changeset 111989:9d22b2a0ae48

Synopsis: Migrate allout encryption provisions from pgg library, which is obsolete, to epg library, which replaces pgg. Due to the underlying GnuPG V2 restrictions on external handling of passphrases (or epg's restrictions when working with GnuPG v2), we are dropping allout's symmetric encryption passphrase hinting and verification. This has the advantage that no emacs code has access to the passphrase, leaving all passphrase handling in GnuPG, which is much more secure. This, together with the reduction in allout code complexity and logistical complications the user would have in arranging to use GnuPG v1, requires dropping these features. Keypair encryption gains features, with adoption of respect for epa-file's 'epa-file-encrypt-to'. This means that allout outlines can be associated with recipients, and encryptions by default will be targeted to those recipients. The default encryption mode (whether to epa-file-encrypt-to recipients, if any, or symmetric mode) is overridden by providing a universal argument greater than 1 to the outline entry encryption command, 'allout-toggle-current-subtree-encryption'. The user is then prompted to select keypair identities from their list of known GnuPG keypairs. If they don't select any, then symmetric encryption is done. Otherwise, the selected keypair identities are targeted. If the universal argument is greater than 4 then the selected recipients (or none, if none were selected) are associated with the outline using a file local variable, as default recipients for subsequent encryptions. This is a big merge from a private branch. Code details: (allout-toggle-current-subtree-encryption, allout-toggle-subtree-encryption): Adjust docstrings to reflect defaulting policy and other changes. Change fetch-pass to keymode-cue, for simpler universal argument interpretation. (allout-toggle-subtree-encryption): Adjust docstring to describe changed encryption provisions. Change fetch-pass to keymode-cue, for simpler universal argument interpretation. Remove provisions for handling key type and identity - they'll all be within allout-encrypt-string or epg/epg or even contained all the way in gpg. (allout-encrypt-string): Include keymode-cue, for optionally prompting for keypair recipients (universal argument > 1) and, in addition, associating the specified recipients with the outline (universal argument > 4) using a file local variable setting for 'epa-file-encrypt-to'. Require epa, for recipients handling. Change how regexp filtering elements are named. Describe the problem with caching of incorrect symmetric-decryption keys. Use the epa-passphrase-callback-function, in case the user is using GnuPG v1. Support saving of the selected keypair recipients when invoked with a keymode-cue > 4. Remove obsolete arguments 'fetch-pass', 'target-cache-id', 'retried'. Require 'epa. Establish epg-context with armoring and default epg-protocol. Remove all passphrase cache, verification, and hinting code. (allout-passphrase-verifier-handling, allout-passphrase-hint-handling): No longer used, delete. (allout-mode): Adjust docstring to describe changed encryption provisions. Describe the problem with caching of incorrect symmetric-decryption keys. (allout-obtain-passphrase, allout-epg-passphrase-callback-function, allout-make-passphrase-state, allout-passphrase-state-passphrase, allout-encrypted-key-info, allout-update-passphrase-mnemonic-aids, allout-get-encryption-passphrase-verifier, allout-verify-passphrase): Obsolete, remove.
author Ken Manheimer <ken.manheimer@gmail.com>
date Thu, 16 Dec 2010 18:30:57 -0500
parents edfb54ff984c (diff) a933a2eaafaf (current diff)
children fd7dd167d6e5
files lisp/allout.el
diffstat 377 files changed, 18544 insertions(+), 11615 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Thu Dec 16 17:43:45 2010 -0500
+++ b/.hgtags	Thu Dec 16 18:30:57 2010 -0500
@@ -1047,6 +1047,7 @@
 d9dee3a4f5d644218faa391a9becc985d7edd73b EMACS_PRETEST_22_0_99
 da06b9bd886b49b1760b5dc93789d29e601b3c27 handa-temp-tag
 da1a2b74d0995400813b93f57028b879948cf24b libc-960913
+da3121d122129d866ab8090fef02f9ac44e31775 EMACS_PRETEST_23_2_90
 de474a770e980291564923dcc0a3acf19d5b7f4d libc-951214
 de474a770e980291564923dcc0a3acf19d5b7f4d libc-951215
 e0aed4d483987dbd9c089db75b5e7fd30623fd28 libc-970717
--- a/ChangeLog	Thu Dec 16 17:43:45 2010 -0500
+++ b/ChangeLog	Thu Dec 16 18:30:57 2010 -0500
@@ -1,3 +1,35 @@
+2010-12-15  Glenn Morris  <rgm@gnu.org>
+
+	* Makefile.in (install-arch-dep, uninstall): Remove code relating to the
+	long absent lib-src/fns-*.el.
+
+2010-12-11  Glenn Morris  <rgm@gnu.org>
+
+	* make-dist: Exclude etc/*.pyc.
+
+2010-12-10  Andreas Schwab  <schwab@linux-m68k.org>
+
+	* configure.in: Don't double machfile in final message.
+
+2010-12-04  Chong Yidong  <cyd@stupidchicken.com>
+
+	* configure.in: Fix last change.
+
+2010-12-04  Andreas Schwab  <schwab@linux-m68k.org>
+
+	* configure.in: Remove reference to removed machine description
+	files and allow $machine and $machfile to be empty.  Substitute
+	M_FILE/S_FILE instead of machfile/opsysfile.
+
+2010-12-03  Glenn Morris  <rgm@gnu.org>
+
+	* make-dist: Remove EMACS_UNIBYTE unsetting; it does nothing.
+
+2010-11-23  Dan Nicolaescu  <dann@ics.uci.edu>
+
+	* configure.in <AC_CHECK_HEADERS>: Remove sys/ioctl.h.
+	(EXTERNALLY_VISIBLE): New definition.
+
 2010-11-21  Dan Nicolaescu  <dann@ics.uci.edu>
 
 	* configure.in (INLINE): Do not depend on OPTIMIZE, unused.
--- a/Makefile.in	Thu Dec 16 17:43:45 2010 -0500
+++ b/Makefile.in	Thu Dec 16 18:30:57 2010 -0500
@@ -424,12 +424,6 @@
 	-chmod 1755 $(DESTDIR)${bindir}/$(EMACSFULL)
 	rm -f $(DESTDIR)${bindir}/$(EMACS)
 	-ln $(DESTDIR)${bindir}/$(EMACSFULL) $(DESTDIR)${bindir}/$(EMACS)
-	-unset CDPATH; \
-	for f in `cd lib-src && echo fns-*.el`; do \
-	  if test -r lib-src/$$f ; then \
-	    ${INSTALL_DATA} lib-src/$$f $(DESTDIR)${archlibdir}/$$f; \
-	  else true; fi ; \
-	done
 	if test "${ns_appresdir}" != ""; then \
 	  ( cd ${ns_appresdir} ; \
 	    if test -d share/emacs ; then dir=share/emacs/*/*; $(MV_DIRS); fi;\
@@ -682,9 +676,6 @@
 	    esac ;					\
 	  fi ;						\
 	done
-	if [ -d $(DESTDIR)${archlibdir} ]; then \
-	  (cd $(DESTDIR)${archlibdir} && rm -f fns-*) \
-	fi
 	-rm -rf $(DESTDIR)${libexecdir}/emacs/${version}
 	(cd $(DESTDIR)${infodir} && \
 	  for elt in $(INFO_FILES); do \
--- a/admin/CPP-DEFINES	Thu Dec 16 17:43:45 2010 -0500
+++ b/admin/CPP-DEFINES	Thu Dec 16 18:30:57 2010 -0500
@@ -62,7 +62,6 @@
 SYSTEM_TYPE
 
 ** Machine specific macros, decribed in detail in src/m/template.h
-EXPLICIT_SIGN_EXTEND
 LOAD_AVE_CVT
 LOAD_AVE_TYPE
 VIRT_ADDR_VARIES
--- a/admin/ChangeLog	Thu Dec 16 17:43:45 2010 -0500
+++ b/admin/ChangeLog	Thu Dec 16 18:30:57 2010 -0500
@@ -1,3 +1,7 @@
+2010-12-03  Andreas Schwab  <schwab@linux-m68k.org>
+
+	* CPP-DEFINES (EXPLICIT_SIGN_EXTEND): Remove.
+
 2010-10-12  Glenn Morris  <rgm@gnu.org>
 
 	* notes/nextstep: Move here from ../nextstep/DEV-NOTES.
--- a/admin/notes/bugtracker	Thu Dec 16 17:43:45 2010 -0500
+++ b/admin/notes/bugtracker	Thu Dec 16 18:30:57 2010 -0500
@@ -475,8 +475,8 @@
 ** Bazaar stuff
 
 *** You can use `bzr commit --fixes debbugs:123' to mark that a commit fixes
-Emacs bug 123.  You will first need to add a line to your ~/bazaar.conf
-or ~/locations.conf:
+Emacs bug 123.  You will first need to add a line to one of your
+configuration files, ~/.bazaar/bazaar.conf or ~/.bazaar/locations.conf:
 
 bugtracker_debbugs_url = http://debbugs.gnu.org/{id}
 
@@ -491,7 +491,7 @@
 configuration section for the branch where you want this to be in
 effect.  For example, if you want this to be in effect for the branch
 located at `/home/projects/emacs/trunk', you need to have this in your
-~/locations.conf file:
+~/.bazaar/locations.conf file:
 
 [/home/projects/emacs/trunk]
 bugtracker_debbugs_url = http://debbugs.gnu.org/{id}
--- a/configure	Thu Dec 16 17:43:45 2010 -0500
+++ b/configure	Thu Dec 16 18:30:57 2010 -0500
@@ -1,11 +1,11 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.65 for emacs 24.0.50.
+# Generated by GNU Autoconf 2.68 for emacs 24.0.50.
 #
 #
 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
-# Inc.
+# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
+# Foundation, Inc.
 #
 #
 # This configure script is free software; the Free Software Foundation
@@ -89,6 +89,7 @@
 IFS=" ""	$as_nl"
 
 # Find who we are.  Look in the path if we contain no directory separator.
+as_myself=
 case $0 in #((
   *[\\/]* ) as_myself=$0 ;;
   *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -214,11 +215,18 @@
   # We cannot yet assume a decent shell, so we have to provide a
 	# neutralization value for shells without unset; and this also
 	# works around shells that cannot unset nonexistent variables.
+	# Preserve -v and -x to the replacement shell.
 	BASH_ENV=/dev/null
 	ENV=/dev/null
 	(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
 	export CONFIG_SHELL
-	exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+	case $- in # ((((
+	  *v*x* | *x*v* ) as_opts=-vx ;;
+	  *v* ) as_opts=-v ;;
+	  *x* ) as_opts=-x ;;
+	  * ) as_opts= ;;
+	esac
+	exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"}
 fi
 
     if test x$as_have_required = xno; then :
@@ -316,7 +324,7 @@
       test -d "$as_dir" && break
     done
     test -z "$as_dirs" || eval "mkdir $as_dirs"
-  } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir"
+  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
 
 
 } # as_fn_mkdir_p
@@ -356,19 +364,19 @@
 fi # as_fn_arith
 
 
-# as_fn_error ERROR [LINENO LOG_FD]
-# ---------------------------------
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
 # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
 # provided, also output the error to LOG_FD, referencing LINENO. Then exit the
-# script with status $?, using 1 if that was 0.
+# script with STATUS, using 1 if that was 0.
 as_fn_error ()
 {
-  as_status=$?; test $as_status -eq 0 && as_status=1
-  if test "$3"; then
-    as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-    $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3
-  fi
-  $as_echo "$as_me: error: $1" >&2
+  as_status=$1; test $as_status -eq 0 && as_status=1
+  if test "$4"; then
+    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+  fi
+  $as_echo "$as_me: error: $2" >&2
   as_fn_exit $as_status
 } # as_fn_error
 
@@ -530,7 +538,7 @@
 exec 6>&1
 
 # Name of the host.
-# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
 # so uname gets run too.
 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
 
@@ -622,8 +630,8 @@
 ns_appresdir
 ns_appbindir
 ns_appdir
-opsysfile
-machfile
+S_FILE
+M_FILE
 X_TOOLKIT_TYPE
 C_SWITCH_X_SYSTEM
 C_SWITCH_X_SITE
@@ -912,8 +920,9 @@
   fi
 
   case $ac_option in
-  *=*)	ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
-  *)	ac_optarg=yes ;;
+  *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+  *=)   ac_optarg= ;;
+  *)    ac_optarg=yes ;;
   esac
 
   # Accept the important Cygnus configure options, so we can diagnose typos.
@@ -958,7 +967,7 @@
     ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
     # Reject names that are not valid shell variable names.
     expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-      as_fn_error "invalid feature name: $ac_useropt"
+      as_fn_error $? "invalid feature name: $ac_useropt"
     ac_useropt_orig=$ac_useropt
     ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
     case $ac_user_opts in
@@ -984,7 +993,7 @@
     ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
     # Reject names that are not valid shell variable names.
     expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-      as_fn_error "invalid feature name: $ac_useropt"
+      as_fn_error $? "invalid feature name: $ac_useropt"
     ac_useropt_orig=$ac_useropt
     ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
     case $ac_user_opts in
@@ -1188,7 +1197,7 @@
     ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
     # Reject names that are not valid shell variable names.
     expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-      as_fn_error "invalid package name: $ac_useropt"
+      as_fn_error $? "invalid package name: $ac_useropt"
     ac_useropt_orig=$ac_useropt
     ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
     case $ac_user_opts in
@@ -1204,7 +1213,7 @@
     ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
     # Reject names that are not valid shell variable names.
     expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-      as_fn_error "invalid package name: $ac_useropt"
+      as_fn_error $? "invalid package name: $ac_useropt"
     ac_useropt_orig=$ac_useropt
     ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
     case $ac_user_opts in
@@ -1234,8 +1243,8 @@
   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
     x_libraries=$ac_optarg ;;
 
-  -*) as_fn_error "unrecognized option: \`$ac_option'
-Try \`$0 --help' for more information."
+  -*) as_fn_error $? "unrecognized option: \`$ac_option'
+Try \`$0 --help' for more information"
     ;;
 
   *=*)
@@ -1243,7 +1252,7 @@
     # Reject names that are not valid shell variable names.
     case $ac_envvar in #(
       '' | [0-9]* | *[!_$as_cr_alnum]* )
-      as_fn_error "invalid variable name: \`$ac_envvar'" ;;
+      as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
     esac
     eval $ac_envvar=\$ac_optarg
     export $ac_envvar ;;
@@ -1253,7 +1262,7 @@
     $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
       $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
-    : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
+    : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
     ;;
 
   esac
@@ -1261,13 +1270,13 @@
 
 if test -n "$ac_prev"; then
   ac_option=--`echo $ac_prev | sed 's/_/-/g'`
-  as_fn_error "missing argument to $ac_option"
+  as_fn_error $? "missing argument to $ac_option"
 fi
 
 if test -n "$ac_unrecognized_opts"; then
   case $enable_option_checking in
     no) ;;
-    fatal) as_fn_error "unrecognized options: $ac_unrecognized_opts" ;;
+    fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
     *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
   esac
 fi
@@ -1290,7 +1299,7 @@
     [\\/$]* | ?:[\\/]* )  continue;;
     NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
   esac
-  as_fn_error "expected an absolute directory name for --$ac_var: $ac_val"
+  as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
 done
 
 # There might be people who depend on the old broken behavior: `$host'
@@ -1304,8 +1313,8 @@
 if test "x$host_alias" != x; then
   if test "x$build_alias" = x; then
     cross_compiling=maybe
-    $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
-    If a cross compiler is detected then cross compile mode will be used." >&2
+    $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host.
+    If a cross compiler is detected then cross compile mode will be used" >&2
   elif test "x$build_alias" != "x$host_alias"; then
     cross_compiling=yes
   fi
@@ -1320,9 +1329,9 @@
 ac_pwd=`pwd` && test -n "$ac_pwd" &&
 ac_ls_di=`ls -di .` &&
 ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
-  as_fn_error "working directory cannot be determined"
+  as_fn_error $? "working directory cannot be determined"
 test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
-  as_fn_error "pwd does not report name of working directory"
+  as_fn_error $? "pwd does not report name of working directory"
 
 
 # Find the source files, if location was not specified.
@@ -1361,11 +1370,11 @@
 fi
 if test ! -r "$srcdir/$ac_unique_file"; then
   test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
-  as_fn_error "cannot find sources ($ac_unique_file) in $srcdir"
+  as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
 fi
 ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
 ac_abs_confdir=`(
-	cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error "$ac_msg"
+	cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
 	pwd)`
 # When building in place, set srcdir=.
 if test "$ac_abs_confdir" = "$ac_pwd"; then
@@ -1405,7 +1414,7 @@
       --help=short        display options specific to this package
       --help=recursive    display the short help of all the included packages
   -V, --version           display version information and exit
-  -q, --quiet, --silent   do not print \`checking...' messages
+  -q, --quiet, --silent   do not print \`checking ...' messages
       --cache-file=FILE   cache test results in FILE [disabled]
   -C, --config-cache      alias for \`--cache-file=config.cache'
   -n, --no-create         do not create output files
@@ -1624,9 +1633,9 @@
 if $ac_init_version; then
   cat <<\_ACEOF
 emacs configure 24.0.50
-generated by GNU Autoconf 2.65
-
-Copyright (C) 2009 Free Software Foundation, Inc.
+generated by GNU Autoconf 2.68
+
+Copyright (C) 2010 Free Software Foundation, Inc.
 This configure script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it.
 _ACEOF
@@ -1670,7 +1679,7 @@
 
 	ac_retval=1
 fi
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
   as_fn_set_status $ac_retval
 
 } # ac_fn_c_try_compile
@@ -1716,7 +1725,7 @@
   # interfere with the next link command; also delete a directory that is
   # left behind by Apple's compiler.  We do this before executing the actions.
   rm -rf conftest.dSYM conftest_ipa8_conftest.oo
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
   as_fn_set_status $ac_retval
 
 } # ac_fn_c_try_link
@@ -1742,7 +1751,7 @@
     mv -f conftest.er1 conftest.err
   fi
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } >/dev/null && {
+  test $ac_status = 0; } > conftest.i && {
 	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        }; then :
@@ -1753,7 +1762,7 @@
 
     ac_retval=1
 fi
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
   as_fn_set_status $ac_retval
 
 } # ac_fn_c_try_cpp
@@ -1766,10 +1775,10 @@
 ac_fn_c_check_header_mongrel ()
 {
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+  if eval \${$3+:} false; then :
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
 $as_echo_n "checking for $2... " >&6; }
-if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+if eval \${$3+:} false; then :
   $as_echo_n "(cached) " >&6
 fi
 eval ac_res=\$$3
@@ -1805,7 +1814,7 @@
 else
   ac_header_preproc=no
 fi
-rm -f conftest.err conftest.$ac_ext
+rm -f conftest.err conftest.i conftest.$ac_ext
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
 $as_echo "$ac_header_preproc" >&6; }
 
@@ -1832,7 +1841,7 @@
 esac
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
 $as_echo_n "checking for $2... " >&6; }
-if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+if eval \${$3+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   eval "$3=\$ac_header_compiler"
@@ -1841,7 +1850,7 @@
 	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
 fi
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
 
 } # ac_fn_c_check_header_mongrel
 
@@ -1882,7 +1891,7 @@
        ac_retval=$ac_status
 fi
   rm -rf conftest.dSYM conftest_ipa8_conftest.oo
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
   as_fn_set_status $ac_retval
 
 } # ac_fn_c_try_run
@@ -1896,7 +1905,7 @@
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
 $as_echo_n "checking for $2... " >&6; }
-if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+if eval \${$3+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -1914,19 +1923,22 @@
 eval ac_res=\$$3
 	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
 
 } # ac_fn_c_check_header_compile
 
-# ac_fn_c_check_decl LINENO SYMBOL VAR
-# ------------------------------------
-# Tests whether SYMBOL is declared, setting cache variable VAR accordingly.
+# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES
+# ---------------------------------------------
+# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR
+# accordingly.
 ac_fn_c_check_decl ()
 {
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $2 is declared" >&5
-$as_echo_n "checking whether $2 is declared... " >&6; }
-if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+  as_decl_name=`echo $2|sed 's/ *(.*//'`
+  as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5
+$as_echo_n "checking whether $as_decl_name is declared... " >&6; }
+if eval \${$3+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -1935,8 +1947,12 @@
 int
 main ()
 {
-#ifndef $2
-  (void) $2;
+#ifndef $as_decl_name
+#ifdef __cplusplus
+  (void) $as_decl_use;
+#else
+  (void) $as_decl_name;
+#endif
 #endif
 
   ;
@@ -1953,7 +1969,7 @@
 eval ac_res=\$$3
 	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
 
 } # ac_fn_c_check_decl
 
@@ -1965,7 +1981,7 @@
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
 $as_echo_n "checking for $2... " >&6; }
-if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+if eval \${$3+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -1977,12 +1993,12 @@
 else
   eval "$3=no"
 fi
-rm -f conftest.err conftest.$ac_ext
+rm -f conftest.err conftest.i conftest.$ac_ext
 fi
 eval ac_res=\$$3
 	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
 
 } # ac_fn_c_check_header_preproc
 
@@ -1995,7 +2011,7 @@
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5
 $as_echo_n "checking for $2.$3... " >&6; }
-if { as_var=$4; eval "test \"\${$as_var+set}\" = set"; }; then :
+if eval \${$4+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -2039,7 +2055,7 @@
 eval ac_res=\$$4
 	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
 
 } # ac_fn_c_check_member
 
@@ -2051,7 +2067,7 @@
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
 $as_echo_n "checking for $2... " >&6; }
-if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+if eval \${$3+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -2106,7 +2122,7 @@
 eval ac_res=\$$3
 	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
 
 } # ac_fn_c_check_func
 
@@ -2119,7 +2135,7 @@
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
 $as_echo_n "checking for $2... " >&6; }
-if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+if eval \${$3+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   eval "$3=no"
@@ -2160,7 +2176,7 @@
 eval ac_res=\$$3
 	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
 
 } # ac_fn_c_check_type
 cat >config.log <<_ACEOF
@@ -2168,7 +2184,7 @@
 running configure, to aid debugging if configure makes a mistake.
 
 It was created by emacs $as_me 24.0.50, which was
-generated by GNU Autoconf 2.65.  Invocation command line was
+generated by GNU Autoconf 2.68.  Invocation command line was
 
   $ $0 $@
 
@@ -2278,11 +2294,9 @@
   {
     echo
 
-    cat <<\_ASBOX
-## ---------------- ##
+    $as_echo "## ---------------- ##
 ## Cache variables. ##
-## ---------------- ##
-_ASBOX
+## ---------------- ##"
     echo
     # The following way of writing the cache mishandles newlines in values,
 (
@@ -2316,11 +2330,9 @@
 )
     echo
 
-    cat <<\_ASBOX
-## ----------------- ##
+    $as_echo "## ----------------- ##
 ## Output variables. ##
-## ----------------- ##
-_ASBOX
+## ----------------- ##"
     echo
     for ac_var in $ac_subst_vars
     do
@@ -2333,11 +2345,9 @@
     echo
 
     if test -n "$ac_subst_files"; then
-      cat <<\_ASBOX
-## ------------------- ##
+      $as_echo "## ------------------- ##
 ## File substitutions. ##
-## ------------------- ##
-_ASBOX
+## ------------------- ##"
       echo
       for ac_var in $ac_subst_files
       do
@@ -2351,11 +2361,9 @@
     fi
 
     if test -s confdefs.h; then
-      cat <<\_ASBOX
-## ----------- ##
+      $as_echo "## ----------- ##
 ## confdefs.h. ##
-## ----------- ##
-_ASBOX
+## ----------- ##"
       echo
       cat confdefs.h
       echo
@@ -2410,7 +2418,12 @@
 ac_site_file1=NONE
 ac_site_file2=NONE
 if test -n "$CONFIG_SITE"; then
-  ac_site_file1=$CONFIG_SITE
+  # We do not want a PATH search for config.site.
+  case $CONFIG_SITE in #((
+    -*)  ac_site_file1=./$CONFIG_SITE;;
+    */*) ac_site_file1=$CONFIG_SITE;;
+    *)   ac_site_file1=./$CONFIG_SITE;;
+  esac
 elif test "x$prefix" != xNONE; then
   ac_site_file1=$prefix/share/config.site
   ac_site_file2=$prefix/etc/config.site
@@ -2425,7 +2438,11 @@
     { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
 $as_echo "$as_me: loading site script $ac_site_file" >&6;}
     sed 's/^/| /' "$ac_site_file" >&5
-    . "$ac_site_file"
+    . "$ac_site_file" \
+      || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "failed to load site script $ac_site_file
+See \`config.log' for more details" "$LINENO" 5; }
   fi
 done
 
@@ -2506,7 +2523,7 @@
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
   { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
-  as_fn_error "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
+  as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
 fi
 ## -------------------- ##
 ## Main body of script. ##
@@ -2680,7 +2697,7 @@
 	    g | gt | gtk  )	val=gtk ;;
 	    gtk3  )	val=gtk3 ;;
 	    * )
-as_fn_error "\`--with-x-toolkit=$withval' is invalid;
+as_fn_error $? "\`--with-x-toolkit=$withval' is invalid;
 this option's value should be \`yes', \`no', \`lucid', \`athena', \`motif', \`gtk' or
 \`gtk3'.  \`yes' and \`gtk' are synonyms. \`athena' and \`lucid' are synonyms." "$LINENO" 5
 	    ;;
@@ -2983,7 +3000,7 @@
 	stringfreelist) ac_gc_check_string_free_list=1 ;;
 	xmallocoverrun)	ac_xmalloc_overrun=1 ;;
 	conslist)	ac_gc_check_cons_list=1 ;;
-	*)	as_fn_error "unknown check category $check" "$LINENO" 5 ;;
+	*)	as_fn_error $? "unknown check category $check" "$LINENO" 5 ;;
 	esac
 done
 IFS="$ac_save_IFS"
@@ -3098,16 +3115,22 @@
 
 ac_aux_dir=
 for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
-  for ac_t in install-sh install.sh shtool; do
-    if test -f "$ac_dir/$ac_t"; then
-      ac_aux_dir=$ac_dir
-      ac_install_sh="$ac_aux_dir/$ac_t -c"
-      break 2
-    fi
-  done
+  if test -f "$ac_dir/install-sh"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install-sh -c"
+    break
+  elif test -f "$ac_dir/install.sh"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install.sh -c"
+    break
+  elif test -f "$ac_dir/shtool"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/shtool install -c"
+    break
+  fi
 done
 if test -z "$ac_aux_dir"; then
-  as_fn_error "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
+  as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
 fi
 
 # These three variables are undocumented and unsupported,
@@ -3121,27 +3144,27 @@
 
 # Make sure we can run config.sub.
 $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
-  as_fn_error "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
+  as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
 $as_echo_n "checking build system type... " >&6; }
-if test "${ac_cv_build+set}" = set; then :
+if ${ac_cv_build+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_build_alias=$build_alias
 test "x$ac_build_alias" = x &&
   ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
 test "x$ac_build_alias" = x &&
-  as_fn_error "cannot guess build type; you must specify one" "$LINENO" 5
+  as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
-  as_fn_error "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
+  as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
 
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
 $as_echo "$ac_cv_build" >&6; }
 case $ac_cv_build in
 *-*-*) ;;
-*) as_fn_error "invalid value of canonical build" "$LINENO" 5;;
+*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
 esac
 build=$ac_cv_build
 ac_save_IFS=$IFS; IFS='-'
@@ -3159,14 +3182,14 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
 $as_echo_n "checking host system type... " >&6; }
-if test "${ac_cv_host+set}" = set; then :
+if ${ac_cv_host+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test "x$host_alias" = x; then
   ac_cv_host=$ac_cv_build
 else
   ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
-    as_fn_error "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
+    as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
 fi
 
 fi
@@ -3174,7 +3197,7 @@
 $as_echo "$ac_cv_host" >&6; }
 case $ac_cv_host in
 *-*-*) ;;
-*) as_fn_error "invalid value of canonical host" "$LINENO" 5;;
+*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
 esac
 host=$ac_cv_host
 ac_save_IFS=$IFS; IFS='-'
@@ -3216,13 +3239,27 @@
 machine='' opsys='' unported=no
 case "${canonical}" in
 
+  ## GNU/Linux ports
+  *-*-linux-gnu*)
+    opsys=gnu-linux
+    case ${canonical} in
+      alpha*)	machine=alpha ;;
+      s390-*)	machine=ibms390 ;;
+      s390x-*)	machine=ibms390x ;;
+      powerpc*)	machine=macppc ;;
+      sparc*)	machine=sparc ;;
+      ia64*)	machine=ia64 ;;
+      m68k*)	machine=m68k ;;
+      x86_64*)	machine=amdx86-64 ;;
+    esac
+  ;;
+
   ## FreeBSD ports
   *-*-freebsd* )
     opsys=freebsd
     case "${canonical}" in
       alpha*)           machine=alpha ;;
       amd64-*|x86_64-*) machine=amdx86-64 ;;
-      arm*)             machine=arm ;;
       ia64-*)           machine=ia64 ;;
       i[3456]86-*)      machine=intel386 ;;
       powerpc-*)        machine=macppc ;;
@@ -3251,13 +3288,9 @@
     case "${canonical}" in
       alpha*)      machine=alpha ;;
       x86_64-*)    machine=amdx86-64 ;;
-      arm-*)       machine=arm ;;
-      hppa-*)      machine=hp800 ;;
       i[3456]86-*) machine=intel386 ;;
       m68k-*)      machine=m68k ;;
       powerpc-*)   machine=macppc ;;
-      mips-*)      machine=mips ;;
-      mipse[bl]-*) machine=mips ;;
       sparc*-)     machine=sparc ;;
       vax-*)       machine=vax ;;
     esac
@@ -3269,8 +3302,6 @@
     case "${canonical}" in
       alpha*)    machine=alpha ;;
       x86_64-*)  machine=amdx86-64 ;;
-      arm-*)     machine=arm ;;
-      hppa-*)    machine=hp800 ;;
       i386-*)    machine=intel386 ;;
       powerpc-*) machine=macppc ;;
       sparc*)    machine=sparc ;;
@@ -3278,14 +3309,6 @@
     esac
   ;;
 
-  alpha*-*-linux-gnu* )
-    machine=alpha opsys=gnu-linux
-  ;;
-
-  arm*-*-linux-gnu* )
-    machine=arm opsys=gnu-linux
-  ;;
-
   ## Apple Darwin / Mac OS X
   *-apple-darwin* )
     case "${canonical}" in
@@ -3307,24 +3330,14 @@
 
   ## HP 9000 series 700 and 800, running HP/UX
   hppa*-hp-hpux10.2* )
-    machine=hp800 opsys=hpux10-20
+    opsys=hpux10-20
   ;;
   hppa*-hp-hpux1[1-9]* )
-    machine=hp800 opsys=hpux11
+    opsys=hpux11
     CFLAGS="-D_INCLUDE__STDC_A1_SOURCE $CFLAGS"
   ;;
 
-  hppa*-*-linux-gnu* )
-    machine=hp800 opsys=gnu-linux
-  ;;
-
   ## IBM machines
-  s390-*-linux-gnu* )
-    machine=ibms390 opsys=gnu-linux
-  ;;
-  s390x-*-linux-gnu* )
-    machine=ibms390x opsys=gnu-linux
-  ;;
   rs6000-ibm-aix4.[23]* )
     machine=ibmrs6000 opsys=aix4-2
   ;;
@@ -3338,11 +3351,6 @@
     machine=ibmrs6000 opsys=aix4-2
   ;;
 
-  ## Macintosh PowerPC
-  powerpc*-*-linux-gnu* )
-    machine=macppc opsys=gnu-linux
-  ;;
-
   ## Silicon Graphics machines
   ## Iris 4D
   mips-sgi-irix6.5 )
@@ -3355,10 +3363,6 @@
   ;;
 
   ## Suns
-  sparc-*-linux-gnu* | sparc64-*-linux-gnu* )
-    machine=sparc opsys=gnu-linux
-  ;;
-
   *-sun-solaris* \
     | i[3456]86-*-solaris2* | i[3456]86-*-sunos5* \
     | x86_64-*-solaris2*    | x86_64-*-sunos5*)
@@ -3398,11 +3402,6 @@
     esac
   ;;
 
-  ## IA-64
-  ia64*-*-linux* )
-    machine=ia64 opsys=gnu-linux
-  ;;
-
   ## Intel 386 machines where we don't care about the manufacturer.
   i[3456]86-*-* )
     machine=intel386
@@ -3411,7 +3410,6 @@
       *-darwin* )               opsys=darwin
                                 CPP="${CC-cc} -E -no-cpp-precomp"
  				;;
-      *-linux-gnu* )		opsys=gnu-linux ;;
       *-sysv4.2uw* )	  	opsys=unixware; NON_GNU_CPP=/lib/cpp ;;
       *-sysv5uw* )	  	opsys=unixware; NON_GNU_CPP=/lib/cpp ;;
       *-sysv5OpenUNIX* )  	opsys=unixware; NON_GNU_CPP=/lib/cpp ;;
@@ -3419,32 +3417,6 @@
     esac
   ;;
 
-  ## m68k Linux-based GNU system
-  m68k-*-linux-gnu* )
-    machine=m68k opsys=gnu-linux
-  ;;
-
-  ## Mips Linux-based GNU system
-  mips-*-linux-gnu* | mipsel-*-linux-gnu* \
-    | mips64-*-linux-gnu* | mips64el-*-linux-gnu* )
-    machine=mips opsys=gnu-linux
-  ;;
-
-  ## AMD x86-64 Linux-based GNU system
-  x86_64-*-linux-gnu* )
-    machine=amdx86-64 opsys=gnu-linux
-  ;;
-
-  ## Tensilica Xtensa Linux-based GNU system
-  xtensa*-*-linux-gnu* )
-    machine=xtensa opsys=gnu-linux
-    ;;
-
-  ## SuperH Linux-based GNU system
-  sh[34]*-*-linux-gnu* )
-    machine=sh3 opsys=gnu-linux
-  ;;
-
   * )
     unported=yes
   ;;
@@ -3468,11 +3440,15 @@
 
 
 if test $unported = yes; then
-  as_fn_error "Emacs hasn't been ported to \`${canonical}' systems.
+  as_fn_error $? "Emacs hasn't been ported to \`${canonical}' systems.
 Check \`etc/MACHINES' for recognized configuration names." "$LINENO" 5
 fi
 
-machfile="m/${machine}.h"
+if test -n "$machine"; then
+  machfile="m/${machine}.h"
+else
+  machfile=
+fi
 opsysfile="s/${opsys}.h"
 
 
@@ -3492,7 +3468,7 @@
 set dummy ${ac_tool_prefix}gcc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then :
+if ${ac_cv_prog_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -3532,7 +3508,7 @@
 set dummy gcc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_CC"; then
@@ -3585,7 +3561,7 @@
 set dummy ${ac_tool_prefix}cc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then :
+if ${ac_cv_prog_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -3625,7 +3601,7 @@
 set dummy cc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then :
+if ${ac_cv_prog_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -3684,7 +3660,7 @@
 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then :
+if ${ac_cv_prog_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -3728,7 +3704,7 @@
 set dummy $ac_prog; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_CC"; then
@@ -3782,8 +3758,8 @@
 
 test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error "no acceptable C compiler found in \$PATH
-See \`config.log' for more details." "$LINENO" 5; }
+as_fn_error $? "no acceptable C compiler found in \$PATH
+See \`config.log' for more details" "$LINENO" 5; }
 
 # Provide some information about the compiler.
 $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
@@ -3897,9 +3873,8 @@
 
 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-{ as_fn_set_status 77
-as_fn_error "C compiler cannot create executables
-See \`config.log' for more details." "$LINENO" 5; }; }
+as_fn_error 77 "C compiler cannot create executables
+See \`config.log' for more details" "$LINENO" 5; }
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
@@ -3941,8 +3916,8 @@
 else
   { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error "cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details." "$LINENO" 5; }
+as_fn_error $? "cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details" "$LINENO" 5; }
 fi
 rm -f conftest conftest$ac_cv_exeext
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
@@ -3999,9 +3974,9 @@
     else
 	{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error "cannot run C compiled programs.
+as_fn_error $? "cannot run C compiled programs.
 If you meant to cross compile, use \`--host'.
-See \`config.log' for more details." "$LINENO" 5; }
+See \`config.log' for more details" "$LINENO" 5; }
     fi
   fi
 fi
@@ -4012,7 +3987,7 @@
 ac_clean_files=$ac_clean_files_save
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
 $as_echo_n "checking for suffix of object files... " >&6; }
-if test "${ac_cv_objext+set}" = set; then :
+if ${ac_cv_objext+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -4052,8 +4027,8 @@
 
 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error "cannot compute suffix of object files: cannot compile
-See \`config.log' for more details." "$LINENO" 5; }
+as_fn_error $? "cannot compute suffix of object files: cannot compile
+See \`config.log' for more details" "$LINENO" 5; }
 fi
 rm -f conftest.$ac_cv_objext conftest.$ac_ext
 fi
@@ -4063,7 +4038,7 @@
 ac_objext=$OBJEXT
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
-if test "${ac_cv_c_compiler_gnu+set}" = set; then :
+if ${ac_cv_c_compiler_gnu+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -4100,7 +4075,7 @@
 ac_save_CFLAGS=$CFLAGS
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
 $as_echo_n "checking whether $CC accepts -g... " >&6; }
-if test "${ac_cv_prog_cc_g+set}" = set; then :
+if ${ac_cv_prog_cc_g+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_save_c_werror_flag=$ac_c_werror_flag
@@ -4178,7 +4153,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
-if test "${ac_cv_prog_cc_c89+set}" = set; then :
+if ${ac_cv_prog_cc_c89+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_cv_prog_cc_c89=no
@@ -4286,7 +4261,7 @@
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using a Sun C compiler" >&5
 $as_echo_n "checking whether we are using a Sun C compiler... " >&6; }
 
-if test "${emacs_cv_sunpro_c+set}" = set; then :
+if ${emacs_cv_sunpro_c+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -4355,7 +4330,7 @@
   CPP=
 fi
 if test -z "$CPP"; then
-  if test "${ac_cv_prog_CPP+set}" = set; then :
+  if ${ac_cv_prog_CPP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
       # Double quotes because CPP needs to be expanded
@@ -4385,7 +4360,7 @@
   # Broken: fails on valid input.
 continue
 fi
-rm -f conftest.err conftest.$ac_ext
+rm -f conftest.err conftest.i conftest.$ac_ext
 
   # OK, works on sane cases.  Now check whether nonexistent headers
   # can be detected and how.
@@ -4401,11 +4376,11 @@
 ac_preproc_ok=:
 break
 fi
-rm -f conftest.err conftest.$ac_ext
+rm -f conftest.err conftest.i conftest.$ac_ext
 
 done
 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
+rm -f conftest.i conftest.err conftest.$ac_ext
 if $ac_preproc_ok; then :
   break
 fi
@@ -4444,7 +4419,7 @@
   # Broken: fails on valid input.
 continue
 fi
-rm -f conftest.err conftest.$ac_ext
+rm -f conftest.err conftest.i conftest.$ac_ext
 
   # OK, works on sane cases.  Now check whether nonexistent headers
   # can be detected and how.
@@ -4460,18 +4435,18 @@
 ac_preproc_ok=:
 break
 fi
-rm -f conftest.err conftest.$ac_ext
+rm -f conftest.err conftest.i conftest.$ac_ext
 
 done
 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
+rm -f conftest.i conftest.err conftest.$ac_ext
 if $ac_preproc_ok; then :
 
 else
   { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error "C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details." "$LINENO" 5; }
+as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details" "$LINENO" 5; }
 fi
 
 ac_ext=c
@@ -4483,7 +4458,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
 $as_echo_n "checking for grep that handles long lines and -e... " >&6; }
-if test "${ac_cv_path_GREP+set}" = set; then :
+if ${ac_cv_path_GREP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -z "$GREP"; then
@@ -4532,7 +4507,7 @@
   done
 IFS=$as_save_IFS
   if test -z "$ac_cv_path_GREP"; then
-    as_fn_error "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+    as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
   fi
 else
   ac_cv_path_GREP=$GREP
@@ -4546,7 +4521,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
 $as_echo_n "checking for egrep... " >&6; }
-if test "${ac_cv_path_EGREP+set}" = set; then :
+if ${ac_cv_path_EGREP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
@@ -4598,7 +4573,7 @@
   done
 IFS=$as_save_IFS
   if test -z "$ac_cv_path_EGREP"; then
-    as_fn_error "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+    as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
   fi
 else
   ac_cv_path_EGREP=$EGREP
@@ -4613,7 +4588,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
 $as_echo_n "checking for ANSI C header files... " >&6; }
-if test "${ac_cv_header_stdc+set}" = set; then :
+if ${ac_cv_header_stdc+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -4730,8 +4705,7 @@
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
 "
-eval as_val=\$$as_ac_Header
-   if test "x$as_val" = x""yes; then :
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
@@ -4743,7 +4717,7 @@
 
 
   ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default"
-if test "x$ac_cv_header_minix_config_h" = x""yes; then :
+if test "x$ac_cv_header_minix_config_h" = xyes; then :
   MINIX=yes
 else
   MINIX=
@@ -4765,7 +4739,7 @@
 
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5
 $as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; }
-if test "${ac_cv_safe_to_define___extensions__+set}" = set; then :
+if ${ac_cv_safe_to_define___extensions__+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -4945,7 +4919,7 @@
   CPP=
 fi
 if test -z "$CPP"; then
-  if test "${ac_cv_prog_CPP+set}" = set; then :
+  if ${ac_cv_prog_CPP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
       # Double quotes because CPP needs to be expanded
@@ -4975,7 +4949,7 @@
   # Broken: fails on valid input.
 continue
 fi
-rm -f conftest.err conftest.$ac_ext
+rm -f conftest.err conftest.i conftest.$ac_ext
 
   # OK, works on sane cases.  Now check whether nonexistent headers
   # can be detected and how.
@@ -4991,11 +4965,11 @@
 ac_preproc_ok=:
 break
 fi
-rm -f conftest.err conftest.$ac_ext
+rm -f conftest.err conftest.i conftest.$ac_ext
 
 done
 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
+rm -f conftest.i conftest.err conftest.$ac_ext
 if $ac_preproc_ok; then :
   break
 fi
@@ -5034,7 +5008,7 @@
   # Broken: fails on valid input.
 continue
 fi
-rm -f conftest.err conftest.$ac_ext
+rm -f conftest.err conftest.i conftest.$ac_ext
 
   # OK, works on sane cases.  Now check whether nonexistent headers
   # can be detected and how.
@@ -5050,18 +5024,18 @@
 ac_preproc_ok=:
 break
 fi
-rm -f conftest.err conftest.$ac_ext
+rm -f conftest.err conftest.i conftest.$ac_ext
 
 done
 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
+rm -f conftest.i conftest.err conftest.$ac_ext
 if $ac_preproc_ok; then :
 
 else
   { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error "C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details." "$LINENO" 5; }
+as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details" "$LINENO" 5; }
 fi
 
 ac_ext=c
@@ -5087,7 +5061,7 @@
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
 $as_echo_n "checking for a BSD-compatible install... " >&6; }
 if test -z "$INSTALL"; then
-if test "${ac_cv_path_install+set}" = set; then :
+if ${ac_cv_path_install+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -5169,7 +5143,7 @@
 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_RANLIB+set}" = set; then :
+if ${ac_cv_prog_RANLIB+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$RANLIB"; then
@@ -5209,7 +5183,7 @@
 set dummy ranlib; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then :
+if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_RANLIB"; then
@@ -5264,7 +5238,7 @@
 ## is running in i386 mode, we can help them out.
 if test "$machine" = "amdx86-64"; then
   ac_fn_c_check_decl "$LINENO" "i386" "ac_cv_have_decl_i386" "$ac_includes_default"
-if test "x$ac_cv_have_decl_i386" = x""yes; then :
+if test "x$ac_cv_have_decl_i386" = xyes; then :
 
 fi
 
@@ -5279,7 +5253,7 @@
 set dummy install-info; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_INSTALL_INFO+set}" = set; then :
+if ${ac_cv_path_INSTALL_INFO+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $INSTALL_INFO in
@@ -5319,7 +5293,7 @@
 set dummy install-info; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_INSTALL_INFO+set}" = set; then :
+if ${ac_cv_path_INSTALL_INFO+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $INSTALL_INFO in
@@ -5359,7 +5333,7 @@
 set dummy install-info; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_INSTALL_INFO+set}" = set; then :
+if ${ac_cv_path_INSTALL_INFO+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $INSTALL_INFO in
@@ -5400,7 +5374,7 @@
 set dummy gzip; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_GZIP_PROG+set}" = set; then :
+if ${ac_cv_path_GZIP_PROG+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $GZIP_PROG in
@@ -5443,7 +5417,7 @@
 set dummy makeinfo; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_MAKEINFO+set}" = set; then :
+if ${ac_cv_path_MAKEINFO+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $MAKEINFO in
@@ -5498,7 +5472,7 @@
   if test "x${with_makeinfo}" = "xno"; then
     MAKEINFO=off
   elif test ! -e $srcdir/info/emacs; then
-    as_fn_error "You do not seem to have makeinfo >= 4.6, and your
+    as_fn_error $? "You do not seem to have makeinfo >= 4.6, and your
 source tree does not seem to have pre-built manuals in the \`info' directory.
 Either install a suitable version of makeinfo, or re-run configure
 with the \`--without-makeinfo' option to build without the manuals. " "$LINENO" 5
@@ -5607,7 +5581,7 @@
 
   gnu-linux)
    ## cpp test was "ifdef __mips__", but presumably this is equivalent...
-   test "$machine" = "mips" && LD_SWITCH_SYSTEM="-G 0"
+   case $host_cpu in mips*) LD_SWITCH_SYSTEM="-G 0";; esac
    ;;
 
   netbsd)
@@ -5644,7 +5618,7 @@
 C_SWITCH_MACHINE=
 if test "$machine" = "alpha"; then
   ac_fn_c_check_decl "$LINENO" "__ELF__" "ac_cv_have_decl___ELF__" "$ac_includes_default"
-if test "x$ac_cv_have_decl___ELF__" = x""yes; then :
+if test "x$ac_cv_have_decl___ELF__" = xyes; then :
 
 fi
 
@@ -5657,7 +5631,7 @@
     if test "x$GCC" = "xyes"; then
       C_SWITCH_MACHINE="-fno-common"
     else
-      as_fn_error "What gives?  Fix me if DEC Unix supports ELF now." "$LINENO" 5
+      as_fn_error $? "What gives?  Fix me if DEC Unix supports ELF now." "$LINENO" 5
     fi
   else
     UNEXEC_OBJ=unexalpha.o
@@ -5714,7 +5688,7 @@
 
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5
 $as_echo_n "checking for special C compiler options needed for large files... " >&6; }
-if test "${ac_cv_sys_largefile_CC+set}" = set; then :
+if ${ac_cv_sys_largefile_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_cv_sys_largefile_CC=no
@@ -5765,7 +5739,7 @@
 
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5
 $as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; }
-if test "${ac_cv_sys_file_offset_bits+set}" = set; then :
+if ${ac_cv_sys_file_offset_bits+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   while :; do
@@ -5834,7 +5808,7 @@
   if test $ac_cv_sys_file_offset_bits = unknown; then
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5
 $as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; }
-if test "${ac_cv_sys_large_files+set}" = set; then :
+if ${ac_cv_sys_large_files+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   while :; do
@@ -5935,7 +5909,7 @@
   ## Some platforms don't use any of these files, so it is not
   ## appropriate to put this test outside the if block.
   test -e $CRT_DIR/crtn.o || test -e $CRT_DIR/crt0.o || \
-    as_fn_error "crt*.o not found in specified location." "$LINENO" 5
+    as_fn_error $? "crt*.o not found in specified location." "$LINENO" 5
 
 fi
 
@@ -5990,8 +5964,7 @@
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-eval as_val=\$$as_ac_Header
-   if test "x$as_val" = x""yes; then :
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
@@ -6003,7 +5976,7 @@
   # Emulation library used on NetBSD.
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _oss_ioctl in -lossaudio" >&5
 $as_echo_n "checking for _oss_ioctl in -lossaudio... " >&6; }
-if test "${ac_cv_lib_ossaudio__oss_ioctl+set}" = set; then :
+if ${ac_cv_lib_ossaudio__oss_ioctl+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -6037,7 +6010,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ossaudio__oss_ioctl" >&5
 $as_echo "$ac_cv_lib_ossaudio__oss_ioctl" >&6; }
-if test "x$ac_cv_lib_ossaudio__oss_ioctl" = x""yes; then :
+if test "x$ac_cv_lib_ossaudio__oss_ioctl" = xyes; then :
   LIBSOUND=-lossaudio
 else
   LIBSOUND=
@@ -6054,7 +6027,7 @@
 set dummy pkg-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
+if ${ac_cv_path_PKG_CONFIG+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $PKG_CONFIG in
@@ -6182,7 +6155,7 @@
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
       if test "$emacs_alsa_subdir" != yes; then
-        as_fn_error "pkg-config found alsa, but it does not compile.  See config.log for error messages." "$LINENO" 5
+        as_fn_error $? "pkg-config found alsa, but it does not compile.  See config.log for error messages." "$LINENO" 5
       fi
       ALSA_CFLAGS="$ALSA_CFLAGS -DALSA_SUBDIR_INCLUDE"
     fi
@@ -6217,8 +6190,7 @@
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-eval as_val=\$$as_ac_Header
-   if test "x$as_val" = x""yes; then :
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
@@ -6259,7 +6231,7 @@
 for ac_header in term.h
 do :
   ac_fn_c_check_header_preproc "$LINENO" "term.h" "ac_cv_header_term_h"
-if test "x$ac_cv_header_term_h" = x""yes; then :
+if test "x$ac_cv_header_term_h" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_TERM_H 1
 _ACEOF
@@ -6270,7 +6242,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
 $as_echo_n "checking for ANSI C header files... " >&6; }
-if test "${ac_cv_header_stdc+set}" = set; then :
+if ${ac_cv_header_stdc+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -6382,7 +6354,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5
 $as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; }
-if test "${ac_cv_header_time+set}" = set; then :
+if ${ac_cv_header_time+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -6416,7 +6388,7 @@
 fi
 
 ac_fn_c_check_decl "$LINENO" "sys_siglist" "ac_cv_have_decl_sys_siglist" "$ac_includes_default"
-if test "x$ac_cv_have_decl_sys_siglist" = x""yes; then :
+if test "x$ac_cv_have_decl_sys_siglist" = xyes; then :
   ac_have_decl=1
 else
   ac_have_decl=0
@@ -6429,7 +6401,7 @@
 if test $ac_cv_have_decl_sys_siglist != yes; then
   # For Tru64, at least:
   ac_fn_c_check_decl "$LINENO" "__sys_siglist" "ac_cv_have_decl___sys_siglist" "$ac_includes_default"
-if test "x$ac_cv_have_decl___sys_siglist" = x""yes; then :
+if test "x$ac_cv_have_decl___sys_siglist" = xyes; then :
   ac_have_decl=1
 else
   ac_have_decl=0
@@ -6447,7 +6419,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sys/wait.h that is POSIX.1 compatible" >&5
 $as_echo_n "checking for sys/wait.h that is POSIX.1 compatible... " >&6; }
-if test "${ac_cv_header_sys_wait_h+set}" = set; then :
+if ${ac_cv_header_sys_wait_h+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -6489,7 +6461,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct utimbuf" >&5
 $as_echo_n "checking for struct utimbuf... " >&6; }
-if test "${emacs_cv_struct_utimbuf+set}" = set; then :
+if ${emacs_cv_struct_utimbuf+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -6532,7 +6504,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5
 $as_echo_n "checking return type of signal handlers... " >&6; }
-if test "${ac_cv_type_signal+set}" = set; then :
+if ${ac_cv_type_signal+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -6566,7 +6538,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for speed_t" >&5
 $as_echo_n "checking for speed_t... " >&6; }
-if test "${emacs_cv_speed_t+set}" = set; then :
+if ${emacs_cv_speed_t+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -6597,7 +6569,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timeval" >&5
 $as_echo_n "checking for struct timeval... " >&6; }
-if test "${emacs_cv_struct_timeval+set}" = set; then :
+if ${emacs_cv_struct_timeval+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -6638,7 +6610,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct exception" >&5
 $as_echo_n "checking for struct exception... " >&6; }
-if test "${emacs_cv_struct_exception+set}" = set; then :
+if ${emacs_cv_struct_exception+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -6671,7 +6643,7 @@
 for ac_header in sys/socket.h
 do :
   ac_fn_c_check_header_mongrel "$LINENO" "sys/socket.h" "ac_cv_header_sys_socket_h" "$ac_includes_default"
-if test "x$ac_cv_header_sys_socket_h" = x""yes; then :
+if test "x$ac_cv_header_sys_socket_h" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_SYS_SOCKET_H 1
 _ACEOF
@@ -6687,7 +6659,7 @@
 #include <sys/socket.h>
 #endif
 "
-if test "x$ac_cv_header_net_if_h" = x""yes; then :
+if test "x$ac_cv_header_net_if_h" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_NET_IF_H 1
 _ACEOF
@@ -6699,7 +6671,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5
 $as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; }
-if test "${ac_cv_struct_tm+set}" = set; then :
+if ${ac_cv_struct_tm+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -6736,7 +6708,7 @@
 #include <$ac_cv_struct_tm>
 
 "
-if test "x$ac_cv_member_struct_tm_tm_zone" = x""yes; then :
+if test "x$ac_cv_member_struct_tm_tm_zone" = xyes; then :
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_STRUCT_TM_TM_ZONE 1
@@ -6752,7 +6724,7 @@
 else
   ac_fn_c_check_decl "$LINENO" "tzname" "ac_cv_have_decl_tzname" "#include <time.h>
 "
-if test "x$ac_cv_have_decl_tzname" = x""yes; then :
+if test "x$ac_cv_have_decl_tzname" = xyes; then :
   ac_have_decl=1
 else
   ac_have_decl=0
@@ -6764,7 +6736,7 @@
 
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tzname" >&5
 $as_echo_n "checking for tzname... " >&6; }
-if test "${ac_cv_var_tzname+set}" = set; then :
+if ${ac_cv_var_tzname+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -6801,7 +6773,7 @@
 
 ac_fn_c_check_member "$LINENO" "struct tm" "tm_gmtoff" "ac_cv_member_struct_tm_tm_gmtoff" "#include <time.h>
 "
-if test "x$ac_cv_member_struct_tm_tm_gmtoff" = x""yes; then :
+if test "x$ac_cv_member_struct_tm_tm_gmtoff" = xyes; then :
 
 $as_echo "#define HAVE_TM_GMTOFF 1" >>confdefs.h
 
@@ -6815,7 +6787,7 @@
 #include <net/if.h>
 #endif
 "
-if test "x$ac_cv_member_struct_ifreq_ifr_flags" = x""yes; then :
+if test "x$ac_cv_member_struct_ifreq_ifr_flags" = xyes; then :
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_STRUCT_IFREQ_IFR_FLAGS 1
@@ -6831,7 +6803,7 @@
 #include <net/if.h>
 #endif
 "
-if test "x$ac_cv_member_struct_ifreq_ifr_hwaddr" = x""yes; then :
+if test "x$ac_cv_member_struct_ifreq_ifr_hwaddr" = xyes; then :
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_STRUCT_IFREQ_IFR_HWADDR 1
@@ -6847,7 +6819,7 @@
 #include <net/if.h>
 #endif
 "
-if test "x$ac_cv_member_struct_ifreq_ifr_netmask" = x""yes; then :
+if test "x$ac_cv_member_struct_ifreq_ifr_netmask" = xyes; then :
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_STRUCT_IFREQ_IFR_NETMASK 1
@@ -6863,7 +6835,7 @@
 #include <net/if.h>
 #endif
 "
-if test "x$ac_cv_member_struct_ifreq_ifr_broadaddr" = x""yes; then :
+if test "x$ac_cv_member_struct_ifreq_ifr_broadaddr" = xyes; then :
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_STRUCT_IFREQ_IFR_BROADADDR 1
@@ -6879,7 +6851,7 @@
 #include <net/if.h>
 #endif
 "
-if test "x$ac_cv_member_struct_ifreq_ifr_addr" = x""yes; then :
+if test "x$ac_cv_member_struct_ifreq_ifr_addr" = xyes; then :
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_STRUCT_IFREQ_IFR_ADDR 1
@@ -6908,7 +6880,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working volatile" >&5
 $as_echo_n "checking for working volatile... " >&6; }
-if test "${ac_cv_c_volatile+set}" = set; then :
+if ${ac_cv_c_volatile+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -6942,7 +6914,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5
 $as_echo_n "checking for an ANSI C-conforming const... " >&6; }
-if test "${ac_cv_c_const+set}" = set; then :
+if ${ac_cv_c_const+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -7022,7 +6994,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for void * support" >&5
 $as_echo_n "checking for void * support... " >&6; }
-if test "${emacs_cv_void_star+set}" = set; then :
+if ${emacs_cv_void_star+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -7055,7 +7027,7 @@
 
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
 $as_echo_n "checking whether byte ordering is bigendian... " >&6; }
-if test "${ac_cv_c_bigendian+set}" = set; then :
+if ${ac_cv_c_bigendian+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_cv_c_bigendian=unknown
@@ -7273,7 +7245,7 @@
 
      ;; #(
    *)
-     as_fn_error "unknown endianness
+     as_fn_error $? "unknown endianness
  presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
  esac
 
@@ -7282,7 +7254,7 @@
 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
 set x ${MAKE-make}
 ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
-if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then :
+if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat >conftest.make <<\_ACEOF
@@ -7290,7 +7262,7 @@
 all:
 	@echo '@@@%%%=$(MAKE)=@@@%%%'
 _ACEOF
-# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
 case `${MAKE-make} -f conftest.make 2>/dev/null` in
   *@@@%%%=?*=@@@%%%*)
     eval ac_cv_prog_make_${ac_make}_set=yes;;
@@ -7370,7 +7342,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for long file names" >&5
 $as_echo_n "checking for long file names... " >&6; }
-if test "${ac_cv_sys_long_file_names+set}" = set; then :
+if ${ac_cv_sys_long_file_names+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_cv_sys_long_file_names=yes
@@ -7426,8 +7398,8 @@
   have_x=disabled
 else
   case $x_includes,$x_libraries in #(
-    *\'*) as_fn_error "cannot use X directory names containing '" "$LINENO" 5;; #(
-    *,NONE | NONE,*) if test "${ac_cv_have_x+set}" = set; then :
+    *\'*) as_fn_error $? "cannot use X directory names containing '" "$LINENO" 5;; #(
+    *,NONE | NONE,*) if ${ac_cv_have_x+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   # One or both of the vars are not set, and there is no cached value.
@@ -7444,7 +7416,7 @@
 	@echo libdir='${LIBDIR}'
 _ACEOF
   if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then
-    # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+    # GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
     for ac_var in incroot usrlibdir libdir; do
       eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`"
     done
@@ -7530,7 +7502,7 @@
   fi
 done
 fi
-rm -f conftest.err conftest.$ac_ext
+rm -f conftest.err conftest.i conftest.$ac_ext
 fi # $ac_x_includes = no
 
 if test "$ac_x_libraries" = no; then
@@ -7710,10 +7682,10 @@
      TEMACS_LDFLAGS2=
   fi
   ac_fn_c_check_header_mongrel "$LINENO" "AppKit/AppKit.h" "ac_cv_header_AppKit_AppKit_h" "$ac_includes_default"
-if test "x$ac_cv_header_AppKit_AppKit_h" = x""yes; then :
+if test "x$ac_cv_header_AppKit_AppKit_h" = xyes; then :
   HAVE_NS=yes
 else
-  as_fn_error "\`--with-ns' was specified, but the include
+  as_fn_error $? "\`--with-ns' was specified, but the include
   files are missing or cannot be compiled." "$LINENO" 5
 fi
 
@@ -7792,7 +7764,7 @@
 set dummy X; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_HAVE_XSERVER+set}" = set; then :
+if ${ac_cv_prog_HAVE_XSERVER+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$HAVE_XSERVER"; then
@@ -7829,7 +7801,7 @@
    if test "$HAVE_XSERVER" = true ||
       test -n "$DISPLAY" ||
       test "`echo /usr/lib/libX11.*`" != "/usr/lib/libX11.*"; then
-        as_fn_error "You seem to be running X, but no X development libraries
+        as_fn_error $? "You seem to be running X, but no X development libraries
 were found.  You should install the relevant development files for X
 and for the toolkit you want, such as Gtk+, Lesstif or Motif.  Also make
 sure you have development files for image handling, i.e.
@@ -7851,14 +7823,14 @@
 GNU_MALLOC=yes
 doug_lea_malloc=yes
 ac_fn_c_check_func "$LINENO" "malloc_get_state" "ac_cv_func_malloc_get_state"
-if test "x$ac_cv_func_malloc_get_state" = x""yes; then :
+if test "x$ac_cv_func_malloc_get_state" = xyes; then :
 
 else
   doug_lea_malloc=no
 fi
 
 ac_fn_c_check_func "$LINENO" "malloc_set_state" "ac_cv_func_malloc_set_state"
-if test "x$ac_cv_func_malloc_set_state" = x""yes; then :
+if test "x$ac_cv_func_malloc_set_state" = xyes; then :
 
 else
   doug_lea_malloc=no
@@ -7866,7 +7838,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether __after_morecore_hook exists" >&5
 $as_echo_n "checking whether __after_morecore_hook exists... " >&6; }
-if test "${emacs_cv_var___after_morecore_hook+set}" = set; then :
+if ${emacs_cv_var___after_morecore_hook+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -7952,8 +7924,7 @@
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
 "
-eval as_val=\$$as_ac_Header
-   if test "x$as_val" = x""yes; then :
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
@@ -7972,7 +7943,7 @@
 for ac_func in getpagesize
 do :
   ac_fn_c_check_func "$LINENO" "getpagesize" "ac_cv_func_getpagesize"
-if test "x$ac_cv_func_getpagesize" = x""yes; then :
+if test "x$ac_cv_func_getpagesize" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_GETPAGESIZE 1
 _ACEOF
@@ -7982,7 +7953,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working mmap" >&5
 $as_echo_n "checking for working mmap... " >&6; }
-if test "${ac_cv_func_mmap_fixed_mapped+set}" = set; then :
+if ${ac_cv_func_mmap_fixed_mapped+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then :
@@ -8059,6 +8030,7 @@
 main ()
 {
   char *data, *data2, *data3;
+  const char *cdata2;
   int i, pagesize;
   int fd, fd2;
 
@@ -8083,10 +8055,10 @@
   fd2 = open ("conftest.txt", O_RDWR | O_CREAT | O_TRUNC, 0600);
   if (fd2 < 0)
     return 4;
-  data2 = "";
-  if (write (fd2, data2, 1) != 1)
+  cdata2 = "";
+  if (write (fd2, cdata2, 1) != 1)
     return 5;
-  data2 = mmap (0, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd2, 0L);
+  data2 = (char *) mmap (0, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd2, 0L);
   if (data2 == MAP_FAILED)
     return 6;
   for (i = 0; i < pagesize; ++i)
@@ -8156,7 +8128,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet" >&5
 $as_echo_n "checking for dnet_ntoa in -ldnet... " >&6; }
-if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then :
+if ${ac_cv_lib_dnet_dnet_ntoa+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -8190,7 +8162,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
 $as_echo "$ac_cv_lib_dnet_dnet_ntoa" >&6; }
-if test "x$ac_cv_lib_dnet_dnet_ntoa" = x""yes; then :
+if test "x$ac_cv_lib_dnet_dnet_ntoa" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBDNET 1
 _ACEOF
@@ -8202,7 +8174,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lXbsd" >&5
 $as_echo_n "checking for main in -lXbsd... " >&6; }
-if test "${ac_cv_lib_Xbsd_main+set}" = set; then :
+if ${ac_cv_lib_Xbsd_main+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -8230,14 +8202,14 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xbsd_main" >&5
 $as_echo "$ac_cv_lib_Xbsd_main" >&6; }
-if test "x$ac_cv_lib_Xbsd_main" = x""yes; then :
+if test "x$ac_cv_lib_Xbsd_main" = xyes; then :
   LD_SWITCH_X_SITE="$LD_SWITCH_X_SITE -lXbsd"
 fi
 
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cma_open in -lpthreads" >&5
 $as_echo_n "checking for cma_open in -lpthreads... " >&6; }
-if test "${ac_cv_lib_pthreads_cma_open+set}" = set; then :
+if ${ac_cv_lib_pthreads_cma_open+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -8271,7 +8243,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthreads_cma_open" >&5
 $as_echo "$ac_cv_lib_pthreads_cma_open" >&6; }
-if test "x$ac_cv_lib_pthreads_cma_open" = x""yes; then :
+if test "x$ac_cv_lib_pthreads_cma_open" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBPTHREADS 1
 _ACEOF
@@ -8298,7 +8270,7 @@
 aix*)
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -bbigtoc option" >&5
 $as_echo_n "checking for -bbigtoc option... " >&6; }
-if test "${gdb_cv_bigtoc+set}" = set; then :
+if ${gdb_cv_bigtoc+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
@@ -8459,8 +8431,7 @@
 do :
   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-eval as_val=\$$as_ac_var
-   if test "x$as_val" = x""yes; then :
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
@@ -8473,7 +8444,7 @@
 if test "${window_system}" = "x11"; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking X11 version 6" >&5
 $as_echo_n "checking X11 version 6... " >&6; }
-  if test "${emacs_cv_x11_version_6+set}" = set; then :
+  if ${emacs_cv_x11_version_6+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -8538,7 +8509,7 @@
 set dummy pkg-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
+if ${ac_cv_path_PKG_CONFIG+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $PKG_CONFIG in
@@ -8649,7 +8620,7 @@
 set dummy pkg-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
+if ${ac_cv_path_PKG_CONFIG+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $PKG_CONFIG in
@@ -8748,7 +8719,7 @@
       for ac_func in MagickExportImagePixels
 do :
   ac_fn_c_check_func "$LINENO" "MagickExportImagePixels" "ac_cv_func_MagickExportImagePixels"
-if test "x$ac_cv_func_MagickExportImagePixels" = x""yes; then :
+if test "x$ac_cv_func_MagickExportImagePixels" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_MAGICKEXPORTIMAGEPIXELS 1
 _ACEOF
@@ -8774,7 +8745,7 @@
 set dummy pkg-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
+if ${ac_cv_path_PKG_CONFIG+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $PKG_CONFIG in
@@ -8862,7 +8833,7 @@
   fi
 
   if test "$pkg_check_gtk" = "no" && test "$USE_X_TOOLKIT" != "maybe"; then
-     as_fn_error "$GTK_PKG_ERRORS" "$LINENO" 5
+     as_fn_error $? "$GTK_PKG_ERRORS" "$LINENO" 5
   fi
 fi
 
@@ -8880,7 +8851,7 @@
 set dummy pkg-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
+if ${ac_cv_path_PKG_CONFIG+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $PKG_CONFIG in
@@ -8968,7 +8939,7 @@
   fi
 
   if test "$pkg_check_gtk" = "no" && test "$USE_X_TOOLKIT" != "maybe"; then
-     as_fn_error "$GTK_PKG_ERRORS" "$LINENO" 5
+     as_fn_error $? "$GTK_PKG_ERRORS" "$LINENO" 5
   fi
 fi
 fi
@@ -8985,7 +8956,7 @@
   for ac_func in gtk_main
 do :
   ac_fn_c_check_func "$LINENO" "gtk_main" "ac_cv_func_gtk_main"
-if test "x$ac_cv_func_gtk_main" = x""yes; then :
+if test "x$ac_cv_func_gtk_main" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_GTK_MAIN 1
 _ACEOF
@@ -8995,7 +8966,7 @@
 
   if test "${GTK_COMPILES}" != "yes"; then
     if test "$USE_X_TOOLKIT" != "maybe"; then
-      as_fn_error "Gtk+ wanted, but it does not compile, see config.log.  Maybe some x11-devel files missing?" "$LINENO" 5;
+      as_fn_error $? "Gtk+ wanted, but it does not compile, see config.log.  Maybe some x11-devel files missing?" "$LINENO" 5;
     fi
   else
     HAVE_GTK=yes
@@ -9033,7 +9004,7 @@
   ac_fn_c_check_decl "$LINENO" "GTK_TYPE_FILE_SELECTION" "ac_cv_have_decl_GTK_TYPE_FILE_SELECTION" "$ac_includes_default
 #include <gtk/gtk.h>
 "
-if test "x$ac_cv_have_decl_GTK_TYPE_FILE_SELECTION" = x""yes; then :
+if test "x$ac_cv_have_decl_GTK_TYPE_FILE_SELECTION" = xyes; then :
   HAVE_GTK_FILE_SELECTION=yes
 else
   HAVE_GTK_FILE_SELECTION=no
@@ -9043,7 +9014,7 @@
     for ac_func in gtk_file_selection_new
 do :
   ac_fn_c_check_func "$LINENO" "gtk_file_selection_new" "ac_cv_func_gtk_file_selection_new"
-if test "x$ac_cv_func_gtk_file_selection_new" = x""yes; then :
+if test "x$ac_cv_func_gtk_file_selection_new" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_GTK_FILE_SELECTION_NEW 1
 _ACEOF
@@ -9057,7 +9028,7 @@
     for ac_header in pthread.h
 do :
   ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default"
-if test "x$ac_cv_header_pthread_h" = x""yes; then :
+if test "x$ac_cv_header_pthread_h" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_PTHREAD_H 1
 _ACEOF
@@ -9069,7 +9040,7 @@
     if test "$ac_cv_header_pthread_h"; then
       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_self in -lpthread" >&5
 $as_echo_n "checking for pthread_self in -lpthread... " >&6; }
-if test "${ac_cv_lib_pthread_pthread_self+set}" = set; then :
+if ${ac_cv_lib_pthread_pthread_self+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -9103,7 +9074,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_self" >&5
 $as_echo "$ac_cv_lib_pthread_pthread_self" >&6; }
-if test "x$ac_cv_lib_pthread_pthread_self" = x""yes; then :
+if test "x$ac_cv_lib_pthread_pthread_self" = xyes; then :
   HAVE_GTK_AND_PTHREAD=yes
 fi
 
@@ -9125,8 +9096,7 @@
 do :
   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-eval as_val=\$$as_ac_var
-   if test "x$as_val" = x""yes; then :
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
@@ -9147,7 +9117,7 @@
 set dummy pkg-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
+if ${ac_cv_path_PKG_CONFIG+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $PKG_CONFIG in
@@ -9242,7 +9212,7 @@
      for ac_func in dbus_watch_get_unix_fd
 do :
   ac_fn_c_check_func "$LINENO" "dbus_watch_get_unix_fd" "ac_cv_func_dbus_watch_get_unix_fd"
-if test "x$ac_cv_func_dbus_watch_get_unix_fd" = x""yes; then :
+if test "x$ac_cv_func_dbus_watch_get_unix_fd" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_DBUS_WATCH_GET_UNIX_FD 1
 _ACEOF
@@ -9264,7 +9234,7 @@
 set dummy pkg-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
+if ${ac_cv_path_PKG_CONFIG+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $PKG_CONFIG in
@@ -9358,7 +9328,7 @@
             for ac_func in g_type_init
 do :
   ac_fn_c_check_func "$LINENO" "g_type_init" "ac_cv_func_g_type_init"
-if test "x$ac_cv_func_g_type_init" = x""yes; then :
+if test "x$ac_cv_func_g_type_init" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_G_TYPE_INIT 1
 _ACEOF
@@ -9374,7 +9344,7 @@
 if test "${with_selinux}" = "yes"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lgetfilecon in -lselinux" >&5
 $as_echo_n "checking for lgetfilecon in -lselinux... " >&6; }
-if test "${ac_cv_lib_selinux_lgetfilecon+set}" = set; then :
+if ${ac_cv_lib_selinux_lgetfilecon+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -9408,7 +9378,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_selinux_lgetfilecon" >&5
 $as_echo "$ac_cv_lib_selinux_lgetfilecon" >&6; }
-if test "x$ac_cv_lib_selinux_lgetfilecon" = x""yes; then :
+if test "x$ac_cv_lib_selinux_lgetfilecon" = xyes; then :
   HAVE_LIBSELINUX=yes
 else
   HAVE_LIBSELINUX=no
@@ -9432,7 +9402,7 @@
 set dummy pkg-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
+if ${ac_cv_path_PKG_CONFIG+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $PKG_CONFIG in
@@ -9534,7 +9504,7 @@
   if test "$with_xaw3d" != no; then
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xaw3d" >&5
 $as_echo_n "checking for xaw3d... " >&6; }
-    if test "${emacs_cv_xaw3d+set}" = set; then :
+    if ${emacs_cv_xaw3d+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -9576,7 +9546,7 @@
 $as_echo "no" >&6; }
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libXaw" >&5
 $as_echo_n "checking for libXaw... " >&6; }
-    if test "${emacs_cv_xaw+set}" = set; then :
+    if ${emacs_cv_xaw+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -9607,7 +9577,7 @@
       USE_X_TOOLKIT=LUCID
       LUCID_LIBW=-lXaw
     elif test x"${USE_X_TOOLKIT}" = xLUCID; then
-      as_fn_error "Lucid toolkit requires X11/Xaw include files" "$LINENO" 5
+      as_fn_error $? "Lucid toolkit requires X11/Xaw include files" "$LINENO" 5
     else
       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no; do not use toolkit by default" >&5
 $as_echo "no; do not use toolkit by default" >&6; }
@@ -9622,7 +9592,7 @@
 if test "${USE_X_TOOLKIT}" != "none"; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking X11 toolkit version" >&5
 $as_echo_n "checking X11 toolkit version... " >&6; }
-  if test "${emacs_cv_x11_toolkit_version_6+set}" = set; then :
+  if ${emacs_cv_x11_toolkit_version_6+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -9673,7 +9643,7 @@
   fi
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XmuConvertStandardSelection in -lXmu" >&5
 $as_echo_n "checking for XmuConvertStandardSelection in -lXmu... " >&6; }
-if test "${ac_cv_lib_Xmu_XmuConvertStandardSelection+set}" = set; then :
+if ${ac_cv_lib_Xmu_XmuConvertStandardSelection+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -9707,7 +9677,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xmu_XmuConvertStandardSelection" >&5
 $as_echo "$ac_cv_lib_Xmu_XmuConvertStandardSelection" >&6; }
-if test "x$ac_cv_lib_Xmu_XmuConvertStandardSelection" = x""yes; then :
+if test "x$ac_cv_lib_Xmu_XmuConvertStandardSelection" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBXMU 1
 _ACEOF
@@ -9721,8 +9691,8 @@
 
 
 LIBXMU=-lXmu
-case "$machine" in
-  ## These machines don't supply Xmu.
+case $opsys in
+  ## These systems don't supply Xmu.
   hpux* | aix4-2 )
     test "X$ac_cv_lib_Xmu_XmuConvertStandardSelection" != "Xyes" && LIBXMU=
     ;;
@@ -9734,7 +9704,7 @@
   if test "${USE_X_TOOLKIT}" != "none"; then
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XShapeQueryExtension in -lXext" >&5
 $as_echo_n "checking for XShapeQueryExtension in -lXext... " >&6; }
-if test "${ac_cv_lib_Xext_XShapeQueryExtension+set}" = set; then :
+if ${ac_cv_lib_Xext_XShapeQueryExtension+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -9768,7 +9738,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xext_XShapeQueryExtension" >&5
 $as_echo "$ac_cv_lib_Xext_XShapeQueryExtension" >&6; }
-if test "x$ac_cv_lib_Xext_XShapeQueryExtension" = x""yes; then :
+if test "x$ac_cv_lib_Xext_XShapeQueryExtension" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBXEXT 1
 _ACEOF
@@ -9784,7 +9754,7 @@
 if test "${USE_X_TOOLKIT}" = "MOTIF"; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Motif version 2.1" >&5
 $as_echo_n "checking for Motif version 2.1... " >&6; }
-if test "${emacs_cv_motif_version_2_1+set}" = set; then :
+if ${emacs_cv_motif_version_2_1+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -9814,7 +9784,7 @@
   if test $emacs_cv_motif_version_2_1 = yes; then
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XpCreateContext in -lXp" >&5
 $as_echo_n "checking for XpCreateContext in -lXp... " >&6; }
-if test "${ac_cv_lib_Xp_XpCreateContext+set}" = set; then :
+if ${ac_cv_lib_Xp_XpCreateContext+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -9848,14 +9818,14 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xp_XpCreateContext" >&5
 $as_echo "$ac_cv_lib_Xp_XpCreateContext" >&6; }
-if test "x$ac_cv_lib_Xp_XpCreateContext" = x""yes; then :
+if test "x$ac_cv_lib_Xp_XpCreateContext" = xyes; then :
   LIBXP=-lXp
 fi
 
   else
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LessTif where some systems put it" >&5
 $as_echo_n "checking for LessTif where some systems put it... " >&6; }
-if test "${emacs_cv_lesstif+set}" = set; then :
+if ${emacs_cv_lesstif+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   # We put this in CFLAGS temporarily to precede other -I options
@@ -10014,7 +9984,7 @@
 set dummy pkg-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
+if ${ac_cv_path_PKG_CONFIG+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $PKG_CONFIG in
@@ -10116,7 +10086,7 @@
 set dummy pkg-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
+if ${ac_cv_path_PKG_CONFIG+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $PKG_CONFIG in
@@ -10208,7 +10178,7 @@
       HAVE_XRENDER=no
       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XRenderQueryExtension in -lXrender" >&5
 $as_echo_n "checking for XRenderQueryExtension in -lXrender... " >&6; }
-if test "${ac_cv_lib_Xrender_XRenderQueryExtension+set}" = set; then :
+if ${ac_cv_lib_Xrender_XRenderQueryExtension+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -10242,7 +10212,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xrender_XRenderQueryExtension" >&5
 $as_echo "$ac_cv_lib_Xrender_XRenderQueryExtension" >&6; }
-if test "x$ac_cv_lib_Xrender_XRenderQueryExtension" = x""yes; then :
+if test "x$ac_cv_lib_Xrender_XRenderQueryExtension" = xyes; then :
   HAVE_XRENDER=yes
 fi
 
@@ -10255,10 +10225,10 @@
 	XFT_LIBS="-lXrender $XFT_LIBS"
 	LIBS="$XFT_LIBS $LIBS"
 	ac_fn_c_check_header_mongrel "$LINENO" "X11/Xft/Xft.h" "ac_cv_header_X11_Xft_Xft_h" "$ac_includes_default"
-if test "x$ac_cv_header_X11_Xft_Xft_h" = x""yes; then :
+if test "x$ac_cv_header_X11_Xft_Xft_h" = xyes; then :
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XftFontOpen in -lXft" >&5
 $as_echo_n "checking for XftFontOpen in -lXft... " >&6; }
-if test "${ac_cv_lib_Xft_XftFontOpen+set}" = set; then :
+if ${ac_cv_lib_Xft_XftFontOpen+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -10292,7 +10262,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xft_XftFontOpen" >&5
 $as_echo "$ac_cv_lib_Xft_XftFontOpen" >&6; }
-if test "x$ac_cv_lib_Xft_XftFontOpen" = x""yes; then :
+if test "x$ac_cv_lib_Xft_XftFontOpen" = xyes; then :
   HAVE_XFT=yes
 fi
 
@@ -10341,7 +10311,7 @@
 set dummy pkg-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
+if ${ac_cv_path_PKG_CONFIG+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $PKG_CONFIG in
@@ -10434,7 +10404,7 @@
 
 	  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OTF_get_variation_glyphs in -lotf" >&5
 $as_echo_n "checking for OTF_get_variation_glyphs in -lotf... " >&6; }
-if test "${ac_cv_lib_otf_OTF_get_variation_glyphs+set}" = set; then :
+if ${ac_cv_lib_otf_OTF_get_variation_glyphs+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -10468,7 +10438,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_otf_OTF_get_variation_glyphs" >&5
 $as_echo "$ac_cv_lib_otf_OTF_get_variation_glyphs" >&6; }
-if test "x$ac_cv_lib_otf_OTF_get_variation_glyphs" = x""yes; then :
+if test "x$ac_cv_lib_otf_OTF_get_variation_glyphs" = xyes; then :
   HAVE_OTF_GET_VARIATION_GLYPHS=yes
 else
   HAVE_OTF_GET_VARIATION_GLYPHS=no
@@ -10493,7 +10463,7 @@
 set dummy pkg-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
+if ${ac_cv_path_PKG_CONFIG+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $PKG_CONFIG in
@@ -10611,10 +10581,10 @@
 if test "${HAVE_X11}" = "yes"; then
   if test "${with_xpm}" != "no"; then
     ac_fn_c_check_header_mongrel "$LINENO" "X11/xpm.h" "ac_cv_header_X11_xpm_h" "$ac_includes_default"
-if test "x$ac_cv_header_X11_xpm_h" = x""yes; then :
+if test "x$ac_cv_header_X11_xpm_h" = xyes; then :
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XpmReadFileToPixmap in -lXpm" >&5
 $as_echo_n "checking for XpmReadFileToPixmap in -lXpm... " >&6; }
-if test "${ac_cv_lib_Xpm_XpmReadFileToPixmap+set}" = set; then :
+if ${ac_cv_lib_Xpm_XpmReadFileToPixmap+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -10648,7 +10618,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xpm_XpmReadFileToPixmap" >&5
 $as_echo "$ac_cv_lib_Xpm_XpmReadFileToPixmap" >&6; }
-if test "x$ac_cv_lib_Xpm_XpmReadFileToPixmap" = x""yes; then :
+if test "x$ac_cv_lib_Xpm_XpmReadFileToPixmap" = xyes; then :
   HAVE_XPM=yes
 fi
 
@@ -10700,10 +10670,10 @@
 if test "${HAVE_X11}" = "yes"; then
   if test "${with_jpeg}" != "no"; then
             ac_fn_c_check_header_mongrel "$LINENO" "jerror.h" "ac_cv_header_jerror_h" "$ac_includes_default"
-if test "x$ac_cv_header_jerror_h" = x""yes; then :
+if test "x$ac_cv_header_jerror_h" = xyes; then :
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for jpeg_destroy_compress in -ljpeg" >&5
 $as_echo_n "checking for jpeg_destroy_compress in -ljpeg... " >&6; }
-if test "${ac_cv_lib_jpeg_jpeg_destroy_compress+set}" = set; then :
+if ${ac_cv_lib_jpeg_jpeg_destroy_compress+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -10737,7 +10707,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_jpeg_jpeg_destroy_compress" >&5
 $as_echo "$ac_cv_lib_jpeg_jpeg_destroy_compress" >&6; }
-if test "x$ac_cv_lib_jpeg_jpeg_destroy_compress" = x""yes; then :
+if test "x$ac_cv_lib_jpeg_jpeg_destroy_compress" = xyes; then :
   HAVE_JPEG=yes
 fi
 
@@ -10784,8 +10754,7 @@
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-eval as_val=\$$as_ac_Header
-   if test "x$as_val" = x""yes; then :
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
@@ -10797,7 +10766,7 @@
     if test "$ac_cv_header_png_h" = yes || test "$ac_cv_header_libpng_png_h" = yes ; then
       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for png_get_channels in -lpng" >&5
 $as_echo_n "checking for png_get_channels in -lpng... " >&6; }
-if test "${ac_cv_lib_png_png_get_channels+set}" = set; then :
+if ${ac_cv_lib_png_png_get_channels+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -10831,7 +10800,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_png_png_get_channels" >&5
 $as_echo "$ac_cv_lib_png_png_get_channels" >&6; }
-if test "x$ac_cv_lib_png_png_get_channels" = x""yes; then :
+if test "x$ac_cv_lib_png_png_get_channels" = xyes; then :
   HAVE_PNG=yes
 fi
 
@@ -10853,13 +10822,13 @@
 if test "${HAVE_X11}" = "yes"; then
   if test "${with_tiff}" != "no"; then
     ac_fn_c_check_header_mongrel "$LINENO" "tiffio.h" "ac_cv_header_tiffio_h" "$ac_includes_default"
-if test "x$ac_cv_header_tiffio_h" = x""yes; then :
+if test "x$ac_cv_header_tiffio_h" = xyes; then :
   tifflibs="-lz -lm"
       # At least one tiff package requires the jpeg library.
       if test "${HAVE_JPEG}" = yes; then tifflibs="-ljpeg $tifflibs"; fi
       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for TIFFGetVersion in -ltiff" >&5
 $as_echo_n "checking for TIFFGetVersion in -ltiff... " >&6; }
-if test "${ac_cv_lib_tiff_TIFFGetVersion+set}" = set; then :
+if ${ac_cv_lib_tiff_TIFFGetVersion+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -10893,7 +10862,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tiff_TIFFGetVersion" >&5
 $as_echo "$ac_cv_lib_tiff_TIFFGetVersion" >&6; }
-if test "x$ac_cv_lib_tiff_TIFFGetVersion" = x""yes; then :
+if test "x$ac_cv_lib_tiff_TIFFGetVersion" = xyes; then :
   HAVE_TIFF=yes
 fi
 
@@ -10916,12 +10885,12 @@
 LIBGIF=
 if test "${HAVE_X11}" = "yes" && test "${with_gif}" != "no"; then
   ac_fn_c_check_header_mongrel "$LINENO" "gif_lib.h" "ac_cv_header_gif_lib_h" "$ac_includes_default"
-if test "x$ac_cv_header_gif_lib_h" = x""yes; then :
+if test "x$ac_cv_header_gif_lib_h" = xyes; then :
   # EGifPutExtensionLast only exists from version libungif-4.1.0b1.
 # Earlier versions can crash Emacs.
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EGifPutExtensionLast in -lgif" >&5
 $as_echo_n "checking for EGifPutExtensionLast in -lgif... " >&6; }
-if test "${ac_cv_lib_gif_EGifPutExtensionLast+set}" = set; then :
+if ${ac_cv_lib_gif_EGifPutExtensionLast+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -10955,7 +10924,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gif_EGifPutExtensionLast" >&5
 $as_echo "$ac_cv_lib_gif_EGifPutExtensionLast" >&6; }
-if test "x$ac_cv_lib_gif_EGifPutExtensionLast" = x""yes; then :
+if test "x$ac_cv_lib_gif_EGifPutExtensionLast" = xyes; then :
   HAVE_GIF=yes
 else
   HAVE_GIF=maybe
@@ -10971,7 +10940,7 @@
 # If gif_lib.h but no libgif, try libungif.
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EGifPutExtensionLast in -lungif" >&5
 $as_echo_n "checking for EGifPutExtensionLast in -lungif... " >&6; }
-if test "${ac_cv_lib_ungif_EGifPutExtensionLast+set}" = set; then :
+if ${ac_cv_lib_ungif_EGifPutExtensionLast+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -11005,7 +10974,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ungif_EGifPutExtensionLast" >&5
 $as_echo "$ac_cv_lib_ungif_EGifPutExtensionLast" >&6; }
-if test "x$ac_cv_lib_ungif_EGifPutExtensionLast" = x""yes; then :
+if test "x$ac_cv_lib_ungif_EGifPutExtensionLast" = xyes; then :
   HAVE_GIF=yes
 else
   HAVE_GIF=no
@@ -11037,7 +11006,7 @@
     MISSING="$MISSING libtiff" && WITH_NO="$WITH_NO --with-tiff=no"
 
   if test "X${MISSING}" != X; then
-    as_fn_error "The following required libraries were not found:
+    as_fn_error $? "The following required libraries were not found:
     $MISSING
 Maybe some development libraries/packages are missing?
 If you don't want to link with them give
@@ -11052,10 +11021,10 @@
 MOUSE_SUPPORT=
 if test "${with_gpm}" != "no"; then
   ac_fn_c_check_header_mongrel "$LINENO" "gpm.h" "ac_cv_header_gpm_h" "$ac_includes_default"
-if test "x$ac_cv_header_gpm_h" = x""yes; then :
+if test "x$ac_cv_header_gpm_h" = xyes; then :
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Gpm_Open in -lgpm" >&5
 $as_echo_n "checking for Gpm_Open in -lgpm... " >&6; }
-if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then :
+if ${ac_cv_lib_gpm_Gpm_Open+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -11089,7 +11058,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gpm_Gpm_Open" >&5
 $as_echo "$ac_cv_lib_gpm_Gpm_Open" >&6; }
-if test "x$ac_cv_lib_gpm_Gpm_Open" = x""yes; then :
+if test "x$ac_cv_lib_gpm_Gpm_Open" = xyes; then :
   HAVE_GPM=yes
 fi
 
@@ -11109,7 +11078,7 @@
 
 
 ac_fn_c_check_header_mongrel "$LINENO" "malloc/malloc.h" "ac_cv_header_malloc_malloc_h" "$ac_includes_default"
-if test "x$ac_cv_header_malloc_malloc_h" = x""yes; then :
+if test "x$ac_cv_header_malloc_malloc_h" = xyes; then :
 
 $as_echo "#define HAVE_MALLOC_MALLOC_H 1" >>confdefs.h
 
@@ -11154,10 +11123,10 @@
 LIBXSM=
 if test "${HAVE_X11}" = "yes"; then
   ac_fn_c_check_header_mongrel "$LINENO" "X11/SM/SMlib.h" "ac_cv_header_X11_SM_SMlib_h" "$ac_includes_default"
-if test "x$ac_cv_header_X11_SM_SMlib_h" = x""yes; then :
+if test "x$ac_cv_header_X11_SM_SMlib_h" = xyes; then :
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SmcOpenConnection in -lSM" >&5
 $as_echo_n "checking for SmcOpenConnection in -lSM... " >&6; }
-if test "${ac_cv_lib_SM_SmcOpenConnection+set}" = set; then :
+if ${ac_cv_lib_SM_SmcOpenConnection+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -11191,7 +11160,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_SM_SmcOpenConnection" >&5
 $as_echo "$ac_cv_lib_SM_SmcOpenConnection" >&6; }
-if test "x$ac_cv_lib_SM_SmcOpenConnection" = x""yes; then :
+if test "x$ac_cv_lib_SM_SmcOpenConnection" = xyes; then :
   HAVE_X_SM=yes
 fi
 
@@ -11222,7 +11191,7 @@
 set dummy pkg-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
+if ${ac_cv_path_PKG_CONFIG+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $PKG_CONFIG in
@@ -11313,7 +11282,7 @@
     LIBS="$LIBXML2_LIBS $LIBS"
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for htmlReadMemory in -lxml2" >&5
 $as_echo_n "checking for htmlReadMemory in -lxml2... " >&6; }
-if test "${ac_cv_lib_xml2_htmlReadMemory+set}" = set; then :
+if ${ac_cv_lib_xml2_htmlReadMemory+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -11347,7 +11316,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xml2_htmlReadMemory" >&5
 $as_echo "$ac_cv_lib_xml2_htmlReadMemory" >&6; }
-if test "x$ac_cv_lib_xml2_htmlReadMemory" = x""yes; then :
+if test "x$ac_cv_lib_xml2_htmlReadMemory" = xyes; then :
   HAVE_LIBXML2=yes
 else
   HAVE_LIBXML2=no
@@ -11369,7 +11338,7 @@
 # If netdb.h doesn't declare h_errno, we must declare it by hand.
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether netdb declares h_errno" >&5
 $as_echo_n "checking whether netdb declares h_errno... " >&6; }
-if test "${emacs_cv_netdb_declares_h_errno+set}" = set; then :
+if ${emacs_cv_netdb_declares_h_errno+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -11399,11 +11368,22 @@
 
 fi
 
+ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default"
+if test "x$ac_cv_type_size_t" = xyes; then :
+
+else
+
+cat >>confdefs.h <<_ACEOF
+#define size_t unsigned int
+_ACEOF
+
+fi
+
 # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
 # for constant arguments.  Useless!
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5
 $as_echo_n "checking for working alloca.h... " >&6; }
-if test "${ac_cv_working_alloca_h+set}" = set; then :
+if ${ac_cv_working_alloca_h+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -11436,7 +11416,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5
 $as_echo_n "checking for alloca... " >&6; }
-if test "${ac_cv_func_alloca_works+set}" = set; then :
+if ${ac_cv_func_alloca_works+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -11455,7 +11435,7 @@
  #pragma alloca
 #   else
 #    ifndef alloca /* predefined by HP cc +Olibcalls */
-char *alloca ();
+void *alloca (size_t);
 #    endif
 #   endif
 #  endif
@@ -11499,7 +11479,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5
 $as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; }
-if test "${ac_cv_os_cray+set}" = set; then :
+if ${ac_cv_os_cray+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -11526,8 +11506,7 @@
   for ac_func in _getb67 GETB67 getb67; do
     as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-eval as_val=\$$as_ac_var
-   if test "x$as_val" = x""yes; then :
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
 
 cat >>confdefs.h <<_ACEOF
 #define CRAY_STACKSEG_END $ac_func
@@ -11541,7 +11520,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5
 $as_echo_n "checking stack direction for C alloca... " >&6; }
-if test "${ac_cv_c_stack_direction+set}" = set; then :
+if ${ac_cv_c_stack_direction+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then :
@@ -11591,14 +11570,14 @@
 
 
 if test x"$ac_cv_func_alloca_works" != xyes; then
-   as_fn_error "a system implementation of alloca is required " "$LINENO" 5
+   as_fn_error $? "a system implementation of alloca is required " "$LINENO" 5
 fi
 
 # fmod, logb, and frexp are found in -lm on most systems.
 # On HPUX 9.01, -lm does not contain logb, so check for sqrt.
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sqrt in -lm" >&5
 $as_echo_n "checking for sqrt in -lm... " >&6; }
-if test "${ac_cv_lib_m_sqrt+set}" = set; then :
+if ${ac_cv_lib_m_sqrt+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -11632,7 +11611,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_sqrt" >&5
 $as_echo "$ac_cv_lib_m_sqrt" >&6; }
-if test "x$ac_cv_lib_m_sqrt" = x""yes; then :
+if test "x$ac_cv_lib_m_sqrt" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBM 1
 _ACEOF
@@ -11646,7 +11625,7 @@
 # have the same check as for liblockfile below.
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for maillock in -lmail" >&5
 $as_echo_n "checking for maillock in -lmail... " >&6; }
-if test "${ac_cv_lib_mail_maillock+set}" = set; then :
+if ${ac_cv_lib_mail_maillock+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -11680,7 +11659,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mail_maillock" >&5
 $as_echo "$ac_cv_lib_mail_maillock" >&6; }
-if test "x$ac_cv_lib_mail_maillock" = x""yes; then :
+if test "x$ac_cv_lib_mail_maillock" = xyes; then :
   have_mail=yes
 else
   have_mail=no
@@ -11697,7 +11676,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for maillock in -llockfile" >&5
 $as_echo_n "checking for maillock in -llockfile... " >&6; }
-if test "${ac_cv_lib_lockfile_maillock+set}" = set; then :
+if ${ac_cv_lib_lockfile_maillock+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -11731,7 +11710,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lockfile_maillock" >&5
 $as_echo "$ac_cv_lib_lockfile_maillock" >&6; }
-if test "x$ac_cv_lib_lockfile_maillock" = x""yes; then :
+if test "x$ac_cv_lib_lockfile_maillock" = xyes; then :
   have_lockfile=yes
 else
   have_lockfile=no
@@ -11751,7 +11730,7 @@
 set dummy liblockfile.so; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_liblockfile+set}" = set; then :
+if ${ac_cv_prog_liblockfile+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$liblockfile"; then
@@ -11787,7 +11766,7 @@
 
 
   if test $ac_cv_prog_liblockfile = yes; then
-    as_fn_error "Shared liblockfile found but can't link against it.
+    as_fn_error $? "Shared liblockfile found but can't link against it.
 This probably means that movemail could lose mail.
 There may be a \`development' package to install containing liblockfile." "$LINENO" 5
   fi
@@ -11795,7 +11774,7 @@
 for ac_func in touchlock
 do :
   ac_fn_c_check_func "$LINENO" "touchlock" "ac_cv_func_touchlock"
-if test "x$ac_cv_func_touchlock" = x""yes; then :
+if test "x$ac_cv_func_touchlock" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_TOUCHLOCK 1
 _ACEOF
@@ -11806,7 +11785,7 @@
 for ac_header in maillock.h
 do :
   ac_fn_c_check_header_mongrel "$LINENO" "maillock.h" "ac_cv_header_maillock_h" "$ac_includes_default"
-if test "x$ac_cv_header_maillock_h" = x""yes; then :
+if test "x$ac_cv_header_maillock_h" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_MAILLOCK_H 1
 _ACEOF
@@ -11876,8 +11855,7 @@
 do :
   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-eval as_val=\$$as_ac_var
-   if test "x$as_val" = x""yes; then :
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
@@ -11889,7 +11867,7 @@
 for ac_header in sys/un.h
 do :
   ac_fn_c_check_header_mongrel "$LINENO" "sys/un.h" "ac_cv_header_sys_un_h" "$ac_includes_default"
-if test "x$ac_cv_header_sys_un_h" = x""yes; then :
+if test "x$ac_cv_header_sys_un_h" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_SYS_UN_H 1
 _ACEOF
@@ -11908,8 +11886,7 @@
 do :
   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-eval as_val=\$$as_ac_var
-   if test "x$as_val" = x""yes; then :
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
@@ -11923,7 +11900,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working mktime" >&5
 $as_echo_n "checking for working mktime... " >&6; }
-if test "${ac_cv_func_working_mktime+set}" = set; then :
+if ${ac_cv_func_working_mktime+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then :
@@ -11961,8 +11938,8 @@
 static time_t time_t_min;
 
 /* Values we'll use to set the TZ environment variable.  */
-static char *tz_strings[] = {
-  (char *) 0, "TZ=GMT0", "TZ=JST-9",
+static const char *tz_strings[] = {
+  (const char *) 0, "TZ=GMT0", "TZ=JST-9",
   "TZ=EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00"
 };
 #define N_STRINGS (sizeof (tz_strings) / sizeof (tz_strings[0]))
@@ -11979,7 +11956,7 @@
      instead of "TZ=America/Vancouver" in order to detect the bug even
      on systems that don't support the Olson extension, or don't have the
      full zoneinfo tables installed.  */
-  putenv ("TZ=PST8PDT,M4.1.0,M10.5.0");
+  putenv ((char*) "TZ=PST8PDT,M4.1.0,M10.5.0");
 
   tm.tm_year = 98;
   tm.tm_mon = 3;
@@ -11992,16 +11969,14 @@
 }
 
 static int
-mktime_test1 (now)
-     time_t now;
+mktime_test1 (time_t now)
 {
   struct tm *lt;
   return ! (lt = localtime (&now)) || mktime (lt) == now;
 }
 
 static int
-mktime_test (now)
-     time_t now;
+mktime_test (time_t now)
 {
   return (mktime_test1 (now)
 	  && mktime_test1 ((time_t) (time_t_max - now))
@@ -12025,8 +12000,7 @@
 }
 
 static int
-bigtime_test (j)
-     int j;
+bigtime_test (int j)
 {
   struct tm tm;
   time_t now;
@@ -12070,7 +12044,7 @@
      instead of "TZ=America/Vancouver" in order to detect the bug even
      on systems that don't support the Olson extension, or don't have the
      full zoneinfo tables installed.  */
-  putenv ("TZ=PST8PDT,M4.1.0,M10.5.0");
+  putenv ((char*) "TZ=PST8PDT,M4.1.0,M10.5.0");
 
   t = mktime (&tm);
 
@@ -12105,7 +12079,7 @@
   for (i = 0; i < N_STRINGS; i++)
     {
       if (tz_strings[i])
-	putenv (tz_strings[i]);
+	putenv ((char*) tz_strings[i]);
 
       for (t = 0; t <= time_t_max - delta; t += delta)
 	if (! mktime_test (t))
@@ -12157,13 +12131,13 @@
 
 # Make sure getloadavg.c is where it belongs, at configure-time.
 test -f "$srcdir/$ac_config_libobj_dir/getloadavg.c" ||
-  as_fn_error "$srcdir/$ac_config_libobj_dir/getloadavg.c is missing" "$LINENO" 5
+  as_fn_error $? "$srcdir/$ac_config_libobj_dir/getloadavg.c is missing" "$LINENO" 5
 
 ac_save_LIBS=$LIBS
 
 # Check for getloadavg, but be sure not to touch the cache variable.
 (ac_fn_c_check_func "$LINENO" "getloadavg" "ac_cv_func_getloadavg"
-if test "x$ac_cv_func_getloadavg" = x""yes; then :
+if test "x$ac_cv_func_getloadavg" = xyes; then :
   exit 0
 else
   exit 1
@@ -12174,7 +12148,7 @@
 for ac_func in pstat_getdynamic
 do :
   ac_fn_c_check_func "$LINENO" "pstat_getdynamic" "ac_cv_func_pstat_getdynamic"
-if test "x$ac_cv_func_pstat_getdynamic" = x""yes; then :
+if test "x$ac_cv_func_pstat_getdynamic" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_PSTAT_GETDYNAMIC 1
 _ACEOF
@@ -12186,7 +12160,7 @@
 # Solaris has libkstat which does not require root.
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for kstat_open in -lkstat" >&5
 $as_echo_n "checking for kstat_open in -lkstat... " >&6; }
-if test "${ac_cv_lib_kstat_kstat_open+set}" = set; then :
+if ${ac_cv_lib_kstat_kstat_open+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -12220,7 +12194,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_kstat_kstat_open" >&5
 $as_echo "$ac_cv_lib_kstat_kstat_open" >&6; }
-if test "x$ac_cv_lib_kstat_kstat_open" = x""yes; then :
+if test "x$ac_cv_lib_kstat_kstat_open" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBKSTAT 1
 _ACEOF
@@ -12238,7 +12212,7 @@
 if test $ac_have_func = no; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for elf_begin in -lelf" >&5
 $as_echo_n "checking for elf_begin in -lelf... " >&6; }
-if test "${ac_cv_lib_elf_elf_begin+set}" = set; then :
+if ${ac_cv_lib_elf_elf_begin+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -12272,7 +12246,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_elf_elf_begin" >&5
 $as_echo "$ac_cv_lib_elf_elf_begin" >&6; }
-if test "x$ac_cv_lib_elf_elf_begin" = x""yes; then :
+if test "x$ac_cv_lib_elf_elf_begin" = xyes; then :
   LIBS="-lelf $LIBS"
 fi
 
@@ -12280,7 +12254,7 @@
 if test $ac_have_func = no; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for kvm_open in -lkvm" >&5
 $as_echo_n "checking for kvm_open in -lkvm... " >&6; }
-if test "${ac_cv_lib_kvm_kvm_open+set}" = set; then :
+if ${ac_cv_lib_kvm_kvm_open+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -12314,14 +12288,14 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_kvm_kvm_open" >&5
 $as_echo "$ac_cv_lib_kvm_kvm_open" >&6; }
-if test "x$ac_cv_lib_kvm_kvm_open" = x""yes; then :
+if test "x$ac_cv_lib_kvm_kvm_open" = xyes; then :
   LIBS="-lkvm $LIBS"
 fi
 
   # Check for the 4.4BSD definition of getloadavg.
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getloadavg in -lutil" >&5
 $as_echo_n "checking for getloadavg in -lutil... " >&6; }
-if test "${ac_cv_lib_util_getloadavg+set}" = set; then :
+if ${ac_cv_lib_util_getloadavg+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -12355,7 +12329,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_util_getloadavg" >&5
 $as_echo "$ac_cv_lib_util_getloadavg" >&6; }
-if test "x$ac_cv_lib_util_getloadavg" = x""yes; then :
+if test "x$ac_cv_lib_util_getloadavg" = xyes; then :
   LIBS="-lutil $LIBS" ac_have_func=yes ac_cv_func_getloadavg_setgid=yes
 fi
 
@@ -12368,7 +12342,7 @@
   LIBS="-L/usr/local/lib $LIBS"
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getloadavg in -lgetloadavg" >&5
 $as_echo_n "checking for getloadavg in -lgetloadavg... " >&6; }
-if test "${ac_cv_lib_getloadavg_getloadavg+set}" = set; then :
+if ${ac_cv_lib_getloadavg_getloadavg+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -12402,7 +12376,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_getloadavg_getloadavg" >&5
 $as_echo "$ac_cv_lib_getloadavg_getloadavg" >&6; }
-if test "x$ac_cv_lib_getloadavg_getloadavg" = x""yes; then :
+if test "x$ac_cv_lib_getloadavg_getloadavg" = xyes; then :
   LIBS="-lgetloadavg $LIBS"
 else
   LIBS=$ac_getloadavg_LIBS
@@ -12415,7 +12389,7 @@
 for ac_func in getloadavg
 do :
   ac_fn_c_check_func "$LINENO" "getloadavg" "ac_cv_func_getloadavg"
-if test "x$ac_cv_func_getloadavg" = x""yes; then :
+if test "x$ac_cv_func_getloadavg" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_GETLOADAVG 1
 _ACEOF
@@ -12433,14 +12407,14 @@
 # Figure out what our getloadavg.c needs.
 ac_have_func=no
 ac_fn_c_check_header_mongrel "$LINENO" "sys/dg_sys_info.h" "ac_cv_header_sys_dg_sys_info_h" "$ac_includes_default"
-if test "x$ac_cv_header_sys_dg_sys_info_h" = x""yes; then :
+if test "x$ac_cv_header_sys_dg_sys_info_h" = xyes; then :
   ac_have_func=yes
 
 $as_echo "#define DGUX 1" >>confdefs.h
 
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dg_sys_info in -ldgc" >&5
 $as_echo_n "checking for dg_sys_info in -ldgc... " >&6; }
-if test "${ac_cv_lib_dgc_dg_sys_info+set}" = set; then :
+if ${ac_cv_lib_dgc_dg_sys_info+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -12474,7 +12448,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dgc_dg_sys_info" >&5
 $as_echo "$ac_cv_lib_dgc_dg_sys_info" >&6; }
-if test "x$ac_cv_lib_dgc_dg_sys_info" = x""yes; then :
+if test "x$ac_cv_lib_dgc_dg_sys_info" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBDGC 1
 _ACEOF
@@ -12488,7 +12462,7 @@
 
 
 ac_fn_c_check_header_mongrel "$LINENO" "locale.h" "ac_cv_header_locale_h" "$ac_includes_default"
-if test "x$ac_cv_header_locale_h" = x""yes; then :
+if test "x$ac_cv_header_locale_h" = xyes; then :
 
 fi
 
@@ -12496,7 +12470,7 @@
 for ac_func in setlocale
 do :
   ac_fn_c_check_func "$LINENO" "setlocale" "ac_cv_func_setlocale"
-if test "x$ac_cv_func_setlocale" = x""yes; then :
+if test "x$ac_cv_func_setlocale" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_SETLOCALE 1
 _ACEOF
@@ -12508,7 +12482,8 @@
 # We cannot check for <dwarf.h>, because Solaris 2 does not use dwarf (it
 # uses stabs), but it is still SVR4.  We cannot check for <elf.h> because
 # Irix 4.0.5F has the header but not the library.
-if test $ac_have_func = no && test "$ac_cv_lib_elf_elf_begin" = yes; then
+if test $ac_have_func = no && test "$ac_cv_lib_elf_elf_begin" = yes \
+    && test "$ac_cv_lib_kvm_kvm_open" = yes; then
   ac_have_func=yes
 
 $as_echo "#define SVR4 1" >>confdefs.h
@@ -12517,7 +12492,7 @@
 
 if test $ac_have_func = no; then
   ac_fn_c_check_header_mongrel "$LINENO" "inq_stats/cpustats.h" "ac_cv_header_inq_stats_cpustats_h" "$ac_includes_default"
-if test "x$ac_cv_header_inq_stats_cpustats_h" = x""yes; then :
+if test "x$ac_cv_header_inq_stats_cpustats_h" = xyes; then :
   ac_have_func=yes
 
 $as_echo "#define UMAX 1" >>confdefs.h
@@ -12532,7 +12507,7 @@
 
 if test $ac_have_func = no; then
   ac_fn_c_check_header_mongrel "$LINENO" "sys/cpustats.h" "ac_cv_header_sys_cpustats_h" "$ac_includes_default"
-if test "x$ac_cv_header_sys_cpustats_h" = x""yes; then :
+if test "x$ac_cv_header_sys_cpustats_h" = xyes; then :
   ac_have_func=yes; $as_echo "#define UMAX 1" >>confdefs.h
 
 fi
@@ -12544,7 +12519,7 @@
   for ac_header in mach/mach.h
 do :
   ac_fn_c_check_header_mongrel "$LINENO" "mach/mach.h" "ac_cv_header_mach_mach_h" "$ac_includes_default"
-if test "x$ac_cv_header_mach_mach_h" = x""yes; then :
+if test "x$ac_cv_header_mach_mach_h" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_MACH_MACH_H 1
 _ACEOF
@@ -12558,13 +12533,13 @@
 for ac_header in nlist.h
 do :
   ac_fn_c_check_header_mongrel "$LINENO" "nlist.h" "ac_cv_header_nlist_h" "$ac_includes_default"
-if test "x$ac_cv_header_nlist_h" = x""yes; then :
+if test "x$ac_cv_header_nlist_h" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_NLIST_H 1
 _ACEOF
  ac_fn_c_check_member "$LINENO" "struct nlist" "n_un.n_name" "ac_cv_member_struct_nlist_n_un_n_name" "#include <nlist.h>
 "
-if test "x$ac_cv_member_struct_nlist_n_un_n_name" = x""yes; then :
+if test "x$ac_cv_member_struct_nlist_n_un_n_name" = xyes; then :
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_STRUCT_NLIST_N_UN_N_NAME 1
@@ -12587,7 +12562,7 @@
 # Some definitions of getloadavg require that the program be installed setgid.
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getloadavg requires setgid" >&5
 $as_echo_n "checking whether getloadavg requires setgid... " >&6; }
-if test "${ac_cv_func_getloadavg_setgid+set}" = set; then :
+if ${ac_cv_func_getloadavg_setgid+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -12620,7 +12595,7 @@
 if test $ac_cv_func_getloadavg_setgid = yes; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking group of /dev/kmem" >&5
 $as_echo_n "checking group of /dev/kmem... " >&6; }
-if test "${ac_cv_group_kmem+set}" = set; then :
+if ${ac_cv_group_kmem+:} false; then :
   $as_echo_n "(cached) " >&6
 else
    # On Solaris, /dev/kmem is a symlink.  Get info on the real file.
@@ -12648,7 +12623,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGEFILE_SOURCE value needed for large files" >&5
 $as_echo_n "checking for _LARGEFILE_SOURCE value needed for large files... " >&6; }
-if test "${ac_cv_sys_largefile_source+set}" = set; then :
+if ${ac_cv_sys_largefile_source+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   while :; do
@@ -12741,7 +12716,7 @@
   for ac_header in getopt.h
 do :
   ac_fn_c_check_header_mongrel "$LINENO" "getopt.h" "ac_cv_header_getopt_h" "$ac_includes_default"
-if test "x$ac_cv_header_getopt_h" = x""yes; then :
+if test "x$ac_cv_header_getopt_h" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_GETOPT_H 1
 _ACEOF
@@ -12756,7 +12731,7 @@
     for ac_func in getopt_long_only
 do :
   ac_fn_c_check_func "$LINENO" "getopt_long_only" "ac_cv_func_getopt_long_only"
-if test "x$ac_cv_func_getopt_long_only" = x""yes; then :
+if test "x$ac_cv_func_getopt_long_only" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_GETOPT_LONG_ONLY 1
 _ACEOF
@@ -12771,7 +12746,7 @@
       if test -z "$GETOPT_H"; then
     ac_fn_c_check_decl "$LINENO" "optreset" "ac_cv_have_decl_optreset" "#include <getopt.h>
 "
-if test "x$ac_cv_have_decl_optreset" = x""yes; then :
+if test "x$ac_cv_have_decl_optreset" = xyes; then :
   GETOPT_H=getopt.h
 fi
 
@@ -12780,13 +12755,13 @@
       if test -z "$GETOPT_H"; then
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working GNU getopt function" >&5
 $as_echo_n "checking for working GNU getopt function... " >&6; }
-if test "${gl_cv_func_gnu_getopt+set}" = set; then :
+if ${gl_cv_func_gnu_getopt+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then :
   	 	 	 ac_fn_c_check_decl "$LINENO" "getopt_clip" "ac_cv_have_decl_getopt_clip" "#include <getopt.h>
 "
-if test "x$ac_cv_have_decl_getopt_clip" = x""yes; then :
+if test "x$ac_cv_have_decl_getopt_clip" = xyes; then :
   gl_cv_func_gnu_getopt=no
 else
   gl_cv_func_gnu_getopt=yes
@@ -12847,7 +12822,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getpgrp requires zero arguments" >&5
 $as_echo_n "checking whether getpgrp requires zero arguments... " >&6; }
-if test "${ac_cv_func_getpgrp_void+set}" = set; then :
+if ${ac_cv_func_getpgrp_void+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   # Use it with a single arg.
@@ -12882,7 +12857,7 @@
 for ac_func in strftime
 do :
   ac_fn_c_check_func "$LINENO" "strftime" "ac_cv_func_strftime"
-if test "x$ac_cv_func_strftime" = x""yes; then :
+if test "x$ac_cv_func_strftime" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_STRFTIME 1
 _ACEOF
@@ -12891,7 +12866,7 @@
   # strftime is in -lintl on SCO UNIX.
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for strftime in -lintl" >&5
 $as_echo_n "checking for strftime in -lintl... " >&6; }
-if test "${ac_cv_lib_intl_strftime+set}" = set; then :
+if ${ac_cv_lib_intl_strftime+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -12925,7 +12900,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_strftime" >&5
 $as_echo "$ac_cv_lib_intl_strftime" >&6; }
-if test "x$ac_cv_lib_intl_strftime" = x""yes; then :
+if test "x$ac_cv_lib_intl_strftime" = xyes; then :
   $as_echo "#define HAVE_STRFTIME 1" >>confdefs.h
 
 LIBS="-lintl $LIBS"
@@ -12939,7 +12914,7 @@
 for ac_func in grantpt
 do :
   ac_fn_c_check_func "$LINENO" "grantpt" "ac_cv_func_grantpt"
-if test "x$ac_cv_func_grantpt" = x""yes; then :
+if test "x$ac_cv_func_grantpt" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_GRANTPT 1
 _ACEOF
@@ -12952,7 +12927,7 @@
 for ac_func in getpt
 do :
   ac_fn_c_check_func "$LINENO" "getpt" "ac_cv_func_getpt"
-if test "x$ac_cv_func_getpt" = x""yes; then :
+if test "x$ac_cv_func_getpt" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_GETPT 1
 _ACEOF
@@ -12969,7 +12944,7 @@
 have_tputs_et_al=true
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing tputs" >&5
 $as_echo_n "checking for library containing tputs... " >&6; }
-if test "${ac_cv_search_tputs+set}" = set; then :
+if ${ac_cv_search_tputs+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_func_search_save_LIBS=$LIBS
@@ -13003,11 +12978,11 @@
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext
-  if test "${ac_cv_search_tputs+set}" = set; then :
+  if ${ac_cv_search_tputs+:} false; then :
   break
 fi
 done
-if test "${ac_cv_search_tputs+set}" = set; then :
+if ${ac_cv_search_tputs+:} false; then :
 
 else
   ac_cv_search_tputs=no
@@ -13026,7 +13001,7 @@
 fi
 
 if test "$have_tputs_et_al" != true; then
-  as_fn_error "I couldn't find termcap functions (tputs and friends).
+  as_fn_error $? "I couldn't find termcap functions (tputs and friends).
 Maybe some development libraries/packages are missing?  Try installing
 libncurses-dev(el), libterminfo-dev(el) or similar." "$LINENO" 5
 fi
@@ -13066,7 +13041,7 @@
   freebsd)
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether FreeBSD is new enough to use terminfo" >&5
 $as_echo_n "checking whether FreeBSD is new enough to use terminfo... " >&6; }
-    if test "${emacs_cv_freebsd_terminfo+set}" = set; then :
+    if ${emacs_cv_freebsd_terminfo+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -13208,16 +13183,16 @@
 if test "$with_hesiod" != no ; then
   # Don't set $LIBS here -- see comments above.  FIXME which comments?
   ac_fn_c_check_func "$LINENO" "res_send" "ac_cv_func_res_send"
-if test "x$ac_cv_func_res_send" = x""yes; then :
+if test "x$ac_cv_func_res_send" = xyes; then :
 
 else
   ac_fn_c_check_func "$LINENO" "__res_send" "ac_cv_func___res_send"
-if test "x$ac_cv_func___res_send" = x""yes; then :
+if test "x$ac_cv_func___res_send" = xyes; then :
 
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for res_send in -lresolv" >&5
 $as_echo_n "checking for res_send in -lresolv... " >&6; }
-if test "${ac_cv_lib_resolv_res_send+set}" = set; then :
+if ${ac_cv_lib_resolv_res_send+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -13251,12 +13226,12 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_resolv_res_send" >&5
 $as_echo "$ac_cv_lib_resolv_res_send" >&6; }
-if test "x$ac_cv_lib_resolv_res_send" = x""yes; then :
+if test "x$ac_cv_lib_resolv_res_send" = xyes; then :
   resolv=yes
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __res_send in -lresolv" >&5
 $as_echo_n "checking for __res_send in -lresolv... " >&6; }
-if test "${ac_cv_lib_resolv___res_send+set}" = set; then :
+if ${ac_cv_lib_resolv___res_send+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -13290,7 +13265,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_resolv___res_send" >&5
 $as_echo "$ac_cv_lib_resolv___res_send" >&6; }
-if test "x$ac_cv_lib_resolv___res_send" = x""yes; then :
+if test "x$ac_cv_lib_resolv___res_send" = xyes; then :
   resolv=yes
 fi
 
@@ -13306,12 +13281,12 @@
     RESOLVLIB=
   fi
   ac_fn_c_check_func "$LINENO" "hes_getmailhost" "ac_cv_func_hes_getmailhost"
-if test "x$ac_cv_func_hes_getmailhost" = x""yes; then :
+if test "x$ac_cv_func_hes_getmailhost" = xyes; then :
 
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for hes_getmailhost in -lhesiod" >&5
 $as_echo_n "checking for hes_getmailhost in -lhesiod... " >&6; }
-if test "${ac_cv_lib_hesiod_hes_getmailhost+set}" = set; then :
+if ${ac_cv_lib_hesiod_hes_getmailhost+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -13345,7 +13320,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hesiod_hes_getmailhost" >&5
 $as_echo "$ac_cv_lib_hesiod_hes_getmailhost" >&6; }
-if test "x$ac_cv_lib_hesiod_hes_getmailhost" = x""yes; then :
+if test "x$ac_cv_lib_hesiod_hes_getmailhost" = xyes; then :
   hesiod=yes
 else
   :
@@ -13384,7 +13359,7 @@
 if test "${with_kerberos}" != no; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for com_err in -lcom_err" >&5
 $as_echo_n "checking for com_err in -lcom_err... " >&6; }
-if test "${ac_cv_lib_com_err_com_err+set}" = set; then :
+if ${ac_cv_lib_com_err_com_err+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -13418,7 +13393,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_com_err_com_err" >&5
 $as_echo "$ac_cv_lib_com_err_com_err" >&6; }
-if test "x$ac_cv_lib_com_err_com_err" = x""yes; then :
+if test "x$ac_cv_lib_com_err_com_err" = xyes; then :
   have_com_err=yes
 else
   have_com_err=no
@@ -13433,7 +13408,7 @@
   fi
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mit_des_cbc_encrypt in -lcrypto" >&5
 $as_echo_n "checking for mit_des_cbc_encrypt in -lcrypto... " >&6; }
-if test "${ac_cv_lib_crypto_mit_des_cbc_encrypt+set}" = set; then :
+if ${ac_cv_lib_crypto_mit_des_cbc_encrypt+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -13467,7 +13442,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_mit_des_cbc_encrypt" >&5
 $as_echo "$ac_cv_lib_crypto_mit_des_cbc_encrypt" >&6; }
-if test "x$ac_cv_lib_crypto_mit_des_cbc_encrypt" = x""yes; then :
+if test "x$ac_cv_lib_crypto_mit_des_cbc_encrypt" = xyes; then :
   have_crypto=yes
 else
   have_crypto=no
@@ -13482,7 +13457,7 @@
   fi
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mit_des_cbc_encrypt in -lk5crypto" >&5
 $as_echo_n "checking for mit_des_cbc_encrypt in -lk5crypto... " >&6; }
-if test "${ac_cv_lib_k5crypto_mit_des_cbc_encrypt+set}" = set; then :
+if ${ac_cv_lib_k5crypto_mit_des_cbc_encrypt+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -13516,7 +13491,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_k5crypto_mit_des_cbc_encrypt" >&5
 $as_echo "$ac_cv_lib_k5crypto_mit_des_cbc_encrypt" >&6; }
-if test "x$ac_cv_lib_k5crypto_mit_des_cbc_encrypt" = x""yes; then :
+if test "x$ac_cv_lib_k5crypto_mit_des_cbc_encrypt" = xyes; then :
   have_k5crypto=yes
 else
   have_k5crypto=no
@@ -13531,7 +13506,7 @@
   fi
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for krb5_init_context in -lkrb5" >&5
 $as_echo_n "checking for krb5_init_context in -lkrb5... " >&6; }
-if test "${ac_cv_lib_krb5_krb5_init_context+set}" = set; then :
+if ${ac_cv_lib_krb5_krb5_init_context+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -13565,7 +13540,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_krb5_krb5_init_context" >&5
 $as_echo "$ac_cv_lib_krb5_krb5_init_context" >&6; }
-if test "x$ac_cv_lib_krb5_krb5_init_context" = x""yes; then :
+if test "x$ac_cv_lib_krb5_krb5_init_context" = xyes; then :
   have_krb5=yes
 else
   have_krb5=no
@@ -13581,7 +13556,7 @@
     if test "${with_kerberos5}" = no; then
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for des_cbc_encrypt in -ldes425" >&5
 $as_echo_n "checking for des_cbc_encrypt in -ldes425... " >&6; }
-if test "${ac_cv_lib_des425_des_cbc_encrypt+set}" = set; then :
+if ${ac_cv_lib_des425_des_cbc_encrypt+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -13615,7 +13590,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_des425_des_cbc_encrypt" >&5
 $as_echo "$ac_cv_lib_des425_des_cbc_encrypt" >&6; }
-if test "x$ac_cv_lib_des425_des_cbc_encrypt" = x""yes; then :
+if test "x$ac_cv_lib_des425_des_cbc_encrypt" = xyes; then :
   have_des425=yes
 else
   have_des425=no
@@ -13630,7 +13605,7 @@
     else
       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for des_cbc_encrypt in -ldes" >&5
 $as_echo_n "checking for des_cbc_encrypt in -ldes... " >&6; }
-if test "${ac_cv_lib_des_des_cbc_encrypt+set}" = set; then :
+if ${ac_cv_lib_des_des_cbc_encrypt+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -13664,7 +13639,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_des_des_cbc_encrypt" >&5
 $as_echo "$ac_cv_lib_des_des_cbc_encrypt" >&6; }
-if test "x$ac_cv_lib_des_des_cbc_encrypt" = x""yes; then :
+if test "x$ac_cv_lib_des_des_cbc_encrypt" = xyes; then :
   have_des=yes
 else
   have_des=no
@@ -13680,7 +13655,7 @@
     fi
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for krb_get_cred in -lkrb4" >&5
 $as_echo_n "checking for krb_get_cred in -lkrb4... " >&6; }
-if test "${ac_cv_lib_krb4_krb_get_cred+set}" = set; then :
+if ${ac_cv_lib_krb4_krb_get_cred+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -13714,7 +13689,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_krb4_krb_get_cred" >&5
 $as_echo "$ac_cv_lib_krb4_krb_get_cred" >&6; }
-if test "x$ac_cv_lib_krb4_krb_get_cred" = x""yes; then :
+if test "x$ac_cv_lib_krb4_krb_get_cred" = xyes; then :
   have_krb4=yes
 else
   have_krb4=no
@@ -13729,7 +13704,7 @@
     else
       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for krb_get_cred in -lkrb" >&5
 $as_echo_n "checking for krb_get_cred in -lkrb... " >&6; }
-if test "${ac_cv_lib_krb_krb_get_cred+set}" = set; then :
+if ${ac_cv_lib_krb_krb_get_cred+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -13763,7 +13738,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_krb_krb_get_cred" >&5
 $as_echo "$ac_cv_lib_krb_krb_get_cred" >&6; }
-if test "x$ac_cv_lib_krb_krb_get_cred" = x""yes; then :
+if test "x$ac_cv_lib_krb_krb_get_cred" = xyes; then :
   have_krb=yes
 else
   have_krb=no
@@ -13783,13 +13758,13 @@
     for ac_header in krb5.h
 do :
   ac_fn_c_check_header_mongrel "$LINENO" "krb5.h" "ac_cv_header_krb5_h" "$ac_includes_default"
-if test "x$ac_cv_header_krb5_h" = x""yes; then :
+if test "x$ac_cv_header_krb5_h" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_KRB5_H 1
 _ACEOF
  ac_fn_c_check_member "$LINENO" "krb5_error" "text" "ac_cv_member_krb5_error_text" "#include <krb5.h>
 "
-if test "x$ac_cv_member_krb5_error_text" = x""yes; then :
+if test "x$ac_cv_member_krb5_error_text" = xyes; then :
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_KRB5_ERROR_TEXT 1
@@ -13799,7 +13774,7 @@
 fi
 ac_fn_c_check_member "$LINENO" "krb5_error" "e_text" "ac_cv_member_krb5_error_e_text" "#include <krb5.h>
 "
-if test "x$ac_cv_member_krb5_error_e_text" = x""yes; then :
+if test "x$ac_cv_member_krb5_error_e_text" = xyes; then :
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_KRB5_ERROR_E_TEXT 1
@@ -13816,7 +13791,7 @@
     for ac_header in des.h
 do :
   ac_fn_c_check_header_mongrel "$LINENO" "des.h" "ac_cv_header_des_h" "$ac_includes_default"
-if test "x$ac_cv_header_des_h" = x""yes; then :
+if test "x$ac_cv_header_des_h" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_DES_H 1
 _ACEOF
@@ -13825,7 +13800,7 @@
   for ac_header in kerberosIV/des.h
 do :
   ac_fn_c_check_header_mongrel "$LINENO" "kerberosIV/des.h" "ac_cv_header_kerberosIV_des_h" "$ac_includes_default"
-if test "x$ac_cv_header_kerberosIV_des_h" = x""yes; then :
+if test "x$ac_cv_header_kerberosIV_des_h" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_KERBEROSIV_DES_H 1
 _ACEOF
@@ -13834,7 +13809,7 @@
   for ac_header in kerberos/des.h
 do :
   ac_fn_c_check_header_mongrel "$LINENO" "kerberos/des.h" "ac_cv_header_kerberos_des_h" "$ac_includes_default"
-if test "x$ac_cv_header_kerberos_des_h" = x""yes; then :
+if test "x$ac_cv_header_kerberos_des_h" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_KERBEROS_DES_H 1
 _ACEOF
@@ -13854,7 +13829,7 @@
     for ac_header in krb.h
 do :
   ac_fn_c_check_header_mongrel "$LINENO" "krb.h" "ac_cv_header_krb_h" "$ac_includes_default"
-if test "x$ac_cv_header_krb_h" = x""yes; then :
+if test "x$ac_cv_header_krb_h" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_KRB_H 1
 _ACEOF
@@ -13863,7 +13838,7 @@
   for ac_header in kerberosIV/krb.h
 do :
   ac_fn_c_check_header_mongrel "$LINENO" "kerberosIV/krb.h" "ac_cv_header_kerberosIV_krb_h" "$ac_includes_default"
-if test "x$ac_cv_header_kerberosIV_krb_h" = x""yes; then :
+if test "x$ac_cv_header_kerberosIV_krb_h" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_KERBEROSIV_KRB_H 1
 _ACEOF
@@ -13872,7 +13847,7 @@
   for ac_header in kerberos/krb.h
 do :
   ac_fn_c_check_header_mongrel "$LINENO" "kerberos/krb.h" "ac_cv_header_kerberos_krb_h" "$ac_includes_default"
-if test "x$ac_cv_header_kerberos_krb_h" = x""yes; then :
+if test "x$ac_cv_header_kerberos_krb_h" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_KERBEROS_KRB_H 1
 _ACEOF
@@ -13893,7 +13868,7 @@
   for ac_header in com_err.h
 do :
   ac_fn_c_check_header_mongrel "$LINENO" "com_err.h" "ac_cv_header_com_err_h" "$ac_includes_default"
-if test "x$ac_cv_header_com_err_h" = x""yes; then :
+if test "x$ac_cv_header_com_err_h" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_COM_ERR_H 1
 _ACEOF
@@ -13914,7 +13889,7 @@
 # to return localized messages.
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dgettext in -lintl" >&5
 $as_echo_n "checking for dgettext in -lintl... " >&6; }
-if test "${ac_cv_lib_intl_dgettext+set}" = set; then :
+if ${ac_cv_lib_intl_dgettext+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -13948,7 +13923,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_dgettext" >&5
 $as_echo "$ac_cv_lib_intl_dgettext" >&6; }
-if test "x$ac_cv_lib_intl_dgettext" = x""yes; then :
+if test "x$ac_cv_lib_intl_dgettext" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBINTL 1
 _ACEOF
@@ -13960,7 +13935,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether localtime caches TZ" >&5
 $as_echo_n "checking whether localtime caches TZ... " >&6; }
-if test "${emacs_cv_localtime_cache+set}" = set; then :
+if ${emacs_cv_localtime_cache+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test x$ac_cv_func_tzset = xyes; then
@@ -14019,7 +13994,7 @@
   for ac_func in gettimeofday
 do :
   ac_fn_c_check_func "$LINENO" "gettimeofday" "ac_cv_func_gettimeofday"
-if test "x$ac_cv_func_gettimeofday" = x""yes; then :
+if test "x$ac_cv_func_gettimeofday" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_GETTIMEOFDAY 1
 _ACEOF
@@ -14030,7 +14005,7 @@
   if test $ac_cv_func_gettimeofday = yes; then
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gettimeofday can accept two arguments" >&5
 $as_echo_n "checking whether gettimeofday can accept two arguments... " >&6; }
-if test "${emacs_cv_gettimeofday_two_arguments+set}" = set; then :
+if ${emacs_cv_gettimeofday_two_arguments+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -14074,7 +14049,7 @@
 
 ok_so_far=yes
 ac_fn_c_check_func "$LINENO" "socket" "ac_cv_func_socket"
-if test "x$ac_cv_func_socket" = x""yes; then :
+if test "x$ac_cv_func_socket" = xyes; then :
 
 else
   ok_so_far=no
@@ -14082,7 +14057,7 @@
 
 if test $ok_so_far = yes; then
   ac_fn_c_check_header_mongrel "$LINENO" "netinet/in.h" "ac_cv_header_netinet_in_h" "$ac_includes_default"
-if test "x$ac_cv_header_netinet_in_h" = x""yes; then :
+if test "x$ac_cv_header_netinet_in_h" = xyes; then :
 
 else
   ok_so_far=no
@@ -14092,7 +14067,7 @@
 fi
 if test $ok_so_far = yes; then
   ac_fn_c_check_header_mongrel "$LINENO" "arpa/inet.h" "ac_cv_header_arpa_inet_h" "$ac_includes_default"
-if test "x$ac_cv_header_arpa_inet_h" = x""yes; then :
+if test "x$ac_cv_header_arpa_inet_h" = xyes; then :
 
 else
   ok_so_far=no
@@ -14106,19 +14081,6 @@
 
 fi
 
-for ac_header in sys/ioctl.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "sys/ioctl.h" "ac_cv_header_sys_ioctl_h" "$ac_includes_default"
-if test "x$ac_cv_header_sys_ioctl_h" = x""yes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_SYS_IOCTL_H 1
-_ACEOF
-
-fi
-
-done
-
-
 if test -f /usr/lpp/X11/bin/smt.exp; then
 
 $as_echo "#define HAVE_AIX_SMT_EXP 1" >>confdefs.h
@@ -14139,7 +14101,7 @@
 fi
 
 ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default"
-if test "x$ac_cv_type_pid_t" = x""yes; then :
+if test "x$ac_cv_type_pid_t" = xyes; then :
 
 else
 
@@ -14152,7 +14114,7 @@
 for ac_header in vfork.h
 do :
   ac_fn_c_check_header_mongrel "$LINENO" "vfork.h" "ac_cv_header_vfork_h" "$ac_includes_default"
-if test "x$ac_cv_header_vfork_h" = x""yes; then :
+if test "x$ac_cv_header_vfork_h" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_VFORK_H 1
 _ACEOF
@@ -14165,8 +14127,7 @@
 do :
   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-eval as_val=\$$as_ac_var
-   if test "x$as_val" = x""yes; then :
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
@@ -14177,7 +14138,7 @@
 if test "x$ac_cv_func_fork" = xyes; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fork" >&5
 $as_echo_n "checking for working fork... " >&6; }
-if test "${ac_cv_func_fork_works+set}" = set; then :
+if ${ac_cv_func_fork_works+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then :
@@ -14230,7 +14191,7 @@
 if test "x$ac_cv_func_vfork" = xyes; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working vfork" >&5
 $as_echo_n "checking for working vfork... " >&6; }
-if test "${ac_cv_func_vfork_works+set}" = set; then :
+if ${ac_cv_func_vfork_works+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then :
@@ -14366,7 +14327,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nl_langinfo and CODESET" >&5
 $as_echo_n "checking for nl_langinfo and CODESET... " >&6; }
-if test "${emacs_cv_langinfo_codeset+set}" = set; then :
+if ${emacs_cv_langinfo_codeset+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -14398,7 +14359,7 @@
 fi
 
 ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default"
-if test "x$ac_cv_type_size_t" = x""yes; then :
+if test "x$ac_cv_type_size_t" = xyes; then :
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_SIZE_T 1
@@ -14410,7 +14371,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mbstate_t" >&5
 $as_echo_n "checking for mbstate_t... " >&6; }
-if test "${ac_cv_type_mbstate_t+set}" = set; then :
+if ${ac_cv_type_mbstate_t+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -14446,7 +14407,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C restrict keyword" >&5
 $as_echo_n "checking for C restrict keyword... " >&6; }
-if test "${emacs_cv_c_restrict+set}" = set; then :
+if ${emacs_cv_c_restrict+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -14500,7 +14461,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C restricted array declarations" >&5
 $as_echo_n "checking for C restricted array declarations... " >&6; }
-if test "${emacs_cv_c_restrict_arr+set}" = set; then :
+if ${emacs_cv_c_restrict_arr+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -14540,14 +14501,14 @@
    && test x"`$CC --version 2> /dev/null | grep 'gcc.* 4.5.0'`" != x \
    && test x"`echo $CFLAGS | grep '\-O[23]'`" != x \
    && test x"`echo $CFLAGS | grep '\-fno-optimize-sibling-calls'`" = x; then
-   as_fn_error "GCC 4.5.0 has problems compiling Emacs; see etc/PROBLEMS'." "$LINENO" 5
+   as_fn_error $? "GCC 4.5.0 has problems compiling Emacs; see etc/PROBLEMS'." "$LINENO" 5
 fi
 
 #### Find out which version of Emacs this is.
 version=`grep 'const char emacs_version' ${srcdir}/src/emacs.c \
 	 | sed -e 's/^[^"]*"\([^"]*\)".*$/\1/'`
 if test x"${version}" = x; then
-  as_fn_error "can't find current emacs version in \`${srcdir}/src/emacs.c'." "$LINENO" 5
+  as_fn_error $? "can't find current emacs version in \`${srcdir}/src/emacs.c'." "$LINENO" 5
 fi
 if test x"${version}" != x"$PACKAGE_VERSION"; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: version mismatch between \`${srcdir}/configure.in' and \`${srcdir}/src/emacs.c'." >&5
@@ -14588,6 +14549,12 @@
 
 ## Used in lwlib/Makefile.in.
 
+if test -n "${machfile}"; then
+  M_FILE="\$(srcdir)/${machfile}"
+else
+  M_FILE=
+fi
+S_FILE="\$(srcdir)/${opsysfile}"
 
 
 
@@ -14608,11 +14575,13 @@
 #define EMACS_CONFIG_OPTIONS "${ac_configure_args}"
 _ACEOF
 
+if test -n "$machfile"; then
 
 cat >>confdefs.h <<_ACEOF
 #define config_machfile "${machfile}"
 _ACEOF
 
+fi
 
 cat >>confdefs.h <<_ACEOF
 #define config_opsysfile "${opsysfile}"
@@ -14888,16 +14857,18 @@
     gnu-*)
       ## armin76@gentoo.org reported that the lgcc_s flag is necessary to
       ## build on ARM EABI under GNU/Linux.  (Bug#5518)
-      ## Note that m/arm.h never bothered to undefine LIB_GCC first.
-      if test "$machine" = "arm"; then
+      case $host_cpu in
+      arm*)
         LIB_GCC="-lgcc_s"
-      else
+	;;
+      *)
         ## FIXME? s/gnu-linux.h used to define LIB_GCC as below, then
         ## immediately undefine it again and redefine it to empty.
         ## Was the C_SWITCH_X_SITE part really necessary?
 ##      LIB_GCC=`$CC $C_SWITCH_X_SITE -print-libgcc-file-name`
         LIB_GCC=
-      fi
+	;;
+      esac
       ;;
 
     ## Ask GCC where to find libgcc.a.
@@ -14939,12 +14910,17 @@
   USE_X_TOOLKIT=GTK
 fi
 
+and_machfile=
+if test -n "$machfile"; then
+  and_machfile=" and \`${machfile}'"
+fi
+
 echo "
 Configured for \`${canonical}'.
 
   Where should the build process find the source code?    ${srcdir}
   What operating system and machine description files should Emacs use?
-        \`${opsysfile}' and \`${machfile}'
+        \`${opsysfile}'${and_machfile}
   What compiler should emacs be built with?               ${CC} ${CFLAGS}
   Should Emacs use the GNU version of malloc?             ${GNU_MALLOC}${GNU_MALLOC_reason}
   Should Emacs use a relocating allocator for buffers?    ${REL_ALLOC}
@@ -15084,10 +15060,21 @@
      :end' >>confcache
 if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
   if test -w "$cache_file"; then
-    test "x$cache_file" != "x/dev/null" &&
+    if test "x$cache_file" != "x/dev/null"; then
       { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
 $as_echo "$as_me: updating cache $cache_file" >&6;}
-    cat confcache >$cache_file
+      if test ! -f "$cache_file" || test -h "$cache_file"; then
+	cat confcache >"$cache_file"
+      else
+        case $cache_file in #(
+        */* | ?:*)
+	  mv -f confcache "$cache_file"$$ &&
+	  mv -f "$cache_file"$$ "$cache_file" ;; #(
+        *)
+	  mv -f confcache "$cache_file" ;;
+	esac
+      fi
+    fi
   else
     { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
@@ -15103,6 +15090,7 @@
 
 ac_libobjs=
 ac_ltlibobjs=
+U=
 for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
   # 1. Remove the extension, and $U if already installed.
   ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
@@ -15119,7 +15107,7 @@
 
 
 
-: ${CONFIG_STATUS=./config.status}
+: "${CONFIG_STATUS=./config.status}"
 ac_write_fail=0
 ac_clean_files_save=$ac_clean_files
 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
@@ -15220,6 +15208,7 @@
 IFS=" ""	$as_nl"
 
 # Find who we are.  Look in the path if we contain no directory separator.
+as_myself=
 case $0 in #((
   *[\\/]* ) as_myself=$0 ;;
   *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -15265,19 +15254,19 @@
 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
 
 
-# as_fn_error ERROR [LINENO LOG_FD]
-# ---------------------------------
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
 # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
 # provided, also output the error to LOG_FD, referencing LINENO. Then exit the
-# script with status $?, using 1 if that was 0.
+# script with STATUS, using 1 if that was 0.
 as_fn_error ()
 {
-  as_status=$?; test $as_status -eq 0 && as_status=1
-  if test "$3"; then
-    as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-    $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3
-  fi
-  $as_echo "$as_me: error: $1" >&2
+  as_status=$1; test $as_status -eq 0 && as_status=1
+  if test "$4"; then
+    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+  fi
+  $as_echo "$as_me: error: $2" >&2
   as_fn_exit $as_status
 } # as_fn_error
 
@@ -15473,7 +15462,7 @@
       test -d "$as_dir" && break
     done
     test -z "$as_dirs" || eval "mkdir $as_dirs"
-  } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir"
+  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
 
 
 } # as_fn_mkdir_p
@@ -15527,7 +15516,7 @@
 # values after options handling.
 ac_log="
 This file was extended by emacs $as_me 24.0.50, which was
-generated by GNU Autoconf 2.65.  Invocation command line was
+generated by GNU Autoconf 2.68.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
   CONFIG_HEADERS  = $CONFIG_HEADERS
@@ -15593,10 +15582,10 @@
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
 emacs config.status 24.0.50
-configured by $0, generated by GNU Autoconf 2.65,
+configured by $0, generated by GNU Autoconf 2.68,
   with options \\"\$ac_cs_config\\"
 
-Copyright (C) 2009 Free Software Foundation, Inc.
+Copyright (C) 2010 Free Software Foundation, Inc.
 This config.status script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it."
 
@@ -15612,11 +15601,16 @@
 while test $# != 0
 do
   case $1 in
-  --*=*)
+  --*=?*)
     ac_option=`expr "X$1" : 'X\([^=]*\)='`
     ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
     ac_shift=:
     ;;
+  --*=)
+    ac_option=`expr "X$1" : 'X\([^=]*\)='`
+    ac_optarg=
+    ac_shift=:
+    ;;
   *)
     ac_option=$1
     ac_optarg=$2
@@ -15638,6 +15632,7 @@
     $ac_shift
     case $ac_optarg in
     *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    '') as_fn_error $? "missing file argument" ;;
     esac
     as_fn_append CONFIG_FILES " '$ac_optarg'"
     ac_need_defaults=false;;
@@ -15650,7 +15645,7 @@
     ac_need_defaults=false;;
   --he | --h)
     # Conflict between --help and --header
-    as_fn_error "ambiguous option: \`$1'
+    as_fn_error $? "ambiguous option: \`$1'
 Try \`$0 --help' for more information.";;
   --help | --hel | -h )
     $as_echo "$ac_cs_usage"; exit ;;
@@ -15659,7 +15654,7 @@
     ac_cs_silent=: ;;
 
   # This is an error.
-  -*) as_fn_error "unrecognized option: \`$1'
+  -*) as_fn_error $? "unrecognized option: \`$1'
 Try \`$0 --help' for more information." ;;
 
   *) as_fn_append ac_config_targets " $1"
@@ -15727,7 +15722,7 @@
     "leim/Makefile") CONFIG_FILES="$CONFIG_FILES leim/Makefile" ;;
     "default") CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
 
-  *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
+  *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
   esac
 done
 
@@ -15750,9 +15745,10 @@
 # after its creation but before its name has been assigned to `$tmp'.
 $debug ||
 {
-  tmp=
+  tmp= ac_tmp=
   trap 'exit_status=$?
-  { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
+  : "${ac_tmp:=$tmp}"
+  { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
 ' 0
   trap 'as_fn_exit 1' 1 2 13 15
 }
@@ -15760,12 +15756,13 @@
 
 {
   tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
-  test -n "$tmp" && test -d "$tmp"
+  test -d "$tmp"
 }  ||
 {
   tmp=./conf$$-$RANDOM
   (umask 077 && mkdir "$tmp")
-} || as_fn_error "cannot create a temporary directory in ." "$LINENO" 5
+} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
+ac_tmp=$tmp
 
 # Set up the scripts for CONFIG_FILES section.
 # No need to generate them if there are no CONFIG_FILES.
@@ -15799,24 +15796,24 @@
 fi
 ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
 if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
-  ac_cs_awk_cr='\r'
+  ac_cs_awk_cr='\\r'
 else
   ac_cs_awk_cr=$ac_cr
 fi
 
-echo 'BEGIN {' >"$tmp/subs1.awk" &&
+echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
 _ACEOF
 
 # Create commands to substitute file output variables.
 {
   echo "cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1" &&
-  echo 'cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&' &&
+  echo 'cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&' &&
   echo "$ac_subst_files" | sed 's/.*/F["&"]="$&"/' &&
   echo "_ACAWK" &&
   echo "_ACEOF"
 } >conf$$files.sh &&
 . ./conf$$files.sh ||
-  as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
+  as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
 rm -f conf$$files.sh
 
 {
@@ -15824,18 +15821,18 @@
   echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
   echo "_ACEOF"
 } >conf$$subs.sh ||
-  as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
-ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'`
+  as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
 ac_delim='%!_!# '
 for ac_last_try in false false false false false :; do
   . ./conf$$subs.sh ||
-    as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
+    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
 
   ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
   if test $ac_delim_n = $ac_delim_num; then
     break
   elif $ac_last_try; then
-    as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
+    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
   else
     ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
   fi
@@ -15843,7 +15840,7 @@
 rm -f conf$$subs.sh
 
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
+cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
 _ACEOF
 sed -n '
 h
@@ -15891,7 +15888,7 @@
 rm -f conf$$subs.awk
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 _ACAWK
-cat >>"\$tmp/subs1.awk" <<_ACAWK &&
+cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
   for (key in S) S_is_set[key] = 1
   FS = ""
   \$ac_cs_awk_pipe_init
@@ -15929,21 +15926,29 @@
   sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
 else
   cat
-fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
-  || as_fn_error "could not setup config files machinery" "$LINENO" 5
-_ACEOF
-
-# VPATH may cause trouble with some makes, so we remove $(srcdir),
-# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
+  || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
+_ACEOF
+
+# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
+# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
 # trailing colons and then remove the whole line if VPATH becomes empty
 # (actually we leave an empty line to preserve line numbers).
 if test "x$srcdir" = x.; then
-  ac_vpsub='/^[	 ]*VPATH[	 ]*=/{
-s/:*\$(srcdir):*/:/
-s/:*\${srcdir}:*/:/
-s/:*@srcdir@:*/:/
-s/^\([^=]*=[	 ]*\):*/\1/
+  ac_vpsub='/^[	 ]*VPATH[	 ]*=[	 ]*/{
+h
+s///
+s/^/:/
+s/[	 ]*$/:/
+s/:\$(srcdir):/:/g
+s/:\${srcdir}:/:/g
+s/:@srcdir@:/:/g
+s/^:*//
 s/:*$//
+x
+s/\(=[	 ]*\).*/\1/
+G
+s/\n//
 s/^[^=]*=[	 ]*$//
 }'
 fi
@@ -15955,7 +15960,7 @@
 # No need to generate them if there are no CONFIG_HEADERS.
 # This happens for instance with `./config.status Makefile'.
 if test -n "$CONFIG_HEADERS"; then
-cat >"$tmp/defines.awk" <<\_ACAWK ||
+cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
 BEGIN {
 _ACEOF
 
@@ -15967,11 +15972,11 @@
 # handling of long lines.
 ac_delim='%!_!# '
 for ac_last_try in false false :; do
-  ac_t=`sed -n "/$ac_delim/p" confdefs.h`
-  if test -z "$ac_t"; then
+  ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
+  if test -z "$ac_tt"; then
     break
   elif $ac_last_try; then
-    as_fn_error "could not make $CONFIG_HEADERS" "$LINENO" 5
+    as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
   else
     ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
   fi
@@ -16056,7 +16061,7 @@
 _ACAWK
 _ACEOF
 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-  as_fn_error "could not setup config headers machinery" "$LINENO" 5
+  as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
 fi # test -n "$CONFIG_HEADERS"
 
 
@@ -16069,7 +16074,7 @@
   esac
   case $ac_mode$ac_tag in
   :[FHL]*:*);;
-  :L* | :C*:*) as_fn_error "invalid tag \`$ac_tag'" "$LINENO" 5;;
+  :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
   :[FH]-) ac_tag=-:-;;
   :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
   esac
@@ -16088,7 +16093,7 @@
     for ac_f
     do
       case $ac_f in
-      -) ac_f="$tmp/stdin";;
+      -) ac_f="$ac_tmp/stdin";;
       *) # Look for the file first in the build tree, then in the source tree
 	 # (if the path is not absolute).  The absolute path cannot be DOS-style,
 	 # because $ac_f cannot contain `:'.
@@ -16097,7 +16102,7 @@
 	   [\\/$]*) false;;
 	   *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
 	   esac ||
-	   as_fn_error "cannot find input file: \`$ac_f'" "$LINENO" 5;;
+	   as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
       esac
       case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
       as_fn_append ac_file_inputs " '$ac_f'"
@@ -16123,8 +16128,8 @@
     esac
 
     case $ac_tag in
-    *:-:* | *:-) cat >"$tmp/stdin" \
-      || as_fn_error "could not create $ac_file" "$LINENO" 5 ;;
+    *:-:* | *:-) cat >"$ac_tmp/stdin" \
+      || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
     esac
     ;;
   esac
@@ -16256,26 +16261,27 @@
 "
 eval sed \"\$ac_sed_extra\" "$ac_file_inputs" |
 if $ac_cs_awk_getline; then
-  $AWK -f "$tmp/subs.awk"
-else
-  $AWK -f "$tmp/subs.awk" | $SHELL
-fi >$tmp/out \
-  || as_fn_error "could not create $ac_file" "$LINENO" 5
+  $AWK -f "$ac_tmp/subs.awk"
+else
+  $AWK -f "$ac_tmp/subs.awk" | $SHELL
+fi \
+  >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
 
 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
-  { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
-  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
+  { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' \
+      "$ac_tmp/out"`; test -z "$ac_out"; } &&
   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined.  Please make sure it is defined." >&5
+which seems to be undefined.  Please make sure it is defined" >&5
 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined.  Please make sure it is defined." >&2;}
-
-  rm -f "$tmp/stdin"
+which seems to be undefined.  Please make sure it is defined" >&2;}
+
+  rm -f "$ac_tmp/stdin"
   case $ac_file in
-  -) cat "$tmp/out" && rm -f "$tmp/out";;
-  *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
+  -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
+  *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
   esac \
-  || as_fn_error "could not create $ac_file" "$LINENO" 5
+  || as_fn_error $? "could not create $ac_file" "$LINENO" 5
  ;;
   :H)
   #
@@ -16284,21 +16290,21 @@
   if test x"$ac_file" != x-; then
     {
       $as_echo "/* $configure_input  */" \
-      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs"
-    } >"$tmp/config.h" \
-      || as_fn_error "could not create $ac_file" "$LINENO" 5
-    if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then
+      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
+    } >"$ac_tmp/config.h" \
+      || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+    if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
       { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
 $as_echo "$as_me: $ac_file is unchanged" >&6;}
     else
       rm -f "$ac_file"
-      mv "$tmp/config.h" "$ac_file" \
-	|| as_fn_error "could not create $ac_file" "$LINENO" 5
+      mv "$ac_tmp/config.h" "$ac_file" \
+	|| as_fn_error $? "could not create $ac_file" "$LINENO" 5
     fi
   else
     $as_echo "/* $configure_input  */" \
-      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \
-      || as_fn_error "could not create -" "$LINENO" 5
+      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
+      || as_fn_error $? "could not create -" "$LINENO" 5
   fi
  ;;
 
@@ -16335,7 +16341,7 @@
 ac_clean_files=$ac_clean_files_save
 
 test $ac_write_fail = 0 ||
-  as_fn_error "write failure creating $CONFIG_STATUS" "$LINENO" 5
+  as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
 
 
 # configure is writing to config.log, and then calls config.status.
@@ -16356,7 +16362,7 @@
   exec 5>>config.log
   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
   # would make configure fail if this is the last instruction.
-  $ac_cs_success || as_fn_exit $?
+  $ac_cs_success || as_fn_exit 1
 fi
 if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
--- a/configure.in	Thu Dec 16 17:43:45 2010 -0500
+++ b/configure.in	Thu Dec 16 18:30:57 2010 -0500
@@ -412,13 +412,27 @@
 machine='' opsys='' unported=no
 case "${canonical}" in
 
+  ## GNU/Linux ports
+  *-*-linux-gnu*)
+    opsys=gnu-linux
+    case ${canonical} in
+      alpha*)	machine=alpha ;;
+      s390-*)	machine=ibms390 ;;
+      s390x-*)	machine=ibms390x ;;
+      powerpc*)	machine=macppc ;;
+      sparc*)	machine=sparc ;;
+      ia64*)	machine=ia64 ;;
+      m68k*)	machine=m68k ;;
+      x86_64*)	machine=amdx86-64 ;;
+    esac
+  ;;
+
   ## FreeBSD ports
   *-*-freebsd* )
     opsys=freebsd
     case "${canonical}" in
       alpha*)           machine=alpha ;;
       amd64-*|x86_64-*) machine=amdx86-64 ;;
-      arm*)             machine=arm ;;
       ia64-*)           machine=ia64 ;;
       i[3456]86-*)      machine=intel386 ;;
       powerpc-*)        machine=macppc ;;
@@ -447,13 +461,9 @@
     case "${canonical}" in
       alpha*)      machine=alpha ;;
       x86_64-*)    machine=amdx86-64 ;;
-      arm-*)       machine=arm ;;
-      hppa-*)      machine=hp800 ;;
       i[3456]86-*) machine=intel386 ;;
       m68k-*)      machine=m68k ;;
       powerpc-*)   machine=macppc ;;
-      mips-*)      machine=mips ;;
-      mipse[bl]-*) machine=mips ;;
       sparc*-)     machine=sparc ;;
       vax-*)       machine=vax ;;
     esac
@@ -465,8 +475,6 @@
     case "${canonical}" in
       alpha*)    machine=alpha ;;
       x86_64-*)  machine=amdx86-64 ;;
-      arm-*)     machine=arm ;;
-      hppa-*)    machine=hp800 ;;
       i386-*)    machine=intel386 ;;
       powerpc-*) machine=macppc ;;
       sparc*)    machine=sparc ;;
@@ -474,14 +482,6 @@
     esac
   ;;
 
-  alpha*-*-linux-gnu* )
-    machine=alpha opsys=gnu-linux
-  ;;
-
-  arm*-*-linux-gnu* )
-    machine=arm opsys=gnu-linux
-  ;;
-
   ## Apple Darwin / Mac OS X
   *-apple-darwin* )
     case "${canonical}" in
@@ -503,24 +503,14 @@
 
   ## HP 9000 series 700 and 800, running HP/UX
   hppa*-hp-hpux10.2* )
-    machine=hp800 opsys=hpux10-20
+    opsys=hpux10-20
   ;;
   hppa*-hp-hpux1[1-9]* )
-    machine=hp800 opsys=hpux11
+    opsys=hpux11
     CFLAGS="-D_INCLUDE__STDC_A1_SOURCE $CFLAGS"
   ;;
 
-  hppa*-*-linux-gnu* )
-    machine=hp800 opsys=gnu-linux
-  ;;
-
   ## IBM machines
-  s390-*-linux-gnu* )
-    machine=ibms390 opsys=gnu-linux
-  ;;
-  s390x-*-linux-gnu* )
-    machine=ibms390x opsys=gnu-linux
-  ;;
   rs6000-ibm-aix4.[23]* )
     machine=ibmrs6000 opsys=aix4-2
   ;;
@@ -534,11 +524,6 @@
     machine=ibmrs6000 opsys=aix4-2
   ;;
 
-  ## Macintosh PowerPC
-  powerpc*-*-linux-gnu* )
-    machine=macppc opsys=gnu-linux
-  ;;
-
   ## Silicon Graphics machines
   ## Iris 4D
   mips-sgi-irix6.5 )
@@ -551,10 +536,6 @@
   ;;
 
   ## Suns
-  sparc-*-linux-gnu* | sparc64-*-linux-gnu* )
-    machine=sparc opsys=gnu-linux
-  ;;
-
   *-sun-solaris* \
     | i[3456]86-*-solaris2* | i[3456]86-*-sunos5* \
     | x86_64-*-solaris2*    | x86_64-*-sunos5*)
@@ -594,11 +575,6 @@
     esac
   ;;
 
-  ## IA-64
-  ia64*-*-linux* )
-    machine=ia64 opsys=gnu-linux
-  ;;
-
   ## Intel 386 machines where we don't care about the manufacturer.
   i[3456]86-*-* )
     machine=intel386
@@ -607,7 +583,6 @@
       *-darwin* )               opsys=darwin
                                 CPP="${CC-cc} -E -no-cpp-precomp"
  				;;
-      *-linux-gnu* )		opsys=gnu-linux ;;
       *-sysv4.2uw* )	  	opsys=unixware; NON_GNU_CPP=/lib/cpp ;;
       *-sysv5uw* )	  	opsys=unixware; NON_GNU_CPP=/lib/cpp ;;
       *-sysv5OpenUNIX* )  	opsys=unixware; NON_GNU_CPP=/lib/cpp ;;
@@ -615,32 +590,6 @@
     esac
   ;;
 
-  ## m68k Linux-based GNU system
-  m68k-*-linux-gnu* )
-    machine=m68k opsys=gnu-linux
-  ;;
-
-  ## Mips Linux-based GNU system
-  mips-*-linux-gnu* | mipsel-*-linux-gnu* \
-    | mips64-*-linux-gnu* | mips64el-*-linux-gnu* )
-    machine=mips opsys=gnu-linux
-  ;;
-
-  ## AMD x86-64 Linux-based GNU system
-  x86_64-*-linux-gnu* )
-    machine=amdx86-64 opsys=gnu-linux
-  ;;
-
-  ## Tensilica Xtensa Linux-based GNU system
-  xtensa*-*-linux-gnu* )
-    machine=xtensa opsys=gnu-linux
-    ;;
-
-  ## SuperH Linux-based GNU system
-  sh[34]*-*-linux-gnu* )
-    machine=sh3 opsys=gnu-linux
-  ;;
-
   * )
     unported=yes
   ;;
@@ -669,7 +618,11 @@
 Check `etc/MACHINES' for recognized configuration names.])
 fi
 
-machfile="m/${machine}.h"
+if test -n "$machine"; then
+  machfile="m/${machine}.h"
+else
+  machfile=
+fi
 opsysfile="s/${opsys}.h"
 
 
@@ -936,7 +889,7 @@
 
   gnu-linux)
    ## cpp test was "ifdef __mips__", but presumably this is equivalent...
-   test "$machine" = "mips" && LD_SWITCH_SYSTEM="-G 0"
+   case $host_cpu in mips*) LD_SWITCH_SYSTEM="-G 0";; esac
    ;;
 
   netbsd)
@@ -2097,8 +2050,8 @@
 dnl FIXME the logic here seems weird, but this is what cpp was doing.
 dnl Why not just test for libxmu in the normal way?
 LIBXMU=-lXmu
-case "$machine" in
-  ## These machines don't supply Xmu.
+case $opsys in
+  ## These systems don't supply Xmu.
   hpux* | aix4-2 )
     test "X$ac_cv_lib_Xmu_XmuConvertStandardSelection" != "Xyes" && LIBXMU=
     ;;
@@ -3028,8 +2981,6 @@
 	    [Define to 1 if you have inet sockets.])
 fi
 
-AC_CHECK_HEADERS(sys/ioctl.h)
-
 if test -f /usr/lpp/X11/bin/smt.exp; then
   AC_DEFINE(HAVE_AIX_SMT_EXP, 1,
 	    [Define to 1 if the file /usr/lpp/X11/bin/smt.exp exists.])
@@ -3157,8 +3108,14 @@
 AC_SUBST(CFLAGS)
 ## Used in lwlib/Makefile.in.
 AC_SUBST(X_TOOLKIT_TYPE)
-AC_SUBST(machfile)
-AC_SUBST(opsysfile)
+if test -n "${machfile}"; then
+  M_FILE="\$(srcdir)/${machfile}"
+else
+  M_FILE=
+fi
+S_FILE="\$(srcdir)/${opsysfile}"
+AC_SUBST(M_FILE)
+AC_SUBST(S_FILE)
 AC_SUBST(GETLOADAVG_LIBS)
 AC_SUBST(ns_appdir)
 AC_SUBST(ns_appbindir)
@@ -3171,8 +3128,10 @@
 		   [Define to the canonical Emacs configuration name.])
 AC_DEFINE_UNQUOTED(EMACS_CONFIG_OPTIONS, "${ac_configure_args}",
 		   [Define to the options passed to configure.])
-AC_DEFINE_UNQUOTED(config_machfile,  "${machfile}",
-		   [Define to the used machine dependent file.])
+if test -n "$machfile"; then
+  AC_DEFINE_UNQUOTED(config_machfile,  "${machfile}",
+		     [Define to the used machine dependent file.])
+fi
 AC_DEFINE_UNQUOTED(config_opsysfile, "${opsysfile}",
 		   [Define to the used os dependent file.])
 
@@ -3436,16 +3395,18 @@
     gnu-*)
       ## armin76@gentoo.org reported that the lgcc_s flag is necessary to
       ## build on ARM EABI under GNU/Linux.  (Bug#5518)
-      ## Note that m/arm.h never bothered to undefine LIB_GCC first.
-      if test "$machine" = "arm"; then
+      case $host_cpu in
+      arm*)
         LIB_GCC="-lgcc_s"
-      else
+	;;
+      *)
         ## FIXME? s/gnu-linux.h used to define LIB_GCC as below, then
         ## immediately undefine it again and redefine it to empty.
         ## Was the C_SWITCH_X_SITE part really necessary?
 ##      LIB_GCC=`$CC $C_SWITCH_X_SITE -print-libgcc-file-name`
         LIB_GCC=
-      fi
+	;;
+      esac
       ;;
 
     ## Ask GCC where to find libgcc.a.
@@ -3527,7 +3488,9 @@
 
 /* Include the os and machine dependent files.  */
 #include config_opsysfile
-#include config_machfile
+#ifdef config_machfile
+# include config_machfile
+#endif
 
 /* GNUstep needs a bit more pure memory.  Of the existing knobs,
    SYSTEM_PURESIZE_EXTRA seems like the least likely to cause problems.
@@ -3635,6 +3598,12 @@
 #define NO_INLINE
 #endif
 
+#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1))
+#define EXTERNALLY_VISIBLE __attribute__((externally_visible))
+#else
+#define EXTERNALLY_VISIBLE
+#endif
+
 /* Some versions of GNU/Linux define noinline in their headers.  */
 #ifdef noinline
 #undef noinline
@@ -3669,12 +3638,17 @@
   USE_X_TOOLKIT=GTK
 fi
 
+and_machfile=
+if test -n "$machfile"; then
+  and_machfile=" and \`${machfile}'"
+fi
+
 echo "
 Configured for \`${canonical}'.
 
   Where should the build process find the source code?    ${srcdir}
   What operating system and machine description files should Emacs use?
-        \`${opsysfile}' and \`${machfile}'
+        \`${opsysfile}'${and_machfile}
   What compiler should emacs be built with?               ${CC} ${CFLAGS}
   Should Emacs use the GNU version of malloc?             ${GNU_MALLOC}${GNU_MALLOC_reason}
   Should Emacs use a relocating allocator for buffers?    ${REL_ALLOC}
--- a/doc/emacs/ChangeLog	Thu Dec 16 17:43:45 2010 -0500
+++ b/doc/emacs/ChangeLog	Thu Dec 16 18:30:57 2010 -0500
@@ -1,3 +1,56 @@
+2010-12-13  Eli Zaretskii  <eliz@gnu.org>
+
+	* custom.texi (Init Syntax): Add index entries for "character syntax".
+	(Bug#7576)
+
+2010-12-13  Karel Klíč  <kklic@redhat.com>
+
+	* text.texi (HTML Mode): Small fixes.  (Bug#7607)
+
+2010-12-13  Glenn Morris  <rgm@gnu.org>
+
+	* trouble.texi (Checklist): Fix typo in newsgroup name.
+
+2010-12-13  Chong Yidong  <cyd@stupidchicken.com>
+
+	* search.texi (Word Search): Note that the lazy highlight always
+	matches to whole words (Bug#7470).
+
+2010-12-13  Eli Zaretskii  <eliz@gnu.org>
+
+	* display.texi (Optional Mode Line): Make the description of
+	load-average more accurate.
+
+	* msdog.texi (Windows HOME): Mention that HOME can also be set in the
+	registry, with a cross-reference.
+	(Windows Startup): New node.  Move the stuff about the current
+	directory from "Windows HOME".
+
+2010-11-27  Bob Rogers  <rogers-emacs@rgrjr.dyndns.org>
+
+	* maintaining.texi (VC With A Locking VCS, VC Directory Commands):
+	* vc1-xtra.texi (Customizing VC, General VC Options): Small fixes.
+
+2010-11-27  Chong Yidong  <cyd@stupidchicken.com>
+
+	* maintaining.texi (Version Control Systems): Fix repeated sentence.
+	Suggested by Štěpán Němec.
+
+2010-11-27  Chong Yidong  <cyd@stupidchicken.com>
+
+	* maintaining.texi (Version Control): Say "commit", not "check in".
+	(Version Control Systems): Simplify descriptions.
+	(VCS Merging, VCS Changesets, VCS Repositories): New nodes, split from
+	VCS Concepts.
+	(VC Mode Line): Update example.
+	(Old Revisions): Document revert-buffer for vc-diff.
+	(Log Buffer): Promote to a subsection.  Document header lines.
+
+	* macos.texi (Mac / GNUstep Basics): Document
+	ns-right-alternate-modifier.
+
+	* emacs.texi (Top): Update node listing.
+
 2010-11-13  Eli Zaretskii  <eliz@gnu.org>
 
 	* rmail.texi (Rmail Coding): Characters with no fonts are not
--- a/doc/emacs/custom.texi	Thu Dec 16 17:43:45 2010 -0500
+++ b/doc/emacs/custom.texi	Thu Dec 16 18:30:57 2010 -0500
@@ -2234,6 +2234,8 @@
 non-@acronym{ASCII} in your init file.
 
 @item Characters:
+@cindex Lisp character syntax
+@cindex character syntax
 Lisp character constant syntax consists of a @samp{?} followed by
 either a character or an escape sequence starting with @samp{\}.
 Examples: @code{?x}, @code{?\n}, @code{?\"}, @code{?\)}.  Note that
@@ -2250,6 +2252,7 @@
 @code{nil} stands for `false'.
 
 @item Other Lisp objects:
+@cindex Lisp object syntax
 Write a single-quote (@code{'}) followed by the Lisp object you want.
 @end table
 
--- a/doc/emacs/display.texi	Thu Dec 16 17:43:45 2010 -0500
+++ b/doc/emacs/display.texi	Thu Dec 16 18:30:57 2010 -0500
@@ -1010,11 +1010,12 @@
 @noindent
 @vindex display-time-24hr-format
 Here @var{hh} and @var{mm} are the hour and minute, followed always by
-@samp{am} or @samp{pm}.  @var{l.ll} is the average number of running
-processes in the whole system recently.  (Some fields may be missing if
-your operating system cannot support them.)  If you prefer time display
-in 24-hour format, set the variable @code{display-time-24hr-format}
-to @code{t}.
+@samp{am} or @samp{pm}.  @var{l.ll} is the average number, collected
+for the last few minutes, of processes in the whole system that were
+either running or ready to run (i.e.@: were waiting for an available
+processor).  (Some fields may be missing if your operating system
+cannot support them.)  If you prefer time display in 24-hour format,
+set the variable @code{display-time-24hr-format} to @code{t}.
 
 @cindex mail (on mode line)
 @vindex display-time-use-mail-icon
--- a/doc/emacs/emacs.texi	Thu Dec 16 17:43:45 2010 -0500
+++ b/doc/emacs/emacs.texi	Thu Dec 16 18:30:57 2010 -0500
@@ -771,6 +771,7 @@
 * Introduction to VC::  How version control works in general.
 * VC Mode Line::        How the mode line shows version control status.
 * Basic VC Editing::    How to edit a file under version control.
+* Log Buffer::          Features available in log entry buffers.
 * Old Revisions::       Examining and comparing old versions.
 * Secondary VC Commands:: The commands used a little less frequently.
 * VC Directory Mode::   Listing files managed by version control.
@@ -785,6 +786,9 @@
 * Why Version Control?::    Understanding the problems it addresses.
 * Version Control Systems:: Supported version control back-end systems.
 * VCS Concepts::            Words and concepts related to version control.
+* VCS Merging::             How file conflicts are handled.
+* VCS Changesets::          Changesets in version control.
+* VCS Repositories::        Where version control repositories are stored.
 * Types of Log File::       The VCS log in contrast to the ChangeLog.
 
 Basic Editing under Version Control
@@ -792,7 +796,6 @@
 * VC With A Merging VCS::  Without locking: default mode for CVS.
 * VC With A Locking VCS::  RCS in its default mode, SCCS, and optionally CVS.
 * Advanced C-x v v::       Advanced features available with a prefix argument.
-* Log Buffer::             Features available in log entry buffers.
 
 The Secondary Commands of VC
 
@@ -1189,6 +1192,7 @@
 
 Emacs and Microsoft Windows/MS-DOS
 
+* Windows Startup::     How to start Emacs on Windows.
 * Text and Binary::     Text files use CRLF to terminate lines.
 * Windows Files::       File-name conventions on Windows.
 * ls in Lisp::          Emulation of @code{ls} for Dired.
--- a/doc/emacs/macos.texi	Thu Dec 16 17:43:45 2010 -0500
+++ b/doc/emacs/macos.texi	Thu Dec 16 18:30:57 2010 -0500
@@ -8,23 +8,22 @@
 @cindex Macintosh
 @cindex GNUstep
 
-  This section briefly describes the peculiarities of using Emacs built with
-the GNUstep libraries on GNU/Linux or other operating systems, or on Mac OS X
-with native window system support.  For Mac OS X, Emacs can be built either
-without window system support, with X11, or with the Cocoa interface.  This
-section only applies to the Cocoa build.  Emacs 23 does not support Mac OS
-Classic.
+  This section describes the peculiarities of using Emacs built with
+the GNUstep libraries on GNU/Linux or other operating systems, or on
+Mac OS X with native window system support.  On Mac OS X, Emacs can be
+built either without window system support, with X11, or with the
+Cocoa interface; this section only applies to the Cocoa build.  Emacs
+does not support earlier versions of Mac OS.
 
-  Emacs, when built on Mac OS X, uses the Cocoa application interface.  For
-various historical and technical reasons, Emacs uses the term @samp{Nextstep}
-internally, instead of ``Cocoa'' or ``Mac OS X''; for instance, most of the
-commands and variables described in the following sections begin with
-@samp{ns-}, which is short for @samp{Nextstep}.  NeXTstep was an application
-interface released by NeXT Inc during the 1980s, of which Cocoa is a direct
-descendant.  Apart from Cocoa, there is another NeXTstep-style system:
-GNUstep, which is free software.  As of this writing, the GNUstep support is
-alpha status (@pxref{GNUstep Support}), but we hope to improve it in the
-future.
+  For various historical and technical reasons, Emacs uses the term
+@samp{Nextstep} internally, instead of ``Cocoa'' or ``Mac OS X''; for
+instance, most of the commands and variables described in this section
+begin with @samp{ns-}, which is short for @samp{Nextstep}.  NeXTstep
+was an application interface released by NeXT Inc during the 1980s, of
+which Cocoa is a direct descendant.  Apart from Cocoa, there is
+another NeXTstep-style system: GNUstep, which is free software.  As of
+this writing, the GNUstep support is alpha status (@pxref{GNUstep
+Support}), but we hope to improve it in the future.
 
 @menu
 * Mac / GNUstep Basics::        Basic Emacs usage under GNUstep or Mac OS.
@@ -37,19 +36,24 @@
 @section Basic Emacs usage under Mac OS and GNUstep
 
   By default, the @key{alt} and @key{option} keys are the same as
-@key{Meta} when running under Mac OS.  The Mac @key{Cmd} key is the
-same as @key{Super}, and Emacs provides a set of keybindings using
-this modifier key that mimic other Mac / GNUstep applications (@pxref{Mac /
-GNUstep Events}).  You can change these bindings in the usual way (@pxref{Key
-Bindings}).
+@key{Meta}.  The Mac @key{Cmd} key is the same as @key{Super}, and
+Emacs provides a set of keybindings using this modifier key that mimic
+other Mac / GNUstep applications (@pxref{Mac / GNUstep Events}).  You
+can change these bindings in the usual way (@pxref{Key Bindings}).
 
-  The standard Mac / GNUstep font and color panels are accessible via Lisp commands.
-  To use the color panel, drag from it to an Emacs frame to change the
-foreground color of the face at that position (if the @key{shift} key
-is held down, it changes the background color instead). To discard the
-settings, create a new frame and close the altered one.
-@c [unclear if the following holds.]
-@c  To finalize the settings for either color or font, choose @samp{Save Options} in the @samp{Options} menu. 
+  The variable @code{ns-right-alternate-modifier} controls the
+behavior of the right @key{alt} and @key{option} keys.  These keys
+behave like the left-hand keys if the value is @code{left} (the
+default).  A value of @code{control}, @code{meta}, @code{alt},
+@code{super}, or @code{hyper} makes them behave like the corresponding
+modifier keys; a value of @code{none} tells Emacs to ignore them.
+
+  The standard Mac / GNUstep font and color panels are accessible via
+Lisp commands.  To use the color panel, drag from it to an Emacs frame
+to change the foreground color of the face at that position (if the
+@key{shift} key is held down, it changes the background color
+instead). To discard the settings, create a new frame and close the
+altered one.
 
   @key{S-Mouse-1} (i.e., clicking the left mouse button
 while holding down the @key{Shift} key) adjusts the region to the
@@ -58,7 +62,7 @@
 @key{S-Mouse-1} normally does (@pxref{Temporary Face Changes}).  This
 change makes Emacs behave more like other Mac / GNUstep applications.
 
-  When you open or save files using the menus, or using the 
+  When you open or save files using the menus, or using the
 @key{Cmd-o} and @key{Cmd-S} bindings, Emacs uses graphical file
 dialogs to read file names.  However, if you use the regular Emacs key
 sequences, such as @key{C-x C-f}, Emacs uses the minibuffer to read
@@ -110,7 +114,7 @@
 background color.
 
 @c To make the changes permanent select the "Save Options"
-@c item in the "Options" menu, or run @code{menu-bar-options-save}. 
+@c item in the "Options" menu, or run @code{menu-bar-options-save}.
 
 Useful in this context is the listing of all faces obtained by @key{M-x}
 @code{list-faces-display}.
@@ -193,7 +197,7 @@
 @code{ns-input-fontsize}, respectively.
 
 @item ns-power-off
-This event occurs when the user logs out and Emacs is still running, or when 
+This event occurs when the user logs out and Emacs is still running, or when
 `Quit Emacs' is chosen from the application menu.
 The default behavior is to save all file-visiting buffers.
 @end table
@@ -208,26 +212,9 @@
 services and receive the results back.  Note that you may need to
 restart Emacs to access newly-available services.
 
-
 @node GNUstep Support, , Mac / GNUstep Events, Mac OS / GNUstep
 @section GNUstep Support
 
-Emacs can be built and run under GNUstep, however there are still some
+Emacs can be built and run under GNUstep, but there are still some
 issues to be addressed.  Interested developers should contact
 @email{emacs-devel@@gnu.org}.
-
-@c Presumably no longer relevant since CANNOT_DUMP removed 2009-05-06:
-@ignore
-In particular, it may be necessary to run @samp{make bootstrap} with a
-plain X configuration, then @samp{make clean} and @samp{./configure
---with-ns} followed by @samp{make install}.
-
-Currently CANNOT_DUMP is automatically enabled in GNUstep configurations,
-because the unex file(s) for GNUstep, mainly @samp{unexelf.c}, have not been
-updated yet with the ``zone'' code in and related to @samp{unexmacosx.c}.
-@end ignore
-
-
-@ignore
-   arch-tag: a822c2ab-4273-4997-927e-c153bb71dcf6
-@end ignore
--- a/doc/emacs/maintaining.texi	Thu Dec 16 17:43:45 2010 -0500
+++ b/doc/emacs/maintaining.texi	Thu Dec 16 18:30:57 2010 -0500
@@ -24,20 +24,20 @@
 @section Version Control
 @cindex version control
 
-  A @dfn{version control system} is a package that can record multiple
+  A @dfn{version control system} is a program that can record multiple
 versions of a source file, storing information such as the creation
-time of each version, who created it, and a description of what was
-changed in that version.
+time of each version, who made it, and a description of what was
+changed.
 
-  The Emacs version control interface is called VC.  Its commands work
-with several different version control systems; currently, it supports
-GNU Arch, Bazaar, CVS, Git, Mercurial, Monotone, RCS, SCCS/CSSC, and
-Subversion.  Of these, the GNU project distributes CVS, GNU Arch, RCS,
-and Bazaar.
+  The Emacs version control interface is called @dfn{VC}.  VC commands
+work with several different version control systems; currently, it
+supports GNU Arch, Bazaar, CVS, Git, Mercurial, Monotone, RCS,
+SCCS/CSSC, and Subversion.  Of these, the GNU project distributes CVS,
+Arch, RCS, and Bazaar.
 
-  VC is enabled automatically whenever you visit a file that is
-governed by a version control system.  To disable VC entirely, set the
-customizable variable @code{vc-handled-backends} to @code{nil}
+  VC is enabled automatically whenever you visit a file governed by a
+version control system.  To disable VC entirely, set the customizable
+variable @code{vc-handled-backends} to @code{nil}
 @iftex
 (@pxref{Customizing VC,,,emacs-xtra, Specialized Emacs Features}).
 @end iftex
@@ -49,6 +49,7 @@
 * Introduction to VC::  How version control works in general.
 * VC Mode Line::        How the mode line shows version control status.
 * Basic VC Editing::    How to edit a file under version control.
+* Log Buffer::          Features available in log entry buffers.
 * Old Revisions::       Examining and comparing old versions.
 * Secondary VC Commands::    The commands used a little less frequently.
 * VC Directory Mode::   Listing files managed by version control.
@@ -65,12 +66,13 @@
 @subsection Introduction to Version Control
 
   VC allows you to use a version control system from within Emacs,
-integrating the version control operations smoothly with editing.
-Though VC cannot completely bridge the gaps between version control
-systems with widely differing capabilities, it does provide a uniform
-interface to many version control operations. Regardless of which
-version control system is in use, you will be able to do basic
-operations in much the same way.
+integrating the version control operations smoothly with editing.  It
+provides a uniform interface for common operations in many version
+control operations.
+
+  Some uncommon or intricate version control operations, such as
+altering repository settings, are not supported in VC.  You should
+perform such tasks outside Emacs, e.g. via the command line.
 
   This section provides a general overview of version control, and
 describes the version control systems that VC supports.  You can skip
@@ -81,6 +83,9 @@
 * Why Version Control?::    Understanding the problems it addresses.
 * Version Control Systems:: Supported version control back-end systems.
 * VCS Concepts::            Words and concepts related to version control.
+* VCS Merging::             How file conflicts are handled.
+* VCS Changesets::          How changes are grouped.
+* VCS Repositories::        Where version control repositories are stored.
 * Types of Log File::       The VCS log in contrast to the ChangeLog.
 @end menu
 
@@ -112,8 +117,8 @@
 @subsubsection Supported Version Control Systems
 
 @cindex back end (version control)
-  VC currently works with many different version control systems or
-@dfn{back ends}:
+  VC currently works with many different version control systems,
+which it refers to as @dfn{back ends}:
 
 @itemize @bullet
 
@@ -134,73 +139,60 @@
 @cindex RCS
 @item
 RCS is the free version control system around which VC was initially
-built.  Almost everything you can do with RCS can be done through VC.
-However, you cannot use RCS over the network, and it only works at the
-level of individual files rather than projects.
+built.  It is relatively primitive: it cannot be used over the
+network, and works at the level of individual files.  Almost
+everything you can do with RCS can be done through VC.
 
 @cindex CVS
 @item
 CVS is the free version control system that was, until recently (circa
 2008), used by the majority of free software projects.  Nowadays, it
 is slowly being superseded by newer systems.  CVS allows concurrent
-multi-user development either locally or over the network.  It lacks
-support for atomic commits or file moving/renaming.  VC supports all
-basic editing operations under CVS.  For some less common tasks, you
-still need to call CVS from the command line.  Note also that before
-using CVS you must set up a repository, which is a subject too complex
-to treat here.
+multi-user development either locally or over the network.  Unlike
+newer systems, it lacks support for atomic commits and file
+moving/renaming.  VC supports all basic editing operations under CVS.
 
 @cindex SVN
 @cindex Subversion
 @item
 Subversion (SVN) is a free version control system designed to be
-similar to CVS but without its problems.  It supports atomic commits
-of filesets, and versioning of directories, symbolic links, meta-data,
-renames, copies, and deletes.
+similar to CVS but without its problems (e.g., it supports atomic
+commits of filesets, and versioning of directories, symbolic links,
+meta-data, renames, copies, and deletes).
 
 @cindex GNU Arch
 @cindex Arch
 @item
-GNU Arch is a version control system designed for distributed work.
-It differs in many ways from older systems like CVS and RCS.  It
-provides different methods for interoperating between users, support
-for offline operations, and good branching and merging features.  It
-also supports atomic commits of filesets and file moving/renaming.  VC
-does not support all operations provided by GNU Arch, so you must
-sometimes invoke it from the command line.
+GNU Arch is one of the earliest @dfn{distributed} version control
+systems (the other being Monotone).  @xref{VCS Concepts}, for a
+description of distributed version control systems.  It is no longer
+under active development, and has been deprecated in favor of Bazaar.
 
 @cindex git
 @item
-Git is a distributed version control system invented by Linus Torvalds to support
-development of Linux (his kernel).  It supports atomic commits of filesets and
-file moving/renaming.  One significant feature of git is that it
-largely abolishes the notion of a single centralized repository;
-instead, each working copy of a git project is its own repository and
-coordination is done through repository-sync operations.  VC supports
-most git operations, with the exception of news merges and repository
-syncing; these must be done from the command line.
+Git is a distributed version control system originally invented by
+Linus Torvalds to support development of Linux (his kernel).  VC
+supports many common git operations, but others, such as repository
+syncing, must be done from the command line.
 
 @cindex hg
 @cindex Mercurial
 @item
 Mercurial (hg) is a distributed version control system broadly
-resembling GNU Arch and git, with atomic fileset commits and file
-moving/renaming.  Like git, it is fully decentralized.  VC supports
-most Mercurial commands, with the exception of repository sync
-operations; this needs to be done from the command line.
+resembling git.  VC supports most Mercurial commands, with the
+exception of repository sync operations.
 
 @cindex bzr
 @cindex Bazaar
 @item
-Bazaar (bzr) is a distributed version control system that supports both
-repository-based and distributed versioning, with atomic fileset
-commits and file moving/renaming.  VC supports most basic editing
-operations under Bazaar.
+Bazaar (bzr) is a distributed version control system that supports
+both repository-based and distributed versioning.  VC supports most
+basic editing operations under Bazaar.
 @end itemize
 
   Previous versions of VC supported a version control system known as
-Meta-CVS.  This support has been dropped because of limited interest
-from users and developers.
+Meta-CVS.  This support was dropped due to limited interest from users
+and developers.
 
 @node VCS Concepts
 @subsubsection Concepts of Version Control
@@ -216,11 +208,11 @@
 
 @cindex work file
 @cindex checking out files
-  A file @dfn{checked out} of a repository is called the @dfn{work
-file}.  You edit the work file and make changes in it, as you would
-with an ordinary file.  After you are done with a set of changes, you
-@dfn{check in} or @dfn{commit} the file; this records the changes in
-the repository, along with a log entry for those changes.
+  The copy of a version-controlled file that you actually edit is
+called the @dfn{work file}.  You can change each work file as you
+would an ordinary file.  After you are done with a set of changes, you
+@dfn{commit} (or @dfn{check in}) the changes; this records the changes
+in the repository, along with a descriptive log entry.
 
 @cindex revision
 @cindex revision ID
@@ -231,12 +223,15 @@
 integer.
 
   To go beyond these basic concepts, you will need to understand three
-aspects in which version control systems differ.
-They can be locking-based or merging-based; they can be file-based or
-changeset-based; and they can be centralized or decentralized.  VC
-handles all these modes of operation, but it cannot hide the differences.
+aspects in which version control systems differ.  As explained in the
+next three sections, they can be lock-based or merge-based; file-based
+or changeset-based; and centralized or decentralized.  VC handles all
+these modes of operation, but it cannot hide the differences.
 
+@node VCS Merging
+@subsubsection Merge-based vs lock-based Version Control
 @cindex locking versus merging
+
   A version control system typically has some mechanism to coordinate
 between users who want to change the same file.  There are two ways to
 do this: merging and locking.
@@ -244,8 +239,7 @@
   In a version control system that uses merging, each user may check
 out and modify a work file at any time.  The system lets you
 @dfn{merge} your work file, which may contain changes that have not
-been checked in, with the latest changes that others have checked into
-the repository.
+been committed, with the latest changes that others have committed.
 
   Older version control systems use a @dfn{locking} scheme instead.
 Here, work files are normally read-only.  To edit a file, you ask the
@@ -253,7 +247,7 @@
 it; only one user can lock a given file at any given time.  This
 procedure is analogous to, but different from, the locking that Emacs
 uses to detect simultaneous editing of ordinary files
-(@pxref{Interlocking}).  When you check in your changes, that unlocks
+(@pxref{Interlocking}).  When you commit your changes, that unlocks
 the file, and the work file becomes read-only again.  Other users may
 then lock the file to make their own changes.
 
@@ -261,8 +255,8 @@
 users try to modify the same file at the same time.  Locking systems
 have @dfn{lock conflicts}; a user may try to check a file out and be
 unable to because it is locked.  In merging systems, @dfn{merge
-conflicts} happen when you check in a change to a file that conflicts
-with a change checked in by someone else after your checkout.  Both
+conflicts} happen when you commit a change to a file that conflicts
+with a change committed by someone else after your checkout.  Both
 kinds of conflict have to be resolved by human judgment and
 communication.  Experience has shown that merging is superior to
 locking, both in convenience to developers and in minimizing the
@@ -275,27 +269,33 @@
 Mercurial, are exclusively merging-based.
 
   VC mode supports both locking and merging version control.  The
-terms ``checkin'' and ``checkout'' come from locking-based version
-control systems; newer version control systems have slightly different
-operations usually called ``commit'' and ``update'', but VC hides the
-differences between them as much as possible.
+terms ``commit'' and ``update'' are used in newer version control
+systems; older lock-based systems use the terms ``check in'' and
+``check out''.  VC hides the differences between them as much as
+possible.
 
-@cindex files versus changesets.
+@node VCS Changesets
+@subsubsection Changeset-based vs File-based Version Control
+
+@cindex changesets
   On SCCS, RCS, CVS, and other early version control systems, version
 control operations are @dfn{file-based}: each file has its own comment
-and revision history separate from that of all other files in the
-system.  Later systems, beginning with Subversion, are
-@dfn{changeset-based}: a checkin may include changes to several files,
-and the entire set of changes is treated as a unit by the system.  Any
-comment associated with the change does not belong to a single file,
-but to the changeset itself.
+and revision history separate from that of all other files.  Newer
+systems, beginning with Subversion, are @dfn{changeset-based}: a
+checkin may include changes to several files, and the entire set of
+changes is handled as a unit.  Any comment associated with the change
+does not belong to a single file, but to the changeset itself.
 
   Changeset-based version control is more flexible and powerful than
 file-based version control; usually, when a change to multiple files
 has to be reversed, it's good to be able to easily identify and remove
 all of it.
 
-@cindex centralized vs. decentralized version control
+@node VCS Repositories
+@subsubsection Decentralized vs Centralized Repositories
+
+@cindex centralized version control
+@cindex decentralized version control
   Early version control systems were designed around a
 @dfn{centralized} model in which each project has only one repository
 used by all developers.  SCCS, RCS, CVS, and Subversion share this
@@ -306,14 +306,12 @@
 control, later implemented in git, Mercurial, and Bazaar.  A project
 may have several different repositories, and these systems support a
 sort of super-merge between repositories that tries to reconcile their
-change histories.  At the limit, each developer has his/her own
-repository, and repository merges replace checkin/commit operations.
+change histories.  In effect, there is one repository for each
+developer, and repository merges take the place of commit operations.
 
-  VC's job is to help you manage the traffic between your personal
-workfiles and a repository.  Whether that repository is a single
-master or one of a network of peer repositories is not something VC
-has to care about.  Thus, the difference between a centralized and a
-decentralized version control system is invisible to VC mode.
+  VC helps you manage the traffic between your personal workfiles and
+a repository.  Whether the repository is a single master, or one of a
+network of peer repositories, is not something VC has to care about.
 
 @node Types of Log File
 @subsubsection Types of Log File
@@ -323,9 +321,9 @@
 
   Projects that use a version control system can have two types of log
 for changes.  One is the log maintained by the version control system:
-each time you check in a change, you fill out a @dfn{log entry} for
-the change (@pxref{Log Buffer}).  This is called the @dfn{version
-control log}.
+each time you commit a change, you fill out a @dfn{log entry} for the
+change (@pxref{Log Buffer}).  This is called the @dfn{version control
+log}.
 
   The other kind of log is the file @file{ChangeLog} (@pxref{Change
 Log}).  It provides a chronological record of all changes to a large
@@ -365,32 +363,29 @@
 @cindex VC, mode line indicator
 
   When you visit a file that is under version control, Emacs indicates
-this on the mode line.  For example, @samp{RCS-1.3} says that the RCS
-back end is used for that file, and the current version of the file is
-1.3.
-
-  The first part of the VC mode-line indicator is the name of the back
-end: @samp{RCS}, @samp{CVS}, @samp{Bzr}, etc.  The back-end name is
-followed by a single character and the version of the file.
+this on the mode line.  For example, @samp{Bzr-1223} says that Bazaar
+is used for that file, and the current revision ID is 1223.
 
   The character between the back-end name and the revision ID
-indicates the version control status of the file.  @samp{-} means that
-the work file is not locked (if locking is in use), or not modified (if
-locking is not in use).  @samp{:} indicates that the file is locked, or
-that it is modified.  If the file is locked by some other user (for
+indicates the status of the work file.  In a merge-based version
+control system, a @samp{-} character indicates that the work file is
+unmodified, and @samp{:} indicates that it has been modified.
+@samp{!} indicates that the file contains conflicts as result of a
+recent merge operation (@pxref{Merging}), or that the file was removed
+from the version control.  Finally, @samp{?}  means that the file is
+under version control, but is missing from the working tree.
+
+  In a lock-based system, @samp{-} indicates an unlocked file, and
+@samp{:} a locked file; if the file is locked by another user (for
 instance, @samp{jim}), that is displayed as @samp{RCS:jim:1.3}.
 @samp{@@} means that the file was locally added, but not yet committed
-to the master repository.  @samp{!} indicates that the file contains
-conflicts as result of a recent merge operation (@pxref{Merging}), or
-that the file was removed from the version control.  Finally, @samp{?}
-means that the file is under version control, but is missing from the
-working tree.
+to the master repository.
 
   On a graphical display, you can move the mouse over this mode line
 indicator to pop up a ``tool-tip'', which displays a more verbose
 description of the version control status.  Pressing @kbd{Mouse-1}
-over the indicator pops up a menu of VC commands.  This menu is
-identical to the @samp{Tools / Version Control} menu item.
+over the indicator pops up a menu of VC commands, identical to
+@samp{Tools / Version Control} on the menu bar.
 
 @vindex auto-revert-check-vc-info
   When Auto Revert mode (@pxref{Reverting}) reverts a buffer that is
@@ -442,12 +437,6 @@
 version control system; if they are not, Emacs signals an error when
 you attempt to execute a command on the fileset.
 
-  Support for VC filesets and changeset-based version control systems
-is the main improvement to VC in Emacs 23.  When you mark multi-file
-VC in a VC Directory buffer, VC operations treat them as a VC fileset,
-and operate on them all at once if the version control system is
-changeset-based.  @xref{VC Directory Mode}.
-
   VC filesets are distinct from the ``named filesets'' used for
 viewing and visiting files in functional groups (@pxref{Filesets}).
 Unlike named filesets, VC filesets are not named and don't persist
@@ -457,7 +446,6 @@
 * VC With A Merging VCS::  Without locking: default mode for CVS.
 * VC With A Locking VCS::  RCS in its default mode, SCCS, and optionally CVS.
 * Advanced C-x v v::       Advanced features available with a prefix argument.
-* Log Buffer::             Features available in log entry buffers.
 @end menu
 
 @node VC With A Merging VCS
@@ -490,9 +478,9 @@
 in changes to the repository, merge those changes into the work file.
 
 @item
-If you have made modifications to the work file, attempts to check in
-your changes.  To do this, Emacs first reads the log entry for the new
-revision (@pxref{Log Buffer}).  If some other user has checked in
+If you have made modifications to the work file, attempt to commit
+the changes.  To do this, Emacs first reads the log entry for the new
+revision (@pxref{Log Buffer}).  If some other user has committed
 changes to the repository since you last checked it out, the checkin
 fails.  In that case, type @kbd{C-x v v} again to merge those changes
 into your own work file; this puts the work file into a ``conflicted''
@@ -507,8 +495,8 @@
 
   These rules also apply when you use RCS in its ``non-locking'' mode,
 except that changes are not automatically merged from the repository.
-Nothing informs you if another user has checked in changes in the same
-file since you began editing it; when you check in your revision, his
+Nothing informs you if another user has committed changes in the same
+file since you began editing it; when you commit your revision, his
 changes are removed (however, they remain in the repository and are
 thus not irrevocably lost).  Therefore, you must verify that the
 current revision is unchanged before checking in your changes.  In
@@ -528,7 +516,7 @@
 can change it.
 
 @item
-If the file is locked by you, and contains changes, check in the
+If the file is locked by you, and contains changes, commit the
 changes.  In order to do this, Emacs first reads the log entry for the
 new revision.  @xref{Log Buffer}.
 
@@ -544,12 +532,12 @@
 @end itemize
 
   These rules also apply when you use CVS in locking mode, except
-that there is no such thing as stealing a lock.
+that CVS does not support stealing a lock.
 
 @node Advanced C-x v v
 @subsubsection Advanced Control in @kbd{C-x v v}
 
-@cindex revision ID to check in/out
+@cindex revision ID in version control
   When you give a prefix argument to @code{vc-next-action} (@kbd{C-u
 C-x v v}), it still performs the next logical version control
 operation, but accepts additional arguments to specify precisely how
@@ -558,8 +546,8 @@
 @itemize @bullet
 @item
 If the file is modified (or locked), you can specify the revision ID
-to use for the new version that you check in.  This is one way
-to create a new branch (@pxref{Branches}).
+to use for the new version that you commit.  This is one way to create
+a new branch (@pxref{Branches}).
 
 @item
 If the file is not modified (and unlocked), you can specify the
@@ -585,34 +573,53 @@
 @end itemize
 
 @node Log Buffer
-@subsubsection Features of the Log Entry Buffer
+@subsection Features of the Log Entry Buffer
+
+  When you tell VC to commit a change, it pops up a buffer called
+@samp{*VC-Log*}.  In this buffer, you should write a @dfn{log entry}
+describing the changes you have made (@pxref{Why Version Control?}).
+After you are done, type @kbd{C-c C-c}; this exits the buffer and
+commits the change, together with your log entry.
 
-  When you check in changes, Emacs pops up a buffer called
-@samp{*VC-Log*} for you to enter a log entry.
+  While in the @samp{*VC-Log*} buffer, you can write one or more
+@dfn{header lines}, specifying additional information to be supplied
+to the version control system.  Each header line must occupy a single
+line at the top of the buffer; the first line that is not a header
+line is treated as the start of the log entry.  For example, the
+following header line states that the present change was not written
+by you, but by another developer:
 
-  After you have finished editing the log message, type @kbd{C-c C-c}
-to exit the buffer and commit the change.
+@smallexample
+Author: J. R. Hacker <jrh@@example.com>
+@end smallexample
+
+@noindent
+Apart from the @samp{Author} header, Emacs recognizes the headers
+@samp{Date} (a manually-specified commit time) and @samp{Fixes} (a
+reference to a bug fixed by the change).  Not all version control
+systems recognize all headers: Bazaar recognizes all three headers,
+while git, Mercurial, and Monotone recognizes only @samp{Author} and
+@samp{Summary}.  If you specify a header for a version control that
+does not support it, the header is treated as part of the log entry.
 
 @findex log-edit-show-files
 @findex log-edit-show-diff
-  In the @samp{*VC-Log*} buffer, typing @kbd{C-c C-f}
-(@code{log-edit-show-files}) displays a list of files in the VC
-fileset you are committing.  If you called @kbd{C-x v v} directly from
-a work file, the VC fileset consists of that single file, so this
-command is not very useful.  If you called @kbd{C-x v v} from a VC
-directory buffer, the VC fileset may consist of multiple files
-(@pxref{VC Directory Mode}).
+  Type @kbd{C-c C-f} (@code{log-edit-show-files}) to display a list of
+files in the current VC fileset.  If you called @kbd{C-x v v} directly
+from a work file, the fileset consists of that single file; if you
+called @kbd{C-x v v} from a VC directory buffer (@pxref{VC Directory
+Mode}), the fileset may consist of multiple files.
 
 @findex log-edit-insert-changelog
-  Type @kbd{C-c C-d} (@code{log-edit-show-diff}) to show a ``diff'' of
-the changes you have made (i.e., the differences between the work file
-and the repository revision from which you started editing the file).
-The diff is displayed in a special buffer in another window.
-@xref{Comparing Files}.
+  Type @kbd{C-c C-d} (@code{log-edit-show-diff}) to show a @dfn{diff}
+of the changes you have made (i.e., the differences between the work
+file and the repository revision from which you started editing).
+@xref{Old Revisions}.
 
-  If you have written an entry in the @file{ChangeLog} (@pxref{Change
-Log}), type @kbd{C-c C-a} (@code{log-edit-insert-changelog}) to pull
-it into the @samp{*VC-Log*} buffer.  If the topmost item in the
+  If the current VC fileset includes one or more @file{ChangeLog}
+files (@pxref{Change Log}), type @kbd{C-c C-a}
+(@code{log-edit-insert-changelog}) to pull the relevant entries into
+the @samp{*VC-Log*} buffer.  If the topmost item in each
 @file{ChangeLog} was made under your user name on the current date,
 this command searches that item for entries that match the file(s) to
 be committed; if found, these entries are inserted.
@@ -627,7 +634,7 @@
 
   To abort a check-in, just @strong{don't} type @kbd{C-c C-c} in that
 buffer.  You can switch buffers and do other editing.  As long as you
-don't try to check in another file, the entry you were editing remains
+don't try to commit another file, the entry you were editing remains
 in the @samp{*VC-Log*} buffer, and you can go back to that buffer at
 any time to complete the check-in.
 
@@ -636,7 +643,7 @@
 is the normal way to do things on a changeset-oriented system, where
 comments are attached to changesets rather than the history of
 individual files.)  The most convenient way to do this is to mark all
-the files in VC Directory Mode and check in from there; the log buffer
+the files in VC Directory Mode and commit from there; the log buffer
 will carry the fileset information with it and do a group commit when
 you type @kbd{C-c C-c}.
 
@@ -648,7 +655,7 @@
 versions are used outside the minibuffer).
 
 @vindex vc-log-mode-hook
-  Each time you check in a change, the log entry buffer is put into VC
+  Each time you commit a change, the log entry buffer is put into VC
 Log Edit mode, which involves running two hooks: @code{text-mode-hook}
 and @code{vc-log-mode-hook}.  @xref{Hooks}.
 
@@ -700,8 +707,12 @@
   @kbd{C-x v =} (@code{vc-diff}) compares each file in the current VC
 fileset (saving them if necessary) with the repository revision(s)
 from which you started editing.  Note that the latter may or may not
-be the latest revision of the file(s).  The diff is displayed in a
-special buffer in another window.  @xref{Comparing Files}.
+be the latest revision of the file(s).
+
+  The diff is displayed in another window, in a Diff mode buffer
+(@pxref{Diff Mode}) named @file{*vc-diff*}.  In this buffer, the
+@kbd{g} (@code{revert-buffer}) command performs the file comparison
+again, generating a new diff.
 
 @findex vc-diff
 @kindex C-u C-x v =
@@ -1008,7 +1019,7 @@
 
 @kindex C-x v c
 @findex vc-rollback
-  To cancel a change that you already checked in, use @kbd{C-x v c}
+  To cancel a change that you already committed, use @kbd{C-x v c}
 (@code{vc-rollback}).  This command discards all record of the most
 recent checked-in revision, but only if your work file corresponds to
 that revision---you cannot use @kbd{C-x v c} to cancel a revision that
@@ -1075,8 +1086,8 @@
 @noindent
 In this example, @samp{file1.c} is modified with respect to the
 repository, and @samp{file2.c} is not.  @samp{file3.c} is modified,
-but other changes have also been checked in to the repository---you
-need to merge them with the work file before you can check it in.
+but other changes have also been committed---you need to merge them
+with the work file before you can check it in.
 
 @vindex vc-stay-local
 @vindex vc-cvs-stay-local
@@ -1114,7 +1125,7 @@
 
   VC Directory mode has a full set of navigation and marking commands
 for picking out filesets.  Some of these are also available in a
-context menu invoked by the @kbd{mouse-2} button.
+context menu invoked by @kbd{mouse-2}.
 
   Up- and down-arrow keys move in the buffer; @kbd{n} and @kbd{p}  also
 move vertically as in other list-browsing modes.  @key{SPC} and
@@ -1158,7 +1169,8 @@
 
   @kbd{M-s a C-s} does an incremental search on the marked files.
 
-  @kbd{M-s a C-M-s} does an incremental search on the marked files.
+  @kbd{M-s a C-M-s} does an incremental regular expression search
+on the marked files.
 
 @cindex stashes in version control
 @cindex shelves in version control
@@ -1174,11 +1186,11 @@
 @kbd{+}, @kbd{l}, @kbd{i}, and @kbd{v} behave as through prefixed with
 @kbd{C-x v}.
 
-  The command @kbd{C-x v v} (@code{vc-next-action}) operates on all the
-marked files, so that you can check in several files at once.
-If the underlying VC supports atomic commits of multiple-file
-changesets, @kbd{C-x v v} with a selected set of modified but not
-committed files will commit all of them at once as a single changeset.
+  The command @kbd{C-x v v} (@code{vc-next-action}) operates on all
+the marked files, so that you can commit several files at once.  If
+the underlying VC supports atomic commits of multiple-file changesets,
+@kbd{C-x v v} with a selected set of modified but not committed files
+will commit all of them at once as a single changeset.
 
   When @kbd{C-x v v} (@code{vc-next-action}) operates on multiple
 files, all of those files must be either in the same state or in
@@ -1261,15 +1273,15 @@
 @node Creating Branches
 @subsubsection Creating New Branches
 
-  To create a new branch from a head revision (one that is the latest in
-the branch that contains it), first select that revision if necessary,
-lock it with @kbd{C-x v v}, and make whatever changes you want.  Then,
-when you check in the changes, use @kbd{C-u C-x v v}.  This lets you
-specify the revision ID for the new revision.  You should specify a
-suitable branch ID for a branch starting at the current revision.
-For example, if the current revision is 2.5, the branch ID should be
-2.5.1, 2.5.2, and so on, depending on the number of existing branches at
-that point.
+  To create a new branch from a head revision (one that is the latest
+in the branch that contains it), first select that revision if
+necessary, lock it with @kbd{C-x v v}, and make whatever changes you
+want.  Then, when you commit the changes, use @kbd{C-u C-x v v}.  This
+lets you specify the revision ID for the new revision.  You should
+specify a suitable branch ID for a branch starting at the current
+revision.  For example, if the current revision is 2.5, the branch ID
+should be 2.5.1, 2.5.2, and so on, depending on the number of existing
+branches at that point.
 
   To create a new branch at an older revision (one that is no longer the
 head of a branch), first select that revision (@pxref{Switching
@@ -1282,11 +1294,11 @@
 you'll be offered a chance to lock the latest revision instead.  On
 a merging-based VCS you will skip this step.
 
-  Then make your changes and type @kbd{C-x v v} again to check in a new
+  Then make your changes and type @kbd{C-x v v} again to commit a new
 revision.  This automatically creates a new branch starting from the
-selected revision.  You need not specially request a new branch, because
-that's the only way to add a new revision at a point that is not the head
-of a branch.
+selected revision.  You need not specially request a new branch,
+because that's the only way to add a new revision at a point that is
+not the head of a branch.
 
   After the branch is created, you ``stay'' on it.  That means that
 subsequent check-ins create new revisions on that branch.  To leave the
@@ -1334,11 +1346,11 @@
 type @kbd{C-x v m 1.3.1 @key{RET}}.  This takes the entire set of changes on
 branch 1.3.1 (relative to revision 1.3, where the branch started, up to
 the last revision on the branch) and merges it into the current revision
-of the work file.  You can now check in the changed file, thus creating
+of the work file.  You can now commit the changed file, thus creating
 revision 1.6 containing the changes from the branch.
 
   It is possible to do further editing after merging the branch, before
-the next check-in.  But it is usually wiser to check in the merged
+the next check-in.  But it is usually wiser to commit the merged
 revision, then lock it and make the further changes.  This will keep
 a better record of the history of changes.
 
@@ -1374,7 +1386,7 @@
   Then you can resolve the conflicts by editing the file manually.  Or
 you can type @code{M-x vc-resolve-conflicts} after visiting the file.
 This starts an Ediff session, as described above.  Don't forget to
-check in the merged version afterwards.
+commit the merged version afterwards.
 
 @node Multi-User Branching
 @subsubsection Multi-User Branching
--- a/doc/emacs/msdog.texi	Thu Dec 16 17:43:45 2010 -0500
+++ b/doc/emacs/msdog.texi	Thu Dec 16 18:30:57 2010 -0500
@@ -28,6 +28,7 @@
 here.
 
 @menu
+* Windows Startup::     How to start Emacs on Windows.
 * Text and Binary::     Text files use CRLF to terminate lines.
 * Windows Files::       File-name conventions on Windows.
 * ls in Lisp::          Emulation of @code{ls} for Dired.
@@ -44,6 +45,68 @@
 @end ifnottex
 @end menu
 
+@node Windows Startup
+@section How to Start Emacs on MS-Windows
+@cindex starting Emacs on MS-Windows
+
+  There are several ways of starting Emacs on MS-Windows:
+
+@enumerate
+@item
+@pindex runemacs.exe
+@cindex desktop shortcut, MS-Windows
+@cindex start directory, MS-Windows
+@cindex directory where Emacs starts on MS-Windows
+From the desktop shortcut icon: either double-click the left mouse
+button on the icon, or click once, then press @key{RET}.  The desktop
+shortcut should specify as its ``Target'' (in the ``Properties'' of
+the shortcut) the full absolute file name of @file{runemacs.exe},
+@emph{not} of @file{emacs.exe}.  This is because @file{runemacs.exe}
+hides the console window that would have been created if the target of
+the shortcut were @file{emacs.exe} (which is a console program, as far
+as Windows is concerned).  If you use this method, Emacs starts in the
+directory specified by the shortcut.  To control where that is,
+right-click on the shortcut, select ``Properties'', and in the
+``Shortcut'' tab modify the ``Start in'' field to your liking.
+
+@item
+From the Command Prompt window, by typing @kbd{emacs @key{RET}} at the
+prompt.  The Command Prompt window where you did that will not be
+available for invoking other commands until Emacs exits.  In this
+case, Emacs will start in the current directory of the Windows shell.
+
+@item
+From the Command Prompt window, by typing @kbd{runemacs @key{RET}} at
+the prompt.  The Command Prompt window where you did that will be
+immediately available for invoking other commands.  In this case,
+Emacs will start in the current directory of the Windows shell.
+
+@item
+@cindex invoking Emacs from Windows Explorer
+@pindex emacsclient.exe
+@pindex emacsclientw.exe
+Via the Emacs client program, @file{emacsclient.exe} or
+@file{emacsclientw.exe}.  This allows to invoke Emacs from other
+programs, and to reuse a running Emacs process for serving editing
+jobs required by other programs.  @xref{Emacs Server}.  The difference
+between @file{emacsclient.exe} and @file{emacsclientw.exe} is that the
+former waits for Emacs to signal that the editing job is finished,
+while the latter does not wait.  Which one of them to use in each case
+depends on the expectations of the program that needs editing
+services.  If the program will use the edited files, it needs to wait
+for Emacs, so you should use @file{emacsclient.exe}.  By contrast, if
+the results of editing are not needed by the invoking program, you
+will be better off using @file{emacsclientw.exe}.  A notable situation
+where you would want @file{emacsclientw.exe} is when you right-click
+on a file in the Windows Explorer and select ``Open With'' from the
+pop-up menu.  Use the @samp{--alternate-editor=} or @samp{-a} options
+if Emacs might not be running (or not running as a server) when
+@command{emacsclient} is invoked---that will always give you an
+editor.  When invoked via @command{emacsclient}, Emacs will start in
+the current directory of the program that invoked
+@command{emacsclient}.
+@end enumerate
+
 @node Text and Binary
 @section Text Files and Binary Files
 @cindex text and binary files on MS-DOS/MS-Windows
@@ -342,6 +405,9 @@
 or @file{C:\WINDOWS\Profiles\@var{username}\Application Data} on the
 older Windows 9X/ME systems.
 
+  @code{HOME} can also be set in the system registry, for details see
+@ref{MS-Windows Registry}.
+
 @cindex init file @file{.emacs} on MS-Windows
   The home directory is where your init file @file{.emacs} is stored.
 When Emacs starts, it first checks whether the environment variable
@@ -373,13 +439,6 @@
 @file{_emacs} as a fallback, if such a file exists in the home
 directory, whereas @file{.emacs} does not.
 
-@cindex start directory, MS-Windows
-@cindex directory where Emacs starts on MS-Windows
-  If you use a Windows desktop shortcut to start Emacs, it starts in
-the directory specified by the shortcut.  To control where that is,
-right-click on the shortcut, select ``Properties'', and in the
-``Shortcut'' tab modify the ``Start in'' field to your liking.
-
 @node Windows Keyboard
 @section Keyboard Usage on MS-Windows
 @cindex keyboard, MS-Windows
--- a/doc/emacs/search.texi	Thu Dec 16 17:43:45 2010 -0500
+++ b/doc/emacs/search.texi	Thu Dec 16 18:30:57 2010 -0500
@@ -459,11 +459,13 @@
 These run the commands @code{word-search-forward} and
 @code{word-search-backward} respectively.
 
-  A nonincremental word search differs slightly from the incremental
-version in the way it finds a match: the last word in the search
-string must be an exact match for a whole word.  In an incremental
-word search, the last word in the search string can match part of a
-word; this allows the matching to proceed incrementally as you type.
+  Incremental and nonincremental word searches differ slightly in the
+way they find a match.  In a nonincremental word search, the last word
+in the search string must exactly match a whole word.  In an
+incremental word search, the matching is more lax: the last word in
+the search string can match part of a word, so that the matching
+proceeds incrementally as you type.  This additional laxity does not
+apply to the lazy highlight, which always matches whole words.
 
 @node Regexp Search
 @section Regular Expression Search
--- a/doc/emacs/text.texi	Thu Dec 16 17:43:45 2010 -0500
+++ b/doc/emacs/text.texi	Thu Dec 16 18:30:57 2010 -0500
@@ -1765,7 +1765,7 @@
 @kindex C-c C-n @r{(SGML mode)}
 @findex sgml-name-char
 Interactively specify a special character and insert the SGML
-@samp{&}-command for that character.
+@samp{&}-command for that character (@code{sgml-name-char}).
 
 @item C-c C-t
 @kindex C-c C-t @r{(SGML mode)}
@@ -1799,7 +1799,7 @@
 @findex sgml-skip-tag-backward
 Skip backward across a balanced tag group (which extends from an
 opening tag through its corresponding closing tag)
-(@code{sgml-skip-tag-forward}).  A numeric argument acts as a repeat
+(@code{sgml-skip-tag-backward}).  A numeric argument acts as a repeat
 count.
 
 @item C-c C-d
@@ -1841,7 +1841,7 @@
 @kindex C-c TAB @r{(SGML mode)}
 @findex sgml-tags-invisible
 Toggle the visibility of existing tags in the buffer.  This can be
-used as a cheap preview.
+used as a cheap preview (@code{sgml-tags-invisible}).
 @end table
 
 @cindex nXML mode
--- a/doc/emacs/trouble.texi	Thu Dec 16 17:43:45 2010 -0500
+++ b/doc/emacs/trouble.texi	Thu Dec 16 18:30:57 2010 -0500
@@ -629,7 +629,7 @@
 you can use.
 
 All mail sent to the @samp{bug-gnu-emacs} mailing list is also
-gatewayed to the @samp{bug.gnu.emacs} newsgroup.  The reverse is also
+gatewayed to the @samp{gnu.emacs.bug} newsgroup.  The reverse is also
 true, but we ask you not to post bug reports via the newsgroup.  It
 can make it much harder to contact you if we need to ask for more
 information, and it does not integrate well with the bug tracker.
@@ -1127,6 +1127,3 @@
 @lowersections
 @end ifnottex
 
-@ignore
-   arch-tag: c9cba76d-b2cb-4e0c-ae3f-19d5ef35817c
-@end ignore
--- a/doc/emacs/vc1-xtra.texi	Thu Dec 16 17:43:45 2010 -0500
+++ b/doc/emacs/vc1-xtra.texi	Thu Dec 16 18:30:57 2010 -0500
@@ -594,7 +594,7 @@
 @vindex vc-handled-backends
 The variable @code{vc-handled-backends} determines which version
 control systems VC should handle.  The default value is @code{(RCS CVS
-SVN SCCS BZR GIT HG Arch)}, so it contains all the version systems
+SVN SCCS Bzr Git Hg Mtn Arch)}, so it contains all the version systems
 that are currently supported.  If you want VC to ignore one or more of
 these systems, exclude its name from the list.  To disable VC entirely,
 set this variable to @code{nil}.
@@ -657,8 +657,8 @@
 that it should always ask for confirmation.)
 
 @vindex vc-command-messages
-  VC mode does much of its work by running the shell commands for RCS,
-CVS and SCCS.  If @code{vc-command-messages} is non-@code{nil}, VC
+  VC mode does much of its work by running the shell commands for the
+appropriate backend.  If @code{vc-command-messages} is non-@code{nil}, VC
 displays messages to indicate which shell commands it runs, and
 additional messages when the commands finish.
 
--- a/doc/lispref/ChangeLog	Thu Dec 16 17:43:45 2010 -0500
+++ b/doc/lispref/ChangeLog	Thu Dec 16 18:30:57 2010 -0500
@@ -1,9 +1,83 @@
+2010-12-13  Eli Zaretskii  <eliz@gnu.org>
+
+	* processes.texi (Shell Arguments):
+	* strings.texi (Creating Strings): Don't mention "shell commands";
+	make it explicit that `split-string-and-unquote' and
+	`combine-and-quote-strings' are mainly for working with arguments
+	to call-process and start-process.
+
+	* processes.texi (Shell Arguments): Fix documentation of
+	`split-string-and-unquote'.  Add indexing.  (Bug#7563)
+
+2010-12-13  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* modes.texi (Auto-Indentation): New section to document SMIE.
+	(Major Mode Conventions):
+	* text.texi (Mode-Specific Indent): Refer to it.
+
+2010-12-13  Eli Zaretskii  <eliz@gnu.org>
+
+	* display.texi (Other Display Specs): Document left-fringe and
+	right-fringe display specs.
+
+2010-12-13  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* backups.texi (Making Backups):
+	* modes.texi (Example Major Modes): Use recommended coding style.
+	(Major Mode Basics, Derived Modes): Encourge more strongly use of
+	define-derived-mode.  Mention completion-at-point-functions.
+
+2010-12-13  Chong Yidong  <cyd@stupidchicken.com>
+
+	* nonascii.texi (Converting Representations):
+	Document byte-to-string.
+
+2010-12-08  Glenn Morris  <rgm@gnu.org>
+
+	* buffers.texi (Modification Time):
+	verify-visited-file-modtime now defaults to the current buffer.
+
+2010-11-27  Chong Yidong  <cyd@stupidchicken.com>
+
+	* nonascii.texi (Converting Representations): Document byte-to-string.
+
+	* strings.texi (Creating Strings): Don't mention semi-obsolete
+	function char-to-string.
+	(String Conversion): Shorten discussion of semi-obsolete function
+	string-to-char.  Link to Converting Representations.
+
+	* objects.texi (Symbol Type):
+	* text.texi (Near Point):
+	* help.texi (Help Functions):
+	* functions.texi (Mapping Functions): Use string instead of
+	char-to-string in examples.
+
+2010-11-27  Chong Yidong  <cyd@stupidchicken.com>
+
+	* text.texi (Kill Functions, Kill Functions)
+	(Low-Level Kill Ring, Low-Level Kill Ring): Remove obsolete
+	YANK-HANDLER args.
+
+	* symbols.texi (Creating Symbols): Using unintern without an
+	obarray arg is now obsolete.
+
+	* numbers.texi (Float Basics): Document float-e and float-pi.
+
+	* variables.texi (Defining Variables): Change "pi" example to
+	"float-pi".
+
+2010-11-26  Eli Zaretskii  <eliz@gnu.org>
+
+	* commands.texi (Click Events): Document the values of X, Y and
+	COL, ROW in the event's position, when the click is on the header
+	or mode line, on the fringes, or in the margins.
+
 2010-11-17  Eli Zaretskii  <eliz@gnu.org>
 
 	* customize.texi (Composite Types): Lower-case index entry.
 
-	* loading.texi (How Programs Do Loading): Document
-	load-file-name.  (Bug#7346)
+	* loading.texi (How Programs Do Loading):
+	Document load-file-name.  (Bug#7346)
 
 2010-11-17  Glenn Morris  <rgm@gnu.org>
 
@@ -444,8 +518,8 @@
 	* minibuf.texi (Basic Completion): 4th arg to all-completions is
 	obsolete.
 
-	* processes.texi (Process Buffers): Document
-	process-kill-buffer-query-function.
+	* processes.texi (Process Buffers):
+	Document process-kill-buffer-query-function.
 
 2009-12-05  Glenn Morris  <rgm@gnu.org>
 
@@ -892,8 +966,8 @@
 	(Suspending Emacs): Mark suspend-emacs as a command.
 	(Processor Run Time): Mark emacs-uptime and emacs-init-time as
 	commands.
-	(Terminal Output): Remove obsolete function baud-rate.  Document
-	TERMINAL arg for send-string-to-terminal.
+	(Terminal Output): Remove obsolete function baud-rate.
+	Document TERMINAL arg for send-string-to-terminal.
 
 	* nonascii.texi (Terminal I/O Encoding): Document TERMINAL arg for
 	terminal-coding-system and set-terminal-coding-system.
@@ -997,8 +1071,8 @@
 2009-05-09  Eli Zaretskii  <eliz@gnu.org>
 
 	* nonascii.texi (Default Coding Systems): Document
-	find-auto-coding, set-auto-coding, and auto-coding-alist.  Add
-	indexing.
+	find-auto-coding, set-auto-coding, and auto-coding-alist.
+	Add indexing.
 	(Lisp and Coding Systems): Add index entries.
 
 2009-05-09  Martin Rudalics  <rudalics@gmx.at>
@@ -1040,8 +1114,8 @@
 
 2009-04-22  Chong Yidong  <cyd@stupidchicken.com>
 
-	* os.texi (Command-Line Arguments): Document
-	command-line-args-left.
+	* os.texi (Command-Line Arguments):
+	Document command-line-args-left.
 	(Suspending Emacs): Adapt text to multi-tty case.  Document use of
 	terminal objects for tty arguments.
 	(Startup Summary): Add xref to Session Management.
@@ -1117,13 +1191,13 @@
 2009-04-09  Chong Yidong  <cyd@stupidchicken.com>
 
 	* text.texi (Yank Commands): Note that yank uses push-mark.
-	(Filling): Clarify REGION argument of fill-paragraph.  Document
-	fill-forward-paragraph-function.
+	(Filling): Clarify REGION argument of fill-paragraph.
+	Document fill-forward-paragraph-function.
 	(Special Properties): Remove "new in Emacs 22" declaration.
 	(Clickable Text): Merge with Links and Mouse-1 node.
 
-	* display.texi (Button Properties, Button Buffer Commands): Change
-	xref to Clickable Text.
+	* display.texi (Button Properties, Button Buffer Commands):
+	Change xref to Clickable Text.
 
 	* tips.texi (Key Binding Conventions): Change xref to Clickable
 	Text.
@@ -1185,8 +1259,8 @@
 
 2009-03-29  Chong Yidong  <cyd@stupidchicken.com>
 
-	* help.texi (Accessing Documentation, Help Functions): Remove
-	information about long-obsolete Emacs versions.
+	* help.texi (Accessing Documentation, Help Functions):
+	Remove information about long-obsolete Emacs versions.
 
 	* modes.texi (Mode Line Variables): The default values of the mode
 	line variables are now more complicated.
@@ -1229,8 +1303,8 @@
 2009-03-23  Chong Yidong  <cyd@stupidchicken.com>
 
 	* minibuf.texi (Intro to Minibuffers): Remove long-obsolete info
-	about minibuffers in old Emacs versions.  Copyedits.  Emphasize
-	that enable-recursive-minibuffers defaults to nil.
+	about minibuffers in old Emacs versions.  Copyedits.
+	Emphasize that enable-recursive-minibuffers defaults to nil.
 	(Text from Minibuffer): Simplify introduction.
 
 2009-03-22  Alan Mackenzie  <acm@muc.de>
@@ -1284,8 +1358,8 @@
 	* customize.texi (Common Keywords): It's not necessary to use :tag
 	to remove hyphens, as custom-unlispify-tag-name does it
 	automatically.
-	(Variable Definitions): Link to File Local Variables.  Document
-	customized-value symbol property.
+	(Variable Definitions): Link to File Local Variables.
+	Document customized-value symbol property.
 	(Customization Types): Move menu to end of node.
 
 2009-03-10  Chong Yidong  <cyd@stupidchicken.com>
@@ -1396,8 +1470,8 @@
 	* text.texi (Commands for Insertion):
 	* commands.texi (Event Mod):
 	* keymaps.texi (Searching Keymaps):
-	* nonascii.texi (Translation of Characters): Reinstate
-	documentation of translation-table-for-input.
+	* nonascii.texi (Translation of Characters):
+	Reinstate documentation of translation-table-for-input.
 	(Explicit Encoding): Document the `charset' text property produced
 	by decode-coding-region and decode-coding-string.
 
@@ -1426,8 +1500,8 @@
 2009-01-22  Chong Yidong  <cyd@stupidchicken.com>
 
 	* files.texi (Format Conversion Piecemeal): Clarify behavior of
-	write-region-annotate-functions.  Document
-	write-region-post-annotation-function.
+	write-region-annotate-functions.
+	Document write-region-post-annotation-function.
 
 2009-01-19  Chong Yidong  <cyd@stupidchicken.com>
 
@@ -1494,8 +1568,8 @@
 
 	* processes.texi (Serial Ports): Improve wording, suggested by RMS.
 
-	* nonascii.texi (Lisp and Coding Systems): Document
-	inhibit-null-byte-detection and inhibit-iso-escape-detection.
+	* nonascii.texi (Lisp and Coding Systems):
+	Document inhibit-null-byte-detection and inhibit-iso-escape-detection.
 	(Character Properties): Improve wording.
 
 2009-01-09  Chong Yidong  <cyd@stupidchicken.com>
@@ -1503,8 +1577,8 @@
 	* display.texi (Font Lookup): Remove obsolete function
 	x-font-family-list.  x-list-fonts accepts Fontconfig/GTK syntax.
 	(Low-Level Font): Rename from Fonts, move to end of Faces section.
-	(Font Selection): Reorder order of variable descriptions.  Minor
-	clarifications.
+	(Font Selection): Reorder order of variable descriptions.
+	Minor clarifications.
 
 	* elisp.texi (Top): Update node listing.
 
@@ -1525,8 +1599,8 @@
 	* elisp.texi: Update node listing.
 
 	* display.texi (Faces): Put Font Selection node after Auto Faces.
-	(Face Attributes): Don't link to Font Lookup.  Document
-	font-family-list.
+	(Face Attributes): Don't link to Font Lookup.
+	Document font-family-list.
 	(Fonts): New node.
 
 2009-01-08  Jason Rumney  <jasonr@gnu.org>
@@ -1754,8 +1828,8 @@
 	* windows.texi (Window Hooks): Remove *-end-trigger-functions
 	vars, which are obsolete.  Mention jit-lock-register.
 
-	* modes.texi (Other Font Lock Variables): Document
-	jit-lock-register and jit-lock-unregister.
+	* modes.texi (Other Font Lock Variables):
+	Document jit-lock-register and jit-lock-unregister.
 
 	* frames.texi (Color Parameters): Document alpha parameter.
 
@@ -1827,8 +1901,8 @@
 2008-11-01  Eli Zaretskii  <eliz@gnu.org>
 
 	* nonascii.texi (Text Representations): Rewrite to make consistent
-	with Emacs 23 internal representation of characters.  Document
-	`unibyte-string'.
+	with Emacs 23 internal representation of characters.
+	Document `unibyte-string'.
 
 2008-10-28  Chong Yidong  <cyd@stupidchicken.com>
 
@@ -1941,8 +2015,8 @@
 
 	* processes.texi (Synchronous Processes): Document `process-lines'.
 
-	* customize.texi (Variable Definitions): Document
-	`custom-reevaluate-setting'.
+	* customize.texi (Variable Definitions):
+	Document `custom-reevaluate-setting'.
 
 2008-10-18  Martin Rudalics  <rudalics@gmx.at>
 
@@ -1958,13 +2032,13 @@
 	* maps.texi (Standard Keymaps): Document `multi-query-replace-map'
 	and `search-map'.
 
-	* searching.texi (Search and Replace): Document
-	`replace-search-function' and `replace-re-search-function'.
+	* searching.texi (Search and Replace):
+	Document `replace-search-function' and `replace-re-search-function'.
 	Document `multi-query-replace-map'.
 
 	* minibuf.texi (Text from Minibuffer): Document `read-regexp'.
-	(Completion Commands, Reading File Names): Rename
-	`minibuffer-local-must-match-filename-map' to
+	(Completion Commands, Reading File Names):
+	Rename `minibuffer-local-must-match-filename-map' to
 	`minibuffer-local-filename-must-match-map'.
 	(Minibuffer Completion): The `require-match' argument to
 	`completing-read' can now have the value `confirm-only'.
@@ -2309,7 +2383,7 @@
 
 2007-12-30  Richard Stallman  <rms@gnu.org>
 
-	* commands.texi (Accessing Mouse): Renamed from Accessing Events.
+	* commands.texi (Accessing Mouse): Rename from Accessing Events.
 	(Accessing Scroll): New node broken out of Accessing Mouse.
 
 2007-12-28  Richard Stallman  <rms@gnu.org>
@@ -2353,8 +2427,8 @@
 
 2007-11-29  Glenn Morris  <rgm@gnu.org>
 
-	* functions.texi (Declaring Functions): Add findex.  Mention
-	`external' files.
+	* functions.texi (Declaring Functions): Add findex.
+	Mention `external' files.
 
 2007-11-26  Juanma Barranquero  <lekktu@gmail.com>
 
@@ -2481,8 +2555,8 @@
 	* display.texi (Display Property): Explain some display specs
 	don't let you move point in.
 
-	* frames.texi (Cursor Parameters): Describe
-	cursor-in-non-selected-windows here.  Explain more values.
+	* frames.texi (Cursor Parameters):
+	Describe cursor-in-non-selected-windows here.  Explain more values.
 
 	* windows.texi (Basic Windows): Don't describe
 	cursor-in-non-selected-windows here.
@@ -2561,8 +2635,8 @@
 
 2007-08-16  Richard Stallman  <rms@gnu.org>
 
-	* processes.texi (Asynchronous Processes): Clarify
-	doc of start-file-process.
+	* processes.texi (Asynchronous Processes):
+	Clarify doc of start-file-process.
 
 2007-08-08  Martin Rudalics  <rudalics@gmx.at>
 
@@ -2629,8 +2703,8 @@
 
 2007-06-27  Richard Stallman  <rms@gnu.org>
 
-	* files.texi (Format Conversion Piecemeal): Clarify
-	`after-insert-file-functions' calling convention.
+	* files.texi (Format Conversion Piecemeal):
+	Clarify `after-insert-file-functions' calling convention.
 
 2007-06-27  Michael Albinus  <michael.albinus@gmx.de>
 
@@ -2685,8 +2759,8 @@
 
 2007-05-30  Nick Roberts  <nickrob@snap.net.nz>
 
-	* commands.texi (Click Events): Layout more logically.  Describe
-	width and height.
+	* commands.texi (Click Events): Layout more logically.
+	Describe width and height.
 	(Drag Events, Motion Events): Update to new format for position.
 
 2007-06-02  Richard Stallman  <rms@gnu.org>
@@ -3092,8 +3166,8 @@
 
 2007-03-05  Richard Stallman  <rms@gnu.org>
 
-	* variables.texi (File Local Variables): Update
-	enable-local-variables values.
+	* variables.texi (File Local Variables):
+	Update enable-local-variables values.
 
 2007-03-04  Richard Stallman  <rms@gnu.org>
 
@@ -3164,8 +3238,8 @@
 2007-02-03  Eli Zaretskii  <eliz@gnu.org>
 
 	* elisp.texi (Top): Make the detailed menu headers compliant with
-	Texinfo guidelines and with what texnfo-upd.el expects.  Add
-	comments to prevent people from inadvertently modifying the key
+	Texinfo guidelines and with what texnfo-upd.el expects.
+	Add comments to prevent people from inadvertently modifying the key
 	parts needed by `texinfo-multiple-files-update'.
 
 2007-02-02  Eli Zaretskii  <eliz@gnu.org>
@@ -3252,8 +3326,8 @@
 
 2006-12-24  Richard Stallman  <rms@gnu.org>
 
-	* customize.texi (Variable Definitions): Document
-	new name custom-add-frequent-value.
+	* customize.texi (Variable Definitions):
+	Document new name custom-add-frequent-value.
 
 2006-12-19  Kim F. Storm  <storm@cua.dk>
 
@@ -3552,8 +3626,8 @@
 
 2006-09-01  Chong Yidong  <cyd@stupidchicken.com>
 
-	* buffers.texi (Buffer Modification): Document
-	buffer-chars-modified-tick.
+	* buffers.texi (Buffer Modification):
+	Document buffer-chars-modified-tick.
 
 2006-08-31  Richard Stallman  <rms@gnu.org>
 
@@ -3615,7 +3689,7 @@
 2006-08-12  Chong Yidong  <cyd@stupidchicken.com>
 
 	* text.texi (Near Point): Say "cursor" not "terminal cursor".
-	(Commands for Insertion): Removed split-line since it's not
+	(Commands for Insertion): Remove split-line since it's not
 	relevant for Lisp programming.
 	(Yank Commands): Rewrite introduction.
 	(Undo): Clarify.
@@ -3646,7 +3720,7 @@
 	(Major Mode Basics): Mention define-derived-mode explicitly.
 	(Major Mode Conventions): Rebinding RET is OK for some modes.
 	Mention change-major-mode-hook and after-change-major-mode-hook.
-	(Example Major Modes): Moved to end of Modes section.
+	(Example Major Modes): Move to end of Modes section.
 	(Mode Line Basics): Clarify.
 	(Mode Line Data): Mention help-echo and local-map in strings.
 	Explain reason for treatment of non-risky variables.
@@ -4145,7 +4219,7 @@
 
 2006-05-25  Chong Yidong  <cyd@stupidchicken.com>
 
-	* keymaps.texi (Key Sequences): Renamed from Keymap Terminology.
+	* keymaps.texi (Key Sequences): Rename from Keymap Terminology.
 	Explain string and vector representations of key sequences.
 
 	* keymaps.texi (Changing Key Bindings):
@@ -4194,8 +4268,8 @@
 
 2006-05-15  Oliver Scholz  <epameinondas@gmx.de>  (tiny change)
 
-	* nonascii.texi (Explicit Encoding): Fix
-	typo (encoding<->decoding).
+	* nonascii.texi (Explicit Encoding):
+	Fix typo (encoding<->decoding).
 
 2006-05-14  Richard Stallman  <rms@gnu.org>
 
@@ -4245,8 +4319,8 @@
 
 2006-05-09  Richard Stallman  <rms@gnu.org>
 
-	* variables.texi (File Local Variables): Document
-	safe-local-eval-forms and safe-local-eval-function.
+	* variables.texi (File Local Variables):
+	Document safe-local-eval-forms and safe-local-eval-function.
 
 2006-05-07  Kim F. Storm  <storm@cua.dk>
 
@@ -4730,8 +4804,8 @@
 
 2005-12-03  Eli Zaretskii  <eliz@gnu.org>
 
-	* hooks.texi (Standard Hooks): Add index entries.  Mention
-	`compilation-finish-functions'.
+	* hooks.texi (Standard Hooks): Add index entries.
+	Mention `compilation-finish-functions'.
 
 2005-11-27  Richard M. Stallman  <rms@gnu.org>
 
@@ -4954,8 +5028,8 @@
 	buffer-local.
 	(Undo): Note that buffer-undo-list is buffer-local.
 
-	* windows.texi (Buffers and Windows): Document
-	buffer-display-count.
+	* windows.texi (Buffers and Windows):
+	Document buffer-display-count.
 
 2005-09-06  Richard M. Stallman  <rms@gnu.org>
 
@@ -5196,7 +5270,7 @@
 
 	* display.texi (Displaying Messages): New node, with most
 	of what was in The Echo Area.
-	(Progress): Moved under The Echo Area.
+	(Progress): Move under The Echo Area.
 	(Logging Messages): New node with new text.
 	(Echo Area Customization): New node, the rest of what was
 	in The Echo Area.  Document message-truncate-lines with @defvar.
@@ -6511,8 +6585,8 @@
 	(Scroll Bars): Add scroll-bar-mode and scroll-bar-width.
 	(Usual Display): Move tab-width up.
 
-	* customize.texi (Variable Definitions): Replace
-	show-paren-mode example with tooltip-mode.
+	* customize.texi (Variable Definitions):
+	Replace show-paren-mode example with tooltip-mode.
 	(Simple Types, Composite Types, Defining New Types):
 	Minor cleanups.
 
@@ -6748,8 +6822,8 @@
 	(Display Fringe Bitmaps): New node.
 	(Images): Add 'Image Slices' to menu.
 	(Image Descriptors): Add `:pointer' and `:map' properties.
-	(Showing Images): Add slice arg to `insert-image'.  Add
-	'insert-sliced-image'.
+	(Showing Images): Add slice arg to `insert-image'.
+	Add 'insert-sliced-image'.
 
 2004-09-20  Richard M. Stallman  <rms@gnu.org>
 
@@ -6762,8 +6836,8 @@
 
 2004-09-07  Luc Teirlinck  <teirllm@auburn.edu>
 
-	* locals.texi (Standard Buffer-Local Variables): Add
-	`buffer-auto-save-file-format'.
+	* locals.texi (Standard Buffer-Local Variables):
+	Add `buffer-auto-save-file-format'.
 	* internals.texi (Buffer Internals): Describe new
 	auto_save_file_format field of the buffer structure.
 	* files.texi (Format Conversion): `auto-save-file-format' has been
@@ -7151,8 +7225,8 @@
 
 2004-04-05  Jesper Harder  <harder@ifa.au.dk>
 
-	* variables.texi (Variable Aliases): Mention
-	cyclic-variable-indirection.
+	* variables.texi (Variable Aliases):
+	Mention cyclic-variable-indirection.
 
 	* errors.texi (Standard Errors): Ditto.
 
@@ -7331,7 +7405,7 @@
 
 2004-02-07  Jan Djärv  <jan.h.d@swipnet.se>
 
-	* positions.texi (Text Lines): Added missing end defun.
+	* positions.texi (Text Lines): Add missing end defun.
 
 2004-02-07  Kim F. Storm  <storm@cua.dk>
 
@@ -7354,12 +7428,12 @@
 	read-minibuffer.
 	(Minibuffer History): Clarify description of cons values for
 	HISTORY arguments.
-	(Basic Completion): Various corrections and clarifications.  Add
-	completion-regexp-list.
+	(Basic Completion): Various corrections and clarifications.
+	Add completion-regexp-list.
 	(Minibuffer Completion): Correct and clarify description of
 	completing-read.
-	(Completion Commands): Mention Partial Completion mode.  Various
-	other minor changes.
+	(Completion Commands): Mention Partial Completion mode.
+	Various other minor changes.
 	(High-Level Completion): Various corrections and clarifications.
 	(Reading File Names): Ditto.
 	(Minibuffer Misc): Ditto.
@@ -7434,8 +7508,8 @@
 
 	* functions.texi: Various small changes in addition to the
 	following.
-	(What Is a Function): `functionp' returns nil for macros.  Clarify
-	behavior of this and following functions for symbol arguments.
+	(What Is a Function): `functionp' returns nil for macros.
+	Clarify behavior of this and following functions for symbol arguments.
 	(Function Documentation): Add `\' in front of (fn @var{arglist})
 	and explain why.
 	(Defining Functions): Mention DOCSTRING argument to `defalias'.
@@ -8231,7 +8305,7 @@
 
 2003-01-31  Joe Buehler  <jhpb@draco.hekimian.com>
 
-	* os.texi (System Environment): Added cygwin system-type.
+	* os.texi (System Environment): Add cygwin system-type.
 
 2003-01-25  Richard M. Stallman  <rms@gnu.org>
 
@@ -8264,7 +8338,7 @@
 
 	* README: Target for Info file is `make info'.
 
-	* files.texi (File Name Components): Fixed typos in
+	* files.texi (File Name Components): Fix typos in
 	`file-name-sans-extension'.
 	(Magic File Names): Complete list of operations for magic file
 	name handlers.
@@ -8280,7 +8354,7 @@
 
 2002-08-05  Per Abrahamsen  <abraham@dina.kvl.dk>
 
-	* customize.texi (Splicing into Lists): Fixed example.
+	* customize.texi (Splicing into Lists): Fix example.
 	Reported by Fabrice Bauzac <fabrice.bauzac@wanadoo.fr>.
 
 2002-06-17  Juanma Barranquero  <lektu@terra.es>
@@ -8320,8 +8394,8 @@
 
 2001-11-17  Eli Zaretskii  <eliz@is.elta.co.il>
 
-	* permute-index: Don't depend on csh-specific features.  Replace
-	the interpreter name with /bin/sh.
+	* permute-index: Don't depend on csh-specific features.
+	Replace the interpreter name with /bin/sh.
 
 	* two-volume-cross-refs.txt: New file.
 	* two.el: New file.
@@ -8459,8 +8533,8 @@
 	* numbers.texi (Integer Basics): Document CL style read syntax for
 	integers in bases other than 10.
 
-	* positions.texi (List Motion): Document
-	open-paren-in-column-0-is-defun-start.
+	* positions.texi (List Motion):
+	Document open-paren-in-column-0-is-defun-start.
 
 	* lists.texi (Sets And Lists): Document member-ignore-case.
 
@@ -8655,7 +8729,7 @@
 1995-06-19  Richard Stallman  <rms@mole.gnu.ai.mit.edu>
 
 	* Makefile (VERSION): Update version number.
-	(maintainer-clean): Renamed from realclean.
+	(maintainer-clean): Rename from realclean.
 
 1995-06-07  Karl Heuer  <kwzh@nutrimat.gnu.ai.mit.edu>
 
@@ -8727,11 +8801,11 @@
 
 1991-11-26  Richard Stallman  (rms@mole.gnu.ai.mit.edu)
 
-	* Makefile (srcs): Added index.perm.
+	* Makefile (srcs): Add index.perm.
 	(elisp.dvi): Remove erroneous shell comment.
 	Expect output of permute-index in permuted.fns.
 	Save old elisp.aux in elisp.oaux.
-	(clean): Added index.texi to be deleted.
+	(clean): Add index.texi to be deleted.
 
 1990-08-11  Richard Stallman  (rms@sugar-bombs.ai.mit.edu)
 
--- a/doc/lispref/backups.texi	Thu Dec 16 17:43:45 2010 -0500
+++ b/doc/lispref/backups.texi	Thu Dec 16 18:30:57 2010 -0500
@@ -88,10 +88,8 @@
 @smallexample
 @group
 (add-hook 'rmail-mode-hook
-          (function (lambda ()
-                      (make-local-variable
-                       'make-backup-files)
-                      (setq make-backup-files nil))))
+          (lambda ()
+            (set (make-local-variable 'make-backup-files) nil)))
 @end group
 @end smallexample
 @end defopt
--- a/doc/lispref/buffers.texi	Thu Dec 16 17:43:45 2010 -0500
+++ b/doc/lispref/buffers.texi	Thu Dec 16 18:30:57 2010 -0500
@@ -1,7 +1,8 @@
 @c -*-texinfo-*-
 @c This is part of the GNU Emacs Lisp Reference Manual.
 @c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2001, 2002,
-@c   2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010  Free Software Foundation, Inc.
+@c   2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+@c   Free Software Foundation, Inc.
 @c See the file elisp.texi for copying conditions.
 @setfilename ../../info/buffers
 @node Buffers, Windows, Backups and Auto-Saving, Top
@@ -594,12 +595,12 @@
 described below before saving the file.  (@xref{File Attributes},
 for how to examine a file's modification time.)
 
-@defun verify-visited-file-modtime buffer
-This function compares what @var{buffer} has recorded for the
-modification time of its visited file against the actual modification
-time of the file as recorded by the operating system.  The two should be
-the same unless some other process has written the file since Emacs
-visited or saved it.
+@defun verify-visited-file-modtime &optional buffer
+This function compares what @var{buffer} (by default, the
+current-buffer) has recorded for the modification time of its visited
+file against the actual modification time of the file as recorded by the
+operating system.  The two should be the same unless some other process
+has written the file since Emacs visited or saved it.
 
 The function returns @code{t} if the last actual modification time and
 Emacs's recorded modification time are the same, @code{nil} otherwise.
@@ -1223,6 +1224,3 @@
 This function returns the current gap size of the current buffer.
 @end defun
 
-@ignore
-   arch-tag: 2e53cfab-5691-41f6-b5a8-9c6a3462399c
-@end ignore
--- a/doc/lispref/commands.texi	Thu Dec 16 17:43:45 2010 -0500
+++ b/doc/lispref/commands.texi	Thu Dec 16 18:30:57 2010 -0500
@@ -1285,8 +1285,12 @@
 @item @var{x}, @var{y}
 These are the pixel coordinates of the click, relative to
 the top left corner of @var{window}, which is @code{(0 . 0)}.
-For the mode or header line, @var{y} does not have meaningful data.
-For the vertical line, @var{x} does not have meaningful data.
+For a click on text, these are relative to the top left corner of
+the window's text area.  For the mode or header line, they are
+relative to the top left window edge.  For fringes, margins, and the
+vertical border, @var{x} does not have meaningful data.  For fringes
+and margins, @var{y} is relative to the bottom edge of the header
+line.
 
 @item @var{timestamp}
 This is the time at which the event occurred, in milliseconds.
@@ -1316,7 +1320,12 @@
 @item @var{col}, @var{row}
 These are the actual coordinates of the glyph under the @var{x},
 @var{y} position, possibly padded with default character width
-glyphs if @var{x} is beyond the last glyph on the line.
+glyphs if @var{x} is beyond the last glyph on the line.  For clicks on
+the header or mode line, these are measured from the top left edge of
+the header or mode line.  For clicks on the fringes and on the
+vertical border, these have no meaningful data.  For clicks on the
+margins, @var{col} is measured from the left edge of the margin area
+and @var{row} is measured from the top of the margin area.
 
 @item @var{image}
 This is the image object on which the click occurred.  It is either
@@ -1333,7 +1342,7 @@
 These are the pixel width and height of @var{object} or, if this is
 @code{nil}, those of the character glyph clicked on.
 @end table
- 
+
 @sp 1
 For mouse clicks on a scroll-bar, @var{position} has this form:
 
--- a/doc/lispref/display.texi	Thu Dec 16 17:43:45 2010 -0500
+++ b/doc/lispref/display.texi	Thu Dec 16 18:30:57 2010 -0500
@@ -3892,6 +3892,13 @@
 but it is done as a special case of marginal display (@pxref{Display
 Margins}).
 
+@item (left-fringe @var{bitmap} @r{[}@var{face}@r{]})
+@itemx (right-fringe @var{bitmap} @r{[}@var{face}@r{]})
+This display specification on any character of a line of text causes
+the specified @var{bitmap} be displayed in the left or right fringes
+for that line.  The optional @var{face} specifies the colors to be
+used for the bitmap.  @xref{Fringe Bitmaps}, for the details.
+
 @item (space-width @var{factor})
 This display specification affects all the space characters within the
 text that has the specification.  It displays all of these spaces
--- a/doc/lispref/functions.texi	Thu Dec 16 17:43:45 2010 -0500
+++ b/doc/lispref/functions.texi	Thu Dec 16 18:30:57 2010 -0500
@@ -818,7 +818,7 @@
      @result{} (a c e)
 (mapcar '1+ [1 2 3])
      @result{} (2 3 4)
-(mapcar 'char-to-string "abc")
+(mapcar 'string "abc")
      @result{} ("a" "b" "c")
 @end group
 
--- a/doc/lispref/help.texi	Thu Dec 16 17:43:45 2010 -0500
+++ b/doc/lispref/help.texi	Thu Dec 16 18:30:57 2010 -0500
@@ -546,7 +546,7 @@
 
 @smallexample
 @group
-(define-key global-map (char-to-string help-char) 'help-command)
+(define-key global-map (string help-char) 'help-command)
 (fset 'help-command help-map)
 @end group
 @end smallexample
--- a/doc/lispref/modes.texi	Thu Dec 16 17:43:45 2010 -0500
+++ b/doc/lispref/modes.texi	Thu Dec 16 18:30:57 2010 -0500
@@ -20,14 +20,15 @@
 @ref{Keymaps}, and @ref{Syntax Tables}.
 
 @menu
-* Hooks::              How to use hooks; how to write code that provides hooks.
-* Major Modes::        Defining major modes.
-* Minor Modes::        Defining minor modes.
-* Mode Line Format::   Customizing the text that appears in the mode line.
-* Imenu::              How a mode can provide a menu
+* Hooks::                       How to use hooks; how to write code that provides hooks.
+* Major Modes::                 Defining major modes.
+* Minor Modes::                 Defining minor modes.
+* Mode Line Format::            Customizing the text that appears in the mode line.
+* Imenu::                       How a mode can provide a menu
                          of definitions in the buffer.
-* Font Lock Mode::     How modes can highlight text according to syntax.
-* Desktop Save Mode::  How modes can have buffer state saved between
+* Font Lock Mode::              How modes can highlight text according to syntax.
+* Auto-Indentation::            How to teach Emacs to indent for a major mode.
+* Desktop Save Mode::           How modes can have buffer state saved between
                          Emacs sessions.
 @end menu
 
@@ -78,8 +79,8 @@
 its value is just a single function, not a list of functions.
 
 @menu
-* Running Hooks::      How to run a hook.
-* Setting Hooks::      How to put functions on a hook, or remove them.
+* Running Hooks::               How to run a hook.
+* Setting Hooks::               How to put functions on a hook, or remove them.
 @end menu
 
 @node Running Hooks
@@ -199,16 +200,16 @@
 to another major mode in the same buffer.
 
 @menu
-* Major Mode Basics::
-* Major Mode Conventions::  Coding conventions for keymaps, etc.
-* Auto Major Mode::         How Emacs chooses the major mode automatically.
-* Mode Help::               Finding out how to use a mode.
-* Derived Modes::           Defining a new major mode based on another major
+* Major Mode Basics::           
+* Major Mode Conventions::      Coding conventions for keymaps, etc.
+* Auto Major Mode::             How Emacs chooses the major mode automatically.
+* Mode Help::                   Finding out how to use a mode.
+* Derived Modes::               Defining a new major mode based on another major
                               mode.
-* Generic Modes::           Defining a simple major mode that supports
+* Generic Modes::               Defining a simple major mode that supports
                               comment syntax and Font Lock mode.
-* Mode Hooks::              Hooks run at the end of major mode functions.
-* Example Major Modes::     Text mode and Lisp modes.
+* Mode Hooks::                  Hooks run at the end of major mode functions.
+* Example Major Modes::         Text mode and Lisp modes.
 @end menu
 
 @node Major Mode Basics
@@ -238,9 +239,8 @@
 is distinct from that of Text mode, but uses that of Text mode.
 
   Even if the new mode is not an obvious derivative of any other mode,
-it is convenient to use @code{define-derived-mode} with a @code{nil}
-parent argument, since it automatically enforces the most important
-coding conventions for you.
+we recommend to use @code{define-derived-mode}, since it automatically
+enforces the most important coding conventions for you.
 
   For a very simple programming language major mode that handles
 comments and fontification, you can use @code{define-generic-mode}.
@@ -333,7 +333,7 @@
 programming language, indentation of text according to structure is
 probably useful.  So the mode should set @code{indent-line-function}
 to a suitable function, and probably customize other variables
-for indentation.
+for indentation.  @xref{Auto-Indentation}.
 
 @item
 @cindex keymaps in modes
@@ -429,6 +429,10 @@
 this mode.
 
 @item
+The mode can specify how to complete various keywords by adding
+to the special hook @code{completion-at-point-functions}.
+
+@item
 Use @code{defvar} or @code{defcustom} to set mode-related variables, so
 that they are not reinitialized if they already have a value.  (Such
 reinitialization could discard customizations made by the user.)
@@ -492,7 +496,7 @@
 mode as special if the parent mode is special.  The special mode
 @code{special-mode} provides a convenient parent for other special
 modes to inherit from; it sets @code{buffer-read-only} to @code{t},
-and does nothing else.
+and does little else.
 
 @item
 If you want to make the new mode the default for files with certain
@@ -737,8 +741,10 @@
 @subsection Defining Derived Modes
 @cindex derived mode
 
-  It's often useful to define a new major mode in terms of an existing
-one.  An easy way to do this is to use @code{define-derived-mode}.
+  The recommended way to define a new major mode is to derive it
+from an existing one using @code{define-derived-mode}.  If there is no
+closely related mode, you can inherit from @code{text-mode},
+@code{special-mode}, or in the worst case @code{fundamental-mode}.
 
 @defmac define-derived-mode variant parent name docstring keyword-args@dots{} body@dots{}
 This macro defines @var{variant} as a major mode command, using
@@ -979,8 +985,7 @@
 Turning on Text mode runs the normal hook `text-mode-hook'."
 @end group
 @group
-  (make-local-variable 'text-mode-variant)
-  (setq text-mode-variant t)
+  (set (make-local-variable 'text-mode-variant) t)
   ;; @r{These two lines are a feature added recently.}
   (set (make-local-variable 'require-final-newline)
        mode-require-final-newline)
@@ -998,9 +1003,8 @@
 @smallexample
 @group
 ;; @r{This isn't needed nowadays, since @code{define-derived-mode} does it.}
-(defvar text-mode-abbrev-table nil
+(define-abbrev-table 'text-mode-abbrev-table ()
   "Abbrev table used while in text mode.")
-(define-abbrev-table 'text-mode-abbrev-table ())
 @end group
 
 @group
@@ -1022,12 +1026,10 @@
   ;; @r{These four lines are absent from the current version}
   ;; @r{not because this is done some other way, but rather}
   ;; @r{because nowadays Text mode uses the normal definition of paragraphs.}
-  (make-local-variable 'paragraph-start)
-  (setq paragraph-start (concat "[ \t]*$\\|" page-delimiter))
-  (make-local-variable 'paragraph-separate)
-  (setq paragraph-separate paragraph-start)
-  (make-local-variable 'indent-line-function)
-  (setq indent-line-function 'indent-relative-maybe)
+  (set (make-local-variable 'paragraph-start)
+       (concat "[ \t]*$\\|" page-delimiter))
+  (set (make-local-variable 'paragraph-separate) paragraph-start)
+  (set (make-local-variable 'indent-line-function) 'indent-relative-maybe)
 @end group
 @group
   (setq mode-name "Text")
@@ -1115,15 +1117,12 @@
 
 @smallexample
 @group
-  (make-local-variable 'paragraph-start)
-  (setq paragraph-start (concat page-delimiter "\\|$" ))
-  (make-local-variable 'paragraph-separate)
-  (setq paragraph-separate paragraph-start)
+  (set (make-local-variable 'paragraph-start) (concat page-delimiter "\\|$" ))
+  (set (make-local-variable 'paragraph-separate) paragraph-start)
   @dots{}
 @end group
 @group
-  (make-local-variable 'comment-indent-function)
-  (setq comment-indent-function 'lisp-comment-indent))
+  (set (make-local-variable 'comment-indent-function) 'lisp-comment-indent))
   @dots{}
 @end group
 @end smallexample
@@ -1135,16 +1134,13 @@
 
 @smallexample
 @group
-(defvar shared-lisp-mode-map ()
+(defvar shared-lisp-mode-map
+  (let ((map (make-sparse-keymap)))
+    (define-key shared-lisp-mode-map "\e\C-q" 'indent-sexp)
+    (define-key shared-lisp-mode-map "\177"
+                'backward-delete-char-untabify)
+    map)
   "Keymap for commands shared by all sorts of Lisp modes.")
-
-;; @r{Putting this @code{if} after the @code{defvar} is an older style.}
-(if shared-lisp-mode-map
-    ()
-   (setq shared-lisp-mode-map (make-sparse-keymap))
-   (define-key shared-lisp-mode-map "\e\C-q" 'indent-sexp)
-   (define-key shared-lisp-mode-map "\177"
-               'backward-delete-char-untabify))
 @end group
 @end smallexample
 
@@ -1153,15 +1149,13 @@
 
 @smallexample
 @group
-(defvar lisp-mode-map ()
+(defvar lisp-mode-map
+  (let ((map (make-sparse-keymap)))
+    (set-keymap-parent map shared-lisp-mode-map)
+    (define-key map "\e\C-x" 'lisp-eval-defun)
+    (define-key map "\C-c\C-z" 'run-lisp)
+    map)
   "Keymap for ordinary Lisp mode...")
-
-(if lisp-mode-map
-    ()
-  (setq lisp-mode-map (make-sparse-keymap))
-  (set-keymap-parent lisp-mode-map shared-lisp-mode-map)
-  (define-key lisp-mode-map "\e\C-x" 'lisp-eval-defun)
-  (define-key lisp-mode-map "\C-c\C-z" 'run-lisp))
 @end group
 @end smallexample
 
@@ -1192,11 +1186,9 @@
                                          ;   @r{finds out what to describe.}
   (setq mode-name "Lisp")                ; @r{This goes into the mode line.}
   (lisp-mode-variables t)                ; @r{This defines various variables.}
-  (make-local-variable 'comment-start-skip)
-  (setq comment-start-skip
-        "\\(\\(^\\|[^\\\\\n]\\)\\(\\\\\\\\\\)*\\)\\(;+\\|#|\\) *")
-  (make-local-variable 'font-lock-keywords-case-fold-search)
-  (setq font-lock-keywords-case-fold-search t)
+  (set (make-local-variable 'comment-start-skip)
+       "\\(\\(^\\|[^\\\\\n]\\)\\(\\\\\\\\\\)*\\)\\(;+\\|#|\\) *")
+  (set (make-local-variable 'font-lock-keywords-case-fold-search) t)
 @end group
 @group
   (setq imenu-case-fold-search t)
@@ -1580,14 +1572,14 @@
 minor modes.
 
 @menu
-* Base: Mode Line Basics. Basic ideas of mode line control.
-* Data: Mode Line Data.   The data structure that controls the mode line.
-* Top: Mode Line Top.     The top level variable, mode-line-format.
-* Mode Line Variables::   Variables used in that data structure.
-* %-Constructs::          Putting information into a mode line.
-* Properties in Mode::    Using text properties in the mode line.
-* Header Lines::          Like a mode line, but at the top.
-* Emulating Mode Line::   Formatting text as the mode line would.
+* Base: Mode Line Basics.       Basic ideas of mode line control.
+* Data: Mode Line Data.         The data structure that controls the mode line.
+* Top: Mode Line Top.           The top level variable, mode-line-format.
+* Mode Line Variables::         Variables used in that data structure.
+* %-Constructs::                Putting information into a mode line.
+* Properties in Mode::          Using text properties in the mode line.
+* Header Lines::                Like a mode line, but at the top.
+* Emulating Mode Line::         Formatting text as the mode line would.
 @end menu
 
 @node Mode Line Basics
@@ -2361,7 +2353,7 @@
 * Other Font Lock Variables::   Additional customization facilities.
 * Levels of Font Lock::         Each mode can define alternative levels
                                   so that the user can select more or less.
-* Precalculated Fontification:: How Lisp programs that produce the buffer
+* Precalculated Fontification::  How Lisp programs that produce the buffer
                                   contents can also specify how to fontify it.
 * Faces for Font Lock::         Special faces specifically for Font Lock.
 * Syntactic Font Lock::         Fontification based on syntax tables.
@@ -3223,6 +3215,659 @@
 reasonably fast.
 @end defvar
 
+@node Auto-Indentation
+@section Auto-indention of code
+
+For programming languages, an important feature of a major mode is to
+provide automatic indentation.  This is controlled in Emacs by
+@code{indent-line-function} (@pxref{Mode-Specific Indent}).
+Writing a good indentation function can be difficult and to a large
+extent it is still a black art.
+
+Many major mode authors will start by writing a simple indentation
+function that works for simple cases, for example by comparing with the
+indentation of the previous text line.  For most programming languages
+that are not really line-based, this tends to scale very poorly:
+improving such a function to let it handle more diverse situations tends
+to become more and more difficult, resulting in the end with a large,
+complex, unmaintainable indentation function which nobody dares to touch.
+
+A good indentation function will usually need to actually parse the
+text, according to the syntax of the language.  Luckily, it is not
+necessary to parse the text in as much detail as would be needed
+for a compiler, but on the other hand, the parser embedded in the
+indentation code will want to be somewhat friendly to syntactically
+incorrect code.
+
+Good maintainable indentation functions usually fall into 2 categories:
+either parsing forward from some ``safe'' starting point until the
+position of interest, or parsing backward from the position of interest.
+Neither of the two is a clearly better choice than the other: parsing
+backward is often more difficult than parsing forward because
+programming languages are designed to be parsed forward, but for the
+purpose of indentation it has the advantage of not needing to
+guess a ``safe'' starting point, and it generally enjoys the property
+that only a minimum of text will be analyzed to decide the indentation
+of a line, so indentation will tend to be unaffected by syntax errors in
+some earlier unrelated piece of code.  Parsing forward on the other hand
+is usually easier and has the advantage of making it possible to
+reindent efficiently a whole region at a time, with a single parse.
+
+Rather than write your own indentation function from scratch, it is
+often preferable to try and reuse some existing ones or to rely
+on a generic indentation engine.  There are sadly few such
+engines.  The CC-mode indentation code (used with C, C++, Java, Awk
+and a few other such modes) has been made more generic over the years,
+so if your language seems somewhat similar to one of those languages,
+you might try to use that engine.  @c FIXME: documentation?
+Another one is SMIE which takes an approach in the spirit
+of Lisp sexps and adapts it to non-Lisp languages.
+
+@menu
+* SMIE::                        A simple minded indentation engine
+@end menu
+
+@node SMIE
+@subsection Simple Minded Indentation Engine
+
+SMIE is a package that provides a generic navigation and indentation
+engine.  Based on a very simple parser using an ``operator precedence
+grammar'', it lets major modes extend the sexp-based navigation of Lisp
+to non-Lisp languages as well as provide a simple to use but reliable
+auto-indentation.
+
+Operator precedence grammar is a very primitive technology for parsing
+compared to some of the more common techniques used in compilers.
+It has the following characteristics: its parsing power is very limited,
+and it is largely unable to detect syntax errors, but it has the
+advantage of being algorithmically efficient and able to parse forward
+just as well as backward.  In practice that means that SMIE can use it
+for indentation based on backward parsing, that it can provide both
+@code{forward-sexp} and @code{backward-sexp} functionality, and that it
+will naturally work on syntactically incorrect code without any extra
+effort.  The downside is that it also means that most programming
+languages cannot be parsed correctly using SMIE, at least not without
+resorting to some special tricks (@pxref{SMIE Tricks}).
+
+@menu
+* SMIE setup::                  SMIE setup and features
+* Operator Precedence Grammars::  A very simple parsing technique
+* SMIE Grammar::                Defining the grammar of a language
+* SMIE Lexer::                  Defining tokens
+* SMIE Tricks::                 Working around the parser's limitations
+* SMIE Indentation::            Specifying indentation rules
+* SMIE Indentation Helpers::    Helper functions for indentation rules
+* SMIE Indentation Example::    Sample indentation rules
+@end menu
+
+@node SMIE setup
+@subsubsection SMIE Setup and Features
+
+SMIE is meant to be a one-stop shop for structural navigation and
+various other features which rely on the syntactic structure of code, in
+particular automatic indentation.  The main entry point is
+@code{smie-setup} which is a function typically called while setting
+up a major mode.
+
+@defun smie-setup grammar rules-function &rest keywords
+Setup SMIE navigation and indentation.
+@var{grammar} is a grammar table generated by @code{smie-prec2->grammar}.
+@var{rules-function} is a set of indentation rules for use on
+@code{smie-rules-function}.
+@var{keywords} are additional arguments, which can include the following
+keywords:
+@itemize
+@item
+@code{:forward-token} @var{fun}: Specify the forward lexer to use.
+@item
+@code{:backward-token} @var{fun}: Specify the backward lexer to use.
+@end itemize
+@end defun
+
+Calling this function is sufficient to make commands such as
+@code{forward-sexp}, @code{backward-sexp}, and @code{transpose-sexps} be
+able to properly handle structural elements other than just the paired
+parentheses already handled by syntax tables.  For example, if the
+provided grammar is precise enough, @code{transpose-sexps} can correctly
+transpose the two arguments of a @code{+} operator, taking into account
+the precedence rules of the language.
+
+Calling `smie-setup' is also sufficient to make TAB indentation work in
+the expected way, extends @code{blink-matching-paren} to apply to
+elements like @code{begin...end}, and provides some commands that you
+can bind in the major mode keymap.
+
+@deffn Command smie-close-block
+This command closes the most recently opened (and not yet closed) block.
+@end deffn
+
+@deffn Command smie-down-list &optional arg
+This command is like @code{down-list} but it also pays attention to
+nesting of tokens other than parentheses, such as @code{begin...end}.
+@end deffn
+
+@node Operator Precedence Grammars
+@subsubsection Operator Precedence Grammars
+
+SMIE's precedence grammars simply give to each token a pair of
+precedences: the left-precedence and the right-precedence.  We say
+@code{T1 < T2} if the right-precedence of token @code{T1} is less than
+the left-precedence of token @code{T2}.  A good way to read this
+@code{<} is as a kind of parenthesis: if we find @code{... T1 something
+T2 ...}  then that should be parsed as @code{... T1 (something T2 ...}
+rather than as @code{... T1 something) T2 ...}.  The latter
+interpretation would be the case if we had @code{T1 > T2}.  If we have
+@code{T1 = T2}, it means that token T2 follows token T1 in the same
+syntactic construction, so typically we have @code{"begin" = "end"}.
+Such pairs of precedences are sufficient to express left-associativity
+or right-associativity of infix operators, nesting of tokens like
+parentheses and many other cases.
+
+@c ¡Let's leave this undocumented to leave it more open for change!
+@c @defvar smie-grammar
+@c The value of this variable is an alist specifying the left and right
+@c precedence of each token.  It is meant to be initialized by using one of
+@c the functions below.
+@c @end defvar
+
+@defun smie-prec2->grammar table
+This function takes a @emph{prec2} grammar @var{table} and returns an
+alist suitable for use in @code{smie-setup}.  The @emph{prec2}
+@var{table} is itself meant to be built by one of the functions below.
+@end defun
+
+@defun smie-merge-prec2s &rest tables
+This function takes several @emph{prec2} @var{tables} and merges them
+into a new @emph{prec2} table.
+@end defun
+
+@defun smie-precs->prec2 precs
+This function builds a @emph{prec2} table from a table of precedences
+@var{precs}.  @var{precs} should be a list, sorted by precedence (for
+example @code{"+"} will come before @code{"*"}), of elements of the form
+@code{(@var{assoc} @var{op} ...)}, where each @var{op} is a token that
+acts as an operator; @var{assoc} is their associativity, which can be
+either @code{left}, @code{right}, @code{assoc}, or @code{nonassoc}.
+All operators in a given element share the same precedence level
+and associativity.
+@end defun
+
+@defun smie-bnf->prec2 bnf &rest resolvers
+This function lets you specify the grammar using a BNF notation.
+It accepts a @var{bnf} description of the grammar along with a set of
+conflict resolution rules @var{resolvers}, and
+returns a @emph{prec2} table.
+
+@var{bnf} is a list of nonterminal definitions of the form
+@code{(@var{nonterm} @var{rhs1} @var{rhs2} ...)} where each @var{rhs}
+is a (non-empty) list of terminals (aka tokens) or non-terminals.
+
+Not all grammars are accepted:
+@itemize
+@item
+An @var{rhs} cannot be an empty list (an empty list is never needed,
+since SMIE allows all non-terminals to match the empty string anyway).
+@item
+An @var{rhs} cannot have 2 consecutive non-terminals: each pair of
+non-terminals needs to be separated by a terminal (aka token).
+This is a fundamental limitation of operator precedence grammars.
+@end itemize
+
+Additionally, conflicts can occur:
+@itemize
+@item
+The returned @emph{prec2} table holds constraints between pairs of tokens, and
+for any given pair only one constraint can be present: T1 < T2,
+T1 = T2, or T1 > T2.
+@item
+A token can be an @code{opener} (something similar to an open-paren),
+a @code{closer} (like a close-paren), or @code{neither} of the two
+(e.g. an infix operator, or an inner token like @code{"else"}).
+@end itemize
+
+Precedence conflicts can be resolved via @var{resolvers}, which
+is a list of @emph{precs} tables (see @code{smie-precs->prec2}): for
+each precedence conflict, if those @code{precs} tables
+specify a particular constraint, then the conflict is resolved by using
+this constraint instead, else a conflict is reported and one of the
+conflicting constraints is picked arbitrarily and the others are
+simply ignored.
+@end defun
+
+@node SMIE Grammar
+@subsubsection Defining the Grammar of a Language
+
+The usual way to define the SMIE grammar of a language is by
+defining a new global variable that holds the precedence table by
+giving a set of BNF rules.
+For example, the grammar definition for a small Pascal-like language
+could look like:
+@example
+@group
+(require 'smie)
+(defvar sample-smie-grammar
+  (smie-prec2->grammar
+   (smie-bnf->prec2
+@end group
+@group
+    '((id)
+      (inst ("begin" insts "end")
+            ("if" exp "then" inst "else" inst)
+            (id ":=" exp)
+            (exp))
+      (insts (insts ";" insts) (inst))
+      (exp (exp "+" exp)
+           (exp "*" exp)
+           ("(" exps ")"))
+      (exps (exps "," exps) (exp)))
+@end group
+@group
+    '((assoc ";"))
+    '((assoc ","))
+    '((assoc "+") (assoc "*")))))
+@end group
+@end example
+
+@noindent
+A few things to note:
+
+@itemize
+@item
+The above grammar does not explicitly mention the syntax of function
+calls: SMIE will automatically allow any sequence of sexps, such as
+identifiers, balanced parentheses, or @code{begin ... end} blocks
+to appear anywhere anyway.
+@item
+The grammar category @code{id} has no right hand side: this does not
+mean that it can match only the empty string, since as mentioned any
+sequence of sexps can appear anywhere anyway.
+@item
+Because non terminals cannot appear consecutively in the BNF grammar, it
+is difficult to correctly handle tokens that act as terminators, so the
+above grammar treats @code{";"} as a statement @emph{separator} instead,
+which SMIE can handle very well.
+@item
+Separators used in sequences (such as @code{","} and @code{";"} above)
+are best defined with BNF rules such as @code{(foo (foo "separator" foo) ...)}
+which generate precedence conflicts which are then resolved by giving
+them an explicit @code{(assoc "separator")}.
+@item
+The @code{("(" exps ")")} rule was not needed to pair up parens, since
+SMIE will pair up any characters that are marked as having paren syntax
+in the syntax table.  What this rule does instead (together with the
+definition of @code{exps}) is to make it clear that @code{","} should
+not appear outside of parentheses.
+@item
+Rather than have a single @emph{precs} table to resolve conflicts, it is
+preferable to have several tables, so as to let the BNF part of the
+grammar specify relative precedences where possible.
+@item
+Unless there is a very good reason to prefer @code{left} or
+@code{right}, it is usually preferable to mark operators as associative,
+using @code{assoc}.  For that reason @code{"+"} and @code{"*"} are
+defined above as @code{assoc}, although the language defines them
+formally as left associative.
+@end itemize
+
+@node SMIE Lexer
+@subsubsection Defining Tokens
+
+SMIE comes with a predefined lexical analyzer which uses syntax tables
+in the following way: any sequence of characters that have word or
+symbol syntax is considered a token, and so is any sequence of
+characters that have punctuation syntax.  This default lexer is
+often a good starting point but is rarely actually correct for any given
+language.  For example, it will consider @code{"2,+3"} to be composed
+of 3 tokens: @code{"2"}, @code{",+"}, and @code{"3"}.
+
+To describe the lexing rules of your language to SMIE, you need
+2 functions, one to fetch the next token, and another to fetch the
+previous token.  Those functions will usually first skip whitespace and
+comments and then look at the next chunk of text to see if it
+is a special token.  If so it should skip the token and
+return a description of this token.  Usually this is simply the string
+extracted from the buffer, but it can be anything you want.
+For example:
+@example
+@group
+(defvar sample-keywords-regexp
+  (regexp-opt '("+" "*" "," ";" ">" ">=" "<" "<=" ":=" "=")))
+@end group
+@group
+(defun sample-smie-forward-token ()
+  (forward-comment (point-max))
+  (cond
+   ((looking-at sample-keywords-regexp)
+    (goto-char (match-end 0))
+    (match-string-no-properties 0))
+   (t (buffer-substring-no-properties
+       (point)
+       (progn (skip-syntax-forward "w_")
+              (point))))))
+@end group
+@group
+(defun sample-smie-backward-token ()
+  (forward-comment (- (point)))
+  (cond
+   ((looking-back sample-keywords-regexp (- (point) 2) t)
+    (goto-char (match-beginning 0))
+    (match-string-no-properties 0))
+   (t (buffer-substring-no-properties
+       (point)
+       (progn (skip-syntax-backward "w_")
+              (point))))))
+@end group
+@end example
+
+Notice how those lexers return the empty string when in front of
+parentheses.  This is because SMIE automatically takes care of the
+parentheses defined in the syntax table.  More specifically if the lexer
+returns nil or an empty string, SMIE tries to handle the corresponding
+text as a sexp according to syntax tables.
+
+@node SMIE Tricks
+@subsubsection Living With a Weak Parser
+
+The parsing technique used by SMIE does not allow tokens to behave
+differently in different contexts.  For most programming languages, this
+manifests itself by precedence conflicts when converting the
+BNF grammar.
+
+Sometimes, those conflicts can be worked around by expressing the
+grammar slightly differently.  For example, for Modula-2 it might seem
+natural to have a BNF grammar that looks like this:
+
+@example
+  ...
+  (inst ("IF" exp "THEN" insts "ELSE" insts "END")
+        ("CASE" exp "OF" cases "END")
+        ...)
+  (cases (cases "|" cases) (caselabel ":" insts) ("ELSE" insts))
+  ...
+@end example
+
+But this will create conflicts for @code{"ELSE"}: on the one hand, the
+IF rule implies (among many other things) that @code{"ELSE" = "END"};
+but on the other hand, since @code{"ELSE"} appears within @code{cases},
+which appears left of @code{"END"}, we also have @code{"ELSE" > "END"}.
+We can solve the conflict either by using:
+@example
+  ...
+  (inst ("IF" exp "THEN" insts "ELSE" insts "END")
+        ("CASE" exp "OF" cases "END")
+        ("CASE" exp "OF" cases "ELSE" insts "END")
+        ...)
+  (cases (cases "|" cases) (caselabel ":" insts))
+  ...
+@end example
+or
+@example
+  ...
+  (inst ("IF" exp "THEN" else "END")
+        ("CASE" exp "OF" cases "END")
+        ...)
+  (else (insts "ELSE" insts))
+  (cases (cases "|" cases) (caselabel ":" insts) (else))
+  ...
+@end example
+
+Reworking the grammar to try and solve conflicts has its downsides, tho,
+because SMIE assumes that the grammar reflects the logical structure of
+the code, so it is preferable to keep the BNF closer to the intended
+abstract syntax tree.
+
+Other times, after careful consideration you may conclude that those
+conflicts are not serious and simply resolve them via the
+@var{resolvers} argument of @code{smie-bnf->prec2}.  Usually this is
+because the grammar is simply ambiguous: the conflict does not affect
+the set of programs described by the grammar, but only the way those
+programs are parsed.  This is typically the case for separators and
+associative infix operators, where you want to add a resolver like
+@code{'((assoc "|"))}.  Another case where this can happen is for the
+classic @emph{dangling else} problem, where you will use @code{'((assoc
+"else" "then"))}.  It can also happen for cases where the conflict is
+real and cannot really be resolved, but it is unlikely to pose a problem
+in practice.
+
+Finally, in many cases some conflicts will remain despite all efforts to
+restructure the grammar.  Do not despair: while the parser cannot be
+made more clever, you can make the lexer as smart as you want.  So, the
+solution is then to look at the tokens involved in the conflict and to
+split one of those tokens into 2 (or more) different tokens.  E.g. if
+the grammar needs to distinguish between two incompatible uses of the
+token @code{"begin"}, make the lexer return different tokens (say
+@code{"begin-fun"} and @code{"begin-plain"}) depending on which kind of
+@code{"begin"} it finds.  This pushes the work of distinguishing the
+different cases to the lexer, which will thus have to look at the
+surrounding text to find ad-hoc clues.
+
+@node SMIE Indentation
+@subsubsection Specifying Indentation Rules
+
+Based on the provided grammar, SMIE will be able to provide automatic
+indentation without any extra effort.  But in practice, this default
+indentation style will probably not be good enough.  You will want to
+tweak it in many different cases.
+
+SMIE indentation is based on the idea that indentation rules should be
+as local as possible.  To this end, it relies on the idea of
+@emph{virtual} indentation, which is the indentation that a particular
+program point would have if it were at the beginning of a line.
+Of course, if that program point is indeed at the beginning of a line,
+its virtual indentation is its current indentation.  But if not, then
+SMIE uses the indentation algorithm to compute the virtual indentation
+of that point.  Now in practice, the virtual indentation of a program
+point does not have to be identical to the indentation it would have if
+we inserted a newline before it.  To see how this works, the SMIE rule
+for indentation after a @code{@{} in C does not care whether the
+@code{@{} is standing on a line of its own or is at the end of the
+preceding line.  Instead, these different cases are handled in the
+indentation rule that decides how to indent before a @code{@{}.
+
+Another important concept is the notion of @emph{parent}: The
+@emph{parent} of a token, is the head token of the nearest enclosing
+syntactic construct.  For example, the parent of an @code{else} is the
+@code{if} to which it belongs, and the parent of an @code{if}, in turn,
+is the lead token of the surrounding construct.  The command
+@code{backward-sexp} jumps from a token to its parent, but there are
+some caveats: for @emph{openers} (tokens which start a construct, like
+@code{if}), you need to start with point before the token, while for
+others you need to start with point after the token.
+@code{backward-sexp} stops with point before the parent token if that is
+the @emph{opener} of the token of interest, and otherwise it stops with
+point after the parent token.
+
+SMIE indentation rules are specified using a function that takes two
+arguments @var{method} and @var{arg} where the meaning of @var{arg} and the
+expected return value depend on @var{method}.
+
+@var{method} can be:
+@itemize
+@item
+@code{:after}, in which case @var{arg} is a token and the function
+should return the @var{offset} to use for indentation after @var{arg}.
+@item
+@code{:before}, in which case @var{arg} is a token and the function
+should return the @var{offset} to use to indent @var{arg} itself.
+@item
+@code{:elem}, in which case the function should return either the offset
+to use to indent function arguments (if @var{arg} is the symbol
+@code{arg}) or the basic indentation step (if @var{arg} is the symbol
+@code{basic}).
+@item
+@code{:list-intro}, in which case @var{arg} is a token and the function
+should return non-@code{nil} if the token is followed by a list of
+expressions (not separated by any token) rather than an expression.
+@end itemize
+
+When @var{arg} is a token, the function is called with point just before
+that token.  A return value of nil always means to fallback on the
+default behavior, so the function should return nil for arguments it
+does not expect.
+
+@var{offset} can be:
+@itemize
+@item
+@code{nil}: use the default indentation rule.
+@item
+@code{(column . @var{column})}: indent to column @var{column}.
+@item
+@var{number}: offset by @var{number}, relative to a base token which is
+the current token for @code{:after} and its parent for @code{:before}.
+@end itemize
+
+@node SMIE Indentation Helpers
+@subsubsection Helper Functions for Indentation Rules
+
+SMIE provides various functions designed specifically for use in the
+indentation rules function (several of those functions break if used in
+another context).  These functions all start with the prefix
+@code{smie-rule-}.
+
+@defun smie-rule-bolp
+Return non-@code{nil} if the current token is the first on the line.
+@end defun
+
+@defun smie-rule-hanging-p
+Return non-@code{nil} if the current token is @emph{hanging}.
+A token is @emph{hanging} if it is the last token on the line
+and if it is preceded by other tokens: a lone token on a line is not
+hanging.
+@end defun
+
+@defun smie-rule-next-p &rest tokens
+Return non-@code{nil} if the next token is among @var{tokens}.
+@end defun
+
+@defun smie-rule-prev-p &rest tokens
+Return non-@code{nil} if the previous token is among @var{tokens}.
+@end defun
+
+@defun smie-rule-parent-p &rest parents
+Return non-@code{nil} if the current token's parent is among @var{parents}.
+@end defun
+
+@defun smie-rule-sibling-p
+Return non-nil if the current token's parent is actually a sibling.
+This is the case for example when the parent of a @code{","} is just the
+previous @code{","}.
+@end defun
+
+@defun smie-rule-parent &optional offset
+Return the proper offset to align the current token with the parent.
+If non-@code{nil}, @var{offset} should be an integer giving an
+additional offset to apply.
+@end defun
+
+@defun smie-rule-separator method
+Indent current token as a @emph{separator}.
+
+By @emph{separator}, we mean here a token whose sole purpose is to
+separate various elements within some enclosing syntactic construct, and
+which does not have any semantic significance in itself (i.e. it would
+typically not exist as a node in an abstract syntax tree).
+
+Such a token is expected to have an associative syntax and be closely
+tied to its syntactic parent.  Typical examples are @code{","} in lists
+of arguments (enclosed inside parentheses), or @code{";"} in sequences
+of instructions (enclosed in a @code{@{...@}} or @code{begin...end}
+block).
+
+@var{method} should be the method name that was passed to
+`smie-rules-function'.
+@end defun
+
+@node SMIE Indentation Example
+@subsubsection Sample Indentation Rules
+
+Here is an example of an indentation function:
+
+@example
+(defun sample-smie-rules (kind token)
+  (pcase (cons kind token)
+    (`(:elem . basic) sample-indent-basic)
+    (`(,_ . ",") (smie-rule-separator kind))
+    (`(:after . ":=") sample-indent-basic)
+    (`(:before . ,(or `"begin" `"(" `"@{")))
+     (if (smie-rule-hanging-p) (smie-rule-parent)))
+    (`(:before . "if")
+     (and (not (smie-rule-bolp)) (smie-rule-prev-p "else")
+          (smie-rule-parent)))))
+@end example
+
+@noindent
+A few things to note:
+
+@itemize
+@item
+The first case indicates the basic indentation increment to use.
+If @code{sample-indent-basic} is nil, then SMIE uses the global
+setting @code{smie-indent-basic}.  The major mode could have set
+@code{smie-indent-basic} buffer-locally instead, but that
+is discouraged.
+
+@item
+The rule for the token @code{","} make SMIE try to be more clever when
+the comma separator is placed at the beginning of lines.  It tries to
+outdent the separator so as to align the code after the comma; for
+example:
+
+@example
+x = longfunctionname (
+        arg1
+      , arg2
+    );
+@end example
+
+@item
+The rule for indentation after @code{":="} exists because otherwise
+SMIE would treat @code{":="} as an infix operator and would align the
+right argument with the left one.
+
+@item
+The rule for indentation before @code{"begin"} is an example of the use
+of virtual indentation:  This rule is used only when @code{"begin"} is
+hanging, which can happen only when @code{"begin"} is not at the
+beginning of a line.  So this is not used when indenting
+@code{"begin"} itself but only when indenting something relative to this
+@code{"begin"}.  Concretely, this rule changes the indentation from:
+
+@example
+    if x > 0 then begin
+            dosomething(x);
+        end
+@end example
+to
+@example
+    if x > 0 then begin
+        dosomething(x);
+    end
+@end example
+
+@item
+The rule for indentation before @code{"if"} is similar to the one for
+@code{"begin"}, but where the purpose is to treat @code{"else if"}
+as a single unit, so as to align a sequence of tests rather than indent
+each test further to the right.  This function does this only in the
+case where the @code{"if"} is not placed on a separate line, hence the
+@code{smie-rule-bolp} test.
+
+If we know that the @code{"else"} is always aligned with its @code{"if"}
+and is always at the beginning of a line, we can use a more efficient
+rule:
+@example
+((equal token "if")
+ (and (not (smie-rule-bolp)) (smie-rule-prev-p "else")
+      (save-excursion
+        (sample-smie-backward-token)  ;Jump before the "else".
+        (cons 'column (current-column)))))
+@end example
+
+The advantage of this formulation is that it reuses the indentation of
+the previous @code{"else"}, rather than going all the way back to the
+first @code{"if"} of the sequence.
+@end itemize
+
 @node Desktop Save Mode
 @section Desktop Save Mode
 @cindex desktop save mode
@@ -3276,5 +3921,7 @@
 @end defvar
 
 @ignore
-   arch-tag: 4c7bff41-36e6-4da6-9e7f-9b9289e27c8e
+   Local Variables:
+   fill-column: 72
+   End:
 @end ignore
--- a/doc/lispref/nonascii.texi	Thu Dec 16 17:43:45 2010 -0500
+++ b/doc/lispref/nonascii.texi	Thu Dec 16 18:30:57 2010 -0500
@@ -199,6 +199,13 @@
 characters.
 @end defun
 
+@defun byte-to-string byte
+@cindex byte to string
+This function returns a unibyte string containing a single byte of
+character data, @var{character}.  It signals a error if
+@var{character} is not an integer between 0 and 255.
+@end defun
+
 @defun multibyte-char-to-unibyte char
 This converts the multibyte character @var{char} to a unibyte
 character, and returns that character.  If @var{char} is neither
--- a/doc/lispref/numbers.texi	Thu Dec 16 17:43:45 2010 -0500
+++ b/doc/lispref/numbers.texi	Thu Dec 16 18:30:57 2010 -0500
@@ -224,6 +224,14 @@
 @end example
 @end defun
 
+@defvar float-e
+The mathematical constant @math{e} (2.71828@dots{}).
+@end defvar
+
+@defvar float-pi
+The mathematical constant @math{pi} (3.14159@dots{}).
+@end defvar
+
 @node Predicates on Numbers
 @section Type Predicates for Numbers
 @cindex predicates for numbers
--- a/doc/lispref/objects.texi	Thu Dec 16 17:43:45 2010 -0500
+++ b/doc/lispref/objects.texi	Thu Dec 16 18:30:57 2010 -0500
@@ -582,7 +582,6 @@
 @group
 foo                 ; @r{A symbol named @samp{foo}.}
 FOO                 ; @r{A symbol named @samp{FOO}, different from @samp{foo}.}
-char-to-string      ; @r{A symbol named @samp{char-to-string}.}
 @end group
 @group
 1+                  ; @r{A symbol named @samp{1+}}
--- a/doc/lispref/processes.texi	Thu Dec 16 17:43:45 2010 -0500
+++ b/doc/lispref/processes.texi	Thu Dec 16 18:30:57 2010 -0500
@@ -195,10 +195,18 @@
 @end example
 @end defun
 
-@cindex quoting and unquoting shell command line
-  The following two functions are useful for creating shell commands
-from individual argument strings, and taking shell command lines apart
-into individual arguments.
+@cindex quoting and unquoting command-line arguments
+@cindex minibuffer input, and command-line arguments
+@cindex @code{call-process}, command-line arguments from minibuffer
+@cindex @code{start-process}, command-line arguments from minibuffer
+  The following two functions are useful for combining a list of
+individual command-line argument strings into a single string, and
+taking a string apart into a list of individual command-line
+arguments.  These functions are mainly intended to be used for
+converting user input in the minibuffer, a Lisp string, into a list of
+string arguments to be passed to @code{call-process} or
+@code{start-process}, or for the converting such lists of arguments in
+a single Lisp string to be presented in the minibuffer or echo area.
 
 @defun split-string-and-unquote string &optional separators
 This function splits @var{string} into substrings at matches for the
@@ -210,7 +218,7 @@
 @code{"\\s-+"}, which is a regular expression that matches one or more
 characters with whitespace syntax (@pxref{Syntax Class Table}).
 
-This function performs two types of quoting: enclosing a whole string
+This function supports two types of quoting: enclosing a whole string
 in double quotes @code{"@dots{}"}, and quoting individual characters
 with a backslash escape @samp{\}.  The latter is also used in Lisp
 strings, so this function can handle those as well.
@@ -226,9 +234,8 @@
 The strings in @var{list-of-strings} that need quoting are those that
 include @var{separator} as their substring.  Quoting a string encloses
 it in double quotes @code{"@dots{}"}.  In the simplest case, if you
-are consing a shell command from the individual command-line
-arguments, every argument that includes embedded blanks will be
-quoted.
+are consing a command from the individual command-line arguments,
+every argument that includes embedded blanks will be quoted.
 @end defun
 
 @node Synchronous Processes
--- a/doc/lispref/strings.texi	Thu Dec 16 17:43:45 2010 -0500
+++ b/doc/lispref/strings.texi	Thu Dec 16 18:30:57 2010 -0500
@@ -126,9 +126,8 @@
      @result{} ""
 @end example
 
-  Other functions to compare with this one include @code{char-to-string}
-(@pxref{String Conversion}), @code{make-vector} (@pxref{Vectors}), and
-@code{make-list} (@pxref{Building Lists}).
+  Other functions to compare with this one include @code{make-vector}
+(@pxref{Vectors}) and @code{make-list} (@pxref{Building Lists}).
 @end defun
 
 @defun string &rest characters
@@ -349,9 +348,9 @@
      @result{} ("o" "o" "o")
 @end example
 
-If you need to split a string that is a shell command, where
-individual arguments could be quoted, see @ref{Shell Arguments,
-split-string-and-unquote}.
+If you need to split a string into a list of individual command-line
+arguments suitable for @code{call-process} or @code{start-process},
+see @ref{Shell Arguments, split-string-and-unquote}.
 @end defun
 
 @defvar split-string-default-separators
@@ -565,38 +564,6 @@
 (@code{single-key-description} and @code{text-char-description}).  These
 are used primarily for making help messages.
 
-@defun char-to-string character
-@cindex character to string
-This function returns a new string containing one character,
-@var{character}.  This function is semi-obsolete because the function
-@code{string} is more general.  @xref{Creating Strings}.
-@end defun
-
-@defun string-to-char string
-@cindex string to character
-  This function returns the first character in @var{string}.  If the
-string is empty, the function returns 0.  The value is also 0 when the
-first character of @var{string} is the null character, @acronym{ASCII} code
-0.
-
-@example
-(string-to-char "ABC")
-     @result{} 65
-
-(string-to-char "xyz")
-     @result{} 120
-(string-to-char "")
-     @result{} 0
-@group
-(string-to-char "\000")
-     @result{} 0
-@end group
-@end example
-
-This function may be eliminated in the future if it does not seem useful
-enough to retain.
-@end defun
-
 @defun number-to-string number
 @cindex integer to string
 @cindex integer to decimal
@@ -659,19 +626,39 @@
 @code{string-to-int} is an obsolete alias for this function.
 @end defun
 
+@defun char-to-string character
+@cindex character to string
+This function returns a new string containing one character,
+@var{character}.  This function is semi-obsolete because the function
+@code{string} is more general.  @xref{Creating Strings}.
+@end defun
+
+@defun string-to-char string
+  This function returns the first character in @var{string}.  This
+mostly identical to @code{(aref string 0)}, except that it returns 0
+if the string is empty.  (The value is also 0 when the first character
+of @var{string} is the null character, @acronym{ASCII} code 0.)  This
+function may be eliminated in the future if it does not seem useful
+enough to retain.
+@end defun
+
   Here are some other functions that can convert to or from a string:
 
 @table @code
 @item concat
-@code{concat} can convert a vector or a list into a string.
+This function converts a vector or a list into a string.
 @xref{Creating Strings}.
 
 @item vconcat
-@code{vconcat} can convert a string into a vector.  @xref{Vector
+This function converts a string into a vector.  @xref{Vector
 Functions}.
 
 @item append
-@code{append} can convert a string into a list.  @xref{Building Lists}.
+This function converts a string into a list.  @xref{Building Lists}.
+
+@item byte-to-string
+This function converts a byte of character data into a unibyte string.
+@xref{Converting Representations}.
 @end table
 
 @node Formatting Strings
--- a/doc/lispref/symbols.texi	Thu Dec 16 17:43:45 2010 -0500
+++ b/doc/lispref/symbols.texi	Thu Dec 16 18:30:57 2010 -0500
@@ -383,7 +383,7 @@
 example using @code{mapatoms}.
 @end defun
 
-@defun unintern symbol &optional obarray
+@defun unintern symbol obarray
 This function deletes @var{symbol} from the obarray @var{obarray}.  If
 @code{symbol} is not actually in the obarray, @code{unintern} does
 nothing.  If @var{obarray} is @code{nil}, the current obarray is used.
--- a/doc/lispref/text.texi	Thu Dec 16 17:43:45 2010 -0500
+++ b/doc/lispref/text.texi	Thu Dec 16 18:30:57 2010 -0500
@@ -87,7 +87,7 @@
 
 @example
 @group
-(char-to-string (char-after 1))
+(string (char-after 1))
      @result{} "@@"
 @end group
 @end example
@@ -122,9 +122,9 @@
 @end group
 
 @group
-(char-to-string (preceding-char))
+(string (preceding-char))
      @result{} "a"
-(char-to-string (following-char))
+(string (following-char))
      @result{} "c"
 @end group
 @end example
@@ -866,7 +866,7 @@
 @code{last-command}) whether the previous command was a kill command,
 and if so appends the killed text to the most recent entry.
 
-@deffn Command kill-region start end &optional yank-handler
+@deffn Command kill-region start end
 This function kills the text in the region defined by @var{start} and
 @var{end}.  The text is deleted but saved in the kill ring, along with
 its text properties.  The value is always @code{nil}.
@@ -874,17 +874,10 @@
 In an interactive call, @var{start} and @var{end} are point and
 the mark.
 
-@c Emacs 19 feature
 If the buffer or text is read-only, @code{kill-region} modifies the kill
 ring just the same, then signals an error without modifying the buffer.
 This is convenient because it lets the user use a series of kill
 commands to copy text from a read-only buffer into the kill ring.
-
-If @var{yank-handler} is non-@code{nil}, this puts that value onto
-the string of killed text, as a @code{yank-handler} text property.
-@xref{Yanking}.  Note that if @var{yank-handler} is @code{nil}, any
-@code{yank-handler} properties present on the killed text are copied
-onto the kill ring, like other text properties.
 @end deffn
 
 @defopt kill-read-only-ok
@@ -1069,7 +1062,7 @@
 move the yanking pointer.
 @end defun
 
-@defun kill-new string &optional replace yank-handler
+@defun kill-new string &optional replace
 This function pushes the text @var{string} onto the kill ring and
 makes the yanking pointer point to it.  It discards the oldest entry
 if appropriate.  It also invokes the value of
@@ -1078,25 +1071,15 @@
 If @var{replace} is non-@code{nil}, then @code{kill-new} replaces the
 first element of the kill ring with @var{string}, rather than pushing
 @var{string} onto the kill ring.
-
-If @var{yank-handler} is non-@code{nil}, this puts that value onto
-the string of killed text, as a @code{yank-handler} property.
-@xref{Yanking}.  Note that if @var{yank-handler} is @code{nil}, then
-@code{kill-new} copies any @code{yank-handler} properties present on
-@var{string} onto the kill ring, as it does with other text properties.
 @end defun
 
-@defun kill-append string before-p &optional yank-handler
+@defun kill-append string before-p
 This function appends the text @var{string} to the first entry in the
 kill ring and makes the yanking pointer point to the combined entry.
 Normally @var{string} goes at the end of the entry, but if
 @var{before-p} is non-@code{nil}, it goes at the beginning.  This
 function also invokes the value of @code{interprogram-cut-function}
-(see below).  This handles @var{yank-handler} just like
-@code{kill-new}, except that if @var{yank-handler} is different from
-the @code{yank-handler} property of the first entry of the kill ring,
-@code{kill-append} pushes the concatenated string onto the kill ring,
-instead of replacing the original first entry with it.
+(see below).
 @end defun
 
 @defvar interprogram-paste-function
@@ -2220,11 +2203,11 @@
 @defvar indent-line-function
 This variable's value is the function to be used by @key{TAB} (and
 various commands) to indent the current line.  The command
-@code{indent-according-to-mode} does no more than call this function.
+@code{indent-according-to-mode} does little more than call this function.
 
 In Lisp mode, the value is the symbol @code{lisp-indent-line}; in C
 mode, @code{c-indent-line}; in Fortran mode, @code{fortran-indent-line}.
-The default value is @code{indent-relative}.
+The default value is @code{indent-relative}.  @xref{Auto-Indentation}.
 @end defvar
 
 @deffn Command indent-according-to-mode
--- a/doc/lispref/variables.texi	Thu Dec 16 17:43:45 2010 -0500
+++ b/doc/lispref/variables.texi	Thu Dec 16 18:30:57 2010 -0500
@@ -544,21 +544,23 @@
 buffer-local bindings for a symbol that is defined with
 @code{defconst}.)
 
-Here, @code{pi} is a constant that presumably ought not to be changed
-by anyone (attempts by the Indiana State Legislature notwithstanding).
-As the second form illustrates, however, this is only advisory.
+An example of the use of @code{defconst} is Emacs' definition of
+@code{float-pi}---the mathematical constant @math{pi}, which ought not
+to be changed by anyone (attempts by the Indiana State Legislature
+notwithstanding).  As the second form illustrates, however,
+@code{defconst} is only advisory.
 
 @example
 @group
-(defconst pi 3.1415 "Pi to five places.")
-     @result{} pi
+(defconst float-pi 3.141592653589793 "The value of Pi.")
+     @result{} float-pi
 @end group
 @group
-(setq pi 3)
-     @result{} pi
+(setq float-pi 3)
+     @result{} float-pi
 @end group
 @group
-pi
+float-pi
      @result{} 3
 @end group
 @end example
--- a/doc/misc/ChangeLog	Thu Dec 16 17:43:45 2010 -0500
+++ b/doc/misc/ChangeLog	Thu Dec 16 18:30:57 2010 -0500
@@ -1,3 +1,92 @@
+2010-12-16  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+	* gnus.texi (Archived Messages): Remove outdated text.
+
+2010-12-16  Teodor Zlatanov  <tzz@lifelogs.com>
+
+	* gnus.texi (Foreign Groups): Added clarification of foreign groups.
+
+2010-12-15  Andrew Cohen  <cohen@andy.bu.edu>
+
+	* gnus.texi (The hyrex Engine): Say that this engine as obsolete.
+
+2010-12-14  Andrew Cohen  <cohen@andy.bu.edu>
+
+	* gnus.texi (The swish++ Engine): Add customizable parameters
+	descriptions.
+	(The swish-e Engine): Ditto.
+
+2010-12-14  Michael Albinus  <michael.albinus@gmx.de>
+
+	* tramp.texi (Inline methods): Add "ksu" method.
+	(Remote processes): Add example with remote `default-directory'.
+
+2010-12-14  Glenn Morris  <rgm@gnu.org>
+
+	* faq.texi (Expanding aliases when sending mail):
+	Now build-mail-aliases is interactive.
+
+2010-12-13  Andrew Cohen  <cohen@andy.bu.edu>
+
+	* gnus.texi: First pass at adding (rough) nnir documentation.
+
+2010-12-13  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+	* gnus.texi (Filtering New Groups):
+	Mention gnus-auto-subscribed-categories.
+	(The First Time): Remove, since default-subscribed-newsgroups has been
+	removed.
+
+2010-12-13  Glenn Morris  <rgm@gnu.org>
+
+	* cl.texi (For Clauses): Small fixes for frames and windows.
+
+2010-12-11  Carsten Dominik  <carsten.dominik@gmail.com>
+
+	* org.texi (Using capture): Document using prefix arguments for
+	finalizing capture.
+	(Agenda commands): Document prefix argument for the bulk scatter
+	command.
+	(Beamer class export): Document that also overlay arguments can be
+	passed to the column environment.
+	(Template elements): Document the new entry type.
+
+2010-12-11  Puneeth Chaganti  <punchagan@gmail.com>
+
+	* org.texi (Include files): Document :minlevel.
+
+2010-12-11  Julien Danjou  <julien@danjou.info>
+
+	* org.texi (Categories): Document category icons.
+
+2010-12-11  Eric Schulte  <schulte.eric@gmail.com>
+
+	* org.texi (noweb): Fix typo.
+
+2010-12-06  Tassilo Horn  <tassilo@member.fsf.org>
+
+	* gnus.texi (Server Commands): Point to the rest of the server
+	commands.
+
+2010-12-04  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+	* gnus.texi (Paging the Article): Note the reverse meanings of `C-u C-u
+	g'.
+
+2010-12-02  Julien Danjou  <julien@danjou.info>
+
+	* gnus.texi (Archived Messages): Remove gnus-outgoing-message-group.
+
+2010-11-28  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+	* gnus.texi (Customizing the IMAP Connection): Note the new defaults.
+	(Direct Functions): Note the STARTTLS upgrade.
+
+2010-11-27  Glenn Morris  <rgm@gnu.org>
+	    James Clark  <none@example.com>
+
+	* nxml-mode.texi (Introduction): New section.
+
 2010-11-21  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
 	* gnus.texi (Server Commands): Document gnus-server-show-server.
--- a/doc/misc/cl.texi	Thu Dec 16 17:43:45 2010 -0500
+++ b/doc/misc/cl.texi	Thu Dec 16 18:30:57 2010 -0500
@@ -2494,15 +2494,18 @@
 @code{of} term may specify either a buffer or a string.
 
 @item for @var{var} being the frames
-This clause iterates over all frames, i.e., X window system windows
-open on Emacs files.  The
-clause @code{screens} is a synonym for @code{frames}.  The frames
-are visited in @code{next-frame} order starting from
-@code{selected-frame}.
+This clause iterates over all Emacs frames. The clause @code{screens} is
+a synonym for @code{frames}.  The frames are visited in
+@code{next-frame} order starting from @code{selected-frame}.
 
 @item for @var{var} being the windows [of @var{frame}]
 This clause iterates over the windows (in the Emacs sense) of
-the current frame, or of the specified @var{frame}.
+the current frame, or of the specified @var{frame}.  It visits windows
+in @code{next-window} order starting from @code{selected-window}
+(or @code{frame-selected-window} if you specify @var{frame}).
+This clause treats the minibuffer window in the same way as
+@code{next-window} does.  For greater flexibility, consider using
+@code{walk-windows} instead.
 
 @item for @var{var} being the buffers
 This clause iterates over all buffers in Emacs.  It is equivalent
@@ -5322,6 +5325,3 @@
 
 @bye
 
-@ignore
-   arch-tag: b61e7200-3bfa-4a70-a9d3-095e152696f8
-@end ignore
--- a/doc/misc/faq.texi	Thu Dec 16 17:43:45 2010 -0500
+++ b/doc/misc/faq.texi	Thu Dec 16 18:30:57 2010 -0500
@@ -4299,12 +4299,12 @@
 Normally, Emacs expands aliases when you send the message.
 To expand them before this, use @kbd{M-x expand-mail-aliases}.
 
-@c FIXME there should be an interactive rebuild command for this.
 @item
-Emacs normally only reads the @file{.mailrc} file once per session,
-when you start to compose your first mail message.  If you edit
-@file{.mailrc}, you can type @kbd{M-: (build-mail-aliases) @key{RET}} to
-make Emacs reread @file{~/.mailrc}.
+Emacs normally only reads the @file{.mailrc} file once per session, when
+you start to compose your first mail message.  If you edit the file
+after this, you can use @kbd{M-x build-mail-aliases} to make Emacs
+reread it.  Prior to Emacs 24.1, this is not an interactive command, so
+you must instead type @kbd{M-: (build-mail-aliases) @key{RET}}.
 
 @item
 If you like, you can expand mail aliases as abbrevs, as soon as you
--- a/doc/misc/gnus.texi	Thu Dec 16 17:43:45 2010 -0500
+++ b/doc/misc/gnus.texi	Thu Dec 16 18:30:57 2010 -0500
@@ -407,6 +407,7 @@
 * Composing Messages::       Information on sending mail and news.
 * Select Methods::           Gnus reads all messages from various select methods.
 * Scoring::                  Assigning values to articles.
+* Searching::                Mail and News search engines.
 * Various::                  General purpose settings.
 * The End::                  Farewell and goodbye.
 * Appendices::               Terminology, Emacs intro, @acronym{FAQ}, History, Internals.
@@ -428,7 +429,6 @@
 Starting Gnus
 
 * Finding the News::            Choosing a method for getting news.
-* The First Time::              What does Gnus do the first time you start it?
 * The Server is Down::          How can I read my mail then?
 * Slave Gnusae::                You can have more than one Gnus active at a time.
 * Fetching a Group::            Starting Gnus just to read a group.
@@ -786,6 +786,21 @@
 * Advanced Scoring Examples::   What they look like.
 * Advanced Scoring Tips::       Getting the most out of it.
 
+Searching
+
+* nnir::                        Searching with various engines.
+* nnmairix::                    Searching with Mairix.
+
+nnir
+
+* What is nnir?::               What does nnir do.
+* Basic Usage::                 How to perform simple searches.
+* Setting up nnir::             How to set up nnir.
+
+Setting up nnir
+
+* Associating Engines::         How to associate engines.
+
 Various
 
 * Process/Prefix::              A convention used by many treatment commands.
@@ -959,7 +974,6 @@
 
 @menu
 * Finding the News::      Choosing a method for getting news.
-* The First Time::        What does Gnus do the first time you start it?
 * The Server is Down::    How can I read my mail then?
 * Slave Gnusae::          You can have more than one Gnus active at a time.
 * New Groups::            What is Gnus supposed to do with new groups?
@@ -1052,31 +1066,6 @@
 new articles.  @xref{NNTP marks}, for more information.
 
 
-@node The First Time
-@section The First Time
-@cindex first time usage
-
-If no startup files exist (@pxref{Startup Files}), Gnus will try to
-determine what groups should be subscribed by default.
-
-@vindex gnus-default-subscribed-newsgroups
-If the variable @code{gnus-default-subscribed-newsgroups} is set, Gnus
-will subscribe you to just those groups in that list, leaving the rest
-killed.  Your system administrator should have set this variable to
-something useful.
-
-Since she hasn't, Gnus will just subscribe you to a few arbitrarily
-picked groups (i.e., @samp{*.newusers}).  (@dfn{Arbitrary} is defined
-here as @dfn{whatever Lars thinks you should read}.)
-
-You'll also be subscribed to the Gnus documentation group, which should
-help you with most common problems.
-
-If @code{gnus-default-subscribed-newsgroups} is @code{t}, Gnus will just
-use the normal functions for handling new groups, and not do anything
-special.
-
-
 @node The Server is Down
 @section The Server is Down
 @cindex server errors
@@ -1321,11 +1310,18 @@
 more meant for setting some ground rules, while the other variable is
 used more for user fiddling.  By default this variable makes all new
 groups that come from mail back ends (@code{nnml}, @code{nnbabyl},
-@code{nnfolder}, @code{nnmbox}, @code{nnmh}, and @code{nnmaildir})
-subscribed.  If you don't like that, just set this variable to
-@code{nil}.
-
-New groups that match this regexp are subscribed using
+@code{nnfolder}, @code{nnmbox}, @code{nnmh}, @code{nnimap}, and
+@code{nnmaildir}) subscribed.  If you don't like that, just set this
+variable to @code{nil}.
+
+@vindex gnus-auto-subscribed-categories
+As if that wasn't enough, @code{gnus-auto-subscribed-categories} also
+allows you to specify that new groups should be subcribed based on the
+category their select methods belong to.  The default is @samp{(mail
+post-mail)}, meaning that all new groups from mail-like backends
+should be subscribed automatically.
+
+New groups that match these variables are subscribed using
 @code{gnus-subscribe-options-newsgroup-method}.
 
 
@@ -1680,7 +1676,6 @@
 * Exiting Gnus::                Stop reading news and get some work done.
 * Group Topics::                A folding group mode divided into topics.
 * Non-ASCII Group Names::       Accessing groups of non-English names.
-* Searching::                   Mail search engines.
 * Misc Group Stuff::            Other stuff that you can to do.
 @end menu
 
@@ -2517,6 +2512,15 @@
 @section Foreign Groups
 @cindex foreign groups
 
+If you recall how to subscribe to servers (@pxref{Finding the News})
+you will remember that @code{gnus-secondary-select-methods} and
+@code{gnus-select-method} let you write a definition in Emacs Lisp of
+what servers you want to see when you start up.  The alternate
+approach is to use foreign servers and groups.  ``Foreign'' here means
+they are not coming from the select methods.  All foreign server
+configuration and subscriptions are stored only in the
+@file{~/.newsrc.eld} file.
+
 Below are some group mode commands for making and editing general foreign
 groups, as well as commands to ease the creation of a few
 special-purpose groups.  All these commands insert the newly created
@@ -4302,712 +4306,6 @@
 header will be displayed incorrectly in the article buffer.
 
 
-@node Searching
-@section Searching
-
-@menu
-* nnir::                     Searching on IMAP, with swish, namazu, etc.
-* nnmairix::                 Searching maildir, MH or mbox with Mairix.
-@end menu
-
-@cindex Searching
-
-FIXME: This node is a stub.
-
-FIXME: Add a brief overview of Gnus search capabilities.  A brief
-comparison of nnir, nnmairix, contrib/gnus-namazu would be nice
-as well.
-
-FIXME: Explain difference to @ref{Searching for Articles}, add reference
-and back-reference.
-
-@node nnir
-@subsection nnir
-
-FIXME: As a first step, convert the commentary of @file{nnir} to texi.
-@cindex nnir
-
-@node nnmairix
-@subsection nnmairix
-
-@cindex mairix
-@cindex nnmairix
-This paragraph describes how to set up mairix and the back end
-@code{nnmairix} for indexing and searching your mail from within
-Gnus.  Additionally, you can create permanent ``smart'' groups which are
-bound to mairix searches and are automatically updated.
-
-@menu
-* About mairix::                About the mairix mail search engine
-* nnmairix requirements::       What you will need for using nnmairix
-* What nnmairix does::          What does nnmairix actually do?
-* Setting up mairix::           Set up your mairix installation
-* Configuring nnmairix::        Set up the nnmairix back end
-* nnmairix keyboard shortcuts:: List of available keyboard shortcuts
-* Propagating marks::           How to propagate marks from nnmairix groups
-* nnmairix tips and tricks::    Some tips, tricks and examples
-* nnmairix caveats::            Some more stuff you might want to know
-@end menu
-
-@c FIXME: The markup in this section might need improvement.
-@c E.g. adding @samp, @var, @file, @command, etc.
-@c Cf. (info "(texinfo)Indicating")
-
-@node About mairix
-@subsubsection About mairix
-
-Mairix is a tool for indexing and searching words in locally stored
-mail.  It was written by Richard Curnow and is licensed under the
-GPL.  Mairix comes with most popular GNU/Linux distributions, but it also
-runs under Windows (with cygwin), Mac OS X and Solaris.  The homepage can
-be found at
-@uref{http://www.rpcurnow.force9.co.uk/mairix/index.html}
-
-Though mairix might not be as flexible as other search tools like
-swish++ or namazu, which you can use via the @code{nnir} back end, it
-has the prime advantage of being incredibly fast.  On current systems, it
-can easily search through headers and message bodies of thousands and
-thousands of mails in well under a second.  Building the database
-necessary for searching might take a minute or two, but only has to be
-done once fully.  Afterwards, the updates are done incrementally and
-therefore are really fast, too.  Additionally, mairix is very easy to set
-up.
-
-For maximum speed though, mairix should be used with mails stored in
-@code{Maildir} or @code{MH} format (this includes the @code{nnml} back
-end), although it also works with mbox.  Mairix presents the search
-results by populating a @emph{virtual} maildir/MH folder with symlinks
-which point to the ``real'' message files (if mbox is used, copies are
-made).  Since mairix already presents search results in such a virtual
-mail folder, it is very well suited for using it as an external program
-for creating @emph{smart} mail folders, which represent certain mail
-searches.
-
-@node nnmairix requirements
-@subsubsection nnmairix requirements
-
-Mairix searches local mail---that means, mairix absolutely must have
-direct access to your mail folders.  If your mail resides on another
-server (e.g. an @acronym{IMAP} server) and you happen to have shell
-access, @code{nnmairix} supports running mairix remotely, e.g. via ssh.
-
-Additionally, @code{nnmairix} only supports the following Gnus back
-ends: @code{nnml}, @code{nnmaildir}, and @code{nnimap}.  You must use
-one of these back ends for using @code{nnmairix}.  Other back ends, like
-@code{nnmbox}, @code{nnfolder} or @code{nnmh}, won't work.
-
-If you absolutely must use mbox and still want to use @code{nnmairix},
-you can set up a local @acronym{IMAP} server, which you then access via
-@code{nnimap}.  This is a rather massive setup for accessing some mbox
-files, so just change to MH or Maildir already...  However, if you're
-really, really passionate about using mbox, you might want to look into
-the package @file{mairix.el}, which comes with Emacs 23.
-
-@node What nnmairix does
-@subsubsection What nnmairix does
-
-The back end @code{nnmairix} enables you to call mairix from within Gnus,
-either to query mairix with a search term or to update the
-database.  While visiting a message in the summary buffer, you can use
-several pre-defined shortcuts for calling mairix, e.g. to quickly
-search for all mails from the sender of the current message or to
-display the whole thread associated with the message, even if the
-mails are in different folders.
-
-Additionally, you can create permanent @code{nnmairix} groups which are bound
-to certain mairix searches.  This way, you can easily create a group
-containing mails from a certain sender, with a certain subject line or
-even for one specific thread based on the Message-ID.  If you check for
-new mail in these folders (e.g. by pressing @kbd{g} or @kbd{M-g}), they
-automatically update themselves by calling mairix.
-
-You might ask why you need @code{nnmairix} at all, since mairix already
-creates the group, populates it with links to the mails so that you can
-then access it with Gnus, right?  Well, this @emph{might} work, but often
-does not---at least not without problems.  Most probably you will get
-strange article counts, and sometimes you might see mails which Gnus
-claims have already been canceled and are inaccessible.  This is due to
-the fact that Gnus isn't really amused when things are happening behind
-its back.  Another problem can be the mail back end itself, e.g. if you
-use mairix with an @acronym{IMAP} server (I had Dovecot complaining
-about corrupt index files when mairix changed the contents of the search
-group).  Using @code{nnmairix} should circumvent these problems.
-
-@code{nnmairix} is not really a mail back end---it's actually more like
-a wrapper, sitting between a ``real'' mail back end where mairix stores
-the searches and the Gnus front end.  You can choose between three
-different mail back ends for the mairix folders: @code{nnml},
-@code{nnmaildir} or @code{nnimap}.  @code{nnmairix} will call the mairix
-binary so that the search results are stored in folders named
-@code{zz_mairix-<NAME>-<NUMBER>} on this mail back end, but it will
-present these folders in the Gnus front end only with @code{<NAME>}.
-You can use an existing mail back end where you already store your mail,
-but if you're uncomfortable with @code{nnmairix} creating new mail
-groups alongside your other mail, you can also create e.g. a new
-@code{nnmaildir} or @code{nnml} server exclusively for mairix, but then
-make sure those servers do not accidentally receive your new mail
-(@pxref{nnmairix caveats}).  A special case exists if you want to use
-mairix remotely on an IMAP server with @code{nnimap}---here the mairix
-folders and your other mail must be on the same @code{nnimap} back end.
-
-@node Setting up mairix
-@subsubsection Setting up mairix
-
-First: create a backup of your mail folders (@pxref{nnmairix caveats}).
-
-Setting up mairix is easy: simply create a @file{.mairixrc} file with
-(at least) the following entries:
-
-@example
-# Your Maildir/MH base folder
-base=~/Maildir
-@end example
-
-This is the base folder for your mails.  All the following directories
-are relative to this base folder.  If you want to use @code{nnmairix}
-with @code{nnimap}, this base directory has to point to the mail
-directory where the @acronym{IMAP} server stores the mail folders!
-
-@example
-maildir= ... your maildir folders which should be indexed ...
-mh= ... your nnml/mh folders which should be indexed ...
-mbox = ... your mbox files which should be indexed ...
-@end example
-
-This specifies all your mail folders and mbox files (relative to the
-base directory!) you want to index with mairix.  Note that the
-@code{nnml} back end saves mails in MH format, so you have to put those
-directories in the @code{mh} line.  See the example at the end of this
-section and mairixrc's man-page for further details.
-
-@example
-omit=zz_mairix-*
-@end example
-
-@vindex nnmairix-group-prefix
-This should make sure that you don't accidentally index the mairix
-search results.  You can change the prefix of these folders with the
-variable @code{nnmairix-group-prefix}.
-
-@example
-mformat= ... 'maildir' or 'mh' ...
-database= ... location of database file ...
-@end example
-
-The @code{format} setting specifies the output format for the mairix
-search folder.  Set this to @code{mh} if you want to access search results
-with @code{nnml}.  Otherwise choose @code{maildir}.
-
-To summarize, here is my shortened @file{.mairixrc} file as an example:
-
-@example
-base=~/Maildir
-maildir=.personal:.work:.logcheck:.sent
-mh=../Mail/nnml/*...
-mbox=../mboxmail/mailarchive_year*
-mformat=maildir
-omit=zz_mairix-*
-database=~/.mairixdatabase
-@end example
-
-In this case, the base directory is @file{~/Maildir}, where all my Maildir
-folders are stored.  As you can see, the folders are separated by
-colons.  If you wonder why every folder begins with a dot: this is
-because I use Dovecot as @acronym{IMAP} server, which again uses
-@code{Maildir++} folders.  For testing nnmairix, I also have some
-@code{nnml} mail, which is saved in @file{~/Mail/nnml}.  Since this has
-to be specified relative to the @code{base} directory, the @code{../Mail}
-notation is needed.  Note that the line ends in @code{*...}, which means
-to recursively scan all files under this directory.  Without the three
-dots, the wildcard @code{*} will not work recursively.  I also have some
-old mbox files with archived mail lying around in @file{~/mboxmail}.
-The other lines should be obvious.
-
-See the man page for @code{mairixrc} for details and further options,
-especially regarding wildcard usage, which may be a little different
-than you are used to.
-
-Now simply call @code{mairix} to create the index for the first time.
-Note that this may take a few minutes, but every following index will do
-the updates incrementally and hence is very fast.
-
-@node Configuring nnmairix
-@subsubsection Configuring nnmairix
-
-In group mode, type @kbd{G b c}
-(@code{nnmairix-create-server-and-default-group}).  This will ask you for all
-necessary information and create a @code{nnmairix} server as a foreign
-server.  You will have to specify the following:
-
-@itemize @bullet
-
-@item
-The @strong{name} of the @code{nnmairix} server---choose whatever you
-want.
-
-@item
-The name of the @strong{back end server} where mairix should store its
-searches.  This must be a full server name, like @code{nnml:mymail}.
-Just hit @kbd{TAB} to see the available servers.  Currently, servers
-which are accessed through @code{nnmaildir}, @code{nnimap} and
-@code{nnml} are supported.  As explained above, for locally stored
-mails, this can be an existing server where you store your mails.
-However, you can also create e.g. a new @code{nnmaildir} or @code{nnml}
-server exclusively for @code{nnmairix} in your secondary select methods
-(@pxref{Finding the News}).  If you use a secondary @code{nnml} server
-just for mairix, make sure that you explicitly set the server variable
-@code{nnml-get-new-mail} to @code{nil}, or you might lose mail
-(@pxref{nnmairix caveats}).  If you want to use mairix remotely on an
-@acronym{IMAP} server, you have to choose the corresponding
-@code{nnimap} server here.
-
-@item
-@vindex nnmairix-mairix-search-options
-The @strong{command} to call the mairix binary.  This will usually just
-be @code{mairix}, but you can also choose something like @code{ssh
-SERVER mairix} if you want to call mairix remotely, e.g. on your
-@acronym{IMAP} server.  If you want to add some default options to
-mairix, you could do this here, but better use the variable
-@code{nnmairix-mairix-search-options} instead.
-
-@item
-The name of the @strong{default search group}.  This will be the group
-where all temporary mairix searches are stored, i.e. all searches which
-are not bound to permanent @code{nnmairix} groups.  Choose whatever you
-like.
-
-@item
-If the mail back end is @code{nnimap} or @code{nnmaildir}, you will be
-asked if you work with @strong{Maildir++}, i.e. with hidden maildir
-folders (=beginning with a dot).  For example, you have to answer
-@samp{yes} here if you work with the Dovecot @acronym{IMAP}
-server.  Otherwise, you should answer @samp{no} here.
-
-@end itemize
-
-@node nnmairix keyboard shortcuts
-@subsubsection nnmairix keyboard shortcuts
-
-In group mode:
-
-@table @kbd
-
-@item G b c
-@kindex G b c (Group)
-@findex nnmairix-create-server-and-default-group
-Creates @code{nnmairix} server and default search group for this server
-(@code{nnmairix-create-server-and-default-group}).  You should have done
-this by now (@pxref{Configuring nnmairix}).
-
-@item G b s
-@kindex G b s (Group)
-@findex nnmairix-search
-Prompts for query which is then sent to the mairix binary.  Search
-results are put into the default search group which is automatically
-displayed (@code{nnmairix-search}).
-
-@item G b m
-@kindex G b m (Group)
-@findex nnmairix-widget-search
-Allows you to create a mairix search or a permanent group more
-comfortably using graphical widgets, similar to a customization
-group.  Just try it to see how it works (@code{nnmairix-widget-search}).
-
-@item G b i
-@kindex G b i (Group)
-@findex nnmairix-search-interactive
-Another command for creating a mairix query more comfortably, but uses
-only the minibuffer (@code{nnmairix-search-interactive}).
-
-@item G b g
-@kindex G b g (Group)
-@findex nnmairix-create-search-group
-Creates a permanent group which is associated with a search query
-(@code{nnmairix-create-search-group}).  The @code{nnmairix} back end
-automatically calls mairix when you update this group with @kbd{g} or
-@kbd{M-g}.
-
-@item G b q
-@kindex G b q (Group)
-@findex nnmairix-group-change-query-this-group
-Changes the search query for the @code{nnmairix} group under cursor
-(@code{nnmairix-group-change-query-this-group}).
-
-@item G b t
-@kindex G b t (Group)
-@findex nnmairix-group-toggle-threads-this-group
-Toggles the 'threads' parameter for the @code{nnmairix} group under cursor,
-i.e.  if you want see the whole threads of the found messages
-(@code{nnmairix-group-toggle-threads-this-group}).
-
-@item G b u
-@kindex G b u (Group)
-@findex nnmairix-update-database
-@vindex nnmairix-mairix-update-options
-Calls mairix binary for updating the database
-(@code{nnmairix-update-database}).  The default parameters are @code{-F}
-and @code{-Q} for making this as fast as possible (see variable
-@code{nnmairix-mairix-update-options} for defining these default
-options).
-
-@item G b r
-@kindex G b r (Group)
-@findex nnmairix-group-toggle-readmarks-this-group
-Keep articles in this @code{nnmairix} group always read or unread, or leave the
-marks unchanged (@code{nnmairix-group-toggle-readmarks-this-group}).
-
-@item G b d
-@kindex G b d (Group)
-@findex nnmairix-group-delete-recreate-this-group
-Recreate @code{nnmairix} group on the ``real'' mail back end
-(@code{nnmairix-group-delete-recreate-this-group}).  You can do this if
-you always get wrong article counts with a @code{nnmairix} group.
-
-@item G b a
-@kindex G b a (Group)
-@findex nnmairix-group-toggle-allowfast-this-group
-Toggles the @code{allow-fast} parameters for group under cursor
-(@code{nnmairix-group-toggle-allowfast-this-group}).  The default
-behavior of @code{nnmairix} is to do a mairix search every time you
-update or enter the group.  With the @code{allow-fast} parameter set,
-mairix will only be called when you explicitly update the group, but not
-upon entering.  This makes entering the group faster, but it may also
-lead to dangling symlinks if something changed between updating and
-entering the group which is not yet in the mairix database.
-
-@item G b p
-@kindex G b p (Group)
-@findex nnmairix-group-toggle-propmarks-this-group
-Toggle marks propagation for this group
-(@code{nnmairix-group-toggle-propmarks-this-group}).  (@pxref{Propagating
-marks}).
-
-@item G b o
-@kindex G b o (Group)
-@findex nnmairix-propagate-marks
-Manually propagate marks (@code{nnmairix-propagate-marks}); needed only when
-@code{nnmairix-propagate-marks-upon-close} is set to @code{nil}.
-
-@end table
-
-In summary mode:
-
-@table @kbd
-
-@item $ m
-@kindex $ m (Summary)
-@findex nnmairix-widget-search-from-this-article
-Allows you to create a mairix query or group based on the current
-message using graphical widgets (same as @code{nnmairix-widget-search})
-(@code{nnmairix-widget-search-from-this-article}).
-
-@item $ g
-@kindex $ g (Summary)
-@findex nnmairix-create-search-group-from-message
-Interactively creates a new search group with query based on the current
-message, but uses the minibuffer instead of graphical widgets
-(@code{nnmairix-create-search-group-from-message}).
-
-@item $ t
-@kindex $ t (Summary)
-@findex nnmairix-search-thread-this-article
-Searches thread for the current article
-(@code{nnmairix-search-thread-this-article}).  This is effectively a
-shortcut for calling @code{nnmairix-search} with @samp{m:msgid} of the
-current article and enabled threads.
-
-@item $ f
-@kindex $ f (Summary)
-@findex nnmairix-search-from-this-article
-Searches all messages from sender of the current article
-(@code{nnmairix-search-from-this-article}).  This is a shortcut for
-calling @code{nnmairix-search} with @samp{f:From}.
-
-@item $ o
-@kindex $ o (Summary)
-@findex nnmairix-goto-original-article
-(Only in @code{nnmairix} groups!) Tries determine the group this article
-originally came from and displays the article in this group, so that
-e.g. replying to this article the correct posting styles/group
-parameters are applied (@code{nnmairix-goto-original-article}).  This
-function will use the registry if available, but can also parse the
-article file name as a fallback method.
-
-@item $ u
-@kindex $ u (Summary)
-@findex nnmairix-remove-tick-mark-original-article
-Remove possibly existing tick mark from original article
-(@code{nnmairix-remove-tick-mark-original-article}).  (@pxref{nnmairix
-tips and tricks}).
-
-@end table
-
-@node Propagating marks
-@subsubsection Propagating marks
-
-First of: you really need a patched mairix binary for using the marks
-propagation feature efficiently. Otherwise, you would have to update
-the mairix database all the time. You can get the patch at
-
-@uref{http://www.randomsample.de/mairix-maildir-patch.tar}
-
-You need the mairix v0.21 source code for this patch; everything else
-is explained in the accompanied readme file. If you don't want to use
-marks propagation, you don't have to apply these patches, but they also
-fix some annoyances regarding changing maildir flags, so it might still
-be useful to you.
-
-With the patched mairix binary, you can use @code{nnmairix} as an
-alternative to mail splitting (@pxref{Fancy Mail Splitting}). For
-example, instead of splitting all mails from @samp{david@@foobar.com}
-into a group, you can simply create a search group with the query
-@samp{f:david@@foobar.com}. This is actually what ``smart folders'' are
-all about: simply put everything in one mail folder and dynamically
-create searches instead of splitting. This is more flexible, since you
-can dynamically change your folders any time you want to. This also
-implies that you will usually read your mails in the @code{nnmairix}
-groups instead of your ``real'' mail groups.
-
-There is one problem, though: say you got a new mail from
-@samp{david@@foobar.com}; it will now show up in two groups, the
-``real'' group (your INBOX, for example) and in the @code{nnmairix}
-search group (provided you have updated the mairix database). Now you
-enter the @code{nnmairix} group and read the mail. The mail will be
-marked as read, but only in the @code{nnmairix} group---in the ``real''
-mail group it will be still shown as unread.
-
-You could now catch up the mail group (@pxref{Group Data}), but this is
-tedious and error prone, since you may overlook mails you don't have
-created @code{nnmairix} groups for. Of course, you could first use
-@code{nnmairix-goto-original-article} (@pxref{nnmairix keyboard
-shortcuts}) and then read the mail in the original group, but that's
-even more cumbersome.
-
-Clearly, the easiest way would be if marks could somehow be
-automatically set for the original article. This is exactly what
-@emph{marks propagation} is about.
-
-Marks propagation is deactivated by default. You can activate it for a
-certain @code{nnmairix} group with
-@code{nnmairix-group-toggle-propmarks-this-group} (bound to @kbd{G b
-p}). This function will warn you if you try to use it with your default
-search group; the reason is that the default search group is used for
-temporary searches, and it's easy to accidentally propagate marks from
-this group. However, you can ignore this warning if you really want to.
-
-With marks propagation enabled, all the marks you set in a @code{nnmairix}
-group should now be propagated to the original article. For example,
-you can now tick an article (by default with @kbd{!}) and this mark should
-magically be set for the original article, too.
-
-A few more remarks which you may or may not want to know:
-
-@vindex nnmairix-propagate-marks-upon-close
-Marks will not be set immediately, but only upon closing a group. This
-not only makes marks propagation faster, it also avoids problems with
-dangling symlinks when dealing with maildir files (since changing flags
-will change the file name). You can also control when to propagate marks
-via @code{nnmairix-propagate-marks-upon-close} (see the doc-string for
-details).
-
-Obviously, @code{nnmairix} will have to look up the original group for every
-article you want to set marks for. If available, @code{nnmairix} will first use
-the registry for determining the original group. The registry is very
-fast, hence you should really, really enable the registry when using
-marks propagation. If you don't have to worry about RAM and disc space,
-set @code{gnus-registry-max-entries} to a large enough value; to be on
-the safe side, choose roughly the amount of mails you index with mairix.
-
-@vindex nnmairix-only-use-registry
-If you don't want to use the registry or the registry hasn't seen the
-original article yet, @code{nnmairix} will use an additional mairix
-search for determining the file name of the article. This, of course, is
-way slower than the registry---if you set hundreds or even thousands of
-marks this way, it might take some time. You can avoid this situation by
-setting @code{nnmairix-only-use-registry} to t.
-
-Maybe you also want to propagate marks the other way round, i.e. if you
-tick an article in a "real" mail group, you'd like to have the same
-article in a @code{nnmairix} group ticked, too. For several good
-reasons, this can only be done efficiently if you use maildir. To
-immediately contradict myself, let me mention that it WON'T work with
-@code{nnmaildir}, since @code{nnmaildir} stores the marks externally and
-not in the file name. Therefore, propagating marks to @code{nnmairix}
-groups will usually only work if you use an IMAP server which uses
-maildir as its file format.
-
-@vindex nnmairix-propagate-marks-to-nnmairix-groups
-If you work with this setup, just set
-@code{nnmairix-propagate-marks-to-nnmairix-groups} to @code{t} and see what
-happens. If you don't like what you see, just set it to @code{nil} again. One
-problem might be that you get a wrong number of unread articles; this
-usually happens when you delete or expire articles in the original
-groups. When this happens, you can recreate the @code{nnmairix} group on the
-back end using @kbd{G b d}.
-
-@node nnmairix tips and tricks
-@subsubsection nnmairix tips and tricks
-
-@itemize
-@item
-Checking Mail
-
-@findex nnmairix-update-groups
-I put all my important mail groups at group level 1. The mairix groups
-have group level 5, so they do not get checked at start up (@pxref{Group
-Levels}).
-
-I use the following to check for mails:
-
-@lisp
-(defun my-check-mail-mairix-update (level)
-  (interactive "P")
-  ;; if no prefix given, set level=1
-  (gnus-group-get-new-news (or level 1))
-  (nnmairix-update-groups "mairixsearch" t t)
-  (gnus-group-list-groups))
-
-(define-key gnus-group-mode-map "g" 'my-check-mail-mairix-update)
-@end lisp
-
-Instead of @samp{"mairixsearch"} use the name of your @code{nnmairix}
-server. See the doc string for @code{nnmairix-update-groups} for
-details.
-
-@item
-Example: search group for ticked articles
-
-For example, you can create a group for all ticked articles, where the
-articles always stay unread:
-
-Hit @kbd{G b g}, enter group name (e.g. @samp{important}), use
-@samp{F:f} as query and do not include threads.
-
-Now activate marks propagation for this group by using @kbd{G b p}. Then
-activate the always-unread feature by using @kbd{G b r} twice.
-
-So far so good---but how do you remove the tick marks in the @code{nnmairix}
-group?  There are two options: You may simply use
-@code{nnmairix-remove-tick-mark-original-article} (bound to @kbd{$ u}) to remove
-tick marks from the original article. The other possibility is to set
-@code{nnmairix-propagate-marks-to-nnmairix-groups} to @code{t}, but see the above
-comments about this option.  If it works for you, the tick marks should
-also exist in the @code{nnmairix} group and you can remove them as usual,
-e.g. by marking an article as read.
-
-When you have removed a tick mark from the original article, this
-article should vanish from the @code{nnmairix} group after you have updated the
-mairix database and updated the group.  Fortunately, there is a function
-for doing exactly that: @code{nnmairix-update-groups}. See the previous code
-snippet and the doc string for details.
-
-@item
-Dealing with auto-subscription of mail groups
-
-As described before, all @code{nnmairix} groups are in fact stored on
-the mail back end in the form @samp{zz_mairix-<NAME>-<NUMBER>}. You can
-see them when you enter the back end server in the server buffer. You
-should not subscribe these groups! Unfortunately, these groups will
-usually get @emph{auto-subscribed} when you use @code{nnmaildir} or
-@code{nnml}, i.e. you will suddenly see groups of the form
-@samp{zz_mairix*} pop up in your group buffer. If this happens to you,
-simply kill these groups with C-k.  For avoiding this, turn off
-auto-subscription completely by setting the variable
-@code{gnus-auto-subscribed-groups} to @code{nil} (@pxref{Filtering New
-Groups}), or if you like to keep this feature use the following kludge
-for turning it off for all groups beginning with @samp{zz_}:
-
-@lisp
-(setq gnus-auto-subscribed-groups
-      "^\\(nnml\\|nnfolder\\|nnmbox\\|nnmh\\|nnbabyl\\|nnmaildir\\).*:\\([^z]\\|z$\\|\\z[^z]\\|zz$\\|zz[^_]\\|zz_$\\).*")
-@end lisp
-
-@end itemize
-
-@node nnmairix caveats
-@subsubsection nnmairix caveats
-
-@itemize
-@item
-You can create a secondary @code{nnml} server just for nnmairix, but then
-you have to explicitly set the corresponding server variable
-@code{nnml-get-new-mail} to @code{nil}.  Otherwise, new mail might get
-put into this secondary server (and would never show up again).  Here's
-an example server definition:
-
-@lisp
-(nnml "mairix" (nnml-directory "mairix") (nnml-get-new-mail nil))
-@end lisp
-
-(The @code{nnmaildir} back end also has a server variabe
-@code{get-new-mail}, but its default value is @code{nil}, so you don't
-have to explicitly set it if you use a @code{nnmaildir} server just for
-mairix.)
-
-@item
-If you use the Gnus registry: don't use the registry with
-@code{nnmairix} groups (put them in
-@code{gnus-registry-unfollowed-groups}).  Be @emph{extra careful} if
-you use @code{gnus-registry-split-fancy-with-parent}; mails which are
-split into @code{nnmairix} groups are usually gone for good as soon as
-you check the group for new mail (yes, it has happened to me...).
-
-@item
-Therefore: @emph{Never ever} put ``real'' mails into @code{nnmairix}
-groups (you shouldn't be able to, anyway).
-
-@item
-If you use the Gnus agent (@pxref{Gnus Unplugged}): don't agentize
-@code{nnmairix} groups (though I have no idea what happens if you do).
-
-@item
-mairix does only support us-ascii characters.
-
-@item
-@code{nnmairix} uses a rather brute force method to force Gnus to
-completely reread the group on the mail back end after mairix was
-called---it simply deletes and re-creates the group on the mail
-back end. So far, this has worked for me without any problems, and I
-don't see how @code{nnmairix} could delete other mail groups than its
-own, but anyway: you really should have a backup of your mail
-folders.
-
-@item
-All necessary information is stored in the group parameters
-(@pxref{Group Parameters}). This has the advantage that no active file
-is needed, but also implies that when you kill a @code{nnmairix} group,
-it is gone for good.
-
-@item
-@findex nnmairix-purge-old-groups
-If you create and kill a lot of @code{nnmairix} groups, the
-``zz_mairix-*'' groups will accumulate on the mail back end server. To
-delete old groups which are no longer needed, call
-@code{nnmairix-purge-old-groups}. Note that this assumes that you don't
-save any ``real'' mail in folders of the form
-@code{zz_mairix-<NAME>-<NUMBER>}. You can change the prefix of
-@code{nnmairix} groups by changing the variable
-@code{nnmairix-group-prefix}.
-
-@item
-The following only applies if you @emph{don't} use the mentioned patch
-for mairix (@pxref{Propagating marks}):
-
-A problem can occur when using @code{nnmairix} with maildir folders and
-comes with the fact that maildir stores mail flags like @samp{Seen} or
-@samp{Replied} by appending chars @samp{S} and @samp{R} to the message
-file name, respectively. This implies that currently you would have to
-update the mairix database not only when new mail arrives, but also when
-mail flags are changing. The same applies to new mails which are indexed
-while they are still in the @samp{new} folder but then get moved to
-@samp{cur} when Gnus has seen the mail. If you don't update the database
-after this has happened, a mairix query can lead to symlinks pointing to
-non-existing files. In Gnus, these messages will usually appear with
-``(none)'' entries in the header and can't be accessed. If this happens
-to you, using @kbd{G b u} and updating the group will usually fix this.
-
-@end itemize
-
 @node Misc Group Stuff
 @section Misc Group Stuff
 
@@ -6152,10 +5450,10 @@
 @findex gnus-summary-show-article
 @vindex gnus-summary-show-article-charset-alist
 (Re)fetch the current article (@code{gnus-summary-show-article}).  If
-given a prefix, fetch the current article, but don't run any of the
-article treatment functions.  If given a prefix twice (i.e., @kbd{C-u
-C-u g'}), show a completely ``raw'' article, just the way it came from
-the server.
+given a prefix, show a completely ``raw'' article, just the way it
+came from the server.  If given a prefix twice (i.e., @kbd{C-u C-u
+g'}), fetch the current article, but don't run any of the article
+treatment functions.
 
 @cindex charset, view article with different charset
 If given a numerical prefix, you can do semi-manual charset stuff.
@@ -13322,9 +12620,6 @@
           (concat "mail." (format-time-string "%Y-%m")))))
 @end lisp
 
-@c (XEmacs 19.13 doesn't have @code{format-time-string}, so you'll have to
-@c use a different value for @code{gnus-message-archive-group} there.)
-
 Now, when you send a message off, it will be stored in the appropriate
 group.  (If you want to disable storing for just one particular message,
 you can just remove the @code{Gcc} header that has been inserted.)  The
@@ -13336,27 +12631,7 @@
 nice---@samp{misc-mail-september-1995}, or whatever.  New messages will
 continue to be stored in the old (now empty) group.
 
-That's the default method of archiving sent messages.  Gnus offers a
-different way for the people who don't like the default method.  In that
-case you should set @code{gnus-message-archive-group} to @code{nil};
-this will disable archiving.
-
-@table @code
-@item gnus-outgoing-message-group
-@vindex gnus-outgoing-message-group
-All outgoing messages will be put in this group.  If you want to store
-all your outgoing mail and articles in the group @samp{nnml:archive},
-you set this variable to that value.  This variable can also be a list of
-group names.
-
-If you want to have greater control over what group to put each
-message in, you can set this variable to a function that checks the
-current newsgroup name and then returns a suitable group name (or list
-of names).
-
-This variable can be used instead of @code{gnus-message-archive-group},
-but the latter is the preferred method.
-
+@table @code
 @item gnus-gcc-mark-as-read
 @vindex gnus-gcc-mark-as-read
 If non-@code{nil}, automatically mark @code{Gcc} articles as read.
@@ -13900,6 +13175,9 @@
 
 @end table
 
+Some more commands for closing, disabling, and re-opening servers are
+listed in @ref{Unavailable Servers}.
+
 
 @node Example Methods
 @subsection Example Methods
@@ -14453,7 +13731,12 @@
 @findex nntp-open-network-stream
 @item nntp-open-network-stream
 This is the default, and simply connects to some port or other on the
-remote system.
+remote system.  If both Emacs and the server supports it, the
+connection will be upgraded to an encrypted @acronym{STARTTLS}
+connection automatically.
+
+@item network-only
+The same as the above, but don't do automatic @acronym{STARTTLS} upgrades.
 
 @findex nntp-open-tls-stream
 @item nntp-open-tls-stream
@@ -14887,12 +14170,17 @@
 How @code{nnimap} should connect to the server.  Possible values are:
 
 @table @code
+@item undecided
+This is the default, and this first tries the @code{ssl} setting, and
+then tries the @code{network} setting.
+
 @item ssl
-This is the default, and this uses standard
-@acronym{TLS}/@acronym{SSL} connection.
+This uses standard @acronym{TLS}/@acronym{SSL} connections.
 
 @item network
-Non-encrypted and unsafe straight socket connection.
+Non-encrypted and unsafe straight socket connection, but will upgrade
+to encrypted @acronym{STARTTLS} if both Emacs and the server
+supports it.
 
 @item starttls
 Encrypted @acronym{STARTTLS} over the normal @acronym{IMAP} port.
@@ -21713,6 +21001,1071 @@
 Gnus will try to decay scores once a day.  If you haven't run Gnus for
 four days, Gnus will decay the scores four times, for instance.
 
+@node Searching
+@chapter Searching
+@cindex searching
+
+FIXME: Add a brief overview of Gnus search capabilities.  A brief
+comparison of nnir, nnmairix, contrib/gnus-namazu would be nice
+as well.
+
+This chapter describes tools for searching groups and servers for
+articles matching a query and then retrieving those articles. Gnus
+provides a simpler mechanism for searching through articles in a summary buffer 
+to find those matching a pattern. @xref{Searching for Articles}. 
+
+@menu
+* nnir::                     Searching with various engines.
+* nnmairix::                 Searching with Mairix.
+@end menu
+
+@node nnir
+@section nnir
+@cindex nnir
+
+This section describes how to use @code{nnir} to search for articles
+within gnus.
+
+@menu
+* What is nnir?::               What does @code{nnir} do?
+* Basic Usage::                 How to perform simple searches.
+* Setting up nnir::             How to set up @code{nnir}.
+@end menu
+
+@node What is nnir?
+@subsection What is nnir?
+
+@code{nnir} is a Gnus interface to a number of tools for searching
+through mail and news repositories. Different backends (like
+@code{nnimap} and @code{nntp}) work with different tools (called
+@dfn{engines} in @code{nnir} lingo), but all use the same basic search
+interface.
+
+The @code{nnimap} and @code{gmane} search engines should work with no
+configuration. Other engines require a local index that needs to be
+created and maintained outside of Gnus. 
+
+
+@node Basic Usage
+@subsection Basic Usage
+
+In the group buffer typing @kbd{G G} will search the group on the
+current line by calling @code{gnus-group-make-nnir-group}.  This prompts
+for a query string, creates an ephemeral @code{nnir} group containing
+the articles that match this query, and takes you to a summary buffer
+showing these articles. Articles may then be read, moved and deleted
+using the usual commands.
+
+The @code{nnir} group made in this way is an @code{ephemeral} group, and
+some changes are not permanent: aside from reading, moving, and
+deleting, you can't act on the original article. But there is an
+alternative: you can @emph{warp} to the original group for the article
+on the current line with @kbd{A W}, aka
+@code{gnus-warp-to-article}. Even better, the function
+@code{gnus-summary-refer-thread}, bound by default in summary buffers to
+@kbd{A T}, will first warp to the original group before it works its
+magic and includes all the articles in the thread. From here you can
+read, move and delete articles, but also copy them, alter article marks,
+whatever. Go nuts.
+
+You say you want to search more than just the group on the current line?
+No problem: just process-mark the groups you want to search. You want
+even more? Calling for an nnir search with the cursor on a topic heading
+will search all the groups under that heading.
+
+Still not enough? OK, in the server buffer
+@code{gnus-group-make-nnir-group} (now bound to @kbd{G}) will search all
+groups from the server on the current line. Too much? Want to ignore
+certain groups when searching, like spam groups? Just customize
+@code{nnir-ignored-newsgroups}.
+
+One more thing: individual search engines may have special search
+features. You can access these special features by giving a prefix-arg
+to @code{gnus-group-make-nnir-group}. If you are searching multiple
+groups with different search engines you will be prompted for the
+special search features for each engine separately. 
+
+
+@node Setting up nnir
+@subsection Setting up nnir
+
+To set up nnir you may need to do some prep work. Firstly, you may need
+to configure the search engines you plan to use. Some of them, like
+@code{imap} and @code{gmane}, need no special configuration. Others,
+like @code{namazu} and @code{swish}, require configuration as described
+below. Secondly, you need to associate a search engine with a server or
+a backend.
+
+If you just want to use the @code{imap} engine to search @code{nnimap}
+servers, and the @code{gmane} engine to search @code{gmane} then you
+don't have to do anything. But you might want to read the details of the
+query language anyway.
+
+@menu
+* Associating Engines::                 How to associate engines.
+* The imap Engine::                     Imap configuration and usage.
+* The gmane Engine::                    Gmane configuration and usage.
+* The swish++ Engine::                  Swish++ configuration and usage.
+* The swish-e Engine::                  Swish-e configuration and usage.
+* The namazu Engine::                   Namazu configuration and usage.
+* The hyrex Engine::                    Hyrex configuration and usage.
+* Customizations::                      User customizable settings.
+@end menu
+
+@node Associating Engines
+@subsubsection Associating Engines
+
+
+When searching a group, @code{nnir} needs to know which search engine to
+use. You can configure a given server to use a particular engine by
+setting the server variable @code{nnir-search-engine} to the engine
+name. For example to use the @code{namazu} engine to search the server
+named @code{home} you can use
+
+@lisp
+(setq gnus-secondary-select-methods
+      '((nnml "home" 
+         (nnimap-address "localhost")
+         (nnir-search-engine namazu))))
+@end lisp
+
+Alternatively you might want to use a particular engine for all servers
+with a given backend. For example, you might want to use the @code{imap}
+engine for all servers using the @code{nnimap} backend. In this case you
+can customize the variable @code{nnir-method-default-engines}. This is
+an alist of pairs of the form @code{(backend . engine)}. By default this
+variable is set to use the @code{imap} engine for all servers using the
+@code{nnimap} backend, and the @code{gmane} backend for @code{nntp}
+servers. (Don't worry, the @code{gmane} search engine won't actually try
+to search non-gmane @code{nntp} servers.) But if you wanted to use
+@code{namazu} for all your servers with an @code{nnimap} backend you
+could change this to
+
+@lisp
+'((nnimap . namazu)
+  (nntp . gmane))
+@end lisp
+
+@node The imap Engine
+@subsubsection The imap Engine
+
+The @code{imap} engine requires no configuration. 
+
+Queries using the @code{imap} engine follow a simple query language. 
+The search is always case-insensitive and supports the following
+features (inspired by the Google search input language):
+
+@table @samp
+
+@item Boolean query operators
+AND, OR, and NOT are supported, and parentheses can be used to control
+operator precedence, e.g. (emacs OR xemacs) AND linux. Note that
+operators must be written with all capital letters to be
+recognised. Also preceding a term with a - sign is equivalent to NOT
+term.
+
+@item Automatic AND queries 
+If you specify multiple words then they will be treated as an AND
+expression intended to match all components.
+
+@item Phrase searches
+If you wrap your query in double-quotes then it will be treated as a
+literal string.
+
+@end table
+
+By default the whole message will be searched. The query can be limited
+to a specific part of a message by using a prefix-arg. After inputting
+the query this will prompt (with completion) for a message part.
+Choices include ``Whole message'', ``Subject'', ``From'', and
+``To''. Any unrecognized input is interpreted as a header name. For
+example, typing @kbd{Message-ID} in response to this prompt will limit
+the query to the Message-ID header.
+
+Finally selecting ``Imap'' will interpret the query as a raw
+@acronym{IMAP} search query. The format of such queries can be found in
+RFC3501.
+
+If you don't like the default of searching whole messages you can
+customize @code{nnir-imap-default-search-key}. For example to use
+@acronym{IMAP} queries by default
+
+@lisp
+(setq nnir-imap-default-search-key "Imap")
+@end lisp
+
+@node The gmane Engine
+@subsubsection The gmane Engine
+
+The @code{gmane} engine requires no configuration. 
+
+Gmane queries follow a simple query language:
+
+@table @samp
+@item Boolean query operators
+AND, OR, NOT (or AND NOT), and XOR are supported, and brackets can be
+used to control operator precedence, e.g. (emacs OR xemacs) AND linux.
+Note that operators must be written with all capital letters to be
+recognised.
+
+@item Required and excluded terms
++ and - can be used to require or exclude terms, e.g. football -american
+
+@item Unicode handling 
+The search engine converts all text to utf-8, so searching should work
+in any language.
+
+@item Stopwords 
+Common English words (like 'the' and 'a') are ignored by default. You
+can override this by prefixing such words with a + (e.g. +the) or
+enclosing the word in quotes (e.g. "the").
+
+@end table
+
+The query can be limited to articles by a specific author using a
+prefix-arg. After inputting the query this will prompt for an author
+name (or part of a name) to match.
+
+@node The swish++ Engine
+@subsubsection The swish++ Engine
+
+FIXEM: Say something more here.
+
+Documentation for swish++ may be found at the swish++ sourceforge page:
+@uref{http://swishplusplus.sourceforge.net}
+
+@table @code
+
+@item nnir-swish++-program
+The name of the swish++ executable. Defaults to @code{search}
+
+@item nnir-swish++-additional-switches
+A list of strings to be given as additional arguments to
+swish++. @code{nil} by default.
+
+@item nnir-swish++-remove-prefix
+The prefix to remove from each file name returned by swish++ in order
+to get a group name. By default this is @code{$HOME/Mail}.
+
+@end table
+
+@node The swish-e Engine
+@subsubsection The swish-e Engine
+
+FIXEM: Say something more here.
+
+Documentation for swish-e may be found at the swish-e homepage
+@uref{http://swish-e.org}
+
+@table @code
+
+@item nnir-swish-e-program
+The name of the swish-e search program. Defaults to @code{swish-e}.
+
+@item nnir-swish-e-additional-switches
+A list of strings to be given as additional arguments to
+swish-e. @code{nil} by default.
+
+@item nnir-swish-e-remove-prefix
+The prefix to remove from each file name returned by swish-e in order
+to get a group name. By default this is @code{$HOME/Mail}.
+
+@end table
+
+@node The namazu Engine
+@subsubsection The namazu Engine
+
+Using the namazu engine requires creating and maintaining index files.
+One directory should contain all the index files, and nnir must be told
+where to find them by setting the @code{nnir-namazu-index-directory}
+variable.  
+
+To work correctly the @code{nnir-namazu-remove-prefix} variable must
+also be correct. This is the prefix to remove from each file name
+returned by Namazu in order to get a proper group name (albeit with `/'
+instead of `.').
+
+For example, suppose that Namazu returns file names such as
+@samp{/home/john/Mail/mail/misc/42}.  For this example, use the
+following setting: @code{(setq nnir-namazu-remove-prefix
+"/home/john/Mail/")} Note the trailing slash.  Removing this prefix from
+the directory gives @samp{mail/misc/42}.  @code{nnir} knows to remove
+the @samp{/42} and to replace @samp{/} with @samp{.} to arrive at the
+correct group name @samp{mail.misc}.
+
+Extra switches may be passed to the namazu search command by setting the
+variable @code{nnir-namazu-additional-switches}.  It is particularly
+important not to pass any any switches to namazu that will change the
+output format.  Good switches to use include `--sort', `--ascending',
+`--early' and `--late'.  Refer to the Namazu documentation for further
+information on valid switches.
+
+Mail must first be indexed  with the `mknmz' program.  Read the documentation
+for namazu to create a configuration file. Here is an example:
+
+@cartouche
+@example
+ package conf;  # Don't remove this line!
+
+ # Paths which will not be indexed. Don't use `^' or `$' anchors.
+ $EXCLUDE_PATH = "spam|sent";
+
+ # Header fields which should be searchable. case-insensitive
+ $REMAIN_HEADER = "from|date|message-id|subject";
+
+ # Searchable fields. case-insensitive
+ $SEARCH_FIELD = "from|date|message-id|subject";
+
+ # The max length of a word.
+ $WORD_LENG_MAX = 128;
+
+ # The max length of a field.
+ $MAX_FIELD_LENGTH = 256;
+@end example
+@end cartouche
+
+For this example, mail is stored in the directories @samp{~/Mail/mail/},
+@samp{~/Mail/lists/} and @samp{~/Mail/archive/}, so to index them go to
+the index directory set in @code{nnir-namazu-index-directory} and issue
+the following command:
+
+@example
+mknmz --mailnews ~/Mail/archive/ ~/Mail/mail/ ~/Mail/lists/
+@end example
+
+For maximum searching efficiency you might want to have a cron job run
+this command periodically, say every four hours.
+
+@node The hyrex Engine
+@subsubsection The hyrex Engine
+This engine is obsolete.
+
+@node Customizations
+@subsubsection Custimozations
+
+@table @code
+
+@item nnir-method-default-engines
+Alist of server backend - search engine pairs. The default associations
+are
+@example
+(nnimap . imap)
+(nntp . gmane)
+@end example
+
+@item nnir-ignored-newsgroups
+A regexp to match newsgroups in the active file that should be skipped
+when searching all groups on a server.
+
+@item nnir-summary-line-format
+The format specification to be used for lines in an nnir summary buffer.
+All the items from `gnus-summary-line-format' are available, along with
+three items unique to nnir summary buffers:
+
+@example
+%Z    Search retrieval score value (integer)
+%G    Article original full group name (string)
+%g    Article original short group name (string)
+@end example
+
+If nil (the default) this will use @code{gnus-summary-line-format}.
+
+@item nnir-retrieve-headers-override-function
+If non-nil, a function that retrieves article headers rather than using
+the gnus built-in function.  This function takes an article list and
+group as arguments and populates the `nntp-server-buffer' with the
+retrieved headers. It should then return either 'nov or 'headers
+indicating the retrieved header format. Failure to retrieve headers
+should return @code{nil}
+
+If this variable is nil, or if the provided function returns nil for a
+search result, @code{gnus-retrieve-headers} will be called instead."
+
+
+@end table
+
+
+@node nnmairix
+@section nnmairix
+
+@cindex mairix
+@cindex nnmairix
+This paragraph describes how to set up mairix and the back end
+@code{nnmairix} for indexing and searching your mail from within
+Gnus.  Additionally, you can create permanent ``smart'' groups which are
+bound to mairix searches and are automatically updated.
+
+@menu
+* About mairix::                About the mairix mail search engine
+* nnmairix requirements::       What you will need for using nnmairix
+* What nnmairix does::          What does nnmairix actually do?
+* Setting up mairix::           Set up your mairix installation
+* Configuring nnmairix::        Set up the nnmairix back end
+* nnmairix keyboard shortcuts:: List of available keyboard shortcuts
+* Propagating marks::           How to propagate marks from nnmairix groups
+* nnmairix tips and tricks::    Some tips, tricks and examples
+* nnmairix caveats::            Some more stuff you might want to know
+@end menu
+
+@c FIXME: The markup in this section might need improvement.
+@c E.g. adding @samp, @var, @file, @command, etc.
+@c Cf. (info "(texinfo)Indicating")
+
+@node About mairix
+@subsection About mairix
+
+Mairix is a tool for indexing and searching words in locally stored
+mail.  It was written by Richard Curnow and is licensed under the
+GPL.  Mairix comes with most popular GNU/Linux distributions, but it also
+runs under Windows (with cygwin), Mac OS X and Solaris.  The homepage can
+be found at
+@uref{http://www.rpcurnow.force9.co.uk/mairix/index.html}
+
+Though mairix might not be as flexible as other search tools like
+swish++ or namazu, which you can use via the @code{nnir} back end, it
+has the prime advantage of being incredibly fast.  On current systems, it
+can easily search through headers and message bodies of thousands and
+thousands of mails in well under a second.  Building the database
+necessary for searching might take a minute or two, but only has to be
+done once fully.  Afterwards, the updates are done incrementally and
+therefore are really fast, too.  Additionally, mairix is very easy to set
+up.
+
+For maximum speed though, mairix should be used with mails stored in
+@code{Maildir} or @code{MH} format (this includes the @code{nnml} back
+end), although it also works with mbox.  Mairix presents the search
+results by populating a @emph{virtual} maildir/MH folder with symlinks
+which point to the ``real'' message files (if mbox is used, copies are
+made).  Since mairix already presents search results in such a virtual
+mail folder, it is very well suited for using it as an external program
+for creating @emph{smart} mail folders, which represent certain mail
+searches.
+
+@node nnmairix requirements
+@subsection nnmairix requirements
+
+Mairix searches local mail---that means, mairix absolutely must have
+direct access to your mail folders.  If your mail resides on another
+server (e.g. an @acronym{IMAP} server) and you happen to have shell
+access, @code{nnmairix} supports running mairix remotely, e.g. via ssh.
+
+Additionally, @code{nnmairix} only supports the following Gnus back
+ends: @code{nnml}, @code{nnmaildir}, and @code{nnimap}.  You must use
+one of these back ends for using @code{nnmairix}.  Other back ends, like
+@code{nnmbox}, @code{nnfolder} or @code{nnmh}, won't work.
+
+If you absolutely must use mbox and still want to use @code{nnmairix},
+you can set up a local @acronym{IMAP} server, which you then access via
+@code{nnimap}.  This is a rather massive setup for accessing some mbox
+files, so just change to MH or Maildir already...  However, if you're
+really, really passionate about using mbox, you might want to look into
+the package @file{mairix.el}, which comes with Emacs 23.
+
+@node What nnmairix does
+@subsection What nnmairix does
+
+The back end @code{nnmairix} enables you to call mairix from within Gnus,
+either to query mairix with a search term or to update the
+database.  While visiting a message in the summary buffer, you can use
+several pre-defined shortcuts for calling mairix, e.g. to quickly
+search for all mails from the sender of the current message or to
+display the whole thread associated with the message, even if the
+mails are in different folders.
+
+Additionally, you can create permanent @code{nnmairix} groups which are bound
+to certain mairix searches.  This way, you can easily create a group
+containing mails from a certain sender, with a certain subject line or
+even for one specific thread based on the Message-ID.  If you check for
+new mail in these folders (e.g. by pressing @kbd{g} or @kbd{M-g}), they
+automatically update themselves by calling mairix.
+
+You might ask why you need @code{nnmairix} at all, since mairix already
+creates the group, populates it with links to the mails so that you can
+then access it with Gnus, right?  Well, this @emph{might} work, but often
+does not---at least not without problems.  Most probably you will get
+strange article counts, and sometimes you might see mails which Gnus
+claims have already been canceled and are inaccessible.  This is due to
+the fact that Gnus isn't really amused when things are happening behind
+its back.  Another problem can be the mail back end itself, e.g. if you
+use mairix with an @acronym{IMAP} server (I had Dovecot complaining
+about corrupt index files when mairix changed the contents of the search
+group).  Using @code{nnmairix} should circumvent these problems.
+
+@code{nnmairix} is not really a mail back end---it's actually more like
+a wrapper, sitting between a ``real'' mail back end where mairix stores
+the searches and the Gnus front end.  You can choose between three
+different mail back ends for the mairix folders: @code{nnml},
+@code{nnmaildir} or @code{nnimap}.  @code{nnmairix} will call the mairix
+binary so that the search results are stored in folders named
+@code{zz_mairix-<NAME>-<NUMBER>} on this mail back end, but it will
+present these folders in the Gnus front end only with @code{<NAME>}.
+You can use an existing mail back end where you already store your mail,
+but if you're uncomfortable with @code{nnmairix} creating new mail
+groups alongside your other mail, you can also create e.g. a new
+@code{nnmaildir} or @code{nnml} server exclusively for mairix, but then
+make sure those servers do not accidentally receive your new mail
+(@pxref{nnmairix caveats}).  A special case exists if you want to use
+mairix remotely on an IMAP server with @code{nnimap}---here the mairix
+folders and your other mail must be on the same @code{nnimap} back end.
+
+@node Setting up mairix
+@subsection Setting up mairix
+
+First: create a backup of your mail folders (@pxref{nnmairix caveats}).
+
+Setting up mairix is easy: simply create a @file{.mairixrc} file with
+(at least) the following entries:
+
+@example
+# Your Maildir/MH base folder
+base=~/Maildir
+@end example
+
+This is the base folder for your mails.  All the following directories
+are relative to this base folder.  If you want to use @code{nnmairix}
+with @code{nnimap}, this base directory has to point to the mail
+directory where the @acronym{IMAP} server stores the mail folders!
+
+@example
+maildir= ... your maildir folders which should be indexed ...
+mh= ... your nnml/mh folders which should be indexed ...
+mbox = ... your mbox files which should be indexed ...
+@end example
+
+This specifies all your mail folders and mbox files (relative to the
+base directory!) you want to index with mairix.  Note that the
+@code{nnml} back end saves mails in MH format, so you have to put those
+directories in the @code{mh} line.  See the example at the end of this
+section and mairixrc's man-page for further details.
+
+@example
+omit=zz_mairix-*
+@end example
+
+@vindex nnmairix-group-prefix
+This should make sure that you don't accidentally index the mairix
+search results.  You can change the prefix of these folders with the
+variable @code{nnmairix-group-prefix}.
+
+@example
+mformat= ... 'maildir' or 'mh' ...
+database= ... location of database file ...
+@end example
+
+The @code{format} setting specifies the output format for the mairix
+search folder.  Set this to @code{mh} if you want to access search results
+with @code{nnml}.  Otherwise choose @code{maildir}.
+
+To summarize, here is my shortened @file{.mairixrc} file as an example:
+
+@example
+base=~/Maildir
+maildir=.personal:.work:.logcheck:.sent
+mh=../Mail/nnml/*...
+mbox=../mboxmail/mailarchive_year*
+mformat=maildir
+omit=zz_mairix-*
+database=~/.mairixdatabase
+@end example
+
+In this case, the base directory is @file{~/Maildir}, where all my Maildir
+folders are stored.  As you can see, the folders are separated by
+colons.  If you wonder why every folder begins with a dot: this is
+because I use Dovecot as @acronym{IMAP} server, which again uses
+@code{Maildir++} folders.  For testing nnmairix, I also have some
+@code{nnml} mail, which is saved in @file{~/Mail/nnml}.  Since this has
+to be specified relative to the @code{base} directory, the @code{../Mail}
+notation is needed.  Note that the line ends in @code{*...}, which means
+to recursively scan all files under this directory.  Without the three
+dots, the wildcard @code{*} will not work recursively.  I also have some
+old mbox files with archived mail lying around in @file{~/mboxmail}.
+The other lines should be obvious.
+
+See the man page for @code{mairixrc} for details and further options,
+especially regarding wildcard usage, which may be a little different
+than you are used to.
+
+Now simply call @code{mairix} to create the index for the first time.
+Note that this may take a few minutes, but every following index will do
+the updates incrementally and hence is very fast.
+
+@node Configuring nnmairix
+@subsection Configuring nnmairix
+
+In group mode, type @kbd{G b c}
+(@code{nnmairix-create-server-and-default-group}).  This will ask you for all
+necessary information and create a @code{nnmairix} server as a foreign
+server.  You will have to specify the following:
+
+@itemize @bullet
+
+@item
+The @strong{name} of the @code{nnmairix} server---choose whatever you
+want.
+
+@item
+The name of the @strong{back end server} where mairix should store its
+searches.  This must be a full server name, like @code{nnml:mymail}.
+Just hit @kbd{TAB} to see the available servers.  Currently, servers
+which are accessed through @code{nnmaildir}, @code{nnimap} and
+@code{nnml} are supported.  As explained above, for locally stored
+mails, this can be an existing server where you store your mails.
+However, you can also create e.g. a new @code{nnmaildir} or @code{nnml}
+server exclusively for @code{nnmairix} in your secondary select methods
+(@pxref{Finding the News}).  If you use a secondary @code{nnml} server
+just for mairix, make sure that you explicitly set the server variable
+@code{nnml-get-new-mail} to @code{nil}, or you might lose mail
+(@pxref{nnmairix caveats}).  If you want to use mairix remotely on an
+@acronym{IMAP} server, you have to choose the corresponding
+@code{nnimap} server here.
+
+@item
+@vindex nnmairix-mairix-search-options
+The @strong{command} to call the mairix binary.  This will usually just
+be @code{mairix}, but you can also choose something like @code{ssh
+SERVER mairix} if you want to call mairix remotely, e.g. on your
+@acronym{IMAP} server.  If you want to add some default options to
+mairix, you could do this here, but better use the variable
+@code{nnmairix-mairix-search-options} instead.
+
+@item
+The name of the @strong{default search group}.  This will be the group
+where all temporary mairix searches are stored, i.e. all searches which
+are not bound to permanent @code{nnmairix} groups.  Choose whatever you
+like.
+
+@item
+If the mail back end is @code{nnimap} or @code{nnmaildir}, you will be
+asked if you work with @strong{Maildir++}, i.e. with hidden maildir
+folders (=beginning with a dot).  For example, you have to answer
+@samp{yes} here if you work with the Dovecot @acronym{IMAP}
+server.  Otherwise, you should answer @samp{no} here.
+
+@end itemize
+
+@node nnmairix keyboard shortcuts
+@subsection nnmairix keyboard shortcuts
+
+In group mode:
+
+@table @kbd
+
+@item G b c
+@kindex G b c (Group)
+@findex nnmairix-create-server-and-default-group
+Creates @code{nnmairix} server and default search group for this server
+(@code{nnmairix-create-server-and-default-group}).  You should have done
+this by now (@pxref{Configuring nnmairix}).
+
+@item G b s
+@kindex G b s (Group)
+@findex nnmairix-search
+Prompts for query which is then sent to the mairix binary.  Search
+results are put into the default search group which is automatically
+displayed (@code{nnmairix-search}).
+
+@item G b m
+@kindex G b m (Group)
+@findex nnmairix-widget-search
+Allows you to create a mairix search or a permanent group more
+comfortably using graphical widgets, similar to a customization
+group.  Just try it to see how it works (@code{nnmairix-widget-search}).
+
+@item G b i
+@kindex G b i (Group)
+@findex nnmairix-search-interactive
+Another command for creating a mairix query more comfortably, but uses
+only the minibuffer (@code{nnmairix-search-interactive}).
+
+@item G b g
+@kindex G b g (Group)
+@findex nnmairix-create-search-group
+Creates a permanent group which is associated with a search query
+(@code{nnmairix-create-search-group}).  The @code{nnmairix} back end
+automatically calls mairix when you update this group with @kbd{g} or
+@kbd{M-g}.
+
+@item G b q
+@kindex G b q (Group)
+@findex nnmairix-group-change-query-this-group
+Changes the search query for the @code{nnmairix} group under cursor
+(@code{nnmairix-group-change-query-this-group}).
+
+@item G b t
+@kindex G b t (Group)
+@findex nnmairix-group-toggle-threads-this-group
+Toggles the 'threads' parameter for the @code{nnmairix} group under cursor,
+i.e.  if you want see the whole threads of the found messages
+(@code{nnmairix-group-toggle-threads-this-group}).
+
+@item G b u
+@kindex G b u (Group)
+@findex nnmairix-update-database
+@vindex nnmairix-mairix-update-options
+Calls mairix binary for updating the database
+(@code{nnmairix-update-database}).  The default parameters are @code{-F}
+and @code{-Q} for making this as fast as possible (see variable
+@code{nnmairix-mairix-update-options} for defining these default
+options).
+
+@item G b r
+@kindex G b r (Group)
+@findex nnmairix-group-toggle-readmarks-this-group
+Keep articles in this @code{nnmairix} group always read or unread, or leave the
+marks unchanged (@code{nnmairix-group-toggle-readmarks-this-group}).
+
+@item G b d
+@kindex G b d (Group)
+@findex nnmairix-group-delete-recreate-this-group
+Recreate @code{nnmairix} group on the ``real'' mail back end
+(@code{nnmairix-group-delete-recreate-this-group}).  You can do this if
+you always get wrong article counts with a @code{nnmairix} group.
+
+@item G b a
+@kindex G b a (Group)
+@findex nnmairix-group-toggle-allowfast-this-group
+Toggles the @code{allow-fast} parameters for group under cursor
+(@code{nnmairix-group-toggle-allowfast-this-group}).  The default
+behavior of @code{nnmairix} is to do a mairix search every time you
+update or enter the group.  With the @code{allow-fast} parameter set,
+mairix will only be called when you explicitly update the group, but not
+upon entering.  This makes entering the group faster, but it may also
+lead to dangling symlinks if something changed between updating and
+entering the group which is not yet in the mairix database.
+
+@item G b p
+@kindex G b p (Group)
+@findex nnmairix-group-toggle-propmarks-this-group
+Toggle marks propagation for this group
+(@code{nnmairix-group-toggle-propmarks-this-group}).  (@pxref{Propagating
+marks}).
+
+@item G b o
+@kindex G b o (Group)
+@findex nnmairix-propagate-marks
+Manually propagate marks (@code{nnmairix-propagate-marks}); needed only when
+@code{nnmairix-propagate-marks-upon-close} is set to @code{nil}.
+
+@end table
+
+In summary mode:
+
+@table @kbd
+
+@item $ m
+@kindex $ m (Summary)
+@findex nnmairix-widget-search-from-this-article
+Allows you to create a mairix query or group based on the current
+message using graphical widgets (same as @code{nnmairix-widget-search})
+(@code{nnmairix-widget-search-from-this-article}).
+
+@item $ g
+@kindex $ g (Summary)
+@findex nnmairix-create-search-group-from-message
+Interactively creates a new search group with query based on the current
+message, but uses the minibuffer instead of graphical widgets
+(@code{nnmairix-create-search-group-from-message}).
+
+@item $ t
+@kindex $ t (Summary)
+@findex nnmairix-search-thread-this-article
+Searches thread for the current article
+(@code{nnmairix-search-thread-this-article}).  This is effectively a
+shortcut for calling @code{nnmairix-search} with @samp{m:msgid} of the
+current article and enabled threads.
+
+@item $ f
+@kindex $ f (Summary)
+@findex nnmairix-search-from-this-article
+Searches all messages from sender of the current article
+(@code{nnmairix-search-from-this-article}).  This is a shortcut for
+calling @code{nnmairix-search} with @samp{f:From}.
+
+@item $ o
+@kindex $ o (Summary)
+@findex nnmairix-goto-original-article
+(Only in @code{nnmairix} groups!) Tries determine the group this article
+originally came from and displays the article in this group, so that
+e.g. replying to this article the correct posting styles/group
+parameters are applied (@code{nnmairix-goto-original-article}).  This
+function will use the registry if available, but can also parse the
+article file name as a fallback method.
+
+@item $ u
+@kindex $ u (Summary)
+@findex nnmairix-remove-tick-mark-original-article
+Remove possibly existing tick mark from original article
+(@code{nnmairix-remove-tick-mark-original-article}).  (@pxref{nnmairix
+tips and tricks}).
+
+@end table
+
+@node Propagating marks
+@subsection Propagating marks
+
+First of: you really need a patched mairix binary for using the marks
+propagation feature efficiently. Otherwise, you would have to update
+the mairix database all the time. You can get the patch at
+
+@uref{http://www.randomsample.de/mairix-maildir-patch.tar}
+
+You need the mairix v0.21 source code for this patch; everything else
+is explained in the accompanied readme file. If you don't want to use
+marks propagation, you don't have to apply these patches, but they also
+fix some annoyances regarding changing maildir flags, so it might still
+be useful to you.
+
+With the patched mairix binary, you can use @code{nnmairix} as an
+alternative to mail splitting (@pxref{Fancy Mail Splitting}). For
+example, instead of splitting all mails from @samp{david@@foobar.com}
+into a group, you can simply create a search group with the query
+@samp{f:david@@foobar.com}. This is actually what ``smart folders'' are
+all about: simply put everything in one mail folder and dynamically
+create searches instead of splitting. This is more flexible, since you
+can dynamically change your folders any time you want to. This also
+implies that you will usually read your mails in the @code{nnmairix}
+groups instead of your ``real'' mail groups.
+
+There is one problem, though: say you got a new mail from
+@samp{david@@foobar.com}; it will now show up in two groups, the
+``real'' group (your INBOX, for example) and in the @code{nnmairix}
+search group (provided you have updated the mairix database). Now you
+enter the @code{nnmairix} group and read the mail. The mail will be
+marked as read, but only in the @code{nnmairix} group---in the ``real''
+mail group it will be still shown as unread.
+
+You could now catch up the mail group (@pxref{Group Data}), but this is
+tedious and error prone, since you may overlook mails you don't have
+created @code{nnmairix} groups for. Of course, you could first use
+@code{nnmairix-goto-original-article} (@pxref{nnmairix keyboard
+shortcuts}) and then read the mail in the original group, but that's
+even more cumbersome.
+
+Clearly, the easiest way would be if marks could somehow be
+automatically set for the original article. This is exactly what
+@emph{marks propagation} is about.
+
+Marks propagation is deactivated by default. You can activate it for a
+certain @code{nnmairix} group with
+@code{nnmairix-group-toggle-propmarks-this-group} (bound to @kbd{G b
+p}). This function will warn you if you try to use it with your default
+search group; the reason is that the default search group is used for
+temporary searches, and it's easy to accidentally propagate marks from
+this group. However, you can ignore this warning if you really want to.
+
+With marks propagation enabled, all the marks you set in a @code{nnmairix}
+group should now be propagated to the original article. For example,
+you can now tick an article (by default with @kbd{!}) and this mark should
+magically be set for the original article, too.
+
+A few more remarks which you may or may not want to know:
+
+@vindex nnmairix-propagate-marks-upon-close
+Marks will not be set immediately, but only upon closing a group. This
+not only makes marks propagation faster, it also avoids problems with
+dangling symlinks when dealing with maildir files (since changing flags
+will change the file name). You can also control when to propagate marks
+via @code{nnmairix-propagate-marks-upon-close} (see the doc-string for
+details).
+
+Obviously, @code{nnmairix} will have to look up the original group for every
+article you want to set marks for. If available, @code{nnmairix} will first use
+the registry for determining the original group. The registry is very
+fast, hence you should really, really enable the registry when using
+marks propagation. If you don't have to worry about RAM and disc space,
+set @code{gnus-registry-max-entries} to a large enough value; to be on
+the safe side, choose roughly the amount of mails you index with mairix.
+
+@vindex nnmairix-only-use-registry
+If you don't want to use the registry or the registry hasn't seen the
+original article yet, @code{nnmairix} will use an additional mairix
+search for determining the file name of the article. This, of course, is
+way slower than the registry---if you set hundreds or even thousands of
+marks this way, it might take some time. You can avoid this situation by
+setting @code{nnmairix-only-use-registry} to t.
+
+Maybe you also want to propagate marks the other way round, i.e. if you
+tick an article in a "real" mail group, you'd like to have the same
+article in a @code{nnmairix} group ticked, too. For several good
+reasons, this can only be done efficiently if you use maildir. To
+immediately contradict myself, let me mention that it WON'T work with
+@code{nnmaildir}, since @code{nnmaildir} stores the marks externally and
+not in the file name. Therefore, propagating marks to @code{nnmairix}
+groups will usually only work if you use an IMAP server which uses
+maildir as its file format.
+
+@vindex nnmairix-propagate-marks-to-nnmairix-groups
+If you work with this setup, just set
+@code{nnmairix-propagate-marks-to-nnmairix-groups} to @code{t} and see what
+happens. If you don't like what you see, just set it to @code{nil} again. One
+problem might be that you get a wrong number of unread articles; this
+usually happens when you delete or expire articles in the original
+groups. When this happens, you can recreate the @code{nnmairix} group on the
+back end using @kbd{G b d}.
+
+@node nnmairix tips and tricks
+@subsection nnmairix tips and tricks
+
+@itemize
+@item
+Checking Mail
+
+@findex nnmairix-update-groups
+I put all my important mail groups at group level 1. The mairix groups
+have group level 5, so they do not get checked at start up (@pxref{Group
+Levels}).
+
+I use the following to check for mails:
+
+@lisp
+(defun my-check-mail-mairix-update (level)
+  (interactive "P")
+  ;; if no prefix given, set level=1
+  (gnus-group-get-new-news (or level 1))
+  (nnmairix-update-groups "mairixsearch" t t)
+  (gnus-group-list-groups))
+
+(define-key gnus-group-mode-map "g" 'my-check-mail-mairix-update)
+@end lisp
+
+Instead of @samp{"mairixsearch"} use the name of your @code{nnmairix}
+server. See the doc string for @code{nnmairix-update-groups} for
+details.
+
+@item
+Example: search group for ticked articles
+
+For example, you can create a group for all ticked articles, where the
+articles always stay unread:
+
+Hit @kbd{G b g}, enter group name (e.g. @samp{important}), use
+@samp{F:f} as query and do not include threads.
+
+Now activate marks propagation for this group by using @kbd{G b p}. Then
+activate the always-unread feature by using @kbd{G b r} twice.
+
+So far so good---but how do you remove the tick marks in the @code{nnmairix}
+group?  There are two options: You may simply use
+@code{nnmairix-remove-tick-mark-original-article} (bound to @kbd{$ u}) to remove
+tick marks from the original article. The other possibility is to set
+@code{nnmairix-propagate-marks-to-nnmairix-groups} to @code{t}, but see the above
+comments about this option.  If it works for you, the tick marks should
+also exist in the @code{nnmairix} group and you can remove them as usual,
+e.g. by marking an article as read.
+
+When you have removed a tick mark from the original article, this
+article should vanish from the @code{nnmairix} group after you have updated the
+mairix database and updated the group.  Fortunately, there is a function
+for doing exactly that: @code{nnmairix-update-groups}. See the previous code
+snippet and the doc string for details.
+
+@item
+Dealing with auto-subscription of mail groups
+
+As described before, all @code{nnmairix} groups are in fact stored on
+the mail back end in the form @samp{zz_mairix-<NAME>-<NUMBER>}. You can
+see them when you enter the back end server in the server buffer. You
+should not subscribe these groups! Unfortunately, these groups will
+usually get @emph{auto-subscribed} when you use @code{nnmaildir} or
+@code{nnml}, i.e. you will suddenly see groups of the form
+@samp{zz_mairix*} pop up in your group buffer. If this happens to you,
+simply kill these groups with C-k.  For avoiding this, turn off
+auto-subscription completely by setting the variable
+@code{gnus-auto-subscribed-groups} to @code{nil} (@pxref{Filtering New
+Groups}), or if you like to keep this feature use the following kludge
+for turning it off for all groups beginning with @samp{zz_}:
+
+@lisp
+(setq gnus-auto-subscribed-groups
+      "^\\(nnml\\|nnfolder\\|nnmbox\\|nnmh\\|nnbabyl\\|nnmaildir\\).*:\\([^z]\\|z$\\|\\z[^z]\\|zz$\\|zz[^_]\\|zz_$\\).*")
+@end lisp
+
+@end itemize
+
+@node nnmairix caveats
+@subsection nnmairix caveats
+
+@itemize
+@item
+You can create a secondary @code{nnml} server just for nnmairix, but then
+you have to explicitly set the corresponding server variable
+@code{nnml-get-new-mail} to @code{nil}.  Otherwise, new mail might get
+put into this secondary server (and would never show up again).  Here's
+an example server definition:
+
+@lisp
+(nnml "mairix" (nnml-directory "mairix") (nnml-get-new-mail nil))
+@end lisp
+
+(The @code{nnmaildir} back end also has a server variabe
+@code{get-new-mail}, but its default value is @code{nil}, so you don't
+have to explicitly set it if you use a @code{nnmaildir} server just for
+mairix.)
+
+@item
+If you use the Gnus registry: don't use the registry with
+@code{nnmairix} groups (put them in
+@code{gnus-registry-unfollowed-groups}).  Be @emph{extra careful} if
+you use @code{gnus-registry-split-fancy-with-parent}; mails which are
+split into @code{nnmairix} groups are usually gone for good as soon as
+you check the group for new mail (yes, it has happened to me...).
+
+@item
+Therefore: @emph{Never ever} put ``real'' mails into @code{nnmairix}
+groups (you shouldn't be able to, anyway).
+
+@item
+If you use the Gnus agent (@pxref{Gnus Unplugged}): don't agentize
+@code{nnmairix} groups (though I have no idea what happens if you do).
+
+@item
+mairix does only support us-ascii characters.
+
+@item
+@code{nnmairix} uses a rather brute force method to force Gnus to
+completely reread the group on the mail back end after mairix was
+called---it simply deletes and re-creates the group on the mail
+back end. So far, this has worked for me without any problems, and I
+don't see how @code{nnmairix} could delete other mail groups than its
+own, but anyway: you really should have a backup of your mail
+folders.
+
+@item
+All necessary information is stored in the group parameters
+(@pxref{Group Parameters}). This has the advantage that no active file
+is needed, but also implies that when you kill a @code{nnmairix} group,
+it is gone for good.
+
+@item
+@findex nnmairix-purge-old-groups
+If you create and kill a lot of @code{nnmairix} groups, the
+``zz_mairix-*'' groups will accumulate on the mail back end server. To
+delete old groups which are no longer needed, call
+@code{nnmairix-purge-old-groups}. Note that this assumes that you don't
+save any ``real'' mail in folders of the form
+@code{zz_mairix-<NAME>-<NUMBER>}. You can change the prefix of
+@code{nnmairix} groups by changing the variable
+@code{nnmairix-group-prefix}.
+
+@item
+The following only applies if you @emph{don't} use the mentioned patch
+for mairix (@pxref{Propagating marks}):
+
+A problem can occur when using @code{nnmairix} with maildir folders and
+comes with the fact that maildir stores mail flags like @samp{Seen} or
+@samp{Replied} by appending chars @samp{S} and @samp{R} to the message
+file name, respectively. This implies that currently you would have to
+update the mairix database not only when new mail arrives, but also when
+mail flags are changing. The same applies to new mails which are indexed
+while they are still in the @samp{new} folder but then get moved to
+@samp{cur} when Gnus has seen the mail. If you don't update the database
+after this has happened, a mairix query can lead to symlinks pointing to
+non-existing files. In Gnus, these messages will usually appear with
+``(none)'' entries in the header and can't be accessed. If this happens
+to you, using @kbd{G b u} and updating the group will usually fix this.
+
+@end itemize
+
 @iftex
 @iflatex
 @chapter Message
--- a/doc/misc/nxml-mode.texi	Thu Dec 16 17:43:45 2010 -0500
+++ b/doc/misc/nxml-mode.texi	Thu Dec 16 18:30:57 2010 -0500
@@ -8,7 +8,8 @@
 This manual documents nxml-mode, an Emacs major mode for editing
 XML with RELAX NG support.
 
-Copyright @copyright{} 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+Copyright @copyright{} 2007, 2008, 2009, 2010
+Free Software Foundation, Inc.
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
@@ -43,6 +44,7 @@
 This manual is not yet complete.
 
 @menu
+* Introduction::
 * Completion::
 * Inserting end-tags::
 * Paragraphs::
@@ -52,6 +54,58 @@
 * Limitations::
 @end menu
 
+@node Introduction
+@chapter Introduction
+
+nXML mode is an Emacs major-mode for editing XML documents.  It supports
+editing well-formed XML documents, and provides schema-sensitive editing
+using RELAX NG Compact Syntax.  To get started, visit a file containing an
+XML document, and, if necessary, use @kbd{M-x nxml-mode} to switch to nXML
+mode.  By default, @code{auto-mode-alist} and @code{magic-fallback-alist}
+put buffers in nXML mode if they have recognizable XML content or file
+extensions.  You may wish to customize the settings, for example to
+recognize different file extensions.
+
+Once in nXML mode, you can type @kbd{C-h m} for basic information on the
+mode.
+
+The @file{etc/nxml} directory in the Emacs distribution contains some data
+files used by nXML mode, and includes two files (@file{test.valid.xml} and
+@file{test.invalid.xml}) that provide examples of valid and invalid XML
+documents.
+
+To get validation and schema-sensitive editing, you need a RELAX NG Compact
+Syntax (RNC) schema for your document (@pxref{Locating a schema}).  The
+@file{etc/schema} directory includes some schemas for popular document
+types.  See @url{http://relaxng.org/} for more information on RELAX NG.
+You can use the @samp{Trang} program from
+@url{http://www.thaiopensource.com/relaxng/trang.html} to
+automatically create RNC schemas.  This program can:
+
+@itemize @bullet
+@item
+infer an RNC schema from an instance document;
+@item
+convert a DTD to an RNC schema;
+@item
+convert a RELAX NG XML syntax schema to an RNC schema.
+@end itemize
+
+@noindent To convert a RELAX NG XML syntax (@samp{.rng}) schema to a RNC
+one, you can also use the XSLT stylesheet from
+@url{http://www.pantor.com/download.html}.
+
+To convert a W3C XML Schema to an RNC schema, you need first to convert it
+to RELAX NG XML syntax using the RELAX NG converter tool @code{rngconv}
+(built on top of MSV).  See @url{https://github.com/kohsuke/msv}
+and @url{https://msv.dev.java.net/}.
+
+For historical discussions only, see the mailing list archives at
+@url{http://groups.yahoo.com/group/emacs-nxml-mode/}.  Please make all new
+discussions on the @samp{help-gnu-emacs} and @samp{emacs-devel} mailing
+lists.  Report any bugs with @kbd{M-x report-emacs-bug}.
+
+
 @node Completion
 @chapter Completion
 
@@ -855,6 +909,3 @@
 
 @bye
 
-@ignore
-   arch-tag: 3b6e8ac2-ae8d-4f38-bd43-ce9f80be04d6
-@end ignore
--- a/doc/misc/org.texi	Thu Dec 16 17:43:45 2010 -0500
+++ b/doc/misc/org.texi	Thu Dec 16 18:30:57 2010 -0500
@@ -4,8 +4,8 @@
 @setfilename ../../info/org
 @settitle The Org Manual
 
-@set VERSION 7.3
-@set DATE November 2010
+@set VERSION 7.4
+@set DATE December 2010
 
 @c Use proper quote and backtick for code sections in PDF output
 @c Cf. Texinfo manual 14.2
@@ -21,40 +21,236 @@
 @c %**end of header
 @finalout
 
-@c Macro definitions
-@macro orgcmd{key,command}
-@iftex
-@kindex \key\
-@findex \command\
-@item @kbd{\key\} @hskip 0pt plus 1filll @code{\command\}
-@end iftex
-@ifnottex
-@kindex \key\
-@findex \command\
-@item @kbd{\key\} @tie{}@tie{}@tie{}@tie{}(@code{\command\})
-@end ifnottex
-@end macro
-
+
+@c -----------------------------------------------------------------------------
+
+@c Macro definitions for commands and keys
+@c =======================================
+
+@c The behavior of the key/command macros will depend on the flag cmdnames
+@c When set, commands names are shown.  When clear, they are not shown.
+
+@set cmdnames
+
+@c Below we define the following macros for Org key tables:
+
+@c orgkey{key}                        A key item                     
+@c orgcmd{key,cmd}                    Key with command name
+@c xorgcmd{key,cmmand}                Key with command name as @itemx
+@c orgcmdnki{key,cmd}                 Like orgcmd, but do not index the key
+@c orgcmdtkc{text,key,cmd}            Like orgcmd,special text instead of key
+@c orgcmdkkc{key1,key2,cmd}           Two keys with one command name, use "or"
+@c orgcmdkxkc{key1,key2,cmd}          Two keys with one command name, but
+@c                                    different functions, so format as @itemx
+@c orgcmdkskc{key1,key2,cmd}          Same as orgcmdkkc, but use "or short"
+@c xorgcmdkskc{key1,key2,cmd}         Same as previous, but use @itemx
+@c orgcmdkkcc{key1,key2,cmd1,cmd2}    Two keys and two commands
+
+@c a key but no command
+@c    Inserts:    @item key
 @macro orgkey{key}
 @kindex \key\
 @item @kbd{\key\}
 @end macro
 
+@macro xorgkey{key}
+@kindex \key\
+@itemx @kbd{\key\}
+@end macro
+
+@c one key with a command
+@c   Inserts:    @item KEY               COMMAND
+@macro orgcmd{key,command}
+@ifset cmdnames
+@kindex \key\
+@findex \command\
+@iftex
+@item @kbd{\key\} @hskip 0pt plus 1filll @code{\command\}
+@end iftex
+@ifnottex
+@item @kbd{\key\} @tie{}@tie{}@tie{}@tie{}(@code{\command\})
+@end ifnottex
+@end ifset
+@ifclear cmdnames
+@kindex \key\
+@item @kbd{\key\}
+@end ifclear
+@end macro
+
+@c One key with one command, formatted using @itemx
+@c   Inserts:    @itemx KEY               COMMAND
+@macro xorgcmd{key,command}
+@ifset cmdnames
+@kindex \key\
+@findex \command\
+@iftex
+@itemx @kbd{\key\} @hskip 0pt plus 1filll @code{\command\}
+@end iftex
+@ifnottex
+@itemx @kbd{\key\} @tie{}@tie{}@tie{}@tie{}(@code{\command\})
+@end ifnottex
+@end ifset
+@ifclear cmdnames
+@kindex \key\
+@itemx @kbd{\key\}
+@end ifclear
+@end macro
+
+@c one key with a command, bit do not index the key
+@c   Inserts:    @item KEY               COMMAND
+@macro orgcmdnki{key,command}
+@ifset cmdnames
+@findex \command\
+@iftex
+@item @kbd{\key\} @hskip 0pt plus 1filll @code{\command\}
+@end iftex
+@ifnottex
+@item @kbd{\key\} @tie{}@tie{}@tie{}@tie{}(@code{\command\})
+@end ifnottex
+@end ifset
+@ifclear cmdnames
+@item @kbd{\key\}
+@end ifclear
+@end macro
+
+@c one key with a command, and special text to replace key in item
+@c   Inserts:    @item TEXT                    COMMAND
+@macro orgcmdtkc{text,key,command}
+@ifset cmdnames
+@kindex \key\
+@findex \command\
+@iftex
+@item @kbd{\text\} @hskip 0pt plus 1filll @code{\command\}
+@end iftex
+@ifnottex
+@item @kbd{\text\} @tie{}@tie{}@tie{}@tie{}(@code{\command\})
+@end ifnottex
+@end ifset
+@ifclear cmdnames
+@kindex \key\
+@item @kbd{\text\}
+@end ifclear
+@end macro
+
+@c two keys with one command
+@c   Inserts:    @item KEY1 or KEY2            COMMAND
+@macro orgcmdkkc{key1,key2,command}
+@ifset cmdnames
+@kindex \key1\
+@kindex \key2\
+@findex \command\
+@iftex
+@item @kbd{\key1\} @ @r{or} @ @kbd{\key2\} @hskip 0pt plus 1filll @code{\command\}
+@end iftex
+@ifnottex
+@item @kbd{\key1\} @ @r{or} @ @kbd{\key2\} @tie{}@tie{}@tie{}@tie{}(@code{\command\})
+@end ifnottex
+@end ifset
+@ifclear cmdnames
+@kindex \key1\
+@kindex \key2\
+@item @kbd{\key1\} @ @r{or} @ @kbd{\key2\}
+@end ifclear
+@end macro
+
+@c Two keys with one command name, but different functions, so format as
+@c @itemx
+@c   Inserts:    @item KEY1
+@c               @itemx KEY2                COMMAND
+@macro orgcmdkxkc{key1,key2,command}
+@ifset cmdnames
+@kindex \key1\
+@kindex \key2\
+@findex \command\
+@iftex
+@item @kbd{\key1\}
+@itemx @kbd{\key2\} @hskip 0pt plus 1filll @code{\command\}
+@end iftex
+@ifnottex
+@item @kbd{\key1\}
+@itemx @kbd{\key2\} @tie{}@tie{}@tie{}@tie{}(@code{\command\})
+@end ifnottex
+@end ifset
+@ifclear cmdnames
+@kindex \key1\
+@kindex \key2\
+@item @kbd{\key1\}
+@itemx @kbd{\key2\}
+@end ifclear
+@end macro
+
+@c Same as previous, but use "or short"
+@c   Inserts:    @item KEY1 or short KEY2            COMMAND
+@macro orgcmdkskc{key1,key2,command}
+@ifset cmdnames
+@kindex \key1\
+@kindex \key2\
+@findex \command\
+@iftex
+@item @kbd{\key1\} @ @r{or short} @ @kbd{\key2\} @hskip 0pt plus 1filll @code{\command\}
+@end iftex
+@ifnottex
+@item @kbd{\key1\} @ @r{or short} @ @kbd{\key2\} @tie{}@tie{}@tie{}@tie{}(@code{\command\})
+@end ifnottex
+@end ifset
+@ifclear cmdnames
+@kindex \key1\
+@kindex \key2\
+@item @kbd{\key1\} @ @r{or short} @ @kbd{\key2\}
+@end ifclear
+@end macro
+
+@c Same as previous, but use @itemx
+@c   Inserts:    @itemx KEY1 or short KEY2            COMMAND
+@macro xorgcmdkskc{key1,key2,command}
+@ifset cmdnames
+@kindex \key1\
+@kindex \key2\
+@findex \command\
+@iftex
+@itemx @kbd{\key1\} @ @r{or short} @ @kbd{\key2\} @hskip 0pt plus 1filll @code{\command\}
+@end iftex
+@ifnottex
+@itemx @kbd{\key1\} @ @r{or short} @ @kbd{\key2\} @tie{}@tie{}@tie{}@tie{}(@code{\command\})
+@end ifnottex
+@end ifset
+@ifclear cmdnames
+@kindex \key1\
+@kindex \key2\
+@itemx @kbd{\key1\} @ @r{or short} @ @kbd{\key2\}
+@end ifclear
+@end macro
+
+@c two keys with two commands
+@c   Inserts:    @item KEY1                        COMMAND1
+@c               @itemx KEY2                       COMMAND2
+@macro orgcmdkkcc{key1,key2,command1,command2}
+@ifset cmdnames
+@kindex \key1\
+@kindex \key2\
+@findex \command1\
+@findex \command2\
+@iftex
+@item @kbd{\key1\} @hskip 0pt plus 1filll @code{\command1\}
+@itemx @kbd{\key2\} @hskip 0pt plus 1filll @code{\command2\}
+@end iftex
+@ifnottex
+@item @kbd{\key1\} @tie{}@tie{}@tie{}@tie{}(@code{\command1\})
+@itemx @kbd{\key2\} @tie{}@tie{}@tie{}@tie{}(@code{\command2\})
+@end ifnottex
+@end ifset
+@ifclear cmdnames
+@kindex \key1\
+@kindex \key2\
+@item @kbd{\key1\}
+@itemx @kbd{\key2\}
+@end ifclear
+@end macro
+@c -----------------------------------------------------------------------------
+
 @iftex
 @c @hyphenation{time-stamp time-stamps time-stamp-ing time-stamp-ed}
 @end iftex
-@macro Ie {}
-I.e.,
-@end macro
-@macro ie {}
-i.e.,
-@end macro
-@macro Eg {}
-E.g.,
-@end macro
-@macro eg {}
-e.g.,
-@end macro
 
 @c Subheadings inside a table.
 @macro tsubheading{text}
@@ -260,7 +456,6 @@
 * Creating timestamps::         Commands which insert timestamps
 * Deadlines and scheduling::    Planning your work
 * Clocking work time::          Tracking how long you spend on a task
-* Resolving idle time::         Resolving time if you've been idle
 * Effort estimates::            Planning work effort in advance
 * Relative timer::              Notes with a running timer
 * Countdown timer::             Starting a countdown timer for a task
@@ -275,6 +470,12 @@
 * Inserting deadline/schedule::  Planning items
 * Repeated tasks::              Items that show up again and again
 
+Clocking work time
+
+* Clocking commands::           Starting and stopping a clock
+* The clock table::             Detailed reports
+* Resolving idle time::         Resolving time when you've been idle
+
 Capture - Refile - Archive
 
 * Capture::                     Capturing new stuff
@@ -355,7 +556,7 @@
 * Horizontal rules::            Make a line
 * Comment lines::               What will *not* be exported
 
-Embedded La@TeX{}
+Embedded @LaTeX{}
 
 * Special symbols::             Greek letters and other symbols
 * Subscripts and superscripts::  Simple syntax for raising/lowering text
@@ -370,7 +571,7 @@
 * The export dispatcher::       How to access exporter commands
 * ASCII/Latin-1/UTF-8 export::  Exporting to flat files with encoding
 * HTML export::                 Exporting to HTML
-* LaTeX and PDF export::        Exporting to La@TeX{}, and processing to PDF
+* LaTeX and PDF export::        Exporting to @LaTeX{}, and processing to PDF
 * DocBook export::              Exporting to DocBook
 * TaskJuggler export::          Exporting to TaskJuggler
 * Freemind export::             Exporting to Freemind mind maps
@@ -389,13 +590,13 @@
 * CSS support::                 Changing the appearance of the output
 * JavaScript support::          Info and Folding in a web browser
 
-La@TeX{} and PDF export
+@LaTeX{} and PDF export
 
 * LaTeX/PDF export commands::   Which key invokes which commands
 * Header and sectioning::       Setting up the export file structure
-* Quoting LaTeX code::          Incorporating literal La@TeX{} code
-* Tables in LaTeX export::      Options for exporting tables to La@TeX{}
-* Images in LaTeX export::      How to insert figures into La@TeX{} output
+* Quoting LaTeX code::          Incorporating literal @LaTeX{} code
+* Tables in LaTeX export::      Options for exporting tables to @LaTeX{}
+* Images in LaTeX export::      How to insert figures into @LaTeX{} output
 * Beamer class export::         Turning the file into a presentation
 
 DocBook export
@@ -506,7 +707,7 @@
 * Add-on packages::             Available extensions
 * Adding hyperlink types::      New custom link types
 * Context-sensitive commands::  How to add functionality to such commands
-* Tables in arbitrary syntax::  Orgtbl for La@TeX{} and other programs
+* Tables in arbitrary syntax::  Orgtbl for @LaTeX{} and other programs
 * Dynamic blocks::              Automatically filled blocks
 * Special agenda views::        Customized views
 * Extracting agenda information::  Postprocessing of agenda information
@@ -567,14 +768,14 @@
 nodes.  Based on this data, specific entries can be extracted in queries and
 create dynamic @i{agenda views}.
 
-Org mode contains the Org Babel environment which allows to work with
-embedded source code block in a file, to facilitate code evaluation,
+Org mode contains the Org Babel environment which allows you to work with
+embedded source code blocks in a file, to facilitate code evaluation,
 documentation, and tangling.
 
 Org's automatic, context-sensitive table editor with spreadsheet
 capabilities can be integrated into any major mode by activating the
 minor Orgtbl mode.  Using a translation step, it can be used to maintain
-tables in arbitrary file types, for example in La@TeX{}.  The structure
+tables in arbitrary file types, for example in @LaTeX{}.  The structure
 editing and list creation capabilities can be used outside Org with
 the minor Orgstruct mode.
 
@@ -591,7 +792,7 @@
 @r{@bullet{} a full agenda and planner with deadlines and work scheduling}
 @pindex GTD, Getting Things Done
 @r{@bullet{} an environment in which to implement David Allen's GTD system}
-@r{@bullet{} a simple hypertext system, with HTML and La@TeX{} export}
+@r{@bullet{} a simple hypertext system, with HTML and @LaTeX{} export}
 @r{@bullet{} a publishing tool to create a set of interlinked webpages}
 @r{@bullet{} an environment for literate programming}
 @end example
@@ -742,7 +943,7 @@
 moderators have to do.}.
 
 For bug reports, please first try to reproduce the bug with the latest
-version of Org available - if you are running an outdated version, it is
+version of Org available---if you are running an outdated version, it is
 quite possible that the bug has been fixed already.  If the bug persists,
 prepare a report and provide as much information as possible, including the
 version information of Emacs (@kbd{M-x emacs-version @key{RET}}) and Org
@@ -819,6 +1020,18 @@
 special meaning are written with all capitals.
 @end table
 
+The manual lists both the keys and the corresponding commands for accessing
+functionality.  Org mode often uses the same key for different functions,
+depending on context.  The command that is bound to such keys has a generic
+name, like @code{org-metaright}.  In the manual we will, wherever possible,
+give the function that is internally called by the generic command.  For
+example, in the chapter on document structure, @kbd{M-@key{right}} will be
+listed to call @code{org-do-demote}, while in the chapter on tables, it will
+be listed to call org-table-move-column-right.
+
+If you prefer, you can compile the manual without the command names by
+unsetting the flag @code{cmdnames} in @file{org.texi}.
+
 @node Document Structure, Tables, Introduction, Top
 @chapter Document structure
 @cindex document structure
@@ -1199,8 +1412,7 @@
 @table @asis
 @orgcmd{C-c /,org-sparse-tree}
 This prompts for an extra key to select a sparse-tree creating command.
-@kindex C-c / r
-@item C-c / r
+@orgcmd{C-c / r,org-occur}
 @vindex org-remove-highlights-with-change
 Occur.  Prompts for a regexp and shows a sparse tree with all matches.  If
 the match is in a headline, the headline is made visible.  If the match is in
@@ -1270,7 +1482,7 @@
 @emph{Ordered} list items start with a numeral followed by either a period or
 a right parenthesis@footnote{You can filter out any of them by configuring
 @code{org-plain-list-ordered-item-terminator}.}, such as @samp{1.} or
-@samp{1)}.  If you want a list to start a different value (e.g. 20), start
+@samp{1)}.  If you want a list to start with a different value (e.g. 20), start
 the text of the item with @code{[@@20]}@footnote{If there's a checkbox in the
 item, the cookie must be put @emph{before} the checkbox.}.  Those constructs
 can be used in any item of the list in order to enforce a particular
@@ -1325,7 +1537,7 @@
 put into @file{.emacs}: @code{(require 'filladapt)}}, and by exporting them
 properly (@pxref{Exporting}).  Since indentation is what governs the
 structure of these lists, many structural constructs like @code{#+BEGIN_...}
-blocks can be indented to signal that they should be considered of a list
+blocks can be indented to signal that they should be considered as a list
 item.
 
 @vindex org-list-demote-modify-bullet
@@ -1336,7 +1548,7 @@
 @vindex org-list-automatic-rules
 The following commands act on items when the cursor is in the first line of
 an item (the line with the bullet or number).  Some of them imply the
-application of automatic rules to keep list structure in tact.  If some of
+application of automatic rules to keep list structure intact.  If some of
 these actions get in your way, configure @code{org-list-automatic-rules}
 to disable them individually.
 
@@ -1345,8 +1557,9 @@
 @vindex org-cycle-include-plain-lists
 Items can be folded just like headline levels.  Normally this works only if
 the cursor is on a plain list item.  For more details, see the variable
-@code{org-cycle-include-plain-lists}. to @code{integrate}, plain list items
-will be treated like low-level.  The level of an item is then given by the
+@code{org-cycle-include-plain-lists}.  If this variable is set to
+@code{integrate}, plain list items will be treated like low-level
+headlines.  The level of an item is then given by the
 indentation of the bullet/number.  Items are always subordinate to real
 headlines, however; the hierarchies remain completely separated.
 @orgcmd{M-@key{RET},org-insert-heading}
@@ -1357,7 +1570,7 @@
 of a line, the line is @emph{split} and the rest of the line becomes the new
 item@footnote{If you do not want the line to be split, customize the variable
 @code{org-M-RET-may-split-line}.}.  If this command is executed @emph{before
-item's body}, the new item is created @emph{before} the current item.  If the
+an item's body}, the new item is created @emph{before} the current item.  If the
 command is executed in the white space before the text that is part of an
 item but does not contain the bullet, a bullet is added to the current line.
 
@@ -1369,7 +1582,7 @@
 Insert a new item with a checkbox (@pxref{Checkboxes}).
 @orgcmd{@key{TAB},org-cycle}
 In a new item with no text yet, the first @key{TAB} demotes the item to
-become a child of the previous one.  Subsequents @key{TAB} move the item to
+become a child of the previous one.  Subsequent @key{TAB}s move the item to
 meaningful levels in the list and eventually get it back to its initial
 position.
 @kindex S-@key{down}
@@ -1475,8 +1688,7 @@
 storing properties (@pxref{Properties and Columns}), and you can also arrange
 for state change notes (@pxref{Tracking TODO state changes}) and clock times
 (@pxref{Clocking work time}) to be stored in a drawer @code{LOGBOOK}.  If you
-want to store a quick note in the LOGBOOK drawer, in a similar way as this is
-done by state changes, use
+want to store a quick note in the LOGBOOK drawer, in a similar way to state changes, use
 
 @table @kbd
 @kindex C-c C-z
@@ -1513,7 +1725,7 @@
 syntax is similar to the one used by @file{footnote.el}, i.e. a footnote is
 defined in a paragraph that is started by a footnote marker in square
 brackets in column 0, no indentation allowed.  If you need a paragraph break
-inside a footnote, use the La@TeX{} idiom @samp{\par}.  The footnote reference
+inside a footnote, use the @LaTeX{} idiom @samp{\par}.  The footnote reference
 is simply the marker in square brackets, inside text.  For example:
 
 @example
@@ -1525,7 +1737,7 @@
 Org-mode extends the number-based syntax to @emph{named} footnotes and
 optional inline definition.  Using plain numbers as markers (as
 @file{footnote.el} does) is supported for backward compatibility, but not
-encouraged because of possible conflicts with La@TeX{} snippets (@pxref{Embedded
+encouraged because of possible conflicts with @LaTeX{} snippets (@pxref{Embedded
 LaTeX}).  Here are the valid references:
 
 @table @code
@@ -1537,7 +1749,7 @@
 A named footnote reference, where @code{name} is a unique label word, or, for
 simplicity of automatic creation, a number.
 @item [fn:: This is the inline definition of this footnote]
-A La@TeX{}-like anonymous footnote where the definition is given directly at the
+A @LaTeX{}-like anonymous footnote where the definition is given directly at the
 reference point.
 @item [fn:name: a definition]
 An inline definition of a footnote, which also specifies a name for the note.
@@ -1548,7 +1760,7 @@
 @vindex org-footnote-auto-label
 Footnote labels can be created automatically, or you can create names yourself.
 This is handled by the variable @code{org-footnote-auto-label} and its
-corresponding @code{#+STARTUP} keywords, see the docstring of that variable
+corresponding @code{#+STARTUP} keywords.  See the docstring of that variable
 for details.
 
 @noindent The following command handles footnotes:
@@ -1631,7 +1843,7 @@
 headline or the first line of a list item, most structure editing commands
 will work, even if the same keys normally have different functionality in the
 major mode you are using.  If the cursor is not in one of those special
-lines, Orgstruct mode lurks silently in the shadow.  When you use
+lines, Orgstruct mode lurks silently in the shadows.  When you use
 @code{orgstruct++-mode}, Org will also export indentation and autofill
 settings into that mode, and detect item context after the first line of an
 item.
@@ -1642,8 +1854,7 @@
 @cindex editing tables
 
 Org comes with a fast and intuitive table editor.  Spreadsheet-like
-calculations are supported in connection with the Emacs @file{calc}
-package
+calculations are supported using the Emacs @file{calc} package
 @ifinfo
 (@pxref{Top,Calc,,Calc,Gnu Emacs Calculator Manual}).
 @end ifinfo
@@ -1722,70 +1933,55 @@
 @kbd{|Name|Phone|Age @key{RET} |- @key{TAB}}.
 
 @tsubheading{Re-aligning and field motion}
-@orgcmd{C-c C-c,org-ctrl-c-ctrl-c}
+@orgcmd{C-c C-c,org-table-align}
 Re-align the table without moving the cursor.
 @c
-@orgcmd{<TAB>,org-cycle}
+@orgcmd{<TAB>,org-table-next-field}
 Re-align the table, move to the next field.  Creates a new row if
 necessary.
 @c
-@orgcmd{S-@key{TAB},org-shifttab}
+@orgcmd{S-@key{TAB},org-table-previous-field}
 Re-align, move to previous field.
 @c
-@orgcmd{@key{RET},org-return}
+@orgcmd{@key{RET},org-table-next-row}
 Re-align the table and move down to next row.  Creates a new row if
 necessary.  At the beginning or end of a line, @key{RET} still does
 NEWLINE, so it can be used to split a table.
 @c
-@kindex M-a
-@item M-a
+@orgcmd{M-a,org-table-beginning-of-field}
 Move to beginning of the current table field, or on to the previous field.
-@kindex M-e
-@item M-e
+@orgcmd{M-e,org-table-end-of-field}
 Move to end of the current table field, or on to the next field.
 
 @tsubheading{Column and row editing}
-@kindex M-@key{left}
-@kindex M-@key{right}
-@item M-@key{left}
-@itemx M-@key{right}
+@orgcmdkkcc{M-@key{left},M-@key{right},org-table-move-column-left,org-table-move-column-right}
 Move the current column left/right.
 @c
-@kindex M-S-@key{left}
-@item M-S-@key{left}
+@orgcmd{M-S-@key{left},org-table-delete-column}
 Kill the current column.
 @c
-@kindex M-S-@key{right}
-@item M-S-@key{right}
+@orgcmd{M-S-@key{right},org-table-insert-column}
 Insert a new column to the left of the cursor position.
 @c
-@kindex M-@key{up}
-@kindex M-@key{down}
-@item M-@key{up}
-@itemx M-@key{down}
+@orgcmdkkcc{M-@key{up},M-@key{down},org-table-move-row-up,org-table-move-row-down}
 Move the current row up/down.
 @c
-@kindex M-S-@key{up}
-@item M-S-@key{up}
+@orgcmd{M-S-@key{up},org-table-kill-row}
 Kill the current row or horizontal line.
 @c
-@kindex M-S-@key{down}
-@item M-S-@key{down}
+@orgcmd{M-S-@key{down},org-table-insert-row}
 Insert a new row above the current row.  With a prefix argument, the line is
 created below the current one.
 @c
-@kindex C-c -
-@item C-c -
+@orgcmd{C-c -,org-table-insert-hline}
 Insert a horizontal line below current row.  With a prefix argument, the line
 is created above the current line.
 @c
-@kindex C-c @key{RET}
-@item C-c @key{RET}
+@orgcmd{C-c @key{RET},org-table-hline-and-move}
 Insert a horizontal line below current row, and move the cursor into the row
 below that line.
 @c
-@kindex C-c ^
-@item C-c ^
+@orgcmd{C-c ^,org-table-sort-lines}
 Sort the table lines in the region.  The position of point indicates the
 column to be used for sorting, and the range of lines is the range
 between the nearest horizontal separator lines, or the entire table.  If
@@ -1797,35 +1993,30 @@
 argument, alphabetic sorting will be case-sensitive.
 
 @tsubheading{Regions}
-@kindex C-c C-x M-w
-@item C-c C-x M-w
+@orgcmd{C-c C-x M-w,org-table-copy-region}
 Copy a rectangular region from a table to a special clipboard.  Point and
 mark determine edge fields of the rectangle.  If there is no active region,
 copy just the current field.  The process ignores horizontal separator lines.
 @c
-@kindex C-c C-x C-w
-@item C-c C-x C-w
+@orgcmd{C-c C-x C-w,org-table-cut-region}
 Copy a rectangular region from a table to a special clipboard, and
 blank all fields in the rectangle.  So this is the ``cut'' operation.
 @c
-@kindex C-c C-x C-y
-@item C-c C-x C-y
+@orgcmd{C-c C-x C-y,org-table-paste-rectangle}
 Paste a rectangular region into a table.
 The upper left corner ends up in the current field.  All involved fields
 will be overwritten.  If the rectangle does not fit into the present table,
 the table is enlarged as needed.  The process ignores horizontal separator
 lines.
 @c
-@kindex M-@key{RET}
-@itemx M-@kbd{RET}
-Wrap several fields in a column like a paragraph.  If there is an active
-region, and both point and mark are in the same column, the text in the
-column is wrapped to minimum width for the given number of lines.  A numeric
-prefix argument may be used to change the number of desired lines.  If there
-is no region, the current field is split at the cursor position and the text
-fragment to the right of the cursor is prepended to the field one line
-down. If there is no region, but you specify a prefix argument, the current
-field is made blank, and the content is appended to the field above.
+@orgcmd{M-@key{RET},org-table-wrap-region}
+Split the current field at the cursor position and move the rest to the line
+below.  If there is an active region, and both point and mark are in the same
+column, the text in the column is wrapped to minimum width for the given
+number of lines.  A numeric prefix argument may be used to change the number
+of desired lines.  If there is no region, but you specify a prefix argument,
+the current field is made blank, and the content is appended to the field
+above.
 
 @tsubheading{Calculations}
 @cindex formula, in tables
@@ -1833,14 +2024,12 @@
 @cindex region, active
 @cindex active region
 @cindex transient mark mode
-@kindex C-c +
-@item C-c +
+@orgcmd{C-c +,org-table-sum}
 Sum the numbers in the current column, or in the rectangle defined by
 the active region.  The result is shown in the echo area and can
 be inserted with @kbd{C-y}.
 @c
-@kindex S-@key{RET}
-@item S-@key{RET}
+@orgcmd{S-@key{RET},org-table-copy-down}
 @vindex org-table-copy-increment
 When current field is empty, copy from first non-empty field above.  When not
 empty, copy current field down to next row and move cursor along with it.
@@ -1851,8 +2040,7 @@
 (@pxref{Conflicts}).
 
 @tsubheading{Miscellaneous}
-@kindex C-c `
-@item C-c `
+@orgcmd{C-c `,org-table-edit-field}
 Edit the current field in a separate window.  This is useful for fields that
 are not fully visible (@pxref{Column width and alignment}).  When called with
 a @kbd{C-u} prefix, just make the full field visible, so that it can be
@@ -1866,12 +2054,13 @@
 the buffer and then converting the region to a table.  Any prefix
 argument is passed on to the converter, which uses it to determine the
 separator.
-@item C-c |
+@orgcmd{C-c |,org-table-create-or-convert-from-region}
 Tables can also be imported by pasting tabular text into the Org
 buffer, selecting the pasted text with @kbd{C-x C-x} and then using the
 @kbd{C-c |} command (see above under @i{Creation and conversion}).
 @c
 @item M-x org-table-export
+@findex org-table-export
 @vindex org-table-export-default-format
 Export the table, by default as a TAB-separated file.  Use for data
 exchange with, for example, spreadsheet or database programs.  The format
@@ -1926,7 +2115,7 @@
 
 @noindent
 Fields that are wider become clipped and end in the string @samp{=>}.
-Note that the full text is still in the buffer, it is only invisible.
+Note that the full text is still in the buffer but is hidden.
 To see the full text, hold the mouse over the field---a tool-tip window
 will show the full content.  To edit such a field, use the command
 @kbd{C-c `} (that is @kbd{C-c} followed by the backquote).  This will
@@ -1947,7 +2136,7 @@
 @end example
 
 If you would like to overrule the automatic alignment of number-rich columns
-to the right and of string-rich column to the left, you and use @samp{<r>},
+to the right and of string-rich column to the left, you can use @samp{<r>},
 @samp{c}@footnote{Centering does not work inside Emacs, but it does have an
 effect when exporting to HTML.} or @samp{<l>} in a similar fashion.  You may
 also combine alignment and field width like this: @samp{<l10>}.
@@ -2007,7 +2196,7 @@
 
 Furthermore, with some special setup, it is possible to maintain tables
 in arbitrary syntax with Orgtbl mode.  For example, it is possible to
-construct La@TeX{} tables with the underlying ease and power of
+construct @LaTeX{} tables with the underlying ease and power of
 Orgtbl mode, including spreadsheet capabilities.  For details, see
 @ref{Tables in arbitrary syntax}.
 
@@ -2280,7 +2469,7 @@
 sin($1);Dp3%.1e      @r{Same, but use printf specifier for display}
 vmean($2..$7)        @r{Compute column range mean, using vector function}
 vmean($2..$7);EN     @r{Same, but treat empty fields as 0}
-taylor($3,x=7,2)     @r{taylor series of $3, at x=7, second degree}
+taylor($3,x=7,2)     @r{Taylor series of $3, at x=7, second degree}
 @end example
 
 Calc also contains a complete set of logical operations.  For example
@@ -2293,24 +2482,23 @@
 @subsection Emacs Lisp forms as formulas
 @cindex Lisp forms, as table formulas
 
-It is also possible to write a formula in Emacs Lisp; this can be useful
-for string manipulation and control structures, if Calc's
-functionality is not enough.  If a formula starts with a single-quote
-followed by an opening parenthesis, then it is evaluated as a Lisp form.
-The evaluation should return either a string or a number.  Just as with
-@file{calc} formulas, you can specify modes and a printf format after a
-semicolon.  With Emacs Lisp forms, you need to be conscious about the way
-field references are interpolated into the form.  By default, a
-reference will be interpolated as a Lisp string (in double-quotes)
-containing the field.  If you provide the @samp{N} mode switch, all
-referenced elements will be numbers (non-number fields will be zero) and
-interpolated as Lisp numbers, without quotes.  If you provide the
-@samp{L} flag, all fields will be interpolated literally, without quotes.
-I.e., if you want a reference to be interpreted as a string by the Lisp
-form, enclose the reference operator itself in double-quotes, like
-@code{"$3"}.  Ranges are inserted as space-separated fields, so you can
-embed them in list or vector syntax.  A few examples, note how the
-@samp{N} mode is used when we do computations in Lisp.
+It is also possible to write a formula in Emacs Lisp; this can be useful for
+string manipulation and control structures, if Calc's functionality is not
+enough.  If a formula starts with a single-quote followed by an opening
+parenthesis, then it is evaluated as a Lisp form.  The evaluation should
+return either a string or a number.  Just as with @file{calc} formulas, you
+can specify modes and a printf format after a semicolon.  With Emacs Lisp
+forms, you need to be conscious about the way field references are
+interpolated into the form.  By default, a reference will be interpolated as
+a Lisp string (in double-quotes) containing the field.  If you provide the
+@samp{N} mode switch, all referenced elements will be numbers (non-number
+fields will be zero) and interpolated as Lisp numbers, without quotes.  If
+you provide the @samp{L} flag, all fields will be interpolated literally,
+without quotes.  I.e., if you want a reference to be interpreted as a string
+by the Lisp form, enclose the reference operator itself in double-quotes,
+like @code{"$3"}.  Ranges are inserted as space-separated fields, so you can
++embed them in list or vector syntax.  Here are a few examples---note how the
+@samp{N} mode is used when we do computations in Lisp:
 
 @example
 @r{Swap the first two characters of the content of column 1}
@@ -2334,7 +2522,7 @@
 
 @cindex #+TBLFM
 Formulas are stored in a special line starting with @samp{#+TBLFM:}
-directly below the table.  If you typed the equation in the 4th field of
+directly below the table.  If you type the equation in the 4th field of
 the 3rd data line in the table, the formula will look like
 @samp{@@3$4=$1+$2}.  When inserting/deleting/swapping column and rows
 with the appropriate commands, @i{absolute references} (but not relative
@@ -2348,8 +2536,7 @@
 following command
 
 @table @kbd
-@kindex C-u C-c =
-@item C-u C-c =
+@orgcmd{C-u C-c =,org-table-eval-formula}
 Install a new formula for the current field.  The command prompts for a
 formula with default taken from the @samp{#+TBLFM:} line, applies
 it to the current field, and stores it.
@@ -2382,8 +2569,7 @@
 following command:
 
 @table @kbd
-@kindex C-c =
-@item C-c =
+@orgcmd{C-c =,org-table-eval-formula}
 Install a new formula for the current column and replace current field with
 the result of the formula.  The command prompts for a formula, with default
 taken from the @samp{#+TBLFM} line, applies it to the current field and
@@ -2406,32 +2592,29 @@
 @code{org-table-use-standard-references}.
 
 @table @kbd
-@kindex C-c =
-@kindex C-u C-c =
-@item C-c =
-@itemx C-u C-c =
+@orgcmdkkc{C-c =,C-u C-c =,org-table-eval-formula}
 Edit the formula associated with the current column/field in the
 minibuffer.  See @ref{Column formulas}, and @ref{Field formulas}.
-@kindex C-u C-u C-c =
-@item C-u C-u C-c =
+@orgcmd{C-u C-u C-c =,org-table-eval-formula}
 Re-insert the active formula (either a
 field formula, or a column formula) into the current field, so that you
 can edit it directly in the field.  The advantage over editing in the
 minibuffer is that you can use the command @kbd{C-c ?}.
-@kindex C-c ?
-@item C-c ?
+@orgcmd{C-c ?,org-table-field-info}
 While editing a formula in a table field, highlight the field(s)
 referenced by the reference at the cursor position in the formula.
 @kindex C-c @}
+@findex org-table-toggle-coordinate-overlays
 @item C-c @}
-Toggle the display of row and column numbers for a table, using
-overlays.  These are updated each time the table is aligned; you can
-force it with @kbd{C-c C-c}.
+Toggle the display of row and column numbers for a table, using overlays
+(@command{org-table-toggle-coordinate-overlays}).  These are updated each
+time the table is aligned; you can force it with @kbd{C-c C-c}.
 @kindex C-c @{
+@findex org-table-toggle-formula-debugger
 @item C-c @{
-Toggle the formula debugger on and off.  See below.
-@kindex C-c '
-@item C-c '
+Toggle the formula debugger on and off
+(@command{org-table-toggle-formula-debugger}).  See below.
+@orgcmd{C-c ',org-table-edit-formulas}
 Edit all formulas for the current table in a special buffer, where the
 formulas will be displayed one per line.  If the current field has an
 active formula, the cursor in the formula editor will mark it.
@@ -2439,46 +2622,40 @@
 any field or range reference at the cursor position.  You may edit,
 remove and add formulas, and use the following commands:
 @table @kbd
-@kindex C-c C-c
-@kindex C-x C-s
-@item C-c C-c
-@itemx C-x C-s
+@orgcmdkkc{C-c C-c,C-x C-s,org-table-fedit-finish}
 Exit the formula editor and store the modified formulas.  With @kbd{C-u}
 prefix, also apply the new formulas to the entire table.
-@kindex C-c C-q
-@item C-c C-q
+@orgcmd{C-c C-q,org-table-fedit-abort}
 Exit the formula editor without installing changes.
-@kindex C-c C-r
-@item C-c C-r
+@orgcmd{C-c C-r,org-table-fedit-toggle-ref-type}
 Toggle all references in the formula editor between standard (like
 @code{B3}) and internal (like @code{@@3$2}).
-@kindex @key{TAB}
-@item @key{TAB}
+@orgcmd{@key{TAB},org-table-fedit-lisp-indent}
 Pretty-print or indent Lisp formula at point.  When in a line containing
 a Lisp formula, format the formula according to Emacs Lisp rules.
 Another @key{TAB} collapses the formula back again.  In the open
 formula, @key{TAB} re-indents just like in Emacs Lisp mode.
-@kindex M-@key{TAB}
-@item M-@key{TAB}
+@orgcmd{M-@key{TAB},lisp-complete-symbol}
 Complete Lisp symbols, just like in Emacs Lisp mode.
 @kindex S-@key{up}
 @kindex S-@key{down}
 @kindex S-@key{left}
 @kindex S-@key{right}
+@findex org-table-fedit-ref-up
+@findex org-table-fedit-ref-down
+@findex org-table-fedit-ref-left
+@findex org-table-fedit-ref-right
 @item S-@key{up}/@key{down}/@key{left}/@key{right}
 Shift the reference at point.  For example, if the reference is
 @code{B3} and you press @kbd{S-@key{right}}, it will become @code{C3}.
 This also works for relative references and for hline references.
-@kindex M-S-@key{up}
-@kindex M-S-@key{down}
-@item M-S-@key{up}/@key{down}
+@orgcmdkkcc{M-S-@key{up},M-S-@key{down},org-table-fedit-line-up,org-table-fedit-line-down}
 Move the test line for column formulas in the Org buffer up and
 down.
-@kindex M-@key{up}
-@kindex M-@key{down}
-@item M-@key{up}/@key{down}
+@orgcmdkkcc{M-@key{up},M-@key{down},org-table-fedit-scroll-down,org-table-fedit-scroll-up}
 Scroll the window displaying the table.
 @kindex C-c @}
+@findex org-table-toggle-coordinate-overlays
 @item C-c @}
 Turn the coordinate grid in the table on and off.
 @end table
@@ -2518,8 +2695,7 @@
 following commands:
 
 @table @kbd
-@kindex C-c *
-@item C-c *
+@orgcmd{C-c *,org-table-recalculate}
 Recalculate the current row by first applying the stored column formulas
 from left to right, and all field formulas in the current row.
 @c
@@ -2530,16 +2706,15 @@
 Recompute the entire table, line by line.  Any lines before the first
 hline are left alone, assuming that these are part of the table header.
 @c
-@kindex C-u C-u C-c *
-@kindex C-u C-u C-c C-c
-@item C-u C-u C-c *
-@itemx C-u C-u C-c C-c
+@orgcmdkkc{C-u C-u C-c *,C-u C-u C-c C-c,org-table-iterate}
 Iterate the table by recomputing it until no further changes occur.
 This may be necessary if some computed fields use the value of other
 fields that are computed @i{later} in the calculation sequence.
 @item M-x org-table-recalculate-buffer-tables
+@findex org-table-recalculate-buffer-tables
 Recompute all tables in the current buffer.
 @item M-x org-table-iterate-buffer-tables
+@findex org-table-iterate-buffer-tables
 Iterate all tables in the current buffer, in order to converge table-to-table
 dependencies.
 @end table
@@ -2551,8 +2726,7 @@
 you want to be able to assign @i{names} to fields and columns, you need
 to reserve the first column of the table for special marking characters.
 @table @kbd
-@kindex C-#
-@item C-#
+@orgcmd{C-#,org-table-rotate-recalc-marks}
 Rotate the calculation mark in first column through the states @samp{ },
 @samp{#}, @samp{*}, @samp{!}, @samp{$}.  When there is an active region,
 change all marks in the region.
@@ -2708,8 +2882,8 @@
 If you want to plot to a file, specify @code{"@var{path/to/desired/output-file}"}.
 
 @item labels
-List of labels to be used for the deps (defaults to the column headers if
-they exist).
+List of labels to be used for the @code{deps} (defaults to the column headers
+if they exist).
 
 @item line
 Specify an entire line to be inserted in the Gnuplot script.
@@ -2821,7 +2995,7 @@
 star followed by a few optional letters into the buffer and press
 @kbd{M-@key{TAB}}.  All headlines in the current buffer will be offered as
 completions.}.  In non-Org files, the search will look for the words in the
-link text, in the above example the search would be for @samp{my target}.
+link text.  In the above example the search would be for @samp{my target}.
 
 Following a link pushes a mark onto Org's own mark ring.  You can
 return to the previous position with @kbd{C-c &}.  Using this command
@@ -2939,9 +3113,8 @@
 insert it into an Org file, and to follow the link.
 
 @table @kbd
-@kindex C-c l
+@orgcmd{C-c l,org-store-link}
 @cindex storing links
-@item C-c l
 Store a link to the current location.  This is a @emph{global} command (you
 must create the key binding yourself) which can be used in any buffer to
 create a link.  The link will be stored for later insertion into an Org
@@ -2997,11 +3170,10 @@
 entry referenced by the current line.
 
 @c
-@kindex C-c C-l
+@orgcmd{C-c C-l,org-insert-link}
 @cindex link completion
 @cindex completion, of links
 @cindex inserting links
-@item C-c C-l
 @vindex org-keep-stored-link-after-insertion
 Insert a link@footnote{ Note that you don't have to use this command to
 insert a link.  Links in Org are plain text, and you can type or paste them
@@ -3031,10 +3203,9 @@
 example, if you type @kbd{file @key{RET}}, file name completion (alternative
 access: @kbd{C-u C-c C-l}, see below) will be offered, and after @kbd{bbdb
 @key{RET}} you can complete contact names.
-@kindex C-u C-c C-l
+@orgkey C-u C-c C-l
 @cindex file name completion
 @cindex completion, of file names
-@item C-u C-c C-l
 When @kbd{C-c C-l} is called with a @kbd{C-u} prefix argument, a link to
 a file will be inserted and you may use file name completion to select
 the name of the file.  The path to the file is inserted relative to the
@@ -3049,9 +3220,7 @@
 link and description parts of the link.
 @c
 @cindex following links
-@kindex C-c C-o
-@kindex @key{RET}
-@item C-c C-o @ @r{(or, if @code{org-return-follows-link} is set, also} @key{RET}
+@orgcmd{C-c C-o,org-open-at-point}
 @vindex org-file-apps
 Open link at point.  This will launch a web browser for URLs (using
 @command{browse-url-at-point}), run VM/MH-E/Wanderlust/Rmail/Gnus/BBDB for
@@ -3067,13 +3236,17 @@
 opening in Emacs, use a @kbd{C-u C-u} prefix.@*
 If the cursor is on a headline, but not on a link, offer all links in the
 headline and entry text.
+@orgkey @key{RET}
+@vindex org-return-follows-link
+When @code{org-return-follows-link} is set, @kbd{@key{RET}} will also follow
+the link at point.
 @c
 @kindex mouse-2
 @kindex mouse-1
 @item mouse-2
 @itemx mouse-1
 On links, @kbd{mouse-2} will open the link just as @kbd{C-c C-o}
-would.  Under Emacs 22, @kbd{mouse-1} will also follow a link.
+would.  Under Emacs 22 and later, @kbd{mouse-1} will also follow a link.
 @c
 @kindex mouse-3
 @item mouse-3
@@ -3082,13 +3255,12 @@
 internal links to be displayed in another window@footnote{See the
 variable @code{org-display-internal-link-with-indirect-buffer}}.
 @c
+@orgcmd{C-c C-x C-v,org-toggle-inline-images}
 @cindex inlining images
 @cindex images, inlining
-@kindex C-c C-x C-v
 @vindex org-startup-with-inline-images
 @cindex @code{inlineimages}, STARTUP keyword
 @cindex @code{noinlineimages}, STARTUP keyword
-@item C-c C-x C-v
 Toggle the inline display of linked images.  Normally this will only inline
 images that have no description part in the link, i.e. images that will also
 be inlined during export.  When called with a prefix argument, also display
@@ -3096,28 +3268,23 @@
 displayed at startup by configuring the variable
 @code{org-startup-with-inline-images}@footnote{with corresponding
 @code{#+STARTUP} keywords @code{inlineimages} and @code{inlineimages}}.
+@orgcmd{C-c %,org-mark-ring-push}
 @cindex mark ring
-@kindex C-c %
-@item C-c %
 Push the current position onto the mark ring, to be able to return
 easily. Commands following an internal link do this automatically.
 @c
+@orgcmd{C-c &,org-mark-ring-goto}
 @cindex links, returning to
-@kindex C-c &
-@item C-c &
 Jump back to a recorded position.  A position is recorded by the
 commands following internal links, and by @kbd{C-c %}.  Using this
 command several times in direct succession moves through a ring of
 previously recorded positions.
 @c
-@kindex C-c C-x C-n
-@kindex C-c C-x C-p
+@orgcmdkkcc{C-c C-x C-n,C-c C-x C-p,org-next-link,org-previous-link}
 @cindex links, finding next/previous
-@item C-c C-x C-n
-@itemx C-c C-x C-p
 Move forward/backward to the next link in the buffer.  At the limit of
 the buffer, the search fails once, and then wraps around.  The key
-bindings for this are really too long, you might want to bind this also
+bindings for this are really too long; you might want to bind this also
 to @kbd{C-n} and @kbd{C-p}
 @lisp
 (add-hook 'org-load-hook
@@ -3316,9 +3483,8 @@
 The most important commands to work with TODO entries are:
 
 @table @kbd
-@kindex C-c C-t
+@orgcmd{C-c C-t,org-todo}
 @cindex cycling, of TODO states
-@item C-c C-t
 Rotate the TODO state of the current item among
 
 @example
@@ -3329,8 +3495,7 @@
 The same rotation can also be done ``remotely'' from the timeline and
 agenda buffers with the @kbd{t} command key (@pxref{Agenda commands}).
 
-@kindex C-u C-c C-t
-@item C-u C-c C-t
+@orgkey{C-u C-c C-t}
 Select a specific keyword using completion or (if it has been set up)
 the fast selection interface.  For the latter, you need to assign keys
 to TODO states, see @ref{Per-file keywords}, and @ref{Setting tags}, for
@@ -3338,17 +3503,15 @@
 
 @kindex S-@key{right}
 @kindex S-@key{left}
+@item S-@key{right} @ @r{/} @ S-@key{left}
 @vindex org-treat-S-cursor-todo-selection-as-state-change
-@item S-@key{right}
-@itemx S-@key{left}
 Select the following/preceding TODO state, similar to cycling.  Useful
 mostly if more than two TODO states are possible (@pxref{TODO
 extensions}).  See also @ref{Conflicts}, for a discussion of the interaction
 with @code{shift-selection-mode}.  See also the variable
 @code{org-treat-S-cursor-todo-selection-as-state-change}.
-@kindex C-c / t
+@orgcmd{C-c / t,org-show-todo-key}
 @cindex sparse tree, for TODO
-@itemx C-c / t
 @vindex org-todo-keywords
 View TODO items in a @emph{sparse tree} (@pxref{Sparse trees}).  Folds the
 entire buffer, but shows all TODO items (with not-DONE state) and the
@@ -3359,15 +3522,13 @@
 N, show the tree for the Nth keyword in the variable
 @code{org-todo-keywords}.  With two prefix arguments, find all TODO states,
 both un-done and done.
-@kindex C-c a t
-@item C-c a t
+@orgcmd{C-c a t,org-todo-list}
 Show the global TODO list.  Collects the TODO items (with not-DONE states)
 from all agenda files (@pxref{Agenda Views}) into a single buffer.  The new
 buffer will be in @code{agenda-mode}, which provides commands to examine and
 manipulate the TODO entries from the new buffer (@pxref{Agenda commands}).
 @xref{Global TODO list}, for more information.
-@kindex S-M-@key{RET}
-@item S-M-@key{RET}
+@orgcmd{S-M-@key{RET},org-insert-todo-heading}
 Insert a new TODO entry below the current one.
 @end table
 
@@ -3644,8 +3805,7 @@
 @end example
 
 @table @kbd
-@kindex C-c C-x o
-@item C-c C-x o
+@orgcmd{C-c C-x o,org-toggle-ordered-property}
 @vindex org-track-ordered-property-with-tag
 @cindex property, ORDERED
 Toggle the @code{ORDERED} property of the current entry.  A property is used
@@ -3653,8 +3813,7 @@
 inherited like a tag.  However, if you would like to @i{track} the value of
 this property with a tag for better visibility, customize the variable
 @code{org-track-ordered-property-with-tag}.
-@kindex C-u C-u C-u C-c C-t
-@item C-u C-u C-u C-c C-t
+@orgkey{C-u C-u C-u C-c C-t}
 Change TODO state, circumventing any state blocking.
 @end table
 
@@ -3698,7 +3857,7 @@
 
 The most basic logging is to keep track of @emph{when} a certain TODO
 item was finished.  This is achieved with@footnote{The corresponding
-in-buffer setting is: @code{#+STARTUP: logdone}}.
+in-buffer setting is: @code{#+STARTUP: logdone}}
 
 @lisp
 (setq org-log-done 'time)
@@ -3928,18 +4087,16 @@
 items.
 
 @table @kbd
+@item @kbd{C-c ,}
 @kindex @kbd{C-c ,}
-@item @kbd{C-c ,}
-Set the priority of the current headline.  The command prompts for a
-priority character @samp{A}, @samp{B} or @samp{C}.  When you press
-@key{SPC} instead, the priority cookie is removed from the headline.
-The priorities can also be changed ``remotely'' from the timeline and
-agenda buffer with the @kbd{,} command (@pxref{Agenda commands}).
-@c
-@kindex S-@key{up}
-@kindex S-@key{down}
-@item S-@key{up}
-@itemx S-@key{down}
+@findex org-priority
+Set the priority of the current headline (@command{org-priority}).  The
+command prompts for a priority character @samp{A}, @samp{B} or @samp{C}.
+When you press @key{SPC} instead, the priority cookie is removed from the
+headline.  The priorities can also be changed ``remotely'' from the timeline
+and agenda buffer with the @kbd{,} command (@pxref{Agenda commands}).
+@c
+@orgcmdkkcc{S-@key{up},S-@key{down},org-priority-up,org-priority-down}
 @vindex org-priority-start-cycle-with-default
 Increase/decrease priority of current headline@footnote{See also the option
 @code{org-priority-start-cycle-with-default}.}.  Note that these keys are
@@ -4089,13 +4246,11 @@
 @noindent The following commands work with checkboxes:
 
 @table @kbd
-@kindex C-c C-c
-@item C-c C-c
+@orgcmd{C-c C-c,org-toggle-checkbox}
 Toggle checkbox status or (with prefix arg) checkbox presence at point.  With
 double prefix argument, set it to @samp{[-]}, which is considered to be an
 intermediate state.
-@kindex C-c C-x C-b
-@item C-c C-x C-b
+@orgcmd{C-c C-x C-b,org-toggle-checkbox}
 Toggle checkbox status or (with prefix arg) checkbox presence at point.  With
 double prefix argument, set it to @samp{[-]}, which is considered to be an
 intermediate state.
@@ -4110,13 +4265,11 @@
 @item
 If there is no active region, just toggle the checkbox at point.
 @end itemize
-@kindex M-S-@key{RET}
-@item M-S-@key{RET}
+@orgcmd{M-S-@key{RET},org-insert-todo-heading}
 Insert a new item with a checkbox.
 This works only if the cursor is already in a plain list item
 (@pxref{Plain lists}).
-@kindex C-c C-x o
-@item C-c C-x o
+@orgcmd{C-c C-x o,org-toggle-ordered-property}
 @vindex org-track-ordered-property-with-tag
 @cindex property, ORDERED
 Toggle the @code{ORDERED} property of the entry, to toggle if checkboxes must
@@ -4125,8 +4278,7 @@
 However, if you would like to @i{track} the value of this property with a tag
 for better visibility, customize the variable
 @code{org-track-ordered-property-with-tag}.
-@kindex C-c #
-@item C-c #
+@orgcmd{C-c #,org-update-statistics-cookies}
 Update the statistics cookie in the current outline entry.  When called with
 a @kbd{C-u} prefix, update the entire file.  Checkbox statistic cookies are
 updated automatically if you toggle checkboxes with @kbd{C-c C-c} and make
@@ -4220,8 +4372,7 @@
 also a special command for inserting tags:
 
 @table @kbd
-@kindex C-c C-q
-@item C-c C-q
+@orgcmd{C-c C-q,org-set-tags-command}
 @cindex completion, of tags
 @vindex org-tags-column
 Enter new tags for the current headline.  Org-mode will either offer
@@ -4231,8 +4382,7 @@
 tags in the current buffer will be aligned to that column, just to make
 things look nice.  TAGS are automatically realigned after promotion,
 demotion, and TODO state changes (@pxref{TODO basics}).
-@kindex C-c C-c
-@item C-c C-c
+@orgcmd{C-c C-c,org-set-tags-command}
 When the cursor is in a headline, this does the same as @kbd{C-c C-q}.
 @end table
 
@@ -4399,18 +4549,13 @@
 information into special lists.
 
 @table @kbd
-@kindex C-c \
-@kindex C-c / m
-@item C-c \
-@itemx C-c / m
+@orgcmdkkc{C-c / m,C-c \,org-match-sparse-tree}
 Create a sparse tree with all headlines matching a tags search.  With a
 @kbd{C-u} prefix argument, ignore headlines that are not a TODO line.
-@kindex C-c a m
-@item C-c a m
+@orgcmd{C-c a m,org-tags-view}
 Create a global list of tag matches from all agenda files.
 @xref{Matching tags and properties}.
-@kindex C-c a M
-@item C-c a M
+@orgcmd{C-c a M,org-tags-view}
 @vindex org-tags-match-list-sublevels
 Create a global list of tag matches from all agenda files, but check
 only TODO items and force checking subitems (see variable
@@ -4511,33 +4656,29 @@
 The following commands help to work with properties:
 
 @table @kbd
-@kindex M-@key{TAB}
-@item M-@key{TAB}
+@orgcmd{M-@key{TAB},org-complete}
 After an initial colon in a line, complete property keys.  All keys used
 in the current file will be offered as possible completions.
-@kindex C-c C-x p
-@item C-c C-x p
+@orgcmd{C-c C-x p,org-set-property}
 Set a property.  This prompts for a property name and a value.  If
 necessary, the property drawer is created as well.
 @item M-x org-insert-property-drawer
+@findex org-insert-property-drawer
 Insert a property drawer into the current entry.  The drawer will be
 inserted early in the entry, but after the lines with planning
 information like deadlines.
-@kindex C-c C-c
-@item C-c C-c
+@orgcmd{C-c C-c,org-property-action}
 With the cursor in a property drawer, this executes property commands.
-@item C-c C-c s
+@orgcmd{C-c C-c s,org-set-property}
 Set a property in the current entry.  Both the property and the value
 can be inserted using completion.
-@kindex S-@key{right}
-@kindex S-@key{left}
-@item S-@key{left}/@key{right}
+@orgcmdkkcc{S-@key{right},S-@key{left},org-property-next-allowed-value,org-property-previous-allowed-value}
 Switch property at point to the next/previous allowed value.
-@item C-c C-c d
+@orgcmd{C-c C-c d,org-delete-property}
 Remove a property from the current entry.
-@item C-c C-c D
+@orgcmd{C-c C-c D,org-delete-property-globally}
 Globally remove a property, from all entries in the current file.
-@item C-c C-c c
+@orgcmd{C-c C-c c,org-compute-property-at-point}
 Compute the property at point, using the operator and scope from the
 nearest column format definition.
 @end table
@@ -4592,18 +4733,13 @@
 To create sparse trees and special lists with selection based on properties,
 the same commands are used as for tag searches (@pxref{Tag searches}).
 @table @kbd
-@kindex C-c \
-@kindex C-c / m
-@item C-c \
-@itemx C-c / m
+@orgcmdkkc{C-c / m,C-c \,org-match-sparse-tree}
 Create a sparse tree with all matching entries.  With a
 @kbd{C-u} prefix argument, ignore headlines that are not a TODO line.
-@kindex C-c a m
-@item C-c a m
+@orgcmd{C-c a m,org-tags-view}
 Create a global list of tag/property  matches from all agenda files.
 @xref{Matching tags and properties}.
-@kindex C-c a M
-@item C-c a M
+@orgcmd{C-c a M,org-tags-view}
 @vindex org-tags-match-list-sublevels
 Create a global list of tag matches from all agenda files, but check
 only TODO items and force checking of subitems (see variable
@@ -4617,12 +4753,11 @@
 single property:
 
 @table @kbd
-@kindex C-c / p
-@item C-c / p
+@orgkey{C-c / p}
 Create a sparse tree based on the value of a property.  This first
 prompts for the name of a property, and then for a value.  A sparse tree
 is created with all entries that define this property with the given
-value.  If you enclose the value into curly braces, it is interpreted as
+value.  If you enclose the value in curly braces, it is interpreted as
 a regular expression and matched against the property values.
 @end table
 
@@ -4632,7 +4767,7 @@
 @cindex inheritance, of properties
 
 @vindex org-use-property-inheritance
-The outline structure of Org-mode documents lends itself for an
+The outline structure of Org-mode documents lends itself to an
 inheritance model of properties: if the parent in a tree has a certain
 property, the children can inherit this property.  Org-mode does not
 turn this on by default, because it can slow down property searches
@@ -4642,7 +4777,7 @@
 all properties inherited from the parent, to a list of properties
 that should be inherited, or to a regular expression that matches
 inherited properties.  If a property has the value @samp{nil}, this is
-interpreted as an explicit undefine of he property, so that inheritance
+interpreted as an explicit undefine of the property, so that inheritance
 search will stop at this value and return @code{nil}.
 
 Org-mode has a few properties for which inheritance is hard-coded, at
@@ -4784,7 +4919,7 @@
 The @code{est+} summary type requires further explanation.  It is used for
 combining estimates, expressed as low-high ranges.  For example, instead
 of estimating a particular task will take 5 days, you might estimate it as
-5-6 days if you're fairly confident you know how much woark is required, or
+5-6 days if you're fairly confident you know how much work is required, or
 1-10 days if you don't really know what needs to be done.  Both ranges
 average at 5.5 days, but the first represents a more predictable delivery.
 
@@ -4829,8 +4964,7 @@
 
 @table @kbd
 @tsubheading{Turning column view on and off}
-@kindex C-c C-x C-c
-@item C-c C-x C-c
+@orgcmd{C-c C-x C-c,org-columns}
 @vindex org-columns-default-format
 Turn on column view.  If the cursor is before the first headline in the file,
 column view is turned on for the entire file, using the @code{#+COLUMNS}
@@ -4841,14 +4975,11 @@
 property.  If no such property is found, the format is taken from the
 @code{#+COLUMNS} line or from the variable @code{org-columns-default-format},
 and column view is established for the current entry and its subtree.
-@kindex r
-@item r
+@orgcmd{r,org-columns-redo}
 Recreate the column view, to include recent changes made in the buffer.
-@kindex g
-@item g
+@orgcmd{g,org-columns-redo}
 Same as @kbd{r}.
-@kindex q
-@item q
+@orgcmd{q,org-columns-quit}
 Exit column view.
 @tsubheading{Editing values}
 @item @key{left} @key{right} @key{up} @key{down}
@@ -4859,40 +4990,30 @@
 Switch to the next/previous allowed value of the field.  For this, you
 have to have specified allowed values for a property.
 @item 1..9,0
-Directly select the nth allowed value, @kbd{0} selects the 10th value.
-@kindex n
-@kindex p
-@itemx  n / p
+Directly select the Nth allowed value, @kbd{0} selects the 10th value.
+@orgcmdkkcc{n,p,org-columns-next-allowed-value,org-columns-previous-allowed-value}
 Same as @kbd{S-@key{left}/@key{right}}
-@kindex e
-@item e
+@orgcmd{e,org-columns-edit-value}
 Edit the property at point.  For the special properties, this will
 invoke the same interface that you normally use to change that
 property.  For example, when editing a TAGS property, the tag completion
 or fast selection interface will pop up.
-@kindex C-c C-c
-@item C-c C-c
+@orgcmd{C-c C-c,org-columns-set-tags-or-toggle}
 When there is a checkbox at point, toggle it.
-@kindex v
-@item v
+@orgcmd{v,org-columns-show-value}
 View the full value of this property.  This is useful if the width of
 the column is smaller than that of the value.
-@kindex a
-@item a
+@orgcmd{a,org-columns-edit-allowed}
 Edit the list of allowed values for this property.  If the list is found
 in the hierarchy, the modified values is stored there.  If no list is
 found, the new value is stored in the first entry that is part of the
 current column view.
 @tsubheading{Modifying the table structure}
-@kindex <
-@kindex >
-@item < / >
+@orgcmdkkcc{<,>,org-columns-narrow,org-columns-widen}
 Make the column narrower/wider by one character.
-@kindex S-M-@key{right}
-@item S-M-@key{right}
+@orgcmd{S-M-@key{right},org-columns-new}
 Insert a new column, to the left of the current column.
-@kindex S-M-@key{left}
-@item S-M-@key{left}
+@orgcmd{S-M-@key{left},org-columns-delete}
 Delete the current column.
 @end table
 
@@ -4948,20 +5069,16 @@
 The following commands insert or update the dynamic block:
 
 @table @kbd
-@kindex C-c C-x i
-@item C-c C-x i
+@orgcmd{C-c C-x i,org-insert-columns-dblock}
 Insert a dynamic block capturing a column view.  You will be prompted
 for the scope or ID of the view.
-@kindex C-c C-c
-@item C-c C-c
-@kindex C-c C-x C-u
-@itemx C-c C-x C-u
+@orgcmdkkc{C-c C-c,C-c C-x C-u,org-dblock-update}
 Update dynamic block at point.  The cursor needs to be in the
 @code{#+BEGIN} line of the dynamic block.
-@kindex C-u C-c C-x C-u
-@item C-u C-c C-x C-u
+@orgcmd{C-u C-c C-x C-u,org-update-all-dblocks}
 Update all dynamic blocks (@pxref{Dynamic blocks}).  This is useful if
-you have several clock table blocks in a buffer.
+you have several clock table blocks, column-capturing blocks or other dynamic
+blocks in a buffer.
 @end table
 
 You can add formulas to the column view table and you may add plotting
@@ -5006,7 +5123,6 @@
 * Creating timestamps::         Commands which insert timestamps
 * Deadlines and scheduling::    Planning your work
 * Clocking work time::          Tracking how long you spend on a task
-* Resolving idle time::         Resolving time if you've been idle
 * Effort estimates::            Planning work effort in advance
 * Relative timer::              Notes with a running timer
 * Countdown timer::             Starting a countdown timer for a task
@@ -5130,17 +5246,11 @@
 Access the agenda for the date given by the timestamp or -range at
 point (@pxref{Weekly/daily agenda}).
 @c
-@kindex S-@key{left}
-@kindex S-@key{right}
-@item S-@key{left}
-@itemx S-@key{right}
+@orgcmdkkcc{S-@key{left},S-@key{right},org-timestamp-down-day,org-timestamp-up-day}
 Change date at cursor by one day.  These key bindings conflict with
 shift-selection and related modes (@pxref{Conflicts}).
 @c
-@kindex S-@key{up}
-@kindex S-@key{down}
-@item S-@key{up}
-@itemx S-@key{down}
+@orgcmdkkcc{S-@key{up},S-@key{down},org-timestamp-up,org-timestamp-down-down}
 Change the item under the cursor in a timestamp.  The cursor can be on a
 year, month, day, hour or minute.  When the timestamp contains a time range
 like @samp{15:30-16:30}, modifying the first time will also shift the second,
@@ -5150,9 +5260,8 @@
 (@pxref{Priorities}). The key bindings also conflict with shift-selection and
 related modes (@pxref{Conflicts}).
 @c
-@kindex C-c C-y
+@orgcmd{C-c C-y,org-evaluate-time-range}
 @cindex evaluate time range
-@item C-c C-y
 Evaluate a time range by computing the difference between start and end.
 With a prefix argument, insert result after the time range (in a table: into
 the following column).
@@ -5215,7 +5324,7 @@
 single plus or minus, the date is always relative to today.  With a
 double plus or minus, it is relative to the default date.  If instead of
 a single letter, you use the abbreviation of day name, the date will be
-the nth such day.  E.g.
+the Nth such day.  E.g.
 
 @example
 +0            --> today
@@ -5234,7 +5343,7 @@
 the variables @code{parse-time-months} and @code{parse-time-weekdays}.
 
 You can specify a time range by giving start and end times or by giving a
-start time and a duration (in HH:MM format). Use '-' or '--' as the separator
+start time and a duration (in HH:MM format). Use `-' or `-@{@}-' as the separator
 in the former case and use '+' as the separator in the latter case. E.g.
 
 @example
@@ -5298,8 +5407,7 @@
 @code{org-time-stamp-custom-formats}.
 
 @table @kbd
-@kindex C-c C-x C-t
-@item C-c C-x C-t
+@orgcmd{C-c C-x C-t,org-toggle-time-stamp-overlays}
 Toggle the display of custom formats for dates and times.
 @end table
 
@@ -5320,7 +5428,7 @@
 time will be changed by one minute.
 @item
 If the timestamp contains a range of clock times or a repeater, these
-will not be overlayed, but remain in the buffer as they were.
+will not be overlaid, but remain in the buffer as they were.
 @item
 When you delete a timestamp character-by-character, it will only
 disappear from the buffer after @emph{all} (invisible) characters
@@ -5372,8 +5480,8 @@
 be listed on that date after it has been marked DONE.  If you don't like
 this, set the variable @code{org-agenda-skip-scheduled-if-done}.}.  In
 addition, a reminder that the scheduled date has passed will be present
-in the compilation for @emph{today}, until the entry is marked DONE.
-I.e. the task will automatically be forwarded until completed.
+in the compilation for @emph{today}, until the entry is marked DONE, i.e.
+the task will automatically be forwarded until completed.
 
 @example
 *** TODO Call Trillian for a date on New Years Eve.
@@ -5415,8 +5523,7 @@
 
 @table @kbd
 @c
-@kindex C-c C-d
-@item C-c C-d
+@orgcmd{C-c C-d,org-deadline}
 Insert @samp{DEADLINE} keyword along with a stamp.  The insertion will happen
 in the line directly following the headline.  When called with a prefix arg,
 an existing deadline will be removed from the entry.  Depending on the
@@ -5426,8 +5533,7 @@
 deadline.
 @c FIXME Any CLOSED timestamp will be removed.????????
 @c
-@kindex C-c C-s
-@item C-c C-s
+@orgcmd{C-c C-s,org-schedule}
 Insert @samp{SCHEDULED} keyword along with a stamp.  The insertion will
 happen in the line directly following the headline.  Any CLOSED timestamp
 will be removed.  When called with a prefix argument, remove the scheduling
@@ -5437,18 +5543,16 @@
 @code{nologredeadline}}, a note will be taken when changing an existing
 scheduling time.
 @c
-@kindex C-c C-x C-k
+@orgcmd{C-c C-x C-k,org-mark-entry-for-agenda-action}
 @kindex k a
 @kindex k s
-@item C-c C-x C-k
 Mark the current entry for agenda action.  After you have marked the entry
 like this, you can open the agenda or the calendar to find an appropriate
 date.  With the cursor on the selected date, press @kbd{k s} or @kbd{k d} to
 schedule the marked item.
 @c
-@kindex C-c / d
+@orgcmd{C-c / d,org-check-deadlines}
 @cindex sparse tree, for deadlines
-@item C-c / d
 @vindex org-deadline-warning-days
 Create a sparse tree with all deadlines that are either past-due, or
 which will become due within @code{org-deadline-warning-days}.
@@ -5456,12 +5560,10 @@
 prefix, check that many days.  For example, @kbd{C-1 C-c / d} shows
 all deadlines due tomorrow.
 @c
-@kindex C-c / b
-@item C-c / b
+@orgcmd{C-c / b,org-check-before-date}
 Sparse tree for deadlines and scheduled items before a given date.
 @c
-@kindex C-c / a
-@item C-c / a
+@orgcmd{C-c / a,org-check-after-date}
 Sparse tree for deadlines and scheduled items after a given date.
 @end table
 
@@ -5520,11 +5622,11 @@
 month.  So if you have not paid the rent for three months, marking this
 entry DONE will still keep it as an overdue deadline.  Depending on the
 task, this may not be the best way to handle it.  For example, if you
-forgot to call you father for 3 weeks, it does not make sense to call
+forgot to call your father for 3 weeks, it does not make sense to call
 him 3 times in a single day to make up for it.  Finally, there are tasks
 like changing batteries which should always repeat a certain time
 @i{after} the last time you did it.  For these tasks, Org-mode has
-special repeaters markers with @samp{++} and @samp{.+}.  For example:
+special repeaters  @samp{++} and @samp{.+}.  For example:
 
 @example
 ** TODO Call Father
@@ -5547,8 +5649,10 @@
 created for this purpose, it is described in @ref{Structure editing}.
 
 
-@node Clocking work time, Resolving idle time, Deadlines and scheduling, Dates and Times
+@node Clocking work time, Effort estimates, Deadlines and scheduling, Dates and Times
 @section Clocking work time
+@cindex clocking time
+@cindex time clocking
 
 Org-mode allows you to clock the time you spend on specific tasks in a
 project.  When you start working on an item, you can start the clock.
@@ -5569,9 +5673,17 @@
 will be found (@pxref{Resolving idle time}) and you will be prompted about
 what to do with it.
 
-@table @kbd
-@kindex C-c C-x C-i
-@item C-c C-x C-i
+@menu
+* Clocking commands::           Starting and stopping a clock
+* The clock table::             Detailed reports
+* Resolving idle time::         Resolving time when you've been idle
+@end menu
+
+@node Clocking commands, The clock table, Clocking work time, Clocking work time
+@subsection Clocking commands
+
+@table @kbd
+@orgcmd{C-c C-x C-i,org-clock-in}
 @vindex org-clock-into-drawer
 Start the clock on the current item (clock-in).  This inserts the CLOCK
 keyword together with a timestamp.  If this is not the first clocking of
@@ -5601,8 +5713,8 @@
 @code{auto} which is the default@footnote{See also the variable
 @code{org-clock-modeline-total}.}.@* Clicking with @kbd{mouse-1} onto the
 mode line entry will pop up a menu with clocking options.
-@kindex C-c C-x C-o
-@item C-c C-x C-o
+@c
+@orgcmd{C-c C-x C-o,org-clock-out}
 @vindex org-log-note-clock-out
 Stop the clock (clock-out).  This inserts another timestamp at the same
 location where the clock was last started.  It also directly computes
@@ -5611,29 +5723,24 @@
 possibility to record an additional note together with the clock-out
 timestamp@footnote{The corresponding in-buffer setting is:
 @code{#+STARTUP: lognoteclock-out}}.
-@kindex C-c C-x C-e
-@item C-c C-x C-e
+@orgcmd{C-c C-x C-e,org-clock-modify-effort-estimate}
 Update the effort estimate for the current clock task.
 @kindex C-c C-y
 @kindex C-c C-c
-@item C-c C-y @ @ @r{or}@ @ C-c C-c
+@orgcmdkkc{C-c C-c,C-c C-y,org-evaluate-time-range}
 Recompute the time interval after changing one of the timestamps.  This
 is only necessary if you edit the timestamps directly.  If you change
 them with @kbd{S-@key{cursor}} keys, the update is automatic.
-@kindex C-c C-t
-@item C-c C-t
+@orgcmd{C-c C-t,org-todo}
 Changing the TODO state of an item to DONE automatically stops the clock
 if it is running in this same item.
-@kindex C-c C-x C-x
-@item C-c C-x C-x
+@orgcmd{C-c C-x C-x,org-clock-cancel}
 Cancel the current clock.  This is useful if a clock was started by
 mistake, or if you ended up working on something else.
-@kindex C-c C-x C-j
-@item C-c C-x C-j
+@orgcmd{C-c C-x C-j,org-clock-goto}
 Jump to the headline of the currently clocked in task.  With a @kbd{C-u}
 prefix arg, select the target task from a list of recently clocked tasks.
-@kindex C-c C-x C-d
-@item C-c C-x C-d
+@orgcmd{C-c C-x C-d,org-clock-display}
 @vindex org-remove-highlights-with-change
 Display time summaries for each subtree in the current buffer.  This
 puts overlays at the end of each headline, showing the total time
@@ -5641,24 +5748,60 @@
 can use visibility cycling to study the tree, but the overlays disappear
 when you change the buffer (see variable
 @code{org-remove-highlights-with-change}) or press @kbd{C-c C-c}.
-@kindex C-c C-x C-r
-@item C-c C-x C-r
+@end table
+
+The @kbd{l} key may be used in the timeline (@pxref{Timeline}) and in
+the agenda (@pxref{Weekly/daily agenda}) to show which tasks have been
+worked on or closed during a day.
+
+@node The clock table, Resolving idle time, Clocking commands, Clocking work time
+@subsection The clock table
+@cindex clocktable, dynamic block
+@cindex report, of clocked time
+
+Org mode can produce quite complex reports based on the time clocking
+information.  Such a report is called a @emph{clock table}, because it is
+formatted as one or several Org tables.
+
+@table @kbd
+@orgcmd{C-c C-x C-r,org-clock-report}
 Insert a dynamic block (@pxref{Dynamic blocks}) containing a clock
 report as an Org-mode table into the current file.  When the cursor is
 at an existing clock table, just update it.  When called with a prefix
 argument, jump to the first clock report in the current document and
 update it.
+@orgcmdkkc{C-c C-c,C-c C-x C-u,org-dblock-update}
+Update dynamic block at point.  The cursor needs to be in the
+@code{#+BEGIN} line of the dynamic block.
+@orgkey{C-u C-c C-x C-u}
+Update all dynamic blocks (@pxref{Dynamic blocks}).  This is useful if
+you have several clock table blocks in a buffer.
+@orgcmdkxkc{S-@key{left},S-@key{right},org-clocktable-try-shift}
+Shift the current @code{:block} interval and update the table.  The cursor
+needs to be in the @code{#+BEGIN: clocktable} line for this command.  If
+@code{:block} is @code{today}, it will be shifted to @code{today-1} etc.
+@end table
+
+
+Here is an example of the frame for a clock table as it is inserted into the
+buffer with the @kbd{C-c C-x C-r} command:
+
 @cindex #+BEGIN, clocktable
 @example
 #+BEGIN: clocktable :maxlevel 2 :emphasize nil :scope file
 #+END: clocktable
 @end example
 @noindent
-If such a block already exists at point, its content is replaced by the
-new table.  The @samp{BEGIN} line can specify options:
+@vindex org-clocktable-defaults
+The @samp{BEGIN} line and specify a number of options to define the scope,
+structure, and formatting of the report.  Defaults for all these options can
+be configured in the variable @code{org-clocktable-defaults}.
+
+@noindent First there are options that determine which clock entries are to
+be selected:
 @example
 :maxlevel    @r{Maximum level depth to which times are listed in the table.}
-:emphasize   @r{When @code{t}, emphasize level one and level two items.}
+             @r{Clocks at deeper levels will be summed into the upper level.}
 :scope       @r{The scope to consider.  This can be any of the following:}
              nil        @r{the current buffer or narrowed region}
              file       @r{the full current buffer}
@@ -5675,6 +5818,7 @@
              2007-12-31    @r{New year eve 2007}
              2007-12       @r{December 2007}
              2007-W50      @r{ISO-week 50 in 2007}
+             2007-Q2       @r{2nd quarter in 2007}
              2007          @r{the year 2007}
              today, yesterday, today-@var{N}          @r{a relative day}
              thisweek, lastweek, thisweek-@var{N}     @r{a relative week}
@@ -5685,15 +5829,33 @@
 :tend        @r{A time string specifying when to stop considering times.}
 :step        @r{@code{week} or @code{day}, to split the table into chunks.}
              @r{To use this, @code{:block} or @code{:tstart}, @code{:tend} are needed.}
-:stepskip0   @r{Don't show steps that have zero time}
-:tags        @r{A tags match to select entries that should contribute}
+:stepskip0   @r{Do not show steps that have zero time.}
+:fileskip0   @r{Do not show table sections from files which did not contribute.}
+:tags        @r{A tags match to select entries that should contribute}.
+@end example
+
+Then there are options which determine the formatting of the table.  There
+options are interpreted by the function @code{org-clocktable-write-default},
+but you can specify your own function using the @code{:formatter} parameter.
+@example
+:emphasize   @r{When @code{t}, emphasize level one and level two items.}
 :link        @r{Link the item headlines in the table to their origins.}
+:narrow      @r{An integer to limit the width of the headline column in}
+             @r{the org table.  If you write it like @samp{50!}, then the}
+             @r{headline will also be shortened in export.}
+:indent      @r{Indent each headline field according to its level.}
+:tcolumns    @r{Number of columns to be used for times.  If this is smaller}
+             @r{than @code{:maxlevel}, lower levels will be lumped into one column.}
+:level       @r{Should a level number column be included?}
+:compact     @r{Abbreviation for @code{:level nil :indent t :narrow 40! :tcolumns 1}}
+             @r{All are overwritten except if there is an explicit @code{:narrow}}
+:timestamp   @r{A timestamp for the entry, when available.  Look for SCHEDULED,}
+             @r{DEADLINE, TIMESTAMP and TIMESTAMP_IA, in this order.}
 :formula     @r{Content of a @code{#+TBLFM} line to be added and evaluated.}
              @r{As a special case, @samp{:formula %} adds a column with % time.}
-             @r{If you do not specify a formula here, any existing formula.}
+             @r{If you do not specify a formula here, any existing formula}
              @r{below the clock table will survive updates and be evaluated.}
-:timestamp   @r{A timestamp for the entry, when available.  Look for SCHEDULED,}
-             @r{DEADLINE, TIMESTAMP and TIMESTAMP_IA, in this order.}
+:formatter   @r{A function to format clock data and insert it into the buffer.}
 @end example
 To get a clock summary of the current level 1 tree, for the current
 day, you could write
@@ -5715,31 +5877,15 @@
 #+BEGIN: clocktable :scope subtree :link t :formula %
 #+END: clocktable
 @end example
-@kindex C-c C-c
-@item C-c C-c
-@kindex C-c C-x C-u
-@itemx C-c C-x C-u
-Update dynamic block at point.  The cursor needs to be in the
-@code{#+BEGIN} line of the dynamic block.
-@kindex C-u C-c C-x C-u
-@item C-u C-c C-x C-u
-Update all dynamic blocks (@pxref{Dynamic blocks}).  This is useful if
-you have several clock table blocks in a buffer.
-@kindex S-@key{left}
-@kindex S-@key{right}
-@item S-@key{left}
-@itemx S-@key{right}
-Shift the current @code{:block} interval and update the table.  The cursor
-needs to be in the @code{#+BEGIN: clocktable} line for this command.  If
-@code{:block} is @code{today}, it will be shifted to @code{today-1} etc.
-@end table
-
-The @kbd{l} key may be used in the timeline (@pxref{Timeline}) and in
-the agenda (@pxref{Weekly/daily agenda}) to show which tasks have been
-worked on or closed during a day.
-
-@node Resolving idle time, Effort estimates, Clocking work time, Dates and Times
-@section Resolving idle time
+A horizontally compact representation of everything clocked during last week
+would be
+@example
+#+BEGIN: clocktable :scope agenda :block lastweek :compact t
+#+END: clocktable
+@end example
+
+@node Resolving idle time,  , The clock table, Clocking work time
+@subsection Resolving idle time
 @cindex resolve idle time
 
 @cindex idle, resolve, dangling
@@ -5800,13 +5946,13 @@
 dangling clock which was never clocked out from your last session.  Using
 that clock's starting time as the beginning of the unaccounted-for period,
 Org will ask how you want to resolve that time.  The logic and behavior is
-identical to dealing with away time due to idleness, it's just happening due
+identical to dealing with away time due to idleness; it's just happening due
 to a recovery event rather than a set amount of idle time.
 
 You can also check all the files visited by your Org agenda for dangling
 clocks at any time using @kbd{M-x org-resolve-clocks}.
 
-@node Effort estimates, Relative timer, Resolving idle time, Dates and Times
+@node Effort estimates, Relative timer, Clocking work time, Dates and Times
 @section Effort estimates
 @cindex effort estimates
 
@@ -5822,13 +5968,11 @@
 for an entry with the following commands:
 
 @table @kbd
-@kindex C-c C-x e
-@item C-c C-x e
+@orgcmd{C-c C-x e,org-set-effort}
 Set the effort estimate for the current entry.  With a numeric prefix
-argument, set it to the NTH allowed value (see below).  This command is also
+argument, set it to the Nth allowed value (see below).  This command is also
 accessible from the agenda with the @kbd{e} key.
-@kindex C-c C-x C-e
-@item C-c C-x C-e
+@orgcmd{C-c C-x C-e,org-clock-modify-effort-estimate}
 Modify the effort estimate of the item currently being clocked.
 @end table
 
@@ -5880,29 +6024,27 @@
 such a relative timer and make it easy to create timed notes.
 
 @table @kbd
-@kindex C-c C-x .
-@item C-c C-x .
+@orgcmd{C-c C-x .,org-timer}
 Insert a relative time into the buffer.  The first time you use this, the
 timer will be started.  When called with a prefix argument, the timer is
 restarted.
-@kindex C-c C-x -
-@item C-c C-x -
+@orgcmd{C-c C-x -,org-timer-item}
 Insert a description list item with the current relative time.  With a prefix
 argument, first reset the timer to 0.
-@kindex M-@key{RET}
-@item M-@key{RET}
+@orgcmd{M-@key{RET},org-insert-heading}
 Once the timer list is started, you can also use @kbd{M-@key{RET}} to insert
 new timer items.
+@c for key sequences with a comma, command name macros fail :(
 @kindex C-c C-x ,
 @item C-c C-x ,
-Pause the timer, or continue it if it is already paused.
+Pause the timer, or continue it if it is already paused
+(@command{org-timer-pause-or-continue}).
 @c removed the sentence because it is redundant to the following item
 @kindex C-u C-c C-x ,
 @item C-u C-c C-x ,
 Stop the timer.  After this, you can only start a new timer, not continue the
 old one.  This command also removes the timer from the mode line.
-@kindex C-c C-x 0
-@item C-c C-x 0
+@orgcmd{C-c C-x 0,org-timer-start}
 Reset the timer without inserting anything into the buffer.  By default, the
 timer is reset to 0.  When called with a @kbd{C-u} prefix, reset the timer to
 specific starting offset.  The user is prompted for the offset, with a
@@ -5994,31 +6136,31 @@
 @subsection Using capture
 
 @table @kbd
-@kindex C-c c
-@item C-c c
-Call the command @code{org-capture}.  If you have templates defined
-@pxref{Capture templates}, it will offer these templates for selection or use
-a new Org outline node as the default template.  It will insert the template
-into the target file and switch to an indirect buffer narrowed to this new
-node.  You may then insert the information you want.
-
-@kindex C-c C-c
-@item C-c C-c
-Once you have finished entering information into the capture buffer, 
-@kbd{C-c C-c} will return you to the window configuration before the capture
-process, so that you can resume your work without further distraction.
-
-@kindex C-c C-w
-@item C-c C-w
+@orgcmd{C-c c,org-capture}
+Call the command @code{org-capture}.  Note that this keybinding is global and
+not active by default - you need to install it.  If you have templates
+defined @pxref{Capture templates}, it will offer these templates for
+selection or use a new Org outline node as the default template.  It will
+insert the template into the target file and switch to an indirect buffer
+narrowed to this new node.  You may then insert the information you want.
+
+@orgcmd{C-c C-c,org-capture-finalize}
+Once you have finished entering information into the capture buffer, @kbd{C-c
+C-c} will return you to the window configuration before the capture process,
+so that you can resume your work without further distraction.  When called
+with a prefix arg, finalize and then jump to the captured item.
+
+@orgcmd{C-c C-w,org-capture-refile}
 Finalize the capture process by refiling (@pxref{Refiling notes}) the note to
 a different place.  Please realize that this is a normal refiling command
-that will be executed - so the cursor position at the moment you run this
+that will be executed---so the cursor position at the moment you run this
 command is important.  If you have inserted a tree with a parent and
-children, first move the cursor back to the parent.
-
-@kindex C-c C-k
-@item C-c C-k
+children, first move the cursor back to the parent.  Any prefix argument
+given to this command will be passed on to the @code{org-refile} command.
+
+@orgcmd{C-c C-k,org-capture-kill}
 Abort the capture process and return to the previous state.
+
 @end table
 
 You can also call @code{org-capture} in a special way from the agenda, using
@@ -6026,6 +6168,17 @@
 the selected capture template will default to the cursor date in the agenda,
 rather than to the current date.
 
+To find the locations of the last stored capture, use @code{org-capture} with
+prefix commands:
+
+@table @kbd
+@orgkey{C-u C-c c}
+Visit the target location of a cpature template.  You get to select the
+template in the usual way.
+@orgkey{C-u C-u C-c c}
+Visit the last stored capture item in its buffer.
+@end table
+
 @node Capture templates,  , Using capture, Capture
 @subsection Capture templates
 @cindex templates, for Capture
@@ -6035,8 +6188,7 @@
 through the customize interface.
 
 @table @kbd
-@kindex C-c c C
-@item C-c c C
+@orgkey{C-c c C}
 Customize the variable @code{org-capture-templates}.
 @end table
 
@@ -6124,7 +6276,7 @@
 @vindex org-default-notes-file
 Specification of where the captured item should be placed.  In Org-mode
 files, targets usually define a node.  Entries will become children of this
-node, other types will be added to the table or list in the body of this
+node.  Other types will be added to the table or list in the body of this
 node.  Most target specifications contain a file name.  If that file name is
 the empty string, it defaults to @code{org-default-notes-file}.
 
@@ -6146,7 +6298,10 @@
 Use a regular expression to position the cursor.
 
 @item (file+datetree "path/to/file")
-Will create a heading in a date tree.
+Will create a heading in a date tree for today's date.
+
+@item (file+datetree+prompt "path/to/file")
+Will create a heading in a date tree, but will prompt for the date.
 
 @item (file+function "path/to/file" function-finding-location)
 A function to find the right location in the file.
@@ -6302,15 +6457,13 @@
 
 @table @kbd
 
-@kindex C-c C-a
-@item C-c C-a
+@orgcmd{C-c C-a,org-attach}
 The dispatcher for commands related to the attachment system.  After these
 keys, a list of commands is displayed and you must press an additional key
 to select a command:
 
 @table @kbd
-@kindex C-c C-a a
-@item a
+@orgcmdtkc{a,C-c C-a a,org-attach-attach}
 @vindex org-attach-method
 Select a file and move it into the task's attachment directory.  The file
 will be copied, moved, or linked, depending on @code{org-attach-method}.
@@ -6323,52 +6476,42 @@
 Attach a file using the copy/move/link method.
 Note that hard links are not supported on all systems.
 
-@kindex C-c C-a n
-@item n
+@orgcmdtkc{n,C-c C-a n,org-attach-new}
 Create a new attachment as an Emacs buffer.
 
-@kindex C-c C-a z
-@item z
+@orgcmdtkc{z,C-c C-a z,org-attach-sync}
 Synchronize the current task with its attachment directory, in case you added
 attachments yourself.
 
-@kindex C-c C-a o
-@item o
+@orgcmdtkc{p,C-c C-a o,org-attach-open}
 @vindex org-file-apps
 Open current task's attachment.  If there is more than one, prompt for a
 file name first.  Opening will follow the rules set by @code{org-file-apps}.
 For more details, see the information on following hyperlinks
 (@pxref{Handling links}).
 
-@kindex C-c C-a O
-@item O
+@orgcmdtkc{O,C-c C-a O,org-attach-open-in-emacs}
 Also open the attachment, but force opening the file in Emacs.
 
-@kindex C-c C-a f
-@item f
+@orgcmdtkc{f,C-c C-a f,org-attach-reveal}
 Open the current task's attachment directory.
 
-@kindex C-c C-a F
-@item F
+@orgcmdtkc{F,C-c C-a F,org-attach-reveal-in-emacs}
 Also open the directory, but force using @command{dired} in Emacs.
 
-@kindex C-c C-a d
-@item d
+@orgcmdtkc{d,C-c C-a d,org-attach-delete-one}
 Select and delete a single attachment.
 
-@kindex C-c C-a D
-@item D
+@orgcmdtkc{D,C-c C-a D,org-attach-delete-all}
 Delete all of a task's attachments.  A safer way is to open the directory in
 @command{dired} and delete from there.
 
-@kindex C-c C-a s
-@item C-c C-a s
+@orgcmdtkc{s,C-c C-a s,org-attach-set-directory}
 @cindex property, ATTACH_DIR
 Set a specific directory as the entry's attachment directory.  This works by
 putting the directory path into the @code{ATTACH_DIR} property.
 
-@kindex C-c C-a i
-@item C-c C-a i
+@orgcmdtkc{i,C-c C-a i,org-attach-set-inherit}
 @cindex property, ATTACH_DIR_INHERIT
 Set the @code{ATTACH_DIR_INHERIT} property, so that children will use the
 same directory for attachments as the parent does.
@@ -6401,12 +6544,11 @@
 the following command is used:
 
 @table @kbd
-@kindex C-c C-x g
+@orgcmd{C-c C-x g,org-feed-update-all}
 @item C-c C-x g
 Collect items from the feeds configured in @code{org-feed-alist} and act upon
 them.
-@kindex C-c C-x G
-@item C-c C-x G
+@orgcmd{C-c C-x G,org-feed-goto-inbox}
 Prompt for a feed name and go to the inbox configured for this feed.
 @end table
 
@@ -6446,8 +6588,7 @@
 process, you can use the following special command:
 
 @table @kbd
-@kindex C-c C-w
-@item C-c C-w
+@orgcmd{C-c C-w,org-refile}
 @vindex org-reverse-note-order
 @vindex org-refile-targets
 @vindex org-refile-use-outline-path
@@ -6472,17 +6613,18 @@
 @code{#+STARTUP} keywords @code{logrefile}, @code{lognoterefile},
 and @code{nologrefile}} is set, a time stamp or a note will be
 recorded when an entry has been refiled.
-@kindex C-u C-c C-w
-@item C-u C-c C-w
+@orgkey{C-u C-c C-w}
 Use the refile interface to jump to a heading.
-@kindex C-u C-u C-c C-w
-@item C-u C-u C-c C-w
+@orgcmd{C-u C-u C-c C-w,org-refile-goto-last-stored}
 Jump to the location where @code{org-refile} last moved a tree to.
 @item C-2 C-c C-w
 Refile as the child of the item currently being clocked.
 @item C-0 C-c C-w @ @r{or} @ C-u C-u C-u C-c C-w
+
+@orgcmdtkc{C-0 C-c C-w @ @r{or} @ C-u C-u C-u C-c C-w,C-0 C-c C-w,org-refile-cache-clear}
+
 Clear the target cache.  Caching of refile targets can be turned on by
-setting @code{org-refile-use-cache}.  To make the command seen new possible
+setting @code{org-refile-use-cache}.  To make the command see new possible
 targets, you have to clear the cache with this command.
 @end table
 
@@ -6496,8 +6638,7 @@
 searches like the construction of agenda views fast.
 
 @table @kbd
-@kindex C-c C-x C-a
-@item C-c C-x C-a
+@orgcmd{C-c C-x C-a,org-archive-subtree-default}
 @vindex org-archive-default-command
 Archive the current entry using the command specified in the variable
 @code{org-archive-default-command}.
@@ -6516,14 +6657,11 @@
 the archive file.
 
 @table @kbd
-@kindex C-c $
-@kindex C-c C-x C-s
-@item C-c C-x C-s@ @r{or short} @ C-c $
+@orgcmdkskc{C-c C-x C-s,C-c $,org-archive-subtree}
 @vindex org-archive-location
 Archive the subtree starting at the cursor position to the location
 given by @code{org-archive-location}.
-@kindex C-u C-c C-x C-s
-@item C-u C-c C-x C-s
+@orgkey{C-u C-c C-x C-s}
 Check if any direct children of the current headline could be moved to
 the archive.  To do this, each subtree is checked for open TODO entries.
 If none are found, the command offers to move it to the archive
@@ -6606,23 +6744,19 @@
 The following commands help manage the ARCHIVE tag:
 
 @table @kbd
-@kindex C-c C-x a
-@item C-c C-x a
+@orgcmd{C-c C-x a,org-toggle-archive-tag}
 Toggle the ARCHIVE tag for the current headline.  When the tag is set,
 the headline changes to a shadowed face, and the subtree below it is
 hidden.
-@kindex C-u C-c C-x a
-@item C-u C-c C-x a
+@orgkey{C-u C-c C-x a}
 Check if any direct children of the current headline should be archived.
 To do this, each subtree is checked for open TODO entries.  If none are
 found, the command offers to set the ARCHIVE tag for the child.  If the
 cursor is @emph{not} on a headline when this command is invoked, the
 level 1 trees will be checked.
-@kindex C-@kbd{TAB}
-@item C-@kbd{TAB}
+@orgcmd{C-@kbd{TAB},org-force-cycle-archived}
 Cycle a tree even if it is tagged with ARCHIVE.
-@kindex C-c C-x A
-@item C-c C-x A
+@orgcmd{C-c C-x A,org-archive-to-archive-sibling}
 Move the current entry to the @emph{Archive Sibling}.  This is a sibling of
 the entry with the heading @samp{Archive} and the tag @samp{ARCHIVE}.  The
 entry becomes a child of that sibling and in this way retains a lot of its
@@ -6715,18 +6849,15 @@
 
 @cindex files, adding to agenda list
 @table @kbd
-@kindex C-c [
-@item C-c [
+@orgcmd{C-c [,org-agenda-to-front}
 Add current file to the list of agenda files.  The file is added to
 the front of the list.  If it was already in the list, it is moved to
 the front.  With a prefix argument, file is added/moved to the end.
-@kindex C-c ]
-@item C-c ]
+@orgcmd{C-c ],org-remove-file}
 Remove current file from the list of agenda files.
 @kindex C-,
-@kindex C-'
-@item C-,
-@itemx C-'
+@orgcmd{C-',org-cycle-agenda-files}
+@itemx C-,
 Cycle through agenda file list, visiting one file after the other.
 @kindex M-x org-iswitchb
 @item M-x org-iswitchb
@@ -6746,16 +6877,14 @@
 extended period, use the following commands:
 
 @table @kbd
-@kindex C-c C-x <
-@item C-c C-x <
+@orgcmd{C-c C-x <,org-agenda-set-restriction-lock}
 Permanently restrict the agenda to the current subtree.  When with a
 prefix argument, or with the cursor before the first headline in a file,
 the agenda scope is set to the entire file.  This restriction remains in
 effect until removed with @kbd{C-c C-x >}, or by typing either @kbd{<}
 or @kbd{>} in the agenda dispatcher.  If there is a window displaying an
 agenda view, the new restriction takes effect immediately.
-@kindex C-c C-x >
-@item C-c C-x >
+@orgcmd{C-c C-x >,org-agenda-remove-restriction-lock}
 Remove the permanent restriction created by @kbd{C-c C-x <}.
 @end table
 
@@ -6763,14 +6892,12 @@
 When working with @file{speedbar.el}, you can use the following commands in
 the Speedbar frame:
 @table @kbd
-@kindex <
-@item < @r{in the speedbar frame}
+@orgcmdtkc{< @r{in the speedbar frame},<,org-speedbar-set-agenda-restriction}
 Permanently restrict the agenda to the item---either an Org file or a subtree
 in such a file---at the cursor in the Speedbar frame.
 If there is a window displaying an agenda view, the new restriction takes
 effect immediately.
-@kindex >
-@item > @r{in the speedbar frame}
+@orgcmdtkc{> @r{in the speedbar frame},>,org-agenda-remove-restriction-lock}
 Lift the restriction.
 @end table
 
@@ -6850,17 +6977,22 @@
 
 @table @kbd
 @cindex org-agenda, command
-@kindex C-c a a
-@item C-c a a
-@vindex org-agenda-ndays
+@orgcmd{C-c a a,org-agenda-list}
 Compile an agenda for the current week from a list of Org files.  The agenda
 shows the entries for each day.  With a numeric prefix@footnote{For backward
 compatibility, the universal prefix @kbd{C-u} causes all TODO entries to be
 listed before the agenda.  This feature is deprecated, use the dedicated TODO
 list, or a block agenda instead (@pxref{Block agenda}).}  (like @kbd{C-u 2 1
-C-c a a}) you may set the number of days to be displayed (see also the
-variable @code{org-agenda-ndays})
-@end table
+C-c a a}) you may set the number of days to be displayed.
+@end table
+
+@vindex org-agenda-span
+@vindex org-agenda-ndays
+The default number of days displayed in the agenda is set by the variable
+@code{org-agenda-span} (or the obsolete @code{org-agenda-ndays}).  This
+variable can be set to any number of days you want to see by default in the
+agenda, or to a span name, such a @code{day}, @code{week}, @code{month} or
+@code{year}.
 
 Remote editing from the agenda buffer means, for example, that you can
 change the dates of deadlines and appointments from the agenda buffer.
@@ -6972,22 +7104,20 @@
 collected into a single place.
 
 @table @kbd
-@kindex C-c a t
-@item C-c a t
+@orgcmd{C-c a t,org-todo-list}
 Show the global TODO list.  This collects the TODO items from all agenda
 files (@pxref{Agenda Views}) into a single buffer.  By default, this lists
 items with a state the is not a DONE state.  The buffer is in
 @code{agenda-mode}, so there are commands to examine and manipulate the TODO
 entries directly from that buffer (@pxref{Agenda commands}).
-@kindex C-c a T
-@item C-c a T
+@orgcmd{C-c a T,org-todo-list}
 @cindex TODO keyword matching
 @vindex org-todo-keywords
 Like the above, but allows selection of a specific TODO keyword.  You can
 also do this by specifying a prefix argument to @kbd{C-c a t}.  You are
 prompted for a keyword, and you may also specify several keywords by
 separating them with @samp{|} as the boolean OR operator.  With a numeric
-prefix, the nth keyword in @code{org-todo-keywords} is selected.
+prefix, the Nth keyword in @code{org-todo-keywords} is selected.
 @kindex r
 The @kbd{r} key in the agenda buffer regenerates it, and you can give
 a prefix argument to this command to change the selected TODO keyword,
@@ -7009,13 +7139,15 @@
 @item
 @vindex org-agenda-todo-ignore-scheduled
 @vindex org-agenda-todo-ignore-deadlines
+@vindex org-agenda-todo-ignore-timestamp
 @vindex org-agenda-todo-ignore-with-date
 Some people view a TODO item that has been @emph{scheduled} for execution or
 have a @emph{deadline} (@pxref{Timestamps}) as no longer @emph{open}.
 Configure the variables @code{org-agenda-todo-ignore-scheduled},
-@code{org-agenda-todo-ignore-deadlines}, and/or
-@code{org-agenda-todo-ignore-with-date} to exclude such items from the
-global TODO list.
+@code{org-agenda-todo-ignore-deadlines},
+@code{org-agenda-todo-ignore-timestamp} and/or
+@code{org-agenda-todo-ignore-with-date} to exclude such items from the global
+TODO list.
 @item
 @vindex org-agenda-todo-list-sublevels
 TODO items may have sublevels to break up the task into subtasks.  In
@@ -7038,15 +7170,13 @@
 m}.
 
 @table @kbd
-@kindex C-c a m
-@item C-c a m
+@orgcmd{C-c a m,org-tags-view}
 Produce a list of all headlines that match a given set of tags.  The
 command prompts for a selection criterion, which is a boolean logic
 expression with tags, like @samp{+work+urgent-withboss} or
 @samp{work|home} (@pxref{Tags}).  If you often need a specific search,
 define a custom command for it (@pxref{Agenda dispatcher}).
-@kindex C-c a M
-@item C-c a M
+@orgcmd{C-c a M,org-tags-view}
 @vindex org-tags-match-list-sublevels
 @vindex org-agenda-tags-todo-honor-ignore-options
 Like @kbd{C-c a m}, but only select headlines that are also TODO items in a
@@ -7197,8 +7327,7 @@
 to give an overview over events in a project.
 
 @table @kbd
-@kindex C-c a L
-@item C-c a L
+@orgcmd{C-c a L,org-timeline}
 Show a time-sorted view of the Org file, with all time-stamped items.
 When called with a @kbd{C-u} prefix, all unfinished TODO entries
 (scheduled or not) are also listed under the current date.
@@ -7218,8 +7347,7 @@
 It is particularly useful to find notes.
 
 @table @kbd
-@kindex C-c a s
-@item C-c a s
+@orgcmd{C-c a s,org-search-view}
 This is a special search that lets you select entries by matching a substring
 or specific words using a boolean logic.
 @end table
@@ -7250,8 +7378,7 @@
 projects and define next actions for them.
 
 @table @kbd
-@kindex C-c a #
-@item C-c a #
+@orgcmd{C-c a #,org-agenda-list-stuck-projects}
 List projects that are stuck.
 @kindex C-c a !
 @item C-c a !
@@ -7336,6 +7463,10 @@
 The display in the agenda buffer looks best if the category is not
 longer than 10 characters.
 
+@noindent
+You can set up icons for category by customizing the
+@code{org-agenda-category-icon-alist} variable.
+
 @node Time-of-day specifications, Sorting of agenda items, Categories, Presentation and sorting
 @subsection Time-of-day specifications
 @cindex time-of-day specification
@@ -7438,40 +7569,26 @@
 @table @kbd
 @tsubheading{Motion}
 @cindex motion commands in agenda
-@kindex n
-@item n
+@orgcmd{n,org-agenda-next-line}
 Next line (same as @key{up} and @kbd{C-p}).
-@kindex p
-@item p
+@orgcmd{p,org-agenda-previous-line}
 Previous line (same as @key{down} and @kbd{C-n}).
 @tsubheading{View/Go to Org file}
-@kindex mouse-3
-@kindex @key{SPC}
-@item mouse-3
-@itemx @key{SPC}
+@orgcmdkkc{@key{SPC},mouse-3,org-agenda-show-and-scroll-up}
 Display the original location of the item in another window.
 With prefix arg, make sure that the entire entry is made visible in the
 outline, not only the heading.
 @c
-@kindex L
-@item L
+@orgcmd{L,org-agenda-recenter}
 Display original location and recenter that window.
 @c
-@kindex mouse-2
-@kindex mouse-1
-@kindex @key{TAB}
-@item mouse-2
-@itemx mouse-1
-@itemx @key{TAB}
-Go to the original location of the item in another window.  Under Emacs
-22, @kbd{mouse-1} will also works for this.
-@c
-@kindex @key{RET}
-@itemx @key{RET}
+@orgcmdkkc{@key{TAB},mouse-2,org-agenda-goto}
+Go to the original location of the item in another window.
+@c
+@orgcmd{@key{RET},org-agenda-switch-to}
 Go to the original location of the item and delete other windows.
 @c
-@kindex F
-@item F
+@orgcmd{F,org-agenda-follow-mode}
 @vindex org-agenda-start-with-follow-mode
 Toggle Follow mode.  In Follow mode, as you move the cursor through
 the agenda buffer, the other window always shows the corresponding
@@ -7479,15 +7596,13 @@
 agenda buffers can be set with the variable
 @code{org-agenda-start-with-follow-mode}.
 @c
-@kindex C-c C-x b
-@item C-c C-x b
+@orgcmd{C-c C-x b,org-agenda-tree-to-indirect-buffer}
 Display the entire subtree of the current item in an indirect buffer.  With a
 numeric prefix argument N, go up to level N and then take that tree.  If N is
 negative, go up that many levels.  With a @kbd{C-u} prefix, do not remove the
 previously used indirect buffer.
 
-@kindex C-c C-o
-@item C-c C-o
+@orgcmd{C-c C-o,org-agenda-open-link}
 Follow a link in the entry.  This will offer a selection of any links in the
 text belonging to the referenced Org node.  If there is only one link, it
 will be followed without a selection prompt.
@@ -7498,16 +7613,20 @@
 @item o
 Delete other windows.
 @c
-@kindex v d
-@kindex d
-@kindex v w
-@kindex w
-@kindex v m
-@kindex v y
-@item v d @ @r{or short} @ d
-@itemx v w @ @r{or short} @ w
-@itemx v m
-@itemx v y
+@c @kindex v d
+@c @kindex d
+@c @kindex v w
+@c @kindex w
+@c @kindex v m
+@c @kindex v y
+@c @item v d @ @r{or short} @ d
+@c @itemx v w @ @r{or short} @ w
+@c @itemx v m
+@c @itemx v y
+@orgcmdkskc{v d,d,org-aganda-day-view}
+@xorgcmdkskc{v w,w,org-aganda-day-view}
+@xorgcmd{v m,org-agenda-month-view}
+@xorgcmd{v y,org-agenda-month-year}
 Switch to day/week/month/year view.  When switching to day or week view,
 this setting becomes the default for subsequent agenda commands.  Since
 month and year views are slow to create, they do not become the default.
@@ -7519,37 +7638,28 @@
 2007.  If such a year specification has only one or two digits, it will
 be mapped to the interval 1938-2037.
 @c
-@kindex f
-@item f
-@vindex org-agenda-ndays
-Go forward in time to display the following @code{org-agenda-ndays} days.
+@orgcmd{f,org-agenda-later}
+Go forward in time to display the following @code{org-agenda-current-span} days.
 For example, if the display covers a week, switch to the following week.
-With prefix arg, go forward that many times @code{org-agenda-ndays} days.
-@c
-@kindex b
-@item b
+With prefix arg, go forward that many times @code{org-agenda-current-span} days.
+@c
+@orgcmd{b,org-agenda-earlier}
 Go backward in time to display earlier dates.
 @c
-@kindex .
-@item .
+@orgcmd{.,org-agenda-goto-today}
 Go to today.
 @c
-@kindex j
-@item j
+@orgcmd{j,org-agenda-goto-date}
 Prompt for a date and go there.
 @c
-@kindex J
-@item J
-Go to the currently clocked in task in the agenda buffer.
-@c
-@kindex D
-@item D
+@orgcmd{J,org-agenda-clock-goto}
+Go to the currently clocked-in task @i{in the agenda buffer}.
+@c
+@orgcmd{D,org-agenda-toggle-diary}
 Toggle the inclusion of diary entries.  See @ref{Weekly/daily agenda}.
 @c
-@kindex v l
+@orgcmdkskc{v l,l,org-agenda-log-mode}
 @kindex v L
-@kindex l
-@item v l @ @r{or short} @ l
 @vindex org-log-done
 @vindex org-agenda-log-mode-items
 Toggle Logbook mode.  In Logbook mode, entries that were marked DONE while
@@ -7561,34 +7671,29 @@
 prefix args @kbd{C-u C-u}, show only logging information, nothing else.
 @kbd{v L} is equivalent to @kbd{C-u v l}.
 @c
-@kindex v [
-@kindex [
-@item v [ @ @r{or short} @ [
+@orgcmdkskc{v [,[,org-agenda-manipulate-query-add}
 Include inactive timestamps into the current view.  Only for weekly/daily
 agenda and timeline views.
 @c
-@kindex v a
-@kindex v A
-@item v a
-@itemx v A
+@orgcmd{v a,org-agenda-archives-mode}
+@xorgcmd{v A,org-agenda-archives-mode 'files}
 Toggle Archives mode.  In Archives mode, trees that are marked
 @code{ARCHIVED} are also scanned when producing the agenda.  When you use the
 capital @kbd{A}, even all archive files are included.  To exit archives mode,
 press @kbd{v a} again.
 @c
-@kindex v R
-@kindex R
-@item v R @ @r{or short} @ R
+@orgcmdkskc{v R,R,org-agenda-clockreport-mode}
 @vindex org-agenda-start-with-clockreport-mode
 Toggle Clockreport mode.  In Clockreport mode, the daily/weekly agenda will
 always show a table with the clocked times for the timespan and file scope
 covered by the current agenda view.  The initial setting for this mode in new
 agenda buffers can be set with the variable
-@code{org-agenda-start-with-clockreport-mode}.
-@c
-@kindex v E
-@kindex E
-@item v E @ @r{or short} @ E
+@code{org-agenda-start-with-clockreport-mode}.  By using a prefix argument
+when toggling this mode (i.e. @kbd{C-u R}), the clock table will not show
+contributions from entries that are hidden by agenda filtering@footnote{Only
+tags filtering will be respected here, effort filtering is ignored.}.
+@c
+@orgcmdkskc{v E,E,org-agenda-entry-text-mode}
 @vindex org-agenda-start-with-entry-text-mode
 @vindex org-agenda-entry-text-maxlines
 Toggle entry text mode.  In entry text mode, a number of lines from the Org
@@ -7597,33 +7702,26 @@
 @code{org-agenda-entry-text-maxlines}.  Calling this command with a numeric
 prefix argument will temporarily modify that number to the prefix value.
 @c
-@kindex G
-@item G
+@orgcmd{G,org-agenda-toggle-time-grid}
 @vindex org-agenda-use-time-grid
 @vindex org-agenda-time-grid
 Toggle the time grid on and off.  See also the variables
 @code{org-agenda-use-time-grid} and @code{org-agenda-time-grid}.
 @c
-@kindex r
-@item r
+@orgcmd{r,org-agenda-rodo}
 Recreate the agenda buffer, for example to reflect the changes after
 modification of the timestamps of items with @kbd{S-@key{left}} and
 @kbd{S-@key{right}}.  When the buffer is the global TODO list, a prefix
 argument is interpreted to create a selective list for a specific TODO
 keyword.
-@kindex g
-@item g
+@orgcmd{g,org-agenda-rodo}
 Same as @kbd{r}.
 @c
-@kindex s
-@kindex C-x C-s
-@item s
-@itemx C-x C-s
+@orgcmdkskc{C-x C-s,s,org-save-all-org-buffers}
 Save all Org buffers in the current Emacs session, and also the locations of
 IDs.
 @c
-@kindex C-c C-x C-c
-@item C-c C-x C-c
+@orgcmd{C-c C-x C-c,org-agenda-columns}
 @vindex org-columns-default-format
 Invoke column view (@pxref{Column view}) in the agenda buffer.  The column
 view format is taken from the entry at point, or (if there is no entry at
@@ -7632,8 +7730,7 @@
 @code{#+COLUMNS} line, or from the default variable
 @code{org-columns-default-format}), will be used in the agenda.
 
-@kindex C-c C-x >
-@item C-c C-x >
+@orgcmd{C-c C-x >,org-agenda-remove-restriction-lock}
 Remove the restriction lock on the agenda, if it is currently restricted to a
 file or subtree (@pxref{Agenda files}).
 
@@ -7643,20 +7740,19 @@
 @cindex effort filtering, in agenda
 @cindex query editing, in agenda
 
-@kindex /
-@item /
+@orgcmd{/,org-agenda-filter-by-tag}
 @vindex org-agenda-filter-preset
 Filter the current agenda view with respect to a tag and/or effort estimates.
 The difference between this and a custom agenda command is that filtering is
 very fast, so that you can switch quickly between different filters without
-having to recreate the agenda@footnote{Custom commands can preset a filter by
+having to recreate the agenda.@footnote{Custom commands can preset a filter by
 binding the variable @code{org-agenda-filter-preset} as an option.  This
 filter will then be applied to the view and persist as a basic filter through
 refreshes and more secondary filtering.  The filter is a global property of
-the entire agenda view - in a block agenda, you should only set this in the
+the entire agenda view---in a block agenda, you should only set this in the
 global options section, not in the section of an individual block.}
 
-You will be prompted for a tag selection letter, SPC will mean any tag at
+You will be prompted for a tag selection letter; @key{SPC} will mean any tag at
 all.  Pressing @key{TAB} at that prompt will offer use completion to select a
 tag (including any tags that do not have a selection character).  The command
 then hides all entries that do not contain or inherit this tag.  When called
@@ -7668,7 +7764,7 @@
 immediately use the @kbd{\} command.
 
 @vindex org-sort-agenda-noeffort-is-high
-In order to filter for effort estimates, you should set-up allowed
+In order to filter for effort estimates, you should set up allowed
 efforts globally, for example
 @lisp
 (setq org-global-properties
@@ -7711,13 +7807,13 @@
 @end group
 @end lisp
 
-@kindex \
-@item \
+@orgcmd{\,org-agenda-filter-by-tag-refine}
 Narrow the current agenda filter by an additional condition.  When called with
 prefix arg, remove the entries that @emph{do} have the tag, or that do match
 the effort criterion.  You can achieve the same effect by pressing @kbd{+} or
 @kbd{-} as the first key after the @kbd{/} command.
 
+@c
 @kindex [
 @kindex ]
 @kindex @{
@@ -7733,7 +7829,6 @@
 selected.
 @end table
 
-@page
 @tsubheading{Remote editing}
 @cindex remote editing, from agenda
 
@@ -7742,115 +7837,89 @@
 @c
 @cindex undoing remote-editing events
 @cindex remote editing, undo
-@kindex C-_
-@item C-_
+@orgcmd{C-_,org-agenda-undo}
 Undo a change due to a remote editing command.  The change is undone
 both in the agenda buffer and in the remote buffer.
 @c
-@kindex t
-@item t
+@orgcmd{t,org-agenda-todo}
 Change the TODO state of the item, both in the agenda and in the
 original org file.
 @c
-@kindex C-S-@key{right}
-@kindex C-S-@key{left}
-@item C-S-@key{right}@r{/}@key{left}
+@orgcmd{C-S-@key{right},org-agenda-todo-nextset}
+@orgcmd{C-S-@key{left},org-agenda-todo-previousset}
 Switch to the next/previous set of TODO keywords.
 @c
-@kindex C-k
-@item C-k
+@orgcmd{C-k,org-agenda-kill}
 @vindex org-agenda-confirm-kill
 Delete the current agenda item along with the entire subtree belonging
 to it in the original Org file.  If the text to be deleted remotely
 is longer than one line, the kill needs to be confirmed by the user.  See
 variable @code{org-agenda-confirm-kill}.
 @c
-@kindex C-c C-w
-@item C-c C-w
+@orgcmd{C-c C-w,org-agenda-refile}
 Refile the entry at point.
 @c
-@kindex C-c C-x C-a
-@kindex a
-@item C-c C-x C-a @ @r{or short} @ a
+@orgcmdkskc{C-c C-x C-a,a,org-agenda-archive-default-with-confirmation}
 @vindex org-archive-default-command
 Archive the subtree corresponding to the entry at point using the default
 archiving command set in @code{org-archive-default-command}.  When using the
 @code{a} key, confirmation will be required.
 @c
-@kindex C-c C-x a
-@item C-c C-x a
+@orgcmd{C-c C-x a,org-agenda-toggle-archive-tag}
 Toggle the ARCHIVE tag for the current headline.
 @c
-@kindex C-c C-x A
-@item C-c C-x A
+@orgcmd{C-c C-x A,org-agenda-archive-to-archive-sibling}
 Move the subtree corresponding to the current entry to its @emph{archive
 sibling}.
 @c
-@kindex $
-@kindex C-c C-x C-s
-@item C-c C-x C-s @ @r{or short} @ $
+@orgcmdkskc{C-c C-x C-s,$,org-agenda-archive}
 Archive the subtree corresponding to the current headline.  This means the
 entry will be moved to the configured archive location, most likely a
 different file.
 @c
-@kindex T
-@item T
+@orgcmd{T,org-agenda-show-tags}
 @vindex org-agenda-show-inherited-tags
 Show all tags associated with the current item.  This is useful if you have
 turned off @code{org-agenda-show-inherited-tags}, but still want to see all
 tags of a headline occasionally.
 @c
-@kindex :
-@item :
+@orgcmd{:,org-agenda-set-tags}
 Set tags for the current headline.  If there is an active region in the
 agenda, change a tag for all headings in the region.
 @c
 @kindex ,
 @item ,
-Set the priority for the current item.  Org-mode prompts for the
-priority character. If you reply with @key{SPC}, the priority cookie
-is removed from the entry.
-@c
-@kindex P
-@item P
+Set the priority for the current item (@command{org-agenda-priority}).
+Org-mode prompts for the priority character. If you reply with @key{SPC}, the
+priority cookie is removed from the entry.
+@c
+@orgcmd{P,org-agenda-show-priority}
 Display weighted priority of current item.
 @c
-@kindex +
-@kindex S-@key{up}
-@item +
-@itemx S-@key{up}
+@orgcmdkkc{+,S-@key{up},org-agenda-priority-up}
 Increase the priority of the current item.  The priority is changed in
 the original buffer, but the agenda is not resorted.  Use the @kbd{r}
 key for this.
 @c
-@kindex -
-@kindex S-@key{down}
-@item -
-@itemx S-@key{down}
+@orgcmdkkc{-,S-@key{down},org-agenda-priority-down}
 Decrease the priority of the current item.
 @c
-@kindex C-c C-z
-@kindex z
-@item z @ @r{or also} @ C-c C-z
+@orgcmdkkc{z,C-c C-z,org-agenda-add-note}
 @vindex org-log-into-drawer
-Add a note to the entry.  This note will be recorded, and then files to the
+Add a note to the entry.  This note will be recorded, and then filed to the
 same location where state change notes are put.  Depending on
-@code{org-log-into-drawer}, this maybe inside a drawer.
-@c
-@kindex C-c C-a
-@item C-c C-a
+@code{org-log-into-drawer}, this may be inside a drawer.
+@c
+@orgcmd{C-c C-a,org-attach}
 Dispatcher for all command related to attachments.
 @c
-@kindex C-c C-s
-@item C-c C-s
-Schedule this item, with prefix arg remove the scheduling timestamp
-@c
-@kindex C-c C-d
-@item C-c C-d
-Set a deadline for this item, with prefix arg remove the deadline.
-@c
-@kindex k
-@item k
+@orgcmd{C-c C-s,org-agenda-schedule}
+Schedule this item.  With prefix arg remove the scheduling timestamp
+@c
+@orgcmd{C-c C-d,org-agenda-deadline}
+Set a deadline for this item.  With prefix arg remove the deadline.
+@c
+@orgcmd{k,org-agenda-action}
 Agenda actions, to set dates for selected items to the cursor date.
 This command also works in the calendar!  The command prompts for an
 additional key:
@@ -7865,8 +7934,7 @@
 Press @kbd{r} afterward to refresh the agenda and see the effect of the
 command.
 @c
-@kindex S-@key{right}
-@item S-@key{right}
+@orgcmd{S-@key{right},org-agenda-do-date-later}
 Change the timestamp associated with the current line by one day into the
 future.  With a numeric prefix argument, change it by that many days.  For
 example, @kbd{3 6 5 S-@key{right}} will change it by a year.  With a
@@ -7876,57 +7944,48 @@
 is changed in the original Org file, but the change is not directly reflected
 in the agenda buffer.  Use @kbd{r} or @kbd{g} to update the buffer.
 @c
-@kindex S-@key{left}
-@item S-@key{left}
+@orgcmd{S-@key{left},org-agenda-do-date-earlier}
 Change the timestamp associated with the current line by one day
 into the past.
 @c
-@kindex >
-@item >
+@orgcmd{>,org-agenda-date-prompt}
 Change the timestamp associated with the current line.  The key @kbd{>} has
 been chosen, because it is the same as @kbd{S-.}  on my keyboard.
 @c
-@kindex I
-@item I
+@orgcmd{I,org-agenda-clock-in}
 Start the clock on the current item.  If a clock is running already, it
 is stopped first.
 @c
-@kindex O
-@item O
+@orgcmd{O,org-agenda-clock-out}
 Stop the previously started clock.
 @c
-@kindex X
-@item X
+@orgcmd{X,org-agenda-clock-cancel}
 Cancel the currently running clock.
-
-@kindex J
-@item J
+@c
+@orgcmd{J,org-agenda-clock-goto}
 Jump to the running clock in another window.
 
 @tsubheading{Bulk remote editing selected entries}
 @cindex remote editing, bulk, from agenda
 
-@kindex m
-@item m
-Mark the entry at point for bulk action.
-
-@kindex u
-@item u
+@orgcmd{m,org-agenda-bulk-mark}
+Mark the entry at point for bulk action.  With prefix arg, mark that many
+successive entries.
+@c
+@orgcmd{u,org-agenda-bulk-unmark}
 Unmark entry for bulk action.
-
-@kindex U
-@item U
+@c
+@orgcmd{U,org-agenda-bulk-remove-all-marks}
 Unmark all marked entries for bulk action.
-
-@kindex B
-@item B
+@c
+@orgcmd{B,org-agenda-bulk-action}
 Bulk action: act on all marked entries in the agenda.  This will prompt for
 another key to select the action to be applied.  The prefix arg to @kbd{B}
 will be passed through to the @kbd{s} and @kbd{d} commands, to bulk-remove
 these special timestamps.
 @example
 r  @r{Prompt for a single refile target and move all entries.  The entries}
-   @r{will no longer be in the agenda, refresh (@kbd{g}) to bring them back.}
+   @r{will no longer be in the agenda; refresh (@kbd{g}) to bring them back.}
 $  @r{Archive all selected entries.}
 A  @r{Archive entries by moving them to their respective archive siblings.}
 t  @r{Change TODO state.  This prompts for a single TODO keyword and}
@@ -7937,23 +7996,24 @@
 s  @r{Schedule all items to a new date.  To shift existing schedule dates}
    @r{by a fixed number of days, use something starting with double plus}
    @r{at the prompt, for example @samp{++8d} or @samp{++2w}.}
+S  @r{Reschedule randomly by N days.  N will be prompted for.  With prefix}
+   @r{arg (@kbd{C-u B S}), scatter only accross weekdays.}
 d  @r{Set deadline to a specific date.}
 @end example
 
 
 @tsubheading{Calendar commands}
 @cindex calendar commands, from agenda
-@kindex c
-@item c
+
+@orgcmd{c,org-agenda-goto-calendar}
 Open the Emacs calendar and move to the date at the agenda cursor.
 @c
-@item c
+@orgcmd{c,org-calendar-goto-agenda}
 When in the calendar, compute and show the Org-mode agenda for the
 date at the cursor.
 @c
 @cindex diary entries, creating from agenda
-@kindex i
-@item i
+@orgcmd{i,org-agenda-diary-entry}
 @vindex org-agenda-diary-file
 Insert a new entry into the diary, using the date at the cursor and (for
 block entries) the date at the mark.  This will add to the Emacs diary
@@ -7967,28 +8027,24 @@
 entries will be stored in a date-based outline tree that will later make it
 easy to archive appointments from previous months/years.  The tree will be
 built under an entry with a @code{DATE_TREE} property, or else with years as
-top-level entries.  Emacs will prompt you for the entry text - if you specify
+top-level entries.  Emacs will prompt you for the entry text---if you specify
 it, the entry will be created in @code{org-agenda-diary-file} without further
 interaction.  If you directly press @key{RET} at the prompt without typing
 text, the target file will be shown in another window for you to finish the
 entry there.  See also the @kbd{k r} command.
 @c
-@kindex M
-@item M
+@orgcmd{M,org-agenda-phases-of-moon}
 Show the phases of the moon for the three months around current date.
 @c
-@kindex S
-@item S
+@orgcmd{S,org-agenda-sunrise-sunset}
 Show sunrise and sunset times.  The geographical location must be set
 with calendar variables, see the documentation for the Emacs calendar.
 @c
-@kindex C
-@item C
+@orgcmd{C,org-agenda-convert-date}
 Convert the date at cursor into many other cultural and historic
 calendars.
 @c
-@kindex H
-@item H
+@orgcmd{H,org-agenda-holidays}
 Show holidays for three months around the cursor date.
 
 @item M-x org-export-icalendar-combine-agenda-files
@@ -7996,8 +8052,7 @@
 This is a globally available command, and also available in the agenda menu.
 
 @tsubheading{Exporting to a file}
-@kindex C-x C-w
-@item C-x C-w
+@orgcmd{C-x C-w,org-write-agenda}
 @cindex exporting agenda views
 @cindex agenda views, exporting
 @vindex org-agenda-exporter-settings
@@ -8010,13 +8065,11 @@
 for @file{htmlize} to be used during export.
 
 @tsubheading{Quit and Exit}
-@kindex q
-@item q
+@orgcmd{q,org-agenda-quit}
 Quit agenda, remove the agenda buffer.
 @c
-@kindex x
 @cindex agenda files, removing buffers
-@item x
+@orgcmd{x,org-agenda-exit}
 Exit agenda, remove the agenda buffer and all buffers loaded by Emacs
 for the compilation of the agenda.  Buffers created by the user to
 visit Org files will not be removed.
@@ -8182,7 +8235,7 @@
 @code{org-agenda-custom-commands} has two separate spots for setting
 options.  You can add options that should be valid for just a single
 command in the set, and options that should be valid for all commands in
-the set.  The former are just added to the command entry, the latter
+the set.  The former are just added to the command entry; the latter
 must come after the list of command entries.  Going back to the block
 agenda example (@pxref{Block agenda}), let's change the sorting strategy
 for the @kbd{C-c a h} commands to @code{priority-down}, but let's sort
@@ -8226,8 +8279,7 @@
 you want to do this only occasionally, use the command
 
 @table @kbd
-@kindex C-x C-w
-@item C-x C-w
+@orgcmd{C-x C-w,org-write-agenda}
 @cindex exporting agenda views
 @cindex agenda views, exporting
 @vindex org-agenda-exporter-settings
@@ -8297,8 +8349,7 @@
 files in one step:
 
 @table @kbd
-@kindex C-c a e
-@item C-c a e
+@orgcmd{C-c a e,org-store-agenda-views}
 Export all agenda views that have export file names associated with
 them.
 @end table
@@ -8338,7 +8389,7 @@
 system you use, please check the FAQ for examples.}
 @example
 emacs -eval '(org-batch-store-agenda-views                      \
-              org-agenda-ndays 30                               \
+              org-agenda-span month                             \
               org-agenda-start-day "2007-11-01"                 \
               org-agenda-include-diary nil                      \
               org-agenda-files (quote ("~/org/project.org")))'  \
@@ -8365,8 +8416,7 @@
 collected by certain criteria.
 
 @table @kbd
-@kindex C-c C-x C-c
-@item C-c C-x C-c
+@orgcmd{C-c C-x C-c,org-agenda-columns}
 Turn on column view in the agenda.
 @end table
 
@@ -8393,7 +8443,7 @@
 make sure that the computations of this property are up to date.  This is
 also true for the special @code{CLOCKSUM} property.  Org will then sum the
 values displayed in the agenda.  In the daily/weekly agenda, the sums will
-cover a single day, in all other views they cover the entire block.  It is
+cover a single day; in all other views they cover the entire block.  It is
 vital to realize that the agenda may show the same entry @emph{twice} (for
 example as scheduled and as a deadline), and it may show two entries from the
 same hierarchy (for example a @emph{parent} and its @emph{child}).  In these
@@ -8416,7 +8466,7 @@
 
 When exporting Org-mode documents, the exporter tries to reflect the
 structure of the document as accurately as possible in the backend.  Since
-export targets like HTML, La@TeX{}, or DocBook allow much richer formatting,
+export targets like HTML, @LaTeX{}, or DocBook allow much richer formatting,
 Org-mode has rules on how to prepare text for rich export.  This section
 summarizes the markup rules used in an Org-mode buffer.
 
@@ -8512,7 +8562,7 @@
 
 Org-mode normally exports the text before the first headline, and even uses
 the first line as the document title.  The text will be fully marked up.  If
-you need to include literal HTML, La@TeX{}, or DocBook code, use the special
+you need to include literal HTML, @LaTeX{}, or DocBook code, use the special
 constructs described below in the sections for the individual exporters.
 
 @vindex org-export-skip-text-before-1st-heading
@@ -8605,7 +8655,7 @@
 You can make words @b{*bold*}, @i{/italic/}, _underlined_, @code{=code=}
 and @code{~verbatim~}, and, if you must, @samp{+strike-through+}.  Text
 in the code and verbatim string is not processed for Org-mode specific
-syntax, it is exported verbatim.
+syntax; it is exported verbatim.
 
 @node Horizontal rules, Comment lines, Emphasis and monospace, Structural markup elements
 @subheading  Horizontal rules
@@ -8653,7 +8703,7 @@
 @end example
 
 @cindex inlined images, markup rules
-Some backends (HTML, La@TeX{}, and DocBook) allow you to directly include
+Some backends (HTML, @LaTeX{}, and DocBook) allow you to directly include
 images into the exported document.  Org does this, if a link to an image
 files does not have a description part, for example @code{[[./img/a.jpg]]}.
 If you wish to define a caption for the image and maybe a label for internal
@@ -8704,7 +8754,7 @@
 that can be marked up by font-lock in Emacs, you can ask for the example to
 look like the fontified Emacs buffer@footnote{This works automatically for
 the HTML backend (it requires version 1.34 of the @file{htmlize.el} package,
-which is distributed with Org.)  Fontified code chunks in LaTeX can be
+which is distributed with Org).  Fontified code chunks in LaTeX can be
 achieved using either the listings or the
 @url{http://code.google.com/p/minted, minted,} package. To use listings, turn
 on the variable @code{org-export-latex-listings} and ensure that the listings
@@ -8773,7 +8823,7 @@
 pressing @kbd{C-c '} again@footnote{Upon exit, lines starting with @samp{*}
 or @samp{#} will get a comma prepended, to keep them from being interpreted
 by Org as outline nodes or special comments.  These commas will be stripped
-for editing with @kbd{C-c '}, and also for export.}, the edited version will
+for editing with @kbd{C-c '}, and also for export.}.  The edited version will
 then replace the old version in the Org buffer.  Fixed-width regions
 (where each line starts with a colon followed by a space) will be edited
 using @code{artist-mode}@footnote{You may select a different-mode with the
@@ -8783,7 +8833,7 @@
 @kindex C-c l
 @item C-c l
 Calling @code{org-store-link} while editing a source code example in a
-temporary buffer created with @kbd{C-c '} will prompt for a label, make sure
+temporary buffer created with @kbd{C-c '} will prompt for a label.  Make sure
 that it is unique in the current buffer, and insert it with the proper
 formatting like @samp{(ref:label)} at the end of the current line.  Then the
 label is stored as a link @samp{(label)}, for retrieval with @kbd{C-c C-l}.
@@ -8804,12 +8854,14 @@
 @noindent
 The optional second and third parameter are the markup (e.g. @samp{quote},
 @samp{example}, or @samp{src}), and, if the markup is @samp{src}, the
-language for formatting the contents.  The markup is optional, if it is not
+language for formatting the contents.  The markup is optional; if it is not
 given, the text will be assumed to be in Org-mode format and will be
 processed normally.  The include line will also allow additional keyword
 parameters @code{:prefix1} and @code{:prefix} to specify prefixes for the
-first line and for each following line, as well as any options accepted by
-the selected markup.  For example, to include a file as an item, use
+first line and for each following line, @code{:minlevel} in order to get
+org-mode content demoted to a specified level, as well as any options
+accepted by the selected markup.  For example, to include a file as an item,
+use
 
 @example
 #+INCLUDE: "~/snippets/xx" :prefix1 "   + " :prefix "     "
@@ -8865,20 +8917,19 @@
 
 
 @node Embedded LaTeX,  , Macro replacement, Markup
-@section Embedded La@TeX{}
+@section Embedded @LaTeX{}
 @cindex @TeX{} interpretation
-@cindex La@TeX{} interpretation
-
-Plain ASCII is normally sufficient for almost all note taking.  One
-exception, however, are scientific notes which need to be able to contain
-mathematical symbols and the occasional formula.  La@TeX{}@footnote{La@TeX{}
-is a macro system based on Donald E. Knuth's @TeX{} system.  Many of the
-features described here as ``La@TeX{}'' are really from @TeX{}, but for
-simplicity I am blurring this distinction.}  is widely used to typeset
-scientific documents. Org-mode supports embedding La@TeX{} code into its
-files, because many academics are used to writing and reading La@TeX{} source
-code, and because it can be readily processed to produce pretty output for a
-number of export backends.
+@cindex @LaTeX{} interpretation
+
+Plain ASCII is normally sufficient for almost all note taking.  Exceptions
+include scientific notes, which often require mathematical symbols and the
+occasional formula.  @LaTeX{}@footnote{@LaTeX{} is a macro system based on
+Donald E. Knuth's @TeX{} system.  Many of the features described here as
+``@LaTeX{}'' are really from @TeX{}, but for simplicity I am blurring this
+distinction.}  is widely used to typeset scientific documents. Org-mode
+supports embedding @LaTeX{} code into its files, because many academics are
+used to writing and reading @LaTeX{} source code, and because it can be
+readily processed to produce pretty output for a number of export backends.
 
 @menu
 * Special symbols::             Greek letters and other symbols
@@ -8893,14 +8944,14 @@
 @cindex math symbols
 @cindex special symbols
 @cindex @TeX{} macros
-@cindex La@TeX{} fragments, markup rules
+@cindex @LaTeX{} fragments, markup rules
 @cindex HTML entities
-@cindex La@TeX{} entities
-
-You can use La@TeX{} macros to insert special symbols like @samp{\alpha} to
+@cindex @LaTeX{} entities
+
+You can use @LaTeX{} macros to insert special symbols like @samp{\alpha} to
 indicate the Greek letter, or @samp{\to} to indicate an arrow.  Completion
 for these macros is available, just type @samp{\} and maybe a few letters,
-and press @kbd{M-@key{TAB}} to see possible completions.  Unlike La@TeX{}
+and press @kbd{M-@key{TAB}} to see possible completions.  Unlike @LaTeX{}
 code, Org-mode allows these macros to be present without surrounding math
 delimiters, for example:
 
@@ -8911,13 +8962,13 @@
 @vindex org-entities
 During export, these symbols will be transformed into the native format of
 the exporter backend.  Strings like @code{\alpha} will be exported as
-@code{&alpha;} in the HTML output, and as @code{$\alpha$} in the La@TeX{}
+@code{&alpha;} in the HTML output, and as @code{$\alpha$} in the @LaTeX{}
 output.  Similarly, @code{\nbsp} will become @code{&nbsp;} in HTML and
-@code{~} in La@TeX{}.  If you need such a symbol inside a word, terminate it
+@code{~} in @LaTeX{}.  If you need such a symbol inside a word, terminate it
 like this: @samp{\Aacute@{@}stor}.
 
 A large number of entities is provided, with names taken from both HTML and
-La@TeX{}, see the variable @code{org-entities} for the complete list.
+@LaTeX{}; see the variable @code{org-entities} for the complete list.
 @samp{\-} is treated as a shy hyphen, and @samp{--}, @samp{---}, and
 @samp{...} are all converted into special commands creating hyphens of
 different lengths or a compact set of dots.
@@ -8930,8 +8981,8 @@
 @table @kbd
 @kindex C-c C-x \
 @item C-c C-x \
-Toggle display of entities as UTF8 characters.  This does not change the
-buffer content which remains plain ASCII, but it overlays the UTF8 character
+Toggle display of entities as UTF-8 characters.  This does not change the
+buffer content which remains plain ASCII, but it overlays the UTF-8 character
 for display purposes only.
 @end table
 
@@ -8940,14 +8991,14 @@
 @cindex subscript
 @cindex superscript
 
-Just like in La@TeX{}, @samp{^} and @samp{_} are used to indicate super-
+Just like in @LaTeX{}, @samp{^} and @samp{_} are used to indicate super-
 and subscripts.  Again, these can be used without embedding them in
 math-mode delimiters.  To increase the readability of ASCII text, it is
 not necessary (but OK) to surround multi-character sub- and superscripts
 with curly braces.  For example
 
 @example
-The mass if the sun is M_sun = 1.989 x 10^30 kg.  The radius of
+The mass of the sun is M_sun = 1.989 x 10^30 kg.  The radius of
 the sun is R_@{sun@} = 6.96 x 10^8 m.
 @end example
 
@@ -8969,42 +9020,43 @@
 @table @kbd
 @kindex C-c C-x \
 @item C-c C-x \
-In addition to showing entities as UTF8 characters, this command will also
+In addition to showing entities as UTF-8 characters, this command will also
 format sub- and superscripts in a WYSIWYM way.
 @end table
 
 @node LaTeX fragments, Previewing LaTeX fragments, Subscripts and superscripts, Embedded LaTeX
-@subsection La@TeX{} fragments
-@cindex La@TeX{} fragments
+@subsection @LaTeX{} fragments
+@cindex @LaTeX{} fragments
 
 @vindex org-format-latex-header
 Going beyond symbols and sub- and superscripts, a full formula language is
-needed.  Org-mode can contain La@TeX{} math fragments, and it supports ways
-to process these for several export backends.  When exporting to La@TeX{},
+needed.  Org-mode can contain @LaTeX{} math fragments, and it supports ways
+to process these for several export backends.  When exporting to @LaTeX{},
 the code is obviously left as it is.  When exporting to HTML, Org invokes the
 @uref{http://www.mathjax.org, MathJax library} (@pxref{Math formatting in
 HTML export}) to process and display the math@footnote{If you plan to use
 this regularly or on pages with significant page views, you should install
-@file{MathJax} on your own server in order to limit the load of our server.}.
-Finally, it can also process the mathematical expressions into
-images@footnote{For this to work you need to be on a system with a working
-La@TeX{} installation. You also need the @file{dvipng} program, available at
-@url{http://sourceforge.net/projects/dvipng/}.  The La@TeX{} header that will
+@file{MathJax} on your own
+server in order to limit the load of our server.}.  Finally, it can also
+process the mathematical expressions into images@footnote{For this to work
+you need to be on a system with a working @LaTeX{} installation. You also
+need the @file{dvipng} program, available at
+@url{http://sourceforge.net/projects/dvipng/}.  The @LaTeX{} header that will
 be used when processing a fragment can be configured with the variable
 @code{org-format-latex-header}.}  that can be displayed in a browser or in
 DocBook documents.
 
-La@TeX{} fragments don't need any special marking at all.  The following
-snippets will be identified as La@TeX{} source code:
+@LaTeX{} fragments don't need any special marking at all.  The following
+snippets will be identified as @LaTeX{} source code:
 @itemize @bullet
 @item
 Environments of any kind@footnote{When @file{MathJax} is used, only the
-environment recognized by @file{MathJax} will be processed.  When dvipng is
-used to create images, any La@TeX{} environments will be handled.}.  The only
-requirement is that the @code{\begin} statement appears on a new line,
-preceded by only whitespace.
-@item
-Text within the usual La@TeX{} math delimiters.  To avoid conflicts with
+environment recognized by @file{MathJax} will be processed.  When
+@file{dvipng} is used to create images, any @LaTeX{} environments will be
+handled.}.  The only requirement is that the @code{\begin} statement appears
+on a new line, preceded by only whitespace.
+@item
+Text within the usual @LaTeX{} math delimiters.  To avoid conflicts with
 currency specifications, single @samp{$} characters are only recognized as
 math delimiters if the enclosed text contains at most two line breaks, is
 directly attached to the @samp{$} characters with no whitespace in between,
@@ -9028,7 +9080,7 @@
 @vindex org-format-latex-options
 If you need any of the delimiter ASCII sequences for other purposes, you
 can configure the option @code{org-format-latex-options} to deselect the
-ones you do not wish to have interpreted by the La@TeX{} converter.
+ones you do not wish to have interpreted by the @LaTeX{} converter.
 
 @vindex org-export-with-LaTeX-fragments
 LaTeX processing can be configured with the variable
@@ -9040,7 +9092,7 @@
 @example
 #+OPTIONS: LaTeX:t          @r{Do the right thing automatically (MathJax)}
 #+OPTIONS: LaTeX:dvipng     @r{Force using dvipng images}
-#+OPTIONS: LaTeX:nil        @r{Do not process La@TeX{} fragments at all}
+#+OPTIONS: LaTeX:nil        @r{Do not process @LaTeX{} fragments at all}
 #+OPTIONS: LaTeX:verbatim   @r{Verbatim export, for jsMath or so}
 @end example
 
@@ -9048,13 +9100,13 @@
 @subsection Previewing LaTeX fragments
 @cindex LaTeX fragments, preview
 
-If you have @file{dvipng} installed, La@TeX{} fragments can be processed to
+If you have @file{dvipng} installed, @LaTeX{} fragments can be processed to
 produce preview images of the typeset expressions:
 
 @table @kbd
 @kindex C-c C-x C-l
 @item C-c C-x C-l
-Produce a preview image of the La@TeX{} fragment at point and overlay it
+Produce a preview image of the @LaTeX{} fragment at point and overlay it
 over the source code.  If there is no fragment at point, process all
 fragments in the current entry (between two headlines).  When called
 with a prefix argument, process the entire subtree.  When called with
@@ -9076,7 +9128,7 @@
 @cindex CDLa@TeX{}
 
 CDLa@TeX{} mode is a minor mode that is normally used in combination with a
-major La@TeX{} mode like AUC@TeX{} in order to speed-up insertion of
+major @LaTeX{} mode like AUC@TeX{} in order to speed-up insertion of
 environments and math templates.  Inside Org-mode, you can make use of
 some of the features of CDLa@TeX{} mode.  You need to install
 @file{cdlatex.el} and @file{texmathp.el} (the latter comes also with
@@ -9099,7 +9151,7 @@
 @item
 @kindex @key{TAB}
 The @key{TAB} key will do template expansion if the cursor is inside a
-La@TeX{} fragment@footnote{Org-mode has a method to test if the cursor is
+@LaTeX{} fragment@footnote{Org-mode has a method to test if the cursor is
 inside such a fragment, see the documentation of the function
 @code{org-inside-LaTeX-fragment-p}.}.  For example, @key{TAB} will
 expand @code{fr} to @code{\frac@{@}@{@}} and position the cursor
@@ -9113,7 +9165,7 @@
 @kindex _
 @kindex ^
 @vindex cdlatex-simplify-sub-super-scripts
-Pressing @kbd{_} and @kbd{^} inside a La@TeX{} fragment will insert these
+Pressing @kbd{_} and @kbd{^} inside a @LaTeX{} fragment will insert these
 characters together with a pair of braces.  If you use @key{TAB} to move
 out of the braces, and if the braces surround only a single character or
 macro, they are removed again (depending on the variable
@@ -9121,14 +9173,14 @@
 @item
 @kindex `
 Pressing the backquote @kbd{`} followed by a character inserts math
-macros, also outside La@TeX{} fragments.  If you wait more than 1.5 seconds
+macros, also outside @LaTeX{} fragments.  If you wait more than 1.5 seconds
 after the backquote, a help window will pop up.
 @item
 @kindex '
 Pressing the single-quote @kbd{'} followed by another character modifies
 the symbol before point with an accent or a font.  If you wait more than
-1.5 seconds after the backquote, a help window will pop up.  Character
-modification will work only inside La@TeX{} fragments, outside the quote
+1.5 seconds after the single-quote, a help window will pop up.  Character
+modification will work only inside @LaTeX{} fragments; outside the quote
 is normal.
 @end itemize
 
@@ -9140,8 +9192,8 @@
 printing and sharing of notes, ASCII export produces a readable and simple
 version of an Org file.  HTML export allows you to publish a notes file on
 the web, while the XOXO format provides a solid base for exchange with a
-broad range of other applications. La@TeX{} export lets you use Org-mode and
-its structured editing functions to easily create La@TeX{} files.  DocBook
+broad range of other applications. @LaTeX{} export lets you use Org-mode and
+its structured editing functions to easily create @LaTeX{} files.  DocBook
 export makes it possible to convert Org files to many other formats using
 DocBook tools.  For project management you can create gantt and resource
 charts by using TaskJuggler export.  To incorporate entries with associated
@@ -9158,7 +9210,7 @@
 * The export dispatcher::       How to access exporter commands
 * ASCII/Latin-1/UTF-8 export::  Exporting to flat files with encoding
 * HTML export::                 Exporting to HTML
-* LaTeX and PDF export::        Exporting to La@TeX{}, and processing to PDF
+* LaTeX and PDF export::        Exporting to @LaTeX{}, and processing to PDF
 * DocBook export::              Exporting to DocBook
 * TaskJuggler export::          Exporting to TaskJuggler
 * Freemind export::             Exporting to Freemind mind maps
@@ -9205,8 +9257,7 @@
 a separate file which can be included using @code{#+SETUPFILE}.
 
 @table @kbd
-@kindex C-c C-e t
-@item C-c C-e t
+@orgcmd{C-c C-e t,org-insert-export-options-template}
 Insert template with export options, see example below.
 @end table
 
@@ -9232,7 +9283,7 @@
 @example
 #+TITLE:       the title to be shown (default is the buffer name)
 #+AUTHOR:      the author (default taken from @code{user-full-name})
-#+DATE:        a date, fixed, of a format string for @code{format-time-string}
+#+DATE:        a date, fixed, or a format string for @code{format-time-string}
 #+EMAIL:       his/her email address (default from @code{user-mail-address})
 #+DESCRIPTION: the page description, e.g. for the XHTML meta tag
 #+KEYWORDS:    the page keywords, e.g. for the XHTML meta tag
@@ -9252,8 +9303,8 @@
 
 @noindent
 The OPTIONS line is a compact@footnote{If you want to configure many options
-this way, you can use several OPTIONS lines.} form to specify export settings.  Here
-you can:
+this way, you can use several OPTIONS lines.} form to specify export
+settings.  Here you can:
 @cindex headline levels
 @cindex section-numbers
 @cindex table of contents
@@ -9266,7 +9317,7 @@
 @cindex special strings
 @cindex emphasized text
 @cindex @TeX{} macros
-@cindex La@TeX{} fragments
+@cindex @LaTeX{} fragments
 @cindex author info, in export
 @cindex time info, in export
 @example
@@ -9288,7 +9339,7 @@
 <:         @r{turn on/off inclusion of any time/date stamps like DEADLINES}
 *:         @r{turn on/off emphasized text (bold, italic, underlined)}
 TeX:       @r{turn on/off simple @TeX{} macros in plain text}
-LaTeX:     @r{configure export of La@TeX{} fragments.  Default @code{auto}}
+LaTeX:     @r{configure export of @LaTeX{} fragments.  Default @code{auto}}
 skip:      @r{turn on/off skipping the text before the first heading}
 author:    @r{turn on/off inclusion of author name/email into exported file}
 email:     @r{turn on/off inclusion of author email into exported file}
@@ -9297,9 +9348,12 @@
 d:         @r{turn on/off inclusion of drawers}
 @end example
 @noindent
-These options take effect in both the HTML and La@TeX{} export, except
-for @code{TeX} and @code{LaTeX}, which are respectively @code{t} and
-@code{nil} for the La@TeX{} export.
+These options take effect in both the HTML and @LaTeX{} export, except for
+@code{TeX} and @code{LaTeX}, which are respectively @code{t} and @code{nil}
+for the @LaTeX{} export.  The default values for these and many other options
+are given by a set of variables.  For a list of such variables, the
+corresponding OPTIONS keys and also the publishing keys (@pxref{Project
+alist}), see the constant @code{org-export-plist-vars}.
 
 When exporting only a single subtree by selecting it with @kbd{C-c @@} before
 calling an export command, the subtree can overrule some of the file's export
@@ -9318,8 +9372,7 @@
 the subtrees are exported.
 
 @table @kbd
-@kindex C-c C-e
-@item C-c C-e
+@orgcmd{C-c C-e,org-export}
 @vindex org-export-run-in-background
 Dispatcher for export and publishing commands.  Displays a help-window
 listing the additional key(s) needed to launch an export or publishing
@@ -9327,14 +9380,12 @@
 @kbd{C-u C-u} causes most commands to be executed in the background, in a
 separate Emacs process@footnote{To make this behavior the default, customize
 the variable @code{org-export-run-in-background}.}.
-@kindex C-c C-e v
-@item C-c C-e v
+@orgcmd{C-c C-e v,org-export-visible}
 Like @kbd{C-c C-e}, but only export the text that is currently visible
 (i.e. not hidden by outline visibility).
-@kindex C-u C-u C-c C-e
-@item C-u C-u C-c C-e
+@orgcmd{C-u C-u C-c C-e,org-export}
 @vindex org-export-run-in-background
-Call an the exporter, but reverse the setting of
+Call the exporter, but reverse the setting of
 @code{org-export-run-in-background}, i.e. request background processing if
 not set, or force processing in the current Emacs process if set.
 @end table
@@ -9353,8 +9404,7 @@
 @cindex active region
 @cindex transient-mark-mode
 @table @kbd
-@kindex C-c C-e a
-@item C-c C-e a
+@orgcmd{C-c C-e a,org-export-as-ascii}
 @cindex property, EXPORT_FILE_NAME
 Export as ASCII file.  For an Org file, @file{myfile.org}, the ASCII file
 will be @file{myfile.txt}.  The file will be overwritten without
@@ -9365,21 +9415,15 @@
 become the document title.  If the tree head entry has or inherits an
 @code{EXPORT_FILE_NAME} property, that name will be used for the
 export.
-@kindex C-c C-e A
-@item C-c C-e A
-Export to a temporary buffer, do not create a file.
-@kindex C-c C-e n
-@kindex C-c C-e N
-@item C-c C-e n @ @ @r{and} @ @ C-c C-e N
+@orgcmd{C-c C-e A,org-export-as-ascii-to-buffer}
+Export to a temporary buffer.  Do not create a file.
+@orgcmd{C-c C-e n,org-export-as-latin1}
+@xorgcmd{C-c C-e N,org-export-as-latin1-to-buffer}
 Like the above commands, but use Latin-1 encoding.
-@kindex C-c C-e u
-@kindex C-c C-e U
-@item C-c C-e u @ @ @r{and} @ @ C-c C-e U
+@orgcmd{C-c C-e u,org-export-as-utf8}
+@xorgcmd{C-c C-e U,org-export-as-utf8-to-buffer}
 Like the above commands, but use UTF-8 encoding.
-@kindex C-c C-e v a
-@kindex C-c C-e v n
-@kindex C-c C-e v u
-@item C-c C-e v a @ @ @r{and} @ @ C-c C-e v n @ @ @r{and} @ @ C-c C-e v u
+@item C-c C-e v a/n/u
 Export only the visible part of the document.
 @end table
 
@@ -9434,8 +9478,7 @@
 @cindex active region
 @cindex transient-mark-mode
 @table @kbd
-@kindex C-c C-e h
-@item C-c C-e h
+@orgcmd{C-c C-e h,org-export-as-html}
 @cindex property, EXPORT_FILE_NAME
 Export as HTML file @file{myfile.html}.  For an Org file @file{myfile.org},
 the ASCII file will be @file{myfile.html}.  The file will be overwritten
@@ -9445,25 +9488,15 @@
 current subtree, use @kbd{C-c @@}.}, the tree head will become the document
 title.  If the tree head entry has, or inherits, an @code{EXPORT_FILE_NAME}
 property, that name will be used for the export.
-@kindex C-c C-e b
-@item C-c C-e b
+@orgcmd{C-c C-e b,org-export-as-html-and-open}
 Export as HTML file and immediately open it with a browser.
-@kindex C-c C-e H
-@item C-c C-e H
-Export to a temporary buffer, do not create a file.
-@kindex C-c C-e R
-@item C-c C-e R
+@orgcmd{C-c C-e H,org-export-as-html-to-buffer}
+Export to a temporary buffer.  Do not create a file.
+@orgcmd{C-c C-e R,org-export-region-as-html}
 Export the active region to a temporary buffer.  With a prefix argument, do
 not produce the file header and footer, but just the plain HTML section for
 the region.  This is good for cut-and-paste operations.
-@kindex C-c C-e v h
-@kindex C-c C-e v b
-@kindex C-c C-e v H
-@kindex C-c C-e v R
-@item C-c C-e v h
-@item C-c C-e v b
-@item C-c C-e v H
-@item C-c C-e v R
+@item C-c C-e v h/b/H/R
 Export only the visible part of the document.
 @item M-x org-export-region-as-html
 Convert the region to HTML under the assumption that it was Org-mode
@@ -9599,16 +9632,18 @@
 @cindex MathJax
 @cindex dvipng
 
-La@TeX{} math snippets (@pxref{LaTeX fragments}) can be displayed in two
+@LaTeX{} math snippets (@pxref{LaTeX fragments}) can be displayed in two
 different ways on HTML pages.  The default is to use the
 @uref{http://www.mathjax.org, MathJax system} which should work out of the
 box with Org mode installation because @code{http://orgmode.org} serves
 @file{MathJax} for Org-mode users for small applications and for testing
 purposes.  @b{If you plan to use this regularly or on pages with significant
-page views, you should install MathJax on your own server in order to limit
-the load of our server.}  To configure @file{MathJax}, use the variable
-@code{org-export-html-mathjax-options} or insert something like the following
-into the buffer:
+page views, you should install@footnote{Installation instructions can be
+found on the MathJax website, see
+@uref{http://www.mathjax.org/resources/docs/?installation.html}.} MathJax on
+your own server in order to limit the load of our server.}  To configure
+@file{MathJax}, use the variable @code{org-export-html-mathjax-options} or
+insert something like the following into the buffer:
 
 @example
 #+MATHJAX: align:"left" mathml:t path:"/MathJax/MathJax.js"
@@ -9618,11 +9653,11 @@
 @code{org-export-html-mathjax-options} for the meaning of the parameters in
 this line.
 
-If you prefer, you can also request that La@TeX{} are processed into small
-images that will be inserted into the browser page.  Before the availability
-of MathJax, this was the default method for Org files.  This method requires
-that the @file{dvipng} program is available on your system.  You can still
-get this processing with
+If you prefer, you can also request that @LaTeX{} fragments are processed
+into small images that will be inserted into the browser page.  Before the
+availability of MathJax, this was the default method for Org files.  This
+method requires that the @file{dvipng} program is available on your system.
+You can still get this processing with
 
 @example
 #+OPTIONS: LaTeX:dvipng
@@ -9705,7 +9740,7 @@
 @code{org-export-html-style-include-default}}.  You may overwrite these
 settings, or add to them by using the variables @code{org-export-html-style}
 (for Org-wide settings) and @code{org-export-html-style-extra} (for more
-granular settings, like file-local settings).  To set the latter variable
+fine-grained settings, like file-local settings).  To set the latter variable
 individually for each file, you can use
 
 @cindex #+STYLE
@@ -9773,11 +9808,11 @@
          @r{@code{org-export-headline-levels} (= the @code{H} switch in @code{#+OPTIONS}).}
          @r{If this is smaller than in @code{org-export-headline-levels}, each}
          @r{info/folding section can still contain child headlines.}
-toc:     @r{Should the table of content @emph{initially} be visible?}
+toc:     @r{Should the table of contents @emph{initially} be visible?}
          @r{Even when @code{nil}, you can always get to the "toc" with @kbd{i}.}
 tdepth:  @r{The depth of the table of contents.  The defaults are taken from}
          @r{the variables @code{org-export-headline-levels} and @code{org-export-with-toc}.}
-ftoc:    @r{Does the css of the page specify a fixed position for the "toc"?}
+ftoc:    @r{Does the CSS of the page specify a fixed position for the "toc"?}
          @r{If yes, the toc will never be displayed as a section.}
 ltoc:    @r{Should there be short contents (children) in each section?}
          @r{Make this @code{above} if the section should be above initial text.}
@@ -9794,41 +9829,40 @@
 pages, configure the variable @code{org-export-html-use-infojs}.
 
 @node LaTeX and PDF export, DocBook export, HTML export, Exporting
-@section La@TeX{} and PDF export
-@cindex La@TeX{} export
+@section @LaTeX{} and PDF export
+@cindex @LaTeX{} export
 @cindex PDF export
 @cindex Guerry, Bastien
 
-Org-mode contains a La@TeX{} exporter written by Bastien Guerry.  With
+Org-mode contains a @LaTeX{} exporter written by Bastien Guerry.  With
 further processing@footnote{The default LaTeX output is designed for
 processing with pdftex or latex.  It includes packages that are not
 compatible with xetex and possibly luatex.  See the variables
 @code{org-export-latex-default-packages-alist} and
 @code{org-export-latex-packages-alist}.}, this backend is also used to
-produce PDF output.  Since the La@TeX{} output uses @file{hyperref} to
+produce PDF output.  Since the @LaTeX{} output uses @file{hyperref} to
 implement links and cross references, the PDF output file will be fully
 linked.
 
 @menu
 * LaTeX/PDF export commands::   Which key invokes which commands
 * Header and sectioning::       Setting up the export file structure
-* Quoting LaTeX code::          Incorporating literal La@TeX{} code
-* Tables in LaTeX export::      Options for exporting tables to La@TeX{}
-* Images in LaTeX export::      How to insert figures into La@TeX{} output
+* Quoting LaTeX code::          Incorporating literal @LaTeX{} code
+* Tables in LaTeX export::      Options for exporting tables to @LaTeX{}
+* Images in LaTeX export::      How to insert figures into @LaTeX{} output
 * Beamer class export::         Turning the file into a presentation
 @end menu
 
 @node LaTeX/PDF export commands, Header and sectioning, LaTeX and PDF export, LaTeX and PDF export
-@subsection La@TeX{} export commands
+@subsection @LaTeX{} export commands
 
 @cindex region, active
 @cindex active region
 @cindex transient-mark-mode
 @table @kbd
-@kindex C-c C-e l
-@item C-c C-e l
+@orgcmd{C-c C-e l,org-export-as-latex}
 @cindex property EXPORT_FILE_NAME
-Export as La@TeX{} file @file{myfile.tex}.  For an Org file
+Export as @LaTeX{} file @file{myfile.tex}.  For an Org file
 @file{myfile.org}, the ASCII file will be @file{myfile.tex}.  The file will
 be overwritten without warning.  If there is an active region@footnote{This
 requires @code{transient-mark-mode} be turned on.}, only the region will be
@@ -9836,27 +9870,21 @@
 current subtree, use @kbd{C-c @@}.}, the tree head will become the document
 title.  If the tree head entry has or inherits an @code{EXPORT_FILE_NAME}
 property, that name will be used for the export.
-@kindex C-c C-e L
-@item C-c C-e L
-Export to a temporary buffer, do not create a file.
-@kindex C-c C-e v l
-@kindex C-c C-e v L
-@item C-c C-e v l
-@item C-c C-e v L
+@orgcmd{C-c C-e L,org-export-as-latex-to-buffer}
+Export to a temporary buffer.  Do not create a file.
+@item C-c C-e v l/L 
 Export only the visible part of the document.
 @item M-x org-export-region-as-latex
-Convert the region to La@TeX{} under the assumption that it was Org-mode
+Convert the region to @LaTeX{} under the assumption that it was Org-mode
 syntax before.  This is a global command that can be invoked in any
 buffer.
 @item M-x org-replace-region-by-latex
-Replace the active region (assumed to be in Org-mode syntax) by La@TeX{}
+Replace the active region (assumed to be in Org-mode syntax) by @LaTeX{}
 code.
-@kindex C-c C-e p
-@item C-c C-e p
-Export as La@TeX{} and then process to PDF.
-@kindex C-c C-e d
-@item C-c C-e d
-Export as La@TeX{} and then process to PDF, then open the resulting PDF file.
+@orgcmd{C-c C-e p,org-export-as-pdf}
+Export as @LaTeX{} and then process to PDF.
+@orgcmd{C-c C-e d,org-export-as-pdf-and-open}
+Export as @LaTeX{} and then process to PDF, then open the resulting PDF file.
 @end table
 
 @cindex headline levels, for exporting
@@ -9879,13 +9907,13 @@
 
 @node Header and sectioning, Quoting LaTeX code, LaTeX/PDF export commands, LaTeX and PDF export
 @subsection Header and sectioning structure
-@cindex La@TeX{} class
-@cindex La@TeX{} sectioning structure
-@cindex La@TeX{} header
+@cindex @LaTeX{} class
+@cindex @LaTeX{} sectioning structure
+@cindex @LaTeX{} header
 @cindex header, for LaTeX files
 @cindex sectioning structure, for LaTeX export
 
-By default, the La@TeX{} output uses the class @code{article}.
+By default, the @LaTeX{} output uses the class @code{article}.
 
 @vindex org-export-latex-default-class
 @vindex org-export-latex-classes
@@ -9912,12 +9940,12 @@
 information.
 
 @node Quoting LaTeX code, Tables in LaTeX export, Header and sectioning, LaTeX and PDF export
-@subsection Quoting La@TeX{} code
-
-Embedded La@TeX{} as described in @ref{Embedded LaTeX}, will be correctly
-inserted into the La@TeX{} file.  This includes simple macros like
+@subsection Quoting @LaTeX{} code
+
+Embedded @LaTeX{} as described in @ref{Embedded LaTeX}, will be correctly
+inserted into the @LaTeX{} file.  This includes simple macros like
 @samp{\ref@{LABEL@}} to create a cross reference to a figure.  Furthermore,
-you can add special code that should only be present in La@TeX{} export with
+you can add special code that should only be present in @LaTeX{} export with
 the following constructs:
 
 @cindex #+LaTeX
@@ -9937,10 +9965,10 @@
 
 
 @node Tables in LaTeX export, Images in LaTeX export, Quoting LaTeX code, LaTeX and PDF export
-@subsection Tables in La@TeX{} export
-@cindex tables, in La@TeX{} export
-
-For La@TeX{} export of a table, you can specify a label and a caption
+@subsection Tables in @LaTeX{} export
+@cindex tables, in @LaTeX{} export
+
+For @LaTeX{} export of a table, you can specify a label and a caption
 (@pxref{Images and tables}).  You can also use the @code{ATTR_LaTeX} line to
 request a @code{longtable} environment for the table, so that it may span
 several pages, or provide the @code{multicolumn} keyword that will make the
@@ -9960,13 +9988,13 @@
 
 
 @node Images in LaTeX export, Beamer class export, Tables in LaTeX export, LaTeX and PDF export
-@subsection Images in La@TeX{} export
-@cindex images, inline in La@TeX{}
-@cindex inlining images in La@TeX{}
+@subsection Images in @LaTeX{} export
+@cindex images, inline in @LaTeX{}
+@cindex inlining images in @LaTeX{}
 
 Images that are linked to without a description part in the link, like
 @samp{[[file:img.jpg]]} or @samp{[[./img.jpg]]} will be inserted into the PDF
-output file resulting from La@TeX{} processing.  Org will use an
+output file resulting from @LaTeX{} processing.  Org will use an
 @code{\includegraphics} macro to insert the image.  If you have specified a
 caption and/or a label as described in @ref{Images and tables}, the figure
 will be wrapped into a @code{figure} environment and thus become a floating
@@ -9997,7 +10025,7 @@
 @end example
 
 If you need references to a label created in this way, write
-@samp{\ref@{fig:SED-HR4049@}} just like in La@TeX{}.
+@samp{\ref@{fig:SED-HR4049@}} just like in @LaTeX{}.
 
 @node Beamer class export,  , Images in LaTeX export, LaTeX and PDF export
 @subsection Beamer class export
@@ -10014,7 +10042,7 @@
 the first level below the selected subtree heading) will be turned into
 frames, and the outline structure below this level will become itemize lists.
 You can also configure the variable @code{org-beamer-frame-level} to a
-different level - then the hierarchy above frames will produce the sectioning
+different level---then the hierarchy above frames will produce the sectioning
 structure of the presentation.
 
 A template for useful in-buffer settings or properties can be inserted into
@@ -10037,7 +10065,8 @@
 @code{[t]} or @code{[<+->]} of @code{<2-3>}.  If the @code{BEAMER_col}
 property is also set, something like @code{C[t]} can be added here as well to
 set an options argument for the implied @code{columns} environment.
-@code{c[t]} will set an option for the implied @code{column} environment.
+@code{c[t]} or @code{c<2->} will set an options for the implied @code{column}
+environment.
 @item BEAMER_col
 The width of a column that should start with this entry.  If this property is
 set, the entry will also get a @code{:BMCOL:} property to make this visible.
@@ -10076,8 +10105,7 @@
 @end example
 
 @table @kbd
-@kindex C-c C-b
-@item C-c C-b
+@orgcmd{C-c C-b,org-beamer-select-environment}
 In @code{org-beamer-mode}, this key offers fast selection of a beamer
 environment or the @code{BEAMER_col} property.
 @end table
@@ -10155,8 +10183,7 @@
 @cindex active region
 @cindex transient-mark-mode
 @table @kbd
-@kindex C-c C-e D
-@item C-c C-e D
+@orgcmd{C-c C-e D,org-export-as-docbook}
 @cindex property EXPORT_FILE_NAME
 Export as DocBook file.  For an Org file, @file{myfile.org}, the DocBook XML
 file will be @file{myfile.xml}.  The file will be overwritten without
@@ -10166,8 +10193,7 @@
 current subtree, use @kbd{C-c @@}.}, the tree head will become the document
 title.  If the tree head entry has, or inherits, an @code{EXPORT_FILE_NAME}
 property, that name will be used for the export.
-@kindex C-c C-e V
-@item C-c C-e V
+@orgcmd{C-c C-e V,org-export-as-docbook-pdf-and-open}
 Export as DocBook file, process to PDF, then open the resulting PDF file.
 
 @vindex org-export-docbook-xslt-proc-command
@@ -10184,8 +10210,7 @@
 the user.  You can also overrule this global setting on a per-file basis by
 adding an in-buffer setting @code{#+XSLT:} to the Org file.
 
-@kindex C-c C-e v D
-@item C-c C-e v D
+@orgkey{C-c C-e v D}
 Export only the visible part of the document.
 @end table
 
@@ -10220,7 +10245,7 @@
 #+BEGIN_DOCBOOK
 <warning>
   <para>You should know what you are doing when quoting DocBook XML code
-  in your Org file.  Invalid DocBook XML file may be generated by
+  in your Org file.  Invalid DocBook XML may be generated by
   DocBook exporter if you are not careful!</para>
 </warning>
 #+END_DOCBOOK
@@ -10349,12 +10374,10 @@
 @subsection TaskJuggler export commands
 
 @table @kbd
-@kindex C-c C-e j
-@item C-c C-e j
+@orgcmd{C-c C-e j,org-export-as-taskjuggler}
 Export as TaskJuggler file.
 
-@kindex C-c C-e J
-@item C-c C-e J
+@orgcmd{C-c C-e J,org-export-as-taskjuggler-and-open}
 Export as TaskJuggler file and then open the file with TaskJugglerUI.
 @end table
 
@@ -10381,7 +10404,7 @@
 identifier (named @samp{resource_id}) to the resources (using the standard
 Org properties commands, @pxref{Property syntax}) or you can let the exporter
 generate identifiers automatically (the exporter picks the first word of the
-headline as the identifier as long as it is unique, see the documentation of
+headline as the identifier as long as it is unique---see the documentation of
 @code{org-taskjuggler-get-unique-id}). Using that identifier you can then
 allocate resources to tasks. This is again done with the @samp{allocate}
 property on the tasks. Do this in column view or when on the task type
@@ -10407,7 +10430,7 @@
 
 The exporter will handle dependencies that are defined in the tasks either
 with the @samp{ORDERED} attribute (@pxref{TODO dependencies}), with the
-@samp{BLOCKER} attribute (see org-depend.el) or alternatively with a
+@samp{BLOCKER} attribute (see @file{org-depend.el}) or alternatively with a
 @samp{depends} attribute. Both the @samp{BLOCKER} and the @samp{depends}
 attribute can be either @samp{previous-sibling} or a reference to an
 identifier (named @samp{task_id}) which is defined for another task in the
@@ -10464,8 +10487,7 @@
 The Freemind exporter was written by Lennart Borgman.
 
 @table @kbd
-@kindex C-c C-e m
-@item C-c C-e m
+@orgcmd{C-c C-e m,org-export-as-freemind}
 Export as Freemind mind map @file{myfile.mm}.
 @end table
 
@@ -10478,11 +10500,9 @@
 does not interpret any additional Org-mode features.
 
 @table @kbd
-@kindex C-c C-e x
-@item C-c C-e x
+@orgcmd{C-c C-e x,org-export-as-xoxo}
 Export as XOXO file @file{myfile.html}.
-@kindex C-c C-e v
-@item C-c C-e v x
+@orgkey{C-c C-e v x}
 Export only the visible part of the document.
 @end table
 
@@ -10525,18 +10545,15 @@
 figure out from which entry all the different instances originate.
 
 @table @kbd
-@kindex C-c C-e i
-@item C-c C-e i
+@orgcmd{C-c C-e i,org-export-icalendar-this-file}
 Create iCalendar entries for the current file and store them in the same
 directory, using a file extension @file{.ics}.
-@kindex C-c C-e I
-@item C-c C-e I
+@orgcmd{C-c C-e I, org-export-icalendar-all-agenda-files}
 @vindex org-agenda-files
 Like @kbd{C-c C-e i}, but do this for all files in
 @code{org-agenda-files}.  For each of these files, a separate iCalendar
 file will be written.
-@kindex C-c C-e c
-@item C-c C-e c
+@orgcmd{C-c C-e c,org-export-icalendar-combine-agenda-files}
 @vindex org-combined-agenda-icalendar-file
 Create a single large iCalendar file from all files in
 @code{org-agenda-files} and write it to the file given by
@@ -10674,6 +10691,9 @@
 @item @code{:include}
 @tab List of files to be included regardless of @code{:base-extension}
 and @code{:exclude}.
+
+@item @code{:recursive}
+@tab Non-nil means, check base-directory recursively for files to publish.
 @end multitable
 
 @node Publishing action, Publishing options, Selecting files, Configuration
@@ -10694,10 +10714,10 @@
 directory@footnote{@file{file-source.org} and @file{file-source.org.html} if
 source and publishing directories are equal.  Note that with this kind of
 setup, you need to add @code{:exclude "-source\\.org"} to the project
-definition in @code{org-publish-project-alist} to avoid that the published
-source files will be considered as new org files the next time the project is
-published.}.  Other files like images only need to be copied to the
-publishing destination, for this you may use @code{org-publish-attachment}.
+definition in @code{org-publish-project-alist} to prevent the published
+source files from being considered as new org files the next time the project
+is published.}.  Other files like images only need to be copied to the
+publishing destination; for this you may use @code{org-publish-attachment}.
 For non-Org files, you always need to specify the publishing function:
 
 @multitable @columnfractions 0.3 0.7
@@ -10717,11 +10737,11 @@
 and place the result into the destination folder.
 
 @node Publishing options, Publishing links, Publishing action, Configuration
-@subsection Options for the HTML/La@TeX{} exporters
+@subsection Options for the HTML/@LaTeX{} exporters
 @cindex options, for publishing
 
 The property list can be used to set many export options for the HTML
-and La@TeX{} exporters.  In most cases, these properties correspond to user
+and @LaTeX{} exporters.  In most cases, these properties correspond to user
 variables in Org.  The table below lists these properties along
 with the variable they belong to.  See the documentation string for the
 respective variable for details.
@@ -10826,9 +10846,9 @@
 @end multitable
 
 Most of the @code{org-export-with-*} variables have the same effect in
-both HTML and La@TeX{} exporters, except for @code{:TeX-macros} and
+both HTML and @LaTeX{} exporters, except for @code{:TeX-macros} and
 @code{:LaTeX-fragments}, respectively @code{nil} and @code{t} in the
-La@TeX{} export.
+@LaTeX{} export.
 
 @vindex org-publish-project-alist
 When a property is given a value in @code{org-publish-project-alist},
@@ -11048,17 +11068,13 @@
 Once properly configured, Org can publish with the following commands:
 
 @table @kbd
-@kindex C-c C-e C
-@item C-c C-e C
+@orgcmd{C-c C-e X,org-publish}
 Prompt for a specific project and publish all files that belong to it.
-@kindex C-c C-e P
-@item C-c C-e P
+@orgcmd{C-c C-e P,org-publish-current-project}
 Publish the project containing the current file.
-@kindex C-c C-e F
-@item C-c C-e F
+@orgcmd{C-c C-e F,org-publish-current-file}
 Publish only the current file.
-@kindex C-c C-e E
-@item C-c C-e E
+@orgcmd{C-c C-e E,org-publish-all}
 Publish every project.
 @end table
 
@@ -11192,7 +11208,7 @@
 Controls the way Emacs windows are rearranged when the edit buffer is created.
 @item org-src-preserve-indentation
 This variable is especially useful for tangling languages such as
-python, in which whitespace indentation in the output is critical.
+Python, in which whitespace indentation in the output is critical.
 @item org-src-ask-before-returning-to-edit-buffer
 By default, Org will ask before returning to an open edit buffer. Set
 this variable to nil to switch without asking.
@@ -11234,7 +11250,7 @@
 @end table
 
 It is possible to inhibit the evaluation of code blocks during export.
-Setting the the @code{org-export-babel-evaluate} variable to @code{nil} will
+Setting the @code{org-export-babel-evaluate} variable to @code{nil} will
 ensure that no code blocks are evaluated as part of the export process.  This
 can be useful in situations where potentially untrusted Org-mode files are
 exported in an automated fashion, for example when Org-mode is used as the
@@ -11361,17 +11377,17 @@
 @item @b{Language} @tab @b{Identifier} @tab @b{Language} @tab @b{Identifier}
 @item Asymptote @tab asymptote @tab C @tab C
 @item C++ @tab C++ @tab Clojure @tab clojure
-@item css @tab css @tab ditaa @tab ditaa
+@item CSS @tab css @tab ditaa @tab ditaa
 @item Graphviz @tab dot @tab Emacs Lisp @tab emacs-lisp
 @item gnuplot @tab gnuplot @tab Haskell @tab haskell
-@item LaTeX @tab latex @tab Matlab @tab matlab
+@item LaTeX @tab latex @tab MATLAB @tab matlab
 @item Mscgen @tab mscgen @tab Objective Caml @tab ocaml
-@item Octave @tab octave @tab OZ @tab oz
+@item Octave @tab octave @tab Oz @tab oz
 @item Perl @tab perl @tab Python @tab python
 @item R @tab R @tab Ruby @tab ruby
 @item Sass @tab sass @tab GNU Screen @tab screen
 @item shell @tab sh @tab SQL @tab sql
-@item Sqlite @tab sqlite
+@item SQLite @tab sqlite
 @end multitable
 
 Language-specific documentation is available for some languages.  If
@@ -11771,8 +11787,8 @@
 @node results, file, var, Specific header arguments
 @subsubsection @code{:results}
 
-There are three classes of @code{:results} header argument.  Only one option of
-each type may be supplied per code block.
+There are three classes of @code{:results} header argument.  Only one option
+per class may be supplied per code block.
 
 @itemize @bullet
 @item
@@ -11795,7 +11811,7 @@
 @item @code{value}
 This is the default.  The result is the value of the last statement in the
 code block.  This header argument places the evaluation in functional
-mode.  Note that in some languages, e.g., python, use of this result type
+mode.  Note that in some languages, e.g., Python, use of this result type
 requires that a @code{return} statement be included in the body of the source
 code block. E.g., @code{:results value}.
 @item @code{output}
@@ -11815,6 +11831,9 @@
 The results should be interpreted as an Org-mode table.  If a single value is
 returned, it will be converted into a table with one row and one column.
 E.g., @code{:results value table}.
+@item @code{list}
+The results should be interpreted as an Org-mode list.  If a single scalar
+value is returned it will be converted into a list with only one element.
 @item @code{scalar}, @code{verbatim}
 The results should be interpreted literally---they will not be
 converted into a table.  The results will be inserted into the Org-mode
@@ -11837,7 +11856,7 @@
 E.g., @code{:results value code}.
 @item @code{pp}
 The result is converted to pretty-printed code and is enclosed in a code
-block.  This option currently supports Emacs Lisp, python, and ruby.  E.g.,
+block.  This option currently supports Emacs Lisp, Python, and Ruby.  E.g.,
 @code{:results value pp}.
 @end itemize
 
@@ -11875,7 +11894,7 @@
 graphical output is sent to the specified file without the file being
 referenced explicitly in the code block. See the documentation for the
 individual languages for details. In contrast, general purpose languages such
-as python and ruby require that the code explicitly create output
+as Python and Ruby require that the code explicitly create output
 corresponding to the path indicated by @code{:file}.
 
 
@@ -11894,8 +11913,8 @@
 (e.g. @code{:file myfile.jpg} or @code{:file results/myfile.jpg}) in which
 case that path will be interpreted relative to the default directory.
 
-In other words, if you want your plot to go into a folder called Work in your
-home directory, you could use
+In other words, if you want your plot to go into a folder called @file{Work}
+in your home directory, you could use
 
 @example
 #+begin_src R :file myplot.png :dir ~/Work
@@ -11928,7 +11947,7 @@
 Most of this functionality follows immediately from the fact that @code{:dir}
 sets the value of the Emacs variable @code{default-directory}, thanks to
 tramp. Those using XEmacs, or GNU Emacs prior to version 23 may need to
-install tramp separately in order for the these features to work correctly.
+install tramp separately in order for these features to work correctly.
 
 @subsubheading Further points
 
@@ -11974,7 +11993,7 @@
 block should be included in tangled extraction of source code files.
 
 @itemize @bullet
-@item @code{yes}
+@item @code{tangle}
 The code block is exported to a source code file named after the
 basename (name w/o extension) of the Org-mode file.  E.g., @code{:tangle
 yes}.
@@ -12047,7 +12066,7 @@
 The default.  No ``noweb'' syntax specific action is taken on evaluating
 code blocks, However, noweb references will still be expanded during
 tangling.
-@item @code{yes}
+@item @code{tangle}
 All ``noweb'' syntax references in the body of the code block will be
 expanded before the block is tangled, however ``noweb'' references will not
 be expanded when the block is evaluated or exported.
@@ -12091,7 +12110,7 @@
 The default.  No caching takes place, and the code block will be evaluated
 every time it is called.
 @item @code{yes}
-Every time the code block is run a sha1 hash of the code and arguments
+Every time the code block is run a SHA1 hash of the code and arguments
 passed to the block will be generated.  This hash is packed into the
 @code{#+results:} line and will be checked on subsequent
 executions of the code block.  If the code block has not
@@ -12269,9 +12288,9 @@
 This is the default. Internally, the value is obtained by wrapping the code
 in a function definition in the external language, and evaluating that
 function. Therefore, code should be written as if it were the body of such a
-function. In particular, note that python does not automatically return a
+function. In particular, note that Python does not automatically return a
 value from a function unless a @code{return} statement is present, and so a
-@samp{return} statement will usually be required in python.
+@samp{return} statement will usually be required in Python.
 
 This is the only one of the four evaluation contexts in which the code is
 automatically wrapped in a function definition.
@@ -12282,12 +12301,12 @@
 languages this also contains the error output stream; this is an area for
 future work.)
 
-@subsection @code{:session}
+@subsection Session
 @subsubsection @code{:results value}
 The code is passed to the interpreter running as an interactive Emacs
 inferior process. The result returned is the result of the last evaluation
 performed by the interpreter. (This is obtained in a language-specific
-manner: the value of the variable @code{_} in python and ruby, and the value
+manner: the value of the variable @code{_} in Python and Ruby, and the value
 of @code{.Last.value} in R).
 
 @subsubsection @code{:results output}
@@ -12310,7 +12329,7 @@
 : bye
 @end example
 
-In non-session mode, the '2' is not printed and does not appear.
+In non-session mode, the `2' is not printed and does not appear.
 @example
 #+begin_src python :results output :session
  print "hello"
@@ -12324,8 +12343,8 @@
 : bye
 @end example
 
-But in @code{:session} mode, the interactive interpreter receives input '2'
-and prints out its value, '2'. (Indeed, the other print statements are
+But in @code{:session} mode, the interactive interpreter receives input `2'
+and prints out its value, `2'. (Indeed, the other print statements are
 unnecessary here).
 
 @node Noweb reference syntax, Key bindings and useful functions, Results of evaluation, Working With Source Code
@@ -12573,7 +12592,7 @@
 into a complete EXAMPLE template.
 
 You can install additional templates by customizing the variable
-@code{org-structure-template-alist}. Refer docstring of the variable for
+@code{org-structure-template-alist}. See the docstring of the variable for
 additional details.
 
 @node Speed keys, Code evaluation security, Easy Templates, Miscellaneous
@@ -12588,7 +12607,7 @@
 pre-defined list of commands, and you can add more such commands using the
 variable @code{org-speed-commands-user}.  Speed keys do not only speed up
 navigation and other commands, but they also provide an alternative way to
-execute commands bound to keys that are not or not easily available on a tty,
+execute commands bound to keys that are not or not easily available on a TTY,
 or on a small mobile device with a limited keyboard.
 
 To see which commands are available, activate the feature and press @kbd{?}
@@ -12617,7 +12636,7 @@
 C-c} in the block.  The most important thing to realize here is that Org mode
 files which contain code snippets are, in a certain sense, like executable
 files.  So you should accept them and load them into Emacs only from trusted
-sources - just like you would do with a program you install on your computer.
+sources---just like you would do with a program you install on your computer.
 
 Make sure you know what you are doing before customizing the variables
 which take off the default security brakes.
@@ -12692,7 +12711,7 @@
 @vindex org-table-formula-constants
 @vindex org-table-formula
 Set file-local values for constants to be used in table formulas.  This
-line set the local variable @code{org-table-formula-constants-local}.
+line sets the local variable @code{org-table-formula-constants-local}.
 The global version of this variable is
 @code{org-table-formula-constants}.
 @item #+FILETAGS: :tag1:tag2:tag3:
@@ -12713,7 +12732,7 @@
 @vindex org-default-priority
 This line sets the limits and the default for the priorities.  All three
 must be either letters A-Z or numbers 0-9.  The highest priority must
-have a lower ASCII number that the lowest priority.
+have a lower ASCII number than the lowest priority.
 @item #+PROPERTY: Property_Name Value
 This line sets a default inheritance value for entries in the current
 buffer, most useful for specifying the allowed values of a property.
@@ -12894,12 +12913,12 @@
 nohideblocks @r{Do not hide blocks on startup}
 @end example
 @cindex org-pretty-entities
-The the display of entities as UTF8 characters is governed by the variable
+The display of entities as UTF-8 characters is governed by the variable
 @code{org-pretty-entities} and the keywords
 @cindex @code{entitiespretty}, STARTUP keyword
 @cindex @code{entitiesplain}, STARTUP keyword
 @example
-entitiespretty  @r{Show entities as UTF8 characters where possible}
+entitiespretty  @r{Show entities as UTF-8 characters where possible}
 entitiesplain   @r{Leave entities plain}
 @end example
 @item #+TAGS:  TAG1(c1) TAG2(c2)
@@ -13023,7 +13042,7 @@
 #+STARTUP: indent
 @end example
 
-If you want a similar effect in earlier version of Emacs and/or Org, or if
+If you want a similar effect in an earlier version of Emacs and/or Org, or if
 you want the indentation to be hard space characters so that the plain text
 file looks as similar as possible to the Emacs display, Org supports you in
 the following way:
@@ -13181,7 +13200,7 @@
 @cindex @file{cdlatex.el}
 @cindex Dominik, Carsten
 Org-mode can make use of the CDLa@TeX{} package to efficiently enter
-La@TeX{} fragments into Org files.  See @ref{CDLaTeX mode}.
+@LaTeX{} fragments into Org files.  See @ref{CDLaTeX mode}.
 @item @file{imenu.el} by Ake Stenhoff and Lars Lindberg
 @cindex @file{imenu.el}
 Imenu allows menu access to an index of items in a file.  Org-mode
@@ -13221,12 +13240,10 @@
 @kbd{C-c '} to edit them, similar to source code snippets.
 
 @table @kbd
-@kindex C-c '
-@item C-c '
+@orgcmd{C-c ',org-edit-special}
 Edit a @file{table.el} table.  Works when the cursor is in a table.el table.
 @c
-@kindex C-c ~
-@item C-c ~
+@orgcmd{C-c ~,org-table-create-with-table.el}
 Insert a @file{table.el} table.  If there is already a table at point, this
 command converts it between the @file{table.el} format and the Org-mode
 format.  See the documentation string of the command
@@ -13288,7 +13305,7 @@
 @item @file{yasnippet.el}
 @cindex @file{yasnippet.el}
 The way Org-mode binds the TAB key (binding to @code{[tab]} instead of
-@code{"\t"}) overrules yasnippets' access to this key.  The following code
+@code{"\t"}) overrules YASnippet's access to this key.  The following code
 fixed this problem:
 
 @lisp
@@ -13341,7 +13358,7 @@
 * Add-on packages::             Available extensions
 * Adding hyperlink types::      New custom link types
 * Context-sensitive commands::  How to add functionality to such commands
-* Tables in arbitrary syntax::  Orgtbl for La@TeX{} and other programs
+* Tables in arbitrary syntax::  Orgtbl for @LaTeX{} and other programs
 * Dynamic blocks::              Automatically filled blocks
 * Special agenda views::        Customized views
 * Extracting agenda information::  Postprocessing of agenda information
@@ -13470,7 +13487,7 @@
 the link description when the link is later inserted into an Org
 buffer with @kbd{C-c C-l}.
 
-When is makes sense for your new link type, you may also define a function
+When it makes sense for your new link type, you may also define a function
 @code{org-PREFIX-complete-link} that implements special (e.g. completion)
 support for inserting such a link with @kbd{C-c C-l}.  Such a function should
 not accept any arguments, and return the full link with prefix.
@@ -13521,7 +13538,7 @@
 
 Since Orgtbl mode can be used as a minor mode in arbitrary buffers, a
 frequent feature request has been to make it work with native tables in
-specific languages, for example La@TeX{}.  However, this is extremely
+specific languages, for example @LaTeX{}.  However, this is extremely
 hard to do in a general way, would lead to a customization nightmare,
 and would take away much of the simplicity of the Orgtbl-mode table
 editor.
@@ -13536,7 +13553,7 @@
 Bastien added the ability to do the same with lists, in Orgstruct mode.  You
 can use Org's facilities to edit and structure lists by turning
 @code{orgstruct-mode} on, then locally exporting such lists in another format
-(HTML, La@TeX{} or Texinfo.)
+(HTML, @LaTeX{} or Texinfo.)
 
 
 @menu
@@ -13594,7 +13611,7 @@
 @noindent
 The one problem remaining is how to keep the source table in the buffer
 without disturbing the normal workings of the file, for example during
-compilation of a C file or processing of a La@TeX{} file.  There are a
+compilation of a C file or processing of a @LaTeX{} file.  There are a
 number of different solutions:
 
 @itemize @bullet
@@ -13605,7 +13622,7 @@
 @item
 Sometimes it is possible to put the table after some kind of @i{END}
 statement, for example @samp{\bye} in @TeX{} and @samp{\end@{document@}}
-in La@TeX{}.
+in @LaTeX{}.
 @item
 You can just comment the table line-by-line whenever you want to process
 the file, and uncomment it whenever you need to edit the table.  This
@@ -13615,14 +13632,14 @@
 @end itemize
 
 @node A LaTeX example, Translator functions, Radio tables, Tables in arbitrary syntax
-@subsection A La@TeX{} example of radio tables
-@cindex La@TeX{}, and Orgtbl mode
-
-The best way to wrap the source table in La@TeX{} is to use the
+@subsection A @LaTeX{} example of radio tables
+@cindex @LaTeX{}, and Orgtbl mode
+
+The best way to wrap the source table in @LaTeX{} is to use the
 @code{comment} environment provided by @file{comment.sty}.  It has to be
 activated by placing @code{\usepackage@{comment@}} into the document
 header.  Orgtbl mode can insert a radio table skeleton@footnote{By
-default this works only for La@TeX{}, HTML, and Texinfo.  Configure the
+default this works only for @LaTeX{}, HTML, and Texinfo.  Configure the
 variable @code{orgtbl-radio-tables} to install templates for other
 modes.}  with the command @kbd{M-x orgtbl-insert-radio-table}.  You will
 be prompted for a table name, let's say we use @samp{salesfigures}.  You
@@ -13639,13 +13656,13 @@
 @end example
 
 @noindent
-@vindex La@TeX{}-verbatim-environments
+@vindex @LaTeX{}-verbatim-environments
 The @code{#+ORGTBL: SEND} line tells Orgtbl mode to use the function
-@code{orgtbl-to-latex} to convert the table into La@TeX{} and to put it
+@code{orgtbl-to-latex} to convert the table into @LaTeX{} and to put it
 into the receiver location with name @code{salesfigures}.  You may now
-fill in the table, feel free to use the spreadsheet features@footnote{If
+fill in the table---feel free to use the spreadsheet features@footnote{If
 the @samp{#+TBLFM} line contains an odd number of dollar characters,
-this may cause problems with font-lock in La@TeX{} mode.  As shown in the
+this may cause problems with font-lock in @LaTeX{} mode.  As shown in the
 example you can fix this by adding an extra line inside the
 @code{comment} environment that is used to balance the dollar
 expressions.  If you are using AUC@TeX{} with the font-latex library, a
@@ -13695,7 +13712,7 @@
 \end@{comment@}
 @end example
 
-The La@TeX{} translator function @code{orgtbl-to-latex} is already part of
+The @LaTeX{} translator function @code{orgtbl-to-latex} is already part of
 Orgtbl mode.  It uses a @code{tabular} environment to typeset the table
 and marks horizontal lines with @code{\hline}.  Furthermore, it
 interprets the following parameters (see also @pxref{Translator functions}):
@@ -13759,7 +13776,7 @@
 @var{PARAMS}) are combined with the ones newly defined in the function
 (variable @var{PARAMS2}).  The ones passed into the function (i.e. the
 ones set by the @samp{ORGTBL SEND} line) take precedence.  So if you
-would like to use the La@TeX{} translator, but wanted the line endings to
+would like to use the @LaTeX{} translator, but wanted the line endings to
 be @samp{\\[2mm]} instead of the default @samp{\\}, you could just
 overrule the default with
 
@@ -13768,7 +13785,7 @@
 @end example
 
 For a new language, you can either write your own converter function in
-analogy with the La@TeX{} translator, or you can use the generic function
+analogy with the @LaTeX{} translator, or you can use the generic function
 directly.  For example, if you have a language where a table is started
 with @samp{!BTBL!}, ended with @samp{!ETBL!}, and where table lines are
 started with @samp{!BL!}, ended with @samp{!EL!}, and where the field
@@ -13802,9 +13819,9 @@
 @cindex radio lists
 @cindex org-list-insert-radio-list
 
-Sending and receiving radio lists works exactly the same way than sending and
+Sending and receiving radio lists works exactly the same way as sending and
 receiving radio tables (@pxref{Radio tables}).  As for radio tables, you can
-insert radio lists templates in HTML, La@TeX{} and Texinfo modes by calling
+insert radio list templates in HTML, @LaTeX{} and Texinfo modes by calling
 @code{org-list-insert-radio-list}.
 
 Here are the differences with radio tables:
@@ -13821,8 +13838,8 @@
 @kbd{C-c C-c} will work when pressed on the first item of the list.
 @end itemize
 
-Here is a La@TeX{} example.  Let's say that you have this in your
-La@TeX{} file:
+Here is a @LaTeX{} example.  Let's say that you have this in your
+@LaTeX{} file:
 
 @cindex #+ORGLST
 @example
@@ -13839,7 +13856,7 @@
 @end example
 
 Pressing `C-c C-c' on @code{a new house} and will insert the converted
-La@TeX{} list between the two marker lines.
+@LaTeX{} list between the two marker lines.
 
 @node Dynamic blocks, Special agenda views, Tables in arbitrary syntax, Hacking
 @section Dynamic blocks
@@ -13850,11 +13867,11 @@
 A good example for such a block is the clock table inserted by the
 command @kbd{C-c C-x C-r} (@pxref{Clocking work time}).
 
-Dynamic block are enclosed by a BEGIN-END structure that assigns a name
+Dynamic blocks are enclosed by a BEGIN-END structure that assigns a name
 to the block and can also specify parameters for the function producing
 the content of the block.
 
-#+BEGIN:dynamic block
+@cindex #+BEGIN:dynamic block
 @example
 #+BEGIN: myblock :parameter1 value1 :parameter2 value2 ...
 
@@ -13864,11 +13881,9 @@
 Dynamic blocks are updated with the following commands
 
 @table @kbd
-@kindex C-c C-x C-u
-@item C-c C-x C-u
+@orgcmd{C-c C-x C-u,org-dblock-update}
 Update dynamic block at point.
-@kindex C-u C-c C-x C-u
-@item C-u C-c C-x C-u
+@orgkey{C-u C-c C-x C-u}
 Update all dynamic blocks in the current file.
 @end table
 
@@ -14037,7 +14052,7 @@
 @example
 emacs -batch -l ~/.emacs                                      \
    -eval '(org-batch-agenda "a"                               \
-            org-agenda-ndays 30                               \
+            org-agenda-span month                             \
             org-agenda-include-diary nil                      \
             org-agenda-files (quote ("~/org/project.org")))'  \
    | lpr
@@ -14115,7 +14130,7 @@
 Get all properties of the entry at point-or-marker POM.@*
 This includes the TODO keyword, the tags, time strings for deadline,
 scheduled, and clocking, and any additional properties defined in the
-entry.  The return value is an alist, keys may occur multiple times
+entry.  The return value is an alist.  Keys may occur multiple times
 if the property key was used several times.@*
 POM may also be nil, in which case the current entry is used.
 If WHICH is nil or `all', get all properties.  If WHICH is
@@ -14173,7 +14188,7 @@
 @end defun
 
 @defopt org-property-allowed-value-functions
-Hook for functions supplying allowed values for specific.
+Hook for functions supplying allowed values for a specific property.
 The functions must take a single argument, the name of the property, and
 return a flat list of allowed values.  If @samp{:ETC} is one of
 the values, use the values as completion help, but allow also other values
@@ -14252,12 +14267,12 @@
 Here are a couple of functions that might be handy:
 
 @defun org-todo &optional arg
-Change the TODO state of the entry, see the docstring of the functions for
+Change the TODO state of the entry.  See the docstring of the functions for
 the many possible values for the argument ARG.
 @end defun
 
 @defun org-priority &optional action
-Change the priority of the entry, see the docstring of this function for the
+Change the priority of the entry.  See the docstring of this function for the
 possible values for ACTION.
 @end defun
 
@@ -14325,7 +14340,7 @@
 @node Setting up the staging area, Pushing to MobileOrg, MobileOrg, MobileOrg
 @section Setting up the staging area
 
-MobileOrg needs to interact with Emacs through directory on a server.  If you
+MobileOrg needs to interact with Emacs through a directory on a server.  If you
 are using a public server, you should consider to encrypt the files that are
 uploaded to the server.  This can be done with Org-mode 7.02 and with
 @i{MobileOrg 1.5} (iPhone version), and you need an @file{openssl}
@@ -14340,8 +14355,7 @@
 The easiest way to create that directory is to use a free
 @uref{http://dropbox.com,Dropbox.com} account@footnote{If you cannot use
 Dropbox, or if your version of MobileOrg does not support it, you can use a
-webdav server.  For more information, check out the the documentation of
-MobileOrg and also this
+webdav server.  For more information, check out the documentation of MobileOrg and also this
 @uref{http://orgmode.org/worg/org-faq.php#mobileorg_webdav, FAQ entry}.}.
 When MobileOrg first connects to your Dropbox, it will create a directory
 @i{MobileOrg} inside the Dropbox.  After the directory has been created, tell
@@ -14361,7 +14375,7 @@
 to the directory @code{org-mobile-directory}.  By default this list contains
 all agenda files (as listed in @code{org-agenda-files}), but additional files
 can be included by customizing @code{org-mobiles-files}.  File names will be
-staged with path relative to @code{org-directory}, so all files should be
+staged with paths relative to @code{org-directory}, so all files should be
 inside this directory.  The push operation also creates a special Org file
 @file{agendas.org} with all custom agenda view defined by the
 user@footnote{While creating the agendas, Org-mode will force ID properties
@@ -14415,7 +14429,7 @@
 z C-y C-c C-c} to store that flagging note as a normal note in the entry.
 Pressing @kbd{?} twice in succession will offer to remove the
 @code{:FLAGGED:} tag along with the recorded flagging note (which is stored
-in a property).  In this way you indicate, that the intended processing for
+in a property).  In this way you indicate that the intended processing for
 this flagged entry is finished.
 @end table
 @end enumerate
@@ -14475,12 +14489,12 @@
 Org into a multi-language environment for evaluating code and doing literate
 programming and reproducible research.
 @item John Wiegley
-John has also contributed a number of great ideas and patches
-directly to Org, including the attachment system (@file{org-attach.el}),
-integration with Apple Mail (@file{org-mac-message.el}), hierarchical
-dependencies of TODO items, habit tracking (@file{org-habits.el}), and
-encryption (@file{org-crypt.el}).  Also, the capture system is really an
-extended copy of his great @file{remember.el}.
+John has contributed a number of great ideas and patches directly to Org,
+including the attachment system (@file{org-attach.el}), integration with
+Apple Mail (@file{org-mac-message.el}), hierarchical dependencies of TODO
+items, habit tracking (@file{org-habits.el}), and encryption
+(@file{org-crypt.el}).  Also, the capture system is really an extended copy
+of his great @file{remember.el}.
 @item Sebastian Rose
 Without Sebastian, the HTML/XHTML publishing of Org would be the pitiful work
 of an ignorant amateur.  Sebastian has pushed this part of Org onto a much
@@ -14537,8 +14551,9 @@
 @i{Thomas S. Dye} contributed documentation on Worg and helped integrating
 the Org-Babel documentation into the manual.
 @item
-@i{Christian Egli} converted the documentation into Texinfo format,
-patched CSS formatting into the HTML exporter, and inspired the agenda.
+@i{Christian Egli} converted the documentation into Texinfo format, inspired
+the agenda, patched CSS formatting into the HTML exporter, and wrote
+@file{org-taskjuggler.el}.
 @item
 @i{David Emery} provided a patch for custom CSS support in exported
 HTML agendas.
@@ -14556,12 +14571,21 @@
 @item
 @i{Austin Frank} works as a mailing list moderator.
 @item
+@i{Eric Fraga} drove the development of BEAMER export with ideas and
+testing.
+@item
+@i{Barry Gidden} did proofreading the manual in preparation for the book
+publication through Network Theory Ltd.
+@item
 @i{Niels Giesen} had the idea to automatically archive DONE trees.
 @item
 @i{Nicolas Goaziou} rewrote much of the plain list code.
 @item
 @i{Kai Grossjohann} pointed out key-binding conflicts with other packages.
 @item
+@i{Brian Gough} of Network Theory Ltd publishes the Org mode manual as a
+book.
+@item
 @i{Bernt Hansen} has driven much of the support for auto-repeating tasks,
 task state change logging, and the clocktable.  His clear explanations have
 been critical when we started to adopt the Git version control system.
@@ -14578,7 +14602,7 @@
 @item
 @i{Tokuya Kameshima} wrote @file{org-wl.el} and @file{org-mew.el}.
 @item
-@i{Shidai Liu} ("Leo") asked for embedded La@TeX{} and tested it.  He also
+@i{Shidai Liu} ("Leo") asked for embedded @LaTeX{} and tested it.  He also
 provided frequent feedback and some patches.
 @item
 @i{Matt Lundin} has proposed last-row references for table formulas and named
@@ -14610,7 +14634,7 @@
 @i{Tim O'Callaghan} suggested in-file links, search options for general
 file links, and TAGS.
 @item
-@i{Osamu Okano} wrote @file{orgcard2ref.pl}, a perl program to create a text
+@i{Osamu Okano} wrote @file{orgcard2ref.pl}, a Perl program to create a text
 version of the reference card.
 @item
 @i{Takeshi Okano} translated the manual and David O'Toole's tutorial
@@ -14680,6 +14704,9 @@
 @i{David O'Toole} wrote @file{org-publish.el} and drafted the manual
 chapter about publishing.
 @item
+@i{Sebastien Vauban} reported many issues with LaTeX and BEAMER export and
+enabled source code highlighling in Gnus.
+@item
 @i{Stefan Vollmar} organized a video-recorded talk at the
 Max-Planck-Institute for Neurology.  He also inspired the creation of a
 concept index for HTML export.
@@ -14739,6 +14766,8 @@
 @c Local variables:
 @c fill-column: 77
 @c indent-tabs-mode: nil
+@c paragraph-start:    "\\|^@[a-zA-Z]*[ \n]\\|^@x?org\\(key\\|cmd\\)\\|\f\\|[ 	]*$"
+@c paragraph-separate: "\\|^@[a-zA-Z]*[ \n]\\|^@x?org\\(key\\|cmd\\)\\|[ 	\f]*$"
 @c End:
 
 
Binary file doc/misc/tramp.texi has changed
--- a/etc/ChangeLog	Thu Dec 16 17:43:45 2010 -0500
+++ b/etc/ChangeLog	Thu Dec 16 18:30:57 2010 -0500
@@ -1,3 +1,19 @@
+2010-12-14  Michael Albinus  <michael.albinus@gmx.de>
+
+	* NEWS: Mention new Tramp method "ksu".
+
+2010-12-13  W. Martin Borgert <debacle@debian.org>  (tiny change)
+
+	* schema/schemas.xml: Add DocBook (Bug#7491).
+
+2010-12-11  Carsten Dominik  <carsten.dominik@gmail.com>
+
+	* refcards/orgcard.tex: Cleanup.
+
+2010-11-27  Ulrich Mueller  <ulm@gentoo.org>
+
+	* HELLO: Add ancient Greek (Bug#7418).
+
 2010-11-13  Eli Zaretskii  <eliz@gnu.org>
 
 	* NEWS: Document display of glyphless characters.
--- a/etc/HELLO	Thu Dec 16 17:43:45 2010 -0500
+++ b/etc/HELLO	Thu Dec 16 18:30:57 2010 -0500
@@ -33,6 +33,7 @@
 Georgian ($,1JEJ0J@J7J5J4J:J8(B)	$,1J2J0J;J0J@JOJ=J1J0(B
 German (Deutsch)	Guten Tag / Gr,A|_(B Gott
 Greek (,Fekkgmij\(B)	,FCei\(B ,Fsar(B
+Greek, ancient ($,1p1,Fkkgmij^(B)	,FO$,1pv,Fk](B ,Fte(B ,Fja$,1q6(B ,Fl]ca(B ,Fwa$,1r6,Fqe(B
 Gujarati ($,19W:!9\9p9~9d: (B)	$,19h9n9x:-9d:'(B
 Hebrew $,1ro(B($,1-",q-(,y-*(B)	,Hylem(B
 Hungarian (magyar)	Sz,Bi(Bp j,Bs(B napot!
--- a/etc/NEWS	Thu Dec 16 17:43:45 2010 -0500
+++ b/etc/NEWS	Thu Dec 16 18:30:57 2010 -0500
@@ -56,8 +56,8 @@
 * Startup Changes in Emacs 24.1
 
 ** The --unibyte, --multibyte, --no-multibyte, and --no-unibyte
-command line arguments no longer have any effect.  (They were declared
-obsolete in Emacs 23.)
+command line arguments, and the EMACS_UNIBYTE environment variable, no
+longer have any effect.  (They were declared obsolete in Emacs 23.)
 
 
 * Changes in Emacs 24.1
@@ -228,10 +228,13 @@
 +++
 ** There is a new command `count-words-region', which does what you expect.
 
-** completion-at-point is now an alias for complete-symbol.
+** completion-at-point now handles tags and semantic completion.
 
 ** The default value of `backup-by-copying-when-mismatch' is now t.
 
+** The command `just-one-space' (C-SPC), if given a negative argument,
+also deletes newlines around point.
+
 ** Deletion changes
 
 *** New option `delete-active-region'.
@@ -303,6 +306,10 @@
 
 *** Support for X cut buffers has been removed.
 
+** New command `rectangle-number-lines', bound to `C-x r N', numbers
+the lines in the current rectangle.  With an prefix argument, this
+prompts for a number to count from and for a format string.
+
 
 * Changes in Specialized Modes and Packages in Emacs 24.1
 
@@ -317,6 +324,9 @@
 
 ** Archive Mode has basic support to browse 7z archives.
 
+** browse-url has gotten a new variable that is used for mailto: URLs,
+   `browse-url-mailto-function', which defaults to `browse-url-mail'.
+
 ** ERC changes
 
 *** New vars `erc-autojoin-timing' and `erc-autojoin-delay'.
@@ -330,6 +340,12 @@
 The default is to decode strings that can be decoded as utf-8 as
 utf-8, and do the normal `undecided' decoding for the rest.
 
+** Eshell changes
+
+*** The default value of eshell-directory-name is a directory named
+"eshell" in `user-emacs-directory'.  If the old "~/.eshell/" directory
+exists, that is used instead.
+
 ** In ido-mode, C-v is no longer bound to ido-toggle-vc.
 The reason is that this interferes with cua-mode.
 
@@ -539,9 +555,29 @@
 
 ** Tramp
 
+*** There exists a new inline access method "ksu" (kerberized su).
+
 *** The following access methods are discontinued: "ssh1_old",
 "ssh2_old", "scp1_old", "scp2_old" and "fish".
 
+** VC and related modes
+
+*** Support for pulling on distributed version control systems.
+The vc-update command now runs a "pull" operation, if it is supported.
+This updates the current branch from upstream.  A prefix argument
+means to prompt the user for command specifics, e.g. a pull location.
+
+**** vc-pull is an alias for vc-update.
+
+**** Currently supported by Bzr.
+
+*** Support for merging on distributed version control systems.
+The vc-merge command now runs a "merge" operation, if it is supported.
+This merges another branch into the current one.  A prefix argument
+means to prompt the user for command specifics, e.g. a merge location.
+
+**** Currently supported by Bzr.
+
 
 * New Modes and Packages in Emacs 24.1
 
--- a/etc/NEWS.23	Thu Dec 16 17:43:45 2010 -0500
+++ b/etc/NEWS.23	Thu Dec 16 18:30:57 2010 -0500
@@ -21,9 +21,6 @@
 
 * Changes in Emacs 23.3
 
-** The nextstep port can have different modifiers for the left and right
-alt/option key by customizing the value for ns-right-alternate-modifier.
-
 
 * Editing Changes in Emacs 23.3
 
@@ -34,6 +31,42 @@
 ** The appt-add command takes an optional argument for the warning time.
 This can be used in place of the default appt-message-warning-time.
 
+---
+** You can allow inferior Python processes to load modules from the
+current directory by setting `python-remove-cwd-from-path' to nil.
+
+** VC and related modes
+
+*** New VC command `vc-log-incoming', bound to `C-x v I'.
+This shows a log of changes to be received with a pull operation.
+For Git, this runs "git fetch" to make the necessary data available
+locally; this requires version 1.7 or newer.
+
+*** New VC command `vc-log-outgoing', bound to `C-x v O'.
+This shows a log of changes to be sent in the next commit.
+
+*** New VC command vc-find-conflicted-file.
+
++++
+*** The 'g' key in VC diff, log, log-incoming and log-outgoing buffers
+reruns the corresponding VC command to compute an up to date version
+of the buffer.
+
+*** vc-dir for Bzr supports viewing shelve contents and shelving snapshots.
+
++++
+*** Special markup can be added to log-edit buffers.
+You can add headers specifying additional information to be supplied
+to the version control system.  For example:
+
+  Author: J. R. Hacker <jrh@example.com>
+  Fixes: 4204
+  Actual text of log entry...
+
+Bazaar recognizes the headers "Author", "Date" and "Fixes".
+Git, Mercurial, and Monotone recognize "Author" and "Date".
+Any unknown header is left as is in the message, so it is not lost.
+
 ** Obsolete packages
 
 +++
@@ -41,10 +74,12 @@
 
 
 * New Modes and Packages in Emacs 23.3
+
 ** smie.el is a generic navigation and indentation engine.
 It takes a simple BNF description of the grammar, and provides both
 sexp-style navigation (jumping over begin..end pairs) as well as
 indentation, which can be adjusted via ad-hoc indentation rules.
+
 
 * Incompatible Lisp Changes in Emacs 23.3
 
@@ -55,16 +90,29 @@
 
 * Lisp changes in Emacs 23.3
 
++++
 ** `e' and `pi' are now called `float-e' and `float-pi'.
   The old names are obsolete.
-** The use of unintern without an obarray arg is declared obsolete.
-** The function `princ-list' is declared obsolete.
-** The yank-handler argument to kill-region and friends is declared obsolete.
+
++++
+** The use of unintern without an obarray arg is now obsolete.
+
+---
+** The function `princ-list' is now obsolete.
+
++++
+** The yank-handler argument to kill-region and friends is now obsolete.
+
++++
 ** New function byte-to-string, like char-to-string but for bytes.
 
 
 * Changes in Emacs 23.3 on non-free operating systems
 
++++
+** The nextstep port can have different modifiers for the left and right
+alt/option key by customizing the value for ns-right-alternate-modifier.
+
 
 * Installation Changes in Emacs 23.2
 
--- a/etc/TODO	Thu Dec 16 17:43:45 2010 -0500
+++ b/etc/TODO	Thu Dec 16 18:30:57 2010 -0500
@@ -1,7 +1,7 @@
 Emacs TODO List                                                   -*-outline-*-
 
-Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
-  Free Software Foundation, Inc.
+Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
+  2010  Free Software Foundation, Inc.
 See the end of the file for license conditions.
 
 
@@ -40,7 +40,6 @@
   fix_submap_inheritance hack and to more cleanly express the
   relationship between minibuffer-local-*-map): I've had this locally
   for a long time, but the details of the semantics is somewhat ... delicate.
-*** Derive from prog-mode in more places, close bug#5532.
 *** prog-mode could/should provide a better fill-paragraph default
   that uses syntax-tables to recognize string/comment boundaries.
 *** provide more completion-at-point-functions.  Make existing
@@ -56,8 +55,6 @@
 
 ** Convert modes that use view-mode to be derived from special-mode instead.
 
-** Replace some uses of the preprocessor code in Makefile.in with the equivalent autoconf.
-
 ** Major modes should have a menu entry.  Examples of modes that do
 not have one at the moment and probably should: text-mode, inferior-lisp-mode.
 
@@ -206,8 +203,7 @@
 ** Imenu could be extended into a file-structure browsing mechanism
 using code like that of customize-groups.
 
-** Display something in the margin on lines that have compilation
-errors.
+** Display something in the margin on lines that have compilation errors.
 
 ** Compilation error navigation bar, parallel to the scroll bar,
 indicating where in the buffer there are compilation errors.
@@ -325,8 +321,7 @@
 
 ** ange-ftp
 *** understand sftp
-   This is hard to make work because sftp doesn't print status
-   messages.
+   This is hard to make work because sftp doesn't print status messages.
 
 *** Use MLS for ange-ftp-insert-directory if a list of files is specified.
 
@@ -364,8 +359,7 @@
   will then come in encoded in UTF-16.
 
   One advantage of switching to Unicode is to toss encoded-kbd usage,
-  which will solve the problem with binding non-ASCII keys with
-  modifiers.
+  which will solve the problem with binding non-ASCII keys with modifiers.
 
   Problem: using this on Windows 9x/ME requires installing the
   Microsoft Layer for Unicode (MSLU), which might not implement all
@@ -391,8 +385,7 @@
 ** Make desktop.el save the "frame configuration" of Emacs (in some
   useful sense).
 
-** Give desktop.el a feature to switch between different named
-  desktops.
+** Give desktop.el a feature to switch between different named desktops.
 
 ** Add a cpio mode, more or less like tar mode.
 
@@ -447,13 +440,12 @@
 
 ** Eliminate the storm of warnings concerning char/unsigned char
   mismatches that we get with GCC 4.x and proprietary compilers on
-  various systems.  They make it difficult to spot the important
-  warnings.
+  various systems.  They make it difficult to spot the important warnings.
 
 ** Fix anything necessary to use `long long' EMACS_INTs with GCC.
 
-** Split out parts of lisp.h and generate Makefile dependencies
-  automatically.
+** Split out parts of lisp.h [and generate Makefile dependencies automatically.]
+[the last bit is done, see DEPFLAGS etc in src/Makefile.in ]
 
 ** Update the FAQ.
 
@@ -466,8 +458,7 @@
   [Do the existing -Q and -D cover this, or is more needed?]
 
 ** Improve the GC (generational, incremental).  (We may be able to use
-  the Boehm collector.)  [See the Boehm-GC branch in CVS for work on
-  this.]
+  the Boehm collector.)  [See the Boehm-GC branch in CVS for work on this.]
 
 ** Check what hooks would help Emacspeak -- see the defadvising in W3.
 
@@ -527,8 +518,7 @@
 ** Reorder defcustom's in each package so that the more important
   options come first in the Customize buffers.  This could be done by
   either rearranging the file (since options are shown in the order
-  they appear in the *.el files), or by adding a few :set-after
-  attributes.
+  they appear in the *.el files), or by adding a few :set-after attributes.
 
 ** Maybe document the features of libraries missing from the manual (or
   ancillary manuals, including the Lisp manual in some cases).
@@ -1230,4 +1220,3 @@
 You should have received a copy of the GNU General Public License
 along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
 
-;;; arch-tag: b0a3e40b-726a-457d-9999-ba848321b036
--- a/etc/refcards/orgcard.tex	Thu Dec 16 17:43:45 2010 -0500
+++ b/etc/refcards/orgcard.tex	Thu Dec 16 18:30:57 2010 -0500
@@ -1,5 +1,5 @@
 % Reference Card for Org Mode
-\def\orgversionnumber{7.3}
+\def\orgversionnumber{7.4}
 \def\versionyear{2010}          % latest update
 \def\year{2010}                 % latest copyright year
 
@@ -266,6 +266,10 @@
 \def\threecol#1#2#3{\hskip\keyindent\relax#1\hfil&\kbd{#2}\hfil\quad
   &\kbd{#3}\hfil\quad\cr}
 
+\def\noteone{{\small \hfill [1]}}
+\def\notetwo{{\small \hfill [2]}}
+
+
 %**end of header
 
 
@@ -274,14 +278,6 @@
 \centerline{(for version \orgversionnumber)}
 
 \section{Getting Started}
-%
-%\vskip -2mm
-%\beginexample%
-%(add-to-list 'auto-mode-alist '("\\\\.org\$" . org-mode))
-%(define-key global-map "\\C-cl" 'org-store-link)$^1$
-%(define-key global-map "\\C-ca" 'org-agenda)$^1$
-%\endexample
-%
 \metax{To read the on-line documentation try}{M-x org-info}
 
 \section{Visibility Cycling}
@@ -298,7 +294,7 @@
 \key{next/previous heading, same level}{C-c C-f/b}
 \key{backward to higher level heading}{C-c C-u}
 \key{jump to another place in document}{C-c C-j}
-\key{previous/next plain list item}{S-UP/DOWN$^3$}
+\key{previous/next plain list item}{S-UP/DOWN\notetwo}
 
 \section{Structure Editing}
 
@@ -310,17 +306,16 @@
 \key{turn item/line into headline}{C-c *}
 \key{promote/demote heading}{M-LEFT/RIGHT}
 \metax{promote/demote current subtree}{M-S-LEFT/RIGHT}
-
 \metax{move subtree/list item up/down}{M-S-UP/DOWN}
 \metax{sort subtree/region/plain-list}{C-c \^{}}
 \metax{clone a subtree}{C-c C-x c}
-\metax{refile subtree}{C-c C-w}
 \metax{kill/copy subtree}{C-c C-x C-w/M-w}
 \metax{yank subtree}{C-c C-x C-y or C-y}
 \metax{narrow buffer to subtree / widen}{C-x n s/w}
 
-\section{Archiving}
-
+\section{Capture - Refile - Archiving}
+\key{capture a new item (C-u C-u = goto last)}{C-c c \noteone}
+\key{refile subtree (C-u C-u = goto last)}{C-c C-w}
 \key{archive subtree using the default command}{C-c C-x C-a}
 \key{move subtree to archive file}{C-c C-x C-s}
 \key{toggle ARCHIVE tag / to ARCHIVE sibling}{C-c C-x a/A}
@@ -330,7 +325,7 @@
 
 \key{construct a sparse tree by various criteria}{C-c /}
 \key{view TODO's in sparse tree}{C-c / t/T}
-\key{global TODO list in agenda mode}{C-c a t$^1$}
+\key{global TODO list in agenda mode}{C-c a t \noteone}
 \key{time sorted view of current org file}{C-c a L}
 
 \section{Tables}
@@ -428,7 +423,7 @@
 
 \section{Links}
 
-\key{globally store link to the current location}{C-c l$^1$}
+\key{globally store link to the current location}{C-c l \noteone}
 \key{insert a link (TAB completes stored links)}{C-c C-l}
 \key{insert file link with file name completion}{C-u C-c C-l}
 \key{edit (also hidden part of) link at point}{C-c C-l}
@@ -444,35 +439,6 @@
 \key{edit code snippet of file at point}{C-c '}
 \key{toggle inline display of linked images}{C-c C-x C-v}
 
-% {\bf Internal Links}
-
-% \key{\kbd{<<My Target>>}}{\rm target}
-% \key{\kbd{<<<My Target>>>}}{\rm radio target$^2$}
-% \key{\kbd{[[*this text]]}}{\rm find headline}
-% \metax{\kbd{[[this text]]}}{\rm find target or text in buffer}
-% \metax{\kbd{[[this text][description]]}}{\rm optional link text}
-
-% {\bf External Links}
-
-% \key{\kbd{file:/home/dominik/img/mars.jpg}}{\rm file, absolute}
-% \key{\kbd{file:papers/last.pdf}}{\rm file, relative}
-% \key{\kbd{file:projects.org::*that text}}{\rm find headline}
-% \key{\kbd{file:projects.org::find me}}{\rm find trgt/string}
-% %\key{\kbd{file:projects.org::/regexp/}}{\rm regexp search}
-% \key{\kbd{http://www.astro.uva.nl/~dominik}}{\rm on the web}
-% \key{\kbd{mailto:adent@galaxy.net}}{\rm Email address}
-% \key{\kbd{news:comp.emacs}}{\rm Usenet group}
-% \key{\kbd{bbdb:Richard Stallman}}{\rm BBDB person}
-% \key{\kbd{gnus:group}}{\rm GNUS group}
-% \key{\kbd{gnus:group\#id}}{\rm GNUS message}
-% \key{\kbd{vm|wl|mhe|rmail:folder}}{\rm Mail folder}
-% \key{\kbd{vm|wl|mhe|rmail:folder\#id}}{\rm Mail message}
-% \key{\kbd{info:emacs:Regexps}}{\rm Info file:node}
-% \key{\kbd{shell:ls *.org}}{\rm shell command}
-% \key{\kbd{elisp:(calendar)}}{\rm elisp form}
-% \metax{\kbd{[[external link][description]]}}{\rm optional link text}
-% %\key{\kbd{vm://myself@some.where.org/folder\#id}}{\rm VM remote}
-
 \section{Working with Code (Babel)}
 
 \key{execute code block at point}{C-c C-c}
@@ -494,25 +460,6 @@
 \key{load expanded body of the current code block into a session}{C-c C-v l}
 \key{view sha1 hash of the current code block}{C-c C-v a}
 
-% \section{Remember-mode Integration}
-
-% See the manual for how to make remember.el use Org-mode links and
-% files.  The note-finishing command \kbd{C-c C-c} will first prompt for
-% an org file. In the file, find a location with:
-
-% \key{rotate subtree visibility}{TAB}
-% \key{next heading}{DOWN}
-% \key{previous heading}{UP}
-
-% Insert the note with one of the following: 
-
-% \key{as sublevel of heading at cursor}{RET}
-% \key{right here (cursor not on heading)}{RET}
-% \key{before current heading}{LEFT}
-% \key{after current heading}{RIGHT}
-% \key{shortcut to end of buffer (cursor at buf-start)}{RET}
-% \key{Abort}{q}
-
 \section{Completion}
 
 In-buffer completion completes TODO keywords at headline start, TeX
@@ -538,11 +485,7 @@
 
 \key{set the priority of the current item}{C-c , [ABC]}
 \key{remove priority cookie from current item}{C-c , SPC}
-\key{raise/lower priority of current item}{S-UP/DOWN$^3$}
-%\key{lower priority of current item}{S-DOWN$^3$}
-
-%\key{\kbd{\#+SEQ_TODO: TODO TRY BLUFF DONE}}{\rm todo workflow}
-%\key{\kbd{\#+TYP_TODO: Phil home work DONE}}{\rm todo types}
+\key{raise/lower priority of current item}{S-UP/DOWN\notetwo}
 
 \key{insert new checkbox item in plain list}{M-S-RET}
 \key{toggle checkbox(es) in region/entry/at point}{C-c C-x C-b}
@@ -585,8 +528,8 @@
 \key{insert SCHEDULED timestamp}{C-c C-s}
 \key{create sparse tree with all deadlines due}{C-c / d}
 \key{the time between 2 dates in a time range}{C-c C-y}
-\key{change timestamp at cursor by $\pm 1$ day}{S-RIGHT/LEFT$^3$}
-\key{change year/month/day at cursor by $\pm 1$}{S-UP/DOWN$^3$}
+\metax{change timestamp at cursor $\pm 1$ day}{S-RIGHT/LEFT\notetwo}
+\key{change year/month/day at cursor by $\pm 1$}{S-UP/DOWN\notetwo}
 \key{access the calendar for the current date}{C-c >}
 \key{insert timestamp matching date in calendar}{C-c <}
 \key{access agenda for current date}{C-c C-o}
@@ -615,15 +558,15 @@
 \key{cycle through agenda file list}{C-'}
 \key{set/remove restriction lock}{C-c C-x </>}
 
-\key{compile agenda for the current week}{C-c a a$^1$}
-\key{compile global TODO list}{C-c a t$^1$}
-\key{compile TODO list for specific keyword}{C-c a T$^1$}
-\key{match tags, TODO kwds, properties}{C-c a m$^1$}
-\key{match only in TODO entries}{C-c a M$^1$}
-\key{find stuck projects}{C-c a \#$^1$}
-\key{show timeline of current org file}{C-c a L$^1$}
-\key{configure custom commands}{C-c a C$^1$}
-%\key{configure stuck projects}{C-c a !$^1$}
+\key{compile agenda for the current week}{C-c a a \noteone}
+\key{compile global TODO list}{C-c a t \noteone}
+\key{compile TODO list for specific keyword}{C-c a T \noteone}
+\key{match tags, TODO kwds, properties}{C-c a m \noteone}
+\key{match only in TODO entries}{C-c a M \noteone}
+\key{find stuck projects}{C-c a \# \noteone}
+\key{show timeline of current org file}{C-c a L \noteone}
+\key{configure custom commands}{C-c a C \noteone}
+%\key{configure stuck projects}{C-c a ! \noteone}
 \key{agenda for date at cursor}{C-c C-o}
 
 {\bf Commands available in an agenda buffer}
@@ -664,10 +607,10 @@
 \key{set/show tags of current headline}{: / T}
 \key{set effort property (prefix=nth)}{e}
 \key{set / compute priority of current item}{, / P}
-\key{raise/lower priority of current item}{S-UP/DOWN$^3$}
+\key{raise/lower priority of current item}{S-UP/DOWN\notetwo}
 \key{run an attachment command}{C-c C-a}
 \key{schedule/set deadline for this item}{C-c C-s/d}
-\key{change timestamp to one day earlier/later}{S-LEFT/RIGHT$^3$}
+\metax{change timestamp one day earlier/later}{S-LEFT/RIGHT\notetwo}
 \key{change timestamp to today}{>}
 \key{insert new entry into diary}{i}
 \newcolumn
@@ -713,43 +656,6 @@
 \key{toggle fixed width for entry or region}{C-c :}
 \key{toggle pretty display of scripts, entities}{C-c C-x {\tt\char`\\}}
 
-%{\bf HTML formatting}
-
-%\key{make words {\bf bold}}{*bold*}
-%\key{make words {\it italic}}{/italic/}
-%\key{make words \underbar{underlined}}{_underlined_}
-%\key{sub- and superscripts}{x\^{}3, J_dust}
-%\key{\TeX{}-like macros}{\\alpha, \\to}
-%\key{typeset lines in fixed width font}{start with :}
-%\key{tables are exported as HTML tables}{start with |}
-%\key{links become HTML links}{http:... etc}
-%\key{include html tags}{@<b>...@</b>}
-
-%{\bf Export options}
-%
-%Include additional information for export by putting these anywhere in the
-%org file.  Use {\tt M-TAB} completion to make sure to get the right
-%keywords. {\tt M-TAB} again just after keyword is complete inserts examples.
-%
-%\key{the title to be shown}{\#+TITLE:}
-%\key{the author}{\#+AUTHOR:}
-%\key{authors email address}{\#+EMAIL:}
-%\key{language code for html}{\#+LANGUAGE:}
-%\key{free text description of file}{\#+TEXT:}
-%\key{... which can carry over multiple lines}{\#+TEXT:}
-%\key{settings for the export process}{\#+OPTIONS:}
-
-%\key{set number of headline levels for export}{H:2}
-%\key{turn on/off section numbers}{num:t}
-%\key{turn on/off table of contents}{toc:t}
-%\key{turn on/off linebreak preservation}{\\n:nil}
-%\key{turn on/off quoted html tags}{@:t}
-%\key{turn on/off fixed width sections}{::t}
-%\key{turn on/off tables}{|:t}
-%\key{turn on/off \TeX\ syntax for sub/super-scripts}{\^{}:t}
-%\key{turn on/off emphasised text}{*:nil}
-%\key{turn on/off \TeX\ macros}{TeX:t}
-
 {\bf Comments: Text not being exported}
 
 Lines starting with \kbd{\#} and subtrees starting with COMMENT are
@@ -763,13 +669,10 @@
 \metax{update all dynamic blocks}{C-u C-c C-x C-u}
 
 \section{Notes}
-$^1$ This is only a suggestion for a binding of this command.  Choose
+[1] This is only a suggestion for a binding of this command.  Choose
 your own key as shown under INSTALLATION.
 
-$^2$ After changing a \kbd{\#+KEYWORD} or \kbd{<<<target>>>} line,
-press \kbd{C-c C-c} with the cursor still in the line to update.
-
-$^3$ Keybinding affected by {\tt org-support-shift-select} and
+[2] Keybinding affected by {\tt org-support-shift-select} and also
  {\tt org-replace-disputed-keys}.
 
 \copyrightnotice
--- a/etc/schema/schemas.xml	Thu Dec 16 17:43:45 2010 -0500
+++ b/etc/schema/schemas.xml	Thu Dec 16 18:30:57 2010 -0500
@@ -22,6 +22,7 @@
   <uri pattern="*.html" typeId="XHTML"/>
   <uri pattern="*.rng" typeId="RELAX NG"/>
   <uri pattern="*.rdf" typeId="RDF"/>
+  <uri pattern="*.dbk" typeId="DocBook"/>
 
   <namespace ns="http://www.w3.org/1999/XSL/Transform" typeId="XSLT"/>
   <namespace ns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" typeId="RDF"/>
--- a/lib-src/ChangeLog	Thu Dec 16 17:43:45 2010 -0500
+++ b/lib-src/ChangeLog	Thu Dec 16 18:30:57 2010 -0500
@@ -1,3 +1,8 @@
+2010-11-27  Joe Matarazzo  <joe.matarazzo@gmail.com>  (tiny change)
+
+	* ebrowse.c (yylex): If end of input buffer encountered while
+	searching for a newline after "//", return YYEOF.  (Bug#7446)
+
 2010-11-18  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
 
 	* emacsclient.c (set_local_socket) [DARWIN_OS]: Add fall-back
--- a/lib-src/ebrowse.c	Thu Dec 16 17:43:45 2010 -0500
+++ b/lib-src/ebrowse.c	Thu Dec 16 18:30:57 2010 -0500
@@ -1700,6 +1700,11 @@
             case '/':
 	      while (GET (c) && c != '\n')
 		;
+	      /* Don't try to read past the end of the input buffer if
+		 the file ends in a C++ comment without a newline.  */
+	      if (c == 0)
+		return YYEOF;
+
 	      INCREMENT_LINENO;
 	      break;
 
--- a/lisp/ChangeLog	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/ChangeLog	Thu Dec 16 18:30:57 2010 -0500
@@ -1,3 +1,853 @@
+2010-12-16  Daiki Ueno  <ueno@unixuser.org>
+
+	* epa-file.el (epa-file-select-keys): Accept 'silent to inhibit
+	key selection prompt; make 'silent as default (Bug#7487).
+
+2010-12-16  Leo  <sdl.web@gmail.com>
+
+	* eshell/eshell.el (eshell-directory-name): Use
+	locate-user-emacs-file (Bug#7578).
+
+2010-12-15  Glenn Morris  <rgm@gnu.org>
+
+	* loadup.el (symbol-file-load-history-loaded): Remove; unused.
+
+2010-12-15  Jari Aalto  <jari.aalto@cante.net>
+            Scott Evans <gse@antisleep.com>
+
+	* rect.el (rectange--default-line-number-format)
+	(rectangle-number-line-callback): New functions.
+	(rectangle-number-lines): New command, bound to C-x r N (Bug#4382).
+
+2010-12-15  Chong Yidong  <cyd@stupidchicken.com>
+
+	* rect.el (operate-on-rectangle-lines, string-rectangle-string):
+	Delete unused variables.
+	(move-to-column-force): Remove function obsolete since 21.2.
+
+2010-12-14  Michael Albinus  <michael.albinus@gmx.de>
+
+	* net/tramp.el (tramp-temp-buffer-file-name): Make it permanent-local.
+	(tramp-handle-insert-file-contents): Do not set permanent-local
+	property.
+
+	* net/tramp-cache.el (tramp-persistency-file-name): Use
+	`locate-user-emacs-file' if fboundp.
+
+	* net/tramp-sh.el (tramp-methods): Add "ksu".
+	(tramp-default-user-alist): Add "ksu".  Use `regexp-opt' for
+	method list.
+
+2010-12-14  Glenn Morris  <rgm@gnu.org>
+
+	* progmodes/js.el: Doc't require font-lock, etags, or easymenu.
+	(find-tag-marker-ring): Declare.
+	(js-find-symbol): Require etags.
+
+	* mail/sendmail.el: Don't require rmail or mailalias when compiling.
+	Require mail-utils.
+	(mail-alias-file): Don't autoload.  Doc fix.
+	(mail-bury-selects-summary, mail-send-nonascii): Don't autoload.
+	(mail-mailer-swallows-blank-line): Default to nil.  Doc fix.
+	Mark as obsolete, and risky.
+	(mail-setup): Simplify.
+
+	* mail/mailalias.el (build-mail-aliases): Make it interactive.
+	* mail/sendmail.el (build-mail-aliases): Update autoload.
+
+	* dired.el (dired-trivial-filenames, dired-chown-program)
+	(dired-auto-revert-buffer): Remove autoload cookies.
+	* mail/sendmail.el (mail-recover-1): Require 'dired.
+
+	* dired.el (dired-subdir-switches, dired-chown-program)
+	(dired-use-ls-dired, dired-chmod-program, dired-touch-program):
+	Make into defcustoms.
+	(dired-chown-program): Simplify initialization.
+
+	* mail/mail-utils.el: No need to require lisp-mode, it's in loadup.
+
+2010-12-13  Romain Francoise  <romain@orebokech.com>
+
+	* net/gnutls.el (gnutls-negotiate): Fix setting of default trustfiles.
+
+2010-12-13  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+	* net/netrc.el (netrc-point-at-eol): Remove the unused
+	netrc-point-at-old and netrc-bound-and-true-p bindings.
+	(netrc-parse): Cache the netrc contents.
+
+2010-12-13  Eli Zaretskii  <eliz@gnu.org>
+
+	* subr.el (posn-col-row): Evaluate header-line-format in the
+	context of the POSITION window's buffer.
+
+2010-12-13  Glenn Morris  <rgm@gnu.org>
+
+	* subr.el (member-ignore-case, run-mode-hooks, insert-for-yank-1)
+	(with-silent-modifications): Doc fixes.
+
+2010-12-13  Michael Albinus  <michael.albinus@gmx.de>
+
+	* net/tramp.el (tramp-action-password, tramp-process-actions):
+	Revert previous from.  Use `save-restriction'.
+
+2010-12-13  Stephen Berman  <stephen.berman@gmx.net>
+
+	* calendar/diary-lib.el (diary-list-sexp-entries):
+	Handle case of no newline at end of file.  (Bug#7536)
+
+2010-12-13  Glenn Morris  <rgm@gnu.org>
+
+	* mail/smtpmail.el (smtpmail-send-it): Revert previous change.
+
+2010-12-13  Michael Albinus  <michael.albinus@gmx.de>
+
+	* net/tramp.el (tramp-action-password): Delete region, do not narrow.
+	(tramp-process-actions): Do not widen.
+
+	* net/tramp-sh.el (tramp-sh-handle-start-file-process):
+	Protect buffer-modified value.  (Bug#7557)
+
+2010-12-13   Jan Moringen  <jmoringe@techfak.uni-bielefeld.de>
+
+	* log-edit.el (log-edit-changelog-entries):
+	Regexp quote filename.  (Bug#7505)
+
+2010-12-13  Tom Breton  <tehom@panix.com>
+
+	* cus-edit.el (custom-save-all):
+	Bind print-length and print-level to nil.  (Bug#7581)
+
+2010-12-13  Glenn Morris  <rgm@gnu.org>
+
+	* mouse.el (mouse-menu-major-mode-map, mouse-menu-bar-map):
+	Run hooks to update menu contents.  (Bug#7586)
+
+	* mail/smtpmail.el (smtpmail-send-it): Avoid colons in the queued
+	file names, for the sake of MS Windows.  (Bug#7588)
+
+2010-12-13  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* diff-mode.el (diff-refine-hunk): Make it work when the hunk contains
+	empty lines without a leading space.
+
+2010-12-13  Leo  <sdl.web@gmail.com>
+
+	* dired-aux.el (dired-do-redisplay): Postpone dired-after-readin-hook
+	while mapping over marks (Bug#6810).
+
+2010-12-13  Chong Yidong  <cyd@stupidchicken.com>
+
+	* image-dired.el (image-dired-db-file)
+	(image-dired-temp-image-file, image-dired-gallery-dir)
+	(image-dired-temp-rotate-image-file): Set default values relative
+	to image-dired-dir (Bug#7518).
+
+2010-12-13  Lawrence Mitchell  <wence@gmx.li>
+
+	* format.el (format-decode-run-method): Pass args FROM and TO, not
+	point-min and point-max, to shell-command-on-region (Bug#7488).
+
+2010-12-13  Jan Djärv  <jan.h.d@swipnet.se>
+
+	* frame.el (blink-cursor-mode): Make default t for ns.
+
+2010-12-13  Bob Rogers  <rogers-emacs@rgrjr.dyndns.org>
+
+	* vc-dir.el (vc-dir-query-replace-regexp): Doc fix (Bug#7501).
+
+2010-12-13  Chong Yidong  <cyd@stupidchicken.com>
+
+	* comint.el (comint-dynamic-list-input-ring)
+	(comint-dynamic-complete-filename)
+	(comint-replace-by-expanded-filename)
+	(comint-dynamic-simple-complete)
+	(comint-dynamic-list-filename-completions)
+	(comint-dynamic-list-completions): Doc fix (Bug#7499).
+
+	* subr.el (posn-x-y, posn-object-x-y, posn-object-width-height):
+	Doc fix (Bug#7471).
+
+2010-12-13  Martin Rudalics  <rudalics@gmx.at>
+
+	* dired.el (dired-pop-to-buffer): Bind pop-up-frames to nil
+	(Bug#7533).
+
+2010-12-13  W. Martin Borgert <debacle@debian.org>  (tiny change)
+
+	* files.el (auto-mode-alist): Handle .dbk (DocBook) with xml-mode.
+	(Bug#7491).
+
+2010-12-13  Eli Zaretskii  <eliz@gnu.org>
+
+	* files.el (file-relative-name): Handle UNC file names on
+	DOS/Windows.  (Bug#4674)
+
+2010-12-13  Daiki Ueno  <ueno@unixuser.org>
+
+	* epg.el (epg-digest-algorithm-alist): Replace "RMD160" with
+	"RIPEMD160" (Bug#7490).  Reported by Daniel Kahn Gillmor.
+	(epg-context-set-passphrase-callback): Mention that the callback
+	is not called when used with GnuPG 2.x.
+
+2010-12-13  Glenn Morris  <rgm@gnu.org>
+
+	* ps-print.el (ps-line-lengths-internal, ps-nb-pages):
+	Ensure ps-footer-font-size-internal is initialized.
+	Call ps-get-page-dimensions before trying to use ps-font-for-text.
+
+2010-12-13  Kenichi Handa  <handa@m17n.org>
+
+	* mail/rmailmm.el (rmail-mime-parse): Call rmail-mime-process
+	within condition-case.
+	(rmail-show-mime): Don't use condition-case.
+	(rmail-search-mime-message): New function.
+	(rmail-search-mime-message-function): Set to
+	rmail-search-mime-message.
+
+2010-12-13  Leo  <sdl.web@gmail.com>
+
+	* ido.el (ido-common-initialization): New function.  (bug#3274)
+	(ido-mode): Use it.
+	(ido-completing-read): Call it.
+
+2010-12-12  Karl Fogel  <kfogel@red-bean.com>
+
+	* bookmark.el (bookmark-name-from-full-record): Rename back to
+	this original name from `bookmark-name-from-record' reverting part
+	of rev 102609 / kfogel@red-bean.com-20101208080927-5j9jqnb2xvcw4ogm.
+	As Drew Adams pointed out, there was no reason to cause churn for
+	third-party callers.
+
+2010-12-12  Alan Mackenzie  <acm@muc.de>
+
+	* progmodes/cc-engine.el (c-forward-type): Before scanning a
+	template arglist, check that the current language supports this.
+
+2010-12-11  Glenn Morris  <rgm@gnu.org>
+
+	* vc/vc-bzr.el (vc-bzr-state-heuristic): Also check that the executable
+	state of the file matches.  (Bug#7544)
+	(vc-bzr-register, vc-bzr-checkin)
+	(vc-bzr-annotate-extract-revision-at-line): Doc fixes.
+	(vc-directory-exclusion-list): Remove unnecessary eval-after-load.
+
+	* textmodes/sgml-mode.el (sgml-xml-guess): Add .xhtml extension.
+
+2010-12-11  Karel Klíč  <kklic@redhat.com>
+
+	* files.el (auto-mode-alist): Use html-mode for *.xhtml.  (Bug#7606)
+
+2010-12-10  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	Derive from prog-mode, use derived-mode-p, and fix up various
+	minor style issues in lisp/progmodes.
+
+	* progmodes/vhdl-mode.el (vhdl-mode):
+	* progmodes/verilog-mode.el (verilog-mode):
+	* progmodes/vera-mode.el (vera-mode):
+	* progmodes/sql.el (sql-mode):
+	* progmodes/scheme.el (scheme-mode):
+	* progmodes/perl-mode.el (perl-mode):
+	* progmodes/octave-inf.el (inferior-octave-mode):
+	* progmodes/autoconf.el (autoconf-mode):
+	* progmodes/m4-mode.el (m4-mode):
+	* progmodes/inf-lisp.el (inferior-lisp-mode):
+	* progmodes/idlwave.el (idlwave-mode):
+	* progmodes/icon.el (icon-mode):
+	* progmodes/idlw-help.el (idlwave-help-mode):
+	* progmodes/dcl-mode.el (dcl-mode):
+	* progmodes/idlw-shell.el (idlwave-shell-mode):
+	* progmodes/ebrowse.el (ebrowse-tree-mode, ebrowse-electric-list-mode)
+	(ebrowse-member-mode, ebrowse-electric-position-mode):
+	Use define-derived-mode.
+
+	* progmodes/xscheme.el (exit-scheme-interaction-mode)
+	(xscheme-enter-interaction-mode, xscheme-enter-debugger-mode)
+	(xscheme-debugger-mode-p, xscheme-send-string-1):
+	* progmodes/tcl.el (inferior-tcl-proc, tcl-current-word)
+	(tcl-load-file, tcl-restart-with-file):
+	* progmodes/ps-mode.el (ps-run-running):
+	* progmodes/gdb-mi.el (gud-watch, gdb-mouse-set-clear-breakpoint):
+	* progmodes/js.el (js--get-all-known-symbols):
+	* progmodes/inf-lisp.el (inferior-lisp-proc):
+	* progmodes/idlwave.el (idlwave-beginning-of-statement)
+	(idlwave-template, idlwave-update-buffer-routine-info)
+	(idlwave-update-current-buffer-info)
+	(idlwave-get-routine-info-from-buffers, idlwave-choose)
+	(idlwave-scan-class-info, idlwave-fix-keywords)
+	(idlwave-list-buffer-load-path-shadows):
+	* progmodes/idlw-toolbar.el (idlwave-toolbar, idlwave-toolbar-add)
+	(idlwave-toolbar-remove):
+	* progmodes/idlw-shell.el (idlwave-shell-save-and-action)
+	(idlwave-shell-file-name, idlwave-shell-electric-debug-all-off)
+	(idlwave-shell-menu-def):
+	* progmodes/idlw-complete-structtag.el
+	(idlwave-prepare-structure-tag-completion):
+	* progmodes/gud.el (gud-set-buffer):
+	* progmodes/f90.el (f90-backslash-not-special):
+	* progmodes/delphi.el (delphi-find-unit): Use derived-mode-p.
+
+	* progmodes/xscheme.el (xscheme-start)
+	(local-set-scheme-interaction-buffer, scheme-interaction-mode):
+	* progmodes/which-func.el (which-function):
+	* progmodes/vhdl-mode.el (vhdl-set-style):
+	* progmodes/verilog-mode.el (verilog-set-compile-command)
+	(verilog-modify-compile-command, verilog-error-regexp-add-xemacs)
+	(verilog-set-define, verilog-auto-reeval-locals):
+	* progmodes/sql.el (sql-product-font-lock, sql-interactive-mode):
+	* progmodes/simula.el (simula-mode):
+	* progmodes/scheme.el (scheme-mode-variables, dsssl-mode):
+	* progmodes/python.el (python-check, python-mode):
+	* progmodes/prolog.el (prolog-mode-variables):
+	* progmodes/gud.el (gud-tooltip-activate-mouse-motions):
+	* progmodes/ebrowse.el (ebrowse-view-file-other-frame):
+	* progmodes/delphi.el (delphi-mode):
+	* progmodes/cc-styles.el (c-setup-paragraph-variables):
+	* progmodes/cc-mode.el (c-basic-common-init, c-common-init)
+	(c-font-lock-init): Move make-local-variable to their setq.
+
+	* progmodes/vhdl-mode.el (vhdl-write-file-hooks-init)
+	(vhdl-hs-minor-mode, vhdl-ps-print-init): Fix make-local-variable ->
+	make-local-hook.
+	* progmodes/sh-script.el (sh-require-final-newline): Remove.
+	(sh-set-shell): Don't set require-final-newline since it's already done
+	by prog-mode.
+	* progmodes/modula2.el (m2-mode): Don't make m2-end-comment-column
+	since we never set it.
+	* progmodes/ebrowse.el (ebrowse-set-tree-indentation):
+	Use read-string and standard prompt.
+	* progmodes/dcl-mode.el (dcl-mode-map): Move init into declaration.
+	* progmodes/meta-mode.el (meta-mode-abbrev-table): Merge init and decl.
+	(meta-common-mode-syntax-table): Rename from meta-mode-syntax-table.
+	(meta-common-mode-map): Rename from meta-mode-map.
+	Remove C-m binding, which is a user preference, not mode specific.
+	(meta-common-mode): New major mode; replace meta-common-initialization.
+	* progmodes/js.el (js-mode): Call syntax-propertize rather than messing
+	around with font-lock.
+	* progmodes/etags.el (select-tags-table-mode):
+	Derive from special-mode.
+	* progmodes/octave-mod.el (octave-mode):
+	* progmodes/gdb-mi.el (gdb-inferior-io-mode, gdb-threads-mode)
+	(gdb-memory-mode, gdb-disassembly-mode, gdb-breakpoints-mode)
+	(gdb-frames-mode, gdb-locals-mode, gdb-registers-mode):
+	Let define-derived-mode do its job.
+	* progmodes/cpp.el (cpp-edit-mode-map):
+	Move initialization into declaration.
+	(cpp-edit-mode): Use define-derived-mode.
+	(cpp-edit-load): Use derived-mode-p.
+	* progmodes/mixal-mode.el (mixal-mode):
+	* progmodes/f90.el (f90-mode):
+	* progmodes/cfengine.el (cfengine-mode): Don't bother setting
+	require-final-newline since prog-mode does it already.
+	* progmodes/cc-cmds.el (c-update-modeline): Use match-string.
+	* progmodes/asm-mode.el (asm-mode-map): Fix menu setup.
+	* progmodes/antlr-mode.el: Require cc-mode upfront.
+	(antlr-mode-syntax-table, antlr-action-syntax-table): Initialize in
+	the declaration.
+	(antlr-directory-dependencies, antlr-show-makefile-rules):
+	Use derived-mode-p.
+	(antlr-language-option): Don't assume point-min==1.
+	(antlr-mode): Use define-derived-mode.
+	* progmodes/ada-mode.el: Use derived-mode-p.
+	(ada-mode): Use define-derived-mode.
+	Use hack-local-variables-hook.
+
+2010-12-10  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* textmodes/texinfo.el (texinfo-mode-map): Bind texinfo-insert-@end.
+	(texinfo-mode): Don't disable adaptive-fill-mode.
+	(texinfo-insert-block): Adjust cursor placement for blocks with arg.
+	(texinfo-insert-@end, texinfo-insert-braces, texinfo-insert-@code)
+	(texinfo-insert-@dfn, texinfo-insert-@email, texinfo-insert-@emph)
+	(texinfo-insert-@example, texinfo-insert-@file, texinfo-insert-@item)
+	(texinfo-insert-@kbd, texinfo-insert-@node, texinfo-insert-@noindent)
+	(texinfo-insert-@quotation, texinfo-insert-@samp)
+	(texinfo-insert-@strong, texinfo-insert-@table, texinfo-insert-@var)
+	(texinfo-insert-@uref): Use define-skeleton.
+	(texinfo-insert-@-with-arg): Delete.
+
+2010-12-10  Eli Zaretskii  <eliz@gnu.org>
+
+	* arc-mode.el (archive-zip-extract): If w32-quote-process-args is
+	nil, do quote archive member names.  (Bug#6144)
+
+2010-12-10  Glenn Morris  <rgm@gnu.org>
+
+	* files.el (diff-no-select): Declare.
+
+	* mail/emacsbug.el (report-emacs-bug): Use mail-user-agent properties.
+	(report-emacs-bug-create-existing-bugs-buffer): Avoid free variables.
+
+	* comint.el (comint-input-ring-file-name): Doc fix.
+
+2010-12-09  Eli Zaretskii  <eliz@gnu.org>
+
+	* menu-bar.el (menu-bar-frame-for-menubar, menu-bar-positive-p):
+	New functions.
+	(menu-bar-showhide-menu) <menu-bar-mode, showhide-tool-bar>:
+	Use them instead of `nil' and `>', respectively.
+	(menu-bar-showhide-tool-bar-menu): Use menu-bar-frame-for-menubar
+	instead of `nil'.
+	(toggle-menu-bar-mode-from-frame): Use menu-bar-frame-for-menubar
+	and menu-bar-positive-p instead of `nil' and `>', respectively.
+	(Bug#1077)
+
+2010-12-09  Vinicius Jose Latorre  <viniciusjl@ig.com.br>
+
+	* whitespace.el (whitespace-newline-mode): Code fix.
+
+2010-12-09  Glenn Morris  <rgm@gnu.org>
+
+	* play/landmark.el (lm-print-y,s,noise-int, lm-print-y,s,noise):
+	Rename functions without commas, update callers.
+
+2010-12-08  Jeff Dairiki  <dairiki@dairiki.org>  (tiny change)
+
+	* whitespace.el (whitespace-cleanup-region):
+	Clean up spaces before tabs.  (Bug#7582)
+
+2010-12-08  Karl Fogel  <kfogel@red-bean.com>
+
+	* bookmark.el: Adjust parameter names and doc strings to resolve
+	confusion over whether "bookmark" meant a bookmark name or a
+	bookmark record.  Along the way, shorten one function's name for
+	similar reasons.  (Issue #7548)
+	(bookmark-name-from-record): New name for
+	`bookmark-name-from-full-record'.  All callers changed.
+	(bookmark-get-bookmark, bookmark-get-bookmark-record)
+	(bookmark-default-annotation-text, bookmark-prop-get, bookmark-prop-set)
+	(bookmark-get-annotation, bookmark-set-annotation)
+	(bookmark-get-filename, bookmark-set-filename)
+	(bookmark-get-position, bookmark-set-position)
+	(bookmark-get-front-context-string, bookmark-set-front-context-string)
+	(bookmark-get-rear-context-string, bookmark-set-rear-context-string)
+	(bookmark-get-handler, bookmark-edit-annotation, bookmark--jump-via)
+	(bookmark-handle-bookmark, bookmark-location, bookmark-show-annotation):
+	Rename `bookmark' parameter to `bookmark-name-or-record', to
+	clearly show its role, and shorten or adjust doc strings accordingly.
+	(bookmark-set-name): Same, and pass the parameter directly to
+	`bookmark-get-bookmark' instead of redundantly doing the callee's work.
+	(bookmark-default-annotation-text, bookmark-send-edited-annotation)
+	(bookmark-relocate, bookmark-insert-location, bookmark-insert)
+	(bookmark-delete): Rename `bookmark' parameter to `bookmark-name',
+	and in some cases shorten doc string accordingly.
+	(bookmark-rename): Change `old' and `new' parameters to `old-name'
+	and `new-name', and adjust an internal variable to avoid confusion.
+	(bookmark-jump, bookmark-jump-noselect): Clarify `bookmark'
+	parameter in doc string.
+
+2010-12-08  Glenn Morris  <rgm@gnu.org>
+
+	* progmodes/gdb-mi.el (gdb): Try to initialize comint input history
+	from gdb's history file.  (Bug#7575)
+
+	* mail/emacsbug.el (report-emacs-bug):
+	Try to handle some other mail clients.
+
+2010-12-08  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* files.el (dir-locals-collect-variables): Don't let errors stop us.
+	Use string-prefix-p.
+	(file-name-version-regexp): New var.
+	(file-name-sans-versions):
+	* jka-cmpr-hook.el (jka-compr-build-file-regexp): Use it,
+	(jka-compr-get-compression-info): Use dolist.
+	(jka-compr-compression-info-list): Don't bother specifying
+	version/backup regexps.
+
+2010-12-07  Tassilo Horn  <tassilo@member.fsf.org>
+
+	* simple.el (just-one-space): Make argument n default to 1 if
+	omitted.
+
+2010-12-07  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* electric.el (electric-indent-post-self-insert-function):
+	Delete trailing newlines even if we don't reindent.
+
+2010-12-06  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* minibuffer.el (completion-at-point): Remove the `arg'.
+	* bindings.el (complete-symbol): Move back from minibuffer.el.
+
+2010-12-06  Deniz Dogan  <deniz.a.m.dogan@gmail.com>
+
+	* simple.el (just-one-space): Delete newlines for negative arg.
+
+2010-12-06  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* ansi-color.el (ansi-color-unfontify-region): Replace by trivial def.
+	(ansi-color-filter-apply): Simplify.
+	(ansi-color-apply): Use `font-lock-face' rather than `face'.
+
+2010-12-05  Bob Rogers  <rogers-emacs@rgrjr.dyndns.org>
+
+	* vc/vc-dir.el (vc-dir-query-replace-regexp): Doc fix (Bug#7501).
+
+2010-12-04  Chong Yidong  <cyd@stupidchicken.com>
+
+	* dired.el (dired-use-ls-dired): Set default to a special
+	"unspecified" value.
+	(dired-insert-directory): When called the first time, check
+	whether "ls --dired" succeeds and set dired-use-ls-dired (Bug#7546).
+
+2010-12-04  Tak Ota  <Takaaki.Ota@am.sony.com>
+
+	* replace.el: Add "collect" feature to occur.
+	(occur-collect-regexp-history): New var.
+	(occur-read-primary-args): Return a replace string for nlines,
+	if needed.
+	(occur): Extend the meaning of nlines.
+
+2010-12-04  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* progmodes/which-func.el (which-func-ff-hook): Log the error message.
+	(which-func-update-1): Distinguish symbols from strings.
+	(which-function): Stay within 80 columns.
+
+2010-12-03  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* subr.el (with-demoted-errors): Distinguish symbols from strings.
+
+	* newcomment.el (comment-styles): Add docs to each style (bug#7509).
+	Improve docstring.
+	(comment-style): Use comment-styles's docs to describe values.
+
+2010-12-03  Jan Djärv  <jan.h.d@swipnet.se>
+
+	* term/common-win.el (x-setup-function-keys): Restore ns-new-frame
+	and ns-show-prefs (Bug#7535).
+
+	* term/ns-win.el (global-map): Restore ns-new-frame and ns-show-prefs
+	bindings (Bug#7535).
+
+2010-12-03  Glenn Morris  <rgm@gnu.org>
+
+	* nxml/nxml-mode.el: Require rng-nxml.
+	(rng-nxml-mode-init, nxml-enable-unicode-char-name-sets):
+	Remove declarations.
+
+	* nxml/nxml-mode.el, nxml/nxml-outln.el, nxml/rng-loc.el:
+	* nxml/rng-nxml.el, nxml/rng-valid.el:
+	Remove leading `*' from defcustom docs.
+
+	* startup.el (normal-top-level-add-subdirs-to-load-path): Simplify.
+	(normal-top-level-add-to-load-path, tty-handle-args):
+	Convert comments to basic doc-strings.
+
+	* net/browse-url.el (browse-url-url-at-point)
+	(browse-url-default-browser): Remove autoload cookies.
+
+	* mail/emacsbug.el (report-emacs-bug-create-existing-bugs-buffer):
+	Remove more undefined cl functions.
+
+	* vc/diff.el (diff-sentinel): Make new arguments optional.
+	* ibuf-ext.el (diff-sentinel): Update declaration.
+
+2010-12-03  Daiki Ueno  <ueno@unixuser.org>
+
+	* epg.el (epg-digest-algorithm-alist): Replace "RMD160" with
+	"RIPEMD160" (Bug#7490).  Reported by Daniel Kahn Gillmor.
+	(epg-context-set-passphrase-callback): Mention that the callback
+	is not called when used with GnuPG 2.x.
+
+2010-12-02  Michael Albinus  <michael.albinus@gmx.de>
+
+	* net/tramp.el (tramp-local-host-regexp): Add "localhost6".
+	(tramp-file-name-port): Check also for `tramp-default-port'.
+	(tramp-get-connection-name): New defun.
+	(tramp-get-connection-process): Use it.
+	(tramp-debug-message): Extend function exclude list.
+	(tramp-drop-volume-letter): Fix doc string.
+
+	* net/tramp-cmds.el: Remove solved todo item.
+
+	* net/tramp-efs.el:
+	* net/tramp-ftp.el:
+	* net/tramp-gvfs.el:
+	* net/tramp-gw.el:
+	* net/tramp-imap.el:
+	* net/tramp-smb.el: Fix regexps added to `tramp-default-method-alist'
+	and `tramp-default-user-alist', respectively.
+
+	* net/tramp-gw.el (tramp-gw-open-connection):
+	Use `tramp-get-connection-name' and `tramp-get-connection-buffer'.
+
+	* net/tramp-imap.el (tramp-imap-make-iht): Use just
+	`tramp-file-name-port'.
+
+	* net/tramp-sh.el (tramp-methods): Add recursive options to "pscp"
+	and "psftp".  Exchange "%k" marker with options.
+	(tramp-do-copy-or-rename-file, tramp-sh-handle-file-local-copy):
+	Compute size of link target.
+	(tramp-do-copy-or-rename-file-out-of-band). Move setting of
+	`tramp-current-*' up due to gateway methods.  Optimze computing of
+	copy arguments.  Use `tramp-get-connection-name' and
+	`tramp-get-connection-buffer'.  Improve debug messages.
+	(tramp-compute-multi-hops): Remove port determination.
+	(tramp-maybe-open-connection): Use `tramp-get-connection-name'.
+
+	* net/trampver.el: Update release number.
+
+2010-12-02  Glenn Morris  <rgm@gnu.org>
+
+	* emacs-lisp/cl-macs.el (cl-parse-loop-clause):
+	Avoid infinite loop over windows.  (Bug#7492)
+
+	* progmodes/flymake.el (flymake-check-file-limit):
+	Allow nil to mean "no limit".
+	(flymake-check-patch-master-file-buffer): Update for above change.
+	Allow a .tex file-name extension to be optional.
+	(flymake-master-tex-init): Also match \include statements.
+
+2010-11-30  Sam Steingold  <sds@gnu.org>
+
+	* nxml/nxml-mode.el (nxml-parent-document): Add a variable.
+	(nxml-parent-document-set): A function to set `nxml-parent-document'.
+	(nxml-mode): Define using `define-derived-mode' instead of `defun'.
+	(nxml-mode-hook): Remove `defcustom' (auto-defined by
+	define-derived-mode').
+	* nxml/rng-valid.el (rng-dtd-trivial-p): Add a helper function for
+	users who want to call `nxml-parent-document-set'.
+
+2010-11-27  Chong Yidong  <cyd@stupidchicken.com>
+
+	* log-edit.el (log-edit-font-lock-keywords): Don't try matching
+	stand-alone lines, since that is handled by log-edit-match-to-eoh
+	(Bug#6465).
+
+2010-11-27  Eduard Wiebe  <usenet@pusto.de>
+
+	* dired.el (dired-get-filename): Replace backslashes with slashes
+	in file names on MS-Windows, needed by `locate'.  (Bug#7308)
+	* locate.el (locate-default-make-command-line): Don't consider
+	drive letter and root directory part of
+	`directory-listing-before-filename-regexp'.  (Bug#7308)
+	(locate-post-command-hook, locate-post-command-hook): New defcustoms.
+
+2010-11-27  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* emacs-lisp/smie.el (smie-prec2->grammar): Simplify handling
+	of :smie-open/close-alist.
+	(smie-next-sexp): Make it accept a "start token" as argument.
+	(smie-indent-keyword): Be careful not to misidentify tokens that span
+	more than one line, as empty lines.  Add argument `token'.
+
+2010-11-27  Kenichi Handa  <handa@m17n.org>
+
+	* mail/rmailmm.el (rmail-mime-insert-multipart): For unsupported
+	multipart subtypes, insert all as usual.
+
+	* mail/rmail.el: Require rfc2047.
+
+2010-11-27  Kenichi Handa  <handa@m17n.org>
+
+	* mail/rmailmm.el (rmail-mime-entity, rmail-mime-entity-type)
+	(rmail-mime-entity-disposition)
+	(rmail-mime-entity-transfer-encoding, rmail-mime-entity-header)
+	(rmail-mime-entity-body, rmail-mime-entity-children): New functions.
+	(rmail-mime-save): Handle the case that the button's `data' is a
+	MIME entity.
+	(rmail-mime-insert-text): New function.
+	(rmail-mime-insert-image): Handle the case that DATA is a MIME entity.
+	(rmail-mime-bulk-handler): Just call rmail-mime-insert-bulk.
+	(rmail-mime-insert-bulk): New function mostly copied from the old
+	rmail-mime-bulk-handler.
+	(rmail-mime-multipart-handler): Just call rmail-mime-process-multipart.
+	(rmail-mime-process-multipart): New function mostly copied from
+	the old rmail-mime-multipart-handler.
+	(rmail-mime-show): Just call rmail-mime-process.
+	(rmail-mime-process): New function mostly copied from the old
+	rmail-mime-show.
+	(rmail-mime-insert-multipart, rmail-mime-parse)
+	(rmail-mime-insert, rmail-show-mime)
+	(rmail-insert-mime-forwarded-message)
+	(rmail-insert-mime-resent-message): New functions.
+	(rmail-insert-mime-forwarded-message-function): Set to
+	rmail-insert-mime-forwarded-message.
+	(rmail-insert-mime-resent-message-function): Set to
+	rmail-insert-mime-resent-message.
+
+	* mail/rmailsum.el: Require rfc2047.
+	(rmail-header-summary): Handle multiline Subject: field.
+	(rmail-summary-line-decoder): Change the default to
+	rfc2047-decode-string.
+
+	* mail/rmail.el (rmail-enable-mime): Change the default to t.
+	(rmail-mime-feature): Change the default to `rmailmm'.
+	(rmail-quit): Delete the specifal code for rmail-enable-mime.
+	(rmail-display-labels): Likewise.
+	(rmail-show-message-1): Check rmail-enable-mime, and use
+	rmail-show-mime-function for a MIME message.  Decode the headers
+	according to RFC2047.
+
+2010-11-27  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* progmodes/which-func.el (which-func-imenu-joiner-function):
+	Return a string, as expected.
+	(which-function-mode): Make sure we stop any previous timer before
+	starting a new one.
+
+2010-11-27  Michael Albinus  <michael.albinus@gmx.de>
+
+	* net/tramp.el (tramp-default-method-alist)
+	(tramp-default-user-alist, tramp-default-proxies-alist):
+	Adapt custom options type.  (Bug#7445)
+
+2010-11-27  Chong Yidong  <cyd@stupidchicken.com>
+
+	* progmodes/python.el: Add Ipython support (Bug#5390).
+	(python-shell-prompt-alist)
+	(python-shell-continuation-prompt-alist): New options.
+	(python--set-prompt-regexp): New function.
+	(inferior-python-mode, run-python, python-shell):
+	Require ansi-color.  Use python--set-prompt-regexp to set the comint
+	prompt based on the Python interpreter.
+	(python--prompt-regexp): New var.
+	(python-check-comint-prompt)
+	(python-comint-output-filter-function): Use it.
+	(run-python): Use a pipe (Bug#5694).
+
+2010-11-27  Chong Yidong  <cyd@stupidchicken.com>
+
+	* progmodes/python.el (run-python): Doc fix.
+	(python-keep-current-directory-in-path): New var (Bug#7454).
+
+2010-11-27  Chong Yidong  <cyd@stupidchicken.com>
+
+	* lpr.el (lpr-buffer, print-buffer, lpr-region, print-region):
+	Prompt user before actually printing.
+
+2010-11-27  Glenn Morris  <rgm@gnu.org>
+
+	* startup.el (package-enable-at-startup, package-initialize):
+	Remove unnecessary declarations.
+
+2010-11-27  Eli Zaretskii  <eliz@gnu.org>
+
+	* international/characters.el (glyphless-char-display-control):
+	Exclude newline and TAB from the c0-control group.
+
+2010-11-27  Glenn Morris  <rgm@gnu.org>
+
+	* mail/sendmail.el (build-mail-aliases): Doc fix for autoload.
+	(expand-mail-aliases): Remove unnecessary autoload.
+
+	* allout.el (allout-command-prefix, allout-mode-map): Declare.
+
+	* shell.el (shell-dir-cookie-re): Move definition before use.
+
+	* mail/emacsbug.el (report-emacs-bug-create-existing-bugs-buffer):
+	Replace undefined CL functions.
+
+2010-11-26  Eli Zaretskii  <eliz@gnu.org>
+
+	* simple.el (prog-mode): Set bidi-paragraph-direction to
+	left-to-right.
+
+	* term/pc-win.el (x-get-selection-internal): Emulation for MS-DOS.
+
+2010-11-26  Glenn Morris  <rgm@gnu.org>
+
+	* calendar/diary-lib.el (diary-outlook-format-1): New function, so that
+	diary-outlook-formats can be sensitive to calendar-date-style.
+	(diary-outlook-formats): Simplify the default setting.
+	(diary-from-outlook-internal): Pass subject and body as arguments.
+	Use dolist rather than dotimes.  Don't save the diary buffer.
+	(diary-from-outlook-gnus, diary-from-outlook-rmail):
+	Pass subject and body as explicit arguments to the -internal function.
+
+2010-11-26  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+	* mail/rfc2368.el (rfc2368-parse-mailto-url): Unfold URLs before
+	parsing them.  This makes mailto:...?subject=foo\nbar work.
+
+2010-11-25  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* vc/diff.el (diff): Fix last change.
+
+2010-11-24  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* emacs-lisp/pcase.el: Improve pcase-let.  Use "pcase--" prefix.
+	(pcase--dontcare-upats): New var.
+	(pcase-let, pcase-let*): Generate better code.
+	Accept the same bodies as `let'.
+	(pcase-dolist): New macro.
+	(pcase--trivial-upat-p): New helper function.
+	(pcase--expand): Strip leading "(let nil" if any.
+
+2010-11-24  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+	* mail/mailclient.el (browse-url): Require.
+	(mailclient-send-it): Bind `browse-url-mailto-function' to nil to
+	use the external browser function to send the mail (bug#7469).
+
+	* net/browse-url.el (browse-url-browser-function): Revert the
+	default back to the previous value, since the new value broke
+	mailclient.el.
+	(browse-url-mailto-function): New variable for mailto: URLs.
+	(browse-url): Use the new variable for mailto: URLs.
+
+2010-11-23  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* eshell/esh-cmd.el (eshell-parse-command):
+	* eshell/esh-arg.el (eshell-parse-arguments):
+	* eshell/em-script.el (eshell-source-file):
+	Use with-silent-modifications.
+
+2010-11-23  Chong Yidong  <cyd@stupidchicken.com>
+
+	* vc/vc.el (vc-merge): Remove optional arg PROMPT.  Always prompt
+	for a merge location.
+
+	* vc/vc-bzr.el (vc-bzr-pull): Remove unused var.
+	(vc-bzr-merge-branch): Always prompt.
+	(vc-bzr-async-command): Use the full branch filename.
+
+2010-11-23  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* shell.el (shell): Use current-buffer by default if it's already
+	a shell mode buffer and its process is dead.
+	Suggested by Jose E. Marchesi <jemarch@gnu.org>.
+
+2010-11-23  Tassilo Horn  <tassilo@member.fsf.org>
+
+	* mail/emacsbug.el (report-emacs-bug-query-existing-bugs):
+	Mention that the keywords should be comma separated.
+
+2010-11-23  Chong Yidong  <cyd@stupidchicken.com>
+
+	* vc/vc.el (vc-merge): Use vc-BACKEND-merge-branch if available.
+	Accept optional prefix arg meaning to prompt for a command.
+	(vc-update): Use vc-BACKEND-pull if available.  Accept optional
+	prefix arg meaning to prompt for a command.
+	(vc-pull): Alias for vc-update.
+
+	* vc/vc-bzr.el (vc-bzr-admin-branchconf, vc-bzr-history): New vars.
+	(vc-bzr--branch-conf, vc-bzr-async-command, vc-bzr-pull)
+	(vc-bzr-merge-branch): New functions, implementing merge-branch
+	and pull operations.
+
+2010-11-22  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* Makefile.in: Fix up last merge.
+
+	* vc/diff.el (diff-old-temp-file, diff-new-temp-file): Remove.
+	(diff-sentinel): Get them as arguments instead.
+	(diff-old-file, diff-new-file, diff-extra-args): Remove.
+	(diff-file-local-copy, diff-better-file-name): New funs.
+	(diff-no-select): Rename from diff-into-buffer.
+	Support buffers additionally to files.  Move `buf' arg.  Don't display buf.
+	Prefer closures to buffer-local variables.
+	(diff): Adjust accordingly.
+	(diff-buffer-with-file): Move from files.el.
+	* files.el (diff-buffer-with-file): Move to vc/diff.el.
+	(diff-buffer-internal): Remove.
+	(diff-buffer-buffer): Remove.
+	(save-some-buffers-action-alist): Use diff-no-select so as not to guess
+	the buffer name used, and so as not to mess up windows and frames.
+
 2010-11-22  Bob Rogers  <rogers-emacs@rgrjr.dyndns.org>
 
 	* files.el: Make revert work with diff-buffer-with-file (bug#7277).
@@ -103,7 +953,8 @@
 2010-11-18  Stefan Monnier  <monnier@iro.umontreal.ca>
 
 	* simple.el (kill-new, kill-append, kill-region):
-	* comint.el (comint-kill-region): Make the yank-handler argument obsolete.
+	* comint.el (comint-kill-region): Make the yank-handler argument
+	obsolete.
 
 2010-11-18  Stefan Monnier  <monnier@iro.umontreal.ca>
 
@@ -319,7 +1170,7 @@
 2010-11-13  Eli Zaretskii  <eliz@gnu.org>
 
 	* international/characters.el (glyphless-char-display-control):
-	Renamed from glyphless-char-control; all users changed.  Doc fix.
+	Rename from glyphless-char-control; all users changed.  Doc fix.
 	Signal an error if display method is not one of the recognized
 	symbols.
 
@@ -2094,10 +2945,6 @@
 
 	* dired.el (dired-save-positions): Doc fix.  (Bug#7119)
 
-2010-10-08  Andreas Schwab  <schwab@linux-m68k.org>
-
-	* Makefile.in (ELCFILES): Update.
-
 2010-10-08  Glenn Morris  <rgm@gnu.org>
 
 	* vc/ediff-wind.el (ediff-setup-control-frame):
@@ -3811,7 +4658,7 @@
 
 	* term/ns-win.el (x-setup-function-keys, ns-last-selected-text):
 	x-cut-buffer-or-selection-value renamed to x-selection-value
-	(x-selection-value): Renamed from x-cut-buffer-or-selection-value.
+	(x-selection-value): Rename from x-cut-buffer-or-selection-value.
 	(x-select-text): Remove argument PUSH, update documentation.
 
 	* emacs-lisp/cl-macs.el (x-get-cutbuffer, x-get-cut-buffer): Remove.
@@ -4323,7 +5170,7 @@
 	whitespace-toggle-options (Bug#6479).  Allow to use fill-column
 	instead of whitespace-line-column (from EmacsWiki).  New version
 	13.1.
-	(whitespace-style): Added new value 'face.  Adjust docstring.
+	(whitespace-style): Add new value 'face.  Adjust docstring.
 	(whitespace-space, whitespace-hspace, whitespace-tab):
 	Adjust foreground property face.
 	(whitespace-line-column): Adjust docstring and type declaration.
@@ -5275,11 +6122,11 @@
 2010-07-20  Michael R. Mauger  <mmaug@yahoo.com>
 
 	* progmodes/sql.el: Version 2.3.
-	(sql-connection-alist): Changed keys from symbols to strings;
+	(sql-connection-alist): Change keys from symbols to strings;
 	enhanced the widget definition.
-	(sql-mode-menu): Added submenu to select connections.
-	(sql-interactive-mode-menu): Added "Save Connection" item.
-	(sql-add-product): Fixed menu item.
+	(sql-mode-menu): Add submenu to select connections.
+	(sql-interactive-mode-menu): Add "Save Connection" item.
+	(sql-add-product): Fix menu item.
 	(sql-get-product-feature): Improved error handling.
 	(sql--alt-buffer-part, sql--alt-if-not-empty): Removed.
 	(sql-make-alternate-buffer-name): Simplified.
@@ -5330,14 +6177,14 @@
 	(sql-ms-login-params, sql-postgres-login-params)
 	(sql-interbase-login-params, sql-db2-login-params)
 	(sql-linter-login-params): Add `port' option.
-	(sql-get-product-feature): Added NO-INDIRECT parameter.
+	(sql-get-product-feature): Add NO-INDIRECT parameter.
 	(sql-comint-oracle, sql-comint-sybase)
 	(sql-comint-informix, sql-comint-sqlite, sql-comint-mysql)
 	(sql-comint-solid, sql-comint-ingres, sql-comint-ms)
 	(sql-comint-postgres, sql-comint-interbase, sql-comint-db2)
-	(sql-comint-linter): Renamed sql-connect-* functions to
+	(sql-comint-linter): Rename sql-connect-* functions to
 	sql-comint-*.
-	(sql-product-alist, sql-mode-menu): Renamed as above and
+	(sql-product-alist, sql-mode-menu): Rename as above and
 	:sqli-connect-func to :sqli-comint-func.
 	(sql-connection): New variable.
 	(sql-interactive-mode): Set it.
@@ -5954,7 +6801,7 @@
 	* vc/vc-annotate.el (vc-annotate): Add an optional argument for the
 	VC backend.  Use it when non-nil.
 	(vc-annotate-warp-revision): Pass the VC backend to vc-annotate.
-	(Bug#6487)
+	(Bug#6487).
 
 	Fix vc-annotate-show-changeset-diff-revision-at-line for git.
 	* vc/vc-annotate.el (vc-annotate-show-diff-revision-at-line-internal):
@@ -8805,8 +9652,9 @@
 
 	Fix bug#5620: recalculate all markers on compilation buffer
 	modifications, not on file modifications.
-	* progmodes/compile.el (buffer-modtime): New buffer-local variable:
-	the buffer modification time, for buffers not associated with files.
+	* progmodes/compile.el (compilation-buffer-modtime): New buffer-local
+	variable: the buffer modification time, for buffers not associated with
+	files.
 	(compilation-mode): Create it.
 	(compilation-filter): Update it.
 	(compilation-next-error-function): Use it instead of
@@ -9615,7 +10463,8 @@
 
 2010-02-06  Dan Nicolaescu  <dann@ics.uci.edu>
 
-	* vc-bzr.el (vc-bzr-dir-extra-headers): Disable the pending merges header.
+	* vc-bzr.el (vc-bzr-dir-extra-headers):
+	Disable the pending merges header.
 
 2010-02-05  Juri Linkov  <juri@jurta.org>
 
@@ -10489,7 +11338,7 @@
 
 2009-12-25  Kenichi Handa  <handa@m17n.org>
 
-	* language/indian.el (devanagari-composable-pattern): Fixed to
+	* language/indian.el (devanagari-composable-pattern): Fix to
 	handle ZWNJ and ZWJ.  Use it in composition-function-table for
 	Devanagari.
 	(malayalam-composable-pattern): Fix previous change.
@@ -11126,7 +11975,7 @@
 	(newsticker-treeview-next-new-or-immortal-item): Doc change.
 	(newsticker--treeview-first-feed): Doc change.
 	(newsticker-treeview-list-menu)
-	(newsticker-treeview-item-menu): Added menu entries.
+	(newsticker-treeview-item-menu): Add menu entries.
 	(newsticker-treeview-item-mode): New.
 
 	* net/newst-backend.el (newsticker-customize): Delete other
@@ -16725,7 +17574,7 @@
 	Don't modify last-coding-system-used by accident.
 	(tramp-completion-file-name-handler): Apply the checks here,
 	instead during registration.
-	(tramp-register-file-name-handlers): Renamed from
+	(tramp-register-file-name-handlers): Rename from
 	`tramp-register-file-name-handler'.  Register both
 	`tramp-file-name-handler' and `tramp-completion-file-name-handler'.
 	(tramp-register-completion-file-name-handler): Remove.  (Bug#4260)
@@ -17517,7 +18366,7 @@
 	'update signal.  Instead, update all disassembly buffers only after
 	threads list.
 	(gdb): Send -target-detach when buffer is killed (Bug#3794).
-	(gdb-starting): Moved -data-list-register-names...
+	(gdb-starting): Move -data-list-register-names...
 	(gdb-stopped): ...here so it's sent when first thread stops.
 	(gdb-registers-handler-custom): Do nothing if register names are
 	unknown yet.
@@ -17656,8 +18505,8 @@
 
 	* progmodes/gdb-mi.el (gdb-var-create-regexp): Removed.
 	(gdb-var-create-handler): Rewritten using JSON parser.
-	(gdb-propertize-header): Moved earlier.
-	(gdb-set-header): Removed to avoid duplication.
+	(gdb-propertize-header): Move earlier.
+	(gdb-set-header): Remove to avoid duplication.
 	(gdb-thread-list-handler-custom, gdb-invalidate-disassembly):
 	Refresh disassembly buffers only after threads list have been
 	update.
@@ -17727,7 +18576,7 @@
 	(gdb-locals-handler-custom): Now prints data like in variable
 	declarations.
 	(gdb-jump-to, gdb-file-button, gdb-insert-file-location-button):
-	Removed confusing buttons.
+	Remove confusing buttons.
 	(gdb-invalidate-threads): Append --frame.
 	(gdb-threads-mode-map, gdb-breakpoints-mode-map): TAB to switch
 	between breakpoints/threads buffers.
@@ -17805,7 +18654,7 @@
 	(def-gdb-auto-update-handler): New nopreserve optional argument.
 	(gdb-stack-list-frames-custom): Print stack from top to bottom.
 
-	* progmodes/gdb-mi.el (gdb-pc-address): Removed unused variable.
+	* progmodes/gdb-mi.el (gdb-pc-address): Remove unused variable.
 	(gdb-threads-list, gdb-breakpoints-list): New assoc lists.
 	(gdb-parent-mode): New mode to derive other GDB modes from.
 	(gdb-display-disassembly-for-thread)
@@ -17829,7 +18678,7 @@
 	(gdb-display-registers-for-thread, gdb-frame-stack-for-thread)
 	(gdb-frame-locals-for-thread, gdb-frame-registers-for-thread):
 	New commands which show buffers bound to thread.
-	(gdb-stack-list-locals-regexp): Removed unused regexp.
+	(gdb-stack-list-locals-regexp): Remove unused regexp.
 
 	* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
 	(gdb-locals-buffer-name, gdb-registers-buffer-name)
--- a/lisp/ChangeLog.13	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/ChangeLog.13	Thu Dec 16 18:30:57 2010 -0500
@@ -6680,8 +6680,9 @@
 	buffer if the parent buffer is in vc-dired-mode.
 
 2007-11-23  Mark A. Hershberger  <mah@everybody.org>
-
-	* nxml: Initial merge of nxml.  Kept nxml/char-name subdir for now.
+	    James Clark  <none@example.com>
+
+	* nxml/: Initial merge of nxml.  Kept nxml/char-name subdir for now.
 
 2007-11-23  Juri Linkov  <juri@jurta.org>
 
@@ -16693,10 +16694,9 @@
 
 ;; Local Variables:
 ;; coding: utf-8
-;; add-log-time-zone-rule: t
 ;; End:
 
-    Copyright (C) 2007, 2008, 2009, 2010  Free Software Foundation, Inc.
+  Copyright (C) 2007, 2008, 2009, 2010  Free Software Foundation, Inc.
 
   This file is part of GNU Emacs.
 
@@ -16712,5 +16712,3 @@
 
   You should have received a copy of the GNU General Public License
   along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
-
-;; arch-tag: 1e8aa93a-fc6c-4ac3-9b10-1f445e1840af
--- a/lisp/Makefile.in	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/Makefile.in	Thu Dec 16 18:30:57 2010 -0500
@@ -180,7 +180,6 @@
 	els=`echo $(lisptagsfiles1) $(lisptagsfiles2) $(lisptagsfiles3) $(lisptagsfiles4) | sed -e "s,$(lisp)/[^ ]*loaddefs[^ ]*,," -e "s,$(lisp)/ldefs-boot[^ ]*,,"`; \
 	${ETAGS} -o $@ $$els
 
-	$(lisp)/emacs-lisp/smie.elc \
 # The src/Makefile.in has its own set of dependencies and when they decide
 # that one Lisp file needs to be re-compiled, we had better recompile it as
 # well, otherwise every subsequent make will again call us, until we finally
--- a/lisp/allout.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/allout.el	Thu Dec 16 18:30:57 2010 -0500
@@ -1,7 +1,7 @@
 ;;; allout.el --- extensive outline mode for use alone and with other modes
 
-;; Copyright (C) 1992, 1993, 1994, 2001, 2002, 2003, 2004, 2005,
-;;   2006, 2007, 2008, 2009, 2010  Free Software Foundation, Inc.
+;; Copyright (C) 1992, 1993, 1994, 2001, 2002, 2003, 2004, 2005, 2006,
+;;   2007, 2008, 2009, 2010  Free Software Foundation, Inc.
 
 ;; Author: Ken Manheimer <ken dot manheimer at gmail dot com>
 ;; Maintainer: Ken Manheimer <ken dot manheimer at gmail dot com>
@@ -107,6 +107,9 @@
 
 ;;;_ + Layout, Mode, and Topic Header Configuration
 
+(defvar allout-command-prefix)          ; defined below
+(defvar allout-mode-map)
+
 ;;;_  > allout-keybindings incidentals:
 ;;;_   > allout-bind-keys &optional varname value
 (defun allout-bind-keys (&optional varname value)
--- a/lisp/ansi-color.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/ansi-color.el	Thu Dec 16 18:30:57 2010 -0500
@@ -215,48 +215,10 @@
 (add-hook 'comint-output-filter-functions
 	  'ansi-color-process-output)
 
-
-;; Alternative font-lock-unfontify-region-function for Emacs only
-
-(defun ansi-color-unfontify-region (beg end &rest xemacs-stuff)
-  "Replacement function for `font-lock-default-unfontify-region'.
-
-As text properties are implemented using extents in XEmacs, this
-function is probably not needed.  In Emacs, however, things are a bit
-different: When font-lock is active in a buffer, you cannot simply add
-face text properties to the buffer.  Font-lock will remove the face
-text property using `font-lock-unfontify-region-function'.  If you want
-to insert the strings returned by `ansi-color-apply' into such buffers,
-you must set `font-lock-unfontify-region-function' to
-`ansi-color-unfontify-region'.  This function will not remove all face
-text properties unconditionally.  It will keep the face text properties
-if the property `ansi-color' is set.
-
-The region from BEG to END is unfontified.  XEMACS-STUFF is ignored.
-
-A possible way to install this would be:
-
-\(add-hook 'font-lock-mode-hook
-	  \(function (lambda ()
-		      \(setq font-lock-unfontify-region-function
-			    'ansi-color-unfontify-region))))"
-  ;; Simplified now that font-lock-unfontify-region uses save-buffer-state.
-  (when (boundp 'font-lock-syntactic-keywords)
-    (remove-text-properties beg end '(syntax-table nil)))
-  ;; instead of just using (remove-text-properties beg end '(face
-  ;; nil)), we find regions with a non-nil face text-property, skip
-  ;; positions with the ansi-color property set, and remove the
-  ;; remaining face text-properties.
-  (while (setq beg (text-property-not-all beg end 'face nil))
-    (setq beg (or (text-property-not-all beg end 'ansi-color t) end))
-    (when (get-text-property beg 'face)
-      (let ((end-face (or (text-property-any beg end 'face nil)
-			  end)))
-	(remove-text-properties beg end-face '(face nil))
-	(setq beg end-face)))))
+(defalias 'ansi-color-unfontify-region 'font-lock-default-unfontify-region)
+(make-obsolete 'ansi-color-unfontify-region "not needed any more" "24.1")
 
 ;; Working with strings
-
 (defvar ansi-color-context nil
   "Context saved between two calls to `ansi-color-apply'.
 This is a list of the form (FACES FRAGMENT) or nil.  FACES is a list of
@@ -290,9 +252,7 @@
 	    (setq fragment (substring string pos)
 		  result (concat result (substring string start pos))))
 	(setq result (concat result (substring string start))))
-      (if fragment
-	  (setq ansi-color-context (list nil fragment))
-	(setq ansi-color-context nil)))
+      (setq ansi-color-context (if fragment (list nil fragment))))
     result))
 
 (defun ansi-color-apply (string)
@@ -309,10 +269,7 @@
 This information will be used for the next call to `ansi-color-apply'.
 Set `ansi-color-context' to nil if you don't want this.
 
-This function can be added to `comint-preoutput-filter-functions'.
-
-You cannot insert the strings returned into buffers using font-lock.
-See `ansi-color-unfontify-region' for a way around this."
+This function can be added to `comint-preoutput-filter-functions'."
   (let ((face (car ansi-color-context))
 	(start 0) end escape-sequence result
 	colorized-substring)
@@ -325,8 +282,7 @@
       (setq escape-sequence (match-string 1 string))
       ;; Colorize the old block from start to end using old face.
       (when face
-	(put-text-property start end 'ansi-color t string)
-	(put-text-property start end 'face face string))
+	(put-text-property start end 'font-lock-face face string))
       (setq colorized-substring (substring string start end)
 	    start (match-end 0))
       ;; Eliminate unrecognized ANSI sequences.
@@ -338,8 +294,7 @@
       (setq face (ansi-color-apply-sequence escape-sequence face)))
     ;; if the rest of the string should have a face, put it there
     (when face
-      (put-text-property start (length string) 'ansi-color t string)
-      (put-text-property start (length string) 'face face string))
+      (put-text-property start (length string) 'font-lock-face face string))
     ;; save context, add the remainder of the string to the result
     (let (fragment)
       (if (string-match "\033" string start)
@@ -347,9 +302,7 @@
 	    (setq fragment (substring string pos))
 	    (push (substring string start pos) result))
 	(push (substring string start) result))
-      (if (or face fragment)
-	  (setq ansi-color-context (list face fragment))
-	(setq ansi-color-context nil)))
+      (setq ansi-color-context (if (or face fragment) (list face fragment))))
     (apply 'concat (nreverse result))))
 
 ;; Working with regions
--- a/lisp/arc-mode.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/arc-mode.el	Thu Dec 16 18:30:57 2010 -0500
@@ -1813,10 +1813,12 @@
      archive
      ;; unzip expands wildcards in NAME, so we need to quote it.  But
      ;; not on DOS/Windows, since that fails extraction on those
-     ;; systems, and file names with wildcards in zip archives don't
-     ;; work there anyway.
+     ;; systems (unless w32-quote-process-args is nil), and file names
+     ;; with wildcards in zip archives don't work there anyway.
      ;; FIXME: Does pkunzip need similar treatment?
-     (if (and (not (memq system-type '(windows-nt ms-dos)))
+     (if (and (or (not (memq system-type '(windows-nt ms-dos)))
+		  (and (boundp 'w32-quote-process-args)
+		       (null w32-quote-process-args)))
 	      (equal (car archive-zip-extract) "unzip"))
 	 (shell-quote-argument name)
        name)
--- a/lisp/bindings.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/bindings.el	Thu Dec 16 18:30:57 2010 -0500
@@ -655,6 +655,16 @@
 
 (define-key esc-map "\t" 'complete-symbol)
 
+(defun complete-symbol (arg)
+  "Perform completion on the text around point.
+The completion method is determined by `completion-at-point-functions'.
+
+With a prefix argument, this command does completion within
+the collection of symbols listed in the index of the manual for the
+language you are using."
+  (interactive "P")
+  (if arg (info-complete-symbol) (completion-at-point)))
+
 ;; Reduce total amount of space we must allocate during this function
 ;; that we will not need to keep permanently.
 (garbage-collect)
--- a/lisp/bookmark.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/bookmark.el	Thu Dec 16 18:30:57 2010 -0500
@@ -305,9 +305,10 @@
 ;; need to know anything about the format of bookmark-alist entries.
 ;; Everyone else should go through them.
 
-(defun bookmark-name-from-full-record (full-record)
-  "Return name of FULL-RECORD (an alist element instead of a string)."
-  (car full-record))
+(defun bookmark-name-from-full-record (bookmark-record)
+  "Return the name of BOOKMARK-RECORD.  BOOKMARK-RECORD is, e.g.,
+one element from `bookmark-alist'."
+  (car bookmark-record))
 
 
 (defun bookmark-all-names ()
@@ -316,113 +317,100 @@
   (mapcar 'bookmark-name-from-full-record bookmark-alist))
 
 
-(defun bookmark-get-bookmark (bookmark &optional noerror)
-  "Return the bookmark record corresponding to BOOKMARK.
-If BOOKMARK is a string, look for the corresponding bookmark record in
-`bookmark-alist'; return it if found, otherwise error.  Else if
-BOOKMARK is already a bookmark record, just return it."
+(defun bookmark-get-bookmark (bookmark-name-or-record &optional noerror)
+  "Return the bookmark record corresponding to BOOKMARK-NAME-OR-RECORD.
+If BOOKMARK-NAME-OR-RECORD is a string, look for the corresponding
+bookmark record in `bookmark-alist'; return it if found, otherwise
+error.  Else if BOOKMARK-NAME-OR-RECORD is already a bookmark record,
+just return it."
   (cond
-   ((consp bookmark) bookmark)
-   ((stringp bookmark)
-    (or (assoc-string bookmark bookmark-alist bookmark-completion-ignore-case)
-        (unless noerror (error "Invalid bookmark %s" bookmark))))))
+   ((consp bookmark-name-or-record) bookmark-name-or-record)
+   ((stringp bookmark-name-or-record)
+    (or (assoc-string bookmark-name-or-record bookmark-alist
+                      bookmark-completion-ignore-case)
+        (unless noerror (error "Invalid bookmark %s"
+                               bookmark-name-or-record))))))
 
 
-(defun bookmark-get-bookmark-record (bookmark)
-  "Return the record portion of the entry for BOOKMARK in
-`bookmark-alist' (that is, all information but the name).
-BOOKMARK may be a bookmark name (a string) or a bookmark record."
-  (let ((alist (cdr (bookmark-get-bookmark bookmark))))
+(defun bookmark-get-bookmark-record (bookmark-name-or-record)
+  "Return the record portion of the entry for BOOKMARK-NAME-OR-RECORD in
+`bookmark-alist' (that is, all information but the name)."
+  (let ((alist (cdr (bookmark-get-bookmark bookmark-name-or-record))))
     ;; The bookmark objects can either look like (NAME ALIST) or
     ;; (NAME . ALIST), so we have to distinguish the two here.
     (if (and (null (cdr alist)) (consp (caar alist)))
         (car alist) alist)))
 
 
-(defun bookmark-set-name (bookmark newname)
-  "Set BOOKMARK's name to NEWNAME.
-BOOKMARK may be a bookmark name (a string) or a bookmark record."
-  (setcar
-   (if (stringp bookmark) (bookmark-get-bookmark bookmark) bookmark)
-   newname))
+(defun bookmark-set-name (bookmark-name-or-record newname)
+  "Set BOOKMARK-NAME-OR-RECORD's name to NEWNAME."
+  (setcar (bookmark-get-bookmark bookmark-name-or-record) newname))
 
-(defun bookmark-prop-get (bookmark prop)
-  "Return the property PROP of BOOKMARK, or nil if none.
-BOOKMARK may be a bookmark name (a string) or a bookmark record."
-  (cdr (assq prop (bookmark-get-bookmark-record bookmark))))
+(defun bookmark-prop-get (bookmark-name-or-record prop)
+  "Return the property PROP of BOOKMARK-NAME-OR-RECORD, or nil if none."
+  (cdr (assq prop (bookmark-get-bookmark-record bookmark-name-or-record))))
 
-(defun bookmark-prop-set (bookmark prop val)
-  "Set the property PROP of BOOKMARK to VAL.
-BOOKMARK may be a bookmark name (a string) or a bookmark record."
-  (let ((cell (assq prop (bookmark-get-bookmark-record bookmark))))
+(defun bookmark-prop-set (bookmark-name-or-record prop val)
+  "Set the property PROP of BOOKMARK-NAME-OR-RECORD to VAL."
+  (let ((cell (assq
+               prop (bookmark-get-bookmark-record bookmark-name-or-record))))
     (if cell
         (setcdr cell val)
-      (nconc (bookmark-get-bookmark-record bookmark)
+      (nconc (bookmark-get-bookmark-record bookmark-name-or-record)
              (list (cons prop val))))))
 
-(defun bookmark-get-annotation (bookmark)
-  "Return the annotation of BOOKMARK, or nil if none.
-BOOKMARK may be a bookmark name (a string) or a bookmark record."
-  (bookmark-prop-get bookmark 'annotation))
+(defun bookmark-get-annotation (bookmark-name-or-record)
+  "Return the annotation of BOOKMARK-NAME-OR-RECORD, or nil if none."
+  (bookmark-prop-get bookmark-name-or-record 'annotation))
 
-(defun bookmark-set-annotation (bookmark ann)
-  "Set the annotation of BOOKMARK to ANN.
-BOOKMARK may be a bookmark name (a string) or a bookmark record."
-  (bookmark-prop-set bookmark 'annotation ann))
+(defun bookmark-set-annotation (bookmark-name-or-record ann)
+  "Set the annotation of BOOKMARK-NAME-OR-RECORD to ANN."
+  (bookmark-prop-set bookmark-name-or-record 'annotation ann))
 
 
-(defun bookmark-get-filename (bookmark)
-  "Return the full filename of BOOKMARK, or nil if none.
-BOOKMARK may be a bookmark name (a string) or a bookmark record."
-  (bookmark-prop-get bookmark 'filename))
+(defun bookmark-get-filename (bookmark-name-or-record)
+  "Return the full filename of BOOKMARK-NAME-OR-RECORD, or nil if none."
+  (bookmark-prop-get bookmark-name-or-record 'filename))
 
 
-(defun bookmark-set-filename (bookmark filename)
-  "Set the full filename of BOOKMARK to FILENAME.
-BOOKMARK may be a bookmark name (a string) or a bookmark record."
-  (bookmark-prop-set bookmark 'filename filename))
+(defun bookmark-set-filename (bookmark-name-or-record filename)
+  "Set the full filename of BOOKMARK-NAME-OR-RECORD to FILENAME."
+  (bookmark-prop-set bookmark-name-or-record 'filename filename))
 
 
-(defun bookmark-get-position (bookmark)
-  "Return the position (i.e.: point) of BOOKMARK, or nil if none.
-BOOKMARK may be a bookmark name (a string) or a bookmark record."
-  (bookmark-prop-get bookmark 'position))
+(defun bookmark-get-position (bookmark-name-or-record)
+  "Return the position (i.e.: point) of BOOKMARK-NAME-OR-RECORD, or nil if none."
+  (bookmark-prop-get bookmark-name-or-record 'position))
 
 
-(defun bookmark-set-position (bookmark position)
-  "Set the position (i.e.: point) of BOOKMARK to POSITION.
-BOOKMARK may be a bookmark name (a string) or a bookmark record."
-  (bookmark-prop-set bookmark 'position position))
+(defun bookmark-set-position (bookmark-name-or-record position)
+  "Set the position (i.e.: point) of BOOKMARK-NAME-OR-RECORD to POSITION."
+  (bookmark-prop-set bookmark-name-or-record 'position position))
 
 
-(defun bookmark-get-front-context-string (bookmark)
-  "Return the front-context-string of BOOKMARK, or nil if none.
-BOOKMARK may be a bookmark name (a string) or a bookmark record."
-  (bookmark-prop-get bookmark 'front-context-string))
+(defun bookmark-get-front-context-string (bookmark-name-or-record)
+  "Return the front-context-string of BOOKMARK-NAME-OR-RECORD, or nil if none."
+  (bookmark-prop-get bookmark-name-or-record 'front-context-string))
 
 
-(defun bookmark-set-front-context-string (bookmark string)
-  "Set the front-context-string of BOOKMARK to STRING.
-BOOKMARK may be a bookmark name (a string) or a bookmark record."
-  (bookmark-prop-set bookmark 'front-context-string string))
+(defun bookmark-set-front-context-string (bookmark-name-or-record string)
+  "Set the front-context-string of BOOKMARK-NAME-OR-RECORD to STRING."
+  (bookmark-prop-set bookmark-name-or-record 'front-context-string string))
 
 
-(defun bookmark-get-rear-context-string (bookmark)
-  "Return the rear-context-string of BOOKMARK, or nil if none.
-BOOKMARK may be a bookmark name (a string) or a bookmark record."
-  (bookmark-prop-get bookmark 'rear-context-string))
+(defun bookmark-get-rear-context-string (bookmark-name-or-record)
+  "Return the rear-context-string of BOOKMARK-NAME-OR-RECORD, or nil if none."
+  (bookmark-prop-get bookmark-name-or-record 'rear-context-string))
 
 
-(defun bookmark-set-rear-context-string (bookmark string)
-  "Set the rear-context-string of BOOKMARK to STRING.
-BOOKMARK may be a bookmark name (a string) or a bookmark record."
-  (bookmark-prop-set bookmark 'rear-context-string string))
+(defun bookmark-set-rear-context-string (bookmark-name-or-record string)
+  "Set the rear-context-string of BOOKMARK-NAME-OR-RECORD to STRING."
+  (bookmark-prop-set bookmark-name-or-record 'rear-context-string string))
 
 
-(defun bookmark-get-handler (bookmark)
-  "Return the handler function for BOOKMARK, or nil if none.
-BOOKMARK may be a bookmark name (a string) or a bookmark record."
-  (bookmark-prop-get bookmark 'handler))
+(defun bookmark-get-handler (bookmark-name-or-record)
+  "Return the handler function for BOOKMARK-NAME-OR-RECORD, or nil if none."
+  (bookmark-prop-get bookmark-name-or-record 'handler))
 
 (defvar bookmark-history nil
   "The history list for bookmark functions.")
@@ -830,11 +818,11 @@
 whose annotation is being edited.")
 
 
-(defun bookmark-default-annotation-text (bookmark)
-  "Return default annotation text for BOOKMARK (a string, not a record).
+(defun bookmark-default-annotation-text (bookmark-name)
+  "Return default annotation text for BOOKMARK-NAME.
 The default annotation text is simply some text explaining how to use
 annotations."
-  (concat "#  Type the annotation for bookmark '" bookmark "' here.\n"
+  (concat "#  Type the annotation for bookmark '" bookmark-name "' here.\n"
 	  "#  All lines which start with a '#' will be deleted.\n"
 	  "#  Type C-c C-c when done.\n#\n"
 	  "#  Author: " (user-full-name) " <" (user-login-name) "@"
@@ -856,22 +844,20 @@
   "Keymap for editing an annotation of a bookmark.")
 
 
-(defun bookmark-edit-annotation-mode (bookmark)
-  "Mode for editing the annotation of bookmark BOOKMARK.
+(defun bookmark-edit-annotation-mode (bookmark-name-or-record)
+  "Mode for editing the annotation of bookmark BOOKMARK-NAME-OR-RECORD.
 When you have finished composing, type \\[bookmark-send-annotation].
 
-BOOKMARK is a bookmark name (a string) or a bookmark record.
-
 \\{bookmark-edit-annotation-mode-map}"
   (interactive)
   (kill-all-local-variables)
   (make-local-variable 'bookmark-annotation-name)
-  (setq bookmark-annotation-name bookmark)
+  (setq bookmark-annotation-name bookmark-name-or-record)
   (use-local-map bookmark-edit-annotation-mode-map)
   (setq major-mode 'bookmark-edit-annotation-mode
         mode-name "Edit Bookmark Annotation")
-  (insert (funcall bookmark-edit-annotation-text-func bookmark))
-  (let ((annotation (bookmark-get-annotation bookmark)))
+  (insert (funcall bookmark-edit-annotation-text-func bookmark-name-or-record))
+  (let ((annotation (bookmark-get-annotation bookmark-name-or-record)))
     (if (and annotation (not (string-equal annotation "")))
 	(insert annotation)))
   (run-mode-hooks 'text-mode-hook))
@@ -890,19 +876,18 @@
       (forward-line 1)))
   ;; Take no chances with text properties.
   (let ((annotation (buffer-substring-no-properties (point-min) (point-max)))
-	(bookmark bookmark-annotation-name))
-    (bookmark-set-annotation bookmark annotation)
+	(bookmark-name bookmark-annotation-name))
+    (bookmark-set-annotation bookmark-name annotation)
     (setq bookmark-alist-modification-count
           (1+ bookmark-alist-modification-count))
     (bookmark-bmenu-surreptitiously-rebuild-list))
   (kill-buffer (current-buffer)))
 
 
-(defun bookmark-edit-annotation (bookmark)
-  "Pop up a buffer for editing bookmark BOOKMARK's annotation.
-BOOKMARK is a bookmark name (a string) or a bookmark record."
+(defun bookmark-edit-annotation (bookmark-name-or-record)
+  "Pop up a buffer for editing bookmark BOOKMARK-NAME-OR-RECORD's annotation."
   (pop-to-buffer (generate-new-buffer-name "*Bookmark Annotation Compose*"))
-  (bookmark-edit-annotation-mode bookmark))
+  (bookmark-edit-annotation-mode bookmark-name-or-record))
 
 
 (defun bookmark-insert-current-bookmark ()
@@ -1002,14 +987,14 @@
   "Hook run after `bookmark-jump' jumps to a bookmark.
 Useful for example to unhide text in `outline-mode'.")
 
-(defun bookmark--jump-via (bookmark display-function)
-  "Handle BOOKMARK, then call DISPLAY-FUNCTION with current buffer as argument.
-Bookmark may be a bookmark name (a string) or a bookmark record.
+(defun bookmark--jump-via (bookmark-name-or-record display-function)
+  "Handle BOOKMARK-NAME-OR-RECORD, then call DISPLAY-FUNCTION with
+current buffer as argument.
 
 After calling DISPLAY-FUNCTION, set window point to the point specified
-by BOOKMARK, if necessary, run `bookmark-after-jump-hook', and then show
-any annotations for this bookmark."
-  (bookmark-handle-bookmark bookmark)
+by BOOKMARK-NAME-OR-RECORD, if necessary, run `bookmark-after-jump-hook',
+and then show any annotations for this bookmark."
+  (bookmark-handle-bookmark bookmark-name-or-record)
   (save-current-buffer
     (funcall display-function (current-buffer)))
   (let ((win (get-buffer-window (current-buffer) 0)))
@@ -1020,7 +1005,7 @@
   (if bookmark-automatically-show-annotations
       ;; if there is an annotation for this bookmark,
       ;; show it in a buffer.
-      (bookmark-show-annotation bookmark)))
+      (bookmark-show-annotation bookmark-name-or-record)))
 
 
 ;;;###autoload
@@ -1036,8 +1021,8 @@
 will then jump to the new location, as well as recording it in place
 of the old one in the permanent bookmark record.
 
-BOOKMARK may be a bookmark name (a string) or a bookmark record, but
-the latter is usually only used by programmatic callers.
+BOOKMARK is usually a bookmark name (a string).  It can also be a
+bookmark record, but this is usually only done by programmatic callers.
 
 If DISPLAY-FUNC is non-nil, it is a function to invoke to display the
 bookmark.  It defaults to `switch-to-buffer'.  A typical value for
@@ -1061,11 +1046,9 @@
 
 
 (defun bookmark-jump-noselect (bookmark)
-  "Return the location pointed to by the bookmark BOOKMARK.
+  "Return the location pointed to by BOOKMARK (see `bookmark-jump').
 The return value has the form (BUFFER . POINT).
 
-BOOKMARK may be a bookmark name (a string) or a bookmark record.
-
 Note: this function is deprecated and is present for Emacs 22
 compatibility only."
   (save-excursion
@@ -1074,26 +1057,27 @@
 
 (make-obsolete 'bookmark-jump-noselect 'bookmark-handle-bookmark "23.1")
 
-(defun bookmark-handle-bookmark (bookmark)
-  "Call BOOKMARK's handler or `bookmark-default-handler' if it has none.
-BOOKMARK may be a bookmark name (a string) or a bookmark record.
-
-Changes current buffer and point and returns nil, or signals a `file-error'.
+(defun bookmark-handle-bookmark (bookmark-name-or-record)
+  "Call BOOKMARK-NAME-OR-RECORD's handler or `bookmark-default-handler'
+if it has none.  This changes current buffer and point and returns nil,
+or signals a `file-error'. 
 
-If BOOKMARK has no file, this is a no-op.  If BOOKMARK has a file, but
-that file no longer exists, then offer interactively to relocate BOOKMARK."
+If BOOKMARK-NAME-OR-RECORD has no file, this is a no-op.  If
+BOOKMARK-NAME-OR-RECORD has a file, but that file no longer exists,
+then offer interactively to relocate BOOKMARK-NAME-OR-RECORD."
   (condition-case err
-      (funcall (or (bookmark-get-handler bookmark)
+      (funcall (or (bookmark-get-handler bookmark-name-or-record)
                    'bookmark-default-handler)
-               (bookmark-get-bookmark bookmark))
+               (bookmark-get-bookmark bookmark-name-or-record))
     (bookmark-error-no-filename         ;file-error
      ;; We were unable to find the marked file, so ask if user wants to
      ;; relocate the bookmark, else remind them to consider deletion.
-     (when (stringp bookmark)
-       ;; `bookmark' can be either a bookmark name (from `bookmark-alist')
-       ;; or a bookmark object.  If it's an object, we assume it's a
-       ;; bookmark used internally by some other package.
-       (let ((file (bookmark-get-filename bookmark)))
+     (when (stringp bookmark-name-or-record)
+       ;; `bookmark-name-or-record' can be either a bookmark name
+       ;; (from `bookmark-alist')  or a bookmark object.  If it's an
+       ;; object, we assume it's a bookmark used internally by some
+       ;; other package.
+       (let ((file (bookmark-get-filename bookmark-name-or-record)))
          (when file        ;Don't know how to relocate if there's no `file'.
            ;; If file is not a dir, directory-file-name just returns file.
            (let ((display-name (directory-file-name file)))
@@ -1106,20 +1090,20 @@
              (let ((use-dialog-box nil)
                    (use-file-dialog nil))
                (if (y-or-n-p (concat display-name " nonexistent.  Relocate \""
-                                     bookmark "\"? "))
+                                     bookmark-name-or-record "\"? "))
                    (progn
-                     (bookmark-relocate bookmark)
+                     (bookmark-relocate bookmark-name-or-record)
                      ;; Try again.
-                     (funcall (or (bookmark-get-handler bookmark)
+                     (funcall (or (bookmark-get-handler bookmark-name-or-record)
                                   'bookmark-default-handler)
-                              (bookmark-get-bookmark bookmark)))
+                              (bookmark-get-bookmark bookmark-name-or-record)))
                  (message
                   "Bookmark not relocated; consider removing it (%s)."
-                  bookmark)
+                  bookmark-name-or-record)
                  (signal (car err) (cdr err))))))))))
   ;; Added by db.
-  (when (stringp bookmark)
-    (setq bookmark-current-bookmark bookmark))
+  (when (stringp bookmark-name-or-record)
+    (setq bookmark-current-bookmark bookmark-name-or-record))
   nil)
 
 (put 'bookmark-error-no-filename
@@ -1159,23 +1143,22 @@
     nil))
 
 ;;;###autoload
-(defun bookmark-relocate (bookmark)
-  "Relocate BOOKMARK to another file (reading file name with minibuffer).
-BOOKMARK is a bookmark name (a string), not a bookmark record.
+(defun bookmark-relocate (bookmark-name)
+  "Relocate BOOKMARK-NAME to another file, reading file name with minibuffer.
 
 This makes an already existing bookmark point to that file, instead of
 the one it used to point at.  Useful when a file has been renamed
 after a bookmark was set in it."
   (interactive (list (bookmark-completing-read "Bookmark to relocate")))
-  (bookmark-maybe-historicize-string bookmark)
+  (bookmark-maybe-historicize-string bookmark-name)
   (bookmark-maybe-load-default-file)
-  (let* ((bmrk-filename (bookmark-get-filename bookmark))
+  (let* ((bmrk-filename (bookmark-get-filename bookmark-name))
          (newloc (abbreviate-file-name
                   (expand-file-name
                    (read-file-name
-                    (format "Relocate %s to: " bookmark)
+                    (format "Relocate %s to: " bookmark-name)
                     (file-name-directory bmrk-filename))))))
-    (bookmark-set-filename bookmark newloc)
+    (bookmark-set-filename bookmark-name newloc)
     (setq bookmark-alist-modification-count
           (1+ bookmark-alist-modification-count))
     (if (bookmark-time-to-save-p)
@@ -1184,17 +1167,16 @@
 
 
 ;;;###autoload
-(defun bookmark-insert-location (bookmark &optional no-history)
-  "Insert the name of the file associated with BOOKMARK.
-BOOKMARK is a bookmark name (a string), not a bookmark record.
+(defun bookmark-insert-location (bookmark-name &optional no-history)
+  "Insert the name of the file associated with BOOKMARK-NAME.
 
 Optional second arg NO-HISTORY means don't record this in the
 minibuffer history list `bookmark-history'."
   (interactive (list (bookmark-completing-read "Insert bookmark location")))
-  (or no-history (bookmark-maybe-historicize-string bookmark))
+  (or no-history (bookmark-maybe-historicize-string bookmark-name))
   (let ((start (point)))
     (prog1
-	(insert (bookmark-location bookmark))
+	(insert (bookmark-location bookmark-name))
       (if (display-mouse-p)
 	  (add-text-properties
 	   start
@@ -1208,42 +1190,39 @@
 ;;;###autoload
 (defalias 'bookmark-locate 'bookmark-insert-location)
 
-(defun bookmark-location (bookmark)
-  "Return a description of the location of BOOKMARK.
-BOOKMARK may be a bookmark name (a string) or a bookmark record."
+(defun bookmark-location (bookmark-name-or-record)
+  "Return a description of the location of BOOKMARK-NAME-OR-RECORD."
   (bookmark-maybe-load-default-file)
   ;; We could call the `handler' and ask for it to construct a description
   ;; dynamically: it would open up several new possibilities, but it
   ;; would have the major disadvantage of forcing to load each and
   ;; every handler when the user calls bookmark-menu.
-  (or (bookmark-prop-get bookmark 'location)
-      (bookmark-get-filename bookmark)
+  (or (bookmark-prop-get bookmark-name-or-record 'location)
+      (bookmark-get-filename bookmark-name-or-record)
       "-- Unknown location --"))
 
 
 ;;;###autoload
-(defun bookmark-rename (old &optional new)
-  "Change the name of OLD bookmark to NEW name.
-If called from keyboard, prompt for OLD and NEW.  If called from
-menubar, select OLD from a menu and prompt for NEW.
+(defun bookmark-rename (old-name &optional new-name)
+  "Change the name of OLD-NAME bookmark to NEW-NAME name.
+If called from keyboard, prompt for OLD-NAME and NEW-NAME.
+If called from menubar, select OLD-NAME from a menu and prompt for NEW-NAME.
 
-Both OLD and NEW are bookmark names (strings), never bookmark records.
-
-If called from Lisp, prompt for NEW if only OLD was passed as an
-argument.  If called with two strings, then no prompting is done.  You
-must pass at least OLD when calling from Lisp.
+If called from Lisp, prompt for NEW-NAME if only OLD-NAME was passed
+as an argument.  If called with two strings, then no prompting is done.
+You must pass at least OLD-NAME when calling from Lisp.
 
 While you are entering the new name, consecutive C-w's insert
 consecutive words from the text of the buffer into the new bookmark
 name."
   (interactive (list (bookmark-completing-read "Old bookmark name")))
-  (bookmark-maybe-historicize-string old)
+  (bookmark-maybe-historicize-string old-name)
   (bookmark-maybe-load-default-file)
 
   (setq bookmark-yank-point (point))
   (setq bookmark-current-buffer (current-buffer))
-  (let ((newname
-         (or new   ; use second arg, if non-nil
+  (let ((final-new-name
+         (or new-name   ; use second arg, if non-nil
              (read-from-minibuffer
               "New name: "
               nil
@@ -1252,8 +1231,8 @@
                 now-map)
               nil
               'bookmark-history))))
-    (bookmark-set-name old newname)
-    (setq bookmark-current-bookmark newname)
+    (bookmark-set-name old-name final-new-name)
+    (setq bookmark-current-bookmark final-new-name)
     (bookmark-bmenu-surreptitiously-rebuild-list)
     (setq bookmark-alist-modification-count
           (1+ bookmark-alist-modification-count))
@@ -1262,21 +1241,21 @@
 
 
 ;;;###autoload
-(defun bookmark-insert (bookmark)
-  "Insert the text of the file pointed to by bookmark BOOKMARK.
-BOOKMARK is a bookmark name (a string), not a bookmark record.
+(defun bookmark-insert (bookmark-name)
+  "Insert the text of the file pointed to by bookmark BOOKMARK-NAME.
+BOOKMARK-NAME is a bookmark name (a string), not a bookmark record.
 
 You may have a problem using this function if the value of variable
 `bookmark-alist' is nil.  If that happens, you need to load in some
 bookmarks.  See help on function `bookmark-load' for more about
 this."
   (interactive (list (bookmark-completing-read "Insert bookmark contents")))
-  (bookmark-maybe-historicize-string bookmark)
+  (bookmark-maybe-historicize-string bookmark-name)
   (bookmark-maybe-load-default-file)
   (let ((orig-point (point))
 	(str-to-insert
 	 (save-current-buffer
-           (bookmark-handle-bookmark bookmark)
+           (bookmark-handle-bookmark bookmark-name)
 	   (buffer-string))))
     (insert str-to-insert)
     (push-mark)
@@ -1284,9 +1263,8 @@
 
 
 ;;;###autoload
-(defun bookmark-delete (bookmark &optional batch)
-  "Delete BOOKMARK from the bookmark list.
-BOOKMARK is a bookmark name (a string), not a bookmark record.
+(defun bookmark-delete (bookmark-name &optional batch)
+  "Delete BOOKMARK-NAME from the bookmark list.
 
 Removes only the first instance of a bookmark with that name.  If
 there are one or more other bookmarks with the same name, they will
@@ -1297,9 +1275,9 @@
   (interactive
    (list (bookmark-completing-read "Delete bookmark"
 				   bookmark-current-bookmark)))
-  (bookmark-maybe-historicize-string bookmark)
+  (bookmark-maybe-historicize-string bookmark-name)
   (bookmark-maybe-load-default-file)
-  (let ((will-go (bookmark-get-bookmark bookmark 'noerror)))
+  (let ((will-go (bookmark-get-bookmark bookmark-name 'noerror)))
     (setq bookmark-alist (delq will-go bookmark-alist))
     ;; Added by db, nil bookmark-current-bookmark if the last
     ;; occurrence has been deleted
@@ -1747,16 +1725,15 @@
     (get-text-property (point) 'bookmark-name-prop)))
 
 
-(defun bookmark-show-annotation (bookmark)
-  "Display the annotation for bookmark named BOOKMARK in a buffer,
+(defun bookmark-show-annotation (bookmark-name-or-record)
+  "Display the annotation for BOOKMARK-NAME-OR-RECORD in a buffer,
 if an annotation exists."
-  (let ((annotation (bookmark-get-annotation bookmark)))
+  (let ((annotation (bookmark-get-annotation bookmark-name-or-record)))
     (when (and annotation (not (string-equal annotation "")))
       (save-excursion
         (let ((old-buf (current-buffer)))
           (pop-to-buffer (get-buffer-create "*Bookmark Annotation*") t)
           (delete-region (point-min) (point-max))
-          ;; (insert (concat "Annotation for bookmark '" bookmark "':\n\n"))
           (insert annotation)
           (goto-char (point-min))
           (switch-to-buffer-other-window old-buf))))))
--- a/lisp/calendar/diary-lib.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/calendar/diary-lib.el	Thu Dec 16 18:30:57 2010 -0500
@@ -305,28 +305,48 @@
   :type 'boolean
   :group 'diary)
 
+(defun diary-outlook-format-1 (body)
+  "Return a replace-match template for an element of `diary-outlook-formats'.
+Returns a string using match elements 1-5, where:
+1 = month name, 2 = day, 3 = year, 4 = time, 5 = location; also uses
+%s = message subject.  BODY is the string from which the matches derive."
+  (let* ((monthname (match-string 1 body))
+        (day (match-string 2 body))
+        (year (match-string 3 body))
+        ;; Blech.
+        (month (catch 'found
+                 (dotimes (i (length calendar-month-name-array))
+                   (if (string-equal (aref calendar-month-name-array i)
+                                     monthname)
+                       (throw 'found (1+ i))))
+                 nil)))
+    ;; If we could convert the monthname to a numeric month, we can
+    ;; use the standard function calendar-date-string.
+    (concat (if month
+                (calendar-date-string (list month (string-to-number day)
+                                            (string-to-number year)))
+              (cond ((eq calendar-date-style 'iso) "\\3 \\1 \\2") ; YMD
+                    ((eq calendar-date-style 'european) "\\2 \\1 \\3") ; DMY
+                    (t "\\1 \\2 \\3"))) ; MDY
+            "\n \\4 %s, \\5")))
+;; TODO Sometimes the time is in a different time-zone to the one you
+;; are in.  Eg in PST, you might still get an email referring to:
+;; "7:00 PM-8:00 PM. Greenwich Standard Time".
+;; Note that it doesn't use a standard abbreviation for the timezone,
+;; or anything helpful like that.
+;; Sigh, this could cause the meeting to even be on a different day
+;; to that given in the When: string.
+;; These things seem to come in a multipart mail with a calendar part,
+;; it's probably better to use that rather than this whole thing.
+;; So this is unlikely to get improved.
+
+;; TODO Is the format of these messages actually documented anywhere?
 (defcustom diary-outlook-formats
-  '(
-    ;; When: 11 October 2001 12:00-14:00 (GMT) Greenwich Mean Time : Dublin, ...
-    ;; [Current UK format?  The timezone is meaningless.  Sometimes the
-    ;; Where is missing.]
-    ("When: \\([0-9]+ [[:alpha:]]+ [0-9]+\\) \
-\\([^ ]+\\) [^\n]+
-\[^\n]+
-\\(?:Where: \\([^\n]+\\)\n+\\)?
-\\*~\\*~\\*~\\*~\\*~\\*~\\*~\\*~\\*~\\*"
-     . "\\1\n \\2 %s, \\3")
-    ;; When: Tuesday, April 30, 2002 03:00 PM-03:30 PM (GMT) Greenwich Mean ...
-    ;; [Old UK format?]
-    ("^When: [[:alpha:]]+, \\([[:alpha:]]+\\) \\([0-9][0-9]*\\), \\([0-9]\\{4\\}\\) \
-\\([^ ]+\\) [^\n]+
-\[^\n]+
-\\(?:Where: \\([^\n]+\\)\\)?\n+"
-     . "\\2 \\1 \\3\n \\4 %s, \\5")
-    (
-     ;; German format, apparently.
-     "^Zeit: [^ ]+, +\\([0-9]+\\)\. +\\([[:upper:]][[:lower:]][[:lower:]]\\)[^ ]* +\\([0-9]+\\) +\\([^ ]+\\).*$"
-     . "\\1 \\2 \\3\n \\4 %s"))
+  '(;; When: Tuesday, November 9, 2010 7:00 PM-8:00 PM. Greenwich Standard Time
+    ;; Where: Meeting room B
+    ("[ \t\n]*When: [[:alpha:]]+, \\([[:alpha:]]+\\) \\([0-9][0-9]*\\), \
+\\([0-9]\\{4\\}\\),? \\(.+\\)\n\
+\\(?:Where: \\(.+\n\\)\\)?" . diary-outlook-format-1))
   "Alist of regexps matching message text and replacement text.
 
 The regexp must match the start of the message text containing an
@@ -836,7 +856,7 @@
   (kill-local-variable 'mode-line-format))
 
 (defvar original-date)                  ; bound in diary-list-entries
-(defvar number)
+;(defvar number)                         ; already declared above
 
 (defun diary-include-other-diary-files ()
   "Include the diary entries from other diary files with those of `diary-file'.
@@ -1744,7 +1764,7 @@
         (forward-line 1)
         (while (looking-at "[ \t]")
           (forward-line 1))
-        (backward-char 1)
+        (if (bolp) (backward-char 1))
         (setq entry (buffer-substring-no-properties entry-start (point))))
       (setq diary-entry (diary-sexp-entry sexp entry date)
             literal entry               ; before evaluation
@@ -2414,25 +2434,19 @@
 ;; functions `diary-from-outlook-gnus' and `diary-from-outlook-rmail',
 ;; could be run from hooks to notice appointments automatically (in
 ;; which case they will prompt about adding to the diary).  The
-;; message formats recognized are customizable through
-;; `diary-outlook-formats'.
+;; message formats recognized are customizable through `diary-outlook-formats'.
 
-(defvar subject)                        ; bound in diary-from-outlook-gnus
-(defvar body)
-
-(defun diary-from-outlook-internal (&optional test-only)
+(defun diary-from-outlook-internal (subject body &optional test-only)
   "Snarf a diary entry from a message assumed to be from MS Outlook.
-Assumes `body' is bound to a string comprising the body of the message and
-`subject' is bound to a string comprising its subject.
+SUBJECT and BODY are strings giving the message subject and body.
 Arg TEST-ONLY non-nil means return non-nil if and only if the
 message contains an appointment, don't make a diary entry."
   (catch 'finished
     (let (format-string)
-      (dotimes (i (length diary-outlook-formats))
-        (when (eq 0 (string-match (car (nth i diary-outlook-formats))
-                                  body))
+      (dolist (fmt diary-outlook-formats)
+        (when (eq 0 (string-match (car fmt) body))
           (unless test-only
-            (setq format-string (cdr (nth i diary-outlook-formats)))
+            (setq format-string (cdr fmt))
             (save-excursion
               (save-window-excursion
                 (diary-make-entry
@@ -2440,8 +2454,7 @@
                                             (funcall format-string body)
                                           format-string)
                                         t nil (match-string 0 body))
-                         subject))
-                (save-buffer))))
+                         subject)))))
           (throw 'finished t))))
     nil))
 
@@ -2469,9 +2482,9 @@
                   (save-restriction
                     (gnus-narrow-to-body)
                     (buffer-string)))))
-      (when (diary-from-outlook-internal t)
+      (when (diary-from-outlook-internal subject body t)
         (when (or noconfirm (y-or-n-p "Snarf diary entry? "))
-          (diary-from-outlook-internal)
+          (diary-from-outlook-internal subject body)
           (message "Diary entry added"))))))
 
 (custom-add-option 'gnus-article-prepare-hook 'diary-from-outlook-gnus)
@@ -2484,15 +2497,17 @@
 this function is called interactively), then if an entry is found the
 user is asked to confirm its addition."
   (interactive "p")
+  ;; FIXME maybe the body needs rmail-mm decoding, in which case
+  ;; there is no single buffer with both body and subject, sigh.
   (with-current-buffer rmail-buffer
     (let ((subject (mail-fetch-field "subject"))
           (body (buffer-substring (save-excursion
                                     (rfc822-goto-eoh)
                                     (point))
                                   (point-max))))
-      (when (diary-from-outlook-internal t)
+      (when (diary-from-outlook-internal subject body t)
         (when (or noconfirm (y-or-n-p "Snarf diary entry? "))
-          (diary-from-outlook-internal)
+          (diary-from-outlook-internal subject body)
           (message "Diary entry added"))))))
 
 (defun diary-from-outlook (&optional noconfirm)
--- a/lisp/comint.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/comint.el	Thu Dec 16 18:30:57 2010 -0500
@@ -244,8 +244,8 @@
 (defcustom comint-input-ring-file-name nil
   "If non-nil, name of the file to read/write input history.
 See also `comint-read-input-ring' and `comint-write-input-ring'.
-
-This variable is buffer-local, and is a good thing to set in mode hooks."
+`comint-mode' makes this a buffer-local variable.  You probably want
+to set this in a mode hook, rather than customize the default value."
   :type '(choice (const :tag "nil" nil)
 		 file)
   :group 'comint)
@@ -1009,7 +1009,7 @@
     (choose-completion-string completion buffer)))
 
 (defun comint-dynamic-list-input-ring ()
-  "List in help buffer the buffer's input history."
+  "Display a list of recent inputs entered into the current buffer."
   (interactive)
   (if (or (not (ring-p comint-input-ring))
 	  (ring-empty-p comint-input-ring))
@@ -3003,7 +3003,7 @@
 This function is similar to `comint-replace-by-expanded-filename', except that
 it won't change parts of the filename already entered in the buffer; it just
 adds completion characters to the end of the filename.  A completions listing
-may be shown in a help buffer if completion is ambiguous.
+may be shown in a separate buffer if completion is ambiguous.
 
 Completion is dependent on the value of `comint-completion-addsuffix',
 `comint-completion-recexact' and `comint-completion-fignore', and the timing of
@@ -3090,11 +3090,11 @@
 
 (defun comint-replace-by-expanded-filename ()
   "Dynamically expand and complete the filename at point.
-Replace the filename with an expanded, canonicalized and completed replacement.
-\"Expanded\" means environment variables (e.g., $HOME) and `~'s are replaced
-with the corresponding directories.  \"Canonicalized\" means `..'  and `.' are
-removed, and the filename is made absolute instead of relative.  For expansion
-see `expand-file-name' and `substitute-in-file-name'.  For completion see
+Replace the filename with an expanded, canonicalized and
+completed replacement, i.e. substituting environment
+variables (e.g. $HOME), `~'s, `..', and `.', and making the
+filename absolute.  For expansion see `expand-file-name' and
+`substitute-in-file-name'.  For completion see
 `comint-dynamic-complete-filename'."
   (interactive)
   (let ((filename (comint-match-partial-filename)))
@@ -3105,15 +3105,16 @@
 
 (defun comint-dynamic-simple-complete (stub candidates)
   "Dynamically complete STUB from CANDIDATES list.
-This function inserts completion characters at point by completing STUB from
-the strings in CANDIDATES.  A completions listing may be shown in a help buffer
-if completion is ambiguous.
-
-Returns nil if no completion was inserted.
-Returns `sole' if completed with the only completion match.
-Returns `shortest' if completed with the shortest of the completion matches.
-Returns `partial' if completed as far as possible with the completion matches.
-Returns `listed' if a completion listing was shown.
+This function inserts completion characters at point by
+completing STUB from the strings in CANDIDATES.  If completion is
+ambiguous, possibly show a completions listing in a separate
+buffer.
+
+Return nil if no completion was inserted.
+Return `sole' if completed with the only completion match.
+Return `shortest' if completed with the shortest match.
+Return `partial' if completed as far as possible.
+Return `listed' if a completion listing was shown.
 
 See also `comint-dynamic-complete-filename'."
   (let* ((completion-ignore-case (memq system-type '(ms-dos windows-nt cygwin)))
@@ -3161,7 +3162,7 @@
 
 
 (defun comint-dynamic-list-filename-completions ()
-  "List in help buffer possible completions of the filename at point."
+  "Display a list of possible completions for the filename at point."
   (interactive)
   (let* ((completion-ignore-case read-file-name-completion-ignore-case)
 	 ;; If we bind this, it breaks remote directory tracking in rlogin.el.
@@ -3190,9 +3191,9 @@
 (defvar comint-dynamic-list-completions-config nil)
 
 (defun comint-dynamic-list-completions (completions &optional common-substring)
-  "List in help buffer sorted COMPLETIONS.
+  "Display a list of sorted COMPLETIONS.
 The meaning of COMMON-SUBSTRING is the same as in `display-completion-list'.
-Typing SPC flushes the help buffer."
+Typing SPC flushes the completions buffer."
   (let ((window (get-buffer-window "*Completions*" 0)))
     (setq completions (sort completions 'string-lessp))
     (if (and (eq last-command this-command)
--- a/lisp/cus-edit.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/cus-edit.el	Thu Dec 16 18:30:57 2010 -0500
@@ -4426,7 +4426,9 @@
 
       (unless (eq major-mode 'emacs-lisp-mode)
 	(emacs-lisp-mode))
-      (let ((inhibit-read-only t))
+      (let ((inhibit-read-only t)
+	    (print-length nil)
+	    (print-level nil))
 	(custom-save-variables)
 	(custom-save-faces))
       (let ((file-precious-flag t))
--- a/lisp/dired-aux.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/dired-aux.el	Thu Dec 16 18:30:57 2010 -0500
@@ -1019,10 +1019,14 @@
     ;; message much faster than making dired-map-over-marks show progress
     (dired-uncache
      (if (consp dired-directory) (car dired-directory) dired-directory))
-    (dired-map-over-marks (let ((fname (dired-get-filename)))
+    (dired-map-over-marks (let ((fname (dired-get-filename))
+				;; Postphone readin hook till we map
+				;; over all marked files (Bug#6810).
+				(dired-after-readin-hook nil))
 			    (message "Redisplaying... %s" fname)
 			    (dired-update-file-line fname))
 			  arg)
+    (run-hooks 'dired-after-readin-hook)
     (dired-move-to-filename)
     (message "Redisplaying...done")))
 
--- a/lisp/dired.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/dired.el	Thu Dec 16 18:30:57 2010 -0500
@@ -26,8 +26,8 @@
 
 ;;; Commentary:
 
-;; This is a major mode for directory browsing and editing.  It is
-;; documented in the Emacs manual.
+;; This is a major mode for directory browsing and editing.
+;; It is documented in the Emacs manual.
 
 ;; Rewritten in 1990/1991 to add tree features, file marking and
 ;; sorting by Sebastian Kremer <sk@thp.uni-koeln.de>.
@@ -62,32 +62,41 @@
   :type 'string
   :group 'dired)
 
-(defvar dired-subdir-switches nil
+(defcustom dired-subdir-switches nil
   "If non-nil, switches passed to `ls' for inserting subdirectories.
-If nil, `dired-listing-switches' is used.")
-
-; Don't use absolute file names as /bin should be in any PATH and people
-; may prefer /usr/local/gnu/bin or whatever.  However, chown is
-; usually not in PATH.
-
-;;;###autoload
-(defvar dired-chown-program
-  (purecopy
-  (if (memq system-type '(hpux usg-unix-v irix gnu/linux cygwin))
-      "chown"
-    (if (file-exists-p "/usr/sbin/chown")
-	"/usr/sbin/chown"
-      "/etc/chown")))
-  "Name of chown command (usually `chown' or `/etc/chown').")
-
-(defvar dired-use-ls-dired (not (not (string-match "gnu" system-configuration)))
-  "Non-nil means Dired should use `ls --dired'.")
-
-(defvar dired-chmod-program "chmod"
-  "Name of chmod command (usually `chmod').")
-
-(defvar dired-touch-program "touch"
-  "Name of touch command (usually `touch').")
+If nil, `dired-listing-switches' is used."
+   :group 'dired
+   :type '(choice (const :tag "Use dired-listing-switches" nil)
+                  (string :tag "Switches")))
+
+(defcustom dired-chown-program
+  (purecopy (cond ((executable-find "chown") "chown")
+                  ((file-executable-p "/usr/sbin/chown") "/usr/sbin/chown")
+                  ((file-executable-p "/etc/chown") "/etc/chown")
+                  (t "chown")))
+  "Name of chown command (usually `chown')."
+  :group 'dired
+  :type 'file)
+
+(defcustom dired-use-ls-dired 'unspecified
+  "Non-nil means Dired should use \"ls --dired\".
+The special value of `unspecified' means to check explicitly, and
+save the result in this variable.  This is performed the first
+time `dired-insert-directory' is called."
+  :group 'dired
+  :type '(choice (const :tag "Check for --dired support" unspecified)
+                 (const :tag "Do not use --dired" nil)
+                 (other :tag "Use --dired" t)))
+
+(defcustom dired-chmod-program "chmod"
+  "Name of chmod command (usually `chmod')."
+  :group 'dired
+  :type 'file)
+
+(defcustom dired-touch-program "touch"
+  "Name of touch command (usually `touch')."
+   :group 'dired
+   :type 'file)
 
 (defcustom dired-ls-F-marks-symlinks nil
   "Informs Dired about how `ls -lF' marks symbolic links.
@@ -105,7 +114,6 @@
   :type 'boolean
   :group 'dired-mark)
 
-;;;###autoload
 (defcustom dired-trivial-filenames (purecopy "^\\.\\.?$\\|^#")
   "Regexp of files to skip when finding first file of a directory.
 A value of nil means move to the subdir line.
@@ -753,7 +761,6 @@
 	 buffer-read-only
 	 (dired-directory-changed-p dirname))))
 
-;;;###autoload
 (defcustom dired-auto-revert-buffer nil
   "Automatically revert dired buffer on revisiting.
 If t, revisiting an existing dired buffer automatically reverts it.
@@ -1057,7 +1064,14 @@
   (let ((opoint (point))
 	(process-environment (copy-sequence process-environment))
 	end)
-    (if (or dired-use-ls-dired (file-remote-p dir))
+    (if (or (if (eq dired-use-ls-dired 'unspecified)
+		;; Check whether "ls --dired" gives exit code 0, and
+		;; save the answer in `dired-use-ls-dired'.
+		(setq dired-use-ls-dired
+		      (eq (call-process insert-directory-program nil nil nil "--dired")
+			  0))
+	      dired-use-ls-dired)
+	    (file-remote-p dir))
 	(setq switches (concat "--dired " switches)))
     ;; We used to specify the C locale here, to force English month names;
     ;; but this should not be necessary any more,
@@ -2011,6 +2025,14 @@
           ;; with quotation marks in their names.
 	  (while (string-match "\\(?:[^\\]\\|\\`\\)\\(\"\\)" file)
 	    (setq file (replace-match "\\\"" nil t file 1)))
+	  
+	  (when (eq system-type 'windows-nt)
+	    (save-match-data
+	      (let ((start 0))
+		(while (string-match "\\\\" file start)
+		  (aset file (match-beginning 0) ?/)
+		  (setq start (match-end 0))))))
+
           (setq file (read (concat "\"" file "\"")))
 	  ;; The above `read' will return a unibyte string if FILE
 	  ;; contains eight-bit-control/graphic characters.
@@ -2757,7 +2779,8 @@
 		    ;; that's possible.  (Bug#1806)
 		    (split-window-vertically))
 	       ;; Otherwise, try to split WINDOW sensibly.
-	       (split-window-sensibly window)))))
+	       (split-window-sensibly window))))
+	pop-up-frames)
     (pop-to-buffer (get-buffer-create buf)))
   ;; If dired-shrink-to-fit is t, make its window fit its contents.
   (when dired-shrink-to-fit
@@ -3539,7 +3562,7 @@
 ;;;;;;  dired-run-shell-command dired-do-shell-command dired-do-async-shell-command
 ;;;;;;  dired-clean-directory dired-do-print dired-do-touch dired-do-chown
 ;;;;;;  dired-do-chgrp dired-do-chmod dired-compare-directories dired-backup-diff
-;;;;;;  dired-diff) "dired-aux" "dired-aux.el" "1628b7a7d379fb4da8ae4bf29faad4b5")
+;;;;;;  dired-diff) "dired-aux" "dired-aux.el" "2e8658304f56098052e312d01c8763a2")
 ;;; Generated autoloads from dired-aux.el
 
 (autoload 'dired-diff "dired-aux" "\
--- a/lisp/electric.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/electric.el	Thu Dec 16 18:30:57 2010 -0500
@@ -217,15 +217,15 @@
                (not (nth 8 (save-excursion (syntax-ppss pos)))))
       ;; For newline, we want to reindent both lines and basically behave like
       ;; reindent-then-newline-and-indent (whose code we hence copied).
-      (when (and (< (1- pos) (line-beginning-position))
-                 ;; Don't reindent the previous line if the indentation
-                 ;; function is not a real one.
-                 (not (memq indent-line-function
-                            '(indent-relative indent-relative-maybe))))
+      (when (< (1- pos) (line-beginning-position))
         (let ((before (copy-marker (1- pos) t)))
           (save-excursion
-            (goto-char before)
-            (indent-according-to-mode)
+            (unless (memq indent-line-function
+                          '(indent-relative indent-relative-maybe))
+              ;; Don't reindent the previous line if the indentation function
+              ;; is not a real one.
+              (goto-char before)
+              (indent-according-to-mode))
             ;; We are at EOL before the call to indent-according-to-mode, and
             ;; after it we usually are as well, but not always.  We tried to
             ;; address it with `save-excursion' but that uses a normal marker
--- a/lisp/emacs-lisp/cl-loaddefs.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/emacs-lisp/cl-loaddefs.el	Thu Dec 16 18:30:57 2010 -0500
@@ -282,7 +282,7 @@
 ;;;;;;  do-all-symbols do-symbols dotimes dolist do* do loop return-from
 ;;;;;;  return block etypecase typecase ecase case load-time-value
 ;;;;;;  eval-when destructuring-bind function* defmacro* defun* gentemp
-;;;;;;  gensym) "cl-macs" "cl-macs.el" "979862b54946a5fcbbccdd90fa3f84d8")
+;;;;;;  gensym) "cl-macs" "cl-macs.el" "34ea402a8756c7d74d27cdcecf35e3c3")
 ;;; Generated autoloads from cl-macs.el
 
 (autoload 'gensym "cl-macs" "\
--- a/lisp/emacs-lisp/cl-macs.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/emacs-lisp/cl-macs.el	Thu Dec 16 18:30:57 2010 -0500
@@ -965,16 +965,25 @@
 
 	       ((memq word '(window windows))
 		(let ((scr (and (memq (car loop-args) '(in of)) (cl-pop2 loop-args)))
-		      (temp (make-symbol "--cl-var--")))
+		      (temp (make-symbol "--cl-var--"))
+		      (minip (make-symbol "--cl-minip--")))
 		  (push (list var (if scr
 				      (list 'frame-selected-window scr)
 				    '(selected-window)))
 			loop-for-bindings)
+		  ;; If we started in the minibuffer, we need to
+		  ;; ensure that next-window will bring us back there
+		  ;; at some point.  (Bug#7492).
+		  ;; (Consider using walk-windows instead of loop if
+		  ;; you care about such things.)
+		  (push (list minip `(minibufferp (window-buffer ,var)))
+			loop-for-bindings)
 		  (push (list temp nil) loop-for-bindings)
 		  (push (list 'prog1 (list 'not (list 'eq var temp))
 			      (list 'or temp (list 'setq temp var)))
 			loop-body)
-		  (push (list var (list 'next-window var)) loop-for-steps)))
+		  (push (list var (list 'next-window var minip))
+			loop-for-steps)))
 
 	       (t
 		(let ((handler (and (symbolp word)
--- a/lisp/emacs-lisp/pcase.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/emacs-lisp/pcase.el	Thu Dec 16 18:30:57 2010 -0500
@@ -31,7 +31,7 @@
 ;;   define-pcase-matcher.  We could easily make it so that (guard BOOLEXP)
 ;;   could be defined this way, as a shorthand for (pred (lambda (_) BOOLEXP)).
 ;;   But better would be if we could define new ways to match by having the
-;;   extension provide its own `pcase-split-<foo>' thingy.
+;;   extension provide its own `pcase--split-<foo>' thingy.
 ;; - ideally we'd want (pcase s ((re RE1) E1) ((re RE2) E2)) to be able to
 ;;   generate a lex-style DFA to decide whether to run E1 or E2.
 
@@ -46,6 +46,8 @@
 ;; over and over again.
 (defconst pcase-memoize (make-hash-table :weakness t :test 'equal))
 
+(defconst pcase--dontcare-upats '(t _ dontcare))
+
 ;;;###autoload
 (defmacro pcase (exp &rest cases)
   "Perform ML-style pattern matching on EXP.
@@ -78,39 +80,61 @@
   (declare (indent 1) (debug case))     ;FIXME: edebug `guard' and vars.
   (or (gethash (cons exp cases) pcase-memoize)
       (puthash (cons exp cases)
-               (pcase-expand exp cases)
+               (pcase--expand exp cases)
                pcase-memoize)))
 
 ;;;###autoload
-(defmacro pcase-let* (bindings body)
+(defmacro pcase-let* (bindings &rest body)
   "Like `let*' but where you can use `pcase' patterns for bindings.
 BODY should be an expression, and BINDINGS should be a list of bindings
 of the form (UPAT EXP)."
   (declare (indent 1) (debug let))
-  (if (null bindings) body
+  (cond
+   ((null bindings) (if (> (length body) 1) `(progn ,@body) (car body)))
+   ((pcase--trivial-upat-p (caar bindings))
+    `(let (,(car bindings)) (pcase-let* ,(cdr bindings) ,@body)))
+   (t
     `(pcase ,(cadr (car bindings))
-       (,(caar bindings) (pcase-let* ,(cdr bindings) ,body))
-       ;; FIXME: In many cases `dontcare' would be preferable, so maybe we
-       ;; should have `let' and `elet', like we have `case' and `ecase'.
-       (t (error "Pattern match failure in `pcase-let'")))))
+       (,(caar bindings) (pcase-let* ,(cdr bindings) ,@body))
+       ;; We can either signal an error here, or just use `dontcare' which
+       ;; generates more efficient code.  In practice, if we use `dontcare' we
+       ;; will still often get an error and the few cases where we don't do not
+       ;; matter that much, so it's a better choice.
+       (dontcare nil)))))
 
 ;;;###autoload
-(defmacro pcase-let (bindings body)
+(defmacro pcase-let (bindings &rest body)
   "Like `let' but where you can use `pcase' patterns for bindings.
-BODY should be an expression, and BINDINGS should be a list of bindings
+BODY should be a list of expressions, and BINDINGS should be a list of bindings
 of the form (UPAT EXP)."
   (declare (indent 1) (debug let))
   (if (null (cdr bindings))
-      `(pcase-let* ,bindings ,body)
-    (setq bindings (mapcar (lambda (x) (cons (make-symbol "x") x)) bindings))
-    `(let ,(mapcar (lambda (binding) (list (nth 0 binding) (nth 2 binding)))
-                   bindings)
-       (pcase-let*
-        ,(mapcar (lambda (binding) (list (nth 1 binding) (nth 0 binding)))
-                 bindings)
-        ,body))))
+      `(pcase-let* ,bindings ,@body)
+    (let ((matches '()))
+      (dolist (binding (prog1 bindings (setq bindings nil)))
+        (cond
+         ((memq (car binding) pcase--dontcare-upats)
+          (push (cons (make-symbol "_") (cdr binding)) bindings))
+         ((pcase--trivial-upat-p (car binding)) (push binding bindings))
+         (t
+          (let ((tmpvar (make-symbol (format "x%d" (length bindings)))))
+            (push (cons tmpvar (cdr binding)) bindings)
+            (push (list (car binding) tmpvar) matches)))))
+      `(let ,(nreverse bindings) (pcase-let* ,matches ,@body)))))
 
-(defun pcase-expand (exp cases)
+(defmacro pcase-dolist (spec &rest body)
+  (if (pcase--trivial-upat-p (car spec))
+      `(dolist ,spec ,@body)
+    (let ((tmpvar (make-symbol "x")))
+      `(dolist (,tmpvar ,@(cdr spec))
+         (pcase-let* ((,(car spec) ,tmpvar))
+           ,@body)))))
+
+
+(defun pcase--trivial-upat-p (upat)
+  (and (symbolp upat) (not (memq upat pcase--dontcare-upats))))
+
+(defun pcase--expand (exp cases)
   (let* ((defs (if (symbolp exp) '()
                  (let ((sym (make-symbol "x")))
                    (prog1 `((,sym ,exp)) (setq exp sym)))))
@@ -153,23 +177,24 @@
                              (mapcar #'car vars)))
                     `(funcall ,res ,@args)))))))
          (main
-          (pcase-u
+          (pcase--u
            (mapcar (lambda (case)
                      `((match ,exp . ,(car case))
                        ,(apply-partially
-                         (if (pcase-small-branch-p (cdr case))
+                         (if (pcase--small-branch-p (cdr case))
                              ;; Don't bother sharing multiple
                              ;; occurrences of this leaf since it's small.
                              #'pcase-codegen codegen)
                          (cdr case))))
                    cases))))
-    `(let ,defs ,main)))
+    (if (null defs) main
+      `(let ,defs ,main))))
 
 (defun pcase-codegen (code vars)
   `(let ,(mapcar (lambda (b) (list (car b) (cdr b))) vars)
      ,@code))
 
-(defun pcase-small-branch-p (code)
+(defun pcase--small-branch-p (code)
   (and (= 1 (length code))
        (or (not (consp (car code)))
            (let ((small t))
@@ -179,15 +204,15 @@
 
 ;; Try to use `cond' rather than a sequence of `if's, so as to reduce
 ;; the depth of the generated tree.
-(defun pcase-if (test then else)
+(defun pcase--if (test then else)
   (cond
-   ((eq else :pcase-dontcare) then)
+   ((eq else :pcase--dontcare) then)
    ((eq (car-safe else) 'if)
     (if (equal test (nth 1 else))
         ;; Doing a test a second time: get rid of the redundancy.
-        ;; FIXME: ideally, this should never happen because the pcase-split-*
-        ;; functions should have eliminated such things, but pcase-split-member
-        ;; is imprecise, so in practice it does happen occasionally.
+        ;; FIXME: ideally, this should never happen because the pcase--split-*
+        ;; funs should have eliminated such things, but pcase--split-member
+        ;; is imprecise, so in practice it can happen occasionally.
         `(if ,test ,then ,@(nthcdr 3 else))
       `(cond (,test ,then)
              (,(nth 1 else) ,(nth 2 else))
@@ -198,7 +223,7 @@
            ,@(remove (assoc test else) (cdr else))))
    (t `(if ,test ,then ,else))))
 
-(defun pcase-upat (qpattern)
+(defun pcase--upat (qpattern)
   (cond
    ((eq (car-safe qpattern) '\,) (cadr qpattern))
    (t (list '\` qpattern))))
@@ -221,7 +246,7 @@
 ;; canonicalize them to one form over another, but we do occasionally
 ;; turn one into the other.
 
-(defun pcase-u (branches)
+(defun pcase--u (branches)
   "Expand matcher for rules BRANCHES.
 Each BRANCH has the form (MATCH CODE . VARS) where
 CODE is the code generator for that branch.
@@ -232,12 +257,12 @@
   (or MATCH ...)"
   (when (setq branches (delq nil branches))
     (destructuring-bind (match code &rest vars) (car branches)
-      (pcase-u1 (list match) code vars (cdr branches)))))
+      (pcase--u1 (list match) code vars (cdr branches)))))
 
-(defun pcase-and (match matches)
+(defun pcase--and (match matches)
   (if matches `(and ,match ,@matches) match))
 
-(defun pcase-split-match (sym splitter match)
+(defun pcase--split-match (sym splitter match)
   (case (car match)
     ((match)
      (if (not (eq sym (cadr match)))
@@ -246,20 +271,21 @@
          (cond
           ;; Hoist `or' and `and' patterns to `or' and `and' matches.
           ((memq (car-safe pat) '(or and))
-           (pcase-split-match sym splitter
-                              (cons (car pat)
-                                    (mapcar (lambda (alt)
-                                              `(match ,sym . ,alt))
-                                            (cdr pat)))))
+           (pcase--split-match sym splitter
+                               (cons (car pat)
+                                     (mapcar (lambda (alt)
+                                               `(match ,sym . ,alt))
+                                             (cdr pat)))))
           (t (let ((res (funcall splitter (cddr match))))
                (cons (or (car res) match) (or (cdr res) match))))))))
     ((or and)
      (let ((then-alts '())
            (else-alts '())
-           (neutral-elem (if (eq 'or (car match)) :pcase-fail :pcase-succeed))
-           (zero-elem (if (eq 'or (car match)) :pcase-succeed :pcase-fail)))
+           (neutral-elem (if (eq 'or (car match))
+                             :pcase--fail :pcase--succeed))
+           (zero-elem (if (eq 'or (car match)) :pcase--succeed :pcase--fail)))
        (dolist (alt (cdr match))
-         (let ((split (pcase-split-match sym splitter alt)))
+         (let ((split (pcase--split-match sym splitter alt)))
            (unless (eq (car split) neutral-elem)
              (push (car split) then-alts))
            (unless (eq (cdr split) neutral-elem)
@@ -274,50 +300,50 @@
                    (t (cons (car match) (nreverse else-alts)))))))
     (t (error "Uknown MATCH %s" match))))
 
-(defun pcase-split-rest (sym splitter rest)
+(defun pcase--split-rest (sym splitter rest)
   (let ((then-rest '())
         (else-rest '()))
     (dolist (branch rest)
       (let* ((match (car branch))
              (code&vars (cdr branch))
              (splitted
-              (pcase-split-match sym splitter match)))
-        (unless (eq (car splitted) :pcase-fail)
+              (pcase--split-match sym splitter match)))
+        (unless (eq (car splitted) :pcase--fail)
           (push (cons (car splitted) code&vars) then-rest))
-        (unless (eq (cdr splitted) :pcase-fail)
+        (unless (eq (cdr splitted) :pcase--fail)
           (push (cons (cdr splitted) code&vars) else-rest))))
     (cons (nreverse then-rest) (nreverse else-rest))))
 
-(defun pcase-split-consp (syma symd pat)
+(defun pcase--split-consp (syma symd pat)
   (cond
    ;; A QPattern for a cons, can only go the `then' side.
    ((and (eq (car-safe pat) '\`) (consp (cadr pat)))
     (let ((qpat (cadr pat)))
-      (cons `(and (match ,syma . ,(pcase-upat (car qpat)))
-                  (match ,symd . ,(pcase-upat (cdr qpat))))
-            :pcase-fail)))
+      (cons `(and (match ,syma . ,(pcase--upat (car qpat)))
+                  (match ,symd . ,(pcase--upat (cdr qpat))))
+            :pcase--fail)))
    ;; A QPattern but not for a cons, can only go the `else' side.
-   ((eq (car-safe pat) '\`) (cons :pcase-fail nil))))
+   ((eq (car-safe pat) '\`) (cons :pcase--fail nil))))
 
-(defun pcase-split-equal (elem pat)
+(defun pcase--split-equal (elem pat)
   (cond
    ;; The same match will give the same result.
    ((and (eq (car-safe pat) '\`) (equal (cadr pat) elem))
-    (cons :pcase-succeed :pcase-fail))
+    (cons :pcase--succeed :pcase--fail))
    ;; A different match will fail if this one succeeds.
    ((and (eq (car-safe pat) '\`)
          ;; (or (integerp (cadr pat)) (symbolp (cadr pat))
          ;;     (consp (cadr pat)))
          )
-    (cons :pcase-fail nil))))
+    (cons :pcase--fail nil))))
 
-(defun pcase-split-member (elems pat)
-  ;; Based on pcase-split-equal.
+(defun pcase--split-member (elems pat)
+  ;; Based on pcase--split-equal.
   (cond
    ;; The same match (or a match of membership in a superset) will
    ;; give the same result, but we don't know how to check it.
    ;; (???
-   ;;  (cons :pcase-succeed nil))
+   ;;  (cons :pcase--succeed nil))
    ;; A match for one of the elements may succeed or fail.
    ((and (eq (car-safe pat) '\`) (member (cadr pat) elems))
     nil)
@@ -326,26 +352,26 @@
          ;; (or (integerp (cadr pat)) (symbolp (cadr pat))
          ;;     (consp (cadr pat)))
          )
-    (cons :pcase-fail nil))))
+    (cons :pcase--fail nil))))
 
-(defun pcase-split-pred (upat pat)
+(defun pcase--split-pred (upat pat)
   ;; FIXME: For predicates like (pred (> a)), two such predicates may
   ;; actually refer to different variables `a'.
   (if (equal upat pat)
-      (cons :pcase-succeed :pcase-fail)))
+      (cons :pcase--succeed :pcase--fail)))
 
-(defun pcase-fgrep (vars sexp)
+(defun pcase--fgrep (vars sexp)
   "Check which of the symbols VARS appear in SEXP."
   (let ((res '()))
     (while (consp sexp)
-      (dolist (var (pcase-fgrep vars (pop sexp)))
+      (dolist (var (pcase--fgrep vars (pop sexp)))
         (unless (memq var res) (push var res))))
     (and (memq sexp vars) (not (memq sexp res)) (push sexp res))
     res))
 
 ;; It's very tempting to use `pcase' below, tho obviously, it'd create
 ;; bootstrapping problems.
-(defun pcase-u1 (matches code vars rest)
+(defun pcase--u1 (matches code vars rest)
   "Return code that runs CODE (with VARS) if MATCHES match.
 and otherwise defers to REST which is a list of branches of the form
 \(ELSE-MATCH ELSE-CODE . ELSE-VARS)."
@@ -356,11 +382,11 @@
   ;; between matches.  So we don't bother trying to reorder anything.
   (cond
    ((null matches) (funcall code vars))
-   ((eq :pcase-fail (car matches)) (pcase-u rest))
-   ((eq :pcase-succeed (car matches))
-    (pcase-u1 (cdr matches) code vars rest))
+   ((eq :pcase--fail (car matches)) (pcase--u rest))
+   ((eq :pcase--succeed (car matches))
+    (pcase--u1 (cdr matches) code vars rest))
    ((eq 'and (caar matches))
-    (pcase-u1 (append (cdar matches) (cdr matches)) code vars rest))
+    (pcase--u1 (append (cdar matches) (cdr matches)) code vars rest))
    ((eq 'or (caar matches))
     (let* ((alts (cdar matches))
            (var (if (eq (caar alts) 'match) (cadr (car alts))))
@@ -375,65 +401,65 @@
               (push (cddr alt) simples)
             (push alt others))))
       (cond
-       ((null alts) (error "Please avoid it") (pcase-u rest))
+       ((null alts) (error "Please avoid it") (pcase--u rest))
        ((> (length simples) 1)
         ;; De-hoist the `or' MATCH into an `or' pattern that will be
         ;; turned into a `memq' below.
-        (pcase-u1 (cons `(match ,var or . ,(nreverse simples)) (cdr matches))
-                  code vars
-                  (if (null others) rest
-                    (cons (list*
-                           (pcase-and (if (cdr others)
-                                          (cons 'or (nreverse others))
-                                        (car others))
-                                      (cdr matches))
-                           code vars)
-                          rest))))
+        (pcase--u1 (cons `(match ,var or . ,(nreverse simples)) (cdr matches))
+                   code vars
+                   (if (null others) rest
+                     (cons (list*
+                            (pcase--and (if (cdr others)
+                                            (cons 'or (nreverse others))
+                                          (car others))
+                                        (cdr matches))
+                            code vars)
+                           rest))))
        (t
-        (pcase-u1 (cons (pop alts) (cdr matches)) code vars
-                  (if (null alts) (progn (error "Please avoid it") rest)
-                    (cons (list*
-                           (pcase-and (if (cdr alts)
-                                          (cons 'or alts) (car alts))
-                                      (cdr matches))
-                           code vars)
-                          rest)))))))
+        (pcase--u1 (cons (pop alts) (cdr matches)) code vars
+                   (if (null alts) (progn (error "Please avoid it") rest)
+                     (cons (list*
+                            (pcase--and (if (cdr alts)
+                                            (cons 'or alts) (car alts))
+                                        (cdr matches))
+                            code vars)
+                           rest)))))))
    ((eq 'match (caar matches))
     (destructuring-bind (op sym &rest upat) (pop matches)
       (cond
-       ((memq upat '(t _)) (pcase-u1 matches code vars rest))
-       ((eq upat 'dontcare) :pcase-dontcare)
+       ((memq upat '(t _)) (pcase--u1 matches code vars rest))
+       ((eq upat 'dontcare) :pcase--dontcare)
        ((functionp upat)  (error "Feature removed, use (pred %s)" upat))
        ((memq (car-safe upat) '(guard pred))
         (destructuring-bind (then-rest &rest else-rest)
-            (pcase-split-rest
-             sym (apply-partially 'pcase-split-pred upat) rest)
-          (pcase-if (if (and (eq (car upat) 'pred) (symbolp (cadr upat)))
-                        `(,(cadr upat) ,sym)
-                      (let* ((exp (cadr upat))
-                             ;; `vs' is an upper bound on the vars we need.
-                             (vs (pcase-fgrep (mapcar #'car vars) exp))
-                             (call (cond
-                                    ((eq 'guard (car upat)) exp)
-                                    ((functionp exp) `(,exp ,sym))
-                                    (t `(,@exp ,sym)))))
-                        (if (null vs)
-                            call
-                          ;; Let's not replace `vars' in `exp' since it's
-                          ;; too difficult to do it right, instead just
-                          ;; let-bind `vars' around `exp'.
-                          `(let ,(mapcar (lambda (var)
-                                           (list var (cdr (assq var vars))))
-                                         vs)
-                             ;; FIXME: `vars' can capture `sym'.  E.g.
-                             ;; (pcase x ((and `(,x . ,y) (pred (fun x)))))
-                             ,call))))
-                    (pcase-u1 matches code vars then-rest)
-                    (pcase-u else-rest))))
+            (pcase--split-rest
+             sym (apply-partially #'pcase--split-pred upat) rest)
+          (pcase--if (if (and (eq (car upat) 'pred) (symbolp (cadr upat)))
+                         `(,(cadr upat) ,sym)
+                       (let* ((exp (cadr upat))
+                              ;; `vs' is an upper bound on the vars we need.
+                              (vs (pcase--fgrep (mapcar #'car vars) exp))
+                              (call (cond
+                                     ((eq 'guard (car upat)) exp)
+                                     ((functionp exp) `(,exp ,sym))
+                                     (t `(,@exp ,sym)))))
+                         (if (null vs)
+                             call
+                           ;; Let's not replace `vars' in `exp' since it's
+                           ;; too difficult to do it right, instead just
+                           ;; let-bind `vars' around `exp'.
+                           `(let ,(mapcar (lambda (var)
+                                            (list var (cdr (assq var vars))))
+                                          vs)
+                              ;; FIXME: `vars' can capture `sym'.  E.g.
+                              ;; (pcase x ((and `(,x . ,y) (pred (fun x)))))
+                              ,call))))
+                     (pcase--u1 matches code vars then-rest)
+                     (pcase--u else-rest))))
        ((symbolp upat)
-        (pcase-u1 matches code (cons (cons upat sym) vars) rest))
+        (pcase--u1 matches code (cons (cons upat sym) vars) rest))
        ((eq (car-safe upat) '\`)
-        (pcase-q1 sym (cadr upat) matches code vars rest))
+        (pcase--q1 sym (cadr upat) matches code vars rest))
        ((eq (car-safe upat) 'or)
         (let ((all (> (length (cdr upat)) 1))
               (memq-fine t))
@@ -448,47 +474,48 @@
               ;; Use memq for (or `a `b `c `d) rather than a big tree.
               (let ((elems (mapcar 'cadr (cdr upat))))
                 (destructuring-bind (then-rest &rest else-rest)
-                    (pcase-split-rest
-                     sym (apply-partially 'pcase-split-member elems) rest)
-                  (pcase-if `(,(if memq-fine #'memq #'member) ,sym ',elems)
-                            (pcase-u1 matches code vars then-rest)
-                            (pcase-u else-rest))))
-            (pcase-u1 (cons `(match ,sym ,@(cadr upat)) matches) code vars
-                      (append (mapcar (lambda (upat)
-                                        `((and (match ,sym . ,upat) ,@matches)
-                                          ,code ,@vars))
-                                      (cddr upat))
-                              rest)))))
+                    (pcase--split-rest
+                     sym (apply-partially #'pcase--split-member elems) rest)
+                  (pcase--if `(,(if memq-fine #'memq #'member) ,sym ',elems)
+                             (pcase--u1 matches code vars then-rest)
+                             (pcase--u else-rest))))
+            (pcase--u1 (cons `(match ,sym ,@(cadr upat)) matches) code vars
+                       (append (mapcar (lambda (upat)
+                                         `((and (match ,sym . ,upat) ,@matches)
+                                           ,code ,@vars))
+                                       (cddr upat))
+                               rest)))))
        ((eq (car-safe upat) 'and)
-        (pcase-u1 (append (mapcar (lambda (upat) `(match ,sym ,@upat)) (cdr upat))
-                          matches)
-                  code vars rest))
+        (pcase--u1 (append (mapcar (lambda (upat) `(match ,sym ,@upat))
+                                   (cdr upat))
+                           matches)
+                   code vars rest))
        ((eq (car-safe upat) 'not)
         ;; FIXME: The implementation below is naive and results in
         ;; inefficient code.
-        ;; To make it work right, we would need to turn pcase-u1's
+        ;; To make it work right, we would need to turn pcase--u1's
         ;; `code' and `vars' into a single argument of the same form as
         ;; `rest'.  We would also need to split this new `then-rest' argument
         ;; for every test (currently we don't bother to do it since
         ;; it's only useful for odd patterns like (and `(PAT1 . PAT2)
         ;; `(PAT3 . PAT4)) which the programmer can easily rewrite
         ;; to the more efficient `(,(and PAT1 PAT3) . ,(and PAT2 PAT4))).
-        (pcase-u1 `((match ,sym . ,(cadr upat)))
-                  (lexical-let ((rest rest))
-                    ;; FIXME: This codegen is not careful to share its
-                    ;; code if used several times: code blow up is likely.
-                    (lambda (vars)
-                      ;; `vars' will likely contain bindings which are
-                      ;; not always available in other paths to
-                      ;; `rest', so there' no point trying to pass
-                      ;; them down.
-                      (pcase-u rest)))
-                  vars
-                  (list `((and . ,matches) ,code . ,vars))))
+        (pcase--u1 `((match ,sym . ,(cadr upat)))
+                   (lexical-let ((rest rest))
+                     ;; FIXME: This codegen is not careful to share its
+                     ;; code if used several times: code blow up is likely.
+                     (lambda (vars)
+                       ;; `vars' will likely contain bindings which are
+                       ;; not always available in other paths to
+                       ;; `rest', so there' no point trying to pass
+                       ;; them down.
+                       (pcase--u rest)))
+                   vars
+                   (list `((and . ,matches) ,code . ,vars))))
        (t (error "Unknown upattern `%s'" upat)))))
    (t (error "Incorrect MATCH %s" (car matches)))))
 
-(defun pcase-q1 (sym qpat matches code vars rest)
+(defun pcase--q1 (sym qpat matches code vars rest)
   "Return code that runs CODE if SYM matches QPAT and if MATCHES match.
 and if not, defers to REST which is a list of branches of the form
 \(OTHER_MATCH OTHER-CODE . OTHER-VARS)."
@@ -502,22 +529,23 @@
     (let ((syma (make-symbol "xcar"))
           (symd (make-symbol "xcdr")))
       (destructuring-bind (then-rest &rest else-rest)
-          (pcase-split-rest sym (apply-partially 'pcase-split-consp syma symd)
-                            rest)
-        (pcase-if `(consp ,sym)
-                  `(let ((,syma (car ,sym))
-                         (,symd (cdr ,sym)))
-                     ,(pcase-u1 `((match ,syma . ,(pcase-upat (car qpat)))
-                                  (match ,symd . ,(pcase-upat (cdr qpat)))
-                                  ,@matches)
-                                code vars then-rest))
-                  (pcase-u else-rest)))))
+          (pcase--split-rest sym
+                             (apply-partially #'pcase--split-consp syma symd)
+                             rest)
+        (pcase--if `(consp ,sym)
+                   `(let ((,syma (car ,sym))
+                          (,symd (cdr ,sym)))
+                      ,(pcase--u1 `((match ,syma . ,(pcase--upat (car qpat)))
+                                    (match ,symd . ,(pcase--upat (cdr qpat)))
+                                    ,@matches)
+                                  code vars then-rest))
+                   (pcase--u else-rest)))))
    ((or (integerp qpat) (symbolp qpat) (stringp qpat))
     (destructuring-bind (then-rest &rest else-rest)
-        (pcase-split-rest sym (apply-partially 'pcase-split-equal qpat) rest)
-      (pcase-if `(,(if (stringp qpat) #'equal #'eq) ,sym ',qpat)
-                (pcase-u1 matches code vars then-rest)
-                (pcase-u else-rest))))
+        (pcase--split-rest sym (apply-partially 'pcase--split-equal qpat) rest)
+      (pcase--if `(,(if (stringp qpat) #'equal #'eq) ,sym ',qpat)
+                 (pcase--u1 matches code vars then-rest)
+                 (pcase--u else-rest))))
    (t (error "Unkown QPattern %s" qpat))))
 
 
--- a/lisp/emacs-lisp/smie.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/emacs-lisp/smie.el	Thu Dec 16 18:30:57 2010 -0500
@@ -76,8 +76,6 @@
 
 ;; TODO & BUGS:
 ;;
-;; - FIXME: I think the behavior on empty lines is wrong.  It shouldn't
-;;   look at the next token on subsequent lines.
 ;; - Using the structural information SMIE gives us, it should be possible to
 ;;   implement a `smie-align' command that would automatically figure out what
 ;;   there is to align and how to do it (something like: align the token of
@@ -470,7 +468,7 @@
               (to (cdar eqs)))
           (setq eqs (cdr eqs))
           (if (eq to from)
-              nil                   ;Nothing to do.
+              nil                       ;Nothing to do.
             (dolist (other-eq eqs)
               (if (eq from (cdr other-eq)) (setcdr other-eq to))
               (when (eq from (car other-eq))
@@ -523,24 +521,23 @@
         (setcar (car eq) (cadr eq))
         ;; (smie-check-grammar table prec2 'step2)
         )
-      ;; Finally, fill in the remaining vars (which only appeared on the
-      ;; right side of the < constraints).
-      (let ((classification-table (gethash :smie-open/close-alist prec2)))
-        (dolist (x table)
-          ;; When both sides are nil, it means this operator binds very
-          ;; very tight, but it's still just an operator, so we give it
-          ;; the highest precedence.
-          ;; OTOH if only one side is nil, it usually means it's like an
-          ;; open-paren, which is very important for indentation purposes,
-          ;; so we keep it nil if so, to make it easier to recognize.
-          (unless (or (nth 1 x)
-                      (eq 'opener (cdr (assoc (car x) classification-table))))
-            (setf (nth 1 x) i)
-            (incf i))                   ;See other (incf i) above.
-          (unless (or (nth 2 x)
-                      (eq 'closer (cdr (assoc (car x) classification-table))))
-            (setf (nth 2 x) i)
-            (incf i)))))                ;See other (incf i) above.
+      ;; Finally, fill in the remaining vars (which did not appear on the
+      ;; left side of any < constraint).
+      (dolist (x table)
+        (unless (nth 1 x)
+          (setf (nth 1 x) i)
+          (incf i))                     ;See other (incf i) above.
+        (unless (nth 2 x)
+          (setf (nth 2 x) i)
+          (incf i))))                   ;See other (incf i) above.
+    ;; Mark closers and openers.
+    (dolist (x (gethash :smie-open/close-alist prec2))
+      (let* ((token (car x))
+             (cons (case (cdr x)
+                     (closer (cddr (assoc token table)))
+                     (opener (cdr (assoc token table))))))
+        (assert (numberp (car cons)))
+        (setf (car cons) (list (car cons)))))
     (let ((ca (gethash :smie-closer-alist prec2)))
       (when ca (push (cons :smie-closer-alist ca) table)))
     ;; (smie-check-grammar table prec2 'step3)
@@ -611,6 +608,8 @@
 OP-BACK is the accessor to the backward level of the level data.
 HALFSEXP if non-nil, means skip over a partial sexp if needed.  I.e. if the
 first token we see is an operator, skip over its left-hand-side argument.
+HALFSEXP can also be a token, in which case it means to parse as if
+we had just successfully passed this token.
 Possible return values:
   (FORW-LEVEL POS TOKEN): we couldn't skip TOKEN because its back-level
     is too high.  FORW-LEVEL is the forw-level of TOKEN,
@@ -619,7 +618,10 @@
   (nil POS TOKEN): we skipped over a paren-like pair.
   nil: we skipped over an identifier, matched parentheses, ..."
   (catch 'return
-    (let ((levels ()))
+    (let ((levels
+           (if (stringp halfsexp)
+               (prog1 (list (cdr (assoc halfsexp smie-grammar)))
+                 (setq halfsexp nil)))))
       (while
           (let* ((pos (point))
                  (token (funcall next-token))
@@ -697,6 +699,8 @@
   "Skip over one sexp.
 HALFSEXP if non-nil, means skip over a partial sexp if needed.  I.e. if the
 first token we see is an operator, skip over its left-hand-side argument.
+HALFSEXP can also be a token, in which case we should skip the text
+assuming it is the left-hand-side argument of that token.
 Possible return values:
   (LEFT-LEVEL POS TOKEN): we couldn't skip TOKEN because its right-level
     is too high.  LEFT-LEVEL is the left-level of TOKEN,
@@ -714,7 +718,9 @@
 (defun smie-forward-sexp (&optional halfsexp)
   "Skip over one sexp.
 HALFSEXP if non-nil, means skip over a partial sexp if needed.  I.e. if the
-first token we see is an operator, skip over its left-hand-side argument.
+first token we see is an operator, skip over its right-hand-side argument.
+HALFSEXP can also be a token, in which case we should skip the text
+assuming it is the right-hand-side argument of that token.
 Possible return values:
   (RIGHT-LEVEL POS TOKEN): we couldn't skip TOKEN because its left-level
     is too high.  RIGHT-LEVEL is the right-level of TOKEN,
@@ -791,7 +797,7 @@
                            (push (car other) found))))))
                  (cond
                   ((null found) (error "No known closer for opener %s" open))
-                  ;; FIXME: what should we do if there are various closers?
+                  ;; What should we do if there are various closers?
                   (t (car found))))))))))
     (unless (save-excursion (skip-chars-backward " \t") (bolp))
       (newline))
@@ -1094,9 +1100,6 @@
   ;; line, in which case we want to align it with its enclosing parent.
   (cond
    ((and (eq method :before) (smie-rule-bolp) (not (smie-rule-sibling-p)))
-    ;; FIXME: Rather than consult the number of spaces, we could *set* the
-    ;; number of spaces so as to align the separator with the close-paren
-    ;; while aligning the content with the rest.
     (let ((parent-col (cdr (smie-rule-parent)))
           (parent-pos-col     ;FIXME: we knew this when computing smie--parent.
            (save-excursion
@@ -1225,39 +1228,48 @@
             (smie-indent-virtual))      ;:not-hanging
         (scan-error nil)))))
 
-(defun smie-indent-keyword ()
-  ;; Align closing token with the corresponding opening one.
-  ;; (e.g. "of" with "case", or "in" with "let").
+(defun smie-indent-keyword (&optional token)
+  "Indent point based on the token that follows it immediately.
+If TOKEN is non-nil, assume that that is the token that follows point.
+Returns either a column number or nil if it considers that indentation
+should not be computed on the basis of the following token."
   (save-excursion
     (let* ((pos (point))
-           (toklevels (smie-indent-forward-token))
-           (token (pop toklevels)))
+           (toklevels
+            (if token
+                (assoc token smie-grammar)
+              (let* ((res (smie-indent-forward-token)))
+                ;; Ignore tokens on subsequent lines.
+                (if (and (< pos (line-beginning-position))
+                         ;; Make sure `token' also *starts* on another line.
+                         (save-excursion
+                           (smie-indent-backward-token)
+                           (< pos (line-beginning-position))))
+                    nil
+                  (goto-char pos)
+                  res)))))
+      (setq token (pop toklevels))
       (cond
-       ((< pos (line-beginning-position))
-        ;; The token we just read is actually not on the line where we started.
-        nil)
+       ((null (cdr toklevels)) nil)     ;Not a keyword.
        ((not (numberp (car toklevels)))
-        (save-excursion
-          (goto-char pos)
-          ;; Different cases:
-          ;; - smie-indent--bolp: "indent according to others".
-          ;; - common hanging: "indent according to others".
-          ;; - SML-let hanging: "indent like parent".
-          ;; - if-after-else: "indent-like parent".
-          ;; - middle-of-line: "trust current position".
-          (cond
-           ((null (cdr toklevels)) nil) ;Not a keyword.
-           ((smie-indent--rule :before token))
-           ((smie-indent--bolp)         ;I.e. non-virtual indent.
-            ;; For an open-paren-like thingy at BOL, always indent only
-            ;; based on other rules (typically smie-indent-after-keyword).
-            nil)
-           (t
-            ;; By default use point unless we're hanging.
-            (unless (smie-indent--hanging-p) (current-column))))))
+        ;; Different cases:
+        ;; - smie-indent--bolp: "indent according to others".
+        ;; - common hanging: "indent according to others".
+        ;; - SML-let hanging: "indent like parent".
+        ;; - if-after-else: "indent-like parent".
+        ;; - middle-of-line: "trust current position".
+        (cond
+         ((smie-indent--rule :before token))
+         ((smie-indent--bolp)           ;I.e. non-virtual indent.
+          ;; For an open-paren-like thingy at BOL, always indent only
+          ;; based on other rules (typically smie-indent-after-keyword).
+          nil)
+         (t
+          ;; By default use point unless we're hanging.
+          (unless (smie-indent--hanging-p) (current-column)))))
        (t
         ;; FIXME: This still looks too much like black magic!!
-        (let* ((parent (smie-backward-sexp 'halfsexp)))
+        (let* ((parent (smie-backward-sexp token)))
           ;; Different behaviors:
           ;; - align with parent.
           ;; - parent + offset.
--- a/lisp/epa-file.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/epa-file.el	Thu Dec 16 18:30:57 2010 -0500
@@ -35,9 +35,16 @@
   :type 'boolean
   :group 'epa-file)
 
-(defcustom epa-file-select-keys nil
-  "If non-nil, always asks user to select recipients."
-  :type 'boolean
+(defcustom epa-file-select-keys 'silent
+  "Control whether or not to pop up the key selection dialog.
+
+If t, always asks user to select recipients.
+If nil, query user only when `epa-file-encrypt-to' is not set.
+If neither t nor nil, doesn't ask user.  In this case, symmetric
+encryption is used."
+  :type '(choice (const :tag "Ask always" t)
+		 (const :tag "Ask when recipients are not set" nil)
+		 (const :tag "Don't ask" silent))
   :group 'epa-file)
 
 (defvar epa-file-passphrase-alist nil)
@@ -218,9 +225,10 @@
 			 end (point-max)))
 		 (epa-file--encode-coding-string (buffer-substring start end)
 						 coding-system))
-	       (if (or epa-file-select-keys
-		       (not (local-variable-p 'epa-file-encrypt-to
-					      (current-buffer))))
+	       (if (or (eq epa-file-select-keys t)
+		       (and (null epa-file-select-keys)
+			    (not (local-variable-p 'epa-file-encrypt-to
+						   (current-buffer)))))
 		   (epa-select-keys
 		    context
 		    "Select recipents for encryption.
--- a/lisp/epg.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/epg.el	Thu Dec 16 18:30:57 2010 -0500
@@ -67,7 +67,7 @@
 (defconst epg-digest-algorithm-alist
   '((1 . "MD5")
     (2 . "SHA1")
-    (3 . "RMD160")
+    (3 . "RIPEMD160")
     (8 . "SHA256")
     (9 . "SHA384")
     (10 . "SHA512")
@@ -337,7 +337,13 @@
 car is a function and cdr is a callback data.
 
 The function gets three arguments: the context, the key-id in
-question, and the callback data (if any)."
+question, and the callback data (if any).
+
+The callback may not be called if you use GnuPG 2.x, which relies
+on the external program called `gpg-agent' for passphrase query.
+If you really want to intercept passphrase query, consider
+installing GnuPG 1.x _along with_ GnuPG 2.x, which does passphrase
+query by itself and Emacs can intercept them."
   (unless (eq (car-safe context) 'epg-context)
     (signal 'wrong-type-argument (list 'epg-context-p context)))
   (aset (cdr context) 7 (if (consp passphrase-callback)
--- a/lisp/eshell/em-rebind.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/eshell/em-rebind.el	Thu Dec 16 18:30:57 2010 -0500
@@ -91,7 +91,6 @@
   '(beginning-of-line-text
     beginning-of-line
     move-to-column
-    move-to-column-force
     move-to-left-margin
     move-to-tab-stop
     forward-char
--- a/lisp/eshell/em-script.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/eshell/em-script.el	Thu Dec 16 18:30:57 2010 -0500
@@ -90,23 +90,25 @@
   (interactive "f")
   (let ((orig (point))
 	(here (point-max))
-	(inhibit-point-motion-hooks t)
-	after-change-functions)
-    (goto-char (point-max))
-    (insert-file-contents file)
+	(inhibit-point-motion-hooks t))
     (goto-char (point-max))
-    (throw 'eshell-replace-command
-	   (prog1
-	       (list 'let
-		     (list (list 'eshell-command-name (list 'quote file))
-			   (list 'eshell-command-arguments
-				 (list 'quote args)))
-		     (let ((cmd (eshell-parse-command (cons here (point)))))
-		       (if subcommand-p
-			   (setq cmd (list 'eshell-as-subcommand cmd)))
-		       cmd))
-	     (delete-region here (point))
-	     (goto-char orig)))))
+    (with-silent-modifications
+      ;; FIXME: Why not use a temporary buffer and avoid this
+      ;; "insert&delete" business?  --Stef
+      (insert-file-contents file)
+      (goto-char (point-max))
+      (throw 'eshell-replace-command
+             (prog1
+                 (list 'let
+                       (list (list 'eshell-command-name (list 'quote file))
+                             (list 'eshell-command-arguments
+                                   (list 'quote args)))
+                       (let ((cmd (eshell-parse-command (cons here (point)))))
+                         (if subcommand-p
+                             (setq cmd (list 'eshell-as-subcommand cmd)))
+                         cmd))
+               (delete-region here (point))
+               (goto-char orig))))))
 
 (defun eshell/source (&rest args)
   "Source a file in a subshell environment."
--- a/lisp/eshell/esh-arg.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/eshell/esh-arg.el	Thu Dec 16 18:30:57 2010 -0500
@@ -123,7 +123,7 @@
   :type 'hook
   :group 'eshell-arg)
 
-(defcustom eshell-delimiter-argument-list '(?\; ?& ?\| ?\> ?  ?\t ?\n)
+(defcustom eshell-delimiter-argument-list '(?\; ?& ?\| ?\> ?\s ?\t ?\n)
   "List of characters to recognize as argument separators."
   :type '(repeat character)
   :group 'eshell-arg)
@@ -214,25 +214,24 @@
       (narrow-to-region beg end)
       (let ((inhibit-point-motion-hooks t)
 	    (args (list t))
-	    after-change-functions
 	    delim)
-	(remove-text-properties (point-min) (point-max)
-				'(arg-begin nil arg-end nil))
-	(if (setq
-	     delim
-	     (catch 'eshell-incomplete
-	       (while (not (eobp))
-		 (let* ((here (point))
-			(arg (eshell-parse-argument)))
-		   (if (= (point) here)
-		       (error "Failed to parse argument '%s'"
-			      (buffer-substring here (point-max))))
-		   (and arg (nconc args (list arg)))))))
-	    (if (listp delim)
-		(throw 'eshell-incomplete delim)
-	      (throw 'eshell-incomplete
-		     (list delim (point) (cdr args)))))
-	(cdr args)))))
+        (with-silent-modifications
+          (remove-text-properties (point-min) (point-max)
+                                  '(arg-begin nil arg-end nil))
+          (if (setq
+               delim
+               (catch 'eshell-incomplete
+                 (while (not (eobp))
+                   (let* ((here (point))
+                          (arg (eshell-parse-argument)))
+                     (if (= (point) here)
+                         (error "Failed to parse argument '%s'"
+                                (buffer-substring here (point-max))))
+                     (and arg (nconc args (list arg)))))))
+              (throw 'eshell-incomplete (if (listp delim)
+                                            delim
+                                          (list delim (point) (cdr args)))))
+          (cdr args))))))
 
 (defun eshell-parse-argument ()
   "Get the next argument.  Leave point after it."
--- a/lisp/eshell/esh-cmd.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/eshell/esh-cmd.el	Thu Dec 16 18:30:57 2010 -0500
@@ -355,12 +355,14 @@
 	   (if (consp command)
 	       (eshell-parse-arguments (car command) (cdr command))
 	     (let ((here (point))
-		   (inhibit-point-motion-hooks t)
-		   after-change-functions)
-	       (insert command)
-	       (prog1
-		   (eshell-parse-arguments here (point))
-		 (delete-region here (point)))))
+		   (inhibit-point-motion-hooks t))
+               (with-silent-modifications
+                 ;; FIXME: Why not use a temporary buffer and avoid this
+                 ;; "insert&delete" business?  --Stef
+                 (insert command)
+                 (prog1
+                     (eshell-parse-arguments here (point))
+                   (delete-region here (point))))))
 	   args))
 	 (commands
 	  (mapcar
--- a/lisp/eshell/eshell.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/eshell/eshell.el	Thu Dec 16 18:30:57 2010 -0500
@@ -285,7 +285,8 @@
   "`eshell-buffer-name' is a member of `same-window-buffer-names'"
   (member eshell-buffer-name same-window-buffer-names))
 
-(defcustom eshell-directory-name (convert-standard-filename "~/.eshell/")
+(defcustom eshell-directory-name
+  (locate-user-emacs-file "eshell/" ".eshell/")
   "The directory where Eshell control files should be kept."
   :type 'directory
   :group 'eshell)
--- a/lisp/files.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/files.el	Thu Dec 16 18:30:57 2010 -0500
@@ -2232,7 +2232,7 @@
    (lambda (elt)
      (cons (purecopy (car elt)) (cdr elt)))
    `(;; do this first, so that .html.pl is Polish html, not Perl
-     ("\\.s?html?\\(\\.[a-zA-Z_]+\\)?\\'" . html-mode)
+     ("\\.[sx]?html?\\(\\.[a-zA-Z_]+\\)?\\'" . html-mode)
      ("\\.svgz?\\'" . image-mode)
      ("\\.svgz?\\'" . xml-mode)
      ("\\.x[bp]m\\'" . image-mode)
@@ -2337,6 +2337,7 @@
      ("\\.oak\\'" . scheme-mode)
      ("\\.sgml?\\'" . sgml-mode)
      ("\\.x[ms]l\\'" . xml-mode)
+     ("\\.dbk\\'" . xml-mode)
      ("\\.dtd\\'" . sgml-mode)
      ("\\.ds\\(ss\\)?l\\'" . dsssl-mode)
      ("\\.js\\'" . js-mode)		; javascript-mode would be better
@@ -3370,22 +3371,29 @@
 Return the new variables list."
   (let* ((file-name (buffer-file-name))
 	 (sub-file-name (if file-name
+                            ;; FIXME: Why not use file-relative-name?
 			    (substring file-name (length root)))))
-    (dolist (entry class-variables variables)
-      (let ((key (car entry)))
-	(cond
-	 ((stringp key)
-	  ;; Don't include this in the previous condition, because we
-	  ;; want to filter all strings before the next condition.
-	  (when (and sub-file-name
-		     (>= (length sub-file-name) (length key))
-		     (string= key (substring sub-file-name 0 (length key))))
-	    (setq variables (dir-locals-collect-variables
-			     (cdr entry) root variables))))
-	 ((or (not key)
-	      (derived-mode-p key))
-	  (setq variables (dir-locals-collect-mode-variables
-			   (cdr entry) variables))))))))
+    (condition-case err
+        (dolist (entry class-variables variables)
+          (let ((key (car entry)))
+            (cond
+             ((stringp key)
+              ;; Don't include this in the previous condition, because we
+              ;; want to filter all strings before the next condition.
+              (when (and sub-file-name
+                         (>= (length sub-file-name) (length key))
+                         (string-prefix-p key sub-file-name))
+                (setq variables (dir-locals-collect-variables
+                                 (cdr entry) root variables))))
+             ((or (not key)
+                  (derived-mode-p key))
+              (setq variables (dir-locals-collect-mode-variables
+                               (cdr entry) variables))))))
+      (error
+       ;; The file's content might be invalid (e.g. have a merge conflict), but
+       ;; that shouldn't prevent the user from opening the file.
+       (message ".dir-locals error: %s" (error-message-string err))
+       nil))))
 
 (defun dir-locals-set-directory-class (directory class &optional mtime)
   "Declare that the DIRECTORY root is an instance of CLASS.
@@ -3516,7 +3524,9 @@
 	  (dir-name nil))
       (cond
        ((stringp variables-file)
-	(setq dir-name (if (buffer-file-name) (file-name-directory (buffer-file-name)) default-directory))
+	(setq dir-name (if (buffer-file-name)
+                           (file-name-directory (buffer-file-name))
+                         default-directory))
 	(setq class (dir-locals-read-from-file variables-file)))
        ((consp variables-file)
 	(setq dir-name (nth 0 variables-file))
@@ -3826,21 +3836,25 @@
   (and context
        (set-file-selinux-context to-name context)))
 
+(defvar file-name-version-regexp
+  "\\(?:~\\|\\.~[-[:alnum:]:#@^._]+~\\)"
+  "Regular expression matching the backup/version part of a file name.
+Used by `file-name-sans-versions'.")
+
 (defun file-name-sans-versions (name &optional keep-backup-version)
   "Return file NAME sans backup versions or strings.
 This is a separate procedure so your site-init or startup file can
 redefine it.
 If the optional argument KEEP-BACKUP-VERSION is non-nil,
-we do not remove backup version numbers, only true file version numbers."
+we do not remove backup version numbers, only true file version numbers.
+See also `file-name-version-regexp'."
   (let ((handler (find-file-name-handler name 'file-name-sans-versions)))
     (if handler
 	(funcall handler 'file-name-sans-versions name keep-backup-version)
       (substring name 0
-		 (if keep-backup-version
-		     (length name)
-		   (or (string-match "\\.~[-[:alnum:]:#@^._]+~\\'" name)
-		       (string-match "~\\'" name)
-		       (length name)))))))
+		 (unless keep-backup-version
+                   (string-match (concat file-name-version-regexp "\\'")
+                                 name))))))
 
 (defun file-ownership-preserved-p (file)
   "Return t if deleting FILE and rewriting it would preserve the owner."
@@ -4154,11 +4168,29 @@
           (dremote (file-remote-p directory)))
       (if ;; Conditions for separate trees
 	  (or
-	   ;; Test for different drives on DOS/Windows
+	   ;; Test for different filesystems on DOS/Windows
 	   (and
 	    ;; Should `cygwin' really be included here?  --stef
 	    (memq system-type '(ms-dos cygwin windows-nt))
-	    (not (eq t (compare-strings filename 0 2 directory 0 2))))
+	    (or
+	     ;; Test for different drive letters
+	     (not (eq t (compare-strings filename 0 2 directory 0 2)))
+	     ;; Test for UNCs on different servers
+	     (not (eq t (compare-strings
+			 (progn
+			   (if (string-match "\\`//\\([^:/]+\\)/" filename)
+			       (match-string 1 filename)
+			     ;; Windows file names cannot have ? in
+			     ;; them, so use that to detect when
+			     ;; neither FILENAME nor DIRECTORY is a
+			     ;; UNC.
+			     "?"))
+			 0 nil
+			 (progn
+			   (if (string-match "\\`//\\([^:/]+\\)/" directory)
+			       (match-string 1 directory)
+			     "?"))
+			 0 nil t)))))
 	   ;; Test for different remote file system identification
 	   (not (equal fremote dremote)))
 	  filename
@@ -4487,46 +4519,8 @@
 		   (setq buffer-backed-up nil))))))
     setmodes))
 
-(defun diff-buffer-with-file (&optional buffer)
-  "View the differences between BUFFER and its associated file.
-This requires the external program `diff' to be in your `exec-path'."
-  (interactive "bBuffer: ")
-  (diff-buffer-internal (get-buffer (or buffer (current-buffer)))
-			(get-buffer-create "*Diff*"))
-  ;; return always nil, so that save-buffers-kill-emacs will not move
-  ;; over to the next unsaved buffer when calling `d'.
-  nil)
-
-(defvar diff-buffer-buffer)	;; suppress compiler warnings.
-
-(defun diff-buffer-internal (buffer result-buffer)
-  (if (not (and buffer (buffer-name buffer)))
-      (error "Original buffer deleted."))
-  (with-current-buffer buffer
-    (if (and buffer-file-name
-	     (file-exists-p buffer-file-name))
-	(let ((tempfile (make-temp-file "buffer-content-")))
-	  (unwind-protect
-	      (progn
-		(write-region nil nil tempfile nil 'nomessage)
-		;; No asynch so we don't delete the temp file prematurely.
-		(diff-into-buffer result-buffer buffer-file-name tempfile
-				  nil t)
-		(sit-for 0)
-		;; Now revise the revert-buffer-function, since the
-		;; default will not be able to find the temp file.
-		(with-current-buffer result-buffer
-		  (set (make-local-variable 'diff-buffer-buffer) buffer)
-		  (setq revert-buffer-function
-			(lambda (ignore-auto noconfirm)
-			  (diff-buffer-internal diff-buffer-buffer
-						(current-buffer))))))
-	    (when (file-exists-p tempfile)
-	      (delete-file tempfile))))
-      (message "Buffer %s has no associated file on disc" (buffer-name))
-      ;; Display that message for 1 second so that user can read it
-      ;; in the minibuffer.
-      (sit-for 1))))
+(declare-function diff-no-select "diff"
+		  (old new &optional switches no-async buf))
 
 (defvar save-some-buffers-action-alist
   `((?\C-r
@@ -4542,13 +4536,14 @@
     (?d ,(lambda (buf)
            (if (null (buffer-file-name buf))
                (message "Not applicable: no file")
-             (save-window-excursion (diff-buffer-with-file buf))
-             (if (not enable-recursive-minibuffers)
-                 (progn (display-buffer (get-buffer-create "*Diff*"))
-                        (setq other-window-scroll-buffer "*Diff*"))
-               (view-buffer (get-buffer-create "*Diff*")
-                            (lambda (_) (exit-recursive-edit)))
-               (recursive-edit)))
+             (require 'diff)            ;for diff-no-select.
+             (let ((diffbuf (diff-no-select (buffer-file-name buf) buf
+                                            nil 'noasync)))
+               (if (not enable-recursive-minibuffers)
+                   (progn (display-buffer diffbuf)
+                          (setq other-window-scroll-buffer diffbuf))
+                 (view-buffer diffbuf (lambda (_) (exit-recursive-edit)))
+                 (recursive-edit))))
            ;; Return nil to ask about BUF again.
            nil)
 	,(purecopy "view changes in this buffer")))
--- a/lisp/format.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/format.el	Thu Dec 16 18:30:57 2010 -0500
@@ -181,8 +181,7 @@
 	;; We should perhaps go via a temporary buffer and copy it
 	;; back, in case of errors.
 	(if (and (zerop (save-window-excursion
-			  (shell-command-on-region (point-min) (point-max)
-						   method t t
+			  (shell-command-on-region from to method t t
 						   error-buff)))
 		 ;; gzip gives zero exit status with bad args, for instance.
 		 (zerop (with-current-buffer error-buff
--- a/lisp/frame.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/frame.el	Thu Dec 16 18:30:57 2010 -0500
@@ -1545,7 +1545,7 @@
   :init-value (not (or noninteractive
 		       no-blinking-cursor
 		       (eq system-type 'ms-dos)
-		       (not (memq window-system '(x w32)))))
+		       (not (memq window-system '(x w32 ns)))))
   :initialize 'custom-initialize-delay
   :group 'cursor
   :global t
--- a/lisp/gnus/ChangeLog	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/gnus/ChangeLog	Thu Dec 16 18:30:57 2010 -0500
@@ -1,5 +1,782 @@
+2010-12-16  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+	* nnimap.el (nnimap-wait-for-response): Fix the end-point calculation
+	to really consider the last line.
+
+2010-12-16  Daiki Ueno  <ueno@unixuser.org>
+
+	* auth-source.el (auth-source-gpg-encrypt-to): New variable to set the
+	list of recipient keys, or use symmetric encryption if not a list.
+	(auth-source-create): Use it to make `epa-file-encrypt-to' local for an
+	EPA override, replacing the call to `netrc-store-data'.
+
+2010-12-16  Dan Davison  <dandavison7@gmail.com>  (tiny change)
+
+	* gnus-srvr.el: Avoid passing nil regexp argument to
+	delete-matching-lines.
+
+2010-12-16  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+	* gnus-html.el (gnus-html-schedule-image-fetching): Make sure the HTML
+	fetching stops when Gnus exits.
+
+	* nnfolder.el (nnfolder-save-all-buffers): Refactor out into its own
+	function.
+	(nnfolder-request-expire-articles): Save all the buffers after doing
+	expiry.
+
+	* nnmail.el (nnmail-expiry-target-group): Revert the "all articles are
+	the last article", since that led to serious performance regressions
+	when expiring nnml groups.
+
+2010-12-16  Andrew Cohen  <cohen@andy.bu.edu>
+
+	* nnir.el: Improve customizations.
+
+2010-12-16  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+	* gnus-start.el (gnus-subscribe-newsgroup): Notify the backend.
+
+	* gnus-group.el (gnus-group-kill-group): Notify the backend that the
+	group has been killed.
+	(gnus-group-yank-group): Ditto.
+
+	* gnus-srvr.el (gnus-browse-unsubscribe-group): Ditto.
+
+	* nnimap.el (nnimap-request-update-group-status): New function.
+
+	* gnus-int.el (gnus-request-update-group-status): New interface
+	function.
+
+	* gnus-sum.el (gnus-summary-push-marks-to-backend): Fix the logic for
+	copying read-ness to the backends.
+
+	* nnimap.el (nnimap-quirk): New function.
+	(nnimap-retrieve-group-data-early): Use it.
+	(nnimap-quirks): New alist.
+
+2010-12-16  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+	* shr.el (shr-insert): Set shr-start after deleting trailing space;
+	don't delete it within indentation.
+
+2010-12-16  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+	* nnimap.el (nnimap-wait-for-response): Always look (at least) at the
+	previous line.
+
+2010-12-15  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+	* nnimap.el (nnimap-retrieve-group-data-early): Fix the syntax of the
+	QRESYNC command by deleting a superfluous space which broke Cyrus
+	servers.  This change will break other servers that are buggy the other
+	way around.
+
+2010-12-14  Teodor Zlatanov  <tzz@lifelogs.com>
+
+	* spam.el: Reindent and fix long lines.
+	(spam-copy-or-move-routine): Exclude invalid move destinations.
+
+2010-12-14  Andrew Cohen  <cohen@andy.bu.edu>
+
+	* nnir.el (nnir-mode): Don't install registry hooks if user hasn't
+	installed the registry.
+
+2010-12-13  Andrew Cohen  <cohen@andy.bu.edu>
+
+	* nnir.el (nnir-run-gmane): Better check for gmane groups: error out if
+	groupname doesn't contain "gmane".
+
+2010-12-13  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+	* gnus-start.el (gnus-matches-options-n): Fix typo in last change.
+	(gnus-1): Don't create the nndrafts group twice.
+	(gnus-setup-news): There's no need to read the active file here, since
+	that's done again later on a per-backend basis.
+	(gnus-start-draft-setup): Make sure that the new group is started out
+	empty.
+
+	* gnus-agent.el (gnus-agentize): Don't create the queue group
+	automatically on startup.  It'll be created later, if needed.
+
+	* gnus-start.el (gnus-auto-subscribed-groups): Add nnimap to the list
+	of automatically subscribed groups.
+	(gnus-auto-subscribed-categories): New variable.
+	(gnus-matches-options-n): Use it.
+	(gnus-default-subscribed-newsgroups): Remove unused variable.
+	(gnus-start-draft-setup): Message a bit less.
+
+2010-12-13  Andrew Cohen  <cohen@andy.bu.edu>
+
+	* nnir.el (nnir-run-imap): Return article list in order of increasing
+	UID.
+
+2010-12-13  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+	* gnus-sum.el (gnus-summary-enter-digest-group): Mention
+	gnus-auto-select-on-ephemeral-exit.
+
+	* proto-stream.el (proto-stream-open-network-only): Fix the calling
+	convention of the network-only option.
+
+2010-12-10  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+	* proto-stream.el (proto-stream-open-network-only): New function to
+	have a way to specify non-STARTTLS upgrade connections.
+
+2010-12-10  Julien Danjou  <julien@danjou.info>
+
+	* gnus-gravatar.el (gnus-gravatar-transform-address): Fix error when
+	email address is nil.
+
+	* message.el (message-bogus-recipient-p): Set address to "" if nil.
+
+2010-12-10  Andrew Cohen  <cohen@andy.bu.edu>
+
+	* nnir.el (nnir-request-expire-articles): Ignore expiry except for
+	deletion.
+	(nnir-run-imap): Only need to parse list once.
+
+2010-12-09  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+	* shr.el (shr-tag-script): Ignore <script>.
+	(shr-tag-label): Add <label> support.
+
+2010-12-09  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+	* mm-util.el (mm-ucs-to-char): Use eval-and-compile.
+
+	* shr.el (shr-image-displayer): Work for images lined side by side.
+
+2010-12-08  Robert Pluim  <rpluim@gmail.com>
+
+	* gnus-demon.el (gnus-demon-init): Call run-with-timer with an integer
+	parameter, since XEmacs doesn't accept t as a parameter.
+
+2010-12-08  Andrew Cohen  <cohen@andy.bu.edu>
+
+	* nnir.el (nnir-retrieve-headers): Use rassq when comparing article
+	ids.
+	(nnir-run-gmane): Simplify groupspec formatting.
+	(nnir-request-expire-articles): New function.
+
+2010-12-07  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+	* nnimap.el (nnimap-parse-flags): Tweak VANISHED regexp to avoid regexp
+	overflow, possibly.
+
+	* shr.el (shr-tag-table-1): Use bg/gfcolor specs on tables.
+	(shr-render-td): Handle td style="" better.
+	(shr-tag-table): Use the color from the style sheet.
+	(shr-render-td): Make sure we copy over all the overlays, too.
+
+2010-12-07  Andrew Cohen  <cohen@andy.bu.edu>
+
+	* nnir.el (nnir-run-gmane): Restore sub-optimal test for gmane server.
+	(nnir-request-article): Improve article retrieval.
+
+2010-12-07  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+	* mm-util.el (mm-extra-numeric-entities): New variable.
+
+	* mm-url.el (mm-url-decode-entities):
+	* mm-decode.el (mm-shr): Use it to decode extra numeric entities.
+
+2010-12-07  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* message.el: Use completion-at-point.
+	(message-completion-function): New fun, extracted from message-tab.
+	(message-mode): Use it for completion-at-point-functions.
+	(message-tab): Use it and completion-at-point.
+
+2010-12-07  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+	* shr.el (shr-find-fill-point): Don't break a line after a kinsoku-bol
+	character if a non-breakable character follows.
+
+2010-12-06  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+	* proto-stream.el (proto-stream-open-tls): Return nil if we don't get
+	any stream.
+
+	* shr.el (shr-tag-font): Colorize the region.
+	(shr-tag-body): Ditto.
+	(shr-tag-font): Actually let the styles be inherited instead of
+	overwriting them.
+	(shr-tag-font): Get the background color right.
+	(shr-tag-style): Ignore all <style> tags for the moment.
+
+	* gnus-int.el (gnus-request-thread): Rework to take a header instead of
+	a Message-ID to avoid having nnimap depend on gnus-sum.
+
+	* shr.el (shr-descend): Only colorize something if we have a node that
+	sets colors.
+
+2010-12-06  Julien Danjou  <julien@danjou.info>
+
+	* shr.el (shr-render-td): Render td content with shr-descend, so style
+	will be applied to <td> too.
+	(shr-colorize-region): Colorize region even if we only have a background.
+	(shr-tag-body): Fix color and background color inheritance.
+	Do not recolorize after shr-generic.
+	(shr-tag-font): Let shr-generic colorize via inheritance.
+
+2010-12-06  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+	* shr.el (shr-find-fill-point): Don't regard apostrophe as kinsoku-bol.
+
+2010-12-06  Andrew Cohen  <cohen@andy.bu.edu>
+
+	* nnir.el (nnir-request-move-article): Remove obsolete code.
+
+2010-12-05  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+	* gnus-util.el (gnus-macroexpand-all): Use eval-and-compile.
+
+2010-12-05  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+	* gnus-sum.el (gnus-summary-respool-article): The completion function
+	expects a list instead of an alist.
+
+	* nntp.el (nntp-snarf-error-message): nnheader-report takes a format
+	string as the parameter.
+
+	* gnus.el (gnus-valid-select-methods): Allow nnimap to respool.
+
+	* shr.el (shr-stylesheet): New dynamic variable for cascading the
+	styles.
+	(shr-colorize-region): New function.
+	(shr-insert-background-overlay): Remove.
+	(shr-render-td): Background setting should be taken care of on a higher
+	level.
+	(shr-tag-body): Use post-hoc colorizations.
+	(shr-tag-body): Set up a style sheet based on bgcolor/fgcolor.
+	(shr-put-color-1): Don't overwrite old colors.
+	(shr-colorize-region): When the background color isn't explicit, use
+	a fixed background.
+
+	* gnus-util.el (gnus-output-to-mail): Require nnmail before using
+	nnmail variables.
+
+2010-12-05  Bjørn Mork  <bjorn@mork.no>
+
+	* nnimap.el (nnimap-process-expiry-targets): Avoid downloading articles
+	unless necessary.
+
+2010-12-05  Andrew Cohen  <cohen@andy.bu.edu>
+
+	* nnir.el (nnir-run-gmane): Use more careful test for gmane nntp
+	server.
+
+2010-12-04  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+	* gnus-html.el (gnus-html-put-image): Use widget instead of local maps
+	so that TAB works.
+
+	* gnus-sum.el (gnus-summary-show-article): Reverse the meanings of `C-u
+	C-u g' and `C-u g' so that `C-u g' does what it traditionally did.
+
+	* shr.el (shr-urlify): Show the URL before the title to avoid
+	misleading URLs.
+
+2010-12-04  Adam Sjøgren  <asjo@koldfront.dk>
+
+	* shr.el (shr-urlify): Display the title in <a> tags.
+
+2010-12-04  Andrew Cohen  <cohen@andy.bu.edu>
+
+	* nnir.el (nnir-categorize): Replace mapcar with mapc.
+
+2010-12-03  Andrew Cohen  <cohen@andy.bu.edu>
+
+	* nnir.el: Rearrange code to allow macros to be autoloaded by
+	gnus-sum.el.
+	(nnir-retrieve-headers-override-function): Make this variable
+	customizable.
+	(nnir-retrieve-headers): Remove obsolete subject-mangling code.
+
+	* gnus-sum.el (nnir-article-group,nnir-article-rsv): Autoload macros
+	from nnir.el.
+
+2010-12-03  Julien Danjou  <julien@danjou.info>
+
+	* gnus-demon.el (gnus-demon-init): Fix time computing when time is nil.
+
+2010-12-03  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+	* gnus-util.el (gnus-macroexpand-all): Don't modify argument;
+	allow optional argument `environment'.
+
+2010-12-03  Glenn Morris  <rgm@gnu.org>
+
+	* mm-extern.el (message-goto-body): Update declaration.
+
+2010-12-03  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+	* gnus-util.el (gnus-macroexpand-all): New function.
+
+	* gnus-sum.el (gnus-summary-line-format-alist): Use gnus-macroexpand-all
+	instead of macroexpand-all that is unavailable in XEmacs.
+
+2010-12-02  Andrew Cohen  <cohen@andy.bu.edu>
+
+	* nnir.el (nnir-summary-line-format): New variable.
+	(nnir-mode): Use it.
+	(nnir-artlist-*,nnir-aritem-*): Reimplement as macros.
+	(nnir-article-ids): Reimplement as defsubst.
+	(nnir-retrieve-headers): Don't mangle the subject header.
+	(nnir-run-imap): Use 100 as RSV score.
+	(nnir-run-find-grep): Fix for full server searching.
+	(nnir-run-gmane): Better restriction to gmane groups.
+
+	* gnus-sum.el (gnus-summary-line-format-alist): Add specs for nnir
+	summary buffers.
+
+2010-12-02  Julien Danjou  <julien@danjou.info>
+
+	* gnus-win.el (gnus-configure-frame): Remove old compatibility code.
+
+	* gnus-msg.el: Mark gnus-outgoing-message-group as obsolete.
+
+	* gnus-win.el (gnus-configure-windows): Remove Gnus 3.x setting
+	support.
+
+2010-12-01  Andrew Cohen  <cohen@andy.bu.edu>
+
+	* nnir.el: Update to handle the registry better.
+	(autoload): Silence byte-compiler.
+	(nnir-open-server): Add a hook for nnir groups.
+	(nnir-request-move-article): Don't mangle the header. Better to use
+	formating variables (which will be added in the future).
+	(nnir-registry-action): Update the registry using the original article
+	group name.
+	(nnir-mode): Install nnir-specific hooks for updating the registry.
+
+	* gnus-sum.el
+	(gnus-article-original-subject,gnus-newsgroup-original-name): Remove
+	obsolete variables.
+	(gnus-summary-move-article): Remove use of obsolete variables.
+	(gnus-summary-local-variables): Make move and delete hooks local to
+	summary buffers.
+
+2010-12-01  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+	* rtree.el: New file.
+
+2010-12-01  Julien Danjou  <julien@danjou.info>
+
+	* message.el (message-user-organization): Do not use
+	gnus-local-organization.
+
+	* gnus.el: Remove gnus-local-organization.
+
+	* gnus-msg.el: Remove nastygram thing.
+
+2010-12-01  Teodor Zlatanov  <tzz@lifelogs.com>
+
+	* nnmaildir.el (nnmaildir-request-set-mark): Add article to add-mark
+	funcall.
+
+2010-12-01  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+	* gnus-gravatar.el (gnus-gravatar-insert): Allow LWSP in the middle of
+	names.
+
+	* shr.el (shr-find-fill-point): Don't break line between kinsoku-bol
+	characters.
+
+	* gnus-gravatar.el (gnus-gravatar-insert): Delete unnecessary binding
+	to t of inhibit-read-only since it is inside gnus-with-article-headers.
+	Suggested by Štěpán Němec <stepnem@gmail.com>.
+	(gnus-gravatar-transform-address): Use mail-extract-address-components
+	that supports non-ASCII names rather than mail-header-parse-addresses.
+
+2010-11-30  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+	* proto-stream.el (open-protocol-stream): All starttls connections are
+	handled by the network handler.
+
+2010-11-30  Julien Danjou  <julien@danjou.info>
+
+	* nnimap.el (nnimap-open-connection-1): Use gnus-string-match-p.
+	(nnimap-open-connection-1): Fix PREAUTH.
+
+	* gnus-gravatar.el (gnus-gravatar-size): Set gnus-gravatar-size to nil.
+
+2010-11-30  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+	* shr.el (shr-char-breakable-p, shr-char-nospace-p)
+	(shr-char-kinsoku-bol-p, shr-char-kinsoku-eol-p): New macros.
+	(shr-insert): Use them.
+	(shr-find-fill-point): Work better for kinsoku chars and apostrophes.
+
+2010-11-29  Andrew Cohen  <cohen@andy.bu.edu>
+
+	* nnir.el (nnir-request-move-article): Bail out if original group
+	doesn't support article moves.
+	(nnir-get-active): Improve active list retrieval.
+
+2010-11-29  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+	* shr.el (shr-find-fill-point): Don't break before apostrophes.
+
+2010-11-29  Binjo  <binjo.cn@gmail.com>  (tiny change)
+
+	* nnimap.el (nnimap-open-connection-1): w32 open-network-stream doesn't
+	seem to accept strings-with-numbers as port numbers,
+
+2010-11-29  Andrew Cohen  <cohen@andy.bu.edu>
+
+	* gnus-sum.el (gnus-summary-delete-article): If delete fails don't
+	change the registry.
+
+2010-11-29  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+	* nnir.el (nnir-run-gmane): Use mm-delete-duplicates instead of
+	delete-dups that is not available in XEmacs 21.4.
+
+	* mm-util.el (mm-delete-duplicates): Add comment.
+
+2010-11-28  Andrew Cohen  <cohen@andy.bu.edu>
+
+	* nnir.el (nnir-ignored-newsgroups): New variable.
+	(nnir-get-active): Use it.
+
+2010-11-28  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+	* proto-stream.el (proto-stream-open-network): Add some comments.
+
+	* nntp.el (nntp-open-connection): Provide a :success condition.
+
+	* nnimap.el (nnimap-open-connection-1): Ditto.
+
+	* proto-stream.el (proto-stream-open-network): See what the response to
+	the STARTTLS command is.
+
+	* nnimap.el (nnimap-open-connection-1): Always upgrade to STARTTLS (for
+	backwards compatibility).
+	(nnimap-open-connection-1): Really respect nnimap-server-port.
+
+	* proto-stream.el (proto-stream-open-network): When doing opportunistic
+	TLS upgrades we don't really care about the identity of the peer.
+	(proto-stream-open-network): Force starttls.el to use gnutls-cli, since
+	that what we've checked for.
+	(proto-stream-always-use-starttls): Only default to t if
+	open-gnutls-stream exists.
+	(proto-stream-open-network): If STARTTLS failed, then just open a
+	normal connection.
+	(proto-stream-open-network): Wait until the greeting before doing
+	STARTTLS.
+
+	* nntp.el (nntp-open-connection): Report what the connection error is.
+
+	* proto-stream.el (open-protocol-stream): Renamed from
+	open-proto-stream.
+
+2010-11-27  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+	* nnimap.el (nnimap-stream): Change default to `undecided'.
+	(nnimap-open-connection): If `nnimap-stream' is `undecided', try ssl
+	first, and then network.
+	(nnimap-open-connection-1): Respect nnimap-server-port.
+	(nnimap-open-connection): Be more backwards-compatible.
+
+	* proto-stream.el (proto-stream-always-use-starttls): New variable.
+	(proto-stream-open-starttls): De-duplicate the starttls code.
+	(proto-stream-open-starttls): Folded back into the main function.
+	(proto-stream-open-network): Fix typo in the gnutls path.
+	(proto-stream-command): Refactor out.
+
+	* nntp.el (nntp-open-connection): Fix the STARTTLS command syntax.
+
+	* proto-stream.el (proto-stream-open-starttls): Actually implement the
+	starttls.el STARTTLS.
+
+	* color.el (color-lab->srgb): Fix function call name.
+
+	* proto-stream.el (proto-stream-open-tls): Delete output from openssl
+	if we're using tls.el.
+	(proto-stream-open-network): If we don't have gnutls-cli or gnutls
+	built in, then don't try to establish a STARTTLS connection.
+
+	* nntp.el (nntp-open-connection): Switch on STARTTLS on supported
+	servers.
+
+	* proto-stream.el (open-proto-stream): Use network, not stream.
+	(open-proto-stream): Add a way to specify what the end of a command is.
+
+	* nntp.el (nntp-open-connection): Use proto-streams for the relevant
+	connections types.
+	(nntp-open-network-stream): Remove.
+	(nntp-open-ssl-stream): Remove.
+	(nntp-open-tls-stream): Remove.
+	(nntp-ssl-program): Remove.
+
+	* nnimap.el (nnimap-open-connection): Check for "OK" from the greeting.
+
+2010-11-27  Andrew Cohen  <cohen@andy.bu.edu>
+
+	* nnir.el: Fix typos.
+	(nnir-retrieve-headers-override-function): Rename variable to reflect
+	new semantics.
+	(nnir-article-group, nnir-article-number, nnir-article-rsv): New helper
+	macros.
+	(nnir-request-article, nnir-request-move-article): Use them.
+	(nnir-categorize): New function.
+	(nnir-run-query): Use it.
+	(nnir-retrieve-headers): Rewrite to batch header retrieval.
+	(nnir-run-gmane): nnir-retrieve-headers now returns the headers already
+	sorted.
+	(nnir-group-full-name): Use gnus-group-full-name instead.
+	(nnir-artlist-artitem-group, nnir-artlist-artitem-number)
+	(nnir-artlist-artitem-rsv, nnir-sort-groups-by-server): Obsolete.
+
+2010-11-27  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+	* nnimap.el (nnimap-open-connection): Fix typo in STARTTLS command.
+
+	* proto-stream.el: New library to provide protocol-specific
+	TLS/STARTTLS connections for IMAP, NNTP, SMTP, POP3 and similar
+	protocols.
+	(open-proto-stream): Complete the documentation.
+	(proto-stream-open-network): Fix some typos.
+
+	* nnimap.el (nnimap-open-connection): Use it.
+
+2010-11-27  Yuri Karaban  <tech@askold.net>  (tiny change)
+
+	* pop3.el (pop3-open-server): Read server greeting before starting TLS
+	negotiation.
+
+2010-11-26  Julien Danjou  <julien@danjou.info>
+
+	* color.el: Rename various rgb functions to srgb.
+
+2010-11-26  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+	* nnimap.el (nnimap-get-groups): Allow non-quoted strings as mailbox
+	names.
+
+2010-11-26  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+	* shr.el (shr-insert): Revert last change.
+	(shr-find-fill-point): Never leave point being at bol;
+	relax the kinsoku limitation when rendering tables.
+
+2010-11-26  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+	* nnmail.el (nnmail-expiry-target-group): Protect against degenerate
+	results from -accept-article.
+
+	* shr-color.el: Require cl when compiling.
+
+	* nnheader.el (nnheader-update-marks-actions): Fix typo in last
+	checkin.
+
+	* gnus-art.el (gnus-url-mailto): Unfold URLs before using them.
+
+	* nnimap.el (nnimap-request-set-mark): Add is "+", not "-".
+
+	* gnus-sum.el (gnus-summary-push-marks-to-backend): Use 'set instead of
+	'add and 'delete to set backend marks.
+
+	* nnmaildir.el (nnmaildir-request-set-mark): Be explicit about 'set.
+
+	* nnheader.el (nnheader-update-marks-actions): Refactor out.
+
+	* nntp.el (nntp-request-set-mark): Use it.
+
+	* nnfolder.el (nnfolder-request-set-mark): Ditto.
+
+	* nnml.el (nnml-request-set-mark): Ditto.
+
+	* nnimap.el (nnimap-last-response-string): Remove the unfolding -- it
+	introduces regressions in article selection.
+	(nnimap-find-uid-response): New function.
+	(nnimap-request-accept-article): Use the UID returned, if any.
+	(nnimap-request-move-article): Use the UID returned, if any.
+	(nnimap-get-groups): Reimplement to work with folded lines.
+	(nnimap-find-uid-response): The UID is the last element in the list.
+	(nnimap-request-set-mark): Extend syntax with 'set.
+
+	* nnml.el (nnml-request-set-mark): Ditto.
+
+	* nnfolder.el (nnfolder-request-set-mark): Ditto.
+
+	* nntp.el (nntp-request-set-mark): Ditto.
+
+2010-11-25  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+	* message.el (message-called-interactively-p): A temporary macro.
+	(message-goto-body): Use it temporarily.
+
+2010-11-25  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+	* nnimap.el (nnimap-unfold-quoted-lines): Refactor out.
+	(nnimap-last-response-string): Unfold quoted lines, if they exist.
+	(nnimap-last-response-string): Fix last unfolding fix.
+
+2010-11-25  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+	* shr.el (shr-insert): Fix the way to fold lines.
+
+2010-11-25  Julien Danjou  <julien@danjou.info>
+
+	* shr-color.el (shr-color->hexadecimal): Use color-rgb->hex
+
+	* color.el: Rename from color-lab.el
+	(color-rgb->hex): Add.
+	(color-complement): Add.
+	(color-complement-hex): Add.
+
+	* gnus-sum.el (gnus-summary-widget-forward): Add, and bind to [tab].
+
+2010-11-25  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+	* shr-color.el (shr-color-visible): Don't bug out if the colour names
+	don't exist.
+
+2010-11-25  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+	* mml.el (mml-preview): Make sure to bind gnus-displaying-mime to nil,
+	assuming that article displaying or another mml-preview may be
+	interrupted for an error or for the like.
+
+	* shr.el (shr-get-background): Fix argument name.
+
+2010-11-24  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+	* gnus-cache.el (gnus-summary-insert-cached-articles): Use it.
+
+	* gnus-sum.el (gnus-summary-include-articles): New function.
+
+	* message.el (message-goto-body): called-interactively-p needs a
+	parameter, so use `any'.
+
+	* nnimap.el (nnimap-request-move-article): It's no longer necessary to
+	clear marks before moving, since they're synced from the Gnus side
+	first.
+
+	* gnus-sum.el (gnus-summary-push-marks-to-backend): New function.
+	(gnus-summary-move-article): Copy over all marks before moving, so that
+	IMAP doesn't think a new article has arrived.
+
+2010-11-24  Julien Danjou  <julien@danjou.info>
+
+	* shr.el (shr-insert-background-overlay): Fix typo.
+	(shr-render-td): Copy the background before rendering.
+
+	* shr-color.el (shr-color-visible): Fix docstring.
+
+	* shr.el (shr-tag-table): Add bgcolor support.
+	(shr-render-td): Add bgcolor support.
+	(shr-get-background): Add.
+	(shr-insert-foreground-overlay): Use shr-get-background.
+
+	* message.el (message-goto-body): Use called-interactively-p.
+	(message-in-body-p): message-goto-body returns point.
+
+2010-11-24  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+	* mm-util.el (mm-enable-multibyte): Use `to' instead of t.  This fixes
+	Fixes something or other in Emacs 23, and is backwards compatible.
+
+	* message.el (message-goto-body): Remove the <#secure special-casing,
+	which is too special.
+
+	* shr.el (shr-parse-style): Drop !important from styles.
+
+2010-11-24  Daniel Schoepe  <daniel.schoepe@googlemail.com>  (tiny change)
+
+	* gnus-sum.el (gnus-summary-articles-in-thread): Fix a bug that causes
+	this function to return incorrect results when calling it with an
+	explicit article argument different from
+	(gnus-summary-article-number).
+
+2010-11-24  Julien Danjou  <julien@danjou.info>
+
+	* shr.el (shr-insert-color-overlay): Replace deprecated syntax.
+	(shr-tag-body): Add background support.
+	(shr-descend): Add background support.
+	(shr-tag-title): Add.
+
+	* shr-color.el (shr-color-visible): Really return original background
+	if fixed.
+
+2010-11-24  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+	* shr.el (shr-color-check): Protect against non-existant colour names.
+
+2010-11-24  Julien Danjou  <julien@danjou.info>
+
+	* color-lab.el: Require 'cl when compiling.
+
+	* shr.el (shr-insert-color-overlay): Remove specific rgb() check.
+
+	* shr-color.el (shr-color->hexadecimal): Only return the hexadecimal
+	matched part.
+
+	* color-lab.el: Fix all expt calls to use float type.
+
+2010-11-24  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+	* shr.el (shr-insert-color-overlay): Pass rgb(rrr, ggg, bbb) type color
+	expression to shr-color-check as is.
+
+	* shr-color.el (shr-color->hexadecimal): Ignore case of color names.
+
+	* color-lab.el: Add coding cookie.
+	(float-pi): Use eval-and-compile.
+
+2010-11-23  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+	* shr.el (shr-insert-color-overlay): Split stuff like
+	"#444444 !important" to find the real colour.
+	(shr-tag-font): Resurrect shr-tag-font again, since it's needed to
+	parse <font color="red"> entries.
+
+2010-11-23  Andrew Cohen  <cohen@andy.bu.edu>
+
+	* nnheader.el (nnheader-parse-head): Bug fix.  Properly position
+	point when parsing headers.
+
+	* nnspool.el (nnspool-insert-nov-head): Bug fix.  Make sure point
+	is positioned properly when parsing headers.
+
+2010-11-23  Julien Danjou  <julien@danjou.info>
+
+	* color-lab.el (boundp): Bind float-pi for Emacs < 23.3.
+
+	* shr-color.el (shr-color->hexadecimal): Add support for color names.
+
+	* shr.el (shr-parse-style): Replace \n with space in style parsing.
+
+	* shr-color.el (shr-color-hsl-to-rgb-fractions): Use
+	shr-color-hue-to-rgb.
+	(shr-color->hexadecimal): Call shr-color-hsl-to-rgb-fractions.
+
+2010-11-23  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+	* shr.el (shr-color->hexadecimal): Autoload.
+	(shr-descend): Add color to all tags.
+
 2010-11-22  Julien Danjou  <julien@danjou.info>
 
+	* shr.el (shr-tag-color-check): Convert colors to hexadecimal with
+	shr-color->hexadecimal.
+
+	* shr-color.el (shr-color->hexadecimal): Add converting functions for
+	RGB() or HSL() color representation.
+
+	* shr.el (shr-tag-font): Add.
+	(shr-tag-color-check): New function to get better colors.
+	(shr-tag-insert-color-overlay): Factorize code between tag-font and
+	tag-span.
+
+	* shr-color.el: New file.
+
+	* color-lab.el: New file.
+
 	* gnus-art.el (gnus-url-mailto): Do not downcase args.
 
 2010-11-21  Andrew Cohen  <cohen@andy.bu.edu>
--- a/lisp/gnus/auth-source.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/gnus/auth-source.el	Thu Dec 16 18:30:57 2010 -0500
@@ -159,6 +159,15 @@
                                                      (const :tag "Any" t)
                                                      (string :tag "Specific user name"))))))))
 
+(defcustom auth-source-gpg-encrypt-to t
+  "List of recipient keys that `authinfo.gpg' encrypted to.
+If the value is not a list, symmetric encryption will be used."
+  :group 'auth-source
+  :version "23.2" ;; No Gnus
+  :type '(choice (const :tag "Symmetric encryption" t)
+		 (repeat :tag "Recipient public keys"
+			 (string :tag "Recipient public key"))))
+
 ;; temp for debugging
 ;; (unintern 'auth-source-protocols)
 ;; (unintern 'auth-sources)
@@ -352,9 +361,28 @@
       ;; netrc interface.
       (when (y-or-n-p (format "Do you want to save this password in %s? "
                               source))
-        (netrc-store-data source host prot
-                          (or user (cdr (assoc "login" result)))
-                          (cdr (assoc "password" result))))))
+	;; the code below is almost same as `netrc-store-data' except
+	;; the `epa-file-encrypt-to' hack (see bug#7487).
+	(with-temp-buffer
+	  (when (file-exists-p source)
+	    (insert-file-contents source))
+	  (when auth-source-gpg-encrypt-to
+	    ;; making `epa-file-encrypt-to' local to this buffer lets
+	    ;; epa-file skip the key selection query (see the
+	    ;; `local-variable-p' check in `epa-file-write-region').
+	    (unless (local-variable-p 'epa-file-encrypt-to)
+	      (make-local-variable 'epa-file-encrypt-to))
+	    (if (listp auth-source-gpg-encrypt-to)
+		(setq epa-file-encrypt-to auth-source-gpg-encrypt-to)))
+	  (goto-char (point-max))
+	  (unless (bolp)
+	    (insert "\n"))
+	  (insert (format "machine %s login %s password %s port %s\n"
+			  host
+			  (or user (cdr (assoc "login" result)))
+			  (cdr (assoc "password" result))
+			  prot))
+	  (write-region (point-min) (point-max) source nil 'silent)))))
     (if (consp mode)
         (mapcar #'cdr result)
       (cdar result))))
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lisp/gnus/color.el	Thu Dec 16 18:30:57 2010 -0500
@@ -0,0 +1,269 @@
+;;; color.el --- Color manipulation laboratory routines -*- coding: utf-8; -*-
+
+;; Copyright (C) 2010 Free Software Foundation, Inc.
+
+;; Author: Julien Danjou <julien@danjou.info>
+;; Keywords: html
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; This package provides color manipulation functions.
+
+;;; Code:
+
+(eval-when-compile
+  (require 'cl))
+
+;; Emacs < 23.3
+(eval-and-compile
+  (unless (boundp 'float-pi)
+    (defconst float-pi (* 4 (atan 1)) "The value of Pi (3.1415926...).")))
+
+(defun color-rgb->hex  (red green blue)
+  "Return hexadecimal notation for RED GREEN BLUE color.
+RED GREEN BLUE must be values between 0 and 1 inclusively."
+  (format "#%02x%02x%02x"
+          (* red 255) (* green 255) (* blue 255)))
+
+(defun color-complement (color)
+  "Return the color that is the complement of COLOR."
+  (let ((color (color-rgb->normalize color)))
+    (list (- 1.0 (car color))
+          (- 1.0 (cadr color))
+          (- 1.0 (caddr color)))))
+
+(defun color-complement-hex (color)
+  "Return the color that is the complement of COLOR, in hexadecimal format."
+  (apply 'color-rgb->hex (color-complement color)))
+
+(defun color-rgb->hsv (red green blue)
+  "Convert RED GREEN BLUE values to HSV representation.
+Hue is in radians. Saturation and values are between 0 and 1
+inclusively."
+   (let* ((r (float red))
+	 (g (float green))
+	 (b (float blue))
+	 (max (max r g b))
+	 (min (min r g b)))
+     (list
+      (/ (* 2 float-pi
+            (cond ((and (= r g) (= g b)) 0)
+                  ((and (= r max)
+                        (>= g b))
+                   (* 60 (/ (- g b) (- max min))))
+                  ((and (= r max)
+                        (< g b))
+                   (+ 360 (* 60 (/ (- g b) (- max min)))))
+                  ((= max g)
+                   (+ 120 (* 60 (/ (- b r) (- max min)))))
+                  ((= max b)
+                       (+ 240 (* 60 (/ (- r g) (- max min)))))))
+         360)
+      (if (= max 0)
+          0
+        (- 1 (/ min max)))
+      (/ max 255.0))))
+
+(defun color-rgb->hsl (red green blue)
+  "Convert RED GREEN BLUE colors to their HSL representation.
+RED, GREEN and BLUE must be between 0 and 1 inclusively."
+  (let* ((r red)
+         (g green)
+         (b blue)
+         (max (max r g b))
+         (min (min r g b))
+         (delta (- max min))
+         (l (/ (+ max min) 2.0)))
+    (list
+     (if (= max min)
+         0
+       (* 2 float-pi
+          (/ (cond ((= max r)
+                    (+ (/ (- g b) delta) (if (< g b) 6 0)))
+                   ((= max g)
+                 (+ (/ (- b r) delta) 2))
+                   (t
+                    (+ (/ (- r g) delta) 4)))
+             6)))
+     (if (= max min)
+         0
+       (if (> l 0.5)
+           (/ delta (- 2 (+ max min)))
+         (/ delta (+ max min))))
+     l)))
+
+(defun color-srgb->xyz (red green blue)
+  "Converts RED GREEN BLUE colors from the sRGB color space to CIE XYZ.
+RED, BLUE and GREEN must be between 0 and 1 inclusively."
+  (let ((r (if (<= red 0.04045)
+               (/ red 12.95)
+             (expt (/ (+ red 0.055) 1.055) 2.4)))
+        (g (if (<= green 0.04045)
+               (/ green 12.95)
+             (expt (/ (+ green 0.055) 1.055) 2.4)))
+        (b (if (<= blue 0.04045)
+               (/ blue 12.95)
+             (expt (/ (+ blue 0.055) 1.055) 2.4))))
+    (list (+ (* 0.4124564 r) (* 0.3575761 g) (* 0.1804375 b))
+          (+ (* 0.21266729 r) (* 0.7151522 g) (* 0.0721750 b))
+          (+ (* 0.0193339 r) (* 0.1191920 g) (* 0.9503041 b)))))
+
+(defun color-xyz->srgb (X Y Z)
+  "Converts CIE X Y Z colors to sRGB color space."
+  (let ((r (+ (* 3.2404542 X) (* -1.5371385 Y) (* -0.4985314 Z)))
+        (g (+ (* -0.9692660 X) (* 1.8760108 Y) (* 0.0415560 Z)))
+        (b (+ (* 0.0556434 X) (* -0.2040259 Y) (* 1.0572252 Z))))
+    (list (if (<= r 0.0031308)
+              (* 12.92 r)
+            (- (* 1.055 (expt r (/ 1 2.4))) 0.055))
+          (if (<= g 0.0031308)
+              (* 12.92 g)
+            (- (* 1.055 (expt g (/ 1 2.4))) 0.055))
+          (if (<= b 0.0031308)
+              (* 12.92 b)
+            (- (* 1.055 (expt b (/ 1 2.4))) 0.055)))))
+
+(defconst color-d65-xyz '(0.950455 1.0 1.088753)
+  "D65 white point in CIE XYZ.")
+
+(defconst color-cie-ε (/ 216 24389.0))
+(defconst color-cie-κ (/ 24389 27.0))
+
+(defun color-xyz->lab (X Y Z &optional white-point)
+  "Converts CIE XYZ to CIE L*a*b*.
+WHITE-POINT can be specified as (X Y Z) white point to use. If
+none is set, `color-d65-xyz' is used."
+  (destructuring-bind (Xr Yr Zr) (or white-point color-d65-xyz)
+      (let* ((xr (/ X Xr))
+             (yr (/ Y Yr))
+             (zr (/ Z Zr))
+             (fx (if (> xr color-cie-ε)
+                     (expt xr (/ 1 3.0))
+                   (/ (+ (* color-cie-κ xr) 16) 116.0)))
+             (fy (if (> yr color-cie-ε)
+                     (expt yr (/ 1 3.0))
+                   (/ (+ (* color-cie-κ yr) 16) 116.0)))
+             (fz (if (> zr color-cie-ε)
+                     (expt zr (/ 1 3.0))
+                   (/ (+ (* color-cie-κ zr) 16) 116.0))))
+        (list
+         (- (* 116 fy) 16)                  ; L
+         (* 500 (- fx fy))                  ; a
+         (* 200 (- fy fz))))))              ; b
+
+(defun color-lab->xyz (L a b &optional white-point)
+  "Converts CIE L*a*b* to CIE XYZ.
+WHITE-POINT can be specified as (X Y Z) white point to use. If
+none is set, `color-d65-xyz' is used."
+  (destructuring-bind (Xr Yr Zr) (or white-point color-d65-xyz)
+      (let* ((fy (/ (+ L 16) 116.0))
+             (fz (- fy (/ b 200.0)))
+             (fx (+ (/ a 500.0) fy))
+             (xr (if (> (expt fx 3.0) color-cie-ε)
+                     (expt fx 3.0)
+               (/ (- (* fx 116) 16) color-cie-κ)))
+             (yr (if (> L (* color-cie-κ color-cie-ε))
+                     (expt (/ (+ L 16) 116.0) 3.0)
+                   (/ L color-cie-κ)))
+             (zr (if (> (expt fz 3) color-cie-ε)
+                     (expt fz 3.0)
+                   (/ (- (* 116 fz) 16) color-cie-κ))))
+        (list (* xr Xr)                 ; X
+              (* yr Yr)                 ; Y
+              (* zr Zr)))))             ; Z
+
+(defun color-srgb->lab (red green blue)
+  "Converts RGB to CIE L*a*b*."
+  (apply 'color-xyz->lab (color-srgb->xyz red green blue)))
+
+(defun color-rgb->normalize (color)
+  "Normalize a RGB color to values between 0 and 1 inclusively."
+  (mapcar (lambda (x) (/ x 65535.0)) (x-color-values color)))
+
+(defun color-lab->srgb (L a b)
+  "Converts CIE L*a*b* to RGB."
+  (apply 'color-xyz->srgb (color-lab->xyz L a b)))
+
+(defun color-cie-de2000 (color1 color2 &optional kL kC kH)
+  "Computes the CIEDE2000 color distance between COLOR1 and COLOR2.
+Colors must be in CIE L*a*b* format."
+  (destructuring-bind (L₁ a₁ b₁) color1
+    (destructuring-bind (L₂ a₂ b₂) color2
+      (let* ((kL (or kL 1))
+             (kC (or kC 1))
+             (kH (or kH 1))
+             (C₁ (sqrt (+ (expt a₁ 2.0) (expt b₁ 2.0))))
+             (C₂ (sqrt (+ (expt a₂ 2.0) (expt b₂ 2.0))))
+             (C̄ (/ (+ C₁ C₂) 2.0))
+             (G (* 0.5 (- 1 (sqrt (/ (expt C̄ 7.0) (+ (expt C̄ 7.0) (expt 25 7.0)))))))
+             (a′₁ (* (+ 1 G) a₁))
+             (a′₂ (* (+ 1 G) a₂))
+             (C′₁ (sqrt (+ (expt a′₁ 2.0) (expt b₁ 2.0))))
+             (C′₂ (sqrt (+ (expt a′₂ 2.0) (expt b₂ 2.0))))
+             (h′₁ (if (and (= b₁ 0) (= a′₁ 0))
+                      0
+                    (let ((v (atan b₁ a′₁)))
+                      (if (< v 0)
+                          (+ v (* 2 float-pi))
+                        v))))
+             (h′₂ (if (and (= b₂ 0) (= a′₂ 0))
+                      0
+                    (let ((v (atan b₂ a′₂)))
+                      (if (< v 0)
+                          (+ v (* 2 float-pi))
+                        v))))
+             (ΔL′ (- L₂ L₁))
+             (ΔC′ (- C′₂ C′₁))
+             (Δh′ (cond ((= (* C′₁ C′₂) 0)
+                         0)
+                        ((<= (abs (- h′₂ h′₁)) float-pi)
+                         (- h′₂ h′₁))
+                        ((> (- h′₂ h′₁) float-pi)
+                         (- (- h′₂ h′₁) (* 2 float-pi)))
+                        ((< (- h′₂ h′₁) (- float-pi))
+                         (+ (- h′₂ h′₁) (* 2 float-pi)))))
+             (ΔH′ (* 2 (sqrt (* C′₁ C′₂)) (sin (/ Δh′ 2.0))))
+             (L̄′ (/ (+ L₁ L₂) 2.0))
+             (C̄′ (/ (+ C′₁ C′₂) 2.0))
+             (h̄′ (cond ((= (* C′₁ C′₂) 0)
+                        (+ h′₁ h′₂))
+                       ((<= (abs (- h′₁ h′₂)) float-pi)
+                        (/ (+ h′₁ h′₂) 2.0))
+                       ((< (+ h′₁ h′₂) (* 2 float-pi))
+                        (/ (+ h′₁ h′₂ (* 2 float-pi)) 2.0))
+                       ((>= (+ h′₁ h′₂) (* 2 float-pi))
+                        (/ (+ h′₁ h′₂ (* -2 float-pi)) 2.0))))
+             (T (+ 1
+                   (- (* 0.17 (cos (- h̄′ (degrees-to-radians 30)))))
+                   (* 0.24 (cos (* h̄′ 2)))
+                   (* 0.32 (cos (+ (* h̄′ 3) (degrees-to-radians 6))))
+                   (- (* 0.20 (cos (- (* h̄′ 4) (degrees-to-radians 63)))))))
+             (Δθ (* (degrees-to-radians 30) (exp (- (expt (/ (- h̄′ (degrees-to-radians 275)) (degrees-to-radians 25)) 2.0)))))
+             (Rc (* 2 (sqrt (/ (expt C̄′ 7.0) (+ (expt C̄′ 7.0) (expt 25.0 7.0))))))
+             (Sl (+ 1 (/ (* 0.015 (expt (- L̄′ 50) 2.0)) (sqrt (+ 20 (expt (- L̄′ 50) 2.0))))))
+             (Sc (+ 1 (* C̄′ 0.045)))
+             (Sh (+ 1 (* 0.015 C̄′ T)))
+             (Rt (- (* (sin (* Δθ 2)) Rc))))
+        (sqrt (+ (expt (/ ΔL′ (* Sl kL)) 2.0)
+                 (expt (/ ΔC′ (* Sc kC)) 2.0)
+                 (expt (/ ΔH′ (* Sh kH)) 2.0)
+                 (* Rt (/ ΔC′ (* Sc kC)) (/ ΔH′ (* Sh kH)))))))))
+
+(provide 'color)
+
+;;; color.el ends here
--- a/lisp/gnus/gnus-agent.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/gnus/gnus-agent.el	Thu Dec 16 18:30:57 2010 -0500
@@ -685,7 +685,6 @@
 minor mode in all Gnus buffers."
   (interactive)
   (gnus-open-agent)
-  (add-hook 'gnus-setup-news-hook 'gnus-agent-queue-setup)
   (unless gnus-agent-send-mail-function
     (setq gnus-agent-send-mail-function
 	  (or message-send-mail-real-function
@@ -1514,7 +1513,7 @@
   "Fetch ARTICLES from GROUP and put them into the Agent."
   (when articles
     (gnus-agent-load-alist group)
-    (let* ((alist   gnus-agent-article-alist)
+    (let* ((alist gnus-agent-article-alist)
            (headers (if (< (length articles) 2) nil gnus-newsgroup-headers))
            (selected-sets (list nil))
            (current-set-size 0)
@@ -1556,9 +1555,9 @@
                                       ;; 65 char/line.  If the line count
                                       ;; is missing, arbitrarily assume a
                                       ;; size of 1000 characters.
-                                    (max (* 65 (mail-header-lines
-                                                (car headers)))
-                                         1000)
+				      (max (* 65 (mail-header-lines
+						  (car headers)))
+					   1000)
                                     char-size))
 			      0))))
             (setcar selected-sets (nreverse (car selected-sets)))
--- a/lisp/gnus/gnus-art.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/gnus/gnus-art.el	Thu Dec 16 18:30:57 2010 -0500
@@ -8146,6 +8146,7 @@
 
 (defun gnus-url-mailto (url)
   ;; Send mail to someone
+  (setq url (replace-regexp-in-string "\n" " " url))
   (when (string-match "mailto:/*\\(.*\\)" url)
     (setq url (substring url (match-beginning 1) nil)))
   (let (to args subject func)
--- a/lisp/gnus/gnus-cache.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/gnus/gnus-cache.el	Thu Dec 16 18:30:57 2010 -0500
@@ -383,9 +383,14 @@
   "Insert all the articles cached for this group into the current buffer."
   (interactive)
   (let ((gnus-verbose (max 6 gnus-verbose)))
-    (if (not gnus-newsgroup-cached)
-	(gnus-message 3 "No cached articles for this group")
-      (gnus-summary-goto-subjects gnus-newsgroup-cached))))
+    (cond
+     ((not gnus-newsgroup-cached)
+      (gnus-message 3 "No cached articles for this group"))
+     ;; This is faster if there are few articles to insert.
+     ((< (length gnus-newsgroup-cached) 20)
+      (gnus-summary-goto-subjects gnus-newsgroup-cached))
+     (t
+      (gnus-summary-include-articles gnus-newsgroup-cached)))))
 
 (defun gnus-summary-limit-include-cached ()
   "Limit the summary buffer to articles that are cached."
--- a/lisp/gnus/gnus-demon.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/gnus/gnus-demon.el	Thu Dec 16 18:30:57 2010 -0500
@@ -121,18 +121,18 @@
            ;; If t, replace by 1
            (time (cond ((eq time t)
                         gnus-demon-timestep)
-                       ((null time))
+                       ((null time) nil)
                        (t (* time gnus-demon-timestep))))
            (timer
             (cond
              ;; (func number t)
              ;; Call when Emacs has been idle for `time'
              ((and (numberp time) (eq idle t))
-              (run-with-timer t time 'gnus-demon-run-callback func time))
+              (run-with-timer time time 'gnus-demon-run-callback func time))
              ;; (func number number)
              ;; Call every `time' when Emacs has been idle for `idle'
              ((and (numberp time) (numberp idle))
-              (run-with-timer t time 'gnus-demon-run-callback func idle))
+              (run-with-timer time time 'gnus-demon-run-callback func idle))
              ;; (func nil number)
              ;; Only call when Emacs has been idle for `idle'
              ((and (null time) (numberp idle))
--- a/lisp/gnus/gnus-gravatar.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/gnus/gnus-gravatar.el	Thu Dec 16 18:30:57 2010 -0500
@@ -26,13 +26,15 @@
 
 (require 'gravatar)
 (require 'gnus-art)
+(require 'mail-extr) ;; Because of binding `mail-extr-disable-voodoo'.
 
 (defgroup gnus-gravatar nil
   "Gnus Gravatar."
   :group 'gnus-visual)
 
-(defcustom gnus-gravatar-size 32
-  "How big should gravatars be displayed."
+(defcustom gnus-gravatar-size nil
+  "How big should gravatars be displayed.
+If nil, default to `gravatar-size'."
   :type 'integer
   :version "24.1"
   :group 'gnus-gravatar)
@@ -51,30 +53,25 @@
 
 (defun gnus-gravatar-transform-address (header category &optional force)
   (gnus-with-article-headers
-    (let ((addresses
-           (mail-header-parse-addresses
-            ;; mail-header-parse-addresses does not work (reliably) on
-            ;; decoded headers.
-            (or
-             (ignore-errors
-               (mail-encode-encoded-word-string
-                (or (mail-fetch-field header) "")))
-             (mail-fetch-field header))))
-	  (gravatar-size gnus-gravatar-size)
-	  name)
+    (let* ((mail-extr-disable-voodoo t)
+	   (addresses (mail-extract-address-components
+		       (or (mail-fetch-field header) "") t))
+	   (gravatar-size gnus-gravatar-size)
+	   name)
       (dolist (address addresses)
-	(when (setq name (cdr address))
-	  (setcdr address (setq name (mail-decode-encoded-word-string name))))
+	(when (and (setq name (car address))
+		   (string-match "\\` +" name))
+	  (setcar address (setq name (substring name (match-end 0)))))
 	(when (or force
 		  (not (and gnus-gravatar-too-ugly
 			    (or (string-match gnus-gravatar-too-ugly
-					      (car address))
+					      (or (cadr address) ""))
 				(and name
 				     (string-match gnus-gravatar-too-ugly
 						   name))))))
 	  (ignore-errors
 	    (gravatar-retrieve
-	     (car address)
+	     (cadr address)
 	     'gnus-gravatar-insert
 	     (list header address category))))))))
 
@@ -87,12 +84,15 @@
       (when (buffer-live-p (current-buffer))
         (gnus-article-goto-header header)
         (mail-header-narrow-to-field)
-        (let ((real-name (cdr address))
-              (mail-address (car address)))
+        (let ((real-name (car address))
+              (mail-address (cadr address)))
           (when (if real-name
-		    (re-search-forward (concat (regexp-quote real-name) "\\|"
-					       (regexp-quote mail-address))
-				       nil t)
+		    (re-search-forward
+		     (concat (gnus-replace-in-string
+			      (regexp-quote real-name) "[\t ]+" "[\t\n ]+")
+			     "\\|"
+			     (regexp-quote mail-address))
+		     nil t)
 		  (search-forward mail-address nil t))
 	    (goto-char (1- (match-beginning 0)))
             ;; If we're on the " quoting the name, go backward
@@ -103,8 +103,7 @@
             ;; example we were fetching someaddress, and then we change to
             ;; another mail with the same someaddress.
             (unless (memq 'gnus-gravatar (text-properties-at (point)))
-              (let ((inhibit-read-only t)
-                    (point (point)))
+              (let ((point (point)))
                 (unless (featurep 'xemacs)
                   (setq gravatar (append gravatar gnus-gravatar-properties)))
                 (gnus-put-image gravatar nil category)
--- a/lisp/gnus/gnus-group.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/gnus/gnus-group.el	Thu Dec 16 18:30:57 2010 -0500
@@ -3781,6 +3781,7 @@
 		  gnus-list-of-killed-groups))
 	  (gnus-group-change-level
 	   (if entry entry group) gnus-level-killed (if entry nil level))
+	  (gnus-request-update-group-status group 'unsubscribe)
 	  (message "Killed group %s" (gnus-group-decoded-name group)))
       ;; If there are lots and lots of groups to be killed, we use
       ;; this thing instead.
@@ -3803,7 +3804,8 @@
 	  (setq gnus-zombie-list (delete group gnus-zombie-list))))
 	;; There may be more than one instance displayed.
 	(while (gnus-group-goto-group group)
-	  (gnus-delete-line)))
+	  (gnus-delete-line))
+	(gnus-request-update-group-status group 'unsubscribe))
       (gnus-make-hashtable-from-newsrc-alist))
 
     (gnus-group-position-point)
@@ -3831,6 +3833,7 @@
        (and prev (gnus-group-entry prev))
        t)
       (gnus-group-insert-group-line-info group)
+      (gnus-request-update-group-status group 'subscribe)
       (gnus-undo-register
 	`(when (gnus-group-goto-group ,group)
 	   (gnus-group-kill-group 1))))
--- a/lisp/gnus/gnus-html.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/gnus/gnus-html.el	Thu Dec 16 18:30:57 2010 -0500
@@ -199,8 +199,11 @@
 				   (gnus-html-display-image url start end
 							    ,alt-text))
 	       'gnus-image (list url start end alt-text)))
-	(gnus-overlay-put (gnus-make-overlay start end)
-			  'local-map gnus-html-image-map)
+	(widget-convert-button
+	 'url-link start (point)
+	 :help-echo alt-text
+	 :keymap gnus-html-image-map
+	 url)
 	(if (string-match "\\`cid:" url)
 	    ;; URLs with cid: have their content stashed in other
 	    ;; parts of the MIME structure, so just insert them
@@ -392,7 +395,7 @@
 	     4)
       (setq args (nconc args (list t))))
     (ignore-errors
-      (apply #'url-retrieve args))))
+      (push (apply #'url-retrieve args) gnus-buffers))))
 
 (defun gnus-html-image-fetched (status buffer image)
   "Callback function called when image has been fetched."
@@ -473,10 +476,11 @@
                   (let ((image (gnus-rescale-image image (gnus-html-maximum-image-size))))
                     (delete-region start end)
                     (gnus-put-image image alt-text 'external)
-                    (gnus-put-text-property start (point) 'help-echo alt-text)
-                    (gnus-overlay-put
-		     (gnus-make-overlay start (point)) 'local-map
-		     gnus-html-displayed-image-map)
+		    (widget-convert-button
+		     'url-link start (point)
+		     :help-echo alt-text
+		     :keymap gnus-html-displayed-image-map
+		     url)
                     (gnus-put-text-property start (point)
 					    'gnus-alt-text alt-text)
                     (when url
--- a/lisp/gnus/gnus-int.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/gnus/gnus-int.el	Thu Dec 16 18:30:57 2010 -0500
@@ -259,20 +259,21 @@
 	  (gnus-message 1 "Denied server %s" server)
 	  nil)
       ;; Open the server.
-      (let* ((open-server-function (gnus-get-function gnus-command-method 'open-server))
+      (let* ((open-server-function
+	      (gnus-get-function gnus-command-method 'open-server))
              (result
-             (condition-case err
-                 (funcall open-server-function
-                          (nth 1 gnus-command-method)
-                          (nthcdr 2 gnus-command-method))
-               (error
-                (gnus-message 1 "Unable to open server %s due to: %s"
-			      server (error-message-string err))
-                nil)
-               (quit
-                (gnus-message 1 "Quit trying to open server %s" server)
-                nil)))
-            open-offline)
+	      (condition-case err
+		  (funcall open-server-function
+			   (nth 1 gnus-command-method)
+			   (nthcdr 2 gnus-command-method))
+		(error
+		 (gnus-message 1 "Unable to open server %s due to: %s"
+			       server (error-message-string err))
+		 nil)
+		(quit
+		 (gnus-message 1 "Quit trying to open server %s" server)
+		 nil)))
+	     open-offline)
 	;; If this hasn't been opened before, we add it to the list.
 	(unless elem
 	  (setq elem (list gnus-command-method nil)
@@ -472,6 +473,18 @@
       (funcall (gnus-get-function gnus-command-method 'request-type)
 	       (gnus-group-real-name group) article))))
 
+(defun gnus-request-update-group-status (group status)
+  "Change the status of a group.
+Valid statuses include `subscribe' and `unsubscribe'."
+  (let ((gnus-command-method (gnus-find-method-for-group group)))
+    (if (not (gnus-check-backend-function
+	      'request-update-group-status (car gnus-command-method)))
+	nil
+      (funcall
+       (gnus-get-function gnus-command-method 'request-update-group-status)
+       (gnus-group-real-name group) status
+       (nth 1 gnus-command-method)))))
+
 (defun gnus-request-set-mark (group action)
   "Set marks on articles in the back end."
   (let ((gnus-command-method (gnus-find-method-for-group group)))
@@ -502,12 +515,11 @@
 	     article (gnus-group-real-name group)
 	     (nth 1 gnus-command-method) buffer)))
 
-(defun gnus-request-thread (id)
-  "Request the headers in the thread containing the article
-specified by Message-ID id."
+(defun gnus-request-thread (header)
+  "Request the headers in the thread containing the article specified by HEADER."
   (let ((gnus-command-method (gnus-find-method-for-group gnus-newsgroup-name)))
     (funcall (gnus-get-function gnus-command-method 'request-thread)
-	     id)))
+	     header)))
 
 (defun gnus-warp-to-article ()
   "Warps from an article in a virtual group to the article in its
--- a/lisp/gnus/gnus-msg.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/gnus/gnus-msg.el	Thu Dec 16 18:30:57 2010 -0500
@@ -55,7 +55,7 @@
 		 (sexp :tag "Methods" ,gnus-select-method)))
 
 (defcustom gnus-outgoing-message-group nil
-  "*All outgoing messages will be put in this group.
+  "All outgoing messages will be put in this group.
 If you want to store all your outgoing mail and articles in the group
 \"nnml:archive\", you set this variable to that value.  This variable
 can also be a list of group names.
@@ -70,6 +70,8 @@
 		 (string :tag "Group")
 		 (repeat :tag "List of groups" (string :tag "Group"))))
 
+(make-obsolete-variable 'gnus-outgoing-message-group 'gnus-message-archive-group "24.1")
+
 (defcustom gnus-mailing-list-groups nil
   "*If non-nil a regexp matching groups that are really mailing lists.
 This is useful when you're reading a mailing list that has been
@@ -397,7 +399,6 @@
 	   (message-mode-hook (copy-sequence message-mode-hook)))
        (setq mml-buffer-list nil)
        (add-hook 'message-header-setup-hook 'gnus-inews-insert-gcc)
-       (add-hook 'message-header-setup-hook 'gnus-inews-insert-archive-gcc)
        ;; message-newsreader and message-mailer were formerly set in
        ;; gnus-inews-add-send-actions, but this is too late when
        ;; message-generate-headers-first is used. --ansel
@@ -826,7 +827,6 @@
 	       (gnus-summary-mark-as-read ,article gnus-canceled-mark)))))
        message-send-actions)
       ;; Add Gcc header.
-      (gnus-inews-insert-archive-gcc)
       (gnus-inews-insert-gcc))))
 
 
@@ -1294,7 +1294,6 @@
 	(goto-char (point-max))
 	(insert mail-header-separator)
 	;; Add Gcc header.
-	(gnus-inews-insert-archive-gcc)
 	(gnus-inews-insert-gcc)
 	(goto-char (point-min))
 	(when (re-search-forward "^To:\\|^Newsgroups:" nil 'move)
@@ -1307,24 +1306,6 @@
   (interactive "P")
   (gnus-summary-mail-forward arg t))
 
-(defvar gnus-nastygram-message
-  "The following article was inappropriately posted to %s.\n\n"
-  "Format string to insert in nastygrams.
-The current group name will be inserted at \"%s\".")
-
-(defun gnus-summary-mail-nastygram (n)
-  "Send a nastygram to the author of the current article."
-  (interactive "P")
-  (when (or gnus-expert-user
-	    (gnus-y-or-n-p
-	     "Really send a nastygram to the author of the current article? "))
-    (let ((group gnus-newsgroup-name))
-      (gnus-summary-reply-with-original n)
-      (set-buffer gnus-message-buffer)
-      (message-goto-body)
-      (insert (format gnus-nastygram-message group))
-      (message-send-and-exit))))
-
 (defun gnus-summary-mail-crosspost-complaint (n)
   "Send a complaint about crossposting to the current article(s)."
   (interactive "P")
@@ -1580,7 +1561,6 @@
     (gnus-setup-message 'compose-bounce
       (message-bounce)
       ;; Add Gcc header.
-      (gnus-inews-insert-archive-gcc)
       (gnus-inews-insert-gcc)
       ;; If there are references, we fetch the article we answered to.
       (when parent
@@ -1694,44 +1674,13 @@
 		(gnus-group-mark-article-read group (cdr group-art)))
 	      (kill-buffer (current-buffer)))))))))
 
-(defun gnus-inews-insert-gcc ()
-  "Insert Gcc headers based on `gnus-outgoing-message-group'."
-  (save-excursion
-    (save-restriction
-      (message-narrow-to-headers)
-      (let* ((group gnus-outgoing-message-group)
-	     (gcc (cond
-		   ((functionp group)
-		    (funcall group))
-		   ((or (stringp group) (listp group))
-		    group))))
-	(when gcc
-	  (insert "Gcc: "
-		  (if (stringp gcc)
-		      (if (string-match " " gcc)
-			  (concat "\"" gcc "\"")
-			gcc)
-		    (mapconcat (lambda (group)
-				 (if (string-match " " group)
-				     (concat "\"" group "\"")
-				   group))
-			       gcc " "))
-		  "\n"))))))
-
-(defun gnus-inews-insert-archive-gcc (&optional group)
+(defun gnus-inews-insert-gcc (&optional group)
   "Insert the Gcc to say where the article is to be archived."
-  (setq group (cond (group
-		     (gnus-group-decoded-name group))
-		    (gnus-newsgroup-name
-		     (gnus-group-decoded-name gnus-newsgroup-name))
-		    (t
-		     "")))
-  (let* ((var gnus-message-archive-group)
+  (let* ((group (or group gnus-newsgroup-name))
+         (group (when group (gnus-group-decoded-name group)))
+         (var (or gnus-outgoing-message-group gnus-message-archive-group))
 	 (gcc-self-val
-	  (and gnus-newsgroup-name
-	       (not (equal gnus-newsgroup-name ""))
-	       (gnus-group-find-parameter
-		gnus-newsgroup-name 'gcc-self)))
+	  (and group (gnus-group-find-parameter group 'gcc-self)))
 	 result
 	 (groups
 	  (cond
--- a/lisp/gnus/gnus-srvr.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/gnus/gnus-srvr.el	Thu Dec 16 18:30:57 2010 -0500
@@ -766,7 +766,8 @@
       (with-current-buffer nntp-server-buffer
 	(let ((cur (current-buffer)))
 	  (goto-char (point-min))
-	  (unless (string= gnus-ignored-newsgroups "")
+         (unless (or (null gnus-ignored-newsgroups)
+                     (string= gnus-ignored-newsgroups ""))
 	    (delete-matching-lines gnus-ignored-newsgroups))
 	  ;; We treat NNTP as a special case to avoid problems with
 	  ;; garbage group names like `"foo' that appear in some badly
@@ -992,7 +993,8 @@
 		;; mechanism for new group subscription.
 		(gnus-call-subscribe-functions
 		 gnus-browse-subscribe-newsgroup-method
-		 group)))
+		 group)
+		(gnus-request-update-group-status group 'subscribe)))
 	    (delete-char 1)
 	    (insert (let ((lvl (gnus-group-level group)))
 		      (cond
--- a/lisp/gnus/gnus-start.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/gnus/gnus-start.el	Thu Dec 16 18:30:57 2010 -0500
@@ -86,14 +86,6 @@
   :group 'gnus-start
   :type '(choice file (const nil)))
 
-(defcustom gnus-default-subscribed-newsgroups nil
-  "List of newsgroups to subscribe, when a user runs Gnus the first time.
-The value should be a list of strings.
-If it is t, Gnus will not do anything special the first time it is
-started; it'll just use the normal newsgroups subscription methods."
-  :group 'gnus-start
-  :type '(choice (repeat string) (const :tag "Nothing special" t)))
-
 (defcustom gnus-use-dribble-file t
   "*Non-nil means that Gnus will use a dribble file to store user updates.
 If Emacs should crash without saving the .newsrc files, complete
@@ -341,8 +333,17 @@
   :group 'gnus-group-new
   :type 'boolean)
 
+(defcustom gnus-auto-subscribed-categories '(mail post-mail)
+  "*New groups from methods of these categories will be subscribed automatically.
+Note that this variable only deals with new groups.  It has no
+effect whatsoever on old groups.  The default is to automatically
+subscribe all groups from mail-like backends."
+  :version "24.1"
+  :group 'gnus-group-new
+  :type '(repeat symbol))
+
 (defcustom gnus-auto-subscribed-groups
-  "^nnml\\|^nnfolder\\|^nnmbox\\|^nnmh\\|^nnbabyl\\|^nnmaildir"
+  "^nnml\\|^nnfolder\\|^nnmbox\\|^nnmh\\|^nnbabyl\\|^nnmaildir\\|^nnimap"
   "*All new groups that match this regexp will be subscribed automatically.
 Note that this variable only deals with new groups.  It has no effect
 whatsoever on old groups.
@@ -644,6 +645,7 @@
     (gnus-group-change-level
      newsgroup gnus-level-default-subscribed
      gnus-level-killed (gnus-group-entry (or next "dummy.group")))
+    (gnus-request-update-group-status newsgroup 'subscribe)
     (gnus-message 5 "Subscribe newsgroup: %s" newsgroup)
     (run-hook-with-args 'gnus-subscribe-newsgroup-hooks newsgroup)
     t))
@@ -784,10 +786,9 @@
 		    (gnus-start-news-server (and arg (not level))))))
 	(if (and (not dont-connect)
 		 (not did-connect))
+	    ;; Couldn't connect to the server, so bail out.
 	    (gnus-group-quit)
 	  (gnus-run-hooks 'gnus-startup-hook)
-	  ;; NNTP server is successfully open.
-
 	  ;; Find the current startup file name.
 	  (setq gnus-current-startup-file
 		(gnus-make-newsrc-file gnus-startup-file))
@@ -797,11 +798,10 @@
 	    (gnus-dribble-read-file))
 
 	  ;; Do the actual startup.
-	  (if gnus-agent
-	      (gnus-request-create-group "queue" '(nndraft "")))
-	  (gnus-request-create-group "drafts" '(nndraft ""))
 	  (gnus-setup-news nil level dont-connect)
 	  (gnus-run-hooks 'gnus-setup-news-hook)
+	  (when gnus-agent
+	    (gnus-request-create-group "queue" '(nndraft "")))
 	  (gnus-start-draft-setup)
 	  ;; Generate the group buffer.
 	  (gnus-group-list-groups level)
@@ -816,10 +816,10 @@
   (gnus-request-create-group "drafts" '(nndraft ""))
   (unless (gnus-group-entry "nndraft:drafts")
     (let ((gnus-level-default-subscribed 1))
-      (gnus-subscribe-group "nndraft:drafts" nil '(nndraft ""))))
+      (gnus-subscribe-group "nndraft:drafts" nil '(nndraft "")))
+    (setcar (gnus-group-entry "nndraft:drafts") 0))
   (unless (equal (gnus-group-get-parameter "nndraft:drafts" 'gnus-dummy t)
 		 '((gnus-draft-mode)))
-    (gnus-message 3 "Setting up drafts group")
     (gnus-group-set-parameter
      "nndraft:drafts" 'gnus-dummy '((gnus-draft-mode)))))
 
@@ -996,27 +996,8 @@
     (when (or (null gnus-read-active-file)
 	      (eq gnus-read-active-file 'some))
       (gnus-update-active-hashtb-from-killed))
-
-    ;; Validate agent covered methods now that gnus-server-alist has
-    ;; been initialized.
-    ;; NOTE: This is here for one purpose only.  By validating the
-    ;; agentized server's, it converts the old 5.10.3, and earlier,
-    ;; format to the current format.  That enables the agent code
-    ;; within gnus-read-active-file to function correctly.
-    (if gnus-agent
-        (gnus-agent-read-servers-validate))
-
-    ;; Read the active file and create `gnus-active-hashtb'.
-    ;; If `gnus-read-active-file' is nil, then we just create an empty
-    ;; hash table.  The partial filling out of the hash table will be
-    ;; done in `gnus-get-unread-articles'.
-    (and gnus-read-active-file
-	 (not level)
-	 (gnus-read-active-file nil dont-connect))
-
     (unless gnus-active-hashtb
       (setq gnus-active-hashtb (gnus-make-hashtable 4096)))
-
     ;; Initialize the cache.
     (when gnus-use-cache
       (gnus-cache-open))
@@ -1158,6 +1139,12 @@
    ((and gnus-options-subscribe
 	 (string-match gnus-options-subscribe group))
     'subscribe)
+   ((let ((do-subscribe nil))
+      (dolist (category gnus-auto-subscribed-categories)
+	(when (gnus-member-of-valid category group)
+	  (setq do-subscribe t)))
+      do-subscribe)
+    'subscribe)
    ((and gnus-auto-subscribed-groups
 	 (string-match gnus-auto-subscribed-groups group))
     'subscribe)
--- a/lisp/gnus/gnus-sum.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/gnus/gnus-sum.el	Thu Dec 16 18:30:57 2010 -0500
@@ -60,6 +60,8 @@
 (autoload 'gnus-article-outlook-unwrap-lines "deuglify" nil t)
 (autoload 'gnus-article-outlook-repair-attribution "deuglify" nil t)
 (autoload 'gnus-article-outlook-rearrange-citation "deuglify" nil t)
+(autoload 'nnir-article-rsv "nnir" nil nil 'macro)
+(autoload 'nnir-article-group "nnir" nil nil 'macro)
 
 (defcustom gnus-kill-summary-on-exit t
   "*If non-nil, kill the summary buffer when you exit from it.
@@ -1310,7 +1312,6 @@
 (defvar gnus-article-decoded-p nil)
 (defvar gnus-article-charset nil)
 (defvar gnus-article-ignored-charsets nil)
-(defvar gnus-article-original-subject nil)
 (defvar gnus-scores-exclude-files nil)
 (defvar gnus-page-broken nil)
 
@@ -1336,7 +1337,6 @@
 (defvar gnus-current-copy-group nil)
 (defvar gnus-current-crosspost-group nil)
 (defvar gnus-newsgroup-display nil)
-(defvar gnus-newsgroup-original-name nil)
 
 (defvar gnus-newsgroup-dependencies nil)
 (defvar gnus-newsgroup-adaptive nil)
@@ -1363,6 +1363,16 @@
     (?c (or (mail-header-chars gnus-tmp-header) 0) ?d)
     (?k (gnus-summary-line-message-size gnus-tmp-header) ?s)
     (?L gnus-tmp-lines ?s)
+    (?Z (or ,(gnus-macroexpand-all
+	      '(nnir-article-rsv (mail-header-number gnus-tmp-header)))
+	    0) ?d)
+    (?G (or ,(gnus-macroexpand-all
+	      '(nnir-article-group (mail-header-number gnus-tmp-header)))
+	    "") ?s)
+    (?g (or ,(gnus-macroexpand-all
+	      '(gnus-group-short-name
+		(nnir-article-group (mail-header-number gnus-tmp-header))))
+	    "") ?s)
     (?O gnus-tmp-downloaded ?c)
     (?I gnus-tmp-indentation ?s)
     (?T (if (= gnus-tmp-level 0) "" (make-string (frame-width) ? )) ?s)
@@ -1583,6 +1593,8 @@
     gnus-newsgroup-prepared gnus-summary-highlight-line-function
     gnus-current-article gnus-current-headers gnus-have-all-headers
     gnus-last-article gnus-article-internal-prepare-hook
+    (gnus-summary-article-delete-hook . global)
+    (gnus-summary-article-move-hook . global)
     gnus-newsgroup-dependencies gnus-newsgroup-selected-overlay
     gnus-newsgroup-scored gnus-newsgroup-kill-headers
     gnus-thread-expunge-below
@@ -1903,6 +1915,7 @@
   "a" gnus-summary-post-news
   "x" gnus-summary-limit-to-unread
   "s" gnus-summary-isearch-article
+  [tab] gnus-summary-widget-forward
   "t" gnus-summary-toggle-header
   "g" gnus-summary-show-article
   "l" gnus-summary-goto-last-article
@@ -2066,6 +2079,7 @@
   "W" gnus-warp-to-article
   "g" gnus-summary-show-article
   "s" gnus-summary-isearch-article
+  [tab] gnus-summary-widget-forward
   "P" gnus-summary-print-article
   "S" gnus-sticky-article
   "M" gnus-mailing-list-insinuate
@@ -8500,6 +8514,18 @@
       (gnus-summary-limit (append gnus-newsgroup-dormant gnus-newsgroup-limit))
     (gnus-summary-position-point)))
 
+(defun gnus-summary-include-articles (articles)
+  "Fetch the headers for ARTICLES and then display the summary lines."
+  (let ((gnus-inhibit-demon t)
+	(gnus-agent nil)
+	(gnus-read-all-available-headers t))
+    (setq gnus-newsgroup-headers
+	  (gnus-merge
+	   'list gnus-newsgroup-headers
+	   (gnus-fetch-headers articles nil t)
+	   'gnus-article-sort-by-number))
+    (gnus-summary-limit (append articles gnus-newsgroup-limit))))
+
 (defun gnus-summary-limit-exclude-dormant ()
   "Hide all dormant articles."
   (interactive)
@@ -8854,7 +8880,7 @@
 	   'list gnus-newsgroup-headers
 	   (if (gnus-check-backend-function
 		'request-thread gnus-newsgroup-name)
-	       (gnus-request-thread id)
+	       (gnus-request-thread (gnus-summary-article-header))
 	     (let* ((last (if (numberp limit)
 			      (min (+ (mail-header-number
 				       (gnus-summary-article-header))
@@ -8956,8 +8982,11 @@
 
 (defun gnus-summary-enter-digest-group (&optional force)
   "Enter an nndoc group based on the current article.
-If FORCE, force a digest interpretation.  If not, try
-to guess what the document format is."
+If FORCE, force a digest interpretation.  If not, try to guess
+what the document format is.
+
+To control what happens when you exit the group, see the
+`gnus-auto-select-on-ephemeral-exit' variable."
   (interactive "P")
   (let ((conf gnus-current-window-configuration))
     (save-window-excursion
@@ -9070,6 +9099,15 @@
      (t
       (error "Couldn't select virtual nndoc group")))))
 
+(defun gnus-summary-widget-forward (arg)
+  "Move point to the next field or button in the article.
+With optional ARG, move across that many fields."
+  (interactive "p")
+  (gnus-summary-select-article)
+  (gnus-configure-windows 'article)
+  (select-window (gnus-get-buffer-window gnus-article-buffer))
+  (widget-forward arg))
+
 (defun gnus-summary-isearch-article (&optional regexp-p)
   "Do incremental search forward on the current article.
 If REGEXP-P (the prefix) is non-nil, do regexp isearch."
@@ -9440,6 +9478,9 @@
    ((or (equal arg '(16))
 	(eq arg t))
     ;; C-u C-u g
+    (let ((gnus-inhibit-article-treatments t))
+      (gnus-summary-select-article nil 'force)))
+   (t
     ;; We have to require this here to make sure that the following
     ;; dynamic binding isn't shadowed by autoloading.
     (require 'gnus-async)
@@ -9457,9 +9498,6 @@
 	  ;; Set it to nil for safety reason.
 	  (setq gnus-article-mime-handle-alist nil)
 	  (setq gnus-article-mime-handles nil)))
-      (gnus-summary-select-article nil 'force)))
-   (t
-    (let ((gnus-inhibit-article-treatments t))
       (gnus-summary-select-article nil 'force))))
   (gnus-summary-goto-subject gnus-current-article)
   (gnus-summary-position-point))
@@ -9705,210 +9743,206 @@
 		  articles)
     (while articles
       (setq article (pop articles))
-      (let ((gnus-newsgroup-original-name gnus-newsgroup-name)
-	    (gnus-article-original-subject
-	     (mail-header-subject
-	      (gnus-data-header (assoc article (gnus-data-list nil))))))
-	(setq
-	 art-group
-	 (cond
-	  ;; Move the article.
-	  ((eq action 'move)
-	   ;; Remove this article from future suppression.
-	   (gnus-dup-unsuppress-article article)
-	   (let* ((from-method (gnus-find-method-for-group
-				gnus-newsgroup-name))
-		  (to-method (or select-method
-				 (gnus-find-method-for-group to-newsgroup)))
-		  (move-is-internal (gnus-server-equal from-method to-method)))
-	     (gnus-request-move-article
-	      article			; Article to move
-	      gnus-newsgroup-name	; From newsgroup
-	      (nth 1 (gnus-find-method-for-group
-		      gnus-newsgroup-name)) ; Server
-	      (list 'gnus-request-accept-article
-		    to-newsgroup (list 'quote select-method)
-		    (not articles) t)	; Accept form
-	      (not articles)		; Only save nov last time
-	      (and move-is-internal
-		   to-newsgroup		; Not respooling
+      ;; Set any marks that may have changed in the summary buffer.
+      (when gnus-preserve-marks
+	(gnus-summary-push-marks-to-backend article))
+      (setq
+       art-group
+       (cond
+	;; Move the article.
+	((eq action 'move)
+	 ;; Remove this article from future suppression.
+	 (gnus-dup-unsuppress-article article)
+	 (let* ((from-method (gnus-find-method-for-group
+			      gnus-newsgroup-name))
+		(to-method (or select-method
+			       (gnus-find-method-for-group to-newsgroup)))
+		(move-is-internal (gnus-server-equal from-method to-method)))
+	   (gnus-request-move-article
+	    article			; Article to move
+	    gnus-newsgroup-name         ; From newsgroup
+	    (nth 1 (gnus-find-method-for-group
+		    gnus-newsgroup-name)) ; Server
+	    (list 'gnus-request-accept-article
+		  to-newsgroup (list 'quote select-method)
+		  (not articles) t)	; Accept form
+	    (not articles)		; Only save nov last time
+	    (and move-is-internal
+		 to-newsgroup		; Not respooling
 					; Is this move internal?
-		   (gnus-group-real-name to-newsgroup)))))
-	  ;; Copy the article.
-	  ((eq action 'copy)
+		 (gnus-group-real-name to-newsgroup)))))
+	;; Copy the article.
+	((eq action 'copy)
+	 (with-current-buffer copy-buf
+	   (when (gnus-request-article-this-buffer article
+						   gnus-newsgroup-name)
+	     (save-restriction
+	       (nnheader-narrow-to-headers)
+	       (dolist (hdr gnus-copy-article-ignored-headers)
+		 (message-remove-header hdr t)))
+	     (gnus-request-accept-article
+	      to-newsgroup select-method (not articles) t))))
+	;; Crosspost the article.
+	((eq action 'crosspost)
+	 (let ((xref (message-tokenize-header
+		      (mail-header-xref (gnus-summary-article-header
+					 article))
+		      " ")))
+	   (setq new-xref (concat (gnus-group-real-name gnus-newsgroup-name)
+				  ":" (number-to-string article)))
+	   (unless xref
+	     (setq xref (list (system-name))))
+	   (setq new-xref
+		 (concat
+		  (mapconcat 'identity
+			     (delete "Xref:" (delete new-xref xref))
+			     " ")
+		  " " new-xref))
 	   (with-current-buffer copy-buf
-	     (when (gnus-request-article-this-buffer article
-						     gnus-newsgroup-name)
-	       (save-restriction
-		 (nnheader-narrow-to-headers)
-		 (dolist (hdr gnus-copy-article-ignored-headers)
-		   (message-remove-header hdr t)))
-	       (gnus-request-accept-article
-		to-newsgroup select-method (not articles) t))))
-	  ;; Crosspost the article.
-	  ((eq action 'crosspost)
-	   (let ((xref (message-tokenize-header
-			(mail-header-xref (gnus-summary-article-header
-					   article))
-			" ")))
-	     (setq new-xref (concat (gnus-group-real-name gnus-newsgroup-name)
-				    ":" (number-to-string article)))
-	     (unless xref
-	       (setq xref (list (system-name))))
-	     (setq new-xref
-		   (concat
-		    (mapconcat 'identity
-			       (delete "Xref:" (delete new-xref xref))
-			       " ")
-		    " " new-xref))
-	     (with-current-buffer copy-buf
-	       ;; First put the article in the destination group.
-	       (gnus-request-article-this-buffer article gnus-newsgroup-name)
-	       (when (consp (setq art-group
-				  (gnus-request-accept-article
-				   to-newsgroup select-method (not articles)
-				   t)))
-		 (setq new-xref (concat new-xref " " (car art-group)
-					":"
-					(number-to-string (cdr art-group))))
-		 ;; Now we have the new Xrefs header, so we insert
-		 ;; it and replace the new article.
-		 (nnheader-replace-header "Xref" new-xref)
-		 (gnus-request-replace-article
-		  (cdr art-group) to-newsgroup (current-buffer) t)
-		 art-group))))))
-	(cond
-	 ((not art-group)
-	  (gnus-message 1 "Couldn't %s article %s: %s"
-			(cadr (assq action names)) article
-			(nnheader-get-report (car to-method))))
-	 ((eq art-group 'junk)
-	  (when (eq action 'move)
-	    (gnus-summary-mark-article article gnus-canceled-mark)
-	    (gnus-message 4 "Deleted article %s" article)
-	    ;; run the delete hook
-	    (run-hook-with-args 'gnus-summary-article-delete-hook
-				action
-				(gnus-data-header
-				 (assoc article (gnus-data-list nil)))
-				gnus-newsgroup-original-name nil
-				select-method)))
-	 (t
-	  (let* ((pto-group (gnus-group-prefixed-name
-			     (car art-group) to-method))
-		 (info (gnus-get-info pto-group))
-		 (to-group (gnus-info-group info))
-		 to-marks)
-	    ;; Update the group that has been moved to.
-	    (when (and info
-		       (memq action '(move copy)))
-	      (unless (member to-group to-groups)
-		(push to-group to-groups))
-
-	      (unless (memq article gnus-newsgroup-unreads)
-		(push 'read to-marks)
-		(gnus-info-set-read
-		 info (gnus-add-to-range (gnus-info-read info)
-					 (list (cdr art-group)))))
-
-	      ;; See whether the article is to be put in the cache.
-	      (let* ((expirable (gnus-group-auto-expirable-p to-group))
-		     (marks (if expirable
-				gnus-article-mark-lists
-			      (delete '(expirable . expire)
-				      (copy-sequence
-				       gnus-article-mark-lists))))
-		     (to-article (cdr art-group)))
-
-		;; Enter the article into the cache in the new group,
-		;; if that is required.
-		(when gnus-use-cache
-		  (gnus-cache-possibly-enter-article
-		   to-group to-article
-		   (memq article gnus-newsgroup-marked)
-		   (memq article gnus-newsgroup-dormant)
-		   (memq article gnus-newsgroup-unreads)))
-
-		(when gnus-preserve-marks
-		  ;; Copy any marks over to the new group.
-		  (when (and (equal to-group gnus-newsgroup-name)
-			     (not (memq article gnus-newsgroup-unreads)))
-		    ;; Mark this article as read in this group.
-		    (push (cons to-article gnus-read-mark)
-			  gnus-newsgroup-reads)
-		    ;; Increase the active status of this group.
-		    (setcdr (gnus-active to-group) to-article)
-		    (setcdr gnus-newsgroup-active to-article))
-
-		  (while marks
-		    (when (eq (gnus-article-mark-to-type (cdar marks)) 'list)
-		      (when (memq article (symbol-value
-					   (intern (format "gnus-newsgroup-%s"
-							   (caar marks)))))
-			(push (cdar marks) to-marks)
-			;; If the other group is the same as this group,
-			;; then we have to add the mark to the list.
-			(when (equal to-group gnus-newsgroup-name)
-			  (set (intern (format "gnus-newsgroup-%s"
-					       (caar marks)))
-			       (cons to-article
-				     (symbol-value
-				      (intern (format "gnus-newsgroup-%s"
-						      (caar marks)))))))
-			;; Copy the marks to other group.
-			(gnus-add-marked-articles
-			 to-group (cdar marks) (list to-article) info)))
-		    (setq marks (cdr marks)))
-
-		  (when (and expirable
-			     gnus-mark-copied-or-moved-articles-as-expirable
-			     (not (memq 'expire to-marks)))
-		    ;; Mark this article as expirable.
-		    (push 'expire to-marks)
-		    (when (equal to-group gnus-newsgroup-name)
-		      (push to-article gnus-newsgroup-expirable))
-		    ;; Copy the expirable mark to other group.
-		    (gnus-add-marked-articles
-		     to-group 'expire (list to-article) info))
-
-		  (when to-marks
-		    (gnus-request-set-mark
-		     to-group (list (list (list to-article) 'add to-marks)))))
-
-		(gnus-dribble-enter
-		 (concat "(gnus-group-set-info '"
-			 (gnus-prin1-to-string (gnus-get-info to-group))
-			 ")"))))
-
-	    ;; Update the Xref header in this article to point to
-	    ;; the new crossposted article we have just created.
-	    (when (eq action 'crosspost)
-	      (with-current-buffer copy-buf
-		(gnus-request-article-this-buffer article gnus-newsgroup-name)
-		(nnheader-replace-header "Xref" new-xref)
-		(gnus-request-replace-article
-		 article gnus-newsgroup-name (current-buffer) t)))
-
-	    ;; run the move/copy/crosspost/respool hook
-	    (let ((header (gnus-data-header
-			   (assoc article (gnus-data-list nil)))))
-	      (mail-header-set-subject header gnus-article-original-subject)
-	      (run-hook-with-args 'gnus-summary-article-move-hook
-				  action
-				  (gnus-data-header
-				   (assoc article (gnus-data-list nil)))
-				  gnus-newsgroup-original-name
-				  to-newsgroup
-				  select-method)))
-
-	  ;;;!!!Why is this necessary?
-	  (set-buffer gnus-summary-buffer)
-
-	  (when (eq action 'move)
-	    (save-excursion
-	      (gnus-summary-goto-subject article)
-	      (gnus-summary-mark-article article gnus-canceled-mark)))))
-	(push article articles-to-update-marks)))
+	     ;; First put the article in the destination group.
+	     (gnus-request-article-this-buffer article gnus-newsgroup-name)
+	     (when (consp (setq art-group
+				(gnus-request-accept-article
+				 to-newsgroup select-method (not articles)
+				 t)))
+	       (setq new-xref (concat new-xref " " (car art-group)
+				      ":"
+				      (number-to-string (cdr art-group))))
+	       ;; Now we have the new Xrefs header, so we insert
+	       ;; it and replace the new article.
+	       (nnheader-replace-header "Xref" new-xref)
+	       (gnus-request-replace-article
+		(cdr art-group) to-newsgroup (current-buffer) t)
+	       art-group))))))
+      (cond
+       ((not art-group)
+	(gnus-message 1 "Couldn't %s article %s: %s"
+		      (cadr (assq action names)) article
+		      (nnheader-get-report (car to-method))))
+       ((eq art-group 'junk)
+	(when (eq action 'move)
+	  (gnus-summary-mark-article article gnus-canceled-mark)
+	  (gnus-message 4 "Deleted article %s" article)
+	  ;; run the delete hook
+	  (run-hook-with-args 'gnus-summary-article-delete-hook
+			      action
+			      (gnus-data-header
+			       (assoc article (gnus-data-list nil)))
+			      gnus-newsgroup-name nil
+			      select-method)))
+       (t
+	(let* ((pto-group (gnus-group-prefixed-name
+			   (car art-group) to-method))
+	       (info (gnus-get-info pto-group))
+	       (to-group (gnus-info-group info))
+	       to-marks)
+	  ;; Update the group that has been moved to.
+	  (when (and info
+		     (memq action '(move copy)))
+	    (unless (member to-group to-groups)
+	      (push to-group to-groups))
+
+	    (unless (memq article gnus-newsgroup-unreads)
+	      (push 'read to-marks)
+	      (gnus-info-set-read
+	       info (gnus-add-to-range (gnus-info-read info)
+				       (list (cdr art-group)))))
+
+	    ;; See whether the article is to be put in the cache.
+	    (let* ((expirable (gnus-group-auto-expirable-p to-group))
+		   (marks (if expirable
+			      gnus-article-mark-lists
+			    (delete '(expirable . expire)
+				    (copy-sequence
+				     gnus-article-mark-lists))))
+		   (to-article (cdr art-group)))
+
+	      ;; Enter the article into the cache in the new group,
+	      ;; if that is required.
+	      (when gnus-use-cache
+		(gnus-cache-possibly-enter-article
+		 to-group to-article
+		 (memq article gnus-newsgroup-marked)
+		 (memq article gnus-newsgroup-dormant)
+		 (memq article gnus-newsgroup-unreads)))
+
+	      (when gnus-preserve-marks
+		;; Copy any marks over to the new group.
+		(when (and (equal to-group gnus-newsgroup-name)
+			   (not (memq article gnus-newsgroup-unreads)))
+		  ;; Mark this article as read in this group.
+		  (push (cons to-article gnus-read-mark)
+			gnus-newsgroup-reads)
+		  ;; Increase the active status of this group.
+		  (setcdr (gnus-active to-group) to-article)
+		  (setcdr gnus-newsgroup-active to-article))
+
+		(while marks
+		  (when (eq (gnus-article-mark-to-type (cdar marks)) 'list)
+		    (when (memq article (symbol-value
+					 (intern (format "gnus-newsgroup-%s"
+							 (caar marks)))))
+		      (push (cdar marks) to-marks)
+		      ;; If the other group is the same as this group,
+		      ;; then we have to add the mark to the list.
+		      (when (equal to-group gnus-newsgroup-name)
+			(set (intern (format "gnus-newsgroup-%s"
+					     (caar marks)))
+			     (cons to-article
+				   (symbol-value
+				    (intern (format "gnus-newsgroup-%s"
+						    (caar marks)))))))
+		      ;; Copy the marks to other group.
+		      (gnus-add-marked-articles
+		       to-group (cdar marks) (list to-article) info)))
+		  (setq marks (cdr marks)))
+
+		(when (and expirable
+			   gnus-mark-copied-or-moved-articles-as-expirable
+			   (not (memq 'expire to-marks)))
+		  ;; Mark this article as expirable.
+		  (push 'expire to-marks)
+		  (when (equal to-group gnus-newsgroup-name)
+		    (push to-article gnus-newsgroup-expirable))
+		  ;; Copy the expirable mark to other group.
+		  (gnus-add-marked-articles
+		   to-group 'expire (list to-article) info))
+
+		(when to-marks
+		  (gnus-request-set-mark
+		   to-group (list (list (list to-article) 'add to-marks)))))
+
+	      (gnus-dribble-enter
+	       (concat "(gnus-group-set-info '"
+		       (gnus-prin1-to-string (gnus-get-info to-group))
+		       ")"))))
+
+	  ;; Update the Xref header in this article to point to
+	  ;; the new crossposted article we have just created.
+	  (when (eq action 'crosspost)
+	    (with-current-buffer copy-buf
+	      (gnus-request-article-this-buffer article gnus-newsgroup-name)
+	      (nnheader-replace-header "Xref" new-xref)
+	      (gnus-request-replace-article
+	       article gnus-newsgroup-name (current-buffer) t)))
+
+	  ;; run the move/copy/crosspost/respool hook
+	  (run-hook-with-args 'gnus-summary-article-move-hook
+			      action
+			      (gnus-data-header
+			       (assoc article (gnus-data-list nil)))
+			      gnus-newsgroup-name
+			      to-newsgroup
+			      select-method))
+
+        ;;;!!!Why is this necessary?
+	(set-buffer gnus-summary-buffer)
+
+	(when (eq action 'move)
+	  (save-excursion
+	    (gnus-summary-goto-subject article)
+	    (gnus-summary-mark-article article gnus-canceled-mark)))))
+      (push article articles-to-update-marks))
 
     (save-excursion
       (apply 'gnus-summary-remove-process-mark articles-to-update-marks))
@@ -9921,6 +9955,20 @@
     (gnus-summary-position-point)
     (gnus-set-mode-line 'summary)))
 
+(defun gnus-summary-push-marks-to-backend (article)
+  (let ((set nil)
+	(marks gnus-article-mark-lists))
+    (unless (memq article gnus-newsgroup-unreads)
+      (push 'read set))
+    (while marks
+      (when (and (eq (gnus-article-mark-to-type (cdar marks)) 'list)
+		 (memq article (symbol-value
+				(intern (format "gnus-newsgroup-%s"
+						(caar marks))))))
+	(push (cdar marks) set))
+      (pop marks))
+    (gnus-request-set-mark gnus-newsgroup-name `(((,article) set ,set)))))
+
 (defun gnus-summary-copy-article (&optional n to-newsgroup select-method)
   "Copy the current article to some other group.
 If TO-NEWSGROUP is string, do not prompt for a newsgroup to copy to.
@@ -9959,7 +10007,7 @@
 latter case, they will be copied into the relevant groups."
   (interactive
    (list current-prefix-arg
-	 (let* ((methods (gnus-methods-using 'respool))
+	 (let* ((methods (mapcar #'car (gnus-methods-using 'respool)))
 		(methname
 		 (symbol-name (or gnus-summary-respool-default-method
 				  (car (gnus-find-method-for-group
@@ -10173,13 +10221,13 @@
 	  ;; The backend might not have been able to delete the article
 	  ;; after all.
 	  (unless (memq (car articles) not-deleted)
-	    (gnus-summary-mark-article (car articles) gnus-canceled-mark))
-	  (let* ((article (car articles))
-		 (ghead  (gnus-data-header
-			  (assoc article (gnus-data-list nil)))))
-	    (run-hook-with-args 'gnus-summary-article-delete-hook
-				'delete ghead gnus-newsgroup-name nil
-				nil))
+	    (gnus-summary-mark-article (car articles) gnus-canceled-mark)
+	    (let* ((article (car articles))
+		   (ghead  (gnus-data-header
+			    (assoc article (gnus-data-list nil)))))
+	      (run-hook-with-args 'gnus-summary-article-delete-hook
+				  'delete ghead gnus-newsgroup-name nil
+				  nil)))
 	  (setq articles (cdr articles))))
       (when not-deleted
 	(gnus-message 4 "Couldn't delete articles %s" not-deleted)))
@@ -11232,6 +11280,7 @@
 		  (mail-header-subject (gnus-data-header (car data)))))
 		(t nil)))
 	 (end-point (save-excursion
+		      (goto-char (gnus-data-pos (car data)))
 		      (if (gnus-summary-go-to-next-thread)
 			  (point) (point-max))))
 	 articles)
--- a/lisp/gnus/gnus-util.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/gnus/gnus-util.el	Thu Dec 16 18:30:57 2010 -0500
@@ -902,6 +902,7 @@
 
 (defun gnus-write-buffer (file)
   "Write the current buffer's contents to FILE."
+  (require 'nnmail)
   (let ((file-name-coding-system nnmail-pathname-coding-system))
     ;; Make sure the directory exists.
     (gnus-make-directory (file-name-directory file))
@@ -1137,6 +1138,7 @@
 FILENAME exists and is Babyl format."
   (require 'rmail)
   (require 'mm-util)
+  (require 'nnmail)
   ;; Some of this codes is borrowed from rmailout.el.
   (setq filename (expand-file-name filename))
   ;; FIXME should we really be messing with this defcustom?
@@ -1228,6 +1230,7 @@
 
 (defun gnus-output-to-mail (filename &optional ask)
   "Append the current article to a mail file named FILENAME."
+  (require 'nnmail)
   (setq filename (expand-file-name filename))
   (let ((artbuf (current-buffer))
 	(tmpbuf (get-buffer-create " *Gnus-output*")))
@@ -2034,6 +2037,27 @@
     (save-match-data
       (string-match regexp string start))))
 
+(eval-and-compile
+  (if (fboundp 'macroexpand-all)
+      (defalias 'gnus-macroexpand-all 'macroexpand-all)
+    (defun gnus-macroexpand-all (form &optional environment)
+      "Return result of expanding macros at all levels in FORM.
+If no macros are expanded, FORM is returned unchanged.
+The second optional arg ENVIRONMENT specifies an environment of macro
+definitions to shadow the loaded ones for use in file byte-compilation."
+      (if (consp form)
+	  (let ((idx 1)
+		(len (length (setq form (copy-sequence form))))
+		expanded)
+	    (while (< idx len)
+	      (setcar (nthcdr idx form) (gnus-macroexpand-all (nth idx form)
+							      environment))
+	      (setq idx (1+ idx)))
+	    (if (eq (setq expanded (macroexpand form environment)) form)
+		form
+	      (gnus-macroexpand-all expanded environment)))
+	form))))
+
 (provide 'gnus-util)
 
 ;;; gnus-util.el ends here
--- a/lisp/gnus/gnus-win.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/gnus/gnus-win.el	Thu Dec 16 18:30:57 2010 -0500
@@ -228,50 +228,6 @@
     (pop list))
   (cadr (assq (car list) gnus-window-configuration)))
 
-(defun gnus-windows-old-to-new (setting)
-  ;; First we take care of the really, really old Gnus 3 actions.
-  (when (symbolp setting)
-    (setq setting
-	  ;; Take care of ooold GNUS 3.x values.
-	  (cond ((eq setting 'SelectArticle) 'article)
-		((memq setting '(SelectNewsgroup SelectSubject ExpandSubject))
-		 'summary)
-		((memq setting '(ExitNewsgroup)) 'group)
-		(t setting))))
-  (if (or (listp setting)
-	  (not (and gnus-window-configuration
-		    (memq setting '(group summary article)))))
-      setting
-    (let* ((elem
-	    (cond
-	     ((eq setting 'group)
-	      (gnus-window-configuration-element
-	       '(group newsgroups ExitNewsgroup)))
-	     ((eq setting 'summary)
-	      (gnus-window-configuration-element
-	       '(summary SelectNewsgroup SelectSubject ExpandSubject)))
-	     ((eq setting 'article)
-	      (gnus-window-configuration-element
-	       '(article SelectArticle)))))
-	   (total (apply '+ elem))
-	   (types '(group summary article))
-	   (pbuf (if (eq setting 'newsgroups) 'group 'summary))
-	   (i 0)
-	   perc out)
-      (while (< i 3)
-	(or (not (numberp (nth i elem)))
-	    (zerop (nth i elem))
-	    (progn
-	      (setq perc (if (= i 2)
-			     1.0
-			   (/ (float (nth i elem)) total)))
-	      (push (if (eq pbuf (nth i types))
-			(list (nth i types) perc 'point)
-		      (list (nth i types) perc))
-		    out)))
-	(incf i))
-      `(vertical 1.0 ,@(nreverse out)))))
-
 ;;;###autoload
 (defun gnus-add-configuration (conf)
   "Add the window configuration CONF to `gnus-buffer-configuration'."
@@ -293,18 +249,9 @@
 
 (defun gnus-configure-frame (split &optional window)
   "Split WINDOW according to SPLIT."
-  (let ((current-window
-	 (or (get-buffer-window (current-buffer)) (selected-window))))
-    (unless window
-      (setq window current-window))
+  (let* ((current-window (or (get-buffer-window (current-buffer)) (selected-window)))
+         (window (or window current-window)))
     (select-window window)
-    ;; This might be an old-style buffer config.
-    (when (vectorp split)
-      (setq split (append split nil)))
-    (when (or (consp (car split))
-	      (vectorp (car split)))
-      (push 1.0 split)
-      (push 'vertical split))
     ;; The SPLIT might be something that is to be evaled to
     ;; return a new SPLIT.
     (while (and (not (assq (car split) gnus-window-to-buffer))
@@ -423,56 +370,55 @@
       (set-window-configuration setting)
     (setq gnus-current-window-configuration setting)
     (setq force (or force gnus-always-force-window-configuration))
-    (setq setting (gnus-windows-old-to-new setting))
     (let ((split (if (symbolp setting)
-		     (cadr (assq setting gnus-buffer-configuration))
-		   setting))
-	  all-visible)
+                     (cadr (assq setting gnus-buffer-configuration))
+                   setting))
+          all-visible)
 
       (setq gnus-frame-split-p nil)
 
       (unless split
-	(error "No such setting in `gnus-buffer-configuration': %s" setting))
+        (error "No such setting in `gnus-buffer-configuration': %s" setting))
 
       (if (and (setq all-visible (gnus-all-windows-visible-p split))
-	       (not force))
-	  ;; All the windows mentioned are already visible, so we just
-	  ;; put point in the assigned buffer, and do not touch the
-	  ;; winconf.
-	  (select-window all-visible)
+               (not force))
+          ;; All the windows mentioned are already visible, so we just
+          ;; put point in the assigned buffer, and do not touch the
+          ;; winconf.
+          (select-window all-visible)
 
-	;; Make sure "the other" buffer, nntp-server-buffer, is live.
-	(unless (gnus-buffer-live-p nntp-server-buffer)
-	  (nnheader-init-server-buffer))
+        ;; Make sure "the other" buffer, nntp-server-buffer, is live.
+        (unless (gnus-buffer-live-p nntp-server-buffer)
+          (nnheader-init-server-buffer))
 
-	;; Either remove all windows or just remove all Gnus windows.
-	(let ((frame (selected-frame)))
-	  (unwind-protect
-	      (if gnus-use-full-window
-		  ;; We want to remove all other windows.
-		  (if (not gnus-frame-split-p)
-		      ;; This is not a `frame' split, so we ignore the
-		      ;; other frames.
-		      (delete-other-windows)
-		  ;; This is a `frame' split, so we delete all windows
-		    ;; on all frames.
-		    (gnus-delete-windows-in-gnusey-frames))
-		;; Just remove some windows.
-		(gnus-remove-some-windows)
-		(if (featurep 'xemacs)
-		    (switch-to-buffer nntp-server-buffer)
-		  (set-buffer nntp-server-buffer)))
-	    (select-frame frame)))
+        ;; Either remove all windows or just remove all Gnus windows.
+        (let ((frame (selected-frame)))
+          (unwind-protect
+              (if gnus-use-full-window
+                  ;; We want to remove all other windows.
+                  (if (not gnus-frame-split-p)
+                      ;; This is not a `frame' split, so we ignore the
+                      ;; other frames.
+                      (delete-other-windows)
+                    ;; This is a `frame' split, so we delete all windows
+                    ;; on all frames.
+                    (gnus-delete-windows-in-gnusey-frames))
+                ;; Just remove some windows.
+                (gnus-remove-some-windows)
+                (if (featurep 'xemacs)
+                    (switch-to-buffer nntp-server-buffer)
+                  (set-buffer nntp-server-buffer)))
+            (select-frame frame)))
 
-	(let (gnus-window-frame-focus)
-	  (if (featurep 'xemacs)
-	      (switch-to-buffer nntp-server-buffer)
-	    (set-buffer nntp-server-buffer))
-	  (gnus-configure-frame split)
-	  (run-hooks 'gnus-configure-windows-hook)
-	  (when gnus-window-frame-focus
-	    (gnus-select-frame-set-input-focus
-	     (window-frame gnus-window-frame-focus))))))))
+        (let (gnus-window-frame-focus)
+          (if (featurep 'xemacs)
+              (switch-to-buffer nntp-server-buffer)
+            (set-buffer nntp-server-buffer))
+          (gnus-configure-frame split)
+          (run-hooks 'gnus-configure-windows-hook)
+          (when gnus-window-frame-focus
+            (gnus-select-frame-set-input-focus
+             (window-frame gnus-window-frame-focus))))))))
 
 (defun gnus-delete-windows-in-gnusey-frames ()
   "Do a `delete-other-windows' in all frames that have Gnus windows."
--- a/lisp/gnus/gnus.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/gnus/gnus.el	Thu Dec 16 18:30:57 2010 -0500
@@ -1401,10 +1401,6 @@
 		 string))
 (make-obsolete-variable 'gnus-local-domain nil "Emacs 24.1")
 
-(defvar gnus-local-organization nil
-  "String with a description of what organization (if any) the user belongs to.
-Obsolete variable; use `message-user-organization' instead.")
-
 ;; Customization variables
 
 (defcustom gnus-refer-article-method 'current
@@ -1612,7 +1608,7 @@
     ("nnweb" none)
     ("nnrss" none)
     ("nnagent" post-mail)
-    ("nnimap" post-mail address prompt-address physical-address)
+    ("nnimap" post-mail address prompt-address physical-address respool)
     ("nnmaildir" mail respool address)
     ("nnnil" none))
   "*An alist of valid select methods.
--- a/lisp/gnus/message.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/gnus/message.el	Thu Dec 16 18:30:57 2010 -0500
@@ -161,7 +161,7 @@
   :type 'regexp)
 
 (defcustom message-from-style mail-from-style
-  "*Specifies how \"From\" headers look.
+  "Specifies how \"From\" headers look.
 
 If nil, they contain just the return address like:
 	king@grassland.com
@@ -277,7 +277,7 @@
 		 regexp))
 
 (defcustom message-ignored-mail-headers
-  "^[GF]cc:\\|^Resent-Fcc:\\|^Xref:\\|^X-Draft-From:\\|^X-Gnus-Agent-Meta-Information:"
+  "^\\([GF]cc\\|Resent-Fcc\\|Xref\\|X-Draft-From\\|X-Gnus-Agent-Meta-Information\\):"
   "*Regexp of headers to be removed unconditionally before mailing."
   :group 'message-mail
   :group 'message-headers
@@ -507,14 +507,9 @@
   :group 'message-buffers
   :type 'boolean)
 
-(defvar gnus-local-organization)
 (defcustom message-user-organization
-  (or (and (boundp 'gnus-local-organization)
-	   (stringp gnus-local-organization)
-	   gnus-local-organization)
-      (getenv "ORGANIZATION")
-      t)
-  "*String to be used as an Organization header.
+  (or (getenv "ORGANIZATION") t)
+  "String to be used as an Organization header.
 If t, use `message-user-organization-file'."
   :group 'message-headers
   :type '(choice string
@@ -2919,6 +2914,7 @@
 	  (mail-aliases-setup))))
    ((message-mail-alias-type-p 'ecomplete)
     (ecomplete-setup)))
+  (add-hook 'completion-at-point-functions 'message-completion-function nil t)
   (unless buffer-file-name
     (message-set-auto-save-file-name))
   (unless (buffer-base-buffer)
@@ -3047,10 +3043,22 @@
   (interactive)
   (message-position-on-field "Summary" "Subject"))
 
-(defun message-goto-body (&optional interactivep)
+(eval-when-compile
+  (defmacro message-called-interactively-p (kind)
+    (condition-case nil
+	(progn
+	  (eval '(called-interactively-p 'any))
+	  ;; Emacs >=23.2
+	  `(called-interactively-p ,kind))
+      ;; Emacs <23.2
+      (wrong-number-of-arguments '(called-interactively-p))
+      ;; XEmacs
+      (void-function '(interactive-p)))))
+
+(defun message-goto-body ()
   "Move point to the beginning of the message body."
-  (interactive (list t))
-  (when (and interactivep
+  (interactive)
+  (when (and (message-called-interactively-p 'any)
 	     (looking-at "[ \t]*\n"))
     (expand-abbrev))
   (goto-char (point-min))
@@ -3059,7 +3067,7 @@
 
 (defun message-in-body-p ()
   "Return t if point is in the message body."
-  (let ((body (save-excursion (message-goto-body) (point))))
+  (let ((body (save-excursion (message-goto-body))))
     (>= (point) body)))
 
 (defun message-goto-eoh ()
@@ -4253,9 +4261,10 @@
   ;; FIXME: How about "foo@subdomain", when the MTA adds ".domain.tld"?
   (let (found)
     (mapc (lambda (address)
-	    (setq address (cadr address))
+	    (setq address (or (cadr address) ""))
 	    (when
-		(or (not
+		(or (string= "" address)
+                    (not
 		     (or
 		      (not (string-match "@" address))
 		      (string-match
@@ -4269,7 +4278,7 @@
 					       "\\|")
 				  message-bogus-addresses)))
 			   (string-match re address))))
-			 (push address found)))
+              (push address found)))
 	  ;;
 	  (mail-extract-address-components recipients t))
     found))
@@ -7736,7 +7745,7 @@
   :type '(alist :key-type regexp :value-type function))
 
 (defcustom message-expand-name-databases
-  (list 'bbdb 'eudc)
+  '(bbdb eudc)
   "List of databases to try for name completion (`message-expand-name').
 Each element is a symbol and can be `bbdb' or `eudc'."
   :group 'message
@@ -7758,15 +7767,25 @@
 Execute function specified by `message-tab-body-function' when not in
 those headers."
   (interactive)
+  (cond
+   ((if (and (boundp 'completion-fail-discreetly)
+             (fboundp 'completion-at-point))
+        (let ((completion-fail-discreetly t)) (completion-at-point))
+      (funcall (or (message-completion-function) #'ignore)))
+    ;; Completion was performed; nothing else to do.
+    nil)
+   (message-tab-body-function (funcall message-tab-body-function))
+   (t (funcall (or (lookup-key text-mode-map "\t")
+                   (lookup-key global-map "\t")
+                   'indent-relative)))))
+
+(defun message-completion-function ()
   (let ((alist message-completion-alist))
     (while (and alist
 		(let ((mail-abbrev-mode-regexp (caar alist)))
 		  (not (mail-abbrev-in-expansion-header-p))))
       (setq alist (cdr alist)))
-    (funcall (or (cdar alist) message-tab-body-function
-		 (lookup-key text-mode-map "\t")
-		 (lookup-key global-map "\t")
-		 'indent-relative))))
+    (cdar alist)))
 
 (eval-and-compile
   (condition-case nil
--- a/lisp/gnus/mm-decode.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/gnus/mm-decode.el	Thu Dec 16 18:30:57 2010 -0500
@@ -1699,7 +1699,7 @@
 				  (when handle
 				    (mm-with-part handle
 				      (buffer-string))))))
-	shr-inhibit-images shr-blocked-images charset)
+	shr-inhibit-images shr-blocked-images charset char)
     (if (and (boundp 'gnus-summary-buffer)
 	     (buffer-name gnus-summary-buffer))
 	(with-current-buffer gnus-summary-buffer
@@ -1714,13 +1714,25 @@
       (narrow-to-region (point) (point))
       (shr-insert-document
        (mm-with-part handle
-	 (when (and charset
-		    (setq charset (mm-charset-to-coding-system charset))
-		    (not (eq charset 'ascii)))
-	   (insert (prog1
-		       (mm-decode-coding-string (buffer-string) charset)
-		     (erase-buffer)
-		     (mm-enable-multibyte))))
+	 (insert (prog1
+		     (if (and charset
+			      (setq charset
+				    (mm-charset-to-coding-system charset))
+			      (not (eq charset 'ascii)))
+			 (mm-decode-coding-string (buffer-string) charset)
+		       (mm-string-as-multibyte (buffer-string)))
+		   (erase-buffer)
+		   (mm-enable-multibyte)))
+	 (goto-char (point-min))
+	 (setq case-fold-search t)
+	 (while (re-search-forward
+		 "&#\\(?:x\\([89][0-9a-f]\\)\\|\\(1[2-5][0-9]\\)\\);" nil t)
+	   (when (setq char
+		       (cdr (assq (if (match-beginning 1)
+				      (string-to-number (match-string 1) 16)
+				    (string-to-number (match-string 2)))
+				  mm-extra-numeric-entities)))
+	     (replace-match (char-to-string char))))
 	 (libxml-parse-html-region (point-min) (point-max))))
       (mm-handle-set-undisplayer
        handle
--- a/lisp/gnus/mm-extern.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/gnus/mm-extern.el	Thu Dec 16 18:30:57 2010 -0500
@@ -1,7 +1,7 @@
 ;;; mm-extern.el --- showing message/external-body
 
-;; Copyright (C) 2000, 2001, 2002, 2003, 2004,
-;;   2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+;; Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
+;;   2009, 2010  Free Software Foundation, Inc.
 
 ;; Author: Shenghuo Zhu <zsh@cs.rochester.edu>
 ;; Keywords: message external-body
@@ -91,7 +91,7 @@
   (let (mm-extern-anonymous)
     (mm-extern-anon-ftp handle)))
 
-(declare-function message-goto-body "message" (&optional interactivep))
+(declare-function message-goto-body "message" ())
 
 (defun mm-extern-mail-server (handle)
   (require 'message)
--- a/lisp/gnus/mm-url.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/gnus/mm-url.el	Thu Dec 16 18:30:57 2010 -0500
@@ -365,16 +365,19 @@
 (defun mm-url-decode-entities ()
   "Decode all HTML entities."
   (goto-char (point-min))
-  (while (re-search-forward "&\\(#[0-9]+\\|#x[0-9a-f]+\\|[a-z]+[0-9]*\\);" nil t)
+  (while (re-search-forward "&\\(#[0-9]+\\|#x[0-9a-f]+\\|[a-z]+[0-9]*\\);"
+			    nil t)
     (let* ((entity (match-string 1))
 	   (elem (if (eq (aref entity 0) ?\#)
-		     (let ((c (mm-ucs-to-char
-			       ;; Hex number: &#x3212
-			       (if (eq (aref entity 1) ?x)
-				   (string-to-number (substring entity 2)
-						     16)
-				 ;; Decimal number: &#23
-				 (string-to-number (substring entity 1))))))
+		     (let ((c
+			    ;; Hex number: &#x3212
+			    (if (eq (aref entity 1) ?x)
+				(string-to-number (substring entity 2)
+						  16)
+			      ;; Decimal number: &#23
+			      (string-to-number (substring entity 1)))))
+		       (setq c (or (cdr (assq c mm-extra-numeric-entities))
+				   (mm-ucs-to-char c)))
 		       (if (mm-char-or-char-int-p c) c ?#))
 		   (or (cdr (assq (intern entity)
 				  mm-url-html-entities))
--- a/lisp/gnus/mm-util.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/gnus/mm-util.el	Thu Dec 16 18:30:57 2010 -0500
@@ -220,42 +220,43 @@
      (t 'identity))))
 
 ;; `ucs-to-char' is a function that Mule-UCS provides.
-(if (featurep 'xemacs)
-    (cond ((and (fboundp 'unicode-to-char) ;; XEmacs 21.5.
-		(subrp (symbol-function 'unicode-to-char)))
-	   (if (featurep 'mule)
-	       (defalias 'mm-ucs-to-char 'unicode-to-char)
+(eval-and-compile
+  (if (featurep 'xemacs)
+      (cond ((and (fboundp 'unicode-to-char) ;; XEmacs 21.5.
+		  (subrp (symbol-function 'unicode-to-char)))
+	     (if (featurep 'mule)
+		 (defalias 'mm-ucs-to-char 'unicode-to-char)
+	       (defun mm-ucs-to-char (codepoint)
+		 "Convert Unicode codepoint to character."
+		 (or (unicode-to-char codepoint) ?#))))
+	    ((featurep 'mule)
 	     (defun mm-ucs-to-char (codepoint)
 	       "Convert Unicode codepoint to character."
-	       (or (unicode-to-char codepoint) ?#))))
-	  ((featurep 'mule)
-	   (defun mm-ucs-to-char (codepoint)
-	     "Convert Unicode codepoint to character."
-	     (if (fboundp 'ucs-to-char) ;; Mule-UCS is loaded.
-		 (progn
-		   (defalias 'mm-ucs-to-char
-		     (lambda (codepoint)
-		       "Convert Unicode codepoint to character."
-		       (condition-case nil
-			   (or (ucs-to-char codepoint) ?#)
-			 (error ?#))))
-		   (mm-ucs-to-char codepoint))
+	       (if (fboundp 'ucs-to-char) ;; Mule-UCS is loaded.
+		   (progn
+		     (defalias 'mm-ucs-to-char
+		       (lambda (codepoint)
+			 "Convert Unicode codepoint to character."
+			 (condition-case nil
+			     (or (ucs-to-char codepoint) ?#)
+			   (error ?#))))
+		     (mm-ucs-to-char codepoint))
+		 (condition-case nil
+		     (or (int-to-char codepoint) ?#)
+		   (error ?#)))))
+	    (t
+	     (defun mm-ucs-to-char (codepoint)
+	       "Convert Unicode codepoint to character."
 	       (condition-case nil
 		   (or (int-to-char codepoint) ?#)
 		 (error ?#)))))
-	  (t
-	   (defun mm-ucs-to-char (codepoint)
-	     "Convert Unicode codepoint to character."
-	     (condition-case nil
-		 (or (int-to-char codepoint) ?#)
-	       (error ?#)))))
-  (if (let ((char (make-char 'japanese-jisx0208 36 34)))
-	(eq char (decode-char 'ucs char)))
-      ;; Emacs 23.
-      (defalias 'mm-ucs-to-char 'identity)
-    (defun mm-ucs-to-char (codepoint)
-      "Convert Unicode codepoint to character."
-      (or (decode-char 'ucs codepoint) ?#))))
+    (if (let ((char (make-char 'japanese-jisx0208 36 34)))
+	  (eq char (decode-char 'ucs char)))
+	;; Emacs 23.
+	(defalias 'mm-ucs-to-char 'identity)
+      (defun mm-ucs-to-char (codepoint)
+	"Convert Unicode codepoint to character."
+	(or (decode-char 'ucs codepoint) ?#)))))
 
 ;; Fixme:  This seems always to be used to read a MIME charset, so it
 ;; should be re-named and fixed (in Emacs) to offer completion only on
@@ -866,6 +867,21 @@
 Setting it to nil is useful on Emacsen supporting Unicode if sending
 mail with multiple parts is preferred to sending a Unicode one.")
 
+(defvar mm-extra-numeric-entities
+  (mapcar
+   (lambda (item)
+     (cons (car item) (mm-ucs-to-char (cdr item))))
+   '((#x80 . #x20AC) (#x82 . #x201A) (#x83 . #x0192) (#x84 . #x201E)
+     (#x85 . #x2026) (#x86 . #x2020) (#x87 . #x2021) (#x88 . #x02C6)
+     (#x89 . #x2030) (#x8A . #x0160) (#x8B . #x2039) (#x8C . #x0152)
+     (#x8E . #x017D) (#x91 . #x2018) (#x92 . #x2019) (#x93 . #x201C)
+     (#x94 . #x201D) (#x95 . #x2022) (#x96 . #x2013) (#x97 . #x2014)
+     (#x98 . #x02DC) (#x99 . #x2122) (#x9A . #x0161) (#x9B . #x203A)
+     (#x9C . #x0153) (#x9E . #x017E) (#x9F . #x0178)))
+  "*Alist of extra numeric entities and characters other than ISO 10646.
+This table is used for decoding extra numeric entities to characters,
+like \"&#128;\" to the euro sign, mainly in html messages.")
+
 ;;; Internal variables:
 
 ;;; Functions:
@@ -903,7 +919,7 @@
       "Set the multibyte flag of the current buffer.
 Only do this if the default value of `enable-multibyte-characters' is
 non-nil.  This is a no-op in XEmacs."
-      (set-buffer-multibyte t)))
+      (set-buffer-multibyte 'to)))
 
   (if (featurep 'xemacs)
       (defalias 'mm-disable-multibyte 'ignore)
@@ -974,6 +990,7 @@
     ;; This is for XEmacs.
     (mm-mule-charset-to-mime-charset charset)))
 
+;; `delete-dups' is not available in XEmacs 21.4.
 (if (fboundp 'delete-dups)
     (defalias 'mm-delete-duplicates 'delete-dups)
   (defun mm-delete-duplicates (list)
--- a/lisp/gnus/mml.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/gnus/mml.el	Thu Dec 16 18:30:57 2010 -0500
@@ -1509,7 +1509,8 @@
 	      (mm-disable-multibyte)
 	      (insert s)))
 	(let ((gnus-newsgroup-charset (car message-posting-charset))
-	      gnus-article-prepare-hook gnus-original-article-buffer)
+	      gnus-article-prepare-hook gnus-original-article-buffer
+	      gnus-displaying-mime)
 	  (run-hooks 'gnus-article-decode-hook)
 	  (let ((gnus-newsgroup-name "dummy")
 		(gnus-newsrc-hashtb (or gnus-newsrc-hashtb
--- a/lisp/gnus/nnfolder.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/gnus/nnfolder.el	Thu Dec 16 18:30:57 2010 -0500
@@ -322,20 +322,20 @@
   (when nnfolder-get-new-mail
     (nnfolder-possibly-change-group group server)
     (nnmail-get-new-mail
-     'nnfolder
-     (lambda ()
-       (let ((bufs nnfolder-buffer-alist))
-	 (save-excursion
-	   (while bufs
-	     (if (not (gnus-buffer-live-p (nth 1 (car bufs))))
-		 (setq nnfolder-buffer-alist
-		       (delq (car bufs) nnfolder-buffer-alist))
-	       (set-buffer (nth 1 (car bufs)))
-	       (nnfolder-save-buffer)
-	       (kill-buffer (current-buffer)))
-	     (setq bufs (cdr bufs))))))
-     nnfolder-directory
-     group)))
+     'nnfolder 'nnfolder-save-all-buffers
+     nnfolder-directory group)))
+
+(defun nnfolder-save-all-buffers ()
+  (let ((bufs nnfolder-buffer-alist))
+    (save-excursion
+      (while bufs
+	(if (not (gnus-buffer-live-p (nth 1 (car bufs))))
+	    (setq nnfolder-buffer-alist
+		  (delq (car bufs) nnfolder-buffer-alist))
+	  (set-buffer (nth 1 (car bufs)))
+	  (nnfolder-save-buffer)
+	  (kill-buffer (current-buffer)))
+	(setq bufs (cdr bufs))))))
 
 ;; Don't close the buffer if we're not shutting down the server.  This way,
 ;; we can keep the buffer in the group buffer cache, and not have to grovel
@@ -488,7 +488,8 @@
       (nnfolder-save-buffer)
       (nnfolder-adjust-min-active newsgroup)
       (nnfolder-save-active nnfolder-group-alist nnfolder-active-file)
-      (gnus-sorted-difference articles (nreverse deleted-articles)))))
+      (gnus-sorted-difference articles (nreverse deleted-articles)))
+    (nnfolder-save-all-buffers)))
 
 (deffoo nnfolder-request-move-article (article group server accept-form
 					       &optional last move-is-internal)
@@ -1186,19 +1187,7 @@
     (nnfolder-open-server server))
   (unless nnfolder-marks-is-evil
     (nnfolder-open-marks group server)
-    (dolist (action actions)
-      (let ((range (nth 0 action))
-	    (what  (nth 1 action))
-	    (marks (nth 2 action)))
-	(assert (or (eq what 'add) (eq what 'del)) nil
-		"Unknown request-set-mark action: %s" what)
-	(dolist (mark marks)
-	  (setq nnfolder-marks (gnus-update-alist-soft
-			    mark
-			    (funcall (if (eq what 'add) 'gnus-range-add
-				       'gnus-remove-from-range)
-				     (cdr (assoc mark nnfolder-marks)) range)
-			    nnfolder-marks)))))
+    (setq nnfolder-marks (nnheader-update-marks-actions nnfolder-marks actions))
     (nnfolder-save-marks group server))
   nil)
 
--- a/lisp/gnus/nnheader.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/gnus/nnheader.el	Thu Dec 16 18:30:57 2010 -0500
@@ -366,15 +366,13 @@
 	      (setq num 0
 		    beg (point-min)
 		    end (point-max))
-	    (goto-char (point-min))
 	    ;; Search to the beginning of the next header.  Error
 	    ;; messages do not begin with 2 or 3.
 	    (when (re-search-forward "^[23][0-9]+ " nil t)
-	      (end-of-line)
 	      (setq num (read cur)
 		    beg (point)
 		    end (if (search-forward "\n.\n" nil t)
-			    (- (point) 2)
+			    (goto-char  (- (point) 2))
 			  (point)))))
       (with-temp-buffer
 	(insert-buffer-substring cur beg end)
@@ -1080,6 +1078,26 @@
 		   (truncate nnheader-read-timeout))
 		1000))))
 
+(defun nnheader-update-marks-actions (backend-marks actions)
+  (dolist (action actions)
+    (let ((range (nth 0 action))
+	  (what  (nth 1 action))
+	  (marks (nth 2 action)))
+      (dolist (mark marks)
+	(setq backend-marks
+	      (gnus-update-alist-soft
+	       mark
+	       (cond
+		((eq what 'add)
+		 (gnus-range-add (cdr (assoc mark backend-marks)) range))
+		((eq what 'del)
+		 (gnus-remove-from-range
+		  (cdr (assoc mark backend-marks)) range))
+		((eq what 'set)
+		 range))
+	       backend-marks)))))
+  backend-marks)
+
 (when (featurep 'xemacs)
   (require 'nnheaderxm))
 
--- a/lisp/gnus/nnimap.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/gnus/nnimap.el	Thu Dec 16 18:30:57 2010 -0500
@@ -45,9 +45,7 @@
 (require 'tls)
 (require 'parse-time)
 (require 'nnmail)
-
-(eval-when-compile
-  (require 'gnus-sum))
+(require 'proto-stream)
 
 (autoload 'auth-source-forget-user-or-password "auth-source")
 (autoload 'auth-source-user-or-password "auth-source")
@@ -62,9 +60,10 @@
 If nnimap-stream is `ssl', this will default to `imaps'.  If not,
 it will default to `imap'.")
 
-(defvoo nnimap-stream 'ssl
+(defvoo nnimap-stream 'undecided
   "How nnimap will talk to the IMAP server.
-Values are `ssl', `network', `starttls' or `shell'.")
+Values are `ssl', `network', `starttls' or `shell'.
+The default is to try `ssl' first, and then `network'.")
 
 (defvoo nnimap-shell-program (if (boundp 'imap-shell-program)
 				 (if (listp imap-shell-program)
@@ -140,6 +139,9 @@
     (download "gnus-download")
     (forward "gnus-forward")))
 
+(defvar nnimap-quirks
+  '(("QRESYNC" "Zimbra" "QRESYNC ")))
+
 (defun nnimap-buffer ()
   (nnimap-find-process-buffer nntp-server-buffer))
 
@@ -181,11 +183,12 @@
 	    (return)))
 	(setq article (match-string 1))
 	;; Unfold quoted {number} strings.
-	(while (re-search-forward "[^]][ (]{\\([0-9]+\\)}\r\n"
+	(while (re-search-forward "[^]][ (]{\\([0-9]+\\)}\r?\n"
 				  (1+ (line-end-position)) t)
 	  (setq size (string-to-number (match-string 1)))
 	  (delete-region (+ (match-beginning 0) 2) (point))
-	  (setq string (delete-region (point) (+ (point) size)))
+	  (setq string (buffer-substring (point) (+ (point) size)))
+	  (delete-region (point) (+ (point) size))
 	  (insert (format "%S" string)))
 	(setq bytes (nnimap-get-length)
 	      lines nil)
@@ -216,6 +219,16 @@
 	(insert ".")
 	(forward-line 1)))))
 
+(defun nnimap-unfold-quoted-lines ()
+  ;; Unfold quoted {number} strings.
+  (let (size string)
+    (while (re-search-forward " {\\([0-9]+\\)}\r?\n" nil t)
+      (setq size (string-to-number (match-string 1)))
+      (delete-region (1+ (match-beginning 0)) (point))
+      (setq string (buffer-substring (point) (+ (point) size)))
+      (delete-region (point) (+ (point) size))
+      (insert (format "%S" string)))))
+
 (defun nnimap-get-length ()
   (and (re-search-forward "{\\([0-9]+\\)}" (line-end-position) t)
        (string-to-number (match-string 1))))
@@ -260,16 +273,6 @@
     (push (current-buffer) nnimap-process-buffers)
     (current-buffer)))
 
-(defun nnimap-open-shell-stream (name buffer host port)
-  (let ((process-connection-type nil))
-    (start-process name buffer shell-file-name
-		   shell-command-switch
-		   (format-spec
-		    nnimap-shell-program
-		    (format-spec-make
-		     ?s host
-		     ?p port)))))
-
 (defun nnimap-credentials (address ports &optional inhibit-create)
   (let (port credentials)
     ;; Request the credentials from all ports, but only query on the
@@ -299,111 +302,79 @@
 			(* 5 60)))
 	    (nnimap-send-command "NOOP")))))))
 
-(declare-function gnutls-negotiate "gnutls"
-		  (proc type &optional priority-string trustfiles keyfiles))
+(defun nnimap-open-connection (buffer)
+  ;; Be backwards-compatible -- the earlier value of nnimap-stream was
+  ;; `ssl' when nnimap-server-port was nil.  Sort of.
+  (when (and nnimap-server-port
+	     (eq nnimap-stream 'undecided))
+    (setq nnimap-stream 'ssl))
+  (let ((stream
+	 (if (eq nnimap-stream 'undecided)
+	     (loop for type in '(ssl network)
+		   for stream = (let ((nnimap-stream type))
+				  (nnimap-open-connection-1 buffer))
+		   while (eq stream 'no-connect)
+		   finally (return stream))
+	   (nnimap-open-connection-1 buffer))))
+    (if (eq stream 'no-connect)
+	nil
+      stream)))
 
-(defun nnimap-open-connection (buffer)
+(defun nnimap-open-connection-1 (buffer)
   (unless nnimap-keepalive-timer
     (setq nnimap-keepalive-timer (run-at-time (* 60 15) (* 60 15)
 					      'nnimap-keepalive)))
-  (block nil
-    (with-current-buffer (nnimap-make-process-buffer buffer)
-      (let* ((coding-system-for-read 'binary)
-	     (coding-system-for-write 'binary)
-	     (port nil)
-	     (ports
-	      (cond
-	       ((or (eq nnimap-stream 'network)
-		    (and (eq nnimap-stream 'starttls)
-			 (fboundp 'open-gnutls-stream)))
-		(nnheader-message 7 "Opening connection to %s..."
-				  nnimap-address)
-		(open-network-stream
-		 "*nnimap*" (current-buffer) nnimap-address
-		 (setq port
-		       (or nnimap-server-port
-			   (if (netrc-find-service-number "imap")
-			       "imap"
-			     "143"))))
-		'("143" "imap"))
-	       ((eq nnimap-stream 'shell)
-		(nnheader-message 7 "Opening connection to %s via shell..."
-				  nnimap-address)
-		(nnimap-open-shell-stream
-		 "*nnimap*" (current-buffer) nnimap-address
-		 (setq port (or nnimap-server-port "imap")))
-		'("imap"))
-	       ((eq nnimap-stream 'starttls)
-		(nnheader-message 7 "Opening connection to %s via starttls..."
-			 nnimap-address)
-		(let ((tls-program
-		       '("openssl s_client -connect %h:%p -no_ssl2 -ign_eof -starttls imap")))
-		  (open-tls-stream
-		   "*nnimap*" (current-buffer) nnimap-address
-		   (setq port (or nnimap-server-port "imap"))))
-		'("imap"))
-	       ((memq nnimap-stream '(ssl tls))
-		(nnheader-message 7 "Opening connection to %s via tls..."
-				  nnimap-address)
-		(funcall (if (fboundp 'open-gnutls-stream)
-			     'open-gnutls-stream
-			   'open-tls-stream)
-			 "*nnimap*" (current-buffer) nnimap-address
-			 (setq port
-			       (or nnimap-server-port
-				   (if (netrc-find-service-number "imaps")
-				       "imaps"
-				     "993"))))
-		'("143" "993" "imap" "imaps"))
-	       (t
-		(error "Unknown stream type: %s" nnimap-stream))))
-	     connection-result login-result credentials)
-	(setf (nnimap-process nnimap-object)
-	      (get-buffer-process (current-buffer)))
-	(if (not (and (nnimap-process nnimap-object)
-		      (memq (process-status (nnimap-process nnimap-object))
-			    '(open run))))
-	    (nnheader-report 'nnimap "Unable to contact %s:%s via %s"
-			     nnimap-address port nnimap-stream)
-	  (gnus-set-process-query-on-exit-flag
-	   (nnimap-process nnimap-object) nil)
-	  (if (not (setq connection-result (nnimap-wait-for-connection)))
-	      (nnheader-report 'nnimap
-			       "%s" (buffer-substring
-				     (point) (line-end-position)))
+  (with-current-buffer (nnimap-make-process-buffer buffer)
+    (let* ((coding-system-for-read 'binary)
+	   (coding-system-for-write 'binary)
+	   (port nil)
+	   (ports
+	    (cond
+	     ((or (eq nnimap-stream 'network)
+		  (eq nnimap-stream 'starttls))
+	      (nnheader-message 7 "Opening connection to %s..."
+				nnimap-address)
+	      '("143" "imap"))
+	     ((eq nnimap-stream 'shell)
+	      (nnheader-message 7 "Opening connection to %s via shell..."
+				nnimap-address)
+	      '("imap"))
+	     ((memq nnimap-stream '(ssl tls))
+	      (nnheader-message 7 "Opening connection to %s via tls..."
+				nnimap-address)
+	      '("143" "993" "imap" "imaps"))
+	     (t
+	      (error "Unknown stream type: %s" nnimap-stream))))
+	   (proto-stream-always-use-starttls t)
+           login-result credentials)
+      (when nnimap-server-port
+	(setq ports (append ports (list nnimap-server-port))))
+      (destructuring-bind (stream greeting capabilities)
+	  (open-protocol-stream
+	   "*nnimap*" (current-buffer) nnimap-address (car (last ports))
+	   :type nnimap-stream
+	   :shell-command nnimap-shell-program
+	   :capability-command "1 CAPABILITY\r\n"
+	   :success " OK "
+	   :starttls-function
+	   (lambda (capabilities)
+	     (when (gnus-string-match-p "STARTTLS" capabilities)
+	       "1 STARTTLS\r\n")))
+	(setf (nnimap-process nnimap-object) stream)
+	(if (not stream)
+	    (progn
+	      (nnheader-report 'nnimap "Unable to contact %s:%s via %s"
+			       nnimap-address port nnimap-stream)
+	      'no-connect)
+	  (gnus-set-process-query-on-exit-flag stream nil)
+	  (if (not (gnus-string-match-p "[*.] \\(OK\\|PREAUTH\\)" greeting))
+	      (nnheader-report 'nnimap "%s" greeting)
 	    ;; Store the greeting (for debugging purposes).
-	    (setf (nnimap-greeting nnimap-object)
-		  (buffer-substring (line-beginning-position)
-				    (line-end-position)))
-	    (nnimap-get-capabilities)
-	    (when nnimap-server-port
-	      (push (format "%s" nnimap-server-port) ports))
-	    ;; If this is a STARTTLS-capable server, then sever the
-	    ;; connection and start a STARTTLS connection instead.
-	    (cond
-	     ((and (or (and (eq nnimap-stream 'network)
-			    (nnimap-capability "STARTTLS"))
-		       (eq nnimap-stream 'starttls))
-		   (fboundp 'open-gnutls-stream))
-	      (nnimap-command "STARTTLS")
-	      (gnutls-negotiate (nnimap-process nnimap-object) nil)
-	      ;; Get the capabilities again -- they may have changed
-	      ;; after doing STARTTLS.
-	      (nnimap-get-capabilities))
-	     ((and (eq nnimap-stream 'network)
-		   (nnimap-capability "STARTTLS"))
-	      (let ((nnimap-stream 'starttls))
-		(let ((tls-process
-		       (nnimap-open-connection buffer)))
-		  ;; If the STARTTLS connection was successful, we
-		  ;; kill our first non-encrypted connection.  If it
-		  ;; wasn't successful, we just use our unencrypted
-		  ;; connection.
-		  (when (memq (process-status tls-process) '(open run))
-		    (delete-process (nnimap-process nnimap-object))
-		    (kill-buffer (current-buffer))
-		    (return tls-process))))))
-	    (unless (equal connection-result "PREAUTH")
+	    (setf (nnimap-greeting nnimap-object) greeting)
+	    (setf (nnimap-capabilities nnimap-object)
+		  (mapcar #'upcase
+			  (split-string capabilities)))
+	    (unless (gnus-string-match-p "[*.] PREAUTH" greeting)
 	      (if (not (setq credentials
 			     (if (eq nnimap-authenticator 'anonymous)
 				 (list "anonymous"
@@ -445,13 +416,6 @@
 		(nnimap-command "ENABLE QRESYNC"))
 	      (nnimap-process nnimap-object))))))))
 
-(defun nnimap-get-capabilities ()
-  (setf (nnimap-capabilities nnimap-object)
-	(mapcar
-	 #'upcase
-	 (nnimap-find-parameter
-	  "CAPABILITY" (cdr (nnimap-command "CAPABILITY"))))))
-
 (defun nnimap-quote-specials (string)
   (with-temp-buffer
     (insert string)
@@ -783,17 +747,15 @@
 	(if internal-move-group
 	    (let ((result
 		   (with-current-buffer (nnimap-buffer)
-		     ;; Clear all flags before moving.
-		     (nnimap-send-command "UID STORE %d FLAGS.SILENT ()"
-					  article)
 		     (nnimap-command "UID COPY %d %S"
 				     article
 				     (utf7-encode internal-move-group t)))))
 	      (when (car result)
 		(nnimap-delete-article article)
 		(cons internal-move-group
-		      (nnimap-find-article-by-message-id
-		       internal-move-group message-id))))
+		      (or (nnimap-find-uid-response "COPYUID" (cadr result))
+			  (nnimap-find-article-by-message-id
+			   internal-move-group message-id)))))
 	  ;; Move the article to a different method.
 	  (let ((result (eval accept-form)))
 	    (when result
@@ -831,22 +793,42 @@
 
 (defun nnimap-process-expiry-targets (articles group server)
   (let ((deleted-articles nil))
-    (dolist (article articles)
-      (let ((target nnmail-expiry-target))
-	(with-temp-buffer
-          (mm-disable-multibyte)
-	  (when (nnimap-request-article article group server (current-buffer))
-	    (nnheader-message 7 "Expiring article %s:%d" group article)
-	    (when (functionp target)
-	      (setq target (funcall target group)))
-	    (when (and target
-		       (not (eq target 'delete)))
-	      (if (or (gnus-request-group target t)
-		      (gnus-request-create-group target))
-		  (nnmail-expiry-target-group target group)
-		(setq target nil)))
-	    (when target
-	      (push article deleted-articles))))))
+    (cond
+     ;; shortcut further processing if we're going to delete the articles
+     ((eq nnmail-expiry-target 'delete)
+      (setq deleted-articles articles)
+      t)
+     ;; or just move them to another folder on the same IMAP server
+     ((and (not (functionp nnmail-expiry-target))
+	   (gnus-server-equal (gnus-group-method nnmail-expiry-target)
+			      (gnus-server-to-method
+			       (format "nnimap:%s" server))))
+      (and (nnimap-possibly-change-group group server)
+	   (with-current-buffer (nnimap-buffer)
+	     (nnheader-message 7 "Expiring articles from %s: %s" group articles)
+	     (nnimap-command
+	      "UID COPY %s %S"
+	      (nnimap-article-ranges (gnus-compress-sequence articles))
+	      (utf7-encode (gnus-group-real-name nnmail-expiry-target) t))
+	     (setq deleted-articles articles)))
+      t)
+     (t
+      (dolist (article articles)
+	(let ((target nnmail-expiry-target))
+	  (with-temp-buffer
+	    (mm-disable-multibyte)
+	    (when (nnimap-request-article article group server (current-buffer))
+	      (nnheader-message 7 "Expiring article %s:%d" group article)
+	      (when (functionp target)
+		(setq target (funcall target group)))
+	      (when (and target
+			 (not (eq target 'delete)))
+		(if (or (gnus-request-group target t)
+			(gnus-request-create-group target))
+		    (nnmail-expiry-target-group target group)
+		  (setq target nil)))
+	      (when target
+		(push article deleted-articles))))))))
     ;; Change back to the current group again.
     (nnimap-possibly-change-group group server)
     (setq deleted-articles (nreverse deleted-articles))
@@ -918,6 +900,16 @@
 	(push flag flags)))
     flags))
 
+(deffoo nnimap-request-update-group-status (group status &optional server)
+  (when (nnimap-possibly-change-group nil server)
+    (let ((command (assoc
+		    status
+		    '((subscribe "SUBSCRIBE")
+		      (unsubscribe "UNSUBSCRIBE")))))
+      (when command
+	(with-current-buffer (nnimap-buffer)
+	  (nnimap-command "%s %S" (cadr command) (utf7-encode group t)))))))
+
 (deffoo nnimap-request-set-mark (group actions &optional server)
   (when (nnimap-possibly-change-group group server)
     (let (sequence)
@@ -932,9 +924,10 @@
 		(setq sequence (nnimap-send-command
 				"UID STORE %s %sFLAGS.SILENT (%s)"
 				(nnimap-article-ranges range)
-				(if (eq action 'del)
-				    "-"
-				  "+")
+				(cond
+				 ((eq action 'del) "-")
+				 ((eq action 'add) "+")
+				 ((eq action 'set) ""))
 				(mapconcat #'identity flags " ")))))))
 	;; Wait for the last command to complete to avoid later
 	;; syncronisation problems with the stream.
@@ -970,7 +963,22 @@
 		(nnheader-message 7 "%s" (nnheader-get-report-string 'nnimap))
 		nil)
 	    (cons group
-		  (nnimap-find-article-by-message-id group message-id))))))))
+		  (or (nnimap-find-uid-response "APPENDUID" (car result))
+		      (nnimap-find-article-by-message-id
+		       group message-id)))))))))
+
+(defun nnimap-find-uid-response (name list)
+  (let ((result (car (last (nnimap-find-response-element name list)))))
+    (and result
+	 (string-to-number result))))
+
+(defun nnimap-find-response-element (name list)
+  (let (result)
+    (dolist (elem list)
+      (when (and (consp elem)
+		 (equal name (car elem)))
+	(setq result elem)))
+    result))
 
 (deffoo nnimap-request-replace-article (article group buffer)
   (let (group-art)
@@ -989,15 +997,25 @@
     (replace-match "\r\n" t t)))
 
 (defun nnimap-get-groups ()
-  (let ((result (nnimap-command "LIST \"\" \"*\""))
+  (erase-buffer)
+  (let ((sequence (nnimap-send-command "LIST \"\" \"*\""))
 	groups)
-    (when (car result)
-      (dolist (line (cdr result))
-	(when (and (equal (car line) "LIST")
-		   (not (and (caadr line)
-			     (string-match "noselect" (caadr line)))))
-	  (push (car (last line)) groups)))
-      (nreverse groups))))
+    (nnimap-wait-for-response sequence)
+    (subst-char-in-region (point-min) (point-max)
+			  ?\\ ?% t)
+    (goto-char (point-min))
+    (nnimap-unfold-quoted-lines)
+    (goto-char (point-min))
+    (while (search-forward "* LIST " nil t)
+      (let ((flags (read (current-buffer)))
+	    (separator (read (current-buffer)))
+	    (group (read (current-buffer))))
+	(unless (member '%NoSelect flags)
+	  (push (if (stringp group)
+		    group
+		  (format "%s" group))
+		groups))))
+    (nreverse groups)))
 
 (deffoo nnimap-request-list (&optional server)
   (nnimap-possibly-change-group nil server)
@@ -1075,8 +1093,9 @@
 		   uidvalidity
 		   modseq)
 	      (push
-	       (list (nnimap-send-command "EXAMINE %S (QRESYNC (%s %s))"
+	       (list (nnimap-send-command "EXAMINE %S (%s (%s %s))"
 					  (utf7-encode group t)
+					  (nnimap-quirk "QRESYNC")
 					  uidvalidity modseq)
 		     'qresync
 		     nil group 'qresync)
@@ -1102,6 +1121,15 @@
 		    sequences))))
 	sequences))))
 
+(defun nnimap-quirk (command)
+  (let ((quirk (assoc command nnimap-quirks)))
+    ;; If this server is of a type that matches a quirk, then return
+    ;; the "quirked" command instead of the proper one.
+    (if (or (null quirk)
+	    (not (string-match (nth 1 quirk) (nnimap-greeting nnimap-object))))
+	command
+      (nth 2 quirk))))
+
 (deffoo nnimap-finish-retrieve-group-infos (server infos sequences)
   (when (and sequences
 	     (nnimap-possibly-change-group nil server))
@@ -1379,7 +1407,7 @@
 		 (goto-char start)
 		 (setq vanished
 		       (and (eq flag-sequence 'qresync)
-			    (re-search-forward "VANISHED.* \\([0-9:,]+\\)"
+			    (re-search-forward "^\\* VANISHED .* \\([0-9:,]+\\)"
 					       (or end (point-min)) t)
 			    (match-string 1)))
 		 (goto-char start)
@@ -1418,9 +1446,10 @@
   (setq nnimap-status-string "Read-only server")
   nil)
 
-(deffoo nnimap-request-thread (id)
-  (let* ((refs (split-string
-		(or (mail-header-references (gnus-summary-article-header))
+(deffoo nnimap-request-thread (header)
+  (let* ((id (mail-header-id header))
+	 (refs (split-string
+		(or (mail-header-references header)
 		    "")))
 	 (cmd (let ((value
 		     (format
@@ -1535,7 +1564,12 @@
 		      (not (re-search-backward
 			    (format "^%d .*\n" sequence)
 			    (if nnimap-streaming
-				(max (point-min) (- (point) 500))
+				(max (point-min)
+				     (min
+				      (- (point) 500)
+				      (save-excursion
+					(forward-line -1)
+					(point))))
 			      (point-min))
 			    t)))
 	    (when messagep
--- a/lisp/gnus/nnir.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/gnus/nnir.el	Thu Dec 16 18:30:57 2010 -0500
@@ -42,7 +42,7 @@
 
 ;; When looking at the retrieval result (in the Summary buffer) you
 ;; can type `A W' (aka M-x gnus-warp-to-article RET) on an article.  You
-;; will be warped into the group this article came from. Typing `A W'
+;; will be warped into the group this article came from. Typing `A T'
 ;; (aka M-x gnus-summary-refer-thread RET) will warp to the group and
 ;; also show the thread this article is part of.
 
@@ -163,7 +163,9 @@
 ;; `nnir-engines'.  Then, users can choose the backend by setting
 ;; `nnir-search-engine' as a server variable.
 
-;;; Setup Code:
+;;; Code:
+
+;;; Setup:
 
 ;; For Emacs <22.2 and XEmacs.
 (eval-and-compile
@@ -171,17 +173,125 @@
 
 (require 'nnoo)
 (require 'gnus-group)
-(require 'gnus-sum)
 (require 'message)
 (require 'gnus-util)
 (eval-when-compile
   (require 'cl))
 
+;;; Internal Variables:
+
+(defvar nnir-current-query nil
+  "Internal: stores current query (= group name).")
+
+(defvar nnir-current-server nil
+  "Internal: stores current server (does it ever change?).")
+
+(defvar nnir-current-group-marked nil
+  "Internal: stores current list of process-marked groups.")
+
+(defvar nnir-artlist nil
+  "Internal: stores search result.")
+
+(defvar nnir-tmp-buffer " *nnir*"
+  "Internal: temporary buffer.")
+
+(defvar nnir-search-history ()
+  "Internal: the history for querying search options in nnir")
+
+(defvar nnir-extra-parms nil
+  "Internal: stores request for extra search parms")
+
+;; Imap variables
+
+(defvar nnir-imap-search-arguments
+  '(("Whole message" . "TEXT")
+    ("Subject" . "SUBJECT")
+    ("To" . "TO")
+    ("From" . "FROM")
+    ("Imap" . ""))
+  "Mapping from user readable keys to IMAP search items for use in nnir")
+
+(defvar nnir-imap-search-other "HEADER %S"
+  "The IMAP search item to use for anything other than
+  `nnir-imap-search-arguments'. By default this is the name of an
+  email header field")
+
+(defvar nnir-imap-search-argument-history ()
+  "The history for querying search options in nnir")
+
+;;; Helper macros
+
+;; Data type article list.
+
+(defmacro nnir-artlist-length (artlist)
+  "Returns number of articles in artlist."
+  `(length ,artlist))
+
+(defmacro nnir-artlist-article (artlist n)
+  "Returns from ARTLIST the Nth artitem (counting starting at 1)."
+  `(when (> ,n 0)
+     (elt ,artlist (1- ,n))))
+
+(defmacro nnir-artitem-group (artitem)
+  "Returns the group from the ARTITEM."
+  `(elt ,artitem 0))
+
+(defmacro nnir-artitem-number (artitem)
+  "Returns the number from the ARTITEM."
+  `(elt ,artitem 1))
+
+(defmacro nnir-artitem-rsv (artitem)
+  "Returns the Retrieval Status Value (RSV, score) from the ARTITEM."
+  `(elt ,artitem 2))
+
+(defmacro nnir-article-group (article)
+  "Returns the group for ARTICLE"
+  `(nnir-artitem-group (nnir-artlist-article nnir-artlist ,article)))
+
+(defmacro nnir-article-number (article)
+  "Returns the number for ARTICLE"
+  `(nnir-artitem-number (nnir-artlist-article nnir-artlist ,article)))
+
+(defmacro nnir-article-rsv (article)
+  "Returns the rsv for ARTICLE"
+  `(nnir-artitem-rsv (nnir-artlist-article nnir-artlist ,article)))
+
+(defsubst nnir-article-ids (article)
+  "Returns the pair `(nnir id . real id)' of ARTICLE"
+  (cons article (nnir-article-number article)))
+
+(defmacro nnir-categorize (sequence keyfunc &optional valuefunc)
+  "Sorts a sequence into categories and returns a list of the form
+`((key1 (element11 element12)) (key2 (element21 element22))'.
+The category key for a member of the sequence is obtained
+as `(keyfunc member)' and the corresponding element is just
+`member'. If `valuefunc' is non-nil, the element of the list
+is `(valuefunc member)'."
+  `(unless (null ,sequence)
+     (let (value)
+       (mapc
+	(lambda (member)
+	  (let ((y (,keyfunc member))
+		(x ,(if valuefunc
+			`(,valuefunc member)
+		      'member)))
+	    (if (assoc y value)
+		(push x (cadr (assoc y value)))
+	      (push (list y (list x)) value))))
+	,sequence)
+       value)))
+
+;;; Finish setup:
+
+(require 'gnus-sum)
 
 (eval-when-compile
   (autoload 'nnimap-buffer "nnimap")
   (autoload 'nnimap-command "nnimap")
-  (autoload 'nnimap-possibly-change-group "nnimap"))
+  (autoload 'nnimap-possibly-change-group "nnimap")
+  (autoload 'gnus-registry-action "gnus-registry")
+  (defvar gnus-registry-install))
+
 
 (nnoo-declare nnir)
 (nnoo-define-basics nnir)
@@ -195,18 +305,43 @@
   "Search groups in Gnus with assorted seach engines."
   :group 'gnus)
 
-(defcustom nnir-method-default-engines
-  '((nnimap . imap)
-    (nntp . gmane))
-  "*Alist of default search engines keyed by server method"
-  :type '(alist)
+(defcustom nnir-ignored-newsgroups ""
+  "*A regexp to match newsgroups in the active file that should
+  be skipped when searching."
+  :type '(regexp)
+  :group 'nnir)
+
+(defcustom nnir-summary-line-format nil
+  "*The format specification of the lines in an nnir summary buffer.
+
+All the items from `gnus-summary-line-format' are available, along
+with three items unique to nnir summary buffers:
+
+%Z    Search retrieval score value (integer)
+%G    Article original full group name (string)
+%g    Article original short group name (string)
+
+If nil this will use `gnus-summary-line-format'."
+  :type '(string)
+  :group 'nnir)
+
+(defcustom nnir-retrieve-headers-override-function nil
+  "*If non-nil, a function that accepts an article list and group
+and populates the `nntp-server-buffer' with the retrieved
+headers. Must return either 'nov or 'headers indicating the
+retrieved header format.
+
+If this variable is nil, or if the provided function returns nil for a search
+result, `gnus-retrieve-headers' will be called instead."
+  :type '(function)
   :group 'nnir)
 
 (defcustom nnir-imap-default-search-key "Whole message"
   "*The default IMAP search key for an nnir search. Must be one of
   the keys in `nnir-imap-search-arguments'. To use raw imap queries
-  by default set this to \"Imap\""
-  :type '(string)
+  by default set this to \"Imap\"."
+  :type `(choice ,@(mapcar (lambda (elem) (list 'const (car elem)))
+			   nnir-imap-search-arguments))
   :group 'nnir)
 
 (defcustom nnir-swish++-configuration-file
@@ -364,24 +499,6 @@
   :type '(directory)
   :group 'nnir)
 
-;; Imap variables
-
-(defvar nnir-imap-search-arguments
-  '(("Whole message" . "TEXT")
-    ("Subject" . "SUBJECT")
-    ("To" . "TO")
-    ("From" . "FROM")
-    ("Imap" . ""))
-  "Mapping from user readable keys to IMAP search items for use in nnir")
-
-(defvar nnir-imap-search-other "HEADER %S"
-  "The IMAP search item to use for anything other than
-  `nnir-imap-search-arguments'. By default this is the name of an
-  email header field")
-
-(defvar nnir-imap-search-argument-history ()
-  "The history for querying search options in nnir")
-
 ;;; Developer Extension Variable:
 
 (defvar nnir-engines
@@ -423,37 +540,18 @@
 
 Add an entry here when adding a new search engine.")
 
-(defvar nnir-get-article-nov-override-function nil
-  "If non-nil, a function that will be passed each search result.  This
-should return a message's headers in NOV format.
-
-If this variable is nil, or if the provided function returns nil for a search
-result, `gnus-retrieve-headers' will be called instead.")
-
-;;; Internal Variables:
-
-(defvar nnir-current-query nil
-  "Internal: stores current query (= group name).")
-
-(defvar nnir-current-server nil
-  "Internal: stores current server (does it ever change?).")
-
-(defvar nnir-current-group-marked nil
-  "Internal: stores current list of process-marked groups.")
-
-(defvar nnir-artlist nil
-  "Internal: stores search result.")
-
-(defvar nnir-tmp-buffer " *nnir*"
-  "Internal: temporary buffer.")
-
-(defvar nnir-search-history ()
-  "Internal: the history for querying search options in nnir")
-
-(defvar nnir-extra-parms nil
-  "Internal: stores request for extra search parms")
-
-;;; Code:
+(defcustom nnir-method-default-engines
+  '((nnimap . imap)
+    (nntp . gmane))
+  "*Alist of default search engines keyed by server method."
+  :type `(repeat (cons (choice (const nnimap) (const nttp) (const nnspool)
+			       (const nneething) (const nndir) (const nnmbox)
+			       (const nnml) (const nnmh) (const nndraft)
+			       (const nnfolder) (const nnmaildir))
+		       (choice
+			,@(mapcar (lambda (elem) (list 'const (car elem)))
+				  nnir-engines))))
+  :group 'nnir)
 
 ;; Gnus glue.
 
@@ -479,6 +577,7 @@
 
 (deffoo nnir-open-server (server &optional definitions)
   ;; Just set the server variables appropriately.
+  (add-hook 'gnus-summary-mode-hook 'nnir-mode)
   (nnoo-change-server 'nnir server definitions))
 
 (deffoo nnir-request-group (group &optional server fast info)
@@ -506,100 +605,86 @@
 		       group))))      ; group name
 
 (deffoo nnir-retrieve-headers (articles &optional group server fetch-old)
-  (save-excursion
-    (let ((artlist (copy-sequence articles))
-          art artitem artgroup artno artrsv artfullgroup
-          novitem novdata foo server)
-      (while (not (null artlist))
-        (setq art (car artlist))
-        (or (numberp art)
-            (nnheader-report
-             'nnir
-             "nnir-retrieve-headers doesn't grok message ids: %s"
-             art))
-        (setq artitem (nnir-artlist-article nnir-artlist art))
-        (setq artrsv (nnir-artitem-rsv artitem))
-        (setq artfullgroup (nnir-artitem-group artitem))
-        (setq artno (nnir-artitem-number artitem))
-        (setq artgroup (gnus-group-real-name artfullgroup))
-	(setq server (gnus-group-server artfullgroup))
-        ;; retrieve NOV or HEAD data for this article, transform into
-        ;; NOV data and prepend to `novdata'
-        (set-buffer nntp-server-buffer)
-	(nnir-possibly-change-server server)
-        (let ((gnus-override-method
-	       (gnus-server-to-method server)))
-	  ;; if nnir-get-article-nov-override-function is set, use it
-	  (if nnir-get-article-nov-override-function
-	      (setq novitem (funcall nnir-get-article-nov-override-function
-				     artitem))
-	    ;; else, set novitem through nnheader-parse-nov/nnheader-parse-head
-	    (case (setq foo (gnus-retrieve-headers (list artno)
-						   artfullgroup nil))
-	      (nov
-	       (goto-char (point-min))
-	       (setq novitem (nnheader-parse-nov)))
-	      (headers
-	       (goto-char (point-min))
-	       (setq novitem (nnheader-parse-head)))
-	      (t (error "Unknown header type %s while requesting article %s of group %s"
-			foo artno artfullgroup)))))
-	;; replace article number in original group with article number
-        ;; in nnir group
-	(when novitem
-	  (mail-header-set-number novitem art)
-	  (mail-header-set-subject
-	   novitem
-	   (format "[%d: %s/%d] %s"
-		   artrsv artgroup artno
-		   (mail-header-subject novitem)))
-	  (push novitem novdata)
-	  (setq artlist (cdr artlist))))
-      (setq novdata (nreverse novdata))
-      (set-buffer nntp-server-buffer) (erase-buffer)
-      (mapc 'nnheader-insert-nov novdata)
+  (with-current-buffer nntp-server-buffer
+    (let ((gnus-inhibit-demon t)
+	  (articles-by-group (nnir-categorize
+			      articles nnir-article-group nnir-article-ids))
+	  headers)
+      (while (not (null articles-by-group))
+	(let* ((group-articles (pop articles-by-group))
+	       (artgroup (car group-articles))
+	       (articleids (cadr group-articles))
+	       (artlist (sort (mapcar 'cdr articleids) '<))
+	       (server (gnus-group-server artgroup))
+	       (gnus-override-method (gnus-server-to-method server))
+	       parsefunc)
+	  ;; (or (numberp art)
+	  ;;     (nnheader-report
+	  ;;      'nnir
+	  ;;      "nnir-retrieve-headers doesn't grok message ids: %s"
+	  ;;      art))
+	  (nnir-possibly-change-server server)
+	  ;; is this needed?
+	  (erase-buffer)
+	  (case (setq gnus-headers-retrieved-by
+		      (or
+		       (and
+			nnir-retrieve-headers-override-function
+			(funcall nnir-retrieve-headers-override-function
+				 artlist artgroup))
+		       (gnus-retrieve-headers artlist artgroup nil)))
+	    (nov
+	     (setq parsefunc 'nnheader-parse-nov))
+	    (headers
+	     (setq parsefunc 'nnheader-parse-head))
+	    (t (error "Unknown header type %s while requesting articles \
+                    of group %s" gnus-headers-retrieved-by artgroup)))
+	  (goto-char (point-min))
+	  (while (not (eobp))
+	    (let* ((novitem (funcall parsefunc))
+		   (artno (mail-header-number novitem))
+		   (art (car (rassq artno articleids))))
+	      (when art
+		(mail-header-set-number novitem art)
+		(push novitem headers))
+	      (forward-line 1)))))
+      (setq headers
+	    (sort headers
+		  (lambda (x y)
+		    (< (mail-header-number x) (mail-header-number y)))))
+      (erase-buffer)
+      (mapc 'nnheader-insert-nov headers)
       'nov)))
 
-(deffoo nnir-request-article (article
-                              &optional group server to-buffer)
+(deffoo nnir-request-article (article &optional group server to-buffer)
   (if (stringp article)
       (nnheader-report
        'nnir
        "nnir-retrieve-headers doesn't grok message ids: %s"
        article)
     (save-excursion
-      (let* ((artitem (nnir-artlist-article nnir-artlist
-					    article))
-	     (artfullgroup (nnir-artitem-group artitem))
-	     (artno (nnir-artitem-number artitem))
-	     ;; Bug?
-	     ;; Why must we bind nntp-server-buffer here?  It won't
-	     ;; work if `buf' is used, say.  (Of course, the set-buffer
-	     ;; line below must then be updated, too.)
-	     (nntp-server-buffer (or to-buffer nntp-server-buffer)))
-	(set-buffer nntp-server-buffer)
-	(erase-buffer)
+      (let ((artfullgroup (nnir-article-group article))
+	    (artno (nnir-article-number article)))
 	(message "Requesting article %d from group %s"
 		 artno artfullgroup)
-	(gnus-request-article artno artfullgroup nntp-server-buffer)
+	(if to-buffer
+	    (with-current-buffer to-buffer
+	      (let ((gnus-article-decode-hook nil))
+		(gnus-request-article-this-buffer artno artfullgroup)))
+	  (gnus-request-article artno artfullgroup))
 	(cons artfullgroup artno)))))
 
 (deffoo nnir-request-move-article (article group server accept-form
 					   &optional last internal-move-group)
-  (let* ((artitem (nnir-artlist-article nnir-artlist
-					article))
-	 (artfullgroup (nnir-artitem-group artitem))
-	 (artno (nnir-artitem-number artitem))
+  (let* ((artfullgroup (nnir-article-group article))
+	 (artno (nnir-article-number article))
 	 (to-newsgroup (nth 1 accept-form))
 	 (to-method (gnus-find-method-for-group to-newsgroup))
 	 (from-method (gnus-find-method-for-group artfullgroup))
-	 (move-is-internal (gnus-server-equal from-method to-method))
-	 (artsubject (mail-header-subject
-		      (gnus-data-header
-		       (assoc article (gnus-data-list nil))))))
-    (setq gnus-newsgroup-original-name artfullgroup)
-    (string-match "^\\[[0-9]+:.+/[0-9]+\\] " artsubject)
-    (setq gnus-article-original-subject (substring artsubject (match-end 0)))
+	 (move-is-internal (gnus-server-equal from-method to-method)))
+    (unless (gnus-check-backend-function
+	     'request-move-article artfullgroup)
+      (error "The group %s does not support article moving" artfullgroup))
     (gnus-request-move-article
      artno
      artfullgroup
@@ -610,12 +695,33 @@
 	  to-newsgroup		; Not respooling
 	  (gnus-group-real-name to-newsgroup)))))
 
+(deffoo nnir-request-expire-articles (articles group &optional server force)
+  (if force
+    (let ((articles-by-group (nnir-categorize
+			      articles nnir-article-group nnir-article-ids))
+	  not-deleted)
+      (while (not (null articles-by-group))
+	(let* ((group-articles (pop articles-by-group))
+	       (artgroup (car group-articles))
+	       (articleids (cadr group-articles))
+	       (artlist (sort (mapcar 'cdr articleids) '<)))
+	  (unless (gnus-check-backend-function 'request-expire-articles
+					       artgroup)
+	    (error "The group %s does not support article deletion" artgroup))
+	  (unless (gnus-check-server (gnus-find-method-for-group artgroup))
+	    (error "Couldn't open server for group %s" artgroup))
+	  (push (gnus-request-expire-articles
+		 artlist artgroup force)
+		not-deleted)))
+      (sort (delq nil not-deleted) '<))
+    articles))
+
 (deffoo nnir-warp-to-article ()
   (let* ((cur (if (> (gnus-summary-article-number) 0)
 		  (gnus-summary-article-number)
 		(error "This is not a real article.")))
-         (gnus-newsgroup-name (nnir-artlist-artitem-group nnir-artlist cur))
-         (backend-number (nnir-artlist-artitem-number nnir-artlist cur)))
+	 (gnus-newsgroup-name (nnir-article-group cur))
+         (backend-number (nnir-article-number cur)))
     (gnus-summary-read-group-1 gnus-newsgroup-name t t gnus-summary-buffer
 			       nil (list backend-number))))
 
@@ -654,7 +760,7 @@
                  (gnus-replace-in-string dirnam "^[./\\]" "" t)
                  "[/\\]" "." t)))
 
-    (vector (nnir-group-full-name group server)
+    (vector (gnus-group-full-name group server)
 	    (if (string= (gnus-group-server server) "nnmaildir")
 		(nnmaildir-base-name-to-article-number
 		 (substring article 0 (string-match ":" article))
@@ -696,16 +802,17 @@
 						    (nnir-imap-make-query
 						     criteria qstring)))))
 		      (mapc
-		       (lambda (artnum) (push (vector group artnum 1) artlist)
-			 (setq arts (1+ arts)))
-		       (and (car result)
-			    (delete 0 (mapcar #'string-to-number
-					      (cdr (assoc "SEARCH"
-							  (cdr result)))))))
+		       (lambda (artnum)
+			 (let ((artn (string-to-number artnum)))
+			   (when (> artn 0)
+			     (push (vector group artn 100)
+				   artlist)
+			     (setq arts (1+ arts)))))
+		       (and (car result) (cdr (assoc "SEARCH" (cdr result)))))
 		      (message "Searching %s... %d matches" group arts)))
 		  (message "Searching %s...done" group))
 	      (quit nil))
-	    artlist))
+	    (nreverse artlist)))
 	groups)))))
 
 (defun nnir-imap-make-query (criteria qstring)
@@ -1056,7 +1163,7 @@
             ;; Windows "\\" -> "."
             (setq group (gnus-replace-in-string group "\\\\" "."))
 
-            (push (vector (nnir-group-full-name group server)
+            (push (vector (gnus-group-full-name group server)
                           (string-to-number artno)
                           (string-to-number score))
                   artlist))))
@@ -1125,7 +1232,7 @@
 	      score (match-string 3))
 	(when (string-match prefix dirnam)
 	  (setq dirnam (replace-match "" t t dirnam)))
-	(push (vector (nnir-group-full-name
+	(push (vector (gnus-group-full-name
                        (gnus-replace-in-string dirnam "/" ".") server)
 		      (string-to-number artno)
 		      (string-to-number score))
@@ -1218,6 +1325,7 @@
 	 (directory (cadr (assoc sym (cddr method))))
 	 (regexp (cdr (assoc 'query query)))
 	 (grep-options (cdr (assoc 'grep-options query)))
+	 (grouplist (or grouplist (nnir-get-active server)))
 	 artlist)
     (unless directory
       (error "No directory found in method specification of server %s"
@@ -1283,7 +1391,7 @@
 						 (nreverse res))
 					       ".")))
 			 (push
-			  (vector (nnir-group-full-name group server) art 0)
+			  (vector (gnus-group-full-name group server) art 0)
 			  artlist))
 		       (forward-line 1)))
 		   (message "Searching %s using find-grep...done"
@@ -1297,16 +1405,15 @@
 ;; gmane interface
 (defun nnir-run-gmane (query srv &optional groups)
   "Run a search against a gmane back-end server."
-  (if (gnus-string-match-p "gmane" srv)
       (let* ((case-fold-search t)
 	     (qstring (cdr (assq 'query query)))
 	     (server (cadr (gnus-server-to-method srv)))
-	     (groupspec (if groups
-			    (mapconcat
-			     (function (lambda (x)
-					 (format "group:%s"
-						 (gnus-group-short-name x))))
-			     groups " ") ""))
+	     (groupspec (mapconcat
+			 (lambda (x)
+			   (if (gnus-string-match-p "gmane" x)
+			       (format "group:%s" (gnus-group-short-name x))
+			     (error "Can't search non-gmane groups: %s" x)))
+			   groups " "))
 	     (authorspec
 	      (if (assq 'author query)
 		  (format "author:%s" (cdr (assq 'author query))) ""))
@@ -1341,14 +1448,7 @@
 		      (string-to-number (match-string 2 xref)) xscore)
 		     artlist)))))
 	    (forward-line 1)))
-	;; Sort by score
-	(apply 'vector
-	       (sort artlist
-		     (function (lambda (x y)
-				 (> (nnir-artitem-rsv x)
-				    (nnir-artitem-rsv y)))))))
-    (message "Can't search non-gmane nntp groups")
-    nil))
+	(apply 'vector (nreverse (mm-delete-duplicates artlist)))))
 
 ;;; Util Code:
 
@@ -1380,33 +1480,34 @@
         (groups (if (string= "all-ephemeral" nserver)
 		    (with-current-buffer gnus-server-buffer
 		      (list (list (gnus-server-server-name))))
-		  (nnir-sort-groups-by-server
+		  (nnir-categorize
 		   (or gnus-group-marked
 		       (if (gnus-group-group-name)
 			   (list (gnus-group-group-name))
 			 (cdr (assoc (gnus-group-topic-name)
-				     gnus-topic-alist))))))))
+				     gnus-topic-alist))))
+		   gnus-group-server))))
     (apply 'vconcat
-           (mapcar (lambda (x)
-                     (let* ((server (car x))
-                            (nnir-search-engine
-                             (or (nnir-read-server-parm 'nnir-search-engine
-                                                        server)
-                                 (cdr (assoc (car
-                                              (gnus-server-to-method server))
-                                             nnir-method-default-engines))))
-                            search-func)
-                       (setq search-func (cadr
-                                          (assoc nnir-search-engine
-						 nnir-engines)))
-                       (if search-func
-			   (funcall search-func
-				    (if nnir-extra-parms
-					(nnir-read-parms q nnir-search-engine)
-				      q)
-				    server (cdr x))
-                         nil)))
-                   groups))))
+           (mapcar
+	    (lambda (x)
+	      (let* ((server (car x))
+		     (nnir-search-engine
+		      (or (nnir-read-server-parm 'nnir-search-engine
+						 server)
+			  (cdr (assoc (car
+				       (gnus-server-to-method server))
+				      nnir-method-default-engines))))
+		     search-func)
+		(setq search-func (cadr (assoc nnir-search-engine
+					       nnir-engines)))
+		(if search-func
+		    (funcall search-func
+			     (if nnir-extra-parms
+				 (nnir-read-parms q nnir-search-engine)
+			       q)
+			     server (cadr x))
+		  nil)))
+	    groups))))
 
 (defun nnir-read-server-parm (key server)
   "Returns the parameter value of key for the given server, where
@@ -1416,50 +1517,11 @@
     	   (nth 1 (assq key (cddr method))))
     	  (t nil))))
 
-(defun nnir-group-full-name (shortname server)
-  "For the given group name, return a full Gnus group name.
-The Gnus backend/server information is added."
-  (gnus-group-prefixed-name shortname (gnus-server-to-method server)))
-
 (defun nnir-possibly-change-server (server)
   (unless (and server (nnir-server-opened server))
     (nnir-open-server server)))
 
 
-;; Data type article list.
-
-(defun nnir-artlist-length (artlist)
-  "Returns number of articles in artlist."
-  (length artlist))
-
-(defun nnir-artlist-article (artlist n)
-  "Returns from ARTLIST the Nth artitem (counting starting at 1)."
-  (elt artlist (1- n)))
-
-(defun nnir-artitem-group (artitem)
-  "Returns the group from the ARTITEM."
-  (elt artitem 0))
-
-(defun nnir-artlist-artitem-group (artlist n)
-  "Returns from ARTLIST the group of the Nth artitem (counting from 1)."
-  (nnir-artitem-group (nnir-artlist-article artlist n)))
-
-(defun nnir-artitem-number (artitem)
-  "Returns the number from the ARTITEM."
-  (elt artitem 1))
-
-(defun nnir-artlist-artitem-number (artlist n)
-  "Returns from ARTLIST the number of the Nth artitem (counting from 1)."
-  (nnir-artitem-number (nnir-artlist-article artlist n)))
-
-(defun nnir-artitem-rsv (artitem)
-  "Returns the Retrieval Status Value (RSV, score) from the ARTITEM."
-  (elt artitem 2))
-
-(defun nnir-artlist-artitem-rsv (artlist n)
-  "Returns from ARTLIST the Retrieval Status Value of the Nth
-artitem (counting from 1)."
-  (nnir-artitem-rsv (nnir-artlist-article artlist n)))
 
 ;; unused?
 (defun nnir-artlist-groups (artlist)
@@ -1473,18 +1535,6 @@
             with-dups)
     res))
 
-(defun nnir-sort-groups-by-server (groups)
-  "sorts a list of groups into an alist keyed by server"
-(if (car groups)
-  (let (value)
-    (dolist (var groups value)
-      (let ((server (gnus-group-server var)))
-	(if (assoc server value)
-	    (nconc (cdr (assoc server value)) (list var))
-	  (push (cons server (list var)) value))))
-    value)
-  nil))
-
 (defun nnir-get-active (srv)
   (let ((method (gnus-server-to-method srv))
 	groups)
@@ -1493,19 +1543,62 @@
       (let ((cur (current-buffer))
 	    name)
 	(goto-char (point-min))
-	(unless (string= gnus-ignored-newsgroups "")
-	  (delete-matching-lines gnus-ignored-newsgroups))
-	(while (not (eobp))
-	  (ignore-errors
-	    (push (mm-string-as-unibyte
-		   (let ((p (point)))
-		     (skip-chars-forward "^ \t\\\\")
-		     (setq name (buffer-substring (+ p 1) (- (point) 1)))
-		     (gnus-group-full-name name method)))
-		  groups))
-	  (forward-line))))
+	(unless (string= nnir-ignored-newsgroups "")
+	  (delete-matching-lines nnir-ignored-newsgroups))
+	(if (eq (car method) 'nntp)
+	    (while (not (eobp))
+	      (ignore-errors
+		(push (mm-string-as-unibyte
+		       (gnus-group-full-name
+			(buffer-substring
+			 (point)
+			 (progn
+			   (skip-chars-forward "^ \t")
+			   (point))) method))
+		      groups))
+	      (forward-line))
+	  (while (not (eobp))
+	    (ignore-errors
+	      (push (mm-string-as-unibyte
+		     (if (eq (char-after) ?\")
+			 (gnus-group-full-name (read cur) method)
+		       (let ((p (point)) (name ""))
+			 (skip-chars-forward "^ \t\\\\")
+			 (setq name (buffer-substring p (point)))
+			 (while (eq (char-after) ?\\)
+			   (setq p (1+ (point)))
+			   (forward-char 2)
+			   (skip-chars-forward "^ \t\\\\")
+			   (setq name (concat name (buffer-substring
+						    p (point)))))
+			 (gnus-group-full-name name method))))
+		    groups))
+	    (forward-line)))))
     groups))
 
+(defun nnir-registry-action (action data-header from &optional to method)
+  "Call `gnus-registry-action' with the original article group."
+  (gnus-registry-action
+   action
+   data-header
+   (nnir-article-group (mail-header-number data-header))
+   to
+   method))
+
+(defun nnir-mode ()
+  (when (eq (car (gnus-find-method-for-group gnus-newsgroup-name)) 'nnir)
+    (setq gnus-summary-line-format
+	  (or nnir-summary-line-format gnus-summary-line-format))
+    (when (eq gnus-registry-install t)
+      (remove-hook 'gnus-summary-article-delete-hook 'gnus-registry-action t)
+      (remove-hook 'gnus-summary-article-move-hook 'gnus-registry-action t)
+      (remove-hook 'gnus-summary-article-expire-hook 'gnus-registry-action t)
+      (add-hook 'gnus-summary-article-delete-hook 'nnir-registry-action t t)
+      (add-hook 'gnus-summary-article-move-hook 'nnir-registry-action t t)
+      (add-hook 'gnus-summary-article-expire-hook 'nnir-registry-action t t))))
+
+
+
 ;; The end.
 (provide 'nnir)
 
--- a/lisp/gnus/nnmail.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/gnus/nnmail.el	Thu Dec 16 18:30:57 2010 -0500
@@ -1915,8 +1915,9 @@
     (unless (eq target 'delete)
       (when (or (gnus-request-group target)
 		(gnus-request-create-group target))
-	(let ((group-art (gnus-request-accept-article target nil t t)))
-	  (when (consp group-art)
+	(let ((group-art (gnus-request-accept-article target nil nil t)))
+	  (when (and (consp group-art)
+		     (cdr group-art))
 	    (gnus-group-mark-article-read target (cdr group-art))))))))
 
 (defun nnmail-fancy-expiry-target (group)
--- a/lisp/gnus/nnmaildir.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/gnus/nnmaildir.el	Thu Dec 16 18:30:57 2010 -0500
@@ -1559,7 +1559,7 @@
 		  (t (signal (car err) (cdr err))))))
 	     todo-marks))
 	  set-action (lambda (article)
-		       (funcall add-action)
+		       (funcall add-action article)
 		       (mapcar (lambda (mark)
 				 (unless (memq mark todo-marks)
 				   (funcall del-mark mark)))
@@ -1590,7 +1590,7 @@
 	(nnmaildir--nlist-iterate nlist ranges
 				  (cond ((eq 'del (cadr action)) del-action)
 					((eq 'add (cadr action)) add-action)
-					(t set-action))))
+					((eq 'set (cadr action)) set-action))))
       nil)))
 
 (defun nnmaildir-close-group (gname &optional server)
--- a/lisp/gnus/nnml.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/gnus/nnml.el	Thu Dec 16 18:30:57 2010 -0500
@@ -1033,19 +1033,7 @@
   (nnml-possibly-change-directory group server)
   (unless nnml-marks-is-evil
     (nnml-open-marks group server)
-    (dolist (action actions)
-      (let ((range (nth 0 action))
-	    (what  (nth 1 action))
-	    (marks (nth 2 action)))
-	(assert (or (eq what 'add) (eq what 'del)) nil
-		"Unknown request-set-mark action: %s" what)
-	(dolist (mark marks)
-	  (setq nnml-marks (gnus-update-alist-soft
-			    mark
-			    (funcall (if (eq what 'add) 'gnus-range-add
-				       'gnus-remove-from-range)
-				     (cdr (assoc mark nnml-marks)) range)
-			    nnml-marks)))))
+    (setq nnml-marks (nnheader-update-marks-actions nnml-marks actions))
     (nnml-save-marks group server))
   nil)
 
--- a/lisp/gnus/nnspool.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/gnus/nnspool.el	Thu Dec 16 18:30:57 2010 -0500
@@ -399,15 +399,16 @@
   "Read the head of ARTICLE, convert to NOV headers, and insert."
   (save-excursion
     (let ((cur (current-buffer))
-	  buf)
+          buf)
       (setq buf (nnheader-set-temp-buffer " *nnspool head*"))
       (when (nnheader-insert-head
-	     (nnspool-article-pathname nnspool-current-group article))
-	(nnheader-insert-article-line article)
-	(let ((headers (nnheader-parse-head)))
-	  (set-buffer cur)
-	  (goto-char (point-max))
-	  (nnheader-insert-nov headers)))
+             (nnspool-article-pathname nnspool-current-group article))
+        (nnheader-insert-article-line article)
+        (goto-char (point-min))
+        (let ((headers (nnheader-parse-head)))
+          (set-buffer cur)
+          (goto-char (point-max))
+          (nnheader-insert-nov headers)))
       (kill-buffer buf))))
 
 (defun nnspool-sift-nov-with-sed (articles file)
--- a/lisp/gnus/nntp.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/gnus/nntp.el	Thu Dec 16 18:30:57 2010 -0500
@@ -34,6 +34,7 @@
 (require 'nnoo)
 (require 'gnus-util)
 (require 'gnus)
+(require 'proto-stream)
 (require 'gnus-group) ;; gnus-group-name-charset
 
 (nnoo-declare nntp)
@@ -86,6 +87,8 @@
 
 Direct connections:
 - `nntp-open-network-stream' (the default),
+- `network-only' (the same as the above, but don't do automatic
+  STARTTLS upgrades).
 - `nntp-open-ssl-stream',
 - `nntp-open-tls-stream',
 - `nntp-open-netcat-stream'.
@@ -305,13 +308,6 @@
 (defvar nntp-async-timer nil)
 (defvar nntp-async-process-list nil)
 
-(defvar nntp-ssl-program
-  "openssl s_client -quiet -ssl3 -connect %s:%p"
-"A string containing commands for SSL connections.
-Within a string, %s is replaced with the server address and %p with
-port number on server.  The program should accept IMAP commands on
-stdin and return responses to stdout.")
-
 (defvar nntp-authinfo-rejected nil
 "A custom error condition used to report 'Authentication Rejected' errors.
 Condition handlers that match just this condition ensure that the nntp
@@ -404,7 +400,8 @@
       (cond ((looking-at "480")
 	     (nntp-handle-authinfo process))
 	    ((looking-at "482")
-	     (nnheader-report 'nntp (get 'nntp-authinfo-rejected 'error-message))
+	     (nnheader-report 'nntp "%s"
+			      (get 'nntp-authinfo-rejected 'error-message))
 	     (signal 'nntp-authinfo-rejected nil))
 	    ((looking-at "^.*\n")
 	     (delete-region (point) (progn (forward-line 1) (point)))))
@@ -1118,19 +1115,7 @@
 	     nntp-marks-file-name)
     (nntp-possibly-create-directory group server)
     (nntp-open-marks group server)
-    (dolist (action actions)
-      (let ((range (nth 0 action))
-	    (what  (nth 1 action))
-	    (marks (nth 2 action)))
-	(assert (or (eq what 'add) (eq what 'del)) nil
-		"Unknown request-set-mark action: %s" what)
-	(dolist (mark marks)
-	  (setq nntp-marks (gnus-update-alist-soft
-			    mark
-			    (funcall (if (eq what 'add) 'gnus-range-add
-				       'gnus-remove-from-range)
-				     (cdr (assoc mark nntp-marks)) range)
-			    nntp-marks)))))
+    (setq nntp-marks (nnheader-update-marks-actions nntp-marks actions))
     (nntp-save-marks group server))
   nil)
 
@@ -1280,11 +1265,29 @@
 		`(lambda ()
 		   (nntp-kill-buffer ,pbuffer)))))
 	 (process
-	  (condition-case ()
+	  (condition-case err
 	      (let ((coding-system-for-read nntp-coding-system-for-read)
-		    (coding-system-for-write nntp-coding-system-for-write))
-		(funcall nntp-open-connection-function pbuffer))
-	    (error nil)
+		    (coding-system-for-write nntp-coding-system-for-write)
+		    (map '((nntp-open-network-stream network)
+			   (network-only network-only)
+			   (nntp-open-ssl-stream tls)
+			   (nntp-open-tls-stream tls))))
+		(if (assoc nntp-open-connection-function map)
+		    (car (open-protocol-stream
+			  "nntpd" pbuffer nntp-address nntp-port-number
+			  :type (cadr
+				 (assoc nntp-open-connection-function map))
+			  :end-of-command "^\\([2345]\\|[.]\\).*\n"
+			  :capability-command "CAPABILITIES\r\n"
+			  :success "^3"
+			  :starttls-function
+			  (lambda (capabilities)
+			    (if (not (string-match "STARTTLS" capabilities))
+				nil
+			      "STARTTLS\r\n"))))
+		  (funcall nntp-open-connection-function pbuffer)))
+	    (error
+	     (nnheader-report 'nntp "%s" err))
 	    (quit
 	     (message "Quit opening connection to %s" nntp-address)
 	     (nntp-kill-buffer pbuffer)
@@ -1312,40 +1315,6 @@
 	(nntp-kill-buffer (process-buffer process))
 	nil))))
 
-(defun nntp-open-network-stream (buffer)
-  (open-network-stream "nntpd" buffer nntp-address nntp-port-number))
-
-(autoload 'format-spec "format-spec")
-(autoload 'format-spec-make "format-spec")
-(autoload 'open-tls-stream "tls")
-
-(defun nntp-open-ssl-stream (buffer)
-  (let* ((process-connection-type nil)
-	 (proc (start-process "nntpd" buffer
-			      shell-file-name
-			      shell-command-switch
-			      (format-spec nntp-ssl-program
-					   (format-spec-make
-					    ?s nntp-address
-					    ?p nntp-port-number)))))
-    (gnus-set-process-query-on-exit-flag proc nil)
-    (with-current-buffer buffer
-      (let ((nntp-connection-alist (list proc buffer nil)))
-	(nntp-wait-for-string "^\r*20[01]"))
-      (beginning-of-line)
-      (delete-region (point-min) (point))
-      proc)))
-
-(defun nntp-open-tls-stream (buffer)
-  (let ((proc (open-tls-stream "nntpd" buffer nntp-address nntp-port-number)))
-    (gnus-set-process-query-on-exit-flag proc nil)
-    (with-current-buffer buffer
-      (let ((nntp-connection-alist (list proc buffer nil)))
-	(nntp-wait-for-string "^\r*20[01]"))
-      (beginning-of-line)
-      (delete-region (point-min) (point))
-      proc)))
-
 (defun nntp-read-server-type ()
   "Find out what the name of the server we have connected to is."
   ;; Wait for the status string to arrive.
@@ -1446,7 +1415,7 @@
   (let ((message (buffer-string)))
     (while (string-match "[\r\n]+" message)
       (setq message (replace-match " " t t message)))
-    (nnheader-report 'nntp message)
+    (nnheader-report 'nntp "%s" message)
     message))
 
 (defun nntp-accept-process-output (process)
--- a/lisp/gnus/pop3.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/gnus/pop3.el	Thu Dec 16 18:30:57 2010 -0500
@@ -327,21 +327,22 @@
 	      ;; gnutls-cli, openssl don't accept service names
 	      (if (equal port "pop3")
 		  (setq port 110))
-	      (let ((process (starttls-open-stream "POP" (current-buffer)
-						   mailhost (or port 110))))
-		(pop3-send-command process "STLS")
-		(let ((response (pop3-read-response process t)))
-		  (if (and response (string-match "+OK" response))
-		      (starttls-negotiate process)
-		    (pop3-quit process)
-		    (error "POP server doesn't support starttls")))
-		process))
+	      ;; Delay STLS until server greeting is read (Bug#7438).
+	      (starttls-open-stream "POP" (current-buffer)
+				    mailhost (or port 110)))
 	     (t
 	      (open-network-stream "POP" (current-buffer) mailhost port))))
       (let ((response (pop3-read-response process t)))
 	(setq pop3-timestamp
 	      (substring response (or (string-match "<" response) 0)
 			 (+ 1 (or (string-match ">" response) -1)))))
+      (when (eq pop3-stream-type 'starttls)
+	(pop3-send-command process "STLS")
+	(let ((response (pop3-read-response process t)))
+	  (if (and response (string-match "+OK" response))
+	      (starttls-negotiate process)
+	    (pop3-quit process)
+	    (error "POP server doesn't support starttls"))))
       (pop3-set-process-query-on-exit-flag process nil)
       process)))
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lisp/gnus/proto-stream.el	Thu Dec 16 18:30:57 2010 -0500
@@ -0,0 +1,272 @@
+;;; proto-stream.el --- negotiating TLS, STARTTLS and other connections
+
+;; Copyright (C) 2010 Free Software Foundation, Inc.
+
+;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
+;; Keywords: network
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; This library is meant to provide the glue between modules that want
+;; to establish a network connection to a server for protocols such as
+;; IMAP, NNTP, SMTP and POP3.
+
+;; The main problem is that there's more than a couple of interfaces
+;; towards doing this.  You have normal, plain connections, which are
+;; no trouble at all, but you also have TLS/SSL connections, and you
+;; have STARTTLS.  Negotiating this for each protocol can be rather
+;; tedious, so this library provides a single entry point, and hides
+;; much of the ugliness.
+
+;; Usage example:
+
+;; (open-protocol-stream
+;;  "*nnimap*" buffer address port
+;;  :type 'network
+;;  :capability-command "1 CAPABILITY\r\n"
+;;  :success " OK "
+;;  :starttls-function
+;;  (lambda (capabilities)
+;;    (if (not (string-match "STARTTLS" capabilities))
+;;        nil
+;;      "1 STARTTLS\r\n")))
+
+;;; Code:
+
+(eval-when-compile
+  (require 'cl))
+(require 'tls)
+(require 'starttls)
+(require 'format-spec)
+
+(defcustom proto-stream-always-use-starttls (fboundp 'open-gnutls-stream)
+  "If non-nil, always try to upgrade network connections with STARTTLS."
+  :version "24.1"
+  :type 'boolean
+  :group 'comm)
+
+(declare-function gnutls-negotiate "gnutls"
+		  (proc type &optional priority-string trustfiles keyfiles))
+
+;;;###autoload
+(defun open-protocol-stream (name buffer host service &rest parameters)
+  "Open a network stream to HOST, upgrading to STARTTLS if possible.
+The first four parameters have the same meaning as in
+`open-network-stream'.  The function returns a list where the
+first element is the stream, the second element is the greeting
+the server replied with after connecting, and the third element
+is a string representing the capabilities of the server (if any).
+
+The PARAMETERS is a keyword list that can have the following
+values:
+
+:type -- either `network', `network-only, `tls', `shell' or
+`starttls'.  If omitted, the default is `network'.  `network'
+will be opportunistically upgraded to STARTTLS if both the server
+and Emacs supports it.  If you don't want STARTTLS upgrades, use
+`network-only'.
+
+:end-of-command -- a regexp saying what the end of a command is.
+This defaults to \"\\n\".
+
+:success -- a regexp saying whether the STARTTLS command was
+successful or not.  For instance, for NNTP this is \"^3\".
+
+:capability-command -- a string representing the command used to
+query server for capabilities.  For instance, for IMAP this is
+\"1 CAPABILITY\\r\\n\".
+
+:starttls-function -- a function that takes one parameter, which
+is the response to the capaibility command.  It should return nil
+if it turns out that the server doesn't support STARTTLS, or the
+command to switch on STARTTLS otherwise."
+  (let ((type (or (cadr (memq :type parameters)) 'network)))
+    (cond
+     ((eq type 'starttls)
+      (setq type 'network))
+     ((eq type 'ssl)
+      (setq type 'tls)))
+    (destructuring-bind (stream greeting capabilities)
+	(funcall (intern (format "proto-stream-open-%s" type) obarray)
+		 name buffer host service parameters)
+      (list (and stream
+		 (memq (process-status stream)
+		       '(open run))
+		 stream)
+	    greeting capabilities))))
+
+(defun proto-stream-open-network-only (name buffer host service parameters)
+  (let ((start (with-current-buffer buffer (point)))
+	(stream (open-network-stream name buffer host service)))
+    (list stream
+	  (proto-stream-get-response
+	   stream start (proto-stream-eoc parameters))
+	  nil)))
+
+(defun proto-stream-open-network (name buffer host service parameters)
+  (let* ((start (with-current-buffer buffer (point)))
+	 (stream (open-network-stream name buffer host service))
+	 (capability-command (cadr (memq :capability-command parameters)))
+	 (eoc (proto-stream-eoc parameters))
+	 (type (cadr (memq :type parameters)))
+	 (greeting (proto-stream-get-response stream start eoc))
+	 success)
+    (if (not capability-command)
+	(list stream greeting nil)
+      (let* ((capabilities
+	      (proto-stream-command stream capability-command eoc))
+	     (starttls-command
+	      (funcall (cadr (memq :starttls-function parameters))
+		       capabilities)))
+	(cond
+	  ;; If this server doesn't support STARTTLS, but we have
+	  ;; requested it explicitly, then close the connection and
+	  ;; return nil.
+	 ((or (not starttls-command)
+	      (and (not (eq type 'starttls))
+		   (not proto-stream-always-use-starttls)))
+	  (if (eq type 'starttls)
+	      (progn
+		(delete-process stream)
+		nil)
+	    ;; Otherwise, just return this plain network connection.
+	    (list stream greeting capabilities)))
+	 ;; We have some kind of STARTTLS support, so we try to
+	 ;; upgrade the connection opportunistically.
+	 ((or (fboundp 'open-gnutls-stream)
+	      (executable-find "gnutls-cli"))
+	  (unless (fboundp 'open-gnutls-stream)
+	    (delete-process stream)
+	    (setq start (with-current-buffer buffer (point-max)))
+	    (let* ((starttls-use-gnutls t)
+		   (starttls-extra-arguments
+		    (if (not (eq type 'starttls))
+			;; When doing opportunistic TLS upgrades we
+			;; don't really care about the identity of the
+			;; peer.
+			(cons "--insecure" starttls-extra-arguments)
+		      starttls-extra-arguments)))
+	      (setq stream (starttls-open-stream name buffer host service)))
+	    (proto-stream-get-response stream start eoc))
+	  (if (not
+	       (string-match
+		(cadr (memq :success parameters))
+		(proto-stream-command stream starttls-command eoc)))
+	      ;; We got an error back from the STARTTLS command.
+	      (progn
+		(if (eq type 'starttls)
+		    (progn
+		      (delete-process stream)
+		      nil)
+		  (list stream greeting capabilities)))
+	    ;; The server said it was OK to start doing STARTTLS negotiations.
+	    (if (fboundp 'open-gnutls-stream)
+		(gnutls-negotiate stream nil)
+	      (unless (starttls-negotiate stream)
+		(delete-process stream)
+		(setq stream nil)))
+	    (when (or (null stream)
+		      (not (memq (process-status stream)
+				 '(open run))))
+	      ;; It didn't successfully negotiate STARTTLS, so we reopen
+	      ;; the connection.
+	      (setq stream (open-network-stream name buffer host service))
+	      (proto-stream-get-response stream start eoc))
+	    ;; Re-get the capabilities, since they may have changed
+	    ;; after switching to TLS.
+	    (list stream greeting
+		  (proto-stream-command stream capability-command eoc))))
+	 ;; We don't have STARTTLS support available, but the caller
+	 ;; requested a STARTTLS connection, so we give up.
+	 ((eq (cadr (memq :type parameters)) 'starttls)
+	  (delete-process stream)
+	  nil)
+	 ;; Fall back on using a plain network stream.
+	 (t
+	  (list stream greeting capabilities)))))))
+
+(defun proto-stream-command (stream command eoc)
+  (let ((start (with-current-buffer (process-buffer stream) (point-max))))
+    (process-send-string stream command)
+    (proto-stream-get-response stream start eoc)))
+
+(defun proto-stream-get-response (stream start end-of-command)
+  (with-current-buffer (process-buffer stream)
+    (save-excursion
+      (goto-char start)
+      (while (and (memq (process-status stream)
+			'(open run))
+		  (not (re-search-forward end-of-command nil t)))
+	(accept-process-output stream 0 50)
+	(goto-char start))
+      (if (= start (point))
+	  ;; The process died; return nil.
+	  nil
+	;; Return the data we got back.
+	(buffer-substring start (point))))))
+
+(defun proto-stream-open-tls (name buffer host service parameters)
+  (with-current-buffer buffer
+    (let ((start (point-max))
+	  (stream
+	   (funcall (if (fboundp 'open-gnutls-stream)
+			'open-gnutls-stream
+		      'open-tls-stream)
+		    name buffer host service)))
+      (if (null stream)
+	  nil
+	;; If we're using tls.el, we have to delete the output from
+	;; openssl/gnutls-cli.
+	(unless (fboundp 'open-gnutls-stream)
+	  (proto-stream-get-response
+	   stream start (proto-stream-eoc parameters))
+	  (goto-char (point-min))
+	  (when (re-search-forward (proto-stream-eoc parameters) nil t)
+	    (goto-char (match-beginning 0))
+	    (delete-region (point-min) (line-beginning-position))))
+	(proto-stream-capability-open start stream parameters)))))
+
+(defun proto-stream-open-shell (name buffer host service parameters)
+  (proto-stream-capability-open
+   (with-current-buffer buffer (point))
+   (let ((process-connection-type nil))
+     (start-process name buffer shell-file-name
+		    shell-command-switch
+		    (format-spec
+		     (cadr (memq :shell-command parameters))
+		     (format-spec-make
+		      ?s host
+		      ?p service))))
+   parameters))
+
+(defun proto-stream-capability-open (start stream parameters)
+  (let ((capability-command (cadr (memq :capability-command parameters)))
+	(greeting (proto-stream-get-response
+		   stream start (proto-stream-eoc parameters))))
+    (list stream greeting
+	  (and capability-command
+	       (proto-stream-command
+		stream capability-command (proto-stream-eoc parameters))))))
+
+(defun proto-stream-eoc (parameters)
+  (or (cadr (memq :end-of-command parameters))
+      "\r\n"))
+
+(provide 'proto-stream)
+
+;;; proto-stream.el ends here
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lisp/gnus/rtree.el	Thu Dec 16 18:30:57 2010 -0500
@@ -0,0 +1,278 @@
+;;; rtree.el --- functions for manipulating range trees
+
+;; Copyright (C) 2010 Free Software Foundation, Inc.
+
+;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; A "range tree" is a binary tree that stores ranges.  They are
+;; similar to interval trees, but do not allow overlapping intervals.
+
+;; A range is an ordered list of number intervals, like this:
+
+;; ((10 . 25) 56 78 (98 . 201))
+
+;; Common operations, like lookup, deletion and insertion are O(n) in
+;; a range, but an rtree is O(log n) in all these operations.
+;; Transformation between a range and an rtree is O(n).
+
+;; The rtrees are quite simple.  The structure of each node is
+
+;; (cons (cons low high) (cons left right))
+
+;; That is, they are three cons cells, where the car of the top cell
+;; is the actual range, and the cdr has the left and right child.  The
+;; rtrees aren't automatically balanced, but are balanced when
+;; created, and can be rebalanced when deemed necessary.
+
+;;; Code:
+
+(eval-when-compile
+  (require 'cl))
+
+(defmacro rtree-make-node ()
+  `(list (list nil) nil))
+
+(defmacro rtree-set-left (node left)
+  `(setcar (cdr ,node) ,left))
+
+(defmacro rtree-set-right (node right)
+  `(setcdr (cdr ,node) ,right))
+
+(defmacro rtree-set-range (node range)
+  `(setcar ,node ,range))
+
+(defmacro rtree-low (node)
+  `(caar ,node))
+
+(defmacro rtree-high (node)
+  `(cdar ,node))
+
+(defmacro rtree-set-low (node number)
+  `(setcar (car ,node) ,number))
+
+(defmacro rtree-set-high (node number)
+  `(setcdr (car ,node) ,number))
+
+(defmacro rtree-left (node)
+  `(cadr ,node))
+
+(defmacro rtree-right (node)
+  `(cddr ,node))
+
+(defmacro rtree-range (node)
+  `(car ,node))
+
+(defsubst rtree-normalise-range (range)
+  (when (numberp range)
+    (setq range (cons range range)))
+  range)
+
+(defun rtree-make (range)
+  "Make an rtree from RANGE."
+  ;; Normalize the range.
+  (unless (listp (cdr-safe range))
+    (setq range (list range)))
+  (rtree-make-1 (cons nil range) (length range)))
+
+(defun rtree-make-1 (range length)
+  (let ((mid (/ length 2))
+	(node (rtree-make-node)))
+    (when (> mid 0)
+      (rtree-set-left node (rtree-make-1 range mid)))
+    (rtree-set-range node (rtree-normalise-range (cadr range)))
+    (setcdr range (cddr range))
+    (when (> (- length mid 1) 0)
+      (rtree-set-right node (rtree-make-1 range (- length mid 1))))
+    node))
+
+(defun rtree-memq (tree number)
+  "Return non-nil if NUMBER is present in TREE."
+  (while (and tree
+	      (not (and (>= number (rtree-low tree))
+			(<= number (rtree-high tree)))))
+    (setq tree
+	  (if (< number (rtree-low tree))
+	      (rtree-left tree)
+	    (rtree-right tree))))
+  tree)
+
+(defun rtree-add (tree number)
+  "Add NUMBER to TREE."
+  (while tree
+    (cond
+     ;; It's already present, so we don't have to do anything.
+     ((and (>= number (rtree-low tree))
+	   (<= number (rtree-high tree)))
+      (setq tree nil))
+     ((< number (rtree-low tree))
+      (cond
+       ;; Extend the low range.
+       ((= number (1- (rtree-low tree)))
+	(rtree-set-low tree number)
+	;; Check whether we need to merge this node with the child.
+	(when (and (rtree-left tree)
+		   (= (rtree-high (rtree-left tree)) (1- number)))
+	  ;; Extend the range to the low from the child.
+	  (rtree-set-low tree (rtree-low (rtree-left tree)))
+	  ;; The child can't have a right child, so just transplant the
+	  ;; child's left tree to our left tree.
+	  (rtree-set-left tree (rtree-left (rtree-left tree))))
+	(setq tree nil))
+       ;; Descend further to the left.
+       ((rtree-left tree)
+	(setq tree (rtree-left tree)))
+       ;; Add a new node.
+       (t
+	(let ((new-node (rtree-make-node)))
+	  (rtree-set-low new-node number)
+	  (rtree-set-high new-node number)
+	  (rtree-set-left tree new-node)
+	  (setq tree nil)))))
+     (t
+      (cond
+       ;; Extend the high range.
+       ((= number (1+ (rtree-high tree)))
+	(rtree-set-high tree number)
+	;; Check whether we need to merge this node with the child.
+	(when (and (rtree-right tree)
+		   (= (rtree-low (rtree-right tree)) (1+ number)))
+	  ;; Extend the range to the high from the child.
+	  (rtree-set-high tree (rtree-high (rtree-right tree)))
+	  ;; The child can't have a left child, so just transplant the
+	  ;; child's left right to our right tree.
+	  (rtree-set-right tree (rtree-right (rtree-right tree))))
+	(setq tree nil))
+       ;; Descend further to the right.
+       ((rtree-right tree)
+	(setq tree (rtree-right tree)))
+       ;; Add a new node.
+       (t
+	(let ((new-node (rtree-make-node)))
+	  (rtree-set-low new-node number)
+	  (rtree-set-high new-node number)
+	  (rtree-set-right tree new-node)
+	  (setq tree nil))))))))
+
+(defun rtree-delq (tree number)
+  "Remove NUMBER from TREE destructively.  Returns the new tree."
+  (let ((result tree)
+	prev)
+    (while tree
+      (cond
+       ((< number (rtree-low tree))
+	(setq prev tree
+	      tree (rtree-left tree)))
+       ((> number (rtree-high tree))
+	(setq prev tree
+	      tree (rtree-right tree)))
+       ;; The number is in this node.
+       (t
+	(cond
+	 ;; The only entry; delete the node.
+	 ((= (rtree-low tree) (rtree-high tree))
+	  (cond
+	   ;; Two children.  Replace with successor value.
+	   ((and (rtree-left tree) (rtree-right tree))
+	    (let ((parent tree)
+		  (successor (rtree-right tree)))
+	      (while (rtree-left successor)
+		(setq parent successor
+		      successor (rtree-left successor)))
+	      ;; We now have the leftmost child of our right child.
+	      (rtree-set-range tree (rtree-range successor))
+	      ;; Transplant the child (if any) to the parent.
+	      (rtree-set-left parent (rtree-right successor))))
+	   (t
+	    (let ((rest (or (rtree-left tree)
+			    (rtree-right tree))))
+	      ;; One or zero children.  Remove the node.
+	      (cond
+	       ((null prev)
+		(setq result rest))
+	       ((eq (rtree-left prev) tree)
+		(rtree-set-left prev rest))
+	       (t
+		(rtree-set-right prev rest)))))))
+	 ;; The lowest in the range; just adjust.
+	 ((= number (rtree-low tree))
+	  (rtree-set-low tree (1+ number)))
+	 ;; The highest in the range; just adjust.
+	 ((= number (rtree-high tree))
+	  (rtree-set-high tree (1- number)))
+	 ;; We have to split this range.
+	 (t
+	  (let ((new-node (rtree-make-node)))
+	    (rtree-set-low new-node (rtree-low tree))
+	    (rtree-set-high new-node (1- number))
+	    (rtree-set-low tree (1+ number))
+	    (cond
+	     ;; Two children; insert the new node as the predecessor
+	     ;; node.
+	     ((and (rtree-left tree) (rtree-right tree))
+	      (let ((predecessor (rtree-left tree)))
+		(while (rtree-right predecessor)
+		  (setq predecessor (rtree-right predecessor)))
+		(rtree-set-right predecessor new-node)))
+	     ((rtree-left tree)
+	      (rtree-set-right new-node tree)
+	      (rtree-set-left new-node (rtree-left tree))
+	      (rtree-set-left tree nil)
+	      (cond
+	       ((null prev)
+		(setq result new-node))
+	       ((eq (rtree-left prev) tree)
+		(rtree-set-left prev new-node))
+	       (t
+		(rtree-set-right prev new-node))))
+	     (t
+	      (rtree-set-left tree new-node))))))
+	(setq tree nil))))
+    result))
+
+(defun rtree-extract (tree)
+  "Convert TREE to range form."
+  (let (stack result)
+    (while (or stack
+	       tree)
+      (if tree
+	  (progn
+	    (push tree stack)
+	    (setq tree (rtree-right tree)))
+	(setq tree (pop stack))
+	(push (if (= (rtree-low tree)
+		     (rtree-high tree))
+		  (rtree-low tree)
+		(rtree-range tree))
+	      result)
+	(setq tree (rtree-left tree))))
+    result))
+
+(defun rtree-length (tree)
+  "Return the number of numbers stored in TREE."
+  (if (null tree)
+      0
+    (+ (rtree-length (rtree-left tree))
+       (1+ (- (rtree-high tree)
+	      (rtree-low tree)))
+       (rtree-length (rtree-right tree)))))
+
+(provide 'rtree)
+
+;;; rtree.el ends here
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lisp/gnus/shr-color.el	Thu Dec 16 18:30:57 2010 -0500
@@ -0,0 +1,361 @@
+;;; shr-color.el --- Simple HTML Renderer color management
+
+;; Copyright (C) 2010 Free Software Foundation, Inc.
+
+;; Author: Julien Danjou <julien@danjou.info>
+;; Keywords: html
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; This package handles colors display for shr.
+
+;;; Code:
+
+(require 'color)
+(eval-when-compile (require 'cl))
+
+(defgroup shr-color nil
+  "Simple HTML Renderer colors"
+  :group 'shr)
+
+(defcustom shr-color-visible-luminance-min 40
+  "Minimum luminance distance between two colors to be considered visible.
+Must be between 0 and 100."
+  :group 'shr
+  :type 'float)
+
+(defcustom shr-color-visible-distance-min 5
+  "Minimum color distance between two colors to be considered visible.
+This value is used to compare result for `ciede2000'. Its an
+absolute value without any unit."
+  :group 'shr
+  :type 'integer)
+
+(defconst shr-color-html-colors-alist
+  '(("AliceBlue" . "#F0F8FF")
+    ("AntiqueWhite" . "#FAEBD7")
+    ("Aqua" . "#00FFFF")
+    ("Aquamarine" . "#7FFFD4")
+    ("Azure" . "#F0FFFF")
+    ("Beige" . "#F5F5DC")
+    ("Bisque" . "#FFE4C4")
+    ("Black" . "#000000")
+    ("BlanchedAlmond" . "#FFEBCD")
+    ("Blue" . "#0000FF")
+    ("BlueViolet" . "#8A2BE2")
+    ("Brown" . "#A52A2A")
+    ("BurlyWood" . "#DEB887")
+    ("CadetBlue" . "#5F9EA0")
+    ("Chartreuse" . "#7FFF00")
+    ("Chocolate" . "#D2691E")
+    ("Coral" . "#FF7F50")
+    ("CornflowerBlue" . "#6495ED")
+    ("Cornsilk" . "#FFF8DC")
+    ("Crimson" . "#DC143C")
+    ("Cyan" . "#00FFFF")
+    ("DarkBlue" . "#00008B")
+    ("DarkCyan" . "#008B8B")
+    ("DarkGoldenRod" . "#B8860B")
+    ("DarkGray" . "#A9A9A9")
+    ("DarkGrey" . "#A9A9A9")
+    ("DarkGreen" . "#006400")
+    ("DarkKhaki" . "#BDB76B")
+    ("DarkMagenta" . "#8B008B")
+    ("DarkOliveGreen" . "#556B2F")
+    ("Darkorange" . "#FF8C00")
+    ("DarkOrchid" . "#9932CC")
+    ("DarkRed" . "#8B0000")
+    ("DarkSalmon" . "#E9967A")
+    ("DarkSeaGreen" . "#8FBC8F")
+    ("DarkSlateBlue" . "#483D8B")
+    ("DarkSlateGray" . "#2F4F4F")
+    ("DarkSlateGrey" . "#2F4F4F")
+    ("DarkTurquoise" . "#00CED1")
+    ("DarkViolet" . "#9400D3")
+    ("DeepPink" . "#FF1493")
+    ("DeepSkyBlue" . "#00BFFF")
+    ("DimGray" . "#696969")
+    ("DimGrey" . "#696969")
+    ("DodgerBlue" . "#1E90FF")
+    ("FireBrick" . "#B22222")
+    ("FloralWhite" . "#FFFAF0")
+    ("ForestGreen" . "#228B22")
+    ("Fuchsia" . "#FF00FF")
+    ("Gainsboro" . "#DCDCDC")
+    ("GhostWhite" . "#F8F8FF")
+    ("Gold" . "#FFD700")
+    ("GoldenRod" . "#DAA520")
+    ("Gray" . "#808080")
+    ("Grey" . "#808080")
+    ("Green" . "#008000")
+    ("GreenYellow" . "#ADFF2F")
+    ("HoneyDew" . "#F0FFF0")
+    ("HotPink" . "#FF69B4")
+    ("IndianRed" . "#CD5C5C")
+    ("Indigo" . "#4B0082")
+    ("Ivory" . "#FFFFF0")
+    ("Khaki" . "#F0E68C")
+    ("Lavender" . "#E6E6FA")
+    ("LavenderBlush" . "#FFF0F5")
+    ("LawnGreen" . "#7CFC00")
+    ("LemonChiffon" . "#FFFACD")
+    ("LightBlue" . "#ADD8E6")
+    ("LightCoral" . "#F08080")
+    ("LightCyan" . "#E0FFFF")
+    ("LightGoldenRodYellow" . "#FAFAD2")
+    ("LightGray" . "#D3D3D3")
+    ("LightGrey" . "#D3D3D3")
+    ("LightGreen" . "#90EE90")
+    ("LightPink" . "#FFB6C1")
+    ("LightSalmon" . "#FFA07A")
+    ("LightSeaGreen" . "#20B2AA")
+    ("LightSkyBlue" . "#87CEFA")
+    ("LightSlateGray" . "#778899")
+    ("LightSlateGrey" . "#778899")
+    ("LightSteelBlue" . "#B0C4DE")
+    ("LightYellow" . "#FFFFE0")
+    ("Lime" . "#00FF00")
+    ("LimeGreen" . "#32CD32")
+    ("Linen" . "#FAF0E6")
+    ("Magenta" . "#FF00FF")
+    ("Maroon" . "#800000")
+    ("MediumAquaMarine" . "#66CDAA")
+    ("MediumBlue" . "#0000CD")
+    ("MediumOrchid" . "#BA55D3")
+    ("MediumPurple" . "#9370D8")
+    ("MediumSeaGreen" . "#3CB371")
+    ("MediumSlateBlue" . "#7B68EE")
+    ("MediumSpringGreen" . "#00FA9A")
+    ("MediumTurquoise" . "#48D1CC")
+    ("MediumVioletRed" . "#C71585")
+    ("MidnightBlue" . "#191970")
+    ("MintCream" . "#F5FFFA")
+    ("MistyRose" . "#FFE4E1")
+    ("Moccasin" . "#FFE4B5")
+    ("NavajoWhite" . "#FFDEAD")
+    ("Navy" . "#000080")
+    ("OldLace" . "#FDF5E6")
+    ("Olive" . "#808000")
+    ("OliveDrab" . "#6B8E23")
+    ("Orange" . "#FFA500")
+    ("OrangeRed" . "#FF4500")
+    ("Orchid" . "#DA70D6")
+    ("PaleGoldenRod" . "#EEE8AA")
+    ("PaleGreen" . "#98FB98")
+    ("PaleTurquoise" . "#AFEEEE")
+    ("PaleVioletRed" . "#D87093")
+    ("PapayaWhip" . "#FFEFD5")
+    ("PeachPuff" . "#FFDAB9")
+    ("Peru" . "#CD853F")
+    ("Pink" . "#FFC0CB")
+    ("Plum" . "#DDA0DD")
+    ("PowderBlue" . "#B0E0E6")
+    ("Purple" . "#800080")
+    ("Red" . "#FF0000")
+    ("RosyBrown" . "#BC8F8F")
+    ("RoyalBlue" . "#4169E1")
+    ("SaddleBrown" . "#8B4513")
+    ("Salmon" . "#FA8072")
+    ("SandyBrown" . "#F4A460")
+    ("SeaGreen" . "#2E8B57")
+    ("SeaShell" . "#FFF5EE")
+    ("Sienna" . "#A0522D")
+    ("Silver" . "#C0C0C0")
+    ("SkyBlue" . "#87CEEB")
+    ("SlateBlue" . "#6A5ACD")
+    ("SlateGray" . "#708090")
+    ("SlateGrey" . "#708090")
+    ("Snow" . "#FFFAFA")
+    ("SpringGreen" . "#00FF7F")
+    ("SteelBlue" . "#4682B4")
+    ("Tan" . "#D2B48C")
+    ("Teal" . "#008080")
+    ("Thistle" . "#D8BFD8")
+    ("Tomato" . "#FF6347")
+    ("Turquoise" . "#40E0D0")
+    ("Violet" . "#EE82EE")
+    ("Wheat" . "#F5DEB3")
+    ("White" . "#FFFFFF")
+    ("WhiteSmoke" . "#F5F5F5")
+    ("Yellow" . "#FFFF00")
+    ("YellowGreen" . "#9ACD32"))
+  "Alist of HTML colors.
+Each entry should have the form (COLOR-NAME . HEXADECIMAL-COLOR).")
+
+(defun shr-color-relative-to-absolute (number)
+  "Convert a relative NUMBER to absolute. If NUMBER is absolute, return NUMBER.
+This will convert \"80 %\" to 204, \"100 %\" to 255 but \"123\" to \"123\"."
+  (let ((string-length (- (length number) 1)))
+    ;; Is this a number with %?
+    (if (eq (elt number string-length) ?%)
+        (/ (* (string-to-number (substring number 0 string-length)) 255) 100)
+      (string-to-number number))))
+
+(defun shr-color-hue-to-rgb (x y h)
+  "Convert X Y H to RGB value."
+  (when (< h 0) (incf h))
+  (when (> h 1) (decf h))
+  (cond ((< h (/ 1 6.0)) (+ x (* (- y x) h 6)))
+        ((< h 0.5) y)
+        ((< h (/ 2.0 3.0)) (+ x (* (- y x) (- (/ 2.0 3.0) h) 6)))
+        (t x)))
+
+(defun shr-color-hsl-to-rgb-fractions (h s l)
+  "Convert H S L to fractional RGB values."
+  (let (m1 m2)
+    (if (<= l 0.5)
+        (setq m2 (* l (+ s 1)))
+        (setq m2 (- (+ l s) (* l s))))
+    (setq m1 (- (* l 2) m2))
+    (list (shr-color-hue-to-rgb m1 m2 (+ h (/ 1 3.0)))
+	  (shr-color-hue-to-rgb m1 m2 h)
+	  (shr-color-hue-to-rgb m1 m2 (- h (/ 1 3.0))))))
+
+(defun shr-color->hexadecimal (color)
+  "Convert any color format to hexadecimal representation.
+Like rgb() or hsl()."
+  (when color
+    (cond
+     ;; Hexadecimal color: #abc or #aabbcc
+     ((string-match
+       "\\(#[0-9a-fA-F]\\{3\\}[0-9a-fA-F]\\{3\\}?\\)"
+       color)
+      (match-string 1 color))
+     ;; rgb() or rgba() colors
+     ((or (string-match
+           "rgb(\s*\\([0-9]\\{1,3\\}\\(?:\s*%\\)?\\)\s*,\s*\\([0-9]\\{1,3\\}\\(?:\s*%\\)?\\)\s*,\s*\\([0-9]\\{1,3\\}\\(?:\s*%\\)?\\)\s*)"
+           color)
+          (string-match
+           "rgba(\s*\\([0-9]\\{1,3\\}\\(?:\s*%\\)?\\)\s*,\s*\\([0-9]\\{1,3\\}\\(?:\s*%\\)?\\)\s*,\s*\\([0-9]\\{1,3\\}\\(?:\s*%\\)?\\)\s*,\s*[0-9]*\.?[0-9]+\s*%?\s*)"
+           color))
+      (format "#%02X%02X%02X"
+              (shr-color-relative-to-absolute (match-string-no-properties 1 color))
+              (shr-color-relative-to-absolute (match-string-no-properties 2 color))
+              (shr-color-relative-to-absolute (match-string-no-properties 3 color))))
+     ;; hsl() or hsla() colors
+     ((or (string-match
+           "hsl(\s*\\([0-9]\\{1,3\\}\\)\s*,\s*\\([0-9]\\{1,3\\}\\)\s*%\s*,\s*\\([0-9]\\{1,3\\}\\)\s*%\s*)"
+           color)
+          (string-match
+           "hsla(\s*\\([0-9]\\{1,3\\}\\)\s*,\s*\\([0-9]\\{1,3\\}\\)\s*%\s*,\s*\\([0-9]\\{1,3\\}\\)\s*%\s*,\s*[0-9]*\.?[0-9]+\s*%?\s*)"
+           color))
+      (let ((h (/ (string-to-number (match-string-no-properties 1 color)) 360.0))
+            (s (/ (string-to-number (match-string-no-properties 2 color)) 100.0))
+            (l (/ (string-to-number (match-string-no-properties 3 color)) 100.0)))
+        (destructuring-bind (r g b)
+            (shr-color-hsl-to-rgb-fractions h s l)
+          (color-rgb->hex r g b))))
+     ;; Color names
+     ((cdr (assoc-string color shr-color-html-colors-alist t)))
+     ;; Unrecognized color :(
+     (t
+      nil))))
+
+(defun set-minimum-interval (val1 val2 min max interval &optional fixed)
+  "Set minimum interval between VAL1 and VAL2 to INTERVAL.
+The values are bound by MIN and MAX.
+If FIXED is t, then val1 will not be touched."
+  (let ((diff (abs (- val1 val2))))
+    (unless (>= diff interval)
+      (if fixed
+          (let* ((missing (- interval diff))
+                 ;; If val2 > val1, try to increase val2
+                 ;; That's the "good direction"
+                 (val2-good-direction
+                  (if (> val2 val1)
+                      (min max (+ val2 missing))
+                    (max min (- val2 missing))))
+                 (diff-val2-good-direction-val1 (abs (- val2-good-direction val1))))
+            (if (>= diff-val2-good-direction-val1 interval)
+                (setq val2 val2-good-direction)
+              ;; Good-direction is not so good, compute bad-direction
+              (let* ((val2-bad-direction
+                      (if (> val2 val1)
+                          (max min (- val1 interval))
+                        (min max (+ val1 interval))))
+                     (diff-val2-bad-direction-val1 (abs (- val2-bad-direction val1))))
+                (if (>= diff-val2-bad-direction-val1 interval)
+                    (setq val2 val2-bad-direction)
+                  ;; Still not good, pick the best and prefer good direction
+                  (setq val2
+                        (if (>= diff-val2-good-direction-val1 diff-val2-bad-direction-val1)
+                            val2-good-direction
+                          val2-bad-direction))))))
+        ;; No fixed, move val1 and val2
+        (let ((missing (/ (- interval diff) 2.0)))
+          (if (< val1 val2)
+              (setq val1 (max min (- val1 missing))
+                    val2 (min max (+ val2 missing)))
+            (setq val2 (max min (- val2 missing))
+                  val1 (min max (+ val1 missing))))
+          (setq diff (abs (- val1 val2)))   ; Recompute diff
+          (unless (>= diff interval)
+            ;; Not ok, we hit a boundary
+            (let ((missing (- interval diff)))
+              (cond ((= val1 min)
+                     (setq val2 (+ val2 missing)))
+                    ((= val2 min)
+                     (setq val1 (+ val1 missing)))
+                    ((= val1 max)
+                     (setq val2 (- val2 missing)))
+                    ((= val2 max)
+                     (setq val1 (- val1 missing)))))))))
+    (list val1 val2)))
+
+(defun shr-color-visible (bg fg &optional fixed-background)
+  "Check that BG and FG colors are visible if they are drawn on each other.
+Return (bg fg) if they are. If they are too similar, two new
+colors are returned instead.
+If FIXED-BACKGROUND is set, and if the color are not visible, a
+new background color will not be computed. Only the foreground
+color will be adapted to be visible on BG."
+  ;; Convert fg and bg to CIE Lab
+  (let ((fg-norm (color-rgb->normalize fg))
+	(bg-norm (color-rgb->normalize bg)))
+    (if (or (null fg-norm)
+	    (null bg-norm))
+	(list bg fg)
+      (let* ((fg-lab (apply 'color-srgb->lab fg-norm))
+	     (bg-lab (apply 'color-srgb->lab bg-norm))
+	     ;; Compute color distance using CIE DE 2000
+	     (fg-bg-distance (color-cie-de2000 fg-lab bg-lab))
+	     ;; Compute luminance distance (substract L component)
+	     (luminance-distance (abs (- (car fg-lab) (car bg-lab)))))
+	(if (and (>= fg-bg-distance shr-color-visible-distance-min)
+		 (>= luminance-distance shr-color-visible-luminance-min))
+	    (list bg fg)
+	  ;; Not visible, try to change luminance to make them visible
+	  (let ((Ls (set-minimum-interval (car bg-lab) (car fg-lab) 0 100
+					  shr-color-visible-luminance-min
+					  fixed-background)))
+	    (unless fixed-background
+	      (setcar bg-lab (car Ls)))
+	    (setcar fg-lab (cadr Ls))
+	    (list
+	     (if fixed-background
+		 bg
+	       (apply 'format "#%02x%02x%02x"
+		      (mapcar (lambda (x) (* (max (min 1 x) 0) 255))
+			      (apply 'color-lab->srgb bg-lab))))
+	     (apply 'format "#%02x%02x%02x"
+		    (mapcar (lambda (x) (* (max (min 1 x) 0) 255))
+			    (apply 'color-lab->srgb fg-lab))))))))))
+
+(provide 'shr-color)
+
+;;; shr-color.el ends here
--- a/lisp/gnus/shr.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/gnus/shr.el	Thu Dec 16 18:30:57 2010 -0500
@@ -32,8 +32,6 @@
 
 (eval-when-compile (require 'cl))
 (require 'browse-url)
-(unless (aref (char-category-set (make-char 'japanese-jisx0208 33 35)) ?>)
-  (load "kinsoku" nil t))
 
 (defgroup shr nil
   "Simple HTML Renderer"
@@ -96,6 +94,7 @@
 (defvar shr-content-cache nil)
 (defvar shr-kinsoku-shorten nil)
 (defvar shr-table-depth 0)
+(defvar shr-stylesheet nil)
 
 (defvar shr-map
   (let ((map (make-sparse-keymap)))
@@ -191,10 +190,23 @@
     (nreverse result)))
 
 (defun shr-descend (dom)
-  (let ((function (intern (concat "shr-tag-" (symbol-name (car dom))) obarray)))
+  (let ((function (intern (concat "shr-tag-" (symbol-name (car dom))) obarray))
+	(style (cdr (assq :style (cdr dom))))
+	(shr-stylesheet shr-stylesheet)
+	(start (point)))
+    (when style
+      (if (string-match "color" style)
+	  (setq shr-stylesheet (nconc (shr-parse-style style)
+				      shr-stylesheet))
+	(setq style nil)))
     (if (fboundp function)
 	(funcall function (cdr dom))
-      (shr-generic (cdr dom)))))
+      (shr-generic (cdr dom)))
+    ;; If style is set, then this node has set the color.
+    (when style
+      (shr-colorize-region start (point)
+			   (cdr (assq 'color shr-stylesheet))
+			   (cdr (assq 'background-color shr-stylesheet))))))
 
 (defun shr-generic (cont)
   (dolist (sub cont)
@@ -204,6 +216,26 @@
      ((listp (cdr sub))
       (shr-descend sub)))))
 
+(defmacro shr-char-breakable-p (char)
+  "Return non-nil if a line can be broken before and after CHAR."
+  `(aref fill-find-break-point-function-table ,char))
+(defmacro shr-char-nospace-p (char)
+  "Return non-nil if no space is required before and after CHAR."
+  `(aref fill-nospace-between-words-table ,char))
+
+;; KINSOKU is a Japanese word meaning a rule that should not be violated.
+;; In Emacs, it is a term used for characters, e.g. punctuation marks,
+;; parentheses, and so on, that should not be placed in the beginning
+;; of a line or the end of a line.
+(defmacro shr-char-kinsoku-bol-p (char)
+  "Return non-nil if a line ought not to begin with CHAR."
+  `(aref (char-category-set ,char) ?>))
+(defmacro shr-char-kinsoku-eol-p (char)
+  "Return non-nil if a line ought not to end with CHAR."
+  `(aref (char-category-set ,char) ?<))
+(unless (shr-char-kinsoku-bol-p (make-char 'japanese-jisx0208 33 35))
+  (load "kinsoku" nil t))
+
 (defun shr-insert (text)
   (when (and (eq shr-state 'image)
 	     (not (string-match "\\`[ \t\n]+\\'" text)))
@@ -221,24 +253,24 @@
       (when (and (bolp)
 		 (> shr-indentation 0))
 	(shr-indent))
+      ;; No space is needed behind a wide character categorized as
+      ;; kinsoku-bol, between characters both categorized as nospace,
+      ;; or at the beginning of a line.
+      (let (prev)
+	(when (and (> (current-column) shr-indentation)
+		   (eq (preceding-char) ? )
+		   (or (= (line-beginning-position) (1- (point)))
+		       (and (shr-char-breakable-p
+			     (setq prev (char-after (- (point) 2))))
+			    (shr-char-kinsoku-bol-p prev))
+		       (and (shr-char-nospace-p prev)
+			    (shr-char-nospace-p (aref elem 0)))))
+	  (delete-char -1)))
       ;; The shr-start is a special variable that is used to pass
       ;; upwards the first point in the buffer where the text really
       ;; starts.
       (unless shr-start
 	(setq shr-start (point)))
-      ;; No space is needed behind a wide character categorized as
-      ;; kinsoku-bol, between characters both categorized as nospace,
-      ;; or at the beginning of a line.
-      (let (prev)
-	(when (and (eq (preceding-char) ? )
-		   (or (= (line-beginning-position) (1- (point)))
-		       (and (aref fill-find-break-point-function-table
-				  (setq prev (char-after (- (point) 2))))
-			    (aref (char-category-set prev) ?>))
-		       (and (aref fill-nospace-between-words-table prev)
-			    (aref fill-nospace-between-words-table
-				  (aref elem 0)))))
-	  (delete-char -1)))
       (insert elem)
       (let (found)
 	(while (and (> (current-column) shr-width)
@@ -263,44 +295,88 @@
 (defun shr-find-fill-point ()
   (when (> (move-to-column shr-width) shr-width)
     (backward-char 1))
-  (let (failed)
-    (while (not
-	    (or (setq failed (= (current-column) shr-indentation))
-		(eq (preceding-char) ? )
-		(eq (following-char) ? )
-		(aref fill-find-break-point-function-table (preceding-char))))
+  (let ((bp (point))
+	failed)
+    (while (not (or (setq failed (= (current-column) shr-indentation))
+		    (eq (preceding-char) ? )
+		    (eq (following-char) ? )
+		    (shr-char-breakable-p (preceding-char))
+		    (shr-char-breakable-p (following-char))
+		    (if (eq (preceding-char) ?')
+			(not (memq (char-after (- (point) 2))
+				   (list nil ?\n ? )))
+		      (and (shr-char-kinsoku-bol-p (preceding-char))
+			   (shr-char-breakable-p (following-char))
+			   (not (shr-char-kinsoku-bol-p (following-char)))))
+		    (shr-char-kinsoku-eol-p (following-char))))
       (backward-char 1))
+    (if (and (not (or failed (eolp)))
+	     (eq (preceding-char) ?'))
+	(while (not (or (setq failed (eolp))
+			(eq (following-char) ? )
+			(shr-char-breakable-p (following-char))
+			(shr-char-kinsoku-eol-p (following-char))))
+	  (forward-char 1)))
     (if failed
 	;; There's no breakable point, so we give it up.
-	(progn
-	  (end-of-line)
-	  (while (aref fill-find-break-point-function-table (preceding-char))
-	    (backward-char 1))
-	  nil)
-      (or (eolp)
-	  ;; Don't put kinsoku-bol characters at the beginning of a line,
-	  ;; or kinsoku-eol characters at the end of a line,
-	  (let ((count 4))
-	    (if (or shr-kinsoku-shorten
-		    (and (aref (char-category-set (preceding-char)) ?<)
-			 (progn
-			   (setq count (1- count))
-			   (backward-char 1)
-			   t)))
-		(while (and
-			(>= (setq count (1- count)) 0)
+	(let (found)
+	  (goto-char bp)
+	  (unless shr-kinsoku-shorten
+	    (while (and (setq found (re-search-forward
+				     "\\(\\c>\\)\\| \\|\\c<\\|\\c|"
+				     (line-end-position) 'move))
+			(eq (preceding-char) ?')))
+	    (if (and found (not (match-beginning 1)))
+		(goto-char (match-beginning 0)))))
+      (or
+       (eolp)
+       ;; Don't put kinsoku-bol characters at the beginning of a line,
+       ;; or kinsoku-eol characters at the end of a line.
+       (cond
+	(shr-kinsoku-shorten
+	 (while (and (not (memq (preceding-char) (list ?\C-@ ?\n ? )))
+		     (shr-char-kinsoku-eol-p (preceding-char)))
+	   (backward-char 1))
+	 (when (setq failed (= (current-column) shr-indentation))
+	   ;; There's no breakable point that doesn't violate kinsoku,
+	   ;; so we look for the second best position.
+	   (while (and (progn
+			 (forward-char 1)
+			 (<= (current-column) shr-width))
+		       (progn
+			 (setq bp (point))
+			 (shr-char-kinsoku-eol-p (following-char)))))
+	   (goto-char bp)))
+	((shr-char-kinsoku-eol-p (preceding-char))
+	 (if (shr-char-kinsoku-eol-p (following-char))
+	     ;; There are consecutive kinsoku-eol characters.
+	     (setq failed t)
+	   (let ((count 4))
+	     (while
+		 (progn
+		   (backward-char 1)
+		   (and (> (setq count (1- count)) 0)
 			(not (memq (preceding-char) (list ?\C-@ ?\n ? )))
-			(or (aref (char-category-set (preceding-char)) ?<)
-			    (aref (char-category-set (following-char)) ?>)))
-		  (backward-char 1))
-	      (while (and (>= (setq count (1- count)) 0)
-			  (aref (char-category-set (following-char)) ?>)
-			  (aref fill-find-break-point-function-table
-				(following-char)))
-		(forward-char 1)))
-	    (when (eq (following-char) ? )
-	      (forward-char 1))
-	    t)))))
+			(or (shr-char-kinsoku-eol-p (preceding-char))
+			    (shr-char-kinsoku-bol-p (following-char)))))))
+	   (if (setq failed (= (current-column) shr-indentation))
+	       ;; There's no breakable point that doesn't violate kinsoku,
+	       ;; so we go to the second best position.
+	       (if (looking-at "\\(\\c<+\\)\\c<")
+		   (goto-char (match-end 1))
+		 (forward-char 1)))))
+	(t
+	 (if (shr-char-kinsoku-bol-p (preceding-char))
+	     ;; There are consecutive kinsoku-bol characters.
+	     (setq failed t)
+	   (let ((count 4))
+	     (while (and (>= (setq count (1- count)) 0)
+			 (shr-char-kinsoku-bol-p (following-char))
+			 (shr-char-breakable-p (following-char)))
+	       (forward-char 1))))))
+       (when (eq (following-char) ? )
+	 (forward-char 1))))
+    (not failed)))
 
 (defun shr-ensure-newline ()
   (unless (zerop (current-column))
@@ -449,7 +525,7 @@
   "Return a function to display an image.
 CONTENT-FUNCTION is a function to retrieve an image for a cid url that
 is an argument.  The function to be returned takes three arguments URL,
-START, and END."
+START, and END.  Note that START and END should be merkers."
   `(lambda (url start end)
      (when url
        (if (string-match "\\`cid:" url)
@@ -459,9 +535,8 @@
 		 (when image
 		   (goto-char start)
 		   (shr-put-image image
-				  (prog1
-				      (buffer-substring-no-properties start end)
-				    (delete-region start end))))))
+				  (buffer-substring-no-properties start end))
+		   (delete-region (point) end))))
 	 (url-retrieve url 'shr-image-fetched
 		       (list (current-buffer) start end)
 		       t)))))
@@ -473,10 +548,10 @@
 
 (autoload 'widget-convert-button "wid-edit")
 
-(defun shr-urlify (start url)
+(defun shr-urlify (start url &optional title)
   (widget-convert-button
    'url-link start (point)
-   :help-echo url
+   :help-echo (if title (format "%s (%s)" url title) url)
    :keymap shr-map
    url)
   (put-text-property start (point) 'shr-url url))
@@ -485,8 +560,95 @@
   "Encode URL."
   (browse-url-url-encode-chars url "[)$ ]"))
 
+(autoload 'shr-color-visible "shr-color")
+(autoload 'shr-color->hexadecimal "shr-color")
+
+(defun shr-color-check (fg bg)
+  "Check that FG is visible on BG.
+Returns (fg bg) with corrected values.
+Returns nil if the colors that would be used are the default
+ones, in case fg and bg are nil."
+  (when (or fg bg)
+    (let ((fixed (cond ((null fg) 'fg)
+                       ((null bg) 'bg))))
+      ;; Convert colors to hexadecimal, or set them to default.
+      (let ((fg (or (shr-color->hexadecimal fg)
+                    (frame-parameter nil 'foreground-color)))
+            (bg (or (shr-color->hexadecimal bg)
+                    (frame-parameter nil 'background-color))))
+        (cond ((eq fixed 'bg)
+               ;; Only return the new fg
+               (list nil (cadr (shr-color-visible bg fg t))))
+              ((eq fixed 'fg)
+               ;; Invert args and results and return only the new bg
+               (list (cadr (shr-color-visible fg bg t)) nil))
+              (t
+               (shr-color-visible bg fg)))))))
+
+(defun shr-colorize-region (start end fg &optional bg)
+  (when (or fg bg)
+    (let ((new-colors (shr-color-check fg bg)))
+      (when new-colors
+	(when fg
+	  (shr-put-color start end :foreground (cadr new-colors)))
+	(when bg
+	  (shr-put-color start end :background (car new-colors)))))))
+
+;; Put a color in the region, but avoid putting colors on on blank
+;; text at the start of the line, and the newline at the end, to avoid
+;; ugliness.  Also, don't overwrite any existing color information,
+;; since this can be called recursively, and we want the "inner" color
+;; to win.
+(defun shr-put-color (start end type color)
+  (save-excursion
+    (goto-char start)
+    (while (< (point) end)
+      (when (bolp)
+	(skip-chars-forward " "))
+      (when (> (line-end-position) (point))
+	(shr-put-color-1 (point) (min (line-end-position) end) type color))
+      (if (< (line-end-position) end)
+	  (forward-line 1)
+	(goto-char end)))))
+
+(defun shr-put-color-1 (start end type color)
+  (let* ((old-props (get-text-property start 'face))
+	 (do-put (not (memq type old-props)))
+	 change)
+    (while (< start end)
+      (setq change (next-single-property-change start 'face nil end))
+      (when do-put
+	(put-text-property start change 'face
+			   (nconc (list type color) old-props)))
+      (setq old-props (get-text-property change 'face))
+      (setq do-put (not (memq type old-props)))
+      (setq start change))
+    (when (and do-put
+	       (> end start))
+      (put-text-property start end 'face
+			 (nconc (list type color old-props))))))
+
 ;;; Tag-specific rendering rules.
 
+(defun shr-tag-body (cont)
+  (let* ((start (point))
+	 (fgcolor (cdr (assq :fgcolor cont)))
+	 (bgcolor (cdr (assq :bgcolor cont)))
+	 (shr-stylesheet (list (cons 'color fgcolor)
+			       (cons 'background-color bgcolor))))
+    (shr-generic cont)
+    (shr-colorize-region start (point) fgcolor bgcolor)))
+
+(defun shr-tag-style (cont)
+  )
+
+(defun shr-tag-script (cont)
+  )
+
+(defun shr-tag-label (cont)
+  (shr-generic cont)
+  (shr-ensure-paragraph))
+
 (defun shr-tag-p (cont)
   (shr-ensure-paragraph)
   (shr-indent)
@@ -519,6 +681,9 @@
 
 (defun shr-parse-style (style)
   (when style
+    (save-match-data
+      (when (string-match "\n" style)
+        (setq style (replace-match " " t t style))))
     (let ((plist nil))
       (dolist (elem (split-string style ";"))
 	(when elem
@@ -527,6 +692,8 @@
 		     (cadr elem))
 	    (let ((name (replace-regexp-in-string "^ +\\| +$" "" (car elem)))
 		  (value (replace-regexp-in-string "^ +\\| +$" "" (cadr elem))))
+	      (when (string-match " *!important\\'" value)
+		(setq value (substring value 0 (match-beginning 0))))
 	      (push (cons (intern name obarray)
 			  value)
 		    plist)))))
@@ -534,10 +701,11 @@
 
 (defun shr-tag-a (cont)
   (let ((url (cdr (assq :href cont)))
+        (title (cdr (assq :title cont)))
 	(start (point))
 	shr-start)
     (shr-generic cont)
-    (shr-urlify (or shr-start start) url)))
+    (shr-urlify (or shr-start start) url title)))
 
 (defun shr-tag-object (cont)
   (let ((start (point))
@@ -676,6 +844,19 @@
   (shr-ensure-newline)
   (insert (make-string shr-width shr-hr-line) "\n"))
 
+(defun shr-tag-title (cont)
+  (shr-heading cont 'bold 'underline))
+
+(defun shr-tag-font (cont)
+  (let* ((start (point))
+         (color (cdr (assq :color cont)))
+         (shr-stylesheet (nconc (list (cons 'color color))
+				shr-stylesheet)))
+    (shr-generic cont)
+    (when color
+      (shr-colorize-region start (point) color
+			   (cdr (assq 'background-color shr-stylesheet))))))
+
 ;;; Table rendering algorithm.
 
 ;; Table rendering is the only complicated thing here.  We do this by
@@ -722,6 +903,10 @@
 	 (header (cdr (assq 'thead cont)))
 	 (body (or (cdr (assq 'tbody cont)) cont))
 	 (footer (cdr (assq 'tfoot cont)))
+         (bgcolor (cdr (assq :bgcolor cont)))
+	 (start (point))
+	 (shr-stylesheet (nconc (list (cons 'background-color bgcolor))
+				shr-stylesheet))
 	 (nheader (if header (shr-max-columns header)))
 	 (nbody (if body (shr-max-columns body)))
 	 (nfooter (if footer (shr-max-columns footer))))
@@ -762,7 +947,10 @@
 		       `((tr (td (table (tbody ,@footer))))))))
 	  (if caption
 	      `((tr (td (table (tbody ,@body)))))
-	    body)))))))
+	    body)))))
+    (when bgcolor
+      (shr-colorize-region start (point) (cdr (assq 'color shr-stylesheet))
+			   bgcolor))))
 
 (defun shr-find-elements (cont type)
   (let (result)
@@ -868,43 +1056,73 @@
 
 (defun shr-render-td (cont width fill)
   (with-temp-buffer
-    (let ((cache (cdr (assoc (cons width cont) shr-content-cache))))
-      (if cache
-	  (insert cache)
-	(let ((shr-width width)
-	      (shr-indentation 0))
-	  (shr-generic cont))
-	(delete-region
-	 (point)
-	 (+ (point)
-	    (skip-chars-backward " \t\n")))
-	(push (cons (cons width cont) (buffer-string))
-	      shr-content-cache)))
-    (goto-char (point-min))
-    (let ((max 0))
-      (while (not (eobp))
-	(end-of-line)
-	(setq max (max max (current-column)))
-	(forward-line 1))
-      (when fill
-	(goto-char (point-min))
-	;; If the buffer is totally empty, then put a single blank
-	;; line here.
-	(if (zerop (buffer-size))
-	    (insert (make-string width ? ))
-	  ;; Otherwise, fill the buffer.
-	  (while (not (eobp))
-	    (end-of-line)
-	    (when (> (- width (current-column)) 0)
-	      (insert (make-string (- width (current-column)) ? )))
-	    (forward-line 1))))
-      (if fill
+    (let ((bgcolor (cdr (assq :bgcolor cont)))
+	  (fgcolor (cdr (assq :fgcolor cont)))
+	  (style (cdr (assq :style cont)))
+	  (shr-stylesheet shr-stylesheet)
+	  overlays)
+      (when style
+	(setq style (and (string-match "color" style)
+			 (shr-parse-style style))))
+      (when bgcolor
+	(setq style (nconc (list (cons 'background-color bgcolor)) style)))
+      (when fgcolor
+	(setq style (nconc (list (cons 'color fgcolor)) style)))
+      (when style
+	(setq shr-stylesheet (append style shr-stylesheet)))
+      (let ((cache (cdr (assoc (cons width cont) shr-content-cache))))
+	(if cache
+	    (progn
+	      (insert (car cache))
+	      (let ((end (length (car cache))))
+		(dolist (overlay (cadr cache))
+		  (let ((new-overlay
+			 (make-overlay (1+ (- end (nth 0 overlay)))
+				       (1+ (- end (nth 1 overlay)))))
+			(properties (nth 2 overlay)))
+		    (while properties
+		      (overlay-put new-overlay
+				   (pop properties) (pop properties)))))))
+	  (let ((shr-width width)
+		(shr-indentation 0))
+	    (shr-descend (cons 'td cont)))
+	  (delete-region
+	   (point)
+	   (+ (point)
+	      (skip-chars-backward " \t\n")))
+	  (push (list (cons width cont) (buffer-string)
+		      (shr-overlays-in-region (point-min) (point-max)))
+		shr-content-cache)))
+      (goto-char (point-min))
+      (let ((max 0))
+	(while (not (eobp))
+	  (end-of-line)
+	  (setq max (max max (current-column)))
+	  (forward-line 1))
+	(when fill
+	  (goto-char (point-min))
+	  ;; If the buffer is totally empty, then put a single blank
+	  ;; line here.
+	  (if (zerop (buffer-size))
+	      (insert (make-string width ? ))
+	    ;; Otherwise, fill the buffer.
+	    (while (not (eobp))
+	      (end-of-line)
+	      (when (> (- width (current-column)) 0)
+		(insert (make-string (- width (current-column)) ? )))
+	      (forward-line 1))))
+	(when style
+	  (shr-colorize-region
+	   (point-min) (point-max)
+	   (cdr (assq 'color shr-stylesheet))
+	   (cdr (assq 'background-color shr-stylesheet))))
+	(if fill
+	    (list max
+		  (count-lines (point-min) (point-max))
+		  (split-string (buffer-string) "\n")
+		  (shr-collect-overlays))
 	  (list max
-		(count-lines (point-min) (point-max))
-		(split-string (buffer-string) "\n")
-		(shr-collect-overlays))
-	(list max
-	      (shr-natural-width))))))
+		(shr-natural-width)))))))
 
 (defun shr-natural-width ()
   (goto-char (point-min))
--- a/lisp/gnus/spam.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/gnus/spam.el	Thu Dec 16 18:30:57 2010 -0500
@@ -45,9 +45,9 @@
 
 (eval-when-compile (require 'cl))
 
-(require 'message)		;for the message-fetch-field functions
+(require 'message)              ;for the message-fetch-field functions
 (require 'gnus-sum)
-(require 'gnus-uu)			; because of key prefix issues
+(require 'gnus-uu)                      ; because of key prefix issues
 ;;; for the definitions of group content classification and spam processors
 (require 'gnus)
 
@@ -93,12 +93,16 @@
   "Exit behavior at the time of summary exit.
 Note that setting the `spam-use-move' or `spam-use-copy' backends on
 a group through group/topic parameters overrides this mechanism."
-  :type '(choice (const 'default :tag
-			"Move spam out of all groups.  Move ham out of spam groups.")
-		 (const 'move-all :tag
-			"Move spam out of all groups.  Move ham out of all groups.")
-		 (const 'move-none :tag
-			"Never move spam or ham out of any groups."))
+  :type '(choice
+          (const
+           'default
+           :tag "Move spam out of all groups and ham out of spam groups.")
+          (const
+           'move-all
+           :tag "Move spam out of all groups and ham out of all groups.")
+          (const
+           'move-none
+           :tag "Never move spam or ham out of any groups."))
   :group 'spam)
 
 (defcustom spam-directory (nnheader-concat gnus-directory "spam/")
@@ -296,27 +300,27 @@
   :group 'spam)
 
 (defcustom spam-install-hooks (or
-			       spam-use-dig
-			       spam-use-gmane-xref
-			       spam-use-blacklist
-			       spam-use-whitelist
-			       spam-use-whitelist-exclusive
-			       spam-use-blackholes
-			       spam-use-hashcash
-			       spam-use-regex-headers
-			       spam-use-regex-body
-			       spam-use-bogofilter
-			       spam-use-bogofilter-headers
-			       spam-use-spamassassin
-			       spam-use-spamassassin-headers
-			       spam-use-bsfilter
-			       spam-use-bsfilter-headers
-			       spam-use-BBDB
-			       spam-use-BBDB-exclusive
-			       spam-use-ifile
-			       spam-use-stat
-			       spam-use-spamoracle
-			       spam-use-crm114)
+                               spam-use-dig
+                               spam-use-gmane-xref
+                               spam-use-blacklist
+                               spam-use-whitelist
+                               spam-use-whitelist-exclusive
+                               spam-use-blackholes
+                               spam-use-hashcash
+                               spam-use-regex-headers
+                               spam-use-regex-body
+                               spam-use-bogofilter
+                               spam-use-bogofilter-headers
+                               spam-use-spamassassin
+                               spam-use-spamassassin-headers
+                               spam-use-bsfilter
+                               spam-use-bsfilter-headers
+                               spam-use-BBDB
+                               spam-use-BBDB-exclusive
+                               spam-use-ifile
+                               spam-use-stat
+                               spam-use-spamoracle
+                               spam-use-crm114)
   "Whether the spam hooks should be installed.
 Default to t if one of the spam-use-* variables is set."
   :group 'spam
@@ -330,8 +334,8 @@
 ;;; TODO: deprecate this variable, it's confusing since it's a list of strings,
 ;;; not regular expressions
 (defcustom spam-junk-mailgroups (cons
-				 spam-split-group
-				 '("mail.junk" "poste.pourriel"))
+                                 spam-split-group
+                                 '("mail.junk" "poste.pourriel"))
   "Mailgroups with spam contents.
 All unmarked article in such group receive the spam mark on group entry."
   :type '(repeat (string :tag "Group"))
@@ -345,7 +349,7 @@
   :group 'spam)
 
 (defcustom spam-blackhole-servers '("bl.spamcop.net" "relays.ordb.org"
-				    "dev.null.dk" "relays.visi.com")
+                                    "dev.null.dk" "relays.visi.com")
   "List of blackhole servers.
 Only meaningful if you enable `spam-use-blackholes'."
   :type '(repeat (string :tag "Server"))
@@ -405,9 +409,9 @@
 (defcustom spam-summary-score-preferred-header nil
   "Preferred header to use for `spam-summary-score'."
   :type '(choice :tag "Header name"
-	  (symbol :tag "SpamAssassin etc" X-Spam-Status)
-	  (symbol :tag "Bogofilter"       X-Bogosity)
-	  (const  :tag "No preference, take best guess." nil))
+          (symbol :tag "SpamAssassin etc" X-Spam-Status)
+          (symbol :tag "Bogofilter"       X-Bogosity)
+          (const  :tag "No preference, take best guess." nil))
   :group 'spam)
 
 (defgroup spam-ifile nil
@@ -419,7 +423,7 @@
 (defcustom spam-ifile-program (executable-find "ifile")
   "Name of the ifile program."
   :type '(choice (file :tag "Location of ifile")
-		 (const :tag "ifile is not installed"))
+                 (const :tag "ifile is not installed"))
   :group 'spam-ifile)
 
 (make-obsolete-variable 'spam-ifile-database-path 'spam-ifile-database
@@ -427,7 +431,7 @@
 (defcustom spam-ifile-database nil
   "File name of the ifile database."
   :type '(choice (file :tag "Location of the ifile database")
-		 (const :tag "Use the default"))
+                 (const :tag "Use the default"))
   :group 'spam-ifile)
 
 (defcustom spam-ifile-spam-category "spam"
@@ -439,7 +443,7 @@
   "Name of the ham ifile category.
 If nil, the current group name will be used."
   :type '(choice (string :tag "Use a fixed category")
-		 (const :tag "Use the current group name"))
+                 (const :tag "Use the current group name"))
   :group 'spam-ifile)
 
 (defcustom spam-ifile-all-categories nil
@@ -458,7 +462,7 @@
 (defcustom spam-bogofilter-program (executable-find "bogofilter")
   "Name of the Bogofilter program."
   :type '(choice (file :tag "Location of bogofilter")
-		 (const :tag "Bogofilter is not installed"))
+                 (const :tag "Bogofilter is not installed"))
   :group 'spam-bogofilter)
 
 (defvar spam-bogofilter-valid 'unknown "Is the bogofilter version valid?")
@@ -497,8 +501,8 @@
   "Location of the Bogofilter database.
 When nil, use the default location."
   :type '(choice (directory
-		  :tag "Location of the Bogofilter database directory")
-		 (const :tag "Use the default"))
+                  :tag "Location of the Bogofilter database directory")
+                 (const :tag "Use the default"))
   :group 'spam-bogofilter)
 
 (defgroup spam-bsfilter nil
@@ -510,7 +514,7 @@
 (defcustom spam-bsfilter-program (executable-find "bsfilter")
   "Name of the Bsfilter program."
   :type '(choice (file :tag "Location of bsfilter")
-		 (const :tag "Bsfilter is not installed"))
+                 (const :tag "Bsfilter is not installed"))
   :group 'spam-bsfilter)
 
 (defcustom spam-bsfilter-header "X-Spam-Flag"
@@ -546,8 +550,8 @@
 (defcustom spam-bsfilter-database-directory nil
   "Directory path of the Bsfilter databases."
   :type '(choice (directory
-		  :tag "Location of the Bsfilter database directory")
-		 (const :tag "Use the default"))
+                  :tag "Location of the Bsfilter database directory")
+                 (const :tag "Use the default"))
   :group 'spam-bsfilter)
 
 (defgroup spam-spamoracle nil
@@ -558,13 +562,13 @@
   "Location of spamoracle database file.
 When nil, use the default spamoracle database."
   :type '(choice (directory :tag "Location of spamoracle database file.")
-		 (const :tag "Use the default"))
+                 (const :tag "Use the default"))
   :group 'spam-spamoracle)
 
 (defcustom spam-spamoracle-binary (executable-find "spamoracle")
   "Location of the spamoracle binary."
   :type '(choice (directory :tag "Location of the spamoracle binary")
-		 (const :tag "Use the default"))
+                 (const :tag "Use the default"))
   :group 'spam-spamoracle)
 
 (defgroup spam-spamassassin nil
@@ -578,7 +582,7 @@
 Hint: set this to \"spamc\" if you have spamd running.  See the spamc and
 spamd man pages for more information on these programs."
   :type '(choice (file :tag "Location of spamc")
-		 (const :tag "spamassassin is not installed"))
+                 (const :tag "spamassassin is not installed"))
   :group 'spam-spamassassin)
 
 (defcustom spam-spamassassin-arguments ()
@@ -608,7 +612,7 @@
 (defcustom spam-sa-learn-program (executable-find "sa-learn")
   "Name of the sa-learn program."
   :type '(choice (file :tag "Location of spamassassin")
-		 (const :tag "spamassassin is not installed"))
+                 (const :tag "spamassassin is not installed"))
   :group 'spam-spamassassin)
 
 (defcustom spam-sa-learn-rebuild t
@@ -642,7 +646,7 @@
 (defcustom spam-crm114-program (executable-find "mailfilter.crm")
   "File path of the CRM114 Mailfilter executable program."
   :type '(choice (file :tag "Location of CRM114 Mailfilter")
-	 (const :tag "CRM114 Mailfilter is not installed"))
+         (const :tag "CRM114 Mailfilter is not installed"))
   :group 'spam-crm114)
 
 (defcustom spam-crm114-header "X-CRM114-Status"
@@ -678,8 +682,8 @@
 (defcustom spam-crm114-database-directory nil
   "Directory path of the CRM114 Mailfilter databases."
   :type '(choice (directory
-	  :tag "Location of the CRM114 Mailfilter database directory")
-	 (const :tag "Use the default"))
+          :tag "Location of the CRM114 Mailfilter database directory")
+         (const :tag "Use the default"))
   :group 'spam-crm114)
 
 ;;; Key bindings for spam control.
@@ -696,8 +700,8 @@
   "Whether spam.el will try to cache lookups using `spam-caches'.")
 
 (defvar spam-caches (make-hash-table
-		     :size 10
-		     :test 'equal)
+                     :size 10
+                     :test 'equal)
   "Cache of spam detection entries.")
 
 (defvar spam-old-articles nil
@@ -736,11 +740,11 @@
   (if (and list1 list2)
       ;; we have two non-nil lists
       (progn
-	(dolist (item (append list1 list2))
-	  (when (and (memq item list1) (memq item list2))
-	    (setq list1 (delq item list1))
-	    (setq list2 (delq item list2))))
-	(append list1 list2))
+        (dolist (item (append list1 list2))
+          (when (and (memq item list1) (memq item list2))
+            (setq list1 (delq item list1))
+            (setq list2 (delq item list2))))
+        (append list1 list2))
     ;; if either of the lists was nil, return the other one
     (if list1 list1 list2)))
 
@@ -748,9 +752,9 @@
   "Checks if MARK is considered a ham mark in GROUP."
   (when (stringp group)
     (let* ((marks (spam-group-ham-marks group spam))
-	   (marks (if (symbolp mark)
-		      marks
-		    (mapcar 'symbol-value marks))))
+           (marks (if (symbolp mark)
+                      marks
+                    (mapcar 'symbol-value marks))))
       (memq mark marks))))
 
 (defun spam-group-spam-mark-p (group mark)
@@ -761,10 +765,10 @@
   "In GROUP, get all the ham marks."
   (when (stringp group)
     (let* ((marks (if spam
-		      (gnus-parameter-spam-marks group)
-		    (gnus-parameter-ham-marks group)))
-	   (marks (car marks))
-	   (marks (if (listp (car marks)) (car marks) marks)))
+                      (gnus-parameter-spam-marks group)
+                    (gnus-parameter-ham-marks group)))
+           (marks (car marks))
+           (marks (if (listp (car marks)) (car marks) marks)))
       marks)))
 
 (defun spam-group-spam-marks (group)
@@ -775,15 +779,15 @@
   "Is GROUP a spam group?"
   (if (and (stringp group) (< 0 (length group)))
       (or (member group spam-junk-mailgroups)
-	  (memq 'gnus-group-spam-classification-spam
-		(gnus-parameter-spam-contents group)))
+          (memq 'gnus-group-spam-classification-spam
+                (gnus-parameter-spam-contents group)))
     nil))
 
 (defun spam-group-ham-contents-p (group)
   "Is GROUP a ham group?"
   (if (stringp group)
       (memq 'gnus-group-spam-classification-ham
-	    (gnus-parameter-spam-contents group))
+            (gnus-parameter-spam-contents group))
     nil))
 
 (defun spam-classifications ()
@@ -812,20 +816,20 @@
 
 (defun spam-list-articles (articles classification)
   (let ((mark-check (if (eq classification 'spam)
-			'spam-group-spam-mark-p
-		      'spam-group-ham-mark-p))
-	alist mark-cache-yes mark-cache-no)
+                        'spam-group-spam-mark-p
+                      'spam-group-ham-mark-p))
+        alist mark-cache-yes mark-cache-no)
     (dolist (article articles)
       (let ((mark (gnus-summary-article-mark article)))
-	(unless (or (memq mark mark-cache-yes)
-		    (memq mark mark-cache-no))
-	  (if (funcall mark-check
-		       gnus-newsgroup-name
-		       mark)
-	      (push mark mark-cache-yes)
-	    (push mark mark-cache-no)))
-	(when (memq mark mark-cache-yes)
-	  (push article alist))))
+        (unless (or (memq mark mark-cache-yes)
+                    (memq mark mark-cache-no))
+          (if (funcall mark-check
+                       gnus-newsgroup-name
+                       mark)
+              (push mark mark-cache-yes)
+            (push mark mark-cache-no)))
+        (when (memq mark mark-cache-yes)
+          (push article alist))))
     alist))
 
 ;;}}}
@@ -841,13 +845,13 @@
   (setq spam-backends (add-to-list 'spam-backends backend))
   (while properties
     (let ((property (pop properties))
-	  (value (pop properties)))
+          (value (pop properties)))
       (if (spam-backend-property-valid-p property)
-	  (put backend property value)
-	(gnus-error
-	 5
-	 "spam-install-backend-super got an invalid property %s"
-	 property)))))
+          (put backend property value)
+        (gnus-error
+         5
+         "spam-install-backend-super got an invalid property %s"
+         property)))))
 
 (defun spam-backend-list (&optional type)
   "Return a list of all the backend symbols, constrained by TYPE.
@@ -856,16 +860,16 @@
   (let (list)
     (dolist (backend spam-backends)
       (when (or
-	     (null type)		;either no type was requested
-	     ;; or the type is 'mover and the backend is a mover
-	     (and
-	      (eq type 'mover)
-	      (spam-backend-mover-p backend))
-	     ;; or the type is 'non-mover and the backend is not a mover
-	     (and
-	      (eq type 'non-mover)
-	      (not (spam-backend-mover-p backend))))
-	(push backend list)))
+             (null type)                ;either no type was requested
+             ;; or the type is 'mover and the backend is a mover
+             (and
+              (eq type 'mover)
+              (spam-backend-mover-p backend))
+             ;; or the type is 'non-mover and the backend is not a mover
+             (and
+              (eq type 'non-mover)
+              (not (spam-backend-mover-p backend))))
+        (push backend list)))
       list))
 
 (defun spam-backend-check (backend)
@@ -889,16 +893,16 @@
   "Return information about BACKEND."
   (if (spam-backend-valid-p backend)
       (let (info)
-	(setq info (format "Backend %s has the following properties:\n"
-			   backend))
-	(dolist (property (spam-backend-properties))
-	  (setq info (format "%s%s=%s\n"
-			     info
-			     property
-			     (get backend property))))
-	info)
+        (setq info (format "Backend %s has the following properties:\n"
+                           backend))
+        (dolist (property (spam-backend-properties))
+          (setq info (format "%s%s=%s\n"
+                             info
+                             property
+                             (get backend property))))
+        info)
     (gnus-error 5 "spam-backend-info was asked about an invalid backend %s"
-		backend)))
+                backend)))
 
 (defun spam-backend-function (backend classification type)
   "Get the BACKEND function for CLASSIFICATION and TYPE.
@@ -908,11 +912,11 @@
        (spam-classification-valid-p classification)
        (spam-backend-function-type-valid-p type))
       (let ((retrieval
-	     (intern
-	      (format "spam-backend-%s-%s-function"
-		      classification
-		      type))))
-	(funcall retrieval backend))
+             (intern
+              (format "spam-backend-%s-%s-function"
+                      classification
+                      type))))
+        (funcall retrieval backend))
     (gnus-error
      5
      "%s was passed invalid backend %s, classification %s, or type %s"
@@ -922,15 +926,15 @@
      type)))
 
 (defun spam-backend-article-list-property (classification
-					   &optional unregister)
+                                           &optional unregister)
   "Property name of article list with CLASSIFICATION and UNREGISTER."
   (let* ((r (if unregister "unregister" "register"))
-	 (prop (format "%s-%s" classification r)))
+         (prop (format "%s-%s" classification r)))
     prop))
 
 (defun spam-backend-get-article-todo-list (backend
-					   classification
-					   &optional unregister)
+                                           classification
+                                           &optional unregister)
   "Get the articles to be processed for BACKEND and CLASSIFICATION.
 With UNREGISTER, get articles to be unregistered.
 This is a temporary storage function - nothing here persists."
@@ -938,7 +942,8 @@
    backend
    (intern (spam-backend-article-list-property classification unregister))))
 
-(defun spam-backend-put-article-todo-list (backend classification list &optional unregister)
+(defun spam-backend-put-article-todo-list (backend classification list
+                                                   &optional unregister)
   "Set the LIST of articles to be processed for BACKEND and CLASSIFICATION.
 With UNREGISTER, set articles to be unregistered.
 This is a temporary storage function - nothing here persists."
@@ -1036,125 +1041,125 @@
 
 ;;{{{ backend installations
 (spam-install-checkonly-backend 'spam-use-blackholes
-				'spam-check-blackholes)
+                                'spam-check-blackholes)
 
 (spam-install-checkonly-backend 'spam-use-hashcash
-				'spam-check-hashcash)
+                                'spam-check-hashcash)
 
 (spam-install-checkonly-backend 'spam-use-spamassassin-headers
-				'spam-check-spamassassin-headers)
+                                'spam-check-spamassassin-headers)
 
 (spam-install-checkonly-backend 'spam-use-bogofilter-headers
-				'spam-check-bogofilter-headers)
+                                'spam-check-bogofilter-headers)
 
 (spam-install-checkonly-backend 'spam-use-bsfilter-headers
-				'spam-check-bsfilter-headers)
+                                'spam-check-bsfilter-headers)
 
 (spam-install-checkonly-backend 'spam-use-gmane-xref
-				'spam-check-gmane-xref)
+                                'spam-check-gmane-xref)
 
 (spam-install-checkonly-backend 'spam-use-regex-headers
-				'spam-check-regex-headers)
+                                'spam-check-regex-headers)
 
 (spam-install-statistical-checkonly-backend 'spam-use-regex-body
-					    'spam-check-regex-body)
-
-;; TODO: NOTE: spam-use-ham-copy is now obsolete, use (ham spam-use-copy) instead
+                                            'spam-check-regex-body)
+
+;; TODO: NOTE: spam-use-ham-copy is now obsolete, use (ham spam-use-copy)
 (spam-install-mover-backend 'spam-use-move
-			    'spam-move-ham-routine
-			    'spam-move-spam-routine
-			    nil
-			    nil)
+                            'spam-move-ham-routine
+                            'spam-move-spam-routine
+                            nil
+                            nil)
 
 (spam-install-nocheck-backend 'spam-use-copy
-			      'spam-copy-ham-routine
-			      'spam-copy-spam-routine
-			      nil
-			      nil)
+                              'spam-copy-ham-routine
+                              'spam-copy-spam-routine
+                              nil
+                              nil)
 
 (spam-install-nocheck-backend 'spam-use-gmane
-			      'spam-report-gmane-unregister-routine
-			      'spam-report-gmane-register-routine
-			      'spam-report-gmane-register-routine
-			      'spam-report-gmane-unregister-routine)
+                              'spam-report-gmane-unregister-routine
+                              'spam-report-gmane-register-routine
+                              'spam-report-gmane-register-routine
+                              'spam-report-gmane-unregister-routine)
 
 (spam-install-nocheck-backend 'spam-use-resend
-			      'spam-report-resend-register-ham-routine
-			      'spam-report-resend-register-routine
-			      nil
-			      nil)
+                              'spam-report-resend-register-ham-routine
+                              'spam-report-resend-register-routine
+                              nil
+                              nil)
 
 (spam-install-backend 'spam-use-BBDB
-		      'spam-check-BBDB
-		      'spam-BBDB-register-routine
-		      nil
-		      'spam-BBDB-unregister-routine
-		      nil)
+                      'spam-check-BBDB
+                      'spam-BBDB-register-routine
+                      nil
+                      'spam-BBDB-unregister-routine
+                      nil)
 
 (spam-install-backend-alias 'spam-use-BBDB 'spam-use-BBDB-exclusive)
 
 (spam-install-backend 'spam-use-blacklist
-		      'spam-check-blacklist
-		      nil
-		      'spam-blacklist-register-routine
-		      nil
-		      'spam-blacklist-unregister-routine)
+                      'spam-check-blacklist
+                      nil
+                      'spam-blacklist-register-routine
+                      nil
+                      'spam-blacklist-unregister-routine)
 
 (spam-install-backend 'spam-use-whitelist
-		      'spam-check-whitelist
-		      'spam-whitelist-register-routine
-		      nil
-		      'spam-whitelist-unregister-routine
-		      nil)
+                      'spam-check-whitelist
+                      'spam-whitelist-register-routine
+                      nil
+                      'spam-whitelist-unregister-routine
+                      nil)
 
 (spam-install-statistical-backend 'spam-use-ifile
-				  'spam-check-ifile
-				  'spam-ifile-register-ham-routine
-				  'spam-ifile-register-spam-routine
-				  'spam-ifile-unregister-ham-routine
-				  'spam-ifile-unregister-spam-routine)
+                                  'spam-check-ifile
+                                  'spam-ifile-register-ham-routine
+                                  'spam-ifile-register-spam-routine
+                                  'spam-ifile-unregister-ham-routine
+                                  'spam-ifile-unregister-spam-routine)
 
 (spam-install-statistical-backend 'spam-use-spamoracle
-				  'spam-check-spamoracle
-				  'spam-spamoracle-learn-ham
-				  'spam-spamoracle-learn-spam
-				  'spam-spamoracle-unlearn-ham
-				  'spam-spamoracle-unlearn-spam)
+                                  'spam-check-spamoracle
+                                  'spam-spamoracle-learn-ham
+                                  'spam-spamoracle-learn-spam
+                                  'spam-spamoracle-unlearn-ham
+                                  'spam-spamoracle-unlearn-spam)
 
 (spam-install-statistical-backend 'spam-use-stat
-				  'spam-check-stat
-				  'spam-stat-register-ham-routine
-				  'spam-stat-register-spam-routine
-				  'spam-stat-unregister-ham-routine
-				  'spam-stat-unregister-spam-routine)
+                                  'spam-check-stat
+                                  'spam-stat-register-ham-routine
+                                  'spam-stat-register-spam-routine
+                                  'spam-stat-unregister-ham-routine
+                                  'spam-stat-unregister-spam-routine)
 
 (spam-install-statistical-backend 'spam-use-spamassassin
-				  'spam-check-spamassassin
-				  'spam-spamassassin-register-ham-routine
-				  'spam-spamassassin-register-spam-routine
-				  'spam-spamassassin-unregister-ham-routine
-				  'spam-spamassassin-unregister-spam-routine)
+                                  'spam-check-spamassassin
+                                  'spam-spamassassin-register-ham-routine
+                                  'spam-spamassassin-register-spam-routine
+                                  'spam-spamassassin-unregister-ham-routine
+                                  'spam-spamassassin-unregister-spam-routine)
 
 (spam-install-statistical-backend 'spam-use-bogofilter
-				  'spam-check-bogofilter
-				  'spam-bogofilter-register-ham-routine
-				  'spam-bogofilter-register-spam-routine
-				  'spam-bogofilter-unregister-ham-routine
-				  'spam-bogofilter-unregister-spam-routine)
+                                  'spam-check-bogofilter
+                                  'spam-bogofilter-register-ham-routine
+                                  'spam-bogofilter-register-spam-routine
+                                  'spam-bogofilter-unregister-ham-routine
+                                  'spam-bogofilter-unregister-spam-routine)
 
 (spam-install-statistical-backend 'spam-use-bsfilter
-				  'spam-check-bsfilter
-				  'spam-bsfilter-register-ham-routine
-				  'spam-bsfilter-register-spam-routine
-				  'spam-bsfilter-unregister-ham-routine
-				  'spam-bsfilter-unregister-spam-routine)
+                                  'spam-check-bsfilter
+                                  'spam-bsfilter-register-ham-routine
+                                  'spam-bsfilter-register-spam-routine
+                                  'spam-bsfilter-unregister-ham-routine
+                                  'spam-bsfilter-unregister-spam-routine)
 
 (spam-install-statistical-backend 'spam-use-crm114
-				  'spam-check-crm114
-				  'spam-crm114-register-ham-routine
-				  'spam-crm114-register-spam-routine
-				  'spam-crm114-unregister-ham-routine
-				  'spam-crm114-unregister-spam-routine)
+                                  'spam-check-crm114
+                                  'spam-crm114-register-ham-routine
+                                  'spam-crm114-register-spam-routine
+                                  'spam-crm114-unregister-ham-routine
+                                  'spam-crm114-unregister-spam-routine)
 ;;}}}
 
 ;;{{{ scoring and summary formatting
@@ -1162,31 +1167,31 @@
   "Return the extra headers spam.el thinks are necessary."
   (let (list)
     (when (or spam-use-spamassassin
-	      spam-use-spamassassin-headers
-	      spam-use-regex-headers)
+              spam-use-spamassassin-headers
+              spam-use-regex-headers)
       (push 'X-Spam-Status list))
     (when (or spam-use-bogofilter
-	      spam-use-regex-headers)
+              spam-use-regex-headers)
       (push 'X-Bogosity list))
     (when (or spam-use-crm114
-	      spam-use-regex-headers)
+              spam-use-regex-headers)
       (push 'X-CRM114-Status list))
     list))
 
 (defun spam-user-format-function-S (headers)
   (when headers
     (format "%3.2f"
-	    (spam-summary-score headers spam-summary-score-preferred-header))))
+            (spam-summary-score headers spam-summary-score-preferred-header))))
 
 (defun spam-article-sort-by-spam-status (h1 h2)
   "Sort articles by score."
   (let (result)
     (dolist (header (spam-necessary-extra-headers))
       (let ((s1 (spam-summary-score h1 header))
-	    (s2 (spam-summary-score h2 header)))
+            (s2 (spam-summary-score h2 header)))
       (unless (= s1 s2)
-	(setq result (< s1 s2))
-	(return))))
+        (setq result (< s1 s2))
+        (return))))
     result))
 
 (defvar spam-spamassassin-score-regexp
@@ -1223,13 +1228,13 @@
 Will not return a nil score."
   (let (score)
     (dolist (header
-	     (if specific-header
-		 (list specific-header)
-	       (spam-necessary-extra-headers)))
+             (if specific-header
+                 (list specific-header)
+               (spam-necessary-extra-headers)))
       (setq score
-	    (spam-extra-header-to-number header headers))
+            (spam-extra-header-to-number header headers))
       (when score
-	(return)))
+        (return)))
     (or score 0)))
 
 (defun spam-generic-score (&optional recheck)
@@ -1256,15 +1261,15 @@
   (let (found)
     (dolist (backend (spam-backend-list))
       (when (and (spam-backend-statistical-p backend)
-		 (or (symbol-value backend)
-		     (memq backend force-symbols)))
-	(setq found backend)))
+                 (or (symbol-value backend)
+                     (memq backend force-symbols)))
+        (setq found backend)))
     found))
 
 (defvar spam-list-of-processors
   ;; note the nil processors are not defined in gnus.el
   '((gnus-group-spam-exit-processor-bogofilter   spam spam-use-bogofilter)
-    (gnus-group-spam-exit-processor-bsfilter	 spam spam-use-bsfilter)
+    (gnus-group-spam-exit-processor-bsfilter     spam spam-use-bsfilter)
     (gnus-group-spam-exit-processor-blacklist    spam spam-use-blacklist)
     (gnus-group-spam-exit-processor-ifile        spam spam-use-ifile)
     (gnus-group-spam-exit-processor-stat         spam spam-use-stat)
@@ -1296,38 +1301,38 @@
 backends, checks the setting of `spam-summary-exit-behavior' in
 addition to the set values for the group."
   (if (and (stringp group)
-	   (symbolp backend))
+           (symbolp backend))
       (let ((old-style (assq backend spam-list-of-processors))
-	    (parameters (nth 0 (gnus-parameter-spam-process group)))
-	    found)
-	(if old-style  ; old-style processor
-	    (spam-group-processor-p group (nth 2 old-style) (nth 1 old-style))
-	  ;; now search for the parameter
-	  (dolist (parameter parameters)
-	    (when (and (null found)
-		       (listp parameter)
-		       (eq classification (nth 0 parameter))
-		       (eq backend (nth 1 parameter)))
-	      (setq found t)))
-
-	  ;; now, if the parameter was not found, do the
-	  ;; spam-summary-exit-behavior-logic for mover backends
-	  (unless found
-	    (when (spam-backend-mover-p backend)
-	      (setq
-	       found
-	       (cond
-		((eq spam-summary-exit-behavior 'move-all) t)
-		((eq spam-summary-exit-behavior 'move-none) nil)
-		((eq spam-summary-exit-behavior 'default)
-		 (or (eq classification 'spam) ;move spam out of all groups
-		     ;; move ham out of spam groups
-		     (and (eq classification 'ham)
-			  (spam-group-spam-contents-p group))))
-		(t (gnus-error 5 "Unknown spam-summary-exit-behavior: %s"
-			       spam-summary-exit-behavior))))))
-
-	  found))
+            (parameters (nth 0 (gnus-parameter-spam-process group)))
+            found)
+        (if old-style  ; old-style processor
+            (spam-group-processor-p group (nth 2 old-style) (nth 1 old-style))
+          ;; now search for the parameter
+          (dolist (parameter parameters)
+            (when (and (null found)
+                       (listp parameter)
+                       (eq classification (nth 0 parameter))
+                       (eq backend (nth 1 parameter)))
+              (setq found t)))
+
+          ;; now, if the parameter was not found, do the
+          ;; spam-summary-exit-behavior-logic for mover backends
+          (unless found
+            (when (spam-backend-mover-p backend)
+              (setq
+               found
+               (cond
+                ((eq spam-summary-exit-behavior 'move-all) t)
+                ((eq spam-summary-exit-behavior 'move-none) nil)
+                ((eq spam-summary-exit-behavior 'default)
+                 (or (eq classification 'spam) ;move spam out of all groups
+                     ;; move ham out of spam groups
+                     (and (eq classification 'ham)
+                          (spam-group-spam-contents-p group))))
+                (t (gnus-error 5 "Unknown spam-summary-exit-behavior: %s"
+                               spam-summary-exit-behavior))))))
+
+          found))
     nil))
 
 ;;}}}
@@ -1339,21 +1344,21 @@
   ;; group parameters
   (when (spam-group-spam-contents-p gnus-newsgroup-name)
     (gnus-message 6 "Marking %s articles as spam"
-		  (if spam-mark-only-unseen-as-spam
-		      "unseen"
-		    "unread"))
+                  (if spam-mark-only-unseen-as-spam
+                      "unseen"
+                    "unread"))
     (let ((articles (if spam-mark-only-unseen-as-spam
-			gnus-newsgroup-unseen
-		      gnus-newsgroup-unreads)))
+                        gnus-newsgroup-unseen
+                      gnus-newsgroup-unreads)))
       (if spam-mark-new-messages-in-spam-group-as-spam
-	  (dolist (article articles)
-	    (gnus-summary-mark-article article gnus-spam-mark))
-	(gnus-message 9 "Did not mark new messages as spam.")))))
+          (dolist (article articles)
+            (gnus-summary-mark-article article gnus-spam-mark))
+        (gnus-message 9 "Did not mark new messages as spam.")))))
 
 (defun spam-summary-prepare ()
   (setq spam-old-articles
-	(list (cons 'ham (spam-list-articles gnus-newsgroup-articles 'ham))
-	      (cons 'spam (spam-list-articles gnus-newsgroup-articles 'spam))))
+        (list (cons 'ham (spam-list-articles gnus-newsgroup-articles 'ham))
+              (cons 'spam (spam-list-articles gnus-newsgroup-articles 'spam))))
   (spam-mark-junk-as-spam-routine))
 
 ;; The spam processors are invoked for any group, spam or ham or neither
@@ -1369,46 +1374,46 @@
     ;; we have to iterate over the processors, or else we'll be too slow
     (dolist (classification (spam-classifications))
       (let* ((old-articles (cdr-safe (assq classification spam-old-articles)))
-	     (new-articles (spam-list-articles
-			    gnus-newsgroup-articles
-			    classification))
-	     (changed-articles (spam-set-difference new-articles old-articles)))
-	;; now that we have the changed articles, we go through the processors
-	(dolist (backend (spam-backend-list))
-	  (let (unregister-list)
-	    (dolist (article changed-articles)
-	      (let ((id (spam-fetch-field-message-id-fast article)))
-		(when (spam-log-unregistration-needed-p
-		       id 'process classification backend)
-		  (push article unregister-list))))
-	    ;; call spam-register-routine with specific articles to unregister,
-	    ;; when there are articles to unregister and the check is enabled
-	    (when (and unregister-list (symbol-value backend))
-	      (spam-backend-put-article-todo-list backend
-						  classification
-						  unregister-list
-						  t))))))
+             (new-articles (spam-list-articles
+                            gnus-newsgroup-articles
+                            classification))
+             (changed-articles (spam-set-difference new-articles old-articles)))
+        ;; now that we have the changed articles, we go through the processors
+        (dolist (backend (spam-backend-list))
+          (let (unregister-list)
+            (dolist (article changed-articles)
+              (let ((id (spam-fetch-field-message-id-fast article)))
+                (when (spam-log-unregistration-needed-p
+                       id 'process classification backend)
+                  (push article unregister-list))))
+            ;; call spam-register-routine with specific articles to unregister,
+            ;; when there are articles to unregister and the check is enabled
+            (when (and unregister-list (symbol-value backend))
+              (spam-backend-put-article-todo-list backend
+                                                  classification
+                                                  unregister-list
+                                                  t))))))
 
     ;; do the non-moving backends first, then the moving ones
     (dolist (backend-type '(non-mover mover))
       (dolist (classification (spam-classifications))
-	(dolist (backend (spam-backend-list backend-type))
-	  (when (spam-group-processor-p
-		 gnus-newsgroup-name
-		 backend
-		 classification)
-	    (spam-backend-put-article-todo-list backend
-						classification
-						(spam-list-articles
-						 gnus-newsgroup-articles
-						 classification))))))
+        (dolist (backend (spam-backend-list backend-type))
+          (when (spam-group-processor-p
+                 gnus-newsgroup-name
+                 backend
+                 classification)
+            (spam-backend-put-article-todo-list backend
+                                                classification
+                                                (spam-list-articles
+                                                 gnus-newsgroup-articles
+                                                 classification))))))
 
     (spam-resolve-registrations-routine) ; do the registrations now
 
     ;; we mark all the leftover spam articles as expired at the end
     (dolist (article (spam-list-articles
-		      gnus-newsgroup-articles
-		      'spam))
+                      gnus-newsgroup-articles
+                      'spam))
       (gnus-summary-mark-article article gnus-expirable-mark)))
 
   (setq spam-old-articles nil))
@@ -1429,67 +1434,94 @@
   (gnus-summary-kill-process-mark)
 
   (let ((backend-supports-deletions
-	 (gnus-check-backend-function
-	  'request-move-article gnus-newsgroup-name))
-	(respool-method (gnus-find-method-for-group gnus-newsgroup-name))
-	article mark deletep respool)
+         (gnus-check-backend-function
+          'request-move-article gnus-newsgroup-name))
+        (respool-method (gnus-find-method-for-group gnus-newsgroup-name))
+        article mark deletep respool valid-move-destinations)
 
     (when (member 'respool groups)
-      (setq respool t)			; boolean for later
+      (setq respool t)                  ; boolean for later
       (setq groups '("fake"))) ; when respooling, groups are dynamic so fake it
 
+    ;; exclude invalid move destinations
+    (dolist (group groups)
+      (unless
+          (or
+           (and
+            (eq classification 'spam)
+            (spam-group-spam-contents-p gnus-newsgroup-name)
+            (spam-group-spam-contents-p group)
+            (gnus-message
+             3
+             "Sorry, can't move spam from spam group %s to spam group %s"
+             gnus-newsgroup-name
+             group))
+           (and
+            (eq classification 'ham)
+            (spam-group-ham-contents-p gnus-newsgroup-name)
+            (spam-group-ham-contents-p group)
+            (gnus-message
+             3
+             "Sorry, can't move ham from ham group %s to ham group %s"
+             gnus-newsgroup-name
+             group)))
+        (push group valid-move-destinations)))
+
+    (setq groups (nreverse valid-move-destinations))
+
     ;; now do the actual move
     (dolist (group groups)
+
       (when (and articles (stringp group))
 
-	;; first, mark the article with the process mark and, if needed,
-	;; the unread or expired mark (for ham and spam respectively)
+        ;; first, mark the article with the process mark and, if needed,
+        ;; the unread or expired mark (for ham and spam respectively)
+        (dolist (article articles)
+          (when (and (eq classification 'ham)
+                     spam-mark-ham-unread-before-move-from-spam-group)
+            (gnus-message 9 "Marking ham article %d unread before move"
+                          article)
+            (gnus-summary-mark-article article gnus-unread-mark))
+          (when (and (eq classification 'spam)
+                     (not copy))
+            (gnus-message 9 "Marking spam article %d expirable before move"
+                          article)
+            (gnus-summary-mark-article article gnus-expirable-mark))
+          (gnus-summary-set-process-mark article)
+
+          (if respool              ; respooling is with a "fake" group
+              (let ((spam-split-disabled
+                     (or spam-split-disabled
+                         (and (eq classification 'ham)
+                              spam-disable-spam-split-during-ham-respool))))
+                (gnus-message 9 "Respooling article %d with method %s"
+                              article respool-method)
+                (gnus-summary-respool-article nil respool-method))
+            ;; else, we are not respooling
+            (if (or (not backend-supports-deletions)
+                    (> (length groups) 1))
+                (progn              ; if copying, copy and set deletep
+                  (gnus-message 9 "Copying article %d to group %s"
+                                article group)
+                  (gnus-summary-copy-article nil group)
+                  (setq deletep t))
+              (gnus-message 9 "Moving article %d to group %s"
+                            article group)
+              (gnus-summary-move-article nil group)))))) ; else move articles
+
+    ;; now delete the articles, unless a) copy is t, and there was a copy done
+    ;;                                 b) a move was done to a single group
+    ;;                                 c) backend-supports-deletions is nil
+    (unless copy
+      (when (and deletep backend-supports-deletions)
 	(dolist (article articles)
-	  (when (and (eq classification 'ham)
-		     spam-mark-ham-unread-before-move-from-spam-group)
-	    (gnus-message 9 "Marking ham article %d unread before move"
-			  article)
-	    (gnus-summary-mark-article article gnus-unread-mark))
-	  (when (and (eq classification 'spam)
-		     (not copy))
-	    (gnus-message 9 "Marking spam article %d expirable before move"
-			  article)
-	    (gnus-summary-mark-article article gnus-expirable-mark))
 	  (gnus-summary-set-process-mark article)
-
-	  (if respool		   ; respooling is with a "fake" group
-	      (let ((spam-split-disabled
-		     (or spam-split-disabled
-			 (and (eq classification 'ham)
-			      spam-disable-spam-split-during-ham-respool))))
-		(gnus-message 9 "Respooling article %d with method %s"
-			      article respool-method)
-		(gnus-summary-respool-article nil respool-method))
-	    (if (or (not backend-supports-deletions) ; else, we are not respooling
-		    (> (length groups) 1))
-		(progn		    ; if copying, copy and set deletep
-		  (gnus-message 9 "Copying article %d to group %s"
-				article group)
-		  (gnus-summary-copy-article nil group)
-		  (setq deletep t))
-	      (gnus-message 9 "Moving article %d to group %s"
-			    article group)
-	      (gnus-summary-move-article nil group)))))	; else move articles
-
-      ;; now delete the articles, unless a) copy is t, and there was a copy done
-      ;;                                 b) a move was done to a single group
-      ;;                                 c) backend-supports-deletions is nil
-      (unless copy
-	(when (and deletep backend-supports-deletions)
-	  (dolist (article articles)
-	      (gnus-summary-set-process-mark article)
-	      (gnus-message 9 "Deleting article %d" article))
-	  (when articles
-	    (let ((gnus-novice-user nil)) ; don't ask me if I'm sure
-	      (gnus-summary-delete-article nil)))))
-
-      (gnus-summary-yank-process-mark)
-      (length articles))))
+	  (gnus-message 9 "Deleting article %d" article))
+	(when articles
+	  (let ((gnus-novice-user nil)) ; don't ask me if I'm sure
+	    (gnus-summary-delete-article nil)))))
+    (gnus-summary-yank-process-mark)
+    (length articles)))
 
 (defun spam-copy-spam-routine (articles)
   (spam-copy-or-move-routine
@@ -1537,44 +1569,44 @@
 ;;       (nnml-possibly-change-directory
 ;;        (gnus-group-real-name gnus-newsgroup-name))
 ;;       (setq article-filename (expand-file-name
-;;	  		        (int-to-string article) nnml-current-directory)))
+;;                              (int-to-string article) nnml-current-directory)))
 ;;     (if (file-exists-p article-filename)
-;; 	article-filename
+;;      article-filename
 ;;       nil)))
 
 (defun spam-fetch-field-fast (article field &optional prepared-data-header)
-  "Fetch a FIELD for ARTICLE quickly, using the internal gnus-data-list function.
+  "Fetch a FIELD for ARTICLE with the internal `gnus-data-list' function.
 When PREPARED-DATA-HEADER is given, don't look in the Gnus data.
 When FIELD is 'number, ARTICLE can be any number (since we want
 to find it out)."
   (when (numberp article)
     (let* ((data-header (or prepared-data-header
-			    (spam-fetch-article-header article))))
+                            (spam-fetch-article-header article))))
       (if (arrayp data-header)
-	(cond
-	 ((equal field 'number)
-	  (mail-header-number data-header))
-	 ((equal field 'from)
-	  (mail-header-from data-header))
-	 ((equal field 'message-id)
-	  (mail-header-message-id data-header))
-	 ((equal field 'subject)
-	  (mail-header-subject data-header))
-	 ((equal field 'references)
-	  (mail-header-references data-header))
-	 ((equal field 'date)
-	  (mail-header-date data-header))
-	 ((equal field 'xref)
-	  (mail-header-xref data-header))
-	 ((equal field 'extra)
-	  (mail-header-extra data-header))
-	 (t
-	  (gnus-error
-	   5
-	   "spam-fetch-field-fast: unknown field %s requested"
-	   field)
-	  nil))
-	(gnus-message 6 "Article %d has a nil data header" article)))))
+        (cond
+         ((equal field 'number)
+          (mail-header-number data-header))
+         ((equal field 'from)
+          (mail-header-from data-header))
+         ((equal field 'message-id)
+          (mail-header-message-id data-header))
+         ((equal field 'subject)
+          (mail-header-subject data-header))
+         ((equal field 'references)
+          (mail-header-references data-header))
+         ((equal field 'date)
+          (mail-header-date data-header))
+         ((equal field 'xref)
+          (mail-header-xref data-header))
+         ((equal field 'extra)
+          (mail-header-extra data-header))
+         (t
+          (gnus-error
+           5
+           "spam-fetch-field-fast: unknown field %s requested"
+           field)
+          nil))
+        (gnus-message 6 "Article %d has a nil data header" article)))))
 
 (defun spam-fetch-field-from-fast (article &optional prepared-data-header)
   (spam-fetch-field-fast article 'from prepared-data-header))
@@ -1588,19 +1620,19 @@
 (defun spam-generate-fake-headers (article)
   (let ((dh (spam-fetch-article-header article)))
     (if dh
-	(concat
-	 (format
-	  ;; 80-character limit makes for strange constructs
-	  (concat "From: %s\nSubject: %s\nMessage-ID: %s\n"
-		  "Date: %s\nReferences: %s\nXref: %s\n")
-	  (spam-fetch-field-fast article 'from dh)
-	  (spam-fetch-field-fast article 'subject dh)
-	  (spam-fetch-field-fast article 'message-id dh)
-	  (spam-fetch-field-fast article 'date dh)
-	  (spam-fetch-field-fast article 'references dh)
-	  (spam-fetch-field-fast article 'xref dh))
-	 (when (spam-fetch-field-fast article 'extra dh)
-	   (format "%s\n" (spam-fetch-field-fast article 'extra dh))))
+        (concat
+         (format
+          ;; 80-character limit makes for strange constructs
+          (concat "From: %s\nSubject: %s\nMessage-ID: %s\n"
+                  "Date: %s\nReferences: %s\nXref: %s\n")
+          (spam-fetch-field-fast article 'from dh)
+          (spam-fetch-field-fast article 'subject dh)
+          (spam-fetch-field-fast article 'message-id dh)
+          (spam-fetch-field-fast article 'date dh)
+          (spam-fetch-field-fast article 'references dh)
+          (spam-fetch-field-fast article 'xref dh))
+         (when (spam-fetch-field-fast article 'extra dh)
+           (format "%s\n" (spam-fetch-field-fast article 'extra dh))))
       (gnus-message
        5
        "spam-generate-fake-headers: article %d didn't have a valid header"
@@ -1627,122 +1659,122 @@
   (unless spam-split-disabled
     (let ((spam-split-group-choice spam-split-group))
       (dolist (check specific-checks)
-	(when (stringp check)
-	  (setq spam-split-group-choice check)
-	  (setq specific-checks (delq check specific-checks))))
+        (when (stringp check)
+          (setq spam-split-group-choice check)
+          (setq specific-checks (delq check specific-checks))))
 
       (let ((spam-split-group spam-split-group-choice)
-	    (widening-needed-check (spam-widening-needed-p specific-checks)))
-	(save-excursion
-	  (save-restriction
-	    (when widening-needed-check
-	      (widen)
-	      (gnus-message 8 "spam-split: widening the buffer (%s requires it)"
-			    widening-needed-check))
-	    (let ((backends (spam-backend-list))
-		  decision)
-	      (while (and backends (not decision))
-		(let* ((backend (pop backends))
-		       (check-function (spam-backend-check backend))
-		       (spam-split-group (if spam-split-symbolic-return
-					     'spam
-					   spam-split-group)))
-		  (when (or
-			 ;; either, given specific checks, this is one of them
-			 (memq backend specific-checks)
-			 ;; or, given no specific checks, spam-use-CHECK is set
-			 (and (null specific-checks) (symbol-value backend)))
-		    (gnus-message 6 "spam-split: calling the %s function"
-				  check-function)
-		    (setq decision (funcall check-function))
-		    ;; if we got a decision at all, save the current check
-		    (when decision
-		      (setq spam-split-last-successful-check backend))
-
-		    (when (eq decision 'spam)
-		      (unless spam-split-symbolic-return
-			(gnus-error
-			 5
-			 (format "spam-split got %s but %s is nil"
-				 decision
-				 spam-split-symbolic-return)))))))
-	      (if (eq decision t)
-		  (if spam-split-symbolic-return-positive 'ham nil)
-		decision))))))))
+            (widening-needed-check (spam-widening-needed-p specific-checks)))
+        (save-excursion
+          (save-restriction
+            (when widening-needed-check
+              (widen)
+              (gnus-message 8 "spam-split: widening the buffer (%s requires it)"
+                            widening-needed-check))
+            (let ((backends (spam-backend-list))
+                  decision)
+              (while (and backends (not decision))
+                (let* ((backend (pop backends))
+                       (check-function (spam-backend-check backend))
+                       (spam-split-group (if spam-split-symbolic-return
+                                             'spam
+                                           spam-split-group)))
+                  (when (or
+                         ;; either, given specific checks, this is one of them
+                         (memq backend specific-checks)
+                         ;; or, given no specific checks, spam-use-CHECK is set
+                         (and (null specific-checks) (symbol-value backend)))
+                    (gnus-message 6 "spam-split: calling the %s function"
+                                  check-function)
+                    (setq decision (funcall check-function))
+                    ;; if we got a decision at all, save the current check
+                    (when decision
+                      (setq spam-split-last-successful-check backend))
+
+                    (when (eq decision 'spam)
+                      (unless spam-split-symbolic-return
+                        (gnus-error
+                         5
+                         (format "spam-split got %s but %s is nil"
+                                 decision
+                                 spam-split-symbolic-return)))))))
+              (if (eq decision t)
+                  (if spam-split-symbolic-return-positive 'ham nil)
+                decision))))))))
 
 (defun spam-find-spam ()
   "Detect spam in the current newsgroup using `spam-split'."
   (interactive)
 
   (let* ((group gnus-newsgroup-name)
-	 (autodetect (gnus-parameter-spam-autodetect group))
-	 (methods (gnus-parameter-spam-autodetect-methods group))
-	 (first-method (nth 0 methods))
-	 (articles (if spam-autodetect-recheck-messages
-		       gnus-newsgroup-articles
-		     gnus-newsgroup-unseen))
-	 article-cannot-be-faked)
+         (autodetect (gnus-parameter-spam-autodetect group))
+         (methods (gnus-parameter-spam-autodetect-methods group))
+         (first-method (nth 0 methods))
+         (articles (if spam-autodetect-recheck-messages
+                       gnus-newsgroup-articles
+                     gnus-newsgroup-unseen))
+         article-cannot-be-faked)
 
 
     (dolist (backend methods)
       (when (spam-backend-statistical-p backend)
-	(setq article-cannot-be-faked t)
-	(return)))
+        (setq article-cannot-be-faked t)
+        (return)))
 
     (when (memq 'default methods)
       (setq article-cannot-be-faked t))
 
     (when (and autodetect
-	       (not (equal first-method 'none)))
+               (not (equal first-method 'none)))
       (mapcar
        (lambda (article)
-	 (let ((id (spam-fetch-field-message-id-fast article))
-	       (subject (spam-fetch-field-subject-fast article))
-	       (sender (spam-fetch-field-from-fast article))
-	       registry-lookup)
-
-	   (unless id
-	     (gnus-message 6 "Article %d has no message ID!" article))
-
-	   (when (and id spam-log-to-registry)
-	     (setq registry-lookup (spam-log-registration-type id 'incoming))
-	     (when registry-lookup
-	       (gnus-message
-		9
-		"spam-find-spam: message %s was already registered incoming"
-		id)))
-
-	   (let* ((spam-split-symbolic-return t)
-		  (spam-split-symbolic-return-positive t)
-		  (fake-headers (spam-generate-fake-headers article))
-		  (split-return
-		   (or registry-lookup
-		       (with-temp-buffer
-			 (if article-cannot-be-faked
-			     (gnus-request-article-this-buffer
-			      article
-			      group)
-			   ;; else, we fake the article
-			   (when fake-headers (insert fake-headers)))
-			 (if (or (null first-method)
-				 (equal first-method 'default))
-			     (spam-split)
-			   (apply 'spam-split methods))))))
-	     (if (equal split-return 'spam)
-		 (gnus-summary-mark-article article gnus-spam-mark))
-
-	     (when (and id split-return spam-log-to-registry)
-	       (when (zerop (gnus-registry-group-count id))
-		 (gnus-registry-add-group
-		  id group subject sender))
-
-	       (unless registry-lookup
-		 (spam-log-processing-to-registry
-		  id
-		  'incoming
-		  split-return
-		  spam-split-last-successful-check
-		  group))))))
+         (let ((id (spam-fetch-field-message-id-fast article))
+               (subject (spam-fetch-field-subject-fast article))
+               (sender (spam-fetch-field-from-fast article))
+               registry-lookup)
+
+           (unless id
+             (gnus-message 6 "Article %d has no message ID!" article))
+
+           (when (and id spam-log-to-registry)
+             (setq registry-lookup (spam-log-registration-type id 'incoming))
+             (when registry-lookup
+               (gnus-message
+                9
+                "spam-find-spam: message %s was already registered incoming"
+                id)))
+
+           (let* ((spam-split-symbolic-return t)
+                  (spam-split-symbolic-return-positive t)
+                  (fake-headers (spam-generate-fake-headers article))
+                  (split-return
+                   (or registry-lookup
+                       (with-temp-buffer
+                         (if article-cannot-be-faked
+                             (gnus-request-article-this-buffer
+                              article
+                              group)
+                           ;; else, we fake the article
+                           (when fake-headers (insert fake-headers)))
+                         (if (or (null first-method)
+                                 (equal first-method 'default))
+                             (spam-split)
+                           (apply 'spam-split methods))))))
+             (if (equal split-return 'spam)
+                 (gnus-summary-mark-article article gnus-spam-mark))
+
+             (when (and id split-return spam-log-to-registry)
+               (when (zerop (gnus-registry-group-count id))
+                 (gnus-registry-add-group
+                  id group subject sender))
+
+               (unless registry-lookup
+                 (spam-log-processing-to-registry
+                  id
+                  'incoming
+                  split-return
+                  spam-split-last-successful-check
+                  group))))))
        articles))))
 
 ;;}}}
@@ -1754,104 +1786,104 @@
   (dolist (backend-type '(non-mover mover))
     (dolist (classification (spam-classifications))
       (dolist (backend (spam-backend-list backend-type))
-	(let ((rlist (spam-backend-get-article-todo-list
-		      backend classification))
-	      (ulist (spam-backend-get-article-todo-list
-		      backend classification t))
-	      (delcount 0))
-
-	  ;; clear the old lists right away
-	  (spam-backend-put-article-todo-list backend
-					      classification
-					      nil
-					      nil)
-	  (spam-backend-put-article-todo-list backend
-					      classification
-					      nil
-					      t)
-
-	  ;; eliminate duplicates
-	  (dolist (article (copy-sequence ulist))
-	    (when (memq article rlist)
-	      (incf delcount)
-	      (setq rlist (delq article rlist))
-	      (setq ulist (delq article ulist))))
-
-	  (unless (zerop delcount)
-	    (gnus-message
-	     9
-	     "%d messages were saved the trouble of unregistering and then registering"
-	     delcount))
-
-	  ;; unregister articles
-	  (unless (zerop (length ulist))
-	    (let ((num (spam-unregister-routine classification backend ulist)))
-	      (when (> num 0)
-		(gnus-message
-		 6
-		 "%d %s messages were unregistered by backend %s."
-		 num
-		 classification
-		 backend))))
-
-	    ;; register articles
-	    (unless (zerop (length rlist))
-	      (let ((num (spam-register-routine classification backend rlist)))
-		(when (> num 0)
-		  (gnus-message
-		   6
-		   "%d %s messages were registered by backend %s."
-		   num
-		   classification
-		   backend)))))))))
+        (let ((rlist (spam-backend-get-article-todo-list
+                      backend classification))
+              (ulist (spam-backend-get-article-todo-list
+                      backend classification t))
+              (delcount 0))
+
+          ;; clear the old lists right away
+          (spam-backend-put-article-todo-list backend
+                                              classification
+                                              nil
+                                              nil)
+          (spam-backend-put-article-todo-list backend
+                                              classification
+                                              nil
+                                              t)
+
+          ;; eliminate duplicates
+          (dolist (article (copy-sequence ulist))
+            (when (memq article rlist)
+              (incf delcount)
+              (setq rlist (delq article rlist))
+              (setq ulist (delq article ulist))))
+
+          (unless (zerop delcount)
+            (gnus-message
+             9
+             "%d messages did not have to unregister and then register"
+             delcount))
+
+          ;; unregister articles
+          (unless (zerop (length ulist))
+            (let ((num (spam-unregister-routine classification backend ulist)))
+              (when (> num 0)
+                (gnus-message
+                 6
+                 "%d %s messages were unregistered by backend %s."
+                 num
+                 classification
+                 backend))))
+
+            ;; register articles
+            (unless (zerop (length rlist))
+              (let ((num (spam-register-routine classification backend rlist)))
+                (when (> num 0)
+                  (gnus-message
+                   6
+                   "%d %s messages were registered by backend %s."
+                   num
+                   classification
+                   backend)))))))))
 
 (defun spam-unregister-routine (classification
-				backend
-				specific-articles)
+                                backend
+                                specific-articles)
   (spam-register-routine classification backend specific-articles t))
 
 (defun spam-register-routine (classification
-			      backend
-			      specific-articles
-			      &optional unregister)
+                              backend
+                              specific-articles
+                              &optional unregister)
   (when (and (spam-classification-valid-p classification)
-	     (spam-backend-valid-p backend))
+             (spam-backend-valid-p backend))
     (let* ((register-function
-	    (spam-backend-function backend classification 'registration))
-	   (unregister-function
-	    (spam-backend-function backend classification 'unregistration))
-	   (run-function (if unregister
-			     unregister-function
-			   register-function))
-	   (log-function (if unregister
-			     'spam-log-undo-registration
-			   'spam-log-processing-to-registry))
-	   article articles)
+            (spam-backend-function backend classification 'registration))
+           (unregister-function
+            (spam-backend-function backend classification 'unregistration))
+           (run-function (if unregister
+                             unregister-function
+                           register-function))
+           (log-function (if unregister
+                             'spam-log-undo-registration
+                           'spam-log-processing-to-registry))
+           article articles)
 
       (when run-function
-	;; make list of articles, using specific-articles if given
-	(setq articles (or specific-articles
-			   (spam-list-articles
-			    gnus-newsgroup-articles
-			    classification)))
-	;; process them
+        ;; make list of articles, using specific-articles if given
+        (setq articles (or specific-articles
+                           (spam-list-articles
+                            gnus-newsgroup-articles
+                            classification)))
+        ;; process them
         (when (> (length articles) 0)
-	  (gnus-message 5 "%s %d %s articles as %s using backend %s"
-			(if unregister "Unregistering" "Registering")
-			(length articles)
-			(if specific-articles "specific" "")
-			classification
-			backend)
-	  (funcall run-function articles)
-	  ;; now log all the registrations (or undo them, depending on
-	  ;; unregister)
-	  (dolist (article articles)
-	    (funcall log-function
-		     (spam-fetch-field-message-id-fast article)
-		     'process
-		     classification
-		     backend
-		     gnus-newsgroup-name))))
+          (gnus-message 5 "%s %d %s articles as %s using backend %s"
+                        (if unregister "Unregistering" "Registering")
+                        (length articles)
+                        (if specific-articles "specific" "")
+                        classification
+                        backend)
+          (funcall run-function articles)
+          ;; now log all the registrations (or undo them, depending on
+          ;; unregister)
+          (dolist (article articles)
+            (funcall log-function
+                     (spam-fetch-field-message-id-fast article)
+                     'process
+                     classification
+                     backend
+                     gnus-newsgroup-name))))
       ;; return the number of articles processed
       (length articles))))
 
@@ -1859,50 +1891,51 @@
 (defun spam-log-processing-to-registry (id type classification backend group)
   (when spam-log-to-registry
     (if (and (stringp id)
-	     (stringp group)
-	     (spam-process-type-valid-p type)
-	     (spam-classification-valid-p classification)
-	     (spam-backend-valid-p backend))
-	(let ((cell-list (cdr-safe (gnus-registry-fetch-extra id type)))
-	      (cell (list classification backend group)))
-	  (push cell cell-list)
-	  (gnus-registry-store-extra-entry
-	   id
-	   type
-	   cell-list))
+             (stringp group)
+             (spam-process-type-valid-p type)
+             (spam-classification-valid-p classification)
+             (spam-backend-valid-p backend))
+        (let ((cell-list (cdr-safe (gnus-registry-fetch-extra id type)))
+              (cell (list classification backend group)))
+          (push cell cell-list)
+          (gnus-registry-store-extra-entry
+           id
+           type
+           cell-list))
 
       (gnus-error
        7
-       (format "%s call with bad ID, type, classification, spam-backend, or group"
-	       "spam-log-processing-to-registry")))))
+       (format
+        "%s call with bad ID, type, classification, spam-backend, or group"
+        "spam-log-processing-to-registry")))))
 
 ;;; check if a ham- or spam-processor registration has been done
 (defun spam-log-registered-p (id type)
   (when spam-log-to-registry
     (if (and (stringp id)
-	     (spam-process-type-valid-p type))
-	(cdr-safe (gnus-registry-fetch-extra id type))
+             (spam-process-type-valid-p type))
+        (cdr-safe (gnus-registry-fetch-extra id type))
       (progn
-	(gnus-error
-	 7
-	 (format "%s called with bad ID, type, classification, or spam-backend"
-		 "spam-log-registered-p"))
-	nil))))
+        (gnus-error
+         7
+         (format "%s called with bad ID, type, classification, or spam-backend"
+                 "spam-log-registered-p"))
+        nil))))
 
 ;;; check what a ham- or spam-processor registration says
 ;;; returns nil if conflicting registrations are found
 (defun spam-log-registration-type (id type)
   (let ((count 0)
-	decision)
+        decision)
     (dolist (reg (spam-log-registered-p id type))
       (let ((classification (nth 0 reg)))
-	(when (spam-classification-valid-p classification)
-	  (when (and decision
-		     (not (eq classification decision)))
-	    (setq count (+ 1 count)))
-	  (setq decision classification))))
+        (when (spam-classification-valid-p classification)
+          (when (and decision
+                     (not (eq classification decision)))
+            (setq count (+ 1 count)))
+          (setq decision classification))))
     (if (< 0 count)
-	nil
+        nil
       decision)))
 
 
@@ -1910,47 +1943,49 @@
 (defun spam-log-unregistration-needed-p (id type classification backend)
   (when spam-log-to-registry
     (if (and (stringp id)
-	     (spam-process-type-valid-p type)
-	     (spam-classification-valid-p classification)
-	     (spam-backend-valid-p backend))
-	(let ((cell-list (cdr-safe (gnus-registry-fetch-extra id type)))
-	      found)
-	  (dolist (cell cell-list)
-	    (unless found
-	      (when (and (eq classification (nth 0 cell))
-			 (eq backend (nth 1 cell)))
-		(setq found t))))
-	  found)
+             (spam-process-type-valid-p type)
+             (spam-classification-valid-p classification)
+             (spam-backend-valid-p backend))
+        (let ((cell-list (cdr-safe (gnus-registry-fetch-extra id type)))
+              found)
+          (dolist (cell cell-list)
+            (unless found
+              (when (and (eq classification (nth 0 cell))
+                         (eq backend (nth 1 cell)))
+                (setq found t))))
+          found)
       (progn
-	(gnus-error
-	 7
-	 (format "%s called with bad ID, type, classification, or spam-backend"
-		 "spam-log-unregistration-needed-p"))
-	nil))))
+        (gnus-error
+         7
+         (format "%s called with bad ID, type, classification, or spam-backend"
+                 "spam-log-unregistration-needed-p"))
+        nil))))
 
 
 ;;; undo a ham- or spam-processor registration (the group is not used)
-(defun spam-log-undo-registration (id type classification backend &optional group)
+(defun spam-log-undo-registration (id type classification backend
+                                      &optional group)
   (when (and spam-log-to-registry
-	     (spam-log-unregistration-needed-p id type classification backend))
+             (spam-log-unregistration-needed-p id type classification backend))
     (if (and (stringp id)
-	     (spam-process-type-valid-p type)
-	     (spam-classification-valid-p classification)
-	     (spam-backend-valid-p backend))
-	(let ((cell-list (cdr-safe (gnus-registry-fetch-extra id type)))
-	      new-cell-list found)
-	  (dolist (cell cell-list)
-	    (unless (and (eq classification (nth 0 cell))
-			 (eq backend (nth 1 cell)))
-	      (push cell new-cell-list)))
-	  (gnus-registry-store-extra-entry
-	   id
-	   type
-	   new-cell-list))
+             (spam-process-type-valid-p type)
+             (spam-classification-valid-p classification)
+             (spam-backend-valid-p backend))
+        (let ((cell-list (cdr-safe (gnus-registry-fetch-extra id type)))
+              new-cell-list found)
+          (dolist (cell cell-list)
+            (unless (and (eq classification (nth 0 cell))
+                         (eq backend (nth 1 cell)))
+              (push cell new-cell-list)))
+          (gnus-registry-store-extra-entry
+           id
+           type
+           new-cell-list))
       (progn
-	(gnus-error 7 (format "%s call with bad ID, type, spam-backend, or group"
-			      "spam-log-undo-registration"))
-	nil))))
+        (gnus-error 7 (format
+                       "%s call with bad ID, type, spam-backend, or group"
+                       "spam-log-undo-registration"))
+        nil))))
 
 ;;}}}
 
@@ -1959,12 +1994,12 @@
 ;;{{{ Gmane xrefs
 (defun spam-check-gmane-xref ()
   (let ((header (or
-		 (message-fetch-field "Xref")
-		 (message-fetch-field "Newsgroups"))))
-    (when header			; return nil when no header
+                 (message-fetch-field "Xref")
+                 (message-fetch-field "Newsgroups"))))
+    (when header                        ; return nil when no header
       (when (string-match spam-gmane-xref-spam-group
-			  header)
-	  spam-split-group))))
+                          header)
+          spam-split-group))))
 
 ;;}}}
 
@@ -1972,7 +2007,7 @@
 
 (defun spam-check-regex-body ()
   (let ((spam-regex-headers-ham spam-regex-body-ham)
-	(spam-regex-headers-spam spam-regex-body-spam))
+        (spam-regex-headers-spam spam-regex-body-spam))
     (spam-check-regex-headers t)))
 
 ;;}}}
@@ -1981,20 +2016,20 @@
 
 (defun spam-check-regex-headers (&optional body)
   (let ((type (if body "body" "header"))
-	ret found)
+        ret found)
     (dolist (h-regex spam-regex-headers-ham)
       (unless found
-	(goto-char (point-min))
-	(when (re-search-forward h-regex nil t)
-	  (message "Ham regex %s search positive." type)
-	  (setq found t))))
+        (goto-char (point-min))
+        (when (re-search-forward h-regex nil t)
+          (message "Ham regex %s search positive." type)
+          (setq found t))))
     (dolist (s-regex spam-regex-headers-spam)
       (unless found
-	(goto-char (point-min))
-	(when (re-search-forward s-regex nil t)
-	  (message "Spam regex %s search positive." type)
-	  (setq found t)
-	  (setq ret spam-split-group))))
+        (goto-char (point-min))
+        (when (re-search-forward s-regex nil t)
+          (message "Spam regex %s search positive." type)
+          (setq found t)
+          (setq ret spam-split-group))))
     ret))
 
 ;;}}}
@@ -2004,44 +2039,44 @@
 (defun spam-reverse-ip-string (ip)
   (when (stringp ip)
     (mapconcat 'identity
-	       (nreverse (split-string ip "\\."))
-	       ".")))
+               (nreverse (split-string ip "\\."))
+               ".")))
 
 (defun spam-check-blackholes ()
   "Check the Received headers for blackholed relays."
   (let ((headers (message-fetch-field "received"))
-	ips matches)
+        ips matches)
     (when headers
       (with-temp-buffer
-	(insert headers)
-	(goto-char (point-min))
-	(gnus-message 6 "Checking headers for relay addresses")
-	(while (re-search-forward
-		"\\([0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+\\)" nil t)
-	  (gnus-message 9 "Blackhole search found host IP %s." (match-string 1))
-	  (push (spam-reverse-ip-string (match-string 1))
-		ips)))
+        (insert headers)
+        (goto-char (point-min))
+        (gnus-message 6 "Checking headers for relay addresses")
+        (while (re-search-forward
+                "\\([0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+\\)" nil t)
+          (gnus-message 9 "Blackhole search found host IP %s." (match-string 1))
+          (push (spam-reverse-ip-string (match-string 1))
+                ips)))
       (dolist (server spam-blackhole-servers)
-	(dolist (ip ips)
-	  (unless (and spam-blackhole-good-server-regex
-		       ;; match the good-server-regex against the reversed (again) IP string
-		       (string-match
-			spam-blackhole-good-server-regex
-			(spam-reverse-ip-string ip)))
-	    (unless matches
-	      (let ((query-string (concat ip "." server)))
-		(if spam-use-dig
-		    (let ((query-result (query-dig query-string)))
-		      (when query-result
-			(gnus-message 6 "(DIG): positive blackhole check '%s'"
-				      query-result)
-			(push (list ip server query-result)
-			      matches)))
-		  ;; else, if not using dig.el
-		  (when (dns-query query-string)
-		    (gnus-message 6 "positive blackhole check")
-		    (push (list ip server (dns-query query-string 'TXT))
-			  matches)))))))))
+        (dolist (ip ips)
+          (unless (and spam-blackhole-good-server-regex
+                       ;; match against the reversed (again) IP string
+                       (string-match
+                        spam-blackhole-good-server-regex
+                        (spam-reverse-ip-string ip)))
+            (unless matches
+              (let ((query-string (concat ip "." server)))
+                (if spam-use-dig
+                    (let ((query-result (query-dig query-string)))
+                      (when query-result
+                        (gnus-message 6 "(DIG): positive blackhole check '%s'"
+                                      query-result)
+                        (push (list ip server query-result)
+                              matches)))
+                  ;; else, if not using dig.el
+                  (when (dns-query query-string)
+                    (gnus-message 6 "positive blackhole check")
+                    (push (list ip server (dns-query query-string 'TXT))
+                          matches)))))))))
     (when matches
       spam-split-group)))
 ;;}}}
@@ -2050,7 +2085,7 @@
 
 (defun spam-check-hashcash ()
   "Check the headers for hashcash payments."
-  (ignore-errors (mail-check-payment)))	 ;mail-check-payment returns a boolean
+  (ignore-errors (mail-check-payment)))  ;mail-check-payment returns a boolean
 
 ;;}}}
 
@@ -2071,16 +2106,16 @@
 
 (eval-and-compile
   (when (condition-case nil
-	    (progn
-	      (require 'bbdb)
-	      (require 'bbdb-com))
-	  (file-error
-	   ;; `bbdb-records' should not be bound as an autoload function
-	   ;; before loading bbdb because of `bbdb-hashtable-size'.
-	   (defalias 'bbdb-records 'ignore)
-	   (defalias 'spam-BBDB-register-routine 'ignore)
-	   (defalias 'spam-enter-ham-BBDB 'ignore)
-	   nil))
+            (progn
+              (require 'bbdb)
+              (require 'bbdb-com))
+          (file-error
+           ;; `bbdb-records' should not be bound as an autoload function
+           ;; before loading bbdb because of `bbdb-hashtable-size'.
+           (defalias 'bbdb-records 'ignore)
+           (defalias 'spam-BBDB-register-routine 'ignore)
+           (defalias 'spam-enter-ham-BBDB 'ignore)
+           nil))
 
     ;; when the BBDB changes, we want to clear out our cache
     (defun spam-clear-cache-BBDB (&rest immaterial)
@@ -2091,32 +2126,32 @@
     (defun spam-enter-ham-BBDB (addresses &optional remove)
       "Enter an address into the BBDB; implies ham (non-spam) sender"
       (dolist (from addresses)
-	(when (stringp from)
-	  (let* ((parsed-address (gnus-extract-address-components from))
-		 (name (or (nth 0 parsed-address) "Ham Sender"))
-		 (remove-function (if remove
-				      'bbdb-delete-record-internal
-				    'ignore))
-		 (net-address (nth 1 parsed-address))
-		 (record (and net-address
-			      (bbdb-search-simple nil net-address))))
-	    (when net-address
-	      (gnus-message 6 "%s address %s %s BBDB"
-			    (if remove "Deleting" "Adding")
-			    from
-			    (if remove "from" "to"))
-	      (if record
-		  (funcall remove-function record)
-		(bbdb-create-internal name nil net-address nil nil
-				      "ham sender added by spam.el")))))))
+        (when (stringp from)
+          (let* ((parsed-address (gnus-extract-address-components from))
+                 (name (or (nth 0 parsed-address) "Ham Sender"))
+                 (remove-function (if remove
+                                      'bbdb-delete-record-internal
+                                    'ignore))
+                 (net-address (nth 1 parsed-address))
+                 (record (and net-address
+                              (bbdb-search-simple nil net-address))))
+            (when net-address
+              (gnus-message 6 "%s address %s %s BBDB"
+                            (if remove "Deleting" "Adding")
+                            from
+                            (if remove "from" "to"))
+              (if record
+                  (funcall remove-function record)
+                (bbdb-create-internal name nil net-address nil nil
+                                      "ham sender added by spam.el")))))))
 
     (defun spam-BBDB-register-routine (articles &optional unregister)
       (let (addresses)
-	(dolist (article articles)
-	  (when (stringp (spam-fetch-field-from-fast article))
-	    (push (spam-fetch-field-from-fast article) addresses)))
-	;; now do the register/unregister action
-	(spam-enter-ham-BBDB addresses unregister)))
+        (dolist (article articles)
+          (when (stringp (spam-fetch-field-from-fast article))
+            (push (spam-fetch-field-from-fast article) addresses)))
+        ;; now do the register/unregister action
+        (spam-enter-ham-BBDB addresses unregister)))
 
     (defun spam-BBDB-unregister-routine (articles)
       (spam-BBDB-register-routine articles t))
@@ -2124,32 +2159,32 @@
     (defun spam-check-BBDB ()
       "Mail from people in the BBDB is classified as ham or non-spam"
       (let ((who (message-fetch-field "from"))
-	    bbdb-cache bbdb-hashtable)
-	(when spam-cache-lookups
-	  (setq bbdb-cache (gethash 'spam-use-BBDB spam-caches))
-	  (unless bbdb-cache
-	    (setq bbdb-cache (make-vector 17 0)) ; a good starting hash value
-	    ;; this is based on the expanded (bbdb-hashtable) macro
-	    ;; without the debugging support
-	    (with-current-buffer (bbdb-buffer)
-	      (save-excursion
-		(save-window-excursion
-		  (bbdb-records nil t)
-		  (mapatoms
-		   (lambda (symbol)
-		     (intern (downcase (symbol-name symbol)) bbdb-cache))
-		   bbdb-hashtable))))
-	    (puthash 'spam-use-BBDB bbdb-cache spam-caches)))
-	(when who
-	  (setq who (nth 1 (gnus-extract-address-components who)))
-	  (if
-	      (if spam-cache-lookups
-		  (intern-soft (downcase who) bbdb-cache)
-		(bbdb-search-simple nil who))
-	      t
-	    (if spam-use-BBDB-exclusive
-		spam-split-group
-	      nil)))))))
+            bbdb-cache bbdb-hashtable)
+        (when spam-cache-lookups
+          (setq bbdb-cache (gethash 'spam-use-BBDB spam-caches))
+          (unless bbdb-cache
+            (setq bbdb-cache (make-vector 17 0)) ; a good starting hash value
+            ;; this is based on the expanded (bbdb-hashtable) macro
+            ;; without the debugging support
+            (with-current-buffer (bbdb-buffer)
+              (save-excursion
+                (save-window-excursion
+                  (bbdb-records nil t)
+                  (mapatoms
+                   (lambda (symbol)
+                     (intern (downcase (symbol-name symbol)) bbdb-cache))
+                   bbdb-hashtable))))
+            (puthash 'spam-use-BBDB bbdb-cache spam-caches)))
+        (when who
+          (setq who (nth 1 (gnus-extract-address-components who)))
+          (if
+              (if spam-cache-lookups
+                  (intern-soft (downcase who) bbdb-cache)
+                (bbdb-search-simple nil who))
+              t
+            (if spam-use-BBDB-exclusive
+                spam-split-group
+              nil)))))))
 
 ;;}}}
 
@@ -2169,44 +2204,44 @@
 (defun spam-check-ifile ()
   "Check the ifile backend for the classification of this message."
   (let ((article-buffer-name (buffer-name))
-	category return)
+        category return)
     (with-temp-buffer
       (let ((temp-buffer-name (buffer-name))
-	    (db-param (spam-get-ifile-database-parameter)))
-	(with-current-buffer article-buffer-name
-	  (apply 'call-process-region
-		 (point-min) (point-max) spam-ifile-program
-		 nil temp-buffer-name nil "-c"
-		 (if db-param `(,db-param "-q") `("-q"))))
-	;; check the return now (we're back in the temp buffer)
-	(goto-char (point-min))
-	(if (not (eobp))
-	    (setq category (buffer-substring (point) (point-at-eol))))
-	(when (not (zerop (length category))) ; we need a category here
-	  (if spam-ifile-all-categories
-	      (setq return category)
-	    ;; else, if spam-ifile-all-categories is not set...
-	    (when (string-equal spam-ifile-spam-category category)
-	      (setq return spam-split-group)))))) ; note return is nil otherwise
+            (db-param (spam-get-ifile-database-parameter)))
+        (with-current-buffer article-buffer-name
+          (apply 'call-process-region
+                 (point-min) (point-max) spam-ifile-program
+                 nil temp-buffer-name nil "-c"
+                 (if db-param `(,db-param "-q") `("-q"))))
+        ;; check the return now (we're back in the temp buffer)
+        (goto-char (point-min))
+        (if (not (eobp))
+            (setq category (buffer-substring (point) (point-at-eol))))
+        (when (not (zerop (length category))) ; we need a category here
+          (if spam-ifile-all-categories
+              (setq return category)
+            ;; else, if spam-ifile-all-categories is not set...
+            (when (string-equal spam-ifile-spam-category category)
+              (setq return spam-split-group)))))) ; note return is nil otherwise
     return))
 
 (defun spam-ifile-register-with-ifile (articles category &optional unregister)
   "Register an article, given as a string, with a category.
 Uses `gnus-newsgroup-name' if category is nil (for ham registration)."
   (let ((category (or category gnus-newsgroup-name))
-	(add-or-delete-option (if unregister "-d" "-i"))
-	(db (spam-get-ifile-database-parameter))
-	parameters)
+        (add-or-delete-option (if unregister "-d" "-i"))
+        (db (spam-get-ifile-database-parameter))
+        parameters)
     (with-temp-buffer
       (dolist (article articles)
-	(let ((article-string (spam-get-article-as-string article)))
-	  (when (stringp article-string)
-	    (insert article-string))))
+        (let ((article-string (spam-get-article-as-string article)))
+          (when (stringp article-string)
+            (insert article-string))))
       (apply 'call-process-region
-	     (point-min) (point-max) spam-ifile-program
-	     nil nil nil
-	     add-or-delete-option category
-	     (if db `(,db "-h") `("-h"))))))
+             (point-min) (point-max) spam-ifile-program
+             nil nil nil
+             add-or-delete-option category
+             (if db `(,db "-h") `("-h"))))))
 
 (defun spam-ifile-register-spam-routine (articles &optional unregister)
   (spam-ifile-register-with-ifile articles spam-ifile-spam-category unregister))
@@ -2235,40 +2270,40 @@
 
 (eval-and-compile
   (when (condition-case nil
-	    (let ((spam-stat-install-hooks nil))
-	      (require 'spam-stat))
-	  (file-error
-	   (defalias 'spam-stat-register-ham-routine 'ignore)
-	   (defalias 'spam-stat-register-spam-routine 'ignore)
-	   nil))
+            (let ((spam-stat-install-hooks nil))
+              (require 'spam-stat))
+          (file-error
+           (defalias 'spam-stat-register-ham-routine 'ignore)
+           (defalias 'spam-stat-register-spam-routine 'ignore)
+           nil))
 
     (defun spam-check-stat ()
       "Check the spam-stat backend for the classification of this message"
       (let ((spam-stat-split-fancy-spam-group spam-split-group) ; override
-	    (spam-stat-buffer (buffer-name)) ; stat the current buffer
-	    category return)
-	(spam-stat-split-fancy)))
+            (spam-stat-buffer (buffer-name)) ; stat the current buffer
+            category return)
+        (spam-stat-split-fancy)))
 
     (defun spam-stat-register-spam-routine (articles &optional unregister)
       (dolist (article articles)
-	(let ((article-string (spam-get-article-as-string article)))
-	  (with-temp-buffer
-	    (insert article-string)
-	    (if unregister
-		(spam-stat-buffer-change-to-non-spam)
-	      (spam-stat-buffer-is-spam))))))
+        (let ((article-string (spam-get-article-as-string article)))
+          (with-temp-buffer
+            (insert article-string)
+            (if unregister
+                (spam-stat-buffer-change-to-non-spam)
+              (spam-stat-buffer-is-spam))))))
 
     (defun spam-stat-unregister-spam-routine (articles)
       (spam-stat-register-spam-routine articles t))
 
     (defun spam-stat-register-ham-routine (articles &optional unregister)
       (dolist (article articles)
-	(let ((article-string (spam-get-article-as-string article)))
-	  (with-temp-buffer
-	    (insert article-string)
-	    (if unregister
-		(spam-stat-buffer-change-to-spam)
-	      (spam-stat-buffer-is-non-spam))))))
+        (let ((article-string (spam-get-article-as-string article)))
+          (with-temp-buffer
+            (insert article-string)
+            (if unregister
+                (spam-stat-buffer-change-to-spam)
+              (spam-stat-buffer-is-non-spam))))))
 
     (defun spam-stat-unregister-ham-routine (articles)
       (spam-stat-register-ham-routine articles t))
@@ -2321,34 +2356,34 @@
     (with-current-buffer
        (find-file-noselect file)
       (dolist (a addresses)
-	(when (stringp a)
-	  (goto-char (point-min))
-	  (if (re-search-forward (regexp-quote a) nil t)
-	      ;; found the address
-	      (when remove
-		(spam-kill-whole-line))
-	    ;; else, the address was not found
-	    (unless remove
-	      (goto-char (point-max))
-	      (unless (bobp)
-		(insert "\n"))
-	      (insert a "\n")))))
+        (when (stringp a)
+          (goto-char (point-min))
+          (if (re-search-forward (regexp-quote a) nil t)
+              ;; found the address
+              (when remove
+                (spam-kill-whole-line))
+            ;; else, the address was not found
+            (unless remove
+              (goto-char (point-max))
+              (unless (bobp)
+                (insert "\n"))
+              (insert a "\n")))))
       (save-buffer))))
 
 (defun spam-filelist-build-cache (type)
   (let ((cache (if (eq type 'spam-use-blacklist)
-		   spam-blacklist-cache
-		 spam-whitelist-cache))
-	parsed-cache)
+                   spam-blacklist-cache
+                 spam-whitelist-cache))
+        parsed-cache)
     (unless (gethash type spam-caches)
       (while cache
-	(let ((address (pop cache)))
-	  (unless (zerop (length address)) ; 0 for a nil address too
-	    (setq address (regexp-quote address))
-	    ;; fix regexp-quote's treatment of user-intended regexes
-	    (while (string-match "\\\\\\*" address)
-	      (setq address (replace-match ".*" t t address))))
-	  (push address parsed-cache)))
+        (let ((address (pop cache)))
+          (unless (zerop (length address)) ; 0 for a nil address too
+            (setq address (regexp-quote address))
+            ;; fix regexp-quote's treatment of user-intended regexes
+            (while (string-match "\\\\\\*" address)
+              (setq address (replace-match ".*" t t address))))
+          (push address parsed-cache)))
       (puthash type parsed-cache spam-caches))))
 
 (defun spam-filelist-check-cache (type from)
@@ -2356,9 +2391,9 @@
     (spam-filelist-build-cache type)
     (let (found)
       (dolist (address (gethash type spam-caches))
-	(when (and address (string-match address from))
-	  (setq found t)
-	  (return)))
+        (when (and address (string-match address from))
+          (setq found t)
+          (return)))
       found)))
 
 ;;; returns t if the sender is in the whitelist, nil or
@@ -2370,7 +2405,7 @@
   (if (spam-from-listed-p 'spam-use-whitelist)
       t
     (if spam-use-whitelist-exclusive
-	spam-split-group
+        spam-split-group
       nil)))
 
 (defun spam-check-blacklist ()
@@ -2384,59 +2419,60 @@
   (when (file-readable-p file)
     (let (contents address)
       (with-temp-buffer
-	(insert-file-contents file)
-	(while (not (eobp))
-	  (setq address (buffer-substring (point) (point-at-eol)))
-	  (forward-line 1)
-	  ;; insert the e-mail address if detected, otherwise the raw data
-	  (unless (zerop (length address))
-	    (let ((pure-address (nth 1 (gnus-extract-address-components address))))
-	      (push (or pure-address address) contents)))))
+        (insert-file-contents file)
+        (while (not (eobp))
+          (setq address (buffer-substring (point) (point-at-eol)))
+          (forward-line 1)
+          ;; insert the e-mail address if detected, otherwise the raw data
+          (unless (zerop (length address))
+            (let ((pure-address
+                   (nth 1 (gnus-extract-address-components address))))
+              (push (or pure-address address) contents)))))
       (nreverse contents))))
 
 (defun spam-from-listed-p (type)
   (let ((from (message-fetch-field "from"))
-	found)
+        found)
     (spam-filelist-check-cache type from)))
 
 (defun spam-filelist-register-routine (articles blacklist &optional unregister)
   (let ((de-symbol (if blacklist 'spam-use-whitelist 'spam-use-blacklist))
-	(declassification (if blacklist 'ham 'spam))
-	(enter-function
-	 (if blacklist 'spam-enter-blacklist 'spam-enter-whitelist))
-	(remove-function
-	 (if blacklist 'spam-enter-whitelist 'spam-enter-blacklist))
-	from addresses unregister-list article-unregister-list)
+        (declassification (if blacklist 'ham 'spam))
+        (enter-function
+         (if blacklist 'spam-enter-blacklist 'spam-enter-whitelist))
+        (remove-function
+         (if blacklist 'spam-enter-whitelist 'spam-enter-blacklist))
+        from addresses unregister-list article-unregister-list)
     (dolist (article articles)
       (let ((from (spam-fetch-field-from-fast article))
-	    (id (spam-fetch-field-message-id-fast article))
-	    sender-ignored)
-	(when (stringp from)
-	  (dolist (ignore-regex spam-blacklist-ignored-regexes)
-	    (when (and (not sender-ignored)
-		       (stringp ignore-regex)
-		       (string-match ignore-regex from))
-	      (setq sender-ignored t)))
-	  ;; remember the messages we need to unregister, unless remove is set
-	  (when (and
-		 (null unregister)
-		 (spam-log-unregistration-needed-p
-		  id 'process declassification de-symbol))
-	    (push article article-unregister-list)
-	    (push from unregister-list))
-	  (unless sender-ignored
-	    (push from addresses)))))
+            (id (spam-fetch-field-message-id-fast article))
+            sender-ignored)
+        (when (stringp from)
+          (dolist (ignore-regex spam-blacklist-ignored-regexes)
+            (when (and (not sender-ignored)
+                       (stringp ignore-regex)
+                       (string-match ignore-regex from))
+              (setq sender-ignored t)))
+          ;; remember the messages we need to unregister, unless remove is set
+          (when (and
+                 (null unregister)
+                 (spam-log-unregistration-needed-p
+                  id 'process declassification de-symbol))
+            (push article article-unregister-list)
+            (push from unregister-list))
+          (unless sender-ignored
+            (push from addresses)))))
 
     (if unregister
-	(funcall enter-function addresses t) ; unregister all these addresses
+        (funcall enter-function addresses t) ; unregister all these addresses
       ;; else, register normally and unregister what we need to
       (funcall remove-function unregister-list t)
       (dolist (article article-unregister-list)
-	(spam-log-undo-registration
-	 (spam-fetch-field-message-id-fast article)
-	 'process
-	 declassification
-	 de-symbol))
+        (spam-log-undo-registration
+         (spam-fetch-field-message-id-fast article)
+         'process
+         declassification
+         de-symbol))
       (funcall enter-function addresses nil))))
 
 (defun spam-blacklist-unregister-routine (articles)
@@ -2467,9 +2503,9 @@
 
 (defun spam-report-resend-register-routine (articles &optional ham)
   (let* ((resend-to-gp
-	  (if ham
-	      (gnus-parameter-ham-resend-to gnus-newsgroup-name)
-	    (gnus-parameter-spam-resend-to gnus-newsgroup-name)))
+          (if ham
+              (gnus-parameter-ham-resend-to gnus-newsgroup-name)
+            (gnus-parameter-spam-resend-to gnus-newsgroup-name)))
          (spam-report-resend-to (or (car-safe resend-to-gp)
                                     spam-report-resend-to)))
     (spam-report-resend articles ham)))
@@ -2479,15 +2515,15 @@
 ;;{{{ Bogofilter
 (defun spam-check-bogofilter-headers (&optional score)
   (let ((header (message-fetch-field spam-bogofilter-header)))
-    (when header			; return nil when no header
-      (if score				; scoring mode
-	  (if (string-match "spamicity=\\([0-9.]+\\)" header)
-	      (match-string 1 header)
-	    "0")
-	;; spam detection mode
-	(when (string-match spam-bogofilter-bogosity-positive-spam-header
-			    header)
-	  spam-split-group)))))
+    (when header                        ; return nil when no header
+      (if score                         ; scoring mode
+          (if (string-match "spamicity=\\([0-9.]+\\)" header)
+              (match-string 1 header)
+            "0")
+        ;; spam detection mode
+        (when (string-match spam-bogofilter-bogosity-positive-spam-header
+                            header)
+          spam-split-group)))))
 
 ;; return something sensible if the score can't be determined
 (defun spam-bogofilter-score (&optional recheck)
@@ -2497,8 +2533,8 @@
     (gnus-summary-show-article t)
     (set-buffer gnus-article-buffer)
     (let ((score (or (unless recheck
-		       (spam-check-bogofilter-headers t))
-		     (spam-check-bogofilter t))))
+                       (spam-check-bogofilter-headers t))
+                     (spam-check-bogofilter t))))
       (gnus-summary-show-article)
       (message "Spamicity score %s" score)
       (or score "0"))))
@@ -2507,53 +2543,53 @@
   "Verify the Bogofilter version is sufficient."
   (when (eq spam-bogofilter-valid 'unknown)
     (setq spam-bogofilter-valid
-	  (not (string-match "^bogofilter version 0\\.\\([0-9]\\|1[01]\\)\\."
-			     (shell-command-to-string
-			      (format "%s -V" spam-bogofilter-program))))))
+          (not (string-match "^bogofilter version 0\\.\\([0-9]\\|1[01]\\)\\."
+                             (shell-command-to-string
+                              (format "%s -V" spam-bogofilter-program))))))
   spam-bogofilter-valid)
 
 (defun spam-check-bogofilter (&optional score)
   "Check the Bogofilter backend for the classification of this message."
   (if (spam-verify-bogofilter)
       (let ((article-buffer-name (buffer-name))
-	    (db spam-bogofilter-database-directory)
-	    return)
-	(with-temp-buffer
-	  (let ((temp-buffer-name (buffer-name)))
-	    (with-current-buffer article-buffer-name
-	      (apply 'call-process-region
-		     (point-min) (point-max)
-		     spam-bogofilter-program
-		     nil temp-buffer-name nil
-		     (if db `("-d" ,db "-v") `("-v"))))
-	    (setq return (spam-check-bogofilter-headers score))))
-	return)
+            (db spam-bogofilter-database-directory)
+            return)
+        (with-temp-buffer
+          (let ((temp-buffer-name (buffer-name)))
+            (with-current-buffer article-buffer-name
+              (apply 'call-process-region
+                     (point-min) (point-max)
+                     spam-bogofilter-program
+                     nil temp-buffer-name nil
+                     (if db `("-d" ,db "-v") `("-v"))))
+            (setq return (spam-check-bogofilter-headers score))))
+        return)
     (gnus-error 5 "`spam.el' doesn't support obsolete bogofilter versions")))
 
 (defun spam-bogofilter-register-with-bogofilter (articles
-						 spam
-						 &optional unregister)
+                                                 spam
+                                                 &optional unregister)
   "Register an article, given as a string, as spam or non-spam."
   (if (spam-verify-bogofilter)
       (dolist (article articles)
-	(let ((article-string (spam-get-article-as-string article))
-	      (db spam-bogofilter-database-directory)
-	      (switch (if unregister
-			  (if spam
-			      spam-bogofilter-spam-strong-switch
-			    spam-bogofilter-ham-strong-switch)
-			(if spam
-			    spam-bogofilter-spam-switch
-			  spam-bogofilter-ham-switch))))
-	  (when (stringp article-string)
-	    (with-temp-buffer
-	      (insert article-string)
-
-	      (apply 'call-process-region
-		     (point-min) (point-max)
-		     spam-bogofilter-program
-		     nil nil nil switch
-		     (if db `("-d" ,db "-v") `("-v")))))))
+        (let ((article-string (spam-get-article-as-string article))
+              (db spam-bogofilter-database-directory)
+              (switch (if unregister
+                          (if spam
+                              spam-bogofilter-spam-strong-switch
+                            spam-bogofilter-ham-strong-switch)
+                        (if spam
+                            spam-bogofilter-spam-switch
+                          spam-bogofilter-ham-switch))))
+          (when (stringp article-string)
+            (with-temp-buffer
+              (insert article-string)
+
+              (apply 'call-process-region
+                     (point-min) (point-max)
+                     spam-bogofilter-program
+                     nil nil nil switch
+                     (if db `("-d" ,db "-v") `("-v")))))))
     (gnus-error 5 "`spam.el' doesn't support obsolete bogofilter versions")))
 
 (defun spam-bogofilter-register-spam-routine (articles &optional unregister)
@@ -2577,45 +2613,45 @@
   (let ((article-buffer-name (buffer-name)))
     (with-temp-buffer
       (let ((temp-buffer-name (buffer-name)))
-	(with-current-buffer article-buffer-name
-	  (let ((status
-		 (apply 'call-process-region
-			(point-min) (point-max)
-			spam-spamoracle-binary
-			nil temp-buffer-name nil
-			(if spam-spamoracle-database
-			    `("-f" ,spam-spamoracle-database "mark")
-			  '("mark")))))
-	    (if (eq 0 status)
-		(progn
-		  (set-buffer temp-buffer-name)
-		  (goto-char (point-min))
-		  (when (re-search-forward "^X-Spam: yes;" nil t)
-		    spam-split-group))
-	      (error "Error running spamoracle: %s" status))))))))
+        (with-current-buffer article-buffer-name
+          (let ((status
+                 (apply 'call-process-region
+                        (point-min) (point-max)
+                        spam-spamoracle-binary
+                        nil temp-buffer-name nil
+                        (if spam-spamoracle-database
+                            `("-f" ,spam-spamoracle-database "mark")
+                          '("mark")))))
+            (if (eq 0 status)
+                (progn
+                  (set-buffer temp-buffer-name)
+                  (goto-char (point-min))
+                  (when (re-search-forward "^X-Spam: yes;" nil t)
+                    spam-split-group))
+              (error "Error running spamoracle: %s" status))))))))
 
 (defun spam-spamoracle-learn (articles article-is-spam-p &optional unregister)
   "Run spamoracle in training mode."
   (with-temp-buffer
     (let ((temp-buffer-name (buffer-name)))
       (save-excursion
-	(goto-char (point-min))
-	(dolist (article articles)
-	  (insert (spam-get-article-as-string article)))
-	(let* ((arg (if (spam-xor unregister article-is-spam-p)
-			"-spam"
-		      "-good"))
-	       (status
-		(apply 'call-process-region
-		       (point-min) (point-max)
-		       spam-spamoracle-binary
-		       nil temp-buffer-name nil
-		       (if spam-spamoracle-database
-			   `("-f" ,spam-spamoracle-database
-			     "add" ,arg)
-			 `("add" ,arg)))))
-	  (unless (eq 0 status)
-	    (error "Error running spamoracle: %s" status)))))))
+        (goto-char (point-min))
+        (dolist (article articles)
+          (insert (spam-get-article-as-string article)))
+        (let* ((arg (if (spam-xor unregister article-is-spam-p)
+                        "-spam"
+                      "-good"))
+               (status
+                (apply 'call-process-region
+                       (point-min) (point-max)
+                       spam-spamoracle-binary
+                       nil temp-buffer-name nil
+                       (if spam-spamoracle-database
+                           `("-f" ,spam-spamoracle-database
+                             "add" ,arg)
+                         `("add" ,arg)))))
+          (unless (eq 0 status)
+            (error "Error running spamoracle: %s" status)))))))
 
 (defun spam-spamoracle-learn-ham (articles &optional unregister)
   (spam-spamoracle-learn articles nil unregister))
@@ -2635,31 +2671,31 @@
 ;;; based mostly on the bogofilter code
 (defun spam-check-spamassassin-headers (&optional score)
   "Check the SpamAssassin headers for the classification of this message."
-  (if score				; scoring mode
+  (if score                             ; scoring mode
       (let ((header (message-fetch-field spam-spamassassin-spam-status-header)))
-	(when header
-	  (if (string-match spam-spamassassin-score-regexp header)
-	      (match-string 1 header)
-	    "0")))
+        (when header
+          (if (string-match spam-spamassassin-score-regexp header)
+              (match-string 1 header)
+            "0")))
     ;; spam detection mode
     (let ((header (message-fetch-field spam-spamassassin-spam-flag-header)))
-	  (when header			; return nil when no header
-	    (when (string-match spam-spamassassin-positive-spam-flag-header
-				header)
-	      spam-split-group)))))
+          (when header                  ; return nil when no header
+            (when (string-match spam-spamassassin-positive-spam-flag-header
+                                header)
+              spam-split-group)))))
 
 (defun spam-check-spamassassin (&optional score)
   "Check the SpamAssassin backend for the classification of this message."
   (let ((article-buffer-name (buffer-name)))
     (with-temp-buffer
       (let ((temp-buffer-name (buffer-name)))
-	(with-current-buffer article-buffer-name
-	  (apply 'call-process-region
-		 (point-min) (point-max) spam-assassin-program
-		 nil temp-buffer-name nil spam-spamassassin-arguments))
-	;; check the return now (we're back in the temp buffer)
-	(goto-char (point-min))
-	(spam-check-spamassassin-headers score)))))
+        (with-current-buffer article-buffer-name
+          (apply 'call-process-region
+                 (point-min) (point-max) spam-assassin-program
+                 nil temp-buffer-name nil spam-spamassassin-arguments))
+        ;; check the return now (we're back in the temp buffer)
+        (goto-char (point-min))
+        (spam-check-spamassassin-headers score)))))
 
 ;; return something sensible if the score can't be determined
 (defun spam-spamassassin-score (&optional recheck)
@@ -2669,40 +2705,40 @@
     (gnus-summary-show-article t)
     (set-buffer gnus-article-buffer)
     (let ((score (or (unless recheck
-		       (spam-check-spamassassin-headers t))
-		     (spam-check-spamassassin t))))
+                       (spam-check-spamassassin-headers t))
+                     (spam-check-spamassassin t))))
       (gnus-summary-show-article)
       (message "SpamAssassin score %s" score)
       (or score "0"))))
 
 (defun spam-spamassassin-register-with-sa-learn (articles spam
-						 &optional unregister)
+                                                 &optional unregister)
   "Register articles with spamassassin's sa-learn as spam or non-spam."
   (if articles
       (let ((action (if unregister spam-sa-learn-unregister-switch
-		      (if spam spam-sa-learn-spam-switch
-			spam-sa-learn-ham-switch)))
-	    (summary-buffer-name (buffer-name)))
-	(with-temp-buffer
-	  ;; group the articles into mbox format
-	  (dolist (article articles)
-	    (let (article-string)
-	      (with-current-buffer summary-buffer-name
-		(setq article-string (spam-get-article-as-string article)))
-	      (when (stringp article-string)
-		(insert "From \n") ; mbox separator (sa-learn only checks the
-				   ; first five chars, so we can get away with
-				   ; a bogus line))
-		(insert article-string)
-		(insert "\n"))))
-	  ;; call sa-learn on all messages at the same time
-	  (apply 'call-process-region
-		 (point-min) (point-max)
-		 spam-sa-learn-program
-		 nil nil nil "--mbox"
-		 (if spam-sa-learn-rebuild
-		     (list action)
-		   `("--no-rebuild" ,action)))))))
+                      (if spam spam-sa-learn-spam-switch
+                        spam-sa-learn-ham-switch)))
+            (summary-buffer-name (buffer-name)))
+        (with-temp-buffer
+          ;; group the articles into mbox format
+          (dolist (article articles)
+            (let (article-string)
+              (with-current-buffer summary-buffer-name
+                (setq article-string (spam-get-article-as-string article)))
+              (when (stringp article-string)
+                (insert "From \n") ; mbox separator (sa-learn only checks the
+                                   ; first five chars, so we can get away with
+                                   ; a bogus line))
+                (insert article-string)
+                (insert "\n"))))
+          ;; call sa-learn on all messages at the same time
+          (apply 'call-process-region
+                 (point-min) (point-max)
+                 spam-sa-learn-program
+                 nil nil nil "--mbox"
+                 (if spam-sa-learn-rebuild
+                     (list action)
+                   `("--no-rebuild" ,action)))))))
 
 (defun spam-spamassassin-register-spam-routine (articles &optional unregister)
   (spam-spamassassin-register-with-sa-learn articles t unregister))
@@ -2723,11 +2759,11 @@
 (defun spam-check-bsfilter-headers (&optional score)
   (if score
       (or (nnmail-fetch-field spam-bsfilter-probability-header)
-	  "0")
+          "0")
     (let ((header (nnmail-fetch-field spam-bsfilter-header)))
       (when header ; return nil when no header
-	(when (string-match "YES" header)
-	  spam-split-group)))))
+        (when (string-match "YES" header)
+          spam-split-group)))))
 
 ;; return something sensible if the score can't be determined
 (defun spam-bsfilter-score (&optional recheck)
@@ -2737,8 +2773,8 @@
     (gnus-summary-show-article t)
     (set-buffer gnus-article-buffer)
     (let ((score (or (unless recheck
-		       (spam-check-bsfilter-headers t))
-		     (spam-check-bsfilter t))))
+                       (spam-check-bsfilter-headers t))
+                     (spam-check-bsfilter t))))
       (gnus-summary-show-article)
       (message "Spamicity score %s" score)
       (or score "0"))))
@@ -2746,47 +2782,47 @@
 (defun spam-check-bsfilter (&optional score)
   "Check the Bsfilter backend for the classification of this message."
   (let ((article-buffer-name (buffer-name))
-	(dir spam-bsfilter-database-directory)
-	return)
+        (dir spam-bsfilter-database-directory)
+        return)
     (with-temp-buffer
       (let ((temp-buffer-name (buffer-name)))
-	(with-current-buffer article-buffer-name
-	  (apply 'call-process-region
-		 (point-min) (point-max)
-		 spam-bsfilter-program
-		 nil temp-buffer-name nil
-		 "--pipe"
-		 "--insert-flag"
-		 "--insert-probability"
-		 (when dir
-		   (list "--homedir" dir))))
-	(setq return (spam-check-bsfilter-headers score))))
+        (with-current-buffer article-buffer-name
+          (apply 'call-process-region
+                 (point-min) (point-max)
+                 spam-bsfilter-program
+                 nil temp-buffer-name nil
+                 "--pipe"
+                 "--insert-flag"
+                 "--insert-probability"
+                 (when dir
+                   (list "--homedir" dir))))
+        (setq return (spam-check-bsfilter-headers score))))
     return))
 
 (defun spam-bsfilter-register-with-bsfilter (articles
-					     spam
-					     &optional unregister)
+                                             spam
+                                             &optional unregister)
   "Register an article, given as a string, as spam or non-spam."
   (dolist (article articles)
     (let ((article-string (spam-get-article-as-string article))
-	  (switch (if unregister
-		      (if spam
-			  spam-bsfilter-spam-strong-switch
-			spam-bsfilter-ham-strong-switch)
-		    (if spam
-			spam-bsfilter-spam-switch
-		      spam-bsfilter-ham-switch))))
+          (switch (if unregister
+                      (if spam
+                          spam-bsfilter-spam-strong-switch
+                        spam-bsfilter-ham-strong-switch)
+                    (if spam
+                        spam-bsfilter-spam-switch
+                      spam-bsfilter-ham-switch))))
       (when (stringp article-string)
-	(with-temp-buffer
-	  (insert article-string)
-	  (apply 'call-process-region
-		 (point-min) (point-max)
-		 spam-bsfilter-program
-		 nil nil nil switch
-		 "--update"
-		 (when spam-bsfilter-database-directory
-		   (list "--homedir"
-			 spam-bsfilter-database-directory))))))))
+        (with-temp-buffer
+          (insert article-string)
+          (apply 'call-process-region
+                 (point-min) (point-max)
+                 spam-bsfilter-program
+                 nil nil nil switch
+                 "--update"
+                 (when spam-bsfilter-database-directory
+                   (list "--homedir"
+                         spam-bsfilter-database-directory))))))))
 
 (defun spam-bsfilter-register-spam-routine (articles &optional unregister)
   (spam-bsfilter-register-with-bsfilter articles t unregister))
@@ -2805,15 +2841,15 @@
 ;;{{{ CRM114 Mailfilter
 (defun spam-check-crm114-headers (&optional score)
   (let ((header (message-fetch-field spam-crm114-header)))
-    (when header			; return nil when no header
-      (if score				; scoring mode
-	  (if (string-match "( pR: \\([0-9.-]+\\)" header)
-	      (match-string 1 header)
-	    "0")
-	;; spam detection mode
-	(when (string-match spam-crm114-positive-spam-header
-			    header)
-	  spam-split-group)))))
+    (when header                        ; return nil when no header
+      (if score                         ; scoring mode
+          (if (string-match "( pR: \\([0-9.-]+\\)" header)
+              (match-string 1 header)
+            "0")
+        ;; spam detection mode
+        (when (string-match spam-crm114-positive-spam-header
+                            header)
+          spam-split-group)))))
 
 ;; return something sensible if the score can't be determined
 (defun spam-crm114-score ()
@@ -2823,7 +2859,7 @@
     (gnus-summary-show-article t)
     (set-buffer gnus-article-buffer)
     (let ((score (or (spam-check-crm114-headers t)
-		     (spam-check-crm114 t))))
+                     (spam-check-crm114 t))))
       (gnus-summary-show-article)
       (message "pR: %s" score)
       (or score "0"))))
@@ -2831,41 +2867,41 @@
 (defun spam-check-crm114 (&optional score)
   "Check the CRM114 Mailfilter backend for the classification of this message."
   (let ((article-buffer-name (buffer-name))
-	(db spam-crm114-database-directory)
-	return)
+        (db spam-crm114-database-directory)
+        return)
     (with-temp-buffer
       (let ((temp-buffer-name (buffer-name)))
-	(with-current-buffer article-buffer-name
-	  (apply 'call-process-region
-		 (point-min) (point-max)
-		 spam-crm114-program
-		 nil temp-buffer-name nil
+        (with-current-buffer article-buffer-name
+          (apply 'call-process-region
+                 (point-min) (point-max)
+                 spam-crm114-program
+                 nil temp-buffer-name nil
                  (when db (list (concat "--fileprefix=" db)))))
-	(setq return (spam-check-crm114-headers score))))
+        (setq return (spam-check-crm114-headers score))))
     return))
 
 (defun spam-crm114-register-with-crm114 (articles
-					 spam
-					 &optional unregister)
+                                         spam
+                                         &optional unregister)
   "Register an article, given as a string, as spam or non-spam."
   (dolist (article articles)
     (let ((article-string (spam-get-article-as-string article))
-	  (db spam-crm114-database-directory)
-	  (switch (if unregister
-		      (if spam
-			  spam-crm114-spam-strong-switch
-			spam-crm114-ham-strong-switch)
-		    (if spam
-			spam-crm114-spam-switch
-		      spam-crm114-ham-switch))))
+          (db spam-crm114-database-directory)
+          (switch (if unregister
+                      (if spam
+                          spam-crm114-spam-strong-switch
+                        spam-crm114-ham-strong-switch)
+                    (if spam
+                        spam-crm114-spam-switch
+                      spam-crm114-ham-switch))))
       (when (stringp article-string)
-	(with-temp-buffer
-	  (insert article-string)
-
-	  (apply 'call-process-region
-		 (point-min) (point-max)
-		 spam-crm114-program
-		 nil nil nil
+        (with-temp-buffer
+          (insert article-string)
+
+          (apply 'call-process-region
+                 (point-min) (point-max)
+                 spam-crm114-program
+                 nil nil nil
                  (when db (list switch (concat "--fileprefix=" db)))))))))
 
 (defun spam-crm114-register-spam-routine (articles &optional unregister)
@@ -2905,7 +2941,7 @@
   (setq spam-install-hooks t)
   ;; TODO: How do we redo this every time the `spam' face is customized?
   (push '((eq mark gnus-spam-mark) . spam)
-	gnus-summary-highlight)
+        gnus-summary-highlight)
   ;; Add hooks for loading and saving the spam stats
   (add-hook 'gnus-save-newsrc-hook 'spam-maybe-spam-stat-save)
   (add-hook 'gnus-get-top-new-news-hook 'spam-maybe-spam-stat-load)
--- a/lisp/ibuf-ext.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/ibuf-ext.el	Thu Dec 16 18:30:57 2010 -0500
@@ -1308,7 +1308,8 @@
 	  (error "No buffer with name %s" name)
 	(goto-char buf-point)))))
 
-(declare-function diff-sentinel "diff" (code))
+(declare-function diff-sentinel "diff"
+		  (code &optional old-temp-file new-temp-file))
 
 (defun ibuffer-diff-buffer-with-file-1 (buffer)
   (let ((bufferfile (buffer-local-value 'buffer-file-name buffer))
@@ -1594,5 +1595,4 @@
 ;; generated-autoload-file: "ibuffer.el"
 ;; End:
 
-;; arch-tag: 9af21953-deda-4c30-b76d-f81d9128e76d
 ;;; ibuf-ext.el ends here
--- a/lisp/ibuffer.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/ibuffer.el	Thu Dec 16 18:30:57 2010 -0500
@@ -2639,7 +2639,7 @@
 ;;;;;;  ibuffer-backward-filter-group ibuffer-forward-filter-group
 ;;;;;;  ibuffer-toggle-filter-group ibuffer-mouse-toggle-filter-group
 ;;;;;;  ibuffer-interactive-filter-by-mode ibuffer-mouse-filter-by-mode
-;;;;;;  ibuffer-auto-mode) "ibuf-ext" "ibuf-ext.el" "fa9822b5ef905f06d8a03dc9ce3a2894")
+;;;;;;  ibuffer-auto-mode) "ibuf-ext" "ibuf-ext.el" "3840d79a044995c846fe8bbaa9565a2b")
 ;;; Generated autoloads from ibuf-ext.el
 
 (autoload 'ibuffer-auto-mode "ibuf-ext" "\
--- a/lisp/ido.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/ido.el	Thu Dec 16 18:30:57 2010 -0500
@@ -1467,6 +1467,11 @@
   ;; ido kill emacs hook
   (ido-save-history))
 
+(defun ido-common-initialization ()
+  (ido-init-completion-maps)
+  (add-hook 'minibuffer-setup-hook 'ido-minibuffer-setup)
+  (add-hook 'choose-completion-string-functions 'ido-choose-completion-string))
+
 (define-minor-mode ido-everywhere
   "Toggle using ido speed-ups everywhere file and directory names are read.
 With ARG, turn ido speed-up on if arg is positive, off otherwise."
@@ -1510,12 +1515,9 @@
 	 (t nil)))
 
   (ido-everywhere (if ido-everywhere 1 -1))
-  (when ido-mode
-    (ido-init-completion-maps))
 
   (when ido-mode
-    (add-hook 'minibuffer-setup-hook 'ido-minibuffer-setup)
-    (add-hook 'choose-completion-string-functions 'ido-choose-completion-string)
+    (ido-common-initialization)
     (ido-load-history)
 
     (add-hook 'kill-emacs-hook 'ido-kill-emacs-hook)
@@ -4759,6 +4761,8 @@
 	(ido-directory-too-big nil)
 	(ido-context-switch-command 'ignore)
 	(ido-choice-list choices))
+    ;; Initialize ido before invoking ido-read-internal
+    (ido-common-initialization)
     (ido-read-internal 'list prompt hist def require-match initial-input)))
 
 (defun ido-unload-function ()
--- a/lisp/image-dired.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/image-dired.el	Thu Dec 16 18:30:57 2010 -0500
@@ -187,19 +187,19 @@
   :group 'image-dired)
 
 (defcustom image-dired-db-file
-  (locate-user-emacs-file "image-dired/.image-dired_db")
+  (expand-file-name ".image-dired_db" image-dired-dir)
   "Database file where file names and their associated tags are stored."
   :type 'string
   :group 'image-dired)
 
 (defcustom image-dired-temp-image-file
-  (locate-user-emacs-file "image-dired/.image-dired_temp")
+  (expand-file-name ".image-dired_temp" image-dired-dir)
   "Name of temporary image file used by various commands."
   :type 'string
   :group 'image-dired)
 
 (defcustom image-dired-gallery-dir
-  (locate-user-emacs-file "image-dired/.image-dired_gallery")
+  (expand-file-name ".image-dired_gallery" image-dired-dir)
   "Directory to store generated gallery html pages.
 This path needs to be \"shared\" to the public so that it can access
 the index.html page that image-dired creates."
@@ -344,7 +344,7 @@
   :group 'image-dired)
 
 (defcustom image-dired-temp-rotate-image-file
-  (locate-user-emacs-file "image-dired/.image-dired_rotate_temp")
+  (expand-file-name ".image-dired_rotate_temp" image-dired-dir)
   "Temporary file for rotate operations."
   :type 'string
   :group 'image-dired)
--- a/lisp/international/characters.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/international/characters.el	Thu Dec 16 18:30:57 2010 -0500
@@ -1305,7 +1305,12 @@
 	  (error "Invalid glyphless character display method: %s" method))
       (cond ((eq target 'c0-control)
 	     (set-char-table-range glyphless-char-display '(#x00 . #x1F)
-				   method))
+				   method)
+	     ;; Users will not expect their newlines and TABs be
+	     ;; displayed as anything but themselves, so exempt those
+	     ;; two characters from c0-control.
+	     (set-char-table-range glyphless-char-display #x9 nil)
+	     (set-char-table-range glyphless-char-display #xa nil))
 	    ((eq target 'c1-control)
 	     (set-char-table-range glyphless-char-display '(#x80 . #x9F)
 				   method))
@@ -1344,7 +1349,7 @@
 group.
 
 GROUP must be one of these symbols:
-  `c0-control':     U+0000..U+001F.
+  `c0-control':     U+0000..U+001F, but excluding newline and TAB.
   `c1-control':     U+0080..U+009F.
   `format-control': Characters of Unicode General Category `Cf',
                     such as U+200C (ZWNJ), U+200E (LRM), but
--- a/lisp/jka-cmpr-hook.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/jka-cmpr-hook.el	Thu Dec 16 18:30:57 2010 -0500
@@ -73,10 +73,18 @@
 
 (defun jka-compr-build-file-regexp ()
   (purecopy
-  (mapconcat
-   'jka-compr-info-regexp
-   jka-compr-compression-info-list
-   "\\|")))
+   (let ((re-anchored '())
+         (re-free '()))
+     (dolist (e jka-compr-compression-info-list)
+       (let ((re (jka-compr-info-regexp e)))
+         (if (string-match "\\\\'\\'" re)
+             (push (substring re 0 (match-beginning 0)) re-anchored)
+           (push re re-free))))
+     (concat
+      (if re-free (concat (mapconcat 'identity re-free "\\|") "\\|"))
+      "\\(?:"
+      (mapconcat 'identity re-anchored "\\|")
+      "\\)" file-name-version-regexp "?\\'"))))
 
 ;; Functions for accessing the return value of jka-compr-get-compression-info
 (defun jka-compr-info-regexp               (info)  (aref info 0))
@@ -97,11 +105,9 @@
 based on the filename itself and `jka-compr-compression-info-list'."
   (catch 'compression-info
     (let ((case-fold-search nil))
-      (mapc
-       (function (lambda (x)
-		   (and (string-match (jka-compr-info-regexp x) filename)
-			(throw 'compression-info x))))
-       jka-compr-compression-info-list)
+      (dolist (x jka-compr-compression-info-list)
+        (and (string-match (jka-compr-info-regexp x) filename)
+             (throw 'compression-info x)))
       nil)))
 
 (defun jka-compr-install ()
@@ -198,7 +204,7 @@
   ;; uncomp-message uncomp-prog uncomp-args
   ;; can-append strip-extension-flag file-magic-bytes]
   (mapcar 'purecopy
-  '(["\\.Z\\(~\\|\\.~[0-9]+~\\)?\\'"
+  '(["\\.Z\\'"
      "compressing"    "compress"     ("-c")
      ;; gzip is more common than uncompress. It can only read, not write.
      "uncompressing"  "gzip"   ("-c" "-q" "-d")
@@ -206,7 +212,7 @@
      ;; Formerly, these had an additional arg "-c", but that fails with
      ;; "Version 0.1pl2, 29-Aug-97." (RedHat 5.1 GNU/Linux) and
      ;; "Version 0.9.0b, 9-Sept-98".
-    ["\\.bz2\\(~\\|\\.~[0-9]+~\\)?\\'"
+    ["\\.bz2\\'"
      "bzip2ing"        "bzip2"         nil
      "bunzip2ing"      "bzip2"         ("-d")
      nil t "BZh"]
@@ -214,15 +220,15 @@
      "bzip2ing"        "bzip2"         nil
      "bunzip2ing"      "bzip2"         ("-d")
      nil nil "BZh"]
-    ["\\.\\(?:tgz\\|svgz\\|sifz\\)\\(~\\|\\.~[0-9]+~\\)?\\'"
+    ["\\.\\(?:tgz\\|svgz\\|sifz\\)\\'"
      "compressing"        "gzip"         ("-c" "-q")
      "uncompressing"      "gzip"         ("-c" "-q" "-d")
      t nil "\037\213"]
-    ["\\.g?z\\(~\\|\\.~[0-9]+~\\)?\\'"
+    ["\\.g?z\\'"
      "compressing"        "gzip"         ("-c" "-q")
      "uncompressing"      "gzip"         ("-c" "-q" "-d")
      t t "\037\213"]
-    ["\\.xz\\(~\\|\\.~[0-9]+~\\)?\\'"
+    ["\\.xz\\'"
      "XZ compressing"     "xz"           ("-c" "-q")
      "XZ uncompressing"   "xz"           ("-c" "-q" "-d")
      t t "\3757zXZ\0"]
--- a/lisp/ldefs-boot.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/ldefs-boot.el	Thu Dec 16 18:30:57 2010 -0500
@@ -1,10 +1,11 @@
 ;;; loaddefs.el --- automatically extracted autoloads
 ;;
 ;;; Code:
+
 
 ;;;### (autoloads (5x5-crack 5x5-crack-xor-mutate 5x5-crack-mutating-best
 ;;;;;;  5x5-crack-mutating-current 5x5-crack-randomly 5x5) "5x5"
-;;;;;;  "play/5x5.el" (19634 57717))
+;;;;;;  "play/5x5.el" (19634 23255))
 ;;; Generated autoloads from play/5x5.el
 
 (autoload '5x5 "5x5" "\
@@ -64,7 +65,7 @@
 ;;;***
 
 ;;;### (autoloads (list-one-abbrev-table) "abbrevlist" "abbrevlist.el"
-;;;;;;  (19578 56905))
+;;;;;;  (19580 19536))
 ;;; Generated autoloads from abbrevlist.el
 
 (autoload 'list-one-abbrev-table "abbrevlist" "\
@@ -75,7 +76,7 @@
 ;;;***
 
 ;;;### (autoloads (ada-mode ada-add-extensions) "ada-mode" "progmodes/ada-mode.el"
-;;;;;;  (19675 9114))
+;;;;;;  (19672 56753))
 ;;; Generated autoloads from progmodes/ada-mode.el
 
 (autoload 'ada-add-extensions "ada-mode" "\
@@ -96,7 +97,7 @@
 ;;;***
 
 ;;;### (autoloads (ada-header) "ada-stmt" "progmodes/ada-stmt.el"
-;;;;;;  (19578 56905))
+;;;;;;  (19580 19536))
 ;;; Generated autoloads from progmodes/ada-stmt.el
 
 (autoload 'ada-header "ada-stmt" "\
@@ -107,7 +108,7 @@
 ;;;***
 
 ;;;### (autoloads (ada-find-file) "ada-xref" "progmodes/ada-xref.el"
-;;;;;;  (19675 9114))
+;;;;;;  (19672 41738))
 ;;; Generated autoloads from progmodes/ada-xref.el
 
 (autoload 'ada-find-file "ada-xref" "\
@@ -122,7 +123,7 @@
 ;;;;;;  add-change-log-entry-other-window add-change-log-entry find-change-log
 ;;;;;;  prompt-for-change-log-name add-log-mailing-address add-log-full-name
 ;;;;;;  add-log-current-defun-function) "add-log" "vc/add-log.el"
-;;;;;;  (19661 45226))
+;;;;;;  (19661 46305))
 ;;; Generated autoloads from vc/add-log.el
 
 (put 'change-log-default-name 'safe-local-variable 'string-or-null-p)
@@ -261,7 +262,7 @@
 
 ;;;### (autoloads (defadvice ad-activate ad-add-advice ad-disable-advice
 ;;;;;;  ad-enable-advice ad-default-compilation-action ad-redefinition-action)
-;;;;;;  "advice" "emacs-lisp/advice.el" (19578 56905))
+;;;;;;  "advice" "emacs-lisp/advice.el" (19580 19536))
 ;;; Generated autoloads from emacs-lisp/advice.el
 
 (defvar ad-redefinition-action 'warn "\
@@ -406,7 +407,7 @@
 
 ;;;### (autoloads (align-newline-and-indent align-unhighlight-rule
 ;;;;;;  align-highlight-rule align-current align-entire align-regexp
-;;;;;;  align) "align" "align.el" (19569 38342))
+;;;;;;  align) "align" "align.el" (19574 61126))
 ;;; Generated autoloads from align.el
 
 (autoload 'align "align" "\
@@ -496,7 +497,7 @@
 ;;;***
 
 ;;;### (autoloads (outlineify-sticky allout-mode) "allout" "allout.el"
-;;;;;;  (19682 26290))
+;;;;;;  (19696 28661))
 ;;; Generated autoloads from allout.el
 
 (put 'allout-use-hanging-indents 'safe-local-variable (if (fboundp 'booleanp) 'booleanp '(lambda (x) (member x '(t nil)))))
@@ -803,7 +804,7 @@
 ;;;***
 
 ;;;### (autoloads (ange-ftp-hook-function ange-ftp-reread-dir) "ange-ftp"
-;;;;;;  "net/ange-ftp.el" (19669 58161))
+;;;;;;  "net/ange-ftp.el" (19668 18649))
 ;;; Generated autoloads from net/ange-ftp.el
 
 (defalias 'ange-ftp-re-read-dir 'ange-ftp-reread-dir)
@@ -825,7 +826,7 @@
 ;;;***
 
 ;;;### (autoloads (animate-birthday-present animate-sequence animate-string)
-;;;;;;  "animate" "play/animate.el" (19379 23432))
+;;;;;;  "animate" "play/animate.el" (19277 34922))
 ;;; Generated autoloads from play/animate.el
 
 (autoload 'animate-string "animate" "\
@@ -853,7 +854,7 @@
 ;;;***
 
 ;;;### (autoloads (ansi-color-process-output ansi-color-for-comint-mode-on)
-;;;;;;  "ansi-color" "ansi-color.el" (19595 20656))
+;;;;;;  "ansi-color" "ansi-color.el" (19594 48841))
 ;;; Generated autoloads from ansi-color.el
 
 (autoload 'ansi-color-for-comint-mode-on "ansi-color" "\
@@ -879,7 +880,7 @@
 ;;;***
 
 ;;;### (autoloads (antlr-set-tabs antlr-mode antlr-show-makefile-rules)
-;;;;;;  "antlr-mode" "progmodes/antlr-mode.el" (19599 32188))
+;;;;;;  "antlr-mode" "progmodes/antlr-mode.el" (19599 45674))
 ;;; Generated autoloads from progmodes/antlr-mode.el
 
 (autoload 'antlr-show-makefile-rules "antlr-mode" "\
@@ -916,7 +917,7 @@
 ;;;***
 
 ;;;### (autoloads (appt-activate appt-add) "appt" "calendar/appt.el"
-;;;;;;  (19629 41197))
+;;;;;;  (19628 54816))
 ;;; Generated autoloads from calendar/appt.el
 
 (autoload 'appt-add "appt" "\
@@ -939,7 +940,7 @@
 
 ;;;### (autoloads (apropos-documentation apropos-value apropos-library
 ;;;;;;  apropos apropos-documentation-property apropos-command apropos-variable
-;;;;;;  apropos-read-pattern) "apropos" "apropos.el" (19578 56905))
+;;;;;;  apropos-read-pattern) "apropos" "apropos.el" (19580 19536))
 ;;; Generated autoloads from apropos.el
 
 (autoload 'apropos-read-pattern "apropos" "\
@@ -1042,8 +1043,8 @@
 
 ;;;***
 
-;;;### (autoloads (archive-mode) "arc-mode" "arc-mode.el" (19669
-;;;;;;  58161))
+;;;### (autoloads (archive-mode) "arc-mode" "arc-mode.el" (19668
+;;;;;;  19473))
 ;;; Generated autoloads from arc-mode.el
 
 (autoload 'archive-mode "arc-mode" "\
@@ -1063,7 +1064,7 @@
 
 ;;;***
 
-;;;### (autoloads (array-mode) "array" "array.el" (19675 9114))
+;;;### (autoloads (array-mode) "array" "array.el" (19672 56753))
 ;;; Generated autoloads from array.el
 
 (autoload 'array-mode "array" "\
@@ -1135,7 +1136,7 @@
 ;;;***
 
 ;;;### (autoloads (artist-mode) "artist" "textmodes/artist.el" (19623
-;;;;;;  61514))
+;;;;;;  59989))
 ;;; Generated autoloads from textmodes/artist.el
 
 (autoload 'artist-mode "artist" "\
@@ -1341,8 +1342,8 @@
 
 ;;;***
 
-;;;### (autoloads (asm-mode) "asm-mode" "progmodes/asm-mode.el" (19438
-;;;;;;  21798))
+;;;### (autoloads (asm-mode) "asm-mode" "progmodes/asm-mode.el" (19439
+;;;;;;  4022))
 ;;; Generated autoloads from progmodes/asm-mode.el
 
 (autoload 'asm-mode "asm-mode" "\
@@ -1370,7 +1371,7 @@
 ;;;***
 
 ;;;### (autoloads (autoarg-kp-mode autoarg-mode) "autoarg" "autoarg.el"
-;;;;;;  (19379 23432))
+;;;;;;  (19277 34915))
 ;;; Generated autoloads from autoarg.el
 
 (defvar autoarg-mode nil "\
@@ -1424,7 +1425,7 @@
 ;;;***
 
 ;;;### (autoloads (autoconf-mode) "autoconf" "progmodes/autoconf.el"
-;;;;;;  (19595 20656))
+;;;;;;  (19594 48841))
 ;;; Generated autoloads from progmodes/autoconf.el
 
 (autoload 'autoconf-mode "autoconf" "\
@@ -1435,7 +1436,7 @@
 ;;;***
 
 ;;;### (autoloads (auto-insert-mode define-auto-insert auto-insert)
-;;;;;;  "autoinsert" "autoinsert.el" (19502 54176))
+;;;;;;  "autoinsert" "autoinsert.el" (19508 78))
 ;;; Generated autoloads from autoinsert.el
 
 (autoload 'auto-insert "autoinsert" "\
@@ -1474,7 +1475,7 @@
 
 ;;;### (autoloads (batch-update-autoloads update-directory-autoloads
 ;;;;;;  update-file-autoloads) "autoload" "emacs-lisp/autoload.el"
-;;;;;;  (19686 22639))
+;;;;;;  (19687 6902))
 ;;; Generated autoloads from emacs-lisp/autoload.el
 
 (put 'generated-autoload-file 'safe-local-variable 'stringp)
@@ -1513,7 +1514,7 @@
 
 ;;;### (autoloads (global-auto-revert-mode turn-on-auto-revert-tail-mode
 ;;;;;;  auto-revert-tail-mode turn-on-auto-revert-mode auto-revert-mode)
-;;;;;;  "autorevert" "autorevert.el" (19379 23432))
+;;;;;;  "autorevert" "autorevert.el" (19277 34915))
 ;;; Generated autoloads from autorevert.el
 
 (autoload 'auto-revert-mode "autorevert" "\
@@ -1594,7 +1595,7 @@
 ;;;***
 
 ;;;### (autoloads (mouse-avoidance-mode mouse-avoidance-mode) "avoid"
-;;;;;;  "avoid.el" (19644 49850))
+;;;;;;  "avoid.el" (19645 60484))
 ;;; Generated autoloads from avoid.el
 
 (defvar mouse-avoidance-mode nil "\
@@ -1635,7 +1636,7 @@
 ;;;***
 
 ;;;### (autoloads (display-battery-mode battery) "battery" "battery.el"
-;;;;;;  (19379 23432))
+;;;;;;  (19277 34915))
 ;;; Generated autoloads from battery.el
  (put 'battery-mode-line-string 'risky-local-variable t)
 
@@ -1667,7 +1668,7 @@
 ;;;***
 
 ;;;### (autoloads (benchmark benchmark-run-compiled benchmark-run)
-;;;;;;  "benchmark" "emacs-lisp/benchmark.el" (19379 23432))
+;;;;;;  "benchmark" "emacs-lisp/benchmark.el" (19277 34919))
 ;;; Generated autoloads from emacs-lisp/benchmark.el
 
 (autoload 'benchmark-run "benchmark" "\
@@ -1700,7 +1701,7 @@
 ;;;***
 
 ;;;### (autoloads (bibtex-search-entry bibtex-mode bibtex-initialize)
-;;;;;;  "bibtex" "textmodes/bibtex.el" (19661 45226))
+;;;;;;  "bibtex" "textmodes/bibtex.el" (19661 46305))
 ;;; Generated autoloads from textmodes/bibtex.el
 
 (autoload 'bibtex-initialize "bibtex" "\
@@ -1787,7 +1788,7 @@
 ;;;***
 
 ;;;### (autoloads (bibtex-style-mode) "bibtex-style" "textmodes/bibtex-style.el"
-;;;;;;  (19612 6522))
+;;;;;;  (19611 36358))
 ;;; Generated autoloads from textmodes/bibtex-style.el
 
 (autoload 'bibtex-style-mode "bibtex-style" "\
@@ -1799,7 +1800,7 @@
 
 ;;;### (autoloads (binhex-decode-region binhex-decode-region-external
 ;;;;;;  binhex-decode-region-internal) "binhex" "mail/binhex.el"
-;;;;;;  (19583 31640))
+;;;;;;  (19582 65302))
 ;;; Generated autoloads from mail/binhex.el
 
 (defconst binhex-begin-line "^:...............................................................$")
@@ -1822,8 +1823,8 @@
 
 ;;;***
 
-;;;### (autoloads (blackbox) "blackbox" "play/blackbox.el" (19379
-;;;;;;  23432))
+;;;### (autoloads (blackbox) "blackbox" "play/blackbox.el" (19277
+;;;;;;  34922))
 ;;; Generated autoloads from play/blackbox.el
 
 (autoload 'blackbox "blackbox" "\
@@ -1946,7 +1947,7 @@
 ;;;;;;  bookmark-save bookmark-write bookmark-delete bookmark-insert
 ;;;;;;  bookmark-rename bookmark-insert-location bookmark-relocate
 ;;;;;;  bookmark-jump-other-window bookmark-jump bookmark-set) "bookmark"
-;;;;;;  "bookmark.el" (19669 58161))
+;;;;;;  "bookmark.el" (19668 18952))
 ;;; Generated autoloads from bookmark.el
  (define-key ctl-x-r-map "b" 'bookmark-jump)
  (define-key ctl-x-r-map "m" 'bookmark-set)
@@ -2153,10 +2154,10 @@
 ;;;;;;  browse-url browse-url-of-region browse-url-of-dired-file
 ;;;;;;  browse-url-of-buffer browse-url-of-file browse-url-url-at-point
 ;;;;;;  browse-url-browser-function) "browse-url" "net/browse-url.el"
-;;;;;;  (19675 9114))
+;;;;;;  (19696 28661))
 ;;; Generated autoloads from net/browse-url.el
 
-(defvar browse-url-browser-function `(("\\`mailto:" . browse-url-mail) ("." \, (cond ((memq system-type '(windows-nt ms-dos cygwin)) 'browse-url-default-windows-browser) ((memq system-type '(darwin)) 'browse-url-default-macosx-browser) (t 'browse-url-default-browser)))) "\
+(defvar browse-url-browser-function (cond ((memq system-type '(windows-nt ms-dos cygwin)) 'browse-url-default-windows-browser) ((memq system-type '(darwin)) 'browse-url-default-macosx-browser) (t 'browse-url-default-browser)) "\
 Function to display the current buffer in a WWW browser.
 This is used by the `browse-url-at-point', `browse-url-at-mouse', and
 `browse-url-of-file' commands.
@@ -2205,6 +2206,8 @@
 Ask a WWW browser to load URL.
 Prompts for a URL, defaulting to the URL at or before point.  Variable
 `browse-url-browser-function' says which browser to use.
+If the URL is a mailto: URL, consult `browse-url-mailto-function'
+first, if that exists.
 
 \(fn URL &rest ARGS)" t nil)
 
@@ -2478,8 +2481,8 @@
 
 ;;;***
 
-;;;### (autoloads (snarf-bruces bruce) "bruce" "play/bruce.el" (19379
-;;;;;;  23432))
+;;;### (autoloads (snarf-bruces bruce) "bruce" "play/bruce.el" (19277
+;;;;;;  34922))
 ;;; Generated autoloads from play/bruce.el
 
 (autoload 'bruce "bruce" "\
@@ -2495,7 +2498,7 @@
 ;;;***
 
 ;;;### (autoloads (bs-show bs-customize bs-cycle-previous bs-cycle-next)
-;;;;;;  "bs" "bs.el" (19520 54552))
+;;;;;;  "bs" "bs.el" (19515 27412))
 ;;; Generated autoloads from bs.el
 
 (autoload 'bs-cycle-next "bs" "\
@@ -2535,7 +2538,7 @@
 
 ;;;***
 
-;;;### (autoloads (bubbles) "bubbles" "play/bubbles.el" (19612 3157))
+;;;### (autoloads (bubbles) "bubbles" "play/bubbles.el" (19612 4032))
 ;;; Generated autoloads from play/bubbles.el
 
 (autoload 'bubbles "bubbles" "\
@@ -2557,7 +2560,7 @@
 ;;;***
 
 ;;;### (autoloads (bug-reference-prog-mode bug-reference-mode) "bug-reference"
-;;;;;;  "progmodes/bug-reference.el" (19416 29566))
+;;;;;;  "progmodes/bug-reference.el" (19418 12890))
 ;;; Generated autoloads from progmodes/bug-reference.el
 
 (put 'bug-reference-url-format 'safe-local-variable (lambda (s) (or (stringp s) (and (symbolp s) (get s 'bug-reference-url-format)))))
@@ -2578,7 +2581,7 @@
 ;;;;;;  batch-byte-compile-if-not-done display-call-tree byte-compile
 ;;;;;;  compile-defun byte-compile-file byte-recompile-directory
 ;;;;;;  byte-force-recompile byte-compile-enable-warning byte-compile-disable-warning)
-;;;;;;  "bytecomp" "emacs-lisp/bytecomp.el" (19686 22639))
+;;;;;;  "bytecomp" "emacs-lisp/bytecomp.el" (19687 6902))
 ;;; Generated autoloads from emacs-lisp/bytecomp.el
 (put 'byte-compile-dynamic 'safe-local-variable 'booleanp)
 (put 'byte-compile-disable-print-circle 'safe-local-variable 'booleanp)
@@ -2698,8 +2701,8 @@
 
 ;;;***
 
-;;;### (autoloads nil "cal-china" "calendar/cal-china.el" (19578
-;;;;;;  56905))
+;;;### (autoloads nil "cal-china" "calendar/cal-china.el" (19580
+;;;;;;  19536))
 ;;; Generated autoloads from calendar/cal-china.el
 
 (put 'calendar-chinese-time-zone 'risky-local-variable t)
@@ -2708,7 +2711,7 @@
 
 ;;;***
 
-;;;### (autoloads nil "cal-dst" "calendar/cal-dst.el" (19578 56905))
+;;;### (autoloads nil "cal-dst" "calendar/cal-dst.el" (19580 19536))
 ;;; Generated autoloads from calendar/cal-dst.el
 
 (put 'calendar-daylight-savings-starts 'risky-local-variable t)
@@ -2720,7 +2723,7 @@
 ;;;***
 
 ;;;### (autoloads (calendar-hebrew-list-yahrzeits) "cal-hebrew" "calendar/cal-hebrew.el"
-;;;;;;  (19632 22628))
+;;;;;;  (19631 54972))
 ;;; Generated autoloads from calendar/cal-hebrew.el
 
 (autoload 'calendar-hebrew-list-yahrzeits "cal-hebrew" "\
@@ -2736,8 +2739,8 @@
 
 ;;;### (autoloads (defmath calc-embedded-activate calc-embedded calc-grab-rectangle
 ;;;;;;  calc-grab-region full-calc-keypad calc-keypad calc-eval quick-calc
-;;;;;;  full-calc calc calc-dispatch) "calc" "calc/calc.el" (19550
-;;;;;;  35591))
+;;;;;;  full-calc calc calc-dispatch) "calc" "calc/calc.el" (19552
+;;;;;;  37739))
 ;;; Generated autoloads from calc/calc.el
  (define-key ctl-x-map "*" 'calc-dispatch)
 
@@ -2822,7 +2825,7 @@
 ;;;***
 
 ;;;### (autoloads (calculator) "calculator" "calculator.el" (19612
-;;;;;;  3157))
+;;;;;;  4032))
 ;;; Generated autoloads from calculator.el
 
 (autoload 'calculator "calculator" "\
@@ -2833,8 +2836,8 @@
 
 ;;;***
 
-;;;### (autoloads (calendar) "calendar" "calendar/calendar.el" (19686
-;;;;;;  22639))
+;;;### (autoloads (calendar) "calendar" "calendar/calendar.el" (19687
+;;;;;;  6902))
 ;;; Generated autoloads from calendar/calendar.el
 
 (autoload 'calendar "calendar" "\
@@ -2878,7 +2881,7 @@
 ;;;***
 
 ;;;### (autoloads (canlock-verify canlock-insert-header) "canlock"
-;;;;;;  "gnus/canlock.el" (19583 31640))
+;;;;;;  "gnus/canlock.el" (19582 65302))
 ;;; Generated autoloads from gnus/canlock.el
 
 (autoload 'canlock-insert-header "canlock" "\
@@ -2896,7 +2899,7 @@
 ;;;***
 
 ;;;### (autoloads (capitalized-words-mode) "cap-words" "progmodes/cap-words.el"
-;;;;;;  (19379 23432))
+;;;;;;  (19277 34922))
 ;;; Generated autoloads from progmodes/cap-words.el
 
 (autoload 'capitalized-words-mode "cap-words" "\
@@ -2931,15 +2934,15 @@
 
 ;;;***
 
-;;;### (autoloads nil "cc-compat" "progmodes/cc-compat.el" (19578
-;;;;;;  56905))
+;;;### (autoloads nil "cc-compat" "progmodes/cc-compat.el" (19580
+;;;;;;  19536))
 ;;; Generated autoloads from progmodes/cc-compat.el
 (put 'c-indent-level 'safe-local-variable 'integerp)
 
 ;;;***
 
 ;;;### (autoloads (c-guess-basic-syntax) "cc-engine" "progmodes/cc-engine.el"
-;;;;;;  (19632 54888))
+;;;;;;  (19632 52521))
 ;;; Generated autoloads from progmodes/cc-engine.el
 
 (autoload 'c-guess-basic-syntax "cc-engine" "\
@@ -2951,7 +2954,7 @@
 
 ;;;### (autoloads (pike-mode idl-mode java-mode objc-mode c++-mode
 ;;;;;;  c-mode c-initialize-cc-mode) "cc-mode" "progmodes/cc-mode.el"
-;;;;;;  (19646 65152))
+;;;;;;  (19646 27154))
 ;;; Generated autoloads from progmodes/cc-mode.el
 
 (autoload 'c-initialize-cc-mode "cc-mode" "\
@@ -3111,7 +3114,7 @@
 ;;;***
 
 ;;;### (autoloads (c-set-offset c-add-style c-set-style) "cc-styles"
-;;;;;;  "progmodes/cc-styles.el" (19623 58252))
+;;;;;;  "progmodes/cc-styles.el" (19623 58121))
 ;;; Generated autoloads from progmodes/cc-styles.el
 
 (autoload 'c-set-style "cc-styles" "\
@@ -3162,7 +3165,7 @@
 
 ;;;***
 
-;;;### (autoloads nil "cc-vars" "progmodes/cc-vars.el" (19578 56905))
+;;;### (autoloads nil "cc-vars" "progmodes/cc-vars.el" (19580 19536))
 ;;; Generated autoloads from progmodes/cc-vars.el
 (put 'c-basic-offset 'safe-local-variable 'integerp)
 (put 'c-backslash-column 'safe-local-variable 'integerp)
@@ -3172,7 +3175,7 @@
 
 ;;;### (autoloads (ccl-execute-with-args check-ccl-program define-ccl-program
 ;;;;;;  declare-ccl-program ccl-dump ccl-compile) "ccl" "international/ccl.el"
-;;;;;;  (19638 63299))
+;;;;;;  (19639 17158))
 ;;; Generated autoloads from international/ccl.el
 
 (autoload 'ccl-compile "ccl" "\
@@ -3433,7 +3436,7 @@
 ;;;***
 
 ;;;### (autoloads (cfengine-mode) "cfengine" "progmodes/cfengine.el"
-;;;;;;  (19595 20656))
+;;;;;;  (19594 48841))
 ;;; Generated autoloads from progmodes/cfengine.el
 
 (autoload 'cfengine-mode "cfengine" "\
@@ -3448,7 +3451,7 @@
 ;;;***
 
 ;;;### (autoloads (check-declare-directory check-declare-file) "check-declare"
-;;;;;;  "emacs-lisp/check-declare.el" (19379 23432))
+;;;;;;  "emacs-lisp/check-declare.el" (19277 34919))
 ;;; Generated autoloads from emacs-lisp/check-declare.el
 
 (autoload 'check-declare-file "check-declare" "\
@@ -3473,7 +3476,7 @@
 ;;;;;;  checkdoc-comments checkdoc-continue checkdoc-start checkdoc-current-buffer
 ;;;;;;  checkdoc-eval-current-buffer checkdoc-message-interactive
 ;;;;;;  checkdoc-interactive checkdoc checkdoc-list-of-strings-p)
-;;;;;;  "checkdoc" "emacs-lisp/checkdoc.el" (19682 26290))
+;;;;;;  "checkdoc" "emacs-lisp/checkdoc.el" (19687 6902))
 ;;; Generated autoloads from emacs-lisp/checkdoc.el
 (put 'checkdoc-force-docstrings-flag 'safe-local-variable 'booleanp)
 (put 'checkdoc-force-history-flag 'safe-local-variable 'booleanp)
@@ -3668,7 +3671,7 @@
 
 ;;;### (autoloads (pre-write-encode-hz post-read-decode-hz encode-hz-buffer
 ;;;;;;  encode-hz-region decode-hz-buffer decode-hz-region) "china-util"
-;;;;;;  "language/china-util.el" (19379 23432))
+;;;;;;  "language/china-util.el" (19277 34920))
 ;;; Generated autoloads from language/china-util.el
 
 (autoload 'decode-hz-region "china-util" "\
@@ -3706,7 +3709,7 @@
 ;;;***
 
 ;;;### (autoloads (command-history list-command-history repeat-matching-complex-command)
-;;;;;;  "chistory" "chistory.el" (19379 23432))
+;;;;;;  "chistory" "chistory.el" (19277 34915))
 ;;; Generated autoloads from chistory.el
 
 (autoload 'repeat-matching-complex-command "chistory" "\
@@ -3745,7 +3748,7 @@
 
 ;;;***
 
-;;;### (autoloads nil "cl" "emacs-lisp/cl.el" (19628 18012))
+;;;### (autoloads nil "cl" "emacs-lisp/cl.el" (19627 57387))
 ;;; Generated autoloads from emacs-lisp/cl.el
 
 (defvar custom-print-functions nil "\
@@ -3761,7 +3764,7 @@
 ;;;***
 
 ;;;### (autoloads (common-lisp-indent-function) "cl-indent" "emacs-lisp/cl-indent.el"
-;;;;;;  (19578 56905))
+;;;;;;  (19580 19536))
 ;;; Generated autoloads from emacs-lisp/cl-indent.el
 
 (autoload 'common-lisp-indent-function "cl-indent" "\
@@ -3840,7 +3843,7 @@
 ;;;***
 
 ;;;### (autoloads (c-macro-expand) "cmacexp" "progmodes/cmacexp.el"
-;;;;;;  (19379 23432))
+;;;;;;  (19277 34922))
 ;;; Generated autoloads from progmodes/cmacexp.el
 
 (autoload 'c-macro-expand "cmacexp" "\
@@ -3860,8 +3863,8 @@
 
 ;;;***
 
-;;;### (autoloads (run-scheme) "cmuscheme" "cmuscheme.el" (19379
-;;;;;;  23432))
+;;;### (autoloads (run-scheme) "cmuscheme" "cmuscheme.el" (19277
+;;;;;;  34915))
 ;;; Generated autoloads from cmuscheme.el
 
 (autoload 'run-scheme "cmuscheme" "\
@@ -3885,7 +3888,7 @@
 ;;;### (autoloads (comint-redirect-results-list-from-process comint-redirect-results-list
 ;;;;;;  comint-redirect-send-command-to-process comint-redirect-send-command
 ;;;;;;  comint-run make-comint make-comint-in-buffer) "comint" "comint.el"
-;;;;;;  (19686 22639))
+;;;;;;  (19687 6902))
 ;;; Generated autoloads from comint.el
 
 (defvar comint-output-filter-functions '(comint-postoutput-scroll-to-bottom comint-watch-for-password-prompt) "\
@@ -3980,7 +3983,7 @@
 ;;;***
 
 ;;;### (autoloads (compare-windows) "compare-w" "vc/compare-w.el"
-;;;;;;  (19478 26045))
+;;;;;;  (19478 62344))
 ;;; Generated autoloads from vc/compare-w.el
 
 (autoload 'compare-windows "compare-w" "\
@@ -4017,8 +4020,8 @@
 ;;;;;;  compilation-shell-minor-mode compilation-mode compilation-start
 ;;;;;;  compile compilation-disable-input compile-command compilation-search-path
 ;;;;;;  compilation-ask-about-save compilation-window-height compilation-start-hook
-;;;;;;  compilation-mode-hook) "compile" "progmodes/compile.el" (19657
-;;;;;;  35339))
+;;;;;;  compilation-mode-hook) "compile" "progmodes/compile.el" (19656
+;;;;;;  61992))
 ;;; Generated autoloads from progmodes/compile.el
 
 (defvar compilation-mode-hook nil "\
@@ -4194,7 +4197,7 @@
 ;;;***
 
 ;;;### (autoloads (dynamic-completion-mode) "completion" "completion.el"
-;;;;;;  (19379 23432))
+;;;;;;  (19277 34915))
 ;;; Generated autoloads from completion.el
 
 (defvar dynamic-completion-mode nil "\
@@ -4216,7 +4219,7 @@
 ;;;### (autoloads (conf-xdefaults-mode conf-ppd-mode conf-colon-mode
 ;;;;;;  conf-space-keywords conf-space-mode conf-javaprop-mode conf-windows-mode
 ;;;;;;  conf-unix-mode conf-mode) "conf-mode" "textmodes/conf-mode.el"
-;;;;;;  (19379 23432))
+;;;;;;  (19277 34923))
 ;;; Generated autoloads from textmodes/conf-mode.el
 
 (autoload 'conf-mode "conf-mode" "\
@@ -4372,7 +4375,7 @@
 ;;;***
 
 ;;;### (autoloads (shuffle-vector cookie-snarf cookie-insert cookie)
-;;;;;;  "cookie1" "play/cookie1.el" (19583 31640))
+;;;;;;  "cookie1" "play/cookie1.el" (19583 60940))
 ;;; Generated autoloads from play/cookie1.el
 
 (autoload 'cookie "cookie1" "\
@@ -4404,8 +4407,8 @@
 ;;;***
 
 ;;;### (autoloads (copyright-update-directory copyright copyright-fix-years
-;;;;;;  copyright-update) "copyright" "emacs-lisp/copyright.el" (19564
-;;;;;;  19367))
+;;;;;;  copyright-update) "copyright" "emacs-lisp/copyright.el" (19561
+;;;;;;  48711))
 ;;; Generated autoloads from emacs-lisp/copyright.el
 
 (autoload 'copyright-update "copyright" "\
@@ -4438,7 +4441,7 @@
 ;;;***
 
 ;;;### (autoloads (cperl-perldoc-at-point cperl-perldoc cperl-mode)
-;;;;;;  "cperl-mode" "progmodes/cperl-mode.el" (19675 9114))
+;;;;;;  "cperl-mode" "progmodes/cperl-mode.el" (19672 56753))
 ;;; Generated autoloads from progmodes/cperl-mode.el
 (put 'cperl-indent-level 'safe-local-variable 'integerp)
 (put 'cperl-brace-offset 'safe-local-variable 'integerp)
@@ -4637,7 +4640,7 @@
 ;;;***
 
 ;;;### (autoloads (cpp-parse-edit cpp-highlight-buffer) "cpp" "progmodes/cpp.el"
-;;;;;;  (19379 23432))
+;;;;;;  (19277 34922))
 ;;; Generated autoloads from progmodes/cpp.el
 
 (autoload 'cpp-highlight-buffer "cpp" "\
@@ -4656,7 +4659,7 @@
 ;;;***
 
 ;;;### (autoloads (crisp-mode crisp-mode) "crisp" "emulation/crisp.el"
-;;;;;;  (19611 13362))
+;;;;;;  (19609 2266))
 ;;; Generated autoloads from emulation/crisp.el
 
 (defvar crisp-mode nil "\
@@ -4680,7 +4683,7 @@
 ;;;***
 
 ;;;### (autoloads (completing-read-multiple) "crm" "emacs-lisp/crm.el"
-;;;;;;  (19379 23432))
+;;;;;;  (19277 34919))
 ;;; Generated autoloads from emacs-lisp/crm.el
 
 (autoload 'completing-read-multiple "crm" "\
@@ -4715,8 +4718,8 @@
 
 ;;;***
 
-;;;### (autoloads (css-mode) "css-mode" "textmodes/css-mode.el" (19612
-;;;;;;  6522))
+;;;### (autoloads (css-mode) "css-mode" "textmodes/css-mode.el" (19611
+;;;;;;  35698))
 ;;; Generated autoloads from textmodes/css-mode.el
 
 (autoload 'css-mode "css-mode" "\
@@ -4727,7 +4730,7 @@
 ;;;***
 
 ;;;### (autoloads (cua-selection-mode cua-mode) "cua-base" "emulation/cua-base.el"
-;;;;;;  (19649 27409))
+;;;;;;  (19648 63621))
 ;;; Generated autoloads from emulation/cua-base.el
 
 (defvar cua-mode nil "\
@@ -4786,7 +4789,7 @@
 ;;;;;;  customize-mode customize customize-save-variable customize-set-variable
 ;;;;;;  customize-set-value custom-menu-sort-alphabetically custom-buffer-sort-alphabetically
 ;;;;;;  custom-browse-sort-alphabetically) "cus-edit" "cus-edit.el"
-;;;;;;  (19642 16823))
+;;;;;;  (19645 60484))
 ;;; Generated autoloads from cus-edit.el
 
 (defvar custom-browse-sort-alphabetically nil "\
@@ -5089,7 +5092,7 @@
 ;;;***
 
 ;;;### (autoloads (customize-themes describe-theme customize-create-theme)
-;;;;;;  "cus-theme" "cus-theme.el" (19642 16823))
+;;;;;;  "cus-theme" "cus-theme.el" (19645 60484))
 ;;; Generated autoloads from cus-theme.el
 
 (autoload 'customize-create-theme "cus-theme" "\
@@ -5116,7 +5119,7 @@
 ;;;***
 
 ;;;### (autoloads (cvs-status-mode) "cvs-status" "vc/cvs-status.el"
-;;;;;;  (19474 38892))
+;;;;;;  (19474 36901))
 ;;; Generated autoloads from vc/cvs-status.el
 
 (autoload 'cvs-status-mode "cvs-status" "\
@@ -5127,7 +5130,7 @@
 ;;;***
 
 ;;;### (autoloads (global-cwarn-mode turn-on-cwarn-mode cwarn-mode)
-;;;;;;  "cwarn" "progmodes/cwarn.el" (19578 56905))
+;;;;;;  "cwarn" "progmodes/cwarn.el" (19580 19536))
 ;;; Generated autoloads from progmodes/cwarn.el
 
 (autoload 'cwarn-mode "cwarn" "\
@@ -5174,7 +5177,7 @@
 
 ;;;### (autoloads (standard-display-cyrillic-translit cyrillic-encode-alternativnyj-char
 ;;;;;;  cyrillic-encode-koi8-r-char) "cyril-util" "language/cyril-util.el"
-;;;;;;  (19379 23432))
+;;;;;;  (19277 34920))
 ;;; Generated autoloads from language/cyril-util.el
 
 (autoload 'cyrillic-encode-koi8-r-char "cyril-util" "\
@@ -5203,7 +5206,7 @@
 ;;;***
 
 ;;;### (autoloads (dabbrev-expand dabbrev-completion) "dabbrev" "dabbrev.el"
-;;;;;;  (19551 10990))
+;;;;;;  (19552 37739))
 ;;; Generated autoloads from dabbrev.el
 (put 'dabbrev-case-fold-search 'risky-local-variable t)
 (put 'dabbrev-case-replace 'risky-local-variable t)
@@ -5250,7 +5253,7 @@
 ;;;***
 
 ;;;### (autoloads (data-debug-new-buffer) "data-debug" "cedet/data-debug.el"
-;;;;;;  (19578 56905))
+;;;;;;  (19580 19536))
 ;;; Generated autoloads from cedet/data-debug.el
 
 (autoload 'data-debug-new-buffer "data-debug" "\
@@ -5260,8 +5263,8 @@
 
 ;;;***
 
-;;;### (autoloads (dbus-handle-event) "dbus" "net/dbus.el" (19665
-;;;;;;  17270))
+;;;### (autoloads (dbus-handle-event) "dbus" "net/dbus.el" (19664
+;;;;;;  56235))
 ;;; Generated autoloads from net/dbus.el
 
 (autoload 'dbus-handle-event "dbus" "\
@@ -5274,8 +5277,8 @@
 
 ;;;***
 
-;;;### (autoloads (dcl-mode) "dcl-mode" "progmodes/dcl-mode.el" (19669
-;;;;;;  58161))
+;;;### (autoloads (dcl-mode) "dcl-mode" "progmodes/dcl-mode.el" (19668
+;;;;;;  19168))
 ;;; Generated autoloads from progmodes/dcl-mode.el
 
 (autoload 'dcl-mode "dcl-mode" "\
@@ -5402,7 +5405,7 @@
 ;;;***
 
 ;;;### (autoloads (cancel-debug-on-entry debug-on-entry debug) "debug"
-;;;;;;  "emacs-lisp/debug.el" (19580 5054))
+;;;;;;  "emacs-lisp/debug.el" (19580 19536))
 ;;; Generated autoloads from emacs-lisp/debug.el
 
 (setq debugger 'debug)
@@ -5446,7 +5449,7 @@
 ;;;***
 
 ;;;### (autoloads (decipher-mode decipher) "decipher" "play/decipher.el"
-;;;;;;  (19671 21337))
+;;;;;;  (19670 666))
 ;;; Generated autoloads from play/decipher.el
 
 (autoload 'decipher "decipher" "\
@@ -5475,8 +5478,8 @@
 ;;;***
 
 ;;;### (autoloads (delimit-columns-rectangle delimit-columns-region
-;;;;;;  delimit-columns-customize) "delim-col" "delim-col.el" (19379
-;;;;;;  23432))
+;;;;;;  delimit-columns-customize) "delim-col" "delim-col.el" (19324
+;;;;;;  55755))
 ;;; Generated autoloads from delim-col.el
 
 (autoload 'delimit-columns-customize "delim-col" "\
@@ -5500,8 +5503,8 @@
 
 ;;;***
 
-;;;### (autoloads (delphi-mode) "delphi" "progmodes/delphi.el" (19520
-;;;;;;  54552))
+;;;### (autoloads (delphi-mode) "delphi" "progmodes/delphi.el" (19519
+;;;;;;  16431))
 ;;; Generated autoloads from progmodes/delphi.el
 
 (autoload 'delphi-mode "delphi" "\
@@ -5552,8 +5555,8 @@
 
 ;;;***
 
-;;;### (autoloads (delete-selection-mode) "delsel" "delsel.el" (19379
-;;;;;;  23432))
+;;;### (autoloads (delete-selection-mode) "delsel" "delsel.el" (19277
+;;;;;;  34915))
 ;;; Generated autoloads from delsel.el
 
 (defalias 'pending-delete-mode 'delete-selection-mode)
@@ -5582,7 +5585,7 @@
 ;;;***
 
 ;;;### (autoloads (derived-mode-init-mode-variables define-derived-mode)
-;;;;;;  "derived" "emacs-lisp/derived.el" (19578 56905))
+;;;;;;  "derived" "emacs-lisp/derived.el" (19580 19536))
 ;;; Generated autoloads from emacs-lisp/derived.el
 
 (autoload 'define-derived-mode "derived" "\
@@ -5649,7 +5652,7 @@
 ;;;***
 
 ;;;### (autoloads (describe-char describe-text-properties) "descr-text"
-;;;;;;  "descr-text.el" (19520 54552))
+;;;;;;  "descr-text.el" (19515 27412))
 ;;; Generated autoloads from descr-text.el
 
 (autoload 'describe-text-properties "descr-text" "\
@@ -5677,7 +5680,7 @@
 ;;;### (autoloads (desktop-revert desktop-save-in-desktop-dir desktop-change-dir
 ;;;;;;  desktop-load-default desktop-read desktop-remove desktop-save
 ;;;;;;  desktop-clear desktop-locals-to-save desktop-save-mode) "desktop"
-;;;;;;  "desktop.el" (19589 20829))
+;;;;;;  "desktop.el" (19590 30214))
 ;;; Generated autoloads from desktop.el
 
 (defvar desktop-save-mode nil "\
@@ -5861,7 +5864,7 @@
 
 ;;;### (autoloads (gnus-article-outlook-deuglify-article gnus-outlook-deuglify-article
 ;;;;;;  gnus-article-outlook-repair-attribution gnus-article-outlook-unwrap-lines)
-;;;;;;  "deuglify" "gnus/deuglify.el" (19583 31640))
+;;;;;;  "deuglify" "gnus/deuglify.el" (19582 65302))
 ;;; Generated autoloads from gnus/deuglify.el
 
 (autoload 'gnus-article-outlook-unwrap-lines "deuglify" "\
@@ -5894,7 +5897,7 @@
 ;;;***
 
 ;;;### (autoloads (diary-mode diary-mail-entries diary) "diary-lib"
-;;;;;;  "calendar/diary-lib.el" (19619 63775))
+;;;;;;  "calendar/diary-lib.el" (19696 27153))
 ;;; Generated autoloads from calendar/diary-lib.el
 
 (autoload 'diary "diary-lib" "\
@@ -5936,8 +5939,8 @@
 
 ;;;***
 
-;;;### (autoloads (diff-backup diff diff-command diff-switches) "diff"
-;;;;;;  "vc/diff.el" (19474 38892))
+;;;### (autoloads (diff-buffer-with-file diff-backup diff diff-command
+;;;;;;  diff-switches) "diff" "vc/diff.el" (19695 9667))
 ;;; Generated autoloads from vc/diff.el
 
 (defvar diff-switches (purecopy "-c") "\
@@ -5972,10 +5975,16 @@
 
 \(fn FILE &optional SWITCHES)" t nil)
 
+(autoload 'diff-buffer-with-file "diff" "\
+View the differences between BUFFER and its associated file.
+This requires the external program `diff' to be in your `exec-path'.
+
+\(fn &optional BUFFER)" t nil)
+
 ;;;***
 
 ;;;### (autoloads (diff-minor-mode diff-mode) "diff-mode" "vc/diff-mode.el"
-;;;;;;  (19547 59994))
+;;;;;;  (19552 37739))
 ;;; Generated autoloads from vc/diff-mode.el
 
 (autoload 'diff-mode "diff-mode" "\
@@ -6003,7 +6012,7 @@
 
 ;;;***
 
-;;;### (autoloads (dig) "dig" "net/dig.el" (19634 57717))
+;;;### (autoloads (dig) "dig" "net/dig.el" (19634 23255))
 ;;; Generated autoloads from net/dig.el
 
 (autoload 'dig "dig" "\
@@ -6016,7 +6025,7 @@
 
 ;;;### (autoloads (dired-mode dired-auto-revert-buffer dired-noselect
 ;;;;;;  dired-other-frame dired-other-window dired dired-trivial-filenames
-;;;;;;  dired-listing-switches) "dired" "dired.el" (19675 9114))
+;;;;;;  dired-listing-switches) "dired" "dired.el" (19673 45510))
 ;;; Generated autoloads from dired.el
 
 (defvar dired-listing-switches (purecopy "-al") "\
@@ -6161,7 +6170,7 @@
 ;;;***
 
 ;;;### (autoloads (dirtrack dirtrack-mode) "dirtrack" "dirtrack.el"
-;;;;;;  (19675 9114))
+;;;;;;  (19674 7816))
 ;;; Generated autoloads from dirtrack.el
 
 (autoload 'dirtrack-mode "dirtrack" "\
@@ -6187,8 +6196,8 @@
 
 ;;;***
 
-;;;### (autoloads (disassemble) "disass" "emacs-lisp/disass.el" (19379
-;;;;;;  23432))
+;;;### (autoloads (disassemble) "disass" "emacs-lisp/disass.el" (19277
+;;;;;;  34919))
 ;;; Generated autoloads from emacs-lisp/disass.el
 
 (autoload 'disassemble "disass" "\
@@ -6202,8 +6211,134 @@
 
 ;;;***
 
+;;;### (autoloads (standard-display-european glyph-face glyph-char
+;;;;;;  make-glyph-code create-glyph standard-display-underline standard-display-graphic
+;;;;;;  standard-display-g1 standard-display-ascii standard-display-default
+;;;;;;  standard-display-8bit describe-current-display-table describe-display-table
+;;;;;;  set-display-table-slot display-table-slot make-display-table)
+;;;;;;  "disp-table" "disp-table.el" (19583 60940))
+;;; Generated autoloads from disp-table.el
+
+(autoload 'make-display-table "disp-table" "\
+Return a new, empty display table.
+
+\(fn)" nil nil)
+
+(autoload 'display-table-slot "disp-table" "\
+Return the value of the extra slot in DISPLAY-TABLE named SLOT.
+SLOT may be a number from 0 to 5 inclusive, or a slot name (symbol).
+Valid symbols are `truncation', `wrap', `escape', `control',
+`selective-display', and `vertical-border'.
+
+\(fn DISPLAY-TABLE SLOT)" nil nil)
+
+(autoload 'set-display-table-slot "disp-table" "\
+Set the value of the extra slot in DISPLAY-TABLE named SLOT to VALUE.
+SLOT may be a number from 0 to 5 inclusive, or a name (symbol).
+Valid symbols are `truncation', `wrap', `escape', `control',
+`selective-display', and `vertical-border'.
+
+\(fn DISPLAY-TABLE SLOT VALUE)" nil nil)
+
+(autoload 'describe-display-table "disp-table" "\
+Describe the display table DT in a help buffer.
+
+\(fn DT)" nil nil)
+
+(autoload 'describe-current-display-table "disp-table" "\
+Describe the display table in use in the selected window and buffer.
+
+\(fn)" t nil)
+
+(autoload 'standard-display-8bit "disp-table" "\
+Display characters representing raw bytes in the range L to H literally.
+
+On a terminal display, each character in the range is displayed
+by sending the corresponding byte directly to the terminal.
+
+On a graphic display, each character in the range is displayed
+using the default font by a glyph whose code is the corresponding
+byte.
+
+Note that ASCII printable characters (SPC to TILDA) are displayed
+in the default way after this call.
+
+\(fn L H)" nil nil)
+
+(autoload 'standard-display-default "disp-table" "\
+Display characters in the range L to H using the default notation.
+
+\(fn L H)" nil nil)
+
+(autoload 'standard-display-ascii "disp-table" "\
+Display character C using printable string S.
+
+\(fn C S)" nil nil)
+
+(autoload 'standard-display-g1 "disp-table" "\
+Display character C as character SC in the g1 character set.
+This function assumes that your terminal uses the SO/SI characters;
+it is meaningless for an X frame.
+
+\(fn C SC)" nil nil)
+
+(autoload 'standard-display-graphic "disp-table" "\
+Display character C as character GC in graphics character set.
+This function assumes VT100-compatible escapes; it is meaningless for an
+X frame.
+
+\(fn C GC)" nil nil)
+
+(autoload 'standard-display-underline "disp-table" "\
+Display character C as character UC plus underlining.
+
+\(fn C UC)" nil nil)
+
+(autoload 'create-glyph "disp-table" "\
+Allocate a glyph code to display by sending STRING to the terminal.
+
+\(fn STRING)" nil nil)
+
+(autoload 'make-glyph-code "disp-table" "\
+Return a glyph code representing char CHAR with face FACE.
+
+\(fn CHAR &optional FACE)" nil nil)
+
+(autoload 'glyph-char "disp-table" "\
+Return the character of glyph code GLYPH.
+
+\(fn GLYPH)" nil nil)
+
+(autoload 'glyph-face "disp-table" "\
+Return the face of glyph code GLYPH, or nil if glyph has default face.
+
+\(fn GLYPH)" nil nil)
+
+(autoload 'standard-display-european "disp-table" "\
+Semi-obsolete way to toggle display of ISO 8859 European characters.
+
+This function is semi-obsolete; you probably don't need it, or else you
+probably should use `set-language-environment' or `set-locale-environment'.
+
+This function enables European character display if ARG is positive,
+disables it if negative.  Otherwise, it toggles European character display.
+
+When this mode is enabled, characters in the range of 160 to 255
+display not as octal escapes, but as accented characters.  Codes 146
+and 160 display as apostrophe and space, even though they are not the
+ASCII codes for apostrophe and space.
+
+Enabling European character display with this command noninteractively
+from Lisp code also selects Latin-1 as the language environment.
+This provides increased compatibility for users who call this function
+in `.emacs'.
+
+\(fn ARG)" nil nil)
+
+;;;***
+
 ;;;### (autoloads (dissociated-press) "dissociate" "play/dissociate.el"
-;;;;;;  (19379 23432))
+;;;;;;  (19277 34922))
 ;;; Generated autoloads from play/dissociate.el
 
 (autoload 'dissociated-press "dissociate" "\
@@ -6219,8 +6354,28 @@
 
 ;;;***
 
+;;;### (autoloads (dnd-protocol-alist) "dnd" "dnd.el" (19631 26857))
+;;; Generated autoloads from dnd.el
+
+(defvar dnd-protocol-alist `((,(purecopy "^file:///") . dnd-open-local-file) (,(purecopy "^file://") . dnd-open-file) (,(purecopy "^file:") . dnd-open-local-file) (,(purecopy "^\\(https?\\|ftp\\|file\\|nfs\\)://") . dnd-open-file)) "\
+The functions to call for different protocols when a drop is made.
+This variable is used by `dnd-handle-one-url' and `dnd-handle-file-name'.
+The list contains of (REGEXP . FUNCTION) pairs.
+The functions shall take two arguments, URL, which is the URL dropped and
+ACTION which is the action to be performed for the drop (move, copy, link,
+private or ask).
+If no match is found here, and the value of `browse-url-browser-function'
+is a pair of (REGEXP . FUNCTION), those regexps are tried for a match.
+If no match is found, the URL is inserted as text by calling `dnd-insert-text'.
+The function shall return the action done (move, copy, link or private)
+if some action was made, or nil if the URL is ignored.")
+
+(custom-autoload 'dnd-protocol-alist "dnd" t)
+
+;;;***
+
 ;;;### (autoloads (dns-mode-soa-increment-serial dns-mode) "dns-mode"
-;;;;;;  "textmodes/dns-mode.el" (19612 6522))
+;;;;;;  "textmodes/dns-mode.el" (19611 36311))
 ;;; Generated autoloads from textmodes/dns-mode.el
 
 (autoload 'dns-mode "dns-mode" "\
@@ -6244,7 +6399,7 @@
 ;;;***
 
 ;;;### (autoloads (doc-view-bookmark-jump doc-view-minor-mode doc-view-mode
-;;;;;;  doc-view-mode-p) "doc-view" "doc-view.el" (19520 54552))
+;;;;;;  doc-view-mode-p) "doc-view" "doc-view.el" (19519 16431))
 ;;; Generated autoloads from doc-view.el
 
 (autoload 'doc-view-mode-p "doc-view" "\
@@ -6279,7 +6434,7 @@
 
 ;;;***
 
-;;;### (autoloads (doctor) "doctor" "play/doctor.el" (19667 61332))
+;;;### (autoloads (doctor) "doctor" "play/doctor.el" (19696 28661))
 ;;; Generated autoloads from play/doctor.el
 
 (autoload 'doctor "doctor" "\
@@ -6289,7 +6444,7 @@
 
 ;;;***
 
-;;;### (autoloads (double-mode) "double" "double.el" (19379 23432))
+;;;### (autoloads (double-mode) "double" "double.el" (19277 34916))
 ;;; Generated autoloads from double.el
 
 (autoload 'double-mode "double" "\
@@ -6304,7 +6459,7 @@
 
 ;;;***
 
-;;;### (autoloads (dunnet) "dunnet" "play/dunnet.el" (19379 23432))
+;;;### (autoloads (dunnet) "dunnet" "play/dunnet.el" (19277 34922))
 ;;; Generated autoloads from play/dunnet.el
 
 (autoload 'dunnet "dunnet" "\
@@ -6316,7 +6471,7 @@
 
 ;;;### (autoloads (easy-mmode-defsyntax easy-mmode-defmap easy-mmode-define-keymap
 ;;;;;;  define-globalized-minor-mode define-minor-mode) "easy-mmode"
-;;;;;;  "emacs-lisp/easy-mmode.el" (19658 41957))
+;;;;;;  "emacs-lisp/easy-mmode.el" (19658 807))
 ;;; Generated autoloads from emacs-lisp/easy-mmode.el
 
 (defalias 'easy-mmode-define-minor-mode 'define-minor-mode)
@@ -6426,7 +6581,7 @@
 
 ;;;### (autoloads (easy-menu-change easy-menu-create-menu easy-menu-do-define
 ;;;;;;  easy-menu-define) "easymenu" "emacs-lisp/easymenu.el" (19580
-;;;;;;  5054))
+;;;;;;  19536))
 ;;; Generated autoloads from emacs-lisp/easymenu.el
 
 (autoload 'easy-menu-define "easymenu" "\
@@ -6580,7 +6735,7 @@
 ;;;;;;  ebnf-eps-file ebnf-eps-directory ebnf-spool-region ebnf-spool-buffer
 ;;;;;;  ebnf-spool-file ebnf-spool-directory ebnf-print-region ebnf-print-buffer
 ;;;;;;  ebnf-print-file ebnf-print-directory ebnf-customize) "ebnf2ps"
-;;;;;;  "progmodes/ebnf2ps.el" (19669 58161))
+;;;;;;  "progmodes/ebnf2ps.el" (19668 19251))
 ;;; Generated autoloads from progmodes/ebnf2ps.el
 
 (autoload 'ebnf-customize "ebnf2ps" "\
@@ -6854,8 +7009,8 @@
 ;;;;;;  ebrowse-tags-find-declaration-other-window ebrowse-tags-find-definition
 ;;;;;;  ebrowse-tags-view-definition ebrowse-tags-find-declaration
 ;;;;;;  ebrowse-tags-view-declaration ebrowse-member-mode ebrowse-electric-choose-tree
-;;;;;;  ebrowse-tree-mode) "ebrowse" "progmodes/ebrowse.el" (19669
-;;;;;;  58161))
+;;;;;;  ebrowse-tree-mode) "ebrowse" "progmodes/ebrowse.el" (19668
+;;;;;;  19022))
 ;;; Generated autoloads from progmodes/ebrowse.el
 
 (autoload 'ebrowse-tree-mode "ebrowse" "\
@@ -7006,7 +7161,7 @@
 ;;;***
 
 ;;;### (autoloads (electric-buffer-list) "ebuff-menu" "ebuff-menu.el"
-;;;;;;  (19669 58161))
+;;;;;;  (19668 18204))
 ;;; Generated autoloads from ebuff-menu.el
 
 (autoload 'electric-buffer-list "ebuff-menu" "\
@@ -7031,7 +7186,7 @@
 ;;;***
 
 ;;;### (autoloads (Electric-command-history-redo-expression) "echistory"
-;;;;;;  "echistory.el" (19379 23432))
+;;;;;;  "echistory.el" (19277 34916))
 ;;; Generated autoloads from echistory.el
 
 (autoload 'Electric-command-history-redo-expression "echistory" "\
@@ -7043,7 +7198,7 @@
 ;;;***
 
 ;;;### (autoloads (ecomplete-setup) "ecomplete" "gnus/ecomplete.el"
-;;;;;;  (19675 9114))
+;;;;;;  (19672 47597))
 ;;; Generated autoloads from gnus/ecomplete.el
 
 (autoload 'ecomplete-setup "ecomplete" "\
@@ -7053,7 +7208,7 @@
 
 ;;;***
 
-;;;### (autoloads (global-ede-mode) "ede" "cedet/ede.el" (19662 54456))
+;;;### (autoloads (global-ede-mode) "ede" "cedet/ede.el" (19662 23507))
 ;;; Generated autoloads from cedet/ede.el
 
 (defvar global-ede-mode nil "\
@@ -7079,7 +7234,7 @@
 
 ;;;### (autoloads (edebug-all-forms edebug-all-defs edebug-eval-top-level-form
 ;;;;;;  edebug-basic-spec edebug-all-forms edebug-all-defs) "edebug"
-;;;;;;  "emacs-lisp/edebug.el" (19669 58161))
+;;;;;;  "emacs-lisp/edebug.el" (19668 19725))
 ;;; Generated autoloads from emacs-lisp/edebug.el
 
 (defvar edebug-all-defs nil "\
@@ -7152,7 +7307,7 @@
 ;;;;;;  ediff-merge-directories-with-ancestor ediff-merge-directories
 ;;;;;;  ediff-directories3 ediff-directory-revisions ediff-directories
 ;;;;;;  ediff-buffers3 ediff-buffers ediff-backup ediff-current-file
-;;;;;;  ediff-files3 ediff-files) "ediff" "vc/ediff.el" (19578 56905))
+;;;;;;  ediff-files3 ediff-files) "ediff" "vc/ediff.el" (19580 19536))
 ;;; Generated autoloads from vc/ediff.el
 
 (autoload 'ediff-files "ediff" "\
@@ -7384,7 +7539,7 @@
 ;;;***
 
 ;;;### (autoloads (ediff-customize) "ediff-help" "vc/ediff-help.el"
-;;;;;;  (19578 56905))
+;;;;;;  (19580 19536))
 ;;; Generated autoloads from vc/ediff-help.el
 
 (autoload 'ediff-customize "ediff-help" "\
@@ -7395,7 +7550,7 @@
 ;;;***
 
 ;;;### (autoloads (ediff-show-registry) "ediff-mult" "vc/ediff-mult.el"
-;;;;;;  (19578 56905))
+;;;;;;  (19580 19536))
 ;;; Generated autoloads from vc/ediff-mult.el
 
 (autoload 'ediff-show-registry "ediff-mult" "\
@@ -7408,7 +7563,7 @@
 ;;;***
 
 ;;;### (autoloads (ediff-toggle-use-toolbar ediff-toggle-multiframe)
-;;;;;;  "ediff-util" "vc/ediff-util.el" (19665 17270))
+;;;;;;  "ediff-util" "vc/ediff-util.el" (19664 56235))
 ;;; Generated autoloads from vc/ediff-util.el
 
 (autoload 'ediff-toggle-multiframe "ediff-util" "\
@@ -7429,7 +7584,7 @@
 
 ;;;### (autoloads (format-kbd-macro read-kbd-macro edit-named-kbd-macro
 ;;;;;;  edit-last-kbd-macro edit-kbd-macro) "edmacro" "edmacro.el"
-;;;;;;  (19634 57717))
+;;;;;;  (19634 23255))
 ;;; Generated autoloads from edmacro.el
 
 (defvar edmacro-eight-bits nil "\
@@ -7482,7 +7637,7 @@
 ;;;***
 
 ;;;### (autoloads (edt-emulation-on edt-set-scroll-margins) "edt"
-;;;;;;  "emulation/edt.el" (19675 9114))
+;;;;;;  "emulation/edt.el" (19674 11425))
 ;;; Generated autoloads from emulation/edt.el
 
 (autoload 'edt-set-scroll-margins "edt" "\
@@ -7500,7 +7655,7 @@
 ;;;***
 
 ;;;### (autoloads (electric-helpify with-electric-help) "ehelp" "ehelp.el"
-;;;;;;  (19535 3923))
+;;;;;;  (19391 30349))
 ;;; Generated autoloads from ehelp.el
 
 (autoload 'with-electric-help "ehelp" "\
@@ -7537,7 +7692,7 @@
 ;;;***
 
 ;;;### (autoloads (turn-on-eldoc-mode eldoc-mode eldoc-minor-mode-string)
-;;;;;;  "eldoc" "emacs-lisp/eldoc.el" (19461 3301))
+;;;;;;  "eldoc" "emacs-lisp/eldoc.el" (19462 38192))
 ;;; Generated autoloads from emacs-lisp/eldoc.el
 
 (defvar eldoc-minor-mode-string (purecopy " ElDoc") "\
@@ -7581,7 +7736,7 @@
 ;;;***
 
 ;;;### (autoloads (electric-layout-mode electric-pair-mode electric-indent-mode)
-;;;;;;  "electric" "electric.el" (19686 22639))
+;;;;;;  "electric" "electric.el" (19687 6902))
 ;;; Generated autoloads from electric.el
 
 (defvar electric-indent-chars '(10) "\
@@ -7632,8 +7787,8 @@
 
 ;;;***
 
-;;;### (autoloads (elide-head) "elide-head" "elide-head.el" (19379
-;;;;;;  23432))
+;;;### (autoloads (elide-head) "elide-head" "elide-head.el" (19277
+;;;;;;  34916))
 ;;; Generated autoloads from elide-head.el
 
 (autoload 'elide-head "elide-head" "\
@@ -7650,7 +7805,7 @@
 
 ;;;### (autoloads (elint-initialize elint-defun elint-current-buffer
 ;;;;;;  elint-directory elint-file) "elint" "emacs-lisp/elint.el"
-;;;;;;  (19669 58161))
+;;;;;;  (19668 31925))
 ;;; Generated autoloads from emacs-lisp/elint.el
 
 (autoload 'elint-file "elint" "\
@@ -7686,8 +7841,8 @@
 ;;;***
 
 ;;;### (autoloads (elp-results elp-instrument-package elp-instrument-list
-;;;;;;  elp-instrument-function) "elp" "emacs-lisp/elp.el" (19379
-;;;;;;  23432))
+;;;;;;  elp-instrument-function) "elp" "emacs-lisp/elp.el" (19277
+;;;;;;  34919))
 ;;; Generated autoloads from emacs-lisp/elp.el
 
 (autoload 'elp-instrument-function "elp" "\
@@ -7722,7 +7877,7 @@
 ;;;***
 
 ;;;### (autoloads (report-emacs-bug) "emacsbug" "mail/emacsbug.el"
-;;;;;;  (19639 5054))
+;;;;;;  (19696 28661))
 ;;; Generated autoloads from mail/emacsbug.el
 
 (autoload 'report-emacs-bug "emacsbug" "\
@@ -7737,7 +7892,7 @@
 ;;;;;;  emerge-revisions emerge-files-with-ancestor-remote emerge-files-remote
 ;;;;;;  emerge-files-with-ancestor-command emerge-files-command emerge-buffers-with-ancestor
 ;;;;;;  emerge-buffers emerge-files-with-ancestor emerge-files) "emerge"
-;;;;;;  "vc/emerge.el" (19675 9114))
+;;;;;;  "vc/emerge.el" (19672 56753))
 ;;; Generated autoloads from vc/emerge.el
 
 (autoload 'emerge-files "emerge" "\
@@ -7798,7 +7953,7 @@
 ;;;***
 
 ;;;### (autoloads (enriched-decode enriched-encode enriched-mode)
-;;;;;;  "enriched" "textmodes/enriched.el" (19611 13362))
+;;;;;;  "enriched" "textmodes/enriched.el" (19609 2751))
 ;;; Generated autoloads from textmodes/enriched.el
 
 (autoload 'enriched-mode "enriched" "\
@@ -7833,8 +7988,8 @@
 ;;;;;;  epa-sign-region epa-verify-cleartext-in-region epa-verify-region
 ;;;;;;  epa-decrypt-armor-in-region epa-decrypt-region epa-encrypt-file
 ;;;;;;  epa-sign-file epa-verify-file epa-decrypt-file epa-select-keys
-;;;;;;  epa-list-secret-keys epa-list-keys) "epa" "epa.el" (19675
-;;;;;;  9114))
+;;;;;;  epa-list-secret-keys epa-list-keys) "epa" "epa.el" (19672
+;;;;;;  56753))
 ;;; Generated autoloads from epa.el
 
 (autoload 'epa-list-keys "epa" "\
@@ -8007,7 +8162,7 @@
 ;;;***
 
 ;;;### (autoloads (epa-dired-do-encrypt epa-dired-do-sign epa-dired-do-verify
-;;;;;;  epa-dired-do-decrypt) "epa-dired" "epa-dired.el" (19578 56905))
+;;;;;;  epa-dired-do-decrypt) "epa-dired" "epa-dired.el" (19580 19536))
 ;;; Generated autoloads from epa-dired.el
 
 (autoload 'epa-dired-do-decrypt "epa-dired" "\
@@ -8033,7 +8188,7 @@
 ;;;***
 
 ;;;### (autoloads (epa-file-disable epa-file-enable epa-file-handler)
-;;;;;;  "epa-file" "epa-file.el" (19633 49761))
+;;;;;;  "epa-file" "epa-file.el" (19634 14572))
 ;;; Generated autoloads from epa-file.el
 
 (autoload 'epa-file-handler "epa-file" "\
@@ -8055,7 +8210,7 @@
 
 ;;;### (autoloads (epa-global-mail-mode epa-mail-import-keys epa-mail-encrypt
 ;;;;;;  epa-mail-sign epa-mail-verify epa-mail-decrypt epa-mail-mode)
-;;;;;;  "epa-mail" "epa-mail.el" (19655 16813))
+;;;;;;  "epa-mail" "epa-mail.el" (19654 15628))
 ;;; Generated autoloads from epa-mail.el
 
 (autoload 'epa-mail-mode "epa-mail" "\
@@ -8119,7 +8274,7 @@
 
 ;;;***
 
-;;;### (autoloads (epg-make-context) "epg" "epg.el" (19578 56905))
+;;;### (autoloads (epg-make-context) "epg" "epg.el" (19580 19536))
 ;;; Generated autoloads from epg.el
 
 (autoload 'epg-make-context "epg" "\
@@ -8130,7 +8285,7 @@
 ;;;***
 
 ;;;### (autoloads (epg-expand-group epg-check-configuration epg-configuration)
-;;;;;;  "epg-config" "epg-config.el" (19652 27168))
+;;;;;;  "epg-config" "epg-config.el" (19652 41479))
 ;;; Generated autoloads from epg-config.el
 
 (autoload 'epg-configuration "epg-config" "\
@@ -8151,7 +8306,7 @@
 ;;;***
 
 ;;;### (autoloads (erc-handle-irc-url erc erc-select-read-args) "erc"
-;;;;;;  "erc/erc.el" (19578 56905))
+;;;;;;  "erc/erc.el" (19580 19536))
 ;;; Generated autoloads from erc/erc.el
 
 (autoload 'erc-select-read-args "erc" "\
@@ -8193,33 +8348,33 @@
 
 ;;;***
 
-;;;### (autoloads nil "erc-autoaway" "erc/erc-autoaway.el" (19379
-;;;;;;  23432))
+;;;### (autoloads nil "erc-autoaway" "erc/erc-autoaway.el" (19277
+;;;;;;  34919))
 ;;; Generated autoloads from erc/erc-autoaway.el
  (autoload 'erc-autoaway-mode "erc-autoaway")
 
 ;;;***
 
-;;;### (autoloads nil "erc-button" "erc/erc-button.el" (19379 23432))
+;;;### (autoloads nil "erc-button" "erc/erc-button.el" (19277 34919))
 ;;; Generated autoloads from erc/erc-button.el
  (autoload 'erc-button-mode "erc-button" nil t)
 
 ;;;***
 
-;;;### (autoloads nil "erc-capab" "erc/erc-capab.el" (19379 23432))
+;;;### (autoloads nil "erc-capab" "erc/erc-capab.el" (19277 34919))
 ;;; Generated autoloads from erc/erc-capab.el
  (autoload 'erc-capab-identify-mode "erc-capab" nil t)
 
 ;;;***
 
-;;;### (autoloads nil "erc-compat" "erc/erc-compat.el" (19379 23432))
+;;;### (autoloads nil "erc-compat" "erc/erc-compat.el" (19277 34919))
 ;;; Generated autoloads from erc/erc-compat.el
  (autoload 'erc-define-minor-mode "erc-compat")
 
 ;;;***
 
 ;;;### (autoloads (erc-ctcp-query-DCC pcomplete/erc-mode/DCC erc-cmd-DCC)
-;;;;;;  "erc-dcc" "erc/erc-dcc.el" (19379 23432))
+;;;;;;  "erc-dcc" "erc/erc-dcc.el" (19277 34919))
 ;;; Generated autoloads from erc/erc-dcc.el
  (autoload 'erc-dcc-mode "erc-dcc")
 
@@ -8252,7 +8407,7 @@
 ;;;;;;  erc-ezb-add-session erc-ezb-end-of-session-list erc-ezb-init-session-list
 ;;;;;;  erc-ezb-identify erc-ezb-notice-autodetect erc-ezb-lookup-action
 ;;;;;;  erc-ezb-get-login erc-cmd-ezb) "erc-ezbounce" "erc/erc-ezbounce.el"
-;;;;;;  (19379 23432))
+;;;;;;  (19277 34919))
 ;;; Generated autoloads from erc/erc-ezbounce.el
 
 (autoload 'erc-cmd-ezb "erc-ezbounce" "\
@@ -8314,8 +8469,8 @@
 
 ;;;***
 
-;;;### (autoloads (erc-fill) "erc-fill" "erc/erc-fill.el" (19379
-;;;;;;  23432))
+;;;### (autoloads (erc-fill) "erc-fill" "erc/erc-fill.el" (19277
+;;;;;;  34919))
 ;;; Generated autoloads from erc/erc-fill.el
  (autoload 'erc-fill-mode "erc-fill" nil t)
 
@@ -8327,15 +8482,15 @@
 
 ;;;***
 
-;;;### (autoloads nil "erc-hecomplete" "erc/erc-hecomplete.el" (19379
-;;;;;;  23432))
+;;;### (autoloads nil "erc-hecomplete" "erc/erc-hecomplete.el" (19277
+;;;;;;  34919))
 ;;; Generated autoloads from erc/erc-hecomplete.el
  (autoload 'erc-hecomplete-mode "erc-hecomplete" nil t)
 
 ;;;***
 
 ;;;### (autoloads (erc-identd-stop erc-identd-start) "erc-identd"
-;;;;;;  "erc/erc-identd.el" (19379 23432))
+;;;;;;  "erc/erc-identd.el" (19277 34919))
 ;;; Generated autoloads from erc/erc-identd.el
  (autoload 'erc-identd-mode "erc-identd")
 
@@ -8357,7 +8512,7 @@
 ;;;***
 
 ;;;### (autoloads (erc-create-imenu-index) "erc-imenu" "erc/erc-imenu.el"
-;;;;;;  (19379 23432))
+;;;;;;  (19277 34919))
 ;;; Generated autoloads from erc/erc-imenu.el
 
 (autoload 'erc-create-imenu-index "erc-imenu" "\
@@ -8367,20 +8522,20 @@
 
 ;;;***
 
-;;;### (autoloads nil "erc-join" "erc/erc-join.el" (19564 19367))
+;;;### (autoloads nil "erc-join" "erc/erc-join.el" (19561 48711))
 ;;; Generated autoloads from erc/erc-join.el
  (autoload 'erc-autojoin-mode "erc-join" nil t)
 
 ;;;***
 
-;;;### (autoloads nil "erc-list" "erc/erc-list.el" (19634 57717))
+;;;### (autoloads nil "erc-list" "erc/erc-list.el" (19634 23255))
 ;;; Generated autoloads from erc/erc-list.el
  (autoload 'erc-list-mode "erc-list")
 
 ;;;***
 
 ;;;### (autoloads (erc-save-buffer-in-logs erc-logging-enabled) "erc-log"
-;;;;;;  "erc/erc-log.el" (19379 23432))
+;;;;;;  "erc/erc-log.el" (19277 34919))
 ;;; Generated autoloads from erc/erc-log.el
  (autoload 'erc-log-mode "erc-log" nil t)
 
@@ -8412,7 +8567,7 @@
 ;;;### (autoloads (erc-delete-dangerous-host erc-add-dangerous-host
 ;;;;;;  erc-delete-keyword erc-add-keyword erc-delete-fool erc-add-fool
 ;;;;;;  erc-delete-pal erc-add-pal) "erc-match" "erc/erc-match.el"
-;;;;;;  (19379 23432))
+;;;;;;  (19277 34919))
 ;;; Generated autoloads from erc/erc-match.el
  (autoload 'erc-match-mode "erc-match")
 
@@ -8458,14 +8613,14 @@
 
 ;;;***
 
-;;;### (autoloads nil "erc-menu" "erc/erc-menu.el" (19379 23432))
+;;;### (autoloads nil "erc-menu" "erc/erc-menu.el" (19277 34919))
 ;;; Generated autoloads from erc/erc-menu.el
  (autoload 'erc-menu-mode "erc-menu" nil t)
 
 ;;;***
 
 ;;;### (autoloads (erc-cmd-WHOLEFT) "erc-netsplit" "erc/erc-netsplit.el"
-;;;;;;  (19379 23432))
+;;;;;;  (19277 34919))
 ;;; Generated autoloads from erc/erc-netsplit.el
  (autoload 'erc-netsplit-mode "erc-netsplit")
 
@@ -8477,7 +8632,7 @@
 ;;;***
 
 ;;;### (autoloads (erc-server-select erc-determine-network) "erc-networks"
-;;;;;;  "erc/erc-networks.el" (19379 23432))
+;;;;;;  "erc/erc-networks.el" (19277 34919))
 ;;; Generated autoloads from erc/erc-networks.el
 
 (autoload 'erc-determine-network "erc-networks" "\
@@ -8495,7 +8650,7 @@
 ;;;***
 
 ;;;### (autoloads (pcomplete/erc-mode/NOTIFY erc-cmd-NOTIFY) "erc-notify"
-;;;;;;  "erc/erc-notify.el" (19379 23432))
+;;;;;;  "erc/erc-notify.el" (19277 34919))
 ;;; Generated autoloads from erc/erc-notify.el
  (autoload 'erc-notify-mode "erc-notify" nil t)
 
@@ -8513,33 +8668,33 @@
 
 ;;;***
 
-;;;### (autoloads nil "erc-page" "erc/erc-page.el" (19379 23432))
+;;;### (autoloads nil "erc-page" "erc/erc-page.el" (19277 34919))
 ;;; Generated autoloads from erc/erc-page.el
  (autoload 'erc-page-mode "erc-page")
 
 ;;;***
 
-;;;### (autoloads nil "erc-pcomplete" "erc/erc-pcomplete.el" (19379
-;;;;;;  23432))
+;;;### (autoloads nil "erc-pcomplete" "erc/erc-pcomplete.el" (19277
+;;;;;;  34919))
 ;;; Generated autoloads from erc/erc-pcomplete.el
  (autoload 'erc-completion-mode "erc-pcomplete" nil t)
 
 ;;;***
 
-;;;### (autoloads nil "erc-replace" "erc/erc-replace.el" (19379 23432))
+;;;### (autoloads nil "erc-replace" "erc/erc-replace.el" (19277 34919))
 ;;; Generated autoloads from erc/erc-replace.el
  (autoload 'erc-replace-mode "erc-replace")
 
 ;;;***
 
-;;;### (autoloads nil "erc-ring" "erc/erc-ring.el" (19379 23432))
+;;;### (autoloads nil "erc-ring" "erc/erc-ring.el" (19277 34919))
 ;;; Generated autoloads from erc/erc-ring.el
  (autoload 'erc-ring-mode "erc-ring" nil t)
 
 ;;;***
 
 ;;;### (autoloads (erc-nickserv-identify erc-nickserv-identify-mode)
-;;;;;;  "erc-services" "erc/erc-services.el" (19379 23432))
+;;;;;;  "erc-services" "erc/erc-services.el" (19311 8632))
 ;;; Generated autoloads from erc/erc-services.el
  (autoload 'erc-services-mode "erc-services" nil t)
 
@@ -8556,14 +8711,14 @@
 
 ;;;***
 
-;;;### (autoloads nil "erc-sound" "erc/erc-sound.el" (19379 23432))
+;;;### (autoloads nil "erc-sound" "erc/erc-sound.el" (19277 34919))
 ;;; Generated autoloads from erc/erc-sound.el
  (autoload 'erc-sound-mode "erc-sound")
 
 ;;;***
 
 ;;;### (autoloads (erc-speedbar-browser) "erc-speedbar" "erc/erc-speedbar.el"
-;;;;;;  (19379 23432))
+;;;;;;  (19277 34919))
 ;;; Generated autoloads from erc/erc-speedbar.el
 
 (autoload 'erc-speedbar-browser "erc-speedbar" "\
@@ -8574,21 +8729,21 @@
 
 ;;;***
 
-;;;### (autoloads nil "erc-spelling" "erc/erc-spelling.el" (19379
-;;;;;;  23432))
+;;;### (autoloads nil "erc-spelling" "erc/erc-spelling.el" (19277
+;;;;;;  34919))
 ;;; Generated autoloads from erc/erc-spelling.el
  (autoload 'erc-spelling-mode "erc-spelling" nil t)
 
 ;;;***
 
-;;;### (autoloads nil "erc-stamp" "erc/erc-stamp.el" (19379 23432))
+;;;### (autoloads nil "erc-stamp" "erc/erc-stamp.el" (19277 34919))
 ;;; Generated autoloads from erc/erc-stamp.el
  (autoload 'erc-timestamp-mode "erc-stamp" nil t)
 
 ;;;***
 
 ;;;### (autoloads (erc-track-minor-mode) "erc-track" "erc/erc-track.el"
-;;;;;;  (19379 23432))
+;;;;;;  (19277 34919))
 ;;; Generated autoloads from erc/erc-track.el
 
 (defvar erc-track-minor-mode nil "\
@@ -8611,7 +8766,7 @@
 ;;;***
 
 ;;;### (autoloads (erc-truncate-buffer erc-truncate-buffer-to-size)
-;;;;;;  "erc-truncate" "erc/erc-truncate.el" (19379 23432))
+;;;;;;  "erc-truncate" "erc/erc-truncate.el" (19277 34919))
 ;;; Generated autoloads from erc/erc-truncate.el
  (autoload 'erc-truncate-mode "erc-truncate" nil t)
 
@@ -8631,7 +8786,7 @@
 ;;;***
 
 ;;;### (autoloads (erc-xdcc-add-file) "erc-xdcc" "erc/erc-xdcc.el"
-;;;;;;  (19638 63299))
+;;;;;;  (19639 17158))
 ;;; Generated autoloads from erc/erc-xdcc.el
  (autoload 'erc-xdcc-mode "erc-xdcc")
 
@@ -8642,8 +8797,8 @@
 
 ;;;***
 
-;;;### (autoloads (eshell-mode) "esh-mode" "eshell/esh-mode.el" (19614
-;;;;;;  29799))
+;;;### (autoloads (eshell-mode) "esh-mode" "eshell/esh-mode.el" (19611
+;;;;;;  64957))
 ;;; Generated autoloads from eshell/esh-mode.el
 
 (autoload 'eshell-mode "esh-mode" "\
@@ -8655,8 +8810,8 @@
 
 ;;;***
 
-;;;### (autoloads (eshell-test) "esh-test" "eshell/esh-test.el" (19675
-;;;;;;  9114))
+;;;### (autoloads (eshell-test) "esh-test" "eshell/esh-test.el" (19672
+;;;;;;  39436))
 ;;; Generated autoloads from eshell/esh-test.el
 
 (autoload 'eshell-test "esh-test" "\
@@ -8667,7 +8822,7 @@
 ;;;***
 
 ;;;### (autoloads (eshell-command-result eshell-command eshell) "eshell"
-;;;;;;  "eshell/eshell.el" (19451 41962))
+;;;;;;  "eshell/eshell.el" (19451 17238))
 ;;; Generated autoloads from eshell/eshell.el
 
 (autoload 'eshell "eshell" "\
@@ -8708,7 +8863,7 @@
 ;;;;;;  visit-tags-table tags-table-mode find-tag-default-function
 ;;;;;;  find-tag-hook tags-add-tables tags-compression-info-list
 ;;;;;;  tags-table-list tags-case-fold-search) "etags" "progmodes/etags.el"
-;;;;;;  (19675 9114))
+;;;;;;  (19672 56753))
 ;;; Generated autoloads from progmodes/etags.el
 
 (defvar tags-file-name nil "\
@@ -9022,7 +9177,7 @@
 ;;;;;;  ethio-fidel-to-sera-marker ethio-fidel-to-sera-region ethio-fidel-to-sera-buffer
 ;;;;;;  ethio-sera-to-fidel-marker ethio-sera-to-fidel-region ethio-sera-to-fidel-buffer
 ;;;;;;  setup-ethiopic-environment-internal) "ethio-util" "language/ethio-util.el"
-;;;;;;  (19451 41962))
+;;;;;;  (19451 17238))
 ;;; Generated autoloads from language/ethio-util.el
 
 (autoload 'setup-ethiopic-environment-internal "ethio-util" "\
@@ -9192,7 +9347,7 @@
 
 ;;;### (autoloads (eudc-load-eudc eudc-query-form eudc-expand-inline
 ;;;;;;  eudc-get-phone eudc-get-email eudc-set-server) "eudc" "net/eudc.el"
-;;;;;;  (19675 9114))
+;;;;;;  (19672 56753))
 ;;; Generated autoloads from net/eudc.el
 
 (autoload 'eudc-set-server "eudc" "\
@@ -9248,7 +9403,7 @@
 
 ;;;### (autoloads (eudc-display-jpeg-as-button eudc-display-jpeg-inline
 ;;;;;;  eudc-display-sound eudc-display-mail eudc-display-url eudc-display-generic-binary)
-;;;;;;  "eudc-bob" "net/eudc-bob.el" (19578 56905))
+;;;;;;  "eudc-bob" "net/eudc-bob.el" (19580 19536))
 ;;; Generated autoloads from net/eudc-bob.el
 
 (autoload 'eudc-display-generic-binary "eudc-bob" "\
@@ -9284,7 +9439,7 @@
 ;;;***
 
 ;;;### (autoloads (eudc-try-bbdb-insert eudc-insert-record-at-point-into-bbdb)
-;;;;;;  "eudc-export" "net/eudc-export.el" (19578 56905))
+;;;;;;  "eudc-export" "net/eudc-export.el" (19580 19536))
 ;;; Generated autoloads from net/eudc-export.el
 
 (autoload 'eudc-insert-record-at-point-into-bbdb "eudc-export" "\
@@ -9301,7 +9456,7 @@
 ;;;***
 
 ;;;### (autoloads (eudc-edit-hotlist) "eudc-hotlist" "net/eudc-hotlist.el"
-;;;;;;  (19634 57717))
+;;;;;;  (19634 23255))
 ;;; Generated autoloads from net/eudc-hotlist.el
 
 (autoload 'eudc-edit-hotlist "eudc-hotlist" "\
@@ -9311,8 +9466,8 @@
 
 ;;;***
 
-;;;### (autoloads (ewoc-create) "ewoc" "emacs-lisp/ewoc.el" (19379
-;;;;;;  23432))
+;;;### (autoloads (ewoc-create) "ewoc" "emacs-lisp/ewoc.el" (19277
+;;;;;;  34919))
 ;;; Generated autoloads from emacs-lisp/ewoc.el
 
 (autoload 'ewoc-create "ewoc" "\
@@ -9341,7 +9496,7 @@
 ;;;### (autoloads (executable-make-buffer-file-executable-if-script-p
 ;;;;;;  executable-self-display executable-set-magic executable-interpret
 ;;;;;;  executable-command-find-posix-p) "executable" "progmodes/executable.el"
-;;;;;;  (19379 23432))
+;;;;;;  (19277 34922))
 ;;; Generated autoloads from progmodes/executable.el
 
 (autoload 'executable-command-find-posix-p "executable" "\
@@ -9384,7 +9539,7 @@
 
 ;;;### (autoloads (expand-jump-to-next-slot expand-jump-to-previous-slot
 ;;;;;;  expand-abbrev-hook expand-add-abbrevs) "expand" "expand.el"
-;;;;;;  (19451 41962))
+;;;;;;  (19451 17238))
 ;;; Generated autoloads from expand.el
 
 (autoload 'expand-add-abbrevs "expand" "\
@@ -9433,7 +9588,7 @@
 
 ;;;***
 
-;;;### (autoloads (f90-mode) "f90" "progmodes/f90.el" (19652 27168))
+;;;### (autoloads (f90-mode) "f90" "progmodes/f90.el" (19651 33965))
 ;;; Generated autoloads from progmodes/f90.el
 
 (autoload 'f90-mode "f90" "\
@@ -9500,7 +9655,7 @@
 ;;;;;;  buffer-face-mode text-scale-adjust text-scale-decrease text-scale-increase
 ;;;;;;  text-scale-set face-remap-set-base face-remap-reset-base
 ;;;;;;  face-remap-add-relative) "face-remap" "face-remap.el" (19652
-;;;;;;  50311))
+;;;;;;  44405))
 ;;; Generated autoloads from face-remap.el
 
 (autoload 'face-remap-add-relative "face-remap" "\
@@ -9640,7 +9795,7 @@
 
 ;;;### (autoloads (feedmail-queue-reminder feedmail-run-the-queue
 ;;;;;;  feedmail-run-the-queue-global-prompt feedmail-run-the-queue-no-prompts
-;;;;;;  feedmail-send-it) "feedmail" "mail/feedmail.el" (19611 13362))
+;;;;;;  feedmail-send-it) "feedmail" "mail/feedmail.el" (19609 2433))
 ;;; Generated autoloads from mail/feedmail.el
 
 (autoload 'feedmail-send-it "feedmail" "\
@@ -9694,7 +9849,7 @@
 ;;;***
 
 ;;;### (autoloads (ffap-bindings dired-at-point ffap-at-mouse ffap-menu
-;;;;;;  find-file-at-point ffap-next) "ffap" "ffap.el" (19379 23432))
+;;;;;;  find-file-at-point ffap-next) "ffap" "ffap.el" (19318 65023))
 ;;; Generated autoloads from ffap.el
 
 (autoload 'ffap-next "ffap" "\
@@ -9758,7 +9913,7 @@
 ;;;### (autoloads (file-cache-minibuffer-complete file-cache-add-directory-recursively
 ;;;;;;  file-cache-add-directory-using-locate file-cache-add-directory-using-find
 ;;;;;;  file-cache-add-file file-cache-add-directory-list file-cache-add-directory)
-;;;;;;  "filecache" "filecache.el" (19675 9114))
+;;;;;;  "filecache" "filecache.el" (19672 41839))
 ;;; Generated autoloads from filecache.el
 
 (autoload 'file-cache-add-directory "filecache" "\
@@ -9818,7 +9973,7 @@
 ;;;;;;  copy-file-locals-to-dir-locals delete-dir-local-variable
 ;;;;;;  add-dir-local-variable delete-file-local-variable-prop-line
 ;;;;;;  add-file-local-variable-prop-line delete-file-local-variable
-;;;;;;  add-file-local-variable) "files-x" "files-x.el" (19578 56905))
+;;;;;;  add-file-local-variable) "files-x" "files-x.el" (19580 19536))
 ;;; Generated autoloads from files-x.el
 
 (autoload 'add-file-local-variable "files-x" "\
@@ -9883,8 +10038,8 @@
 
 ;;;***
 
-;;;### (autoloads (filesets-init) "filesets" "filesets.el" (19612
-;;;;;;  6522))
+;;;### (autoloads (filesets-init) "filesets" "filesets.el" (19611
+;;;;;;  60752))
 ;;; Generated autoloads from filesets.el
 
 (autoload 'filesets-init "filesets" "\
@@ -9895,7 +10050,7 @@
 
 ;;;***
 
-;;;### (autoloads (find-cmd) "find-cmd" "find-cmd.el" (19379 23432))
+;;;### (autoloads (find-cmd) "find-cmd" "find-cmd.el" (19279 53114))
 ;;; Generated autoloads from find-cmd.el
 
 (autoload 'find-cmd "find-cmd" "\
@@ -9916,7 +10071,7 @@
 
 ;;;### (autoloads (find-grep-dired find-name-dired find-dired find-grep-options
 ;;;;;;  find-ls-subdir-switches find-ls-option) "find-dired" "find-dired.el"
-;;;;;;  (19379 23432))
+;;;;;;  (19379 30332))
 ;;; Generated autoloads from find-dired.el
 
 (defvar find-ls-option (if (eq system-type 'berkeley-unix) (purecopy '("-ls" . "-gilsb")) (purecopy '("-exec ls -ld {} \\;" . "-ld"))) "\
@@ -9977,7 +10132,7 @@
 
 ;;;### (autoloads (ff-mouse-find-other-file-other-window ff-mouse-find-other-file
 ;;;;;;  ff-find-other-file ff-get-other-file) "find-file" "find-file.el"
-;;;;;;  (19379 23432))
+;;;;;;  (19442 62609))
 ;;; Generated autoloads from find-file.el
 
 (defvar ff-special-constructs `((,(purecopy "^#\\s *\\(include\\|import\\)\\s +[<\"]\\(.*\\)[>\"]") lambda nil (buffer-substring (match-beginning 2) (match-end 2)))) "\
@@ -10071,7 +10226,7 @@
 ;;;;;;  find-variable find-variable-noselect find-function-other-frame
 ;;;;;;  find-function-other-window find-function find-function-noselect
 ;;;;;;  find-function-search-for-symbol find-library) "find-func"
-;;;;;;  "emacs-lisp/find-func.el" (19649 27409))
+;;;;;;  "emacs-lisp/find-func.el" (19649 956))
 ;;; Generated autoloads from emacs-lisp/find-func.el
 
 (autoload 'find-library "find-func" "\
@@ -10226,7 +10381,7 @@
 ;;;***
 
 ;;;### (autoloads (find-lisp-find-dired-filter find-lisp-find-dired-subdirectories
-;;;;;;  find-lisp-find-dired) "find-lisp" "find-lisp.el" (19379 23432))
+;;;;;;  find-lisp-find-dired) "find-lisp" "find-lisp.el" (19277 34916))
 ;;; Generated autoloads from find-lisp.el
 
 (autoload 'find-lisp-find-dired "find-lisp" "\
@@ -10247,7 +10402,7 @@
 ;;;***
 
 ;;;### (autoloads (finder-by-keyword finder-commentary finder-list-keywords)
-;;;;;;  "finder" "finder.el" (19662 54456))
+;;;;;;  "finder" "finder.el" (19662 23188))
 ;;; Generated autoloads from finder.el
 
 (autoload 'finder-list-keywords "finder" "\
@@ -10269,7 +10424,7 @@
 ;;;***
 
 ;;;### (autoloads (enable-flow-control-on enable-flow-control) "flow-ctrl"
-;;;;;;  "flow-ctrl.el" (19379 23432))
+;;;;;;  "flow-ctrl.el" (19277 34916))
 ;;; Generated autoloads from flow-ctrl.el
 
 (autoload 'enable-flow-control "flow-ctrl" "\
@@ -10291,7 +10446,7 @@
 ;;;***
 
 ;;;### (autoloads (fill-flowed fill-flowed-encode) "flow-fill" "gnus/flow-fill.el"
-;;;;;;  (19606 36461))
+;;;;;;  (19604 65275))
 ;;; Generated autoloads from gnus/flow-fill.el
 
 (autoload 'fill-flowed-encode "flow-fill" "\
@@ -10307,7 +10462,7 @@
 ;;;***
 
 ;;;### (autoloads (flymake-mode-off flymake-mode-on flymake-mode)
-;;;;;;  "flymake" "progmodes/flymake.el" (19671 21337))
+;;;;;;  "flymake" "progmodes/flymake.el" (19670 2258))
 ;;; Generated autoloads from progmodes/flymake.el
 
 (autoload 'flymake-mode "flymake" "\
@@ -10331,7 +10486,7 @@
 
 ;;;### (autoloads (flyspell-buffer flyspell-region flyspell-mode-off
 ;;;;;;  turn-off-flyspell turn-on-flyspell flyspell-mode flyspell-prog-mode)
-;;;;;;  "flyspell" "textmodes/flyspell.el" (19682 26290))
+;;;;;;  "flyspell" "textmodes/flyspell.el" (19681 34867))
 ;;; Generated autoloads from textmodes/flyspell.el
 
 (autoload 'flyspell-prog-mode "flyspell" "\
@@ -10401,7 +10556,7 @@
 
 ;;;### (autoloads (follow-delete-other-windows-and-split follow-mode
 ;;;;;;  turn-off-follow-mode turn-on-follow-mode) "follow" "follow.el"
-;;;;;;  (19379 23432))
+;;;;;;  (19277 34916))
 ;;; Generated autoloads from follow.el
 
 (autoload 'turn-on-follow-mode "follow" "\
@@ -10474,8 +10629,8 @@
 
 ;;;***
 
-;;;### (autoloads (footnote-mode) "footnote" "mail/footnote.el" (19379
-;;;;;;  23432))
+;;;### (autoloads (footnote-mode) "footnote" "mail/footnote.el" (19277
+;;;;;;  34921))
 ;;; Generated autoloads from mail/footnote.el
 
 (autoload 'footnote-mode "footnote" "\
@@ -10489,7 +10644,7 @@
 ;;;***
 
 ;;;### (autoloads (forms-find-file-other-window forms-find-file forms-mode)
-;;;;;;  "forms" "forms.el" (19397 4695))
+;;;;;;  "forms" "forms.el" (19406 15657))
 ;;; Generated autoloads from forms.el
 
 (autoload 'forms-mode "forms" "\
@@ -10526,7 +10681,7 @@
 ;;;***
 
 ;;;### (autoloads (fortran-mode) "fortran" "progmodes/fortran.el"
-;;;;;;  (19675 9114))
+;;;;;;  (19672 56753))
 ;;; Generated autoloads from progmodes/fortran.el
 
 (autoload 'fortran-mode "fortran" "\
@@ -10604,7 +10759,7 @@
 ;;;***
 
 ;;;### (autoloads (fortune fortune-to-signature fortune-compile fortune-from-region
-;;;;;;  fortune-add-fortune) "fortune" "play/fortune.el" (19661 45226))
+;;;;;;  fortune-add-fortune) "fortune" "play/fortune.el" (19661 46305))
 ;;; Generated autoloads from play/fortune.el
 
 (autoload 'fortune-add-fortune "fortune" "\
@@ -10653,7 +10808,7 @@
 ;;;***
 
 ;;;### (autoloads (gdb gdb-enable-debug) "gdb-mi" "progmodes/gdb-mi.el"
-;;;;;;  (19613 57681))
+;;;;;;  (19614 24990))
 ;;; Generated autoloads from progmodes/gdb-mi.el
 
 (defvar gdb-enable-debug nil "\
@@ -10714,8 +10869,8 @@
 ;;;***
 
 ;;;### (autoloads (generic-make-keywords-list generic-mode generic-mode-internal
-;;;;;;  define-generic-mode) "generic" "emacs-lisp/generic.el" (19578
-;;;;;;  56905))
+;;;;;;  define-generic-mode) "generic" "emacs-lisp/generic.el" (19580
+;;;;;;  19536))
 ;;; Generated autoloads from emacs-lisp/generic.el
 
 (defvar generic-mode-list nil "\
@@ -10792,7 +10947,7 @@
 ;;;***
 
 ;;;### (autoloads (glasses-mode) "glasses" "progmodes/glasses.el"
-;;;;;;  (19379 23432))
+;;;;;;  (19277 34922))
 ;;; Generated autoloads from progmodes/glasses.el
 
 (autoload 'glasses-mode "glasses" "\
@@ -10806,7 +10961,7 @@
 
 ;;;### (autoloads (gmm-tool-bar-from-list gmm-widget-p gmm-error
 ;;;;;;  gmm-message gmm-regexp-concat) "gmm-utils" "gnus/gmm-utils.el"
-;;;;;;  (19623 61514))
+;;;;;;  (19623 58490))
 ;;; Generated autoloads from gnus/gmm-utils.el
 
 (autoload 'gmm-regexp-concat "gmm-utils" "\
@@ -10861,7 +11016,7 @@
 ;;;***
 
 ;;;### (autoloads (gnus gnus-other-frame gnus-slave gnus-no-server
-;;;;;;  gnus-slave-no-server) "gnus" "gnus/gnus.el" (19682 26290))
+;;;;;;  gnus-slave-no-server) "gnus" "gnus/gnus.el" (19687 6902))
 ;;; Generated autoloads from gnus/gnus.el
 (when (fboundp 'custom-autoload)
  (custom-autoload 'gnus-select-method "gnus"))
@@ -10914,7 +11069,7 @@
 ;;;;;;  gnus-agent-get-undownloaded-list gnus-agent-delete-group
 ;;;;;;  gnus-agent-rename-group gnus-agent-possibly-save-gcc gnus-agentize
 ;;;;;;  gnus-slave-unplugged gnus-plugged gnus-unplugged) "gnus-agent"
-;;;;;;  "gnus/gnus-agent.el" (19682 26290))
+;;;;;;  "gnus/gnus-agent.el" (19687 6902))
 ;;; Generated autoloads from gnus/gnus-agent.el
 
 (autoload 'gnus-unplugged "gnus-agent" "\
@@ -11005,7 +11160,7 @@
 ;;;***
 
 ;;;### (autoloads (gnus-article-prepare-display) "gnus-art" "gnus/gnus-art.el"
-;;;;;;  (19686 22639))
+;;;;;;  (19695 9549))
 ;;; Generated autoloads from gnus/gnus-art.el
 
 (autoload 'gnus-article-prepare-display "gnus-art" "\
@@ -11016,7 +11171,7 @@
 ;;;***
 
 ;;;### (autoloads (gnus-bookmark-bmenu-list gnus-bookmark-jump gnus-bookmark-set)
-;;;;;;  "gnus-bookmark" "gnus/gnus-bookmark.el" (19671 21337))
+;;;;;;  "gnus-bookmark" "gnus/gnus-bookmark.el" (19670 666))
 ;;; Generated autoloads from gnus/gnus-bookmark.el
 
 (autoload 'gnus-bookmark-set "gnus-bookmark" "\
@@ -11041,8 +11196,8 @@
 
 ;;;### (autoloads (gnus-cache-delete-group gnus-cache-rename-group
 ;;;;;;  gnus-cache-generate-nov-databases gnus-cache-generate-active
-;;;;;;  gnus-jog-cache) "gnus-cache" "gnus/gnus-cache.el" (19635
-;;;;;;  41857))
+;;;;;;  gnus-jog-cache) "gnus-cache" "gnus/gnus-cache.el" (19693
+;;;;;;  40409))
 ;;; Generated autoloads from gnus/gnus-cache.el
 
 (autoload 'gnus-jog-cache "gnus-cache" "\
@@ -11084,7 +11239,7 @@
 ;;;***
 
 ;;;### (autoloads (gnus-delay-initialize gnus-delay-send-queue gnus-delay-article)
-;;;;;;  "gnus-delay" "gnus/gnus-delay.el" (19644 51090))
+;;;;;;  "gnus-delay" "gnus/gnus-delay.el" (19645 60484))
 ;;; Generated autoloads from gnus/gnus-delay.el
 
 (autoload 'gnus-delay-article "gnus-delay" "\
@@ -11120,7 +11275,7 @@
 ;;;***
 
 ;;;### (autoloads (gnus-user-format-function-D gnus-user-format-function-d)
-;;;;;;  "gnus-diary" "gnus/gnus-diary.el" (19641 32539))
+;;;;;;  "gnus-diary" "gnus/gnus-diary.el" (19645 60484))
 ;;; Generated autoloads from gnus/gnus-diary.el
 
 (autoload 'gnus-user-format-function-d "gnus-diary" "\
@@ -11136,7 +11291,7 @@
 ;;;***
 
 ;;;### (autoloads (turn-on-gnus-dired-mode) "gnus-dired" "gnus/gnus-dired.el"
-;;;;;;  (19662 8083))
+;;;;;;  (19662 7391))
 ;;; Generated autoloads from gnus/gnus-dired.el
 
 (autoload 'turn-on-gnus-dired-mode "gnus-dired" "\
@@ -11147,7 +11302,7 @@
 ;;;***
 
 ;;;### (autoloads (gnus-draft-reminder) "gnus-draft" "gnus/gnus-draft.el"
-;;;;;;  (19646 65152))
+;;;;;;  (19648 31344))
 ;;; Generated autoloads from gnus/gnus-draft.el
 
 (autoload 'gnus-draft-reminder "gnus-draft" "\
@@ -11160,7 +11315,7 @@
 ;;;### (autoloads (gnus-convert-png-to-face gnus-convert-face-to-png
 ;;;;;;  gnus-face-from-file gnus-x-face-from-file gnus-insert-random-x-face-header
 ;;;;;;  gnus-random-x-face) "gnus-fun" "gnus/gnus-fun.el" (19635
-;;;;;;  41857))
+;;;;;;  50568))
 ;;; Generated autoloads from gnus/gnus-fun.el
 
 (autoload 'gnus-random-x-face "gnus-fun" "\
@@ -11205,7 +11360,7 @@
 ;;;***
 
 ;;;### (autoloads (gnus-treat-mail-gravatar gnus-treat-from-gravatar)
-;;;;;;  "gnus-gravatar" "gnus/gnus-gravatar.el" (19671 21337))
+;;;;;;  "gnus-gravatar" "gnus/gnus-gravatar.el" (19688 19082))
 ;;; Generated autoloads from gnus/gnus-gravatar.el
 
 (autoload 'gnus-treat-from-gravatar "gnus-gravatar" "\
@@ -11223,7 +11378,7 @@
 ;;;***
 
 ;;;### (autoloads (gnus-fetch-group-other-frame gnus-fetch-group)
-;;;;;;  "gnus-group" "gnus/gnus-group.el" (19675 9114))
+;;;;;;  "gnus-group" "gnus/gnus-group.el" (19672 21006))
 ;;; Generated autoloads from gnus/gnus-group.el
 
 (autoload 'gnus-fetch-group "gnus-group" "\
@@ -11241,7 +11396,7 @@
 ;;;***
 
 ;;;### (autoloads (gnus-html-prefetch-images gnus-article-html) "gnus-html"
-;;;;;;  "gnus/gnus-html.el" (19686 22639))
+;;;;;;  "gnus/gnus-html.el" (19687 6902))
 ;;; Generated autoloads from gnus/gnus-html.el
 
 (autoload 'gnus-article-html "gnus-html" "\
@@ -11257,7 +11412,7 @@
 ;;;***
 
 ;;;### (autoloads (gnus-batch-score) "gnus-kill" "gnus/gnus-kill.el"
-;;;;;;  (19636 31813))
+;;;;;;  (19636 38740))
 ;;; Generated autoloads from gnus/gnus-kill.el
 
 (defalias 'gnus-batch-kill 'gnus-batch-score)
@@ -11272,7 +11427,7 @@
 
 ;;;### (autoloads (gnus-mailing-list-mode gnus-mailing-list-insinuate
 ;;;;;;  turn-on-gnus-mailing-list-mode) "gnus-ml" "gnus/gnus-ml.el"
-;;;;;;  (19583 31640))
+;;;;;;  (19582 65302))
 ;;; Generated autoloads from gnus/gnus-ml.el
 
 (autoload 'turn-on-gnus-mailing-list-mode "gnus-ml" "\
@@ -11297,7 +11452,7 @@
 
 ;;;### (autoloads (gnus-group-split-fancy gnus-group-split gnus-group-split-update
 ;;;;;;  gnus-group-split-setup) "gnus-mlspl" "gnus/gnus-mlspl.el"
-;;;;;;  (19583 31640))
+;;;;;;  (19582 65302))
 ;;; Generated autoloads from gnus/gnus-mlspl.el
 
 (autoload 'gnus-group-split-setup "gnus-mlspl" "\
@@ -11398,7 +11553,7 @@
 ;;;***
 
 ;;;### (autoloads (gnus-button-reply gnus-button-mailto gnus-msg-mail)
-;;;;;;  "gnus-msg" "gnus/gnus-msg.el" (19662 54456))
+;;;;;;  "gnus-msg" "gnus/gnus-msg.el" (19662 23188))
 ;;; Generated autoloads from gnus/gnus-msg.el
 
 (autoload 'gnus-msg-mail "gnus-msg" "\
@@ -11424,7 +11579,7 @@
 
 ;;;### (autoloads (gnus-treat-newsgroups-picon gnus-treat-mail-picon
 ;;;;;;  gnus-treat-from-picon) "gnus-picon" "gnus/gnus-picon.el"
-;;;;;;  (19635 41857))
+;;;;;;  (19635 50568))
 ;;; Generated autoloads from gnus/gnus-picon.el
 
 (autoload 'gnus-treat-from-picon "gnus-picon" "\
@@ -11451,7 +11606,7 @@
 ;;;;;;  gnus-sorted-nintersection gnus-sorted-range-intersection
 ;;;;;;  gnus-sorted-intersection gnus-intersection gnus-sorted-complement
 ;;;;;;  gnus-sorted-ndifference gnus-sorted-difference) "gnus-range"
-;;;;;;  "gnus/gnus-range.el" (19606 36461))
+;;;;;;  "gnus/gnus-range.el" (19604 65275))
 ;;; Generated autoloads from gnus/gnus-range.el
 
 (autoload 'gnus-sorted-difference "gnus-range" "\
@@ -11519,7 +11674,7 @@
 ;;;***
 
 ;;;### (autoloads (gnus-registry-install-hooks gnus-registry-initialize)
-;;;;;;  "gnus-registry" "gnus/gnus-registry.el" (19644 51090))
+;;;;;;  "gnus-registry" "gnus/gnus-registry.el" (19645 60484))
 ;;; Generated autoloads from gnus/gnus-registry.el
 
 (autoload 'gnus-registry-initialize "gnus-registry" "\
@@ -11535,8 +11690,8 @@
 ;;;***
 
 ;;;### (autoloads (gnus-sieve-article-add-rule gnus-sieve-generate
-;;;;;;  gnus-sieve-update) "gnus-sieve" "gnus/gnus-sieve.el" (19583
-;;;;;;  31640))
+;;;;;;  gnus-sieve-update) "gnus-sieve" "gnus/gnus-sieve.el" (19582
+;;;;;;  65302))
 ;;; Generated autoloads from gnus/gnus-sieve.el
 
 (autoload 'gnus-sieve-update "gnus-sieve" "\
@@ -11564,7 +11719,7 @@
 ;;;***
 
 ;;;### (autoloads (gnus-update-format) "gnus-spec" "gnus/gnus-spec.el"
-;;;;;;  (19638 15279))
+;;;;;;  (19638 16738))
 ;;; Generated autoloads from gnus/gnus-spec.el
 
 (autoload 'gnus-update-format "gnus-spec" "\
@@ -11575,7 +11730,7 @@
 ;;;***
 
 ;;;### (autoloads (gnus-declare-backend) "gnus-start" "gnus/gnus-start.el"
-;;;;;;  (19675 9114))
+;;;;;;  (19672 21006))
 ;;; Generated autoloads from gnus/gnus-start.el
 
 (autoload 'gnus-declare-backend "gnus-start" "\
@@ -11586,7 +11741,7 @@
 ;;;***
 
 ;;;### (autoloads (gnus-summary-bookmark-jump) "gnus-sum" "gnus/gnus-sum.el"
-;;;;;;  (19682 26290))
+;;;;;;  (19695 9549))
 ;;; Generated autoloads from gnus/gnus-sum.el
 
 (autoload 'gnus-summary-bookmark-jump "gnus-sum" "\
@@ -11598,7 +11753,7 @@
 ;;;***
 
 ;;;### (autoloads (gnus-sync-install-hooks gnus-sync-initialize)
-;;;;;;  "gnus-sync" "gnus/gnus-sync.el" (19629 41197))
+;;;;;;  "gnus-sync" "gnus/gnus-sync.el" (19630 1041))
 ;;; Generated autoloads from gnus/gnus-sync.el
 
 (autoload 'gnus-sync-initialize "gnus-sync" "\
@@ -11614,7 +11769,7 @@
 ;;;***
 
 ;;;### (autoloads (gnus-add-configuration) "gnus-win" "gnus/gnus-win.el"
-;;;;;;  (19626 28928))
+;;;;;;  (19626 25721))
 ;;; Generated autoloads from gnus/gnus-win.el
 
 (autoload 'gnus-add-configuration "gnus-win" "\
@@ -11624,7 +11779,7 @@
 
 ;;;***
 
-;;;### (autoloads (gomoku) "gomoku" "play/gomoku.el" (19677 58077))
+;;;### (autoloads (gomoku) "gomoku" "play/gomoku.el" (19675 8283))
 ;;; Generated autoloads from play/gomoku.el
 
 (autoload 'gomoku "gomoku" "\
@@ -11651,8 +11806,8 @@
 ;;;***
 
 ;;;### (autoloads (goto-address-prog-mode goto-address-mode goto-address
-;;;;;;  goto-address-at-point) "goto-addr" "net/goto-addr.el" (19379
-;;;;;;  23432))
+;;;;;;  goto-address-at-point) "goto-addr" "net/goto-addr.el" (19360
+;;;;;;  14173))
 ;;; Generated autoloads from net/goto-addr.el
 
 (define-obsolete-function-alias 'goto-address-at-mouse 'goto-address-at-point "22.1")
@@ -11691,7 +11846,7 @@
 ;;;***
 
 ;;;### (autoloads (gravatar-retrieve) "gravatar" "gnus/gravatar.el"
-;;;;;;  (19626 28928))
+;;;;;;  (19626 25721))
 ;;; Generated autoloads from gnus/gravatar.el
 
 (autoload 'gravatar-retrieve "gravatar" "\
@@ -11704,7 +11859,7 @@
 
 ;;;### (autoloads (zrgrep rgrep lgrep grep-find grep grep-mode grep-compute-defaults
 ;;;;;;  grep-process-setup grep-setup-hook grep-find-command grep-command
-;;;;;;  grep-window-height) "grep" "progmodes/grep.el" (19686 22639))
+;;;;;;  grep-window-height) "grep" "progmodes/grep.el" (19687 6902))
 ;;; Generated autoloads from progmodes/grep.el
 
 (defvar grep-window-height nil "\
@@ -11860,7 +12015,7 @@
 
 ;;;***
 
-;;;### (autoloads (gs-load-image) "gs" "gs.el" (19379 23432))
+;;;### (autoloads (gs-load-image) "gs" "gs.el" (19277 34916))
 ;;; Generated autoloads from gs.el
 
 (autoload 'gs-load-image "gs" "\
@@ -11874,7 +12029,7 @@
 ;;;***
 
 ;;;### (autoloads (gud-tooltip-mode gdb-script-mode jdb pdb perldb
-;;;;;;  xdb dbx sdb gud-gdb) "gud" "progmodes/gud.el" (19612 6522))
+;;;;;;  xdb dbx sdb gud-gdb) "gud" "progmodes/gud.el" (19611 36621))
 ;;; Generated autoloads from progmodes/gud.el
 
 (autoload 'gud-gdb "gud" "\
@@ -11960,8 +12115,8 @@
 
 ;;;***
 
-;;;### (autoloads (handwrite) "handwrite" "play/handwrite.el" (19379
-;;;;;;  23432))
+;;;### (autoloads (handwrite) "handwrite" "play/handwrite.el" (19277
+;;;;;;  34922))
 ;;; Generated autoloads from play/handwrite.el
 
 (autoload 'handwrite "handwrite" "\
@@ -11979,7 +12134,7 @@
 ;;;***
 
 ;;;### (autoloads (hanoi-unix-64 hanoi-unix hanoi) "hanoi" "play/hanoi.el"
-;;;;;;  (19379 23432))
+;;;;;;  (19267 61658))
 ;;; Generated autoloads from play/hanoi.el
 
 (autoload 'hanoi "hanoi" "\
@@ -12008,7 +12163,7 @@
 
 ;;;### (autoloads (mail-check-payment mail-add-payment-async mail-add-payment
 ;;;;;;  hashcash-verify-payment hashcash-insert-payment-async hashcash-insert-payment)
-;;;;;;  "hashcash" "mail/hashcash.el" (19635 41857))
+;;;;;;  "hashcash" "mail/hashcash.el" (19635 50568))
 ;;; Generated autoloads from mail/hashcash.el
 
 (autoload 'hashcash-insert-payment "hashcash" "\
@@ -12053,7 +12208,7 @@
 ;;;### (autoloads (scan-buf-previous-region scan-buf-next-region
 ;;;;;;  scan-buf-move-to-region help-at-pt-display-when-idle help-at-pt-set-timer
 ;;;;;;  help-at-pt-cancel-timer display-local-help help-at-pt-kbd-string
-;;;;;;  help-at-pt-string) "help-at-pt" "help-at-pt.el" (19379 23432))
+;;;;;;  help-at-pt-string) "help-at-pt" "help-at-pt.el" (19277 34916))
 ;;; Generated autoloads from help-at-pt.el
 
 (autoload 'help-at-pt-string "help-at-pt" "\
@@ -12183,7 +12338,7 @@
 ;;;### (autoloads (doc-file-to-info doc-file-to-man describe-categories
 ;;;;;;  describe-syntax describe-variable variable-at-point describe-function-1
 ;;;;;;  find-lisp-object-file-name help-C-file-name describe-function)
-;;;;;;  "help-fns" "help-fns.el" (19651 9126))
+;;;;;;  "help-fns" "help-fns.el" (19649 15956))
 ;;; Generated autoloads from help-fns.el
 
 (autoload 'describe-function "help-fns" "\
@@ -12263,7 +12418,7 @@
 ;;;***
 
 ;;;### (autoloads (three-step-help) "help-macro" "help-macro.el"
-;;;;;;  (19578 56905))
+;;;;;;  (19580 19536))
 ;;; Generated autoloads from help-macro.el
 
 (defvar three-step-help nil "\
@@ -12279,8 +12434,8 @@
 
 ;;;### (autoloads (help-xref-on-pp help-insert-xref-button help-xref-button
 ;;;;;;  help-make-xrefs help-buffer help-setup-xref help-mode-finish
-;;;;;;  help-mode-setup help-mode) "help-mode" "help-mode.el" (19636
-;;;;;;  19378))
+;;;;;;  help-mode-setup help-mode) "help-mode" "help-mode.el" (19635
+;;;;;;  56796))
 ;;; Generated autoloads from help-mode.el
 
 (autoload 'help-mode "help-mode" "\
@@ -12372,7 +12527,7 @@
 ;;;***
 
 ;;;### (autoloads (Helper-help Helper-describe-bindings) "helper"
-;;;;;;  "emacs-lisp/helper.el" (19578 56905))
+;;;;;;  "emacs-lisp/helper.el" (19580 19536))
 ;;; Generated autoloads from emacs-lisp/helper.el
 
 (autoload 'Helper-describe-bindings "helper" "\
@@ -12388,7 +12543,7 @@
 ;;;***
 
 ;;;### (autoloads (hexlify-buffer hexl-find-file hexl-mode) "hexl"
-;;;;;;  "hexl.el" (19648 1980))
+;;;;;;  "hexl.el" (19648 31344))
 ;;; Generated autoloads from hexl.el
 
 (autoload 'hexl-mode "hexl" "\
@@ -12485,7 +12640,7 @@
 ;;;### (autoloads (hi-lock-write-interactive-patterns hi-lock-unface-buffer
 ;;;;;;  hi-lock-face-phrase-buffer hi-lock-face-buffer hi-lock-line-face-buffer
 ;;;;;;  global-hi-lock-mode hi-lock-mode) "hi-lock" "hi-lock.el"
-;;;;;;  (19635 38402))
+;;;;;;  (19635 50568))
 ;;; Generated autoloads from hi-lock.el
 
 (autoload 'hi-lock-mode "hi-lock" "\
@@ -12619,7 +12774,7 @@
 ;;;***
 
 ;;;### (autoloads (hide-ifdef-mode) "hideif" "progmodes/hideif.el"
-;;;;;;  (19669 58161))
+;;;;;;  (19668 19057))
 ;;; Generated autoloads from progmodes/hideif.el
 
 (autoload 'hide-ifdef-mode "hideif" "\
@@ -12659,7 +12814,7 @@
 ;;;***
 
 ;;;### (autoloads (turn-off-hideshow hs-minor-mode) "hideshow" "progmodes/hideshow.el"
-;;;;;;  (19379 23432))
+;;;;;;  (19277 34922))
 ;;; Generated autoloads from progmodes/hideshow.el
 
 (defvar hs-special-modes-alist (mapcar 'purecopy '((c-mode "{" "}" "/[*/]" nil nil) (c++-mode "{" "}" "/[*/]" nil nil) (bibtex-mode ("@\\S(*\\(\\s(\\)" 1)) (java-mode "{" "}" "/[*/]" nil nil) (js-mode "{" "}" "/[*/]" nil))) "\
@@ -12722,7 +12877,7 @@
 ;;;;;;  highlight-changes-previous-change highlight-changes-next-change
 ;;;;;;  highlight-changes-remove-highlight highlight-changes-visible-mode
 ;;;;;;  highlight-changes-mode) "hilit-chg" "hilit-chg.el" (19630
-;;;;;;  8477))
+;;;;;;  1041))
 ;;; Generated autoloads from hilit-chg.el
 
 (autoload 'highlight-changes-mode "hilit-chg" "\
@@ -12851,7 +13006,7 @@
 ;;;;;;  hippie-expand-ignore-buffers hippie-expand-max-buffers hippie-expand-no-restriction
 ;;;;;;  hippie-expand-dabbrev-as-symbol hippie-expand-dabbrev-skip-space
 ;;;;;;  hippie-expand-verbose hippie-expand-try-functions-list) "hippie-exp"
-;;;;;;  "hippie-exp.el" (19675 9114))
+;;;;;;  "hippie-exp.el" (19672 56753))
 ;;; Generated autoloads from hippie-exp.el
 
 (defvar hippie-expand-try-functions-list '(try-complete-file-name-partially try-complete-file-name try-expand-all-abbrevs try-expand-list try-expand-line try-expand-dabbrev try-expand-dabbrev-all-buffers try-expand-dabbrev-from-kill try-complete-lisp-symbol-partially try-complete-lisp-symbol) "\
@@ -12924,7 +13079,7 @@
 ;;;***
 
 ;;;### (autoloads (global-hl-line-mode hl-line-mode) "hl-line" "hl-line.el"
-;;;;;;  (19520 54552))
+;;;;;;  (19515 27412))
 ;;; Generated autoloads from hl-line.el
 
 (autoload 'hl-line-mode "hl-line" "\
@@ -12968,7 +13123,7 @@
 ;;;;;;  holiday-bahai-holidays holiday-islamic-holidays holiday-christian-holidays
 ;;;;;;  holiday-hebrew-holidays holiday-other-holidays holiday-local-holidays
 ;;;;;;  holiday-oriental-holidays holiday-general-holidays) "holidays"
-;;;;;;  "calendar/holidays.el" (19662 54456))
+;;;;;;  "calendar/holidays.el" (19662 28391))
 ;;; Generated autoloads from calendar/holidays.el
 
 (define-obsolete-variable-alias 'general-holidays 'holiday-general-holidays "23.1")
@@ -13116,8 +13271,8 @@
 
 ;;;***
 
-;;;### (autoloads (html2text) "html2text" "gnus/html2text.el" (19583
-;;;;;;  31640))
+;;;### (autoloads (html2text) "html2text" "gnus/html2text.el" (19582
+;;;;;;  65302))
 ;;; Generated autoloads from gnus/html2text.el
 
 (autoload 'html2text "html2text" "\
@@ -13128,7 +13283,7 @@
 ;;;***
 
 ;;;### (autoloads (htmlfontify-copy-and-link-dir htmlfontify-buffer)
-;;;;;;  "htmlfontify" "htmlfontify.el" (19630 57790))
+;;;;;;  "htmlfontify" "htmlfontify.el" (19631 26857))
 ;;; Generated autoloads from htmlfontify.el
 
 (autoload 'htmlfontify-buffer "htmlfontify" "\
@@ -13161,8 +13316,8 @@
 ;;;***
 
 ;;;### (autoloads (define-ibuffer-filter define-ibuffer-op define-ibuffer-sorter
-;;;;;;  define-ibuffer-column) "ibuf-macs" "ibuf-macs.el" (19578
-;;;;;;  56905))
+;;;;;;  define-ibuffer-column) "ibuf-macs" "ibuf-macs.el" (19580
+;;;;;;  19536))
 ;;; Generated autoloads from ibuf-macs.el
 
 (autoload 'define-ibuffer-column "ibuf-macs" "\
@@ -13259,7 +13414,7 @@
 ;;;***
 
 ;;;### (autoloads (ibuffer ibuffer-other-window ibuffer-list-buffers)
-;;;;;;  "ibuffer" "ibuffer.el" (19632 54888))
+;;;;;;  "ibuffer" "ibuffer.el" (19632 44567))
 ;;; Generated autoloads from ibuffer.el
 
 (autoload 'ibuffer-list-buffers "ibuffer" "\
@@ -13300,7 +13455,7 @@
 
 ;;;### (autoloads (icalendar-import-buffer icalendar-import-file
 ;;;;;;  icalendar-export-region icalendar-export-file) "icalendar"
-;;;;;;  "calendar/icalendar.el" (19578 56905))
+;;;;;;  "calendar/icalendar.el" (19580 19536))
 ;;; Generated autoloads from calendar/icalendar.el
 
 (autoload 'icalendar-export-file "icalendar" "\
@@ -13352,8 +13507,8 @@
 
 ;;;***
 
-;;;### (autoloads (icomplete-mode) "icomplete" "icomplete.el" (19407
-;;;;;;  29238))
+;;;### (autoloads (icomplete-mode) "icomplete" "icomplete.el" (19408
+;;;;;;  44404))
 ;;; Generated autoloads from icomplete.el
 
 (defvar icomplete-mode nil "\
@@ -13374,7 +13529,7 @@
 
 ;;;***
 
-;;;### (autoloads (icon-mode) "icon" "progmodes/icon.el" (19669 58161))
+;;;### (autoloads (icon-mode) "icon" "progmodes/icon.el" (19668 19042))
 ;;; Generated autoloads from progmodes/icon.el
 
 (autoload 'icon-mode "icon" "\
@@ -13415,7 +13570,7 @@
 ;;;***
 
 ;;;### (autoloads (idlwave-shell) "idlw-shell" "progmodes/idlw-shell.el"
-;;;;;;  (19677 58077))
+;;;;;;  (19675 14361))
 ;;; Generated autoloads from progmodes/idlw-shell.el
 
 (autoload 'idlwave-shell "idlw-shell" "\
@@ -13441,7 +13596,7 @@
 ;;;***
 
 ;;;### (autoloads (idlwave-mode) "idlwave" "progmodes/idlwave.el"
-;;;;;;  (19677 58077))
+;;;;;;  (19675 14373))
 ;;; Generated autoloads from progmodes/idlwave.el
 
 (autoload 'idlwave-mode "idlwave" "\
@@ -13575,8 +13730,8 @@
 ;;;;;;  ido-find-alternate-file ido-find-file-other-window ido-find-file
 ;;;;;;  ido-find-file-in-dir ido-switch-buffer-other-frame ido-insert-buffer
 ;;;;;;  ido-kill-buffer ido-display-buffer ido-switch-buffer-other-window
-;;;;;;  ido-switch-buffer ido-mode ido-mode) "ido" "ido.el" (19606
-;;;;;;  36461))
+;;;;;;  ido-switch-buffer ido-mode ido-mode) "ido" "ido.el" (19604
+;;;;;;  1959))
 ;;; Generated autoloads from ido.el
 
 (defvar ido-mode nil "\
@@ -13837,7 +13992,7 @@
 
 ;;;***
 
-;;;### (autoloads (ielm) "ielm" "ielm.el" (19379 23432))
+;;;### (autoloads (ielm) "ielm" "ielm.el" (19277 34916))
 ;;; Generated autoloads from ielm.el
  (add-hook 'same-window-buffer-names (purecopy "*ielm*"))
 
@@ -13849,7 +14004,7 @@
 
 ;;;***
 
-;;;### (autoloads (iimage-mode) "iimage" "iimage.el" (19629 41197))
+;;;### (autoloads (iimage-mode) "iimage" "iimage.el" (19629 13333))
 ;;; Generated autoloads from iimage.el
 
 (define-obsolete-function-alias 'turn-on-iimage-mode 'iimage-mode "24.1")
@@ -13861,6 +14016,210 @@
 
 ;;;***
 
+;;;### (autoloads (imagemagick-register-types create-animated-image
+;;;;;;  defimage find-image remove-images insert-sliced-image insert-image
+;;;;;;  put-image create-image image-type-auto-detected-p image-type-available-p
+;;;;;;  image-type image-type-from-file-name image-type-from-file-header
+;;;;;;  image-type-from-buffer image-type-from-data) "image" "image.el"
+;;;;;;  (19652 54251))
+;;; Generated autoloads from image.el
+
+(autoload 'image-type-from-data "image" "\
+Determine the image type from image data DATA.
+Value is a symbol specifying the image type or nil if type cannot
+be determined.
+
+\(fn DATA)" nil nil)
+
+(autoload 'image-type-from-buffer "image" "\
+Determine the image type from data in the current buffer.
+Value is a symbol specifying the image type or nil if type cannot
+be determined.
+
+\(fn)" nil nil)
+
+(autoload 'image-type-from-file-header "image" "\
+Determine the type of image file FILE from its first few bytes.
+Value is a symbol specifying the image type, or nil if type cannot
+be determined.
+
+\(fn FILE)" nil nil)
+
+(autoload 'image-type-from-file-name "image" "\
+Determine the type of image file FILE from its name.
+Value is a symbol specifying the image type, or nil if type cannot
+be determined.
+
+\(fn FILE)" nil nil)
+
+(autoload 'image-type "image" "\
+Determine and return image type.
+SOURCE is an image file name or image data.
+Optional TYPE is a symbol describing the image type.  If TYPE is omitted
+or nil, try to determine the image type from its first few bytes
+of image data.  If that doesn't work, and SOURCE is a file name,
+use its file extension as image type.
+Optional DATA-P non-nil means SOURCE is a string containing image data.
+
+\(fn SOURCE &optional TYPE DATA-P)" nil nil)
+
+(autoload 'image-type-available-p "image" "\
+Return non-nil if image type TYPE is available.
+Image types are symbols like `xbm' or `jpeg'.
+
+\(fn TYPE)" nil nil)
+
+(autoload 'image-type-auto-detected-p "image" "\
+Return t if the current buffer contains an auto-detectable image.
+This function is intended to be used from `magic-fallback-mode-alist'.
+
+The buffer is considered to contain an auto-detectable image if
+its beginning matches an image type in `image-type-header-regexps',
+and that image type is present in `image-type-auto-detectable' with a
+non-nil value.  If that value is non-nil, but not t, then the image type
+must be available.
+
+\(fn)" nil nil)
+
+(autoload 'create-image "image" "\
+Create an image.
+FILE-OR-DATA is an image file name or image data.
+Optional TYPE is a symbol describing the image type.  If TYPE is omitted
+or nil, try to determine the image type from its first few bytes
+of image data.  If that doesn't work, and FILE-OR-DATA is a file name,
+use its file extension as image type.
+Optional DATA-P non-nil means FILE-OR-DATA is a string containing image data.
+Optional PROPS are additional image attributes to assign to the image,
+like, e.g. `:mask MASK'.
+Value is the image created, or nil if images of type TYPE are not supported.
+
+Images should not be larger than specified by `max-image-size'.
+
+Image file names that are not absolute are searched for in the
+\"images\" sub-directory of `data-directory' and
+`x-bitmap-file-path' (in that order).
+
+\(fn FILE-OR-DATA &optional TYPE DATA-P &rest PROPS)" nil nil)
+
+(autoload 'put-image "image" "\
+Put image IMAGE in front of POS in the current buffer.
+IMAGE must be an image created with `create-image' or `defimage'.
+IMAGE is displayed by putting an overlay into the current buffer with a
+`before-string' STRING that has a `display' property whose value is the
+image.  STRING is defaulted if you omit it.
+POS may be an integer or marker.
+AREA is where to display the image.  AREA nil or omitted means
+display it in the text area, a value of `left-margin' means
+display it in the left marginal area, a value of `right-margin'
+means display it in the right marginal area.
+
+\(fn IMAGE POS &optional STRING AREA)" nil nil)
+
+(autoload 'insert-image "image" "\
+Insert IMAGE into current buffer at point.
+IMAGE is displayed by inserting STRING into the current buffer
+with a `display' property whose value is the image.  STRING is
+defaulted if you omit it.
+AREA is where to display the image.  AREA nil or omitted means
+display it in the text area, a value of `left-margin' means
+display it in the left marginal area, a value of `right-margin'
+means display it in the right marginal area.
+SLICE specifies slice of IMAGE to insert.  SLICE nil or omitted
+means insert whole image.  SLICE is a list (X Y WIDTH HEIGHT)
+specifying the X and Y positions and WIDTH and HEIGHT of image area
+to insert.  A float value 0.0 - 1.0 means relative to the width or
+height of the image; integer values are taken as pixel values.
+
+\(fn IMAGE &optional STRING AREA SLICE)" nil nil)
+
+(autoload 'insert-sliced-image "image" "\
+Insert IMAGE into current buffer at point.
+IMAGE is displayed by inserting STRING into the current buffer
+with a `display' property whose value is the image.  STRING is
+defaulted if you omit it.
+AREA is where to display the image.  AREA nil or omitted means
+display it in the text area, a value of `left-margin' means
+display it in the left marginal area, a value of `right-margin'
+means display it in the right marginal area.
+The image is automatically split into ROWS x COLS slices.
+
+\(fn IMAGE &optional STRING AREA ROWS COLS)" nil nil)
+
+(autoload 'remove-images "image" "\
+Remove images between START and END in BUFFER.
+Remove only images that were put in BUFFER with calls to `put-image'.
+BUFFER nil or omitted means use the current buffer.
+
+\(fn START END &optional BUFFER)" nil nil)
+
+(autoload 'find-image "image" "\
+Find an image, choosing one of a list of image specifications.
+
+SPECS is a list of image specifications.
+
+Each image specification in SPECS is a property list.  The contents of
+a specification are image type dependent.  All specifications must at
+least contain the properties `:type TYPE' and either `:file FILE' or
+`:data DATA', where TYPE is a symbol specifying the image type,
+e.g. `xbm', FILE is the file to load the image from, and DATA is a
+string containing the actual image data.  The specification whose TYPE
+is supported, and FILE exists, is used to construct the image
+specification to be returned.  Return nil if no specification is
+satisfied.
+
+The image is looked for in `image-load-path'.
+
+Image files should not be larger than specified by `max-image-size'.
+
+\(fn SPECS)" nil nil)
+
+(autoload 'defimage "image" "\
+Define SYMBOL as an image.
+
+SPECS is a list of image specifications.  DOC is an optional
+documentation string.
+
+Each image specification in SPECS is a property list.  The contents of
+a specification are image type dependent.  All specifications must at
+least contain the properties `:type TYPE' and either `:file FILE' or
+`:data DATA', where TYPE is a symbol specifying the image type,
+e.g. `xbm', FILE is the file to load the image from, and DATA is a
+string containing the actual image data.  The first image
+specification whose TYPE is supported, and FILE exists, is used to
+define SYMBOL.
+
+Example:
+
+   (defimage test-image ((:type xpm :file \"~/test1.xpm\")
+                         (:type xbm :file \"~/test1.xbm\")))
+
+\(fn SYMBOL SPECS &optional DOC)" nil (quote macro))
+
+(put 'defimage 'doc-string-elt '3)
+
+(autoload 'create-animated-image "image" "\
+Create an animated image.
+FILE-OR-DATA is an image file name or image data.
+Optional TYPE is a symbol describing the image type.  If TYPE is omitted
+or nil, try to determine the image type from its first few bytes
+of image data.  If that doesn't work, and FILE-OR-DATA is a file name,
+use its file extension as image type.
+Optional DATA-P non-nil means FILE-OR-DATA is a string containing image data.
+Optional PROPS are additional image attributes to assign to the image,
+like, e.g. `:mask MASK'.
+Value is the image created, or nil if images of type TYPE are not supported.
+
+Images should not be larger than specified by `max-image-size'.
+
+\(fn FILE-OR-DATA &optional TYPE DATA-P &rest PROPS)" nil nil)
+
+(autoload 'imagemagick-register-types "image" "\
+Register the file types that ImageMagick is able to handle.
+
+\(fn)" nil nil)
+
+;;;***
+
 ;;;### (autoloads (image-dired-dired-edit-comment-and-tags image-dired-mark-tagged-files
 ;;;;;;  image-dired-dired-comment-files image-dired-dired-display-image
 ;;;;;;  image-dired-dired-display-external image-dired-display-thumb
@@ -13868,7 +14227,7 @@
 ;;;;;;  image-dired-jump-thumbnail-buffer image-dired-delete-tag
 ;;;;;;  image-dired-tag-files image-dired-show-all-from-dir image-dired-display-thumbs
 ;;;;;;  image-dired-dired-with-window-configuration image-dired-dired-toggle-marked-thumbs)
-;;;;;;  "image-dired" "image-dired.el" (19456 17095))
+;;;;;;  "image-dired" "image-dired.el" (19457 25386))
 ;;; Generated autoloads from image-dired.el
 
 (autoload 'image-dired-dired-toggle-marked-thumbs "image-dired" "\
@@ -14006,7 +14365,7 @@
 
 ;;;### (autoloads (auto-image-file-mode insert-image-file image-file-name-regexp
 ;;;;;;  image-file-name-regexps image-file-name-extensions) "image-file"
-;;;;;;  "image-file.el" (19379 23432))
+;;;;;;  "image-file.el" (19277 34916))
 ;;; Generated autoloads from image-file.el
 
 (defvar image-file-name-extensions (purecopy '("png" "jpeg" "jpg" "gif" "tiff" "tif" "xbm" "xpm" "pbm" "pgm" "ppm" "pnm" "svg")) "\
@@ -14068,7 +14427,7 @@
 ;;;***
 
 ;;;### (autoloads (image-bookmark-jump image-mode-as-text image-minor-mode
-;;;;;;  image-mode) "image-mode" "image-mode.el" (19612 6522))
+;;;;;;  image-mode) "image-mode" "image-mode.el" (19611 35948))
 ;;; Generated autoloads from image-mode.el
 
 (autoload 'image-mode "image-mode" "\
@@ -14109,7 +14468,7 @@
 ;;;***
 
 ;;;### (autoloads (imenu imenu-add-menubar-index imenu-add-to-menubar
-;;;;;;  imenu-sort-function) "imenu" "imenu.el" (19612 6522))
+;;;;;;  imenu-sort-function) "imenu" "imenu.el" (19611 60767))
 ;;; Generated autoloads from imenu.el
 
 (defvar imenu-sort-function nil "\
@@ -14226,7 +14585,7 @@
 
 ;;;### (autoloads (indian-2-column-to-ucs-region in-is13194-pre-write-conversion
 ;;;;;;  in-is13194-post-read-conversion indian-compose-string indian-compose-region)
-;;;;;;  "ind-util" "language/ind-util.el" (19379 23432))
+;;;;;;  "ind-util" "language/ind-util.el" (19277 34920))
 ;;; Generated autoloads from language/ind-util.el
 
 (autoload 'indian-compose-region "ind-util" "\
@@ -14258,7 +14617,7 @@
 
 ;;;### (autoloads (inferior-lisp inferior-lisp-prompt inferior-lisp-load-command
 ;;;;;;  inferior-lisp-program inferior-lisp-filter-regexp) "inf-lisp"
-;;;;;;  "progmodes/inf-lisp.el" (19634 57717))
+;;;;;;  "progmodes/inf-lisp.el" (19634 23255))
 ;;; Generated autoloads from progmodes/inf-lisp.el
 
 (defvar inferior-lisp-filter-regexp (purecopy "\\`\\s *\\(:\\(\\w\\|\\s_\\)\\)?\\s *\\'") "\
@@ -14326,7 +14685,7 @@
 ;;;;;;  Info-goto-emacs-command-node Info-mode info-finder info-apropos
 ;;;;;;  Info-index Info-directory Info-on-current-buffer info-standalone
 ;;;;;;  info-emacs-manual info info-other-window) "info" "info.el"
-;;;;;;  (19675 9114))
+;;;;;;  (19688 19082))
 ;;; Generated autoloads from info.el
 
 (autoload 'info-other-window "info" "\
@@ -14508,7 +14867,7 @@
 
 ;;;### (autoloads (info-complete-file info-complete-symbol info-lookup-file
 ;;;;;;  info-lookup-symbol info-lookup-reset) "info-look" "info-look.el"
-;;;;;;  (19379 23432))
+;;;;;;  (19277 34916))
 ;;; Generated autoloads from info-look.el
 
 (autoload 'info-lookup-reset "info-look" "\
@@ -14556,7 +14915,7 @@
 ;;;***
 
 ;;;### (autoloads (info-xref-check-all-custom info-xref-check-all
-;;;;;;  info-xref-check) "info-xref" "info-xref.el" (19379 23432))
+;;;;;;  info-xref-check) "info-xref" "info-xref.el" (19277 34916))
 ;;; Generated autoloads from info-xref.el
 
 (autoload 'info-xref-check "info-xref" "\
@@ -14583,7 +14942,7 @@
 ;;;***
 
 ;;;### (autoloads (batch-info-validate Info-validate Info-split Info-split-threshold
-;;;;;;  Info-tagify) "informat" "informat.el" (19379 23432))
+;;;;;;  Info-tagify) "informat" "informat.el" (19277 34916))
 ;;; Generated autoloads from informat.el
 
 (autoload 'Info-tagify "informat" "\
@@ -14630,7 +14989,7 @@
 
 ;;;### (autoloads (isearch-process-search-multibyte-characters isearch-toggle-input-method
 ;;;;;;  isearch-toggle-specified-input-method) "isearch-x" "international/isearch-x.el"
-;;;;;;  (19379 23432))
+;;;;;;  (19277 34920))
 ;;; Generated autoloads from international/isearch-x.el
 
 (autoload 'isearch-toggle-specified-input-method "isearch-x" "\
@@ -14650,8 +15009,8 @@
 
 ;;;***
 
-;;;### (autoloads (isearchb-activate) "isearchb" "isearchb.el" (19379
-;;;;;;  23432))
+;;;### (autoloads (isearchb-activate) "isearchb" "isearchb.el" (19277
+;;;;;;  34916))
 ;;; Generated autoloads from isearchb.el
 
 (autoload 'isearchb-activate "isearchb" "\
@@ -14667,7 +15026,7 @@
 ;;;### (autoloads (iso-cvt-define-menu iso-cvt-write-only iso-cvt-read-only
 ;;;;;;  iso-sgml2iso iso-iso2sgml iso-iso2duden iso-iso2gtex iso-gtex2iso
 ;;;;;;  iso-tex2iso iso-iso2tex iso-german iso-spanish) "iso-cvt"
-;;;;;;  "international/iso-cvt.el" (19379 23432))
+;;;;;;  "international/iso-cvt.el" (19277 34920))
 ;;; Generated autoloads from international/iso-cvt.el
 
 (autoload 'iso-spanish "iso-cvt" "\
@@ -14758,7 +15117,7 @@
 ;;;***
 
 ;;;### (autoloads nil "iso-transl" "international/iso-transl.el"
-;;;;;;  (19379 23432))
+;;;;;;  (19277 34920))
 ;;; Generated autoloads from international/iso-transl.el
  (or key-translation-map (setq key-translation-map (make-sparse-keymap)))
  (define-key key-translation-map "\C-x8" 'iso-transl-ctl-x-8-map)
@@ -14770,7 +15129,7 @@
 ;;;;;;  ispell-complete-word ispell-continue ispell-buffer ispell-comments-and-strings
 ;;;;;;  ispell-region ispell-change-dictionary ispell-kill-ispell
 ;;;;;;  ispell-help ispell-pdict-save ispell-word ispell-personal-dictionary)
-;;;;;;  "ispell" "textmodes/ispell.el" (19675 9114))
+;;;;;;  "ispell" "textmodes/ispell.el" (19672 56753))
 ;;; Generated autoloads from textmodes/ispell.el
 
 (put 'ispell-check-comments 'safe-local-variable (lambda (a) (memq a '(nil t exclusive))))
@@ -14990,8 +15349,8 @@
 
 ;;;***
 
-;;;### (autoloads (iswitchb-mode) "iswitchb" "iswitchb.el" (19657
-;;;;;;  35339))
+;;;### (autoloads (iswitchb-mode) "iswitchb" "iswitchb.el" (19656
+;;;;;;  61992))
 ;;; Generated autoloads from iswitchb.el
 
 (defvar iswitchb-mode nil "\
@@ -15016,7 +15375,7 @@
 ;;;### (autoloads (read-hiragana-string japanese-zenkaku-region japanese-hankaku-region
 ;;;;;;  japanese-hiragana-region japanese-katakana-region japanese-zenkaku
 ;;;;;;  japanese-hankaku japanese-hiragana japanese-katakana setup-japanese-environment-internal)
-;;;;;;  "japan-util" "language/japan-util.el" (19379 23432))
+;;;;;;  "japan-util" "language/japan-util.el" (19277 34920))
 ;;; Generated autoloads from language/japan-util.el
 
 (autoload 'setup-japanese-environment-internal "japan-util" "\
@@ -15094,7 +15453,7 @@
 ;;;***
 
 ;;;### (autoloads (jka-compr-uninstall jka-compr-handler) "jka-compr"
-;;;;;;  "jka-compr.el" (19455 29789))
+;;;;;;  "jka-compr.el" (19455 3103))
 ;;; Generated autoloads from jka-compr.el
 
 (defvar jka-compr-inhibit nil "\
@@ -15117,7 +15476,7 @@
 
 ;;;***
 
-;;;### (autoloads (js-mode) "js" "progmodes/js.el" (19671 21337))
+;;;### (autoloads (js-mode) "js" "progmodes/js.el" (19670 666))
 ;;; Generated autoloads from progmodes/js.el
 
 (autoload 'js-mode "js" "\
@@ -15135,7 +15494,7 @@
 
 ;;;### (autoloads (keypad-setup keypad-numlock-shifted-setup keypad-shifted-setup
 ;;;;;;  keypad-numlock-setup keypad-setup) "keypad" "emulation/keypad.el"
-;;;;;;  (19379 23432))
+;;;;;;  (19277 34919))
 ;;; Generated autoloads from emulation/keypad.el
 
 (defvar keypad-setup nil "\
@@ -15191,7 +15550,7 @@
 ;;;***
 
 ;;;### (autoloads (kinsoku) "kinsoku" "international/kinsoku.el"
-;;;;;;  (19379 23432))
+;;;;;;  (19277 34920))
 ;;; Generated autoloads from international/kinsoku.el
 
 (autoload 'kinsoku "kinsoku" "\
@@ -15212,8 +15571,8 @@
 
 ;;;***
 
-;;;### (autoloads (kkc-region) "kkc" "international/kkc.el" (19611
-;;;;;;  13362))
+;;;### (autoloads (kkc-region) "kkc" "international/kkc.el" (19609
+;;;;;;  2343))
 ;;; Generated autoloads from international/kkc.el
 
 (defvar kkc-after-update-conversion-functions nil "\
@@ -15238,7 +15597,7 @@
 ;;;### (autoloads (kmacro-end-call-mouse kmacro-end-and-call-macro
 ;;;;;;  kmacro-end-or-call-macro kmacro-start-macro-or-insert-counter
 ;;;;;;  kmacro-call-macro kmacro-end-macro kmacro-start-macro kmacro-exec-ring-item)
-;;;;;;  "kmacro" "kmacro.el" (19492 29282))
+;;;;;;  "kmacro" "kmacro.el" (19498 12592))
 ;;; Generated autoloads from kmacro.el
  (global-set-key "\C-x(" 'kmacro-start-macro)
  (global-set-key "\C-x)" 'kmacro-end-macro)
@@ -15349,7 +15708,7 @@
 ;;;***
 
 ;;;### (autoloads (setup-korean-environment-internal) "korea-util"
-;;;;;;  "language/korea-util.el" (19379 23432))
+;;;;;;  "language/korea-util.el" (19277 34920))
 ;;; Generated autoloads from language/korea-util.el
 
 (defvar default-korean-keyboard (purecopy (if (string-match "3" (or (getenv "HANGUL_KEYBOARD_TYPE") "")) "3" "")) "\
@@ -15364,7 +15723,7 @@
 ;;;***
 
 ;;;### (autoloads (lm lm-test-run) "landmark" "play/landmark.el"
-;;;;;;  (19677 58077))
+;;;;;;  (19675 8295))
 ;;; Generated autoloads from play/landmark.el
 
 (defalias 'landmark-repeat 'lm-test-run)
@@ -15398,7 +15757,7 @@
 
 ;;;### (autoloads (lao-compose-region lao-composition-function lao-transcribe-roman-to-lao-string
 ;;;;;;  lao-transcribe-single-roman-syllable-to-lao lao-compose-string)
-;;;;;;  "lao-util" "language/lao-util.el" (19379 23432))
+;;;;;;  "lao-util" "language/lao-util.el" (19277 34920))
 ;;; Generated autoloads from language/lao-util.el
 
 (autoload 'lao-compose-string "lao-util" "\
@@ -15437,7 +15796,7 @@
 
 ;;;### (autoloads (latexenc-find-file-coding-system latexenc-coding-system-to-inputenc
 ;;;;;;  latexenc-inputenc-to-coding-system latex-inputenc-coding-alist)
-;;;;;;  "latexenc" "international/latexenc.el" (19379 23432))
+;;;;;;  "latexenc" "international/latexenc.el" (19277 34920))
 ;;; Generated autoloads from international/latexenc.el
 
 (defvar latex-inputenc-coding-alist (purecopy '(("ansinew" . windows-1252) ("applemac" . mac-roman) ("ascii" . us-ascii) ("cp1250" . windows-1250) ("cp1252" . windows-1252) ("cp1257" . cp1257) ("cp437de" . cp437) ("cp437" . cp437) ("cp850" . cp850) ("cp852" . cp852) ("cp858" . cp858) ("cp865" . cp865) ("latin1" . iso-8859-1) ("latin2" . iso-8859-2) ("latin3" . iso-8859-3) ("latin4" . iso-8859-4) ("latin5" . iso-8859-5) ("latin9" . iso-8859-15) ("next" . next) ("utf8" . utf-8) ("utf8x" . utf-8))) "\
@@ -15469,7 +15828,7 @@
 ;;;***
 
 ;;;### (autoloads (latin1-display-ucs-per-lynx latin1-display latin1-display)
-;;;;;;  "latin1-disp" "international/latin1-disp.el" (19379 23432))
+;;;;;;  "latin1-disp" "international/latin1-disp.el" (19277 34920))
 ;;; Generated autoloads from international/latin1-disp.el
 
 (defvar latin1-display nil "\
@@ -15511,7 +15870,7 @@
 ;;;***
 
 ;;;### (autoloads (ld-script-mode) "ld-script" "progmodes/ld-script.el"
-;;;;;;  (19611 13362))
+;;;;;;  (19611 1232))
 ;;; Generated autoloads from progmodes/ld-script.el
 
 (autoload 'ld-script-mode "ld-script" "\
@@ -15522,7 +15881,7 @@
 ;;;***
 
 ;;;### (autoloads (ledit-from-lisp-mode ledit-mode) "ledit" "ledit.el"
-;;;;;;  (19379 23432))
+;;;;;;  (19277 34916))
 ;;; Generated autoloads from ledit.el
 
 (defconst ledit-save-files t "\
@@ -15557,7 +15916,7 @@
 
 ;;;***
 
-;;;### (autoloads (life) "life" "play/life.el" (19669 58161))
+;;;### (autoloads (life) "life" "play/life.el" (19668 18627))
 ;;; Generated autoloads from play/life.el
 
 (autoload 'life "life" "\
@@ -15571,7 +15930,7 @@
 ;;;***
 
 ;;;### (autoloads (global-linum-mode linum-mode linum-format) "linum"
-;;;;;;  "linum.el" (19578 56905))
+;;;;;;  "linum.el" (19580 19536))
 ;;; Generated autoloads from linum.el
 
 (defvar linum-format 'dynamic "\
@@ -15609,8 +15968,8 @@
 
 ;;;***
 
-;;;### (autoloads (unload-feature) "loadhist" "loadhist.el" (19379
-;;;;;;  23432))
+;;;### (autoloads (unload-feature) "loadhist" "loadhist.el" (19277
+;;;;;;  34916))
 ;;; Generated autoloads from loadhist.el
 
 (autoload 'unload-feature "loadhist" "\
@@ -15642,7 +16001,7 @@
 ;;;***
 
 ;;;### (autoloads (locate-with-filter locate locate-ls-subdir-switches)
-;;;;;;  "locate" "locate.el" (19675 9114))
+;;;;;;  "locate" "locate.el" (19673 45510))
 ;;; Generated autoloads from locate.el
 
 (defvar locate-ls-subdir-switches (purecopy "-al") "\
@@ -15694,7 +16053,7 @@
 
 ;;;***
 
-;;;### (autoloads (log-edit) "log-edit" "vc/log-edit.el" (19657 41085))
+;;;### (autoloads (log-edit) "log-edit" "vc/log-edit.el" (19657 48297))
 ;;; Generated autoloads from vc/log-edit.el
 
 (autoload 'log-edit "log-edit" "\
@@ -15721,8 +16080,8 @@
 
 ;;;***
 
-;;;### (autoloads (log-view-mode) "log-view" "vc/log-view.el" (19633
-;;;;;;  49761))
+;;;### (autoloads (log-view-mode) "log-view" "vc/log-view.el" (19634
+;;;;;;  14572))
 ;;; Generated autoloads from vc/log-view.el
 
 (autoload 'log-view-mode "log-view" "\
@@ -15732,8 +16091,8 @@
 
 ;;;***
 
-;;;### (autoloads (longlines-mode) "longlines" "longlines.el" (19379
-;;;;;;  23432))
+;;;### (autoloads (longlines-mode) "longlines" "longlines.el" (19277
+;;;;;;  34916))
 ;;; Generated autoloads from longlines.el
 
 (autoload 'longlines-mode "longlines" "\
@@ -15755,7 +16114,7 @@
 
 ;;;### (autoloads (print-region lpr-region print-buffer lpr-buffer
 ;;;;;;  lpr-command lpr-switches printer-name) "lpr" "lpr.el" (19451
-;;;;;;  41962))
+;;;;;;  17238))
 ;;; Generated autoloads from lpr.el
 
 (defvar lpr-windows-system (memq system-type '(ms-dos windows-nt)))
@@ -15848,8 +16207,20 @@
 
 ;;;***
 
-;;;### (autoloads (lunar-phases) "lunar" "calendar/lunar.el" (19578
-;;;;;;  56905))
+;;;### (autoloads (ls-lisp-support-shell-wildcards) "ls-lisp" "ls-lisp.el"
+;;;;;;  (19687 6902))
+;;; Generated autoloads from ls-lisp.el
+
+(defvar ls-lisp-support-shell-wildcards t "\
+Non-nil means ls-lisp treats file patterns as shell wildcards.
+Otherwise they are treated as Emacs regexps (for backward compatibility).")
+
+(custom-autoload 'ls-lisp-support-shell-wildcards "ls-lisp" t)
+
+;;;***
+
+;;;### (autoloads (lunar-phases) "lunar" "calendar/lunar.el" (19580
+;;;;;;  19536))
 ;;; Generated autoloads from calendar/lunar.el
 
 (autoload 'lunar-phases "lunar" "\
@@ -15863,8 +16234,8 @@
 
 ;;;***
 
-;;;### (autoloads (m4-mode) "m4-mode" "progmodes/m4-mode.el" (19379
-;;;;;;  23432))
+;;;### (autoloads (m4-mode) "m4-mode" "progmodes/m4-mode.el" (19277
+;;;;;;  34922))
 ;;; Generated autoloads from progmodes/m4-mode.el
 
 (autoload 'm4-mode "m4-mode" "\
@@ -15876,7 +16247,7 @@
 ;;;***
 
 ;;;### (autoloads (macroexpand-all) "macroexp" "emacs-lisp/macroexp.el"
-;;;;;;  (19577 43088))
+;;;;;;  (19580 19536))
 ;;; Generated autoloads from emacs-lisp/macroexp.el
 
 (autoload 'macroexpand-all "macroexp" "\
@@ -15890,7 +16261,7 @@
 ;;;***
 
 ;;;### (autoloads (apply-macro-to-region-lines kbd-macro-query insert-kbd-macro
-;;;;;;  name-last-kbd-macro) "macros" "macros.el" (19578 56905))
+;;;;;;  name-last-kbd-macro) "macros" "macros.el" (19580 19536))
 ;;; Generated autoloads from macros.el
 
 (autoload 'name-last-kbd-macro "macros" "\
@@ -15979,7 +16350,7 @@
 ;;;***
 
 ;;;### (autoloads (what-domain mail-extract-address-components) "mail-extr"
-;;;;;;  "mail/mail-extr.el" (19669 58161))
+;;;;;;  "mail/mail-extr.el" (19668 31646))
 ;;; Generated autoloads from mail/mail-extr.el
 
 (autoload 'mail-extract-address-components "mail-extr" "\
@@ -16011,7 +16382,7 @@
 
 ;;;### (autoloads (mail-hist-put-headers-into-history mail-hist-keep-history
 ;;;;;;  mail-hist-enable mail-hist-define-keys) "mail-hist" "mail/mail-hist.el"
-;;;;;;  (19578 56905))
+;;;;;;  (19580 19536))
 ;;; Generated autoloads from mail/mail-hist.el
 
 (autoload 'mail-hist-define-keys "mail-hist" "\
@@ -16043,7 +16414,7 @@
 ;;;### (autoloads (mail-fetch-field mail-unquote-printable-region
 ;;;;;;  mail-unquote-printable mail-quote-printable-region mail-quote-printable
 ;;;;;;  mail-file-babyl-p mail-use-rfc822) "mail-utils" "mail/mail-utils.el"
-;;;;;;  (19635 38402))
+;;;;;;  (19635 50568))
 ;;; Generated autoloads from mail/mail-utils.el
 
 (defvar mail-use-rfc822 nil "\
@@ -16105,8 +16476,8 @@
 ;;;***
 
 ;;;### (autoloads (define-mail-abbrev build-mail-abbrevs mail-abbrevs-setup
-;;;;;;  mail-abbrevs-mode) "mailabbrev" "mail/mailabbrev.el" (19379
-;;;;;;  23432))
+;;;;;;  mail-abbrevs-mode) "mailabbrev" "mail/mailabbrev.el" (19277
+;;;;;;  34921))
 ;;; Generated autoloads from mail/mailabbrev.el
 
 (defvar mail-abbrevs-mode nil "\
@@ -16148,8 +16519,8 @@
 ;;;***
 
 ;;;### (autoloads (mail-complete define-mail-alias expand-mail-aliases
-;;;;;;  mail-complete-style) "mailalias" "mail/mailalias.el" (19379
-;;;;;;  23432))
+;;;;;;  mail-complete-style) "mailalias" "mail/mailalias.el" (19277
+;;;;;;  34921))
 ;;; Generated autoloads from mail/mailalias.el
 
 (defvar mail-complete-style 'angles "\
@@ -16195,7 +16566,7 @@
 ;;;***
 
 ;;;### (autoloads (mailclient-send-it) "mailclient" "mail/mailclient.el"
-;;;;;;  (19379 23432))
+;;;;;;  (19693 26133))
 ;;; Generated autoloads from mail/mailclient.el
 
 (autoload 'mailclient-send-it "mailclient" "\
@@ -16209,7 +16580,7 @@
 
 ;;;### (autoloads (makefile-imake-mode makefile-bsdmake-mode makefile-makepp-mode
 ;;;;;;  makefile-gmake-mode makefile-automake-mode makefile-mode)
-;;;;;;  "make-mode" "progmodes/make-mode.el" (19595 20656))
+;;;;;;  "make-mode" "progmodes/make-mode.el" (19594 48841))
 ;;; Generated autoloads from progmodes/make-mode.el
 
 (autoload 'makefile-mode "make-mode" "\
@@ -16326,8 +16697,8 @@
 
 ;;;***
 
-;;;### (autoloads (make-command-summary) "makesum" "makesum.el" (19669
-;;;;;;  58161))
+;;;### (autoloads (make-command-summary) "makesum" "makesum.el" (19668
+;;;;;;  19366))
 ;;; Generated autoloads from makesum.el
 
 (autoload 'make-command-summary "makesum" "\
@@ -16339,7 +16710,7 @@
 ;;;***
 
 ;;;### (autoloads (Man-bookmark-jump man-follow man) "man" "man.el"
-;;;;;;  (19638 63299))
+;;;;;;  (19614 24990))
 ;;; Generated autoloads from man.el
 
 (defalias 'manual-entry 'man)
@@ -16393,7 +16764,7 @@
 
 ;;;***
 
-;;;### (autoloads (master-mode) "master" "master.el" (19379 23432))
+;;;### (autoloads (master-mode) "master" "master.el" (19277 34916))
 ;;; Generated autoloads from master.el
 
 (autoload 'master-mode "master" "\
@@ -16416,7 +16787,7 @@
 ;;;***
 
 ;;;### (autoloads (minibuffer-depth-indicate-mode) "mb-depth" "mb-depth.el"
-;;;;;;  (19379 23432))
+;;;;;;  (19277 34916))
 ;;; Generated autoloads from mb-depth.el
 
 (defvar minibuffer-depth-indicate-mode nil "\
@@ -16447,7 +16818,7 @@
 ;;;;;;  message-forward-make-body message-forward message-recover
 ;;;;;;  message-supersede message-cancel-news message-followup message-wide-reply
 ;;;;;;  message-reply message-news message-mail message-mode) "message"
-;;;;;;  "gnus/message.el" (19677 58077))
+;;;;;;  "gnus/message.el" (19695 9549))
 ;;; Generated autoloads from gnus/message.el
 
 (define-mail-user-agent 'message-user-agent 'message-mail 'message-send-and-exit 'message-kill-buffer 'message-send-hook)
@@ -16613,7 +16984,7 @@
 ;;;***
 
 ;;;### (autoloads (metapost-mode metafont-mode) "meta-mode" "progmodes/meta-mode.el"
-;;;;;;  (19675 9114))
+;;;;;;  (19673 1234))
 ;;; Generated autoloads from progmodes/meta-mode.el
 
 (autoload 'metafont-mode "meta-mode" "\
@@ -16640,7 +17011,7 @@
 
 ;;;### (autoloads (metamail-region metamail-buffer metamail-interpret-body
 ;;;;;;  metamail-interpret-header) "metamail" "mail/metamail.el"
-;;;;;;  (19379 23432))
+;;;;;;  (19354 34807))
 ;;; Generated autoloads from mail/metamail.el
 
 (autoload 'metamail-interpret-header "metamail" "\
@@ -16685,7 +17056,7 @@
 
 ;;;### (autoloads (mh-fully-kill-draft mh-send-letter mh-user-agent-compose
 ;;;;;;  mh-smail-batch mh-smail-other-window mh-smail) "mh-comp"
-;;;;;;  "mh-e/mh-comp.el" (19443 63936))
+;;;;;;  "mh-e/mh-comp.el" (19444 23363))
 ;;; Generated autoloads from mh-e/mh-comp.el
 
 (autoload 'mh-smail "mh-comp" "\
@@ -16775,7 +17146,7 @@
 
 ;;;***
 
-;;;### (autoloads (mh-version) "mh-e" "mh-e/mh-e.el" (19422 40643))
+;;;### (autoloads (mh-version) "mh-e" "mh-e/mh-e.el" (19423 37200))
 ;;; Generated autoloads from mh-e/mh-e.el
 
 (put 'mh-progs 'risky-local-variable t)
@@ -16792,7 +17163,7 @@
 ;;;***
 
 ;;;### (autoloads (mh-folder-mode mh-nmail mh-rmail) "mh-folder"
-;;;;;;  "mh-e/mh-folder.el" (19379 23432))
+;;;;;;  "mh-e/mh-folder.el" (19277 34921))
 ;;; Generated autoloads from mh-e/mh-folder.el
 
 (autoload 'mh-rmail "mh-folder" "\
@@ -16874,7 +17245,7 @@
 ;;;***
 
 ;;;### (autoloads (midnight-delay-set clean-buffer-list) "midnight"
-;;;;;;  "midnight.el" (19379 23432))
+;;;;;;  "midnight.el" (19369 35251))
 ;;; Generated autoloads from midnight.el
 
 (autoload 'clean-buffer-list "midnight" "\
@@ -16901,7 +17272,7 @@
 ;;;***
 
 ;;;### (autoloads (minibuffer-electric-default-mode) "minibuf-eldef"
-;;;;;;  "minibuf-eldef.el" (19379 23432))
+;;;;;;  "minibuf-eldef.el" (19277 34917))
 ;;; Generated autoloads from minibuf-eldef.el
 
 (defvar minibuffer-electric-default-mode nil "\
@@ -16928,7 +17299,7 @@
 
 ;;;***
 
-;;;### (autoloads (butterfly) "misc" "misc.el" (19669 58161))
+;;;### (autoloads (butterfly) "misc" "misc.el" (19668 18610))
 ;;; Generated autoloads from misc.el
 
 (autoload 'butterfly "misc" "\
@@ -16947,7 +17318,7 @@
 
 ;;;### (autoloads (multi-isearch-files-regexp multi-isearch-files
 ;;;;;;  multi-isearch-buffers-regexp multi-isearch-buffers multi-isearch-setup)
-;;;;;;  "misearch" "misearch.el" (19379 23432))
+;;;;;;  "misearch" "misearch.el" (19277 34917))
 ;;; Generated autoloads from misearch.el
  (add-hook 'isearch-mode-hook 'multi-isearch-setup)
 
@@ -17029,7 +17400,7 @@
 ;;;***
 
 ;;;### (autoloads (mixal-mode) "mixal-mode" "progmodes/mixal-mode.el"
-;;;;;;  (19612 6522))
+;;;;;;  (19611 35755))
 ;;; Generated autoloads from progmodes/mixal-mode.el
 
 (autoload 'mixal-mode "mixal-mode" "\
@@ -17041,7 +17412,7 @@
 ;;;***
 
 ;;;### (autoloads (mm-inline-external-body mm-extern-cache-contents)
-;;;;;;  "mm-extern" "gnus/mm-extern.el" (19635 41857))
+;;;;;;  "mm-extern" "gnus/mm-extern.el" (19635 50568))
 ;;; Generated autoloads from gnus/mm-extern.el
 
 (autoload 'mm-extern-cache-contents "mm-extern" "\
@@ -17060,7 +17431,7 @@
 ;;;***
 
 ;;;### (autoloads (mm-inline-partial) "mm-partial" "gnus/mm-partial.el"
-;;;;;;  (19606 36461))
+;;;;;;  (19604 65275))
 ;;; Generated autoloads from gnus/mm-partial.el
 
 (autoload 'mm-inline-partial "mm-partial" "\
@@ -17074,7 +17445,7 @@
 ;;;***
 
 ;;;### (autoloads (mm-url-insert-file-contents-external mm-url-insert-file-contents)
-;;;;;;  "mm-url" "gnus/mm-url.el" (19583 31640))
+;;;;;;  "mm-url" "gnus/mm-url.el" (19582 65302))
 ;;; Generated autoloads from gnus/mm-url.el
 
 (autoload 'mm-url-insert-file-contents "mm-url" "\
@@ -17091,7 +17462,7 @@
 ;;;***
 
 ;;;### (autoloads (mm-uu-dissect-text-parts mm-uu-dissect) "mm-uu"
-;;;;;;  "gnus/mm-uu.el" (19583 31640))
+;;;;;;  "gnus/mm-uu.el" (19691 3508))
 ;;; Generated autoloads from gnus/mm-uu.el
 
 (autoload 'mm-uu-dissect "mm-uu" "\
@@ -17111,7 +17482,7 @@
 ;;;***
 
 ;;;### (autoloads (mml1991-sign mml1991-encrypt) "mml1991" "gnus/mml1991.el"
-;;;;;;  (19635 41857))
+;;;;;;  (19635 50568))
 ;;; Generated autoloads from gnus/mml1991.el
 
 (autoload 'mml1991-encrypt "mml1991" "\
@@ -17128,7 +17499,7 @@
 
 ;;;### (autoloads (mml2015-self-encrypt mml2015-sign mml2015-encrypt
 ;;;;;;  mml2015-verify-test mml2015-verify mml2015-decrypt-test mml2015-decrypt)
-;;;;;;  "mml2015" "gnus/mml2015.el" (19686 22639))
+;;;;;;  "mml2015" "gnus/mml2015.el" (19687 6902))
 ;;; Generated autoloads from gnus/mml2015.el
 
 (autoload 'mml2015-decrypt "mml2015" "\
@@ -17168,8 +17539,8 @@
 
 ;;;***
 
-;;;### (autoloads (m2-mode) "modula2" "progmodes/modula2.el" (19677
-;;;;;;  58077))
+;;;### (autoloads (m2-mode) "modula2" "progmodes/modula2.el" (19676
+;;;;;;  36176))
 ;;; Generated autoloads from progmodes/modula2.el
 
 (defalias 'modula-2-mode 'm2-mode)
@@ -17203,7 +17574,7 @@
 ;;;***
 
 ;;;### (autoloads (unmorse-region morse-region) "morse" "play/morse.el"
-;;;;;;  (19379 23432))
+;;;;;;  (19277 34922))
 ;;; Generated autoloads from play/morse.el
 
 (autoload 'morse-region "morse" "\
@@ -17219,7 +17590,7 @@
 ;;;***
 
 ;;;### (autoloads (mouse-drag-drag mouse-drag-throw) "mouse-drag"
-;;;;;;  "mouse-drag.el" (19675 9114))
+;;;;;;  "mouse-drag.el" (19672 56753))
 ;;; Generated autoloads from mouse-drag.el
 
 (autoload 'mouse-drag-throw "mouse-drag" "\
@@ -17266,8 +17637,8 @@
 
 ;;;***
 
-;;;### (autoloads (mouse-sel-mode) "mouse-sel" "mouse-sel.el" (19686
-;;;;;;  22639))
+;;;### (autoloads (mouse-sel-mode) "mouse-sel" "mouse-sel.el" (19687
+;;;;;;  6902))
 ;;; Generated autoloads from mouse-sel.el
 
 (defvar mouse-sel-mode nil "\
@@ -17319,7 +17690,7 @@
 
 ;;;***
 
-;;;### (autoloads (mpc) "mpc" "mpc.el" (19379 23432))
+;;;### (autoloads (mpc) "mpc" "mpc.el" (19373 24504))
 ;;; Generated autoloads from mpc.el
 
 (autoload 'mpc "mpc" "\
@@ -17329,7 +17700,7 @@
 
 ;;;***
 
-;;;### (autoloads (mpuz) "mpuz" "play/mpuz.el" (19634 57717))
+;;;### (autoloads (mpuz) "mpuz" "play/mpuz.el" (19634 23255))
 ;;; Generated autoloads from play/mpuz.el
 
 (autoload 'mpuz "mpuz" "\
@@ -17339,7 +17710,7 @@
 
 ;;;***
 
-;;;### (autoloads (msb-mode) "msb" "msb.el" (19379 23432))
+;;;### (autoloads (msb-mode) "msb" "msb.el" (19277 34917))
 ;;; Generated autoloads from msb.el
 
 (defvar msb-mode nil "\
@@ -17366,7 +17737,7 @@
 ;;;;;;  describe-current-coding-system describe-current-coding-system-briefly
 ;;;;;;  describe-coding-system describe-character-set list-charset-chars
 ;;;;;;  read-charset list-character-sets) "mule-diag" "international/mule-diag.el"
-;;;;;;  (19617 8027))
+;;;;;;  (19617 12132))
 ;;; Generated autoloads from international/mule-diag.el
 
 (autoload 'list-character-sets "mule-diag" "\
@@ -17503,7 +17874,7 @@
 ;;;;;;  coding-system-translation-table-for-decode coding-system-pre-write-conversion
 ;;;;;;  coding-system-post-read-conversion lookup-nested-alist set-nested-alist
 ;;;;;;  truncate-string-to-width store-substring string-to-sequence)
-;;;;;;  "mule-util" "international/mule-util.el" (19472 6950))
+;;;;;;  "mule-util" "international/mule-util.el" (19472 31430))
 ;;; Generated autoloads from international/mule-util.el
 
 (autoload 'string-to-sequence "mule-util" "\
@@ -17643,8 +18014,8 @@
 ;;;### (autoloads (network-connection network-connection-to-service
 ;;;;;;  whois-reverse-lookup whois finger ftp run-dig dns-lookup-host
 ;;;;;;  nslookup nslookup-host ping traceroute route arp netstat
-;;;;;;  iwconfig ifconfig) "net-utils" "net/net-utils.el" (19675
-;;;;;;  9114))
+;;;;;;  iwconfig ifconfig) "net-utils" "net/net-utils.el" (19672
+;;;;;;  41548))
 ;;; Generated autoloads from net/net-utils.el
 
 (autoload 'ifconfig "net-utils" "\
@@ -17739,7 +18110,7 @@
 ;;;***
 
 ;;;### (autoloads (netrc-credentials) "netrc" "net/netrc.el" (19621
-;;;;;;  13173))
+;;;;;;  23882))
 ;;; Generated autoloads from net/netrc.el
 
 (autoload 'netrc-credentials "netrc" "\
@@ -17756,7 +18127,7 @@
 ;;;;;;  uncomment-region comment-kill comment-set-column comment-indent
 ;;;;;;  comment-indent-default comment-normalize-vars comment-multi-line
 ;;;;;;  comment-padding comment-style comment-column) "newcomment"
-;;;;;;  "newcomment.el" (19649 27409))
+;;;;;;  "newcomment.el" (19648 59284))
 ;;; Generated autoloads from newcomment.el
 
 (defalias 'indent-for-comment 'comment-indent)
@@ -17956,7 +18327,7 @@
 ;;;***
 
 ;;;### (autoloads (newsticker-start newsticker-running-p) "newst-backend"
-;;;;;;  "net/newst-backend.el" (19578 56905))
+;;;;;;  "net/newst-backend.el" (19580 19536))
 ;;; Generated autoloads from net/newst-backend.el
 
 (autoload 'newsticker-running-p "newst-backend" "\
@@ -17978,7 +18349,7 @@
 ;;;***
 
 ;;;### (autoloads (newsticker-plainview) "newst-plainview" "net/newst-plainview.el"
-;;;;;;  (19578 56905))
+;;;;;;  (19580 19536))
 ;;; Generated autoloads from net/newst-plainview.el
 
 (autoload 'newsticker-plainview "newst-plainview" "\
@@ -17989,7 +18360,7 @@
 ;;;***
 
 ;;;### (autoloads (newsticker-show-news) "newst-reader" "net/newst-reader.el"
-;;;;;;  (19578 56905))
+;;;;;;  (19580 19536))
 ;;; Generated autoloads from net/newst-reader.el
 
 (autoload 'newsticker-show-news "newst-reader" "\
@@ -18000,7 +18371,7 @@
 ;;;***
 
 ;;;### (autoloads (newsticker-start-ticker newsticker-ticker-running-p)
-;;;;;;  "newst-ticker" "net/newst-ticker.el" (19578 56905))
+;;;;;;  "newst-ticker" "net/newst-ticker.el" (19580 19536))
 ;;; Generated autoloads from net/newst-ticker.el
 
 (autoload 'newsticker-ticker-running-p "newst-ticker" "\
@@ -18021,7 +18392,7 @@
 ;;;***
 
 ;;;### (autoloads (newsticker-treeview) "newst-treeview" "net/newst-treeview.el"
-;;;;;;  (19578 56905))
+;;;;;;  (19580 19536))
 ;;; Generated autoloads from net/newst-treeview.el
 
 (autoload 'newsticker-treeview "newst-treeview" "\
@@ -18032,7 +18403,7 @@
 ;;;***
 
 ;;;### (autoloads (nndiary-generate-nov-databases) "nndiary" "gnus/nndiary.el"
-;;;;;;  (19665 17270))
+;;;;;;  (19664 37038))
 ;;; Generated autoloads from gnus/nndiary.el
 
 (autoload 'nndiary-generate-nov-databases "nndiary" "\
@@ -18042,8 +18413,8 @@
 
 ;;;***
 
-;;;### (autoloads (nndoc-add-type) "nndoc" "gnus/nndoc.el" (19662
-;;;;;;  2422))
+;;;### (autoloads (nndoc-add-type) "nndoc" "gnus/nndoc.el" (19661
+;;;;;;  61255))
 ;;; Generated autoloads from gnus/nndoc.el
 
 (autoload 'nndoc-add-type "nndoc" "\
@@ -18058,7 +18429,7 @@
 ;;;***
 
 ;;;### (autoloads (nnfolder-generate-active-file) "nnfolder" "gnus/nnfolder.el"
-;;;;;;  (19635 41857))
+;;;;;;  (19695 9549))
 ;;; Generated autoloads from gnus/nnfolder.el
 
 (autoload 'nnfolder-generate-active-file "nnfolder" "\
@@ -18070,7 +18441,7 @@
 ;;;***
 
 ;;;### (autoloads (nnml-generate-nov-databases) "nnml" "gnus/nnml.el"
-;;;;;;  (19615 37479))
+;;;;;;  (19695 9549))
 ;;; Generated autoloads from gnus/nnml.el
 
 (autoload 'nnml-generate-nov-databases "nnml" "\
@@ -18081,7 +18452,7 @@
 ;;;***
 
 ;;;### (autoloads (disable-command enable-command disabled-command-function)
-;;;;;;  "novice" "novice.el" (19686 22639))
+;;;;;;  "novice" "novice.el" (19687 6902))
 ;;; Generated autoloads from novice.el
 
 (defvar disabled-command-function 'disabled-command-function "\
@@ -18114,7 +18485,7 @@
 ;;;***
 
 ;;;### (autoloads (nroff-mode) "nroff-mode" "textmodes/nroff-mode.el"
-;;;;;;  (19606 36461))
+;;;;;;  (19604 6253))
 ;;; Generated autoloads from textmodes/nroff-mode.el
 
 (autoload 'nroff-mode "nroff-mode" "\
@@ -18129,7 +18500,7 @@
 ;;;***
 
 ;;;### (autoloads (nxml-glyph-display-string) "nxml-glyph" "nxml/nxml-glyph.el"
-;;;;;;  (19379 23432))
+;;;;;;  (19277 34921))
 ;;; Generated autoloads from nxml/nxml-glyph.el
 
 (autoload 'nxml-glyph-display-string "nxml-glyph" "\
@@ -18141,8 +18512,8 @@
 
 ;;;***
 
-;;;### (autoloads (nxml-mode) "nxml-mode" "nxml/nxml-mode.el" (19652
-;;;;;;  27168))
+;;;### (autoloads (nxml-mode) "nxml-mode" "nxml/nxml-mode.el" (19696
+;;;;;;  28661))
 ;;; Generated autoloads from nxml/nxml-mode.el
 
 (autoload 'nxml-mode "nxml-mode" "\
@@ -18204,7 +18575,7 @@
 ;;;***
 
 ;;;### (autoloads (nxml-enable-unicode-char-name-sets) "nxml-uchnm"
-;;;;;;  "nxml/nxml-uchnm.el" (19379 23432))
+;;;;;;  "nxml/nxml-uchnm.el" (19691 9263))
 ;;; Generated autoloads from nxml/nxml-uchnm.el
 
 (autoload 'nxml-enable-unicode-char-name-sets "nxml-uchnm" "\
@@ -18225,7 +18596,7 @@
 ;;;;;;  org-babel-expand-src-block org-babel-execute-src-block org-babel-pop-to-session-maybe
 ;;;;;;  org-babel-load-in-session-maybe org-babel-expand-src-block-maybe
 ;;;;;;  org-babel-execute-maybe org-babel-execute-safely-maybe) "ob"
-;;;;;;  "org/ob.el" (19681 9924))
+;;;;;;  "org/ob.el" (19677 59043))
 ;;; Generated autoloads from org/ob.el
 
 (autoload 'org-babel-execute-safely-maybe "ob" "\
@@ -18381,7 +18752,7 @@
 ;;;***
 
 ;;;### (autoloads (org-babel-describe-bindings) "ob-keys" "org/ob-keys.el"
-;;;;;;  (19677 58077))
+;;;;;;  (19676 49793))
 ;;; Generated autoloads from org/ob-keys.el
 
 (autoload 'org-babel-describe-bindings "ob-keys" "\
@@ -18392,7 +18763,7 @@
 ;;;***
 
 ;;;### (autoloads (org-babel-lob-get-info org-babel-lob-execute-maybe
-;;;;;;  org-babel-lob-ingest) "ob-lob" "org/ob-lob.el" (19681 9924))
+;;;;;;  org-babel-lob-ingest) "ob-lob" "org/ob-lob.el" (19677 59221))
 ;;; Generated autoloads from org/ob-lob.el
 
 (autoload 'org-babel-lob-ingest "ob-lob" "\
@@ -18417,7 +18788,7 @@
 
 ;;;### (autoloads (org-babel-tangle org-babel-tangle-file org-babel-load-file
 ;;;;;;  org-babel-tangle-lang-exts) "ob-tangle" "org/ob-tangle.el"
-;;;;;;  (19677 58077))
+;;;;;;  (19676 49793))
 ;;; Generated autoloads from org/ob-tangle.el
 
 (defvar org-babel-tangle-lang-exts '(("emacs-lisp" . "el")) "\
@@ -18459,7 +18830,7 @@
 ;;;***
 
 ;;;### (autoloads (inferior-octave) "octave-inf" "progmodes/octave-inf.el"
-;;;;;;  (19578 56905))
+;;;;;;  (19580 19536))
 ;;; Generated autoloads from progmodes/octave-inf.el
 
 (autoload 'inferior-octave "octave-inf" "\
@@ -18482,7 +18853,7 @@
 ;;;***
 
 ;;;### (autoloads (octave-mode) "octave-mod" "progmodes/octave-mod.el"
-;;;;;;  (19686 22639))
+;;;;;;  (19687 6902))
 ;;; Generated autoloads from progmodes/octave-mod.el
 
 (autoload 'octave-mode "octave-mod" "\
@@ -18570,7 +18941,7 @@
 ;;;;;;  org-insert-link-global org-store-link org-run-like-in-org-mode
 ;;;;;;  turn-on-orgstruct++ turn-on-orgstruct orgstruct-mode org-global-cycle
 ;;;;;;  org-mode org-babel-do-load-languages) "org" "org/org.el"
-;;;;;;  (19677 58077))
+;;;;;;  (19676 49793))
 ;;; Generated autoloads from org/org.el
 
 (autoload 'org-babel-do-load-languages "org" "\
@@ -18793,7 +19164,7 @@
 ;;;;;;  org-diary org-agenda-list-stuck-projects org-tags-view org-todo-list
 ;;;;;;  org-search-view org-agenda-list org-batch-store-agenda-views
 ;;;;;;  org-store-agenda-views org-batch-agenda-csv org-batch-agenda
-;;;;;;  org-agenda) "org-agenda" "org/org-agenda.el" (19677 58077))
+;;;;;;  org-agenda) "org-agenda" "org/org-agenda.el" (19676 49793))
 ;;; Generated autoloads from org/org-agenda.el
 
 (autoload 'org-agenda "org-agenda" "\
@@ -19043,7 +19414,7 @@
 
 ;;;### (autoloads (org-archive-subtree-default-with-confirmation
 ;;;;;;  org-archive-subtree-default) "org-archive" "org/org-archive.el"
-;;;;;;  (19677 58077))
+;;;;;;  (19676 49793))
 ;;; Generated autoloads from org/org-archive.el
 
 (autoload 'org-archive-subtree-default "org-archive" "\
@@ -19063,8 +19434,8 @@
 ;;;### (autoloads (org-export-as-ascii org-export-region-as-ascii
 ;;;;;;  org-replace-region-by-ascii org-export-as-ascii-to-buffer
 ;;;;;;  org-export-as-utf8-to-buffer org-export-as-utf8 org-export-as-latin1-to-buffer
-;;;;;;  org-export-as-latin1) "org-ascii" "org/org-ascii.el" (19677
-;;;;;;  58077))
+;;;;;;  org-export-as-latin1) "org-ascii" "org/org-ascii.el" (19676
+;;;;;;  49793))
 ;;; Generated autoloads from org/org-ascii.el
 
 (autoload 'org-export-as-latin1 "org-ascii" "\
@@ -19137,8 +19508,8 @@
 
 ;;;***
 
-;;;### (autoloads (org-attach) "org-attach" "org/org-attach.el" (19677
-;;;;;;  58077))
+;;;### (autoloads (org-attach) "org-attach" "org/org-attach.el" (19676
+;;;;;;  49793))
 ;;; Generated autoloads from org/org-attach.el
 
 (autoload 'org-attach "org-attach" "\
@@ -19150,7 +19521,7 @@
 ;;;***
 
 ;;;### (autoloads (org-bbdb-anniversaries) "org-bbdb" "org/org-bbdb.el"
-;;;;;;  (19677 58077))
+;;;;;;  (19676 49793))
 ;;; Generated autoloads from org/org-bbdb.el
 
 (autoload 'org-bbdb-anniversaries "org-bbdb" "\
@@ -19161,7 +19532,7 @@
 ;;;***
 
 ;;;### (autoloads (org-capture-import-remember-templates org-capture-insert-template-here
-;;;;;;  org-capture) "org-capture" "org/org-capture.el" (19677 58077))
+;;;;;;  org-capture) "org-capture" "org/org-capture.el" (19678 1813))
 ;;; Generated autoloads from org/org-capture.el
 
 (autoload 'org-capture "org-capture" "\
@@ -19199,7 +19570,7 @@
 ;;;***
 
 ;;;### (autoloads (org-clock-persistence-insinuate org-get-clocktable)
-;;;;;;  "org-clock" "org/org-clock.el" (19677 58077))
+;;;;;;  "org-clock" "org/org-clock.el" (19676 49793))
 ;;; Generated autoloads from org/org-clock.el
 
 (autoload 'org-get-clocktable "org-clock" "\
@@ -19217,7 +19588,7 @@
 ;;;***
 
 ;;;### (autoloads (org-datetree-find-date-create) "org-datetree"
-;;;;;;  "org/org-datetree.el" (19677 58077))
+;;;;;;  "org/org-datetree.el" (19676 49793))
 ;;; Generated autoloads from org/org-datetree.el
 
 (autoload 'org-datetree-find-date-create "org-datetree" "\
@@ -19233,7 +19604,7 @@
 ;;;### (autoloads (org-export-as-docbook org-export-as-docbook-pdf-and-open
 ;;;;;;  org-export-as-docbook-pdf org-export-region-as-docbook org-replace-region-by-docbook
 ;;;;;;  org-export-as-docbook-to-buffer org-export-as-docbook-batch)
-;;;;;;  "org-docbook" "org/org-docbook.el" (19677 58077))
+;;;;;;  "org-docbook" "org/org-docbook.el" (19676 49793))
 ;;; Generated autoloads from org/org-docbook.el
 
 (autoload 'org-export-as-docbook-batch "org-docbook" "\
@@ -19310,7 +19681,7 @@
 
 ;;;### (autoloads (org-insert-export-options-template org-export-as-org
 ;;;;;;  org-export-visible org-export) "org-exp" "org/org-exp.el"
-;;;;;;  (19677 58077))
+;;;;;;  (19676 49793))
 ;;; Generated autoloads from org/org-exp.el
 
 (autoload 'org-export "org-exp" "\
@@ -19367,8 +19738,8 @@
 ;;;***
 
 ;;;### (autoloads (org-feed-show-raw-feed org-feed-goto-inbox org-feed-update
-;;;;;;  org-feed-update-all) "org-feed" "org/org-feed.el" (19677
-;;;;;;  58077))
+;;;;;;  org-feed-update-all) "org-feed" "org/org-feed.el" (19676
+;;;;;;  49793))
 ;;; Generated autoloads from org/org-feed.el
 
 (autoload 'org-feed-update-all "org-feed" "\
@@ -19396,7 +19767,7 @@
 ;;;***
 
 ;;;### (autoloads (org-footnote-normalize org-footnote-action) "org-footnote"
-;;;;;;  "org/org-footnote.el" (19677 58077))
+;;;;;;  "org/org-footnote.el" (19676 49793))
 ;;; Generated autoloads from org/org-footnote.el
 
 (autoload 'org-footnote-action "org-footnote" "\
@@ -19423,7 +19794,7 @@
 ;;;### (autoloads (org-freemind-to-org-mode org-freemind-from-org-sparse-tree
 ;;;;;;  org-freemind-from-org-mode org-freemind-from-org-mode-node
 ;;;;;;  org-freemind-show org-export-as-freemind) "org-freemind"
-;;;;;;  "org/org-freemind.el" (19677 58077))
+;;;;;;  "org/org-freemind.el" (19676 49793))
 ;;; Generated autoloads from org/org-freemind.el
 
 (autoload 'org-export-as-freemind "org-freemind" "\
@@ -19484,7 +19855,7 @@
 ;;;### (autoloads (org-export-htmlize-generate-css org-export-as-html
 ;;;;;;  org-export-region-as-html org-replace-region-by-html org-export-as-html-to-buffer
 ;;;;;;  org-export-as-html-batch org-export-as-html-and-open) "org-html"
-;;;;;;  "org/org-html.el" (19677 58077))
+;;;;;;  "org/org-html.el" (19676 49793))
 ;;; Generated autoloads from org/org-html.el
 
 (put 'org-export-html-style-include-default 'safe-local-variable 'booleanp)
@@ -19578,7 +19949,7 @@
 
 ;;;### (autoloads (org-export-icalendar-combine-agenda-files org-export-icalendar-all-agenda-files
 ;;;;;;  org-export-icalendar-this-file) "org-icalendar" "org/org-icalendar.el"
-;;;;;;  (19677 58077))
+;;;;;;  (19676 49793))
 ;;; Generated autoloads from org/org-icalendar.el
 
 (autoload 'org-export-icalendar-this-file "org-icalendar" "\
@@ -19606,7 +19977,7 @@
 ;;;### (autoloads (org-id-store-link org-id-find-id-file org-id-find
 ;;;;;;  org-id-goto org-id-get-with-outline-drilling org-id-get-with-outline-path-completion
 ;;;;;;  org-id-get org-id-copy org-id-get-create) "org-id" "org/org-id.el"
-;;;;;;  (19677 58077))
+;;;;;;  (19676 49793))
 ;;; Generated autoloads from org/org-id.el
 
 (autoload 'org-id-get-create "org-id" "\
@@ -19675,7 +20046,7 @@
 ;;;***
 
 ;;;### (autoloads (org-indent-mode) "org-indent" "org/org-indent.el"
-;;;;;;  (19677 58077))
+;;;;;;  (19676 49793))
 ;;; Generated autoloads from org/org-indent.el
 
 (autoload 'org-indent-mode "org-indent" "\
@@ -19690,7 +20061,7 @@
 ;;;***
 
 ;;;### (autoloads (org-irc-store-link) "org-irc" "org/org-irc.el"
-;;;;;;  (19677 58077))
+;;;;;;  (19676 49793))
 ;;; Generated autoloads from org/org-irc.el
 
 (autoload 'org-irc-store-link "org-irc" "\
@@ -19703,7 +20074,7 @@
 ;;;### (autoloads (org-export-as-pdf-and-open org-export-as-pdf org-export-as-latex
 ;;;;;;  org-export-region-as-latex org-replace-region-by-latex org-export-as-latex-to-buffer
 ;;;;;;  org-export-as-latex-batch) "org-latex" "org/org-latex.el"
-;;;;;;  (19677 58077))
+;;;;;;  (19676 49793))
 ;;; Generated autoloads from org/org-latex.el
 
 (autoload 'org-export-as-latex-batch "org-latex" "\
@@ -19783,8 +20154,8 @@
 ;;;***
 
 ;;;### (autoloads (org-mobile-create-sumo-agenda org-mobile-pull
-;;;;;;  org-mobile-push) "org-mobile" "org/org-mobile.el" (19677
-;;;;;;  58077))
+;;;;;;  org-mobile-push) "org-mobile" "org/org-mobile.el" (19676
+;;;;;;  49793))
 ;;; Generated autoloads from org/org-mobile.el
 
 (autoload 'org-mobile-push "org-mobile" "\
@@ -19809,7 +20180,7 @@
 ;;;***
 
 ;;;### (autoloads (org-plot/gnuplot) "org-plot" "org/org-plot.el"
-;;;;;;  (19677 58077))
+;;;;;;  (19676 49793))
 ;;; Generated autoloads from org/org-plot.el
 
 (autoload 'org-plot/gnuplot "org-plot" "\
@@ -19823,7 +20194,7 @@
 
 ;;;### (autoloads (org-publish-current-project org-publish-current-file
 ;;;;;;  org-publish-all org-publish) "org-publish" "org/org-publish.el"
-;;;;;;  (19677 58077))
+;;;;;;  (19676 49793))
 ;;; Generated autoloads from org/org-publish.el
 
 (defalias 'org-publish-project 'org-publish)
@@ -19857,7 +20228,7 @@
 
 ;;;### (autoloads (org-remember-handler org-remember org-remember-apply-template
 ;;;;;;  org-remember-annotation org-remember-insinuate) "org-remember"
-;;;;;;  "org/org-remember.el" (19677 58077))
+;;;;;;  "org/org-remember.el" (19676 49793))
 ;;; Generated autoloads from org/org-remember.el
 
 (autoload 'org-remember-insinuate "org-remember" "\
@@ -19933,7 +20304,7 @@
 ;;;***
 
 ;;;### (autoloads (org-table-to-lisp orgtbl-mode turn-on-orgtbl)
-;;;;;;  "org-table" "org/org-table.el" (19677 58077))
+;;;;;;  "org-table" "org/org-table.el" (19676 49793))
 ;;; Generated autoloads from org/org-table.el
 
 (autoload 'turn-on-orgtbl "org-table" "\
@@ -19957,7 +20328,7 @@
 ;;;***
 
 ;;;### (autoloads (org-export-as-taskjuggler-and-open org-export-as-taskjuggler)
-;;;;;;  "org-taskjuggler" "org/org-taskjuggler.el" (19677 58077))
+;;;;;;  "org-taskjuggler" "org/org-taskjuggler.el" (19676 49793))
 ;;; Generated autoloads from org/org-taskjuggler.el
 
 (autoload 'org-export-as-taskjuggler "org-taskjuggler" "\
@@ -19985,7 +20356,7 @@
 
 ;;;### (autoloads (org-timer-set-timer org-timer-item org-timer-change-times-in-region
 ;;;;;;  org-timer org-timer-start) "org-timer" "org/org-timer.el"
-;;;;;;  (19677 58077))
+;;;;;;  (19676 49793))
 ;;; Generated autoloads from org/org-timer.el
 
 (autoload 'org-timer-start "org-timer" "\
@@ -20046,7 +20417,7 @@
 ;;;***
 
 ;;;### (autoloads (org-export-as-xoxo) "org-xoxo" "org/org-xoxo.el"
-;;;;;;  (19677 58077))
+;;;;;;  (19676 49793))
 ;;; Generated autoloads from org/org-xoxo.el
 
 (autoload 'org-export-as-xoxo "org-xoxo" "\
@@ -20058,7 +20429,7 @@
 ;;;***
 
 ;;;### (autoloads (outline-minor-mode outline-mode) "outline" "outline.el"
-;;;;;;  (19623 4932))
+;;;;;;  (19622 9855))
 ;;; Generated autoloads from outline.el
 (put 'outline-regexp 'safe-local-variable 'string-or-null-p)
 
@@ -20118,7 +20489,7 @@
 ;;;### (autoloads (list-packages describe-package package-initialize
 ;;;;;;  package-install-file package-install-from-buffer package-install
 ;;;;;;  package-enable-at-startup) "package" "emacs-lisp/package.el"
-;;;;;;  (19675 9114))
+;;;;;;  (19675 5423))
 ;;; Generated autoloads from emacs-lisp/package.el
 
 (defvar package-enable-at-startup t "\
@@ -20180,7 +20551,7 @@
 
 ;;;***
 
-;;;### (autoloads (show-paren-mode) "paren" "paren.el" (19649 27409))
+;;;### (autoloads (show-paren-mode) "paren" "paren.el" (19648 63605))
 ;;; Generated autoloads from paren.el
 
 (defvar show-paren-mode nil "\
@@ -20205,7 +20576,7 @@
 ;;;***
 
 ;;;### (autoloads (parse-time-string) "parse-time" "calendar/parse-time.el"
-;;;;;;  (19583 31640))
+;;;;;;  (19582 65302))
 ;;; Generated autoloads from calendar/parse-time.el
 (put 'parse-time-rules 'risky-local-variable t)
 
@@ -20218,8 +20589,8 @@
 
 ;;;***
 
-;;;### (autoloads (pascal-mode) "pascal" "progmodes/pascal.el" (19671
-;;;;;;  21337))
+;;;### (autoloads (pascal-mode) "pascal" "progmodes/pascal.el" (19670
+;;;;;;  1520))
 ;;; Generated autoloads from progmodes/pascal.el
 
 (autoload 'pascal-mode "pascal" "\
@@ -20272,7 +20643,7 @@
 ;;;***
 
 ;;;### (autoloads (password-cache-expiry password-cache) "password-cache"
-;;;;;;  "password-cache.el" (19583 31640))
+;;;;;;  "password-cache.el" (19582 65302))
 ;;; Generated autoloads from password-cache.el
 
 (defvar password-cache t "\
@@ -20289,7 +20660,7 @@
 ;;;***
 
 ;;;### (autoloads (pc-bindings-mode) "pc-mode" "emulation/pc-mode.el"
-;;;;;;  (19379 23432))
+;;;;;;  (19277 34919))
 ;;; Generated autoloads from emulation/pc-mode.el
 
 (autoload 'pc-bindings-mode "pc-mode" "\
@@ -20307,7 +20678,7 @@
 ;;;***
 
 ;;;### (autoloads (pc-selection-mode) "pc-select" "emulation/pc-select.el"
-;;;;;;  (19611 13362))
+;;;;;;  (19609 2166))
 ;;; Generated autoloads from emulation/pc-select.el
 
 (defvar pc-selection-mode nil "\
@@ -20374,7 +20745,7 @@
 ;;;***
 
 ;;;### (autoloads (pcase-let pcase-let* pcase) "pcase" "emacs-lisp/pcase.el"
-;;;;;;  (19677 58077))
+;;;;;;  (19693 26133))
 ;;; Generated autoloads from emacs-lisp/pcase.el
 
 (autoload 'pcase "pcase" "\
@@ -20415,23 +20786,23 @@
 BODY should be an expression, and BINDINGS should be a list of bindings
 of the form (UPAT EXP).
 
-\(fn BINDINGS BODY)" nil (quote macro))
+\(fn BINDINGS &rest BODY)" nil (quote macro))
 
 (put 'pcase-let* 'lisp-indent-function '1)
 
 (autoload 'pcase-let "pcase" "\
 Like `let' but where you can use `pcase' patterns for bindings.
-BODY should be an expression, and BINDINGS should be a list of bindings
+BODY should be a list of expressions, and BINDINGS should be a list of bindings
 of the form (UPAT EXP).
 
-\(fn BINDINGS BODY)" nil (quote macro))
+\(fn BINDINGS &rest BODY)" nil (quote macro))
 
 (put 'pcase-let 'lisp-indent-function '1)
 
 ;;;***
 
-;;;### (autoloads (pcomplete/cvs) "pcmpl-cvs" "pcmpl-cvs.el" (19578
-;;;;;;  56905))
+;;;### (autoloads (pcomplete/cvs) "pcmpl-cvs" "pcmpl-cvs.el" (19580
+;;;;;;  19536))
 ;;; Generated autoloads from pcmpl-cvs.el
 
 (autoload 'pcomplete/cvs "pcmpl-cvs" "\
@@ -20442,7 +20813,7 @@
 ;;;***
 
 ;;;### (autoloads (pcomplete/tar pcomplete/make pcomplete/bzip2 pcomplete/gzip)
-;;;;;;  "pcmpl-gnu" "pcmpl-gnu.el" (19578 56905))
+;;;;;;  "pcmpl-gnu" "pcmpl-gnu.el" (19580 19536))
 ;;; Generated autoloads from pcmpl-gnu.el
 
 (autoload 'pcomplete/gzip "pcmpl-gnu" "\
@@ -20470,7 +20841,7 @@
 ;;;***
 
 ;;;### (autoloads (pcomplete/mount pcomplete/umount pcomplete/kill)
-;;;;;;  "pcmpl-linux" "pcmpl-linux.el" (19578 56905))
+;;;;;;  "pcmpl-linux" "pcmpl-linux.el" (19580 19536))
 ;;; Generated autoloads from pcmpl-linux.el
 
 (autoload 'pcomplete/kill "pcmpl-linux" "\
@@ -20490,8 +20861,8 @@
 
 ;;;***
 
-;;;### (autoloads (pcomplete/rpm) "pcmpl-rpm" "pcmpl-rpm.el" (19578
-;;;;;;  56905))
+;;;### (autoloads (pcomplete/rpm) "pcmpl-rpm" "pcmpl-rpm.el" (19580
+;;;;;;  19536))
 ;;; Generated autoloads from pcmpl-rpm.el
 
 (autoload 'pcomplete/rpm "pcmpl-rpm" "\
@@ -20503,7 +20874,7 @@
 
 ;;;### (autoloads (pcomplete/scp pcomplete/ssh pcomplete/chgrp pcomplete/chown
 ;;;;;;  pcomplete/which pcomplete/xargs pcomplete/rm pcomplete/rmdir
-;;;;;;  pcomplete/cd) "pcmpl-unix" "pcmpl-unix.el" (19578 56905))
+;;;;;;  pcomplete/cd) "pcmpl-unix" "pcmpl-unix.el" (19580 19536))
 ;;; Generated autoloads from pcmpl-unix.el
 
 (autoload 'pcomplete/cd "pcmpl-unix" "\
@@ -20561,7 +20932,7 @@
 ;;;### (autoloads (pcomplete-shell-setup pcomplete-comint-setup pcomplete-list
 ;;;;;;  pcomplete-help pcomplete-expand pcomplete-continue pcomplete-expand-and-complete
 ;;;;;;  pcomplete-reverse pcomplete) "pcomplete" "pcomplete.el" (19451
-;;;;;;  41962))
+;;;;;;  17238))
 ;;; Generated autoloads from pcomplete.el
 
 (autoload 'pcomplete "pcomplete" "\
@@ -20620,7 +20991,7 @@
 
 ;;;### (autoloads (cvs-dired-use-hook cvs-dired-action cvs-status
 ;;;;;;  cvs-update cvs-examine cvs-quickdir cvs-checkout) "pcvs"
-;;;;;;  "vc/pcvs.el" (19474 38892))
+;;;;;;  "vc/pcvs.el" (19474 36901))
 ;;; Generated autoloads from vc/pcvs.el
 
 (autoload 'cvs-checkout "pcvs" "\
@@ -20695,7 +21066,7 @@
 
 ;;;***
 
-;;;### (autoloads nil "pcvs-defs" "vc/pcvs-defs.el" (19578 56905))
+;;;### (autoloads nil "pcvs-defs" "vc/pcvs-defs.el" (19580 19536))
 ;;; Generated autoloads from vc/pcvs-defs.el
 
 (defvar cvs-global-menu (let ((m (make-sparse-keymap "PCL-CVS"))) (define-key m [status] `(menu-item ,(purecopy "Directory Status") cvs-status :help ,(purecopy "A more verbose status of a workarea"))) (define-key m [checkout] `(menu-item ,(purecopy "Checkout Module") cvs-checkout :help ,(purecopy "Check out a module from the repository"))) (define-key m [update] `(menu-item ,(purecopy "Update Directory") cvs-update :help ,(purecopy "Fetch updates from the repository"))) (define-key m [examine] `(menu-item ,(purecopy "Examine Directory") cvs-examine :help ,(purecopy "Examine the current state of a workarea"))) (fset 'cvs-global-menu m)))
@@ -20703,7 +21074,7 @@
 ;;;***
 
 ;;;### (autoloads (perl-mode) "perl-mode" "progmodes/perl-mode.el"
-;;;;;;  (19669 58161))
+;;;;;;  (19668 19310))
 ;;; Generated autoloads from progmodes/perl-mode.el
 (put 'perl-indent-level 'safe-local-variable 'integerp)
 (put 'perl-continued-statement-offset 'safe-local-variable 'integerp)
@@ -20767,7 +21138,7 @@
 ;;;### (autoloads (pgg-snarf-keys pgg-snarf-keys-region pgg-insert-key
 ;;;;;;  pgg-verify pgg-verify-region pgg-sign pgg-sign-region pgg-decrypt
 ;;;;;;  pgg-decrypt-region pgg-encrypt pgg-encrypt-symmetric pgg-encrypt-symmetric-region
-;;;;;;  pgg-encrypt-region) "pgg" "pgg.el" (19635 41857))
+;;;;;;  pgg-encrypt-region) "pgg" "pgg.el" (19635 50568))
 ;;; Generated autoloads from pgg.el
 
 (autoload 'pgg-encrypt-region "pgg" "\
@@ -20901,7 +21272,7 @@
 ;;;***
 
 ;;;### (autoloads (pgg-gpg-symmetric-key-p) "pgg-gpg" "pgg-gpg.el"
-;;;;;;  (19583 31640))
+;;;;;;  (19582 65302))
 ;;; Generated autoloads from pgg-gpg.el
 
 (autoload 'pgg-gpg-symmetric-key-p "pgg-gpg" "\
@@ -20912,7 +21283,7 @@
 ;;;***
 
 ;;;### (autoloads (picture-mode) "picture" "textmodes/picture.el"
-;;;;;;  (19686 22639))
+;;;;;;  (19687 6902))
 ;;; Generated autoloads from textmodes/picture.el
 
 (autoload 'picture-mode "picture" "\
@@ -20993,7 +21364,7 @@
 ;;;***
 
 ;;;### (autoloads (po-find-file-coding-system) "po" "textmodes/po.el"
-;;;;;;  (19379 23432))
+;;;;;;  (19277 34923))
 ;;; Generated autoloads from textmodes/po.el
 
 (autoload 'po-find-file-coding-system "po" "\
@@ -21004,7 +21375,7 @@
 
 ;;;***
 
-;;;### (autoloads (pong) "pong" "play/pong.el" (19379 23432))
+;;;### (autoloads (pong) "pong" "play/pong.el" (19277 34922))
 ;;; Generated autoloads from play/pong.el
 
 (autoload 'pong "pong" "\
@@ -21020,7 +21391,7 @@
 
 ;;;***
 
-;;;### (autoloads (pop3-movemail) "pop3" "gnus/pop3.el" (19624 62323))
+;;;### (autoloads (pop3-movemail) "pop3" "gnus/pop3.el" (19624 59837))
 ;;; Generated autoloads from gnus/pop3.el
 
 (autoload 'pop3-movemail "pop3" "\
@@ -21033,7 +21404,7 @@
 
 ;;;### (autoloads (pp-macroexpand-last-sexp pp-eval-last-sexp pp-macroexpand-expression
 ;;;;;;  pp-eval-expression pp pp-buffer pp-to-string) "pp" "emacs-lisp/pp.el"
-;;;;;;  (19379 23432))
+;;;;;;  (19277 34919))
 ;;; Generated autoloads from emacs-lisp/pp.el
 
 (autoload 'pp-to-string "pp" "\
@@ -21101,7 +21472,7 @@
 ;;;;;;  pr-ps-buffer-print pr-ps-buffer-using-ghostscript pr-ps-buffer-preview
 ;;;;;;  pr-ps-directory-ps-print pr-ps-directory-print pr-ps-directory-using-ghostscript
 ;;;;;;  pr-ps-directory-preview pr-interface) "printing" "printing.el"
-;;;;;;  (19686 22639))
+;;;;;;  (19687 6902))
 ;;; Generated autoloads from printing.el
 
 (autoload 'pr-interface "printing" "\
@@ -21688,7 +22059,7 @@
 
 ;;;***
 
-;;;### (autoloads (proced) "proced" "proced.el" (19589 20829))
+;;;### (autoloads (proced) "proced" "proced.el" (19590 30214))
 ;;; Generated autoloads from proced.el
 
 (autoload 'proced "proced" "\
@@ -21704,7 +22075,7 @@
 ;;;***
 
 ;;;### (autoloads (switch-to-prolog prolog-mode) "prolog" "progmodes/prolog.el"
-;;;;;;  (19671 21337))
+;;;;;;  (19672 21006))
 ;;; Generated autoloads from progmodes/prolog.el
 
 (autoload 'prolog-mode "prolog" "\
@@ -21727,8 +22098,8 @@
 
 ;;;***
 
-;;;### (autoloads (bdf-directory-list) "ps-bdf" "ps-bdf.el" (19578
-;;;;;;  56905))
+;;;### (autoloads (bdf-directory-list) "ps-bdf" "ps-bdf.el" (19580
+;;;;;;  19536))
 ;;; Generated autoloads from ps-bdf.el
 
 (defvar bdf-directory-list (if (memq system-type '(ms-dos windows-nt)) (list (expand-file-name "fonts/bdf" installation-directory)) '("/usr/local/share/emacs/fonts/bdf")) "\
@@ -21739,8 +22110,8 @@
 
 ;;;***
 
-;;;### (autoloads (ps-mode) "ps-mode" "progmodes/ps-mode.el" (19578
-;;;;;;  56905))
+;;;### (autoloads (ps-mode) "ps-mode" "progmodes/ps-mode.el" (19580
+;;;;;;  19536))
 ;;; Generated autoloads from progmodes/ps-mode.el
 
 (autoload 'ps-mode "ps-mode" "\
@@ -21791,8 +22162,8 @@
 ;;;;;;  ps-spool-region ps-spool-buffer-with-faces ps-spool-buffer
 ;;;;;;  ps-print-region-with-faces ps-print-region ps-print-buffer-with-faces
 ;;;;;;  ps-print-buffer ps-print-customize ps-print-color-p ps-paper-type
-;;;;;;  ps-page-dimensions-database) "ps-print" "ps-print.el" (19649
-;;;;;;  27409))
+;;;;;;  ps-page-dimensions-database) "ps-print" "ps-print.el" (19648
+;;;;;;  63513))
 ;;; Generated autoloads from ps-print.el
 
 (defvar ps-page-dimensions-database (purecopy (list (list 'a4 (/ (* 72 21.0) 2.54) (/ (* 72 29.7) 2.54) "A4") (list 'a3 (/ (* 72 29.7) 2.54) (/ (* 72 42.0) 2.54) "A3") (list 'letter (* 72 8.5) (* 72 11.0) "Letter") (list 'legal (* 72 8.5) (* 72 14.0) "Legal") (list 'letter-small (* 72 7.68) (* 72 10.16) "LetterSmall") (list 'tabloid (* 72 11.0) (* 72 17.0) "Tabloid") (list 'ledger (* 72 17.0) (* 72 11.0) "Ledger") (list 'statement (* 72 5.5) (* 72 8.5) "Statement") (list 'executive (* 72 7.5) (* 72 10.0) "Executive") (list 'a4small (* 72 7.47) (* 72 10.85) "A4Small") (list 'b4 (* 72 10.125) (* 72 14.33) "B4") (list 'b5 (* 72 7.16) (* 72 10.125) "B5") '(addresslarge 236.0 99.0 "AddressLarge") '(addresssmall 236.0 68.0 "AddressSmall") '(cuthanging13 90.0 222.0 "CutHanging13") '(cuthanging15 90.0 114.0 "CutHanging15") '(diskette 181.0 136.0 "Diskette") '(eurofilefolder 139.0 112.0 "EuropeanFilefolder") '(eurofoldernarrow 526.0 107.0 "EuroFolderNarrow") '(eurofolderwide 526.0 136.0 "EuroFolderWide") '(euronamebadge 189.0 108.0 "EuroNameBadge") '(euronamebadgelarge 223.0 136.0 "EuroNameBadgeLarge") '(filefolder 230.0 37.0 "FileFolder") '(jewelry 76.0 136.0 "Jewelry") '(mediabadge 180.0 136.0 "MediaBadge") '(multipurpose 126.0 68.0 "MultiPurpose") '(retaillabel 90.0 104.0 "RetailLabel") '(shipping 271.0 136.0 "Shipping") '(slide35mm 26.0 104.0 "Slide35mm") '(spine8mm 187.0 26.0 "Spine8mm") '(topcoated 425.19685 136.0 "TopCoatedPaper") '(topcoatedpaper 396.0 136.0 "TopcoatedPaper150") '(vhsface 205.0 127.0 "VHSFace") '(vhsspine 400.0 50.0 "VHSSpine") '(zipdisk 156.0 136.0 "ZipDisk"))) "\
@@ -21989,7 +22360,7 @@
 ;;;***
 
 ;;;### (autoloads (python-shell jython-mode python-mode run-python)
-;;;;;;  "python" "progmodes/python.el" (19686 22639))
+;;;;;;  "python" "progmodes/python.el" (19691 3508))
 ;;; Generated autoloads from progmodes/python.el
 
 (add-to-list 'interpreter-mode-alist (cons (purecopy "jython") 'jython-mode))
@@ -22105,7 +22476,7 @@
 ;;;***
 
 ;;;### (autoloads (quoted-printable-decode-region) "qp" "gnus/qp.el"
-;;;;;;  (19583 31640))
+;;;;;;  (19582 65302))
 ;;; Generated autoloads from gnus/qp.el
 
 (autoload 'quoted-printable-decode-region "qp" "\
@@ -22128,7 +22499,7 @@
 ;;;;;;  quail-defrule quail-install-decode-map quail-install-map
 ;;;;;;  quail-define-rules quail-show-keyboard-layout quail-set-keyboard-layout
 ;;;;;;  quail-define-package quail-use-package quail-title) "quail"
-;;;;;;  "international/quail.el" (19496 32415))
+;;;;;;  "international/quail.el" (19498 12592))
 ;;; Generated autoloads from international/quail.el
 
 (autoload 'quail-title "quail" "\
@@ -22359,8 +22730,8 @@
 
 ;;;### (autoloads (quickurl-list quickurl-list-mode quickurl-edit-urls
 ;;;;;;  quickurl-browse-url-ask quickurl-browse-url quickurl-add-url
-;;;;;;  quickurl-ask quickurl) "quickurl" "net/quickurl.el" (19675
-;;;;;;  9114))
+;;;;;;  quickurl-ask quickurl) "quickurl" "net/quickurl.el" (19672
+;;;;;;  56753))
 ;;; Generated autoloads from net/quickurl.el
 
 (defconst quickurl-reread-hook-postfix "\n;; Local Variables:\n;; eval: (progn (require 'quickurl) (add-hook 'local-write-file-hooks (lambda () (quickurl-read) nil)))\n;; End:\n" "\
@@ -22432,7 +22803,7 @@
 ;;;***
 
 ;;;### (autoloads (rcirc-track-minor-mode rcirc-connect rcirc) "rcirc"
-;;;;;;  "net/rcirc.el" (19598 15988))
+;;;;;;  "net/rcirc.el" (19599 45674))
 ;;; Generated autoloads from net/rcirc.el
 
 (autoload 'rcirc "rcirc" "\
@@ -22467,8 +22838,8 @@
 
 ;;;***
 
-;;;### (autoloads (remote-compile) "rcompile" "net/rcompile.el" (19611
-;;;;;;  13362))
+;;;### (autoloads (remote-compile) "rcompile" "net/rcompile.el" (19609
+;;;;;;  2577))
 ;;; Generated autoloads from net/rcompile.el
 
 (autoload 'remote-compile "rcompile" "\
@@ -22480,7 +22851,7 @@
 ;;;***
 
 ;;;### (autoloads (re-builder) "re-builder" "emacs-lisp/re-builder.el"
-;;;;;;  (19535 27714))
+;;;;;;  (19552 37739))
 ;;; Generated autoloads from emacs-lisp/re-builder.el
 
 (defalias 'regexp-builder 're-builder)
@@ -22492,7 +22863,7 @@
 
 ;;;***
 
-;;;### (autoloads (recentf-mode) "recentf" "recentf.el" (19379 23432))
+;;;### (autoloads (recentf-mode) "recentf" "recentf.el" (19277 34917))
 ;;; Generated autoloads from recentf.el
 
 (defvar recentf-mode nil "\
@@ -22519,8 +22890,8 @@
 ;;;### (autoloads (clear-rectangle string-insert-rectangle string-rectangle
 ;;;;;;  delete-whitespace-rectangle open-rectangle insert-rectangle
 ;;;;;;  yank-rectangle kill-rectangle extract-rectangle delete-extract-rectangle
-;;;;;;  delete-rectangle move-to-column-force) "rect" "rect.el" (19578
-;;;;;;  56905))
+;;;;;;  delete-rectangle move-to-column-force) "rect" "rect.el" (19580
+;;;;;;  19536))
 ;;; Generated autoloads from rect.el
  (define-key ctl-x-r-map "c" 'clear-rectangle)
  (define-key ctl-x-r-map "k" 'kill-rectangle)
@@ -22654,8 +23025,8 @@
 
 ;;;***
 
-;;;### (autoloads (refill-mode) "refill" "textmodes/refill.el" (19379
-;;;;;;  23432))
+;;;### (autoloads (refill-mode) "refill" "textmodes/refill.el" (19277
+;;;;;;  34923))
 ;;; Generated autoloads from textmodes/refill.el
 
 (autoload 'refill-mode "refill" "\
@@ -22671,7 +23042,7 @@
 ;;;***
 
 ;;;### (autoloads (reftex-reset-scanning-information reftex-mode
-;;;;;;  turn-on-reftex) "reftex" "textmodes/reftex.el" (19595 20656))
+;;;;;;  turn-on-reftex) "reftex" "textmodes/reftex.el" (19594 48841))
 ;;; Generated autoloads from textmodes/reftex.el
 
 (autoload 'turn-on-reftex "reftex" "\
@@ -22721,7 +23092,7 @@
 ;;;***
 
 ;;;### (autoloads (reftex-citation) "reftex-cite" "textmodes/reftex-cite.el"
-;;;;;;  (19669 58161))
+;;;;;;  (19669 41170))
 ;;; Generated autoloads from textmodes/reftex-cite.el
 
 (autoload 'reftex-citation "reftex-cite" "\
@@ -22751,7 +23122,7 @@
 ;;;***
 
 ;;;### (autoloads (reftex-isearch-minor-mode) "reftex-global" "textmodes/reftex-global.el"
-;;;;;;  (19578 56905))
+;;;;;;  (19580 19536))
 ;;; Generated autoloads from textmodes/reftex-global.el
 
 (autoload 'reftex-isearch-minor-mode "reftex-global" "\
@@ -22768,7 +23139,7 @@
 ;;;***
 
 ;;;### (autoloads (reftex-index-phrases-mode) "reftex-index" "textmodes/reftex-index.el"
-;;;;;;  (19665 17270))
+;;;;;;  (19664 56235))
 ;;; Generated autoloads from textmodes/reftex-index.el
 
 (autoload 'reftex-index-phrases-mode "reftex-index" "\
@@ -22801,7 +23172,7 @@
 ;;;***
 
 ;;;### (autoloads (reftex-all-document-files) "reftex-parse" "textmodes/reftex-parse.el"
-;;;;;;  (19608 30156))
+;;;;;;  (19607 63447))
 ;;; Generated autoloads from textmodes/reftex-parse.el
 
 (autoload 'reftex-all-document-files "reftex-parse" "\
@@ -22813,8 +23184,8 @@
 
 ;;;***
 
-;;;### (autoloads nil "reftex-vars" "textmodes/reftex-vars.el" (19578
-;;;;;;  56905))
+;;;### (autoloads nil "reftex-vars" "textmodes/reftex-vars.el" (19580
+;;;;;;  19536))
 ;;; Generated autoloads from textmodes/reftex-vars.el
 (put 'reftex-vref-is-default 'safe-local-variable (lambda (x) (or (stringp x) (symbolp x))))
 (put 'reftex-fref-is-default 'safe-local-variable (lambda (x) (or (stringp x) (symbolp x))))
@@ -22824,7 +23195,7 @@
 ;;;***
 
 ;;;### (autoloads (regexp-opt-depth regexp-opt) "regexp-opt" "emacs-lisp/regexp-opt.el"
-;;;;;;  (19645 32682))
+;;;;;;  (19645 60484))
 ;;; Generated autoloads from emacs-lisp/regexp-opt.el
 
 (autoload 'regexp-opt "regexp-opt" "\
@@ -22855,7 +23226,7 @@
 
 ;;;### (autoloads (remember-diary-extract-entries remember-clipboard
 ;;;;;;  remember-other-frame remember) "remember" "textmodes/remember.el"
-;;;;;;  (19675 9114))
+;;;;;;  (19672 39537))
 ;;; Generated autoloads from textmodes/remember.el
 
 (autoload 'remember "remember" "\
@@ -22886,7 +23257,7 @@
 
 ;;;***
 
-;;;### (autoloads (repeat) "repeat" "repeat.el" (19645 32682))
+;;;### (autoloads (repeat) "repeat" "repeat.el" (19645 60484))
 ;;; Generated autoloads from repeat.el
 
 (autoload 'repeat "repeat" "\
@@ -22909,7 +23280,7 @@
 ;;;***
 
 ;;;### (autoloads (reporter-submit-bug-report) "reporter" "mail/reporter.el"
-;;;;;;  (19379 23432))
+;;;;;;  (19277 34921))
 ;;; Generated autoloads from mail/reporter.el
 
 (autoload 'reporter-submit-bug-report "reporter" "\
@@ -22941,7 +23312,7 @@
 ;;;***
 
 ;;;### (autoloads (reposition-window) "reposition" "reposition.el"
-;;;;;;  (19669 58161))
+;;;;;;  (19668 19461))
 ;;; Generated autoloads from reposition.el
 
 (autoload 'reposition-window "reposition" "\
@@ -22968,7 +23339,7 @@
 ;;;***
 
 ;;;### (autoloads (global-reveal-mode reveal-mode) "reveal" "reveal.el"
-;;;;;;  (19379 23432))
+;;;;;;  (19354 34807))
 ;;; Generated autoloads from reveal.el
 
 (autoload 'reveal-mode "reveal" "\
@@ -23003,7 +23374,7 @@
 ;;;***
 
 ;;;### (autoloads (make-ring ring-p) "ring" "emacs-lisp/ring.el"
-;;;;;;  (19379 23432))
+;;;;;;  (19277 34919))
 ;;; Generated autoloads from emacs-lisp/ring.el
 
 (autoload 'ring-p "ring" "\
@@ -23018,7 +23389,7 @@
 
 ;;;***
 
-;;;### (autoloads (rlogin) "rlogin" "net/rlogin.el" (19611 13362))
+;;;### (autoloads (rlogin) "rlogin" "net/rlogin.el" (19609 2536))
 ;;; Generated autoloads from net/rlogin.el
  (add-hook 'same-window-regexps (purecopy "^\\*rlogin-.*\\*\\(\\|<[0-9]+>\\)"))
 
@@ -23068,8 +23439,8 @@
 ;;;;;;  rmail-secondary-file-directory rmail-primary-inbox-list rmail-highlighted-headers
 ;;;;;;  rmail-retry-ignored-headers rmail-displayed-headers rmail-ignored-headers
 ;;;;;;  rmail-dont-reply-to-names rmail-user-mail-address-regexp
-;;;;;;  rmail-movemail-variant-p) "rmail" "mail/rmail.el" (19638
-;;;;;;  63299))
+;;;;;;  rmail-movemail-variant-p) "rmail" "mail/rmail.el" (19639
+;;;;;;  17158))
 ;;; Generated autoloads from mail/rmail.el
 
 (autoload 'rmail-movemail-variant-p "rmail" "\
@@ -23263,7 +23634,7 @@
 ;;;***
 
 ;;;### (autoloads (rmail-output-body-to-file rmail-output-as-seen
-;;;;;;  rmail-output) "rmailout" "mail/rmailout.el" (19578 56905))
+;;;;;;  rmail-output) "rmailout" "mail/rmailout.el" (19580 19536))
 ;;; Generated autoloads from mail/rmailout.el
 (put 'rmail-output-file-alist 'risky-local-variable t)
 
@@ -23328,7 +23699,7 @@
 ;;;***
 
 ;;;### (autoloads (rng-c-load-schema) "rng-cmpct" "nxml/rng-cmpct.el"
-;;;;;;  (19379 23432))
+;;;;;;  (19277 34921))
 ;;; Generated autoloads from nxml/rng-cmpct.el
 
 (autoload 'rng-c-load-schema "rng-cmpct" "\
@@ -23340,7 +23711,7 @@
 ;;;***
 
 ;;;### (autoloads (rng-nxml-mode-init) "rng-nxml" "nxml/rng-nxml.el"
-;;;;;;  (19379 23432))
+;;;;;;  (19696 28661))
 ;;; Generated autoloads from nxml/rng-nxml.el
 
 (autoload 'rng-nxml-mode-init "rng-nxml" "\
@@ -23353,7 +23724,7 @@
 ;;;***
 
 ;;;### (autoloads (rng-validate-mode) "rng-valid" "nxml/rng-valid.el"
-;;;;;;  (19379 23432))
+;;;;;;  (19696 28661))
 ;;; Generated autoloads from nxml/rng-valid.el
 
 (autoload 'rng-validate-mode "rng-valid" "\
@@ -23383,8 +23754,8 @@
 
 ;;;***
 
-;;;### (autoloads (rng-xsd-compile) "rng-xsd" "nxml/rng-xsd.el" (19379
-;;;;;;  23432))
+;;;### (autoloads (rng-xsd-compile) "rng-xsd" "nxml/rng-xsd.el" (19277
+;;;;;;  34921))
 ;;; Generated autoloads from nxml/rng-xsd.el
 
 (put 'http://www\.w3\.org/2001/XMLSchema-datatypes 'rng-dt-compile 'rng-xsd-compile)
@@ -23412,7 +23783,7 @@
 ;;;***
 
 ;;;### (autoloads (robin-use-package robin-modify-package robin-define-package)
-;;;;;;  "robin" "international/robin.el" (19379 23432))
+;;;;;;  "robin" "international/robin.el" (19277 34920))
 ;;; Generated autoloads from international/robin.el
 
 (autoload 'robin-define-package "robin" "\
@@ -23445,7 +23816,7 @@
 ;;;***
 
 ;;;### (autoloads (toggle-rot13-mode rot13-other-window rot13-region
-;;;;;;  rot13-string rot13) "rot13" "rot13.el" (19379 23432))
+;;;;;;  rot13-string rot13) "rot13" "rot13.el" (19277 34917))
 ;;; Generated autoloads from rot13.el
 
 (autoload 'rot13 "rot13" "\
@@ -23483,7 +23854,7 @@
 ;;;***
 
 ;;;### (autoloads (rst-minor-mode rst-mode) "rst" "textmodes/rst.el"
-;;;;;;  (19686 22639))
+;;;;;;  (19687 6902))
 ;;; Generated autoloads from textmodes/rst.el
  (add-to-list 'auto-mode-alist (purecopy '("\\.re?st\\'" . rst-mode)))
 
@@ -23521,7 +23892,7 @@
 ;;;***
 
 ;;;### (autoloads (ruby-mode) "ruby-mode" "progmodes/ruby-mode.el"
-;;;;;;  (19671 21337))
+;;;;;;  (19670 666))
 ;;; Generated autoloads from progmodes/ruby-mode.el
 
 (autoload 'ruby-mode "ruby-mode" "\
@@ -23542,8 +23913,8 @@
 
 ;;;***
 
-;;;### (autoloads (ruler-mode) "ruler-mode" "ruler-mode.el" (19500
-;;;;;;  25190))
+;;;### (autoloads (ruler-mode) "ruler-mode" "ruler-mode.el" (19502
+;;;;;;  11548))
 ;;; Generated autoloads from ruler-mode.el
 
 (defvar ruler-mode nil "\
@@ -23558,8 +23929,8 @@
 
 ;;;***
 
-;;;### (autoloads (rx rx-to-string) "rx" "emacs-lisp/rx.el" (19589
-;;;;;;  20829))
+;;;### (autoloads (rx rx-to-string) "rx" "emacs-lisp/rx.el" (19590
+;;;;;;  30214))
 ;;; Generated autoloads from emacs-lisp/rx.el
 
 (autoload 'rx-to-string "rx" "\
@@ -23865,8 +24236,8 @@
 
 ;;;***
 
-;;;### (autoloads (savehist-mode) "savehist" "savehist.el" (19422
-;;;;;;  40643))
+;;;### (autoloads (savehist-mode) "savehist" "savehist.el" (19423
+;;;;;;  37200))
 ;;; Generated autoloads from savehist.el
 
 (defvar savehist-mode nil "\
@@ -23894,7 +24265,7 @@
 ;;;***
 
 ;;;### (autoloads (dsssl-mode scheme-mode) "scheme" "progmodes/scheme.el"
-;;;;;;  (19564 19367))
+;;;;;;  (19561 48711))
 ;;; Generated autoloads from progmodes/scheme.el
 
 (autoload 'scheme-mode "scheme" "\
@@ -23936,7 +24307,7 @@
 ;;;***
 
 ;;;### (autoloads (gnus-score-mode) "score-mode" "gnus/score-mode.el"
-;;;;;;  (19583 31640))
+;;;;;;  (19582 65302))
 ;;; Generated autoloads from gnus/score-mode.el
 
 (autoload 'gnus-score-mode "score-mode" "\
@@ -23950,7 +24321,7 @@
 ;;;***
 
 ;;;### (autoloads (scroll-all-mode) "scroll-all" "scroll-all.el"
-;;;;;;  (19433 51924))
+;;;;;;  (19433 56975))
 ;;; Generated autoloads from scroll-all.el
 
 (defvar scroll-all-mode nil "\
@@ -23973,7 +24344,7 @@
 ;;;***
 
 ;;;### (autoloads (scroll-lock-mode) "scroll-lock" "scroll-lock.el"
-;;;;;;  (19379 23432))
+;;;;;;  (19277 34917))
 ;;; Generated autoloads from scroll-lock.el
 
 (autoload 'scroll-lock-mode "scroll-lock" "\
@@ -23987,7 +24358,7 @@
 
 ;;;***
 
-;;;### (autoloads nil "secrets" "net/secrets.el" (19443 63936))
+;;;### (autoloads nil "secrets" "net/secrets.el" (19444 23363))
 ;;; Generated autoloads from net/secrets.el
 (when (featurep 'dbusbind)
  (autoload 'secrets-show-secrets "secrets" nil t))
@@ -23995,7 +24366,7 @@
 ;;;***
 
 ;;;### (autoloads (semantic-mode semantic-default-submodes) "semantic"
-;;;;;;  "cedet/semantic.el" (19612 3157))
+;;;;;;  "cedet/semantic.el" (19612 4032))
 ;;; Generated autoloads from cedet/semantic.el
 
 (defvar semantic-default-submodes '(global-semantic-idle-scheduler-mode global-semanticdb-minor-mode) "\
@@ -24047,7 +24418,7 @@
 ;;;;;;  mail-alias-file mail-default-reply-to mail-archive-file-name
 ;;;;;;  mail-header-separator send-mail-function mail-interactive
 ;;;;;;  mail-self-blind mail-specify-envelope-from mail-from-style)
-;;;;;;  "sendmail" "mail/sendmail.el" (19675 9114))
+;;;;;;  "sendmail" "mail/sendmail.el" (19696 28661))
 ;;; Generated autoloads from mail/sendmail.el
 
 (defvar mail-from-style 'default "\
@@ -24347,8 +24718,8 @@
 ;;;***
 
 ;;;### (autoloads (server-save-buffers-kill-terminal server-mode
-;;;;;;  server-force-delete server-start) "server" "server.el" (19686
-;;;;;;  22639))
+;;;;;;  server-force-delete server-start) "server" "server.el" (19687
+;;;;;;  6902))
 ;;; Generated autoloads from server.el
 
 (put 'server-host 'risky-local-variable t)
@@ -24411,7 +24782,7 @@
 
 ;;;***
 
-;;;### (autoloads (ses-mode) "ses" "ses.el" (19379 23432))
+;;;### (autoloads (ses-mode) "ses" "ses.el" (19277 34917))
 ;;; Generated autoloads from ses.el
 
 (autoload 'ses-mode "ses" "\
@@ -24430,7 +24801,7 @@
 ;;;***
 
 ;;;### (autoloads (html-mode sgml-mode) "sgml-mode" "textmodes/sgml-mode.el"
-;;;;;;  (19652 27168))
+;;;;;;  (19651 33965))
 ;;; Generated autoloads from textmodes/sgml-mode.el
 
 (autoload 'sgml-mode "sgml-mode" "\
@@ -24496,7 +24867,7 @@
 ;;;***
 
 ;;;### (autoloads (sh-mode) "sh-script" "progmodes/sh-script.el"
-;;;;;;  (19675 9114))
+;;;;;;  (19672 56753))
 ;;; Generated autoloads from progmodes/sh-script.el
 (put 'sh-shell 'safe-local-variable 'symbolp)
 
@@ -24560,7 +24931,7 @@
 
 ;;;***
 
-;;;### (autoloads (sha1) "sha1" "sha1.el" (19583 31640))
+;;;### (autoloads (sha1) "sha1" "sha1.el" (19582 65302))
 ;;; Generated autoloads from sha1.el
 
 (autoload 'sha1 "sha1" "\
@@ -24575,7 +24946,7 @@
 ;;;***
 
 ;;;### (autoloads (list-load-path-shadows) "shadow" "emacs-lisp/shadow.el"
-;;;;;;  (19635 38402))
+;;;;;;  (19635 50568))
 ;;; Generated autoloads from emacs-lisp/shadow.el
 
 (autoload 'list-load-path-shadows "shadow" "\
@@ -24625,8 +24996,8 @@
 ;;;***
 
 ;;;### (autoloads (shadow-initialize shadow-define-regexp-group shadow-define-literal-group
-;;;;;;  shadow-define-cluster) "shadowfile" "shadowfile.el" (19379
-;;;;;;  23432))
+;;;;;;  shadow-define-cluster) "shadowfile" "shadowfile.el" (19277
+;;;;;;  34917))
 ;;; Generated autoloads from shadowfile.el
 
 (autoload 'shadow-define-cluster "shadowfile" "\
@@ -24665,7 +25036,7 @@
 ;;;***
 
 ;;;### (autoloads (shell shell-dumb-shell-regexp) "shell" "shell.el"
-;;;;;;  (19677 58077))
+;;;;;;  (19696 28661))
 ;;; Generated autoloads from shell.el
 
 (defvar shell-dumb-shell-regexp (purecopy "cmd\\(proxy\\)?\\.exe") "\
@@ -24714,8 +25085,8 @@
 
 ;;;***
 
-;;;### (autoloads (shr-insert-document) "shr" "gnus/shr.el" (19686
-;;;;;;  22639))
+;;;### (autoloads (shr-insert-document) "shr" "gnus/shr.el" (19696
+;;;;;;  27153))
 ;;; Generated autoloads from gnus/shr.el
 
 (autoload 'shr-insert-document "shr" "\
@@ -24726,7 +25097,7 @@
 ;;;***
 
 ;;;### (autoloads (sieve-upload-and-bury sieve-upload sieve-manage)
-;;;;;;  "sieve" "gnus/sieve.el" (19628 41996))
+;;;;;;  "sieve" "gnus/sieve.el" (19628 47406))
 ;;; Generated autoloads from gnus/sieve.el
 
 (autoload 'sieve-manage "sieve" "\
@@ -24747,7 +25118,7 @@
 ;;;***
 
 ;;;### (autoloads (sieve-mode) "sieve-mode" "gnus/sieve-mode.el"
-;;;;;;  (19583 31640))
+;;;;;;  (19582 65302))
 ;;; Generated autoloads from gnus/sieve-mode.el
 
 (autoload 'sieve-mode "sieve-mode" "\
@@ -24762,8 +25133,8 @@
 
 ;;;***
 
-;;;### (autoloads (simula-mode) "simula" "progmodes/simula.el" (19669
-;;;;;;  58161))
+;;;### (autoloads (simula-mode) "simula" "progmodes/simula.el" (19668
+;;;;;;  19649))
 ;;; Generated autoloads from progmodes/simula.el
 
 (autoload 'simula-mode "simula" "\
@@ -24812,7 +25183,7 @@
 ;;;***
 
 ;;;### (autoloads (skeleton-pair-insert-maybe skeleton-insert skeleton-proxy-new
-;;;;;;  define-skeleton) "skeleton" "skeleton.el" (19677 58077))
+;;;;;;  define-skeleton) "skeleton" "skeleton.el" (19677 38476))
 ;;; Generated autoloads from skeleton.el
 
 (defvar skeleton-filter-function 'identity "\
@@ -24922,7 +25293,7 @@
 ;;;***
 
 ;;;### (autoloads (smerge-start-session smerge-mode smerge-ediff)
-;;;;;;  "smerge-mode" "vc/smerge-mode.el" (19677 58077))
+;;;;;;  "smerge-mode" "vc/smerge-mode.el" (19677 38476))
 ;;; Generated autoloads from vc/smerge-mode.el
 
 (autoload 'smerge-ediff "smerge-mode" "\
@@ -24947,7 +25318,7 @@
 ;;;***
 
 ;;;### (autoloads (smiley-buffer smiley-region) "smiley" "gnus/smiley.el"
-;;;;;;  (19583 31640))
+;;;;;;  (19582 65302))
 ;;; Generated autoloads from gnus/smiley.el
 
 (autoload 'smiley-region "smiley" "\
@@ -24965,7 +25336,7 @@
 ;;;***
 
 ;;;### (autoloads (smtpmail-send-queued-mail smtpmail-send-it) "smtpmail"
-;;;;;;  "mail/smtpmail.el" (19379 23432))
+;;;;;;  "mail/smtpmail.el" (19277 34921))
 ;;; Generated autoloads from mail/smtpmail.el
 
 (autoload 'smtpmail-send-it "smtpmail" "\
@@ -24980,7 +25351,7 @@
 
 ;;;***
 
-;;;### (autoloads (snake) "snake" "play/snake.el" (19379 23432))
+;;;### (autoloads (snake) "snake" "play/snake.el" (19277 34922))
 ;;; Generated autoloads from play/snake.el
 
 (autoload 'snake "snake" "\
@@ -25004,7 +25375,7 @@
 ;;;***
 
 ;;;### (autoloads (snmpv2-mode snmp-mode) "snmp-mode" "net/snmp-mode.el"
-;;;;;;  (19379 23432))
+;;;;;;  (19277 34921))
 ;;; Generated autoloads from net/snmp-mode.el
 
 (autoload 'snmp-mode "snmp-mode" "\
@@ -25034,7 +25405,7 @@
 ;;;***
 
 ;;;### (autoloads (sunrise-sunset) "solar" "calendar/solar.el" (19612
-;;;;;;  3157))
+;;;;;;  4032))
 ;;; Generated autoloads from calendar/solar.el
 
 (autoload 'sunrise-sunset "solar" "\
@@ -25049,8 +25420,8 @@
 
 ;;;***
 
-;;;### (autoloads (solitaire) "solitaire" "play/solitaire.el" (19379
-;;;;;;  23432))
+;;;### (autoloads (solitaire) "solitaire" "play/solitaire.el" (19277
+;;;;;;  34922))
 ;;; Generated autoloads from play/solitaire.el
 
 (autoload 'solitaire "solitaire" "\
@@ -25127,7 +25498,7 @@
 
 ;;;### (autoloads (reverse-region sort-columns sort-regexp-fields
 ;;;;;;  sort-fields sort-numeric-fields sort-pages sort-paragraphs
-;;;;;;  sort-lines sort-subr) "sort" "sort.el" (19669 58161))
+;;;;;;  sort-lines sort-subr) "sort" "sort.el" (19668 19352))
 ;;; Generated autoloads from sort.el
 (put 'sort-fold-case 'safe-local-variable 'booleanp)
 
@@ -25272,7 +25643,7 @@
 ;;;***
 
 ;;;### (autoloads (spam-initialize) "spam" "gnus/spam.el" (19648
-;;;;;;  1980))
+;;;;;;  31344))
 ;;; Generated autoloads from gnus/spam.el
 
 (autoload 'spam-initialize "spam" "\
@@ -25288,7 +25659,7 @@
 
 ;;;### (autoloads (spam-report-deagentize spam-report-agentize spam-report-url-to-file
 ;;;;;;  spam-report-url-ping-mm-url spam-report-process-queue) "spam-report"
-;;;;;;  "gnus/spam-report.el" (19626 28928))
+;;;;;;  "gnus/spam-report.el" (19626 25721))
 ;;; Generated autoloads from gnus/spam-report.el
 
 (autoload 'spam-report-process-queue "spam-report" "\
@@ -25331,7 +25702,7 @@
 ;;;***
 
 ;;;### (autoloads (speedbar-get-focus speedbar-frame-mode) "speedbar"
-;;;;;;  "speedbar.el" (19686 22639))
+;;;;;;  "speedbar.el" (19687 6902))
 ;;; Generated autoloads from speedbar.el
 
 (defalias 'speedbar 'speedbar-frame-mode)
@@ -25356,7 +25727,7 @@
 ;;;***
 
 ;;;### (autoloads (spell-string spell-region spell-word spell-buffer)
-;;;;;;  "spell" "textmodes/spell.el" (19611 13362))
+;;;;;;  "spell" "textmodes/spell.el" (19609 2713))
 ;;; Generated autoloads from textmodes/spell.el
 
 (put 'spell-filter 'risky-local-variable t)
@@ -25400,8 +25771,8 @@
 
 ;;;***
 
-;;;### (autoloads (snarf-spooks spook) "spook" "play/spook.el" (19379
-;;;;;;  23432))
+;;;### (autoloads (snarf-spooks spook) "spook" "play/spook.el" (19277
+;;;;;;  34922))
 ;;; Generated autoloads from play/spook.el
 
 (autoload 'spook "spook" "\
@@ -25420,7 +25791,7 @@
 ;;;;;;  sql-ms sql-ingres sql-solid sql-mysql sql-sqlite sql-informix
 ;;;;;;  sql-sybase sql-oracle sql-product-interactive sql-connect
 ;;;;;;  sql-mode sql-help sql-add-product-keywords) "sql" "progmodes/sql.el"
-;;;;;;  (19661 45226))
+;;;;;;  (19661 46305))
 ;;; Generated autoloads from progmodes/sql.el
 
 (autoload 'sql-add-product-keywords "sql" "\
@@ -25916,7 +26287,7 @@
 ;;;***
 
 ;;;### (autoloads (srecode-template-mode) "srecode/srt-mode" "cedet/srecode/srt-mode.el"
-;;;;;;  (19379 23432))
+;;;;;;  (19277 34919))
 ;;; Generated autoloads from cedet/srecode/srt-mode.el
 
 (autoload 'srecode-template-mode "srecode/srt-mode" "\
@@ -25929,7 +26300,7 @@
 ;;;***
 
 ;;;### (autoloads (starttls-open-stream) "starttls" "gnus/starttls.el"
-;;;;;;  (19613 16556))
+;;;;;;  (19614 24990))
 ;;; Generated autoloads from gnus/starttls.el
 
 (autoload 'starttls-open-stream "starttls" "\
@@ -25956,8 +26327,8 @@
 ;;;;;;  strokes-mode strokes-list-strokes strokes-load-user-strokes
 ;;;;;;  strokes-help strokes-describe-stroke strokes-do-complex-stroke
 ;;;;;;  strokes-do-stroke strokes-read-complex-stroke strokes-read-stroke
-;;;;;;  strokes-global-set-stroke) "strokes" "strokes.el" (19379
-;;;;;;  23432))
+;;;;;;  strokes-global-set-stroke) "strokes" "strokes.el" (19277
+;;;;;;  34917))
 ;;; Generated autoloads from strokes.el
 
 (autoload 'strokes-global-set-stroke "strokes" "\
@@ -26067,7 +26438,7 @@
 ;;;***
 
 ;;;### (autoloads (studlify-buffer studlify-word studlify-region)
-;;;;;;  "studly" "play/studly.el" (19379 23432))
+;;;;;;  "studly" "play/studly.el" (19267 61660))
 ;;; Generated autoloads from play/studly.el
 
 (autoload 'studlify-region "studly" "\
@@ -26088,7 +26459,7 @@
 ;;;***
 
 ;;;### (autoloads (global-subword-mode subword-mode) "subword" "progmodes/subword.el"
-;;;;;;  (19447 3689))
+;;;;;;  (19445 54332))
 ;;; Generated autoloads from progmodes/subword.el
 
 (autoload 'subword-mode "subword" "\
@@ -26136,7 +26507,7 @@
 ;;;***
 
 ;;;### (autoloads (sc-cite-original) "supercite" "mail/supercite.el"
-;;;;;;  (19425 7399))
+;;;;;;  (19426 22841))
 ;;; Generated autoloads from mail/supercite.el
 
 (autoload 'sc-cite-original "supercite" "\
@@ -26168,8 +26539,8 @@
 
 ;;;***
 
-;;;### (autoloads (gpm-mouse-mode) "t-mouse" "t-mouse.el" (19379
-;;;;;;  23432))
+;;;### (autoloads (gpm-mouse-mode) "t-mouse" "t-mouse.el" (19277
+;;;;;;  34917))
 ;;; Generated autoloads from t-mouse.el
 
 (define-obsolete-function-alias 't-mouse-mode 'gpm-mouse-mode "23.1")
@@ -26196,7 +26567,7 @@
 
 ;;;***
 
-;;;### (autoloads (tabify untabify) "tabify" "tabify.el" (19578 56905))
+;;;### (autoloads (tabify untabify) "tabify" "tabify.el" (19580 19536))
 ;;; Generated autoloads from tabify.el
 
 (autoload 'untabify "tabify" "\
@@ -26231,7 +26602,7 @@
 ;;;;;;  table-recognize table-insert-row-column table-insert-column
 ;;;;;;  table-insert-row table-insert table-point-left-cell-hook
 ;;;;;;  table-point-entered-cell-hook table-load-hook table-cell-map-hook)
-;;;;;;  "table" "textmodes/table.el" (19669 58161))
+;;;;;;  "table" "textmodes/table.el" (19668 19553))
 ;;; Generated autoloads from textmodes/table.el
 
 (defvar table-cell-map-hook nil "\
@@ -26819,7 +27190,7 @@
 
 ;;;***
 
-;;;### (autoloads (talk talk-connect) "talk" "talk.el" (19379 23432))
+;;;### (autoloads (talk talk-connect) "talk" "talk.el" (19277 34917))
 ;;; Generated autoloads from talk.el
 
 (autoload 'talk-connect "talk" "\
@@ -26834,7 +27205,7 @@
 
 ;;;***
 
-;;;### (autoloads (tar-mode) "tar-mode" "tar-mode.el" (19617 8027))
+;;;### (autoloads (tar-mode) "tar-mode" "tar-mode.el" (19617 12132))
 ;;; Generated autoloads from tar-mode.el
 
 (autoload 'tar-mode "tar-mode" "\
@@ -26858,7 +27229,7 @@
 ;;;***
 
 ;;;### (autoloads (tcl-help-on-word inferior-tcl tcl-mode) "tcl"
-;;;;;;  "progmodes/tcl.el" (19675 9114))
+;;;;;;  "progmodes/tcl.el" (19673 45510))
 ;;; Generated autoloads from progmodes/tcl.el
 
 (autoload 'tcl-mode "tcl" "\
@@ -26909,7 +27280,7 @@
 
 ;;;***
 
-;;;### (autoloads (rsh telnet) "telnet" "net/telnet.el" (19635 52116))
+;;;### (autoloads (rsh telnet) "telnet" "net/telnet.el" (19635 50595))
 ;;; Generated autoloads from net/telnet.el
  (add-hook 'same-window-regexps (purecopy "\\*telnet-.*\\*\\(\\|<[0-9]+>\\)"))
 
@@ -26937,7 +27308,7 @@
 ;;;***
 
 ;;;### (autoloads (serial-term ansi-term term make-term) "term" "term.el"
-;;;;;;  (19675 9114))
+;;;;;;  (19672 56753))
 ;;; Generated autoloads from term.el
 
 (autoload 'make-term "term" "\
@@ -26979,8 +27350,8 @@
 
 ;;;***
 
-;;;### (autoloads (terminal-emulator) "terminal" "terminal.el" (19379
-;;;;;;  23432))
+;;;### (autoloads (terminal-emulator) "terminal" "terminal.el" (19277
+;;;;;;  34917))
 ;;; Generated autoloads from terminal.el
 
 (autoload 'terminal-emulator "terminal" "\
@@ -27017,7 +27388,7 @@
 ;;;***
 
 ;;;### (autoloads (testcover-this-defun) "testcover" "emacs-lisp/testcover.el"
-;;;;;;  (19379 23432))
+;;;;;;  (19277 34919))
 ;;; Generated autoloads from emacs-lisp/testcover.el
 
 (autoload 'testcover-this-defun "testcover" "\
@@ -27027,7 +27398,7 @@
 
 ;;;***
 
-;;;### (autoloads (tetris) "tetris" "play/tetris.el" (19664 28584))
+;;;### (autoloads (tetris) "tetris" "play/tetris.el" (19552 37739))
 ;;; Generated autoloads from play/tetris.el
 
 (autoload 'tetris "tetris" "\
@@ -27058,7 +27429,7 @@
 ;;;;;;  tex-start-commands tex-start-options slitex-run-command latex-run-command
 ;;;;;;  tex-run-command tex-offer-save tex-main-file tex-first-line-header-regexp
 ;;;;;;  tex-directory tex-shell-file-name) "tex-mode" "textmodes/tex-mode.el"
-;;;;;;  (19652 27168))
+;;;;;;  (19651 33965))
 ;;; Generated autoloads from textmodes/tex-mode.el
 
 (defvar tex-shell-file-name nil "\
@@ -27360,7 +27731,7 @@
 ;;;***
 
 ;;;### (autoloads (texi2info texinfo-format-region texinfo-format-buffer)
-;;;;;;  "texinfmt" "textmodes/texinfmt.el" (19675 9114))
+;;;;;;  "texinfmt" "textmodes/texinfmt.el" (19673 38854))
 ;;; Generated autoloads from textmodes/texinfmt.el
 
 (autoload 'texinfo-format-buffer "texinfmt" "\
@@ -27400,7 +27771,7 @@
 ;;;***
 
 ;;;### (autoloads (texinfo-mode texinfo-close-quote texinfo-open-quote)
-;;;;;;  "texinfo" "textmodes/texinfo.el" (19595 20656))
+;;;;;;  "texinfo" "textmodes/texinfo.el" (19594 48841))
 ;;; Generated autoloads from textmodes/texinfo.el
 
 (defvar texinfo-open-quote (purecopy "``") "\
@@ -27486,7 +27857,7 @@
 
 ;;;### (autoloads (thai-composition-function thai-compose-buffer
 ;;;;;;  thai-compose-string thai-compose-region) "thai-util" "language/thai-util.el"
-;;;;;;  (19379 23432))
+;;;;;;  (19277 34921))
 ;;; Generated autoloads from language/thai-util.el
 
 (autoload 'thai-compose-region "thai-util" "\
@@ -27515,7 +27886,7 @@
 
 ;;;### (autoloads (list-at-point number-at-point symbol-at-point
 ;;;;;;  sexp-at-point thing-at-point bounds-of-thing-at-point forward-thing)
-;;;;;;  "thingatpt" "thingatpt.el" (19379 23432))
+;;;;;;  "thingatpt" "thingatpt.el" (19277 34917))
 ;;; Generated autoloads from thingatpt.el
 
 (autoload 'forward-thing "thingatpt" "\
@@ -27572,7 +27943,7 @@
 
 ;;;### (autoloads (thumbs-dired-setroot thumbs-dired-show thumbs-dired-show-marked
 ;;;;;;  thumbs-show-from-dir thumbs-find-thumb) "thumbs" "thumbs.el"
-;;;;;;  (19379 23432))
+;;;;;;  (19277 34917))
 ;;; Generated autoloads from thumbs.el
 
 (autoload 'thumbs-find-thumb "thumbs" "\
@@ -27610,8 +27981,8 @@
 ;;;;;;  tibetan-post-read-conversion tibetan-compose-buffer tibetan-decompose-buffer
 ;;;;;;  tibetan-decompose-string tibetan-decompose-region tibetan-compose-region
 ;;;;;;  tibetan-compose-string tibetan-transcription-to-tibetan tibetan-tibetan-to-transcription
-;;;;;;  tibetan-char-p) "tibet-util" "language/tibet-util.el" (19379
-;;;;;;  23432))
+;;;;;;  tibetan-char-p) "tibet-util" "language/tibet-util.el" (19277
+;;;;;;  34921))
 ;;; Generated autoloads from language/tibet-util.el
 
 (autoload 'tibetan-char-p "tibet-util" "\
@@ -27685,7 +28056,7 @@
 ;;;***
 
 ;;;### (autoloads (tildify-buffer tildify-region) "tildify" "textmodes/tildify.el"
-;;;;;;  (19379 23432))
+;;;;;;  (19277 34923))
 ;;; Generated autoloads from textmodes/tildify.el
 
 (autoload 'tildify-region "tildify" "\
@@ -27710,7 +28081,7 @@
 
 ;;;### (autoloads (emacs-init-time emacs-uptime display-time-world
 ;;;;;;  display-time-mode display-time display-time-day-and-date)
-;;;;;;  "time" "time.el" (19623 14869))
+;;;;;;  "time" "time.el" (19623 51891))
 ;;; Generated autoloads from time.el
 
 (defvar display-time-day-and-date nil "\
@@ -27773,7 +28144,7 @@
 ;;;;;;  time-to-day-in-year date-leap-year-p days-between date-to-day
 ;;;;;;  time-add time-subtract time-since days-to-time time-less-p
 ;;;;;;  seconds-to-time date-to-time) "time-date" "calendar/time-date.el"
-;;;;;;  (19675 9114))
+;;;;;;  (19672 47874))
 ;;; Generated autoloads from calendar/time-date.el
 
 (autoload 'date-to-time "time-date" "\
@@ -27887,7 +28258,7 @@
 ;;;***
 
 ;;;### (autoloads (time-stamp-toggle-active time-stamp) "time-stamp"
-;;;;;;  "time-stamp.el" (19379 23432))
+;;;;;;  "time-stamp.el" (19277 34917))
 ;;; Generated autoloads from time-stamp.el
 (put 'time-stamp-format 'safe-local-variable 'stringp)
 (put 'time-stamp-time-zone 'safe-local-variable 'string-or-null-p)
@@ -27931,7 +28302,7 @@
 ;;;;;;  timeclock-workday-remaining-string timeclock-reread-log timeclock-query-out
 ;;;;;;  timeclock-change timeclock-status-string timeclock-out timeclock-in
 ;;;;;;  timeclock-modeline-display) "timeclock" "calendar/timeclock.el"
-;;;;;;  (19675 9114))
+;;;;;;  (19674 6793))
 ;;; Generated autoloads from calendar/timeclock.el
 
 (autoload 'timeclock-modeline-display "timeclock" "\
@@ -28031,7 +28402,7 @@
 ;;;***
 
 ;;;### (autoloads (batch-titdic-convert titdic-convert) "titdic-cnv"
-;;;;;;  "international/titdic-cnv.el" (19638 63299))
+;;;;;;  "international/titdic-cnv.el" (19639 17158))
 ;;; Generated autoloads from international/titdic-cnv.el
 
 (autoload 'titdic-convert "titdic-cnv" "\
@@ -28054,7 +28425,7 @@
 ;;;***
 
 ;;;### (autoloads (tmm-prompt tmm-menubar-mouse tmm-menubar) "tmm"
-;;;;;;  "tmm.el" (19404 27319))
+;;;;;;  "tmm.el" (19406 15657))
 ;;; Generated autoloads from tmm.el
  (define-key global-map "\M-`" 'tmm-menubar)
  (define-key global-map [menu-bar mouse-1] 'tmm-menubar-mouse)
@@ -28094,7 +28465,7 @@
 
 ;;;### (autoloads (todo-show todo-cp todo-mode todo-print todo-top-priorities
 ;;;;;;  todo-insert-item todo-add-item-non-interactively todo-add-category)
-;;;;;;  "todo-mode" "calendar/todo-mode.el" (19398 25564))
+;;;;;;  "todo-mode" "calendar/todo-mode.el" (19672 18325))
 ;;; Generated autoloads from calendar/todo-mode.el
 
 (autoload 'todo-add-category "todo-mode" "\
@@ -28152,8 +28523,80 @@
 
 ;;;***
 
+;;;### (autoloads (tool-bar-local-item-from-menu tool-bar-add-item-from-menu
+;;;;;;  tool-bar-local-item tool-bar-add-item toggle-tool-bar-mode-from-frame)
+;;;;;;  "tool-bar" "tool-bar.el" (19691 3508))
+;;; Generated autoloads from tool-bar.el
+
+(autoload 'toggle-tool-bar-mode-from-frame "tool-bar" "\
+Toggle tool bar on or off, based on the status of the current frame.
+See `tool-bar-mode' for more information.
+
+\(fn &optional ARG)" t nil)
+
+(autoload 'tool-bar-add-item "tool-bar" "\
+Add an item to the tool bar.
+ICON names the image, DEF is the key definition and KEY is a symbol
+for the fake function key in the menu keymap.  Remaining arguments
+PROPS are additional items to add to the menu item specification.  See
+Info node `(elisp)Tool Bar'.  Items are added from left to right.
+
+ICON is the base name of a file containing the image to use.  The
+function will first try to use low-color/ICON.xpm if `display-color-cells'
+is less or equal to 256, then ICON.xpm, then ICON.pbm, and finally
+ICON.xbm, using `find-image'.
+
+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'.
+
+\(fn ICON DEF KEY &rest PROPS)" nil nil)
+
+(autoload 'tool-bar-local-item "tool-bar" "\
+Add an item to the tool bar in map MAP.
+ICON names the image, DEF is the key definition and KEY is a symbol
+for the fake function key in the menu keymap.  Remaining arguments
+PROPS are additional items to add to the menu item specification.  See
+Info node `(elisp)Tool Bar'.  Items are added from left to right.
+
+ICON is the base name of a file containing the image to use.  The
+function will first try to use low-color/ICON.xpm if `display-color-cells'
+is less or equal to 256, then ICON.xpm, then ICON.pbm, and finally
+ICON.xbm, using `find-image'.
+
+\(fn ICON DEF KEY MAP &rest PROPS)" nil nil)
+
+(autoload 'tool-bar-add-item-from-menu "tool-bar" "\
+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
+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.
+
+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-from-menu'.
+
+\(fn COMMAND ICON &optional MAP &rest PROPS)" nil nil)
+
+(autoload 'tool-bar-local-item-from-menu "tool-bar" "\
+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.
+
+FROM-MAP must contain appropriate binding for `[menu-bar]' which
+holds a keymap.
+
+\(fn COMMAND ICON IN-MAP &optional FROM-MAP &rest PROPS)" nil nil)
+
+;;;***
+
 ;;;### (autoloads (tpu-edt-on tpu-edt-mode) "tpu-edt" "emulation/tpu-edt.el"
-;;;;;;  (19675 12103))
+;;;;;;  (19674 8635))
 ;;; Generated autoloads from emulation/tpu-edt.el
 
 (defvar tpu-edt-mode nil "\
@@ -28180,7 +28623,7 @@
 ;;;***
 
 ;;;### (autoloads (tpu-mapper) "tpu-mapper" "emulation/tpu-mapper.el"
-;;;;;;  (19578 56905))
+;;;;;;  (19580 19536))
 ;;; Generated autoloads from emulation/tpu-mapper.el
 
 (autoload 'tpu-mapper "tpu-mapper" "\
@@ -28214,7 +28657,7 @@
 
 ;;;***
 
-;;;### (autoloads (tq-create) "tq" "emacs-lisp/tq.el" (19379 23432))
+;;;### (autoloads (tq-create) "tq" "emacs-lisp/tq.el" (19277 34919))
 ;;; Generated autoloads from emacs-lisp/tq.el
 
 (autoload 'tq-create "tq" "\
@@ -28228,7 +28671,7 @@
 ;;;***
 
 ;;;### (autoloads (trace-function-background trace-function trace-buffer)
-;;;;;;  "trace" "emacs-lisp/trace.el" (19379 23432))
+;;;;;;  "trace" "emacs-lisp/trace.el" (19370 23595))
 ;;; Generated autoloads from emacs-lisp/trace.el
 
 (defvar trace-buffer (purecopy "*trace-output*") "\
@@ -28265,7 +28708,7 @@
 ;;;### (autoloads (tramp-unload-tramp tramp-completion-handle-file-name-completion
 ;;;;;;  tramp-completion-handle-file-name-all-completions tramp-unload-file-name-handlers
 ;;;;;;  tramp-file-name-handler tramp-syntax tramp-mode) "tramp"
-;;;;;;  "net/tramp.el" (19681 9924))
+;;;;;;  "net/tramp.el" (19691 3508))
 ;;; Generated autoloads from net/tramp.el
 
 (defvar tramp-mode t "\
@@ -28403,7 +28846,7 @@
 ;;;***
 
 ;;;### (autoloads (tramp-ftp-enable-ange-ftp) "tramp-ftp" "net/tramp-ftp.el"
-;;;;;;  (19598 20570))
+;;;;;;  (19599 45674))
 ;;; Generated autoloads from net/tramp-ftp.el
 
 (autoload 'tramp-ftp-enable-ange-ftp "tramp-ftp" "\
@@ -28413,8 +28856,8 @@
 
 ;;;***
 
-;;;### (autoloads (help-with-tutorial) "tutorial" "tutorial.el" (19578
-;;;;;;  56905))
+;;;### (autoloads (help-with-tutorial) "tutorial" "tutorial.el" (19580
+;;;;;;  19536))
 ;;; Generated autoloads from tutorial.el
 
 (autoload 'help-with-tutorial "tutorial" "\
@@ -28439,7 +28882,7 @@
 ;;;***
 
 ;;;### (autoloads (tai-viet-composition-function) "tv-util" "language/tv-util.el"
-;;;;;;  (19520 54552))
+;;;;;;  (19515 27412))
 ;;; Generated autoloads from language/tv-util.el
 
 (autoload 'tai-viet-composition-function "tv-util" "\
@@ -28450,7 +28893,7 @@
 ;;;***
 
 ;;;### (autoloads (2C-split 2C-associate-buffer 2C-two-columns) "two-column"
-;;;;;;  "textmodes/two-column.el" (19611 13362))
+;;;;;;  "textmodes/two-column.el" (19609 2643))
 ;;; Generated autoloads from textmodes/two-column.el
  (autoload '2C-command "two-column" () t 'keymap)
  (global-set-key "\C-x6" '2C-command)
@@ -28501,7 +28944,7 @@
 ;;;;;;  type-break type-break-mode type-break-keystroke-threshold
 ;;;;;;  type-break-good-break-interval type-break-good-rest-interval
 ;;;;;;  type-break-interval type-break-mode) "type-break" "type-break.el"
-;;;;;;  (19669 58161))
+;;;;;;  (19668 18229))
 ;;; Generated autoloads from type-break.el
 
 (defvar type-break-mode nil "\
@@ -28683,7 +29126,7 @@
 
 ;;;***
 
-;;;### (autoloads (uce-reply-to-uce) "uce" "mail/uce.el" (19379 23432))
+;;;### (autoloads (uce-reply-to-uce) "uce" "mail/uce.el" (19277 34921))
 ;;; Generated autoloads from mail/uce.el
 
 (autoload 'uce-reply-to-uce "uce" "\
@@ -28701,7 +29144,7 @@
 ;;;;;;  ucs-normalize-NFKC-string ucs-normalize-NFKC-region ucs-normalize-NFKD-string
 ;;;;;;  ucs-normalize-NFKD-region ucs-normalize-NFC-string ucs-normalize-NFC-region
 ;;;;;;  ucs-normalize-NFD-string ucs-normalize-NFD-region) "ucs-normalize"
-;;;;;;  "international/ucs-normalize.el" (19599 55780))
+;;;;;;  "international/ucs-normalize.el" (19600 6790))
 ;;; Generated autoloads from international/ucs-normalize.el
 
 (autoload 'ucs-normalize-NFD-region "ucs-normalize" "\
@@ -28767,7 +29210,7 @@
 ;;;***
 
 ;;;### (autoloads (ununderline-region underline-region) "underline"
-;;;;;;  "textmodes/underline.el" (19379 23432))
+;;;;;;  "textmodes/underline.el" (19277 34923))
 ;;; Generated autoloads from textmodes/underline.el
 
 (autoload 'underline-region "underline" "\
@@ -28788,7 +29231,7 @@
 ;;;***
 
 ;;;### (autoloads (unrmail batch-unrmail) "unrmail" "mail/unrmail.el"
-;;;;;;  (19379 23432))
+;;;;;;  (19277 34921))
 ;;; Generated autoloads from mail/unrmail.el
 
 (autoload 'batch-unrmail "unrmail" "\
@@ -28808,7 +29251,7 @@
 ;;;***
 
 ;;;### (autoloads (unsafep) "unsafep" "emacs-lisp/unsafep.el" (19645
-;;;;;;  32682))
+;;;;;;  60484))
 ;;; Generated autoloads from emacs-lisp/unsafep.el
 
 (autoload 'unsafep "unsafep" "\
@@ -28821,7 +29264,7 @@
 ;;;***
 
 ;;;### (autoloads (url-retrieve-synchronously url-retrieve) "url"
-;;;;;;  "url/url.el" (19623 4932))
+;;;;;;  "url/url.el" (19622 39471))
 ;;; Generated autoloads from url/url.el
 
 (autoload 'url-retrieve "url" "\
@@ -28863,7 +29306,7 @@
 ;;;***
 
 ;;;### (autoloads (url-register-auth-scheme url-get-authentication)
-;;;;;;  "url-auth" "url/url-auth.el" (19379 23432))
+;;;;;;  "url-auth" "url/url-auth.el" (19277 34923))
 ;;; Generated autoloads from url/url-auth.el
 
 (autoload 'url-get-authentication "url-auth" "\
@@ -28905,7 +29348,7 @@
 ;;;***
 
 ;;;### (autoloads (url-cache-extract url-is-cached url-store-in-cache)
-;;;;;;  "url-cache" "url/url-cache.el" (19625 7291))
+;;;;;;  "url-cache" "url/url-cache.el" (19624 63510))
 ;;; Generated autoloads from url/url-cache.el
 
 (autoload 'url-store-in-cache "url-cache" "\
@@ -28926,7 +29369,7 @@
 
 ;;;***
 
-;;;### (autoloads (url-cid) "url-cid" "url/url-cid.el" (19379 23432))
+;;;### (autoloads (url-cid) "url-cid" "url/url-cid.el" (19277 34923))
 ;;; Generated autoloads from url/url-cid.el
 
 (autoload 'url-cid "url-cid" "\
@@ -28937,7 +29380,7 @@
 ;;;***
 
 ;;;### (autoloads (url-dav-vc-registered url-dav-supported-p) "url-dav"
-;;;;;;  "url/url-dav.el" (19379 23432))
+;;;;;;  "url/url-dav.el" (19277 34923))
 ;;; Generated autoloads from url/url-dav.el
 
 (autoload 'url-dav-supported-p "url-dav" "\
@@ -28952,8 +29395,8 @@
 
 ;;;***
 
-;;;### (autoloads (url-file) "url-file" "url/url-file.el" (19686
-;;;;;;  22639))
+;;;### (autoloads (url-file) "url-file" "url/url-file.el" (19687
+;;;;;;  6902))
 ;;; Generated autoloads from url/url-file.el
 
 (autoload 'url-file "url-file" "\
@@ -28964,7 +29407,7 @@
 ;;;***
 
 ;;;### (autoloads (url-open-stream url-gateway-nslookup-host) "url-gw"
-;;;;;;  "url/url-gw.el" (19639 32022))
+;;;;;;  "url/url-gw.el" (19645 60484))
 ;;; Generated autoloads from url/url-gw.el
 
 (autoload 'url-gateway-nslookup-host "url-gw" "\
@@ -28984,7 +29427,7 @@
 
 ;;;### (autoloads (url-insert-file-contents url-file-local-copy url-copy-file
 ;;;;;;  url-file-handler url-handler-mode) "url-handlers" "url/url-handlers.el"
-;;;;;;  (19379 23432))
+;;;;;;  (19277 34923))
 ;;; Generated autoloads from url/url-handlers.el
 
 (defvar url-handler-mode nil "\
@@ -29036,7 +29479,7 @@
 ;;;***
 
 ;;;### (autoloads (url-http-options url-http-file-attributes url-http-file-exists-p
-;;;;;;  url-http) "url-http" "url/url-http.el" (19629 52252))
+;;;;;;  url-http) "url-http" "url/url-http.el" (19630 1041))
 ;;; Generated autoloads from url/url-http.el
 
 (autoload 'url-http "url-http" "\
@@ -29102,7 +29545,7 @@
 
 ;;;***
 
-;;;### (autoloads (url-irc) "url-irc" "url/url-irc.el" (19595 20656))
+;;;### (autoloads (url-irc) "url-irc" "url/url-irc.el" (19594 47996))
 ;;; Generated autoloads from url/url-irc.el
 
 (autoload 'url-irc "url-irc" "\
@@ -29112,8 +29555,8 @@
 
 ;;;***
 
-;;;### (autoloads (url-ldap) "url-ldap" "url/url-ldap.el" (19379
-;;;;;;  23432))
+;;;### (autoloads (url-ldap) "url-ldap" "url/url-ldap.el" (19277
+;;;;;;  34923))
 ;;; Generated autoloads from url/url-ldap.el
 
 (autoload 'url-ldap "url-ldap" "\
@@ -29127,7 +29570,7 @@
 ;;;***
 
 ;;;### (autoloads (url-mailto url-mail) "url-mailto" "url/url-mailto.el"
-;;;;;;  (19379 23432))
+;;;;;;  (19277 34923))
 ;;; Generated autoloads from url/url-mailto.el
 
 (autoload 'url-mail "url-mailto" "\
@@ -29143,7 +29586,7 @@
 ;;;***
 
 ;;;### (autoloads (url-data url-generic-emulator-loader url-info
-;;;;;;  url-man) "url-misc" "url/url-misc.el" (19379 23432))
+;;;;;;  url-man) "url-misc" "url/url-misc.el" (19277 34923))
 ;;; Generated autoloads from url/url-misc.el
 
 (autoload 'url-man "url-misc" "\
@@ -29175,7 +29618,7 @@
 ;;;***
 
 ;;;### (autoloads (url-snews url-news) "url-news" "url/url-news.el"
-;;;;;;  (19379 23432))
+;;;;;;  (19277 34923))
 ;;; Generated autoloads from url/url-news.el
 
 (autoload 'url-news "url-news" "\
@@ -29192,7 +29635,7 @@
 
 ;;;### (autoloads (url-ns-user-pref url-ns-prefs isInNet isResolvable
 ;;;;;;  dnsResolve dnsDomainIs isPlainHostName) "url-ns" "url/url-ns.el"
-;;;;;;  (19379 23432))
+;;;;;;  (19277 34923))
 ;;; Generated autoloads from url/url-ns.el
 
 (autoload 'isPlainHostName "url-ns" "\
@@ -29233,7 +29676,7 @@
 ;;;***
 
 ;;;### (autoloads (url-generic-parse-url url-recreate-url) "url-parse"
-;;;;;;  "url/url-parse.el" (19623 4932))
+;;;;;;  "url/url-parse.el" (19622 39471))
 ;;; Generated autoloads from url/url-parse.el
 
 (autoload 'url-recreate-url "url-parse" "\
@@ -29251,7 +29694,7 @@
 ;;;***
 
 ;;;### (autoloads (url-setup-privacy-info) "url-privacy" "url/url-privacy.el"
-;;;;;;  (19379 23432))
+;;;;;;  (19277 34923))
 ;;; Generated autoloads from url/url-privacy.el
 
 (autoload 'url-setup-privacy-info "url-privacy" "\
@@ -29267,7 +29710,7 @@
 ;;;;;;  url-pretty-length url-strip-leading-spaces url-eat-trailing-space
 ;;;;;;  url-get-normalized-date url-lazy-message url-normalize-url
 ;;;;;;  url-insert-entities-in-string url-parse-args url-debug url-debug)
-;;;;;;  "url-util" "url/url-util.el" (19625 7291))
+;;;;;;  "url-util" "url/url-util.el" (19624 63510))
 ;;; Generated autoloads from url/url-util.el
 
 (defvar url-debug nil "\
@@ -29403,7 +29846,7 @@
 ;;;***
 
 ;;;### (autoloads (ask-user-about-supersession-threat ask-user-about-lock)
-;;;;;;  "userlock" "userlock.el" (19379 23432))
+;;;;;;  "userlock" "userlock.el" (19277 34917))
 ;;; Generated autoloads from userlock.el
 
 (autoload 'ask-user-about-lock "userlock" "\
@@ -29433,7 +29876,7 @@
 
 ;;;### (autoloads (utf-7-imap-pre-write-conversion utf-7-pre-write-conversion
 ;;;;;;  utf-7-imap-post-read-conversion utf-7-post-read-conversion)
-;;;;;;  "utf-7" "international/utf-7.el" (19451 41962))
+;;;;;;  "utf-7" "international/utf-7.el" (19451 17238))
 ;;; Generated autoloads from international/utf-7.el
 
 (autoload 'utf-7-post-read-conversion "utf-7" "\
@@ -29458,7 +29901,7 @@
 
 ;;;***
 
-;;;### (autoloads (utf7-encode) "utf7" "gnus/utf7.el" (19618 61033))
+;;;### (autoloads (utf7-encode) "utf7" "gnus/utf7.el" (19618 38629))
 ;;; Generated autoloads from gnus/utf7.el
 
 (autoload 'utf7-encode "utf7" "\
@@ -29470,7 +29913,7 @@
 
 ;;;### (autoloads (uudecode-decode-region uudecode-decode-region-internal
 ;;;;;;  uudecode-decode-region-external) "uudecode" "mail/uudecode.el"
-;;;;;;  (19583 31640))
+;;;;;;  (19582 65302))
 ;;; Generated autoloads from mail/uudecode.el
 
 (autoload 'uudecode-decode-region-external "uudecode" "\
@@ -29500,7 +29943,7 @@
 ;;;;;;  vc-print-log vc-retrieve-tag vc-create-tag vc-merge vc-insert-headers
 ;;;;;;  vc-revision-other-window vc-root-diff vc-diff vc-version-diff
 ;;;;;;  vc-register vc-next-action vc-before-checkin-hook vc-checkin-hook
-;;;;;;  vc-checkout-hook) "vc" "vc/vc.el" (19677 58077))
+;;;;;;  vc-checkout-hook) "vc" "vc/vc.el" (19693 26133))
 ;;; Generated autoloads from vc/vc.el
 
 (defvar vc-checkout-hook nil "\
@@ -29613,13 +30056,17 @@
 \(fn)" t nil)
 
 (autoload 'vc-merge "vc" "\
-Merge changes between two revisions into the current buffer's file.
-This asks for two revisions to merge from in the minibuffer.  If the
-first revision is a branch number, then merge all changes from that
-branch.  If the first revision is empty, merge news, i.e. recent changes
-from the current branch.
-
-See Info node `Merging'.
+Perform a version control merge operation.
+On a distributed version control system, this runs a \"merge\"
+operation to incorporate changes from another branch onto the
+current branch, prompting for an argument list.
+
+On a non-distributed version control system, this merges changes
+between two revisions into the current fileset.  This asks for
+two revisions to merge from in the minibuffer.  If the first
+revision is a branch number, then merge all changes from that
+branch.  If the first revision is empty, merge the most recent
+changes from the current branch.
 
 \(fn)" t nil)
 
@@ -29691,13 +30138,20 @@
 (define-obsolete-function-alias 'vc-revert-buffer 'vc-revert "23.1")
 
 (autoload 'vc-update "vc" "\
-Update the current fileset's files to their tip revisions.
-For each one that contains no changes, and is not locked, then this simply
-replaces the work file with the latest revision on its branch.  If the file
-contains changes, and the backend supports merging news, then any recent
-changes from the current branch are merged into the working file.
-
-\(fn)" t nil)
+Update the current fileset or branch.
+On a distributed version control system, this runs a \"pull\"
+operation to update the current branch, prompting for an argument
+list if required.  Optional prefix ARG forces a prompt.
+
+On a non-distributed version control system, update the current
+fileset to the tip revisions.  For each unchanged and unlocked
+file, this simply replaces the work file with the latest revision
+on its branch.  If the file contains changes, any changes in the
+tip revision are merged into the working file.
+
+\(fn &optional ARG)" t nil)
+
+(defalias 'vc-pull 'vc-update)
 
 (autoload 'vc-switch-backend "vc" "\
 Make BACKEND the current version control system for FILE.
@@ -29755,7 +30209,7 @@
 ;;;***
 
 ;;;### (autoloads (vc-annotate) "vc-annotate" "vc/vc-annotate.el"
-;;;;;;  (19578 56905))
+;;;;;;  (19580 19536))
 ;;; Generated autoloads from vc/vc-annotate.el
 
 (autoload 'vc-annotate "vc-annotate" "\
@@ -29792,7 +30246,7 @@
 
 ;;;***
 
-;;;### (autoloads nil "vc-arch" "vc/vc-arch.el" (19662 54456))
+;;;### (autoloads nil "vc-arch" "vc/vc-arch.el" (19662 23188))
 ;;; Generated autoloads from vc/vc-arch.el
  (defun vc-arch-registered (file)
   (if (vc-find-root file "{arch}/=tagging-method")
@@ -29802,7 +30256,7 @@
 
 ;;;***
 
-;;;### (autoloads nil "vc-bzr" "vc/vc-bzr.el" (19578 56905))
+;;;### (autoloads nil "vc-bzr" "vc/vc-bzr.el" (19693 26133))
 ;;; Generated autoloads from vc/vc-bzr.el
 
 (defconst vc-bzr-admin-dirname ".bzr" "\
@@ -29817,7 +30271,7 @@
 
 ;;;***
 
-;;;### (autoloads nil "vc-cvs" "vc/vc-cvs.el" (19662 54456))
+;;;### (autoloads nil "vc-cvs" "vc/vc-cvs.el" (19662 23188))
 ;;; Generated autoloads from vc/vc-cvs.el
  (defun vc-cvs-registered (f)
   (when (file-readable-p (expand-file-name
@@ -29827,7 +30281,7 @@
 
 ;;;***
 
-;;;### (autoloads (vc-dir) "vc-dir" "vc/vc-dir.el" (19578 56905))
+;;;### (autoloads (vc-dir) "vc-dir" "vc/vc-dir.el" (19580 19536))
 ;;; Generated autoloads from vc/vc-dir.el
 
 (autoload 'vc-dir "vc-dir" "\
@@ -29852,7 +30306,7 @@
 ;;;***
 
 ;;;### (autoloads (vc-do-command) "vc-dispatcher" "vc/vc-dispatcher.el"
-;;;;;;  (19578 56905))
+;;;;;;  (19580 19536))
 ;;; Generated autoloads from vc/vc-dispatcher.el
 
 (autoload 'vc-do-command "vc-dispatcher" "\
@@ -29875,7 +30329,7 @@
 
 ;;;***
 
-;;;### (autoloads nil "vc-git" "vc/vc-git.el" (19578 56905))
+;;;### (autoloads nil "vc-git" "vc/vc-git.el" (19580 19536))
 ;;; Generated autoloads from vc/vc-git.el
  (defun vc-git-registered (file)
   "Return non-nil if FILE is registered with git."
@@ -29886,7 +30340,7 @@
 
 ;;;***
 
-;;;### (autoloads nil "vc-hg" "vc/vc-hg.el" (19686 22639))
+;;;### (autoloads nil "vc-hg" "vc/vc-hg.el" (19687 6902))
 ;;; Generated autoloads from vc/vc-hg.el
  (defun vc-hg-registered (file)
   "Return non-nil if FILE is registered with hg."
@@ -29897,7 +30351,7 @@
 
 ;;;***
 
-;;;### (autoloads nil "vc-mtn" "vc/vc-mtn.el" (19675 9114))
+;;;### (autoloads nil "vc-mtn" "vc/vc-mtn.el" (19673 45510))
 ;;; Generated autoloads from vc/vc-mtn.el
 
 (defconst vc-mtn-admin-dir "_MTN")
@@ -29912,7 +30366,7 @@
 ;;;***
 
 ;;;### (autoloads (vc-rcs-master-templates) "vc-rcs" "vc/vc-rcs.el"
-;;;;;;  (19662 54456))
+;;;;;;  (19662 23188))
 ;;; Generated autoloads from vc/vc-rcs.el
 
 (defvar vc-rcs-master-templates (purecopy '("%sRCS/%s,v" "%s%s,v" "%sRCS/%s")) "\
@@ -29926,7 +30380,7 @@
 ;;;***
 
 ;;;### (autoloads (vc-sccs-master-templates) "vc-sccs" "vc/vc-sccs.el"
-;;;;;;  (19662 54456))
+;;;;;;  (19662 23188))
 ;;; Generated autoloads from vc/vc-sccs.el
 
 (defvar vc-sccs-master-templates (purecopy '("%sSCCS/s.%s" "%ss.%s" vc-sccs-search-project-dir)) "\
@@ -29943,7 +30397,7 @@
 
 ;;;***
 
-;;;### (autoloads nil "vc-svn" "vc/vc-svn.el" (19630 58051))
+;;;### (autoloads nil "vc-svn" "vc/vc-svn.el" (19631 26857))
 ;;; Generated autoloads from vc/vc-svn.el
  (defun vc-svn-registered (f)
   (let ((admin-dir (cond ((and (eq system-type 'windows-nt)
@@ -29959,7 +30413,7 @@
 ;;;***
 
 ;;;### (autoloads (vera-mode) "vera-mode" "progmodes/vera-mode.el"
-;;;;;;  (19669 58161))
+;;;;;;  (19668 19680))
 ;;; Generated autoloads from progmodes/vera-mode.el
  (add-to-list 'auto-mode-alist (cons (purecopy "\\.vr[hi]?\\'")  'vera-mode))
 
@@ -30017,7 +30471,7 @@
 ;;;***
 
 ;;;### (autoloads (verilog-mode) "verilog-mode" "progmodes/verilog-mode.el"
-;;;;;;  (19675 9114))
+;;;;;;  (19673 45510))
 ;;; Generated autoloads from progmodes/verilog-mode.el
 
 (autoload 'verilog-mode "verilog-mode" "\
@@ -30154,7 +30608,7 @@
 ;;;***
 
 ;;;### (autoloads (vhdl-mode) "vhdl-mode" "progmodes/vhdl-mode.el"
-;;;;;;  (19675 9114))
+;;;;;;  (19672 56753))
 ;;; Generated autoloads from progmodes/vhdl-mode.el
 
 (autoload 'vhdl-mode "vhdl-mode" "\
@@ -30695,7 +31149,7 @@
 
 ;;;***
 
-;;;### (autoloads (vi-mode) "vi" "emulation/vi.el" (19379 23432))
+;;;### (autoloads (vi-mode) "vi" "emulation/vi.el" (19267 61660))
 ;;; Generated autoloads from emulation/vi.el
 
 (autoload 'vi-mode "vi" "\
@@ -30750,7 +31204,7 @@
 ;;;### (autoloads (viqr-pre-write-conversion viqr-post-read-conversion
 ;;;;;;  viet-encode-viqr-buffer viet-encode-viqr-region viet-decode-viqr-buffer
 ;;;;;;  viet-decode-viqr-region viet-encode-viscii-char) "viet-util"
-;;;;;;  "language/viet-util.el" (19379 23432))
+;;;;;;  "language/viet-util.el" (19277 34921))
 ;;; Generated autoloads from language/viet-util.el
 
 (autoload 'viet-encode-viscii-char "viet-util" "\
@@ -30798,7 +31252,7 @@
 ;;;;;;  view-mode view-buffer-other-frame view-buffer-other-window
 ;;;;;;  view-buffer view-file-other-frame view-file-other-window
 ;;;;;;  view-file kill-buffer-if-not-modified view-remove-frame-by-deleting)
-;;;;;;  "view" "view.el" (19422 40643))
+;;;;;;  "view" "view.el" (19423 37200))
 ;;; Generated autoloads from view.el
 
 (defvar view-remove-frame-by-deleting t "\
@@ -31044,8 +31498,8 @@
 
 ;;;***
 
-;;;### (autoloads (vip-mode vip-setup) "vip" "emulation/vip.el" (19611
-;;;;;;  13362))
+;;;### (autoloads (vip-mode vip-setup) "vip" "emulation/vip.el" (19609
+;;;;;;  2196))
 ;;; Generated autoloads from emulation/vip.el
 
 (autoload 'vip-setup "vip" "\
@@ -31061,7 +31515,7 @@
 ;;;***
 
 ;;;### (autoloads (viper-mode toggle-viper-mode) "viper" "emulation/viper.el"
-;;;;;;  (19578 56905))
+;;;;;;  (19580 19536))
 ;;; Generated autoloads from emulation/viper.el
 
 (autoload 'toggle-viper-mode "viper" "\
@@ -31078,7 +31532,7 @@
 ;;;***
 
 ;;;### (autoloads (warn lwarn display-warning) "warnings" "emacs-lisp/warnings.el"
-;;;;;;  (19606 36461))
+;;;;;;  (19607 38013))
 ;;; Generated autoloads from emacs-lisp/warnings.el
 
 (defvar warning-prefix-function nil "\
@@ -31168,7 +31622,7 @@
 ;;;***
 
 ;;;### (autoloads (wdired-change-to-wdired-mode) "wdired" "wdired.el"
-;;;;;;  (19379 23432))
+;;;;;;  (19277 34917))
 ;;; Generated autoloads from wdired.el
 
 (autoload 'wdired-change-to-wdired-mode "wdired" "\
@@ -31184,7 +31638,7 @@
 
 ;;;***
 
-;;;### (autoloads (webjump) "webjump" "net/webjump.el" (19379 23432))
+;;;### (autoloads (webjump) "webjump" "net/webjump.el" (19277 34921))
 ;;; Generated autoloads from net/webjump.el
 
 (autoload 'webjump "webjump" "\
@@ -31201,7 +31655,7 @@
 ;;;***
 
 ;;;### (autoloads (which-function-mode) "which-func" "progmodes/which-func.el"
-;;;;;;  (19551 10990))
+;;;;;;  (19552 37739))
 ;;; Generated autoloads from progmodes/which-func.el
  (put 'which-func-format 'risky-local-variable t)
  (put 'which-func-current 'risky-local-variable t)
@@ -31232,7 +31686,7 @@
 ;;;### (autoloads (whitespace-report-region whitespace-report whitespace-cleanup-region
 ;;;;;;  whitespace-cleanup global-whitespace-toggle-options whitespace-toggle-options
 ;;;;;;  global-whitespace-newline-mode global-whitespace-mode whitespace-newline-mode
-;;;;;;  whitespace-mode) "whitespace" "whitespace.el" (19575 52125))
+;;;;;;  whitespace-mode) "whitespace" "whitespace.el" (19580 19536))
 ;;; Generated autoloads from whitespace.el
 
 (autoload 'whitespace-mode "whitespace" "\
@@ -31635,7 +32089,7 @@
 ;;;***
 
 ;;;### (autoloads (widget-minor-mode widget-browse-other-window widget-browse
-;;;;;;  widget-browse-at) "wid-browse" "wid-browse.el" (19578 56905))
+;;;;;;  widget-browse-at) "wid-browse" "wid-browse.el" (19580 19536))
 ;;; Generated autoloads from wid-browse.el
 
 (autoload 'widget-browse-at "wid-browse" "\
@@ -31662,8 +32116,8 @@
 ;;;***
 
 ;;;### (autoloads (widget-setup widget-insert widget-delete widget-create
-;;;;;;  widget-prompt-value widgetp) "wid-edit" "wid-edit.el" (19686
-;;;;;;  22639))
+;;;;;;  widget-prompt-value widgetp) "wid-edit" "wid-edit.el" (19687
+;;;;;;  6902))
 ;;; Generated autoloads from wid-edit.el
 
 (autoload 'widgetp "wid-edit" "\
@@ -31706,8 +32160,8 @@
 ;;;***
 
 ;;;### (autoloads (windmove-default-keybindings windmove-down windmove-right
-;;;;;;  windmove-up windmove-left) "windmove" "windmove.el" (19379
-;;;;;;  23432))
+;;;;;;  windmove-up windmove-left) "windmove" "windmove.el" (19277
+;;;;;;  34917))
 ;;; Generated autoloads from windmove.el
 
 (autoload 'windmove-left "windmove" "\
@@ -31760,7 +32214,7 @@
 ;;;***
 
 ;;;### (autoloads (winner-mode winner-mode) "winner" "winner.el"
-;;;;;;  (19379 23432))
+;;;;;;  (19277 34917))
 ;;; Generated autoloads from winner.el
 
 (defvar winner-mode nil "\
@@ -31779,7 +32233,7 @@
 ;;;***
 
 ;;;### (autoloads (woman-bookmark-jump woman-find-file woman-dired-find-file
-;;;;;;  woman woman-locale) "woman" "woman.el" (19669 58161))
+;;;;;;  woman woman-locale) "woman" "woman.el" (19668 18093))
 ;;; Generated autoloads from woman.el
 
 (defvar woman-locale nil "\
@@ -31828,7 +32282,7 @@
 ;;;***
 
 ;;;### (autoloads (wordstar-mode) "ws-mode" "emulation/ws-mode.el"
-;;;;;;  (19634 57717))
+;;;;;;  (19634 23255))
 ;;; Generated autoloads from emulation/ws-mode.el
 
 (autoload 'wordstar-mode "ws-mode" "\
@@ -31940,7 +32394,7 @@
 
 ;;;***
 
-;;;### (autoloads (xesam-search) "xesam" "net/xesam.el" (19379 23432))
+;;;### (autoloads (xesam-search) "xesam" "net/xesam.el" (19360 14173))
 ;;; Generated autoloads from net/xesam.el
 
 (autoload 'xesam-search "xesam" "\
@@ -31960,7 +32414,7 @@
 ;;;***
 
 ;;;### (autoloads (xml-parse-region xml-parse-file) "xml" "xml.el"
-;;;;;;  (19520 54552))
+;;;;;;  (19515 27412))
 ;;; Generated autoloads from xml.el
 
 (autoload 'xml-parse-file "xml" "\
@@ -31986,7 +32440,7 @@
 ;;;***
 
 ;;;### (autoloads (xmltok-get-declared-encoding-position) "xmltok"
-;;;;;;  "nxml/xmltok.el" (19379 23432))
+;;;;;;  "nxml/xmltok.el" (19277 34921))
 ;;; Generated autoloads from nxml/xmltok.el
 
 (autoload 'xmltok-get-declared-encoding-position "xmltok" "\
@@ -32004,8 +32458,8 @@
 
 ;;;***
 
-;;;### (autoloads (xterm-mouse-mode) "xt-mouse" "xt-mouse.el" (19520
-;;;;;;  54552))
+;;;### (autoloads (xterm-mouse-mode) "xt-mouse" "xt-mouse.el" (19524
+;;;;;;  29717))
 ;;; Generated autoloads from xt-mouse.el
 
 (defvar xterm-mouse-mode nil "\
@@ -32034,7 +32488,7 @@
 ;;;***
 
 ;;;### (autoloads (yenc-extract-filename yenc-decode-region) "yenc"
-;;;;;;  "gnus/yenc.el" (19583 31640))
+;;;;;;  "gnus/yenc.el" (19582 65302))
 ;;; Generated autoloads from gnus/yenc.el
 
 (autoload 'yenc-decode-region "yenc" "\
@@ -32050,7 +32504,7 @@
 ;;;***
 
 ;;;### (autoloads (psychoanalyze-pinhead apropos-zippy insert-zippyism
-;;;;;;  yow) "yow" "play/yow.el" (19379 23432))
+;;;;;;  yow) "yow" "play/yow.el" (19277 34922))
 ;;; Generated autoloads from play/yow.el
 
 (autoload 'yow "yow" "\
@@ -32076,7 +32530,7 @@
 
 ;;;***
 
-;;;### (autoloads (zone) "zone" "play/zone.el" (19520 54552))
+;;;### (autoloads (zone) "zone" "play/zone.el" (19515 27412))
 ;;; Generated autoloads from play/zone.el
 
 (autoload 'zone "zone" "\
@@ -32086,36 +32540,28 @@
 
 ;;;***
 
-;;;### (autoloads nil nil ("abbrevlist.el" "align.el" "allout.el"
-;;;;;;  "ansi-color.el" "apropos.el" "arc-mode.el" "array.el" "autoarg.el"
-;;;;;;  "autoinsert.el" "autorevert.el" "avoid.el" "battery.el" "bookmark.el"
-;;;;;;  "bs.el" "calc/calc-aent.el" "calc/calc-alg.el" "calc/calc-arith.el"
-;;;;;;  "calc/calc-bin.el" "calc/calc-comb.el" "calc/calc-cplx.el"
-;;;;;;  "calc/calc-embed.el" "calc/calc-ext.el" "calc/calc-fin.el"
-;;;;;;  "calc/calc-forms.el" "calc/calc-frac.el" "calc/calc-funcs.el"
-;;;;;;  "calc/calc-graph.el" "calc/calc-help.el" "calc/calc-incom.el"
-;;;;;;  "calc/calc-keypd.el" "calc/calc-lang.el" "calc/calc-macs.el"
-;;;;;;  "calc/calc-map.el" "calc/calc-math.el" "calc/calc-menu.el"
-;;;;;;  "calc/calc-misc.el" "calc/calc-mode.el" "calc/calc-mtx.el"
-;;;;;;  "calc/calc-nlfit.el" "calc/calc-poly.el" "calc/calc-prog.el"
-;;;;;;  "calc/calc-rewr.el" "calc/calc-rules.el" "calc/calc-sel.el"
-;;;;;;  "calc/calc-stat.el" "calc/calc-store.el" "calc/calc-stuff.el"
-;;;;;;  "calc/calc-trail.el" "calc/calc-undo.el" "calc/calc-units.el"
-;;;;;;  "calc/calc-vec.el" "calc/calc-yank.el" "calc/calc.el" "calc/calcalg2.el"
-;;;;;;  "calc/calcalg3.el" "calc/calccomp.el" "calc/calcsel2.el"
-;;;;;;  "calculator.el" "calendar/appt.el" "calendar/cal-bahai.el"
-;;;;;;  "calendar/cal-china.el" "calendar/cal-coptic.el" "calendar/cal-dst.el"
-;;;;;;  "calendar/cal-french.el" "calendar/cal-hebrew.el" "calendar/cal-html.el"
-;;;;;;  "calendar/cal-islam.el" "calendar/cal-iso.el" "calendar/cal-julian.el"
-;;;;;;  "calendar/cal-loaddefs.el" "calendar/cal-mayan.el" "calendar/cal-menu.el"
-;;;;;;  "calendar/cal-move.el" "calendar/cal-persia.el" "calendar/cal-tex.el"
-;;;;;;  "calendar/cal-x.el" "calendar/calendar.el" "calendar/diary-lib.el"
-;;;;;;  "calendar/diary-loaddefs.el" "calendar/hol-loaddefs.el" "calendar/holidays.el"
-;;;;;;  "calendar/icalendar.el" "calendar/lunar.el" "calendar/parse-time.el"
-;;;;;;  "calendar/solar.el" "calendar/time-date.el" "calendar/timeclock.el"
-;;;;;;  "calendar/todo-mode.el" "cdl.el" "cedet/cedet-cscope.el"
-;;;;;;  "cedet/cedet-files.el" "cedet/cedet-global.el" "cedet/cedet-idutils.el"
-;;;;;;  "cedet/cedet.el" "cedet/data-debug.el" "cedet/ede.el" "cedet/ede/auto.el"
+;;;### (autoloads nil nil ("calc/calc-aent.el" "calc/calc-alg.el"
+;;;;;;  "calc/calc-arith.el" "calc/calc-bin.el" "calc/calc-comb.el"
+;;;;;;  "calc/calc-cplx.el" "calc/calc-embed.el" "calc/calc-ext.el"
+;;;;;;  "calc/calc-fin.el" "calc/calc-forms.el" "calc/calc-frac.el"
+;;;;;;  "calc/calc-funcs.el" "calc/calc-graph.el" "calc/calc-help.el"
+;;;;;;  "calc/calc-incom.el" "calc/calc-keypd.el" "calc/calc-lang.el"
+;;;;;;  "calc/calc-macs.el" "calc/calc-map.el" "calc/calc-math.el"
+;;;;;;  "calc/calc-menu.el" "calc/calc-misc.el" "calc/calc-mode.el"
+;;;;;;  "calc/calc-mtx.el" "calc/calc-nlfit.el" "calc/calc-poly.el"
+;;;;;;  "calc/calc-prog.el" "calc/calc-rewr.el" "calc/calc-rules.el"
+;;;;;;  "calc/calc-sel.el" "calc/calc-stat.el" "calc/calc-store.el"
+;;;;;;  "calc/calc-stuff.el" "calc/calc-trail.el" "calc/calc-undo.el"
+;;;;;;  "calc/calc-units.el" "calc/calc-vec.el" "calc/calc-yank.el"
+;;;;;;  "calc/calcalg2.el" "calc/calcalg3.el" "calc/calccomp.el"
+;;;;;;  "calc/calcsel2.el" "calendar/cal-bahai.el" "calendar/cal-coptic.el"
+;;;;;;  "calendar/cal-french.el" "calendar/cal-html.el" "calendar/cal-islam.el"
+;;;;;;  "calendar/cal-iso.el" "calendar/cal-julian.el" "calendar/cal-loaddefs.el"
+;;;;;;  "calendar/cal-mayan.el" "calendar/cal-menu.el" "calendar/cal-move.el"
+;;;;;;  "calendar/cal-persia.el" "calendar/cal-tex.el" "calendar/cal-x.el"
+;;;;;;  "calendar/diary-loaddefs.el" "calendar/hol-loaddefs.el" "cdl.el"
+;;;;;;  "cedet/cedet-cscope.el" "cedet/cedet-files.el" "cedet/cedet-global.el"
+;;;;;;  "cedet/cedet-idutils.el" "cedet/cedet.el" "cedet/ede/auto.el"
 ;;;;;;  "cedet/ede/autoconf-edit.el" "cedet/ede/base.el" "cedet/ede/cpp-root.el"
 ;;;;;;  "cedet/ede/custom.el" "cedet/ede/dired.el" "cedet/ede/emacs.el"
 ;;;;;;  "cedet/ede/files.el" "cedet/ede/generic.el" "cedet/ede/linux.el"
@@ -32128,7 +32574,7 @@
 ;;;;;;  "cedet/ede/simple.el" "cedet/ede/source.el" "cedet/ede/speedbar.el"
 ;;;;;;  "cedet/ede/srecode.el" "cedet/ede/system.el" "cedet/ede/util.el"
 ;;;;;;  "cedet/inversion.el" "cedet/mode-local.el" "cedet/pulse.el"
-;;;;;;  "cedet/semantic.el" "cedet/semantic/analyze.el" "cedet/semantic/analyze/complete.el"
+;;;;;;  "cedet/semantic/analyze.el" "cedet/semantic/analyze/complete.el"
 ;;;;;;  "cedet/semantic/analyze/debug.el" "cedet/semantic/analyze/fcn.el"
 ;;;;;;  "cedet/semantic/analyze/refs.el" "cedet/semantic/bovine.el"
 ;;;;;;  "cedet/semantic/bovine/c-by.el" "cedet/semantic/bovine/c.el"
@@ -32167,294 +32613,135 @@
 ;;;;;;  "cedet/srecode/fields.el" "cedet/srecode/filters.el" "cedet/srecode/find.el"
 ;;;;;;  "cedet/srecode/getset.el" "cedet/srecode/insert.el" "cedet/srecode/java.el"
 ;;;;;;  "cedet/srecode/map.el" "cedet/srecode/mode.el" "cedet/srecode/semantic.el"
-;;;;;;  "cedet/srecode/srt-mode.el" "cedet/srecode/srt-wy.el" "cedet/srecode/srt.el"
-;;;;;;  "cedet/srecode/table.el" "cedet/srecode/template.el" "cedet/srecode/texi.el"
-;;;;;;  "chistory.el" "cmuscheme.el" "comint.el" "completion.el"
-;;;;;;  "cus-dep.el" "cus-edit.el" "cus-theme.el" "dabbrev.el" "delim-col.el"
-;;;;;;  "delsel.el" "descr-text.el" "desktop.el" "dframe.el" "dired-aux.el"
-;;;;;;  "dired-x.el" "dired.el" "dirtrack.el" "doc-view.el" "dos-fns.el"
-;;;;;;  "dos-vars.el" "double.el" "dynamic-setting.el" "ebuff-menu.el"
-;;;;;;  "echistory.el" "edmacro.el" "ehelp.el" "electric.el" "elide-head.el"
-;;;;;;  "emacs-lisp/advice.el" "emacs-lisp/assoc.el" "emacs-lisp/authors.el"
-;;;;;;  "emacs-lisp/autoload.el" "emacs-lisp/avl-tree.el" "emacs-lisp/benchmark.el"
-;;;;;;  "emacs-lisp/bindat.el" "emacs-lisp/byte-opt.el" "emacs-lisp/bytecomp.el"
-;;;;;;  "emacs-lisp/chart.el" "emacs-lisp/check-declare.el" "emacs-lisp/checkdoc.el"
-;;;;;;  "emacs-lisp/cl-extra.el" "emacs-lisp/cl-indent.el" "emacs-lisp/cl-loaddefs.el"
+;;;;;;  "cedet/srecode/srt-wy.el" "cedet/srecode/srt.el" "cedet/srecode/table.el"
+;;;;;;  "cedet/srecode/template.el" "cedet/srecode/texi.el" "cus-dep.el"
+;;;;;;  "dframe.el" "dired-aux.el" "dired-x.el" "dos-fns.el" "dos-vars.el"
+;;;;;;  "dos-w32.el" "dynamic-setting.el" "emacs-lisp/assoc.el" "emacs-lisp/authors.el"
+;;;;;;  "emacs-lisp/avl-tree.el" "emacs-lisp/bindat.el" "emacs-lisp/byte-opt.el"
+;;;;;;  "emacs-lisp/chart.el" "emacs-lisp/cl-extra.el" "emacs-lisp/cl-loaddefs.el"
 ;;;;;;  "emacs-lisp/cl-macs.el" "emacs-lisp/cl-seq.el" "emacs-lisp/cl-specs.el"
-;;;;;;  "emacs-lisp/cl.el" "emacs-lisp/copyright.el" "emacs-lisp/crm.el"
-;;;;;;  "emacs-lisp/cust-print.el" "emacs-lisp/debug.el" "emacs-lisp/derived.el"
-;;;;;;  "emacs-lisp/disass.el" "emacs-lisp/easy-mmode.el" "emacs-lisp/easymenu.el"
-;;;;;;  "emacs-lisp/edebug.el" "emacs-lisp/eieio-base.el" "emacs-lisp/eieio-comp.el"
+;;;;;;  "emacs-lisp/cust-print.el" "emacs-lisp/eieio-base.el" "emacs-lisp/eieio-comp.el"
 ;;;;;;  "emacs-lisp/eieio-custom.el" "emacs-lisp/eieio-datadebug.el"
 ;;;;;;  "emacs-lisp/eieio-opt.el" "emacs-lisp/eieio-speedbar.el"
-;;;;;;  "emacs-lisp/eieio.el" "emacs-lisp/eldoc.el" "emacs-lisp/elint.el"
-;;;;;;  "emacs-lisp/elp.el" "emacs-lisp/ewoc.el" "emacs-lisp/find-func.el"
-;;;;;;  "emacs-lisp/find-gc.el" "emacs-lisp/generic.el" "emacs-lisp/gulp.el"
-;;;;;;  "emacs-lisp/helper.el" "emacs-lisp/lisp-mnt.el" "emacs-lisp/macroexp.el"
-;;;;;;  "emacs-lisp/package-x.el" "emacs-lisp/package.el" "emacs-lisp/pcase.el"
-;;;;;;  "emacs-lisp/pp.el" "emacs-lisp/re-builder.el" "emacs-lisp/regexp-opt.el"
-;;;;;;  "emacs-lisp/regi.el" "emacs-lisp/ring.el" "emacs-lisp/rx.el"
-;;;;;;  "emacs-lisp/shadow.el" "emacs-lisp/smie.el" "emacs-lisp/sregex.el"
-;;;;;;  "emacs-lisp/tcover-ses.el" "emacs-lisp/tcover-unsafep.el"
-;;;;;;  "emacs-lisp/testcover.el" "emacs-lisp/tq.el" "emacs-lisp/trace.el"
-;;;;;;  "emacs-lisp/unsafep.el" "emacs-lisp/warnings.el" "emacs-lock.el"
-;;;;;;  "emulation/crisp.el" "emulation/cua-base.el" "emulation/cua-gmrk.el"
+;;;;;;  "emacs-lisp/eieio.el" "emacs-lisp/find-gc.el" "emacs-lisp/gulp.el"
+;;;;;;  "emacs-lisp/lisp-mnt.el" "emacs-lisp/package-x.el" "emacs-lisp/regi.el"
+;;;;;;  "emacs-lisp/smie.el" "emacs-lisp/sregex.el" "emacs-lisp/tcover-ses.el"
+;;;;;;  "emacs-lisp/tcover-unsafep.el" "emacs-lock.el" "emulation/cua-gmrk.el"
 ;;;;;;  "emulation/cua-rect.el" "emulation/edt-lk201.el" "emulation/edt-mapper.el"
-;;;;;;  "emulation/edt-pc.el" "emulation/edt-vt100.el" "emulation/edt.el"
-;;;;;;  "emulation/keypad.el" "emulation/pc-mode.el" "emulation/pc-select.el"
-;;;;;;  "emulation/tpu-edt.el" "emulation/tpu-extras.el" "emulation/tpu-mapper.el"
-;;;;;;  "emulation/vi.el" "emulation/vip.el" "emulation/viper-cmd.el"
-;;;;;;  "emulation/viper-ex.el" "emulation/viper-init.el" "emulation/viper-keym.el"
-;;;;;;  "emulation/viper-macs.el" "emulation/viper-mous.el" "emulation/viper-util.el"
-;;;;;;  "emulation/viper.el" "emulation/ws-mode.el" "epa-dired.el"
-;;;;;;  "epa-file.el" "epa-mail.el" "epa.el" "epg-config.el" "epg.el"
-;;;;;;  "erc/erc-autoaway.el" "erc/erc-backend.el" "erc/erc-button.el"
-;;;;;;  "erc/erc-capab.el" "erc/erc-compat.el" "erc/erc-dcc.el" "erc/erc-ezbounce.el"
-;;;;;;  "erc/erc-fill.el" "erc/erc-goodies.el" "erc/erc-hecomplete.el"
-;;;;;;  "erc/erc-ibuffer.el" "erc/erc-identd.el" "erc/erc-imenu.el"
-;;;;;;  "erc/erc-join.el" "erc/erc-lang.el" "erc/erc-list.el" "erc/erc-log.el"
-;;;;;;  "erc/erc-match.el" "erc/erc-menu.el" "erc/erc-netsplit.el"
-;;;;;;  "erc/erc-networks.el" "erc/erc-notify.el" "erc/erc-page.el"
-;;;;;;  "erc/erc-pcomplete.el" "erc/erc-replace.el" "erc/erc-ring.el"
-;;;;;;  "erc/erc-services.el" "erc/erc-sound.el" "erc/erc-speedbar.el"
-;;;;;;  "erc/erc-spelling.el" "erc/erc-stamp.el" "erc/erc-track.el"
-;;;;;;  "erc/erc-truncate.el" "erc/erc-xdcc.el" "erc/erc.el" "eshell/em-alias.el"
+;;;;;;  "emulation/edt-pc.el" "emulation/edt-vt100.el" "emulation/tpu-extras.el"
+;;;;;;  "emulation/viper-cmd.el" "emulation/viper-ex.el" "emulation/viper-init.el"
+;;;;;;  "emulation/viper-keym.el" "emulation/viper-macs.el" "emulation/viper-mous.el"
+;;;;;;  "emulation/viper-util.el" "erc/erc-backend.el" "erc/erc-goodies.el"
+;;;;;;  "erc/erc-ibuffer.el" "erc/erc-lang.el" "eshell/em-alias.el"
 ;;;;;;  "eshell/em-banner.el" "eshell/em-basic.el" "eshell/em-cmpl.el"
 ;;;;;;  "eshell/em-dirs.el" "eshell/em-glob.el" "eshell/em-hist.el"
 ;;;;;;  "eshell/em-ls.el" "eshell/em-pred.el" "eshell/em-prompt.el"
 ;;;;;;  "eshell/em-rebind.el" "eshell/em-script.el" "eshell/em-smart.el"
 ;;;;;;  "eshell/em-term.el" "eshell/em-unix.el" "eshell/em-xtra.el"
 ;;;;;;  "eshell/esh-arg.el" "eshell/esh-cmd.el" "eshell/esh-ext.el"
-;;;;;;  "eshell/esh-io.el" "eshell/esh-mode.el" "eshell/esh-module.el"
-;;;;;;  "eshell/esh-opt.el" "eshell/esh-proc.el" "eshell/esh-test.el"
-;;;;;;  "eshell/esh-util.el" "eshell/esh-var.el" "eshell/eshell.el"
-;;;;;;  "expand.el" "ezimage.el" "face-remap.el" "ffap.el" "filecache.el"
-;;;;;;  "files-x.el" "filesets.el" "find-cmd.el" "find-dired.el"
-;;;;;;  "find-file.el" "find-lisp.el" "finder.el" "flow-ctrl.el"
-;;;;;;  "foldout.el" "follow.el" "format-spec.el" "forms-d2.el" "forms-pass.el"
-;;;;;;  "forms.el" "generic-x.el" "gnus/auth-source.el" "gnus/canlock.el"
-;;;;;;  "gnus/compface.el" "gnus/deuglify.el" "gnus/ecomplete.el"
-;;;;;;  "gnus/flow-fill.el" "gnus/gmm-utils.el" "gnus/gnus-agent.el"
-;;;;;;  "gnus/gnus-art.el" "gnus/gnus-async.el" "gnus/gnus-bcklg.el"
-;;;;;;  "gnus/gnus-bookmark.el" "gnus/gnus-cache.el" "gnus/gnus-cite.el"
-;;;;;;  "gnus/gnus-cus.el" "gnus/gnus-delay.el" "gnus/gnus-demon.el"
-;;;;;;  "gnus/gnus-diary.el" "gnus/gnus-dired.el" "gnus/gnus-draft.el"
+;;;;;;  "eshell/esh-io.el" "eshell/esh-module.el" "eshell/esh-opt.el"
+;;;;;;  "eshell/esh-proc.el" "eshell/esh-util.el" "eshell/esh-var.el"
+;;;;;;  "ezimage.el" "foldout.el" "format-spec.el" "forms-d2.el"
+;;;;;;  "forms-pass.el" "fringe.el" "generic-x.el" "gnus/auth-source.el"
+;;;;;;  "gnus/color.el" "gnus/compface.el" "gnus/gnus-async.el" "gnus/gnus-bcklg.el"
+;;;;;;  "gnus/gnus-cite.el" "gnus/gnus-cus.el" "gnus/gnus-demon.el"
 ;;;;;;  "gnus/gnus-dup.el" "gnus/gnus-eform.el" "gnus/gnus-ems.el"
-;;;;;;  "gnus/gnus-fun.el" "gnus/gnus-gravatar.el" "gnus/gnus-group.el"
-;;;;;;  "gnus/gnus-html.el" "gnus/gnus-int.el" "gnus/gnus-kill.el"
-;;;;;;  "gnus/gnus-logic.el" "gnus/gnus-mh.el" "gnus/gnus-ml.el"
-;;;;;;  "gnus/gnus-mlspl.el" "gnus/gnus-msg.el" "gnus/gnus-picon.el"
-;;;;;;  "gnus/gnus-range.el" "gnus/gnus-registry.el" "gnus/gnus-salt.el"
-;;;;;;  "gnus/gnus-score.el" "gnus/gnus-setup.el" "gnus/gnus-sieve.el"
-;;;;;;  "gnus/gnus-spec.el" "gnus/gnus-srvr.el" "gnus/gnus-start.el"
-;;;;;;  "gnus/gnus-sum.el" "gnus/gnus-sync.el" "gnus/gnus-topic.el"
-;;;;;;  "gnus/gnus-undo.el" "gnus/gnus-util.el" "gnus/gnus-uu.el"
-;;;;;;  "gnus/gnus-vm.el" "gnus/gnus-win.el" "gnus/gnus.el" "gnus/gravatar.el"
-;;;;;;  "gnus/html2text.el" "gnus/ietf-drums.el" "gnus/legacy-gnus-agent.el"
-;;;;;;  "gnus/mail-parse.el" "gnus/mail-prsvr.el" "gnus/mail-source.el"
-;;;;;;  "gnus/mailcap.el" "gnus/message.el" "gnus/messcompat.el"
+;;;;;;  "gnus/gnus-int.el" "gnus/gnus-logic.el" "gnus/gnus-mh.el"
+;;;;;;  "gnus/gnus-salt.el" "gnus/gnus-score.el" "gnus/gnus-setup.el"
+;;;;;;  "gnus/gnus-srvr.el" "gnus/gnus-topic.el" "gnus/gnus-undo.el"
+;;;;;;  "gnus/gnus-util.el" "gnus/gnus-uu.el" "gnus/gnus-vm.el" "gnus/ietf-drums.el"
+;;;;;;  "gnus/legacy-gnus-agent.el" "gnus/mail-parse.el" "gnus/mail-prsvr.el"
+;;;;;;  "gnus/mail-source.el" "gnus/mailcap.el" "gnus/messcompat.el"
 ;;;;;;  "gnus/mm-bodies.el" "gnus/mm-decode.el" "gnus/mm-encode.el"
-;;;;;;  "gnus/mm-extern.el" "gnus/mm-partial.el" "gnus/mm-url.el"
-;;;;;;  "gnus/mm-util.el" "gnus/mm-uu.el" "gnus/mm-view.el" "gnus/mml-sec.el"
-;;;;;;  "gnus/mml-smime.el" "gnus/mml.el" "gnus/mml1991.el" "gnus/mml2015.el"
-;;;;;;  "gnus/nnagent.el" "gnus/nnbabyl.el" "gnus/nndiary.el" "gnus/nndir.el"
-;;;;;;  "gnus/nndoc.el" "gnus/nndraft.el" "gnus/nneething.el" "gnus/nnfolder.el"
-;;;;;;  "gnus/nngateway.el" "gnus/nnheader.el" "gnus/nnimap.el" "gnus/nnir.el"
-;;;;;;  "gnus/nnmail.el" "gnus/nnmaildir.el" "gnus/nnmairix.el" "gnus/nnmbox.el"
-;;;;;;  "gnus/nnmh.el" "gnus/nnml.el" "gnus/nnnil.el" "gnus/nnoo.el"
-;;;;;;  "gnus/nnregistry.el" "gnus/nnrss.el" "gnus/nnspool.el" "gnus/nntp.el"
-;;;;;;  "gnus/nnvirtual.el" "gnus/nnweb.el" "gnus/pop3.el" "gnus/qp.el"
+;;;;;;  "gnus/mm-util.el" "gnus/mm-view.el" "gnus/mml-sec.el" "gnus/mml-smime.el"
+;;;;;;  "gnus/mml.el" "gnus/nnagent.el" "gnus/nnbabyl.el" "gnus/nndir.el"
+;;;;;;  "gnus/nndraft.el" "gnus/nneething.el" "gnus/nngateway.el"
+;;;;;;  "gnus/nnheader.el" "gnus/nnimap.el" "gnus/nnir.el" "gnus/nnmail.el"
+;;;;;;  "gnus/nnmaildir.el" "gnus/nnmairix.el" "gnus/nnmbox.el" "gnus/nnmh.el"
+;;;;;;  "gnus/nnnil.el" "gnus/nnoo.el" "gnus/nnregistry.el" "gnus/nnrss.el"
+;;;;;;  "gnus/nnspool.el" "gnus/nntp.el" "gnus/nnvirtual.el" "gnus/nnweb.el"
 ;;;;;;  "gnus/rfc1843.el" "gnus/rfc2045.el" "gnus/rfc2047.el" "gnus/rfc2104.el"
-;;;;;;  "gnus/rfc2231.el" "gnus/score-mode.el" "gnus/shr.el" "gnus/sieve-manage.el"
-;;;;;;  "gnus/sieve-mode.el" "gnus/sieve.el" "gnus/smiley.el" "gnus/smime.el"
-;;;;;;  "gnus/spam-report.el" "gnus/spam-stat.el" "gnus/spam-wash.el"
-;;;;;;  "gnus/spam.el" "gnus/starttls.el" "gnus/utf7.el" "gnus/yenc.el"
-;;;;;;  "gs.el" "help-at-pt.el" "help-fns.el" "help-macro.el" "help-mode.el"
-;;;;;;  "hex-util.el" "hexl.el" "hfy-cmap.el" "hi-lock.el" "hilit-chg.el"
-;;;;;;  "hippie-exp.el" "hl-line.el" "htmlfontify.el" "ibuf-ext.el"
-;;;;;;  "ibuf-macs.el" "ibuffer.el" "icomplete.el" "ido.el" "ielm.el"
-;;;;;;  "iimage.el" "image-dired.el" "image-file.el" "image-mode.el"
-;;;;;;  "imenu.el" "info-look.el" "info-xref.el" "info.el" "informat.el"
-;;;;;;  "international/ccl.el" "international/cp51932.el" "international/eucjp-ms.el"
-;;;;;;  "international/isearch-x.el" "international/iso-ascii.el"
-;;;;;;  "international/iso-cvt.el" "international/iso-transl.el"
+;;;;;;  "gnus/rfc2231.el" "gnus/shr-color.el" "gnus/sieve-manage.el"
+;;;;;;  "gnus/smime.el" "gnus/spam-stat.el" "gnus/spam-wash.el" "hex-util.el"
+;;;;;;  "hfy-cmap.el" "ibuf-ext.el" "international/charprop.el" "international/cp51932.el"
+;;;;;;  "international/eucjp-ms.el" "international/fontset.el" "international/iso-ascii.el"
 ;;;;;;  "international/ja-dic-cnv.el" "international/ja-dic-utl.el"
-;;;;;;  "international/kinsoku.el" "international/kkc.el" "international/latexenc.el"
-;;;;;;  "international/latin1-disp.el" "international/mule-diag.el"
-;;;;;;  "international/mule-util.el" "international/ogonek.el" "international/quail.el"
-;;;;;;  "international/robin.el" "international/titdic-cnv.el" "international/ucs-normalize.el"
-;;;;;;  "international/uni-bidi.el" "international/uni-category.el"
+;;;;;;  "international/ogonek.el" "international/uni-bidi.el" "international/uni-category.el"
 ;;;;;;  "international/uni-combining.el" "international/uni-comment.el"
 ;;;;;;  "international/uni-decimal.el" "international/uni-decomposition.el"
 ;;;;;;  "international/uni-digit.el" "international/uni-lowercase.el"
 ;;;;;;  "international/uni-mirrored.el" "international/uni-name.el"
 ;;;;;;  "international/uni-numeric.el" "international/uni-old-name.el"
 ;;;;;;  "international/uni-titlecase.el" "international/uni-uppercase.el"
-;;;;;;  "international/utf-7.el" "isearchb.el" "iswitchb.el" "jka-compr.el"
-;;;;;;  "json.el" "kermit.el" "kmacro.el" "language/china-util.el"
-;;;;;;  "language/cyril-util.el" "language/ethio-util.el" "language/hanja-util.el"
-;;;;;;  "language/ind-util.el" "language/japan-util.el" "language/korea-util.el"
-;;;;;;  "language/lao-util.el" "language/thai-util.el" "language/thai-word.el"
-;;;;;;  "language/tibet-util.el" "language/tv-util.el" "language/viet-util.el"
-;;;;;;  "ldefs-boot.el" "ledit.el" "linum.el" "loadhist.el" "locate.el"
-;;;;;;  "longlines.el" "lpr.el" "macros.el" "mail/binhex.el" "mail/blessmail.el"
-;;;;;;  "mail/emacsbug.el" "mail/feedmail.el" "mail/footnote.el"
-;;;;;;  "mail/hashcash.el" "mail/mail-extr.el" "mail/mail-hist.el"
-;;;;;;  "mail/mail-utils.el" "mail/mailabbrev.el" "mail/mailalias.el"
-;;;;;;  "mail/mailclient.el" "mail/mailheader.el" "mail/mailpost.el"
-;;;;;;  "mail/metamail.el" "mail/mspools.el" "mail/reporter.el" "mail/rfc2368.el"
-;;;;;;  "mail/rfc822.el" "mail/rmail-spam-filter.el" "mail/rmail.el"
-;;;;;;  "mail/rmailedit.el" "mail/rmailkwd.el" "mail/rmailmm.el"
-;;;;;;  "mail/rmailmsc.el" "mail/rmailout.el" "mail/rmailsort.el"
-;;;;;;  "mail/rmailsum.el" "mail/sendmail.el" "mail/smtpmail.el"
-;;;;;;  "mail/supercite.el" "mail/uce.el" "mail/undigest.el" "mail/unrmail.el"
-;;;;;;  "mail/uudecode.el" "makesum.el" "man.el" "master.el" "mb-depth.el"
-;;;;;;  "md4.el" "mh-e/mh-acros.el" "mh-e/mh-alias.el" "mh-e/mh-buffers.el"
-;;;;;;  "mh-e/mh-comp.el" "mh-e/mh-compat.el" "mh-e/mh-e.el" "mh-e/mh-folder.el"
+;;;;;;  "json.el" "kermit.el" "language/hanja-util.el" "language/thai-word.el"
+;;;;;;  "ldefs-boot.el" "mail/blessmail.el" "mail/mailheader.el"
+;;;;;;  "mail/mailpost.el" "mail/mspools.el" "mail/rfc2368.el" "mail/rfc822.el"
+;;;;;;  "mail/rmail-spam-filter.el" "mail/rmailedit.el" "mail/rmailkwd.el"
+;;;;;;  "mail/rmailmm.el" "mail/rmailmsc.el" "mail/rmailsort.el"
+;;;;;;  "mail/rmailsum.el" "mail/undigest.el" "md4.el" "mh-e/mh-acros.el"
+;;;;;;  "mh-e/mh-alias.el" "mh-e/mh-buffers.el" "mh-e/mh-compat.el"
 ;;;;;;  "mh-e/mh-funcs.el" "mh-e/mh-gnus.el" "mh-e/mh-identity.el"
 ;;;;;;  "mh-e/mh-inc.el" "mh-e/mh-junk.el" "mh-e/mh-letter.el" "mh-e/mh-limit.el"
 ;;;;;;  "mh-e/mh-loaddefs.el" "mh-e/mh-mime.el" "mh-e/mh-print.el"
 ;;;;;;  "mh-e/mh-scan.el" "mh-e/mh-search.el" "mh-e/mh-seq.el" "mh-e/mh-show.el"
 ;;;;;;  "mh-e/mh-speed.el" "mh-e/mh-thread.el" "mh-e/mh-tool-bar.el"
-;;;;;;  "mh-e/mh-utils.el" "mh-e/mh-xface.el" "midnight.el" "minibuf-eldef.el"
-;;;;;;  "misc.el" "misearch.el" "mouse-copy.el" "mouse-drag.el" "mouse-sel.el"
-;;;;;;  "mpc.el" "msb.el" "net/ange-ftp.el" "net/browse-url.el" "net/dbus.el"
-;;;;;;  "net/dig.el" "net/dns.el" "net/eudc-bob.el" "net/eudc-export.el"
-;;;;;;  "net/eudc-hotlist.el" "net/eudc-vars.el" "net/eudc.el" "net/eudcb-bbdb.el"
+;;;;;;  "mh-e/mh-utils.el" "mh-e/mh-xface.el" "mouse-copy.el" "mouse.el"
+;;;;;;  "mwheel.el" "net/dns.el" "net/eudc-vars.el" "net/eudcb-bbdb.el"
 ;;;;;;  "net/eudcb-ldap.el" "net/eudcb-mab.el" "net/eudcb-ph.el"
-;;;;;;  "net/gnutls.el" "net/goto-addr.el" "net/hmac-def.el" "net/hmac-md5.el"
-;;;;;;  "net/imap-hash.el" "net/imap.el" "net/ldap.el" "net/mairix.el"
-;;;;;;  "net/net-utils.el" "net/netrc.el" "net/newst-backend.el"
-;;;;;;  "net/newst-plainview.el" "net/newst-reader.el" "net/newst-ticker.el"
-;;;;;;  "net/newst-treeview.el" "net/newsticker.el" "net/ntlm.el"
-;;;;;;  "net/quickurl.el" "net/rcirc.el" "net/rcompile.el" "net/rlogin.el"
-;;;;;;  "net/sasl-cram.el" "net/sasl-digest.el" "net/sasl-ntlm.el"
-;;;;;;  "net/sasl.el" "net/secrets.el" "net/snmp-mode.el" "net/socks.el"
-;;;;;;  "net/telnet.el" "net/tls.el" "net/tramp-cache.el" "net/tramp-cmds.el"
-;;;;;;  "net/tramp-compat.el" "net/tramp-ftp.el" "net/tramp-gvfs.el"
+;;;;;;  "net/gnutls.el" "net/hmac-def.el" "net/hmac-md5.el" "net/imap-hash.el"
+;;;;;;  "net/imap.el" "net/ldap.el" "net/mairix.el" "net/newsticker.el"
+;;;;;;  "net/ntlm.el" "net/sasl-cram.el" "net/sasl-digest.el" "net/sasl-ntlm.el"
+;;;;;;  "net/sasl.el" "net/socks.el" "net/tls.el" "net/tramp-cache.el"
+;;;;;;  "net/tramp-cmds.el" "net/tramp-compat.el" "net/tramp-gvfs.el"
 ;;;;;;  "net/tramp-gw.el" "net/tramp-imap.el" "net/tramp-loaddefs.el"
-;;;;;;  "net/tramp-sh.el" "net/tramp-smb.el" "net/tramp-uu.el" "net/tramp.el"
-;;;;;;  "net/trampver.el" "net/webjump.el" "net/xesam.el" "net/zeroconf.el"
-;;;;;;  "newcomment.el" "notifications.el" "novice.el" "nxml/nxml-enc.el"
-;;;;;;  "nxml/nxml-glyph.el" "nxml/nxml-maint.el" "nxml/nxml-mode.el"
+;;;;;;  "net/tramp-sh.el" "net/tramp-smb.el" "net/tramp-uu.el" "net/trampver.el"
+;;;;;;  "net/zeroconf.el" "notifications.el" "nxml/nxml-enc.el" "nxml/nxml-maint.el"
 ;;;;;;  "nxml/nxml-ns.el" "nxml/nxml-outln.el" "nxml/nxml-parse.el"
-;;;;;;  "nxml/nxml-rap.el" "nxml/nxml-uchnm.el" "nxml/nxml-util.el"
-;;;;;;  "nxml/rng-cmpct.el" "nxml/rng-dt.el" "nxml/rng-loc.el" "nxml/rng-maint.el"
-;;;;;;  "nxml/rng-match.el" "nxml/rng-nxml.el" "nxml/rng-parse.el"
+;;;;;;  "nxml/nxml-rap.el" "nxml/nxml-util.el" "nxml/rng-dt.el" "nxml/rng-loc.el"
+;;;;;;  "nxml/rng-maint.el" "nxml/rng-match.el" "nxml/rng-parse.el"
 ;;;;;;  "nxml/rng-pttrn.el" "nxml/rng-uri.el" "nxml/rng-util.el"
-;;;;;;  "nxml/rng-valid.el" "nxml/rng-xsd.el" "nxml/xmltok.el" "nxml/xsd-regexp.el"
-;;;;;;  "org/ob-C.el" "org/ob-R.el" "org/ob-asymptote.el" "org/ob-calc.el"
-;;;;;;  "org/ob-clojure.el" "org/ob-comint.el" "org/ob-css.el" "org/ob-ditaa.el"
-;;;;;;  "org/ob-dot.el" "org/ob-emacs-lisp.el" "org/ob-eval.el" "org/ob-exp.el"
-;;;;;;  "org/ob-gnuplot.el" "org/ob-haskell.el" "org/ob-js.el" "org/ob-keys.el"
-;;;;;;  "org/ob-latex.el" "org/ob-ledger.el" "org/ob-lisp.el" "org/ob-lob.el"
+;;;;;;  "nxml/xsd-regexp.el" "org/ob-C.el" "org/ob-R.el" "org/ob-asymptote.el"
+;;;;;;  "org/ob-calc.el" "org/ob-clojure.el" "org/ob-comint.el" "org/ob-css.el"
+;;;;;;  "org/ob-ditaa.el" "org/ob-dot.el" "org/ob-emacs-lisp.el"
+;;;;;;  "org/ob-eval.el" "org/ob-exp.el" "org/ob-gnuplot.el" "org/ob-haskell.el"
+;;;;;;  "org/ob-js.el" "org/ob-latex.el" "org/ob-ledger.el" "org/ob-lisp.el"
 ;;;;;;  "org/ob-matlab.el" "org/ob-mscgen.el" "org/ob-ocaml.el" "org/ob-octave.el"
 ;;;;;;  "org/ob-org.el" "org/ob-perl.el" "org/ob-plantuml.el" "org/ob-python.el"
 ;;;;;;  "org/ob-ref.el" "org/ob-ruby.el" "org/ob-sass.el" "org/ob-scheme.el"
 ;;;;;;  "org/ob-screen.el" "org/ob-sh.el" "org/ob-sql.el" "org/ob-sqlite.el"
-;;;;;;  "org/ob-table.el" "org/ob-tangle.el" "org/ob.el" "org/org-agenda.el"
-;;;;;;  "org/org-archive.el" "org/org-ascii.el" "org/org-attach.el"
-;;;;;;  "org/org-bbdb.el" "org/org-beamer.el" "org/org-bibtex.el"
-;;;;;;  "org/org-capture.el" "org/org-clock.el" "org/org-colview.el"
-;;;;;;  "org/org-compat.el" "org/org-crypt.el" "org/org-ctags.el"
-;;;;;;  "org/org-datetree.el" "org/org-docbook.el" "org/org-docview.el"
-;;;;;;  "org/org-entities.el" "org/org-exp-blocks.el" "org/org-exp.el"
-;;;;;;  "org/org-faces.el" "org/org-feed.el" "org/org-footnote.el"
-;;;;;;  "org/org-freemind.el" "org/org-gnus.el" "org/org-habit.el"
-;;;;;;  "org/org-html.el" "org/org-icalendar.el" "org/org-id.el"
-;;;;;;  "org/org-indent.el" "org/org-info.el" "org/org-inlinetask.el"
-;;;;;;  "org/org-install.el" "org/org-irc.el" "org/org-jsinfo.el"
-;;;;;;  "org/org-latex.el" "org/org-list.el" "org/org-mac-message.el"
-;;;;;;  "org/org-macs.el" "org/org-mew.el" "org/org-mhe.el" "org/org-mks.el"
-;;;;;;  "org/org-mobile.el" "org/org-mouse.el" "org/org-plot.el"
-;;;;;;  "org/org-protocol.el" "org/org-publish.el" "org/org-remember.el"
-;;;;;;  "org/org-rmail.el" "org/org-src.el" "org/org-table.el" "org/org-taskjuggler.el"
-;;;;;;  "org/org-timer.el" "org/org-vm.el" "org/org-w3m.el" "org/org-wl.el"
-;;;;;;  "org/org-xoxo.el" "org/org.el" "outline.el" "paren.el" "password-cache.el"
-;;;;;;  "patcomp.el" "pcmpl-cvs.el" "pcmpl-gnu.el" "pcmpl-linux.el"
-;;;;;;  "pcmpl-rpm.el" "pcmpl-unix.el" "pcomplete.el" "pgg-def.el"
-;;;;;;  "pgg-gpg.el" "pgg-parse.el" "pgg-pgp.el" "pgg-pgp5.el" "pgg.el"
-;;;;;;  "play/5x5.el" "play/animate.el" "play/blackbox.el" "play/bruce.el"
-;;;;;;  "play/bubbles.el" "play/cookie1.el" "play/decipher.el" "play/dissociate.el"
-;;;;;;  "play/doctor.el" "play/dunnet.el" "play/fortune.el" "play/gamegrid.el"
-;;;;;;  "play/gametree.el" "play/gomoku.el" "play/handwrite.el" "play/hanoi.el"
-;;;;;;  "play/landmark.el" "play/life.el" "play/meese.el" "play/morse.el"
-;;;;;;  "play/mpuz.el" "play/pong.el" "play/snake.el" "play/solitaire.el"
-;;;;;;  "play/spook.el" "play/studly.el" "play/tetris.el" "play/yow.el"
-;;;;;;  "play/zone.el" "printing.el" "proced.el" "progmodes/ada-mode.el"
-;;;;;;  "progmodes/ada-prj.el" "progmodes/ada-stmt.el" "progmodes/ada-xref.el"
-;;;;;;  "progmodes/antlr-mode.el" "progmodes/asm-mode.el" "progmodes/autoconf.el"
-;;;;;;  "progmodes/bug-reference.el" "progmodes/cap-words.el" "progmodes/cc-align.el"
+;;;;;;  "org/ob-table.el" "org/org-beamer.el" "org/org-bibtex.el"
+;;;;;;  "org/org-colview.el" "org/org-compat.el" "org/org-crypt.el"
+;;;;;;  "org/org-ctags.el" "org/org-docview.el" "org/org-entities.el"
+;;;;;;  "org/org-exp-blocks.el" "org/org-faces.el" "org/org-gnus.el"
+;;;;;;  "org/org-habit.el" "org/org-info.el" "org/org-inlinetask.el"
+;;;;;;  "org/org-install.el" "org/org-jsinfo.el" "org/org-list.el"
+;;;;;;  "org/org-mac-message.el" "org/org-macs.el" "org/org-mew.el"
+;;;;;;  "org/org-mhe.el" "org/org-mks.el" "org/org-mouse.el" "org/org-protocol.el"
+;;;;;;  "org/org-rmail.el" "org/org-src.el" "org/org-vm.el" "org/org-w3m.el"
+;;;;;;  "org/org-wl.el" "patcomp.el" "pgg-def.el" "pgg-parse.el"
+;;;;;;  "pgg-pgp.el" "pgg-pgp5.el" "play/gamegrid.el" "play/gametree.el"
+;;;;;;  "play/meese.el" "progmodes/ada-prj.el" "progmodes/cc-align.el"
 ;;;;;;  "progmodes/cc-awk.el" "progmodes/cc-bytecomp.el" "progmodes/cc-cmds.el"
-;;;;;;  "progmodes/cc-compat.el" "progmodes/cc-defs.el" "progmodes/cc-engine.el"
-;;;;;;  "progmodes/cc-fonts.el" "progmodes/cc-langs.el" "progmodes/cc-menus.el"
-;;;;;;  "progmodes/cc-mode.el" "progmodes/cc-styles.el" "progmodes/cc-vars.el"
-;;;;;;  "progmodes/cfengine.el" "progmodes/cmacexp.el" "progmodes/compile.el"
-;;;;;;  "progmodes/cperl-mode.el" "progmodes/cpp.el" "progmodes/cwarn.el"
-;;;;;;  "progmodes/dcl-mode.el" "progmodes/delphi.el" "progmodes/ebnf-abn.el"
-;;;;;;  "progmodes/ebnf-bnf.el" "progmodes/ebnf-dtd.el" "progmodes/ebnf-ebx.el"
-;;;;;;  "progmodes/ebnf-iso.el" "progmodes/ebnf-otz.el" "progmodes/ebnf-yac.el"
-;;;;;;  "progmodes/ebnf2ps.el" "progmodes/ebrowse.el" "progmodes/etags.el"
-;;;;;;  "progmodes/executable.el" "progmodes/f90.el" "progmodes/flymake.el"
-;;;;;;  "progmodes/fortran.el" "progmodes/gdb-mi.el" "progmodes/glasses.el"
-;;;;;;  "progmodes/grep.el" "progmodes/gud.el" "progmodes/hideif.el"
-;;;;;;  "progmodes/hideshow.el" "progmodes/icon.el" "progmodes/idlw-complete-structtag.el"
-;;;;;;  "progmodes/idlw-help.el" "progmodes/idlw-shell.el" "progmodes/idlw-toolbar.el"
-;;;;;;  "progmodes/idlwave.el" "progmodes/inf-lisp.el" "progmodes/js.el"
-;;;;;;  "progmodes/ld-script.el" "progmodes/m4-mode.el" "progmodes/make-mode.el"
-;;;;;;  "progmodes/mantemp.el" "progmodes/meta-mode.el" "progmodes/mixal-mode.el"
-;;;;;;  "progmodes/modula2.el" "progmodes/octave-inf.el" "progmodes/octave-mod.el"
-;;;;;;  "progmodes/pascal.el" "progmodes/perl-mode.el" "progmodes/prolog.el"
-;;;;;;  "progmodes/ps-mode.el" "progmodes/python.el" "progmodes/ruby-mode.el"
-;;;;;;  "progmodes/scheme.el" "progmodes/sh-script.el" "progmodes/simula.el"
-;;;;;;  "progmodes/sql.el" "progmodes/subword.el" "progmodes/tcl.el"
-;;;;;;  "progmodes/vera-mode.el" "progmodes/verilog-mode.el" "progmodes/vhdl-mode.el"
-;;;;;;  "progmodes/which-func.el" "progmodes/xscheme.el" "ps-bdf.el"
-;;;;;;  "ps-def.el" "ps-mule.el" "ps-print.el" "ps-samp.el" "recentf.el"
-;;;;;;  "rect.el" "repeat.el" "reposition.el" "reveal.el" "rot13.el"
-;;;;;;  "ruler-mode.el" "savehist.el" "saveplace.el" "sb-image.el"
-;;;;;;  "scroll-all.el" "scroll-lock.el" "server.el" "ses.el" "sha1.el"
-;;;;;;  "shadowfile.el" "shell.el" "skeleton.el" "sort.el" "soundex.el"
-;;;;;;  "speedbar.el" "strokes.el" "subdirs.el" "t-mouse.el" "tabify.el"
-;;;;;;  "talk.el" "tar-mode.el" "tempo.el" "term.el" "terminal.el"
-;;;;;;  "textmodes/artist.el" "textmodes/bib-mode.el" "textmodes/bibtex-style.el"
-;;;;;;  "textmodes/bibtex.el" "textmodes/conf-mode.el" "textmodes/css-mode.el"
-;;;;;;  "textmodes/dns-mode.el" "textmodes/enriched.el" "textmodes/flyspell.el"
-;;;;;;  "textmodes/ispell.el" "textmodes/makeinfo.el" "textmodes/nroff-mode.el"
-;;;;;;  "textmodes/page-ext.el" "textmodes/picture.el" "textmodes/po.el"
-;;;;;;  "textmodes/refbib.el" "textmodes/refer.el" "textmodes/refill.el"
-;;;;;;  "textmodes/reftex-auc.el" "textmodes/reftex-cite.el" "textmodes/reftex-dcr.el"
-;;;;;;  "textmodes/reftex-global.el" "textmodes/reftex-index.el"
-;;;;;;  "textmodes/reftex-parse.el" "textmodes/reftex-ref.el" "textmodes/reftex-sel.el"
-;;;;;;  "textmodes/reftex-toc.el" "textmodes/reftex-vars.el" "textmodes/reftex.el"
-;;;;;;  "textmodes/remember.el" "textmodes/rst.el" "textmodes/sgml-mode.el"
-;;;;;;  "textmodes/spell.el" "textmodes/table.el" "textmodes/tex-mode.el"
-;;;;;;  "textmodes/texinfmt.el" "textmodes/texinfo.el" "textmodes/texnfo-upd.el"
-;;;;;;  "textmodes/tildify.el" "textmodes/two-column.el" "textmodes/underline.el"
-;;;;;;  "thingatpt.el" "thumbs.el" "time-stamp.el" "time.el" "timezone.el"
-;;;;;;  "tmm.el" "tree-widget.el" "tutorial.el" "type-break.el" "uniquify.el"
-;;;;;;  "url/url-about.el" "url/url-auth.el" "url/url-cache.el" "url/url-cid.el"
-;;;;;;  "url/url-cookie.el" "url/url-dav.el" "url/url-dired.el" "url/url-expand.el"
-;;;;;;  "url/url-file.el" "url/url-ftp.el" "url/url-gw.el" "url/url-handlers.el"
-;;;;;;  "url/url-history.el" "url/url-http.el" "url/url-imap.el"
-;;;;;;  "url/url-irc.el" "url/url-ldap.el" "url/url-mailto.el" "url/url-methods.el"
-;;;;;;  "url/url-misc.el" "url/url-news.el" "url/url-nfs.el" "url/url-ns.el"
-;;;;;;  "url/url-parse.el" "url/url-privacy.el" "url/url-proxy.el"
-;;;;;;  "url/url-util.el" "url/url-vars.el" "url/url.el" "userlock.el"
-;;;;;;  "vc/add-log.el" "vc/compare-w.el" "vc/cvs-status.el" "vc/diff-mode.el"
-;;;;;;  "vc/diff.el" "vc/ediff-diff.el" "vc/ediff-help.el" "vc/ediff-init.el"
-;;;;;;  "vc/ediff-merg.el" "vc/ediff-mult.el" "vc/ediff-ptch.el"
-;;;;;;  "vc/ediff-util.el" "vc/ediff-vers.el" "vc/ediff-wind.el"
-;;;;;;  "vc/ediff.el" "vc/emerge.el" "vc/log-edit.el" "vc/log-view.el"
-;;;;;;  "vc/pcvs-defs.el" "vc/pcvs-info.el" "vc/pcvs-parse.el" "vc/pcvs-util.el"
-;;;;;;  "vc/pcvs.el" "vc/smerge-mode.el" "vc/vc-annotate.el" "vc/vc-arch.el"
-;;;;;;  "vc/vc-bzr.el" "vc/vc-cvs.el" "vc/vc-dav.el" "vc/vc-dir.el"
-;;;;;;  "vc/vc-dispatcher.el" "vc/vc-git.el" "vc/vc-hg.el" "vc/vc-mtn.el"
-;;;;;;  "vc/vc-rcs.el" "vc/vc-sccs.el" "vc/vc-svn.el" "vc/vc.el"
-;;;;;;  "vcursor.el" "view.el" "vt-control.el" "vt100-led.el" "wdired.el"
-;;;;;;  "whitespace.el" "wid-browse.el" "wid-edit.el" "windmove.el"
-;;;;;;  "winner.el" "woman.el" "x-dnd.el" "xml.el" "xt-mouse.el")
-;;;;;;  (19686 22873 697000))
+;;;;;;  "progmodes/cc-defs.el" "progmodes/cc-fonts.el" "progmodes/cc-langs.el"
+;;;;;;  "progmodes/cc-menus.el" "progmodes/ebnf-abn.el" "progmodes/ebnf-bnf.el"
+;;;;;;  "progmodes/ebnf-dtd.el" "progmodes/ebnf-ebx.el" "progmodes/ebnf-iso.el"
+;;;;;;  "progmodes/ebnf-otz.el" "progmodes/ebnf-yac.el" "progmodes/idlw-complete-structtag.el"
+;;;;;;  "progmodes/idlw-help.el" "progmodes/idlw-toolbar.el" "progmodes/mantemp.el"
+;;;;;;  "progmodes/xscheme.el" "ps-def.el" "ps-mule.el" "ps-samp.el"
+;;;;;;  "saveplace.el" "sb-image.el" "scroll-bar.el" "select.el"
+;;;;;;  "soundex.el" "subdirs.el" "tempo.el" "textmodes/bib-mode.el"
+;;;;;;  "textmodes/makeinfo.el" "textmodes/page-ext.el" "textmodes/refbib.el"
+;;;;;;  "textmodes/refer.el" "textmodes/reftex-auc.el" "textmodes/reftex-dcr.el"
+;;;;;;  "textmodes/reftex-ref.el" "textmodes/reftex-sel.el" "textmodes/reftex-toc.el"
+;;;;;;  "textmodes/texnfo-upd.el" "timezone.el" "tooltip.el" "tree-widget.el"
+;;;;;;  "uniquify.el" "url/url-about.el" "url/url-cookie.el" "url/url-dired.el"
+;;;;;;  "url/url-expand.el" "url/url-ftp.el" "url/url-history.el"
+;;;;;;  "url/url-imap.el" "url/url-methods.el" "url/url-nfs.el" "url/url-proxy.el"
+;;;;;;  "url/url-vars.el" "vc/ediff-diff.el" "vc/ediff-init.el" "vc/ediff-merg.el"
+;;;;;;  "vc/ediff-ptch.el" "vc/ediff-vers.el" "vc/ediff-wind.el"
+;;;;;;  "vc/pcvs-info.el" "vc/pcvs-parse.el" "vc/pcvs-util.el" "vc/vc-dav.el"
+;;;;;;  "vcursor.el" "vt-control.el" "vt100-led.el" "w32-fns.el"
+;;;;;;  "w32-vars.el" "x-dnd.el") (19696 28874 906463))
 
 ;;;***
 
--- a/lisp/loadup.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/loadup.el	Thu Dec 16 18:30:57 2010 -0500
@@ -292,46 +292,16 @@
       (error nil)))
 (message "Finding pointers to doc strings...done")
 
-;;;Note: You can cause additional libraries to be preloaded
-;;;by writing a site-init.el that loads them.
-;;;See also "site-load" above.
+;; Note: You can cause additional libraries to be preloaded
+;; by writing a site-init.el that loads them.
+;; See also "site-load" above.
 (load "site-init" t)
 (setq current-load-list nil)
 
-;; Write the value of load-history into fns-VERSION.el,
-;; then clear out load-history.
-;; (if (or (equal (nth 3 command-line-args) "dump")
-;; 	(equal (nth 4 command-line-args) "dump"))
-;;     (let ((buffer-undo-list t))
-;;       (princ "(setq load-history\n" (current-buffer))
-;;       (princ "      (nconc load-history\n" (current-buffer))
-;;       (princ "             '(" (current-buffer))
-;;       (let ((tem load-history))
-;; 	(while tem
-;; 	  (prin1 (car tem) (current-buffer))
-;; 	  (terpri (current-buffer))
-;; 	  (if (cdr tem)
-;; 	      (princ "               " (current-buffer)))
-;; 	  (setq tem (cdr tem))))
-;;       (princ ")))\n" (current-buffer))
-;;       (write-region (point-min) (point-max)
-;; 		    (expand-file-name
-;; 		     (cond
-;; 		      ((eq system-type 'ms-dos)
-;; 		       "../lib-src/fns.el")
-;; 		      ((eq system-type 'windows-nt)
-;; 		       (format "../../../lib-src/fns-%s.el" emacs-version))
-;; 		      (t
-;; 		       (format "../lib-src/fns-%s.el" emacs-version)))
-;; 		     invocation-directory))
-;;       (erase-buffer)
-;;       (setq load-history nil))
-;;   (setq symbol-file-load-history-loaded t))
-;; We don't use this fns-*.el file.  Instead we keep the data in PURE space.
+;; We keep the load-history data in PURE space.
 ;; Make sure that the spine of the list is not in pure space because it can
 ;; be destructively mutated in lread.c:build_load_history.
 (setq load-history (mapcar 'purecopy load-history))
-(setq symbol-file-load-history-loaded t)
 
 (set-buffer-modified-p nil)
 
--- a/lisp/locate.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/locate.el	Thu Dec 16 18:30:57 2010 -0500
@@ -145,6 +145,11 @@
   :type 'string
   :group 'locate)
 
+(defcustom locate-post-command-hook nil
+  "List of hook functions run after `locate' (see `run-hooks')."
+  :type  'hook
+  :group 'locate)
+
 (defvar locate-history-list nil
   "The history list used by the \\[locate] command.")
 
@@ -226,6 +231,11 @@
   :group 'locate
   :type 'boolean)
 
+(defcustom locate-mode-hook nil
+  "List of hook functions run by `locate-mode' (see `run-mode-hooks')."
+  :type  'hook
+  :group 'locate)
+
 ;; Functions
 
 (defun locate-default-make-command-line (search-string)
@@ -471,9 +481,9 @@
   (make-local-variable 'directory-listing-before-filename-regexp)
   ;; This should support both Unix and Windoze style names
   (setq directory-listing-before-filename-regexp
-	(concat "^."
+	(concat "^.\\("
 		(make-string (1- locate-filename-indentation) ?\s)
-		"\\(/\\|[A-Za-z]:\\)\\|"
+		 "\\)\\|"
 		(default-value 'directory-listing-before-filename-regexp)))
   (make-local-variable 'dired-actual-switches)
   (setq dired-actual-switches "")
--- a/lisp/lpr.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/lpr.el	Thu Dec 16 18:30:57 2010 -0500
@@ -152,7 +152,9 @@
   "Print buffer contents without pagination or page headers.
 See the variables `lpr-switches' and `lpr-command'
 for customization of the printer command."
-  (interactive)
+  (interactive
+   (unless (y-or-n-p "Send current buffer to default printer? ")
+     (error "Cancelled")))
   (print-region-1 (point-min) (point-max) lpr-switches nil))
 
 ;;;###autoload
@@ -169,7 +171,9 @@
 
 See the variables `lpr-switches' and `lpr-command'
 for further customization of the printer command."
-  (interactive)
+  (interactive
+   (unless (y-or-n-p "Send current buffer to default printer? ")
+     (error "Cancelled")))
   (print-region-1 (point-min) (point-max) lpr-switches t))
 
 ;;;###autoload
@@ -177,7 +181,10 @@
   "Print region contents without pagination or page headers.
 See the variables `lpr-switches' and `lpr-command'
 for customization of the printer command."
-  (interactive "r")
+  (interactive
+   (if (y-or-n-p "Send selected text to default printer? ")
+       (list (region-beginning) (region-end))
+     (error "Cancelled")))
   (print-region-1 start end lpr-switches nil))
 
 ;;;###autoload
@@ -194,7 +201,10 @@
 
 See the variables `lpr-switches' and `lpr-command'
 for further customization of the printer command."
-  (interactive "r")
+  (interactive
+   (if (y-or-n-p "Send selected text to default printer? ")
+       (list (region-beginning) (region-end))
+     (error "Cancelled")))
   (print-region-1 start end lpr-switches t))
 
 (defun print-region-1 (start end switches page-headers)
--- a/lisp/mail/emacsbug.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/mail/emacsbug.el	Thu Dec 16 18:30:57 2010 -0500
@@ -279,16 +279,11 @@
     (if can-xdg-email
 	(define-key (current-local-map) "\C-cm"
 	  'report-emacs-bug-insert-to-mailer))
-    ;; Could test major-mode instead.
-    (cond ((memq mail-user-agent '(message-user-agent gnus-user-agent))
-           (setq report-emacs-bug-send-command "message-send-and-exit"
-                 report-emacs-bug-send-hook 'message-send-hook))
-          ((eq mail-user-agent 'sendmail-user-agent)
-           (setq report-emacs-bug-send-command "mail-send-and-exit"
-                 report-emacs-bug-send-hook 'mail-send-hook))
-          ((eq mail-user-agent 'mh-e-user-agent)
-           (setq report-emacs-bug-send-command "mh-send-letter"
-                 report-emacs-bug-send-hook 'mh-before-send-letter-hook)))
+    (setq report-emacs-bug-send-command (get mail-user-agent 'sendfunc)
+	  report-emacs-bug-send-hook (get mail-user-agent 'hookvar))
+    (if report-emacs-bug-send-command
+	(setq report-emacs-bug-send-command
+	      (symbol-name report-emacs-bug-send-command)))
     (unless report-emacs-bug-no-explanations
       (with-output-to-temp-buffer "*Bug Help*"
 	(princ "While in the mail buffer:\n\n")
@@ -380,30 +375,33 @@
 
 ;; Querying the bug database
 
+(defvar report-emacs-bug-bug-alist nil)
+(make-variable-buffer-local 'report-emacs-bug-bug-alist)
+(defvar report-emacs-bug-choice-widget nil)
+(make-variable-buffer-local 'report-emacs-bug-choice-widget)
+
 (defun report-emacs-bug-create-existing-bugs-buffer (bugs keywords)
   (switch-to-buffer (get-buffer-create "*Existing Emacs Bugs*"))
   (setq buffer-read-only t)
   (let ((inhibit-read-only t))
     (erase-buffer)
-    (make-local-variable 'bug-alist)
-    (setq bug-alist bugs)
-    (make-local-variable 'bug-choice-widget)
+    (setq report-emacs-bug-bug-alist bugs)
     (widget-insert (propertize (concat "Already known bugs ("
 				       keywords "):\n\n")
 			       'face 'bold))
     (if bugs
-	(setq bug-choice-widget
+	(setq report-emacs-bug-choice-widget
 	      (apply 'widget-create 'radio-button-choice
-		     :value (car (first bugs))
+		     :value (caar bugs)
 		     (let (items)
 		       (dolist (bug bugs)
 			 (push (list
 				'url-link
-				:format (concat "Bug#" (number-to-string (third bug))
-						": " (second bug) "\n    %[%v%]\n")
+				:format (concat "Bug#" (number-to-string (nth 2 bug))
+						": " (cadr bug) "\n    %[%v%]\n")
 				;; FIXME: Why is only the link of the
 				;; active item clickable?
-				(first bug))
+				(car bug))
 			       items))
 		       (nreverse items))))
       (widget-insert "No bugs maching your keywords found.\n"))
@@ -417,10 +415,10 @@
       (widget-insert " ")
       (widget-create 'push-button
 		     :notify (lambda (&rest ignore)
-			       (let ((val (widget-value bug-choice-widget)))
+			       (let ((val (widget-value report-emacs-bug-choice-widget)))
 				 ;; TODO: Do something!
 				 (message "Appending to bug %s!"
-					  (third (assoc val bug-alist)))))
+					  (nth 2 (assoc val report-emacs-bug-bug-alist)))))
 		     "Append to chosen bug"))
     (widget-insert " ")
     (widget-create 'push-button
@@ -451,7 +449,7 @@
 (defun report-emacs-bug-query-existing-bugs (keywords)
   "Query for KEYWORDS at `report-emacs-bug-tracker-url', and return the result.
 The result is an alist with items of the form (URL SUBJECT NO)."
-  (interactive "sBug keywords: ")
+  (interactive "sBug keywords (comma separated): ")
   (url-retrieve (concat report-emacs-bug-tracker-url
 			"pkgreport.cgi?include=subject%3A"
 			(replace-regexp-in-string "[[:space:]]+" "+" keywords)
--- a/lisp/mail/mail-utils.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/mail/mail-utils.el	Thu Dec 16 18:30:57 2010 -0500
@@ -28,10 +28,6 @@
 
 ;;; Code:
 
-;;; We require lisp-mode to make sure that lisp-mode-syntax-table has
-;;; been initialized.
-(require 'lisp-mode)
-
 ;;;###autoload
 (defcustom mail-use-rfc822 nil
   "If non-nil, use a full, hairy RFC822 parser on mail addresses.
--- a/lisp/mail/mailalias.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/mail/mailalias.el	Thu Dec 16 18:30:57 2010 -0500
@@ -1,7 +1,8 @@
 ;;; mailalias.el --- expand and complete mailing address aliases
 
-;; Copyright (C) 1985, 1987, 1995, 1996, 1997, 2001, 2002, 2003,
-;;   2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 1987, 1995, 1996, 1997, 2001, 2002, 2003, 2004,
+;;   2005, 2006, 2007, 2008, 2009, 2010
+;;   Free Software Foundation, Inc.
 
 ;; Maintainer: FSF
 ;; Keywords: mail
@@ -240,6 +241,11 @@
 (defun build-mail-aliases (&optional file)
   "Read mail aliases from personal aliases file and set `mail-aliases'.
 By default, this is the file specified by `mail-personal-alias-file'."
+  (interactive
+   (list
+    (read-file-name (format "Read mail alias file (default %s): "
+			    mail-personal-alias-file)
+		    nil mail-personal-alias-file t)))
   (setq file (expand-file-name (or file mail-personal-alias-file)))
   ;; In case mail-aliases is t, make sure define-mail-alias
   ;; does not recursively call build-mail-aliases.
@@ -562,5 +568,4 @@
 
 (provide 'mailalias)
 
-;; arch-tag: 1d6a0f87-eb34-4d45-8816-60c1b952cf46
 ;;; mailalias.el ends here
--- a/lisp/mail/mailclient.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/mail/mailclient.el	Thu Dec 16 18:30:57 2010 -0500
@@ -46,6 +46,7 @@
 
 (require 'sendmail)   ;; for mail-sendmail-undelimit-header
 (require 'mail-utils) ;; for mail-fetch-field
+(require 'browse-url)
 
 (defcustom mailclient-place-body-on-clipboard-flag
   (fboundp 'w32-set-clipboard-data)
@@ -122,7 +123,10 @@
 	  (while (and (re-search-forward "\n\n\n*" delimline t)
 		      (< (point) delimline))
 	    (replace-match "\n"))
-	  (let ((case-fold-search t))
+	  (let ((case-fold-search t)
+		;; Use the external browser function to send the
+		;; message.
+		(browse-url-mailto-function nil))
 	    ;; initialize limiter
 	    (setq mailclient-delim-static "?")
 	    ;; construct and call up mailto URL
--- a/lisp/mail/rfc2368.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/mail/rfc2368.el	Thu Dec 16 18:30:57 2010 -0500
@@ -92,13 +92,11 @@
 calling this function."
   (let ((case-fold-search t)
 	prequery query headers-alist)
-
+    (setq mailto-url (replace-regexp-in-string "\n" " " mailto-url))
     (if (string-match rfc2368-mailto-regexp mailto-url)
 	(progn
-
 	  (setq prequery
 		(match-string rfc2368-mailto-prequery-index mailto-url))
-
 	  (setq query
 		(match-string rfc2368-mailto-query-index mailto-url))
 
@@ -131,10 +129,8 @@
 
 	  headers-alist)
 
-      (error "Failed to match a mailto: url"))
-    ))
+      (error "Failed to match a mailto: url"))))
 
 (provide 'rfc2368)
 
-;; arch-tag: ea804934-ad96-4f69-957b-857a76e4fd95
 ;;; rfc2368.el ends here
--- a/lisp/mail/rmail.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/mail/rmail.el	Thu Dec 16 18:30:57 2010 -0500
@@ -39,6 +39,7 @@
 ;;
 
 (require 'mail-utils)
+(require 'rfc2047)
 
 (defconst rmail-attribute-header "X-RMAIL-ATTRIBUTES"
   "The header that stores the Rmail attribute data.")
@@ -638,7 +639,7 @@
 
 This is set to nil by default.")
 
-(defcustom rmail-enable-mime nil
+(defcustom rmail-enable-mime t
   "If non-nil, RMAIL uses MIME features.
 If the value is t, RMAIL automatically shows MIME decoded message.
 If the value is neither t nor nil, RMAIL does not show MIME decoded message
@@ -649,6 +650,7 @@
   :type '(choice (const :tag "on" t)
 		 (const :tag "off" nil)
 		 (other :tag "when asked" ask))
+  :version "23.3"
   :group 'rmail)
 
 (defvar rmail-enable-mime-composing nil
@@ -693,13 +695,12 @@
 where MSG is the message number, REGEXP is the regular
 expression, LIMIT is the position specifying the end of header.")
 
-(defvar rmail-mime-feature 'rmail-mime
+(defvar rmail-mime-feature 'rmailmm
   "Feature to require to load MIME support in Rmail.
 When starting Rmail, if `rmail-enable-mime' is non-nil,
 this feature is required with `require'.
 
-The default value is `rmail-mime'.  This feature is provided by
-the rmail-mime package available at <http://www.m17n.org/rmail-mime/>.")
+The default value is `rmailmm'")
 
 ;; FIXME this is unused.
 (defvar rmail-decode-mime-charset t
@@ -1509,17 +1510,9 @@
       (set-buffer-modified-p nil))
     (replace-buffer-in-windows rmail-summary-buffer)
     (bury-buffer rmail-summary-buffer))
-  (if rmail-enable-mime
-      (let ((obuf rmail-buffer)
-	    (ovbuf rmail-view-buffer))
-	(set-buffer rmail-view-buffer)
-	(quit-window)
-	(replace-buffer-in-windows ovbuf)
-	(replace-buffer-in-windows obuf)
-	(bury-buffer obuf))
-    (let ((obuf (current-buffer)))
-      (quit-window)
-      (replace-buffer-in-windows obuf))))
+  (let ((obuf (current-buffer)))
+    (quit-window)
+    (replace-buffer-in-windows obuf)))
 
 (defun rmail-bury ()
   "Bury current Rmail buffer and its summary buffer."
@@ -2219,15 +2212,7 @@
   (let ((blurb (rmail-get-labels)))
     (setq mode-line-process
 	  (format " %d/%d%s"
-		  rmail-current-message rmail-total-messages blurb))
-    ;; If rmail-enable-mime is non-nil, we may have to update
-    ;; `mode-line-process' of rmail-view-buffer too.
-    (if (and rmail-enable-mime
-	     (not (eq (current-buffer) rmail-view-buffer))
-	     (buffer-live-p rmail-view-buffer))
-	(let ((mlp mode-line-process))
-	  (with-current-buffer rmail-view-buffer
-	    (setq mode-line-process mlp))))))
+		  rmail-current-message rmail-total-messages blurb))))
 
 (defun rmail-get-attr-value (attr state)
   "Return the character value for ATTR.
@@ -2706,6 +2691,11 @@
 	  (message "Showing message %d" msg))
 	(narrow-to-region beg end)
 	(goto-char beg)
+	(if (and rmail-enable-mime
+		 (re-search-forward "mime-version: 1.0" nil t))
+	    (let ((rmail-buffer mbox-buf)
+		  (rmail-view-buffer view-buf))
+	      (funcall rmail-show-mime-function))
 	(setq body-start (search-forward "\n\n" nil t))
 	(narrow-to-region beg (point))
 	(goto-char beg)
@@ -2722,11 +2712,6 @@
 	;; unibyte temporary buffer where the character decoding takes
 	;; place.
 	(with-current-buffer rmail-view-buffer
-	  ;; We give the view buffer a buffer-local value of
-	  ;; rmail-header-style based on the binding in effect when
-	  ;; this function is called; `rmail-toggle-headers' can
-	  ;; inspect this value to determine how to toggle.
-	  (set (make-local-variable 'rmail-header-style) header-style)
 	  (erase-buffer))
 	(if (null character-coding)
 	    ;; Do it directly since that is fast.
@@ -2749,8 +2734,13 @@
 	      (error "uuencoded messages are not supported yet"))
 	     (t))
 	    (rmail-decode-region (point-min) (point-max)
-				 coding-system view-buf)))
+				 coding-system view-buf))))
 	(with-current-buffer rmail-view-buffer
+	  ;; We give the view buffer a buffer-local value of
+	  ;; rmail-header-style based on the binding in effect when
+	  ;; this function is called; `rmail-toggle-headers' can
+	  ;; inspect this value to determine how to toggle.
+	  (set (make-local-variable 'rmail-header-style) header-style)
 	  ;; Unquote quoted From lines
 	  (goto-char (point-min))
 	  (while (re-search-forward "^>+From " nil t)
@@ -2766,6 +2756,10 @@
 	(with-current-buffer rmail-view-buffer
 	  (insert "\n")
 	  (goto-char (point-min))
+	  ;; Decode the headers according to RFC2047.
+	  (save-excursion
+	    (search-forward "\n\n" nil 'move)
+	    (rfc2047-decode-region (point-min) (point)))
 	  (rmail-highlight-headers)
 					;(rmail-activate-urls)
 					;(rmail-process-quoted-material)
@@ -4295,7 +4289,7 @@
 
 ;;;***
 
-;;;### (autoloads (rmail-mime) "rmailmm" "rmailmm.el" "9f67f3b67de9b700b128b73c52abfefa")
+;;;### (autoloads (rmail-mime) "rmailmm" "rmailmm.el" "b1ce015fd919b54cc7b1d0b2155489f9")
 ;;; Generated autoloads from rmailmm.el
 
 (autoload 'rmail-mime "rmailmm" "\
@@ -4386,7 +4380,7 @@
 
 ;;;### (autoloads (rmail-summary-by-senders rmail-summary-by-topic
 ;;;;;;  rmail-summary-by-regexp rmail-summary-by-recipients rmail-summary-by-labels
-;;;;;;  rmail-summary) "rmailsum" "rmailsum.el" "4715fb58fb191bf6b192458ea75524b2")
+;;;;;;  rmail-summary) "rmailsum" "rmailsum.el" "666a5db1021cdcba6e68a18a553d65f1")
 ;;; Generated autoloads from rmailsum.el
 
 (autoload 'rmail-summary "rmailsum" "\
--- a/lisp/mail/rmailmm.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/mail/rmailmm.el	Thu Dec 16 18:30:57 2010 -0500
@@ -27,17 +27,57 @@
 
 ;; Essentially based on the design of Alexander Pohoyda's MIME
 ;; extensions (mime-display.el and mime.el).
-;; Call `M-x rmail-mime' when viewing an Rmail message.
+
+;; This file provides two operation modes for viewing a MIME message.
+
+;; (1) When rmail-enable-mime is non-nil (now it is the default), the
+;; function `rmail-show-mime' is automatically called.  That function
+;; shows a MIME message directly in RMAIL's view buffer.
+
+;; (2) When rmail-enable-mime is nil, the command 'v' (or M-x
+;; rmail-mime) shows a MIME message in a new buffer "*RMAIL*".
+
+;; Both operations share the intermediate functions rmail-mime-process
+;; and rmail-mime-process-multipart as below.
+
+;; rmail-show-mime
+;;   +- rmail-mime-parse
+;;   |    +- rmail-mime-process <--+------------+
+;;   |         |         +---------+            |
+;;   |         + rmail-mime-process-multipart --+
+;;   |
+;;   + rmail-mime-insert <----------------+
+;;       +- rmail-mime-insert-text        |
+;;       +- rmail-mime-insert-bulk        |
+;;       +- rmail-mime-insert-multipart --+
+;;
+;; rmail-mime
+;;  +- rmail-mime-show <----------------------------------+
+;;       +- rmail-mime-process                            | 
+;;            +- rmail-mime-handle                        |
+;;                 +- rmail-mime-text-handler             |
+;;                 +- rmail-mime-bulk-handler             |
+;;                 |    + rmail-mime-insert-bulk
+;;                 +- rmail-mime-multipart-handler        |
+;;                      +- rmail-mime-process-multipart --+
+
+;; In addition, for the case of rmail-enable-mime being non-nil, this
+;; file provides two functions rmail-insert-mime-forwarded-message and
+;; rmail-insert-mime-resent-message for composing forwarded and resent
+;; messages respectively.
 
 ;; Todo:
 
-;; Handle multipart/alternative.
+;; Make rmail-mime-media-type-handlers-alist usable in the first
+;; operation mode.
+;; Handle multipart/alternative in the second operation mode.
 ;; Offer the option to call external/internal viewers (doc-view, xpdf, etc).
 
 ;;; Code:
 
 (require 'rmail)
 (require 'mail-parse)
+(require 'message)
 
 ;;; User options.
 
@@ -91,6 +131,52 @@
 
 ;;; End of user options.
 
+;;; MIME-entity object
+
+(defun rmail-mime-entity (type disposition transfer-encoding
+			       header body children)
+  "Retrun a newly created MIME-entity object.
+
+A MIME-entity is a vector of 6 elements:
+
+  [ TYPE DISPOSITION TRANSFER-ENCODING HEADER BODY CHILDREN ]
+  
+TYPE and DISPOSITION correspond to MIME headers Content-Type: and
+Cotent-Disposition: respectively, and has this format:
+
+  \(VALUE (ATTRIBUTE . VALUE) (ATTRIBUTE . VALUE) ...)
+
+VALUE is a string and ATTRIBUTE is a symbol.
+
+Consider the following header, for example:
+
+Content-Type: multipart/mixed;
+	boundary=\"----=_NextPart_000_0104_01C617E4.BDEC4C40\"
+
+The corresponding TYPE argument must be:
+
+\(\"multipart/mixed\"
+  \(\"boundary\" . \"----=_NextPart_000_0104_01C617E4.BDEC4C40\"))
+
+TRANSFER-ENCODING corresponds to MIME header
+Content-Transfer-Encoding, and is a lowercased string.
+
+HEADER and BODY are a cons (BEG . END), where BEG and END specify
+the region of the corresponding part in RMAIL's data (mbox)
+buffer.  BODY may be nil.  In that case, the current buffer is
+narrowed to the body part.
+
+CHILDREN is a list of MIME-entities for a \"multipart\" entity, and
+nil for the other types."
+  (vector type disposition transfer-encoding header body children))
+
+;; Accessors for a MIME-entity object.
+(defsubst rmail-mime-entity-type (entity) (aref entity 0))
+(defsubst rmail-mime-entity-disposition (entity) (aref entity 1))
+(defsubst rmail-mime-entity-transfer-encoding (entity) (aref entity 2))
+(defsubst rmail-mime-entity-header (entity) (aref entity 3))
+(defsubst rmail-mime-entity-body (entity) (aref entity 4))
+(defsubst rmail-mime-entity-children (entity) (aref entity 5))
 
 ;;; Buttons
 
@@ -99,6 +185,7 @@
   (let* ((filename (button-get button 'filename))
 	 (directory (button-get button 'directory))
 	 (data (button-get button 'data))
+	 (mbox-buf rmail-view-buffer)
 	 (ofilename filename))
     (setq filename (expand-file-name
 		    (read-file-name (format "Save as (default: %s): " filename)
@@ -117,7 +204,17 @@
       ;; file, the magic signature compares equal with the unibyte
       ;; signature string recorded in jka-compr-compression-info-list.
       (set-buffer-multibyte nil)
-      (insert data)
+      (setq buffer-undo-list t)
+      (if (stringp data)
+	  (insert data)
+	;; DATA is a MIME-entity object.
+	(let ((transfer-encoding (rmail-mime-entity-transfer-encoding data))
+	      (body (rmail-mime-entity-body data)))
+	  (insert-buffer-substring mbox-buf (car body) (cdr body))
+	  (cond ((string= transfer-encoding "base64")
+		 (ignore-errors (base64-decode-region (point-min) (point-max))))
+		((string= transfer-encoding "quoted-printable")
+		 (quoted-printable-decode-region (point-min) (point-max))))))
       (write-region nil nil filename nil nil nil t))))
 
 (define-button-type 'rmail-mime-save 'action 'rmail-mime-save)
@@ -134,6 +231,23 @@
     (when (coding-system-p coding-system)
       (decode-coding-region (point-min) (point-max) coding-system))))
 
+(defun rmail-mime-insert-text (entity)
+  "Insert MIME-entity ENTITY as a plain text MIME part in the current buffer."
+  (let* ((content-type (rmail-mime-entity-type entity))
+	 (charset (cdr (assq 'charset (cdr content-type))))
+	 (coding-system (if charset (intern (downcase charset))))
+	 (transfer-encoding (rmail-mime-entity-transfer-encoding entity))
+	 (body (rmail-mime-entity-body entity)))
+    (save-restriction
+      (narrow-to-region (point) (point))
+      (insert-buffer-substring rmail-buffer (car body) (cdr body))
+      (cond ((string= transfer-encoding "base64")
+	     (ignore-errors (base64-decode-region (point-min) (point-max))))
+	    ((string= transfer-encoding "quoted-printable")
+	     (quoted-printable-decode-region (point-min) (point-max))))
+      (if (coding-system-p coding-system)
+	  (decode-coding-region (point-min) (point-max) coding-system)))))
+
 ;; FIXME move to the test/ directory?
 (defun test-rmail-mime-handler ()
   "Test of a mail using no MIME parts at all."
@@ -152,10 +266,28 @@
 
 
 (defun rmail-mime-insert-image (type data)
-  "Insert an image of type TYPE, where DATA is the image data."
+  "Insert an image of type TYPE, where DATA is the image data.
+If DATA is not a string, it is a MIME-entity object."
   (end-of-line)
-  (insert ?\n)
-  (insert-image (create-image data type t)))
+  (let ((modified (buffer-modified-p)))
+    (insert ?\n)
+    (unless (stringp data)
+      ;; DATA is a MIME-entity.
+      (let ((transfer-encoding (rmail-mime-entity-transfer-encoding data))
+	    (body (rmail-mime-entity-body data))
+	    (mbox-buffer rmail-view-buffer))
+	(with-temp-buffer
+	  (set-buffer-multibyte nil)
+	  (setq buffer-undo-list t)
+	  (insert-buffer-substring mbox-buffer (car body) (cdr body))
+	  (cond ((string= transfer-encoding "base64")
+		 (ignore-errors (base64-decode-region (point-min) (point-max))))
+		((string= transfer-encoding "quoted-printable")
+		 (quoted-printable-decode-region (point-min) (point-max))))
+	  (setq data
+		(buffer-substring-no-properties (point-min) (point-max))))))
+    (insert-image (create-image data type t))
+    (set-buffer-modified-p modified)))
 
 (defun rmail-mime-image (button)
   "Display the image associated with BUTTON."
@@ -172,8 +304,19 @@
   "Handle the current buffer as an attachment to download.
 For images that Emacs is capable of displaying, the behavior
 depends upon the value of `rmail-mime-show-images'."
+  (rmail-mime-insert-bulk
+   (rmail-mime-entity content-type content-disposition content-transfer-encoding
+		      nil nil nil)))
+
+(defun rmail-mime-insert-bulk (entity)
+  "Inesrt a MIME-entity ENTITY as an attachment.
+The optional second arg DATA, if non-nil, is a string containing
+the attachment data that is already decoded."
   ;; Find the default directory for this media type.
-  (let* ((directory (catch 'directory
+  (let* ((content-type (rmail-mime-entity-type entity))
+	 (content-disposition (rmail-mime-entity-disposition entity))
+	 (body (rmail-mime-entity-body entity))
+	 (directory (catch 'directory
 		      (dolist (entry rmail-mime-attachment-dirs-alist)
 			(when (string-match (car entry) (car content-type))
 			  (dolist (dir (cdr entry))
@@ -183,17 +326,21 @@
 		       (cdr (assq 'filename (cdr content-disposition)))
 		       "noname"))
 	 (label (format "\nAttached %s file: " (car content-type)))
-	 (data (buffer-string))
-	 (udata (string-as-unibyte data))
-	 (size (length udata))
-	 (osize size)
 	 (units '(B kB MB GB))
-	 type)
-    (while (and (> size 1024.0)	; cribbed from gnus-agent-expire-done-message
+	 data udata size osize type)
+    (if body
+	(setq data entity
+	      udata entity
+	      size (- (cdr body) (car body)))
+      (setq data (buffer-string)
+	    udata (string-as-unibyte data)
+	    size (length udata))
+      (delete-region (point-min) (point-max)))
+    (setq osize size)
+    (while (and (> size 1024.0) ; cribbed from gnus-agent-expire-done-message
 		(cdr units))
       (setq size (/ size 1024.0)
 	    units (cdr units)))
-    (delete-region (point-min) (point-max))
     (insert label)
     (insert-button filename
 		   :type 'rmail-mime-save
@@ -249,6 +396,22 @@
 CONTENT-DISPOSITION, and CONTENT-TRANSFER-ENCODING are the values
 of the respective parsed headers.  See `rmail-mime-handle' for their
 format."
+  (rmail-mime-process-multipart
+   content-type content-disposition content-transfer-encoding nil))
+
+(defun rmail-mime-process-multipart (content-type
+				     content-disposition
+				     content-transfer-encoding
+				     parse-only)
+  "Process the current buffer as a multipart MIME body.
+
+If PARSE-ONLY is nil, modify the current buffer directly for showing
+the MIME body and return nil.
+
+Otherwise, just parse the current buffer and return a list of
+MIME-entity objects.
+
+The other arguments are the same as `rmail-mime-multipart-handler'."
   ;; Some MUAs start boundaries with "--", while it should start
   ;; with "CRLF--", as defined by RFC 2046:
   ;;    The boundary delimiter MUST occur at the beginning of a line,
@@ -257,7 +420,7 @@
   ;;    of the preceding part.
   ;; We currently don't handle that.
   (let ((boundary (cdr (assq 'boundary content-type)))
-	beg end next)
+	beg end next entities)
     (unless boundary
       (rmail-mm-get-boundary-error-message
        "No boundary defined" content-type content-disposition
@@ -267,7 +430,9 @@
     (goto-char (point-min))
     (when (and (search-forward boundary nil t)
 	       (looking-at "[ \t]*\n"))
-      (delete-region (point-min) (match-end 0)))
+      (if parse-only
+	  (narrow-to-region (match-end 0) (point-max))
+	(delete-region (point-min) (match-end 0))))
     ;; Loop over all body parts, where beg points at the beginning of
     ;; the part and end points at the end of the part.  next points at
     ;; the beginning of the next part.
@@ -285,13 +450,17 @@
 	     (rmail-mm-get-boundary-error-message
 	      "Malformed boundary" content-type content-disposition
 	      content-transfer-encoding)))
-      (delete-region end next)
       ;; Handle the part.
-      (save-restriction
-	(narrow-to-region beg end)
-	(rmail-mime-show))
-      (goto-char (setq beg next)))))
-
+      (if parse-only
+	  (save-restriction
+	    (narrow-to-region beg end)
+	    (setq entities (cons (rmail-mime-process nil t) entities)))
+	(delete-region end next)
+	(save-restriction
+	  (narrow-to-region beg end)
+	  (rmail-mime-show)))
+      (goto-char (setq beg next)))
+    (nreverse entities)))
 
 (defun test-rmail-mime-multipart-handler ()
   "Test of a mail used as an example in RFC 2046."
@@ -394,6 +563,9 @@
 
 The current buffer must contain a single message.  It will be
 modified."
+  (rmail-mime-process show-headers nil))
+
+(defun rmail-mime-process (show-headers parse-only)
   (let ((end (point-min))
 	content-type
 	content-transfer-encoding
@@ -437,14 +609,107 @@
     ;; attachment according to RFC 2183.
     (unless (member (car content-disposition) '("inline" "attachment"))
       (setq content-disposition '("attachment")))
-    ;; Hide headers and handle the part.
-    (save-restriction
-      (cond ((string= (car content-type) "message/rfc822")
-	     (narrow-to-region end (point-max)))
-	    ((not show-headers)
-	     (delete-region (point-min) end)))
-      (rmail-mime-handle content-type content-disposition
-			 content-transfer-encoding))))
+
+    (if parse-only
+	(cond ((string-match "multipart/.*" (car content-type))
+	       (setq end (1- end))
+	       (save-restriction
+		 (let ((header (if show-headers (cons (point-min) end))))
+		   (narrow-to-region end (point-max))
+		   (rmail-mime-entity content-type
+				      content-disposition
+				      content-transfer-encoding
+				      header nil
+				      (rmail-mime-process-multipart
+				       content-type content-disposition
+				       content-transfer-encoding t)))))
+	      ((string-match "message/rfc822" (car content-type))
+	       (or show-headers
+		   (narrow-to-region end (point-max)))
+	       (rmail-mime-process t t))
+	      (t
+	       (rmail-mime-entity content-type
+				  content-disposition
+				  content-transfer-encoding
+				  nil
+				  (cons end (point-max))
+				  nil)))
+      ;; Hide headers and handle the part.
+      (save-restriction
+	(cond ((string= (car content-type) "message/rfc822")
+	       (narrow-to-region end (point-max)))
+	      ((not show-headers)
+	       (delete-region (point-min) end)))
+	(rmail-mime-handle content-type content-disposition
+			   content-transfer-encoding)))))
+
+(defun rmail-mime-insert-multipart (entity)
+  "Insert MIME-entity ENTITY of multipart type in the current buffer."
+  (let ((subtype (cadr (split-string (car (rmail-mime-entity-type entity))
+				     "/")))
+	(disposition (rmail-mime-entity-disposition entity))
+	(header (rmail-mime-entity-header entity))
+	(children (rmail-mime-entity-children entity)))
+    (if header
+	(let ((pos (point)))
+	  (or (bolp)
+	      (insert "\n"))
+	  (insert-buffer-substring rmail-buffer (car header) (cdr header))
+	  (rfc2047-decode-region pos (point))
+	  (insert "\n")))
+    (cond
+     ((string= subtype "mixed")
+      (dolist (child children)
+	(rmail-mime-insert child '("text/plain") disposition)))
+     ((string= subtype "digest")
+      (dolist (child children)
+	(rmail-mime-insert child '("message/rfc822") disposition)))
+     ((string= subtype "alternative")
+      (let (best-plain-text best-text)
+	(dolist (child children)
+	  (if (string= (or (car (rmail-mime-entity-disposition child))
+			   (car disposition))
+		       "inline")
+	      (if (string-match "text/plain"
+				(car (rmail-mime-entity-type child)))
+		  (setq best-plain-text child)
+		(if (string-match "text/.*"
+				  (car (rmail-mime-entity-type child)))
+		    (setq best-text child)))))
+	(if (or best-plain-text best-text)
+	    (rmail-mime-insert (or best-plain-text best-text))
+	  ;; No child could be handled.  Insert all.
+	  (dolist (child children)
+	    (rmail-mime-insert child nil disposition)))))
+     (t
+      ;; Unsupported subtype.  Insert all of them.
+      (dolist (child children)
+	(rmail-mime-insert child))))))
+
+(defun rmail-mime-parse ()
+  "Parse the current Rmail message as a MIME message.
+The value is a MIME-entiy object (see `rmail-mime-enty-new')."
+  (save-excursion
+    (goto-char (point-min))
+    (condition-case nil
+	(rmail-mime-process nil t)
+      (error nil))))
+
+(defun rmail-mime-insert (entity &optional content-type disposition)
+  "Insert a MIME-entity ENTITY in the current buffer.
+
+This function will be called recursively if multiple parts are
+available."
+  (if (rmail-mime-entity-children entity)
+      (rmail-mime-insert-multipart entity)
+    (setq content-type
+	  (or (rmail-mime-entity-type entity) content-type))
+    (setq disposition
+	  (or (rmail-mime-entity-disposition entity) disposition))
+    (if (and (string= (car disposition) "inline")
+	     (string-match "text/.*" (car content-type)))
+	(rmail-mime-insert-text entity)
+      (rmail-mime-insert-bulk entity))))
 
 (define-derived-mode rmail-mime-mode fundamental-mode "RMIME"
   "Major mode used in `rmail-mime' buffers."
@@ -480,6 +745,87 @@
   (error "%s; type: %s; disposition: %s; encoding: %s"
 	 message type disposition encoding))
 
+(defun rmail-show-mime ()
+  "Function to set in `rmail-show-mime-function' (which see)."
+  (let ((mbox-buf rmail-buffer)
+	(entity (rmail-mime-parse)))
+    (if entity
+	(with-current-buffer rmail-view-buffer
+	  (let ((inhibit-read-only t)
+		(rmail-buffer mbox-buf))
+	    (erase-buffer)
+	    (rmail-mime-insert entity)))
+      ;; Decoding failed.  Insert the original message body as is.
+      (let ((region (with-current-buffer mbox-buf
+		      (goto-char (point-min))
+		      (re-search-forward "^$" nil t)
+		      (forward-line 1)
+		      (cons (point) (point-max)))))
+	(with-current-buffer rmail-view-buffer
+	  (let ((inhibit-read-only t))
+	    (erase-buffer)
+	    (insert-buffer-substring mbox-buf (car region) (cdr region))))
+	(message "MIME decoding failed")))))
+
+(setq rmail-show-mime-function 'rmail-show-mime)
+
+(defun rmail-insert-mime-forwarded-message (forward-buffer)
+  "Function to set in `rmail-insert-mime-forwarded-message-function' (which see)."
+  (let ((mbox-buf (with-current-buffer forward-buffer rmail-view-buffer)))
+    (save-restriction
+      (narrow-to-region (point) (point))
+      (message-forward-make-body-mime mbox-buf))))
+
+(setq rmail-insert-mime-forwarded-message-function
+      'rmail-insert-mime-forwarded-message)
+
+(defun rmail-insert-mime-resent-message (forward-buffer)
+  "Function to set in `rmail-insert-mime-resent-message-function' (which see)."
+  (insert-buffer-substring
+   (with-current-buffer forward-buffer rmail-view-buffer))
+  (goto-char (point-min))
+  (when (looking-at "From ")
+    (forward-line 1)
+    (delete-region (point-min) (point))))
+
+(setq rmail-insert-mime-resent-message-function
+      'rmail-insert-mime-resent-message)
+
+(defun rmail-search-mime-message (msg regexp)
+  "Function to set in `rmail-search-mime-message-function' (which see)."
+  (save-restriction
+    (narrow-to-region (rmail-msgbeg msg) (rmail-msgend msg))
+    (let ((mbox-buf (current-buffer))
+	  (header-end (save-excursion
+			(re-search-forward "^$" nil 'move) (point)))
+	  (body-end (point-max))
+	  (entity (rmail-mime-parse)))
+      (or 
+       ;; At first, just search the headers.
+       (with-temp-buffer
+	 (insert-buffer-substring mbox-buf nil header-end)
+	 (rfc2047-decode-region (point-min) (point))
+	 (goto-char (point-min))
+	 (re-search-forward regexp nil t))
+       ;; Next, search the body.
+       (if (and entity
+		(let* ((content-type (rmail-mime-entity-type entity))
+		       (charset (cdr (assq 'charset (cdr content-type)))))
+		  (or (not (string-match "text/.*" (car content-type))) 
+		      (and charset
+			   (not (string= (downcase charset) "us-ascii"))))))
+	   ;; Search the decoded MIME message.
+	   (with-temp-buffer
+	     (let ((rmail-buffer mbox-buf))
+	       (rmail-mime-insert entity))
+	     (goto-char (point-min))
+	     (re-search-forward regexp nil t))
+	 ;; Search the body without decoding.
+	 (goto-char header-end)
+	 (re-search-forward regexp nil t))))))
+
+(setq rmail-search-mime-message-function 'rmail-search-mime-message)
+
 (provide 'rmailmm)
 
 ;; Local Variables:
--- a/lisp/mail/rmailsum.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/mail/rmailsum.el	Thu Dec 16 18:30:57 2010 -0500
@@ -32,6 +32,7 @@
 
 ;; For rmail-select-summary.
 (require 'rmail)
+(require 'rfc2047)
 
 (defcustom rmail-summary-scroll-between-messages t
   "Non-nil means Rmail summary scroll commands move between messages.
@@ -364,13 +365,15 @@
       (aset rmail-summary-vector (1- msgnum) line))
     line))
 
-(defcustom rmail-summary-line-decoder (function identity)
+(defcustom rmail-summary-line-decoder (function rfc2047-decode-string)
   "Function to decode a Rmail summary line.
 It receives the summary line for one message as a string
 and should return the decoded string.
 
-By default, it is `identity', which returns the string unaltered."
+By default, it is `rfc2047-decode-string', which decodes MIME-encoded
+subject."
   :type 'function
+  :version "23.3"
   :group 'rmail-summary)
 
 (defun rmail-create-summary-line (msgnum)
@@ -589,10 +592,17 @@
 						     (t (- mch 14))))
 				      (min len (+ lo 25)))))))))
    (concat (if (re-search-forward "^Subject:" nil t)
-	       (progn (skip-chars-forward " \t")
-		      (buffer-substring (point)
-					(progn (end-of-line)
-					       (point))))
+	       (let (pos str)
+		 (skip-chars-forward " \t")
+		 (setq pos (point))
+		 (forward-line 1)
+		 (setq str (buffer-substring pos (1- (point))))
+		 (while (looking-at "\\s ")
+		   (setq str (concat str " " 
+				     (buffer-substring (match-end 0)
+						       (line-end-position))))
+		   (forward-line 1))
+		 str)
 	     (re-search-forward "[\n][\n]+" nil t)
 	     (buffer-substring (point) (progn (end-of-line) (point))))
 	   "\n")))
--- a/lisp/mail/sendmail.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/mail/sendmail.el	Thu Dec 16 18:30:57 2010 -0500
@@ -28,11 +28,7 @@
 ;; documented in the Emacs user's manual.
 
 ;;; Code:
-(eval-when-compile
-  ;; Necessary to avoid recursive `require's.
-  (provide 'sendmail)
-  (require 'rmail)
-  (require 'mailalias))
+(require 'mail-utils)
 
 (autoload 'rfc2047-encode-string "rfc2047")
 
@@ -203,13 +199,14 @@
   :type '(choice (const nil) string)
   :group 'sendmail)
 
-;;;###autoload
 (defcustom mail-alias-file nil
-  "If non-nil, the name of a file to use instead of `/usr/lib/aliases'.
+  "If non-nil, the name of a file to use instead of the sendmail default.
 This file defines aliases to be expanded by the mailer; this is a different
 feature from that of defining aliases in `.mailrc' to be expanded in Emacs.
-This variable has no effect unless your system uses sendmail as its mailer."
-  :type '(choice (const nil) file)
+This variable has no effect unless your system uses sendmail as its mailer.
+The default file is defined in sendmail's configuration file, e.g.
+`/etc/aliases'."
+  :type '(choice (const :tag "Sendmail default" nil) file)
   :group 'sendmail)
 
 ;;;###autoload
@@ -383,15 +380,8 @@
     map))
 
 (autoload 'build-mail-aliases "mailalias"
-  "Read mail aliases from user's personal aliases file and set `mail-aliases'."
-  nil)
-
-(autoload 'expand-mail-aliases "mailalias"
-  "Expand all mail aliases in suitable header fields found between BEG and END.
-Suitable header fields are `To', `Cc' and `Bcc' and their `Resent-' variants.
-Optional second arg EXCLUDE may be a regular expression defining text to be
-removed from alias expansions."
-  nil)
+  "Read mail aliases from personal aliases file and set `mail-aliases'.
+By default, this is the file specified by `mail-personal-alias-file'." t)
 
 ;;;###autoload
 (defcustom mail-signature t
@@ -440,8 +430,6 @@
   :type '(choice (const nil) string)
   :group 'sendmail)
 
-;; FIXME no need for autoload
-;;;###autoload
 (defcustom mail-bury-selects-summary t
   "If non-nil, try to show Rmail summary buffer after returning from mail.
 The functions \\[mail-send-on-exit] or \\[mail-dont-send] select
@@ -450,8 +438,6 @@
   :type 'boolean
   :group 'sendmail)
 
-;; FIXME no need for autoload
-;;;###autoload
 (defcustom mail-send-nonascii 'mime
   "Specify whether to allow sending non-ASCII characters in mail.
 If t, that means do allow it.  nil means don't allow it.
@@ -475,23 +461,16 @@
 
 ;; Note: could use /usr/ucb/mail instead of sendmail;
 ;; options -t, and -v if not interactive.
-(defvar mail-mailer-swallows-blank-line
-  (if (and (string-match "sparc-sun-sunos\\(\\'\\|[^5]\\)" system-configuration)
-	   (file-readable-p "/etc/sendmail.cf")
-           (with-temp-buffer
-             (insert-file-contents "/etc/sendmail.cf")
-             (goto-char (point-min))
-             (let ((case-fold-search nil))
-               (re-search-forward "^OR\\>" nil t))))
-      ;; According to RFC822, "The field-name must be composed of printable
-      ;; ASCII characters (i.e. characters that have decimal values between
-      ;; 33 and 126, except colon)", i.e. any chars except ctl chars,
-      ;; space, or colon.
-      '(looking-at "[ \t]\\|[][!\"#$%&'()*+,-./0-9;<=>?@A-Z\\\\^_`a-z{|}~]+:"))
+(defvar mail-mailer-swallows-blank-line nil
   "Set this non-nil if the system's mailer runs the header and body together.
-\(This problem exists on Sunos 4 when sendmail is run in remote mode.)
-The value should be an expression to test whether the problem will
-actually occur.")
+The actual value should be an expression to evaluate that returns
+non-nil if the problem will actually occur.
+\(As far as we know, this is not an issue on any system still supported
+by Emacs.)")
+
+(put 'mail-mailer-swallows-blank-line 'risky-local-variable t) ; gets evalled
+(make-obsolete-variable 'mail-mailer-swallows-blank-line
+			"no need to set this on any modern system." "24.1")
 
 (defvar mail-mode-syntax-table
   ;; define-derived-mode will make it inherit from text-mode-syntax-table.
@@ -546,12 +525,11 @@
   (or mail-default-reply-to
       (setq mail-default-reply-to (getenv "REPLYTO")))
   (sendmail-sync-aliases)
-  (if (eq mail-aliases t)
-      (progn
-	(setq mail-aliases nil)
-	(when mail-personal-alias-file
-	  (if (file-exists-p mail-personal-alias-file)
-	      (build-mail-aliases)))))
+  (when (eq mail-aliases t)
+    (setq mail-aliases nil)
+    (and mail-personal-alias-file
+	 (file-exists-p mail-personal-alias-file)
+	 (build-mail-aliases)))
   ;; Don't leave this around from a previous message.
   (kill-local-variable 'buffer-file-coding-system)
   ;; This doesn't work for enable-multibyte-characters.
@@ -1824,6 +1802,9 @@
       ;; names are normally ``trivial'', so Dired will set point after
       ;; all the files, at buffer bottom.  We want it on the first
       ;; file instead.
+      ;; Require dired so that dired-trivial-filenames does not get
+      ;; unbound on exit from the let.
+      (require 'dired)
       (let ((dired-trivial-filenames t))
 	(dired-other-window wildcard (concat dired-listing-switches "t")))
       (rename-buffer "*Auto-saved Drafts*" t)
--- a/lisp/mail/smtpmail.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/mail/smtpmail.el	Thu Dec 16 18:30:57 2010 -0500
@@ -1007,5 +1007,4 @@
 
 (provide 'smtpmail)
 
-;; arch-tag: a76992df-6d71-43b7-9e72-4bacc6c05466
 ;;; smtpmail.el ends here
--- a/lisp/menu-bar.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/menu-bar.el	Thu Dec 16 18:30:57 2010 -0500
@@ -1020,10 +1020,24 @@
 	      :visible (and (display-graphic-p) (fboundp 'x-show-tip))
 	      :button (:toggle . tooltip-mode)))
 
+(defun menu-bar-frame-for-menubar ()
+  "Return the frame suitable for updating the menu bar."
+  (or (and (framep menu-updating-frame)
+	   menu-updating-frame)
+      (selected-frame)))
+
+(defun menu-bar-positive-p (val)
+  "Return non-nil iff VAL is a positive number."
+  (and (numberp val)
+       (> val 0)))
+
 (define-key menu-bar-showhide-menu [menu-bar-mode]
   `(menu-item ,(purecopy "Menu-bar") toggle-menu-bar-mode-from-frame
 	      :help ,(purecopy "Turn menu-bar on/off")
-	      :button (:toggle . (> (frame-parameter nil 'menu-bar-lines) 0))))
+	      :button
+	      (:toggle . (menu-bar-positive-p
+			  (frame-parameter (menu-bar-frame-for-menubar)
+					   'menu-bar-lines)))))
 
 (defun menu-bar-set-tool-bar-position (position)
   (customize-set-variable 'tool-bar-mode t)
@@ -1060,7 +1074,9 @@
 		    :visible (display-graphic-p)
 		    :button
 		    (:radio . (and tool-bar-mode
-				   (eq (frame-parameter nil 'tool-bar-position)
+				   (eq (frame-parameter
+					(menu-bar-frame-for-menubar)
+					'tool-bar-position)
 				       'left)))))
 
       (define-key menu-bar-showhide-tool-bar-menu [showhide-tool-bar-right]
@@ -1070,7 +1086,9 @@
 		    :visible (display-graphic-p)
 		    :button
 		    (:radio . (and tool-bar-mode
-				   (eq (frame-parameter nil 'tool-bar-position)
+				   (eq (frame-parameter
+					(menu-bar-frame-for-menubar)
+					'tool-bar-position)
 				       'right)))))
 
       (define-key menu-bar-showhide-tool-bar-menu [showhide-tool-bar-bottom]
@@ -1080,7 +1098,9 @@
 		    :visible (display-graphic-p)
 		    :button
 		    (:radio . (and tool-bar-mode
-				   (eq (frame-parameter nil 'tool-bar-position)
+				   (eq (frame-parameter
+					(menu-bar-frame-for-menubar)
+					'tool-bar-position)
 				       'bottom)))))
 
       (define-key menu-bar-showhide-tool-bar-menu [showhide-tool-bar-top]
@@ -1090,7 +1110,9 @@
 		    :visible (display-graphic-p)
 		    :button
 		    (:radio . (and tool-bar-mode
-				   (eq (frame-parameter nil 'tool-bar-position)
+				   (eq (frame-parameter
+					(menu-bar-frame-for-menubar)
+					'tool-bar-position)
 				       'top)))))
 
       (define-key menu-bar-showhide-tool-bar-menu [showhide-tool-bar-none]
@@ -1110,8 +1132,10 @@
     `(menu-item ,(purecopy "Tool-bar") toggle-tool-bar-mode-from-frame
 		:help ,(purecopy "Turn tool-bar on/off")
 		:visible (display-graphic-p)
-		:button (:toggle . (> (frame-parameter nil 'tool-bar-lines) 0))))
-)
+		:button
+		(:toggle . (menu-bar-positive-p
+			    (frame-parameter (menu-bar-frame-for-menubar)
+					     'tool-bar-lines))))))
 
 (define-key menu-bar-options-menu [showhide]
   `(menu-item ,(purecopy "Show/Hide") ,menu-bar-showhide-menu))
@@ -2109,7 +2133,10 @@
 See `menu-bar-mode' for more information."
   (interactive (list (or current-prefix-arg 'toggle)))
   (if (eq arg 'toggle)
-      (menu-bar-mode (if (> (frame-parameter nil 'menu-bar-lines) 0) 0 1))
+      (menu-bar-mode
+       (if (menu-bar-positive-p
+	    (frame-parameter (menu-bar-frame-for-menubar) 'menu-bar-lines))
+	    0 1))
     (menu-bar-mode arg)))
 
 (declare-function x-menu-bar-open "term/x-win" (&optional frame))
--- a/lisp/minibuffer.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/minibuffer.el	Thu Dec 16 18:30:57 2010 -0500
@@ -1251,31 +1251,23 @@
  `:predicate'           a predicate that completion candidates need to satisfy.
  `:annotation-function' the value to use for `completion-annotate-function'.")
 
-(defun completion-at-point (&optional arg)
+(defun completion-at-point ()
   "Perform completion on the text around point.
-The completion method is determined by `completion-at-point-functions'.
-
-With a prefix argument, this command does completion within
-the collection of symbols listed in the index of the manual for the
-language you are using."
-  (interactive "P")
-  (if arg
-      (info-complete-symbol)
-    (let ((res (run-hook-with-args-until-success
-		'completion-at-point-functions)))
-      (cond
-       ((functionp res) (funcall res))
-       (res
-	(let* ((plist (nthcdr 3 res))
-	       (start (nth 0 res))
-	       (end (nth 1 res))
-	       (completion-annotate-function
-		(or (plist-get plist :annotation-function)
-		    completion-annotate-function)))
-	  (completion-in-region start end (nth 2 res)
-				(plist-get plist :predicate))))))))
-
-(define-obsolete-function-alias 'complete-symbol 'completion-at-point "24.1")
+The completion method is determined by `completion-at-point-functions'."
+  (interactive)
+  (let ((res (run-hook-with-args-until-success
+              'completion-at-point-functions)))
+    (cond
+     ((functionp res) (funcall res))
+     (res
+      (let* ((plist (nthcdr 3 res))
+             (start (nth 0 res))
+             (end (nth 1 res))
+             (completion-annotate-function
+              (or (plist-get plist :annotation-function)
+                  completion-annotate-function)))
+        (completion-in-region start end (nth 2 res)
+                              (plist-get plist :predicate)))))))
 
 ;;; Key bindings.
 
--- a/lisp/mouse.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/mouse.el	Thu Dec 16 18:30:57 2010 -0500
@@ -185,6 +185,7 @@
     (minor-mode-menu-from-indicator indicator)))
 
 (defun mouse-menu-major-mode-map ()
+  (run-hooks 'activate-menubar-hook 'menu-bar-update-hook)
   (let* (;; Keymap from which to inherit; may be null.
 	 (ancestor (mouse-menu-non-singleton
 		    (and (current-local-map)
@@ -217,6 +218,7 @@
   "Return a keymap equivalent to the menu bar.
 The contents are the items that would be in the menu bar whether or
 not it is actually displayed."
+  (run-hooks 'activate-menubar-hook 'menu-bar-update-hook)
   (let* ((local-menu (and (current-local-map)
 			  (lookup-key (current-local-map) [menu-bar])))
 	 (global-menu (lookup-key global-map [menu-bar]))
@@ -2130,5 +2132,4 @@
 
 (provide 'mouse)
 
-;; arch-tag: 9a710ce1-914a-4923-9b81-697f7bf82ab3
 ;;; mouse.el ends here
--- a/lisp/net/browse-url.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/net/browse-url.el	Thu Dec 16 18:30:57 2010 -0500
@@ -216,13 +216,13 @@
 
 ;;;###autoload
 (defcustom browse-url-browser-function
-  `(("\\`mailto:" . browse-url-mail)
-    ("." .
-     ,(cond
-       ((memq system-type '(windows-nt ms-dos cygwin))
-	'browse-url-default-windows-browser)
-       ((memq system-type '(darwin)) 'browse-url-default-macosx-browser)
-       (t 'browse-url-default-browser))))
+  (cond
+   ((memq system-type '(windows-nt ms-dos cygwin))
+    'browse-url-default-windows-browser)
+   ((memq system-type '(darwin))
+    'browse-url-default-macosx-browser)
+   (t
+    'browse-url-default-browser))
   "Function to display the current buffer in a WWW browser.
 This is used by the `browse-url-at-point', `browse-url-at-mouse', and
 `browse-url-of-file' commands.
@@ -265,6 +265,18 @@
   :version "24.1"
   :group 'browse-url)
 
+(defcustom browse-url-mailto-function 'browse-url-mail
+  "Function to display mailto: links.
+This variable uses the same syntax as the
+`browse-url-browser-function' variable.  If the
+`browse-url-mailto-function' variable is nil, that variable will
+be used instead."
+  :type '(choice
+	  (function-item :tag "Emacs Mail" :value browse-url-mail)
+	  (function-item :tag "None" nil))
+  :version "24.1"
+  :group 'browse-url)
+
 (defcustom browse-url-netscape-program "netscape"
   ;; Info about netscape-remote from Karl Berry.
   "The name by which to invoke Netscape.
@@ -637,7 +649,6 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; URL input
 
-;;;###autoload
 (defun browse-url-url-at-point ()
   (let ((url (thing-at-point 'url)))
     (set-text-properties 0 (length url) nil url)
@@ -780,22 +791,27 @@
 (defun browse-url (url &rest args)
   "Ask a WWW browser to load URL.
 Prompts for a URL, defaulting to the URL at or before point.  Variable
-`browse-url-browser-function' says which browser to use."
+`browse-url-browser-function' says which browser to use.
+If the URL is a mailto: URL, consult `browse-url-mailto-function'
+first, if that exists."
   (interactive (browse-url-interactive-arg "URL: "))
   (unless (called-interactively-p 'interactive)
     (setq args (or args (list browse-url-new-window-flag))))
-  (let ((process-environment (copy-sequence process-environment)))
+  (let ((process-environment (copy-sequence process-environment))
+	(function (or (and (string-match "\\`mailto:" url)
+			   browse-url-mailto-function)
+		      browse-url-browser-function)))
     ;; When connected to various displays, be careful to use the display of
     ;; the currently selected frame, rather than the original start display,
     ;; which may not even exist any more.
     (if (stringp (frame-parameter (selected-frame) 'display))
         (setenv "DISPLAY" (frame-parameter (selected-frame) 'display)))
-    (if (and (consp browse-url-browser-function)
-	     (not (functionp browse-url-browser-function)))
+    (if (and (consp function)
+	     (not (functionp function)))
 	;; The `function' can be an alist; look down it for first match
 	;; and apply the function (which might be a lambda).
 	(catch 'done
-	  (dolist (bf browse-url-browser-function)
+	  (dolist (bf function)
 	    (when (string-match (car bf) url)
 	      (apply (cdr bf) url args)
 	      (throw 'done t)))
@@ -803,7 +819,7 @@
 		 url))
       ;; Unbound symbols go down this leg, since void-function from
       ;; apply is clearer than wrong-type-argument from dolist.
-      (apply browse-url-browser-function url args))))
+      (apply function url args))))
 
 ;;;###autoload
 (defun browse-url-at-point (&optional arg)
@@ -876,7 +892,6 @@
     (and (not (equal display (getenv "DISPLAY")))
          display)))
 
-;;;###autoload
 (defun browse-url-default-browser (url &rest args)
   "Find a suitable browser and ask it to load URL.
 Default to the URL around or before point.
--- a/lisp/net/gnutls.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/net/gnutls.el	Thu Dec 16 18:30:57 2010 -0500
@@ -77,7 +77,7 @@
 TRUSTFILES is a list of CA bundles.
 KEYFILES is a list of client keys."
   (let* ((type (or type 'gnutls-x509pki))
-         (trusfiles (or trustfiles
+         (trustfiles (or trustfiles
                         '("/etc/ssl/certs/ca-certificates.crt")))
          (priority-string (or priority-string
                               (cond
--- a/lisp/net/netrc.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/net/netrc.el	Thu Dec 16 18:30:57 2010 -0500
@@ -34,18 +34,6 @@
 ;;; .netrc and .authinfo rc parsing
 ;;;
 
-(defalias 'netrc-point-at-eol
-  (if (fboundp 'point-at-eol)
-      'point-at-eol
-    'line-end-position))
-(eval-when-compile
-  ;; This is unnecessary in the compiled version as it is a macro.
-  (if (fboundp 'bound-and-true-p)
-      (defalias 'netrc-bound-and-true-p 'bound-and-true-p)
-    (defmacro netrc-bound-and-true-p (var)
-      "Return the value of symbol VAR if it is bound, else nil."
-      `(and (boundp (quote ,var)) ,var))))
-
 (defgroup netrc nil
  "Netrc configuration."
  :group 'comm)
@@ -58,12 +46,15 @@
 (defvar netrc-services-file "/etc/services"
   "The name of the services file.")
 
+(defvar netrc-cache nil)
+
 (defun netrc-parse (&optional file)
   (interactive "fFile to Parse: ")
   "Parse FILE and return a list of all entries in the file."
   (unless file
     (setq file netrc-file))
   (if (listp file)
+      ;; We got already parsed contents; just return it.
       file
     (when (file-exists-p file)
       (with-temp-buffer
@@ -71,7 +62,16 @@
 			"password" "account" "macdef" "force"
 			"port"))
 	      alist elem result pair)
-          (insert-file-contents file)
+          (if (and netrc-cache
+		   (equal (car netrc-cache) (nth 5 (file-attributes file))))
+	      ;; Store the contents of the file heavily encrypted in memory.
+	      (insert (base64-decode-string (rot13-string (cdr netrc-cache))))
+	    (insert-file-contents file)
+	    (when (string-match "\\.gpg\\'" file)
+	      (setq netrc-cache (cons (nth 5 (file-attributes file))
+				      (rot13-string
+				       (base64-encode-string
+					(buffer-string)))))))
 	  (goto-char (point-min))
 	  ;; Go through the file, line by line.
 	  (while (not (eobp))
--- a/lisp/net/tramp-cache.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/net/tramp-cache.el	Thu Dec 16 18:30:57 2010 -0500
@@ -62,6 +62,8 @@
 (defcustom tramp-persistency-file-name
   (cond
    ;; GNU Emacs.
+   ((and (fboundp 'locate-user-emacs-file))
+    (expand-file-name (tramp-compat-funcall 'locate-user-emacs-file "tramp")))
    ((and (boundp 'user-emacs-directory)
 	 (stringp (symbol-value 'user-emacs-directory))
 	 (file-directory-p (symbol-value 'user-emacs-directory)))
@@ -403,5 +405,4 @@
 
 (provide 'tramp-cache)
 
-;; arch-tag: ee1739b7-7628-408c-9b96-d11a74b05d26
 ;;; tramp-cache.el ends here
--- a/lisp/net/tramp-cmds.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/net/tramp-cmds.el	Thu Dec 16 18:30:57 2010 -0500
@@ -363,12 +363,5 @@
 ;;   flavor)  (Reiner Steib)
 ;; * Let the user edit the connection properties interactively.
 ;;   Something like `gnus-server-edit-server' in Gnus' *Server* buffer.
-;; * It's just that when I come to Customize `tramp-default-user-alist'
-;;   I'm presented with a mismatch and raw lisp for a value.  It is my
-;;   understanding that a variable declared with defcustom is a User
-;;   Option and should not be modified by the code.  add-to-list is
-;;   called in several places. One way to handle that is to have a new
-;;   ordinary variable that gets its initial value from
-;;   tramp-default-user-alist and then is added to.  (Pete Forman)
 
 ;;; tramp-cmds.el ends here
--- a/lisp/net/tramp-ftp.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/net/tramp-ftp.el	Thu Dec 16 18:30:57 2010 -0500
@@ -107,11 +107,11 @@
 (unless (featurep 'xemacs)
   (add-to-list 'tramp-methods (cons tramp-ftp-method nil)))
 
-;; Add some defaults for `tramp-default-method-alist'
+;; Add some defaults for `tramp-default-method-alist'.
 (add-to-list 'tramp-default-method-alist
-	     (list "\\`ftp\\." "" tramp-ftp-method))
+	     (list "\\`ftp\\." nil tramp-ftp-method))
 (add-to-list 'tramp-default-method-alist
-	     (list "" "\\`\\(anonymous\\|ftp\\)\\'" tramp-ftp-method))
+	     (list nil "\\`\\(anonymous\\|ftp\\)\\'" tramp-ftp-method))
 
 ;; Add completion function for FTP method.
 (tramp-set-completion-function
@@ -221,5 +221,4 @@
 
 ;; * There are no backup files on FTP hosts.
 
-;; arch-tag: 759fb338-5c63-4b99-bd36-b4d59db91cff
 ;;; tramp-ftp.el ends here
--- a/lisp/net/tramp-gvfs.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/net/tramp-gvfs.el	Thu Dec 16 18:30:57 2010 -0500
@@ -124,8 +124,7 @@
 
 ;; Add a default for `tramp-default-user-alist'.  Rule: For the SYNCE
 ;; method, no user is chosen.
-(add-to-list 'tramp-default-user-alist
-	     '("synce" nil nil))
+(add-to-list 'tramp-default-user-alist '("\\`synce\\'" nil nil))
 
 (defcustom tramp-gvfs-zeroconf-domain "local"
   "*Zeroconf domain to be used for discovering services, like host names."
@@ -1432,5 +1431,4 @@
 ;;   capability.
 ;; * Implement obex for other serial communication but bluetooth.
 
-;; arch-tag: f7f660ce-77f4-4132-9663-f5c25a47f7ed
 ;;; tramp-gvfs.el ends here
--- a/lisp/net/tramp-gw.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/net/tramp-gw.el	Thu Dec 16 18:30:57 2010 -0500
@@ -44,6 +44,9 @@
   (when (featurep 'xemacs)
       (byte-compiler-options (warnings (- unused-vars)))))
 
+;; We don't add the following methods to `tramp-methods', in order to
+;; exclude them from file name completion.
+
 ;; Define HTTP tunnel method ...
 ;;;###tramp-autoload
 (defconst tramp-gw-tunnel-method "tunnel"
@@ -69,10 +72,12 @@
   (list "Default server" "socks" tramp-gw-default-socks-port 5))
 
 ;; Add a default for `tramp-default-user-alist'.  Default is the local user.
-(add-to-list 'tramp-default-user-alist
-	     `(,tramp-gw-tunnel-method nil ,(user-login-name)))
-(add-to-list 'tramp-default-user-alist
-	     `(,tramp-gw-socks-method nil ,(user-login-name)))
+(add-to-list
+ 'tramp-default-user-alist
+ (list (concat "\\`"
+	       (regexp-opt (list tramp-gw-tunnel-method tramp-gw-socks-method))
+	       "\\'")
+       nil (user-login-name)))
 
 ;; Internal file name functions and variables.
 
@@ -194,8 +199,8 @@
     (setq tramp-gw-gw-proc
 	  (funcall
 	   socks-function
-	   (tramp-buffer-name gw-vec)
-	   (tramp-get-buffer gw-vec)
+	   (tramp-get-connection-name gw-vec)
+	   (tramp-get-connection-buffer gw-vec)
 	   (tramp-file-name-real-host target-vec)
 	   (tramp-file-name-port target-vec)))
     (set-process-sentinel tramp-gw-gw-proc 'tramp-gw-gw-proc-sentinel)
@@ -324,5 +329,4 @@
 ;; * Provide descriptive Commentary.
 ;; * Enable it for several gateway processes in parallel.
 
-;; arch-tag: 277e3a81-fdee-40cf-9e6b-59626292a5e0
 ;;; tramp-gw.el ends here
--- a/lisp/net/tramp-imap.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/net/tramp-imap.el	Thu Dec 16 18:30:57 2010 -0500
@@ -84,10 +84,6 @@
   (add-to-list 'tramp-methods
 	       (list tramp-imap-method '(tramp-default-port 143))))
 
-;; Add a default for `tramp-default-user-alist'.  Default is the local user.
-(add-to-list 'tramp-default-user-alist
-	     `(,tramp-imap-method nil ,(user-login-name)))
-
 ;; Define Tramp IMAPS method ...
 ;;;###tramp-autoload
 (defconst tramp-imaps-method "imaps"
@@ -100,8 +96,12 @@
 	       (list tramp-imaps-method '(tramp-default-port 993))))
 
 ;; Add a default for `tramp-default-user-alist'.  Default is the local user.
-(add-to-list 'tramp-default-user-alist
-	     `(,tramp-imaps-method nil ,(user-login-name)))
+(add-to-list
+ 'tramp-default-user-alist
+ (list (concat "\\`"
+	       (regexp-opt (list tramp-imap-method tramp-imaps-method))
+	       "\\'")
+       nil (user-login-name)))
 
 ;; Add completion function for IMAP method.
 ;; (tramp-set-completion-function
@@ -746,8 +746,7 @@
 	 (method (tramp-file-name-method vec))
 	 (user (tramp-file-name-user vec))
 	 (ssl (string-equal method tramp-imaps-method))
-	 (port (or (tramp-file-name-port vec)
-		   (tramp-get-method-parameter method 'tramp-default-port)))
+	 (port (tramp-file-name-port vec))
 	 (result (imap-hash-make server port mbox user nil ssl)))
     ;; Return the IHT with a test override to look for the subject
     ;; marker.
@@ -842,5 +841,3 @@
 ;;; (tramp-imap-make-iht (tramp-dissect-file-name "/imap:yourhosthere.com:/test/welcommen"))
 ;;; (tramp-imap-make-iht (tramp-dissect-file-name "/imap:yourhosthere.com:/INBOX.test/4"))
 ;;; (tramp-imap-make-iht (tramp-dissect-file-name "/imap:yourhosthere.com:/INBOX.test/4") "extra")
-
-;; arch-tag: f2723749-58fb-4f29-894e-39708096e850
--- a/lisp/net/tramp-sh.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/net/tramp-sh.el	Thu Dec 16 18:30:57 2010 -0500
@@ -91,7 +91,7 @@
     (tramp-login-args           (("%h") ("-l" "%u")))
     (tramp-remote-sh            "/bin/sh")
     (tramp-copy-program         "rcp")
-    (tramp-copy-args            (("-p" "%k") ("-r")))
+    (tramp-copy-args            (("%k" "-p") ("-r")))
     (tramp-copy-keep-date       t)
     (tramp-copy-recursive       t)))
 ;;;###tramp-autoload
@@ -101,18 +101,17 @@
     (tramp-login-args           (("%h") ("-l" "%u")))
     (tramp-remote-sh            "/bin/sh")
     (tramp-copy-program         "rcp")
-    (tramp-copy-args            (("-p" "%k")))
+    (tramp-copy-args            (("%k" "-p")))
     (tramp-copy-keep-date       t)))
 ;;;###tramp-autoload
-(add-to-list
- 'tramp-methods
+(add-to-list 'tramp-methods
  '("scp"
    (tramp-login-program        "ssh")
    (tramp-login-args           (("-l" "%u") ("-p" "%p")	("-e" "none") ("%h")))
    (tramp-async-args           (("-q")))
    (tramp-remote-sh            "/bin/sh")
    (tramp-copy-program         "scp")
-   (tramp-copy-args            (("-P" "%p") ("-p" "%k")	("-q") ("-r")))
+   (tramp-copy-args            (("-P" "%p") ("%k" "-p")	("-q") ("-r")))
    (tramp-copy-keep-date       t)
    (tramp-copy-recursive       t)
    (tramp-gw-args              (("-o" "GlobalKnownHostsFile=/dev/null")
@@ -128,7 +127,7 @@
     (tramp-async-args           (("-q")))
     (tramp-remote-sh            "/bin/sh")
     (tramp-copy-program         "scp")
-    (tramp-copy-args            (("-1") ("-P" "%p") ("-p" "%k") ("-q") ("-r")))
+    (tramp-copy-args            (("-1") ("-P" "%p") ("%k" "-p") ("-q") ("-r")))
     (tramp-copy-keep-date       t)
     (tramp-copy-recursive       t)
     (tramp-gw-args              (("-o" "GlobalKnownHostsFile=/dev/null")
@@ -144,7 +143,7 @@
     (tramp-async-args           (("-q")))
     (tramp-remote-sh            "/bin/sh")
     (tramp-copy-program         "scp")
-    (tramp-copy-args            (("-2") ("-P" "%p") ("-p" "%k") ("-q") ("-r")))
+    (tramp-copy-args            (("-2") ("-P" "%p") ("%k" "-p") ("-q") ("-r")))
     (tramp-copy-keep-date       t)
     (tramp-copy-recursive       t)
     (tramp-gw-args              (("-o" "GlobalKnownHostsFile=/dev/null")
@@ -162,7 +161,7 @@
     (tramp-async-args           (("-q")))
     (tramp-remote-sh            "/bin/sh")
     (tramp-copy-program         "scp")
-    (tramp-copy-args            (("-P" "%p") ("-p" "%k") ("-q")
+    (tramp-copy-args            (("-P" "%p") ("%k" "-p") ("-q")
 				 ("-o" "ControlPath=%t.%%r@%%h:%%p")
 				 ("-o" "ControlMaster=auto")))
     (tramp-copy-keep-date       t)
@@ -180,7 +179,7 @@
     (tramp-async-args           (("-q")))
     (tramp-remote-sh            "/bin/sh")
     (tramp-copy-program         "scp")
-    (tramp-copy-args            (("-p" "%k")))
+    (tramp-copy-args            (("%k" "-p")))
     (tramp-copy-keep-date       t)
     (tramp-gw-args              (("-o" "GlobalKnownHostsFile=/dev/null")
 				 ("-o" "UserKnownHostsFile=/dev/null")
@@ -202,7 +201,7 @@
     (tramp-async-args           (("-q")))
     (tramp-remote-sh            "/bin/sh")
     (tramp-copy-program         "rsync")
-    (tramp-copy-args            (("-e" "ssh") ("-t" "%k") ("-r")))
+    (tramp-copy-args            (("-e" "ssh") ("%k" "-t") ("-r")))
     (tramp-copy-keep-date       t)
     (tramp-copy-keep-tmpfile    t)
     (tramp-copy-recursive       t)))
@@ -217,7 +216,7 @@
     (tramp-async-args           (("-q")))
     (tramp-remote-sh            "/bin/sh")
     (tramp-copy-program         "rsync")
-    (tramp-copy-args            (("-t" "%k") ("-r")))
+    (tramp-copy-args            (("%k" "-t") ("-r")))
     (tramp-copy-env             (("RSYNC_RSH")
 				 (,(concat
 				    "ssh"
@@ -307,6 +306,12 @@
     (tramp-remote-sh            "/bin/sh")))
 ;;;###tramp-autoload
 (add-to-list 'tramp-methods
+  '("ksu"
+    (tramp-login-program        "ksu")
+    (tramp-login-args           (("%u") ("-q")))
+    (tramp-remote-sh            "/bin/sh")))
+;;;###tramp-autoload
+(add-to-list 'tramp-methods
   '("krlogin"
     (tramp-login-program        "krlogin")
     (tramp-login-args           (("%h") ("-l" "%u") ("-x")))
@@ -347,8 +352,10 @@
     (tramp-login-args           (("-l" "%u") ("-P" "%p") ("-ssh") ("%h")))
     (tramp-remote-sh            "/bin/sh")
     (tramp-copy-program         "pscp")
-    (tramp-copy-args            (("-P" "%p") ("-scp") ("-p" "%k")))
+    (tramp-copy-args            (("-P" "%p") ("-scp") ("%k" "-p")
+				 ("-q") ("-r")))
     (tramp-copy-keep-date       t)
+    (tramp-copy-recursive       t)
     (tramp-password-end-of-line "xy") ;see docstring for "xy"
     (tramp-default-port         22)))
 ;;;###tramp-autoload
@@ -358,8 +365,10 @@
     (tramp-login-args           (("-l" "%u") ("-P" "%p") ("-ssh") ("%h")))
     (tramp-remote-sh            "/bin/sh")
     (tramp-copy-program         "pscp")
-    (tramp-copy-args            (("-P" "%p") ("-sftp") ("-p" "%k")))
+    (tramp-copy-args            (("-P" "%p") ("-sftp") ("%k" "-p")
+				 ("-q") ("-r")))
     (tramp-copy-keep-date       t)
+    (tramp-copy-recursive       t)
     (tramp-password-end-of-line "xy"))) ;see docstring for "xy"
 ;;;###tramp-autoload
 (add-to-list 'tramp-methods
@@ -368,16 +377,23 @@
     (tramp-login-args           (("%h") ("-l" "%u") ("sh" "-i")))
     (tramp-remote-sh            "/bin/sh -i")
     (tramp-copy-program         "fcp")
-    (tramp-copy-args            (("-p" "%k")))
+    (tramp-copy-args            (("%k" "-p")))
     (tramp-copy-keep-date       t)))
 
 (add-to-list 'tramp-default-method-alist
 	     `(,tramp-local-host-regexp "\\`root\\'" "su"))
 
 (add-to-list 'tramp-default-user-alist
-	     '("\\`su\\(do\\)?\\'" nil "root"))
+	     `(,(concat "\\`" (regexp-opt '("su" "sudo" "ksu")) "\\'")
+	       nil "root"))
 (add-to-list 'tramp-default-user-alist
-	     `("\\`r\\(em\\)?\\(cp\\|sh\\)\\|telnet\\|plink1?\\'"
+	     `(,(concat
+		 "\\`"
+		 (regexp-opt
+		  '("rcp" "remcp" "scp" "scp1" "scp2" "scpc" "scpx" "sftp"
+		    "rsync" "rsyncc" "rsh" "remsh" "ssh" "ssh1" "ssh2" "sshx"
+		    "telnet" "krlogin" "plink" "plink1" "pscp" "psftp" "fcp"))
+		 "\\'")
 	       nil ,(user-login-name)))
 
 (defconst tramp-completion-function-alist-rsh
@@ -434,6 +450,7 @@
 (tramp-set-completion-function "telnet" tramp-completion-function-alist-telnet)
 (tramp-set-completion-function "su" tramp-completion-function-alist-su)
 (tramp-set-completion-function "sudo" tramp-completion-function-alist-su)
+(tramp-set-completion-function "ksu" tramp-completion-function-alist-su)
 (tramp-set-completion-function "krlogin" tramp-completion-function-alist-rsh)
 (tramp-set-completion-function "plink" tramp-completion-function-alist-ssh)
 (tramp-set-completion-function "plink1" tramp-completion-function-alist-ssh)
@@ -1943,7 +1960,7 @@
 
 	       ;; Try out-of-band operation.
 	       ((tramp-method-out-of-band-p
-		 v1 (nth 7 (file-attributes filename)))
+		 v1 (nth 7 (file-attributes (file-truename filename))))
 		(tramp-do-copy-or-rename-file-out-of-band
 		 op filename newname keep-date))
 
@@ -1971,7 +1988,8 @@
 
 	   ;; If the Tramp file has an out-of-band method, the
 	   ;; corresponding copy-program can be invoked.
-	   ((tramp-method-out-of-band-p v (nth 7 (file-attributes filename)))
+	   ((tramp-method-out-of-band-p
+	     v (nth 7 (file-attributes (file-truename filename))))
 	    (tramp-do-copy-or-rename-file-out-of-band
 	     op filename newname keep-date))
 
@@ -2178,10 +2196,11 @@
 (defun tramp-do-copy-or-rename-file-out-of-band (op filename newname keep-date)
   "Invoke rcp program to copy.
 The method used must be an out-of-band method."
-  (let ((t1 (tramp-tramp-file-p filename))
-	(t2 (tramp-tramp-file-p newname))
-	copy-program copy-args copy-env copy-keep-date port spec
-	source target)
+  (let* ((t1 (tramp-tramp-file-p filename))
+	 (t2 (tramp-tramp-file-p newname))
+	 (orig-vec (tramp-dissect-file-name (if t1 filename newname)))
+	 copy-program copy-args copy-env copy-keep-date port spec
+	 source target)
 
     (with-parsed-tramp-file-name (if t1 filename newname) nil
       (if (and t1 t2)
@@ -2207,6 +2226,12 @@
 		     (expand-file-name ".." tmpfile) 'recursive)
 		  (delete-file tmpfile)))))
 
+	;; Set variables for computing the prompt for reading
+	;; password.
+	(setq tramp-current-method (tramp-file-name-method v)
+	      tramp-current-user   (tramp-file-name-user v)
+	      tramp-current-host   (tramp-file-name-host v))
+
 	;; Expand hops.  Might be necessary for gateway methods.
 	(setq v (car (tramp-compute-multi-hops v)))
 	(aset v 3 localname)
@@ -2239,16 +2264,20 @@
 	      copy-keep-date (tramp-get-method-parameter
 			      method 'tramp-copy-keep-date)
 	      copy-args
-	      (delq
-	       nil
-	       (mapcar
-		(lambda (x)
-		  (setq
-		   x
-		   ;; " " is indication for keep-date argument.
-		   (delete " " (mapcar (lambda (y) (format-spec y spec)) x)))
-		  (unless (member "" x) (mapconcat 'identity x " ")))
-		(tramp-get-method-parameter method 'tramp-copy-args)))
+	      (delete
+	       ;; " " has either been a replacement of "%k" (when
+	       ;; keep-date argument is non-nil), or a replacemtent
+	       ;; for the whole keep-date sublist.
+	       " "
+	       (dolist
+		   (x
+		    (tramp-get-method-parameter method 'tramp-copy-args)
+		    copy-args)
+		 (setq copy-args
+		       (append
+			copy-args
+			(let ((y (mapcar (lambda (z) (format-spec z spec)) x)))
+			  (if (zerop (length (car y))) '(" ") y))))))
 	      copy-env
 	      (delq
 	       nil
@@ -2266,14 +2295,8 @@
 	  (tramp-error
 	   v 'file-error "Cannot find copy program: %s" copy-program))
 
-	;; Set variables for computing the prompt for reading
-	;; password.
-	(setq tramp-current-method (tramp-file-name-method v)
-	      tramp-current-user   (tramp-file-name-user v)
-	      tramp-current-host   (tramp-file-name-host v))
-
-	(unwind-protect
-	    (with-temp-buffer
+	(with-temp-buffer
+	  (unwind-protect
 	      ;; The default directory must be remote.
 	      (let ((default-directory
 		      (file-name-directory (if t1 filename newname)))
@@ -2284,7 +2307,8 @@
 		(tramp-set-connection-property
 		 v "process-buffer" (current-buffer))
 		(while copy-env
-		  (tramp-message v 5 "%s=\"%s\"" (car copy-env) (cadr copy-env))
+		  (tramp-message
+		   orig-vec 5 "%s=\"%s\"" (car copy-env) (cadr copy-env))
 		  (setenv (pop copy-env) (pop copy-env)))
 
 		;; Use an asynchronous process.  By this, password can
@@ -2295,20 +2319,20 @@
 		(let ((p (let ((default-directory
 				 (tramp-compat-temporary-file-directory)))
 			   (apply 'start-process
-				  (tramp-get-connection-property
-				   v "process-name" nil)
-				  (tramp-get-connection-property
-				   v "process-buffer" nil)
+				  (tramp-get-connection-name v)
+				  (tramp-get-connection-buffer v)
 				  copy-program
 				  (append copy-args (list source target))))))
 		  (tramp-message
-		   v 6 "%s" (mapconcat 'identity (process-command p) " "))
+		   orig-vec 6 "%s"
+		   (mapconcat 'identity (process-command p) " "))
 		  (tramp-compat-set-process-query-on-exit-flag p nil)
-		  (tramp-process-actions p v tramp-actions-copy-out-of-band))))
-
-	  ;; Reset the transfer process properties.
-	  (tramp-set-connection-property v "process-name" nil)
-	  (tramp-set-connection-property v "process-buffer" nil))
+		  (tramp-process-actions p v tramp-actions-copy-out-of-band)))
+
+	    ;; Reset the transfer process properties.
+	    (tramp-message orig-vec 6 "%s" (buffer-string))
+	    (tramp-set-connection-property v "process-name" nil)
+	    (tramp-set-connection-property v "process-buffer" nil)))
 
 	;; Handle KEEP-DATE argument.
 	(when (and keep-date (not copy-keep-date))
@@ -2627,61 +2651,65 @@
 (defun tramp-sh-handle-start-file-process (name buffer program &rest args)
   "Like `start-file-process' for Tramp files."
   (with-parsed-tramp-file-name default-directory nil
-    (unwind-protect
-	;; When PROGRAM is nil, we just provide a tty.
-	(let ((command
-	       (when (stringp program)
-		 (format "cd %s; exec %s"
-			 (tramp-shell-quote-argument localname)
-			 (mapconcat 'tramp-shell-quote-argument
-				    (cons program args) " "))))
-	      (tramp-process-connection-type
-	       (or (null program) tramp-process-connection-type))
-	      (name1 name)
-	      (i 0))
-	  (unless buffer
-	    ;; BUFFER can be nil.  We use a temporary buffer.
-	    (setq buffer (generate-new-buffer tramp-temp-buffer-name)))
-	  (while (get-process name1)
-	    ;; NAME must be unique as process name.
-	    (setq i (1+ i)
-		  name1 (format "%s<%d>" name i)))
-	  (setq name name1)
-	  ;; Set the new process properties.
-	  (tramp-set-connection-property v "process-name" name)
-	  (tramp-set-connection-property v "process-buffer" buffer)
-	  ;; Activate narrowing in order to save BUFFER contents.
-	  ;; Clear also the modification time; otherwise we might be
-	  ;; interrupted by `verify-visited-file-modtime'.
-	  (with-current-buffer (tramp-get-connection-buffer v)
-	    (clear-visited-file-modtime)
-	    (narrow-to-region (point-max) (point-max)))
-	  (if command
-	      ;; Send the command.
-	      (tramp-send-command v command nil t) ; nooutput
-	    ;; Check, whether a pty is associated.
-	    (tramp-maybe-open-connection v)
-	    (unless (tramp-compat-process-get
-		     (tramp-get-connection-process v) 'remote-tty)
-	      (tramp-error
-	       v 'file-error "pty association is not supported for `%s'" name)))
-	  (let ((p (tramp-get-connection-process v)))
-	    ;; Set sentinel and query flag for this process.
-	    (tramp-set-connection-property p "vector" v)
-	    (set-process-sentinel p 'tramp-process-sentinel)
-	    (tramp-compat-set-process-query-on-exit-flag p t)
-	    ;; Return process.
-	    p))
-      ;; Save exit.
-      (with-current-buffer (tramp-get-connection-buffer v)
-	(if (string-match tramp-temp-buffer-name (buffer-name))
-	    (progn
-	      (set-process-buffer (tramp-get-connection-process v) nil)
-	      (kill-buffer (current-buffer)))
-	  (widen)
-	  (goto-char (point-max))))
-      (tramp-set-connection-property v "process-name" nil)
-      (tramp-set-connection-property v "process-buffer" nil))))
+    ;; When PROGRAM is nil, we just provide a tty.
+    (let ((command
+	   (when (stringp program)
+	     (format "cd %s; exec %s"
+		     (tramp-shell-quote-argument localname)
+		     (mapconcat 'tramp-shell-quote-argument
+				(cons program args) " "))))
+	  (tramp-process-connection-type
+	   (or (null program) tramp-process-connection-type))
+	  (bmp (and (buffer-live-p buffer) (buffer-modified-p buffer)))
+	  (name1 name)
+	  (i 0))
+      (unwind-protect
+	  (save-excursion
+	    (save-restriction
+	      (unless buffer
+		;; BUFFER can be nil.  We use a temporary buffer.
+		(setq buffer (generate-new-buffer tramp-temp-buffer-name)))
+	      (while (get-process name1)
+		;; NAME must be unique as process name.
+		(setq i (1+ i)
+		      name1 (format "%s<%d>" name i)))
+	      (setq name name1)
+	      ;; Set the new process properties.
+	      (tramp-set-connection-property v "process-name" name)
+	      (tramp-set-connection-property v "process-buffer" buffer)
+	      ;; Activate narrowing in order to save BUFFER contents.
+	      ;; Clear also the modification time; otherwise we might
+	      ;; be interrupted by `verify-visited-file-modtime'.
+	      (with-current-buffer (tramp-get-connection-buffer v)
+		(let ((buffer-undo-list t))
+		  (clear-visited-file-modtime)
+		  (narrow-to-region (point-max) (point-max))
+		  (if command
+		      ;; Send the command.
+		      (tramp-send-command v command nil t) ; nooutput
+		    ;; Check, whether a pty is associated.
+		    (tramp-maybe-open-connection v)
+		    (unless (tramp-compat-process-get
+			     (tramp-get-connection-process v) 'remote-tty)
+		      (tramp-error
+		       v 'file-error
+		       "pty association is not supported for `%s'" name)))))
+	      (let ((p (tramp-get-connection-process v)))
+		;; Set sentinel and query flag for this process.
+		(tramp-set-connection-property p "vector" v)
+		(set-process-sentinel p 'tramp-process-sentinel)
+		(tramp-compat-set-process-query-on-exit-flag p t)
+		;; Return process.
+		p)))
+	;; Save exit.
+	(with-current-buffer (tramp-get-connection-buffer v)
+	  (if (string-match tramp-temp-buffer-name (buffer-name))
+	      (progn
+		(set-process-buffer (tramp-get-connection-process v) nil)
+		(kill-buffer (current-buffer)))
+	    (set-buffer-modified-p bmp)))
+	(tramp-set-connection-property v "process-name" nil)
+	(tramp-set-connection-property v "process-buffer" nil)))))
 
 (defun tramp-sh-handle-process-file
   (program &optional infile destination display &rest args)
@@ -2895,7 +2923,7 @@
        v 'file-error
        "Cannot make local copy of non-existing file `%s'" filename))
 
-    (let* ((size (nth 7 (file-attributes filename)))
+    (let* ((size (nth 7 (file-attributes (file-truename filename))))
 	   (rem-enc (tramp-get-inline-coding v "remote-encoding" size))
 	   (loc-dec (tramp-get-inline-coding v "local-decoding" size))
 	   (tmpfile (tramp-compat-make-temp-file filename)))
@@ -4103,22 +4131,10 @@
       (let ((gw (pop target-alist))
 	    (hop (pop target-alist)))
 	;; Is the method prepared for gateways?
-	(unless (tramp-get-method-parameter
-		 (tramp-file-name-method hop) 'tramp-default-port)
+	(unless (tramp-file-name-port hop)
 	  (tramp-error
 	   vec 'file-error
-	   "Method `%s' is not supported for gateway access."
-	   (tramp-file-name-method hop)))
-	;; Add default port if needed.
-	(unless
-	    (string-match
-	     tramp-host-with-port-regexp (tramp-file-name-host hop))
-	  (aset hop 2
-		(concat
-		 (tramp-file-name-host hop) tramp-prefix-port-format
-		 (number-to-string
-		  (tramp-get-method-parameter
-		   (tramp-file-name-method hop) 'tramp-default-port)))))
+	   "Connection `%s' is not supported for gateway access." hop))
 	;; Open the gateway connection.
 	(add-to-list
 	 'target-alist
@@ -4238,7 +4254,7 @@
 		 (p (let ((default-directory
 			    (tramp-compat-temporary-file-directory)))
 		      (start-process
-		       (or process-name (tramp-buffer-name vec))
+		       (tramp-get-connection-name vec)
 		       (tramp-get-connection-buffer vec)
 		       tramp-encoding-shell))))
 
--- a/lisp/net/tramp-smb.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/net/tramp-smb.el	Thu Dec 16 18:30:57 2010 -0500
@@ -49,7 +49,7 @@
 ;; Add a default for `tramp-default-user-alist'. Rule: For the SMB method,
 ;; the anonymous user is chosen.
 (add-to-list 'tramp-default-user-alist
-	     `(,tramp-smb-method nil ""))
+	     `(,(concat "\\`" tramp-smb-method "\\'") nil nil))
 
 ;; Add completion function for SMB method.
 (tramp-set-completion-function
--- a/lisp/net/tramp.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/net/tramp.el	Thu Dec 16 18:30:57 2010 -0500
@@ -331,9 +331,9 @@
 
 See `tramp-methods' for a list of possibilities for METHOD."
   :group 'tramp
-  :type '(repeat (list (regexp :tag "Host regexp")
-		       (regexp :tag "User regexp")
-		       (string :tag "Method"))))
+  :type '(repeat (list (choice :tag "Host regexp" regexp sexp)
+		       (choice :tag "User regexp" regexp sexp)
+		       (choice :tag "Method name" string (const nil)))))
 
 (defcustom tramp-default-user nil
   "*Default user to use for transferring files.
@@ -355,9 +355,9 @@
 If the file name does not specify the method, lookup is done using the
 empty string for the method name."
   :group 'tramp
-  :type '(repeat (list (regexp :tag "Method regexp")
-		       (regexp :tag "Host regexp")
-		       (string :tag "User"))))
+  :type '(repeat (list (choice :tag "Method regexp" regexp sexp)
+		       (choice :tag "  Host regexp" regexp sexp)
+		       (choice :tag "    User name" string (const nil)))))
 
 (defcustom tramp-default-host (system-name)
   "*Default host to use for transferring files.
@@ -382,11 +382,14 @@
   :group 'tramp
   :type '(repeat (list (choice :tag "Host regexp" regexp sexp)
 		       (choice :tag "User regexp" regexp sexp)
-		       (choice :tag "Proxy remote name" string (const nil)))))
+		       (choice :tag " Proxy name" string (const nil)))))
 
 (defconst tramp-local-host-regexp
   (concat
-   "^" (regexp-opt (list "localhost" (system-name) "127\.0\.0\.1" "::1") t) "$")
+   "\\`"
+   (regexp-opt
+    (list "localhost" "localhost6" (system-name) "127\.0\.0\.1" "::1") t)
+   "\\'")
   "*Host names which are regarded as local host.")
 
 (defvar tramp-completion-function-alist nil
@@ -600,6 +603,7 @@
   "File name of a persistent local temporary file.
 Useful for \"rsync\" like methods.")
 (make-variable-buffer-local 'tramp-temp-buffer-file-name)
+(put 'tramp-temp-buffer-file-name 'permanent-local t)
 
 ;; XEmacs is distributed with few Lisp packages.  Further packages are
 ;; installed using EFS.  If we use a unified filename format, then
@@ -1066,10 +1070,12 @@
 (defun tramp-file-name-port (vec)
   "Return the port number of VEC."
   (save-match-data
-    (let ((host (tramp-file-name-host vec)))
-      (and (stringp host)
-	   (string-match tramp-host-with-port-regexp host)
-	   (string-to-number (match-string 2 host))))))
+    (let ((method (tramp-file-name-method vec))
+	  (host (tramp-file-name-host vec)))
+      (or (and (stringp host)
+	       (string-match tramp-host-with-port-regexp host)
+	       (string-to-number (match-string 2 host)))
+	  (tramp-get-method-parameter method 'tramp-default-port)))))
 
 ;;;###tramp-autoload
 (defun tramp-tramp-file-p (name)
@@ -1205,13 +1211,18 @@
   (or (tramp-get-connection-property vec "process-buffer" nil)
       (tramp-get-buffer vec)))
 
+(defun tramp-get-connection-name (vec)
+  "Get the connection name to be used for VEC.
+In case a second asynchronous communication has been started, it is different
+from the default one."
+  (or (tramp-get-connection-property vec "process-name" nil)
+      (tramp-buffer-name vec)))
+
 (defun tramp-get-connection-process (vec)
   "Get the connection process to be used for VEC.
 In case a second asynchronous communication has been started, it is different
 from the default one."
-  (get-process
-   (or (tramp-get-connection-property vec "process-name" nil)
-       (tramp-buffer-name vec))))
+  (get-process (tramp-get-connection-name vec)))
 
 (defun tramp-debug-buffer-name (vec)
   "A name for the debug buffer for VEC."
@@ -1284,7 +1295,7 @@
 	      (setq fn (symbol-name btf))
 	      (unless (and (string-match "^tramp" fn)
 			   (not (string-match
-				 "^tramp\\(-debug\\)?\\(-message\\|-error\\|-compat-funcall\\)$"
+				 "^tramp\\(-debug\\)?\\(-message\\|-error\\|-compat\\(-funcall\\|-with-temp-message\\)\\)$"
 				 fn)))
 		(setq fn nil)))
 	    (setq btn (1+ btn))))
@@ -1454,7 +1465,7 @@
   (if (memq system-type '(cygwin windows-nt))
       (defun tramp-drop-volume-letter (name)
 	"Cut off unnecessary drive letter from file NAME.
-The function `tramp-handle-expand-file-name' calls `expand-file-name'
+The functions `tramp-*-handle-expand-file-name' call `expand-file-name'
 locally on a remote file name.  When the local system is a W32 system
 but the remote system is Unix, this introduces a superfluous drive
 letter into the file name.  This function removes it."
@@ -2832,8 +2843,8 @@
 		       (t (file-local-copy filename)))))
 
 	      ;; When the file is not readable for the owner, it
-	      ;; cannot be inserted, even it is redable for the group
-	      ;; or for everybody.
+	      ;; cannot be inserted, even if it is readable for the
+	      ;; group or for everybody.
 	      (set-file-modes local-copy (tramp-compat-octal-to-decimal "0600"))
 
 	      (when (and (null remote-copy)
@@ -2841,8 +2852,7 @@
 			  method 'tramp-copy-keep-tmpfile))
 		;; We keep the local file for performance reasons,
 		;; useful for "rsync".
-		(setq tramp-temp-buffer-file-name local-copy)
-		(put 'tramp-temp-buffer-file-name 'permanent-local t))
+		(setq tramp-temp-buffer-file-name local-copy))
 
 	      (with-progress-reporter
 		  v 3 (format "Inserting local temp file `%s'" local-copy)
@@ -3067,26 +3077,27 @@
   (tramp-compat-with-temp-message ""
     ;; Enable auth-source and password-cache.
     (tramp-set-connection-property vec "first-password-request" t)
-    (let (exit)
-      (while (not exit)
-	(tramp-message proc 3 "Waiting for prompts from remote shell")
-	(setq exit
-	      (catch 'tramp-action
-		(if timeout
-		    (with-timeout (timeout)
-		      (tramp-process-one-action proc vec actions))
-		  (tramp-process-one-action proc vec actions)))))
-      (with-current-buffer (tramp-get-connection-buffer vec)
-	(widen)
-	(tramp-message vec 6 "\n%s" (buffer-string)))
-      (unless (eq exit 'ok)
-	(tramp-clear-passwd vec)
-	(tramp-error-with-buffer
-	 nil vec 'file-error
-	 (cond
-	  ((eq exit 'permission-denied) "Permission denied")
-	  ((eq exit 'process-died) "Process died")
-	  (t "Login failed")))))))
+    (save-restriction
+      (let (exit)
+	(while (not exit)
+	  (tramp-message proc 3 "Waiting for prompts from remote shell")
+	  (setq exit
+		(catch 'tramp-action
+		  (if timeout
+		      (with-timeout (timeout)
+			(tramp-process-one-action proc vec actions))
+		    (tramp-process-one-action proc vec actions)))))
+	(with-current-buffer (tramp-get-connection-buffer vec)
+	  (widen)
+	  (tramp-message vec 6 "\n%s" (buffer-string)))
+	(unless (eq exit 'ok)
+	  (tramp-clear-passwd vec)
+	  (tramp-error-with-buffer
+	   nil vec 'file-error
+	   (cond
+	    ((eq exit 'permission-denied) "Permission denied")
+	    ((eq exit 'process-died) "Process died")
+	    (t "Login failed"))))))))
 
 :;; Utility functions:
 
--- a/lisp/net/trampver.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/net/trampver.el	Thu Dec 16 18:30:57 2010 -0500
@@ -32,7 +32,7 @@
 ;; should be changed only there.
 
 ;;;###tramp-autoload
-(defconst tramp-version "2.2.0"
+(defconst tramp-version "2.2.1-pre"
   "This version of Tramp.")
 
 ;;;###tramp-autoload
@@ -45,7 +45,7 @@
 		      (= emacs-major-version 21)
 		      (>= emacs-minor-version 4)))
 	     "ok"
-	   (format "Tramp 2.2.0 is not fit for %s"
+	   (format "Tramp 2.2.1-pre is not fit for %s"
 		   (when (string-match "^.*$" (emacs-version))
 		     (match-string 0 (emacs-version)))))))
   (unless (string-match "\\`ok\\'" x) (error "%s" x)))
--- a/lisp/newcomment.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/newcomment.el	Thu Dec 16 18:30:57 2010 -0500
@@ -187,21 +187,58 @@
 it is 1 so that regions are commented with two or three semi-colons.")
 
 (defconst comment-styles
-  '((plain	. (nil nil nil nil))
-    (indent	. (nil nil nil t))
-    (indent-or-triple
-                . (nil nil nil multi-char))
-    (aligned	. (nil t nil t))
-    (multi-line	. (t nil nil t))
-    (extra-line	. (t nil t t))
-    (box	. (nil t t t))
-    (box-multi	. (t t t t)))
-  "Comment region styles of the form (STYLE . (MULTI ALIGN EXTRA INDENT)).
+  '((plain      nil nil nil nil
+                "Start in column 0 (do not indent), as in Emacs-20")
+    (indent-or-triple nil nil nil multi-char
+              "Start in column 0, but only for single-char starters")
+    (indent     nil nil nil t
+                "Full comment per line, ends not aligned")
+    (aligned	nil t   nil t
+                "Full comment per line, ends aligned")
+    (box	nil t   t   t
+                "Full comment per line, ends aligned, + top and bottom")
+    (extra-line	t   nil t   t
+                "One comment for all lines, end on a line by itself")
+    (multi-line	t   nil nil t
+                "One comment for all lines, end on last commented line")
+    (box-multi	t   t   t   t
+                "One comment for all lines, + top and bottom"))
+  "Comment region style definitions.
+Each style is defined with a form (STYLE . (MULTI ALIGN EXTRA INDENT DOC)).
+DOC should succinctly describe the style.
 STYLE should be a mnemonic symbol.
 MULTI specifies that comments are allowed to span multiple lines.
+  e.g. in C it comments regions as
+     /* blabla
+      * bli */
+  rather than
+     /* blabla */
+     /* bli */
+  if `comment-end' is empty, this has no effect.
+
 ALIGN specifies that the `comment-end' markers should be aligned.
+  e.g. in C it comments regions as
+     /* blabla */
+     /* bli    */
+  rather than
+     /* blabla */
+     /* bli */
+  if `comment-end' is empty, this has no effect, unless EXTRA is also set,
+  in which case the comment gets wrapped in a box.
+  
 EXTRA specifies that an extra line should be used before and after the
   region to comment (to put the `comment-end' and `comment-start').
+  e.g. in C it comments regions as
+     /*
+      * blabla
+      * bli
+      */
+  rather than
+     /* blabla
+      * bli */
+  if the comment style is not multi line, this has no effect, unless ALIGN
+  is also set, in which case the comment gets wrapped in a box.
+
 INDENT specifies that the `comment-start' markers should not be put at the
   left margin but at the current indentation of the region to comment.
 If INDENT is `multi-char', that means indent multi-character
@@ -212,8 +249,11 @@
   "Style to be used for `comment-region'.
 See `comment-styles' for a list of available styles."
   :type (if (boundp 'comment-styles)
-	    `(choice ,@(mapcar (lambda (s) `(const ,(car s)))
-			       comment-styles))
+	    `(choice
+              ,@(mapcar (lambda (s)
+                          `(const :tag ,(format "%s: %s" (car s) (nth 5 s))
+                                  ,(car s)))
+                        comment-styles))
 	  'symbol)
   :version "23.1"
   :group 'comment)
--- a/lisp/nxml/nxml-mode.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/nxml/nxml-mode.el	Thu Dec 16 18:30:57 2010 -0500
@@ -1,6 +1,7 @@
 ;;; nxml-mode.el --- a new XML mode
 
-;; Copyright (C) 2003, 2004, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2004, 2007, 2008, 2009, 2010
+;;   Free Software Foundation, Inc.
 
 ;; Author: James Clark
 ;; Keywords: XML
@@ -37,9 +38,10 @@
 (require 'nxml-util)
 (require 'nxml-rap)
 (require 'nxml-outln)
-
-(declare-function rng-nxml-mode-init "rng-nxml")
-(declare-function nxml-enable-unicode-char-name-sets "nxml-uchnm")
+;; nxml-mode calls rng-nxml-mode-init, which is autoloaded from rng-nxml.
+;; So we might as well just require it and silence the compiler.
+(provide 'nxml-mode)			; avoid recursive require
+(require 'rng-nxml)
 
 ;;; Customization
 
@@ -52,38 +54,33 @@
   :group 'nxml)
 
 (defcustom nxml-char-ref-display-glyph-flag t
-  "*Non-nil means display glyph following character reference.
+  "Non-nil means display glyph following character reference.
 The glyph is displayed in face `nxml-glyph'.  The hook
 `nxml-glyph-set-hook' can be used to customize for which characters
 glyphs are displayed."
   :group 'nxml
   :type 'boolean)
 
-(defcustom nxml-mode-hook nil
-  "Hook run by command `nxml-mode'."
-  :group 'nxml
-  :type 'hook)
-
 (defcustom nxml-sexp-element-flag nil
-  "*Non-nil means sexp commands treat an element as a single expression."
+  "Non-nil means sexp commands treat an element as a single expression."
   :group 'nxml
   :type 'boolean)
 
 (defcustom nxml-slash-auto-complete-flag nil
-  "*Non-nil means typing a slash automatically completes the end-tag.
+  "Non-nil means typing a slash automatically completes the end-tag.
 This is used by `nxml-electric-slash'."
   :group 'nxml
   :type 'boolean)
 
 (defcustom nxml-child-indent 2
-  "*Indentation for the children of an element relative to the start-tag.
+  "Indentation for the children of an element relative to the start-tag.
 This only applies when the line or lines containing the start-tag contains
 nothing else other than that start-tag."
   :group 'nxml
   :type 'integer)
 
 (defcustom nxml-attribute-indent 4
-  "*Indentation for the attributes of an element relative to the start-tag.
+  "Indentation for the attributes of an element relative to the start-tag.
 This only applies when the first attribute of a tag starts a line.
 In other cases, the first attribute on one line is indented the same
 as the first attribute on the previous line."
@@ -91,7 +88,7 @@
   :type 'integer)
 
 (defcustom nxml-bind-meta-tab-to-complete-flag (not window-system)
-  "*Non-nil means bind M-TAB in `nxml-mode-map' to `nxml-complete'.
+  "Non-nil means bind M-TAB in `nxml-mode-map' to `nxml-complete'.
 C-return will be bound to `nxml-complete' in any case.
 M-TAB gets swallowed by many window systems/managers, and
 `documentation' will show M-TAB rather than C-return as the
@@ -105,7 +102,7 @@
   :type 'boolean)
 
 (defcustom nxml-prefer-utf-16-to-utf-8-flag nil
-  "*Non-nil means prefer UTF-16 to UTF-8 when saving a buffer.
+  "Non-nil means prefer UTF-16 to UTF-8 when saving a buffer.
 This is used only when a buffer does not contain an encoding declaration
 and when its current `buffer-file-coding-system' specifies neither UTF-16
 nor UTF-8."
@@ -114,7 +111,7 @@
 
 (defcustom nxml-prefer-utf-16-little-to-big-endian-flag (eq system-type
 							    'windows-nt)
-  "*Non-nil means prefer little-endian to big-endian byte-order for UTF-16.
+  "Non-nil means prefer little-endian to big-endian byte-order for UTF-16.
 This is used only for saving a buffer; when reading the byte-order is
 auto-detected. It may be relevant both when there is no encoding declaration
 and when the encoding declaration specifies `UTF-16'."
@@ -122,14 +119,14 @@
   :type 'boolean)
 
 (defcustom nxml-default-buffer-file-coding-system nil
-  "*Default value for `buffer-file-coding-system' for a buffer for a new file.
+  "Default value for `buffer-file-coding-system' for a buffer for a new file.
 A value of nil means use the default value of `buffer-file-coding-system' as normal.
 A buffer's `buffer-file-coding-system' affects what \\[nxml-insert-xml-declaration] inserts."
   :group 'nxml
   :type 'coding-system)
 
 (defcustom nxml-auto-insert-xml-declaration-flag nil
-  "*Non-nil means automatically insert an XML declaration in a new file.
+  "Non-nil means automatically insert an XML declaration in a new file.
 The XML declaration is inserted using `nxml-insert-xml-declaration'."
   :group 'nxml
   :type 'boolean)
@@ -354,6 +351,12 @@
 
 ;;; Global variables
 
+(defvar nxml-parent-document nil
+  "The parent document for a part of a modular document.
+Use `nxml-parent-document-set' to set it.")
+(make-variable-buffer-local 'nxml-parent-document)
+(put 'nxml-parent-document 'safe-local-variable 'stringp)
+
 (defvar nxml-prolog-regions nil
   "List of regions in the prolog to be fontified.
 See the function `xmltok-forward-prolog' for more information.")
@@ -430,8 +433,40 @@
   (when (and face (< start end))
     (font-lock-append-text-property start end 'face face)))
 
+(defun nxml-parent-document-set (parent-document)
+  "Set `nxml-parent-document' and inherit the DTD &c."
+  ;; FIXME: this does not work.
+  ;;  the idea is that by inheriting some variables from the parent,
+  ;;  `rng-validate-mode' will validate entities declared in the parent.
+  ;;  alas, the most interesting variables (`rng-compile-table' et al)
+  ;;  are circular and cannot be printed even with `print-circle'.
+  (interactive "fParent document")
+  (let (dtd current-schema current-schema-file-name compile-table
+        ipattern-table last-ipattern-index)
+    (when (string= (file-truename parent-document)
+                   (file-truename buffer-file-name))
+      (error "Parent document cannot be the same as the document"))
+    (with-current-buffer (find-file-noselect parent-document)
+      (setq dtd rng-dtd
+            current-schema rng-current-schema
+            current-schema-file-name rng-current-schema-file-name
+            compile-table rng-compile-table
+            ipattern-table rng-ipattern-table
+            last-ipattern-index rng-last-ipattern-index
+            parent-document buffer-file-name))
+    (setq rng-dtd dtd
+          rng-current-schema current-schema
+          rng-current-schema-file-name current-schema-file-name
+          rng-compile-table compile-table
+          rng-ipattern-table ipattern-table
+          rng-last-ipattern-index last-ipattern-index
+          nxml-parent-document parent-document)
+    (message "Set parent document to %s" parent-document)
+    (when rng-validate-mode
+      (rng-validate-while-idle (current-buffer)))))
+
 ;;;###autoload
-(defun nxml-mode ()
+(define-derived-mode nxml-mode text-mode "nXML"
   ;; We use C-c C-i instead of \\[nxml-balanced-close-start-tag-inline]
   ;; because Emacs turns C-c C-i into C-c TAB which is hard to type and
   ;; not mnemonic.
@@ -485,10 +520,7 @@
 
 Many aspects this mode can be customized using
 \\[customize-group] nxml RET."
-  (interactive)
-  (kill-all-local-variables)
-  (setq major-mode 'nxml-mode)
-  (setq mode-name "nXML")
+  ;; (kill-all-local-variables)
   (set (make-local-variable 'mode-line-process) '((nxml-degraded "/degraded")))
   ;; We'll determine the fill prefix ourselves
   (make-local-variable 'adaptive-fill-mode)
@@ -552,8 +584,7 @@
           (font-lock-unfontify-region-function . nxml-unfontify-region)))
 
   (rng-nxml-mode-init)
-  (nxml-enable-unicode-char-name-sets)
-  (run-mode-hooks 'nxml-mode-hook))
+  (nxml-enable-unicode-char-name-sets))
 
 (defun nxml-cleanup ()
   "Clean up after nxml-mode."
@@ -2664,5 +2695,4 @@
 
 (provide 'nxml-mode)
 
-;; arch-tag: 8603bc5f-1ef9-4021-b223-322fb2ca708e
 ;;; nxml-mode.el ends here
--- a/lisp/nxml/nxml-outln.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/nxml/nxml-outln.el	Thu Dec 16 18:30:57 2010 -0500
@@ -1,6 +1,7 @@
 ;;; nxml-outln.el --- outline support for nXML mode
 
-;; Copyright (C) 2004, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+;; Copyright (C) 2004, 2007, 2008, 2009, 2010
+;;   Free Software Foundation, Inc.
 
 ;; Author: James Clark
 ;; Keywords: XML
@@ -82,7 +83,7 @@
 
 (defcustom nxml-section-element-name-regexp
   "article\\|\\(sub\\)*section\\|chapter\\|div\\|appendix\\|part\\|preface\\|reference\\|simplesect\\|bibliography\\|bibliodiv\\|glossary\\|glossdiv"
-  "*Regular expression matching the name of elements used as sections.
+  "Regular expression matching the name of elements used as sections.
 An XML element is treated as a section if:
 
 - its local name (that is, the name without the prefix) matches
@@ -97,7 +98,7 @@
   :type 'regexp)
 
 (defcustom nxml-heading-element-name-regexp "title\\|head"
-  "*Regular expression matching the name of elements used as headings.
+  "Regular expression matching the name of elements used as headings.
 An XML element is only recognized as a heading if it occurs as or
 within the first child of an element that is recognized as a section.
 See the variable `nxml-section-element-name-regexp' for more details."
@@ -105,7 +106,7 @@
   :type 'regexp)
 
 (defcustom nxml-outline-child-indent 2
-  "*Indentation in an outline for child element relative to parent element."
+  "Indentation in an outline for child element relative to parent element."
   :group 'nxml
   :type 'integer)
 
@@ -1037,5 +1038,4 @@
 
 (provide 'nxml-outln)
 
-;; arch-tag: 1f1b7454-e573-4cd7-a505-d9dc64eef828
 ;;; nxml-outln.el ends here
--- a/lisp/nxml/rng-loc.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/nxml/rng-loc.el	Thu Dec 16 18:30:57 2010 -0500
@@ -1,6 +1,7 @@
 ;;; rng-loc.el --- locate the schema to use for validation
 
-;; Copyright (C) 2003, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2007, 2008, 2009, 2010
+;;   Free Software Foundation, Inc.
 
 ;; Author: James Clark
 ;; Keywords: XML, RelaxNG
@@ -48,7 +49,7 @@
   "Schema for schema locating files or nil if not yet loaded.")
 
 (defcustom rng-schema-locating-files rng-schema-locating-files-default
-  "*List of schema locating files."
+  "List of schema locating files."
   :type '(repeat file)
   :group 'relax-ng)
 
@@ -546,5 +547,4 @@
 
 (provide 'rng-loc)
 
-;; arch-tag: 725cf968-37a2-418b-b47b-d5209871a9ab
 ;;; rng-loc.el ends here
--- a/lisp/nxml/rng-nxml.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/nxml/rng-nxml.el	Thu Dec 16 18:30:57 2010 -0500
@@ -1,6 +1,7 @@
 ;;; rng-nxml.el --- make nxml-mode take advantage of rng-validate-mode
 
-;; Copyright (C) 2003, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2007, 2008, 2009, 2010
+;;   Free Software Foundation, Inc.
 
 ;; Author: James Clark
 ;; Keywords: XML, RelaxNG
@@ -35,7 +36,7 @@
 (require 'rng-loc)
 
 (defcustom rng-nxml-auto-validate-flag t
-  "*Non-nil means automatically turn on validation with nxml-mode."
+  "Non-nil means automatically turn on validation with nxml-mode."
   :type 'boolean
   :group 'relax-ng)
 
@@ -47,7 +48,7 @@
     ("http://www.w3.org/2001/XMLSchema-instance" . "xsi")
     ("http://purl.org/dc/elements/1.1/" . "dc")
     ("http://purl.org/dc/terms/" . "dcterms"))
-  "*Alist of namespaces vs preferred prefixes."
+  "Alist of namespaces vs preferred prefixes."
   :type '(repeat (cons :tag "With"
 		       (string :tag "this namespace URI")
 		       (string :tag "use this prefix")))
@@ -591,5 +592,4 @@
 
 (provide 'rng-nxml)
 
-;; arch-tag: bec0d6ed-6be1-4540-9c2c-6f56e8e55d8b
 ;;; rng-nxml.el ends here
--- a/lisp/nxml/rng-valid.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/nxml/rng-valid.el	Thu Dec 16 18:30:57 2010 -0500
@@ -1,6 +1,7 @@
 ;;; rng-valid.el --- real-time validation of XML using RELAX NG
 
-;; Copyright (C) 2003, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2007, 2008, 2009, 2010
+;;   Free Software Foundation, Inc.
 
 ;; Author: James Clark
 ;; Keywords: XML, RelaxNG
@@ -110,12 +111,12 @@
   :group 'relax-ng)
 
 (defcustom rng-state-cache-distance 2000
-  "*Distance in characters between each parsing and validation state cache."
+  "Distance in characters between each parsing and validation state cache."
   :type 'integer
   :group 'relax-ng)
 
 (defcustom rng-validate-chunk-size 8000
-  "*Number of characters in a RELAX NG validation chunk.
+  "Number of characters in a RELAX NG validation chunk.
 A validation chunk will be the smallest chunk that is at least this
 size and ends with a tag.  After validating a chunk, validation will
 continue only if Emacs is still idle."
@@ -123,14 +124,14 @@
   :group 'relax-ng)
 
 (defcustom rng-validate-delay 1.5
-  "*Time in seconds that Emacs must be idle before starting a full validation.
+  "Time in seconds that Emacs must be idle before starting a full validation.
 A full validation continues until either validation is up to date
 or Emacs is no longer idle."
   :type 'number
   :group 'relax-ng)
 
 (defcustom rng-validate-quick-delay 0.3
-  "*Time in seconds that Emacs must be idle before starting a quick validation.
+  "Time in seconds that Emacs must be idle before starting a quick validation.
 A quick validation validates at most one chunk."
   :type 'number
   :group 'relax-ng)
@@ -518,6 +519,9 @@
 			     (goto-char pos))
 			    (t (rng-set-initial-state))))))))))
 
+(defun rng-dtd-trivial-p (dtd)
+  "Check whether the current dtd is different from the trivial default."
+  (or (null dtd) (eq dtd xmltok-predefined-entity-alist)))
 
 (defun rng-do-some-validation-1 (&optional continue-p-function)
   (let ((limit (+ rng-validate-up-to-date-end
@@ -1461,5 +1465,4 @@
 
 (provide 'rng-valid)
 
-;; arch-tag: 7dd846d3-519d-4a6d-8107-4ff0024a60ef
 ;;; rng-valid.el ends here
--- a/lisp/org/ChangeLog	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/ChangeLog	Thu Dec 16 18:30:57 2010 -0500
@@ -1,3 +1,658 @@
+2010-12-11  Tassilo Horn  <tassilo@member.fsf.org>
+
+	* org-footnote.el (org-footnote-create-definition): Place
+	Footnotes section before message-signature-separator also in modes
+	derived from message-mode.
+
+2010-12-11  Julien Danjou  <julien@danjou.info>
+
+	* org.el (org-make-tags-matcher): Remove useless cat-p value.
+
+2010-12-11  Julien Danjou  <julien@danjou.info>
+
+	* org.el (org-entry-properties): Enhance docstring.
+
+2010-12-11  Nicolas Goaziou  <n.goaziou@gmail.com>
+
+	* org-list.el (org-list-top-point-with-indent)
+	(org-list-bottom-point-with-indent): Pay also attention to
+	'original-indentation property of text, as blocks are put to
+	column 0 upon exporting.
+
+2010-12-11  Dan Davison  <dandavison7@gmail.com>
+
+	* ob.el (org-babel-remove-temporary-directory): Handle exception
+	with message informing of failure to remove directory.
+
+2010-12-11  Eric Schulte  <schulte.eric@gmail.com>
+
+	* ob-clojure.el (org-babel-header-arg-names:clojure): Add
+	`package' to the list of Clojure header arguments which will be read
+	from heading properties.
+
+2010-12-11  Nicolas Goaziou  <n.goaziou@gmail.com>
+
+	* org-inlinetask.el (org-inlinetask-export-templates): Add
+	Sébastien Vauban's suggestion for LaTeX export in docstring. This is
+	not default as it requires an additional LaTeX package: "todonotes".
+
+2010-12-11  Nicolas Goaziou  <n.goaziou@gmail.com>
+
+	* org-inlinetask.el (org-inlinetask-export-templates): New variable.
+
+	* org-inlinetask.el (org-inlinetask-export-handler): Make use of
+	templates to export inline tasks.
+
+2010-12-11  Nicolas Goaziou  <n.goaziou@gmail.com>
+
+	* org.el (org-current-level): Ignore inline tasks when getting current
+	level of entry.
+
+2010-12-11  Nicolas Goaziou  <n.goaziou@gmail.com>
+
+	* org.el (org-indent-line-function): Ignore drawers inside inline
+	tasks  if the line to indent isn't inside an inline task itself.
+
+2010-12-11  Nicolas Goaziou  <n.goaziou@gmail.com>
+
+	* org-inlinetask.el (org-inlinetask-get-task-level): New function.
+
+	* org-indent.el (org-indent-add-properties): Find true level of
+	indentation wrt inline tasks.
+
+2010-12-11  Nicolas Goaziou  <n.goaziou@gmail.com>
+
+	* org-inlinetask.el (org-inlinetask-outline-regexp): New function.
+
+	* org-inlinetask.el (org-inlinetask-goto-beginning): New function.
+
+	* org-inlinetask.el (org-inlinetask-goto-end): New function.
+
+	* org.el (org-mark-subtree): New command.
+
+	* org.el (org-speed-commands-default, org-mode-map): Make use of
+	new command.
+
+2010-12-11  Nicolas Goaziou  <n.goaziou@gmail.com>
+
+	* org-inlinetask.el (org-inlinetask-export-handler): Remove protection
+	from @<span class...> so it can be removed during LaTeX export.
+
+2010-12-11  Eric Schulte  <schulte.eric@gmail.com>
+
+	* ob.el (org-babel-insert-result): More informative code block
+	evaluation messages.
+
+2010-12-11  Matt Lundin  <mdl@imapmail.org>
+
+	* org.el (org-make-heading-search-string): Optionally limit number
+	of lines stored in file link search strings.
+	(org-context-in-file-links) Add option to set to integer specifying
+	number of lines.
+
+2010-12-11  Carsten Dominik  <carsten.dominik@gmail.com>
+
+	* org-capture.el (org-capture-finalize): New prefix argument
+	STAY-WITH-CAPTURE.
+	(org-capture-refile): Improve docstring.
+
+2010-12-11  Eric Schulte  <schulte.eric@gmail.com>
+
+	* ob-sql.el (org-babel-execute:sql): Add msosql as optional sql
+	interaction engine.
+
+2010-12-11  Carsten Dominik  <carsten.dominik@gmail.com>
+
+	* org-agenda.el (org-agenda-list):
+	(org-agenda-goto-today): Use `org-today'.
+
+2010-12-11  Carsten Dominik  <carsten.dominik@gmail.com>
+
+	* org-latex.el (org-export-latex-make-header): Swap \begin{document}
+	and the title/author definitions.
+
+2010-12-11  Carsten Dominik  <carsten.dominik@gmail.com>
+
+	* org-macs.el: Better backup definition for
+	`with-silent-modifications'.
+
+2010-12-11  Eric Schulte  <schulte.eric@gmail.com>
+
+	* ob-python.el (org-babel-execute:python): Rename "prefix" to
+	"preamble".
+	(org-babel-python-evaluate): Rename "prefix" to "preamble".
+	(org-babel-python-evaluate-external-process): Rename "prefix" to
+	"preamble".
+
+2010-12-11  Eric Schulte  <schulte.eric@gmail.com>
+
+	* ob.el (org-babel-examplize-region): Check if `end' is a marker
+	or a point and handle appropriately.
+
+2010-12-11  Eric Schulte  <schulte.eric@gmail.com>
+
+	* ob-sql.el (org-babel-execute:sql): Explicitly set field
+	separator to \t when importing tabular data.
+
+2010-12-11  Julien Danjou  <julien@danjou.info>
+
+	* org-agenda.el (org-agenda-custom-commands-local-options):
+	Allow org-agenda-span to be a symbol.
+	(org-agenda-ndays): Make obsolete.
+	(org-agenda-span): New variable superseding org-agenda-ndays.
+	(org-agenda-menu): Use org-agenda-current-span.
+	(org-agenda-current-span): New local variable storing current
+	span.
+	(org-agenda-list): Take a span instead of ndays as argument.
+	This function is now responsible for computing the ndays based
+	on span.
+	(org-agenda-ndays-to-span): Return span only if number of days
+	really matches.
+	(org-agenda-span-to-ndays): New function.
+	(org-agenda-manipulate-query): Use org-agenda-compute-starting-span.
+	(org-agenda-goto-today): Use org-agenda-compute-starting-span.
+	(org-agenda-later): Do not give compute a new span, use the
+	current one.
+	(org-agenda-day-view, org-agenda-week-view)
+	(org-agenda-month-view, org-agenda-year-view): Stop touching
+	org-agenda-ndays.
+	(org-agenda-change-time-span): Only compute starting-span.
+	(org-agenda-compute-starting-span): New function derived from
+	the old org-agenda-compute-time-span.
+	(org-agenda-set-mode-name): Compute mode based on
+	org-agenda-current-span.
+	(org-agenda-span-name): New function.
+
+2010-12-11  Robert Pluim  <rpluim@gmail.com>  (tiny change)
+
+	* org-agenda.el (org-agenda-toggle-deadlines): Fix docstring.
+
+2010-12-11  Carsten Dominik  <carsten.dominik@gmail.com>
+
+	* org-clock.el (org-quarter-to-date): Define variables.
+	(org-clock-special-range): Defin variables.  Use org-floor*.
+	(org-clocktable-write-default): Define tcol.
+
+	* org-compat.el (org-floor*): New function.
+
+2010-12-11  Carsten Dominik  <carsten.dominik@gmail.com>
+	    John Wiegley  <jwiegley@gmail.com>
+
+	* org-complete.el: New file.
+
+2010-12-11  Carsten Dominik  <carsten.dominik@gmail.com>
+
+	* org-clock.el (org-clocktable-write-default): Fix the % formula.
+
+2010-12-11  Matt Lundin  <mdl@imapmail.org>
+
+	* org-agenda.el (org-format-agenda-item): The value of
+	org-category is not converted to a string unless it is defined.
+
+2010-12-11  Eric Schulte  <schulte.eric@gmail.com>
+
+	* ob-python.el (org-babel-execute:python): Pass the new "prefix"
+	header argument through to external evaluation.
+	(org-babel-python-evaluate): Pass the new "prefix" header argument
+	through to external evaluation.
+	(org-babel-python-evaluate-external-process): When specified prepend
+	"prefix" to the file used in external evaluation.
+
+2010-12-11  Dan Davison  <dandavison7@gmail.com>
+
+	* ob-python.el (org-babel-python-evaluate-session): Change python
+	module name from 'pp' to 'pprint'.
+
+2010-12-11  Eric Schulte  <schulte.eric@gmail.com>
+
+	* ob-R.el (org-babel-R-evaluate-session): Removing empty lines
+	from R session output, these are often the result of variable
+	assignments.
+
+2010-12-11  Eric Schulte  <schulte.eric@gmail.com>
+
+	* ob-sql.el (orgtbl-to-csv): Declaring an external function to
+	fix a compiler warning.
+
+2010-12-11  Eric Schulte  <schulte.eric@gmail.com>
+
+	* ob-eval.el (require): No longer require ob.el to allow
+	requiring by ob.el.
+
+	* ob.el (ob-eval): Require ob-eval.
+
+2010-12-11  Eric Schulte  <schulte.eric@gmail.com>
+
+	* ob.el (org-babel-confirm-evaluate): Show code block's name when
+	it is available during evaluation query.
+
+2010-12-11  Eric Schulte  <schulte.eric@gmail.com>
+
+	* ob-sql.el (org-babel-expand-body:sql): Expand the body of a sql
+	code block.
+	(org-babel-execute:sql): Use sql specific body expansion function.
+	(org-babel-sql-expand-vars): Insert variables into a sql code block.
+
+2010-12-11  Eric Schulte  <schulte.eric@gmail.com>
+
+	* ob.el (org-babel-insert-result): Using markers instead of
+	points for more robust buffer anchors.
+
+2010-12-11  Julien Danjou  <julien@danjou.info>
+
+	* org-capture.el: Use org-today.
+
+2010-12-11  Julien Danjou  <julien@danjou.info>
+
+	* org-habit.el: Use org-today.
+
+2010-12-11  Julien Danjou  <julien@danjou.info>
+
+	* org.el (org-auto-repeat-maybe): Use org-today.
+
+2010-12-11  Carsten Dominik  <carsten.dominik@gmail.com>
+
+	* org-clock.el (org-day-of-week): New function.
+	(org-quarter-to-date): New function.
+	(org-clock-special-range): Implement quarters.
+
+2010-12-11  Sébastien Vauban  <wxhgmqzgwmuf@spammotel.com>
+
+	* org.el (org-complete-tags-always-offer-all-agenda-tags): Fix
+	docstring.
+
+2010-12-11  Julien Danjou  <julien@danjou.info>
+
+	* org-agenda.el (org-format-agenda-item): Convert category to a string
+	if it is a symbol. This fixes the following call to
+	org-agenda-get-category-icon which fails if category is not a string.
+
+2010-12-11  Eric Schulte  <schulte.eric@gmail.com>
+
+	* ob-clojure.el: Updated requirements documentation to mention
+	the minimum version of Clojure.
+	(org-babel-expand-body:clojure): Fully qualified function name.
+
+2010-12-11  Nicolas Goaziou  <n.goaziou@gmail.com>
+
+	* org-latex.el (org-export-latex-lists): do not add an
+	unnecessary newline character after a list.
+
+	* org-list.el (org-list-bottom-point-with-indent): ensure bottom
+	point is just after a non blank line.
+
+2010-12-11  Eric Schulte  <schulte.eric@gmail.com>
+
+	* ob.el (org-babel-examplize-region): Remove old assertion which
+	no longer applies to the result insertion code.
+
+2010-12-11  Eric Schulte  <schulte.eric@gmail.com>
+
+	* ob-python.el (org-babel-execute:python): Use a :return header
+	argument for external evaluation in which the code block body need
+	be wrapped in a function
+
+2010-12-11  Eric Schulte  <schulte.eric@gmail.com>
+
+	* ob-clojure.el (org-babel-expand-body:clojure): Trapped free
+	variable.
+
+2010-12-11  Carsten Dominik  <carsten.dominik@gmail.com>
+
+	* org.el (org-edit-special): Edit formulas when in TBLMF line
+
+2010-12-11  Allen S. Rout  <asr@ufl.edu>  (tiny change)
+
+	* org-capture.el (org-capture-after-finalize-hook): New hook.
+	(org-capture-finalize): Run the new hook.
+
+2010-12-11  Eric Schulte  <schulte.eric@gmail.com>
+
+	* ob-clojure.el (org-babel-expand-body:clojure): Support for
+	pretty printing of Clojure code and data.
+
+2010-12-11  Eric Schulte  <schulte.eric@gmail.com>
+
+	* ob.el (org-babel-insert-result): No longer escape results which
+	will be wrapped in a block.
+
+2010-12-11  Eric Schulte  <schulte.eric@gmail.com>
+
+	* ob-eval.el (org-babel-eval-wipe-error-buffer): Fixed compiler
+	warning and added documentation string.
+
+2010-12-11  Eric Schulte  <schulte.eric@gmail.com>
+
+	* ob-clojure.el (org-babel-execute:clojure): Remade using slime
+	for all code evaluation.
+
+2010-12-11  Carsten Dominik  <carsten.dominik@gmail.com>
+
+	* org-beamer.el (org-beamer-sectioning): Allow overlay arguments for
+	the column as well.
+
+2010-12-11  Eric Schulte  <schulte.eric@gmail.com>
+
+	* ob.el (org-babel-confirm-evaluate): More descriptive message
+	when evaluation is aborted or disabled.
+
+2010-12-11  Eric Schulte  <schulte.eric@gmail.com>
+
+	* ob.el (org-babel-insert-result): Responds to new "wrap" header
+	argument.
+	(org-babel-merge-params): Includes new "wrap" header argument in
+	one of the results header argument exclusive groups.
+
+2010-12-11  David Maus  <dmaus@ictsoc.de>
+
+	* org-macs.el (with-silent-modifications): Fix condition for
+	with-silent-modification.
+
+2010-12-11  Eric Schulte  <schulte.eric@gmail.com>
+
+	* ob.el (org-babel-parse-header-arguments): Stripping trailing
+	spaces off of header arguments (even the first one).
+
+2010-12-11  Eric Schulte  <schulte.eric@gmail.com>
+
+	* ob-sh.el (org-babel-sh-var-to-sh): Wrap end token of heredoc in
+	single quotes which is the best practice.
+	(org-babel-sh-table-or-results): Use `org-babel-script-escape' for
+	more robust parsing of shell output.
+
+2010-12-11  Dan Davison  <dandavison7@gmail.com>
+
+	* org.el (org-additional-option-like-keywords): Add more keywords,
+	and colons to some old ones.
+
+2010-12-11  Dan Davison  <dandavison7@gmail.com>
+
+	* ob-eval.el (org-babel-error-buffer-name): Define new variable.
+
+2010-12-11  Eric Schulte  <schulte.eric@gmail.com>
+
+	* ob-python.el (org-babel-python-table-or-string): Using
+	`org-babel-script-escape' for reading string input from scripting
+	languages.
+
+2010-12-11  Achim Gratz  <Stromeko@nexgo.de>  (tiny change)
+
+	* org-macs.el (org-called-interactively-p): Wrap function call in
+	with-no-warnings.
+	(with-silent-modifications) Declare macro for Emacs < 23.2.
+
+2010-12-11  Eric Schulte  <schulte.eric@gmail.com>
+
+	* ob.el (org-babel-parse-header-arguments): Removed addition of
+	":" to singleton first header arguments as it was leading to errors.
+
+2010-12-11  Carsten Dominik  <carsten.dominik@gmail.com>
+
+	* org-latex.el (org-export-latex-make-header): Run the title through
+	`org-export-latex-fontify-headline'.
+	(org-export-latex-fontify-headline): Do the protection of math
+	snippets also here.
+
+2010-12-11  Richard Lawrence  <richard.lawrence@berkeley.edu>
+
+	* org-latex.el (org-export-as-latex): Sent the section title
+	through the preprocessor.
+
+2010-12-11  Carsten Dominik  <carsten.dominik@gmail.com>
+
+	* org-html.el (org-html-level-start): Mark listified headings
+	with a custom id.
+
+2010-12-11  Carsten Dominik  <carsten.dominik@gmail.com>
+
+	* org.el (org-open-at-point): Don't do footnote action if cursor is
+	on a bracket link.
+
+2010-12-11  Carsten Dominik  <carsten.dominik@gmail.com>
+
+	* org.el (org-edit-special): Check also for TBLFM line.
+
+2010-12-11  Achim Gratz  <Stromeko@Stromeko.DE>  (tiny change)
+
+	* org-clock.el (org-get-clocktable): previous patch incorrectly
+	required whitespace in front of #+BEGIN: and #+END:
+
+2010-12-11  Dan Davison  <dandavison7@gmail.com>
+
+	* org-src.el (org-edit-src-code): Allow region to be inherited by
+	edit buffer when mark is one character beyond end of src block.
+
+2010-12-11  Nicolas Goaziou  <n.goaziou@gmail.com>
+
+	* org-list.el (org-cycle-list-bullet): ensure point is at bol before
+	checking item indentation.
+
+2010-12-11  Eric Schulte  <schulte.eric@gmail.com>
+
+	* ob.el (org-babel-map-src-blocks): Moved to earlier in the file
+	and now autoloading.
+
+2010-12-11  Eric Schulte  <schulte.eric@gmail.com>
+
+	* ob-ref.el (org-babel-ref-at-ref-p): Use higher level function
+	for testing list membership.
+
+	* ob.el (org-babel-read-result): Use higher level function for
+	testing list membership.
+	(org-babel-result-end): Use higher level function for testing list
+	membership.
+
+2010-12-11  Eric Schulte  <schulte.eric@gmail.com>
+
+	* ob-sqlite.el (ob-eval): Require ob-eval for external command
+	execution.
+	(org-babel-execute:sqlite): No longer uses the init option for
+	passing commands to sqlite.
+
+2010-12-11  Nicolas Goaziou  <n.goaziou@gmail.com>
+
+	* org.el (org-indent-line-function): Drawers and blocks have no
+	influence on indentation of text below. Also fix indentation
+	problem with a block at column 0 and add a special case for
+	literal examples.
+
+2010-12-11  Eric Schulte  <schulte.eric@gmail.com>
+
+	* ob.el (org-babel-map-src-blocks): Ensure that the file argument
+	is only evaluated once.
+
+2010-12-11  Eric Schulte  <schulte.eric@gmail.com>
+
+	* ob-ref.el (org-babel-ref-resolve): Recognize `list' as a unique
+	type of data
+	(org-babel-ref-at-ref-p): Recognize `list' as a unique type of data
+
+2010-12-11  Eric Schulte  <schulte.eric@gmail.com>
+
+	* ob-tangle.el (org-babel-load-file): Can be called interactively.
+
+2010-12-11  Carsten Dominik  <carsten.dominik@gmail.com>  (tiny change)
+
+	* org-table.el (orgtbl-after-send-table-hook): New hook.
+	(orgtbl-ctrl-c-ctrl-c): Run `orgtbl-after-send-table-hook' when a
+	table was sent.
+	(orgtbl-send-table): Return the number of sent tables, or nil if no
+	sending has happened.
+
+2010-12-11  Carsten Dominik  <carsten.dominik@gmail.com>
+
+	* org.el (org-get-priority-function): New option.
+	(org-get-priority): Call `org-get-priority-function' if that
+	has been set.
+
+2010-12-11  Dan Davison  <dandavison7@gmail.com>
+
+	* ob-table.el (org-babel-table-truncate-at-newline): Only add
+	"..." if there is something after the newline.
+
+2010-12-11  Achim Gratz  <Stromeko@nexgo.de>  (tiny change)
+
+	* org-clock.el (org-get-clocktable):
+	(org-in-clocktable-p):
+	(org-clocktable-shift):
+	(org-clocktable-steps): Fix regexp to allow for indented clock tables
+
+2010-12-11  Puneeth Chaganti  <punchagan@gmail.com>
+
+	* org-exp.el (org-export-handle-include-files): Support :minlevel
+	property.
+	(org-get-file-contents): New argument minlevel to demote included
+	content.
+
+2010-12-11  Noorul Islam  <noorul@noorul.com>
+
+	* org-latex.el (org-export-latex-hyperref-format): New option.
+	(org-export-latex-href-format): Renamed the existing variable
+	`org-export-latex-hyperref-format' as `org-export-latex-href-format'
+	(org-export-latex-links): Use `org-export-latex-hyperref-format' and
+	`org-export-latex-href-format'
+
+2010-12-11  Eric Schulte  <schulte.eric@gmail.com>
+
+	* ob-calc.el (org-babel-execute:calc): Ensure the *Calculator*
+	buffer exists before it is used.
+
+2010-12-11  Nicolas Goaziou  <n.goaziou@gmail.com>
+
+	* org-exp.el (org-export-preprocess-string): delaying code block
+	processing a bit to allow correct list parsing in the export string
+
+2010-12-11  Christopher Allan Webber  <cwebber@dustycloud.org>
+
+	* org-agenda.el (org-agenda-timegrid-use-ampm): New option.
+	(org-agenda-time-of-day-to-ampm): New function.
+	(org-agenda-time-of-day-to-ampm-maybe): New function.
+	(org-format-agenda-item): Call org-agenda-time-of-day-to-ampm-maybe.
+
+2010-12-11  Carsten Dominik  <carsten.dominik@gmail.com>
+
+	* org-faces.el (org-cycle-level-faces): New option.
+
+	* org.el (org-get-level-face): Honor org-cycle-level-faces.
+
+2010-12-11  Julien Danjou  <julien@danjou.info>
+
+	* org-agenda.el (org-agenda-today): New function.
+	(org-agenda-get-day-face): New function.
+	(org-timeline): Use org-agenda-today and org-agenda-get-day-face.
+	(org-agenda-list): Use org-agenda-today and org-agenda-get-day-face.
+	(org-todo-list): Use org-agenda-today.
+	(org-get-all-dates): Use org-agenda-today.
+	(org-agenda-day-face-function): New variable.
+	(org-agenda-get-day-face): Use org-agenda-day-face-function.
+
+2010-12-11  Carsten Dominik  <carsten.dominik@gmail.com>
+
+	* org.el (org-ctrl-c-ctrl-c): Consider sending a radio table also
+	in Org.
+
+2010-12-11  Carsten Dominik  <carsten.dominik@gmail.com>
+
+	* org-html.el (org-export-as-html): Do not treat partially
+	protected lines as if they were fully protected.
+
+2010-12-11  Dan Davison  <dandavison7@gmail.com>
+
+	* org-exp.el (org-export-format-source-code-or-example):
+	Remove hard-wired configuration of minted export
+	(org-export-latex-minted-with-line-numbers): Remove variable
+
+2010-12-11  Bastien Guerry  <bzg@altern.org>
+
+	* org-clock.el (org-dblock-write:clocktable): Fix double
+	reference to `link' in let construct.
+	(org-clock-clocktable-formatter): Fix typo in docstring.
+	(org-clocktable-write-default): Fix typo in docstring.
+
+2010-12-11  David Maus  <dmaus@ictsoc.de>
+
+	* org-protocol.el (org-protocol-unhex-string): Normalize percent
+	escape sequence to upper case letters.
+
+2010-12-11  Eric Schulte  <schulte.eric@gmail.com>
+
+	* ob-lob.el (org-babel-lob-get-info): including pass-through
+	header arguments in results variable header argument string
+
+2010-12-11  David Maus  <dmaus@ictsoc.de>
+
+	* org-exp.el (org-export-visible): Limit search for in-buffer options
+	beginning of first headline.
+
+2010-12-11  David Maus  <dmaus@ictsoc.de>
+
+	* org.el (org-open-at-point): Remove stale link handler for news:
+	links.
+
+2010-12-11  Carsten Dominik  <carsten.dominik@gmail.com>
+
+	* org-clock.el (org-clocktable-write-default): Better handling of
+	narrowing.
+
+2010-12-11  Julien Danjou  <julien@danjou.info>
+
+	* org-agenda.el (org-agenda-category-icon-alist): Fix defcustom type.
+
+2010-12-11  Nicolas Goaziou  <n.goaziou@gmail.com>
+
+	* org.el (org-indent-line-function): simplify code and remove bug that
+	would insert a tab at the beginning of the line when trying to
+	indent the item.
+
+2010-12-11  Julien Danjou  <julien@danjou.info>
+
+	* org.el (org-diary-sexp-entry): Split sexp result strings at semicolon.
+
+2010-12-11  Julien Danjou  <julien@danjou.info>
+
+	* org-agenda.el (org-agenda-prefix-format): Insert place holder
+	for icon.
+	(org-agenda-category-icon-alist): New option.
+	(org-agenda-get-category-icon): New function.
+	(org-format-agenda-item): Support for icons.
+	(org-compile-prefix-format): Support for icons.
+
+2010-12-11  Julien Danjou  <julien@danjou.info>
+
+	* org-compat.el: Create defalias for `string-match-p' and
+	looking-at-p.
+
+2010-12-11  Eric Schulte  <schulte.eric@gmail.com>
+
+	* ob-calc.el (org-babel-execute:calc): support for variables --
+	converts :var variables in calc variables
+
+2010-12-11  Carsten Dominik  <carsten.dominik@gmail.com>
+
+	* org.el (org-sparse-tree): Mention [r] in dispatch menu
+
+2010-12-11  Carsten Dominik  <carsten.dominik@gmail.com>
+
+	* org-list.el (org-list-parse-list): Use `org-looking-at-p'.
+
+2010-12-11  Carsten Dominik  <carsten.dominik@gmail.com>
+
+	* org-id.el (org-id-store-link): Test for org-mode before checking
+	for IDs.
+
+2010-12-11  Carsten Dominik  <carsten.dominik@gmail.com>
+
+	* org.el (org-shorten-string): New function.
+
+	* org-exp.el (org-export-convert-protected-spaces): New function.
+	(org-export-preprocess-string): Call
+	`org-export-convert-protected-spaces' to handle new hard spaces.
+
+2010-12-11  David Maus  <dmaus@ictsoc.de>
+
+	* org.el (org-narrow-to-subtree): Check for heading that ends at end
+	of buffer.
+
 2010-11-12  Carsten Dominik  <carsten.dominik@gmail.com>
 
 	* org-capture.el (org-capture-templates): Remove autoload from
@@ -250,9 +905,9 @@
 
 2010-11-11  Carsten Dominik  <carsten.dominik@gmail.com>
 
-	* org-indent.el: (org-indent-add-properties): Use
-	`with-silent-modificaitons'.
-	(org-indent-remove-properties): Use `with-silent-modificaitons'.
+	* org-indent.el (org-indent-add-properties): Use
+	`with-silent-modificatons'.
+	(org-indent-remove-properties): Use `with-silent-modificatons'.
 
 2010-11-11  Carsten Dominik  <carsten.dominik@gmail.com>
 
--- a/lisp/org/ob-C.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/ob-C.el	Thu Dec 16 18:30:57 2010 -0500
@@ -5,7 +5,7 @@
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 
 ;; This file is part of GNU Emacs.
 
--- a/lisp/org/ob-R.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/ob-R.el	Thu Dec 16 18:30:57 2010 -0500
@@ -2,11 +2,10 @@
 
 ;; Copyright (C) 2009, 2010  Free Software Foundation, Inc.
 
-;; Author: Eric Schulte
-;;	Dan Davison
+;; Author: Eric Schulte, Dan Davison
 ;; Keywords: literate programming, reproducible research, R, statistics
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 
 ;; This file is part of GNU Emacs.
 
@@ -277,16 +276,18 @@
       (butlast
        (delq nil
 	     (mapcar
-	      (lambda (line) ;; cleanup extra prompts left in output
-		(if (string-match
-		     "^\\([ ]*[>+][ ]?\\)+\\([[0-9]+\\|[ ]\\)" line)
-		    (substring line (match-end 1))
-		  line))
-	      (org-babel-comint-with-output (session org-babel-R-eoe-output)
-		(insert (mapconcat #'org-babel-chomp
-				   (list body org-babel-R-eoe-indicator)
-				   "\n"))
-		(inferior-ess-send-input)))) 2) "\n"))))
+	      (lambda (line) (when (> (length line) 0) line))
+	      (mapcar
+	       (lambda (line) ;; cleanup extra prompts left in output
+		 (if (string-match
+		      "^\\([ ]*[>+][ ]?\\)+\\([[0-9]+\\|[ ]\\)" line)
+		     (substring line (match-end 1))
+		   line))
+	       (org-babel-comint-with-output (session org-babel-R-eoe-output)
+		 (insert (mapconcat #'org-babel-chomp
+				    (list body org-babel-R-eoe-indicator)
+				    "\n"))
+		 (inferior-ess-send-input)))))) "\n"))))
 
 (defun org-babel-R-process-value-result (result column-names-p)
   "R-specific processing of return value.
--- a/lisp/org/ob-asymptote.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/ob-asymptote.el	Thu Dec 16 18:30:57 2010 -0500
@@ -5,7 +5,7 @@
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 
 ;; This file is part of GNU Emacs.
 
--- a/lisp/org/ob-calc.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/ob-calc.el	Thu Dec 16 18:30:57 2010 -0500
@@ -1,11 +1,11 @@
 ;;; ob-calc.el --- org-babel functions for calc code evaluation
 
-;; Copyright (C) 2010  Free Software Foundation, Inc.
+;; Copyright (C) 2010  Free Software Foundation, Inc
 
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 
 ;; This file is part of GNU Emacs.
 
@@ -40,25 +40,55 @@
 
 (defun org-babel-execute:calc (body params)
   "Execute a block of calc code with Babel."
-  (mapcar
-   (lambda (line)
-     (when (> (length line) 0)
-       (if (string= "'" (substring line 0 1))
-	   (funcall (lookup-key calc-mode-map (substring line 1)) nil)
-	 (calc-push-list
-	  (list ((lambda (res)
-		   (cond
-		    ((numberp res) res)
-		    ((listp res) (error "calc error \"%s\" on input \"%s\""
-					(cadr res) line))
-		    (t res))
-		   (if (numberp res) res (math-read-number res)))
-		 (calc-eval line)))))))
-   (mapcar #'org-babel-trim
-	   (split-string (org-babel-expand-body:calc body params) "[\n\r]")))
+  (unless (get-buffer "*Calculator*")
+    (save-window-excursion (calc) (calc-quit)))
+  (let* ((vars (mapcar #'cdr (org-babel-get-header params :var)))
+	 (var-syms (mapcar #'car vars))
+	 (var-names (mapcar #'symbol-name var-syms)))
+    (mapc
+     (lambda (pair)
+       (calc-push-list (list (cdr pair)))
+       (calc-store-into (car pair)))
+     vars)
+    (mapc
+     (lambda (line)
+       (when (> (length line) 0)
+	 (cond
+	  ;; simple variable name
+	  ((member line var-names) (calc-recall (intern line)))
+	  ;; stack operation
+	  ((string= "'" (substring line 0 1))
+	   (funcall (lookup-key calc-mode-map (substring line 1)) nil))
+	  ;; complex expression
+	  (t
+	   (calc-push-list
+	    (list ((lambda (res)
+		     (cond
+		      ((numberp res) res)
+		      ((math-read-number res) (math-read-number res))
+		      ((listp res) (error "calc error \"%s\" on input \"%s\""
+					  (cadr res) line))
+		      (t (calc-eval
+			  (math-evaluate-expr
+			   ;; resolve user variables, calc built in
+			   ;; variables are handled automatically
+			   ;; upstream by calc
+			   (mapcar (lambda (el)
+				     (if (and (consp el) (equal 'var (car el))
+					      (member (cadr el) var-syms))
+					 (progn
+					   (calc-recall (cadr el))
+					   (prog1 (calc-top 1)
+					     (calc-pop 1)))
+				       el))
+				   ;; parse line into calc objects
+				   (car (math-read-exprs line))))))))
+		   (calc-eval line))))))))
+     (mapcar #'org-babel-trim
+	     (split-string (org-babel-expand-body:calc body params) "[\n\r]"))))
   (save-excursion
-    (set-buffer (get-buffer "*Calculator*"))
-    (calc-eval (calc-top 1))))
+    (with-current-buffer (get-buffer "*Calculator*")
+      (calc-eval (calc-top 1)))))
 
 (provide 'ob-calc)
 
--- a/lisp/org/ob-clojure.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/ob-clojure.el	Thu Dec 16 18:30:57 2010 -0500
@@ -2,10 +2,10 @@
 
 ;; Copyright (C) 2009, 2010  Free Software Foundation, Inc.
 
-;; Author: Joel Boehland
+;; Author: Joel Boehland, Eric Schulte
 ;; Keywords: literate programming, reproducible research
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 
 ;; This file is part of GNU Emacs.
 
@@ -24,14 +24,14 @@
 
 ;;; Commentary:
 
-;;; ob support for evaluating clojure code
+;;; support for evaluating clojure code, relies on slime for all eval
 
 ;;; Requirements:
 
-;;; A working clojure install. This also implies a working java executable
-;;; clojure-mode
-;;; slime
-;;; swank-clojure
+;;; - clojure (at least 1.2.0)
+;;; - clojure-mode
+;;; - slime
+;;; - swank-clojure
 
 ;;; By far, the best way to install these components is by following
 ;;; the directions as set out by Phil Hagelberg (Technomancy) on the
@@ -39,277 +39,47 @@
 
 ;;; Code:
 (require 'ob)
-(require 'ob-eval)
-(eval-when-compile (require 'cl))
 
-(declare-function slime-eval-async "ext:slime" (sexp &optional cont package))
 (declare-function slime-eval "ext:slime" (sexp &optional package))
-(declare-function swank-clojure-concat-paths "ext:slime" (paths))
-(declare-function slime "ext:slime" (&optional command coding-system))
-(declare-function slime-output-buffer "ext:slime" (&optional noprompt))
-(declare-function slime-filter-buffers "ext:slime" (predicate))
 
 (add-to-list 'org-babel-tangle-lang-exts '("clojure" . "clj"))
 
 (defvar org-babel-default-header-args:clojure '())
-
-(defvar org-babel-clojure-wrapper-method
-  "
-(defn spit
-  [f content]
-  (with-open [#^java.io.PrintWriter w
-                 (java.io.PrintWriter.
-                   (java.io.BufferedWriter.
-                     (java.io.OutputStreamWriter.
-                       (java.io.FileOutputStream.
-                         (java.io.File. f)))))]
-      (.print w content)))
-
-(defn main
-  []
-  %s)
-
-(spit \"%s\" (str (main)))")
-;;";; <-- syntax highlighting is messed without this double quote
-
-;;taken mostly from clojure-test-mode.el
-(defun org-babel-clojure-clojure-slime-eval (string &optional handler)
-  "Evaluate a STRING of clojure code using `slime-eval-async'."
-  (slime-eval-async `(swank:eval-and-grab-output ,string)
-                    (or handler #'identity)))
-
-(defun org-babel-clojure-slime-eval-sync (string)
-  "Evaluate a STRING of clojure code using `slime-eval'."
-  (slime-eval `(swank:eval-and-grab-output ,string)))
-
-;;taken from swank-clojure.el
-(defvar swank-clojure-binary)
-(defvar swank-clojure-classpath)
-(defvar swank-clojure-java-path)
-(defvar swank-clojure-extra-vm-args)
-(defvar swank-clojure-library-paths)
-(defvar swank-clojure-extra-classpaths)
-(defun org-babel-clojure-babel-clojure-cmd ()
-  "Create the command to start clojure according to current settings."
-  (or (when swank-clojure-binary
-	(if (listp swank-clojure-binary)
-	    swank-clojure-binary
-	  (list swank-clojure-binary)))
-      (when swank-clojure-classpath
-	(delq
-	 nil
-	 (append
-	  (list swank-clojure-java-path)
-	  swank-clojure-extra-vm-args
-	  (list
-	   (when swank-clojure-library-paths
-	     (concat "-Djava.library.path="
-		     (swank-clojure-concat-paths swank-clojure-library-paths)))
-	   "-classpath"
-	   (swank-clojure-concat-paths
-	    (append
-	     swank-clojure-classpath
-	     swank-clojure-extra-classpaths))
-	   "clojure.main"))))
-      (error "%s" (concat "You must specifiy either a `swank-clojure-binary' "
-			  "or a `swank-clojure-classpath'"))))
-
-(defun org-babel-clojure-table-or-string (results)
-  "Convert RESULTS to an elisp value.
-If RESULTS looks like a table, then convert to an Emacs-lisp
-table, otherwise return the results as a string."
-  (org-babel-read
-   (if (string-match "^\\[.+\\]$" results)
-       (org-babel-read
-        (concat "'"
-                (replace-regexp-in-string
-                 "\\[" "(" (replace-regexp-in-string
-                            "\\]" ")" (replace-regexp-in-string
-                                       ", " " " (replace-regexp-in-string
-                                                 "'" "\"" results))))))
-     results)))
-
-(defun org-babel-clojure-var-to-clojure (var)
-  "Convert an elisp value into a clojure variable.
-The elisp value VAR is converted into a string of clojure source
-code specifying a variable of the same value."
-  (if (listp var)
-      (format "'%s" var)
-    (format "%S" var)))
-
-(defun org-babel-clojure-build-full-form (body vars)
-  "Construct a clojure let form with VARS as the let variables."
-  (let ((vars-forms
-	 (mapconcat ;; define any variables
-	  (lambda (pair)
-	    (format "%s %s"
-		    (car pair) (org-babel-clojure-var-to-clojure (cdr pair))))
-	  vars "\n      "))
-	(body (org-babel-trim body)))
-    (if (> (length vars-forms) 0)
-	(format "(let [%s]\n  %s)" vars-forms body)
-      body)))
-
-(defun org-babel-prep-session:clojure (session params)
-  "Prepare SESSION according to the header arguments specified in PARAMS."
-  (require 'slime) (require 'swank-clojure)
-  (let* ((session-buf (org-babel-clojure-initiate-session session))
-         (vars (mapcar #'cdr (org-babel-get-header params :var)))
-         (var-lines (mapcar ;; define any top level session variables
-                     (lambda (pair)
-                       (format "(def %s %s)\n" (car pair)
-                               (org-babel-clojure-var-to-clojure (cdr pair))))
-                     vars)))
-    session-buf))
-
-(defun org-babel-load-session:clojure (session body params)
-  "Load BODY into SESSION."
-  (require 'slime) (require 'swank-clojure)
-  (save-window-excursion
-    (let ((buffer (org-babel-prep-session:clojure session params)))
-      (with-current-buffer buffer
-        (goto-char (point-max))
-        (insert (org-babel-chomp body)))
-      buffer)))
-
-(defvar org-babel-clojure-buffers '())
-(defvar org-babel-clojure-pending-sessions '())
-
-(defun org-babel-clojure-session-buffer (session)
-  "Return the buffer associated with SESSION."
-  (cdr (assoc session org-babel-clojure-buffers)))
-
-(defun org-babel-clojure-initiate-session-by-key (&optional session)
-  "Initiate a clojure session in an inferior-process-buffer.
-If there is not a current inferior-process-buffer in SESSION
-then create one.  Return the initialized session."
-  (save-window-excursion
-    (let* ((session (if session
-                        (if (stringp session) (intern session)
-                          session)
-		      :default))
-           (clojure-buffer (org-babel-clojure-session-buffer session)))
-      (unless (and clojure-buffer (buffer-live-p clojure-buffer))
-        (setq org-babel-clojure-buffers
-	      (assq-delete-all session org-babel-clojure-buffers))
-        (push session org-babel-clojure-pending-sessions)
-        (slime)
-        ;; we are waiting to finish setting up which will be done in
-        ;; org-babel-clojure-session-connected-hook below.
-        (let ((timeout 9))
-          (while (and (not (org-babel-clojure-session-buffer session))
-                      (< 0 timeout))
-            (message "Waiting for clojure repl for session: %s ... %i"
-		     session timeout)
-            (sit-for 1)
-            (decf timeout)))
-        (setq org-babel-clojure-pending-sessions
-              (remove session org-babel-clojure-pending-sessions))
-        (unless (org-babel-clojure-session-buffer session)
-          (error "Couldn't create slime clojure process"))
-        (setq clojure-buffer (org-babel-clojure-session-buffer session)))
-      session)))
-
-(defun org-babel-clojure-initiate-session (&optional session params)
-  "Return the slime-clojure repl buffer bound to SESSION.
-Returns nil if \"none\" is specified."
-  (require 'slime) (require 'swank-clojure)
-  (unless (and (stringp session) (string= session "none"))
-    (org-babel-clojure-session-buffer
-     (org-babel-clojure-initiate-session-by-key session))))
-
-(defun org-babel-clojure-session-connected-hook ()
-  "Finish  binding an org-babel session to a slime-clojure repl."
-  (let ((pending-session (pop org-babel-clojure-pending-sessions)))
-    (when pending-session
-      (save-excursion
-        (switch-to-buffer (slime-output-buffer))
-        (rename-buffer
-	 (if (stringp pending-session)
-	     pending-session (symbol-name pending-session)))
-        (org-babel-clojure-bind-session-to-repl-buffer
-	 pending-session (slime-output-buffer))))))
-
-(add-hook 'slime-connected-hook 'org-babel-clojure-session-connected-hook)
-
-(defun org-babel-clojure-bind-session-to-repl-buffer (session repl-buffer)
-  "Associate SESSION with REPL-BUFFER."
-  (when (stringp session) (setq session (intern session)))
-  (setq org-babel-clojure-buffers
-        (cons (cons session repl-buffer)
-              (assq-delete-all session org-babel-clojure-buffers))))
-
-(defun org-babel-clojure-repl-buffer-pred ()
-  "Test whether the current buffer is an active slime-clojure
-repl buffer."
-  (and (buffer-live-p (current-buffer)) (eq major-mode 'slime-repl-mode)))
-
-(defun org-babel-clojure-bind-session-to-repl (session)
-  "Bind SESSION to a clojure repl."
-  (interactive "sEnter session name: ")
-  (let ((repl-bufs (slime-filter-buffers 'org-babel-clojure-repl-buffer-pred)))
-    (unless repl-bufs (error "No existing slime-clojure repl buffers exist"))
-    (let ((repl-buf (read-buffer "Choose slime-clojure repl: " repl-bufs t)))
-      (org-babel-clojure-bind-session-to-repl-buffer session repl-buf))))
-
-(defun org-babel-clojure-evaluate-external-process
-  (buffer body &optional result-type)
-  "Evaluate the body in an external process."
-  (let ((cmd (format "%s -" (mapconcat #'identity
-				       (org-babel-clojure-babel-clojure-cmd)
-				       " "))))
-    (case result-type
-      (output (org-babel-eval cmd body))
-      (value (let* ((tmp-file (org-babel-temp-file "clojure-")))
-	       (org-babel-eval
-		cmd
-		(format
-		 org-babel-clojure-wrapper-method
-		 body
-		 (org-babel-process-file-name tmp-file 'noquote)))
-	       (org-babel-clojure-table-or-string
-		(org-babel-eval-read-file tmp-file)))))))
-
-(defun org-babel-clojure-evaluate-session (buffer body &optional result-type)
-  "Evaluate the body in the context of a clojure session."
-  (require 'slime) (require 'swank-clojure)
-  (let ((raw nil)
-        (results nil))
-    (with-current-buffer buffer
-      (setq raw (org-babel-clojure-slime-eval-sync body))
-      (setq results (reverse (mapcar #'org-babel-trim raw)))
-      (cond
-       ((equal result-type 'output)
-	(mapconcat #'identity (reverse (cdr results)) "\n"))
-       ((equal result-type 'value)
-	(org-babel-clojure-table-or-string (car results)))))))
-
-(defun org-babel-clojure-evaluate (buffer body &optional result-type)
-  "Pass BODY to the Clojure process in BUFFER.
-If RESULT-TYPE equals 'output then return a list of the outputs
-of the statements in BODY, if RESULT-TYPE equals 'value then
-return the value of the last statement in BODY as elisp."
-  (if buffer
-      (org-babel-clojure-evaluate-session buffer body result-type)
-    (org-babel-clojure-evaluate-external-process buffer body result-type)))
+(defvar org-babel-header-arg-names:clojure '(package))
 
 (defun org-babel-expand-body:clojure (body params)
   "Expand BODY according to PARAMS, return the expanded body."
-  (org-babel-clojure-build-full-form
-   body (mapcar #'cdr (org-babel-get-header params :var))))
+  (let* ((vars (mapcar #'cdr (org-babel-get-header params :var)))
+	 (result-params (cdr (assoc :result-params params)))
+	 (print-level nil) (print-length nil)
+	 (body (org-babel-trim
+		(if (> (length vars) 0)
+		    (concat "(let ["
+			    (mapconcat
+			     (lambda (var)
+			       (format "%S (quote %S)" (car var) (cdr var)))
+			     vars "\n      ")
+			    "]\n" body ")")
+		  body))))
+    (if (or (member "code" result-params)
+	    (member "pp" result-params))
+	(format (concat "(let [org-mode-print-catcher (java.io.StringWriter.)]"
+			"(clojure.pprint/with-pprint-dispatch %s-dispatch"
+			"(clojure.pprint/pprint %s org-mode-print-catcher)"
+			"(str org-mode-print-catcher)))")
+		(if (member "code" result-params) "code" "simple") body)
+      body)))
 
 (defun org-babel-execute:clojure (body params)
-  "Execute a block of Clojure code."
+  "Execute a block of Clojure code with Babel."
   (require 'slime) (require 'swank-clojure)
-  (let* ((body (org-babel-expand-body:clojure body params))
-         (session (org-babel-clojure-initiate-session
-		   (cdr (assoc :session params)))))
-    (org-babel-reassemble-table
-     (org-babel-clojure-evaluate session body (cdr (assoc :result-type params)))
-     (org-babel-pick-name
-      (cdr (assoc :colname-names params)) (cdr (assoc :colnames params)))
-     (org-babel-pick-name
-      (cdr (assoc :rowname-names params)) (cdr (assoc :rownames params))))))
+  (with-temp-buffer
+    (insert (org-babel-expand-body:clojure body params))
+    (read
+     (slime-eval
+      `(swank:interactive-eval-region
+        ,(buffer-substring-no-properties (point-min) (point-max)))
+      (cdr (assoc :package params))))))
 
 (provide 'ob-clojure)
 
--- a/lisp/org/ob-comint.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/ob-comint.el	Thu Dec 16 18:30:57 2010 -0500
@@ -5,7 +5,7 @@
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research, comint
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 
 ;; This file is part of GNU Emacs.
 
--- a/lisp/org/ob-css.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/ob-css.el	Thu Dec 16 18:30:57 2010 -0500
@@ -5,7 +5,7 @@
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 
 ;; This file is part of GNU Emacs.
 
--- a/lisp/org/ob-ditaa.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/ob-ditaa.el	Thu Dec 16 18:30:57 2010 -0500
@@ -5,7 +5,7 @@
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 
 ;; This file is part of GNU Emacs.
 
--- a/lisp/org/ob-dot.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/ob-dot.el	Thu Dec 16 18:30:57 2010 -0500
@@ -5,7 +5,7 @@
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 
 ;; This file is part of GNU Emacs.
 
--- a/lisp/org/ob-emacs-lisp.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/ob-emacs-lisp.el	Thu Dec 16 18:30:57 2010 -0500
@@ -1,11 +1,11 @@
 ;;; ob-emacs-lisp.el --- org-babel functions for emacs-lisp code evaluation
 
-;; Copyright (C) 2009, 2010  Free Software Foundation, Inc.
+;; Copyright (C) 2009, 2010  Free Software Foundation, Inc
 
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 
 ;; This file is part of GNU Emacs.
 
--- a/lisp/org/ob-eval.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/ob-eval.el	Thu Dec 16 18:30:57 2010 -0500
@@ -5,7 +5,7 @@
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research, comint
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 
 ;; This file is part of GNU Emacs.
 
@@ -28,12 +28,13 @@
 ;; shell commands.
 
 ;;; Code:
-(require 'ob)
 (eval-when-compile (require 'cl))
 
+(defvar org-babel-error-buffer-name "*Org-Babel Error Output*")
+
 (defun org-babel-eval-error-notify (exit-code stderr)
   "Open a buffer to display STDERR and a message with the value of EXIT-CODE."
-  (let ((buf (get-buffer-create "*Org-Babel Error Output*")))
+  (let ((buf (get-buffer-create org-babel-error-buffer-name)))
     (with-current-buffer buf
       (goto-char (point-max))
       (save-excursion (insert stderr)))
@@ -44,7 +45,7 @@
   "Run CMD on BODY.
 If CMD succeeds then return its results, otherwise display
 STDERR with `org-babel-eval-error-notify'."
-  (let ((err-buff (get-buffer-create "*Org-Babel Error*")) exit-code)
+  (let ((err-buff (get-buffer-create " *Org-Babel Error*")) exit-code)
     (with-current-buffer err-buff (erase-buffer))
     (with-temp-buffer
       (insert body)
@@ -138,9 +139,9 @@
 	 (if error-buffer
 	     (make-temp-file
 	      (expand-file-name "scor"
-				(or (unless (featurep 'xemacs)
-				      small-temporary-file-directory)
-				    temporary-file-directory)))
+                                (if (featurep 'xemacs)
+                                    (temp-directory)
+                                  temporary-file-directory)))
 	   nil))
 	exit-status)
     (if (or replace
@@ -247,6 +248,13 @@
       (delete-file error-file))
     exit-status))
 
+(defun org-babel-eval-wipe-error-buffer ()
+  "Delete the contents of the Org code block error buffer.
+This buffer is named by `org-babel-error-buffer-name'."
+  (when (get-buffer org-babel-error-buffer-name)
+    (with-current-buffer org-babel-error-buffer-name
+      (delete-region (point-min) (point-max)))))
+
 (provide 'ob-eval)
 
 ;; arch-tag: 5328b17f-957d-42d9-94da-a2952682d04d
--- a/lisp/org/ob-exp.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/ob-exp.el	Thu Dec 16 18:30:57 2010 -0500
@@ -5,7 +5,7 @@
 ;; Author: Eric Schulte, Dan Davison
 ;; Keywords: literate programming, reproducible research
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 
 ;; This file is part of GNU Emacs.
 
@@ -39,8 +39,7 @@
 (defvar org-babel-lob-one-liner-regexp)
 (defvar org-babel-ref-split-regexp)
 (declare-function org-babel-lob-get-info "ob-lob" ())
-(declare-function org-babel-ref-literal "ob-ref" (ref))
-
+(declare-function org-babel-eval-wipe-error-buffer "ob-eval" ())
 (add-to-list 'org-export-interblocks '(src org-babel-exp-inline-src-blocks))
 (add-to-list 'org-export-interblocks '(lob org-babel-exp-lob-one-liners))
 (add-hook 'org-export-blocks-postblock-hook 'org-exp-res/src-name-cleanup)
@@ -289,6 +288,7 @@
 			   (org-babel-process-params (nth 2 info))))
        ;; skip code blocks which we can't evaluate
        (when (fboundp (intern (concat "org-babel-execute:" lang)))
+	 (org-babel-eval-wipe-error-buffer)
 	 (if (equal type 'inline)
 	     (let ((raw (org-babel-execute-src-block
 			 nil info '((:results . "silent"))))
--- a/lisp/org/ob-gnuplot.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/ob-gnuplot.el	Thu Dec 16 18:30:57 2010 -0500
@@ -5,7 +5,7 @@
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 
 ;; This file is part of GNU Emacs.
 
--- a/lisp/org/ob-haskell.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/ob-haskell.el	Thu Dec 16 18:30:57 2010 -0500
@@ -5,7 +5,7 @@
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 
 ;; This file is part of GNU Emacs.
 
@@ -136,16 +136,7 @@
   "Convert RESULTS to an Emacs-lisp table or string.
 If RESULTS look like a table, then convert them into an
 Emacs-lisp table, otherwise return the results as a string."
-  (org-babel-read
-   (if (and (stringp results) (string-match "^\\[.+\\]$" results))
-       (org-babel-read
-        (concat "'"
-                (replace-regexp-in-string
-                 "\\[" "(" (replace-regexp-in-string
-                            "\\]" ")" (replace-regexp-in-string
-                                       "," " " (replace-regexp-in-string
-                                                "'" "\"" results))))))
-     results)))
+  (org-babel-script-escape results))
 
 (defun org-babel-haskell-var-to-haskell (var)
   "Convert an elisp value VAR into a haskell variable.
--- a/lisp/org/ob-js.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/ob-js.el	Thu Dec 16 18:30:57 2010 -0500
@@ -1,26 +1,28 @@
 ;;; ob-js.el --- org-babel functions for Javascript
 
-;; Copyright (C) 2010 Free Software Foundation, Inc.
+;; Copyright (C) 2010 Free Software Foundation
 
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research, js
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 
-;; This file is part of GNU Emacs.
+;;; License:
 
-;; GNU Emacs is free software: you can redistribute it and/or modify
+;; 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 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
+;; the Free Software Foundation; either version 3, 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.  If not, see <http://www.gnu.org/licenses/>.
+;; 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:
 
@@ -33,7 +35,7 @@
 
 ;; - a non-browser javascript engine such as node.js http://nodejs.org/
 ;;   or mozrepl http://wiki.github.com/bard/mozrepl/
-;;
+;; 
 ;; - for session based evaluation mozrepl and moz.el are required see
 ;;   http://wiki.github.com/bard/mozrepl/emacs-integration for
 ;;   configuration instructions
--- a/lisp/org/ob-keys.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/ob-keys.el	Thu Dec 16 18:30:57 2010 -0500
@@ -5,7 +5,7 @@
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 
 ;; This file is part of GNU Emacs.
 
--- a/lisp/org/ob-latex.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/ob-latex.el	Thu Dec 16 18:30:57 2010 -0500
@@ -5,7 +5,7 @@
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 
 ;; This file is part of GNU Emacs.
 
--- a/lisp/org/ob-ledger.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/ob-ledger.el	Thu Dec 16 18:30:57 2010 -0500
@@ -5,7 +5,7 @@
 ;; Author: Eric S Fraga
 ;; Keywords: literate programming, reproducible research, accounting
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 
 ;; This file is part of GNU Emacs.
 
--- a/lisp/org/ob-lisp.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/ob-lisp.el	Thu Dec 16 18:30:57 2010 -0500
@@ -1,27 +1,28 @@
 ;;; ob-lisp.el --- org-babel functions for Common Lisp
 
-;; Copyright (C) 2010  Free Software Foundation, Inc.
+;; Copyright (C) 2010 Free Software Foundation
 
-;; Author: David T. O'Toole <dto@gnu.org>
-;;	Eric Schulte
+;; Author: David T. O'Toole <dto@gnu.org>, Eric Schulte
 ;; Keywords: literate programming, reproducible research, lisp
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 
-;; This file is part of GNU Emacs.
+;;; License:
 
-;; GNU Emacs is free software: you can redistribute it and/or modify
+;; 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 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
+;; the Free Software Foundation; either version 3, 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.  If not, see <http://www.gnu.org/licenses/>.
+;; 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:
 
@@ -40,16 +41,18 @@
 (require 'ob-ref)
 (require 'ob-comint)
 (require 'ob-eval)
-(declare-function slime-eval "ext:slime" (form))
+
+(declare-function slime-eval "ext:slime" (sexp &optional package))
+(declare-function slime-process "ext:slime" (&optional connection))
 (declare-function slime-connected-p "ext:slime" ())
-(declare-function slime-process "ext:slime" ())
-(require 'slime nil 'noerror)
 
 (defvar org-babel-default-header-args:lisp '()
   "Default header arguments for lisp code blocks.")
 
 (defcustom org-babel-lisp-cmd "sbcl --script"
-  "Name of command used to evaluate lisp blocks.")
+  "Name of command used to evaluate lisp blocks."
+  :group 'org-babel
+  :type 'string)
 
 (defun org-babel-expand-body:lisp (body params)
   "Expand BODY according to PARAMS, return the expanded body."
@@ -65,6 +68,7 @@
 (defun org-babel-execute:lisp (body params)
   "Execute a block of Lisp code with org-babel.
 This function is called by `org-babel-execute-src-block'"
+  (require 'slime)
   (message "executing Lisp source code block")
   (let* ((session (org-babel-lisp-initiate-session
 		   (cdr (assoc :session params))))
@@ -96,6 +100,7 @@
 (defun org-babel-lisp-initiate-session (&optional session)
   "If there is not a current inferior-process-buffer in SESSION
 then create.  Return the initialized session."
+  (require 'slime)
   (unless (string= session "none")
     (save-window-excursion
       (or (slime-connected-p)
--- a/lisp/org/ob-lob.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/ob-lob.el	Thu Dec 16 18:30:57 2010 -0500
@@ -2,11 +2,10 @@
 
 ;; Copyright (C) 2009, 2010  Free Software Foundation, Inc.
 
-;; Author: Eric Schulte
-;;	Dan Davison
+;; Author: Eric Schulte, Dan Davison
 ;; Keywords: literate programming, reproducible research
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 
 ;; This file is part of GNU Emacs.
 
@@ -26,7 +25,7 @@
 ;;; Commentary:
 
 ;; See the online documentation for more information
-;;
+;; 
 ;;   http://orgmode.org/worg/org-contrib/babel/
 
 ;;; Code:
@@ -72,7 +71,8 @@
   (concat
    "^\\([ \t]*\\)#\\+\\(?:"
    (mapconcat #'regexp-quote org-babel-lob-call-aliases "\\|")
-   "\\):[ \t]+\\([^\(\)\n]+\\)\(\\([^\n]*\\)\)\\(\\[.+\\]\\|\\)[ \t]*\\([^\n]*\\)")
+   "\\):[ \t]+\\([^\(\)\n]+?\\)\\(\\[\\(.*\\)\\]\\|\\(\\)\\)"
+   "\(\\([^\n]*\\)\)\\(\\[.+\\]\\|\\)[ \t]*\\([^\n]*\\)")
   "Regexp to match calls to predefined source block functions.")
 
 ;; functions for executing lob one-liners
@@ -93,13 +93,16 @@
       (beginning-of-line 1)
       (if (looking-at org-babel-lob-one-liner-regexp)
           (append
-	   (mapcar #'org-babel-clean-text-properties
+	   (mapcar #'org-babel-clean-text-properties 
 		   (list
-		    (format "%s(%s)%s"
-			    (match-string 2) (match-string 3) (match-string 4))
-		    (match-string 5)))
+		    (format "%s%s(%s)%s"
+			    (match-string 2)
+			    (if (match-string 4)
+				(concat "[" (match-string 4) "]") "")
+			    (or (match-string 6) "") (match-string 7))
+		    (match-string 8)))
 	   (list (length (match-string 1))))))))
-
+  
 (defun org-babel-lob-execute (info)
   "Execute the lob call specified by INFO."
   (let ((params (org-babel-process-params
--- a/lisp/org/ob-matlab.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/ob-matlab.el	Thu Dec 16 18:30:57 2010 -0500
@@ -5,7 +5,7 @@
 ;; Author: Dan Davison
 ;; Keywords: literate programming, reproducible research
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 
 ;; This file is part of GNU Emacs.
 
--- a/lisp/org/ob-mscgen.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/ob-mscgen.el	Thu Dec 16 18:30:57 2010 -0500
@@ -5,7 +5,7 @@
 ;; Author: Juan Pechiar
 ;; Keywords: literate programming, reproducible research
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 
 ;; This file is part of GNU Emacs.
 
--- a/lisp/org/ob-ocaml.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/ob-ocaml.el	Thu Dec 16 18:30:57 2010 -0500
@@ -5,7 +5,7 @@
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 
 ;; This file is part of GNU Emacs.
 
--- a/lisp/org/ob-octave.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/ob-octave.el	Thu Dec 16 18:30:57 2010 -0500
@@ -5,7 +5,7 @@
 ;; Author: Dan Davison
 ;; Keywords: literate programming, reproducible research
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 
 ;; This file is part of GNU Emacs.
 
--- a/lisp/org/ob-org.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/ob-org.el	Thu Dec 16 18:30:57 2010 -0500
@@ -5,7 +5,7 @@
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 
 ;; This file is part of GNU Emacs.
 
--- a/lisp/org/ob-perl.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/ob-perl.el	Thu Dec 16 18:30:57 2010 -0500
@@ -1,12 +1,11 @@
 ;;; ob-perl.el --- org-babel functions for perl evaluation
 
-;; Copyright (C) 2009, 2010  Free Software Foundation, Inc.
+;; Copyright (C) 2009, 2010  Free Software Foundation
 
-;; Author: Dan Davison
-;;	Eric Schulte
+;; Author: Dan Davison, Eric Schulte
 ;; Keywords: literate programming, reproducible research
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 
 ;; This file is part of GNU Emacs.
 
--- a/lisp/org/ob-plantuml.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/ob-plantuml.el	Thu Dec 16 18:30:57 2010 -0500
@@ -5,7 +5,7 @@
 ;; Author: Zhang Weize
 ;; Keywords: literate programming, reproducible research
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 
 ;; This file is part of GNU Emacs.
 
--- a/lisp/org/ob-python.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/ob-python.el	Thu Dec 16 18:30:57 2010 -0500
@@ -1,12 +1,11 @@
 ;;; ob-python.el --- org-babel functions for python evaluation
 
-;; Copyright (C) 2009, 2010  Free Software Foundation, Inc.
+;; Copyright (C) 2009, 2010  Free Software Foundation
 
-;; Author: Eric Schulte
-;;	Dan Davison
+;; Author: Eric Schulte, Dan Davison
 ;; Keywords: literate programming, reproducible research
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 
 ;; This file is part of GNU Emacs.
 
@@ -57,11 +56,15 @@
 		   (cdr (assoc :session params))))
          (result-params (cdr (assoc :result-params params)))
          (result-type (cdr (assoc :result-type params)))
+	 (return-val (when (and (eq result-type 'value) (not session))
+		       (cdr (assoc :return params))))
+	 (preamble (cdr (assoc :preamble params)))
          (full-body
 	  (org-babel-expand-body:generic
-	   body params (org-babel-variable-assignments:python params)))
+	   (concat body (if return-val (format "return %s" return-val) ""))
+	   params (org-babel-variable-assignments:python params)))
          (result (org-babel-python-evaluate
-		  session full-body result-type result-params)))
+		  session full-body result-type result-params preamble)))
     (or (cdr (assoc :file params))
         (org-babel-reassemble-table
          result
@@ -118,20 +121,7 @@
   "Convert RESULTS into an appropriate elisp value.
 If the results look like a list or tuple, then convert them into an
 Emacs-lisp table, otherwise return the results as a string."
-  ((lambda (res)
-     (if (listp res)
-	 (mapcar (lambda (el) (if (equal el 'None) 'hline el)) res)
-       res))
-   (org-babel-read
-    (if (and (stringp results) (string-match "^[([].+[])]$" results))
-       (org-babel-read
-        (concat "'"
-                (replace-regexp-in-string
-                 "\\[" "(" (replace-regexp-in-string
-                            "\\]" ")" (replace-regexp-in-string
-                                       ", " " " (replace-regexp-in-string
-                                                 "'" "\"" results t))))))
-     results))))
+  (org-babel-script-escape results))
 
 (defvar org-babel-python-buffers '((:default . nil)))
 
@@ -192,35 +182,38 @@
 open('%s', 'w').write( pprint.pformat(main()) )")
 
 (defun org-babel-python-evaluate
-  (session body &optional result-type result-params)
+  (session body &optional result-type result-params preamble)
   "Evaluate BODY as python code."
   (if session
       (org-babel-python-evaluate-session
        session body result-type result-params)
     (org-babel-python-evaluate-external-process
-     body result-type result-params)))
+     body result-type result-params preamble)))
 
 (defun org-babel-python-evaluate-external-process
-  (body &optional result-type result-params)
+  (body &optional result-type result-params preamble)
   "Evaluate BODY in external python process.
 If RESULT-TYPE equals 'output then return standard output as a
 string. If RESULT-TYPE equals 'value then return the value of the
 last statement in BODY, as elisp."
   (case result-type
-    (output (org-babel-eval org-babel-python-command body))
+    (output (org-babel-eval org-babel-python-command
+			    (concat (if preamble (concat preamble "\n") "") body)))
     (value (let ((tmp-file (org-babel-temp-file "python-")))
 	     (org-babel-eval org-babel-python-command
-			     (format
-			      (if (member "pp" result-params)
-				  org-babel-python-pp-wrapper-method
-				org-babel-python-wrapper-method)
-			      (mapconcat
-			       (lambda (line) (format "\t%s" line))
-			       (split-string
-				(org-remove-indentation
-				 (org-babel-trim body))
-				"[\r\n]") "\n")
-			      (org-babel-process-file-name tmp-file 'noquote)))
+			     (concat
+			      (if preamble (concat preamble "\n") "")
+			      (format
+			       (if (member "pp" result-params)
+				   org-babel-python-pp-wrapper-method
+				 org-babel-python-wrapper-method)
+			       (mapconcat
+				(lambda (line) (format "\t%s" line))
+				(split-string
+				 (org-remove-indentation
+				  (org-babel-trim body))
+				 "[\r\n]") "\n")
+			       (org-babel-process-file-name tmp-file 'noquote))))
 	     ((lambda (raw)
 		(if (or (member "code" result-params)
 			(member "pp" result-params))
@@ -240,7 +233,7 @@
 	   (lambda (statement) (insert statement) (comint-send-input))
 	   (if pp
 	       (list
-		"import pp"
+		"import pprint"
 		(format "open('%s', 'w').write(pprint.pformat(_))"
 			(org-babel-process-file-name tmp-file 'noquote)))
 	     (list (format "open('%s', 'w').write(str(_))"
--- a/lisp/org/ob-ref.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/ob-ref.el	Thu Dec 16 18:30:57 2010 -0500
@@ -2,11 +2,10 @@
 
 ;; Copyright (C) 2009, 2010  Free Software Foundation, Inc.
 
-;; Author: Eric Schulte
-;;	Dan Davison
+;; Author: Eric Schulte, Dan Davison
 ;; Keywords: literate programming, reproducible research
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 
 ;; This file is part of GNU Emacs.
 
@@ -52,11 +51,13 @@
 ;;; Code:
 (require 'ob)
 (eval-when-compile
+  (require 'org-list)
   (require 'cl))
 
 (declare-function org-remove-if-not "org" (predicate seq))
 (declare-function org-at-table-p "org" (&optional table-type))
 (declare-function org-count "org" (CL-ITEM CL-SEQ))
+(declare-function org-in-item-p "org-list" ())
 
 (defvar org-babel-ref-split-regexp
   "[ \f\t\n\r\v]*\\(.+?\\)[ \f\t\n\r\v]*=[ \f\t\n\r\v]*\\(.+\\)[ \f\t\n\r\v]*")
@@ -74,46 +75,39 @@
     (let ((var (match-string 1 assignment))
 	  (ref (match-string 2 assignment)))
       (cons (intern var)
-	    ((lambda (val)
-	       (if (equal :ob-must-be-reference val)
-		   (org-babel-ref-resolve ref) val))
-	     (org-babel-ref-literal ref))))))
-
-(defun org-babel-ref-literal (ref)
-  "Return the value of REF if it is a literal value.
-Determine if the right side of a header argument variable
-assignment is a literal value or is a reference to some external
-resource.  REF should be a string of the right hand side of the
-assignment.  If REF is literal then return it's value, otherwise
-return nil."
-  (let ((out (org-babel-read ref)))
-    (if (equal out ref)
-        (if (string-match "^\".+\"$" ref)
-            (read ref)
-	  :ob-must-be-reference)
-      out)))
+	    (let ((out (org-babel-read ref)))
+	      (if (equal out ref)
+		  (if (string-match "^\".+\"$" ref)
+		      (read ref)
+		    (org-babel-ref-resolve ref))
+		out))))))
 
 (defvar org-babel-library-of-babel)
 (defun org-babel-ref-resolve (ref)
   "Resolve the reference REF and return its value."
   (save-excursion
     (let ((case-fold-search t)
-          type args new-refere new-referent result lob-info split-file split-ref
-          index index-row index-col)
+          type args new-refere new-header-args new-referent result
+	  lob-info split-file split-ref index index-row index-col)
       ;; if ref is indexed grab the indices -- beware nested indices
-      (when (and (string-match "\\[\\(.+\\)\\]" ref)
+      (when (and (string-match "\\[\\([^\\[]+\\)\\]$" ref)
 		 (let ((str (substring ref 0 (match-beginning 0))))
 		   (= (org-count ?( str) (org-count ?) str))))
         (setq index (match-string 1 ref))
         (setq ref (substring ref 0 (match-beginning 0))))
       ;; assign any arguments to pass to source block
-      (when (string-match "^\\(.+?\\)\(\\(.*\\)\)$" ref)
-        (setq new-refere (match-string 1 ref))
-        (setq new-referent (match-string 2 ref))
+      (when (string-match
+	     "^\\(.+?\\)\\(\\[\\(.*\\)\\]\\|\\(\\)\\)\(\\(.*\\)\)$" ref)
+        (setq new-refere      (match-string 1 ref))
+	(setq new-header-args (match-string 3 ref))
+        (setq new-referent    (match-string 5 ref))
         (when (> (length new-refere) 0)
-          (if (> (length new-referent) 0)
-              (setq args (mapcar (lambda (ref) (cons :var ref))
-                                 (org-babel-ref-split-args new-referent))))
+          (when (> (length new-referent) 0)
+	    (setq args (mapcar (lambda (ref) (cons :var ref))
+			       (org-babel-ref-split-args new-referent))))
+	  (when (> (length new-header-args) 0)
+	    (setq args (append (org-babel-parse-header-arguments new-header-args)
+			       args)))
           (setq ref new-refere)))
       (when (string-match "^\\(.+\\):\\(.+\\)$" ref)
         (setq split-file (match-string 1 ref))
@@ -155,6 +149,7 @@
 		(case type
 		  ('results-line (org-babel-read-result))
 		  ('table (org-babel-read-table))
+		  ('list (org-babel-read-list))
 		  ('file (org-babel-read-link))
 		  ('source-block (org-babel-execute-src-block nil nil params))
 		  ('lob (org-babel-execute-src-block nil lob-info params)))))
@@ -222,6 +217,7 @@
 Return nil if none of the supported reference types are found.
 Supported reference types are tables and source blocks."
   (cond ((org-at-table-p) 'table)
+	((org-in-item-p) 'list)
         ((looking-at "^[ \t]*#\\+BEGIN_SRC") 'source-block)
         ((looking-at org-bracket-link-regexp) 'file)
         ((looking-at org-babel-result-regexp) 'results-line)))
--- a/lisp/org/ob-ruby.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/ob-ruby.el	Thu Dec 16 18:30:57 2010 -0500
@@ -1,11 +1,11 @@
 ;;; ob-ruby.el --- org-babel functions for ruby evaluation
 
-;; Copyright (C) 2009, 2010  Free Software Foundation, Inc.
+;; Copyright (C) 2009, 2010  Free Software Foundation
 
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 
 ;; This file is part of GNU Emacs.
 
@@ -29,10 +29,10 @@
 ;;; Requirements:
 
 ;; - ruby and irb executables :: http://www.ruby-lang.org/
-;;
+;; 
 ;; - ruby-mode :: Can be installed through ELPA, or from
 ;;   http://github.com/eschulte/rinari/raw/master/util/ruby-mode.el
-;;
+;;   
 ;; - inf-ruby mode :: Can be installed through ELPA, or from
 ;;   http://github.com/eschulte/rinari/raw/master/util/inf-ruby.el
 
@@ -116,16 +116,7 @@
   "Convert RESULTS into an appropriate elisp value.
 If RESULTS look like a table, then convert them into an
 Emacs-lisp table, otherwise return the results as a string."
-  (org-babel-read
-   (if (and (stringp results) (string-match "^\\[.+\\]$" results))
-       (org-babel-read
-        (concat "'"
-                (replace-regexp-in-string
-                 "\\[" "(" (replace-regexp-in-string
-                            "\\]" ")" (replace-regexp-in-string
-                                       ", " " " (replace-regexp-in-string
-						 "'" "\"" results))))))
-     results)))
+  (org-babel-script-escape results))
 
 (defun org-babel-ruby-initiate-session (&optional session params)
   "Initiate a ruby session.
--- a/lisp/org/ob-sass.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/ob-sass.el	Thu Dec 16 18:30:57 2010 -0500
@@ -5,7 +5,7 @@
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 
 ;; This file is part of GNU Emacs.
 
--- a/lisp/org/ob-scheme.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/ob-scheme.el	Thu Dec 16 18:30:57 2010 -0500
@@ -1,26 +1,28 @@
 ;;; ob-scheme.el --- org-babel functions for Scheme
 
-;; Copyright (C) 2010 Free Software Foundation, Inc.
+;; Copyright (C) 2010 Free Software Foundation
 
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research, scheme
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 
-;; This file is part of GNU Emacs.
+;;; License:
 
-;; GNU Emacs is free software: you can redistribute it and/or modify
+;; 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 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
+;; the Free Software Foundation; either version 3, 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.  If not, see <http://www.gnu.org/licenses/>.
+;; 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:
 
@@ -33,7 +35,7 @@
 
 ;; - a working scheme implementation
 ;;   (e.g. guile http://www.gnu.org/software/guile/guile.html)
-;;
+;;   
 ;; - for session based evaluation cmuscheme.el is required which is
 ;;   included in Emacs
 
--- a/lisp/org/ob-screen.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/ob-screen.el	Thu Dec 16 18:30:57 2010 -0500
@@ -1,11 +1,11 @@
 ;;; ob-screen.el --- org-babel support for interactive terminal
 
-;; Copyright (C) 2009, 2010  Free Software Foundation, Inc.
+;; Copyright (C) 2009, 2010  Free Software Foundation
 
 ;; Author: Benjamin Andresen
 ;; Keywords: literate programming, interactive shell
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 
 ;; This file is part of GNU Emacs.
 
--- a/lisp/org/ob-sh.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/ob-sh.el	Thu Dec 16 18:30:57 2010 -0500
@@ -5,7 +5,7 @@
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 
 ;; This file is part of GNU Emacs.
 
@@ -100,7 +100,7 @@
                           (if (listp el)
                               (mapcar #'deep-string el)
 			    (org-babel-sh-var-to-sh el sep))))
-	(format "$(cat <<BABEL_TABLE\n%s\nBABEL_TABLE\n)"
+	(format "$(cat <<'BABEL_TABLE'\n%s\nBABEL_TABLE\n)"
 		(orgtbl-to-generic
 		 (deep-string (if (listp (car var)) var (list var)))
 		 (list :sep (or sep "\t")))))
@@ -114,16 +114,7 @@
   "Convert RESULTS to an appropriate elisp value.
 If the results look like a table, then convert them into an
 Emacs-lisp table, otherwise return the results as a string."
-  (org-babel-read
-   (if (string-match "^\\[.+\\]$" results)
-       (org-babel-read
-        (concat "'"
-                (replace-regexp-in-string
-                 "\\[" "(" (replace-regexp-in-string
-                            "\\]" ")" (replace-regexp-in-string
-                                       ", " " " (replace-regexp-in-string
-                                                 "'" "\"" results))))))
-     results)))
+  (org-babel-script-escape results))
 
 (defun org-babel-sh-initiate-session (&optional session params)
   "Initiate a session named SESSION according to PARAMS."
--- a/lisp/org/ob-sql.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/ob-sql.el	Thu Dec 16 18:30:57 2010 -0500
@@ -5,7 +5,7 @@
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 
 ;; This file is part of GNU Emacs.
 
@@ -47,9 +47,15 @@
 (eval-when-compile (require 'cl))
 
 (declare-function org-table-import "org-table" (file arg))
+(declare-function orgtbl-to-csv "org-table" (TABLE PARAMS))
 
 (defvar org-babel-default-header-args:sql '())
 
+(defun org-babel-expand-body:sql (body params)
+  "Expand BODY according to the values of PARAMS."
+  (org-babel-sql-expand-vars
+   body (mapcar #'cdr (org-babel-get-header params :var))))
+
 (defun org-babel-execute:sql (body params)
   "Execute a block of Sql code with Babel.
 This function is called by `org-babel-execute-src-block'."
@@ -60,6 +66,10 @@
          (out-file (or (cdr (assoc :out-file params))
                        (org-babel-temp-file "sql-out-")))
          (command (case (intern engine)
+                    ('msosql (format "osql %s -s \"\t\" -i %s -o %s"
+                                     (or cmdline "")
+                                     (org-babel-process-file-name in-file)
+                                     (org-babel-process-file-name out-file)))
                     ('mysql (format "mysql %s -e \"source %s\" > %s"
                                     (or cmdline "")
 				    (org-babel-process-file-name in-file)
@@ -70,11 +80,11 @@
 				    (or cmdline "")))
                     (t (error "no support for the %s sql engine" engine)))))
     (with-temp-file in-file
-      (insert (org-babel-expand-body:generic body params)))
+      (insert (org-babel-expand-body:sql body params)))
     (message command)
     (shell-command command)
     (with-temp-buffer
-      (org-table-import out-file nil)
+      (org-table-import out-file '(16))
       (org-babel-reassemble-table
        (org-table-to-lisp)
        (org-babel-pick-name (cdr (assoc :colname-names params))
@@ -82,6 +92,28 @@
        (org-babel-pick-name (cdr (assoc :rowname-names params))
 			    (cdr (assoc :rownames params)))))))
 
+(defun org-babel-sql-expand-vars (body vars)
+  "Expand the variables held in VARS in BODY."
+  (mapc
+   (lambda (pair)
+     (setq body
+	   (replace-regexp-in-string
+	    (format "\$%s" (car pair))
+	    ((lambda (val)
+	       (if (listp val)
+		   ((lambda (data-file)
+		      (with-temp-file data-file
+			(insert (orgtbl-to-csv
+				 val '(:fmt (lambda (el) (if (stringp el)
+							el
+						      (format "%S" el)))))))
+		      data-file)
+		    (org-babel-temp-file "sql-data-"))
+		 (if (stringp val) val (format "%S" val))))
+	     (cdr pair))
+	    body)))
+   vars)
+  body)
 
 (defun org-babel-prep-session:sql (session params)
   "Raise an error because Sql sessions aren't implemented."
--- a/lisp/org/ob-sqlite.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/ob-sqlite.el	Thu Dec 16 18:30:57 2010 -0500
@@ -1,11 +1,11 @@
 ;;; ob-sqlite.el --- org-babel functions for sqlite database interaction
 
-;; Copyright (C) 2010  Free Software Foundation, Inc.
+;; Copyright (C) 2010  Free Software Foundation
 
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 
 ;; This file is part of GNU Emacs.
 
@@ -28,6 +28,7 @@
 
 ;;; Code:
 (require 'ob)
+(require 'ob-eval)
 (require 'ob-ref)
 
 (declare-function org-fill-template "org" (template alist))
@@ -52,7 +53,6 @@
   "Execute a block of Sqlite code with Babel.
 This function is called by `org-babel-execute-src-block'."
   (let ((result-params (split-string (or (cdr (assoc :results params)) "")))
-	(vars (org-babel-get-header params :var))
 	(db (cdr (assoc :db params)))
 	(separator (cdr (assoc :separator params)))
 	(nullvalue (cdr (assoc :nullvalue params)))
@@ -65,15 +65,10 @@
     (unless db (error "ob-sqlite: can't evaluate without a database."))
     (with-temp-buffer
       (insert
-       (shell-command-to-string
+       (org-babel-eval
 	(org-fill-template
-	 "%cmd -init %body %header %separator %nullvalue %others %csv %db "
+	 "%cmd %header %separator %nullvalue %others %csv %db "
 	 (list
-	  (cons "body" ((lambda (sql-file)
-			  (with-temp-file sql-file
-			    (insert (org-babel-expand-body:sqlite body params)))
-			  sql-file)
-			(org-babel-temp-file "sqlite-sql-")))
 	  (cons "cmd" org-babel-sqlite3-command)
 	  (cons "header" (if headers-p "-header" "-noheader"))
 	  (cons "separator"
@@ -90,7 +85,9 @@
 			      (member :html others) separator)
 			  ""
 			"-csv"))
-	  (cons "db " db)))))
+	  (cons "db " db)))
+	;; body of the code block
+	(org-babel-expand-body:sqlite body params)))
       (if (or (member "scalar" result-params)
 	      (member "html" result-params)
 	      (member "code" result-params)
--- a/lisp/org/ob-table.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/ob-table.el	Thu Dec 16 18:30:57 2010 -0500
@@ -5,7 +5,7 @@
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 
 ;; This file is part of GNU Emacs.
 
@@ -57,9 +57,9 @@
   "Replace newline character with ellipses.
 If STRING ends in a newline character, then remove the newline
 character and replace it with ellipses."
-  (if (and (stringp string) (string-match "[\n\r]" string))
-      (concat (substring string 0 (match-beginning 0)) "...")
-    string))
+  (if (and (stringp string) (string-match "[\n\r]\\(.\\)?" string))
+      (concat (substring string 0 (match-beginning 0))
+	      (if (match-string 1 string) "...")) string))
 
 (defmacro sbe (source-block &rest variables)
   "Return the results of calling SOURCE-BLOCK with VARIABLES.
--- a/lisp/org/ob-tangle.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/ob-tangle.el	Thu Dec 16 18:30:57 2010 -0500
@@ -5,7 +5,7 @@
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 
 ;; This file is part of GNU Emacs.
 
@@ -125,6 +125,7 @@
 This function exports the source code using
 `org-babel-tangle' and then loads the resulting file using
 `load-file'."
+  (interactive "fFile to load: ")
   (flet ((age (file)
               (float-time
                (time-subtract (current-time)
--- a/lisp/org/ob.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/ob.el	Thu Dec 16 18:30:57 2010 -0500
@@ -2,11 +2,10 @@
 
 ;; Copyright (C) 2009, 2010  Free Software Foundation, Inc.
 
-;; Author: Eric Schulte
-;;	Dan Davison
+;; Author: Eric Schulte, Dan Davison
 ;; Keywords: literate programming, reproducible research
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 
 ;; This file is part of GNU Emacs.
 
@@ -31,7 +30,9 @@
 
 ;;; Code:
 (eval-when-compile
+  (require 'org-list)
   (require 'cl))
+(require 'ob-eval)
 (require 'org-macs)
 
 (defvar org-babel-call-process-region-original)
@@ -43,7 +44,7 @@
 (declare-function tramp-file-name-host "tramp" (vec))
 (declare-function with-parsed-tramp-file-name "tramp" (filename var &rest body))
 (declare-function org-icompleting-read "org" (&rest args))
-(declare-function org-edit-src-code "org-src" 
+(declare-function org-edit-src-code "org-src"
                   (&optional context code edit-buffer-name quietp))
 (declare-function org-edit-src-exit "org-src"  (&optional context))
 (declare-function org-open-at-point "org" (&optional in-emacs reference-buffer))
@@ -73,6 +74,10 @@
 (declare-function org-babel-ref-resolve "ob-ref" (ref))
 (declare-function org-babel-lob-execute-maybe "ob-lob" ())
 (declare-function org-number-sequence "org-compat" (from &optional to inc))
+(declare-function org-in-item-p "org-list" ())
+(declare-function org-list-parse-list "org-list" (&optional delete))
+(declare-function org-list-to-generic "org-list" (LIST PARAMS))
+(declare-function org-list-bottom-point "org-list" ())
 
 (defgroup org-babel nil
   "Code block evaluation and management in `org-mode' documents."
@@ -213,9 +218,13 @@
     (if (or (equal eval "never") (equal eval "no")
 	    (and query
 		 (not (yes-or-no-p
-		       (format "Evaluate this%scode on your system? "
-			       (if info (format " %s " (nth 0 info)) " "))))))
-	(prog1 nil (message "evaluation aborted"))
+		       (format "Evaluate this%scode block%son your system? "
+			       (if info (format " %s " (nth 0 info)) " ")
+			       (if (nth 4 info)
+				   (format " (%s) " (nth 4 info)) " "))))))
+	(prog1 nil (message "Evaluation %s"
+			    (if (or (equal eval "never") (equal eval "no"))
+				"Disabled" "Aborted")))
       t)))
 
 ;;;###autoload
@@ -238,7 +247,8 @@
   (interactive)
   (let ((info (org-babel-get-src-block-info)))
     (if info
-	(progn (org-babel-execute-src-block current-prefix-arg info) t) nil)))
+	(progn (org-babel-eval-wipe-error-buffer)
+	       (org-babel-execute-src-block current-prefix-arg info) t) nil)))
 
 ;;;###autoload
 (defun org-babel-expand-src-block-maybe ()
@@ -363,10 +373,12 @@
 	     (new-hash (when cache? (org-babel-sha1-hash info)))
 	     (old-hash (when cache? (org-babel-result-hash info)))
 	     (body (setf (nth 1 info)
-			 (if (and (cdr (assoc :noweb params))
-				  (string= "yes" (cdr (assoc :noweb params))))
-			     (org-babel-expand-noweb-references info)
-			   (nth 1 info))))
+			 (let ((noweb (cdr (assoc :noweb params))))
+			   (if (and noweb
+				    (or (string= "yes" noweb)
+					(string= "tangle" noweb)))
+			       (org-babel-expand-noweb-references info)
+			     (nth 1 info)))))
 	     (cmd (intern (concat "org-babel-execute:" lang)))
 	     (dir (cdr (assoc :dir params)))
 	     (default-directory
@@ -379,7 +391,7 @@
 	     result)
 	(unwind-protect
 	    (flet ((call-process-region (&rest args)
-					(apply 'org-babel-tramp-handle-call-process-region args)))
+		    (apply 'org-babel-tramp-handle-call-process-region args)))
 	      (unless (fboundp cmd)
 		(error "No org-babel-execute function for %s!" lang))
 	      (if (and (not arg) new-hash (equal new-hash old-hash))
@@ -584,6 +596,60 @@
       t)))
 
 ;;;###autoload
+(defmacro org-babel-map-src-blocks (file &rest body)
+  "Evaluate BODY forms on each source-block in FILE.
+If FILE is nil evaluate BODY forms on source blocks in current
+buffer.  During evaluation of BODY the following local variables
+are set relative to the currently matched code block.
+
+full-block ------- string holding the entirety of the code block
+beg-block -------- point at the beginning of the code block
+end-block -------- point at the end of the matched code block
+lang ------------- string holding the language of the code block
+beg-lang --------- point at the beginning of the lang
+end-lang --------- point at the end of the lang
+switches --------- string holding the switches
+beg-switches ----- point at the beginning of the switches
+end-switches ----- point at the end of the switches
+header-args ------ string holding the header-args
+beg-header-args -- point at the beginning of the header-args
+end-header-args -- point at the end of the header-args
+body ------------- string holding the body of the code block
+beg-body --------- point at the beginning of the body
+end-body --------- point at the end of the body"
+  (declare (indent 1))
+  (let ((tempvar (make-symbol "file")))
+    `(let* ((,tempvar ,file)
+	    (visited-p (or (null ,tempvar)
+			   (get-file-buffer (expand-file-name ,tempvar))))
+	    (point (point)) to-be-removed)
+       (save-window-excursion
+	 (when ,tempvar (find-file ,tempvar))
+	 (setq to-be-removed (current-buffer))
+	 (goto-char (point-min))
+	 (while (re-search-forward org-babel-src-block-regexp nil t)
+	   (goto-char (match-beginning 0))
+	   (let ((full-block (match-string 0))
+		 (beg-block (match-beginning 0))
+		 (end-block (match-end 0))
+		 (lang (match-string 2))
+		 (beg-lang (match-beginning 2))
+		 (end-lang (match-end 2))
+		 (switches (match-string 3))
+		 (beg-switches (match-beginning 3))
+		 (end-switches (match-end 3))
+		 (header-args (match-string 4))
+		 (beg-header-args (match-beginning 4))
+		 (end-header-args (match-end 4))
+		 (body (match-string 5))
+		 (beg-body (match-beginning 5))
+		 (end-body (match-end 5)))
+	     ,@body
+	     (goto-char end-block))))
+       (unless visited-p (kill-buffer to-be-removed))
+       (goto-char point))))
+
+;;;###autoload
 (defun org-babel-execute-buffer (&optional arg)
   "Execute source code blocks in a buffer.
 Call `org-babel-execute-src-block' on every source block in
@@ -757,57 +823,6 @@
 	  (lambda () (org-add-hook 'change-major-mode-hook
 				   'org-babel-show-result-all 'append 'local)))
 
-(defmacro org-babel-map-src-blocks (file &rest body)
-  "Evaluate BODY forms on each source-block in FILE.
-If FILE is nil evaluate BODY forms on source blocks in current
-buffer.  During evaluation of BODY the following local variables
-are set relative to the currently matched code block.
-
-full-block ------- string holding the entirety of the code block
-beg-block -------- point at the beginning of the code block
-end-block -------- point at the end of the matched code block
-lang ------------- string holding the language of the code block
-beg-lang --------- point at the beginning of the lang
-end-lang --------- point at the end of the lang
-switches --------- string holding the switches
-beg-switches ----- point at the beginning of the switches
-end-switches ----- point at the end of the switches
-header-args ------ string holding the header-args
-beg-header-args -- point at the beginning of the header-args
-end-header-args -- point at the end of the header-args
-body ------------- string holding the body of the code block
-beg-body --------- point at the beginning of the body
-end-body --------- point at the end of the body"
-  (declare (indent 1))
-  `(let ((visited-p (or (null ,file)
-			(get-file-buffer (expand-file-name ,file))))
-	 (point (point)) to-be-removed)
-     (save-window-excursion
-       (when ,file (find-file ,file))
-       (setq to-be-removed (current-buffer))
-       (goto-char (point-min))
-       (while (re-search-forward org-babel-src-block-regexp nil t)
-         (goto-char (match-beginning 0))
-	 (let ((full-block (match-string 0))
-	       (beg-block (match-beginning 0))
-	       (end-block (match-end 0))
-	       (lang (match-string 2))
-	       (beg-lang (match-beginning 2))
-	       (end-lang (match-end 2))
-	       (switches (match-string 3))
-	       (beg-switches (match-beginning 3))
-	       (end-switches (match-end 3))
-	       (header-args (match-string 4))
-	       (beg-header-args (match-beginning 4))
-	       (end-header-args (match-end 4))
-	       (body (match-string 5))
-	       (beg-body (match-beginning 5))
-	       (end-body (match-end 5)))
-	   ,@body
-	   (goto-char end-block))))
-     (unless visited-p (kill-buffer to-be-removed))
-     (goto-char point)))
-
 (defvar org-file-properties)
 (defun org-babel-params-from-properties (&optional lang)
   "Retrieve parameters specified as properties.
@@ -893,17 +908,31 @@
 
 (defun org-babel-parse-header-arguments (arg-string)
   "Parse a string of header arguments returning an alist."
-  (if (> (length arg-string) 0)
-      (delq nil
-	    (mapcar
-	     (lambda (arg)
-	       (if (string-match
-                    "\\([^ \f\t\n\r\v]+\\)[ \f\t\n\r\v]+\\([^ \f\t\n\r\v]+.*\\)"
-                    arg)
-		   (cons (intern (concat ":" (match-string 1 arg)))
-                         (org-babel-read (org-babel-chomp (match-string 2 arg))))
-		 (cons (intern (concat ":" arg)) nil)))
-	     (split-string (concat " " arg-string) "[ \f\t\n\r\v]+:" t)))))
+  (when (> (length arg-string) 0)
+    (delq nil
+	  (mapcar
+	   (lambda (arg)
+	     (if (string-match
+		  "\\([^ \f\t\n\r\v]+\\)[ \f\t\n\r\v]+\\([^ \f\t\n\r\v]+.*\\)"
+		  arg)
+		 (cons (intern (match-string 1 arg))
+		       (org-babel-read (org-babel-chomp (match-string 2 arg))))
+	       (cons (intern (org-babel-chomp arg)) nil)))
+	   (let ((balance 0) (partial nil) (lst nil) (last 0))
+	     (mapc (lambda (ch)  ; split on [] balanced instances of [ \t]:
+		     (setq balance (+ balance
+				      (cond ((equal 91 ch) 1)
+					    ((equal 93 ch) -1)
+					    (t 0))))
+		     (setq partial (cons ch partial))
+		     (when (and (= ch 58) (= balance 0)
+				(or (= last 32) (= last 9)))
+		       (setq lst (cons (apply #'string (nreverse (cddr partial)))
+				       lst))
+		       (setq partial (list ch)))
+		     (setq last ch))
+		   (string-to-list arg-string))
+	     (nreverse (cons (apply #'string (nreverse partial)) lst)))))))
 
 (defun org-babel-process-params (params)
   "Expand variables in PARAMS and add summary parameters."
@@ -1291,6 +1320,7 @@
   (let ((case-fold-search t) result-string)
     (cond
      ((org-at-table-p) (org-babel-read-table))
+     ((org-in-item-p) (org-babel-read-list))
      ((looking-at org-bracket-link-regexp) (org-babel-read-link))
      ((looking-at org-block-regexp) (org-babel-trim (match-string 4)))
      ((looking-at "^[ \t]*: ")
@@ -1316,6 +1346,10 @@
               (mapcar #'org-babel-read row)))
           (org-table-to-lisp)))
 
+(defun org-babel-read-list ()
+  "Read the list at `point' into emacs-lisp."
+  (mapcar #'org-babel-read (cdr (org-list-parse-list))))
+
 (defvar org-link-types-re)
 (defun org-babel-read-link ()
   "Read the link at `point' into emacs-lisp.
@@ -1349,7 +1383,9 @@
 file ---- the results are interpreted as a file path, and are
           inserted into the buffer using the Org-mode file syntax
 
-raw ----- results are added directly to the org-mode file.  This
+list ---- the results are interpreted as an Org-mode list.
+
+raw ----- results are added directly to the Org-mode file.  This
           is a good option if you code block will output org-mode
           formatted text.
 
@@ -1406,16 +1442,24 @@
 	   ((member "replace" result-params)
 	    (delete-region (point) (org-babel-result-end)))
 	   ((member "append" result-params)
-	    (goto-char (org-babel-result-end)) (setq beg (point)))
-	   ((member "prepend" result-params) ;; already there
-	    )))
+	    (goto-char (org-babel-result-end)) (setq beg (point-marker)))
+	   ((member "prepend" result-params)))) ; already there
 	(setq results-switches
 	      (if results-switches (concat " " results-switches) ""))
+	;; insert results based on type
 	(cond
 	 ;; do nothing for an empty result
 	 ((= (length result) 0))
+	 ;; insert a list if preferred
+	 ((member "list" result-params)
+	  (insert
+	   (org-babel-trim
+	    (org-list-to-generic (cons 'unordered
+				       (if (listp result) result (list result)))
+				 '(:splicep nil :istart "- " :iend "\n")))))
 	 ;; assume the result is a table if it's not a string
 	 ((not (stringp result))
+	  (goto-char beg)
 	  (insert (concat (orgtbl-to-orgtbl
 			   (if (or (eq 'hline (car result))
 				   (and (listp (car result))
@@ -1425,24 +1469,34 @@
 	  (goto-char beg) (when (org-at-table-p) (org-table-align)))
 	 ((member "file" result-params)
 	  (insert result))
-	 ((member "html" result-params)
-	  (insert (format "#+BEGIN_HTML%s\n%s#+END_HTML\n"
-			  results-switches result)))
-	 ((member "latex" result-params)
-	  (insert (format "#+BEGIN_LaTeX%s\n%s#+END_LaTeX\n"
-			  results-switches result)))
-	 ((member "code" result-params)
-	  (insert (format "#+BEGIN_SRC %s%s\n%s#+END_SRC\n"
-			  (or lang "none") results-switches result)))
-	 ((member "org" result-params)
-	  (insert (format "#+BEGIN_SRC org\n%s#+END_SRC\n" result)))
-	 ((member "raw" result-params)
-	  (save-excursion (insert result)) (if (org-at-table-p) (org-cycle)))
-	 (t
-	  (org-babel-examplize-region
-	   (point) (progn (insert result) (point)) results-switches)))
+	 (t (goto-char beg) (insert result)))
+	(when (listp result) (goto-char (org-table-end)))
+	(setq end (point-marker))
+	;; possibly wrap result
+	(flet ((wrap (start finish)
+		     (goto-char beg) (insert start)
+		     (goto-char end) (insert finish)
+		     (setq end (point-marker))))
+	  (cond
+	   ((member "html" result-params)
+	    (wrap "#+BEGIN_HTML\n" "#+END_HTML"))
+	   ((member "latex" result-params)
+	    (wrap "#+BEGIN_LaTeX\n" "#+END_LaTeX"))
+	   ((member "code" result-params)
+	    (wrap (format "#+BEGIN_SRC %s%s\n" (or lang "none") results-switches)
+		  "#+END_SRC"))
+	   ((member "org" result-params)
+	    (wrap "#+BEGIN_ORG\n" "#+END_ORG"))
+	   ((member "raw" result-params)
+	    (goto-char beg) (if (org-at-table-p) (org-cycle)))
+	   ((member "wrap" result-params)
+	    (when (and (stringp result) (not (member "file" result-params)))
+	      (org-babel-examplize-region beg end results-switches))
+	    (wrap "#+BEGIN_RESULT\n" "#+END_RESULT"))
+	   ((and (stringp result) (not (member "file" result-params)))
+	    (org-babel-examplize-region beg end results-switches)
+	    (setq end (point)))))
 	;; possibly indent the results to match the #+results line
-	(setq end (if (listp result) (org-table-end) (point)))
 	(when (and indent (> indent 0)
 		   ;; in this case `table-align' does the work for us
 		   (not (and (listp result)
@@ -1450,9 +1504,9 @@
 	  (indent-rigidly beg end indent))))
     (if (= (length result) 0)
 	(if (member "value" result-params)
-	    (message "No result returned by source block")
-	  (message "Source block produced no output"))
-      (message "finished"))))
+	    (message "Code block returned no value.")
+	  (message "Code block produced no output."))
+      (message "Code block evaluation complete."))))
 
 (defun org-babel-remove-result (&optional info)
   "Remove the result of the current source block."
@@ -1466,25 +1520,18 @@
 (defun org-babel-result-end ()
   "Return the point at the end of the current set of results"
   (save-excursion
-    (if (org-at-table-p)
-        (progn (goto-char (org-table-end)) (point))
-      (let ((case-fold-search t))
-        (cond
-         ((looking-at "[ \t]*#\\+begin_latex")
-          (re-search-forward "[ \t]*#\\+end_latex" nil t)
-          (forward-line 1))
-         ((looking-at "[ \t]*#\\+begin_html")
-          (re-search-forward "[ \t]*#\\+end_html" nil t)
-          (forward-line 1))
-         ((looking-at "[ \t]*#\\+begin_example")
-          (re-search-forward "[ \t]*#\\+end_example" nil t)
-          (forward-line 1))
-         ((looking-at "[ \t]*#\\+begin_src")
-          (re-search-forward "[ \t]*#\\+end_src" nil t)
-          (forward-line 1))
-         (t (progn (while (looking-at "[ \t]*\\(: \\|\\[\\[\\)")
-                     (forward-line 1))))))
-      (point))))
+    (cond
+     ((org-at-table-p) (progn (goto-char (org-table-end)) (point)))
+     ((org-in-item-p) (- (org-list-bottom-point) 1))
+     (t
+      (let ((case-fold-search t)
+	    (blocks-re (regexp-opt
+			(list "latex" "html" "example" "src" "result"))))
+	(if (looking-at (concat "[ \t]*#\\+begin_" blocks-re))
+	    (re-search-forward (concat "[ \t]*#\\+end_" blocks-re) nil t)
+	  (while (looking-at "[ \t]*\\(: \\|\\[\\[\\)")
+	    (forward-line 1))))
+      (point)))))
 
 (defun org-babel-result-to-file (result)
   "Convert RESULT into an `org-mode' link.
@@ -1505,9 +1552,7 @@
   (interactive "*r")
   (let ((size (count-lines beg end)))
     (save-excursion
-      (cond ((= size 0)
-	     (error (concat "This should not be impossible:"
-                            "a newline was appended to result if missing")))
+      (cond ((= size 0))	      ; do nothing for an empty result
 	    ((< size org-babel-min-lines-for-block-output)
 	     (goto-char beg)
 	     (dotimes (n size)
@@ -1517,7 +1562,7 @@
 	     (insert (if results-switches
                          (format "#+begin_example%s\n" results-switches)
                        "#+begin_example\n"))
-	     (forward-char (- end beg))
+	     (if (markerp end) (goto-char end) (forward-char (- end beg)))
 	     (insert "#+end_example\n"))))))
 
 (defun org-babel-update-block-body (new-body)
@@ -1534,8 +1579,8 @@
 This takes into account some special considerations for certain
 parameters when merging lists."
   (let ((results-exclusive-groups
-	 '(("file" "vector" "table" "scalar" "raw" "org"
-            "html" "latex" "code" "pp")
+	 '(("file" "list" "vector" "table" "scalar" "raw" "org"
+            "html" "latex" "code" "pp" "wrap")
 	   ("replace" "silent" "append" "prepend")
 	   ("output" "value")))
 	(exports-exclusive-groups
@@ -1599,7 +1644,7 @@
 	      (:tangle ;; take the latest -- always overwrite
 	       (setq tangle (or (list (cdr pair)) tangle)))
 	      (:noweb
-	       (setq noweb (e-merge '(("yes" "no")) noweb
+	       (setq noweb (e-merge '(("yes" "no" "tangle")) noweb
 				    (split-string (or (cdr pair) "")))))
 	      (:cache
 	       (setq cache (e-merge '(("yes" "no")) cache
@@ -1718,6 +1763,38 @@
   "Strip protective commas from bodies of source blocks."
   (replace-regexp-in-string "^,#" "#" body))
 
+(defun org-babel-script-escape (str)
+  "Safely convert tables into elisp lists."
+  (let (in-single in-double out)
+    (org-babel-read
+     (if (and (stringp str) (string-match "^\\[.+\\]$" str))
+	 (org-babel-read
+	  (concat
+	   "'"
+	   (progn
+	     (mapc
+	      (lambda (ch)
+		(setq
+		 out
+		 (case ch
+		   (91 (if (or in-double in-single) ; [
+			   (cons 91 out)
+			 (cons 40 out)))
+		   (93 (if (or in-double in-single) ; ]
+			   (cons 93 out)
+			 (cons 41 out)))
+		   (44 (if (or in-double in-single) (cons 44 out) out)) ; ,
+		   (39 (if in-double	; '
+			   (cons 39 out)
+			 (setq in-single (not in-single)) (cons 34 out)))
+		   (34 (if in-single	; "
+			   (append (list 34 32) out)
+			 (setq in-double (not in-double)) (cons 34 out)))
+		   (t  (cons ch out)))))
+	      (string-to-list str))
+	     (apply #'string (reverse out)))))
+       str))))
+
 (defun org-babel-read (cell)
   "Convert the string value of CELL to a number if appropriate.
 Otherwise if cell looks like lisp (meaning it starts with a
@@ -1851,7 +1928,7 @@
   (if (file-remote-p default-directory)
       (make-temp-file
        (concat (file-remote-p default-directory)
-	       (expand-file-name 
+	       (expand-file-name
 		prefix temporary-file-directory)
 	       nil suffix))
     (let ((temporary-file-directory
@@ -1865,17 +1942,22 @@
   (when (and (boundp 'org-babel-temporary-directory)
 	     (file-exists-p org-babel-temporary-directory))
     ;; taken from `delete-directory' in files.el
-    (mapc (lambda (file)
-	    ;; This test is equivalent to
-	    ;; (and (file-directory-p fn) (not (file-symlink-p fn)))
-	    ;; but more efficient
-	    (if (eq t (car (file-attributes file)))
-		(delete-directory file)
-	      (delete-file file)))
-	  ;; We do not want to delete "." and "..".
-	  (directory-files org-babel-temporary-directory 'full
-			   "^\\([^.]\\|\\.\\([^.]\\|\\..\\)\\).*"))
-    (delete-directory org-babel-temporary-directory)))
+    (condition-case nil
+	(progn
+	  (mapc (lambda (file)
+		  ;; This test is equivalent to
+		  ;; (and (file-directory-p fn) (not (file-symlink-p fn)))
+		  ;; but more efficient
+		  (if (eq t (car (file-attributes file)))
+		      (delete-directory file)
+		    (delete-file file)))
+		;; We do not want to delete "." and "..".
+		(directory-files org-babel-temporary-directory 'full
+				 "^\\([^.]\\|\\.\\([^.]\\|\\..\\)\\).*"))
+	  (delete-directory org-babel-temporary-directory))
+      (error
+       (message "Failed to remove temporary Org-babel directory %s"
+		org-babel-temporary-directory)))))
 
 (add-hook 'kill-emacs-hook 'org-babel-remove-temporary-directory)
 
--- a/lisp/org/org-agenda.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/org-agenda.el	Thu Dec 16 18:30:57 2010 -0500
@@ -6,7 +6,7 @@
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 ;;
 ;; This file is part of GNU Emacs.
 ;;
@@ -242,8 +242,12 @@
 		  (const org-agenda-prefix-format :value "  %-12:c%?-12t% s")
 		  (string))
 	    (list :tag "Number of days in agenda"
-		  (const org-agenda-ndays)
-		  (integer :value 1))
+		  (const org-agenda-span)
+		  (choice (const :tag "Day" 'day)
+			  (const :tag "Week" 'week)
+			  (const :tag "Month" 'month)
+			  (const :tag "Year" 'year)
+			  (integer :tag "Custom")))
 	    (list :tag "Fixed starting date"
 		  (const org-agenda-start-day)
 		  (string :value "2007-11-01"))
@@ -562,6 +566,33 @@
   :group 'org-agenda-todo-list
   :type 'boolean)
 
+(defcustom org-agenda-todo-ignore-timestamp nil
+  "Non-nil means don't show entries with a timestamp.
+This applies when creating the global todo list.
+Valid values are:
+
+past     Don't show entries for today or in the past.
+
+future   Don't show entries with a timestamp in the future.
+         The idea behind this is that if it has a future
+         timestamp, you don't want to think about it until the
+         date.
+
+all      Don't show any entries with a timestamp in the global todo list.
+         The idea behind this is that by setting a timestamp, you
+         have already \"taken care\" of this item.
+
+See also `org-agenda-todo-ignore-with-date'.
+See also the variable `org-agenda-tags-todo-honor-ignore-options' if you want
+to make his option also apply to the tags-todo list."
+  :group 'org-agenda-skip
+  :group 'org-agenda-todo-list
+  :type '(choice
+	  (const :tag "Ignore future timestamp todos" future)
+	  (const :tag "Ignore past or present timestamp todos" past)
+	  (const :tag "Ignore all timestamp todos" all)
+	  (const :tag "Show timestamp todos" nil)))
+
 (defcustom org-agenda-todo-ignore-scheduled nil
   "Non-nil means, ignore some scheduled TODO items when making TODO list.
 This applies when creating the global todo list.
@@ -632,7 +663,8 @@
   "Non-nil means honor todo-list ...ignore options also in tags-todo search.
 The variables
    `org-agenda-todo-ignore-with-date',
-   `org-agenda-todo-ignore-scheduled'
+   `org-agenda-todo-ignore-timestamp',
+   `org-agenda-todo-ignore-scheduled',
    `org-agenda-todo-ignore-deadlines'
 make the global TODO list skip entries that have time stamps of certain
 kinds.  If this option is set, the same options will also apply for the
@@ -860,12 +892,25 @@
   :group 'org-agenda-windows
   :type 'boolean)
 
-(defcustom org-agenda-ndays 7
+(defcustom org-agenda-ndays nil
+   "Number of days to include in overview display.
+Should be 1 or 7.
+Obsolete, see `org-agenda-span'."
+   :group 'org-agenda-daily/weekly
+   :type 'integer)
+
+(make-obsolete-variable 'org-agenda-ndays 'org-agenda-span "24.1")
+
+(defcustom org-agenda-span 'week
   "Number of days to include in overview display.
-Should be 1 or 7.
+Can be day, week, month, year, or any number of days.
 Custom commands can set this variable in the options section."
   :group 'org-agenda-daily/weekly
-  :type 'integer)
+  :type '(choice (const :tag "Day" day)
+		 (const :tag "Week" week)
+		 (const :tag "Month" month)
+		 (const :tag "Year" year)
+		 (integer :tag "Custom")))
 
 (defcustom org-agenda-start-on-weekday 1
   "Non-nil means start the overview always on the specified weekday.
@@ -922,6 +967,35 @@
   :group 'org-agenda-daily/weekly
   :type 'boolean)
 
+(defcustom org-agenda-timegrid-use-ampm nil
+  "When set, show AM/PM style timestamps on the timegrid."
+  :group 'org-agenda
+  :type 'boolean)
+
+(defun org-agenda-time-of-day-to-ampm (time)
+  "Convert TIME of a string like '13:45' to an AM/PM style time string."
+  (let* ((hour-number (string-to-number (substring time 0 -3)))
+         (minute (substring time -2))
+         (ampm "am"))
+    (cond
+     ((equal hour-number 12)
+      (setq ampm "pm"))
+     ((> hour-number 12)
+      (setq ampm "pm")
+      (setq hour-number (- hour-number 12))))
+    (concat
+     (if org-agenda-time-leading-zero
+	 (format "%02d" hour-number)
+       (format "%02s" (number-to-string hour-number)))
+     ":" minute ampm)))
+
+(defun org-agenda-time-of-day-to-ampm-maybe (time)
+  "Conditionally convert TIME to AM/PM format
+based on `org-agenda-timegrid-use-ampm'"
+  (if org-agenda-timegrid-use-ampm
+      (org-agenda-time-of-day-to-ampm time)
+    time))
+
 (defcustom org-agenda-weekend-days '(6 0)
   "Which days are weekend?
 These days get the special face `org-agenda-date-weekend' in the agenda
@@ -1211,11 +1285,11 @@
   :group 'org-agenda)
 
 (defcustom org-agenda-prefix-format
-  '((agenda  . "  %-12:c%?-12t% s")
+  '((agenda  . " %i %-12:c%?-12t% s")
     (timeline  . "  % s")
-    (todo  . "  %-12:c")
-    (tags  . "  %-12:c")
-    (search . "  %-12:c"))
+    (todo  . " %i %-12:c")
+    (tags  . " %i %-12:c")
+    (search . " %i %-12:c"))
   "Format specifications for the prefix of items in the agenda views.
 An alist with four entries, for the different agenda types.  The keys to the
 sublists are `agenda', `timeline', `todo', and `tags'.  The values
@@ -1224,6 +1298,8 @@
 
   %c   the category of the item, \"Diary\" for entries from the diary, or
        as given by the CATEGORY keyword or derived from the file name.
+  %i   the icon category of the item, as give in
+       `org-agenda-category-icon-alist'.
   %T   the *last* tag of the item.  Last because inherited tags come
        first in the list.
   %t   the time-of-day specification if one applies to the entry, in the
@@ -1431,6 +1507,52 @@
 				   (string :tag "Color")
 				   (sexp :tag "Face"))))))
 
+(defcustom org-agenda-day-face-function nil
+  "Function called to determine what face should be used to display a day.
+The only argument passed to that function is the day. It should
+returns a face, or nil if does not want to specify a face and let
+the normal rules apply."
+  :group 'org-agenda-line-format
+  :type 'function)
+
+(defcustom org-agenda-category-icon-alist nil
+  "Alist of category icon to be displayed in agenda views.
+
+Each entry should have the following format:
+
+  (CATEGORY-REGEXP FILE-OR-DATA TYPE DATA-P PROPS)
+
+Where CATEGORY-REGEXP is a regexp matching the categories where
+the icon should be displayed.
+FILE-OR-DATA either a file path or a string containing image data.
+
+The other fields can be ommited safely if not needed:
+TYPE indicates the image type.
+DATA-P is a boolean indicating whether the FILE-OR-DATA string is
+image data.
+PROPS are additional image attributes to assign to the image,
+like, e.g. `:ascent center'.
+
+   (\"Org\" \"/path/to/icon.png\" nil nil :ascent center)
+
+If you want to set the display properties yourself, just put a
+list as second element:
+
+  (CATEGORY-REGEXP (MY PROPERTY LIST))
+
+For example, to display a 16px horizontal space for Emacs
+category, you can use:
+
+  (\"Emacs\" '(space . (:width (16))))"
+  :group 'org-agenda-line-format
+  :type '(alist :key-type (string :tag "Regexp matching category")
+		:value-type (choice (list :tag "Icon"
+					  (string :tag "File or data")
+					  (symbol :tag "Type")
+					  (boolean :tag "Data?")
+					  (repeat :tag "Extra image properties" :inline t symbol))
+				    (list :tag "Display properties" sexp))))
+
 (defgroup org-agenda-column-view nil
   "Options concerning column view in the agenda."
   :tag "Org Agenda Column View"
@@ -1720,19 +1842,19 @@
     ("View"
      ["Day View" org-agenda-day-view
       :active (org-agenda-check-type nil 'agenda)
-      :style radio :selected (equal org-agenda-ndays 1)
+      :style radio :selected (eq org-agenda-current-span 'day)
       :keys "v d  (or just d)"]
      ["Week View" org-agenda-week-view
       :active (org-agenda-check-type nil 'agenda)
-      :style radio :selected (equal org-agenda-ndays 7)
+      :style radio :selected (eq org-agenda-current-span 'week)
       :keys "v w  (or just w)"]
      ["Month View" org-agenda-month-view
       :active (org-agenda-check-type nil 'agenda)
-      :style radio :selected (member org-agenda-ndays '(28 29 30 31))
+      :style radio :selected (eq org-agenda-current-span 'month)
       :keys "v m"]
      ["Year View" org-agenda-year-view
       :active (org-agenda-check-type nil 'agenda)
-      :style radio :selected (member org-agenda-ndays '(365 366))
+      :style radio :selected (eq org-agenda-current-span 'year)
       :keys "v y"]
      "--"
      ["Include Diary" org-agenda-toggle-diary
@@ -2778,6 +2900,7 @@
 (defvar org-agenda-columns-active nil)
 (defvar org-agenda-name nil)
 (defvar org-agenda-filter nil)
+(defvar org-agenda-filter-while-redo nil)
 (defvar org-agenda-filter-preset nil
   "A preset of the tags filter used for secondary agenda filtering.
 This must be a list of strings, each string must be a single tag preceded
@@ -3065,6 +3188,16 @@
 		      (progn (delete-overlay o) t)))
 		(overlays-in (point-min) (point-max)))))
 
+(defun org-agenda-get-day-face (date)
+  "Return the face DATE should be displayed with."
+  (or (and (functionp org-agenda-day-face-function)
+	   (funcall org-agenda-day-face-function date))
+      (cond ((org-agenda-todayp date)
+	     'org-agenda-date-today)
+	    ((member (calendar-day-of-week date) org-agenda-weekend-days)
+	     'org-agenda-date-weekend)
+	    (t 'org-agenda-date))))
+
 ;;; Agenda timeline
 
 (defvar org-agenda-only-exact-dates nil) ; dynamically scoped
@@ -3092,10 +3225,10 @@
 					 org-timeline-show-empty-dates))
 	 (org-deadline-warning-days 0)
 	 (org-agenda-only-exact-dates t)
-	 (today (time-to-days (current-time)))
+	 (today (org-today))
 	 (past t)
 	 args
-	 s e rtn d emptyp wd)
+	 s e rtn d emptyp)
     (setq org-agenda-redo-command
 	  (list 'progn
 		(list 'org-switch-to-buffer-other-window (current-buffer))
@@ -3129,8 +3262,7 @@
 	    (progn
 	      (setq past nil)
 	      (insert (make-string 79 ?-) "\n")))
-	(setq date (calendar-gregorian-from-absolute d)
-	      wd (calendar-day-of-week date))
+	(setq date (calendar-gregorian-from-absolute d))
 	(setq s (point))
 	(setq rtn (and (not emptyp)
 		       (apply 'org-agenda-get-day-entries entry
@@ -3144,9 +3276,7 @@
 		 (funcall org-agenda-format-date date))
 	       "\n")
 	      (put-text-property s (1- (point)) 'face
-				 (if (member wd org-agenda-weekend-days)
-				     'org-agenda-date-weekend
-				   'org-agenda-date))
+				 (org-agenda-get-day-face date))
 	      (put-text-property s (1- (point)) 'org-date-line t)
 	      (put-text-property s (1- (point)) 'org-agenda-date-header t)
 	      (if (equal d today)
@@ -3172,7 +3302,7 @@
 	     (if inactive org-ts-regexp-both org-ts-regexp)))
 	 dates dates1 date day day1 day2 ts1 ts2)
     (if force-today
-	(setq dates (list (time-to-days (current-time)))))
+	(setq dates (list (org-today))))
     (save-excursion
       (goto-char beg)
       (while (re-search-forward re end t)
@@ -3210,7 +3340,8 @@
 (defvar org-agenda-last-arguments nil
   "The arguments of the previous call to `org-agenda'.")
 (defvar org-starting-day nil) ; local variable in the agenda buffer
-(defvar org-agenda-span nil) ; local variable in the agenda buffer
+(defvar org-agenda-current-span nil
+  "The current span used in the agenda view.") ; local variable in the agenda buffer
 (defvar org-include-all-loc nil) ; local variable
 
 (defvar org-agenda-entry-types '(:deadline :scheduled :timestamp :sexp)
@@ -3247,7 +3378,7 @@
 the daily/weekly agenda, see `org-agenda-skip-function'.")
 
 ;;;###autoload
-(defun org-agenda-list (&optional include-all start-day ndays)
+(defun org-agenda-list (&optional include-all start-day span)
   "Produce a daily/weekly view from all files in variable `org-agenda-files'.
 The view will be for the current day or week, but from the overview buffer
 you will be able to go to other days/weeks.
@@ -3258,37 +3389,36 @@
 agenda instead.
 
 With a numeric prefix argument in an interactive call, the agenda will
-span INCLUDE-ALL days.  Lisp programs should instead specify NDAYS to change
-the number of days.  NDAYS defaults to `org-agenda-ndays'.
+span INCLUDE-ALL days.  Lisp programs should instead specify SPAN to change
+the number of days.  SPAN defaults to `org-agenda-span'.
 
 START-DAY defaults to TODAY, or to the most recent match for the weekday
 given in `org-agenda-start-on-weekday'."
   (interactive "P")
   (if (and (integerp include-all) (> include-all 0))
-      (setq ndays include-all include-all nil))
-  (setq ndays (or ndays org-agenda-ndays)
-	start-day (or start-day org-agenda-start-day))
+      (setq span include-all include-all nil))
+  (setq start-day (or start-day org-agenda-start-day))
   (if org-agenda-overriding-arguments
       (setq include-all (car org-agenda-overriding-arguments)
 	    start-day (nth 1 org-agenda-overriding-arguments)
-	    ndays (nth 2 org-agenda-overriding-arguments)))
+	    span (nth 2 org-agenda-overriding-arguments)))
   (if (stringp start-day)
       ;; Convert to an absolute day number
       (setq start-day (time-to-days (org-read-date nil t start-day))))
-  (setq org-agenda-last-arguments (list include-all start-day ndays))
+  (setq org-agenda-last-arguments (list include-all start-day span))
   (org-compile-prefix-format 'agenda)
   (org-set-sorting-strategy 'agenda)
-  (let* ((org-agenda-start-on-weekday
-	  (if (or (equal ndays 7) (and (null ndays) (equal 7 org-agenda-ndays)))
-	      org-agenda-start-on-weekday nil))
+  (let* ((span (org-agenda-ndays-to-span (or span org-agenda-ndays org-agenda-span)))
+	 (today (org-today))
+	 (sd (or start-day today))
+	 (ndays (org-agenda-span-to-ndays span sd))
+	 (org-agenda-start-on-weekday
+	  (if (eq ndays 7)
+	      org-agenda-start-on-weekday))
 	 (thefiles (org-agenda-files nil 'ifmode))
 	 (files thefiles)
-	 (today (time-to-days
-		 (time-subtract (current-time)
-				(list 0 (* 3600 org-extend-today-until) 0))))
-	 (sd (or start-day today))
 	 (start (if (or (null org-agenda-start-on-weekday)
-			(< org-agenda-ndays 7))
+			(< ndays 7))
 		    sd
 		  (let* ((nt (calendar-day-of-week
 			      (calendar-gregorian-from-absolute sd)))
@@ -3298,24 +3428,19 @@
 	 (day-numbers (list start))
 	 (day-cnt 0)
 	 (inhibit-redisplay (not debug-on-error))
-	 s e rtn rtnall file date d start-pos end-pos todayp nd wd
-	 clocktable-start clocktable-end)
+	 s e rtn rtnall file date d start-pos end-pos todayp
+	 clocktable-start clocktable-end filter)
     (setq org-agenda-redo-command
-	  (list 'org-agenda-list (list 'quote include-all) start-day ndays))
-    ;; Make the list of days
-    (setq ndays (or ndays org-agenda-ndays)
-	  nd ndays)
-    (while (> ndays 1)
-      (push (1+ (car day-numbers)) day-numbers)
-      (setq ndays (1- ndays)))
+	  (list 'org-agenda-list (list 'quote include-all) start-day (list 'quote span)))
+    (dotimes (n (1- ndays))
+      (push (1+ (car day-numbers)) day-numbers))
     (setq day-numbers (nreverse day-numbers))
     (setq clocktable-start (car day-numbers)
 	  clocktable-end (1+ (or (org-last day-numbers) 0)))
     (org-prepare-agenda "Day/Week")
     (org-set-local 'org-starting-day (car day-numbers))
     (org-set-local 'org-include-all-loc include-all)
-    (org-set-local 'org-agenda-span
-		   (org-agenda-ndays-to-span nd))
+    (org-set-local 'org-agenda-current-span (org-agenda-ndays-to-span span))
     (when (and (or include-all org-agenda-include-all-todo)
 	       (member today day-numbers))
       (setq files thefiles
@@ -3343,7 +3468,7 @@
 	(if org-agenda-overriding-header
 	    (insert (org-add-props (copy-sequence org-agenda-overriding-header)
 			nil 'face 'org-agenda-structure) "\n")
-	  (insert (capitalize (symbol-name (org-agenda-ndays-to-span nd)))
+	  (insert (org-agenda-span-name span)
 		  "-agenda"
 		  (if (< (- d2 d1) 350)
 		      (if (= w1 w2)
@@ -3356,7 +3481,6 @@
       (org-agenda-mark-header-line s))
     (while (setq d (pop day-numbers))
       (setq date (calendar-gregorian-from-absolute d)
-	    wd (calendar-day-of-week date)
 	    s (point))
       (if (or (setq todayp (= d today))
 	      (and (not start-pos) (= d sd)))
@@ -3400,19 +3524,16 @@
 	       (funcall org-agenda-format-date date))
 	     "\n")
 	    (put-text-property s (1- (point)) 'face
-			       (if (member wd org-agenda-weekend-days)
-				   'org-agenda-date-weekend
-				 'org-agenda-date))
+			       (org-agenda-get-day-face date))
 	    (put-text-property s (1- (point)) 'org-date-line t)
 	    (put-text-property s (1- (point)) 'org-agenda-date-header t)
 	    (put-text-property s (1- (point)) 'org-day-cnt day-cnt)
 	    (when todayp
-	      (put-text-property s (1- (point)) 'org-today t)
-	      (put-text-property s (1- (point)) 'face 'org-agenda-date-today))
+	      (put-text-property s (1- (point)) 'org-today t))
 	    (if rtnall (insert
 			(org-finalize-agenda-entries
 			 (org-agenda-add-time-grid-maybe
-			  rtnall nd todayp))
+			  rtnall ndays todayp))
 			"\n"))
 	    (put-text-property s (1- (point)) 'day d)
 	    (put-text-property s (1- (point)) 'org-day-cnt day-cnt))))
@@ -3425,6 +3546,15 @@
 	(setq p (plist-put p :tstart clocktable-start))
 	(setq p (plist-put p :tend clocktable-end))
 	(setq p (plist-put p :scope 'agenda))
+	(when (and (eq org-agenda-clockreport-mode 'with-filter)
+		   (setq filter (or org-agenda-filter-while-redo
+				    (get 'org-agenda-filter :preset-filter))))
+	  (setq p (plist-put p :tags (mapconcat (lambda (x)
+						  (if (string-match "[<>=]" x)
+						      ""
+						    x))
+						filter ""))))
+	(message "%s" (plist-get p :tags)) (sit-for 2)
 	(setq tbl (apply 'org-get-clocktable p))
 	(insert tbl)))
     (goto-char (point-min))
@@ -3444,7 +3574,31 @@
     (message "")))
 
 (defun org-agenda-ndays-to-span (n)
-  (cond ((< n 7) 'day) ((= n 7) 'week) ((< n 32) 'month) (t 'year)))
+  "Return a span symbol for a span of N days, or N if none matches."
+  (cond ((symbolp n) n)
+	((= n 1) 'day)
+	((= n 7) 'week)
+	(t n)))
+
+(defun org-agenda-span-to-ndays (span start-day)
+  "Return ndays from SPAN starting at START-DAY."
+  (cond ((numberp span) span)
+	((eq span 'day) 1)
+	((eq span 'week) 7)
+	((eq span 'month)
+	 (let ((date (calendar-gregorian-from-absolute start-day)))
+	   (calendar-last-day-of-month (car date) (caddr date))))
+	((eq span 'year)
+	 (let ((date (calendar-gregorian-from-absolute start-day)))
+	   (if (calendar-leap-year-p (caddr date)) 366 365)))))
+
+(defun org-agenda-span-name (span)
+  "Return a SPAN name."
+  (if (null span)
+      ""
+    (if (symbolp span)
+	(capitalize (symbol-name span))
+      (format "%d days" span))))
 
 ;;; Agenda word search
 
@@ -3723,7 +3877,7 @@
   (org-set-sorting-strategy 'todo)
   (org-prepare-agenda "TODO")
   (if (and (stringp arg) (not (string-match "\\S-" arg))) (setq arg nil))
-  (let* ((today (time-to-days (current-time)))
+  (let* ((today (org-today))
 	 (date (calendar-gregorian-from-absolute today))
 	 (kwds org-todo-keywords-for-agenda)
 	 (completion-ignore-case t)
@@ -4347,7 +4501,8 @@
   "Do we have a reason to ignore this TODO entry because it has a time stamp?"
   (when (or org-agenda-todo-ignore-with-date
 	    org-agenda-todo-ignore-scheduled
-	    org-agenda-todo-ignore-deadlines)
+	    org-agenda-todo-ignore-deadlines
+	    org-agenda-todo-ignore-timestamp)
     (setq end (or end (save-excursion (outline-next-heading) (point))))
     (save-excursion
       (or (and org-agenda-todo-ignore-with-date
@@ -4370,7 +4525,29 @@
 		 (> (org-days-to-time (match-string 1)) 0))
 		((eq org-agenda-todo-ignore-deadlines 'past)
 		 (<= (org-days-to-time (match-string 1)) 0))
-		(t (org-deadline-close (match-string 1)))))))))
+		(t (org-deadline-close (match-string 1)))))
+	  (and org-agenda-todo-ignore-timestamp
+	       (let ((buffer (current-buffer))
+		     (regexp
+		      (concat
+		       org-scheduled-time-regexp "\\|" org-deadline-time-regexp))
+		     (start (point)))
+		 ;; Copy current buffer into a temporary one
+		 (with-temp-buffer
+		   (insert-buffer-substring buffer start end)
+		   (goto-char (point-min))
+		   ;; Delete SCHEDULED and DEADLINE items
+		   (while (re-search-forward regexp end t)
+		     (delete-region (match-beginning 0) (match-end 0)))
+		   (goto-char (point-min))
+		   ;; No search for timestamp left
+		   (when (re-search-forward org-ts-regexp nil t)
+		     (cond
+		      ((eq org-agenda-todo-ignore-timestamp 'future)
+		       (> (org-days-to-time (match-string 1)) 0))
+		      ((eq org-agenda-todo-ignore-timestamp 'past)
+		       (<= (org-days-to-time (match-string 1)) 0))
+		      (t))))))))))
 
 (defconst org-agenda-no-heading-message
   "No heading for this item in buffer or region.")
@@ -4924,6 +5101,14 @@
 (defvar org-prefix-category-max-length nil
   "Used by `org-compile-prefix-format' to remember the category field width.")
 
+(defun org-agenda-get-category-icon (category)
+  "Return an image for CATEGORY according to `org-agenda-category-icon-alist'."
+  (dolist (entry org-agenda-category-icon-alist)
+    (when (org-string-match-p (car entry) category)
+      (if (listp (cadr entry))
+	  (return (cadr entry))
+      (return (apply 'create-image (cdr entry)))))))
+
 (defun org-format-agenda-item (extra txt &optional category tags dotime
 				     noprefix remove-re habitp)
   "Format TXT to be inserted into the agenda buffer.
@@ -4948,11 +5133,17 @@
 	       org-agenda-show-inherited-tags
 	       org-agenda-hide-tags-regexp))
     (let* ((category (or category
-			 org-category
+			 (if (stringp org-category)
+			     org-category
+			   (and org-category (symbol-name org-category)))
 			 (if buffer-file-name
 			     (file-name-sans-extension
 			      (file-name-nondirectory buffer-file-name))
 			   "")))
+	   (category-icon (org-agenda-get-category-icon category))
+	   (category-icon (if category-icon
+			      (propertize " " 'display category-icon)
+			    ""))
 	   ;; time, tag, effort are needed for the eval of the prefix format
 	   (tag (if tags (nth (1- (length tags)) tags) ""))
 	   time effort neffort
@@ -5038,8 +5229,15 @@
       (if noprefix
 	  (setq rtn txt)
 	;; Prepare the variables needed in the eval of the compiled format
-	(setq time (cond (s2 (concat s1 "-" s2))
-			 (s1 (concat s1 "......"))
+	(setq time (cond (s2 (concat
+			      (org-agenda-time-of-day-to-ampm-maybe s1)
+			      "-" (org-agenda-time-of-day-to-ampm-maybe s2)
+			      (if org-agenda-timegrid-use-ampm " ")))
+			 (s1 (concat
+			      (org-agenda-time-of-day-to-ampm-maybe s1)
+			      (if org-agenda-timegrid-use-ampm
+				  "........ "
+				"......")))
 			 (t ""))
 	      extra (or (and (not habitp) extra) "")
 	      category (if (symbolp category) (symbol-name category) category)
@@ -5163,11 +5361,11 @@
 	    (t "  %-12:c%?-12t% s")))
 	(start 0)
 	varform vars var e c f opt)
-    (while (string-match "%\\(\\?\\)?\\([-+]?[0-9.]*\\)\\([ .;,:!?=|/<>]?\\)\\([ctse]\\)"
+    (while (string-match "%\\(\\?\\)?\\([-+]?[0-9.]*\\)\\([ .;,:!?=|/<>]?\\)\\([ctsei]\\)"
 			 s start)
       (setq var (cdr (assoc (match-string 4 s)
 			    '(("c" . category) ("t" . time) ("s" . extra)
-			      ("T" . tag) ("e" . effort))))
+			      ("i" . category-icon) ("T" . tag) ("e" . effort))))
 	    c (or (match-string 3 s) "")
 	    opt (match-beginning 1)
 	    start (1+ (match-beginning 0)))
@@ -5567,6 +5765,7 @@
   (let* ((org-agenda-keep-modes t)
 	 (filter org-agenda-filter)
 	 (preset (get 'org-agenda-filter :preset-filter))
+	 (org-agenda-filter-while-redo (or filter preset))
 	 (cols org-agenda-columns-active)
 	 (line (org-current-line))
 	 (window-line (- line (org-current-line (window-start))))
@@ -5839,13 +6038,10 @@
     (cond
      (tdpos (goto-char tdpos))
      ((eq org-agenda-type 'agenda)
-      (let* ((sd (time-to-days
-		  (time-subtract (current-time)
-				 (list 0 (* 3600 org-extend-today-until) 0))))
-	     (comp (org-agenda-compute-time-span sd org-agenda-span))
+      (let* ((sd (org-agenda-compute-starting-span
+		  (org-today) (or org-agenda-ndays org-agenda-span)))
 	     (org-agenda-overriding-arguments org-agenda-last-arguments))
-	(setf (nth 1 org-agenda-overriding-arguments) (car comp))
-	(setf (nth 2 org-agenda-overriding-arguments) (cdr comp))
+	(setf (nth 1 org-agenda-overriding-arguments) sd)
 	(org-agenda-redo)
 	(org-agenda-find-same-or-today-or-agenda)))
      (t (error "Cannot find today")))))
@@ -5862,28 +6058,28 @@
 With prefix ARG, go forward that many times the current span."
   (interactive "p")
   (org-agenda-check-type t 'agenda)
-  (let* ((span org-agenda-span)
+  (let* ((span org-agenda-current-span)
 	 (sd org-starting-day)
 	 (greg (calendar-gregorian-from-absolute sd))
 	 (cnt (org-get-at-bol 'org-day-cnt))
-	 greg2 nd)
+	 greg2)
     (cond
      ((eq span 'day)
-      (setq sd (+ arg sd) nd 1))
+      (setq sd (+ arg sd)))
      ((eq span 'week)
-      (setq sd (+ (* 7 arg) sd) nd 7))
+      (setq sd (+ (* 7 arg) sd)))
      ((eq span 'month)
       (setq greg2 (list (+ (car greg) arg) (nth 1 greg) (nth 2 greg))
 	    sd (calendar-absolute-from-gregorian greg2))
-      (setcar greg2 (1+ (car greg2)))
-      (setq nd (- (calendar-absolute-from-gregorian greg2) sd)))
+      (setcar greg2 (1+ (car greg2))))
      ((eq span 'year)
       (setq greg2 (list (car greg) (nth 1 greg) (+ arg (nth 2 greg)))
 	    sd (calendar-absolute-from-gregorian greg2))
-      (setcar (nthcdr 2 greg2) (1+ (nth 2 greg2)))
-      (setq nd (- (calendar-absolute-from-gregorian greg2) sd))))
+      (setcar (nthcdr 2 greg2) (1+ (nth 2 greg2))))
+     (t
+      (setq sd (+ (* span arg) sd))))
     (let ((org-agenda-overriding-arguments
-	   (list (car org-agenda-last-arguments) sd nd t)))
+	   (list (car org-agenda-last-arguments) sd span t)))
       (org-agenda-redo)
       (org-agenda-find-same-or-today-or-agenda cnt))))
 
@@ -5926,7 +6122,6 @@
   "Switch to daily view for agenda.
 With argument DAY-OF-YEAR, switch to that day of the year."
   (interactive "P")
-  (setq org-agenda-ndays 1)
   (org-agenda-change-time-span 'day day-of-year))
 (defun org-agenda-week-view (&optional iso-week)
   "Switch to daily view for agenda.
@@ -5936,7 +6131,6 @@
 week 12 of year 2007.  Years in the range 1938-2037 can also be
 written as 2-digit years."
   (interactive "P")
-  (setq org-agenda-ndays 7)
   (org-agenda-change-time-span 'week iso-week))
 (defun org-agenda-month-view (&optional month)
   "Switch to monthly view for agenda.
@@ -5961,70 +6155,61 @@
   "Change the agenda view to SPAN.
 SPAN may be `day', `week', `month', `year'."
   (org-agenda-check-type t 'agenda)
-  (if (and (not n) (equal org-agenda-span span))
+  (if (and (not n) (equal org-agenda-current-span span))
       (error "Viewing span is already \"%s\"" span))
   (let* ((sd (or (org-get-at-bol 'day)
 		org-starting-day))
-	 (computed (org-agenda-compute-time-span sd span n))
+	 (sd (org-agenda-compute-starting-span sd span n))
 	 (org-agenda-overriding-arguments
-	  (list (car org-agenda-last-arguments)
-		(car computed) (cdr computed) t)))
+	  (list (car org-agenda-last-arguments) sd span t)))
     (org-agenda-redo)
     (org-agenda-find-same-or-today-or-agenda))
   (org-agenda-set-mode-name)
   (message "Switched to %s view" span))
 
-(defun org-agenda-compute-time-span (sd span &optional n)
-  "Compute starting date and number of days for agenda.
+(defun org-agenda-compute-starting-span (sd span &optional n)
+  "Compute starting date for agenda.
 SPAN may be `day', `week', `month', `year'.  The return value
 is a cons cell with the starting date and the number of days,
 so that the date SD will be in that range."
   (let* ((greg (calendar-gregorian-from-absolute sd))
 	 (dg (nth 1 greg))
 	 (mg (car greg))
-	 (yg (nth 2 greg))
-	 nd w1 y1 m1 thisweek)
+	 (yg (nth 2 greg)))
     (cond
      ((eq span 'day)
       (when n
 	(setq sd (+ (calendar-absolute-from-gregorian
 		     (list mg 1 yg))
-		    n -1)))
-      (setq nd 1))
+		    n -1))))
      ((eq span 'week)
       (let* ((nt (calendar-day-of-week
 		  (calendar-gregorian-from-absolute sd)))
 	     (d (if org-agenda-start-on-weekday
 		    (- nt org-agenda-start-on-weekday)
-		  0)))
+		  0))
+	     y1)
 	(setq sd (- sd (+ (if (< d 0) 7 0) d)))
 	(when n
 	  (require 'cal-iso)
-	  (setq thisweek (car (calendar-iso-from-absolute sd)))
 	  (when (> n 99)
 	    (setq y1 (org-small-year-to-year (/ n 100))
 		  n (mod n 100)))
 	  (setq sd
 		(calendar-absolute-from-iso
 		 (list n 1
-		       (or y1 (nth 2 (calendar-iso-from-absolute sd)))))))
-	(setq nd 7)))
+		       (or y1 (nth 2 (calendar-iso-from-absolute sd)))))))))
      ((eq span 'month)
-      (when (and n (> n 99))
-	(setq y1 (org-small-year-to-year (/ n 100))
-	      n (mod n 100)))
-      (setq sd (calendar-absolute-from-gregorian
-		(list (or n mg) 1 (or y1 yg)))
-	    nd (- (calendar-absolute-from-gregorian
-		   (list (1+ (or n mg)) 1 (or y1 yg)))
-		  sd)))
+      (let (y1)
+	(when (and n (> n 99))
+	  (setq y1 (org-small-year-to-year (/ n 100))
+		n (mod n 100)))
+	(setq sd (calendar-absolute-from-gregorian
+		  (list (or n mg) 1 (or y1 yg))))))
      ((eq span 'year)
       (setq sd (calendar-absolute-from-gregorian
-		(list 1 1 (or n yg)))
-	    nd (- (calendar-absolute-from-gregorian
-		   (list 1 1 (1+ (or n yg))))
-		  sd))))
-    (cons sd nd)))
+		(list 1 1 (or n yg))))))
+    sd))
 
 (defun org-agenda-next-date-line (&optional arg)
   "Jump to the next line indicating a date in agenda buffer."
@@ -6094,11 +6279,15 @@
 	   (if org-agenda-entry-text-mode "on" "off")
 	   (if (integerp arg) arg org-agenda-entry-text-maxlines)))
 
-(defun org-agenda-clockreport-mode ()
-  "Toggle clocktable mode in an agenda buffer."
-  (interactive)
+(defun org-agenda-clockreport-mode (&optional with-filter)
+  "Toggle clocktable mode in an agenda buffer.
+With prefix arg WITH-FILTER, make the clocktable respect the current
+agenda filter."
+  (interactive "P")
   (org-agenda-check-type t 'agenda)
-  (setq org-agenda-clockreport-mode (not org-agenda-clockreport-mode))
+  (if with-filter
+      (setq org-agenda-clockreport-mode 'with-filter)
+    (setq org-agenda-clockreport-mode (not org-agenda-clockreport-mode)))
   (org-agenda-set-mode-name)
   (org-agenda-redo)
   (message "Clocktable mode is %s"
@@ -6151,7 +6340,7 @@
 	   (if org-agenda-include-diary "on" "off")))
 
 (defun org-agenda-toggle-deadlines ()
-  "Toggle diary inclusion in an agenda buffer."
+  "Toggle inclusion of entries with a deadline in an agenda buffer."
   (interactive)
   (org-agenda-check-type t 'agenda)
   (setq org-agenda-include-deadlines (not org-agenda-include-deadlines))
@@ -6173,33 +6362,36 @@
 (defun org-agenda-set-mode-name ()
   "Set the mode name to indicate all the small mode settings."
   (setq mode-name
-	(concat "Org-Agenda"
-		(if (get 'org-agenda-files 'org-restrict) " []" "")
-		(if (equal org-agenda-ndays 1) " Day"    "")
-		(if (equal org-agenda-ndays 7) " Week"   "")
-		(if org-agenda-follow-mode     " Follow" "")
-		(if org-agenda-entry-text-mode " ETxt"   "")
-		(if org-agenda-include-diary   " Diary"  "")
-		(if org-agenda-include-deadlines " Ddl"  "")
-		(if org-agenda-use-time-grid   " Grid"   "")
-		(if (and (boundp 'org-habit-show-habits)
-			 org-habit-show-habits) " Habit"   "")
-		(if (consp org-agenda-show-log) " LogAll"
-		  (if org-agenda-show-log " Log" ""))
-		(if (or org-agenda-filter (get 'org-agenda-filter
-					       :preset-filter))
-		    (concat " {" (mapconcat
-				  'identity
-				  (append (get 'org-agenda-filter
-					       :preset-filter)
-					  org-agenda-filter) "") "}")
-		  "")
-		(if org-agenda-archives-mode
-		    (if (eq org-agenda-archives-mode t)
-			" Archives"
-		      (format " :%s:" org-archive-tag))
-		  "")
-		(if org-agenda-clockreport-mode " Clock"   "")))
+	(list "Org-Agenda"
+	      (if (get 'org-agenda-files 'org-restrict) " []" "")
+	      " "
+	      '(:eval (org-agenda-span-name org-agenda-current-span))
+	      (if org-agenda-follow-mode     " Follow" "")
+	      (if org-agenda-entry-text-mode " ETxt"   "")
+	      (if org-agenda-include-diary   " Diary"  "")
+	      (if org-agenda-include-deadlines " Ddl"  "")
+	      (if org-agenda-use-time-grid   " Grid"   "")
+	      (if (and (boundp 'org-habit-show-habits)
+		       org-habit-show-habits) " Habit"   "")
+	      (if (consp org-agenda-show-log) " LogAll"
+		(if org-agenda-show-log " Log" ""))
+	      (if (or org-agenda-filter (get 'org-agenda-filter
+					     :preset-filter))
+		  (concat " {" (mapconcat
+				'identity
+				(append (get 'org-agenda-filter
+					     :preset-filter)
+					org-agenda-filter) "") "}")
+		"")
+	      (if org-agenda-archives-mode
+		  (if (eq org-agenda-archives-mode t)
+		      " Archives"
+		    (format " :%s:" org-archive-tag))
+		"")
+	      (if org-agenda-clockreport-mode
+		  (if (eq org-agenda-clockreport-mode 'with-filter)
+		      " Clock{}" " Clock")
+		"")))
   (force-mode-line-update))
 
 (defun org-agenda-post-command-hook ()
@@ -6216,7 +6408,6 @@
 
 (defun org-agenda-previous-line ()
   "Move cursor to the previous line, and show if follow-mode is active."
-
   (interactive)
   (call-interactively 'previous-line)
   (org-agenda-do-context-action))
@@ -6642,8 +6833,7 @@
 	 (buffer (marker-buffer marker))
 	 (pos (marker-position marker))
 	 (hdmarker (org-get-at-bol 'org-hd-marker))
-	 (todayp (equal (org-get-at-bol 'day)
-			(time-to-days (current-time))))
+	 (todayp (org-agenda-todayp (org-get-at-bol 'day)))
 	 (inhibit-read-only t)
 	 org-agenda-headline-snapshot-before-repeat newhead just-one)
     (org-with-remote-undo buffer
@@ -7551,25 +7741,26 @@
   (eq (get-char-property (point-at-bol) 'type)
       'org-marked-entry-overlay))
 
-(defun org-agenda-bulk-mark ()
+(defun org-agenda-bulk-mark (&optional arg)
   "Mark the entry at point for future bulk action."
-  (interactive)
-  (org-agenda-check-no-diary)
-  (let* ((m (org-get-at-bol 'org-hd-marker))
-	 ov)
-    (unless (org-agenda-bulk-marked-p)
-      (unless m (error "Nothing to mark at point"))
-      (push m org-agenda-bulk-marked-entries)
-      (setq ov (make-overlay (point-at-bol) (+ 2 (point-at-bol))))
-      (org-overlay-display ov "> "
-			   (org-get-todo-face "TODO")
-			   'evaporate)
-      (overlay-put ov 'type 'org-marked-entry-overlay))
-    (beginning-of-line 2)
-    (while (and (get-char-property (point) 'invisible) (not (eobp)))
-      (beginning-of-line 2))
-    (message "%d entries marked for bulk action"
-	     (length org-agenda-bulk-marked-entries))))
+  (interactive "p")
+  (dotimes (i (max arg 1))
+    (unless (org-get-at-bol 'org-agenda-diary-link)
+      (let* ((m (org-get-at-bol 'org-hd-marker))
+	     ov)
+	(unless (org-agenda-bulk-marked-p)
+	  (unless m (error "Nothing to mark at point"))
+	  (push m org-agenda-bulk-marked-entries)
+	  (setq ov (make-overlay (point-at-bol) (+ 2 (point-at-bol))))
+	  (org-overlay-display ov "> "
+			       (org-get-todo-face "TODO")
+			       'evaporate)
+	  (overlay-put ov 'type 'org-marked-entry-overlay))
+	(beginning-of-line 2)
+	(while (and (get-char-property (point) 'invisible) (not (eobp)))
+	  (beginning-of-line 2))
+	(message "%d entries marked for bulk action"
+		 (length org-agenda-bulk-marked-entries))))))
 
 (defun org-agenda-bulk-unmark ()
   "Unmark the entry at point for future bulk action."
@@ -7619,7 +7810,7 @@
   (interactive "P")
   (unless org-agenda-bulk-marked-entries
     (error "No entries are marked"))
-  (message "Bulk: [r]efile [$]archive [A]rch->sib [t]odo [+/-]tag [s]chedule [d]eadline")
+  (message "Bulk: [r]efile [$]arch [A]rch->sib [t]odo [+/-]tag [s]chd [S]catter [d]eadline")
   (let* ((action (read-char-exclusive))
 	 (org-log-refile (if org-log-refile 'time nil))
 	 (entries (reverse org-agenda-bulk-marked-entries))
@@ -7681,6 +7872,29 @@
 		       (if bound
 			   (fset 'read-string old)
 			 (fmakunbound 'read-string)))))))
+
+     ((eq action '?S)
+      (let ((days (read-number
+		   (format "Scatter tasks across how many %sdays: "
+			   (if arg "week" "")) 7)))
+	(setq cmd
+	      `(let ((distance (random ,(1+ days))))
+		 (if arg
+		     (let ((dist distance)
+			   (day-of-week
+			    (calendar-day-of-week
+			     (calendar-gregorian-from-absolute (org-today)))))
+		       (dotimes (i (1+ dist))
+			 (while (member day-of-week org-agenda-weekend-days)
+			   (incf distance)
+			   (incf day-of-week)
+			   (if (= day-of-week 7)
+			       (setq day-of-week 0)))
+			 (incf day-of-week)
+			 (if (= day-of-week 7)
+			     (setq day-of-week 0)))))
+		 (org-agenda-date-later distance)))))
+
      (t (error "Invalid bulk action")))
 
     ;; Sort the markers, to make sure that parents are handled before children
@@ -7792,6 +8006,9 @@
   (let* ((cnt 0) ; count added events
 	 (org-agenda-new-buffers nil)
 	 (org-deadline-warning-days 0)
+	 ;; Do not use `org-today' here because appt only takes
+	 ;; time and without date as argument, so it may pass wrong
+	 ;; information otherwise
 	 (today (org-date-to-gregorian
 		 (time-to-days (current-time))))
 	 (org-agenda-restrict nil)
@@ -7834,14 +8051,10 @@
 
 (defun org-agenda-todayp (date)
   "Does DATE mean today, when considering `org-extend-today-until'?"
-  (let (today h)
-    (if (listp date) (setq date (calendar-absolute-from-gregorian date)))
-    (setq today (calendar-absolute-from-gregorian (calendar-current-date)))
-    (setq h (nth 2 (decode-time (current-time))))
-    (or (and (>= h org-extend-today-until)
-	     (= date today))
-	(and (< h org-extend-today-until)
-	     (= date (1- today))))))
+  (let ((today (org-today))
+	(date (if (and date (listp date)) (calendar-absolute-from-gregorian date)
+		date)))
+    (eq date today)))
 
 (provide 'org-agenda)
 
--- a/lisp/org/org-archive.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/org-archive.el	Thu Dec 16 18:30:57 2010 -0500
@@ -6,7 +6,7 @@
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 ;;
 ;; This file is part of GNU Emacs.
 ;;
--- a/lisp/org/org-ascii.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/org-ascii.el	Thu Dec 16 18:30:57 2010 -0500
@@ -6,7 +6,7 @@
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 ;;
 ;; This file is part of GNU Emacs.
 ;;
--- a/lisp/org/org-attach.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/org-attach.el	Thu Dec 16 18:30:57 2010 -0500
@@ -4,7 +4,7 @@
 
 ;; Author: John Wiegley <johnw@newartisans.com>
 ;; Keywords: org data task
-;; Version: 7.3
+;; Version: 7.4
 
 ;; This file is part of GNU Emacs.
 ;;
--- a/lisp/org/org-bbdb.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/org-bbdb.el	Thu Dec 16 18:30:57 2010 -0500
@@ -7,7 +7,7 @@
 ;;         Thomas Baumann <thomas dot baumann at ch dot tum dot de>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 ;;
 ;; This file is part of GNU Emacs.
 ;;
--- a/lisp/org/org-beamer.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/org-beamer.el	Thu Dec 16 18:30:57 2010 -0500
@@ -2,7 +2,7 @@
 ;;
 ;; Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 ;;
-;; Version: 7.3
+;; Version: 7.4
 ;; Author: Carsten Dominik <carsten.dominik AT gmail DOT com>
 ;; Maintainer: Carsten Dominik <carsten.dominik AT gmail DOT com>
 ;; Keywords: org, wp, tex
@@ -246,14 +246,14 @@
       (if (and (string-match "\\`[0-9.]+\\'" tmp)
 	       (or (= (string-to-number tmp) 1.0)
 		   (= (string-to-number tmp) 0.0)))
-	  ;; column width 1 means cloase columns, go back to full width
+	  ;; column width 1 means close columns, go back to full width
 	  (org-beamer-close-columns-maybe)
 	(when (setq ass (assoc "BEAMER_envargs" props))
 	  (let (case-fold-search)
-	    (when (string-match "C\\(\\[[^][]*\\]\\)" (cdr ass))
+	    (while (string-match "C\\(\\[[^][]*\\]\\|<[^<>]*>\\)" (cdr ass))
 	      (setq columns-option (match-string 1 (cdr ass)))
 	      (setcdr ass (replace-match "" t t (cdr ass))))
-	    (when (string-match "c\\(\\[[^][]*\\]\\)" (cdr ass))
+	    (while (string-match "c\\(\\[[^][]*\\]\\|<[^<>]*>\\)" (cdr ass))
 	      (setq column-option (match-string 1 (cdr ass)))
 	      (setcdr ass (replace-match "" t t (cdr ass))))))
 	(org-beamer-open-columns-maybe columns-option)
--- a/lisp/org/org-bibtex.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/org-bibtex.el	Thu Dec 16 18:30:57 2010 -0500
@@ -5,7 +5,7 @@
 ;; Author: Bastien Guerry <bzg at altern dot org>
 ;;         Carsten Dominik <carsten dot dominik at gmail dot com>
 ;; Keywords: org, wp, remember
-;; Version: 7.3
+;; Version: 7.4
 ;;
 ;; This file is part of GNU Emacs.
 ;;
--- a/lisp/org/org-capture.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/org-capture.el	Thu Dec 16 18:30:57 2010 -0500
@@ -5,7 +5,7 @@
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 ;;
 ;; This file is part of GNU Emacs.
 ;;
@@ -133,7 +133,10 @@
                  File to the entry matching regexp
 
              (file+datetree \"path/to/file\")
-                 Will create a heading in a date tree
+                 Will create a heading in a date tree for today's date
+
+             (file+datetree+prompt \"path/to/file\")
+                 Will create a heading in a date tree, promts for date
 
              (file+function \"path/to/file\" function-finding-location)
                  A function to find the right location in the file
@@ -280,6 +283,9 @@
 		   (list :tag "File & Date tree"
 			 (const :format "" file+datetree)
 			 (file :tag "  File"))
+		   (list :tag "File & Date tree, prompt for date"
+			 (const :format "" file+datetree+prompt)
+			 (file :tag "  File"))
 		   (list :tag "File & function"
 			 (const :format "" file+function)
 			 (file :tag "  File    ")
@@ -313,6 +319,12 @@
   :group 'org-capture
   :type 'hook)
 
+(defcustom org-capture-after-finalize-hook nil
+  "Hook that is run right after a capture process is finalized.
+  Suitable for window cleanup"
+  :group 'org-capture
+  :type 'hook)
+
 ;;; The property list for keeping information about the capture process
 
 (defvar org-capture-plist nil
@@ -461,9 +473,11 @@
      (t (setq txt "* Invalid capture template")))
     (org-capture-put :template txt)))
 
-(defun org-capture-finalize ()
-  "Finalize the capture process."
-  (interactive)
+(defun org-capture-finalize (&optional stay-with-capture)
+  "Finalize the capture process.
+With prefix argument STAY-WITH-CAPTURE, jump to the location of the
+captured item after finalizing."
+  (interactive "P")
   (unless (and org-capture-mode
 	       (buffer-base-buffer (current-buffer)))
     (error "This does not seem to be a capture buffer for Org-mode"))
@@ -548,17 +562,25 @@
 
       ;; Restore the window configuration before capture
       (set-window-configuration return-wconf))
-    (when abort-note
+
+    (run-hooks 'org-capture-after-finalize-hook)
+    ;; Special cases
+    (cond
+     (abort-note
       (cond
        ((equal abort-note 'clean)
 	(message "Capture process aborted and target buffer cleaned up"))
        ((equal abort-note 'dirty)
-	(error "Capture process aborted, but target buffer could not be cleaned up correctly"))))))
+	(error "Capture process aborted, but target buffer could not be cleaned up correctly"))))
+     (stay-with-capture
+      (org-capture-goto-last-stored)))
+    ;; Return if we did store something
+    (not abort-note)))
 
 (defun org-capture-refile ()
   "Finalize the current capture and then refile the entry.
 Refiling is done from the base buffer, because the indirect buffer is then
-already gone."
+already gone.  Any prefix argument will be passed to the refile comand."
   (interactive)
   (unless (eq (org-capture-get :type 'local) 'entry)
     (error
@@ -640,19 +662,28 @@
 	      (setq target-entry-p (and (org-mode-p) (org-at-heading-p))))
 	  (error "No match for target regexp in file %s" (nth 1 target))))
 
-       ((eq (car target) 'file+datetree)
+       ((memq (car target) '(file+datetree file+datetree+prompt))
 	(require 'org-datetree)
 	(set-buffer (org-capture-target-buffer (nth 1 target)))
 	;; Make a date tree entry, with the current date (or yesterday,
 	;; if we are extending dates for a couple of hours)
 	(org-datetree-find-date-create
 	 (calendar-gregorian-from-absolute
-	  (if org-overriding-default-time
-	      (time-to-days org-overriding-default-time)
-	    (time-to-days
-	     (time-subtract (current-time)
-			    (list 0 (* 3600 org-extend-today-until) 0)))))))
+	  (cond
+
+	   (org-overriding-default-time
+	    ;; use the overriding default time
+	    (time-to-days org-overriding-default-time))
 
+	   ((eq (car target) 'file+datetree+prompt)
+	    ;; prompt for date
+	    (time-to-days (org-read-date 
+			   nil t nil "Date for tree entry:"
+			   (days-to-time (org-today)))))
+	   (t
+	    ;; current date, possible corrected for late night workers
+	    (org-today))))))
+       
        ((eq (car target) 'file+function)
 	(set-buffer (org-capture-target-buffer (nth 1 target)))
 	(funcall (nth 2 target))
@@ -1358,5 +1389,3 @@
 ;; arch-tag: 986bf41b-8ada-4e28-bf20-e8388a7205a0
 
 ;;; org-capture.el ends here
-
-
--- a/lisp/org/org-clock.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/org-clock.el	Thu Dec 16 18:30:57 2010 -0500
@@ -6,7 +6,7 @@
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 ;;
 ;; This file is part of GNU Emacs.
 ;;
@@ -34,7 +34,7 @@
 (eval-when-compile
   (require 'cl))
 
-(declare-function calendar-absolute-from-iso    "cal-iso"    (&optional date))
+(declare-function calendar-absolute-from-iso "cal-iso" (&optional date))
 (declare-function notifications-notify "notifications" (&rest params))
 (defvar org-time-stamp-formats)
 
@@ -222,9 +222,46 @@
 	  (string :tag "Program")
 	  (function :tag "Function")))
 
+(defgroup org-clocktable nil
+  "Options concerning the clock table in Org-mode."
+  :tag "Org Clock Table"
+  :group 'org-clock)
+
+(defcustom org-clocktable-defaults
+  (list
+   :maxlevel 2
+   :scope 'file
+   :block nil
+   :tstart nil
+   :tend nil
+   :step nil
+   :stepskip0 nil
+   :fileskip0 nil
+   :tags nil
+   :emphasize nil
+   :link nil
+   :narrow '40!
+   :indent t
+   :formula nil
+   :timestamp nil
+   :level nil
+   :tcolumns nil
+   :formatter nil)
+  "Default properties for clock tables."
+  :group 'org-clock
+  :type 'plist)
+
+(defcustom org-clock-clocktable-formatter 'org-clocktable-write-default
+  "Function to turn clocking data into a table.
+For more information, see `org-clocktable-write-default'."
+  :group 'org-clocktable
+  :type 'function)
+
 (defcustom org-clock-clocktable-default-properties '(:maxlevel 2 :scope file)
-  "Default properties for new clocktables."
-  :group 'org-clock
+  "Default properties for new clocktables.
+These will be inserted into the BEGIN line, to make it easy for users to
+play with them."
+  :group 'org-clocktable
   :type 'plist)
 
 (defcustom org-clock-idle-time nil
@@ -1586,7 +1623,7 @@
     (font-lock-fontify-buffer)
     (forward-line 2)
     (buffer-substring (point) (progn
-				(re-search-forward "^#\\+END" nil t)
+				(re-search-forward "^[ \t]*#\\+END" nil t)
 				(point-at-bol)))))
 
 (defun org-clock-report (&optional arg)
@@ -1611,12 +1648,68 @@
   (let ((pos (point)) start)
     (save-excursion
       (end-of-line 1)
-      (and (re-search-backward "^#\\+BEGIN:[ \t]+clocktable" nil t)
+      (and (re-search-backward "^[ \t]*#\\+BEGIN:[ \t]+clocktable" nil t)
 	   (setq start (match-beginning 0))
-	   (re-search-forward "^#\\+END:.*" nil t)
+	   (re-search-forward "^[ \t]*#\\+END:.*" nil t)
 	   (>= (match-end 0) pos)
 	   start))))
 
+(defun org-day-of-week (day month year)
+  "Returns the day of the week as an integer."
+  (nth 6
+       (decode-time
+	(date-to-time
+	 (format "%d-%02d-%02dT00:00:00" year month day)))))
+
+(defun org-quarter-to-date (quarter year)
+  "Get the date (week day year) of the first day of a given quarter."
+  (let (startday)
+    (cond
+     ((= quarter 1)
+      (setq startday (org-day-of-week 1 1 year))
+      (cond
+       ((= startday 0)
+	(list 52 7 (- year 1)))
+       ((= startday 6)
+	(list 52 6 (- year 1)))
+       ((<= startday 4)
+	(list 1 startday year))
+       ((> startday 4)
+	(list 53 startday (- year 1)))
+       )
+      )
+     ((= quarter 2)
+      (setq startday (org-day-of-week 1 4 year))
+      (cond
+       ((= startday 0)
+	(list 13 startday year))
+       ((< startday 4)
+	(list 14 startday year))
+       ((>= startday 4)
+	(list 13 startday year))
+       )
+      )
+     ((= quarter 3)
+      (setq startday (org-day-of-week 1 7 year))
+      (cond
+       ((= startday 0)
+	(list 26 startday year))
+       ((< startday 4)
+	(list 27 startday year))
+       ((>= startday 4)
+	(list 26 startday year))
+       )
+      )
+     ((= quarter 4)
+      (setq startday (org-day-of-week 1 10 year))
+      (cond
+       ((= startday 0)
+	(list 39 startday year))
+       ((<= startday 4)
+	(list 40 startday year))
+       ((> startday 4)
+	(list 39 startday year)))))))
+
 (defun org-clock-special-range (key &optional time as-strings)
   "Return two times bordering a special time range.
 Key is a symbol specifying the range and can be one of `today', `yesterday',
@@ -1633,7 +1726,12 @@
 	 (dow (nth 6 tm))
 	 (skey (symbol-name key))
 	 (shift 0)
-	 s1 m1 h1 d1 month1 y1 diff ts te fm txt w date)
+         (q (cond ((>= (nth 4 tm) 10) 4)
+                  ((>= (nth 4 tm) 7) 3)
+                  ((>= (nth 4 tm) 4) 2)
+                  ((>= (nth 4 tm) 1) 1)))
+	 s1 m1 h1 d1 month1 y1 diff ts te fm txt w date
+	 interval tmp shiftedy shiftedm shiftedq)
     (cond
      ((string-match "^[0-9]+$" skey)
       (setq y (string-to-number skey) m 1 d 1 key 'year))
@@ -1650,6 +1748,15 @@
       (setq d (nth 1 date) month (car date) y (nth 2 date)
 	    dow 1
 	    key 'week))
+      ((string-match "^\\([0-9]+\\)-[qQ]\\([1-4]\\)$" skey)
+       (require 'cal-iso)
+       (setq y (string-to-number (match-string 1 skey)))
+       (setq q (string-to-number (match-string 2 skey)))
+       (setq date (calendar-gregorian-from-absolute
+                   (calendar-absolute-from-iso (org-quarter-to-date q y))))
+       (setq d (nth 1 date) month (car date) y (nth 2 date)
+            dow 1
+            key 'quarter))
      ((string-match "^\\([0-9]+\\)-\\([0-9]\\{1,2\\}\\)-\\([0-9]\\{1,2\\}\\)$" skey)
       (setq y (string-to-number (match-string 1 skey))
 	    month (string-to-number (match-string 2 skey))
@@ -1657,12 +1764,17 @@
 	    key 'day))
      ((string-match "\\([-+][0-9]+\\)$" skey)
       (setq shift (string-to-number (match-string 1 skey))
-	    key (intern (substring skey 0 (match-beginning 1))))))
+            key (intern (substring skey 0 (match-beginning 1))))
+       (if(and (memq key '(quarter thisq)) (> shift 0))
+         (error "Looking forward with quarters isn't implemented.")
+        ())))
+
     (when (= shift 0)
-      (cond ((eq key 'yesterday) (setq key 'today shift -1))
-	    ((eq key 'lastweek)  (setq key 'week  shift -1))
-	    ((eq key 'lastmonth) (setq key 'month shift -1))
-	    ((eq key 'lastyear)  (setq key 'year  shift -1))))
+       (cond ((eq key 'yesterday) (setq key 'today   shift -1))
+            ((eq key 'lastweek)  (setq key 'week    shift -1))
+            ((eq key 'lastmonth) (setq key 'month   shift -1))
+            ((eq key 'lastyear)  (setq key 'year    shift -1))
+            ((eq key 'lastq)     (setq key 'quarter shift -1))))
     (cond
      ((memq key '(day today))
       (setq d (+ d shift) h 0 m 0 h1 24 m1 0))
@@ -1671,6 +1783,28 @@
 	    m 0 h 0 d (- d diff) d1 (+ 7 d)))
      ((memq key '(month thismonth))
       (setq d 1 h 0 m 0 d1 1 month (+ month shift) month1 (1+ month) h1 0 m1 0))
+     ((memq key '(quarter thisq))
+      ; compute if this shift remains in this year
+      ; if not, compute how many years and quarters we have to shift (via floor*)
+      ; and compute the shifted years, months and quarters
+      (cond
+       ((< (+ (- q 1) shift) 0) ; shift not in this year
+       (setq interval (* -1 (+ (- q 1) shift)))
+       ; set tmp to ((years to shift) (quarters to shift))
+       (setq tmp (org-floor* interval 4))
+       ; due to the use of floor, 0 quarters actually means 4
+       (if (= 0 (nth 1 tmp))
+           (setq shiftedy (- y (nth 0 tmp))
+                 shiftedm 1
+                 shiftedq 1)
+         (setq shiftedy (- y (+ 1 (nth 0 tmp)))
+               shiftedm (- 13 (* 3 (nth 1 tmp)))
+               shiftedq (- 5 (nth 1 tmp))))
+       (setq d 1 h 0 m 0 d1 1 month shiftedm month1 (+ 3 shiftedm) h1 0 m1 0 y shiftedy))
+       ((> (+ q shift) 0) ; shift is whitin this year
+       (setq shiftedq (+ q shift))
+       (setq shiftedy y)
+       (setq d 1 h 0 m 0 d1 1 month (+ 1 (* 3 (- (+ q shift) 1))) month1 (+ 4 (* 3 (- (+ q shift) 1))) h1 0 m1 0))))
      ((memq key '(year thisyear))
       (setq m 0 h 0 d 1 month 1 y (+ y shift) y1 (1+ y)))
      (t (error "No such time block %s" key)))
@@ -1686,11 +1820,21 @@
      ((memq key '(month thismonth))
       (setq txt (format-time-string "%B %Y" ts)))
      ((memq key '(year thisyear))
-      (setq txt (format-time-string "the year %Y" ts))))
+      (setq txt (format-time-string "the year %Y" ts)))
+     ((memq key '(quarter thisq))
+      (setq txt (concatenate 'string (org-count-quarter shiftedq) " quarter of " (number-to-string shiftedy))))
+     )
     (if as-strings
 	(list (format-time-string fm ts) (format-time-string fm te) txt)
       (list ts te txt))))
 
+(defun org-count-quarter (n)
+  (cond
+   ((= n 1) "1st")
+   ((= n 2) "2nd")
+   ((= n 3) "3rd")
+   ((= n 4) "4th")))
+
 (defun org-clocktable-shift (dir n)
   "Try to shift the :block date of the clocktable at point.
 Point must be in the #+BEGIN: line of a clocktable, or this function
@@ -1704,7 +1848,7 @@
   (and (memq dir '(left down)) (setq n (- n)))
   (save-excursion
     (goto-char (point-at-bol))
-    (if (not (looking-at "#\\+BEGIN: clocktable\\>.*?:block[ \t]+\\(\\S-+\\)"))
+    (if (not (looking-at "^[ \t]*#\\+BEGIN:[ \t]+clocktable\\>.*?:block[ \t]+\\(\\S-+\\)"))
 	(error "Line needs a :block definition before this command works")
       (let* ((b (match-beginning 1)) (e (match-end 1))
 	     (s (match-string 1))
@@ -1713,90 +1857,95 @@
 	 ((equal s "yesterday") (setq s "today-1"))
 	 ((equal s "lastweek") (setq s "thisweek-1"))
 	 ((equal s "lastmonth") (setq s "thismonth-1"))
-	 ((equal s "lastyear") (setq s "thisyear-1")))
-	(cond
-	 ((string-match "^\\(today\\|thisweek\\|thismonth\\|thisyear\\)\\([-+][0-9]+\\)?$" s)
-	  (setq block (match-string 1 s)
-		shift (if (match-end 2)
-			  (string-to-number (match-string 2 s))
-			0))
-	  (setq shift (+ shift n))
-	  (setq ins (if (= shift 0) block (format "%s%+d" block shift))))
-	 ((string-match "\\([0-9]+\\)\\(-\\([wW]?\\)\\([0-9]\\{1,2\\}\\)\\(-\\([0-9]\\{1,2\\}\\)\\)?\\)?" s)
-	  ;;               1        1  2   3       3  4                4  5   6                6  5   2
-	  (setq y (string-to-number (match-string 1 s))
-		wp (and (match-end 3) (match-string 3 s))
-		mw (and (match-end 4) (string-to-number (match-string 4 s)))
-		d (and (match-end 6) (string-to-number (match-string 6 s))))
-	  (cond
-	   (d (setq ins (format-time-string
-			 "%Y-%m-%d"
-			 (encode-time 0 0 0 (+ d n) m y))))
-	   ((and wp mw (> (length wp) 0))
-	    (require 'cal-iso)
-	    (setq date (calendar-gregorian-from-absolute (calendar-absolute-from-iso (list (+ mw n) 1 y))))
-	    (setq ins (format-time-string
-		       "%G-W%V"
-		       (encode-time 0 0 0 (nth 1 date) (car date) (nth 2 date)))))
-	   (mw
-	    (setq ins (format-time-string
-		       "%Y-%m"
-		       (encode-time 0 0 0 1 (+ mw n) y))))
-	   (y
-	    (setq ins (number-to-string (+ y n))))))
-	 (t (error "Cannot shift clocktable block")))
-	(when ins
-	  (goto-char b)
-	  (insert ins)
-	  (delete-region (point) (+ (point) (- e b)))
-	  (beginning-of-line 1)
-	  (org-update-dblock)
-	  t)))))
+	 ((equal s "lastyear") (setq s "thisyear-1"))
+	 ((equal s "lastq") (setq s "thisq-1")))
+
+       (cond
+        ((string-match "^\\(today\\|thisweek\\|thismonth\\|thisyear\\|thisq\\)\\([-+][0-9]+\\)?$" s)
+         (setq block (match-string 1 s)
+               shift (if (match-end 2)
+                         (string-to-number (match-string 2 s))
+                       0))
+         (setq shift (+ shift n))
+         (setq ins (if (= shift 0) block (format "%s%+d" block shift))))
+	((string-match "\\([0-9]+\\)\\(-\\([wWqQ]?\\)\\([0-9]\\{1,2\\}\\)\\(-\\([0-9]\\{1,2\\}\\)\\)?\\)?" s)
+        ;;               1        1  2   3       3  4                  4  5   6                6  5   2
+         (setq y (string-to-number (match-string 1 s))
+               wp (and (match-end 3) (match-string 3 s))
+               mw (and (match-end 4) (string-to-number (match-string 4 s)))
+	       d (and (match-end 6) (string-to-number (match-string 6 s))))
+	 (cond
+	  (d (setq ins (format-time-string
+                        "%Y-%m-%d"
+                        (encode-time 0 0 0 (+ d n) m y))))
+          ((and wp (string-match "w\\|W" wp) mw (> (length wp) 0))
+           (require 'cal-iso)
+           (setq date (calendar-gregorian-from-absolute (calendar-absolute-from-iso (list (+ mw n) 1 y))))
+           (setq ins (format-time-string
+                      "%G-W%V"
+                      (encode-time 0 0 0 (nth 1 date) (car date) (nth 2 date)))))
+	  ((and wp (string-match "q\\|Q" wp) mw (> (length wp) 0))
+           (require 'cal-iso)
+	   ; if the 4th + 1 quarter is requested we flip to the 1st quarter of the next year
+           (if (> (+ mw n) 4)
+               (setq mw 0
+                     y (+ 1 y))
+	     ())
+	   ; if the 1st - 1 quarter is requested we flip to the 4th quarter of the previous year
+           (if (= (+ mw n) 0)
+               (setq mw 5
+                     y (- y 1))
+             ())
+           (setq date (calendar-gregorian-from-absolute (calendar-absolute-from-iso (org-quarter-to-date (+ mw n) y))))
+           (setq ins (format-time-string
+                      (concatenate 'string (number-to-string y) "-Q" (number-to-string (+ mw n)))
+                      (encode-time 0 0 0 (nth 1 date) (car date) (nth 2 date)))))
+          (mw
+           (setq ins (format-time-string
+                      "%Y-%m"
+		      (encode-time 0 0 0 1 (+ mw n) y))))
+	  (y
+	   (setq ins (number-to-string (+ y n))))))
+	(t (error "Cannot shift clocktable block")))
+       (when ins
+	 (goto-char b)
+	 (insert ins)
+	 (delete-region (point) (+ (point) (- e b)))
+	 (beginning-of-line 1)
+	 (org-update-dblock)
+	 t)))))
 
 (defun org-dblock-write:clocktable (params)
   "Write the standard clocktable."
+  (setq params (org-combine-plists org-clocktable-defaults params))
   (catch 'exit
-    (let* ((hlchars '((1 . "*") (2 . "/")))
-	   (ins (make-marker))
-	   (total-time nil)
-	   (scope (plist-get params :scope))
-	   (tostring (plist-get  params :tostring))
-	   (multifile (plist-get  params :multifile))
-	   (header (plist-get  params :header))
+    (let* ((scope (plist-get params :scope))
+	   (block (plist-get params :block))
+	   (ts (plist-get params :tstart))
+	   (te (plist-get params :tend))
+	   (link (plist-get params :link))
 	   (maxlevel (or (plist-get params :maxlevel) 3))
 	   (step (plist-get params :step))
-	   (emph (plist-get params :emphasize))
 	   (timestamp (plist-get params :timestamp))
-	   (ts (plist-get params :tstart))
-	   (te (plist-get params :tend))
-	   (block (plist-get params :block))
-	   (link (plist-get params :link))
-	   (tags (plist-get params :tags))
-	   (matcher (if tags (cdr (org-make-tags-matcher tags))))
-	   ipos time p level hlc hdl tsp props content recalc formula pcol
-	   cc beg end pos tbl tbl1 range-text rm-file-column scope-is-list st)
-      (setq org-clock-file-total-minutes nil)
+	   (formatter (or (plist-get params :formatter)
+			  org-clock-clocktable-formatter
+			  'org-clocktable-write-default))
+	   cc range-text ipos pos one-file-with-archives
+	   scope-is-list tbls level)
+
+      ;; Check if we need to do steps
+      (when block
+	;; Get the range text for the header
+	(setq cc (org-clock-special-range block nil t)
+	      ts (car cc) te (nth 1 cc) range-text (nth 2 cc)))
       (when step
+	;; Write many tables, in steps
 	(unless (or block (and ts te))
 	  (error "Clocktable `:step' can only be used with `:block' or `:tstart,:end'"))
 	(org-clocktable-steps params)
 	(throw 'exit nil))
-      (when block
-	(setq cc (org-clock-special-range block nil t)
-	      ts (car cc) te (nth 1 cc) range-text (nth 2 cc)))
-      (when (integerp ts) (setq ts (calendar-gregorian-from-absolute ts)))
-      (when (integerp te) (setq te (calendar-gregorian-from-absolute te)))
-      (when (and ts (listp ts))
-	(setq ts (format "%4d-%02d-%02d" (nth 2 ts) (car ts) (nth 1 ts))))
-      (when (and te (listp te))
-	(setq te (format "%4d-%02d-%02d" (nth 2 te) (car te) (nth 1 te))))
-      ;; Now the times are strings we can parse.
-      (if ts (setq ts (org-float-time
-		       (apply 'encode-time (org-parse-time-string ts)))))
-      (if te (setq te (org-float-time
-		       (apply 'encode-time (org-parse-time-string te)))))
-      (move-marker ins (point))
-      (setq ipos (point))
+
+      (setq ipos (point)) ; remember the insertion position
 
       ;; Get the right scope
       (setq pos (point))
@@ -1810,166 +1959,271 @@
 	(setq scope (org-add-archive-files scope)))
        ((eq scope 'file-with-archives)
 	(setq scope (org-add-archive-files (list (buffer-file-name)))
-	      rm-file-column t)))
+	      one-file-with-archives t)))
       (setq scope-is-list (and scope (listp scope)))
-      (save-restriction
-	(cond
-	 ((not scope))
-	 ((eq scope 'file) (widen))
-	 ((eq scope 'subtree) (org-narrow-to-subtree))
-	 ((eq scope 'tree)
-	  (while (org-up-heading-safe))
-	  (org-narrow-to-subtree))
-	 ((and (symbolp scope) (string-match "^tree\\([0-9]+\\)$"
-					     (symbol-name scope)))
-	  (setq level (string-to-number (match-string 1 (symbol-name scope))))
-	  (catch 'exit
-	    (while (org-up-heading-safe)
-	      (looking-at outline-regexp)
-	      (if (<= (org-reduced-level (funcall outline-level)) level)
-		  (throw 'exit nil))))
-	  (org-narrow-to-subtree))
-	 (scope-is-list
+      (if scope-is-list
+	  ;; we collect from several files
 	  (let* ((files scope)
-		 (scope 'agenda)
-		 (p1 (copy-sequence params))
 		 file)
-	    (setq p1 (plist-put p1 :tostring t))
-	    (setq p1 (plist-put p1 :multifile t))
-	    (setq p1 (plist-put p1 :scope 'file))
 	    (org-prepare-agenda-buffers files)
 	    (while (setq file (pop files))
 	      (with-current-buffer (find-buffer-visiting file)
-		(setq org-clock-file-total-minutes 0)
-		(setq tbl1 (org-dblock-write:clocktable p1))
-		(when tbl1
-		  (push (org-clocktable-add-file
-			 file
-			 (concat "| |*File time*|*"
-				 (org-minutes-to-hh:mm-string
-				  org-clock-file-total-minutes)
-				 "*|\n"
-				 tbl1)) tbl)
-		  (setq total-time (+ (or total-time 0)
-				      org-clock-file-total-minutes))))))))
-	(goto-char pos)
+		(save-excursion
+		  (save-restriction
+		    (push (org-clock-get-table-data file params) tbls))))))
+	;; Just from the current file
+	(save-restriction
+	  ;; get the right range into the restriction
+	  (org-prepare-agenda-buffers (list (buffer-file-name)))
+	  (cond
+	   ((not scope))  ; use the restriction as it is now
+	   ((eq scope 'file) (widen))
+	   ((eq scope 'subtree) (org-narrow-to-subtree))
+	   ((eq scope 'tree)
+	    (while (org-up-heading-safe))
+	    (org-narrow-to-subtree))
+	   ((and (symbolp scope) (string-match "^tree\\([0-9]+\\)$"
+					       (symbol-name scope)))
+	    (setq level (string-to-number (match-string 1 (symbol-name scope))))
+	    (catch 'exit
+	      (while (org-up-heading-safe)
+		(looking-at outline-regexp)
+		(if (<= (org-reduced-level (funcall outline-level)) level)
+		    (throw 'exit nil))))
+	    (org-narrow-to-subtree)))
+	  ;; do the table, with no file name.
+	  (push (org-clock-get-table-data nil params) tbls)))
+
+      ;; OK, at this point we tbls as a list of tables, one per file
+      (setq tbls (nreverse tbls))
+
+      (setq params (plist-put params :multifile scope-is-list))
+      (setq params (plist-put params :one-file-with-archives
+			      one-file-with-archives))
+
+      (funcall formatter ipos tbls params))))
+
+(defun org-clocktable-write-default (ipos tables params)
+  "Write out a clock table at position IPOS in the current buffer.
+TABLES is a list of tables with clocking data as produced by
+`org-clock-get-table-data'.  PARAMS is the parameter property list obtained
+from the dynamic block defintion."
+  ;; This function looks quite complicated, mainly because there are a lot
+  ;; of options which can add or remove columns.  I have massively commented
+  ;; function, to I hope it is understandable.  If someone want to write
+  ;; there own special formatter, this maybe much easier because there can
+  ;; be a fixed format with a well-defined number of columns...
+  (let* ((hlchars '((1 . "*") (2 . "/")))
+	 (multifile (plist-get params :multifile))
+	 (block (plist-get params :block))
+	 (ts (plist-get params :tstart))
+	 (te (plist-get params :tend))
+	 (header (plist-get  params :header))
+	 (narrow (plist-get params :narrow))
+	 (link (plist-get params :link))
+	 (maxlevel (or (plist-get params :maxlevel) 3))
+	 (emph (plist-get params :emphasize))
+	 (level-p (plist-get params :level))
+	 (timestamp (plist-get params :timestamp))
+	 (ntcol (max 1 (or (plist-get params :tcolumns) 100)))
+	 (rm-file-column (plist-get params :one-file-with-archives))
+	 (indent (plist-get params :indent))
+	 range-text total-time tbl level hlc formula pcol
+	 file-time entries entry headline
+	 recalc content narrow-cut-p tcol)
+
+    ;; Implement abbreviations
+    (when (plist-get params :compact)
+      (setq level nil indent t narrow (or narrow '40!) ntcol 1))
+
+    ;; Some consistency test for parameters
+      (unless (integerp ntcol)
+	(setq params (plist-put params :tcolumns (setq ntcol 100))))
+
+      (when (and narrow (integerp narrow) link)
+	;; We cannot have both integer narrow and link
+	(message
+	 "Using hard narrowing in clocktable to allow for links")
+	(setq narrow (intern (format "%d!" narrow))))
+
+      (when narrow
+	(cond
+	 ((integerp narrow))
+	 ((and (symbolp narrow)
+	       (string-match "\\`[0-9]+!\\'" (symbol-name narrow)))
+	  (setq narrow-cut-p t
+		narrow (string-to-number (substring (symbol-name narrow)
+						    0 -1))))
+	 (t
+	  (error "Invalid value %s of :narrow property in clock table"
+		 narrow))))
+
+      (when block
+	;; Get the range text for the header
+	(setq range-text (nth 2 (org-clock-special-range block nil t))))
+
+      ;; Compute the total time
+      (setq total-time (apply '+ (mapcar 'cadr tables)))
+
+      ;; Now we need to output this tsuff
+      (goto-char ipos)
+
+      ;; Insert the text *before* the actual table
+      (insert-before-markers
+       (or header
+	   ;; Format the standard header
+	   (concat
+	    "Clock summary at ["
+	    (substring
+	     (format-time-string (cdr org-time-stamp-formats))
+	     1 -1)
+	    "]"
+	    (if block (concat ", for " range-text ".") "")
+	    "\n\n")))
+
+      ;; Insert the narrowing line
+      (when (and narrow (integerp narrow) (not narrow-cut-p))
+	(insert-before-markers
+	 "|"                            ; table line starter
+	 (if multifile "|" "")          ; file column, maybe
+	 (if level-p   "|" "")          ; level column, maybe
+	 (if timestamp "|" "")          ; timestamp column, maybe
+	 (format "<%d>| |\n" narrow)))  ; headline and time columns
 
-	(unless scope-is-list
-	  (org-clock-sum ts te
-			 (unless (null matcher)
-			   (lambda ()
-			     (let ((tags-list
-				    (org-split-string
-				     (or (org-entry-get (point) "ALLTAGS") "")
-				     ":")))
-			       (eval matcher)))))
-	  (goto-char (point-min))
-	  (setq st t)
-	  (while (or (and (bobp) (prog1 st (setq st nil))
-			  (get-text-property (point) :org-clock-minutes)
-			  (setq p (point-min)))
-		     (setq p (next-single-property-change (point) :org-clock-minutes)))
-	    (goto-char p)
-	    (when (setq time (get-text-property p :org-clock-minutes))
-	      (save-excursion
-		(beginning-of-line 1)
-		(when (and (looking-at (org-re "\\(\\*+\\)[ \t]+\\(.*?\\)\\([ \t]+:[[:alnum:]_@#%:]+:\\)?[ \t]*$"))
-			   (setq level (org-reduced-level
-					(- (match-end 1) (match-beginning 1))))
-			   (<= level maxlevel))
-		  (setq hlc (if emph (or (cdr (assoc level hlchars)) "") "")
-			hdl (if (not link)
-				(match-string 2)
-			      (org-make-link-string
-			       (format "file:%s::%s"
-				       (buffer-file-name)
-				       (save-match-data
-					 (org-make-org-heading-search-string
-					  (match-string 2))))
-			       (match-string 2)))
-			tsp (when timestamp
-			      (setq props (org-entry-properties (point)))
-			      (or (cdr (assoc "SCHEDULED" props))
-				  (cdr (assoc "TIMESTAMP" props))
-				  (cdr (assoc "DEADLINE" props))
-				  (cdr (assoc "TIMESTAMP_IA" props)))))
-		  (if (and (not multifile) (= level 1)) (push "|-" tbl))
-		  (push (concat
-			 "| " (int-to-string level) "|"
-			 (if timestamp (concat tsp "|") "")
-			 hlc hdl hlc " |"
-			 (make-string (1- level) ?|)
-			 hlc (org-minutes-to-hh:mm-string time) hlc
-			 " |") tbl))))))
-	(setq tbl (nreverse tbl))
-	(if tostring
-	    (if tbl (mapconcat 'identity tbl "\n") nil)
-	  (goto-char ins)
-	  (insert-before-markers
-	   (or header
-	       (concat
-		"Clock summary at ["
-		(substring
-		 (format-time-string (cdr org-time-stamp-formats))
-		 1 -1)
-		"]"
-		(if block (concat ", for " range-text ".") "")
-		"\n\n"))
-	   (if scope-is-list "|File" "")
-	   "|L|" (if timestamp "Timestamp|" "") "Headline|Time|\n")
-	  (setq total-time (or total-time org-clock-file-total-minutes))
-	  (insert-before-markers
-	   "|-\n|"
-	   (if scope-is-list "|" "")
-	   (if timestamp "|Timestamp|" "|")
-	   "*Total time*| *"
-	   (org-minutes-to-hh:mm-string (or total-time 0))
-	   "*|\n|-\n")
-	  (setq tbl (delq nil tbl))
-	  (if (and (stringp (car tbl)) (> (length (car tbl)) 1)
-		   (equal (substring (car tbl) 0 2) "|-"))
-	      (pop tbl))
-	  (insert-before-markers (mapconcat
-				  'identity (delq nil tbl)
-				  (if scope-is-list "\n|-\n" "\n")))
-	  (backward-delete-char 1)
-	  (if (setq formula (plist-get params :formula))
-	      (cond
-	       ((eq formula '%)
-		(setq pcol (+ (if scope-is-list 1 0) maxlevel 3))
-		(insert
-		 (format
-		  "\n#+TBLFM: $%d='(org-clock-time%% @%d$%d $%d..$%d);%%.1f"
-		  pcol
-		  2
-		  (+ 3 (if scope-is-list 1 0))
-		  (+ (if scope-is-list 1 0) 3)
-		  (1- pcol)))
-		(setq recalc t))
-	       ((stringp formula)
-		(insert "\n#+TBLFM: " formula)
-		(setq recalc t))
-	       (t (error "invalid formula in clocktable")))
-	    ;; Should we rescue an old formula?
-	    (when (stringp (setq content (plist-get params :content)))
-	      (when (string-match "^\\([ \t]*#\\+TBLFM:.*\\)" content)
-		(setq recalc t)
-		(insert "\n" (match-string 1 (plist-get params :content)))
-		(beginning-of-line 0))))
-	  (goto-char ipos)
-	  (skip-chars-forward "^|")
-	  (org-table-align)
-	  (when recalc
-	    (if (eq formula '%)
-		(save-excursion (org-table-goto-column pcol nil 'force)
-				(insert "%")))
-	    (org-table-recalculate 'all))
-	  (when rm-file-column
-	    (forward-char 1)
-	    (org-table-delete-column))
-	  total-time)))))
+      ;; Insert the table header line
+      (insert-before-markers
+       "|"                              ; table line starter
+       (if multifile "File|"      "")   ; file column, maybe
+       (if level-p   "L|"         "")   ; level column, maybe
+       (if timestamp "Timestamp|" "")   ; timestamp column, maybe
+       "Headline|Time|\n")              ; headline and time columns
+
+      ;; Insert the total time in the table
+      (insert-before-markers
+       "|-\n"                           ; a hline
+       "|"                              ; table line starter
+       (if multifile "| ALL " "")       ; file column, maybe
+       (if level-p   "|"      "")       ; level column, maybe
+       (if timestamp "|"      "")       ; timestamp column, maybe
+       "*Total time*| "                 ; instead of a headline
+       "*"
+       (org-minutes-to-hh:mm-string (or total-time 0)) ; the time
+       "*|\n")                          ; close line
+
+      ;; Now iterate over the tables and insert the data
+      ;; but only if any time has been collected
+      (when (and total-time (> total-time 0))
+
+	(while (setq tbl (pop tables))
+	  ;; now tbl is the table resulting from one file.
+	  (setq file-time (nth 1 tbl))
+	  (when (or (and file-time (> file-time 0))
+		    (not (plist-get params :fileskip0)))
+	    (insert-before-markers "|-\n")  ; a hline because a new file starts
+	    ;; First the file time, if we have multiple files
+	    (when multifile
+	      ;; Summarize the time colleted from this file
+	      (insert-before-markers
+	       (format "| %s %s | %s*File time* | *%s*|\n"
+		       (file-name-nondirectory (car tbl))
+		       (if level-p   "| " "") ; level column, maybe
+		       (if timestamp "| " "") ; timestamp column, maybe
+		       (org-minutes-to-hh:mm-string (nth 1 tbl))))) ; the time
+
+	    ;; Get the list of node entries and iterate over it
+	    (setq entries (nth 2 tbl))
+	    (while (setq entry (pop entries))
+	      (setq level (car entry)
+		    headline (nth 1 entry)
+		    hlc (if emph (or (cdr (assoc level hlchars)) "") ""))
+	      (when narrow-cut-p
+		(if (and (string-match (concat "\\`" org-bracket-link-regexp
+					       "\\'")
+				       headline)
+			 (match-end 3))
+		    (setq headline
+			  (format "[[%s][%s]]"
+				  (match-string 1 headline)
+				  (org-shorten-string (match-string 3 headline)
+						      narrow)))
+		  (setq headline (org-shorten-string headline narrow))))
+	      (insert-before-markers
+	       "|"                      ; start the table line
+	       (if multifile "|" "")    ; free space for file name column?
+	       (if level-p (format "%d|" (car entry)) "")   ; level, maybe
+	       (if timestamp (concat (nth 2 entry) "|") "") ; timestamp, maybe
+	       (if indent (org-clocktable-indent-string level) "") ; indentation
+	       hlc headline hlc "|"                                ; headline
+	       (make-string (min (1- ntcol) (or (- level 1))) ?|)
+					; empty fields for higher levels
+	       hlc (org-minutes-to-hh:mm-string (nth 3 entry)) hlc ; time
+	       "|\n"                                               ; close line
+	       )))))
+      (backward-delete-char 1)
+      (if (setq formula (plist-get params :formula))
+	  (cond
+	   ((eq formula '%)
+	    ;; compute the column where the % numbers need to go
+	    (setq pcol (+ 2
+			  (if multifile 1 0)
+			  (if level-p 1 0)
+			  (if timestamp 1 0)
+			  (min maxlevel (or ntcol 100))))
+	    ;; compute the column where the total time is
+	    (setq tcol (+ 2
+			  (if multifile 1 0)
+			  (if level-p 1 0)
+			  (if timestamp 1 0)))
+	    (insert
+	     (format
+	      "\n#+TBLFM: $%d='(org-clock-time%% @%d$%d $%d..$%d);%%.1f"
+	      pcol            ; the column where the % numbers should go
+	      (if (and narrow (not narrow-cut-p)) 3 2) ; row of the total time
+	      tcol            ; column of the total time
+	      tcol (1- pcol)  ; range of columns where times can be found
+	      ))
+	    (setq recalc t))
+	   ((stringp formula)
+	    (insert "\n#+TBLFM: " formula)
+	    (setq recalc t))
+	   (t (error "invalid formula in clocktable")))
+	;; Should we rescue an old formula?
+	(when (stringp (setq content (plist-get params :content)))
+	  (when (string-match "^\\([ \t]*#\\+TBLFM:.*\\)" content)
+	    (setq recalc t)
+	    (insert "\n" (match-string 1 (plist-get params :content)))
+	    (beginning-of-line 0))))
+      ;; Back to beginning, align the table, recalculate if necessary
+      (goto-char ipos)
+      (skip-chars-forward "^|")
+      (org-table-align)
+      (when org-hide-emphasis-markers
+	;; we need to align a second time
+	(org-table-align))
+      (when recalc
+	(if (eq formula '%)
+	    (save-excursion
+	      (if (and narrow (not narrow-cut-p)) (beginning-of-line 2))
+	      (org-table-goto-column pcol nil 'force)
+	      (insert "%")))
+	(org-table-recalculate 'all))
+      (when rm-file-column
+	;; The file column is actually not wanted
+	(forward-char 1)
+	(org-table-delete-column))
+      total-time))
+
+(defun org-clocktable-indent-string (level)
+  (if (= level 1)
+      ""
+    (let ((str "\\__"))
+      (while (> level 2)
+	(setq level (1- level)
+	      str (concat str "___")))
+      (concat str " "))))
 
 (defun org-clocktable-steps (params)
+  "Step through the range to make a number of clock tables."
   (let* ((p1 (copy-sequence params))
 	 (ts (plist-get p1 :tstart))
 	 (te (plist-get p1 :tend))
@@ -2008,29 +2262,107 @@
       (setq p1 (plist-put p1 :tend (format-time-string
 				    (org-time-stamp-format nil t)
 				    (seconds-to-time (setq ts (+ ts step))))))
-      (insert "\n" (if (eq step0 'day) "Daily report: " "Weekly report starting on: ")
+      (insert "\n" (if (eq step0 'day) "Daily report: "
+		     "Weekly report starting on: ")
 	      (plist-get p1 :tstart) "\n")
       (setq step-time (org-dblock-write:clocktable p1))
-      (re-search-forward "#\\+END:")
+      (re-search-forward "^[ \t]*#\\+END:")
       (when (and (equal step-time 0) stepskip0)
 	;; Remove the empty table
 	(delete-region (point-at-bol)
 		       (save-excursion
-			 (re-search-backward "^\\(Daily\\|Weekly\\) report" nil t)
+			 (re-search-backward "^\\(Daily\\|Weekly\\) report"
+					     nil t)
 			 (point))))
       (end-of-line 0))))
 
-(defun org-clocktable-add-file (file table)
-  (if table
-      (let ((lines (org-split-string table "\n"))
-	    (ff (file-name-nondirectory file)))
-	(mapconcat 'identity
-		   (mapcar (lambda (x)
-			     (if (string-match org-table-dataline-regexp x)
-				 (concat "|" ff x)
-			       x))
-			   lines)
-		   "\n"))))
+(defun org-clock-get-table-data (file params)
+  "Get the clocktable data for file FILE, with parameters PARAMS.
+FILE is only for identification - this function assumes that
+the correct buffer is current, and that the wanted restriction is
+in place.
+The return value will be a list with the file name and the total
+file time (in minutes) as 1st and 2nd elements.  The third element
+of this list will be a list of headline entries.  Each entry has the
+following structure:
+
+  (LEVEL HEADLINE TIMESTAMP TIME)
+
+LEVEL:     The level of the headline, as an integer.  This will be
+           the reduced leve, so 1,2,3,... even if only odd levels
+           are being used.
+HEADLINE:  The text of the headline.  Depending on PARAMS, this may
+           already be formatted like a link.
+TIMESTAMP: If PARAMS require it, this will be a time stamp found in the
+           entry, any of SCHEDULED, DEADLINE, NORMAL, or first inactive,
+           in this sequence.
+TIME:      The sum of all time spend in this tree, in minutes.  This time
+           will of cause be restricted to the time block and tags match
+           specified in PARAMS."
+  (let* ((maxlevel (or (plist-get params :maxlevel) 3))
+	 (timestamp (plist-get params :timestamp))
+	 (ts (plist-get params :tstart))
+	 (te (plist-get params :tend))
+	 (block (plist-get params :block))
+	 (link (plist-get params :link))
+	 (tags (plist-get params :tags))
+	 (matcher (if tags (cdr (org-make-tags-matcher tags))))
+	 cc range-text st p time level hdl props tsp tbl)
+
+    (setq org-clock-file-total-minutes nil)
+    (when block
+      (setq cc (org-clock-special-range block nil t)
+	    ts (car cc) te (nth 1 cc) range-text (nth 2 cc)))
+    (when (integerp ts) (setq ts (calendar-gregorian-from-absolute ts)))
+    (when (integerp te) (setq te (calendar-gregorian-from-absolute te)))
+    (when (and ts (listp ts))
+      (setq ts (format "%4d-%02d-%02d" (nth 2 ts) (car ts) (nth 1 ts))))
+    (when (and te (listp te))
+      (setq te (format "%4d-%02d-%02d" (nth 2 te) (car te) (nth 1 te))))
+    ;; Now the times are strings we can parse.
+    (if ts (setq ts (org-float-time
+		     (apply 'encode-time (org-parse-time-string ts)))))
+    (if te (setq te (org-float-time
+		     (apply 'encode-time (org-parse-time-string te)))))
+    (save-excursion
+      (org-clock-sum ts te
+		     (unless (null matcher)
+		       (lambda ()
+			 (let ((tags-list (org-get-tags-at)))
+			   (eval matcher)))))
+      (goto-char (point-min))
+      (setq st t)
+      (while (or (and (bobp) (prog1 st (setq st nil))
+		      (get-text-property (point) :org-clock-minutes)
+		      (setq p (point-min)))
+		 (setq p (next-single-property-change
+			  (point) :org-clock-minutes)))
+	(goto-char p)
+	(when (setq time (get-text-property p :org-clock-minutes))
+	  (save-excursion
+	    (beginning-of-line 1)
+	    (when (and (looking-at (org-re "\\(\\*+\\)[ \t]+\\(.*?\\)\\([ \t]+:[[:alnum:]_@#%:]+:\\)?[ \t]*$"))
+		       (setq level (org-reduced-level
+				    (- (match-end 1) (match-beginning 1))))
+		       (<= level maxlevel))
+	      (setq hdl (if (not link)
+			    (match-string 2)
+			  (org-make-link-string
+			   (format "file:%s::%s"
+				   (buffer-file-name)
+				   (save-match-data
+				     (org-make-org-heading-search-string
+				      (match-string 2))))
+			   (match-string 2)))
+		    tsp (when timestamp
+			  (setq props (org-entry-properties (point)))
+			  (or (cdr (assoc "SCHEDULED" props))
+			      (cdr (assoc "DEADLINE" props))
+			      (cdr (assoc "TIMESTAMP" props))
+			      (cdr (assoc "TIMESTAMP_IA" props)))))
+	      (when (> time 0) (push (list level hdl tsp time) tbl))))))
+      (setq tbl (nreverse tbl))
+      (list file org-clock-file-total-minutes tbl))))
 
 (defun org-clock-time% (total &rest strings)
   "Compute a time fraction in percent.
@@ -2051,7 +2383,8 @@
 	  (if (string-match "\\([0-9]+\\):\\([0-9]+\\)" s)
 	      (throw 'exit
 		     (/ (* 100.0 (+ (string-to-number (match-string 2 s))
-				    (* 60 (string-to-number (match-string 1 s)))))
+				    (* 60 (string-to-number
+					   (match-string 1 s)))))
 			tot))))
 	0))))
 
@@ -2081,7 +2414,8 @@
 		   (buffer-file-name b)
 		   (or (not org-clock-persist-query-save)
 		       (y-or-n-p (concat "Save current clock ("
-					 (substring-no-properties org-clock-heading)
+					 (substring-no-properties
+					  org-clock-heading)
 					 ") "))))
 	      (insert "(setq resume-clock '(\""
 		      (buffer-file-name (org-clocking-buffer))
@@ -2162,3 +2496,4 @@
 ;; arch-tag: 7b42c5d4-9b36-48be-97c0-66a869daed4c
 
 ;;; org-clock.el ends here
+
--- a/lisp/org/org-colview.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/org-colview.el	Thu Dec 16 18:30:57 2010 -0500
@@ -6,7 +6,7 @@
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 ;;
 ;; This file is part of GNU Emacs.
 ;;
--- a/lisp/org/org-compat.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/org-compat.el	Thu Dec 16 18:30:57 2010 -0500
@@ -6,7 +6,7 @@
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 ;;
 ;; This file is part of GNU Emacs.
 ;;
@@ -372,15 +372,15 @@
       (time-to-seconds (or time (current-time)))
     (float-time time)))
 
-(defun org-string-match-p (&rest args)
-  (if (fboundp 'string-match-p)
-      (apply 'string-match-p args)
+(if (fboundp 'string-match-p)
+    (defalias 'org-string-match-p 'string-match-p)
+  (defun org-string-match-p (regexp string &optional start)
     (save-match-data
-      (apply 'string-match args))))
+      (funcall 'string-match regexp string start))))
 
-(defun org-looking-at-p (&rest args)
-  (if (fboundp 'looking-at-p)
-      (apply 'looking-at-p args)
+(if (fboundp 'looking-at-p)
+    (defalias 'org-looking-at-p 'looking-at-p)
+  (defun org-looking-at-p (&rest args)
     (save-match-data
       (apply 'looking-at args))))
 
@@ -418,6 +418,12 @@
 	      (looking-at (concat "\\(?:"  regexp "\\)\\'")))))
       (not (null pos)))))
 
+(defun org-floor* (x &optional y)
+  "Return a list of the floor of X and the fractional part of X.
+With two arguments, return floor and remainder of their quotient."
+  (let ((q (floor x y)))
+    (list q (- x (if y (* y q) q)))))
+
 (provide 'org-compat)
 
 ;; arch-tag: a0a0579f-e68c-4bdf-9e55-93768b846bbe
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lisp/org/org-complete.el	Thu Dec 16 18:30:57 2010 -0500
@@ -0,0 +1,279 @@
+;;; org-complete.el --- In-buffer completion code
+
+;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
+;;   Free Software Foundation, Inc.
+;;
+;; Author: Carsten Dominik <carsten at orgmode dot org>
+;;         John Wiegley <johnw at gnu dot org>
+;; Keywords: outlines, hypermedia, calendar, wp
+;; Homepage: http://orgmode.org
+;; Version: 7.4
+;;
+;; This file is part of GNU Emacs.
+;;
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;;; Code:
+
+;;;; Require other packages
+
+(eval-when-compile
+  (require 'cl))
+
+(require 'org-macs)
+(require 'pcomplete)
+
+(declare-function org-split-string "org" (string &optional separators))
+(declare-function org-get-current-options "org-exp" ())
+(declare-function org-make-org-heading-search-string "org"
+		  (&optional string heading))
+(declare-function org-get-buffer-tags "org" ())
+(declare-function org-get-tags "org" ())
+(declare-function org-buffer-property-keys "org"
+		  (&optional include-specials include-defaults include-columns))
+(declare-function org-entry-properties "org" (&optional pom which specific))
+
+;;;; Customization variables
+
+(defgroup org-complete nil
+  "Outline-based notes management and organizer."
+  :tag "Org"
+  :group 'org)
+
+(defun org-thing-at-point ()
+  "Examine the thing at point and let the caller know what it is.
+The return value is a string naming the thing at point."
+  (let ((beg1 (save-excursion
+		(skip-chars-backward (org-re "[:alnum:]_@"))
+		(point)))
+	(beg (save-excursion
+	       (skip-chars-backward "a-zA-Z0-9_:$")
+	       (point)))
+	(line-to-here (buffer-substring (point-at-bol) (point))))
+    (cond
+     ((string-match "\\`[ \t]*#\\+begin: clocktable[ \t]+" line-to-here)
+      (cons "block-option" "clocktable"))
+     ((string-match "\\`[ \t]*#\\+begin_src[ \t]+" line-to-here)
+      (cons "block-option" "src"))
+     ((save-excursion
+	(re-search-backward "^[ \t]*#\\+\\([A-Z_]+\\):.*"
+			    (line-beginning-position) t))
+      (cons "file-option" (match-string-no-properties 1)))
+     ((string-match "\\`[ \t]*#\\+[a-zA-Z]*\\'" line-to-here)
+      (cons "file-option" nil))
+     ((equal (char-before beg) ?\[)
+      (cons "link" nil))
+     ((equal (char-before beg) ?\\)
+      (cons "tex" nil))
+     ((string-match "\\`\\*+[ \t]+\\'"
+		    (buffer-substring (point-at-bol) beg))
+      (cons "todo" nil))
+     ((equal (char-before beg) ?*)
+      (cons "searchhead" nil))
+     ((and (equal (char-before beg1) ?:)
+	   (equal (char-after (point-at-bol)) ?*))
+      (cons "tag" nil))
+     ((and (equal (char-before beg1) ?:)
+	   (not (equal (char-after (point-at-bol)) ?*)))
+      (cons "prop" nil))
+     (t nil))))
+
+(defun org-command-at-point ()
+  "Return the qualified name of the Org completion entity at point.
+When completing for #+STARTUP, for example, this function returns
+\"file-option/startup\"."
+  (let ((thing (org-thing-at-point)))
+    (cond
+     ((string= "file-option" (car thing))
+      (concat (car thing) "/" (downcase (cdr thing))))
+     ((string= "block-option" (car thing))
+      (concat (car thing) "/" (downcase (cdr thing))))
+     (t
+      (car thing)))))
+
+(defun org-parse-arguments ()
+  "Parse whitespace separated arguments in the current region."
+  (let ((begin (line-beginning-position))
+	(end (line-end-position))
+	begins args)
+    (save-restriction
+      (narrow-to-region begin end)
+      (save-excursion
+	(goto-char (point-min))
+	(while (not (eobp))
+	  (skip-chars-forward " \t\n[")
+	  (setq begins (cons (point) begins))
+	  (skip-chars-forward "^ \t\n[")
+	  (setq args (cons (buffer-substring-no-properties
+			    (car begins) (point))
+			   args)))
+	(cons (reverse args) (reverse begins))))))
+
+
+(defun org-complete-initial ()
+  "Calls the right completion function for first argument completions."
+  (ignore
+   (funcall (or (pcomplete-find-completion-function
+		 (car (org-thing-at-point)))
+		pcomplete-default-completion-function))))
+
+(defvar org-additional-option-like-keywords)
+(defun pcomplete/org-mode/file-option ()
+  "Complete against all valid file options."
+  (require 'org-exp)
+  (pcomplete-here
+   (org-complete-case-double
+    (mapcar (lambda (x)
+	      (if (= ?: (aref x (1- (length x))))
+		  (concat x " ")
+		x))
+	    (delq nil
+		  (pcomplete-uniqify-list
+		   (append
+		    (mapcar (lambda (x)
+			      (if (string-match "^#\\+\\([A-Z_]+:?\\)" x)
+				  (match-string 1 x)))
+			    (org-split-string (org-get-current-options) "\n"))
+		    org-additional-option-like-keywords)))))
+   (substring pcomplete-stub 2)))
+  
+(defvar org-startup-options)
+(defun pcomplete/org-mode/file-option/startup ()
+  "Complete arguments for the #+STARTUP file option."
+  (while (pcomplete-here
+	  (let ((opts (pcomplete-uniqify-list
+		       (mapcar 'car org-startup-options))))
+	    ;; Some options are mutually exclusive, and shouldn't be completed
+	    ;; against if certain other options have already been seen.
+	    (dolist (arg pcomplete-args)
+	      (cond
+	       ((string= arg "hidestars")
+		(setq opts (delete "showstars" opts)))))
+	    opts))))
+
+(defun pcomplete/org-mode/file-option/bind ()
+  "Complete arguments for the #+BIND file option, which are variable names"
+  (let (vars)
+    (mapatoms
+     (lambda (a) (if (boundp a) (setq vars (cons (symbol-name a) vars)))))
+    (pcomplete-here vars)))
+
+(defvar org-link-abbrev-alist-local)
+(defvar org-link-abbrev-alist)
+(defun pcomplete/org-mode/link ()
+  "Complete against defined #+LINK patterns."
+  (pcomplete-here
+   (pcomplete-uniqify-list (append (mapcar 'car org-link-abbrev-alist-local)
+				   (mapcar 'car org-link-abbrev-alist)))))
+
+(defvar org-entities)
+(defun pcomplete/org-mode/tex ()
+  "Complete against TeX-style HTML entity names."
+  (require 'org-entities)
+  (while (pcomplete-here
+	  (pcomplete-uniqify-list (remove nil (mapcar 'car-safe org-entities)))
+	  (substring pcomplete-stub 1))))
+
+(defvar org-todo-keywords-1)
+(defun pcomplete/org-mode/todo ()
+  "Complete against known TODO keywords."
+  (pcomplete-here (pcomplete-uniqify-list org-todo-keywords-1)))
+
+(defvar org-todo-line-regexp)
+(defun pcomplete/org-mode/searchhead ()
+  "Complete against all headings.
+This needs more work, to handle headings with lots of spaces in them."
+  (while
+   (pcomplete-here
+    (save-excursion
+      (goto-char (point-min))
+      (let (tbl)
+	(while (re-search-forward org-todo-line-regexp nil t)
+	  (push (org-make-org-heading-search-string
+		 (match-string-no-properties 3) t)
+		tbl))
+	(pcomplete-uniqify-list tbl)))
+    (substring pcomplete-stub 1))))
+
+(defvar org-tag-alist)
+(defun pcomplete/org-mode/tag ()
+  "Complete a tag name.  Omit tags already set."
+  (while (pcomplete-here
+	  (mapcar (lambda (x)
+		    (concat x ":"))
+		  (let ((lst (pcomplete-uniqify-list
+			      (or (remove
+				   nil
+				   (mapcar (lambda (x)
+					     (and (stringp (car x)) (car x)))
+					   org-tag-alist))
+				  (mapcar 'car (org-get-buffer-tags))))))
+		    (dolist (tag (org-get-tags))
+		      (setq lst (delete tag lst)))
+		    lst))
+	  (and (string-match ".*:" pcomplete-stub)
+	       (substring pcomplete-stub (match-end 0))))))
+
+(defun pcomplete/org-mode/prop ()
+  "Complete a property name.  Omit properties already set."
+  (pcomplete-here
+   (mapcar (lambda (x)
+	     (concat x ": "))
+	   (let ((lst (pcomplete-uniqify-list
+		       (org-buffer-property-keys nil t t))))
+	     (dolist (prop (org-entry-properties))
+	       (setq lst (delete (car prop) lst)))
+	     lst))
+   (substring pcomplete-stub 1)))
+
+(defun pcomplete/org-mode/block-option/src ()
+  "Complete the arguments of a begin_src block.
+Complete a language in the first field, the header arguments and switches."
+  (pcomplete-here
+   (mapcar
+    (lambda(x) (symbol-name (nth 3 x)))
+    (cdr (car (cdr (memq :key-type (plist-get
+				    (symbol-plist
+				     'org-babel-load-languages)
+				    'custom-type)))))))
+  (while (pcomplete-here
+	  '("-n" "-r" "-l"
+	    ":cache" ":colnames" ":comments" ":dir" ":eval" ":exports"
+	    ":file" ":hlines" ":no-expand" ":noweb" ":results" ":rownames"
+	    ":session" ":shebang" ":tangle" ":var"))))
+
+(defun pcomplete/org-mode/block-option/clocktable ()
+  "Complete keywords in a clocktable line"
+  (while (pcomplete-here '(":maxlevel" ":scope"
+			   ":tstart" ":tend" ":block" ":step"
+			   ":stepskip0" ":fileskip0"
+			   ":emphasize" ":link" ":narrow" ":indent"
+			   ":tcolumns" ":level" ":compact" ":timestamp"
+			   ":formula" ":formatter"))))
+
+(defun org-complete-case-double (list)
+  "Return list with both upcase and downcase version of all strings in LIST."
+  (let (e res)
+    (while (setq e (pop list))
+      (setq res (cons (downcase e) (cons (upcase e) res))))
+    (nreverse res)))
+
+;;;; Finish up
+
+(provide 'org-complete)
+
+;; arch-tag: 
+
+;;; org-complete.el ends here
--- a/lisp/org/org-crypt.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/org-crypt.el	Thu Dec 16 18:30:57 2010 -0500
@@ -4,7 +4,7 @@
 
 ;; Emacs Lisp Archive Entry
 ;; Filename: org-crypt.el
-;; Version: 7.3
+;; Version: 7.4
 ;; Keywords: org-mode
 ;; Author: John Wiegley <johnw@gnu.org>
 ;; Maintainer: Peter Jones <pjones@pmade.com>
--- a/lisp/org/org-ctags.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/org-ctags.el	Thu Dec 16 18:30:57 2010 -0500
@@ -3,10 +3,10 @@
 ;; Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 
 ;; Author: Paul Sexton <eeeickythump@gmail.com>
-;; Version: 7.3
+;; Version: 7.4
 
 ;; Keywords: org, wp
-;; Version: 7.3
+;; Version: 7.4
 ;;
 ;; This file is part of GNU Emacs.
 ;;
--- a/lisp/org/org-datetree.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/org-datetree.el	Thu Dec 16 18:30:57 2010 -0500
@@ -5,7 +5,7 @@
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 ;;
 ;; This file is part of GNU Emacs.
 ;;
--- a/lisp/org/org-docbook.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/org-docbook.el	Thu Dec 16 18:30:57 2010 -0500
@@ -4,7 +4,7 @@
 ;;
 ;; Emacs Lisp Archive Entry
 ;; Filename: org-docbook.el
-;; Version: 7.3
+;; Version: 7.4
 ;; Author: Baoqiu Cui <cbaoqiu AT yahoo DOT com>
 ;; Maintainer: Baoqiu Cui <cbaoqiu AT yahoo DOT com>
 ;; Keywords: org, wp, docbook
--- a/lisp/org/org-docview.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/org-docview.el	Thu Dec 16 18:30:57 2010 -0500
@@ -5,7 +5,7 @@
 ;; Author: Jan Böcker <jan.boecker at jboecker dot de>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 ;;
 ;; This file is part of GNU Emacs.
 ;;
--- a/lisp/org/org-entities.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/org-entities.el	Thu Dec 16 18:30:57 2010 -0500
@@ -6,7 +6,7 @@
 ;;         Ulf Stegemann <ulf at zeitform dot de>
 ;; Keywords: outlines, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 ;;
 ;; This file is part of GNU Emacs.
 ;;
--- a/lisp/org/org-exp-blocks.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/org-exp-blocks.el	Thu Dec 16 18:30:57 2010 -0500
@@ -4,7 +4,7 @@
 ;;   Free Software Foundation, Inc.
 
 ;; Author: Eric Schulte
-;; Version: 7.3
+;; Version: 7.4
 
 ;; This file is part of GNU Emacs.
 ;;
@@ -201,9 +201,6 @@
 	(interblock start (point-max))
 	(run-hooks 'org-export-blocks-postblock-hook)))))
 
-(add-hook 'org-export-preprocess-after-include-files-hook
-	  'org-export-blocks-preprocess)
-
 ;;================================================================================
 ;; type specific functions
 
--- a/lisp/org/org-exp.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/org-exp.el	Thu Dec 16 18:30:57 2010 -0500
@@ -6,7 +6,7 @@
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 ;;
 ;; This file is part of GNU Emacs.
 ;;
@@ -984,7 +984,7 @@
 	  (set-process-sentinel p 'org-export-process-sentinel)
 	  (message "Background process \"%s\": started" p))
       ;; background processing not requested, or not possible
-      (if subtree-p (progn (outline-mark-subtree) (activate-mark)))
+      (if subtree-p (progn (org-mark-subtree) (activate-mark)))
       (call-interactively (nth 1 ass))
       (when (and bpos (get-buffer-window cbuf))
 	(let ((cw (selected-window)))
@@ -1080,12 +1080,18 @@
       ;; Mark end of lists
       (org-export-mark-list-ending backend)
 
+      ;; Export code blocks
+      (org-export-blocks-preprocess)
+
       ;; Handle source code snippets
       (org-export-replace-src-segments-and-examples backend)
 
       ;; Protect short examples marked by a leading colon
       (org-export-protect-colon-examples)
 
+      ;; Protected spaces
+      (org-export-convert-protected-spaces backend)
+
       ;; Normalize footnotes
       (when (plist-get parameters :footnotes)
 	(org-footnote-normalize nil t))
@@ -1536,6 +1542,26 @@
       (add-text-properties (point) (org-end-of-subtree t)
 			   '(org-protected t)))))
 
+(defun org-export-convert-protected-spaces (backend)
+  "Convert strings like \\____ to protected spaces in all backends."
+  (goto-char (point-min))
+  (while (re-search-forward "\\\\__+" nil t)
+    (org-if-unprotected-1
+     (replace-match
+      (org-add-props
+	  (cond
+	   ((eq backend 'latex)
+	    (format "\\hspace{%dex}" (- (match-end 0) (match-beginning 0))))
+	   ((eq backend 'html)
+	    (org-add-props (match-string 0) nil
+	      'org-whitespace (- (match-end 0) (match-beginning 0))))
+	   ;; ((eq backend 'docbook))
+	   ((eq backend 'ascii)
+	    (org-add-props (match-string 0) '(org-whitespace t)))
+	   (t (make-string (- (match-end 0) (match-beginning 0)) ?\ )))
+	  '(org-protected t))
+      t t))))
+
 (defun org-export-protect-verbatim ()
   "Mark verbatim snippets with the protection property."
   (goto-char (point-min))
@@ -2100,12 +2126,13 @@
 (defun org-export-handle-include-files ()
   "Include the contents of include files, with proper formatting."
   (let ((case-fold-search t)
-	params file markup lang start end prefix prefix1 switches all)
+	params file markup lang start end prefix prefix1 switches all minlevel)
     (goto-char (point-min))
     (while (re-search-forward "^#\\+INCLUDE:?[ \t]+\\(.*\\)" nil t)
       (setq params (read (concat "(" (match-string 1) ")"))
 	    prefix (org-get-and-remove-property 'params :prefix)
 	    prefix1 (org-get-and-remove-property 'params :prefix1)
+	    minlevel (org-get-and-remove-property 'params :minlevel)
 	    file (org-symname-or-string (pop params))
 	    markup (org-symname-or-string (pop params))
 	    lang (and (member markup '("src" "SRC"))
@@ -2128,7 +2155,7 @@
 		  end  (format "#+end_%s" markup))))
 	(insert (or start ""))
 	(insert (org-get-file-contents (expand-file-name file)
-				       prefix prefix1 markup))
+				       prefix prefix1 markup minlevel))
 	(or (bolp) (newline))
 	(insert (or end ""))))
     all))
@@ -2145,7 +2172,7 @@
 	(when intersection
 	  (error "Recursive #+INCLUDE: %S" intersection))))))
 
-(defun org-get-file-contents (file &optional prefix prefix1 markup)
+(defun org-get-file-contents (file &optional prefix prefix1 markup minlevel)
   "Get the contents of FILE and return them as a string.
 If PREFIX is a string, prepend it to each line.  If PREFIX1
 is a string, prepend it to the first line instead of PREFIX.
@@ -2167,6 +2194,9 @@
 	(goto-char (match-beginning 0))
 	(insert ",")
 	(end-of-line 1)))
+    (when minlevel
+      (dotimes (lvl minlevel)
+	(org-map-region 'org-demote (point-min) (point-max))))
     (buffer-string)))
 
 (defun org-get-and-remove-property (listvar prop)
@@ -2235,8 +2265,6 @@
 (defvar org-export-latex-listings-langs) ;; defined in org-latex.el
 (defvar org-export-latex-listings-w-names) ;; defined in org-latex.el
 (defvar org-export-latex-minted-langs) ;; defined in org-latex.el
-(defvar org-export-latex-minted-with-line-numbers) ;; defined in org-latex.el
-
 (defun org-export-format-source-code-or-example
   (backend lang code &optional opts indent caption)
   "Format CODE from language LANG and return it formatted for export.
@@ -2403,8 +2431,7 @@
 				     (format "\n%s $\\equiv$ \n"
 					     (replace-regexp-in-string
 					      "_" "\\\\_" caption)))
-				   (format
-				    "\\begin{minted}[mathescape,%s\nnumbersep=5pt,\nframe=lines,\nframesep=2mm]{%s}\n" (if org-export-latex-minted-with-line-numbers "\nlinenos," "") minted-lang)
+				   (format "\\begin{minted}{%s}\n" minted-lang)
 				   rtn "\\end{minted}\n"))))
 			    (t (concat (car org-export-latex-verbatim-wrap)
 				       rtn (cdr org-export-latex-verbatim-wrap))))
@@ -2585,9 +2612,10 @@
 	;; does do the trick.
 	(if (looking-at "#[^\r\n]*")
 	    (append-to-buffer buffer (match-beginning 0) (1+ (match-end 0))))
-	(while (re-search-forward "[\n\r]#[^\n\r]*" nil t)
-	  (append-to-buffer buffer (1+ (match-beginning 0))
-			    (min (point-max) (1+ (match-end 0))))))
+	(when (re-search-forward "^\\*+[ \t]+" nil t)
+	  (while (re-search-backward "[\n\r]#[^\n\r]*" nil t)
+	    (append-to-buffer buffer (1+ (match-beginning 0))
+			      (min (point-max) (1+ (match-end 0)))))))
       (set-buffer buffer)
       (let ((buffer-file-name file)
 	    (org-inhibit-startup t))
--- a/lisp/org/org-faces.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/org-faces.el	Thu Dec 16 18:30:57 2010 -0500
@@ -6,7 +6,7 @@
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 ;;
 ;; This file is part of GNU Emacs.
 ;;
@@ -685,6 +685,15 @@
   :type 'integer
   :group 'org-faces)
 
+(defcustom org-cycle-level-faces t
+ "Non-nil means level styles cycle after level `org-n-level-faces'.
+Then so level org-n-level-faces+1 is styled like level 1.
+If nil, then all levels >=org-n-level-faces are styled like
+level org-n-level-faces"
+ :group 'org-appearance
+ :group 'org-faces
+ :type 'boolean)
+
 (defface org-latex-and-export-specials
   (let ((font (cond ((assq :inherit custom-face-attributes)
 		     '(:inherit underline))
--- a/lisp/org/org-feed.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/org-feed.el	Thu Dec 16 18:30:57 2010 -0500
@@ -5,7 +5,7 @@
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 ;;
 ;; This file is part of GNU Emacs.
 ;;
--- a/lisp/org/org-footnote.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/org-footnote.el	Thu Dec 16 18:30:57 2010 -0500
@@ -5,7 +5,7 @@
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 ;;
 ;; This file is part of GNU Emacs.
 ;;
@@ -303,7 +303,7 @@
      (t
       (setq re (concat "^" org-footnote-tag-for-non-org-mode-files "[ \t]*$"))
       (unless (re-search-forward re nil t)
-	(let ((max (if (and (eq major-mode 'message-mode)
+	(let ((max (if (and (derived-mode-p 'message-mode)
 			    (re-search-forward message-signature-separator nil t))
 		       (progn (beginning-of-line) (point))
 		     (goto-char (point-max)))))
--- a/lisp/org/org-freemind.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/org-freemind.el	Thu Dec 16 18:30:57 2010 -0500
@@ -5,7 +5,7 @@
 ;; Author: Lennart Borgman (lennart O borgman A gmail O com)
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 ;;
 ;; This file is part of GNU Emacs.
 ;;
--- a/lisp/org/org-gnus.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/org-gnus.el	Thu Dec 16 18:30:57 2010 -0500
@@ -7,7 +7,7 @@
 ;;         Tassilo Horn <tassilo at member dot fsf dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 ;;
 ;; This file is part of GNU Emacs.
 ;;
--- a/lisp/org/org-habit.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/org-habit.el	Thu Dec 16 18:30:57 2010 -0500
@@ -5,7 +5,7 @@
 ;; Author: John Wiegley <johnw at gnu dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 ;;
 ;; This file is part of GNU Emacs.
 ;;
@@ -197,10 +197,7 @@
   "Determine the relative priority of a habit.
 This must take into account not just urgency, but consistency as well."
   (let ((pri 1000)
-	(now (time-to-days
-	      (or moment
-		  (time-subtract (current-time)
-				 (list 0 (* 3600 org-extend-today-until) 0)))))
+	(now (if moment (time-to-days moment) (org-today)))
 	(scheduled (org-habit-scheduled habit))
 	(deadline (org-habit-deadline habit)))
     ;; add 10 for every day past the scheduled date, and subtract for every
--- a/lisp/org/org-html.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/org-html.el	Thu Dec 16 18:30:57 2010 -0500
@@ -6,7 +6,7 @@
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 ;;
 ;; This file is part of GNU Emacs.
 ;;
@@ -1213,7 +1213,11 @@
 	    (throw 'nextline nil))
 
 	  ;; Protected HTML
-	  (when (get-text-property 0 'org-protected line)
+	  (when (and (get-text-property 0 'org-protected line)
+		     ;; Make sure it is the entire line that is protected
+		     (not (< (or (next-single-property-change
+				  0 'org-protected line) 10000)
+			     (length line))))
 	    (let (par (ind (get-text-property 0 'original-indentation line)))
 	      (when (re-search-backward
 		     "\\(<p>\\)\\([ \t\r\n]*\\)\\=" (- (point) 100) t)
@@ -2316,10 +2320,9 @@
 	 (extra-class (and title (org-get-text-property-any 0 'html-container-class title)))
 	 (preferred (and target
 			 (cdr (assoc target org-export-preferred-target-alist))))
-	 (remove (or preferred target))
 	 (l org-level-max)
 	 snumber snu href suffix)
-    (setq extra-targets (remove remove extra-targets))
+    (setq extra-targets (remove (or preferred target) extra-targets))
     (setq extra-targets
 	  (mapconcat (lambda (x)
 		       (if (org-uuidgen-p x) (setq x (concat "ID-" x)))
@@ -2358,12 +2361,13 @@
 		(progn
 		  (org-close-li)
 		  (if target
-		      (insert (format "<li id=\"%s\">" target) extra-targets title "<br/>\n")
+		      (insert (format "<li id=\"%s\">" (or preferred target))
+			      extra-targets title "<br/>\n")
 		    (insert "<li>" title "<br/>\n")))
 	      (aset org-levels-open (1- level) t)
 	      (org-close-par-maybe)
 	      (if target
-		  (insert (format "<ul>\n<li id=\"%s\">" target)
+		  (insert (format "<ul>\n<li id=\"%s\">" (or preferred target))
 			  extra-targets title "<br/>\n")
 		(insert "<ul>\n<li>" title "<br/>\n"))))
 	(aset org-levels-open (1- level) t)
--- a/lisp/org/org-icalendar.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/org-icalendar.el	Thu Dec 16 18:30:57 2010 -0500
@@ -6,7 +6,7 @@
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 ;;
 ;; This file is part of GNU Emacs.
 ;;
--- a/lisp/org/org-id.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/org-id.el	Thu Dec 16 18:30:57 2010 -0500
@@ -5,7 +5,7 @@
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 ;;
 ;; This file is part of GNU Emacs.
 ;;
@@ -600,15 +600,18 @@
 (defun org-id-store-link ()
   "Store a link to the current entry, using its ID."
   (interactive)
-  (let* ((link (org-make-link "id:" (org-id-get-create)))
-	 (case-fold-search nil)
-	 (desc (save-excursion
-		 (org-back-to-heading t)
-		 (or (and (looking-at org-complex-heading-regexp)
-			  (if (match-end 4) (match-string 4) (match-string 0)))
-		     link))))
-    (org-store-link-props :link link :description desc :type "id")
-    link))
+  (when (and (buffer-file-name (buffer-base-buffer)) (org-mode-p))
+    (let* ((link (org-make-link "id:" (org-id-get-create)))
+	   (case-fold-search nil)
+	   (desc (save-excursion
+		   (org-back-to-heading t)
+		   (or (and (looking-at org-complex-heading-regexp)
+			    (if (match-end 4)
+				(match-string 4)
+			      (match-string 0)))
+		       link))))
+      (org-store-link-props :link link :description desc :type "id")
+      link)))
 
 (defun org-id-open (id)
   "Go to the entry with id ID."
--- a/lisp/org/org-indent.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/org-indent.el	Thu Dec 16 18:30:57 2010 -0500
@@ -4,7 +4,7 @@
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 ;;
 ;; This file is part of GNU Emacs.
 ;;
@@ -38,6 +38,10 @@
 (eval-when-compile
   (require 'cl))
 
+(defvar org-inlinetask-min-level)
+(declare-function org-inlinetask-get-task-level "org-inlinetask" ())
+(declare-function org-inlinetask-in-task-p "org-inlinetask" ())
+
 (defgroup org-indent nil
   "Options concerning dynamic virtual outline indentation."
   :tag "Org Indent"
@@ -219,35 +223,49 @@
 (defun org-indent-add-properties (beg end)
   "Add indentation properties between BEG and END.
 Assumes that BEG is at the beginning of a line."
-  (when (or t org-indent-mode)
-    (let ((inhibit-modification-hooks t)
-	  ov b e n level exit nstars)
-      (with-silent-modifications
-       (save-excursion
-	 (goto-char beg)
-	 (while (not exit)
-	   (setq e end)
-	   (if (not (re-search-forward org-indent-outline-re nil t))
-	       (setq e (point-max) exit t)
-	     (setq e (match-beginning 0))
-	     (if (>= e end) (setq exit t))
-	     (setq level (- (match-end 0) (match-beginning 0) 1))
-	     (setq nstars (- (* (1- level) org-indent-indentation-per-level)
-			     (1- level)))
-	     (add-text-properties
-	      (point-at-bol) (point-at-eol)
-	      (list 'line-prefix
-		    (aref org-indent-stars nstars)
-		    'wrap-prefix
-		    (aref org-indent-strings
-			  (* level org-indent-indentation-per-level)))))
-	   (when (and b (> e b))
-	     (add-text-properties
-	      b  e (list 'line-prefix (aref org-indent-strings n)
-			 'wrap-prefix (aref org-indent-strings n))))
-	   (setq b (1+ (point-at-eol))
-		 n (* (or level 0) org-indent-indentation-per-level))))))))
+  (let* ((inhibit-modification-hooks t)
+	 (inlinetaskp (featurep 'org-inlinetask))
+	 (get-real-level (lambda (pos lvl)
+			   (save-excursion
+			     (goto-char pos)
+			     (if (and inlinetaskp (org-inlinetask-in-task-p))
+				 (org-inlinetask-get-task-level)
+			       lvl))))
+	 (b beg)
+	 (e end)
+	 (level 0)
+	 (n 0)
+	 exit nstars)
+    (with-silent-modifications
+      (save-excursion
+	(goto-char beg)
+	(while (not exit)
+	  (setq e end)
+	  (if (not (re-search-forward org-indent-outline-re nil t))
+	      (setq e (point-max) exit t)
+	    (setq e (match-beginning 0))
+	    (if (>= e end) (setq exit t))
+	    (unless (and inlinetaskp (org-inlinetask-in-task-p))
+	      (setq level (- (match-end 0) (match-beginning 0) 1)))
+	    (setq nstars (* (1- (funcall get-real-level e level))
+			    (1- org-indent-indentation-per-level)))
+	    (add-text-properties
+	     (point-at-bol) (point-at-eol)
+	     (list 'line-prefix
+		   (aref org-indent-stars nstars)
+		   'wrap-prefix
+		   (aref org-indent-strings
+			 (* (funcall get-real-level e level)
+			    org-indent-indentation-per-level)))))
+	  (when (> e b)
+	    (add-text-properties
+	     b  e (list 'line-prefix (aref org-indent-strings n)
+			'wrap-prefix (aref org-indent-strings n))))
+	  (setq b (1+ (point-at-eol))
+		n (* (funcall get-real-level b level)
+		     org-indent-indentation-per-level)))))))
 
+(defvar org-inlinetask-min-level)
 (defun org-indent-refresh-section ()
   "Refresh indentation properties in the current outline section.
 Point is assumed to be at the beginning of a headline."
@@ -255,7 +273,11 @@
   (when org-indent-mode
     (let (beg end)
       (save-excursion
-	(when (ignore-errors (org-back-to-heading))
+	(when (ignore-errors (let ((outline-regexp (format "\\*\\{1,%s\\}[ \t]+"
+				(if (featurep 'org-inlinetask)
+				    (1- org-inlinetask-min-level)
+				  ""))))
+			       (org-back-to-heading)))
 	  (setq beg (point))
 	  (setq end (or (save-excursion (or (outline-next-heading) (point)))))
 	  (org-indent-remove-properties beg end)
@@ -268,7 +290,11 @@
   (when org-indent-mode
     (let ((beg (point)) (end limit))
       (save-excursion
-	(and (ignore-errors (org-back-to-heading t))
+	(and (ignore-errors (let ((outline-regexp (format "\\*\\{1,%s\\}[ \t]+"
+				(if (featurep 'org-inlinetask)
+				    (1- org-inlinetask-min-level)
+				  ""))))
+			      (org-back-to-heading)))
 	     (setq beg (point))))
       (org-indent-remove-properties beg end)
       (org-indent-add-properties beg end)))
--- a/lisp/org/org-info.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/org-info.el	Thu Dec 16 18:30:57 2010 -0500
@@ -6,7 +6,7 @@
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 ;;
 ;; This file is part of GNU Emacs.
 ;;
--- a/lisp/org/org-inlinetask.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/org-inlinetask.el	Thu Dec 16 18:30:57 2010 -0500
@@ -5,7 +5,7 @@
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 
 ;; This file is part of GNU Emacs.
 
@@ -100,6 +100,60 @@
   :group 'org-inlinetask
   :type 'boolean)
 
+(defvar org-inlinetask-export-templates
+  '((html "<pre class=\"inlinetask\"><b>%s%s</b><br>%s</pre>"
+	  '((unless (eq todo "")
+	      (format "<span class=\"%s %s\">%s%s</span> "
+		      class todo todo priority))
+	    heading content))
+    (latex "\\begin\{description\}\\item[%s%s]%s\\end\{description\}"
+	   '((unless (eq todo "") (format "\\textsc\{%s%s\} " todo priority))
+	     heading content))
+    (ascii "     -- %s%s%s"
+	   '((unless (eq todo "") (format "%s%s " todo priority))
+	     heading
+	     (unless (eq content "")
+	       (format "\n         ¦ %s"
+		       (mapconcat 'identity (org-split-string content "\n")
+				  "\n         ¦ ")))))
+    (docbook "<variablelist>
+<varlistentry>
+<term>%s%s</term>
+<listitem><para>%s</para></listitem>
+</varlistentry>
+</variablelist>"
+	     '((unless (eq todo "") (format "%s%s " todo priority))
+	       heading content)))
+  "Templates for inline tasks in various exporters.
+
+This variable is an alist in the shape of (BACKEND STRING OBJECTS).
+
+BACKEND is the name of the backend for the template (ascii, html...).
+
+STRING is a format control string.
+
+OBJECTS is a list of elements to be substituted into the format
+string.  They can be of any type, from a string to a form
+returning a value (thus allowing conditional insertion).  A nil
+object will be substituted as the empty string.  Obviously, there
+must be at least as many objects as %-sequences in the format
+string.
+
+Moreover, the following special keywords are provided: `todo',
+`priority', `heading', `content', `tags'.  If some of them are not
+defined in an inline task, their value is the empty string.
+
+As an example, valid associations are:
+
+(html \"<ul><li>%s <p>%s</p></li></ul>\" (heading content))
+
+or, with the additional package \"todonotes\" for LaTeX,
+
+(latex \"\\todo[inline]{\\textbf{\\textsf{%s %s}}\\linebreak{} %s}\"
+       '((unless (eq todo \"\")
+	   (format \"\\textsc{%s%s}\" todo priority))
+	 heading content)))")
+
 (defvar org-odd-levels-only)
 (defvar org-keyword-time-regexp)
 (defvar org-drawer-regexp)
@@ -131,24 +185,56 @@
   (end-of-line -1))
 (define-key org-mode-map "\C-c\C-xt" 'org-inlinetask-insert-task)
 
+(defun org-inlinetask-outline-regexp ()
+  "Return string matching an inline task heading.
+The number of levels is controlled by `org-inlinetask-min-level'."
+  (let ((nstars (if org-odd-levels-only
+		    (1- (* org-inlinetask-min-level 2))
+		  org-inlinetask-min-level)))
+    (format "^\\(\\*\\{%d,\\}\\)[ \t]+" nstars)))
+
 (defun org-inlinetask-in-task-p ()
   "Return true if point is inside an inline task."
   (save-excursion
-    (let* ((nstars (if org-odd-levels-only
-		       (1- (* 2 (or org-inlinetask-min-level 200)))
-		     (or org-inlinetask-min-level 200)))
-	   (stars-re (concat "^\\(?:\\*\\{"
-			     (format "%d" (- nstars 1))
-			     ",\\}\\)[ \t]+"))
+    (let* ((stars-re (org-inlinetask-outline-regexp))
 	   (task-beg-re (concat stars-re "\\(?:.*\\)"))
-	   (task-end-re (concat stars-re "\\(?:END\\|end\\)")))
+	   (task-end-re (concat stars-re "\\(?:END\\|end\\)[ \t]*$")))
       (beginning-of-line)
       (or (looking-at task-beg-re)
 	  (and (re-search-forward "^\\*+[ \t]+" nil t)
 	       (progn (beginning-of-line) (looking-at task-end-re)))))))
 
-(defvar htmlp)  ; dynamically scoped into the next function
-(defvar latexp) ; dynamically scoped into the next function
+(defun org-inlinetask-goto-beginning ()
+  "Go to the beginning of the inline task at point."
+  (end-of-line)
+  (re-search-backward (org-inlinetask-outline-regexp) nil t)
+  (when (org-looking-at-p (concat (org-inlinetask-outline-regexp) "END[ \t]*$"))
+    (re-search-backward (org-inlinetask-outline-regexp) nil t)))
+
+(defun org-inlinetask-goto-end ()
+  "Go to the end of the inline task at point."
+  (beginning-of-line)
+  (cond
+   ((org-looking-at-p (concat (org-inlinetask-outline-regexp) "END[ \t]*$"))
+    (forward-line 1))
+   ((org-looking-at-p (org-inlinetask-outline-regexp))
+    (forward-line 1)
+    (when (org-inlinetask-in-task-p)
+      (re-search-forward (org-inlinetask-outline-regexp) nil t)
+      (forward-line 1)))
+   (t
+    (re-search-forward (org-inlinetask-outline-regexp) nil t)
+    (forward-line 1))))
+
+(defun org-inlinetask-get-task-level ()
+  "Get the level of the inline task around.
+This assumes the point is inside an inline task."
+  (save-excursion
+    (end-of-line)
+    (re-search-backward (org-inlinetask-outline-regexp) nil t)
+    (- (match-end 1) (match-beginning 1))))
+
+(defvar backend) ; dynamically scoped into the next function
 (defun org-inlinetask-export-handler ()
   "Handle headlines with level larger or equal to `org-inlinetask-min-level'.
 Either remove headline and meta data, or do special formatting."
@@ -158,7 +244,7 @@
 		   (or org-inlinetask-min-level 200)))
 	 (re1 (format "^\\(\\*\\{%d,\\}\\) .*\n" nstars))
 	 (re2 (concat "^[ \t]*" org-keyword-time-regexp))
-	 headline beg end stars content indent)
+	 headline beg end stars content)
     (while (re-search-forward re1 nil t)
       (setq headline (match-string 0)
 	    stars (match-string 1)
@@ -179,40 +265,34 @@
 	(delete-region beg (1+ (match-end 0))))
       (goto-char beg)
       (when org-inlinetask-export
-	(when (string-match org-complex-heading-regexp headline)
-	  (setq headline (concat
-			  (if (match-end 2)
-			      (concat
-			       (org-add-props
-				   (format
-				    "@<span class=\"%s %s\"> %s@</span>"
-				    (if (member (match-string 2 headline)
-						org-done-keywords)
-					"done" "todo")
-				    (match-string 2 headline)
-				    (match-string 2 headline))
-				   nil 'org-protected t)
-			       " ") "")
-			  (match-string 4 headline)))
-	  (when content
+	;; content formatting
+	(when content
 	    (if (not (string-match "\\S-" content))
 		(setq content nil)
 	      (if (string-match "[ \t\n]+\\'" content)
 		  (setq content (substring content 0 (match-beginning 0))))
-	      (setq content (org-remove-indentation content))
-	      (if latexp (setq content (concat "\\quad \\\\\n" content)))))
-	  (insert (make-string (org-inlinetask-get-current-indentation) ?\ )
-		  "- ")
-	  (setq indent (make-string (current-column) ?\ ))
-	  (insert headline " ::")
-	  (if content
-	      (insert (if htmlp " " (concat "\n" indent))
-		      (mapconcat 'identity (org-split-string content "\n")
-				 (concat "\n" indent)) "\n")
-	    (insert "\n"))
-	  (insert indent)
-	  (backward-delete-char 2)
-	  (insert "THISISTHEINLINELISTTEMINATOR\n"))))))
+	      (setq content (org-remove-indentation content))))
+	(setq content (or content ""))
+	;; grab elements to export
+	(when (string-match org-complex-heading-regexp headline)
+	  (let* ((todo (or (match-string 2 headline) ""))
+		 (class (or (and (eq "" todo) "")
+			    (if (member todo org-done-keywords) "done" "todo")))
+		 (priority (or (match-string 3 headline) ""))
+		 (heading (or (match-string 4 headline) ""))
+		 (tags (or (match-string 5 headline) ""))
+		 (backend-spec (assq backend org-inlinetask-export-templates))
+		 (format-str (nth 1 backend-spec))
+		 (tokens (cadr (nth 2 backend-spec)))
+		 ;; change nil arguments into empty strings
+		 (nil-to-str (lambda (el) (or (eval el) "")))
+		 ;; build and protect export string
+		 (export-str (org-add-props
+				 (eval (append '(format format-str)
+					       (mapcar nil-to-str tokens)))
+				 nil 'org-protected t)))
+	    ;; eventually insert it
+	    (insert export-str "\n")))))))
 
 (defun org-inlinetask-get-current-indentation ()
   "Get the indentation of the last non-while line above this one."
@@ -247,31 +327,11 @@
 			    org-inlinetask-min-level))
     (replace-match "")))
 
-(defun org-inlinetask-remove-terminator ()
-  (let (beg end)
-    (save-excursion
-      (goto-char (point-min))
-      (while (re-search-forward "THISISTHEINLINELISTTEMINATOR\n" nil t)
-	(setq beg (match-beginning 0) end (match-end 0))
-	(save-excursion
-	  (beginning-of-line 1)
-	  (and (looking-at "<p\\(ara\\)?>THISISTHEINLINELISTTEMINATOR[ \t\n]*</p\\(ara\\)?>")
-	       (setq beg (point) end (match-end 0))))
-	(delete-region beg end)))))
-
 (eval-after-load "org-exp"
   '(add-hook 'org-export-preprocess-after-tree-selection-hook
 	     'org-inlinetask-export-handler))
 (eval-after-load "org"
   '(add-hook 'org-font-lock-hook 'org-inlinetask-fontify))
-(eval-after-load "org-html"
-  '(add-hook 'org-export-html-final-hook 'org-inlinetask-remove-terminator))
-(eval-after-load "org-latex"
-  '(add-hook 'org-export-latex-final-hook 'org-inlinetask-remove-terminator))
-(eval-after-load "org-ascii"
-  '(add-hook 'org-export-ascii-final-hook 'org-inlinetask-remove-terminator))
-(eval-after-load "org-docbook"
-  '(add-hook 'org-export-docbook-final-hook 'org-inlinetask-remove-terminator))
 
 (provide 'org-inlinetask)
 
--- a/lisp/org/org-irc.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/org-irc.el	Thu Dec 16 18:30:57 2010 -0500
@@ -4,7 +4,7 @@
 ;;
 ;; Author: Philip Jackson <emacs@shellarchive.co.uk>
 ;; Keywords: erc, irc, link, org
-;; Version: 7.3
+;; Version: 7.4
 ;;
 ;; This file is part of GNU Emacs.
 ;;
--- a/lisp/org/org-jsinfo.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/org-jsinfo.el	Thu Dec 16 18:30:57 2010 -0500
@@ -6,7 +6,7 @@
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 ;;
 ;; This file is part of GNU Emacs.
 ;;
--- a/lisp/org/org-latex.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/org-latex.el	Thu Dec 16 18:30:57 2010 -0500
@@ -4,7 +4,7 @@
 ;;
 ;; Emacs Lisp Archive Entry
 ;; Filename: org-latex.el
-;; Version: 7.3
+;; Version: 7.4
 ;; Author: Bastien Guerry <bzg AT altern DOT org>
 ;; Maintainer: Carsten Dominik <carsten.dominik AT gmail DOT com>
 ;; Keywords: org, wp, tex
@@ -295,7 +295,14 @@
   :group 'org-export-latex
   :type 'string)
 
-(defcustom org-export-latex-hyperref-format "\\href{%s}{%s}"
+(defcustom org-export-latex-href-format "\\href{%s}{%s}"
+  "A printf format string to be applied to href links.
+The format must contain two %s instances.  The first will be filled with
+the link, the second with the link description."
+  :group 'org-export-latex
+  :type 'string)
+
+(defcustom org-export-latex-hyperref-format "\\hyperref[%s]{%s}"
   "A printf format string to be applied to hyperref links.
 The format must contain two %s instances.  The first will be filled with
 the link, the second with the link description."
@@ -453,12 +460,6 @@
 	   (symbol :tag "Major mode       ")
 	   (string :tag "Listings language"))))
 
-(defcustom org-export-latex-minted-with-line-numbers nil
-  "Should source code line numbers be included when exporting
-with the latex minted package?"
-  :group 'org-export-latex
-  :type 'boolean)
-
 (defcustom org-export-latex-remove-from-headlines
   '(:todo nil :priority nil :tags nil)
   "A plist of keywords to remove from headlines.  OBSOLETE.
@@ -1280,12 +1281,13 @@
      (org-export-apply-macros-in-string org-export-latex-append-header)
      ;; define alert if not yet defined
      "\n\\providecommand{\\alert}[1]{\\textbf{#1}}"
+     ;; beginning of the document
+     "\n\\begin{document}\n\n"
      ;; insert the title
      (format
       "\n\n\\title{%s}\n"
       ;; convert the title
-      (org-export-latex-content
-       title '(lists tables fixed-width keywords)))
+      (org-export-latex-fontify-headline title))
      ;; insert author info
      (if (plist-get opt-plist :author-info)
 	 (format "\\author{%s}\n"
@@ -1297,8 +1299,6 @@
 	     (format-time-string
 	      (or (plist-get opt-plist :date)
 		  org-export-latex-date-format)))
-     ;; beginning of the document
-     "\n\\begin{document}\n\n"
      ;; insert the title command
      (when (string-match "\\S-" title)
        (if (string-match "%s" org-export-latex-title-command)
@@ -1325,7 +1325,7 @@
   (save-excursion
     (goto-char (or beg (point-min)))
     (let* ((pt (point))
-	   (end (if (re-search-forward "^\\*+ " end t)
+	   (end (if (re-search-forward (org-get-limited-outline-regexp) end t)
 		    (goto-char (match-beginning 0))
 		  (goto-char (or end (point-max))))))
       (prog1
@@ -1452,6 +1452,33 @@
     ;; FIXME: org-inside-LaTeX-fragment-p doesn't work when the $...$ is at
     ;; the beginning of the buffer - inserting "\n" is safe here though.
     (insert "\n" string)
+
+    ;; Preserve math snippets
+    
+    (let* ((matchers (plist-get org-format-latex-options :matchers))
+	   (re-list org-latex-regexps)
+	   beg end re e m n block off)
+      ;; Check the different regular expressions
+      (while (setq e (pop re-list))
+	(setq m (car e) re (nth 1 e) n (nth 2 e)
+	      block (if (nth 3 e) "\n\n" ""))
+	(setq off (if (member m '("$" "$1")) 1 0))
+	(when (and (member m matchers) (not (equal m "begin")))
+	  (goto-char (point-min))
+	  (while (re-search-forward re nil t)
+	    (setq beg (+ (match-beginning 0) off) end (- (match-end 0) 0))
+	    (add-text-properties beg end
+				 '(org-protected t org-latex-math t))))))
+
+    ;; Convert LaTeX to \LaTeX{} and TeX to \TeX{}
+    (goto-char (point-min))
+    (let ((case-fold-search nil))
+      (while (re-search-forward "\\<\\(\\(La\\)?TeX\\)\\>" nil t)
+	(unless (eq (char-before (match-beginning 1)) ?\\)
+	  (org-if-unprotected-1
+	   (replace-match (org-export-latex-protect-string
+			   (concat "\\" (match-string 1)
+				   "{}")) t t)))))
     (goto-char (point-min))
     (let ((re (concat "\\\\\\([a-zA-Z]+\\)"
 		      "\\(?:<[^<>\n]*>\\)*"
@@ -2016,10 +2043,10 @@
 	      (insert (format
 		       (org-export-get-coderef-format path desc)
 		       (cdr (assoc path org-export-code-refs)))))
-	     (radiop (insert (format "\\hyperref[%s]{%s}"
+	     (radiop (insert (format org-export-latex-hyperref-format
 				     (org-solidify-link-text raw-path) desc)))
 	     ((not type)
-	      (insert (format "\\hyperref[%s]{%s}"
+	      (insert (format org-export-latex-hyperref-format
 			      (org-remove-initial-hash
 			       (org-solidify-link-text raw-path))
 			      desc)))
@@ -2030,7 +2057,7 @@
 		;; a LaTeX issue, but we here implement a work-around anyway.
 		(setq path (org-export-latex-protect-amp path)
 		      desc (org-export-latex-protect-amp desc)))
-	      (insert (format org-export-latex-hyperref-format path desc)))
+	      (insert (format org-export-latex-href-format path desc)))
 
 	     ((functionp (setq fnc (nth 2 (assoc type org-link-protocols))))
 	      ;; The link protocol has a function for formatting the link
@@ -2356,7 +2383,7 @@
 			   "\n"
 			   (match-string 1 res))
 		   t t res)))
-      (insert res "\n"))))
+      (insert res))))
 
 (defconst org-latex-entities
  '("\\!"
--- a/lisp/org/org-list.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/org-list.el	Thu Dec 16 18:30:57 2010 -0500
@@ -7,7 +7,7 @@
 ;;	   Bastien Guerry <bzg AT altern DOT org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 ;;
 ;; This file is part of GNU Emacs.
 ;;
@@ -462,7 +462,8 @@
 	(forward-line -1)
 	(catch 'exit
 	  (while t
-	    (let ((ind (org-get-indentation)))
+	    (let ((ind (+ (or (get-text-property (point) 'original-indentation) 0)
+			(org-get-indentation))))
 	      (cond
 	       ((looking-at "^[ \t]*:END:")
 		(throw 'exit item-ref))
@@ -502,7 +503,8 @@
       (catch 'exit
 	(while t
 	  (skip-chars-forward " \t")
-	  (let ((ind (org-get-indentation)))
+	  (let ((ind (+ (or (get-text-property (point) 'original-indentation) 0)
+			(org-get-indentation))))
 	    (cond
 	     ((or (>= (point) limit)
 		  (looking-at ":END:"))
@@ -518,7 +520,11 @@
 	      (setq ind-ref ind)
 	      (forward-line 1))
 	     ((<= ind ind-ref)
-	      (throw 'exit (point-at-bol)))
+	      (throw 'exit (progn
+			     ;; Again, ensure bottom is just after a
+			     ;; non-blank line.
+			     (skip-chars-backward " \r\t\n")
+			     (min (point-max) (1+ (point-at-eol))))))
 	     ((looking-at "#\\+begin_")
 	      (re-search-forward "[ \t]*#\\+end_")
 	      (forward-line 1))
@@ -636,7 +642,7 @@
 	    ;; insert bullet above item in order to avoid bothering
 	    ;; with possible blank lines ending last item.
 	    (goto-char (org-get-item-beginning))
-            (indent-to-column ind)
+            (org-indent-to-column ind)
 	    (insert (concat bullet (when checkbox "[ ] ") after-bullet))
 	    ;; Stay between after-bullet and before text.
 	    (save-excursion
@@ -1060,7 +1066,7 @@
 	(org-list-exchange-items actual-item next-item bottom)
 	(org-list-repair nil nil bottom)
 	(goto-char (org-get-next-item (point) bottom))
-	(move-to-column col)))))
+	(org-move-to-column col)))))
 
 (defun org-move-item-up ()
   "Move the plain list item at point up, i.e. swap with previous item.
@@ -1081,7 +1087,7 @@
 	    (error "Cannot move this item further up"))
 	(org-list-exchange-items prev-item actual-item bottom)
 	(org-list-repair nil top bottom)
-	(move-to-column col)))))
+	(org-move-to-column col)))))
 
 (defun org-insert-item (&optional checkbox)
   "Insert a new item at the current level.
@@ -1481,7 +1487,7 @@
           ;; this is not an empty line
           (let ((i (org-get-indentation)))
             (when (and (> i 0) (> (+ i delta) 0))
-              (indent-line-to (+ i delta)))))
+              (org-indent-line-to (+ i delta)))))
         (beginning-of-line 0)))))
 
 (defun org-outdent-item ()
@@ -1543,7 +1549,7 @@
 		   (ignore-errors
 		     (org-list-indent-item-generic 1 t top bottom))))
 	     (t (back-to-indentation)
-		(indent-to-column (car org-tab-ind-state))
+		(org-indent-to-column (car org-tab-ind-state))
 		(end-of-line)
 		(org-list-repair (cdr org-tab-ind-state))
 		;; Break cycle
@@ -1629,35 +1635,36 @@
 is an integer, 0 means `-', 1 means `+' etc. If WHICH is
 'previous, cycle backwards."
   (interactive "P")
-  (let* ((top (org-list-top-point))
-	 (bullet (save-excursion
-		   (goto-char (org-get-beginning-of-list top))
-		   (org-get-bullet)))
-	 (current (cond
-		   ((string-match "\\." bullet) "1.")
-		   ((string-match ")" bullet) "1)")
-		   (t bullet)))
-	 (bullet-rule-p (cdr (assq 'bullet org-list-automatic-rules)))
-	 (bullet-list (append '("-" "+" )
-			      ;; *-bullets are not allowed at column 0
-			      (unless (and bullet-rule-p
-					   (looking-at "\\S-")) '("*"))
-			      ;; Description items cannot be numbered
-			      (unless (and bullet-rule-p
-					   (or (eq org-plain-list-ordered-item-terminator ?\))
-					       (org-at-item-description-p))) '("1."))
-			      (unless (and bullet-rule-p
-					   (or (eq org-plain-list-ordered-item-terminator ?.)
-					       (org-at-item-description-p))) '("1)"))))
-	 (len (length bullet-list))
-	 (item-index (- len (length (member current bullet-list))))
-	 (get-value (lambda (index) (nth (mod index len) bullet-list)))
-	 (new (cond
-	       ((member which bullet-list) which)
-	       ((numberp which) (funcall get-value which))
-	       ((eq 'previous which) (funcall get-value (1- item-index)))
-	       (t (funcall get-value (1+ item-index))))))
-    (org-list-repair new top)))
+  (save-excursion
+    (let* ((top (org-list-top-point))
+	   (bullet (progn
+		     (goto-char (org-get-beginning-of-list top))
+		     (org-get-bullet)))
+	   (current (cond
+		     ((string-match "\\." bullet) "1.")
+		     ((string-match ")" bullet) "1)")
+		     (t bullet)))
+	   (bullet-rule-p (cdr (assq 'bullet org-list-automatic-rules)))
+	   (bullet-list (append '("-" "+" )
+				;; *-bullets are not allowed at column 0
+				(unless (and bullet-rule-p
+					     (looking-at "\\S-")) '("*"))
+				;; Description items cannot be numbered
+				(unless (and bullet-rule-p
+					     (or (eq org-plain-list-ordered-item-terminator ?\))
+						 (org-at-item-description-p))) '("1."))
+				(unless (and bullet-rule-p
+					     (or (eq org-plain-list-ordered-item-terminator ?.)
+						 (org-at-item-description-p))) '("1)"))))
+	   (len (length bullet-list))
+	   (item-index (- len (length (member current bullet-list))))
+	   (get-value (lambda (index) (nth (mod index len) bullet-list)))
+	   (new (cond
+		 ((member which bullet-list) which)
+		 ((numberp which) (funcall get-value which))
+		 ((eq 'previous which) (funcall get-value (1- item-index)))
+		 (t (funcall get-value (1+ item-index))))))
+      (org-list-repair new top))))
 
 ;;; Checkboxes
 
@@ -2029,7 +2036,7 @@
     (while (org-search-forward-unenclosed org-item-beginning-re end t)
       (save-excursion
 	(beginning-of-line)
-	(setq ltype (cond ((looking-at-p "^[ \t]*[0-9]") 'ordered)
+	(setq ltype (cond ((org-looking-at-p "^[ \t]*[0-9]") 'ordered)
 			  ((org-at-item-description-p) 'descriptive)
 			  (t 'unordered))))
       (let* ((indent1 (org-get-indentation))
--- a/lisp/org/org-mac-message.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/org-mac-message.el	Thu Dec 16 18:30:57 2010 -0500
@@ -5,7 +5,7 @@
 ;; Author: John Wiegley <johnw@gnu.org>
 ;;         Christopher Suckling <suckling at gmail dot com>
 
-;; Version: 7.3
+;; Version: 7.4
 ;; Keywords: outlines, hypermedia, calendar, wp
 
 ;; This file is part of GNU Emacs.
--- a/lisp/org/org-macs.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/org-macs.el	Thu Dec 16 18:30:57 2010 -0500
@@ -6,7 +6,7 @@
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 ;;
 ;; This file is part of GNU Emacs.
 ;;
@@ -46,9 +46,16 @@
      (if (or (> emacs-major-version 23)
 	     (and (>= emacs-major-version 23)
 		  (>= emacs-minor-version 2)))
-	 (called-interactively-p ,kind)
+	 (with-no-warnings (called-interactively-p ,kind)) ;; defined with no argument in <=23.1
        (interactive-p))))
 
+(if (and (not (fboundp 'with-silent-modifications))
+	 (or (< emacs-major-version 23)
+	     (and (= emacs-major-version 23)
+		  (< emacs-minor-version 2))))
+    (defmacro with-silent-modifications (&rest body)
+      `(org-unmodified ,@body)))
+
 (defmacro org-bound-and-true-p (var)
   "Return the value of symbol VAR if it is bound, else nil."
   `(and (boundp (quote ,var)) ,var))
--- a/lisp/org/org-mew.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/org-mew.el	Thu Dec 16 18:30:57 2010 -0500
@@ -5,7 +5,7 @@
 ;; Author: Tokuya Kameshima <kames at fa2 dot so-net dot ne dot jp>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 
 ;; This file is part of GNU Emacs.
 
--- a/lisp/org/org-mhe.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/org-mhe.el	Thu Dec 16 18:30:57 2010 -0500
@@ -6,7 +6,7 @@
 ;; Author: Thomas Baumann <thomas dot baumann at ch dot tum dot de>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 ;;
 ;; This file is part of GNU Emacs.
 ;;
--- a/lisp/org/org-mks.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/org-mks.el	Thu Dec 16 18:30:57 2010 -0500
@@ -5,7 +5,7 @@
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 ;;
 ;; This file is part of GNU Emacs.
 ;;
--- a/lisp/org/org-mobile.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/org-mobile.el	Thu Dec 16 18:30:57 2010 -0500
@@ -4,7 +4,7 @@
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 ;;
 ;; This file is part of GNU Emacs.
 ;;
--- a/lisp/org/org-mouse.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/org-mouse.el	Thu Dec 16 18:30:57 2010 -0500
@@ -1,11 +1,10 @@
 ;;; org-mouse.el --- Better mouse support for org-mode
 
-;; Copyright (C) 2006, 2007, 2008, 2009, 2010
-;;   Free Software Foundation, Inc.
+;; Copyright (C) 2006, 2007, 2008, 2009, 2010 Free Software Foundation
 ;;
 ;; Author: Piotr Zielinski <piotr dot zielinski at gmail dot com>
 ;; Maintainer: Carsten Dominik <carsten at orgmode dot org>
-;; Version: 7.3
+;; Version: 7.4
 ;;
 ;; This file is part of GNU Emacs.
 ;;
@@ -1101,10 +1100,10 @@
 	 "--"
 	 ["Day View" org-agenda-day-view
 	  :active (org-agenda-check-type nil 'agenda)
-	  :style radio :selected (equal org-agenda-ndays 1)]
+	  :style radio :selected (eq org-agenda-current-span 'day)]
 	 ["Week View" org-agenda-week-view
 	  :active (org-agenda-check-type nil 'agenda)
-	  :style radio :selected (equal org-agenda-ndays 7)]
+	  :style radio :selected (eq org-agenda-current-span 'week)]
 	 "--"
 	 ["Show Logbook entries" org-agenda-log-mode
 	  :style toggle :selected org-agenda-show-log
--- a/lisp/org/org-plot.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/org-plot.el	Thu Dec 16 18:30:57 2010 -0500
@@ -5,7 +5,7 @@
 ;; Author: Eric Schulte <schulte dot eric at gmail dot com>
 ;; Keywords: tables, plotting
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 ;;
 ;; This file is part of GNU Emacs.
 ;;
--- a/lisp/org/org-protocol.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/org-protocol.el	Thu Dec 16 18:30:57 2010 -0500
@@ -9,7 +9,7 @@
 ;; Author: Ross Patterson <me AT rpatterson DOT net>
 ;; Maintainer: Sebastian Rose <sebastian_rose AT gmx DOT de>
 ;; Keywords: org, emacsclient, wp
-;; Version: 7.3
+;; Version: 7.4
 
 ;; This file is part of GNU Emacs.
 ;;
@@ -313,7 +313,7 @@
       (let* ((start (match-beginning 0))
 	     (end (match-end 0))
 	     (hex (match-string 0 str))
-	     (replacement (org-protocol-unhex-compound hex)))
+	     (replacement (org-protocol-unhex-compound (upcase hex))))
 	(setq tmp (concat tmp (substring str 0 start) replacement))
 	(setq str (substring str end))))
     (setq tmp (concat tmp str))
--- a/lisp/org/org-publish.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/org-publish.el	Thu Dec 16 18:30:57 2010 -0500
@@ -5,7 +5,7 @@
 ;; Author: David O'Toole <dto@gnu.org>
 ;; Maintainer: Carsten Dominik <carsten DOT dominik AT gmail DOT com>
 ;; Keywords: hypermedia, outlines, wp
-;; Version: 7.3
+;; Version: 7.4
 
 ;; This file is part of GNU Emacs.
 ;;
--- a/lisp/org/org-remember.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/org-remember.el	Thu Dec 16 18:30:57 2010 -0500
@@ -6,7 +6,7 @@
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 ;;
 ;; This file is part of GNU Emacs.
 ;;
--- a/lisp/org/org-rmail.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/org-rmail.el	Thu Dec 16 18:30:57 2010 -0500
@@ -6,7 +6,7 @@
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 ;;
 ;; This file is part of GNU Emacs.
 ;;
--- a/lisp/org/org-src.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/org-src.el	Thu Dec 16 18:30:57 2010 -0500
@@ -8,7 +8,7 @@
 ;;         Dan Davison <davison at stats dot ox dot ac dot uk>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 ;;
 ;; This file is part of GNU Emacs.
 ;;
@@ -240,8 +240,8 @@
 	    block-nindent (nth 5 info)
 	    lang-f (intern (concat lang "-mode"))
 	    begline (save-excursion (goto-char beg) (org-current-line)))
-      (if (and mark (>= mark beg) (<= mark end))
-	  (save-excursion (goto-char mark)
+      (if (and mark (>= mark beg) (<= mark (1+ end)))
+	  (save-excursion (goto-char (min mark end))
 			  (setq markline (org-current-line)
 				markcol (current-column))))
       (if (equal lang-f 'table.el-mode)
--- a/lisp/org/org-table.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/org-table.el	Thu Dec 16 18:30:57 2010 -0500
@@ -6,7 +6,7 @@
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 ;;
 ;; This file is part of GNU Emacs.
 ;;
@@ -48,6 +48,12 @@
 (defvar org-export-html-table-tag) ; defined in org-exp.el
 (defvar constants-unit-system)
 
+(defvar orgtbl-after-send-table-hook nil
+  "Hook for functions attaching to `C-c C-c', if the table is sent.
+This can be used to add additional functionality after the table is sent
+to the receiver position, othewise, if table is not sent, the functions 
+are not run.")
+
 (defcustom orgtbl-optimized (eq org-enable-table-editor 'optimized)
   "Non-nil means use the optimized table editor version for `orgtbl-mode'.
 In the optimized version, the table editor takes over all simple keys that
@@ -3729,7 +3735,8 @@
 	  (call-interactively 'org-table-recalculate)
 	(org-table-maybe-recalculate-line))
       (call-interactively 'org-table-align)
-      (orgtbl-send-table 'maybe))
+      (when (orgtbl-send-table 'maybe)
+	(run-hooks 'orgtbl-after-send-table-hook)))
      ((eq action 'recalc)
       (save-excursion
 	(beginning-of-line 1)
@@ -3943,7 +3950,10 @@
 	  (orgtbl-send-replace-tbl name txt))
 	(setq ntbl (1+ ntbl)))
       (message "Table converted and installed at %d receiver location%s"
-	       ntbl (if (> ntbl 1) "s" "")))))
+			   ntbl (if (> ntbl 1) "s" ""))
+      (if (> ntbl 0)
+	  ntbl
+	nil))))
 
 (defun org-remove-by-index (list indices &optional i0)
   "Remove the elements in LIST with indices in INDICES.
--- a/lisp/org/org-taskjuggler.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/org-taskjuggler.el	Thu Dec 16 18:30:57 2010 -0500
@@ -4,7 +4,7 @@
 ;;
 ;; Emacs Lisp Archive Entry
 ;; Filename: org-taskjuggler.el
-;; Version: 7.3
+;; Version: 7.4
 ;; Author: Christian Egli
 ;; Maintainer: Christian Egli
 ;; Keywords: org, taskjuggler, project planning
--- a/lisp/org/org-timer.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/org-timer.el	Thu Dec 16 18:30:57 2010 -0500
@@ -5,7 +5,7 @@
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 ;;
 ;; This file is part of GNU Emacs.
 ;;
--- a/lisp/org/org-vm.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/org-vm.el	Thu Dec 16 18:30:57 2010 -0500
@@ -6,7 +6,7 @@
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 ;;
 ;; This file is part of GNU Emacs.
 ;;
--- a/lisp/org/org-w3m.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/org-w3m.el	Thu Dec 16 18:30:57 2010 -0500
@@ -5,7 +5,7 @@
 ;; Author: Andy Stewart <lazycat dot manatee at gmail dot com>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 ;;
 ;; This file is part of GNU Emacs.
 ;;
--- a/lisp/org/org-wl.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/org-wl.el	Thu Dec 16 18:30:57 2010 -0500
@@ -7,7 +7,7 @@
 ;;         David Maus <dmaus at ictsoc dot de>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 ;;
 ;; This file is part of GNU Emacs.
 ;;
--- a/lisp/org/org-xoxo.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/org-xoxo.el	Thu Dec 16 18:30:57 2010 -0500
@@ -6,7 +6,7 @@
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 ;;
 ;; This file is part of GNU Emacs.
 ;;
--- a/lisp/org/org.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/org/org.el	Thu Dec 16 18:30:57 2010 -0500
@@ -6,7 +6,7 @@
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.4
 ;;
 ;; This file is part of GNU Emacs.
 ;;
@@ -75,6 +75,7 @@
   (require 'gnus-sum))
 
 (require 'calendar)
+
 ;; Emacs 22 calendar compatibility:  Make sure the new variables are available
 (when (fboundp 'defvaralias)
   (unless (boundp 'calendar-view-holidays-initially-flag)
@@ -98,6 +99,7 @@
 (require 'org-compat)
 (require 'org-faces)
 (require 'org-list)
+(require 'org-complete)
 (require 'org-src)
 (require 'org-footnote)
 
@@ -186,7 +188,7 @@
 
 ;;; Version
 
-(defconst org-version "7.3"
+(defconst org-version "7.4"
   "The version number of the file org.el.")
 
 (defun org-version (&optional here)
@@ -1383,12 +1385,15 @@
 (defcustom org-context-in-file-links t
   "Non-nil means file links from `org-store-link' contain context.
 A search string will be added to the file name with :: as separator and
-used to find the context when the link is activated by the command
-`org-open-at-point'.
+used to find the context when the link is activated by the command 
+`org-open-at-point'. When this option is t, the entire active region 
+will be placed in the search string of the file link. If set to a 
+positive integer, only the first n lines of context will be stored.
+
 Using a prefix arg to the command \\[org-store-link] (`org-store-link')
 negates this setting for the duration of the command."
   :group 'org-link-store
-  :type 'boolean)
+  :type '(choice boolean integer))
 
 (defcustom org-keep-stored-link-after-insertion nil
   "Non-nil means keep link in list for entire session.
@@ -1958,7 +1963,7 @@
 action steps, or as different types of TODO items.  The first
 keywords are states requiring action - these states will select a headline
 for inclusion into the global TODO list Org-mode produces.  If one of
-the \"keywords\" is the vertical bat \"|\" the remaining keywords
+the \"keywords\" is the vertical bar, \"|\", the remaining keywords
 signify that no further action is necessary.  If \"|\" is not found,
 the last keyword is treated as the only DONE state of the sequence.
 
@@ -2473,6 +2478,16 @@
   :group 'org-priorities
   :type 'boolean)
 
+(defcustom org-get-priority-function nil
+  "Function to extract the priority from a string.
+The string is normally the headline.  If this is nil Org computes the
+priority from the priority cookie like [#A] in the headline.  It returns
+an integer, increasing by 1000 for each priority level.
+The user can set a different function here, which should take a string
+as an argument and return the numeric priority."
+  :group 'org-priorities
+  :type 'function)
+
 (defgroup org-time nil
   "Options concerning time stamps and deadlines in Org-mode."
   :tag "Org Time"
@@ -2613,7 +2628,7 @@
   :group 'org-agenda 
   :group 'org-time 
   :type '(choice
-	  (const :tag "Use org-aread-date-prefer-future"
+	  (const :tag "Use org-read-date-prefer-future"
 		 org-read-date-prefer-future)
 	  (const :tag "Never" nil)
 	  (const :tag "Always" t)))
@@ -2719,10 +2734,10 @@
 (defcustom org-complete-tags-always-offer-all-agenda-tags nil
   "If non-nil, always offer completion for all tags of all agenda files.
 Instead of customizing this variable directly, you might want to
-set it locally for remember buffers, because there no list of
+set it locally for capture buffers, because there no list of
 tags in that file can be created dynamically (there are none).
 
-  (add-hook 'org-remember-mode-hook
+  (add-hook 'org-capture-mode-hook
             (lambda ()
               (set (make-local-variable
                     'org-complete-tags-always-offer-all-agenda-tags)
@@ -3422,7 +3437,7 @@
 (defcustom org-emphasis-regexp-components
   '(" \t('\"{" "- \t.,:!?;'\")}\\" " \t\r\n,\"'" "." 1)
   "Components used to build the regular expression for emphasis.
-This is a list with 6 entries.  Terminology:  In an emphasis string
+This is a list with five entries.  Terminology:  In an emphasis string
 like \" *strong word* \", we call the initial space PREMATCH, the final
 space POSTMATCH, the stars MARKERS, \"s\" and \"d\" are BORDER characters
 and \"trong wor\" is the body.  The different components in this variable
@@ -3506,8 +3521,8 @@
   :type 'boolean)
 
 (defcustom org-completion-fallback-command 'hippie-expand
-  "The expansion command called by \\[org-complete] in normal context.
-Normal means no org-mode-specific context."
+  "The expansion command called by \\[pcomplete] in normal context.
+Normal means, no org-mode-specific context."
   :group 'org-completion
   :type 'function)
 
@@ -3555,10 +3570,13 @@
 		  "org-agenda" (&optional end))
 (declare-function org-inlinetask-remove-END-maybe "org-inlinetask" ())
 (declare-function org-inlinetask-in-task-p "org-inlinetask" ())
+(declare-function org-inlinetask-goto-beginning "org-inlinetask" ())
+(declare-function org-inlinetask-goto-end "org-inlinetask" ())
 (declare-function org-indent-mode "org-indent" (&optional arg))
 (declare-function parse-time-string "parse-time" (string))
 (declare-function org-attach-reveal "org-attach" (&optional if-exists))
 (declare-function org-export-latex-fix-inputenc "org-latex" ())
+(declare-function orgtbl-send-table "org-table" (&optional maybe))
 (defvar remember-data-file)
 (defvar texmathp-why)
 (declare-function speedbar-line-directory "speedbar" (&optional depth))
@@ -4739,6 +4757,17 @@
   ;; Turn on org-beamer-mode?
   (and org-startup-with-beamer-mode (org-beamer-mode 1))
 
+  ;; Setup the pcomplete hooks
+  (set (make-local-variable 'pcomplete-command-completion-function)
+       'org-complete-initial)
+  (set (make-local-variable 'pcomplete-command-name-function)
+       'org-command-at-point)
+  (set (make-local-variable 'pcomplete-default-completion-function)
+       'ignore)
+  (set (make-local-variable 'pcomplete-parse-arguments-function)
+       'org-parse-arguments)
+  (set (make-local-variable 'pcomplete-termination-string) "")
+
   ;; If empty file that did not turn on org-mode automatically, make it to.
   (if (and org-insert-mode-line-in-empty-file
 	   (interactive-p)
@@ -4773,6 +4802,12 @@
 		       (nthcdr 2 time))))
     (current-time)))
 
+(defun org-today ()
+  "Return today date, considering `org-extend-today-until'."
+  (time-to-days
+   (time-subtract (current-time)
+		  (list 0 (* 3600 org-extend-today-until) 0))))
+
 ;;;; Font-Lock stuff, including the activators
 
 (defvar org-mouse-map (make-sparse-keymap))
@@ -5581,14 +5616,17 @@
 (defvar org-l nil)
 (defvar org-f nil)
 (defun org-get-level-face (n)
-  "Get the right face for match N in font-lock matching of headlines."
-  (setq org-l (- (match-end 2) (match-beginning 1) 1))
-  (if org-odd-levels-only (setq org-l (1+ (/ org-l 2))))
-  (setq org-f (nth (% (1- org-l) org-n-level-faces) org-level-faces))
-  (cond
-   ((eq n 1) (if org-hide-leading-stars 'org-hide org-f))
-   ((eq n 2) org-f)
-   (t (if org-level-color-stars-only nil org-f))))
+ "Get the right face for match N in font-lock matching of headlines."
+ (setq org-l (- (match-end 2) (match-beginning 1) 1))
+ (if org-odd-levels-only (setq org-l (1+ (/ org-l 2))))
+ (if org-cycle-level-faces
+     (setq org-f (nth (% (1- org-l) org-n-level-faces) org-level-faces))
+   (setq org-f (nth (1- (min org-l org-n-level-faces)) org-level-faces)))
+ (cond
+  ((eq n 1) (if org-hide-leading-stars 'org-hide org-f))
+  ((eq n 2) org-f)
+  (t (if org-level-color-stars-only nil org-f))))
+
 
 (defun org-get-todo-face (kwd)
   "Get the right face for a TODO keyword KWD.
@@ -6040,8 +6078,8 @@
   (interactive)
   (let (org-show-entry-below state)
     (save-excursion
-      (goto-char (point-max))
-      (while (re-search-backward
+      (goto-char (point-min))
+      (while (re-search-forward
 	      "^[ \t]*:VISIBILITY:[ \t]+\\([a-z]+\\)"
 	      nil t)
 	(setq state (match-string 1))
@@ -6982,11 +7020,12 @@
   "Return the level of the current entry, or nil if before the first headline.
 The level is the number of stars at the beginning of the headline."
   (save-excursion
-    (condition-case nil
-	(progn
-	  (org-back-to-heading t)
-	  (funcall outline-level))
-      (error nil))))
+    (let ((outline-regexp (org-get-limited-outline-regexp)))
+      (condition-case nil
+	  (progn
+	    (org-back-to-heading t)
+	    (funcall outline-level))
+	(error nil)))))
 
 (defun org-get-previous-line-level ()
   "Return the outline depth of the last headline before the current line.
@@ -7501,12 +7540,13 @@
       (narrow-to-region
        (progn (org-back-to-heading t) (point))
        (progn (org-end-of-subtree t t)
-	      (if (org-on-heading-p) (backward-char 1))
+	      (if (and (org-on-heading-p) (not (eobp))) (backward-char 1))
 	      (point))))))
 
 (eval-when-compile
   (defvar org-property-drawer-re))
 
+(defvar org-property-start-re)  ;; defined below
 (defun org-clone-subtree-with-time-shift (n &optional shift)
   "Clone the task (subtree) at point N times.
 The clones will be inserted as siblings.
@@ -7570,7 +7610,7 @@
 	    (and idprop (if org-clone-delete-id
 			    (org-entry-delete nil "ID")
 			  (org-id-get-create t)))
-	    (while (re-search-forward org-property-drawer-re nil t)
+	    (while (re-search-forward org-property-start-re nil t)
 	      (org-remove-empty-drawer-at "PROPERTIES" (point)))
 	    (goto-char (point-min))
 	    (when doshift
@@ -8468,7 +8508,8 @@
 (defun org-make-org-heading-search-string (&optional string heading)
   "Make search string for STRING or current headline."
   (interactive)
-  (let ((s (or string (org-get-heading))))
+  (let ((s (or string (org-get-heading)))
+	(lines org-context-in-file-links))
     (unless (and string (not heading))
       ;; We are using a headline, clean up garbage in there.
       (if (string-match org-todo-regexp s)
@@ -8482,6 +8523,13 @@
       (while (string-match org-ts-regexp s)
 	(setq s (replace-match "" t t s))))
     (or string (setq s (concat "*" s)))  ; Add * for headlines
+    (when (and string (integerp lines) (> lines 0))
+      (let ((slines (org-split-string s "\n")))
+	(when (< lines (length slines))
+	  (setq s (mapconcat 
+		   'identity
+		   (reverse (nthcdr (- (length slines) lines) 
+				    (reverse slines))) "\n")))))
     (mapconcat 'identity (org-split-string s "[ \t]+") " ")))
 
 (defun org-make-link (&rest strings)
@@ -9054,7 +9102,8 @@
 	(progn (require 'org-attach) (org-attach-reveal 'if-exists))))
    ((run-hook-with-args-until-success 'org-open-at-point-functions))
    ((org-at-timestamp-p t) (org-follow-timestamp-link))
-   ((or (org-footnote-at-reference-p) (org-footnote-at-definition-p))
+   ((and (or (org-footnote-at-reference-p) (org-footnote-at-definition-p))
+	 (not (org-in-regexp org-bracket-link-regexp)))
     (org-footnote-action))
    (t
     (let (type path link line search (pos (point)))
@@ -9170,10 +9219,6 @@
 	      (dired path)
 	    (org-open-file path in-emacs line search)))
 
-	 ((string= type "news")
-	  (require 'org-gnus)
-	  (org-gnus-follow-link path))
-
 	 ((string= type "shell")
 	  (let ((cmd path))
 	    (if (or (not org-confirm-shell-link-function)
@@ -10464,6 +10509,7 @@
   "Update the dynamic block at point.
 This means to empty the block, parse for parameters and then call
 the correct writing function."
+  (interactive)
   (save-window-excursion
     (let* ((pos (point))
 	   (line (org-current-line))
@@ -10505,6 +10551,7 @@
 (defun org-update-all-dblocks ()
   "Update all dynamic blocks in the buffer.
 This function can be used in a hook."
+  (interactive)
   (when (org-mode-p)
     (org-map-dblocks 'org-update-dblock)))
 
@@ -10512,10 +10559,10 @@
 ;;;; Completion
 
 (defconst org-additional-option-like-keywords
-  '("BEGIN_HTML"  "END_HTML"  "HTML:" "ATTR_HTML"
-    "BEGIN_DocBook"  "END_DocBook"  "DocBook:" "ATTR_DocBook"
+  '("BEGIN_HTML"  "END_HTML"  "HTML:" "ATTR_HTML:"
+    "BEGIN_DocBook"  "END_DocBook"  "DocBook:" "ATTR_DocBook:"
     "BEGIN_LaTeX" "END_LaTeX" "LaTeX:" "LATEX_HEADER:"
-    "LATEX_CLASS:" "LATEX_CLASS_OPTIONS:" "ATTR_LaTeX"
+    "LATEX_CLASS:" "LATEX_CLASS_OPTIONS:" "ATTR_LaTeX:"
     "BEGIN:" "END:"
     "ORGTBL" "TBLFM:" "TBLNAME:"
     "BEGIN_EXAMPLE" "END_EXAMPLE"
@@ -10523,11 +10570,17 @@
     "BEGIN_VERSE" "END_VERSE"
     "BEGIN_CENTER" "END_CENTER"
     "BEGIN_SRC" "END_SRC"
-    "CATEGORY" "COLUMNS" "PROPERTY"
-    "CAPTION" "LABEL"
-    "SETUPFILE"
-    "BIND"
-    "MACRO"))
+    "BEGIN_RESULT" "END_RESULT"
+    "SOURCE:" "SRCNAME:" "FUNCTION:"
+    "RESULTS:"
+    "HEADER:" "HEADERS:"
+    "BABEL:"
+    "CATEGORY:" "COLUMNS:" "PROPERTY:"
+    "CAPTION:" "LABEL:"
+    "SETUPFILE:"
+    "INCLUDE:"
+    "BIND:"
+    "MACRO:"))
 
 (defcustom org-structure-template-alist
   '(
@@ -10609,137 +10662,6 @@
     (insert rpl)
     (if (re-search-backward "\\?" start t) (delete-char 1))))
 
-
-(defun org-complete (&optional arg)
-  "Perform completion on word at point.
-At the beginning of a headline, this completes TODO keywords as given in
-`org-todo-keywords'.
-If the current word is preceded by a backslash, completes the TeX symbols
-that are supported for HTML support.
-If the current word is preceded by \"#+\", completes special words for
-setting file options.
-In the line after \"#+STARTUP:, complete valid keywords.\"
-At all other locations, this simply calls the value of
-`org-completion-fallback-command'."
-  (interactive "P")
-  (org-without-partial-completion
-   (catch 'exit
-     (let* ((a nil)
-	    (end (point))
-	    (beg1 (save-excursion
-		    (skip-chars-backward (org-re "[:alnum:]_@#%"))
-		    (point)))
-	    (beg (save-excursion
-		   (skip-chars-backward "a-zA-Z0-9_:$")
-		   (point)))
-	    (confirm (lambda (x) (stringp (car x))))
-	    (searchhead (equal (char-before beg) ?*))
-	    (struct
-	     (when (and (member (char-before beg1) '(?. ?<))
-			(setq a (assoc (buffer-substring beg1 (point))
-				       org-structure-template-alist)))
-	       (org-complete-expand-structure-template (1- beg1) a)
-	       (throw 'exit t)))
-	    (tag (and (equal (char-before beg1) ?:)
-		      (equal (char-after (point-at-bol)) ?*)))
-	    (prop (or (and (equal (char-before beg1) ?:)
-			   (not (equal (char-after (point-at-bol)) ?*)))
-		      (string-match "^#\\+PROPERTY:.*"
-				    (buffer-substring (point-at-bol) (point)))))
-	    (texp (equal (char-before beg) ?\\))
-	    (link (equal (char-before beg) ?\[))
-	    (opt (equal (buffer-substring (max (point-at-bol) (- beg 2))
-					  beg)
-			"#+"))
-	    (startup (string-match "^#\\+STARTUP:.*"
-				   (buffer-substring (point-at-bol) (point))))
-	    (completion-ignore-case opt)
-	    (type nil)
-	    (tbl nil)
-	    (table (cond
-		    (opt
-		     (setq type :opt)
-		     (require 'org-exp)
-		     (append
-		      (delq nil
-			    (mapcar
-			     (lambda (x)
-			       (if (string-match
-				    "^#\\+\\(\\([A-Z_]+:?\\).*\\)" x)
-				   (cons (match-string 2 x)
-					 (match-string 1 x))))
-			     (org-split-string (org-get-current-options) "\n")))
-		      (mapcar 'list org-additional-option-like-keywords)))
-		    (startup
-		     (setq type :startup)
-		     org-startup-options)
-		    (link (append org-link-abbrev-alist-local
-				  org-link-abbrev-alist))
-		    (texp
-		     (setq type :tex)
-		     (append org-entities-user org-entities))
-		    ((string-match "\\`\\*+[ \t]+\\'"
-				   (buffer-substring (point-at-bol) beg))
-		     (setq type :todo)
-		     (mapcar 'list org-todo-keywords-1))
-		    (searchhead
-		     (setq type :searchhead)
-		     (save-excursion
-		       (goto-char (point-min))
-		       (while (re-search-forward org-todo-line-regexp nil t)
-			 (push (list
-				(org-make-org-heading-search-string
-				 (match-string 3) t))
-			       tbl)))
-		     tbl)
-		    (tag (setq type :tag beg beg1)
-			 (or org-tag-alist (org-get-buffer-tags)))
-		    (prop (setq type :prop beg beg1)
-			  (mapcar 'list (org-buffer-property-keys nil t t)))
-		    (t (progn
-			 (call-interactively org-completion-fallback-command)
-			 (throw 'exit nil)))))
-	    (pattern (buffer-substring-no-properties beg end))
-	    (completion (try-completion pattern table confirm)))
-       (cond ((eq completion t)
-	      (if (not (assoc (upcase pattern) table))
-		  (message "Already complete")
-		(if (and (equal type :opt)
-			 (not (member (car (assoc (upcase pattern) table))
-				      org-additional-option-like-keywords)))
-		    (insert (substring (cdr (assoc (upcase pattern) table))
-				       (length pattern)))
-		  (if (memq type '(:tag :prop)) (insert ":")))))
-	     ((null completion)
-	      (message "Can't find completion for \"%s\"" pattern)
-	      (ding))
-	     ((not (string= pattern completion))
-	      (delete-region beg end)
-	      (if (string-match " +$" completion)
-		  (setq completion (replace-match "" t t completion)))
-	      (insert completion)
-	      (if (get-buffer-window "*Completions*")
-		  (delete-window (get-buffer-window "*Completions*")))
-	      (if (assoc completion table)
-		  (if (eq type :todo) (insert " ")
-		    (if (and (memq type '(:tag :prop))
-			     (not (string-match "^#[ \t]*\\+property:"
-						(org-current-line-string t))))
-			(insert ":"))))
-	      (if (and (equal type :opt) (assoc completion table))
-		  (message "%s" (substitute-command-keys
-				 "Press \\[org-complete] again to insert example settings"))))
-	     (t
-	      (message "Making completion list...")
-	      (let ((list (sort (all-completions pattern table confirm)
-				'string<)))
-		(with-output-to-temp-buffer "*Completions*"
-		  (condition-case nil
-		      ;; Protection needed for XEmacs and emacs 21
-		      (display-completion-list list pattern)
-		    (error (display-completion-list list)))))
-	      (message "Making completion list...%s" "done")))))))
-
 ;;;; TODO, DEADLINE, Comments
 
 (defun org-toggle-comment ()
@@ -11962,13 +11884,13 @@
 m      Show entries selected by a tags/property match.
 p      Enter a property name and its value (both with completion on existing
        names/values) and show entries with that property.
-/      Show entries matching a regular expression (`r' can be used as well)
+r      Show entries matching a regular expression (`/' can be used as well)
 d      Show deadlines due within `org-deadline-warning-days'.
 b      Show deadlines and scheduled items before a date.
 a      Show deadlines and scheduled items after a date."
   (interactive "P")
   (let (ans kwd value)
-    (message "Sparse tree: [/]regexp [t]odo [T]odo-kwd [m]atch [p]roperty [d]eadlines\n             [b]efore-date [a]fter-date")
+    (message "Sparse tree: [r]egexp [/]regexp [t]odo [T]odo-kwd [m]atch [p]roperty\n             [d]eadlines [b]efore-date [a]fter-date")
     (setq ans (read-char-exclusive))
     (cond
      ((equal ans ?d)
@@ -12213,11 +12135,13 @@
 
 (defun org-get-priority (s)
   "Find priority cookie and return priority."
-  (save-match-data
-    (if (not (string-match org-priority-regexp s))
-	(* 1000 (- org-lowest-priority org-default-priority))
-      (* 1000 (- org-lowest-priority
-		 (string-to-char (match-string 2 s)))))))
+  (if (functionp org-get-priority-function)
+      (funcall org-get-priority-function)
+    (save-match-data
+      (if (not (string-match org-priority-regexp s))
+	  (* 1000 (- org-lowest-priority org-default-priority))
+	(* 1000 (- org-lowest-priority
+		   (string-to-char (match-string 2 s))))))))
 
 ;;;; Tags
 
@@ -12458,7 +12382,7 @@
 	minus tag mm
 	tagsmatch todomatch tagsmatcher todomatcher kwd matcher
 	orterms term orlist re-p str-p level-p level-op time-p
-	prop-p pn pv po cat-p gv rest)
+	prop-p pn pv po gv rest)
     (if (string-match "/+" match)
 	;; match contains also a todo-matching request
 	(progn
@@ -12498,7 +12422,6 @@
 		     (setq pn (match-string 5 term)
 			   po (match-string 6 term)
 			   pv (match-string 7 term)
-			   cat-p (equal pn "CATEGORY")
 			   re-p (equal (string-to-char pv) ?{)
 			   str-p (equal (string-to-char pv) ?\")
 			   time-p (save-match-data
@@ -13459,7 +13382,7 @@
 POM may also be nil, in which case the current entry is used.
 If WHICH is nil or `all', get all properties.  If WHICH is
 `special' or `standard', only get that subclass.  If WHICH
-is a string only get exactly this property.  Specific can be a string, the
+is a string only get exactly this property.  SPECIFIC can be a string, the
 specific property we are interested in.  Specifying it can speed
 things up because then unnecessary parsing is avoided."
   (setq which (or which 'all))
@@ -15025,7 +14948,7 @@
 			      (org-current-line)
 			      (buffer-file-name) sexp)
                      (sleep-for 2))))))
-    (cond ((stringp result) result)
+    (cond ((stringp result) (split-string result "; "))
 	  ((and (consp result)
 		(not (consp (cdr result)))
 		(stringp (cdr result))) (cdr result))
@@ -16285,9 +16208,9 @@
 (org-defkey org-mode-map "\C-i"       'org-cycle)
 (org-defkey org-mode-map [(tab)]      'org-cycle)
 (org-defkey org-mode-map [(control tab)] 'org-force-cycle-archived)
-(org-defkey org-mode-map [(meta tab)] 'org-complete)
-(org-defkey org-mode-map "\M-\t" 'org-complete)
-(org-defkey org-mode-map "\M-\C-i"      'org-complete)
+(org-defkey org-mode-map [(meta tab)] 'pcomplete)
+(org-defkey org-mode-map "\M-\t" 'pcomplete)
+(org-defkey org-mode-map "\M-\C-i"      'pcomplete)
 ;; The following line is necessary under Suse GNU/Linux
 (unless (featurep 'xemacs)
   (org-defkey org-mode-map [S-iso-lefttab]  'org-shifttab))
@@ -16352,7 +16275,7 @@
   (org-defkey org-mode-map [?\C-c (right)] 'org-shiftright)
   (org-defkey org-mode-map [?\C-c ?\C-x (right)] 'org-shiftcontrolright)
   (org-defkey org-mode-map [?\C-c ?\C-x (left)] 'org-shiftcontrolleft)
-  (org-defkey org-mode-map [?\e (tab)] 'org-complete)
+  (org-defkey org-mode-map [?\e (tab)] 'pcomplete)
   (org-defkey org-mode-map [?\e (shift return)] 'org-insert-todo-heading)
   (org-defkey org-mode-map [?\e (shift left)]   'org-shiftmetaleft)
   (org-defkey org-mode-map [?\e (shift right)]  'org-shiftmetaright)
@@ -16433,6 +16356,7 @@
 (org-defkey org-mode-map "\C-c\C-xf"    'org-footnote-action)
 (org-defkey org-mode-map "\C-c\C-x\C-mg"    'org-mobile-pull)
 (org-defkey org-mode-map "\C-c\C-x\C-mp"    'org-mobile-push)
+(org-defkey org-mode-map "\C-c@" 'org-mark-subtree)
 (org-defkey org-mode-map [?\C-c (control ?*)] 'org-list-make-subtree)
 ;;(org-defkey org-mode-map [?\C-c (control ?-)] 'org-list-make-list-from-subtree)
 
@@ -16506,7 +16430,7 @@
     ("^" . org-sort)
     ("w" . org-refile)
     ("a" . org-archive-subtree-default-with-confirmation)
-    ("." . outline-mark-subtree)
+    ("." . org-mark-subtree)
     ("Clock Commands")
     ("I" . org-clock-in)
     ("O" . org-clock-out)
@@ -17246,11 +17170,13 @@
    ((org-edit-fixed-width-region))
    ((org-at-table.el-p)
     (org-edit-src-code))
-   ((org-at-table-p)
+   ((or (org-at-table-p)
+	(save-excursion
+	  (beginning-of-line 1)
+	  (looking-at "[ \t]*#\\+TBLFM:")))
     (call-interactively 'org-table-edit-formulas))
    (t (call-interactively 'ffap))))
 
-
 (defun org-ctrl-c-ctrl-c (&optional arg)
   "Set tags in headline, or update according to changed information at point.
 
@@ -17324,7 +17250,8 @@
       (if arg
 	  (call-interactively 'org-table-recalculate)
 	(org-table-maybe-recalculate-line))
-      (call-interactively 'org-table-align))
+      (call-interactively 'org-table-align)
+      (orgtbl-send-table 'maybe))
      ((or (org-footnote-at-reference-p)
 	  (org-footnote-at-definition-p))
       (call-interactively 'org-footnote-action))
@@ -17681,7 +17608,7 @@
      ("Select keyword"
       ["Next keyword" org-shiftright (org-on-heading-p)]
       ["Previous keyword" org-shiftleft (org-on-heading-p)]
-      ["Complete Keyword" org-complete (assq :todo-keyword (org-context))]
+      ["Complete Keyword" pcomplete (assq :todo-keyword (org-context))]
       ["Next keyword set" org-shiftcontrolright (and (> (length org-todo-sets) 1) (org-on-heading-p))]
       ["Previous keyword set" org-shiftcontrolright (and (> (length org-todo-sets) 1) (org-on-heading-p))])
      ["Show TODO Tree" org-show-todo-tree :active t :keys "C-c / t"]
@@ -18066,6 +17993,23 @@
       (setq l (- l (get-text-property b 'org-dwidth-n s))))
     l))
 
+(defun org-shorten-string (s maxlength)
+  "Shorten string S so tht it is no longer than MAXLENGTH characters.
+If the string is shorter or has length MAXLENGTH, just return the
+original string.  If it is longer, the functions finds a space in the
+string, breaks this string off at that locations and adds three dots
+as ellipsis.  Including the ellipsis, the string will not be longer
+than MAXLENGTH.  If finding a good breaking point in the string does
+not work, the string is just chopped off in the middle of a word
+if necessary."
+  (if (<= (length s) maxlength)
+      s
+    (let* ((n (max (- maxlength 4) 1))
+	   (re (concat "\\`\\(.\\{1," (int-to-string n) "\\}[^ ]\\)\\([ ]\\|\\'\\)")))
+      (if (string-match re s)
+	  (concat (match-string 1 s) "...")
+	(concat (substring s 0 (max (- maxlength 3) 0)) "...")))))
+
 (defun org-get-indentation (&optional line)
   "Get the indentation of the current line, interpreting tabs.
 When LINE is given, assume it represents a line and compute its indentation."
@@ -18636,11 +18580,36 @@
   (message
    "Entry marked for action; press `k' at desired date in agenda or calendar"))
 
+(defun org-mark-subtree ()
+  "Mark the current subtree.
+This puts point at the start of the current subtree, and mark at the end.
+
+If point is in an inline task, mark that task instead."
+  (interactive)
+  (let ((inline-task-p
+	 (and (featurep 'org-inlinetask)
+	      (org-inlinetask-in-task-p)))
+	(beg))
+    ;; Get beginning of subtree
+    (cond
+     (inline-task-p (org-inlinetask-goto-beginning))
+     ((org-at-heading-p) (beginning-of-line))
+     (t (let ((outline-regexp (org-get-limited-outline-regexp)))
+	  (outline-previous-visible-heading 1))))
+    (setq beg (point))
+    ;; Get end of it
+    (if	inline-task-p
+	(org-inlinetask-goto-end)
+      (org-end-of-subtree))
+    ;; Mark zone
+    (push-mark (point) nil t)
+    (goto-char beg)))
+
 ;;; Paragraph filling stuff.
 ;; We want this to be just right, so use the full arsenal.
 
 (defun org-indent-line-function ()
-  "Indent line like previous, but further if previous was headline or item."
+  "Indent line depending on context."
   (interactive)
   (let* ((pos (point))
 	 (itemp (org-at-item-p))
@@ -18648,14 +18617,16 @@
 	 (org-drawer-regexp (or org-drawer-regexp "\000"))
 	 (inline-task-p (and (featurep 'org-inlinetask)
 			     (org-inlinetask-in-task-p)))
-	 column bpos bcol tpos tcol bullet btype bullet-type)
-    ;; Find the previous relevant line
+	 column bpos bcol tpos tcol)
     (beginning-of-line 1)
     (cond
      ;; Comments
-     ((looking-at "#") (setq column 0))
+     ((looking-at "# ") (setq column 0))
      ;; Headings
      ((looking-at "\\*+ ") (setq column 0))
+     ;; Literal examples
+     ((looking-at "[ \t]*:[ \t]")
+      (setq column (org-get-indentation))) ; do nothing
      ;; Drawers
      ((and (looking-at "[ \t]*:END:")
 	   (save-excursion (re-search-backward org-drawer-regexp nil t)))
@@ -18683,36 +18654,29 @@
       (looking-at "[ \t]*\\(\\S-+\\)[ \t]*\\(\\(:?\\[@\\(:?start:\\)?[0-9]+\\][ \t]*\\)?\\[[- X]\\][ \t]*\\|.*? :: \\)?")
       (setq bpos (match-beginning 1) tpos (match-end 0)
 	    bcol (progn (goto-char bpos) (current-column))
-	    tcol (progn (goto-char tpos) (current-column))
-	    bullet (match-string 1)
-	    bullet-type (if (string-match "[0-9]" bullet) "n" bullet))
+	    tcol (progn (goto-char tpos) (current-column)))
       (if (> tcol (+ bcol org-description-max-indent))
 	  (setq tcol (+ bcol 5)))
-      (if (not itemp)
-	  (setq column tcol)
-	(beginning-of-line 1)
-	(goto-char pos)
-	(if (looking-at "\\S-")
-	    (progn
-	      (looking-at "[ \t]*\\(\\S-+\\)[ \t]*")
-	      (setq bullet (match-string 1)
-		    btype (if (string-match "[0-9]" bullet) "n" bullet))
-	      (setq column (if (equal btype bullet-type) bcol tcol)))
-	  (setq column (org-get-indentation)))))
-     ;; This line has nothing special, look upside to get a clue about
-     ;; what to do.
+      (goto-char pos)
+      (setq column (if itemp (org-get-indentation) tcol)))
+     ;; This line has nothing special, look at the previous relevant
+     ;; line to compute indentation
      (t
       (beginning-of-line 0)
       (while (and (not (bobp))
+		  (not (looking-at org-drawer-regexp))
 		  ;; skip comments, verbatim, empty lines, tables,
-		  ;; inline tasks
-		  (or (looking-at "[ \t]*[\n:#|]")
+		  ;; inline tasks, lists, drawers and blocks
+		  (or (and (looking-at "[ \t]*:END:")
+			   (re-search-backward org-drawer-regexp nil t))
+		      (and (looking-at "[ \t]*#\\+end_")
+			   (re-search-backward "[ \t]*#\\+begin_"nil t))
+		      (looking-at "[ \t]*[\n:#|]")
 		      (and (org-in-item-p) (goto-char (org-list-top-point)))
 		      (and (not inline-task-p)
 			   (featurep 'org-inlinetask)
-			   (org-inlinetask-in-task-p)))
-      		  (not (looking-at "[ \t]*:END:"))
-      		  (not (looking-at org-drawer-regexp)))
+			   (org-inlinetask-in-task-p)
+			   (or (org-inlinetask-goto-beginning) t))))
       	(beginning-of-line 0))
       (cond
        ;; There was an heading above.
@@ -18721,20 +18685,18 @@
 	    (setq column 0)
 	  (goto-char (match-end 0))
 	  (setq column (current-column))))
-       ;; A drawer had started and is unfinished: indent consequently.
+       ;; A drawer had started and is unfinished
        ((looking-at org-drawer-regexp)
 	(goto-char (1- (match-beginning 1)))
 	(setq column (current-column)))
-       ;; The drawer had ended: indent like its :END: line.
-       ((looking-at "\\([ \t]*\\):END:")
-	(goto-char (match-end 1))
-	(setq column (current-column)))
        ;; Else, nothing noticeable found: get indentation and go on.
        (t (setq column (org-get-indentation))))))
+    ;; Now apply indentation and move cursor accordingly
     (goto-char pos)
     (if (<= (current-column) (current-indentation))
 	(org-indent-line-to column)
       (save-excursion (org-indent-line-to column)))
+    ;; Special polishing for properties, see `org-property-format'
     (setq column (current-column))
     (beginning-of-line 1)
     (if (looking-at
@@ -19005,8 +18967,6 @@
 
 (define-key org-mode-map "\C-a" 'org-beginning-of-line)
 (define-key org-mode-map "\C-e" 'org-end-of-line)
-(define-key org-mode-map [home] 'org-beginning-of-line)
-(define-key org-mode-map [end]  'org-end-of-line)
 
 (defun org-backward-sentence (&optional arg)
   "Go to beginning of sentence, or beginning of table field.
--- a/lisp/play/landmark.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/play/landmark.el	Thu Dec 16 18:30:57 2010 -0500
@@ -1137,7 +1137,7 @@
 
 (defun lm-weights-debug ()
   (if lm-debug
-      (progn (lm-print-wts) (lm-blackbox) (lm-print-y,s,noise)
+      (progn (lm-print-wts) (lm-blackbox) (lm-print-y-s-noise)
 	     (lm-print-smell))))
 
 ;;;_  - Printing various things
@@ -1187,7 +1187,7 @@
     (insert (format "%S\n" moves))))
 
 
-(defun lm-print-y,s,noise-int (direction)
+(defun lm-print-y-s-noise-int (direction)
   (insert (format "%S:lm-y %S, s %S, noise %S \n"
 		    (symbol-name direction)
 		    (get direction 'y_t)
@@ -1195,11 +1195,11 @@
 		    (get direction 'noise)
 		    )))
 
-(defun lm-print-y,s,noise ()
+(defun lm-print-y-s-noise ()
   (interactive)
   (with-current-buffer "*lm-y,s,noise*"
     (insert "==============================\n")
-    (mapc 'lm-print-y,s,noise-int lm-directions)))
+    (mapc 'lm-print-y-s-noise-int lm-directions)))
 
 (defun lm-print-smell-int (direction)
   (insert (format "%S: smell: %S \n"
--- a/lisp/progmodes/ada-mode.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/progmodes/ada-mode.el	Thu Dec 16 18:30:57 2010 -0500
@@ -461,6 +461,7 @@
 
 (defvar ada-mode-abbrev-table nil
   "Local abbrev table for Ada mode.")
+(define-abbrev-table 'ada-mode-abbrev-table ())
 
 (defvar ada-mode-syntax-table nil
   "Syntax table to be used for editing Ada source code.")
@@ -1123,16 +1124,8 @@
 (defvar ada-font-lock-syntactic-keywords) ; defined below
 
 ;;;###autoload
-(defun ada-mode ()
-  "Ada mode is the major mode for editing Ada code.
-\\{ada-mode-map}"
-
-  (interactive)
-  (kill-all-local-variables)
-
-  (set-syntax-table ada-mode-syntax-table)
-
-  (set (make-local-variable 'require-final-newline) mode-require-final-newline)
+(define-derived-mode ada-mode prog-mode "Ada"
+  "Ada mode is the major mode for editing Ada code."
 
   ;;  Set the paragraph delimiters so that one can select a whole block
   ;;  simply with M-h
@@ -1303,64 +1296,54 @@
       (define-key ada-mode-map ada-popup-key 'ada-popup-menu))
 
   ;;  Support for Abbreviations (the user still need to "M-x abbrev-mode"
-  (define-abbrev-table 'ada-mode-abbrev-table ())
   (setq local-abbrev-table ada-mode-abbrev-table)
 
   ;;  Support for which-function mode
-  (make-local-variable 'which-func-functions)
-  (setq which-func-functions '(ada-which-function))
+  (set (make-local-variable 'which-func-functions) '(ada-which-function))
 
   ;;  Support for indent-new-comment-line (Especially for XEmacs)
   (set (make-local-variable 'comment-multi-line) nil)
 
   ;;  Support for add-log
-  (set (make-local-variable 'add-log-current-defun-function) 'ada-which-function)
-
-  (setq major-mode 'ada-mode
-	mode-name "Ada")
-
-  (use-local-map ada-mode-map)
+  (set (make-local-variable 'add-log-current-defun-function)
+       'ada-which-function)
 
   (easy-menu-add ada-mode-menu ada-mode-map)
 
-  (set-syntax-table ada-mode-syntax-table)
-
   (set (make-local-variable 'skeleton-further-elements)
        '((< '(backward-delete-char-untabify
 	      (min ada-indent (current-column))))))
   (add-hook 'skeleton-end-hook  'ada-adjust-case-skeleton nil t)
 
-  (run-mode-hooks 'ada-mode-hook)
-
   ;;  To be run after the hook, in case the user modified
   ;;  ada-fill-comment-prefix
-  ;; FIXME: if the user modified ada-fill-comment-prefix in his .emacs
-  ;; then it was already available before running the hook, and if he
-  ;; modifies it in the hook, he might as well modify comment-start instead.
-  (set (make-local-variable 'comment-start) (or ada-fill-comment-prefix "-- "))
-
-  ;;  Run this after the hook to give the users a chance to activate
-  ;;  font-lock-mode
-
-  (unless (or (eval-when-compile (fboundp 'syntax-propertize-via-font-lock))
-              (featurep 'xemacs))
-    (ada-initialize-syntax-table-properties)
-    (add-hook 'font-lock-mode-hook 'ada-handle-syntax-table-properties nil t))
-
-  ;; the following has to be done after running the ada-mode-hook
-  ;; because users might want to set the values of these variable
-  ;; inside the hook
-  ;; FIXME: it might even be set later on via file-local vars, no?
-  ;; so maybe ada-keywords should be set lazily.
-  (cond ((eq ada-language-version 'ada83)
-	 (setq ada-keywords ada-83-keywords))
-	((eq ada-language-version 'ada95)
-	 (setq ada-keywords ada-95-keywords))
-	((eq ada-language-version 'ada2005)
-	 (setq ada-keywords ada-2005-keywords)))
-
-  (if ada-auto-case
-      (ada-activate-keys-for-case)))
+  (add-hook 'hack-local-variables-hook
+            (lambda ()
+              (set (make-local-variable 'comment-start)
+                   (or ada-fill-comment-prefix "-- "))
+
+              ;; Run this after the hook to give the users a chance
+              ;; to activate font-lock-mode.
+
+              (unless (or (eval-when-compile (fboundp 'syntax-propertize-via-font-lock))
+                          (featurep 'xemacs))
+                (ada-initialize-syntax-table-properties)
+                (add-hook 'font-lock-mode-hook
+                          'ada-handle-syntax-table-properties nil t))
+
+              ;; FIXME: ada-language-version might be set in the mode
+              ;; hook or it might even be set later on via file-local
+              ;; vars, so ada-keywords should be set lazily.
+              (cond ((eq ada-language-version 'ada83)
+                     (setq ada-keywords ada-83-keywords))
+                    ((eq ada-language-version 'ada95)
+                     (setq ada-keywords ada-95-keywords))
+                    ((eq ada-language-version 'ada2005)
+                     (setq ada-keywords ada-2005-keywords)))
+
+              (if ada-auto-case
+                  (ada-activate-keys-for-case)))
+            nil 'local))
 
 (defun ada-adjust-case-skeleton ()
   "Adjust the case of the text inserted by a skeleton."
@@ -4632,7 +4615,7 @@
 	      ["Gdb Documentation"      (info "gdb")
 	       (eq ada-which-compiler 'gnat)]
 	      ["Ada95 Reference Manual" (info "arm95") t])
-	     ("Options"  :included (eq major-mode 'ada-mode)
+	     ("Options"  :included (derived-mode-p 'ada-mode)
 	      ["Auto Casing" (setq ada-auto-case (not ada-auto-case))
 	       :style toggle :selected ada-auto-case]
 	      ["Auto Indent After Return"
@@ -4669,7 +4652,7 @@
 	      ["Load..."      ada-set-default-project-file t]
 	      ["New..."       ada-prj-new                  t]
 	      ["Edit..."      ada-prj-edit                 t])
-	     ("Goto"   :included (eq major-mode 'ada-mode)
+	     ("Goto"   :included (derived-mode-p 'ada-mode)
 	      ["Goto Declaration/Body"   ada-goto-declaration
 	       (eq ada-which-compiler 'gnat)]
 	      ["Goto Body"               ada-goto-body
@@ -4698,7 +4681,7 @@
 	      ["-"                       nil                    nil]
 	      ["Other File"              ff-find-other-file     t]
 	      ["Other File Other Window" ada-ff-other-window    t])
-	     ("Edit"   :included (eq major-mode 'ada-mode)
+	     ("Edit"   :included (derived-mode-p 'ada-mode)
 	      ["Search File On Source Path"  ada-find-file                t]
 	      ["------"                      nil                          nil]
 	      ["Complete Identifier"         ada-complete-identifier      t]
@@ -4730,7 +4713,7 @@
 	      ["-----"                       nil                          nil]
 	      ["Narrow to subprogram"        ada-narrow-to-defun          t])
 	     ("Templates"
-	      :included  (eq major-mode 'ada-mode)
+	      :included  (derived-mode-p 'ada-mode)
 	      ["Header"          ada-header          t]
 	      ["-"               nil                 nil]
 	      ["Package Body"    ada-package-body    t]
--- a/lisp/progmodes/ada-prj.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/progmodes/ada-prj.el	Thu Dec 16 18:30:57 2010 -0500
@@ -514,11 +514,18 @@
 
       (set (make-local-variable 'ada-prj-ada-buffer) ada-buffer)
 
-      (use-local-map (copy-keymap custom-mode-map))
-      (local-set-key "\C-x\C-s" 'ada-prj-save)
+      (use-local-map
+       (let ((map (make-sparse-keymap)))
+         (set-keymap-parent map custom-mode-map)
+         (define-key map "\C-x\C-s" 'ada-prj-save)
+         map))
 
-      (make-local-variable 'widget-keymap)
-      (define-key widget-keymap "\C-x\C-s" 'ada-prj-save)
+      ;; FIXME: Not sure if this works!!
+      (set (make-local-variable 'widget-keymap)
+           (let ((map (make-sparse-keymap)))
+             (set-keymap-parent map widget-keymap)
+             (define-key map "\C-x\C-s" 'ada-prj-save)
+             map))
 
       (set (make-local-variable 'ada-old-cross-prefix)
 	   (ada-xref-get-project-field 'cross-prefix))
--- a/lisp/progmodes/antlr-mode.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/progmodes/antlr-mode.el	Thu Dec 16 18:30:57 2010 -0500
@@ -87,6 +87,7 @@
   (require 'cl))
 
 (require 'easymenu)
+(require 'cc-mode)
 
 ;; Just to get the rid of the byte compiler warning.  The code for
 ;; this function and its friends are too complex for their own good.
@@ -1004,12 +1005,21 @@
 (defvar antlr-mode-hook nil
   "Hook called by `antlr-mode'.")
 
-(defvar antlr-mode-syntax-table nil
+(defvar antlr-mode-syntax-table
+  (let ((st (make-syntax-table)))
+    (c-populate-syntax-table st)
+    st)
   "Syntax table used in `antlr-mode' buffers.
 If non-nil, it will be initialized in `antlr-mode'.")
 
 ;; used for "in Java/C++ code" = syntactic-depth>0
-(defvar antlr-action-syntax-table nil
+(defvar antlr-action-syntax-table
+  (let ((st (copy-syntax-table antlr-mode-syntax-table))
+        (slist (nth 3 antlr-font-lock-defaults)))
+    (while slist
+      (modify-syntax-entry (caar slist) (cdar slist) st)
+      (setq slist (cdr slist)))
+    st)
   "Syntax table used for ANTLR action parsing.
 Initialized by `antlr-mode-syntax-table', changed by SYNTAX-ALIST in
 `antlr-font-lock-defaults'.  This table should be selected if you use
@@ -2189,7 +2199,7 @@
 		  (insert-file-contents file t nil nil t)
 		  (normal-mode t)	; necessary for major-mode, syntax
 					; table and `antlr-language'
-		  (when (eq major-mode 'antlr-mode)
+		  (when (derived-mode-p 'antlr-mode)
 		    (let* ((file-deps (antlr-file-dependencies))
 			   (file (car file-deps)))
 		      (when file-deps
@@ -2373,7 +2383,7 @@
 commentary with value `antlr-help-unknown-file-text' is added.  The
 *Help* buffer always starts with the text in `antlr-help-rules-intro'."
   (interactive)
-  (if (null (eq major-mode 'makefile-mode))
+  (if (null (derived-mode-p 'makefile-mode))
       (antlr-with-displaying-help-buffer 'antlr-insert-makefile-rules)
     (push-mark)
     (antlr-insert-makefile-rules t)))
@@ -2563,13 +2573,15 @@
   "Find language in `antlr-language-alist' for language option.
 If SEARCH is non-nil, find element for language option.  Otherwise, find
 the default language."
-  (let ((value (and search
-		    (save-excursion
-		      (goto-char (point-min))
-		      (re-search-forward (cdr antlr-language-limit-n-regexp)
-					 (car antlr-language-limit-n-regexp)
-					 t))
-		    (match-string 1)))
+  (let ((value
+         (and search
+              (save-excursion
+                (goto-char (point-min))
+                (re-search-forward (cdr antlr-language-limit-n-regexp)
+                                   (+ (point)
+                                      (car antlr-language-limit-n-regexp))
+                                   t))
+              (match-string 1)))
 	(seq antlr-language-alist)
 	r)
     ;; Like (find VALUE antlr-language-alist :key 'cddr :test 'member)
@@ -2581,35 +2593,20 @@
     (car r)))
 
 ;;;###autoload
-(defun antlr-mode ()
-  "Major mode for editing ANTLR grammar files.
-\\{antlr-mode-map}"
-  (interactive)
-  (kill-all-local-variables)
+(define-derived-mode antlr-mode prog-mode
+  ;; FIXME: Since it uses cc-mode, it bumps into c-update-modeline's
+  ;; limitation to mode-name being a string.
+  ;; '("Antlr." (:eval (cadr (assq antlr-language antlr-language-alist))))
+  "Antlr" 
+  "Major mode for editing ANTLR grammar files."
+  :abbrev-table antlr-mode-abbrev-table
   (c-initialize-cc-mode)		; cc-mode is required
   (unless (fboundp 'c-forward-sws)	; see above
     (fset 'antlr-c-forward-sws 'c-forward-syntactic-ws))
   ;; ANTLR specific ----------------------------------------------------------
-  (setq major-mode 'antlr-mode
-	mode-name "Antlr")
-  (setq local-abbrev-table antlr-mode-abbrev-table)
-  (unless antlr-mode-syntax-table
-    (setq antlr-mode-syntax-table (make-syntax-table))
-    (c-populate-syntax-table antlr-mode-syntax-table))
-  (set-syntax-table antlr-mode-syntax-table)
-  (unless antlr-action-syntax-table
-    (let ((slist (nth 3 antlr-font-lock-defaults)))
-      (setq antlr-action-syntax-table
-	    (copy-syntax-table antlr-mode-syntax-table))
-      (while slist
-	(modify-syntax-entry (caar slist) (cdar slist)
-			     antlr-action-syntax-table)
-	(setq slist (cdr slist)))))
-  (use-local-map antlr-mode-map)
-  (make-local-variable 'antlr-language)
   (unless antlr-language
-    (setq antlr-language
-	  (or (antlr-language-option t) (antlr-language-option nil))))
+    (set (make-local-variable 'antlr-language)
+         (or (antlr-language-option t) (antlr-language-option nil))))
   (if (stringp (cadr (assq antlr-language antlr-language-alist)))
       (setq mode-name
 	    (concat "Antlr."
@@ -2627,33 +2624,24 @@
 	(t				; cc-mode upto 5.28
 	 (antlr-c-init-language-vars)))	; do it myself
   (c-basic-common-init antlr-language (or antlr-indent-style "gnu"))
-  (make-local-variable 'outline-regexp)
-  (make-local-variable 'outline-level)
-  (make-local-variable 'require-final-newline)
-  (make-local-variable 'indent-line-function)
-  (make-local-variable 'indent-region-function)
-  (setq outline-regexp "[^#\n\^M]"
-	outline-level 'c-outline-level)	; TODO: define own
-  (setq require-final-newline mode-require-final-newline)
-  (setq indent-line-function 'antlr-indent-line
-	indent-region-function nil)	; too lazy
+  (set (make-local-variable 'outline-regexp) "[^#\n\^M]")
+  (set (make-local-variable 'outline-level) 'c-outline-level) ;TODO: define own
+  (set (make-local-variable 'indent-line-function) 'antlr-indent-line)
+  (set (make-local-variable 'indent-region-function) nil)	; too lazy
   (setq comment-start "// "
  	comment-end ""
 	comment-start-skip "/\\*+ *\\|// *")
   ;; various -----------------------------------------------------------------
-  (make-local-variable 'font-lock-defaults)
-  (setq font-lock-defaults antlr-font-lock-defaults)
+  (set (make-local-variable 'font-lock-defaults) antlr-font-lock-defaults)
   (easy-menu-add antlr-mode-menu)
-  (make-local-variable 'imenu-create-index-function)
-  (setq imenu-create-index-function 'antlr-imenu-create-index-function)
-  (make-local-variable 'imenu-generic-expression)
-  (setq imenu-generic-expression t)	; fool stupid test
+  (set (make-local-variable 'imenu-create-index-function)
+       'antlr-imenu-create-index-function)
+  (set (make-local-variable 'imenu-generic-expression) t) ; fool stupid test
   (and antlr-imenu-name			; there should be a global variable...
        (fboundp 'imenu-add-to-menubar)
        (imenu-add-to-menubar
 	(if (stringp antlr-imenu-name) antlr-imenu-name "Index")))
-  (antlr-set-tabs)
-  (run-mode-hooks 'antlr-mode-hook))
+  (antlr-set-tabs))
 
 ;; A smarter version of `group-buffers-menu-by-mode-then-alphabetically' (in
 ;; XEmacs) could use the following property.  The header of the submenu would
--- a/lisp/progmodes/asm-mode.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/progmodes/asm-mode.el	Thu Dec 16 18:30:57 2010 -0500
@@ -77,15 +77,14 @@
     (define-key map "\C-c;"	'comment-region)
     (define-key map "\C-j"	'newline-and-indent)
     (define-key map "\C-m"	'newline-and-indent)
-    (define-key map [menu-bar] (make-sparse-keymap))
-    (define-key map [menu-bar asm-mode] (cons "Asm" map))
-    (define-key map [comment-region]
+    (define-key map [menu-bar asm-mode] (cons "Asm" (make-sparse-keymap)))
+    (define-key map [menu-bar asm-mode comment-region]
       '(menu-item "Comment Region" comment-region
 		  :help "Comment or uncomment each line in the region"))
-    (define-key map [newline-and-indent]
+    (define-key map [menu-bar asm-mode newline-and-indent]
       '(menu-item "Insert Newline and Indent" newline-and-indent
 		  :help "Insert a newline, then indent according to major mode"))
-    (define-key map [asm-colon]
+    (define-key map [menu-bar asm-mode asm-colon]
       '(menu-item "Insert Colon" asm-colon
 		  :help "Insert a colon; if it follows a label, delete the label's indentation"))
     map)
@@ -142,16 +141,12 @@
   (set-syntax-table (make-syntax-table asm-mode-syntax-table))
   (modify-syntax-entry	asm-comment-char "< b")
 
-  (make-local-variable 'comment-start)
-  (setq comment-start (string asm-comment-char))
-  (make-local-variable 'comment-add)
-  (setq comment-add 1)
-  (make-local-variable 'comment-start-skip)
-  (setq comment-start-skip "\\(?:\\s<+\\|/[/*]+\\)[ \t]*")
-  (make-local-variable 'comment-end-skip)
-  (setq comment-end-skip "[ \t]*\\(\\s>\\|\\*+/\\)")
-  (make-local-variable 'comment-end)
-  (setq comment-end "")
+  (set (make-local-variable 'comment-start) (string asm-comment-char))
+  (set (make-local-variable 'comment-add) 1)
+  (set (make-local-variable 'comment-start-skip)
+       "\\(?:\\s<+\\|/[/*]+\\)[ \t]*")
+  (set (make-local-variable 'comment-end-skip) "[ \t]*\\(\\s>\\|\\*+/\\)")
+  (set (make-local-variable 'comment-end) "")
   (setq fill-prefix "\t"))
 
 (defun asm-indent-line ()
--- a/lisp/progmodes/autoconf.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/progmodes/autoconf.el	Thu Dec 16 18:30:57 2010 -0500
@@ -78,14 +78,8 @@
 	  (match-string-no-properties 3)))))
 
 ;;;###autoload
-(defun autoconf-mode ()
+(define-derived-mode autoconf-mode prog-mode "Autoconf"
   "Major mode for editing Autoconf configure.in files."
-  (interactive)
-  (kill-all-local-variables)
-  (use-local-map autoconf-mode-map)
-  (setq major-mode 'autoconf-mode)
-  (setq mode-name "Autoconf")
-  (set-syntax-table autoconf-mode-syntax-table)
   (set (make-local-variable 'parens-require-spaces) nil) ; for M4 arg lists
   (set (make-local-variable 'defun-prompt-regexp)
        "^[ \t]*A[CM]_\\(\\sw\\|\\s_\\)+")
@@ -100,8 +94,7 @@
   (set (make-local-variable 'imenu-syntax-alist) '(("_" . "w")))
   (set (make-local-variable 'indent-line-function) #'indent-relative)
   (set (make-local-variable 'add-log-current-defun-function)
-	#'autoconf-current-defun-function)
-  (run-mode-hooks 'autoconf-mode-hook))
+	#'autoconf-current-defun-function))
 
 (provide 'autoconf-mode)
 (provide 'autoconf)
--- a/lisp/progmodes/cc-cmds.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/progmodes/cc-cmds.el	Thu Dec 16 18:30:57 2010 -0500
@@ -266,8 +266,10 @@
 			  (symbol-value 'subword-mode))
 			 "w"
 		       "")))
+        ;; FIXME: Derived modes might want to use something else
+        ;; than a string for `mode-name'.
 	(bare-mode-name (if (string-match "\\(^[^/]*\\)/" mode-name)
-			    (substring mode-name (match-beginning 1) (match-end 1))
+			    (match-string 1 mode-name)
 			  mode-name)))
 ;;     (setq c-submode-indicators
 ;; 	  (if (> (length fmt) 1)
--- a/lisp/progmodes/cc-engine.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/progmodes/cc-engine.el	Thu Dec 16 18:30:57 2010 -0500
@@ -5846,7 +5846,8 @@
   ;; `c-record-type-identifiers' is non-nil.
   ;;
   ;; This function might do hidden buffer changes.
-  (when (looking-at "<")
+  (when (and c-recognize-<>-arglists
+	     (looking-at "<"))
     (c-forward-<>-arglist t)
     (c-forward-syntactic-ws))
 
--- a/lisp/progmodes/cc-mode.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/progmodes/cc-mode.el	Thu Dec 16 18:30:57 2010 -0500
@@ -487,15 +487,10 @@
 
   ;; these variables should always be buffer local; they do not affect
   ;; indentation style.
-  (make-local-variable 'parse-sexp-ignore-comments)
-  (make-local-variable 'indent-line-function)
-  (make-local-variable 'indent-region-function)
-  (make-local-variable 'normal-auto-fill-function)
   (make-local-variable 'comment-start)
   (make-local-variable 'comment-end)
   (make-local-variable 'comment-start-skip)
-  (make-local-variable 'comment-multi-line)
-  (make-local-variable 'comment-line-break-function)
+  
   (make-local-variable 'paragraph-start)
   (make-local-variable 'paragraph-separate)
   (make-local-variable 'paragraph-ignore-fill-prefix)
@@ -503,18 +498,18 @@
   (make-local-variable 'adaptive-fill-regexp)
 
   ;; now set their values
-  (setq parse-sexp-ignore-comments t
-	indent-line-function 'c-indent-line
-	indent-region-function 'c-indent-region
-	normal-auto-fill-function 'c-do-auto-fill
-	comment-multi-line t
-	comment-line-break-function 'c-indent-new-comment-line)
+  (set (make-local-variable 'parse-sexp-ignore-comments) t)
+  (set (make-local-variable 'indent-line-function) 'c-indent-line)
+  (set (make-local-variable 'indent-region-function) 'c-indent-region)
+  (set (make-local-variable 'normal-auto-fill-function) 'c-do-auto-fill)
+  (set (make-local-variable 'comment-multi-line) t)
+  (set (make-local-variable 'comment-line-break-function)
+       'c-indent-new-comment-line)
 
   ;; Install `c-fill-paragraph' on `fill-paragraph-function' so that a
   ;; direct call to `fill-paragraph' behaves better.  This still
   ;; doesn't work with filladapt but it's better than nothing.
-  (make-local-variable 'fill-paragraph-function)
-  (setq fill-paragraph-function 'c-fill-paragraph)
+  (set (make-local-variable 'fill-paragraph-function) 'c-fill-paragraph)
 
   ;; Initialise the cache of brace pairs, and opening braces/brackets/parens.
   (c-state-cache-init)
@@ -532,22 +527,19 @@
 
     ;; Emacs.
     (when (boundp 'parse-sexp-lookup-properties)
-      (make-local-variable 'parse-sexp-lookup-properties)
-      (setq parse-sexp-lookup-properties t))
+      (set (make-local-variable 'parse-sexp-lookup-properties) t))
 
     ;; Same as above for XEmacs.
     (when (boundp 'lookup-syntax-properties)
-      (make-local-variable 'lookup-syntax-properties)
-      (setq lookup-syntax-properties t)))
+      (set (make-local-variable 'lookup-syntax-properties) t)))
 
   ;; Use this in Emacs 21+ to avoid meddling with the rear-nonsticky
   ;; property on each character.
   (when (boundp 'text-property-default-nonsticky)
-    (make-local-variable 'text-property-default-nonsticky)
     (mapc (lambda (tprop)
 	    (unless (assq tprop text-property-default-nonsticky)
-	      (setq text-property-default-nonsticky
-		    (cons `(,tprop . t) text-property-default-nonsticky))))
+	      (set (make-local-variable 'text-property-default-nonsticky)
+                   (cons `(,tprop . t) text-property-default-nonsticky))))
 	  '(syntax-table category c-type)))
 
   ;; In Emacs 21 and later it's possible to turn off the ad-hoc
@@ -587,8 +579,7 @@
   (setq c-offsets-alist (copy-alist c-offsets-alist))
 
   ;; setup the comment indent variable in a Emacs version portable way
-  (make-local-variable 'comment-indent-function)
-  (setq comment-indent-function 'c-comment-indent)
+  (set (make-local-variable 'comment-indent-function) 'c-comment-indent)
 
 ;;   ;; Put submode indicators onto minor-mode-alist, but only once.
 ;;   (or (assq 'c-submode-indicators minor-mode-alist)
@@ -660,16 +651,14 @@
 	  (funcall c-before-font-lock-function (point-min) (point-max)
 		   (- (point-max) (point-min))))))
 
-  (make-local-variable 'outline-regexp)
-  (make-local-variable 'outline-level)
-  (setq outline-regexp "[^#\n\^M]"
-	outline-level 'c-outline-level)
+  (set (make-local-variable 'outline-regexp) "[^#\n\^M]")
+  (set (make-local-variable 'outline-level) 'c-outline-level)
 
   (let ((rfn (assq mode c-require-final-newline)))
     (when rfn
-      (make-local-variable 'require-final-newline)
       (and (cdr rfn)
-	   (setq require-final-newline mode-require-final-newline)))))
+	   (set (make-local-variable 'require-final-newline)
+                mode-require-final-newline)))))
 
 (defun c-count-cfss (lv-alist)
   ;; LV-ALIST is an alist like `file-local-variables-alist'.  Count how many
@@ -1100,8 +1089,7 @@
 This does not load the font-lock package.  Use after
 `c-basic-common-init' and after cc-fonts has been loaded."
 
-  (make-local-variable 'font-lock-defaults)
-  (setq font-lock-defaults
+  (set (make-local-variable 'font-lock-defaults)
 	`(,(if (c-major-mode-is 'awk-mode)
 	       ;; awk-mode currently has only one font lock level.
 	       'awk-font-lock-keywords
@@ -1206,7 +1194,7 @@
   (kill-all-local-variables)
   (c-initialize-cc-mode t)
   (set-syntax-table c-mode-syntax-table)
-  (setq major-mode 'c-mode
+  (setq major-mode 'c-mode           ; FIXME: Use define-derived-mode.
 	mode-name "C"
 	local-abbrev-table c-mode-abbrev-table
 	abbrev-mode t)
@@ -1269,7 +1257,7 @@
   (kill-all-local-variables)
   (c-initialize-cc-mode t)
   (set-syntax-table c++-mode-syntax-table)
-  (setq major-mode 'c++-mode
+  (setq major-mode 'c++-mode         ; FIXME: Use define-derived-mode.
 	mode-name "C++"
 	local-abbrev-table c++-mode-abbrev-table
 	abbrev-mode t)
@@ -1330,7 +1318,7 @@
   (kill-all-local-variables)
   (c-initialize-cc-mode t)
   (set-syntax-table objc-mode-syntax-table)
-  (setq major-mode 'objc-mode
+  (setq major-mode 'objc-mode        ; FIXME: Use define-derived-mode.
 	mode-name "ObjC"
 	local-abbrev-table objc-mode-abbrev-table
 	abbrev-mode t)
@@ -1400,7 +1388,7 @@
   (kill-all-local-variables)
   (c-initialize-cc-mode t)
   (set-syntax-table java-mode-syntax-table)
-  (setq major-mode 'java-mode
+  (setq major-mode 'java-mode        ; FIXME: Use define-derived-mode.
  	mode-name "Java"
  	local-abbrev-table java-mode-abbrev-table
 	abbrev-mode t)
@@ -1459,7 +1447,7 @@
   (kill-all-local-variables)
   (c-initialize-cc-mode t)
   (set-syntax-table idl-mode-syntax-table)
-  (setq major-mode 'idl-mode
+  (setq major-mode 'idl-mode         ; FIXME: Use define-derived-mode.
 	mode-name "IDL"
 	local-abbrev-table idl-mode-abbrev-table)
   (use-local-map idl-mode-map)
@@ -1520,7 +1508,7 @@
   (kill-all-local-variables)
   (c-initialize-cc-mode t)
   (set-syntax-table pike-mode-syntax-table)
-  (setq major-mode 'pike-mode
+  (setq major-mode 'pike-mode        ; FIXME: Use define-derived-mode.
  	mode-name "Pike"
  	local-abbrev-table pike-mode-abbrev-table
 	abbrev-mode t)
@@ -1594,7 +1582,7 @@
   (kill-all-local-variables)
   (c-initialize-cc-mode t)
   (set-syntax-table awk-mode-syntax-table)
-  (setq major-mode 'awk-mode
+  (setq major-mode 'awk-mode         ; FIXME: Use define-derived-mode.
 	mode-name "AWK"
 	local-abbrev-table awk-mode-abbrev-table
 	abbrev-mode t)
@@ -1680,7 +1668,7 @@
 		     adaptive-fill-regexp)
 		   nil)))
 	(mapc (lambda (var) (unless (boundp var)
-			      (setq vars (delq var vars))))
+                         (setq vars (delq var vars))))
 	      '(signal-error-on-buffer-boundary
 		filladapt-mode
 		defun-prompt-regexp
--- a/lisp/progmodes/cc-styles.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/progmodes/cc-styles.el	Thu Dec 16 18:30:57 2010 -0500
@@ -540,13 +540,12 @@
 
     (when (boundp 'adaptive-fill-first-line-regexp)
       ;; XEmacs adaptive fill mode doesn't have this.
-      (make-local-variable 'adaptive-fill-first-line-regexp)
-      (setq adaptive-fill-first-line-regexp
-	    (concat "\\`" comment-line-prefix
-		    ;; Maybe we should incorporate the old value here,
-		    ;; but then we have to do all sorts of kludges to
-		    ;; deal with the \` and \' it probably contains.
-		    "\\'"))))
+      (set (make-local-variable 'adaptive-fill-first-line-regexp)
+           (concat "\\`" comment-line-prefix
+                   ;; Maybe we should incorporate the old value here,
+                   ;; but then we have to do all sorts of kludges to
+                   ;; deal with the \` and \' it probably contains.
+                   "\\'"))))
 
   ;; Set up the values for use in strings.  These are the default
   ;; paragraph-start/separate values, enhanced to accept escaped EOLs as
--- a/lisp/progmodes/cfengine.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/progmodes/cfengine.el	Thu Dec 16 18:30:57 2010 -0500
@@ -221,7 +221,6 @@
   ;; movement.
 
   (set (make-local-variable 'parens-require-spaces) nil)
-  (set (make-local-variable 'require-final-newline) mode-require-final-newline)
   (set (make-local-variable 'comment-start)  "# ")
   (set (make-local-variable 'comment-start-skip)
        "\\(\\(?:^\\|[^\\\\\n]\\)\\(?:\\\\\\\\\\)*\\)#+[ \t]*")
--- a/lisp/progmodes/compile.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/progmodes/compile.el	Thu Dec 16 18:30:57 2010 -0500
@@ -1606,7 +1606,7 @@
   ;; Let windows scroll along with the output.
   (set (make-local-variable 'window-point-insertion-type) t)
   (set (make-local-variable 'tool-bar-map) compilation-mode-tool-bar-map)
-  (setq major-mode 'compilation-mode
+  (setq major-mode 'compilation-mode ; FIXME: Use define-derived-mode.
 	mode-name (or name-of-mode "Compilation"))
   (set (make-local-variable 'page-delimiter)
        compilation-page-delimiter)
--- a/lisp/progmodes/cpp.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/progmodes/cpp.el	Thu Dec 16 18:30:57 2010 -0500
@@ -416,63 +416,59 @@
 
 ;;; Edit Buffer:
 
-(defvar cpp-edit-map nil)
-;; Keymap for `cpp-edit-mode'.
+(defvar cpp-edit-mode-map
+  (let ((map (make-keymap)))
+    (suppress-keymap map)
+    (define-key map [ down-mouse-2 ] 'cpp-push-button)
+    (define-key map [ mouse-2 ] 'ignore)
+    (define-key map " " 'scroll-up)
+    (define-key map "\C-?" 'scroll-down)
+    (define-key map [ delete ] 'scroll-down)
+    (define-key map "\C-c\C-c" 'cpp-edit-apply)
+    (define-key map "a" 'cpp-edit-apply)
+    (define-key map "A" 'cpp-edit-apply)
+    (define-key map "r" 'cpp-edit-reset)
+    (define-key map "R" 'cpp-edit-reset)
+    (define-key map "s" 'cpp-edit-save)
+    (define-key map "S" 'cpp-edit-save)
+    (define-key map "l" 'cpp-edit-load)
+    (define-key map "L" 'cpp-edit-load)
+    (define-key map "h" 'cpp-edit-home)
+    (define-key map "H" 'cpp-edit-home)
+    (define-key map "b" 'cpp-edit-background)
+    (define-key map "B" 'cpp-edit-background)
+    (define-key map "k" 'cpp-edit-known)
+    (define-key map "K" 'cpp-edit-known)
+    (define-key map "u" 'cpp-edit-unknown)
+    (define-key map "u" 'cpp-edit-unknown)
+    (define-key map "t" 'cpp-edit-true)
+    (define-key map "T" 'cpp-edit-true)
+    (define-key map "f" 'cpp-edit-false)
+    (define-key map "F" 'cpp-edit-false)
+    (define-key map "w" 'cpp-edit-write)
+    (define-key map "W" 'cpp-edit-write)
+    (define-key map "X" 'cpp-edit-toggle-known)
+    (define-key map "x" 'cpp-edit-toggle-known)
+    (define-key map "Y" 'cpp-edit-toggle-unknown)
+    (define-key map "y" 'cpp-edit-toggle-unknown)
+    (define-key map "q" 'bury-buffer)
+    (define-key map "Q" 'bury-buffer)
+    map)
+  "Keymap for `cpp-edit-mode'.")
 
-(if cpp-edit-map
-    ()
-  (setq cpp-edit-map (make-keymap))
-  (suppress-keymap cpp-edit-map)
-  (define-key cpp-edit-map [ down-mouse-2 ] 'cpp-push-button)
-  (define-key cpp-edit-map [ mouse-2 ] 'ignore)
-  (define-key cpp-edit-map " " 'scroll-up)
-  (define-key cpp-edit-map "\C-?" 'scroll-down)
-  (define-key cpp-edit-map [ delete ] 'scroll-down)
-  (define-key cpp-edit-map "\C-c\C-c" 'cpp-edit-apply)
-  (define-key cpp-edit-map "a" 'cpp-edit-apply)
-  (define-key cpp-edit-map "A" 'cpp-edit-apply)
-  (define-key cpp-edit-map "r" 'cpp-edit-reset)
-  (define-key cpp-edit-map "R" 'cpp-edit-reset)
-  (define-key cpp-edit-map "s" 'cpp-edit-save)
-  (define-key cpp-edit-map "S" 'cpp-edit-save)
-  (define-key cpp-edit-map "l" 'cpp-edit-load)
-  (define-key cpp-edit-map "L" 'cpp-edit-load)
-  (define-key cpp-edit-map "h" 'cpp-edit-home)
-  (define-key cpp-edit-map "H" 'cpp-edit-home)
-  (define-key cpp-edit-map "b" 'cpp-edit-background)
-  (define-key cpp-edit-map "B" 'cpp-edit-background)
-  (define-key cpp-edit-map "k" 'cpp-edit-known)
-  (define-key cpp-edit-map "K" 'cpp-edit-known)
-  (define-key cpp-edit-map "u" 'cpp-edit-unknown)
-  (define-key cpp-edit-map "u" 'cpp-edit-unknown)
-  (define-key cpp-edit-map "t" 'cpp-edit-true)
-  (define-key cpp-edit-map "T" 'cpp-edit-true)
-  (define-key cpp-edit-map "f" 'cpp-edit-false)
-  (define-key cpp-edit-map "F" 'cpp-edit-false)
-  (define-key cpp-edit-map "w" 'cpp-edit-write)
-  (define-key cpp-edit-map "W" 'cpp-edit-write)
-  (define-key cpp-edit-map "X" 'cpp-edit-toggle-known)
-  (define-key cpp-edit-map "x" 'cpp-edit-toggle-known)
-  (define-key cpp-edit-map "Y" 'cpp-edit-toggle-unknown)
-  (define-key cpp-edit-map "y" 'cpp-edit-toggle-unknown)
-  (define-key cpp-edit-map "q" 'bury-buffer)
-  (define-key cpp-edit-map "Q" 'bury-buffer))
+
 
 (defvar cpp-edit-symbols nil)
 ;; Symbols defined in the edit buffer.
 (make-variable-buffer-local 'cpp-edit-symbols)
 
-(defun cpp-edit-mode ()
+(define-derived-mode cpp-edit-mode fundamental-mode "CPP Edit"
   "Major mode for editing the criteria for highlighting cpp conditionals.
 Click on objects to change them.
 You can also use the keyboard accelerators indicated like this: [K]ey."
-  (kill-all-local-variables)
   (buffer-disable-undo)
   (auto-save-mode -1)
-  (setq buffer-read-only t)
-  (setq major-mode 'cpp-edit-mode)
-  (setq mode-name "CPP Edit")
-  (use-local-map cpp-edit-map))
+  (setq buffer-read-only t))
 
 (defun cpp-edit-apply ()
   "Apply edited display information to original buffer."
@@ -568,7 +564,7 @@
 	 (load-file cpp-config-file))
 	((file-readable-p (concat "~/" cpp-config-file))
 	 (load-file cpp-config-file)))
-  (if (eq major-mode 'cpp-edit-mode)
+  (if (derived-mode-p 'cpp-edit-mode)
       (cpp-edit-reset)))
 
 (defun cpp-edit-save ()
--- a/lisp/progmodes/dcl-mode.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/progmodes/dcl-mode.el	Thu Dec 16 18:30:57 2010 -0500
@@ -296,72 +296,69 @@
 )
 
 
-(defvar dcl-mode-map ()
-  "Keymap used in DCL-mode buffers.")
-(if dcl-mode-map
-    ()
-  (setq dcl-mode-map (make-sparse-keymap))
-  (define-key dcl-mode-map "\e\n"	'dcl-split-line)
-  (define-key dcl-mode-map "\e\t" 	'tempo-complete-tag)
-  (define-key dcl-mode-map "\e^"	'dcl-delete-indentation)
-  (define-key dcl-mode-map "\em"	'dcl-back-to-indentation)
-  (define-key dcl-mode-map "\ee"        'dcl-forward-command)
-  (define-key dcl-mode-map "\ea"        'dcl-backward-command)
-  (define-key dcl-mode-map "\e\C-q" 	'dcl-indent-command)
-  (define-key dcl-mode-map "\t"         'dcl-tab)
-  (define-key dcl-mode-map ":"          'dcl-electric-character)
-  (define-key dcl-mode-map "F"          'dcl-electric-character)
-  (define-key dcl-mode-map "f"          'dcl-electric-character)
-  (define-key dcl-mode-map "E"          'dcl-electric-character)
-  (define-key dcl-mode-map "e"          'dcl-electric-character)
-  (define-key dcl-mode-map "\C-c\C-o" 	'dcl-set-option)
-  (define-key dcl-mode-map "\C-c\C-f" 	'tempo-forward-mark)
-  (define-key dcl-mode-map "\C-c\C-b" 	'tempo-backward-mark)
+(defvar dcl-mode-map
+  (let ((map (make-sparse-keymap)))
+    (define-key map "\e\n"	'dcl-split-line)
+    (define-key map "\e\t" 	'tempo-complete-tag)
+    (define-key map "\e^"	'dcl-delete-indentation)
+    (define-key map "\em"	'dcl-back-to-indentation)
+    (define-key map "\ee"        'dcl-forward-command)
+    (define-key map "\ea"        'dcl-backward-command)
+    (define-key map "\e\C-q" 	'dcl-indent-command)
+    (define-key map "\t"         'dcl-tab)
+    (define-key map ":"          'dcl-electric-character)
+    (define-key map "F"          'dcl-electric-character)
+    (define-key map "f"          'dcl-electric-character)
+    (define-key map "E"          'dcl-electric-character)
+    (define-key map "e"          'dcl-electric-character)
+    (define-key map "\C-c\C-o" 	'dcl-set-option)
+    (define-key map "\C-c\C-f" 	'tempo-forward-mark)
+    (define-key map "\C-c\C-b" 	'tempo-backward-mark)
 
-  (define-key dcl-mode-map [menu-bar] 	(make-sparse-keymap))
-  (define-key dcl-mode-map [menu-bar dcl]
-    (cons "DCL" (make-sparse-keymap "DCL")))
+    (define-key map [menu-bar] 	(make-sparse-keymap))
+    (define-key map [menu-bar dcl]
+      (cons "DCL" (make-sparse-keymap "DCL")))
 
-  ;; Define these in bottom-up order
-  (define-key dcl-mode-map [menu-bar dcl tempo-backward-mark]
-    '("Previous template mark" . tempo-backward-mark))
-  (define-key dcl-mode-map [menu-bar dcl tempo-forward-mark]
-    '("Next template mark" . tempo-forward-mark))
-  (define-key dcl-mode-map [menu-bar dcl tempo-complete-tag]
-    '("Complete template tag" . tempo-complete-tag))
-  (define-key dcl-mode-map [menu-bar dcl dcl-separator-tempo]
-    '("--"))
-  (define-key dcl-mode-map [menu-bar dcl dcl-save-all-options]
-    '("Save all options" . dcl-save-all-options))
-  (define-key dcl-mode-map [menu-bar dcl dcl-save-nondefault-options]
-    '("Save changed options" . dcl-save-nondefault-options))
-  (define-key dcl-mode-map [menu-bar dcl dcl-set-option]
-    '("Set option" . dcl-set-option))
-  (define-key dcl-mode-map [menu-bar dcl dcl-separator-option]
-    '("--"))
-  (define-key dcl-mode-map [menu-bar dcl dcl-delete-indentation]
-    '("Delete indentation" . dcl-delete-indentation))
-  (define-key dcl-mode-map [menu-bar dcl dcl-split-line]
-    '("Split line" . dcl-split-line))
-  (define-key dcl-mode-map [menu-bar dcl dcl-indent-command]
-    '("Indent command" . dcl-indent-command))
-  (define-key dcl-mode-map [menu-bar dcl dcl-tab]
-    '("Indent line/insert tab" . dcl-tab))
-  (define-key dcl-mode-map [menu-bar dcl dcl-back-to-indentation]
-    '("Back to indentation" . dcl-back-to-indentation))
-  (define-key dcl-mode-map [menu-bar dcl dcl-forward-command]
-    '("End of statement" . dcl-forward-command))
-  (define-key dcl-mode-map [menu-bar dcl dcl-backward-command]
-    '("Beginning of statement" . dcl-backward-command))
-  ;; imenu is only supported for versions with imenu-generic-expression
-  (if (boundp 'imenu-generic-expression)
-      (progn
-	(define-key dcl-mode-map [menu-bar dcl dcl-separator-movement]
-	  '("--"))
-	(define-key dcl-mode-map [menu-bar dcl imenu]
-	  '("Buffer index menu" . imenu))))
-  )
-
+    ;; Define these in bottom-up order
+    (define-key map [menu-bar dcl tempo-backward-mark]
+      '("Previous template mark" . tempo-backward-mark))
+    (define-key map [menu-bar dcl tempo-forward-mark]
+      '("Next template mark" . tempo-forward-mark))
+    (define-key map [menu-bar dcl tempo-complete-tag]
+      '("Complete template tag" . tempo-complete-tag))
+    (define-key map [menu-bar dcl dcl-separator-tempo]
+      '("--"))
+    (define-key map [menu-bar dcl dcl-save-all-options]
+      '("Save all options" . dcl-save-all-options))
+    (define-key map [menu-bar dcl dcl-save-nondefault-options]
+      '("Save changed options" . dcl-save-nondefault-options))
+    (define-key map [menu-bar dcl dcl-set-option]
+      '("Set option" . dcl-set-option))
+    (define-key map [menu-bar dcl dcl-separator-option]
+      '("--"))
+    (define-key map [menu-bar dcl dcl-delete-indentation]
+      '("Delete indentation" . dcl-delete-indentation))
+    (define-key map [menu-bar dcl dcl-split-line]
+      '("Split line" . dcl-split-line))
+    (define-key map [menu-bar dcl dcl-indent-command]
+      '("Indent command" . dcl-indent-command))
+    (define-key map [menu-bar dcl dcl-tab]
+      '("Indent line/insert tab" . dcl-tab))
+    (define-key map [menu-bar dcl dcl-back-to-indentation]
+      '("Back to indentation" . dcl-back-to-indentation))
+    (define-key map [menu-bar dcl dcl-forward-command]
+      '("End of statement" . dcl-forward-command))
+    (define-key map [menu-bar dcl dcl-backward-command]
+      '("Beginning of statement" . dcl-backward-command))
+    ;; imenu is only supported for versions with imenu-generic-expression
+    (if (boundp 'imenu-generic-expression)
+        (progn
+          (define-key map [menu-bar dcl dcl-separator-movement]
+            '("--"))
+          (define-key map [menu-bar dcl imenu]
+            '("Buffer index menu" . imenu))))
+    map)
+  "Keymap used in DCL-mode buffers.")
 
 (defcustom dcl-ws-r
   "\\([ \t]*-[ \t]*\\(!.*\\)*\n\\)*[ \t]*"
@@ -475,7 +472,7 @@
 
 
 ;;;###autoload
-(defun dcl-mode ()
+(define-derived-mode dcl-mode prog-mode "DCL"
   "Major mode for editing DCL-files.
 
 This mode indents command lines in blocks.  (A block is commands between
@@ -593,29 +590,17 @@
 
 There is some minimal font-lock support (see vars
 `dcl-font-lock-defaults' and `dcl-font-lock-keywords')."
-  (interactive)
-  (kill-all-local-variables)
-  (set-syntax-table dcl-mode-syntax-table)
-
-  (make-local-variable 'indent-line-function)
-  (setq indent-line-function 'dcl-indent-line)
-
-  (make-local-variable 'comment-start)
-  (setq comment-start "!")
-
-  (make-local-variable 'comment-end)
-  (setq comment-end "")
-
-  (make-local-variable 'comment-multi-line)
-  (setq comment-multi-line nil)
+  (set (make-local-variable 'indent-line-function) 'dcl-indent-line)
+  (set (make-local-variable 'comment-start) "!")
+  (set (make-local-variable 'comment-end) "")
+  (set (make-local-variable 'comment-multi-line) nil)
 
   ;; This used to be "^\\$[ \t]*![ \t]*" which looks more correct.
   ;; The drawback was that you couldn't make empty comment lines by pressing
   ;; C-M-j repeatedly - only the first line became a comment line.
   ;; This version has the drawback that the "$" can be anywhere in the line,
   ;; and something inappropriate might be interpreted as a comment.
-  (make-local-variable 'comment-start-skip)
-  (setq comment-start-skip "\\$[ \t]*![ \t]*")
+  (set (make-local-variable 'comment-start-skip) "\\$[ \t]*![ \t]*")
 
   (if (boundp 'imenu-generic-expression)
       (progn (setq imenu-generic-expression dcl-imenu-generic-expression)
@@ -636,14 +621,9 @@
   (make-local-variable 'dcl-electric-reindent-regexps)
 
   ;; font lock
-  (make-local-variable 'font-lock-defaults)
-  (setq font-lock-defaults dcl-font-lock-defaults)
+  (set (make-local-variable 'font-lock-defaults) dcl-font-lock-defaults)
 
-  (setq major-mode 'dcl-mode)
-  (setq mode-name "DCL")
-  (use-local-map dcl-mode-map)
-  (tempo-use-tag-list 'dcl-tempo-tags)
-  (run-mode-hooks 'dcl-mode-hook))
+  (tempo-use-tag-list 'dcl-tempo-tags))
 
 
 ;;; *** Movement commands ***************************************************
--- a/lisp/progmodes/delphi.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/progmodes/delphi.el	Thu Dec 16 18:30:57 2010 -0500
@@ -1779,7 +1779,7 @@
     (if (null file)
         (error "unit not found: %s" unit-file)
       (find-file file)
-      (if (not (eq major-mode 'delphi-mode))
+      (if (not (derived-mode-p 'delphi-mode))
           (delphi-mode)))
     file))
 
@@ -2015,7 +2015,7 @@
   (interactive)
   (kill-all-local-variables)
   (use-local-map delphi-mode-map)
-  (setq major-mode 'delphi-mode)
+  (setq major-mode 'delphi-mode)        ;FIXME: Use define-derived-mode.
   (setq mode-name "Delphi")
 
   (setq local-abbrev-table delphi-mode-abbrev-table)
@@ -2025,8 +2025,7 @@
   (mapc #'(lambda (var)
 	    (let ((var-symb (car var))
 		  (var-val (cadr var)))
-	      (make-local-variable var-symb)
-	      (set var-symb var-val)))
+              (set (make-local-variable var-symb) var-val)))
 	(list '(indent-line-function delphi-indent-line)
 	      '(comment-indent-function delphi-indent-line)
 	      '(case-fold-search t)
--- a/lisp/progmodes/ebrowse.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/progmodes/ebrowse.el	Thu Dec 16 18:30:57 2010 -0500
@@ -1116,7 +1116,7 @@
 ;;; Tree-mode - mode for tree buffers
 
 ;;;###autoload
-(defun ebrowse-tree-mode ()
+(define-derived-mode ebrowse-tree-mode special-mode "Ebrowse-Tree"
   "Major mode for Ebrowse class tree buffers.
 Each line corresponds to a class in a class tree.
 Letters do not insert themselves, they are commands.
@@ -1125,12 +1125,10 @@
 
 Tree mode key bindings:
 \\{ebrowse-tree-mode-map}"
-  (interactive)
   (let* ((ident (propertized-buffer-identification "C++ Tree"))
-	 header tree buffer-read-only)
-
-    (kill-all-local-variables)
-    (use-local-map ebrowse-tree-mode-map)
+	 (inhibit-read-only t)
+         header tree)
+
     (buffer-disable-undo)
 
     (unless (zerop (buffer-size))
@@ -1141,38 +1139,27 @@
       (erase-buffer)
       (message nil))
 
-    (mapc 'make-local-variable
-	  '(ebrowse--tags-file-name
-	    ebrowse--indentation
-	    ebrowse--tree
-	    ebrowse--header
-	    ebrowse--show-file-names-flag
-	    ebrowse--frozen-flag
-	    ebrowse--tree-obarray
-	    revert-buffer-function))
-
-    (setf ebrowse--show-file-names-flag nil
-	  ebrowse--tree-obarray (make-vector 127 0)
-	  ebrowse--frozen-flag nil
-	  major-mode 'ebrowse-tree-mode
-	  mode-name "Ebrowse-Tree"
-	  mode-line-buffer-identification ident
-	  buffer-read-only t
-	  selective-display t
-	  selective-display-ellipses t
-	  revert-buffer-function 'ebrowse-revert-tree-buffer-from-file
-	  ebrowse--header header
-	  ebrowse--tree tree
-	  ebrowse--tags-file-name (buffer-file-name)
-	  ebrowse--tree-obarray (and tree (ebrowse-build-tree-obarray tree))
-	  ebrowse--frozen-flag nil)
-
-    (add-hook 'local-write-file-hooks 'ebrowse-write-file-hook-fn)
+    (set (make-local-variable 'ebrowse--show-file-names-flag) nil)
+    (set (make-local-variable 'ebrowse--tree-obarray) (make-vector 127 0))
+    (set (make-local-variable 'ebrowse--frozen-flag) nil)
+    (setq mode-line-buffer-identification ident)
+    (setq buffer-read-only t)
+    (setq selective-display t)
+    (setq selective-display-ellipses t)
+    (set (make-local-variable 'revert-buffer-function)
+         #'ebrowse-revert-tree-buffer-from-file)
+    (set (make-local-variable 'ebrowse--header) header)
+    (set (make-local-variable 'ebrowse--tree) tree)
+    (set (make-local-variable 'ebrowse--tags-file-name) buffer-file-name)
+    (set (make-local-variable 'ebrowse--tree-obarray)
+         (and tree (ebrowse-build-tree-obarray tree)))
+    (set (make-local-variable 'ebrowse--frozen-flag) nil)
+
+    (add-hook 'local-write-file-hooks 'ebrowse-write-file-hook-fn nil t)
     (modify-syntax-entry ?_ (char-to-string (char-syntax ?a)))
     (when tree
       (ebrowse-redraw-tree)
-      (set-buffer-modified-p nil))
-    (run-mode-hooks 'ebrowse-tree-mode-hook)))
+      (set-buffer-modified-p nil))))
 
 
 
@@ -1340,6 +1327,7 @@
 
 (defun ebrowse-member-buffer-p (buffer)
   "Value is non-nil if BUFFER is a member buffer."
+  ;; FIXME: Why not (buffer-local-value 'major-mode buffer)?
   (eq (cdr (assoc 'major-mode (buffer-local-variables buffer)))
       'ebrowse-member-mode))
 
@@ -1459,12 +1447,13 @@
 (defun ebrowse-set-tree-indentation ()
   "Set the indentation width of the tree display."
   (interactive)
-  (let ((width (string-to-number (read-from-minibuffer
-                                  (concat "Indentation ("
+  (let ((width (string-to-number (read-string
+                                  (concat "Indentation (default "
                                           (int-to-string ebrowse--indentation)
-                                          "): ")))))
+                                          "): ")
+                                  nil nil ebrowse--indentation))))
     (when (plusp width)
-      (setf ebrowse--indentation width)
+      (set (make-local-variable 'ebrowse--indentation) width)
       (ebrowse-redraw-tree))))
 
 
@@ -1632,13 +1621,12 @@
 	(had-a-buf (get-file-buffer file))
 	(buf-to-view (find-file-noselect file)))
     (switch-to-buffer-other-frame buf-to-view)
-    (make-local-variable 'ebrowse--frame-configuration)
-    (setq ebrowse--frame-configuration old-frame-configuration)
-    (make-local-variable 'ebrowse--view-exit-action)
-    (setq ebrowse--view-exit-action
-	  (and (not had-a-buf)
-	       (not (buffer-modified-p buf-to-view))
-	       'kill-buffer))
+    (set (make-local-variable 'ebrowse--frame-configuration)
+         old-frame-configuration)
+    (set (make-local-variable 'ebrowse--view-exit-action)
+         (and (not had-a-buf)
+              (not (buffer-modified-p buf-to-view))
+              'kill-buffer))
     (view-mode-enter (cons (selected-window) (cons (selected-window) t))
 		     'ebrowse-view-exit-fn)))
 
@@ -2006,21 +1994,16 @@
 (put 'ebrowse-electric-list-undefined 'suppress-keymap t)
 
 
-(defun ebrowse-electric-list-mode ()
+(define-derived-mode ebrowse-electric-list-mode
+  fundamental-mode "Electric Position Menu"
   "Mode for electric tree list mode."
-  (kill-all-local-variables)
-  (use-local-map ebrowse-electric-list-mode-map)
-  (setq mode-name "Electric Position Menu"
-	mode-line-buffer-identification "Electric Tree Menu")
+  (setq mode-line-buffer-identification "Electric Tree Menu")
   (when (memq 'mode-name mode-line-format)
     (setq mode-line-format (copy-sequence mode-line-format))
     (setcar (memq 'mode-name mode-line-format) "Tree Buffers"))
-  (make-local-variable 'Helper-return-blurb)
-  (setq Helper-return-blurb "return to buffer editing"
-	truncate-lines t
-	buffer-read-only t
-	major-mode 'ebrowse-electric-list-mode)
-  (run-mode-hooks 'ebrowse-electric-list-mode-hook))
+  (set (make-local-variable 'Helper-return-blurb) "return to buffer editing")
+  (setq truncate-lines t
+	buffer-read-only t))
 
 
 (defun ebrowse-list-tree-buffers ()
@@ -2226,13 +2209,8 @@
 ;;; Member mode
 
 ;;;###autoload
-(defun ebrowse-member-mode ()
-  "Major mode for Ebrowse member buffers.
-
-\\{ebrowse-member-mode-map}"
-  (kill-all-local-variables)
-  (use-local-map ebrowse-member-mode-map)
-  (setq major-mode 'ebrowse-member-mode)
+(define-derived-mode ebrowse-member-mode special-mode "Ebrowse-Members"
+  "Major mode for Ebrowse member buffers."
   (mapc 'make-local-variable
 	'(ebrowse--decl-column	        ;display column
 	  ebrowse--n-columns		;number of short columns
@@ -2255,8 +2233,7 @@
 	  ebrowse--const-display-flag
 	  ebrowse--pure-display-flag
 	  ebrowse--frozen-flag))	;buffer not automagically reused
-  (setq mode-name "Ebrowse-Members"
-	mode-line-buffer-identification
+  (setq mode-line-buffer-identification
 	(propertized-buffer-identification "C++ Members")
 	buffer-read-only t
 	ebrowse--long-display-flag nil
@@ -2270,8 +2247,7 @@
 	ebrowse--inline-display-flag nil
 	ebrowse--const-display-flag nil
 	ebrowse--pure-display-flag nil)
-  (modify-syntax-entry ?_ (char-to-string (char-syntax ?a)))
-  (run-mode-hooks 'ebrowse-member-mode-hook))
+  (modify-syntax-entry ?_ (char-to-string (char-syntax ?a))))
 
 
 
@@ -3967,22 +3943,17 @@
 (put 'ebrowse-electric-position-undefined 'suppress-keymap t)
 
 
-(defun ebrowse-electric-position-mode ()
+(define-derived-mode ebrowse-electric-position-mode
+  fundamental-mode "Electric Position Menu"
   "Mode for electric position buffers.
 Runs the hook `ebrowse-electric-position-mode-hook'."
-  (kill-all-local-variables)
-  (use-local-map ebrowse-electric-position-mode-map)
-  (setq mode-name "Electric Position Menu"
-	mode-line-buffer-identification "Electric Position Menu")
+  (setq mode-line-buffer-identification "Electric Position Menu")
   (when (memq 'mode-name mode-line-format)
     (setq mode-line-format (copy-sequence mode-line-format))
     (setcar (memq 'mode-name mode-line-format) "Positions"))
-  (make-local-variable 'Helper-return-blurb)
-  (setq Helper-return-blurb "return to buffer editing"
-	truncate-lines t
-	buffer-read-only t
-	major-mode 'ebrowse-electric-position-mode)
-  (run-mode-hooks 'ebrowse-electric-position-mode-hook))
+  (set (make-local-variable 'Helper-return-blurb) "return to buffer editing")
+  (setq truncate-lines t
+	buffer-read-only t))
 
 
 (defun ebrowse-draw-position-buffer ()
--- a/lisp/progmodes/etags.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/progmodes/etags.el	Thu Dec 16 18:30:57 2010 -0500
@@ -280,7 +280,7 @@
 (defun tags-table-mode ()
   "Major mode for tags table file buffers."
   (interactive)
-  (setq major-mode 'tags-table-mode
+  (setq major-mode 'tags-table-mode     ;FIXME: Use define-derived-mode.
         mode-name "Tags Table"
         buffer-undo-list t)
   (initialize-new-tags-table))
@@ -2030,10 +2030,8 @@
     (define-key map "q" 'select-tags-table-quit)
     map))
 
-(define-derived-mode select-tags-table-mode fundamental-mode "Select Tags Table"
-  "Major mode for choosing a current tags table among those already loaded.
-
-\\{select-tags-table-mode-map}"
+(define-derived-mode select-tags-table-mode special-mode "Select Tags Table"
+  "Major mode for choosing a current tags table among those already loaded."
   (setq buffer-read-only t))
 
 (defun select-tags-table-select (button)
--- a/lisp/progmodes/f90.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/progmodes/f90.el	Thu Dec 16 18:30:57 2010 -0500
@@ -1067,11 +1067,9 @@
 Turning on F90 mode calls the value of the variable `f90-mode-hook'
 with no args, if that value is non-nil."
   :group 'f90
-  :syntax-table f90-mode-syntax-table
   :abbrev-table f90-mode-abbrev-table
   (set (make-local-variable 'indent-line-function) 'f90-indent-line)
   (set (make-local-variable 'indent-region-function) 'f90-indent-region)
-  (set (make-local-variable 'require-final-newline) mode-require-final-newline)
   (set (make-local-variable 'comment-start) "!")
   (set (make-local-variable 'comment-start-skip) "!+ *")
   (set (make-local-variable 'comment-indent-function) 'f90-comment-indent)
@@ -2207,7 +2205,7 @@
 With optional argument ALL, change the default for all present
 and future F90 buffers.  F90 mode normally treats backslash as an
 escape character."
-  (or (eq major-mode 'f90-mode)
+  (or (derived-mode-p 'f90-mode)
       (error "This function should only be used in F90 buffers"))
   (when (equal (char-syntax ?\\ ) ?\\ )
     (or all (set-syntax-table (copy-syntax-table (syntax-table))))
--- a/lisp/progmodes/flymake.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/progmodes/flymake.el	Thu Dec 16 18:30:57 2010 -0500
@@ -413,9 +413,11 @@
        (not (equal file-one file-two))))
 
 (defcustom flymake-check-file-limit 8192
-  "Max number of chars to look at when checking possible master file."
+  "Maximum number of chars to look at when checking possible master file.
+Nil means search the entire file."
   :group 'flymake
-  :type 'integer)
+  :type '(choice (const :tag "No limit" nil)
+                 (integer :tag "Characters")))
 
 (defun flymake-check-patch-master-file-buffer
        (master-file-temp-buffer
@@ -431,16 +433,26 @@
 Whether a buffer for MATER-FILE-NAME exists, use it as a source
 instead of reading master file from disk."
   (let* ((source-file-nondir (file-name-nondirectory source-file-name))
+         (source-file-extension (file-name-extension source-file-nondir))
+         (source-file-nonext (file-name-sans-extension source-file-nondir))
          (found                     nil)
 	 (inc-name                  nil)
 	 (search-limit              flymake-check-file-limit))
     (setq regexp
           (format regexp	; "[ \t]*#[ \t]*include[ \t]*\"\\(.*%s\\)\""
-                  (regexp-quote source-file-nondir)))
+                  ;; Hack for tex files, where \include often excludes .tex.
+                  ;; Maybe this is safe generally.
+                  (if (and (> (length source-file-extension) 1)
+                           (string-equal source-file-extension "tex"))
+                      (format "%s\\(?:\\.%s\\)?"
+                              (regexp-quote source-file-nonext)
+                              (regexp-quote source-file-extension))
+                    (regexp-quote source-file-nondir))))
     (unwind-protect
         (with-current-buffer master-file-temp-buffer
-          (when (> search-limit (point-max))
-            (setq search-limit (point-max)))
+          (if (or (not search-limit)
+                  (> search-limit (point-max)))
+              (setq search-limit (point-max)))
           (flymake-log 3 "checking %s against regexp %s"
                        master-file-name regexp)
           (goto-char (point-min))
@@ -451,6 +463,11 @@
 
               (flymake-log 3 "found possible match for %s" source-file-nondir)
               (setq inc-name (match-string 1))
+              (and (> (length source-file-extension) 1)
+                   (string-equal source-file-extension "tex")
+                   (not (string-match (format "\\.%s\\'" source-file-extension)
+                                      inc-name))
+                   (setq inc-name (concat inc-name "." source-file-extension)))
               (when (eq t (compare-strings
                            source-file-nondir nil nil
                            inc-name (- (length inc-name)
@@ -1737,11 +1754,14 @@
 (defun flymake-simple-tex-init ()
   (flymake-get-tex-args (flymake-init-create-temp-buffer-copy 'flymake-create-temp-inplace)))
 
+;; Perhaps there should be a buffer-local variable flymake-master-file
+;; that people can set to override this stuff.  Could inherit from
+;; the similar AUCTeX variable.
 (defun flymake-master-tex-init ()
   (let* ((temp-master-file-name (flymake-init-create-temp-source-and-master-buffer-copy
                                  'flymake-get-include-dirs-dot 'flymake-create-temp-inplace
 				 '("\\.tex\\'")
-				 "[ \t]*\\input[ \t]*{\\(.*%s\\)}")))
+				 "[ \t]*\\in\\(?:put\\|clude\\)[ \t]*{\\(.*%s\\)}")))
     (when temp-master-file-name
       (flymake-get-tex-args temp-master-file-name))))
 
--- a/lisp/progmodes/gdb-mi.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/progmodes/gdb-mi.el	Thu Dec 16 18:30:57 2010 -0500
@@ -647,7 +647,22 @@
   (gud-common-init command-line nil 'gud-gdbmi-marker-filter)
   (set (make-local-variable 'gud-minor-mode) 'gdbmi)
   (setq comint-input-sender 'gdb-send)
-
+  (when (ring-empty-p comint-input-ring) ; cf shell-mode
+    (let (hfile)
+      (when (catch 'done
+	      (dolist (file '(".gdbinit" "~/.gdbinit"))
+		(if (file-readable-p (setq file (expand-file-name file)))
+		    (with-temp-buffer
+		      (insert-file-contents file)
+		      (and (re-search-forward
+			    "^ *set history filename  *\\(.*\\)" nil t)
+			   (file-readable-p
+			    (setq hfile (expand-file-name
+					 (match-string 1)
+					 (file-name-directory file))))
+			   (throw 'done t))))))
+	(set (make-local-variable 'comint-input-ring-file-name) hfile)
+	(comint-read-input-ring t))))
   (gud-def gud-tbreak "tbreak %f:%l" "\C-t"
 	   "Set temporary breakpoint at current line.")
   (gud-def gud-jump
@@ -1001,7 +1016,7 @@
 					'gud-gdb-complete-command)
 		     (if (and transient-mark-mode mark-active)
 			 (buffer-substring (region-beginning) (region-end))
-		       (concat (if (eq major-mode 'gdb-registers-mode) "$")
+		       (concat (if (derived-mode-p 'gdb-registers-mode) "$")
 			       (tooltip-identifier-from-point (point)))))))
 	      (set-text-properties 0 (length expr) nil expr)
 	      (gdb-input
@@ -1468,14 +1483,9 @@
 
 ;; We want to use comint because it has various nifty and familiar features.
 (define-derived-mode gdb-inferior-io-mode comint-mode "Inferior I/O"
-  "Major mode for gdb inferior-io.
-
-The following commands are available:
-\\{gdb-inferior-io-mode-map}"
-
+  "Major mode for gdb inferior-io."
   :syntax-table nil :abbrev-table nil
-
-(make-comint-in-buffer "gdb-inferior" (current-buffer)  nil))
+  (make-comint-in-buffer "gdb-inferior" (current-buffer) nil))
 
 (defun gdb-inferior-filter (proc string)
   (unless (string-equal string "")
@@ -2428,7 +2438,7 @@
   (mouse-minibuffer-check event)
   (let ((posn (event-end event)))
     (with-selected-window (posn-window posn)
-      (if (or (buffer-file-name) (eq major-mode 'gdb-disassembly-mode))
+      (if (or (buffer-file-name) (derived-mode-p 'gdb-disassembly-mode))
 	  (if (numberp (posn-point posn))
 	      (save-excursion
 		(goto-char (posn-point posn))
@@ -2612,15 +2622,12 @@
 			  nil nil mode-line)))
 
 (define-derived-mode gdb-threads-mode gdb-parent-mode "Threads"
-  "Major mode for GDB threads.
-
-\\{gdb-threads-mode-map}"
+  "Major mode for GDB threads."
   (setq gdb-thread-position (make-marker))
   (add-to-list 'overlay-arrow-variable-list 'gdb-thread-position)
   (setq header-line-format gdb-threads-header)
   (set (make-local-variable 'font-lock-defaults)
        '(gdb-threads-font-lock-keywords))
-  (run-mode-hooks 'gdb-threads-mode-hook)
   'gdb-invalidate-threads)
 
 (defun gdb-thread-list-handler-custom ()
@@ -3146,13 +3153,10 @@
   "Header line used in `gdb-memory-mode'.")
 
 (define-derived-mode gdb-memory-mode gdb-parent-mode "Memory"
-  "Major mode for examining memory.
-
-\\{gdb-memory-mode-map}"
+  "Major mode for examining memory."
   (setq header-line-format gdb-memory-header)
   (set (make-local-variable 'font-lock-defaults)
        '(gdb-memory-font-lock-keywords))
-  (run-mode-hooks 'gdb-memory-mode-hook)
   'gdb-invalidate-memory)
 
 (defun gdb-memory-buffer-name ()
@@ -3241,16 +3245,13 @@
      map))
 
 (define-derived-mode gdb-disassembly-mode gdb-parent-mode "Disassembly"
-  "Major mode for GDB disassembly information.
-
-\\{gdb-disassembly-mode-map}"
+  "Major mode for GDB disassembly information."
   ;; TODO Rename overlay variable for disassembly mode
   (add-to-list 'overlay-arrow-variable-list 'gdb-disassembly-position)
   (setq fringes-outside-margins t)
   (set (make-local-variable 'gdb-disassembly-position) (make-marker))
   (set (make-local-variable 'font-lock-defaults)
        '(gdb-disassembly-font-lock-keywords))
-  (run-mode-hooks 'gdb-disassembly-mode-hook)
   'gdb-invalidate-disassembly)
 
 (defun gdb-disassembly-handler-custom ()
@@ -3308,11 +3309,8 @@
 
 ;;; Breakpoints view
 (define-derived-mode gdb-breakpoints-mode gdb-parent-mode "Breakpoints"
-  "Major mode for gdb breakpoints.
-
-\\{gdb-breakpoints-mode-map}"
+  "Major mode for gdb breakpoints."
   (setq header-line-format gdb-breakpoints-header)
-  (run-mode-hooks 'gdb-breakpoints-mode-hook)
   'gdb-invalidate-breakpoints)
 
 (defun gdb-toggle-breakpoint ()
@@ -3451,15 +3449,12 @@
   "Font lock keywords used in `gdb-frames-mode'.")
 
 (define-derived-mode gdb-frames-mode gdb-parent-mode "Frames"
-  "Major mode for gdb call stack.
-
-\\{gdb-frames-mode-map}"
+  "Major mode for gdb call stack."
   (setq gdb-stack-position (make-marker))
   (add-to-list 'overlay-arrow-variable-list 'gdb-stack-position)
   (setq truncate-lines t)  ;; Make it easier to see overlay arrow.
   (set (make-local-variable 'font-lock-defaults)
        '(gdb-frames-font-lock-keywords))
-  (run-mode-hooks 'gdb-frames-mode-hook)
   'gdb-invalidate-frames)
 
 (defun gdb-select-frame (&optional event)
@@ -3573,11 +3568,8 @@
      map))
 
 (define-derived-mode gdb-locals-mode gdb-parent-mode "Locals"
-  "Major mode for gdb locals.
-
-\\{gdb-locals-mode-map}"
+  "Major mode for gdb locals."
   (setq header-line-format gdb-locals-header)
-  (run-mode-hooks 'gdb-locals-mode-hook)
   'gdb-invalidate-locals)
 
 (defun gdb-locals-buffer-name ()
@@ -3672,11 +3664,8 @@
 			  nil nil mode-line)))
 
 (define-derived-mode gdb-registers-mode gdb-parent-mode "Registers"
-  "Major mode for gdb registers.
-
-\\{gdb-registers-mode-map}"
+  "Major mode for gdb registers."
   (setq header-line-format gdb-registers-header)
-  (run-mode-hooks 'gdb-registers-mode-hook)
   'gdb-invalidate-registers)
 
 (defun gdb-registers-buffer-name ()
@@ -4191,5 +4180,4 @@
 
 (provide 'gdb-mi)
 
-;; arch-tag: 1b41ea2b-f364-4cec-8f35-e02e4fe01912
 ;;; gdb-mi.el ends here
--- a/lisp/progmodes/gud.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/progmodes/gud.el	Thu Dec 16 18:30:57 2010 -0500
@@ -2533,7 +2533,7 @@
   (gud-set-buffer))
 
 (defun gud-set-buffer ()
-  (when (eq major-mode 'gud-mode)
+  (when (derived-mode-p 'gud-mode)
     (setq gud-comint-buffer (current-buffer))))
 
 (defvar gud-filter-defer-flag nil
@@ -3344,10 +3344,8 @@
 ACTIVATEP non-nil means activate mouse motion events."
   (if activatep
       (progn
-	(make-local-variable 'gud-tooltip-mouse-motions-active)
-	(setq gud-tooltip-mouse-motions-active t)
-	(make-local-variable 'track-mouse)
-	(setq track-mouse t))
+        (set (make-local-variable 'gud-tooltip-mouse-motions-active) t)
+        (set (make-local-variable 'track-mouse) t))
     (when gud-tooltip-mouse-motions-active
       (kill-local-variable 'gud-tooltip-mouse-motions-active)
       (kill-local-variable 'track-mouse))))
--- a/lisp/progmodes/icon.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/progmodes/icon.el	Thu Dec 16 18:30:57 2010 -0500
@@ -131,7 +131,7 @@
 
 
 ;;;###autoload
-(defun icon-mode ()
+(define-derived-mode icon-mode prog-mode "Icon"
   "Major mode for editing Icon code.
 Expression and list commands understand all Icon brackets.
 Tab indents for Icon code.
@@ -163,49 +163,33 @@
 
 Turning on Icon mode calls the value of the variable `icon-mode-hook'
 with no args, if that value is non-nil."
-  (interactive)
-  (kill-all-local-variables)
-  (use-local-map icon-mode-map)
-  (setq major-mode 'icon-mode)
-  (setq mode-name "Icon")
-  (setq local-abbrev-table icon-mode-abbrev-table)
-  (set-syntax-table icon-mode-syntax-table)
-  (make-local-variable 'paragraph-start)
-  (setq paragraph-start (concat "$\\|" page-delimiter))
-  (make-local-variable 'paragraph-separate)
-  (setq paragraph-separate paragraph-start)
-  (make-local-variable 'indent-line-function)
-  (setq indent-line-function 'icon-indent-line)
-  (make-local-variable 'require-final-newline)
-  (setq require-final-newline mode-require-final-newline)
-  (make-local-variable 'comment-start)
-  (setq comment-start "# ")
-  (make-local-variable 'comment-end)
-  (setq comment-end "")
-  (make-local-variable 'comment-start-skip)
-  (setq comment-start-skip "# *")
-  (make-local-variable 'comment-indent-function)
-  (setq comment-indent-function 'icon-comment-indent)
+  :abbrev-table icon-mode-abbrev-table
+  (set (make-local-variable 'paragraph-start) (concat "$\\|" page-delimiter))
+  (set (make-local-variable 'paragraph-separate) paragraph-start)
+  (set (make-local-variable 'indent-line-function) #'icon-indent-line)
+  (set (make-local-variable 'comment-start) "# ")
+  (set (make-local-variable 'comment-end) "")
+  (set (make-local-variable 'comment-start-skip) "# *")
+  (set (make-local-variable 'comment-indent-function) 'icon-comment-indent)
   (set (make-local-variable 'indent-line-function) 'icon-indent-line)
   ;; font-lock support
-  (setq font-lock-defaults
-	'((icon-font-lock-keywords
-	   icon-font-lock-keywords-1 icon-font-lock-keywords-2)
-	  nil nil ((?_ . "w")) beginning-of-defun
-	  ;; Obsoleted by Emacs 19.35 parse-partial-sexp's COMMENTSTOP.
-	  ;(font-lock-comment-start-regexp . "#")
-	  (font-lock-mark-block-function . mark-defun)))
+  (set (make-local-variable 'font-lock-defaults)
+       '((icon-font-lock-keywords
+          icon-font-lock-keywords-1 icon-font-lock-keywords-2)
+         nil nil ((?_ . "w")) beginning-of-defun
+         ;; Obsoleted by Emacs 19.35 parse-partial-sexp's COMMENTSTOP.
+         ;;(font-lock-comment-start-regexp . "#")
+         (font-lock-mark-block-function . mark-defun)))
   ;; imenu support
-  (make-local-variable 'imenu-generic-expression)
-  (setq imenu-generic-expression icon-imenu-generic-expression)
+  (set (make-local-variable 'imenu-generic-expression)
+       icon-imenu-generic-expression)
   ;; hideshow support
   ;; we start from the assertion that `hs-special-modes-alist' is autoloaded.
   (unless (assq 'icon-mode hs-special-modes-alist)
     (setq hs-special-modes-alist
 	  (cons '(icon-mode  "\\<procedure\\>" "\\<end\\>" nil
 			     icon-forward-sexp-function)
-		hs-special-modes-alist)))
-  (run-mode-hooks 'icon-mode-hook))
+		hs-special-modes-alist))))
 
 ;; This is used by indent-for-comment to decide how much to
 ;; indent a comment in Icon code based on its context.
--- a/lisp/progmodes/idlw-complete-structtag.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/progmodes/idlw-complete-structtag.el	Thu Dec 16 18:30:57 2010 -0500
@@ -167,7 +167,7 @@
 (defun idlwave-prepare-structure-tag-completion (var)
   "Find and parse the tag list for structure tag completion."
   ;; This works differently in source buffers and in the shell
-  (if (eq major-mode 'idlwave-shell-mode)
+  (if (derived-mode-p 'idlwave-shell-mode)
       ;; OK, we are in the shell, do it dynamically
       (progn
         (message "preparing shell tags") 
--- a/lisp/progmodes/idlw-help.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/progmodes/idlw-help.el	Thu Dec 16 18:30:57 2010 -0500
@@ -288,7 +288,7 @@
 (declare-function idlwave-what-module-find-class "idlwave")
 (declare-function idlwave-where "idlwave")
 
-(defun idlwave-help-mode ()
+(define-derived-mode idlwave-help-mode special-mode "IDLWAVE Help"
   "Major mode for displaying IDL Help.
 
 This is a VIEW mode for the ASCII version of IDL Help files,
@@ -308,11 +308,7 @@
 
 Here are all keybindings.
 \\{idlwave-help-mode-map}"
-  (kill-all-local-variables)
   (buffer-disable-undo)
-  (setq major-mode 'idlwave-help-mode
-	mode-name "IDLWAVE Help")
-  (use-local-map idlwave-help-mode-map)
   (easy-menu-add idlwave-help-menu idlwave-help-mode-map)
   (setq truncate-lines t)
   (setq case-fold-search t)
@@ -325,8 +321,7 @@
   (setq buffer-read-only t)
   (set (make-local-variable 'idlwave-help-def-pos) nil)
   (set (make-local-variable 'idlwave-help-args) nil)
-  (set (make-local-variable 'idlwave-help-in-header) nil)
-  (run-hooks 'idlwave-help-mode-hook))
+  (set (make-local-variable 'idlwave-help-in-header) nil))
 
 (defun idlwave-html-help-location ()
   "Return the help directory where HTML files are, or nil if that is unknown."
--- a/lisp/progmodes/idlw-shell.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/progmodes/idlw-shell.el	Thu Dec 16 18:30:57 2010 -0500
@@ -866,7 +866,7 @@
 (defvar idlwave-shell-only-prompt-pattern nil)
 (defvar tool-bar-map)
 
-(defun idlwave-shell-mode ()
+(define-derived-mode idlwave-shell-mode comint-mode "IDL-Shell"
   "Major mode for interacting with an inferior IDL process.
 
 1. Shell Interaction
@@ -947,28 +947,23 @@
 8. Keybindings
    -----------
 \\{idlwave-shell-mode-map}"
-
-  (interactive)
+  :abbrev-table idlwave-mode-abbrev-table
   (idlwave-setup) ; Make sure config files and paths, etc. are available.
   (unless (file-name-absolute-p idlwave-shell-command-history-file)
     (setq idlwave-shell-command-history-file
 	  (expand-file-name idlwave-shell-command-history-file
 			    idlwave-config-directory)))
 
-  ;; We don't do `kill-all-local-variables' here, because this is done by
-  ;; comint
   (setq comint-prompt-regexp idlwave-shell-prompt-pattern)
   (setq comint-process-echoes t)
 
   ;; Can not use history expansion because "!" is used for system variables.
   (setq comint-input-autoexpand nil)
-;  (setq comint-input-ring-size 64)
-  (make-local-variable 'comint-completion-addsuffix)
+  ;; (setq comint-input-ring-size 64)
+  
   (set (make-local-variable 'completion-ignore-case) t)
-  (setq comint-completion-addsuffix '("/" . ""))
+  (set (make-local-variable 'comint-completion-addsuffix) '("/" . ""))
   (setq comint-input-ignoredups t)
-  (setq major-mode 'idlwave-shell-mode)
-  (setq mode-name "IDL-Shell")
   (setq idlwave-shell-mode-line-info nil)
   (setq mode-line-format
 	'(""
@@ -1023,7 +1018,6 @@
 	    nil 'local)
   (add-hook 'kill-buffer-hook 'idlwave-shell-delete-temp-files nil 'local)
   (add-hook 'kill-emacs-hook 'idlwave-shell-delete-temp-files)
-  (use-local-map idlwave-shell-mode-map)
   (easy-menu-add idlwave-shell-mode-menu idlwave-shell-mode-map)
 
   ;; Set the optional comint variables
@@ -1054,10 +1048,7 @@
   ;; with overlay-arrows.
   (remove-hook 'comint-output-filter-functions 'py-pdbtrack-track-stack-file)
 
-
   ;; IDLWAVE syntax, and turn on abbreviations
-  (setq local-abbrev-table idlwave-mode-abbrev-table)
-  (set-syntax-table idlwave-mode-syntax-table)
   (set (make-local-variable 'comment-start) ";")
   (setq abbrev-mode t)
 
@@ -1076,8 +1067,6 @@
   ;; Turn off the non-debug toolbar buttons (open,save,etc.)
   (set (make-local-variable 'tool-bar-map) nil)
 
-  ;; Run the hooks.
-  (run-mode-hooks 'idlwave-shell-mode-hook)
   (idlwave-shell-send-command idlwave-shell-initial-commands nil 'hide)
   ;; Turn off IDL's ^d interpreting, and define a system
   ;; variable which knows the version of IDLWAVE
@@ -3895,7 +3884,7 @@
   (setq overlay-arrow-string nil)
   (let (buf)
     (cond
-     ((eq major-mode 'idlwave-mode)
+     ((derived-mode-p 'idlwave-mode)
       (save-buffer)
       (setq idlwave-shell-last-save-and-action-file (buffer-file-name)))
      (idlwave-shell-last-save-and-action-file
@@ -4083,7 +4072,7 @@
 (defun idlwave-shell-file-name (name)
   "If `idlwave-shell-use-truename' is non-nil, convert file name to true name.
 Otherwise, just expand the file name."
-  (let ((def-dir (if (eq major-mode 'idlwave-shell-mode)
+  (let ((def-dir (if (derived-mode-p 'idlwave-shell-mode)
 		     default-directory
 		   idlwave-shell-default-directory)))
     (if idlwave-shell-use-truename
@@ -4346,7 +4335,7 @@
       (while (setq buf (pop buffers))
 	(when (buffer-live-p buf)
 	  (set-buffer buf)
-	  (when (and (eq major-mode 'idlwave-mode)
+	  (when (and (derived-mode-p 'idlwave-mode)
 		     buffer-file-name
 		     idlwave-shell-electric-debug-mode)
 	    (idlwave-shell-electric-debug-mode 0))))))
@@ -4371,51 +4360,51 @@
     ["Electric Debug Mode"
      idlwave-shell-electric-debug-mode
      :style toggle :selected idlwave-shell-electric-debug-mode
-     :included (eq major-mode 'idlwave-mode) :keys "C-c C-d C-v"]
+     :included (derived-mode-p 'idlwave-mode) :keys "C-c C-d C-v"]
     "--"
     ("Compile & Run"
      ["Save and .RUN" idlwave-shell-save-and-run
-      (or (eq major-mode 'idlwave-mode)
+      (or (derived-mode-p 'idlwave-mode)
 	  idlwave-shell-last-save-and-action-file)]
      ["Save and .COMPILE" idlwave-shell-save-and-compile
-      (or (eq major-mode 'idlwave-mode)
+      (or (derived-mode-p 'idlwave-mode)
 	  idlwave-shell-last-save-and-action-file)]
      ["Save and @Batch" idlwave-shell-save-and-batch
-      (or (eq major-mode 'idlwave-mode)
+      (or (derived-mode-p 'idlwave-mode)
 	  idlwave-shell-last-save-and-action-file)]
      "--"
      ["Goto Next Error" idlwave-shell-goto-next-error t]
      "--"
      ["Compile and Run Region" idlwave-shell-run-region
-      (eq major-mode 'idlwave-mode)]
+      (derived-mode-p 'idlwave-mode)]
      ["Evaluate Region" idlwave-shell-evaluate-region
-      (eq major-mode 'idlwave-mode)]
+      (derived-mode-p 'idlwave-mode)]
      "--"
      ["Execute Default Cmd" idlwave-shell-execute-default-command-line t]
      ["Edit Default Cmd" idlwave-shell-edit-default-command-line t])
     ("Breakpoints"
      ["Set Breakpoint" idlwave-shell-break-here
-      :keys "C-c C-d C-b" :active (eq major-mode 'idlwave-mode)]
+      :keys "C-c C-d C-b" :active (derived-mode-p 'idlwave-mode)]
      ("Set Special Breakpoint"
       ["Set After Count Breakpoint"
        (progn
 	(let ((count (string-to-number (read-string "Break after count: "))))
 	      (if (integerp count) (idlwave-shell-break-here count))))
-       :active (eq major-mode 'idlwave-mode)]
+       :active (derived-mode-p 'idlwave-mode)]
       ["Set Condition Breakpoint"
        (idlwave-shell-break-here '(4))
-       :active (eq major-mode 'idlwave-mode)])
+       :active (derived-mode-p 'idlwave-mode)])
      ["Break in Module" idlwave-shell-break-in
-      :keys "C-c C-d C-i" :active (eq major-mode 'idlwave-mode)]
+      :keys "C-c C-d C-i" :active (derived-mode-p 'idlwave-mode)]
      ["Break in this Module" idlwave-shell-break-this-module
-      :keys "C-c C-d C-j" :active (eq major-mode 'idlwave-mode)]
+      :keys "C-c C-d C-j" :active (derived-mode-p 'idlwave-mode)]
      ["Clear Breakpoint" idlwave-shell-clear-current-bp t]
      ["Clear All Breakpoints" idlwave-shell-clear-all-bp t]
      ["Disable/Enable Breakpoint" idlwave-shell-toggle-enable-current-bp t]
      ["Goto Previous Breakpoint" idlwave-shell-goto-previous-bp
-      :keys "C-c C-d [" :active (eq major-mode 'idlwave-mode)]
+      :keys "C-c C-d [" :active (derived-mode-p 'idlwave-mode)]
      ["Goto Next Breakpoint" idlwave-shell-goto-next-bp
-      :keys "C-c C-d ]" :active (eq major-mode 'idlwave-mode)]
+      :keys "C-c C-d ]" :active (derived-mode-p 'idlwave-mode)]
      ["List All Breakpoints" idlwave-shell-list-all-bp t]
      ["Resync Breakpoints" idlwave-shell-bp-query t])
     ("Continue/Step"
@@ -4427,7 +4416,7 @@
      ["... to End of Subprog" idlwave-shell-return t]
      ["... to End of Subprog+1" idlwave-shell-out t]
      ["... to Here (Cursor Line)" idlwave-shell-to-here
-      :keys "C-c C-d C-h" :active (eq major-mode 'idlwave-mode)])
+      :keys "C-c C-d C-h" :active (derived-mode-p 'idlwave-mode)])
     ("Examine Expressions"
      ["Print expression" idlwave-shell-print t]
      ["Help on expression" idlwave-shell-help-expression t]
@@ -4512,7 +4501,7 @@
       (save-current-buffer
 	(dolist (buf (buffer-list))
           (set-buffer buf)
-          (if (eq major-mode 'idlwave-mode)
+          (if (derived-mode-p 'idlwave-mode)
               (progn
                 (easy-menu-remove idlwave-mode-debug-menu)
                 (easy-menu-add idlwave-mode-debug-menu)))))))
--- a/lisp/progmodes/idlw-toolbar.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/progmodes/idlw-toolbar.el	Thu Dec 16 18:30:57 2010 -0500
@@ -807,7 +807,7 @@
      "Goto Next Error"]
     [idlwave-toolbar-stop-at-icon
      idlwave-shell-break-here
-     (eq major-mode 'idlwave-mode)
+     (derived-mode-p 'idlwave-mode)
      "Set Breakpoint at selected position"]
     [idlwave-toolbar-clear-at-icon
      idlwave-shell-clear-current-bp
@@ -819,7 +819,7 @@
      "Clear all Breakpoints"]
     [idlwave-toolbar-stop-beginning-icon
      idlwave-shell-break-this-module
-     (eq major-mode 'idlwave-mode)
+     (derived-mode-p 'idlwave-mode)
      "Stop at beginning of enclosing Routine"]
     [idlwave-toolbar-stop-in-icon
      idlwave-shell-break-in
@@ -839,7 +839,7 @@
      "Continue Current Program"]
     [idlwave-toolbar-to-here-icon
      idlwave-shell-to-here
-     (eq major-mode 'idlwave-mode)
+     (derived-mode-p 'idlwave-mode)
      "Continue to Here (cursor position)"]
     [idlwave-toolbar-step-over-icon
      idlwave-shell-stepover
@@ -871,7 +871,7 @@
      "Reset IDL (RETALL & CLOSE,/ALL and more)"]
     [idlwave-toolbar-electric-debug-icon
      idlwave-shell-electric-debug-mode
-     (eq major-mode 'idlwave-mode)
+     (derived-mode-p 'idlwave-mode)
      "Toggle Electric Debug Mode"]
     ))
 
@@ -884,8 +884,7 @@
   "Add the IDLWAVE toolbar if appropriate."
   (if (and (featurep 'xemacs)    ; This is a noop on Emacs
 	   (boundp 'idlwave-toolbar-is-possible)
-	   (or (eq major-mode 'idlwave-mode)
-	       (eq major-mode 'idlwave-shell-mode)))
+	   (derived-mode-p 'idlwave-mode 'idlwave-shell-mode))
       (set-specifier default-toolbar (cons (current-buffer)
 					   idlwave-toolbar))))
 
@@ -893,8 +892,7 @@
   "Add the IDLWAVE toolbar if appropriate."
   (if (and (featurep 'xemacs)    ; This is a noop on Emacs
 	   (boundp 'idlwave-toolbar-is-possible)
-	   (or (eq major-mode 'idlwave-mode)
-	       (eq major-mode 'idlwave-shell-mode)))
+           (derived-mode-p 'idlwave-mode 'idlwave-shell-mode))
       (remove-specifier default-toolbar (current-buffer))))
 
 (defvar idlwave-shell-mode-map)
--- a/lisp/progmodes/idlwave.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/progmodes/idlwave.el	Thu Dec 16 18:30:57 2010 -0500
@@ -1776,7 +1776,7 @@
 (defvar idlwave-mode-debug-menu)
 
 ;;;###autoload
-(defun idlwave-mode ()
+(define-derived-mode idlwave-mode prog-mode "IDLWAVE"
   "Major mode for editing IDL source files (version 6.1_em22).
 
 The main features of this mode are
@@ -1895,21 +1895,15 @@
    followed by the key sequence to see what the key sequence does.
 
 \\{idlwave-mode-map}"
-
-  (interactive)
-  (kill-all-local-variables)
-
+  :abbrev-table idlwave-mode-abbrev-table
   (if idlwave-startup-message
       (message "Emacs IDLWAVE mode version %s." idlwave-mode-version))
   (setq idlwave-startup-message nil)
 
-  (setq local-abbrev-table idlwave-mode-abbrev-table)
-  (set-syntax-table idlwave-mode-syntax-table)
-
   (set (make-local-variable 'indent-line-function) 'idlwave-indent-and-action)
 
-  (make-local-variable idlwave-comment-indent-function)
-  (set idlwave-comment-indent-function 'idlwave-comment-hook)
+  (set (make-local-variable idlwave-comment-indent-function)
+       #'idlwave-comment-hook)
 
   (set (make-local-variable 'comment-start-skip) ";+[ \t]*")
   (set (make-local-variable 'comment-start) ";")
@@ -1919,14 +1913,10 @@
   (set (make-local-variable 'indent-tabs-mode) nil)
   (set (make-local-variable 'completion-ignore-case) t)
 
-  (use-local-map idlwave-mode-map)
-
   (when (featurep 'easymenu)
     (easy-menu-add idlwave-mode-menu idlwave-mode-map)
     (easy-menu-add idlwave-mode-debug-menu idlwave-mode-map))
 
-  (setq mode-name "IDLWAVE")
-  (setq major-mode 'idlwave-mode)
   (setq abbrev-mode t)
 
   (set (make-local-variable idlwave-fill-function) 'idlwave-auto-fill)
@@ -1991,10 +1981,7 @@
   (idlwave-new-buffer-update)
 
   ;; Check help location
-  (idlwave-help-check-locations)
-
-  ;; Run the mode hook
-  (run-mode-hooks 'idlwave-mode-hook))
+  (idlwave-help-check-locations))
 
 (defvar idlwave-setup-done nil)
 (defun idlwave-setup ()
@@ -2543,7 +2530,7 @@
 actual statement."
   (interactive)
   (cond
-   ((eq major-mode 'idlwave-shell-mode)
+   ((derived-mode-p 'idlwave-shell-mode)
     (if (re-search-backward idlwave-shell-prompt-pattern nil t)
 	(goto-char (match-end 0))))
    (t
@@ -3732,7 +3719,7 @@
 
 The lines containing S1 and S2 are reindented using `indent-region'
 unless the optional second argument NOINDENT is non-nil."
-  (if (eq major-mode 'idlwave-shell-mode)
+  (if (derived-mode-p 'idlwave-shell-mode)
       ;; This is a gross hack to avoit template abbrev expansion
       ;; in the shell.  FIXME: This is a dirty hack.
       (if (and (eq this-command 'self-insert-command)
@@ -5088,7 +5075,7 @@
       (setq res nil))
      (t
       ;; Just scan this buffer
-      (if (eq major-mode 'idlwave-mode)
+      (if (derived-mode-p 'idlwave-mode)
 	  (progn
 	    (message "Scanning current buffer...")
 	    (setq res (idlwave-get-routine-info-from-buffers
@@ -5142,7 +5129,7 @@
 (defun idlwave-update-current-buffer-info (why)
   "Update `idlwave-routines' for current buffer.
 Can run from `after-save-hook'."
-  (when (and (eq major-mode 'idlwave-mode)
+  (when (and (derived-mode-p 'idlwave-mode)
 	     (or (eq t idlwave-auto-routine-info-updates)
 		 (memq why idlwave-auto-routine-info-updates))
 	     idlwave-scan-all-buffers-for-routine-info
@@ -5188,7 +5175,7 @@
     (save-excursion
       (while (setq buf (pop buffers))
 	(set-buffer buf)
-	(if (and (eq major-mode 'idlwave-mode)
+	(if (and (derived-mode-p 'idlwave-mode)
 		 buffer-file-name)
 	    ;; yes, this buffer has the right mode.
 	    (progn (setq res (condition-case nil
@@ -7030,7 +7017,7 @@
   "Call FUNCTION as a completion chooser and pass ARGS to it."
   (let ((completion-ignore-case t))	    ; install correct value
     (apply function args))
-  (if (and (eq major-mode 'idlwave-shell-mode)
+  (if (and (derived-mode-p 'idlwave-shell-mode)
 	   (boundp 'font-lock-mode)
 	   (not font-lock-mode))
       ;; For the shell, remove the fontification of the word before point
@@ -7431,7 +7418,7 @@
 	  ;; Read the file in temporarily
 	  (set-buffer (get-buffer-create " *IDLWAVE-tmp*"))
 	  (erase-buffer)
-	  (unless (eq major-mode 'idlwave-mode)
+	  (unless (derived-mode-p 'idlwave-mode)
 	    (idlwave-mode))
 	  (insert-file-contents file))
 	(save-excursion
@@ -8183,8 +8170,7 @@
     ;; If this is the OBJ_NEW function, try to figure out the class and use
     ;; the keywords from the corresponding INIT method.
     (if (and (equal (upcase name) "OBJ_NEW")
-	     (or (eq major-mode 'idlwave-mode)
-		 (eq major-mode 'idlwave-shell-mode)))
+	     (derived-mode-p 'idlwave-mode 'idlwave-shell-mode))
 	(let* ((bos (save-excursion (idlwave-beginning-of-statement) (point)))
 	       (string (buffer-substring bos (point)))
 	       (case-fold-search t)
@@ -8634,7 +8620,7 @@
   "List the load path shadows of all routines defined in current buffer."
   (interactive "P")
   (idlwave-routines)
-  (if (eq major-mode 'idlwave-mode)
+  (if (derived-mode-p 'idlwave-mode)
       (idlwave-list-load-path-shadows
        nil (idlwave-update-current-buffer-info 'save-buffer)
        "in current buffer")
--- a/lisp/progmodes/inf-lisp.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/progmodes/inf-lisp.el	Thu Dec 16 18:30:57 2010 -0500
@@ -216,7 +216,7 @@
 
 (put 'inferior-lisp-mode 'mode-class 'special)
 
-(defun inferior-lisp-mode ()
+(define-derived-mode inferior-lisp-mode comint-mode "Inferior Lisp"
   "Major mode for interacting with an inferior Lisp process.
 Runs a Lisp interpreter as a subprocess of Emacs, with Lisp I/O through an
 Emacs buffer.  Variable `inferior-lisp-program' controls which Lisp interpreter
@@ -263,18 +263,11 @@
 Paragraphs are separated only by blank lines.  Semicolons start comments.
 If you accidentally suspend your process, use \\[comint-continue-subjob]
 to continue it."
-  (interactive)
-  (delay-mode-hooks
-    (comint-mode))
   (setq comint-prompt-regexp inferior-lisp-prompt)
-  (setq major-mode 'inferior-lisp-mode)
-  (setq mode-name "Inferior Lisp")
   (setq mode-line-process '(":%s"))
   (lisp-mode-variables t)
-  (use-local-map inferior-lisp-mode-map)    ;c-c c-k for "kompile" file
   (setq comint-get-old-input (function lisp-get-old-input))
-  (setq comint-input-filter (function lisp-input-filter))
-  (run-mode-hooks 'inferior-lisp-mode-hook))
+  (setq comint-input-filter (function lisp-input-filter)))
 
 (defun lisp-get-old-input ()
   "Return a string containing the sexp ending at point."
@@ -600,7 +593,7 @@
 ;;  "Returns the current inferior Lisp process.
 ;; See variable `inferior-lisp-buffer'."
 (defun inferior-lisp-proc ()
-  (let ((proc (get-buffer-process (if (eq major-mode 'inferior-lisp-mode)
+  (let ((proc (get-buffer-process (if (derived-mode-p 'inferior-lisp-mode)
 				      (current-buffer)
 				    inferior-lisp-buffer))))
     (or proc
--- a/lisp/progmodes/js.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/progmodes/js.el	Thu Dec 16 18:30:57 2010 -0500
@@ -47,12 +47,9 @@
 
 
 (require 'cc-mode)
-(require 'font-lock)
 (require 'newcomment)
+(require 'thingatpt)                    ; forward-symbol etc
 (require 'imenu)
-(require 'etags)
-(require 'thingatpt)
-(require 'easymenu)
 (require 'moz nil t)
 (require 'json nil t)
 
@@ -2135,7 +2132,7 @@
         with imenu-use-markers = t
         for buffer being the buffers
         for imenu-index = (with-current-buffer buffer
-                            (when (eq major-mode 'js-mode)
+                            (when (derived-mode-p 'js-mode)
                               (js--imenu-create-index)))
         do (js--imenu-to-flat imenu-index "" symbols)
         finally return symbols))
@@ -2171,12 +2168,15 @@
           (setf (car bounds) (point))))
       (buffer-substring (car bounds) (cdr bounds)))))
 
+(defvar find-tag-marker-ring)           ; etags
+
 (defun js-find-symbol (&optional arg)
   "Read a JavaScript symbol and jump to it.
 With a prefix argument, restrict symbols to those from the
 current buffer.  Pushes a mark onto the tag ring just like
 `find-tag'."
   (interactive "P")
+  (require 'etags)
   (let (symbols marker)
     (if (not arg)
         (setq symbols (js--get-all-known-symbols))
@@ -3286,15 +3286,9 @@
 ;;; Main Function
 
 ;;;###autoload
-(define-derived-mode js-mode prog-mode "js"
-  "Major mode for editing JavaScript.
-
-Key bindings:
-
-\\{js-mode-map}"
-
+(define-derived-mode js-mode prog-mode "Javascript"
+  "Major mode for editing JavaScript."
   :group 'js
-  :syntax-table js-mode-syntax-table
 
   (set (make-local-variable 'indent-line-function) 'js-indent-line)
   (set (make-local-variable 'beginning-of-defun-function)
@@ -3330,9 +3324,6 @@
   (set (make-local-variable 'imenu-create-index-function)
        #'js--imenu-create-index)
 
-  (setq major-mode 'js-mode)
-  (setq mode-name "Javascript")
-
   ;; for filling, pretend we're cc-mode
   (setq c-comment-prefix-regexp "//+\\|\\**"
         c-paragraph-start "$"
@@ -3363,10 +3354,9 @@
   ;; the buffer containing the problem, JIT-lock will apply the
   ;; correct syntax to the regular expresion literal and the problem
   ;; will mysteriously disappear.
-  (font-lock-set-defaults)
-
-  (let (font-lock-keywords) ; leaves syntactic keywords intact
-    (font-lock-fontify-buffer)))
+  ;; FIXME: We should actually do this fontification lazily by adding
+  ;; calls to syntax-propertize wherever it's really needed.
+  (syntax-propertize (point-max)))
 
 ;;;###autoload
 (defalias 'javascript-mode 'js-mode)
--- a/lisp/progmodes/m4-mode.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/progmodes/m4-mode.el	Thu Dec 16 18:30:57 2010 -0500
@@ -143,27 +143,12 @@
   (switch-to-buffer-other-window "*m4-output*"))
 
 ;;;###autoload
-(defun m4-mode ()
-  "A major mode to edit m4 macro files.
-\\{m4-mode-map}
-"
-  (interactive)
-  (kill-all-local-variables)
-  (use-local-map m4-mode-map)
-
-  (make-local-variable 'comment-start)
-  (setq comment-start "#")
-  (make-local-variable 'parse-sexp-ignore-comments)
-  (setq parse-sexp-ignore-comments t)
-  (setq local-abbrev-table m4-mode-abbrev-table)
-
-  (make-local-variable	'font-lock-defaults)
-  (setq major-mode 'm4-mode
-	mode-name "m4"
-	font-lock-defaults '(m4-font-lock-keywords nil)
-	)
-  (set-syntax-table m4-mode-syntax-table)
-  (run-mode-hooks 'm4-mode-hook))
+(define-derived-mode m4-mode prog-mode "m4"
+  "A major mode to edit m4 macro files."
+  :abbrev-table m4-mode-abbrev-table
+  (set (make-local-variable 'comment-start) "#")
+  (set (make-local-variable 'parse-sexp-ignore-comments) t)
+  (set (make-local-variable 'font-lock-defaults) '(m4-font-lock-keywords nil)))
 
 (provide 'm4-mode)
 ;;stuff to play with for debugging
--- a/lisp/progmodes/meta-mode.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/progmodes/meta-mode.el	Thu Dec 16 18:30:57 2010 -0500
@@ -474,6 +474,7 @@
 
 (defun meta-complete-symbol ()
   "Perform completion on Metafont or MetaPost symbol preceding point."
+  ;; FIXME: Use completion-at-point-functions.
   (interactive "*")
   (let ((list meta-complete-list)
         entry)
@@ -844,11 +845,10 @@
 
 ;;; Syntax table, keymap and menu.
 
-(defvar meta-mode-abbrev-table nil
+(define-abbrev-table 'meta-mode-abbrev-table ()
   "Abbrev table used in Metafont or MetaPost mode.")
-(define-abbrev-table 'meta-mode-abbrev-table ())
 
-(defvar meta-mode-syntax-table
+(defvar meta-common-mode-syntax-table
   (let ((st (make-syntax-table)))
     ;; underscores are word constituents
     (modify-syntax-entry ?_  "w"  st)
@@ -885,9 +885,8 @@
     st)
   "Syntax table used in Metafont or MetaPost mode.")
 
-(defvar meta-mode-map
+(defvar meta-common-mode-map
   (let ((map (make-sparse-keymap)))
-    (define-key map "\C-m"      'reindent-then-newline-and-indent)
     ;; Comment Paragraphs:
     ;; (define-key map "\M-a"      'backward-sentence)
     ;; (define-key map "\M-e"      'forward-sentence)
@@ -915,10 +914,10 @@
     ;; (define-key map "\C-c\C-l"  'meta-recenter-output)
     map)
   "Keymap used in Metafont or MetaPost mode.")
-
+(define-obsolete-variable-alias 'meta-mode-map 'meta-common-mode-map "24.1")
 
 (easy-menu-define
- meta-mode-menu meta-mode-map
+ meta-mode-menu meta-common-mode-map
  "Menu used in Metafont or MetaPost mode."
  (list "Meta"
        ["Forward Environment"           meta-beginning-of-defun t]
@@ -976,106 +975,62 @@
 
 ;;; Initialization.
 
-(defun meta-common-initialization ()
+(define-derived-mode meta-common-mode prog-mode "-Meta-common-"
   "Common initialization for Metafont or MetaPost mode."
-  (kill-all-local-variables)
-
-  (make-local-variable 'paragraph-start)
-  (make-local-variable 'paragraph-separate)
-  (setq paragraph-start
-        (concat page-delimiter "\\|$"))
-  (setq paragraph-separate
-        (concat page-delimiter "\\|$"))
+  :abbrev-table meta-mode-abbrev-table
+  (set (make-local-variable 'paragraph-start)
+       (concat page-delimiter "\\|$"))
+  (set (make-local-variable 'paragraph-separate)
+       (concat page-delimiter "\\|$"))
 
-  (make-local-variable 'paragraph-ignore-fill-prefix)
-  (setq paragraph-ignore-fill-prefix t)
+  (set (make-local-variable 'paragraph-ignore-fill-prefix) t)
 
-  (make-local-variable 'comment-start-skip)
-  (make-local-variable 'comment-start)
-  (make-local-variable 'comment-end)
-  (make-local-variable 'comment-multi-line)
-  (setq comment-start-skip "%+[ \t\f]*")
-  (setq comment-start "%")
-  (setq comment-end "")
-  (setq comment-multi-line nil)
+  (set (make-local-variable 'comment-start-skip) "%+[ \t\f]*")
+  (set (make-local-variable 'comment-start) "%")
+  (set (make-local-variable 'comment-end) "")
+  (set (make-local-variable 'comment-multi-line) nil)
 
   ;; We use `back-to-indentation' but \f is no indentation sign.
   (modify-syntax-entry ?\f "_   ")
 
-  (make-local-variable 'parse-sexp-ignore-comments)
-  (setq parse-sexp-ignore-comments t)
+  (set (make-local-variable 'parse-sexp-ignore-comments) t)
 
-  (make-local-variable 'comment-indent-function)
-  (setq comment-indent-function 'meta-comment-indent)
-  (make-local-variable 'indent-line-function)
-  (setq indent-line-function 'meta-indent-line)
+  (set (make-local-variable 'comment-indent-function) #'meta-comment-indent)
+  (set (make-local-variable 'indent-line-function) #'meta-indent-line)
   ;; No need to define a mode-specific 'indent-region-function.
   ;; Simply use the generic 'indent-region and 'comment-region.
 
   ;; Set defaults for font-lock mode.
-  (make-local-variable 'font-lock-defaults)
-  (setq font-lock-defaults
-        '(meta-font-lock-keywords
-          nil nil ((?_ . "w")) nil
-          (font-lock-comment-start-regexp . "%")))
+  (set (make-local-variable 'font-lock-defaults)
+       '(meta-font-lock-keywords
+         nil nil ((?_ . "w")) nil
+         (font-lock-comment-start-regexp . "%")))
 
   ;; Activate syntax table, keymap and menu.
-  (setq local-abbrev-table meta-mode-abbrev-table)
-  (set-syntax-table meta-mode-syntax-table)
-  (use-local-map meta-mode-map)
-  (easy-menu-add meta-mode-menu)
-  )
+  (easy-menu-add meta-mode-menu))
 
 
 ;;;###autoload
-(defun metafont-mode ()
-  "Major mode for editing Metafont sources.
-Special commands:
-\\{meta-mode-map}
-
-Turning on Metafont mode calls the value of the variables
-`meta-common-mode-hook' and `metafont-mode-hook'."
-  (interactive)
-  (meta-common-initialization)
-  (setq mode-name "Metafont")
-  (setq major-mode 'metafont-mode)
-
+(define-derived-mode metafont-mode meta-common-mode "Metafont"
+  "Major mode for editing Metafont sources."
   ;; Set defaults for completion function.
-  (make-local-variable 'meta-symbol-list)
-  (make-local-variable 'meta-symbol-changed)
-  (make-local-variable 'meta-complete-list)
-  (setq meta-symbol-list nil)
-  (setq meta-symbol-changed nil)
+  (set (make-local-variable 'meta-symbol-list) nil)
+  (set (make-local-variable 'meta-symbol-changed) nil)
   (apply 'meta-add-symbols metafont-symbol-list)
-  (setq meta-complete-list
+  (set (make-local-variable 'meta-complete-list)
         (list (list "\\<\\(\\sw+\\)" 1 'meta-symbol-list)
-              (list "" 'ispell-complete-word)))
-  (run-mode-hooks 'meta-common-mode-hook 'metafont-mode-hook))
+              (list "" 'ispell-complete-word))))
 
 ;;;###autoload
-(defun metapost-mode ()
-  "Major mode for editing MetaPost sources.
-Special commands:
-\\{meta-mode-map}
-
-Turning on MetaPost mode calls the value of the variable
-`meta-common-mode-hook' and `metafont-mode-hook'."
-  (interactive)
-  (meta-common-initialization)
-  (setq mode-name "MetaPost")
-  (setq major-mode 'metapost-mode)
-
+(define-derived-mode metapost-mode meta-common-mode "MetaPost"
+  "Major mode for editing MetaPost sources."
   ;; Set defaults for completion function.
-  (make-local-variable 'meta-symbol-list)
-  (make-local-variable 'meta-symbol-changed)
-  (make-local-variable 'meta-complete-list)
-  (setq meta-symbol-list nil)
-  (setq meta-symbol-changed nil)
+  (set (make-local-variable 'meta-symbol-list) nil)
+  (set (make-local-variable 'meta-symbol-changed) nil)
   (apply 'meta-add-symbols metapost-symbol-list)
-  (setq meta-complete-list
+  (set (make-local-variable 'meta-complete-list)
         (list (list "\\<\\(\\sw+\\)" 1 'meta-symbol-list)
-              (list "" 'ispell-complete-word)))
-  (run-mode-hooks 'meta-common-mode-hook 'metapost-mode-hook))
+              (list "" 'ispell-complete-word))))
 
 
 ;;; Just in case ...
--- a/lisp/progmodes/mixal-mode.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/progmodes/mixal-mode.el	Thu Dec 16 18:30:57 2010 -0500
@@ -1106,8 +1106,7 @@
 
 ;;;###autoload
 (define-derived-mode mixal-mode fundamental-mode "mixal"
-  "Major mode for the mixal asm language.
-\\{mixal-mode-map}"
+  "Major mode for the mixal asm language."
   (set (make-local-variable 'comment-start) "*")
   (set (make-local-variable 'comment-start-skip) "^\\*[ \t]*")
   (set (make-local-variable 'font-lock-defaults)
@@ -1117,11 +1116,7 @@
   ;; might add an indent function in the future
   ;;  (set (make-local-variable 'indent-line-function) 'mixal-indent-line)
   (set (make-local-variable 'compile-command) (concat "mixasm "
-						      buffer-file-name))
-  ;; mixasm will do strange when there is no final newline,
-  ;; so let Emacs ensure that it is always there
-  (set (make-local-variable 'require-final-newline)
-       mode-require-final-newline))
+						      buffer-file-name)))
 
 (provide 'mixal-mode)
 
--- a/lisp/progmodes/modula2.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/progmodes/modula2.el	Thu Dec 16 18:30:57 2010 -0500
@@ -308,8 +308,6 @@
    `m2-indent' controls the number of spaces for each indentation.
    `m2-compile-command' holds the command to compile a Modula-2 program.
    `m2-link-command' holds the command to link a Modula-2 program."
-  (make-local-variable 'm2-end-comment-column)
-  
   (set (make-local-variable 'paragraph-start) (concat "$\\|" page-delimiter))
   (set (make-local-variable 'paragraph-separate) paragraph-start)
   (set (make-local-variable 'paragraph-ignore-fill-prefix) t)
--- a/lisp/progmodes/octave-inf.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/progmodes/octave-inf.el	Thu Dec 16 18:30:57 2010 -0500
@@ -121,34 +121,24 @@
 This variable is used to initialize `comint-dynamic-complete-functions'
 in the Inferior Octave buffer.")
 
-(defun inferior-octave-mode ()
+(define-derived-mode inferior-octave-mode comint-mode "Inferior Octave"
   "Major mode for interacting with an inferior Octave process.
 Runs Octave as a subprocess of Emacs, with Octave I/O through an Emacs
 buffer.
 
 Entry to this mode successively runs the hooks `comint-mode-hook' and
 `inferior-octave-mode-hook'."
-  (interactive)
-  (delay-mode-hooks (comint-mode))
   (setq comint-prompt-regexp inferior-octave-prompt
-	major-mode 'inferior-octave-mode
-	mode-name "Inferior Octave"
 	mode-line-process '(":%s")
 	local-abbrev-table octave-abbrev-table)
-  (use-local-map inferior-octave-mode-map)
-  (set-syntax-table inferior-octave-mode-syntax-table)
 
-  (make-local-variable 'comment-start)
-  (setq comment-start octave-comment-start)
-  (make-local-variable 'comment-end)
-  (setq comment-end "")
-  (make-local-variable 'comment-column)
-  (setq comment-column 32)
-  (make-local-variable 'comment-start-skip)
-  (setq comment-start-skip octave-comment-start-skip)
+  (set (make-local-variable 'comment-start) octave-comment-start)
+  (set (make-local-variable 'comment-end) "")
+  (set (make-local-variable 'comment-column) 32)
+  (set (make-local-variable 'comment-start-skip) octave-comment-start-skip)
 
-  (make-local-variable 'font-lock-defaults)
-  (setq font-lock-defaults '(inferior-octave-font-lock-keywords nil nil))
+  (set (make-local-variable 'font-lock-defaults)
+       '(inferior-octave-font-lock-keywords nil nil))
 
   (setq comint-input-ring-file-name
 	(or (getenv "OCTAVE_HISTFILE") "~/.octave_hist")
@@ -157,9 +147,7 @@
        inferior-octave-dynamic-complete-functions)
   (add-hook 'comint-input-filter-functions
 	'inferior-octave-directory-tracker nil t)
-  (comint-read-input-ring t)
-
-  (run-mode-hooks 'inferior-octave-mode-hook))
+  (comint-read-input-ring t))
 
 ;;;###autoload
 (defun inferior-octave (&optional arg)
--- a/lisp/progmodes/octave-mod.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/progmodes/octave-mod.el	Thu Dec 16 18:30:57 2010 -0500
@@ -655,8 +655,7 @@
        'octave-beginning-of-defun)
 
   (easy-menu-add octave-mode-menu)
-  (octave-initialize-completions)
-  (run-mode-hooks 'octave-mode-hook))
+  (octave-initialize-completions))
 
 (defvar info-lookup-mode)
 
--- a/lisp/progmodes/perl-mode.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/progmodes/perl-mode.el	Thu Dec 16 18:30:57 2010 -0500
@@ -545,7 +545,7 @@
   "Normal hook to run when entering Perl mode.")
 
 ;;;###autoload
-(defun perl-mode ()
+(define-derived-mode perl-mode prog-mode "Perl"
   "Major mode for editing Perl code.
 Expression and list commands understand all Perl brackets.
 Tab indents for Perl code.
@@ -592,33 +592,16 @@
   perl-label-offset               -5   -8   -2   -2   -2
 
 Turning on Perl mode runs the normal hook `perl-mode-hook'."
-  (interactive)
-  (kill-all-local-variables)
-  (use-local-map perl-mode-map)
-  (setq major-mode 'perl-mode)
-  (setq mode-name "Perl")
-  (setq local-abbrev-table perl-mode-abbrev-table)
-  (set-syntax-table perl-mode-syntax-table)
-  (make-local-variable 'paragraph-start)
-  (setq paragraph-start (concat "$\\|" page-delimiter))
-  (make-local-variable 'paragraph-separate)
-  (setq paragraph-separate paragraph-start)
-  (make-local-variable 'paragraph-ignore-fill-prefix)
-  (setq paragraph-ignore-fill-prefix t)
-  (make-local-variable 'indent-line-function)
-  (setq indent-line-function 'perl-indent-line)
-  (make-local-variable 'require-final-newline)
-  (setq require-final-newline mode-require-final-newline)
-  (make-local-variable 'comment-start)
-  (setq comment-start "# ")
-  (make-local-variable 'comment-end)
-  (setq comment-end "")
-  (make-local-variable 'comment-start-skip)
-  (setq comment-start-skip "\\(^\\|\\s-\\);?#+ *")
-  (make-local-variable 'comment-indent-function)
-  (setq comment-indent-function 'perl-comment-indent)
-  (make-local-variable 'parse-sexp-ignore-comments)
-  (setq parse-sexp-ignore-comments t)
+  :abbrev-table perl-mode-abbrev-table
+  (set (make-local-variable 'paragraph-start) (concat "$\\|" page-delimiter))
+  (set (make-local-variable 'paragraph-separate) paragraph-start)
+  (set (make-local-variable 'paragraph-ignore-fill-prefix) t)
+  (set (make-local-variable 'indent-line-function) #'perl-indent-line)
+  (set (make-local-variable 'comment-start) "# ")
+  (set (make-local-variable 'comment-end) "")
+  (set (make-local-variable 'comment-start-skip) "\\(^\\|\\s-\\);?#+ *")
+  (set (make-local-variable 'comment-indent-function) #'perl-comment-indent)
+  (set (make-local-variable 'parse-sexp-ignore-comments) t)
   ;; Tell font-lock.el how to handle Perl.
   (setq font-lock-defaults '((perl-font-lock-keywords
 			      perl-font-lock-keywords-1
@@ -636,8 +619,7 @@
   (setq imenu-case-fold-search nil)
   ;; Setup outline-minor-mode.
   (set (make-local-variable 'outline-regexp) perl-outline-regexp)
-  (set (make-local-variable 'outline-level) 'perl-outline-level)
-  (run-mode-hooks 'perl-mode-hook))
+  (set (make-local-variable 'outline-level) 'perl-outline-level))
 
 ;; This is used by indent-for-comment
 ;; to decide how much to indent a comment in Perl code
--- a/lisp/progmodes/prolog.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/progmodes/prolog.el	Thu Dec 16 18:30:57 2010 -0500
@@ -180,12 +180,9 @@
     (`(:after . ,(or `":-" `"->")) prolog-indent-width)))
 
 (defun prolog-mode-variables ()
-  (make-local-variable 'paragraph-separate)
-  (setq paragraph-separate (concat "%%\\|$\\|" page-delimiter)) ;'%%..'
-  (make-local-variable 'paragraph-ignore-fill-prefix)
-  (setq paragraph-ignore-fill-prefix t)
-  (make-local-variable 'imenu-generic-expression)
-  (setq imenu-generic-expression '((nil "^\\sw+" 0)))
+  (set (make-local-variable 'paragraph-separate) (concat "%%\\|$\\|" page-delimiter)) ;'%%..'
+  (set (make-local-variable 'paragraph-ignore-fill-prefix) t)
+  (set (make-local-variable 'imenu-generic-expression) '((nil "^\\sw+" 0)))
 
   ;; Setup SMIE.
   (smie-setup prolog-smie-grammar #'prolog-smie-rules
@@ -197,14 +194,10 @@
   ;; There's no real closer in Prolog anyway.
   (set (make-local-variable 'smie-blink-matching-inners) t)
 
-  (make-local-variable 'comment-start)
-  (setq comment-start "%")
-  (make-local-variable 'comment-start-skip)
-  (setq comment-start-skip "\\(?:%+\\|/\\*+\\)[ \t]*")
-  (make-local-variable 'comment-end-skip)
-  (setq comment-end-skip "[ \t]*\\(\n\\|\\*+/\\)")
-  (make-local-variable 'comment-column)
-  (setq comment-column 48))
+  (set (make-local-variable 'comment-start) "%")
+  (set (make-local-variable 'comment-start-skip) "\\(?:%+\\|/\\*+\\)[ \t]*")
+  (set (make-local-variable 'comment-end-skip) "[ \t]*\\(\n\\|\\*+/\\)")
+  (set (make-local-variable 'comment-column) 48))
 
 (defvar prolog-mode-map
   (let ((map (make-sparse-keymap)))
--- a/lisp/progmodes/ps-mode.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/progmodes/ps-mode.el	Thu Dec 16 18:30:57 2010 -0500
@@ -979,9 +979,7 @@
 
 (define-derived-mode ps-run-mode comint-mode "Interactive PS"
   "Major mode in interactive PostScript window.
-This mode is invoked from `ps-mode' and should not be called directly.
-
-\\{ps-run-mode-map}"
+This mode is invoked from `ps-mode' and should not be called directly."
   (set (make-local-variable 'font-lock-defaults)
        '((ps-run-font-lock-keywords
 	  ps-run-font-lock-keywords-1
@@ -991,7 +989,7 @@
 
 (defun ps-run-running ()
   "Error if not in `ps-mode' or not running PostScript."
-  (unless (equal major-mode 'ps-mode)
+  (unless (derived-mode-p 'ps-mode)
     (error "This function can only be called from PostScript mode"))
   (unless (equal (process-status "ps-run") 'run)
     (error "No PostScript process running")))
--- a/lisp/progmodes/python.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/progmodes/python.el	Thu Dec 16 18:30:57 2010 -0500
@@ -1317,7 +1317,7 @@
 				  (let ((name (buffer-file-name)))
 				    (if name
 					(file-name-nondirectory name))))))))
-  (setq python-saved-check-command command)
+  (set (make-local-variable 'python-saved-check-command) command)
   (require 'compile)                    ;To define compilation-* variables.
   (save-some-buffers (not compilation-ask-about-save) nil)
   (let ((compilation-error-regexp-alist
@@ -1462,6 +1462,16 @@
   :type 'regexp
   :group 'python)
 
+(defcustom python-remove-cwd-from-path t
+  "Whether to allow loading of Python modules from the current directory.
+If this is non-nil, Emacs removes '' from sys.path when starting
+an inferior Python process.  This is the default, for security
+reasons, as it is easy for the Python process to be started
+without the user's realization (e.g. to perform completion)."
+  :type 'boolean
+  :group 'python
+  :version "23.3")
+
 (defun python-input-filter (str)
   "`comint-input-filter' function for inferior Python.
 Don't save anything for STR matching `inferior-python-filter-regexp'."
@@ -1559,20 +1569,24 @@
 ;;;###autoload
 (defun run-python (&optional cmd noshow new)
   "Run an inferior Python process, input and output via buffer *Python*.
-CMD is the Python command to run.  NOSHOW non-nil means don't show the
-buffer automatically.
+CMD is the Python command to run.  NOSHOW non-nil means don't
+show the buffer automatically.
+
+Interactively, a prefix arg means to prompt for the initial
+Python command line (default is `python-command').
 
-Normally, if there is a process already running in `python-buffer',
-switch to that buffer.  Interactively, a prefix arg allows you to edit
-the initial command line (default is `python-command'); `-i' etc. args
-will be added to this as appropriate.  A new process is started if:
-one isn't running attached to `python-buffer', or interactively the
-default `python-command', or argument NEW is non-nil.  See also the
-documentation for `python-buffer'.
+A new process is started if one isn't running attached to
+`python-buffer', or if called from Lisp with non-nil arg NEW.
+Otherwise, if a process is already running in `python-buffer',
+switch to that buffer.
 
-Runs the hook `inferior-python-mode-hook' \(after the
-`comint-mode-hook' is run).  \(Type \\[describe-mode] in the process
-buffer for a list of commands.)"
+This command runs the hook `inferior-python-mode-hook' after
+running `comint-mode-hook'.  Type \\[describe-mode] in the
+process buffer for a list of commands.
+
+By default, Emacs inhibits the loading of Python modules from the
+current working directory, for security reasons.  To disable this
+behavior, change `python-remove-cwd-from-path' to nil."
   (interactive (if current-prefix-arg
 		   (list (read-string "Run Python: " python-command) nil t)
 		 (list python-command)))
@@ -1586,13 +1600,9 @@
   (when (or new (not (comint-check-proc python-buffer)))
     (with-current-buffer
 	(let* ((cmdlist
-		(append (python-args-to-list cmd)
-                        ;; It's easy for the user to cause the process to be
-			;; started without realizing it (e.g. to perform
-			;; completion); for this reason loading files from the
-			;; current directory is a security risk.  See
-			;; http://article.gmane.org/gmane.emacs.devel/103569
-			'("-i" "-c" "import sys; sys.path.remove('')")))
+		(append (python-args-to-list cmd) '("-i")
+			(if python-remove-cwd-from-path
+			    '("-c" "import sys; sys.path.remove('')"))))
 	       (path (getenv "PYTHONPATH"))
 	       (process-environment	; to import emacs.py
 		(cons (concat "PYTHONPATH="
@@ -2512,7 +2522,6 @@
   (set (make-local-variable 'outline-heading-end-regexp) ":\\s-*\n")
   (set (make-local-variable 'outline-level) #'python-outline-level)
   (set (make-local-variable 'open-paren-in-column-0-is-defun-start) nil)
-  (make-local-variable 'python-saved-check-command)
   (set (make-local-variable 'beginning-of-defun-function)
        'python-beginning-of-defun)
   (set (make-local-variable 'end-of-defun-function) 'python-end-of-defun)
--- a/lisp/progmodes/scheme.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/progmodes/scheme.el	Thu Dec 16 18:30:57 2010 -0500
@@ -126,39 +126,27 @@
 (defun scheme-mode-variables ()
   (set-syntax-table scheme-mode-syntax-table)
   (setq local-abbrev-table scheme-mode-abbrev-table)
-  (make-local-variable 'paragraph-start)
-  (setq paragraph-start (concat "$\\|" page-delimiter))
-  (make-local-variable 'paragraph-separate)
-  (setq paragraph-separate paragraph-start)
-  (make-local-variable 'paragraph-ignore-fill-prefix)
-  (setq paragraph-ignore-fill-prefix t)
-  (make-local-variable 'fill-paragraph-function)
-  (setq fill-paragraph-function 'lisp-fill-paragraph)
+  (set (make-local-variable 'paragraph-start) (concat "$\\|" page-delimiter))
+  (set (make-local-variable 'paragraph-separate) paragraph-start)
+  (set (make-local-variable 'paragraph-ignore-fill-prefix) t)
+  (set (make-local-variable 'fill-paragraph-function) 'lisp-fill-paragraph)
   ;; Adaptive fill mode gets in the way of auto-fill,
   ;; and should make no difference for explicit fill
   ;; because lisp-fill-paragraph should do the job.
-  (make-local-variable 'adaptive-fill-mode)
-  (setq adaptive-fill-mode nil)
-  (make-local-variable 'indent-line-function)
-  (setq indent-line-function 'lisp-indent-line)
-  (make-local-variable 'parse-sexp-ignore-comments)
-  (setq parse-sexp-ignore-comments t)
-  (make-local-variable 'outline-regexp)
-  (setq outline-regexp ";;; \\|(....")
-  (make-local-variable 'comment-start)
-  (setq comment-start ";")
+  (set (make-local-variable 'adaptive-fill-mode) nil)
+  (set (make-local-variable 'indent-line-function) 'lisp-indent-line)
+  (set (make-local-variable 'parse-sexp-ignore-comments) t)
+  (set (make-local-variable 'outline-regexp) ";;; \\|(....")
+  (set (make-local-variable 'comment-start) ";")
   (set (make-local-variable 'comment-add) 1)
-  (make-local-variable 'comment-start-skip)
   ;; Look within the line for a ; following an even number of backslashes
   ;; after either a non-backslash or the line beginning.
-  (setq comment-start-skip "\\(\\(^\\|[^\\\\\n]\\)\\(\\\\\\\\\\)*\\);+[ \t]*")
+  (set (make-local-variable 'comment-start-skip)
+       "\\(\\(^\\|[^\\\\\n]\\)\\(\\\\\\\\\\)*\\);+[ \t]*")
   (set (make-local-variable 'font-lock-comment-start-skip) ";+ *")
-  (make-local-variable 'comment-column)
-  (setq comment-column 40)
-  (make-local-variable 'parse-sexp-ignore-comments)
-  (setq parse-sexp-ignore-comments t)
-  (make-local-variable 'lisp-indent-function)
-  (setq lisp-indent-function 'scheme-indent-function)
+  (set (make-local-variable 'comment-column) 40)
+  (set (make-local-variable 'parse-sexp-ignore-comments) t)
+  (set (make-local-variable 'lisp-indent-function) 'scheme-indent-function)
   (setq mode-line-process '("" scheme-mode-line-process))
   (set (make-local-variable 'imenu-case-fold-search) t)
   (setq imenu-generic-expression scheme-imenu-generic-expression)
@@ -206,7 +194,7 @@
   (define-key map "\e\C-q" 'indent-sexp))
 
 ;;;###autoload
-(defun scheme-mode ()
+(define-derived-mode scheme-mode prog-mode "Scheme"
   "Major mode for editing Scheme code.
 Editing commands are similar to those of `lisp-mode'.
 
@@ -225,13 +213,7 @@
 \\{scheme-mode-map}
 Entry to this mode calls the value of `scheme-mode-hook'
 if that value is non-nil."
-  (interactive)
-  (kill-all-local-variables)
-  (use-local-map scheme-mode-map)
-  (setq major-mode 'scheme-mode)
-  (setq mode-name "Scheme")
-  (scheme-mode-variables)
-  (run-mode-hooks 'scheme-mode-hook))
+  (scheme-mode-variables))
 
 (defgroup scheme nil
   "Editing Scheme code."
@@ -404,10 +386,7 @@
 Entering this mode runs the hooks `scheme-mode-hook' and then
 `dsssl-mode-hook' and inserts the value of `dsssl-sgml-declaration' if
 that variable's value is a string."
-  (make-local-variable 'page-delimiter)
-  (setq page-delimiter "^;;;" ; ^L not valid SGML char
-	major-mode 'dsssl-mode
-	mode-name "DSSSL")
+  (set (make-local-variable 'page-delimiter) "^;;;") ; ^L not valid SGML char
   ;; Insert a suitable SGML declaration into an empty buffer.
   ;; FIXME: This should use `auto-insert-alist' instead.
   (and (zerop (buffer-size))
--- a/lisp/progmodes/sh-script.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/progmodes/sh-script.el	Thu Dec 16 18:30:57 2010 -0500
@@ -362,8 +362,6 @@
   "The shell being programmed.  This is set by \\[sh-set-shell].")
 ;;;###autoload(put 'sh-shell 'safe-local-variable 'symbolp)
 
-(defvar sh-mode-abbrev-table nil)
-
 (define-abbrev-table 'sh-mode-abbrev-table ())
 
 
@@ -566,19 +564,6 @@
   :type '(repeat function)
   :group 'sh-script)
 
-
-(defcustom sh-require-final-newline
-  '((csh . t)
-    (pdksh . t))
-  "Value of `require-final-newline' in Shell-Script mode buffers.
-\(SHELL . t) means use the value of `mode-require-final-newline' for SHELL.
-See `sh-feature'."
-  :type '(repeat (cons (symbol :tag "Shell")
-		       (choice (const :tag "require" t)
-			       (sexp :format "Evaluate: %v"))))
-  :group 'sh-script)
-
-
 (defcustom sh-assignment-regexp
   '((csh . "\\<\\([[:alnum:]_]+\\)\\(\\[.+\\]\\)?[ \t]*[-+*/%^]?=")
     ;; actually spaces are only supported in let/(( ... ))
@@ -1717,10 +1702,6 @@
       (setq sh-shell-file
 	    (executable-set-magic shell (sh-feature sh-shell-arg)
 				  no-query-flag insert-flag)))
-  (let ((tem (sh-feature sh-require-final-newline)))
-    (if (eq tem t)
-	(set (make-local-variable 'require-final-newline)
-             mode-require-final-newline)))
   (setq mode-line-process (format "[%s]" sh-shell))
   (set (make-local-variable 'sh-shell-variables) nil)
   (set (make-local-variable 'sh-shell-variables-initialized) nil)
--- a/lisp/progmodes/simula.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/progmodes/simula.el	Thu Dec 16 18:30:57 2010 -0500
@@ -371,33 +371,20 @@
 
 Turning on SIMULA mode calls the value of the variable simula-mode-hook
 with no arguments, if that value is non-nil."
-  (make-local-variable 'comment-column)
-  (setq comment-column 40)
-;  (make-local-variable 'end-comment-column)
-;  (setq end-comment-column 75)
-  (make-local-variable 'paragraph-start)
-  (setq paragraph-start "[ \t]*$\\|\\f")
-  (make-local-variable 'paragraph-separate)
-  (setq paragraph-separate paragraph-start)
-  (make-local-variable 'indent-line-function)
-  (setq indent-line-function 'simula-indent-line)
-  (make-local-variable 'require-final-newline)
-  (setq require-final-newline mode-require-final-newline)
-  (make-local-variable 'comment-start)
-  (setq comment-start "! ")
-  (make-local-variable 'comment-end)
-  (setq comment-end " ;")
-  (make-local-variable 'comment-start-skip)
-  (setq comment-start-skip "!+ *")
-  (make-local-variable 'parse-sexp-ignore-comments)
-  (setq parse-sexp-ignore-comments nil)
-  (make-local-variable 'comment-multi-line)
-  (setq comment-multi-line t)
-  (make-local-variable 'font-lock-defaults)
-  (setq font-lock-defaults
-	'((simula-font-lock-keywords simula-font-lock-keywords-1
-	   simula-font-lock-keywords-2 simula-font-lock-keywords-3)
-	  nil t ((?_ . "w"))))
+  (set (make-local-variable 'comment-column) 40)
+  ;; (set (make-local-variable 'end-comment-column) 75)
+  (set (make-local-variable 'paragraph-start) "[ \t]*$\\|\\f")
+  (set (make-local-variable 'paragraph-separate) paragraph-start)
+  (set (make-local-variable 'indent-line-function) 'simula-indent-line)
+  (set (make-local-variable 'comment-start) "! ")
+  (set (make-local-variable 'comment-end) " ;")
+  (set (make-local-variable 'comment-start-skip) "!+ *")
+  (set (make-local-variable 'parse-sexp-ignore-comments) nil)
+  (set (make-local-variable 'comment-multi-line) t)
+  (set (make-local-variable 'font-lock-defaults)
+       '((simula-font-lock-keywords simula-font-lock-keywords-1
+          simula-font-lock-keywords-2 simula-font-lock-keywords-3)
+         nil t ((?_ . "w"))))
   (set (make-local-variable 'syntax-propertize-function)
        simula-syntax-propertize-function)
   (abbrev-mode 1))
--- a/lisp/progmodes/sql.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/progmodes/sql.el	Thu Dec 16 18:30:57 2010 -0500
@@ -2303,20 +2303,21 @@
 	 '((?_ . "w") (?. . "w")))))
 
     ;; Get the product-specific keywords.
-    (setq sql-mode-font-lock-keywords
-	  (append
-	   (unless (eq sql-product 'ansi)
-	     (sql-get-product-feature sql-product :font-lock))
-	   ;; Always highlight ANSI keywords
-	   (sql-get-product-feature 'ansi :font-lock)
-	   ;; Fontify object names in CREATE, DROP and ALTER DDL
-	   ;; statements
-	   (list sql-mode-font-lock-object-name)))
+    (set (make-local-variable 'sql-mode-font-lock-keywords)
+         (append
+          (unless (eq sql-product 'ansi)
+            (sql-get-product-feature sql-product :font-lock))
+          ;; Always highlight ANSI keywords
+          (sql-get-product-feature 'ansi :font-lock)
+          ;; Fontify object names in CREATE, DROP and ALTER DDL
+          ;; statements
+          (list sql-mode-font-lock-object-name)))
 
     ;; Setup font-lock.  Force re-parsing of `font-lock-defaults'.
     (kill-local-variable 'font-lock-set-defaults)
-    (setq font-lock-defaults (list 'sql-mode-font-lock-keywords
-				   keywords-only t syntax-alist))
+    (set (make-local-variable 'font-lock-defaults)
+         (list 'sql-mode-font-lock-keywords
+               keywords-only t syntax-alist))
 
     ;; Force font lock to reinitialize if it is already on
     ;; Otherwise, we can wait until it can be started.
@@ -3232,7 +3233,7 @@
 ;;; SQL mode -- uses SQL interactive mode
 
 ;;;###autoload
-(defun sql-mode ()
+(define-derived-mode sql-mode prog-mode "SQL"
   "Major mode to edit SQL.
 
 You can send SQL statements to the SQLi buffer using
@@ -3259,18 +3260,11 @@
 \(add-hook 'sql-mode-hook
           (lambda ()
 	    (modify-syntax-entry ?\\\\ \".\" sql-mode-syntax-table)))"
-  (interactive)
-  (kill-all-local-variables)
-  (setq major-mode 'sql-mode)
-  (setq mode-name "SQL")
-  (use-local-map sql-mode-map)
+  :abbrev-table sql-mode-abbrev-table
   (if sql-mode-menu
       (easy-menu-add sql-mode-menu)); XEmacs
-  (set-syntax-table sql-mode-syntax-table)
-  (make-local-variable 'font-lock-defaults)
-  (make-local-variable 'sql-mode-font-lock-keywords)
-  (make-local-variable 'comment-start)
-  (setq comment-start "--")
+  
+  (set (make-local-variable 'comment-start) "--")
   ;; Make each buffer in sql-mode remember the "current" SQLi buffer.
   (make-local-variable 'sql-buffer)
   ;; Add imenu support for sql-mode.  Note that imenu-generic-expression
@@ -3280,17 +3274,11 @@
 	imenu-case-fold-search t)
   ;; Make `sql-send-paragraph' work on paragraphs that contain indented
   ;; lines.
-  (make-local-variable 'paragraph-separate)
-  (make-local-variable 'paragraph-start)
-  (setq paragraph-separate "[\f]*$"
-	paragraph-start "[\n\f]")
+  (set (make-local-variable 'paragraph-separate) "[\f]*$")
+  (set (make-local-variable 'paragraph-start) "[\n\f]")
   ;; Abbrevs
-  (setq local-abbrev-table sql-mode-abbrev-table)
   (setq abbrev-all-caps 1)
-  ;; Run hook
-  (run-mode-hooks 'sql-mode-hook)
   ;; Catch changes to sql-product and highlight accordingly
-  (sql-highlight-product)
   (add-hook 'hack-local-variables-hook 'sql-highlight-product t t))
 
 
@@ -3375,15 +3363,14 @@
 	   sql-product))
 
   ;; Setup the mode.
-  (setq major-mode 'sql-interactive-mode)
-  (setq mode-name (concat "SQLi[" (or (sql-get-product-feature sql-product :name)
-				      (symbol-name sql-product)) "]"))
+  (setq major-mode 'sql-interactive-mode) ;FIXME: Use define-derived-mode.
+  (setq mode-name
+        (concat "SQLi[" (or (sql-get-product-feature sql-product :name)
+                            (symbol-name sql-product)) "]"))
   (use-local-map sql-interactive-mode-map)
   (if sql-interactive-mode-menu
       (easy-menu-add sql-interactive-mode-menu)) ; XEmacs
   (set-syntax-table sql-mode-syntax-table)
-  (make-local-variable 'sql-mode-font-lock-keywords)
-  (make-local-variable 'font-lock-defaults)
 
   ;; Note that making KEYWORDS-ONLY nil will cause havoc if you try
   ;; SELECT 'x' FROM DUAL with SQL*Plus, because the title of the column
@@ -3392,8 +3379,7 @@
   (sql-product-font-lock t nil)
 
   ;; Enable commenting and uncommenting of the region.
-  (make-local-variable 'comment-start)
-  (setq comment-start "--")
+  (set (make-local-variable 'comment-start) "--")
   ;; Abbreviation table init and case-insensitive.  It is not activated
   ;; by default.
   (setq local-abbrev-table sql-mode-abbrev-table)
@@ -3403,8 +3389,8 @@
   ;; Save the connection name
   (make-local-variable 'sql-connection)
   ;; Create a usefull name for renaming this buffer later.
-  (make-local-variable 'sql-alternate-buffer-name)
-  (setq sql-alternate-buffer-name (sql-make-alternate-buffer-name))
+  (set (make-local-variable 'sql-alternate-buffer-name)
+       (sql-make-alternate-buffer-name))
   ;; User stuff.  Initialize before the hook.
   (set (make-local-variable 'sql-prompt-regexp)
        (sql-get-product-feature sql-product :prompt-regexp))
--- a/lisp/progmodes/tcl.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/progmodes/tcl.el	Thu Dec 16 18:30:57 2010 -0500
@@ -572,10 +572,7 @@
 
 Turning on Tcl mode runs `tcl-mode-hook'.  Read the documentation for
 `tcl-mode-hook' to see what kinds of interesting hook functions
-already exist.
-
-Commands:
-\\{tcl-mode-map}"
+already exist."
   (unless (and (boundp 'filladapt-mode) filladapt-mode)
     (set (make-local-variable 'paragraph-ignore-fill-prefix) t))
 
@@ -1064,7 +1061,7 @@
 (defun inferior-tcl-proc ()
   "Return current inferior Tcl process.
 See variable `inferior-tcl-buffer'."
-  (let ((proc (get-buffer-process (if (eq major-mode 'inferior-tcl-mode)
+  (let ((proc (get-buffer-process (if (derived-mode-p 'inferior-tcl-mode)
 				      (current-buffer)
 				    inferior-tcl-buffer))))
     (or proc
@@ -1287,7 +1284,7 @@
 If FLAG is nil, just uses `current-word'.
 Otherwise scans backward for most likely Tcl command word."
   (if (and flag
-	   (memq major-mode '(tcl-mode inferior-tcl-mode)))
+	   (derived-mode-p 'tcl-mode 'inferior-tcl-mode))
       (condition-case nil
 	  (save-excursion
 	    ;; Look backward for first word actually in alist.
@@ -1363,7 +1360,7 @@
     ;; filename.
     (car (comint-get-source "Load Tcl file: "
 			    (or (and
-				 (eq major-mode 'tcl-mode)
+				 (derived-mode-p 'tcl-mode)
 				 (buffer-file-name))
 				tcl-previous-dir/file)
 			    '(tcl-mode) t))
@@ -1383,12 +1380,12 @@
    (list
     (car (comint-get-source "Restart with Tcl file: "
 			    (or (and
-				 (eq major-mode 'tcl-mode)
+				 (derived-mode-p 'tcl-mode)
 				 (buffer-file-name))
 				tcl-previous-dir/file)
 			    '(tcl-mode) t))
     current-prefix-arg))
-  (let* ((buf (if (eq major-mode 'inferior-tcl-mode)
+  (let* ((buf (if (derived-mode-p 'inferior-tcl-mode)
 		  (current-buffer)
 		inferior-tcl-buffer))
 	 (proc (and buf (get-process buf))))
--- a/lisp/progmodes/vera-mode.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/progmodes/vera-mode.el	Thu Dec 16 18:30:57 2010 -0500
@@ -253,7 +253,7 @@
 ;;;###autoload (add-to-list 'auto-mode-alist (cons (purecopy "\\.vr[hi]?\\'")  'vera-mode))
 
 ;;;###autoload
-(defun vera-mode ()
+(define-derived-mode vera-mode prog-mode "Vera"
   "Major mode for editing Vera code.
 
 Usage:
@@ -301,13 +301,6 @@
 -------------
 
 \\{vera-mode-map}"
-  (interactive)
-  (kill-all-local-variables)
-  (setq major-mode 'vera-mode)
-  (setq mode-name "Vera")
-  ;; set maps and tables
-  (use-local-map vera-mode-map)
-  (set-syntax-table vera-mode-syntax-table)
   ;; set local variables
   (require 'cc-cmds)
   (set (make-local-variable 'comment-start) "//")
@@ -328,9 +321,7 @@
   ;; add menu (XEmacs)
   (easy-menu-add vera-mode-menu)
   ;; miscellaneous
-  (message "Vera Mode %s.  Type C-c C-h for documentation." vera-version)
-  ;; run hooks
-  (run-hooks 'vera-mode-hook))
+  (message "Vera Mode %s.  Type C-c C-h for documentation." vera-version))
 
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
--- a/lisp/progmodes/verilog-mode.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/progmodes/verilog-mode.el	Thu Dec 16 18:30:57 2010 -0500
@@ -1533,16 +1533,14 @@
   (cond
    ((or (file-exists-p "makefile")	;If there is a makefile, use it
 	(file-exists-p "Makefile"))
-    (make-local-variable 'compile-command)
-    (setq compile-command "make "))
+    (set (make-local-variable 'compile-command) "make "))
    (t
-    (make-local-variable 'compile-command)
-    (setq compile-command
-	  (if verilog-tool
-	      (if (string-match "%s" (eval verilog-tool))
-		  (format (eval verilog-tool) (or buffer-file-name ""))
-		(concat (eval verilog-tool) " " (or buffer-file-name "")))
-	    ""))))
+    (set (make-local-variable 'compile-command)
+         (if verilog-tool
+             (if (string-match "%s" (eval verilog-tool))
+                 (format (eval verilog-tool) (or buffer-file-name ""))
+               (concat (eval verilog-tool) " " (or buffer-file-name "")))
+           ""))))
   (verilog-modify-compile-command))
 
 (defun verilog-expand-command (command)
@@ -1566,8 +1564,8 @@
   (when (and
 	 (stringp compile-command)
 	 (string-match "\\b\\(__FLAGS__\\|__FILE__\\)\\b" compile-command))
-    (make-local-variable 'compile-command)
-    (setq compile-command (verilog-expand-command compile-command))))
+    (set (make-local-variable 'compile-command)
+         (verilog-expand-command compile-command))))
 
 (if (featurep 'xemacs)
     ;; Following code only gets called from compilation-mode-hook on XEmacs to add error handling.
@@ -1588,8 +1586,8 @@
 			    (cdr compilation-error-regexp-alist-alist)))))
       (if (boundp 'compilation-font-lock-keywords)
 	  (progn
-	    (make-local-variable 'compilation-font-lock-keywords)
-	    (setq compilation-font-lock-keywords  verilog-error-font-lock-keywords)
+            (set (make-local-variable 'compilation-font-lock-keywords)
+                 verilog-error-font-lock-keywords)
 	    (font-lock-set-defaults)))
       ;; Need to re-run compilation-error-regexp builder
       (if (fboundp 'compilation-build-compilation-error-regexp-alist)
@@ -2975,7 +2973,7 @@
 ;;
 (defvar verilog-which-tool 1)
 ;;;###autoload
-(defun verilog-mode ()
+(define-derived-mode verilog-mode prog-mode "Verilog"
   "Major mode for editing Verilog code.
 \\<verilog-mode-map>
 See \\[describe-function] verilog-auto (\\[verilog-auto]) for details on how
@@ -3103,30 +3101,21 @@
 Key bindings specific to `verilog-mode-map' are:
 
 \\{verilog-mode-map}"
-  (interactive)
-  (kill-all-local-variables)
-  (use-local-map verilog-mode-map)
-  (setq major-mode 'verilog-mode)
-  (setq mode-name "Verilog")
-  (setq local-abbrev-table verilog-mode-abbrev-table)
+  :abbrev-table verilog-mode-abbrev-table
   (set (make-local-variable 'beginning-of-defun-function)
        'verilog-beg-of-defun)
   (set (make-local-variable 'end-of-defun-function)
        'verilog-end-of-defun)
   (set-syntax-table verilog-mode-syntax-table)
-  (make-local-variable 'indent-line-function)
-  (setq indent-line-function 'verilog-indent-line-relative)
+  (set (make-local-variable 'indent-line-function)
+       #'verilog-indent-line-relative)
   (setq comment-indent-function 'verilog-comment-indent)
-  (make-local-variable 'parse-sexp-ignore-comments)
-  (setq parse-sexp-ignore-comments nil)
-  (make-local-variable 'comment-start)
-  (make-local-variable 'comment-end)
-  (make-local-variable 'comment-multi-line)
-  (make-local-variable 'comment-start-skip)
-  (setq comment-start "// "
-	comment-end ""
-	comment-start-skip "/\\*+ *\\|// *"
-	comment-multi-line nil)
+  (set (make-local-variable 'parse-sexp-ignore-comments) nil)
+  
+  (set (make-local-variable 'comment-start) "// ")
+  (set (make-local-variable 'comment-end) "")
+  (set (make-local-variable 'comment-start-skip) "/\\*+ *\\|// *")
+  (set (make-local-variable 'comment-multi-line) nil)
   ;; Set up for compilation
   (setq verilog-which-tool 1)
   (setq verilog-tool 'verilog-linter)
@@ -3166,8 +3155,8 @@
     (add-hook 'after-change-functions 'verilog-highlight-region t t))
 
   ;; Tell imenu how to handle Verilog.
-  (make-local-variable 'imenu-generic-expression)
-  (setq imenu-generic-expression verilog-imenu-generic-expression)
+  (set (make-local-variable 'imenu-generic-expression)
+       verilog-imenu-generic-expression)
   ;; Tell which-func-modes that imenu knows about verilog
   (when (boundp 'which-function-modes)
     (add-to-list 'which-func-modes 'verilog-mode))
@@ -3180,8 +3169,7 @@
 		  hs-special-modes-alist))))
 
   ;; Stuff for autos
-  (add-hook 'write-contents-hooks 'verilog-auto-save-check) ; already local
-  (run-hooks 'verilog-mode-hook))
+  (add-hook 'write-contents-hooks 'verilog-auto-save-check nil 'local))
 
 
 ;;
@@ -8042,8 +8030,7 @@
 	(let ((enumvar (intern (concat "venum-" enumname))))
 	  ;;(message "Define %s=%s" defname defvalue) (sleep-for 1)
 	  (unless (boundp enumvar) (set enumvar nil))
-	  (make-local-variable enumvar)
-	  (add-to-list enumvar defname)))))
+          (add-to-list (make-local-variable enumvar) defname)))))
 
 (defun verilog-read-defines (&optional filename recurse subcall)
   "Read `defines and parameters for the current file, or optional FILENAME.
@@ -9349,10 +9336,9 @@
 (defun verilog-auto-reeval-locals (&optional force)
   "Read file local variable segment at bottom of file if it has changed.
 If FORCE, always reread it."
-  (make-local-variable 'verilog-auto-last-file-locals)
   (let ((curlocal (verilog-auto-read-locals)))
     (when (or force (not (equal verilog-auto-last-file-locals curlocal)))
-      (setq verilog-auto-last-file-locals curlocal)
+      (set (make-local-variable 'verilog-auto-last-file-locals) curlocal)
       ;; Note this may cause this function to be recursively invoked,
       ;; because hack-local-variables may call (verilog-mode)
       ;; The above when statement will prevent it from recursing forever.
--- a/lisp/progmodes/vhdl-mode.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/progmodes/vhdl-mode.el	Thu Dec 16 18:30:57 2010 -0500
@@ -4117,7 +4117,10 @@
 ;; performs all buffer local initializations
 
 ;;;###autoload
-(defun vhdl-mode ()
+(define-derived-mode vhdl-mode prog-mode
+  '("VHDL" (vhdl-electric-mode "/" (vhdl-stutter-mode "/"))
+           (vhdl-electric-mode "e")
+           (vhdl-stutter-mode "s"))
   "Major mode for editing VHDL code.
 
 Usage:
@@ -4650,26 +4653,13 @@
 -------------
 
 \\{vhdl-mode-map}"
-  (interactive)
-  (kill-all-local-variables)
-  (setq major-mode 'vhdl-mode)
-  (setq mode-name '("VHDL"
-                    (vhdl-electric-mode "/" (vhdl-stutter-mode "/"))
-                    (vhdl-electric-mode "e")
-                    (vhdl-stutter-mode "s")))
-
-  ;; set maps and tables
-  (use-local-map vhdl-mode-map)
-  (set-syntax-table vhdl-mode-syntax-table)
-  (setq local-abbrev-table vhdl-mode-abbrev-table)
+  :abbrev-table vhdl-mode-abbrev-table
 
   ;; set local variables
   (set (make-local-variable 'paragraph-start)
        "\\s-*\\(--+\\s-*$\\|[^ -]\\|$\\)")
   (set (make-local-variable 'paragraph-separate) paragraph-start)
   (set (make-local-variable 'paragraph-ignore-fill-prefix) t)
-  (set (make-local-variable 'require-final-newline)
-       (if vhdl-emacs-22 mode-require-final-newline t))
   (set (make-local-variable 'parse-sexp-ignore-comments) t)
   (set (make-local-variable 'indent-line-function) 'vhdl-indent-line)
   (set (make-local-variable 'comment-start) "--")
@@ -4686,8 +4676,7 @@
   ;; setup the comment indent variable in a Emacs version portable way
   ;; ignore any byte compiler warnings you might get here
   (when (boundp 'comment-indent-function)
-    (make-local-variable 'comment-indent-function)
-    (setq comment-indent-function 'vhdl-comment-indent))
+    (set (make-local-variable 'comment-indent-function) 'vhdl-comment-indent))
 
   ;; initialize font locking
   (set (make-local-variable 'font-lock-defaults)
@@ -4731,12 +4720,7 @@
   (vhdl-ps-print-init)
   (vhdl-write-file-hooks-init)
   (message "VHDL Mode %s.%s" vhdl-version
-	   (if noninteractive "" "  See menu for documentation and release notes."))
-
-  ;; run hooks
-  (if vhdl-emacs-22
-      (run-mode-hooks 'vhdl-mode-hook)
-    (run-hooks 'vhdl-mode-hook)))
+	   (if noninteractive "" "  See menu for documentation and release notes.")))
 
 (defun vhdl-activate-customizations ()
   "Activate all customizations on local variables."
@@ -4754,10 +4738,10 @@
 (defun vhdl-write-file-hooks-init ()
   "Add/remove hooks when buffer is saved."
   (if vhdl-modify-date-on-saving
-      (add-hook 'local-write-file-hooks 'vhdl-template-modify-noerror)
-    (remove-hook 'local-write-file-hooks 'vhdl-template-modify-noerror))
-  (make-local-variable 'after-save-hook)
-  (add-hook 'after-save-hook 'vhdl-add-modified-file))
+      (add-hook 'local-write-file-hooks 'vhdl-template-modify-noerror nil t)
+    (remove-hook 'local-write-file-hooks 'vhdl-template-modify-noerror t))
+  (if (featurep 'xemacs) (make-local-hook 'after-save-hook))
+  (add-hook 'after-save-hook 'vhdl-add-modified-file nil t))
 
 (defun vhdl-process-command-line-option (option)
   "Process command line options for VHDL Mode."
@@ -5271,13 +5255,12 @@
       (lambda (varentry)
 	(let ((var (car varentry))
 	      (val (cdr varentry)))
-	  (and local
-	       (make-local-variable var))
 	  ;; special case for vhdl-offsets-alist
 	  (if (not (eq var 'vhdl-offsets-alist))
-	      (set var val)
+	      (set (if local (make-local-variable var) var) val)
 	    ;; reset vhdl-offsets-alist to the default value first
-	    (setq vhdl-offsets-alist (copy-alist vhdl-offsets-alist-default))
+	    (set (if local (make-local-variable var) var)
+                 (copy-alist vhdl-offsets-alist-default))
 	    ;; now set the langelems that are different
 	    (mapcar
 	     (function
@@ -12500,10 +12483,10 @@
 	    (cons (list 'vhdl-mode vhdl-hs-start-regexp nil "--\\( \\|$\\)"
 			'vhdl-hs-forward-sexp-func nil)
 		  hs-special-modes-alist)))
-    (make-local-variable 'hs-minor-mode-hook)
+    (if (featurep 'xemacs) (make-local-hook 'hs-minor-mode-hook))
     (if vhdl-hide-all-init
-	(add-hook 'hs-minor-mode-hook 'hs-hide-all)
-      (remove-hook 'hs-minor-mode-hook 'hs-hide-all))
+	(add-hook 'hs-minor-mode-hook 'hs-hide-all nil t)
+      (remove-hook 'hs-minor-mode-hook 'hs-hide-all t))
     (hs-minor-mode arg)
     (force-mode-line-update)))		; hack to update menu bar
 
@@ -12970,8 +12953,8 @@
   (if (featurep 'xemacs)
       (when (boundp 'ps-print-color-p)
 	(vhdl-ps-print-settings))
-    (make-local-variable 'ps-print-hook)
-    (add-hook 'ps-print-hook 'vhdl-ps-print-settings)))
+    (if (featurep 'xemacs) (make-local-hook 'ps-print-hook))
+    (add-hook 'ps-print-hook 'vhdl-ps-print-settings nil t)))
 
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
--- a/lisp/progmodes/which-func.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/progmodes/which-func.el	Thu Dec 16 18:30:57 2010 -0500
@@ -154,7 +154,7 @@
   :type 'sexp)
 ;;;###autoload (put 'which-func-format 'risky-local-variable t)
 
-(defvar which-func-imenu-joiner-function #'last
+(defvar which-func-imenu-joiner-function (lambda (x) (car (last x)))
   "Function to join together multiple levels of imenu nomenclature.
 Called with a single argument, a list of strings giving the names
 of the menus we had to traverse to get to the item.  Returns a
@@ -198,7 +198,7 @@
 	     (or (eq which-func-modes t)
 		 (member major-mode which-func-modes))))
 
-  (condition-case nil
+  (condition-case err
       (if (and which-func-mode
 	       (not (member major-mode which-func-non-auto-modes))
 	       (or (null which-func-maxout)
@@ -207,6 +207,7 @@
 	  (setq imenu--index-alist
 		(save-excursion (funcall imenu-create-index-function))))
     (error
+     (message "which-func-ff-hook error: %S" err)
      (setq which-func-mode nil))))
 
 (defun which-func-update ()
@@ -225,7 +226,7 @@
 	      (force-mode-line-update)))
 	(error
 	 (setq which-func-mode nil)
-	 (error "Error in which-func-update: %s" info))))))
+	 (error "Error in which-func-update: %S" info))))))
 
 ;;;###autoload
 (defalias 'which-func-mode 'which-function-mode)
@@ -242,6 +243,9 @@
 With prefix ARG, turn Which Function mode on if arg is positive,
 and off otherwise."
   :global t :group 'which-func
+  (when (timerp which-func-update-timer)
+    (cancel-timer which-func-update-timer))
+  (setq which-func-update-timer nil)
   (if which-function-mode
       ;;Turn it on
       (progn
@@ -253,9 +257,6 @@
                   (or (eq which-func-modes t)
                       (member major-mode which-func-modes))))))
     ;; Turn it off
-    (when (timerp which-func-update-timer)
-      (cancel-timer which-func-update-timer))
-    (setq which-func-update-timer nil)
     (dolist (buf (buffer-list))
       (with-current-buffer buf (setq which-func-mode nil)))))
 
@@ -282,8 +283,7 @@
 	       (null which-function-imenu-failed))
       (imenu--make-index-alist t)
       (unless imenu--index-alist
-	(make-local-variable 'which-function-imenu-failed)
-	(setq which-function-imenu-failed t)))
+        (set (make-local-variable 'which-function-imenu-failed) t)))
     ;; If we have an index alist, use it.
     (when (and (null name)
 	       (boundp 'imenu--index-alist) imenu--index-alist)
@@ -294,29 +294,31 @@
         ;; ("submenu" ("name" . marker) ... ). The list can be
         ;; arbitrarily nested.
         (while (or alist imstack)
-          (if alist
-              (progn
-                (setq pair (car-safe alist)
-                      alist (cdr-safe alist))
+          (if (null alist)
+              (setq alist     (car imstack)
+                    namestack (cdr namestack)
+                    imstack   (cdr imstack))
 
-                (cond ((atom pair))     ; skip anything not a cons
+            (setq pair (car-safe alist)
+                  alist (cdr-safe alist))
 
-                      ((imenu--subalist-p pair)
-                       (setq imstack   (cons alist imstack)
-                             namestack (cons (car pair) namestack)
-                             alist     (cdr pair)))
+            (cond
+             ((atom pair))              ; Skip anything not a cons.
 
-                      ((number-or-marker-p (setq mark (cdr pair)))
-                       (if (>= (setq offset (- (point) mark)) 0)
-                           (if (< offset minoffset) ; find the closest item
-                               (setq minoffset offset
-                                     name (funcall
-                                           which-func-imenu-joiner-function
-					   (reverse (cons (car pair)
-							  namestack)))))))))
-            (setq alist     (car imstack)
-                  namestack (cdr namestack)
-                  imstack   (cdr imstack))))))
+             ((imenu--subalist-p pair)
+              (setq imstack   (cons alist imstack)
+                    namestack (cons (car pair) namestack)
+                    alist     (cdr pair)))
+
+             ((number-or-marker-p (setq mark (cdr pair)))
+              (when (and (>= (setq offset (- (point) mark)) 0)
+                         (< offset minoffset)) ; Find the closest item.
+                (setq minoffset offset
+                      name (if (null which-func-imenu-joiner-function)
+                               (car pair)
+                             (funcall
+                              which-func-imenu-joiner-function
+                              (reverse (cons (car pair) namestack))))))))))))
 
     ;; Try using add-log support.
     (when (and (null name) (boundp 'add-log-current-defun-function)
--- a/lisp/progmodes/xscheme.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/progmodes/xscheme.el	Thu Dec 16 18:30:57 2010 -0500
@@ -186,8 +186,7 @@
   (setq-default xscheme-process-command-line command-line)
   (switch-to-buffer
    (xscheme-start-process command-line process-name buffer-name))
-  (make-local-variable 'xscheme-process-command-line)
-  (setq xscheme-process-command-line command-line))
+  (set (make-local-variable 'xscheme-process-command-line) command-line))
 
 (defun xscheme-read-command-line (arg)
   (let ((default
@@ -278,13 +277,11 @@
 		      xscheme-buffer-name
 		      t)))
   (let ((process-name (verify-xscheme-buffer buffer-name t)))
-    (make-local-variable 'xscheme-buffer-name)
-    (setq xscheme-buffer-name buffer-name)
-    (make-local-variable 'xscheme-process-name)
-    (setq xscheme-process-name process-name)
-    (make-local-variable 'xscheme-runlight)
-    (setq xscheme-runlight (with-current-buffer buffer-name
-                             xscheme-runlight))))
+    (set (make-local-variable 'xscheme-buffer-name) buffer-name)
+    (set (make-local-variable 'xscheme-process-name) process-name)
+    (set (make-local-variable 'xscheme-runlight)
+         (with-current-buffer buffer-name
+           xscheme-runlight))))
 
 (defun local-clear-scheme-interaction-buffer ()
   "Make the current buffer use the default scheme interaction buffer."
@@ -386,21 +383,19 @@
 with no args, if that value is non-nil.
  Likewise with the value of scheme-mode-hook.
  scheme-interaction-mode-hook is called after scheme-mode-hook."
+  ;; FIXME: Use define-derived-mode.
   (interactive "P")
   (if (not preserve)
       (let ((previous-mode major-mode))
         (kill-all-local-variables)
-        (make-local-variable 'xscheme-previous-mode)
-        (make-local-variable 'xscheme-buffer-name)
         (make-local-variable 'xscheme-process-name)
         (make-local-variable 'xscheme-previous-process-state)
         (make-local-variable 'xscheme-runlight-string)
         (make-local-variable 'xscheme-runlight)
-        (make-local-variable 'xscheme-last-input-end)
-        (setq xscheme-previous-mode previous-mode)
+        (set (make-local-variable 'xscheme-previous-mode) previous-mode)
         (let ((buffer (current-buffer)))
-          (setq xscheme-buffer-name (buffer-name buffer))
-          (setq xscheme-last-input-end (make-marker))
+          (set (make-local-variable 'xscheme-buffer-name) (buffer-name buffer))
+          (set (make-local-variable 'xscheme-last-input-end) (make-marker))
           (let ((process (get-buffer-process buffer)))
             (if process
                 (progn
@@ -420,7 +415,7 @@
 (defun exit-scheme-interaction-mode ()
   "Take buffer out of scheme interaction mode"
   (interactive)
-  (if (not (eq major-mode 'scheme-interaction-mode))
+  (if (not (derived-mode-p 'scheme-interaction-mode))
       (error "Buffer not in scheme interaction mode"))
   (let ((previous-state xscheme-previous-process-state))
     (funcall xscheme-previous-mode)
@@ -437,7 +432,7 @@
 
 (defun scheme-interaction-mode-initialize ()
   (use-local-map scheme-interaction-mode-map)
-  (setq major-mode 'scheme-interaction-mode)
+  (setq major-mode 'scheme-interaction-mode) ;FIXME: Use define-derived-mode.
   (setq mode-name "Scheme Interaction"))
 
 (defun scheme-interaction-mode-commands (keymap)
@@ -469,8 +464,8 @@
 
 (defun xscheme-enter-interaction-mode ()
   (with-current-buffer (xscheme-process-buffer)
-    (if (not (eq major-mode 'scheme-interaction-mode))
-	(if (eq major-mode 'scheme-debugger-mode)
+    (if (not (derived-mode-p 'scheme-interaction-mode))
+	(if (derived-mode-p 'scheme-debugger-mode)
 	    (scheme-interaction-mode-initialize)
 	    (scheme-interaction-mode t)))))
 
@@ -494,7 +489,7 @@
 
 (defun scheme-debugger-mode-initialize ()
   (use-local-map scheme-debugger-mode-map)
-  (setq major-mode 'scheme-debugger-mode)
+  (setq major-mode 'scheme-debugger-mode) ;FIXME: Use define-derived-mode.
   (setq mode-name "Scheme Debugger"))
 
 (defun scheme-debugger-mode-commands (keymap)
@@ -518,9 +513,9 @@
 
 (defun xscheme-enter-debugger-mode (prompt-string)
   (with-current-buffer (xscheme-process-buffer)
-    (if (not (eq major-mode 'scheme-debugger-mode))
+    (if (not (derived-mode-p 'scheme-debugger-mode))
 	(progn
-	  (if (not (eq major-mode 'scheme-interaction-mode))
+	  (if (not (derived-mode-p 'scheme-interaction-mode))
 	      (scheme-interaction-mode t))
 	  (scheme-debugger-mode-initialize)))))
 
@@ -528,7 +523,7 @@
   (let ((buffer (xscheme-process-buffer)))
     (and buffer
 	 (with-current-buffer buffer
-	   (eq major-mode 'scheme-debugger-mode)))))
+	   (derived-mode-p 'scheme-debugger-mode)))))
 
 ;;;; Evaluation Commands
 
@@ -550,7 +545,7 @@
 (defun xscheme-send-string-1 (strings)
   (let ((string (apply 'concat strings)))
     (xscheme-send-string-2 string)
-    (if (eq major-mode 'scheme-interaction-mode)
+    (if (derived-mode-p 'scheme-interaction-mode)
 	(xscheme-insert-expression string))))
 
 (defun xscheme-send-string-2 (string)
--- a/lisp/ps-print.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/ps-print.el	Thu Dec 16 18:30:57 2010 -0500
@@ -4328,14 +4328,17 @@
 	 (ps-header-font-size-internal
 	  (or ps-header-font-size-internal
 	      (ps-get-font-size 'ps-header-font-size)))
+	 (ps-footer-font-size-internal
+	  (or ps-footer-font-size-internal
+	      (ps-get-font-size 'ps-footer-font-size)))
 	 (ps-header-title-font-size-internal
 	  (or ps-header-title-font-size-internal
 	      (ps-get-font-size 'ps-header-title-font-size)))
 	 (buf (get-buffer-create "*Line-lengths*"))
 	 (ifs ps-font-size-internal)	; initial font size
-	 (icw (ps-avg-char-width 'ps-font-for-text)) ; initial character width
 	 (print-width (progn (ps-get-page-dimensions)
 			     ps-print-width))
+	 (icw (ps-avg-char-width 'ps-font-for-text)) ; initial character width
 	 (ps-setup (ps-setup))		; setup for the current buffer
 	 (fs-min 5)			; minimum font size
 	 cw-min				; minimum character width
@@ -4375,6 +4378,9 @@
 	 (ps-header-font-size-internal
 	  (or ps-header-font-size-internal
 	      (ps-get-font-size 'ps-header-font-size)))
+	 (ps-footer-font-size-internal
+	  (or ps-footer-font-size-internal
+	      (ps-get-font-size 'ps-footer-font-size)))
 	 (ps-header-title-font-size-internal
 	  (or ps-header-title-font-size-internal
 	      (ps-get-font-size 'ps-header-title-font-size)))
@@ -4384,9 +4390,9 @@
 	 (buf (get-buffer-create "*Nb-Pages*"))
 	 (ils ps-line-spacing-internal) ; initial line spacing
 	 (ifs ps-font-size-internal)	; initial font size
-	 (ilh (ps-line-height 'ps-font-for-text)) ; initial line height
 	 (page-height (progn (ps-get-page-dimensions)
 			     ps-print-height))
+	 (ilh (ps-line-height 'ps-font-for-text)) ; initial line height
 	 (ps-setup (ps-setup))		; setup for the current buffer
 	 (fs-min 4)			; minimum font size
 	 lh-min				; minimum line height
--- a/lisp/rect.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/rect.el	Thu Dec 16 18:30:57 2010 -0500
@@ -27,10 +27,8 @@
 ;; This package provides the operations on rectangles that are documented
 ;; in the Emacs manual.
 
-;; ### NOTE: this file has been almost completely rewritten by Didier Verna
-;; <didier@xemacs.org> in July 1999. The purpose of this rewrite is to be less
-;; intrusive and fill lines with whitespaces only when needed. A few functions
-;; are untouched though, as noted above their definition.
+;; ### NOTE: this file was almost completely rewritten by Didier Verna
+;; <didier@xemacs.org> in July 1999.
 
 ;;; Global key bindings
 
@@ -40,26 +38,11 @@
 ;;;###autoload (define-key ctl-x-r-map "y" 'yank-rectangle)
 ;;;###autoload (define-key ctl-x-r-map "o" 'open-rectangle)
 ;;;###autoload (define-key ctl-x-r-map "t" 'string-rectangle)
+;;;###autoload (define-key ctl-x-r-map "N" 'rectangle-number-lines)
 
 ;;; Code:
 
-;;;###autoload
-(defun move-to-column-force (column &optional flag)
-  "If COLUMN is within a multi-column character, replace it by spaces and tab.
-As for `move-to-column', passing anything but nil or t in FLAG will move to
-the desired column only if the line is long enough."
-  (move-to-column column (or flag t)))
-
-;;;###autoload
-(make-obsolete 'move-to-column-force 'move-to-column "21.2")
-
-;; not used any more --dv
-;; extract-rectangle-line stores lines into this list
-;; to accumulate them for extract-rectangle and delete-extract-rectangle.
-(defvar operate-on-rectangle-lines)
-
-;; ### NOTE: this function is untouched, but not used anymore apart from
-;; `delete-whitespace-rectangle'. `apply-on-rectangle' is used instead. --dv
+;; FIXME: this function should be replaced by `apply-on-rectangle'
 (defun operate-on-rectangle (function start end coerce-tabs)
   "Call FUNCTION for each line of rectangle with corners at START, END.
 If COERCE-TABS is non-nil, convert multi-column characters
@@ -107,7 +90,6 @@
        (forward-line 1)))
     (- endcol startcol)))
 
-;; The replacement for `operate-on-rectangle' -- dv
 (defun apply-on-rectangle (function start end &rest args)
   "Call FUNCTION for each line of rectangle with corners at START, END.
 FUNCTION is called with two arguments: the start and end columns of the
@@ -151,9 +133,9 @@
       (setcdr lines (cons (filter-buffer-substring pt (point) t) (cdr lines))))
     ))
 
-;; ### NOTE: this is actually the only function that needs to do complicated
-;; stuff like what's happening in `operate-on-rectangle', because the buffer
-;; might be read-only. --dv
+;; This is actually the only function that needs to do complicated
+;; stuff like what's happening in `operate-on-rectangle', because the
+;; buffer might be read-only.
 (defun extract-rectangle-line (startcol endcol lines)
   (let (start end begextra endextra line)
     (move-to-column startcol)
@@ -186,7 +168,6 @@
 (defconst spaces-strings
   '["" " " "  " "   " "    " "     " "      " "       " "        "])
 
-;; this one is untouched --dv
 (defun spaces-string (n)
   "Return a string with N spaces."
   (if (<= n 8) (aref spaces-strings n)
@@ -253,14 +234,12 @@
        (barf-if-buffer-read-only)
        (signal 'text-read-only (list (current-buffer)))))))
 
-;; this one is untouched --dv
 ;;;###autoload
 (defun yank-rectangle ()
   "Yank the last killed rectangle with upper left corner at point."
   (interactive "*")
   (insert-rectangle killed-rectangle))
 
-;; this one is untoutched --dv
 ;;;###autoload
 (defun insert-rectangle (rectangle)
   "Insert text of RECTANGLE with upper left corner at point.
@@ -323,10 +302,6 @@
   (interactive "*r\nP")
   (apply-on-rectangle 'delete-whitespace-rectangle-line start end fill))
 
-;; not used any more --dv
-;; string-rectangle uses this variable to pass the string
-;; to string-rectangle-line.
-(defvar string-rectangle-string)
 (defvar string-rectangle-history nil)
 (defun string-rectangle-line (startcol endcol string delete)
   (move-to-column startcol t)
@@ -396,6 +371,45 @@
 	(delete-region pt (point))
 	(indent-to endcol)))))
 
+;; Line numbers for `rectangle-number-line-callback'.
+(defvar rectangle-number-line-counter)
+
+(defun rectangle-number-line-callback (start end format-string)
+  (move-to-column start t)
+  (insert (format format-string rectangle-number-line-counter))
+  (setq rectangle-number-line-counter
+	(1+ rectangle-number-line-counter)))
+
+(defun rectange--default-line-number-format (start end start-at)
+  (concat "%"
+	  (int-to-string (length (int-to-string (+ (count-lines start end)
+						   start-at))))
+	  "d "))
+
+;;;###autoload
+(defun rectangle-number-lines (start end start-at &optional format)
+  "Insert numbers in front of the region-rectangle.
+
+START-AT, if non-nil, should be a number from which to begin
+counting.  FORMAT, if non-nil, should be a format string to pass
+to `format' along with the line count.  When called interactively
+with a prefix argument, prompt for START-AT and FORMAT."
+  (interactive
+   (if current-prefix-arg
+       (let* ((start (region-beginning))
+	      (end   (region-end))
+	      (start-at (read-number "Number to count from: " 1)))
+	 (list start end start-at
+	       (read-string "Format string: "
+			    (rectange--default-line-number-format
+			     start end start-at))))
+     (list (region-beginning) (region-end) 1 nil)))
+  (unless format
+    (setq format (rectange--default-line-number-format start end start-at)))
+  (let ((rectangle-number-line-counter start-at))
+    (apply-on-rectangle 'rectangle-number-line-callback
+			start end format)))
+
 (provide 'rect)
 
 ;; arch-tag: 178847b3-1f50-4b03-83de-a6e911cc1d16
--- a/lisp/replace.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/replace.el	Thu Dec 16 18:30:57 2010 -0500
@@ -532,6 +532,9 @@
 Maximum length of the history list is determined by the value
 of `history-length', which see.")
 
+(defvar occur-collect-regexp-history '("\\1")
+  "History of regexp for occur's collect operation")
+
 (defun read-regexp (prompt &optional default-value)
   "Read regexp as a string using the regexp history and some useful defaults.
 Prompt for a regular expression with PROMPT (without a colon and
@@ -1007,10 +1010,25 @@
   :version "22.1")
 
 (defun occur-read-primary-args ()
-  (list (read-regexp "List lines matching regexp"
-		     (car regexp-history))
-	(when current-prefix-arg
-	  (prefix-numeric-value current-prefix-arg))))
+  (let* ((perform-collect (consp current-prefix-arg))
+         (regexp (read-regexp (if perform-collect
+                                  "Collect strings matching regexp"
+                                "List lines matching regexp")
+                              (car regexp-history))))
+    (list regexp
+	  (if perform-collect
+	      ;; Perform collect operation
+	      (if (zerop (regexp-opt-depth regexp))
+		  ;; No subexpression so collect the entire match.
+		  "\\&"
+		;; Get the regexp for collection pattern.
+		(let ((default (car occur-collect-regexp-history)))
+		  (read-string
+		   (format "Regexp to collect (default %s): " default)
+		   nil 'occur-collect-regexp-history default)))
+	    ;; Otherwise normal occur takes numerical prefix argument.
+	    (when current-prefix-arg
+	      (prefix-numeric-value current-prefix-arg))))))
 
 (defun occur-rename-buffer (&optional unique-p interactive-p)
   "Rename the current *Occur* buffer to *Occur: original-buffer-name*.
@@ -1043,7 +1061,18 @@
 \\<occur-mode-map>\\[describe-mode] in that buffer will explain how.
 
 If REGEXP contains upper case characters (excluding those preceded by `\\')
-and `search-upper-case' is non-nil, the matching is case-sensitive."
+and `search-upper-case' is non-nil, the matching is case-sensitive.
+
+When NLINES is a string or when the function is called
+interactively with prefix argument without a number (`C-u' alone
+as prefix) the matching strings are collected into the `*Occur*'
+buffer by using NLINES as a replacement regexp.  NLINES may
+contain \\& and \\N which convention follows `replace-match'.
+For example, providing \"defun\\s +\\(\\S +\\)\" for REGEXP and
+\"\\1\" for NLINES collects all the function names in a lisp
+program.  When there is no parenthesized subexpressions in REGEXP
+the entire match is collected.  In any case the searched buffers
+are not modified."
   (interactive (occur-read-primary-args))
   (occur-1 regexp nlines (list (current-buffer))))
 
@@ -1125,20 +1154,43 @@
     (setq occur-buf (get-buffer-create buf-name))
 
     (with-current-buffer occur-buf
-      (occur-mode)
+      (if (stringp nlines)
+	  (fundamental-mode) ;; This is for collect opeartion.
+	(occur-mode))
       (let ((inhibit-read-only t)
 	    ;; Don't generate undo entries for creation of the initial contents.
 	    (buffer-undo-list t))
 	(erase-buffer)
-	(let ((count (occur-engine
-		      regexp active-bufs occur-buf
-		      (or nlines list-matching-lines-default-context-lines)
-		      (if (and case-fold-search search-upper-case)
-			  (isearch-no-upper-case-p regexp t)
-			case-fold-search)
-		      list-matching-lines-buffer-name-face
-		      nil list-matching-lines-face
-		      (not (eq occur-excluded-properties t)))))
+	(let ((count
+	       (if (stringp nlines)
+                   ;; Treat nlines as a regexp to collect.
+		   (let ((bufs active-bufs)
+			 (count 0))
+		     (while bufs
+		       (with-current-buffer (car bufs)
+			 (save-excursion
+			   (goto-char (point-min))
+			   (while (re-search-forward regexp nil t)
+                             ;; Insert the replacement regexp.
+			     (let ((str (match-substitute-replacement nlines)))
+			       (if str
+				   (with-current-buffer occur-buf
+				     (insert str)
+				     (setq count (1+ count))
+				     (or (zerop (current-column))
+					 (insert "\n"))))))))
+                       (setq bufs (cdr bufs)))
+                     count)
+		 ;; Perform normal occur.
+		 (occur-engine
+		  regexp active-bufs occur-buf
+		  (or nlines list-matching-lines-default-context-lines)
+		  (if (and case-fold-search search-upper-case)
+		      (isearch-no-upper-case-p regexp t)
+		    case-fold-search)
+		  list-matching-lines-buffer-name-face
+		  nil list-matching-lines-face
+		  (not (eq occur-excluded-properties t))))))
 	  (let* ((bufcount (length active-bufs))
 		 (diff (- (length bufs) bufcount)))
 	    (message "Searched %d buffer%s%s; %s match%s%s"
--- a/lisp/shell.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/shell.el	Thu Dec 16 18:30:57 2010 -0500
@@ -368,6 +368,17 @@
 
 ;;; Basic Procedures
 
+(defcustom shell-dir-cookie-re nil
+  "Regexp matching your prompt, including some part of the current directory.
+If your prompt includes the current directory or the last few elements of it,
+set this to a pattern that matches your prompt and whose subgroup 1 matches
+the directory part of it.
+This is used by `shell-dir-cookie-watcher' to try and use this info
+to track your current directory.  It can be used instead of or in addition
+to `dirtrack-mode'."
+  :group 'shell
+  :type '(choice (const nil) regexp))
+
 (put 'shell-mode 'mode-class 'special)
 
 (define-derived-mode shell-mode comint-mode "Shell"
@@ -554,13 +565,19 @@
 			  (generate-new-buffer-name "*shell*"))
 	   (if (file-remote-p default-directory)
 	       ;; It must be possible to declare a local default-directory.
+               ;; FIXME: This can't be right: it changes the default-directory
+               ;; of the current-buffer rather than of the *shell* buffer.
 	       (setq default-directory
 		     (expand-file-name
 		      (read-file-name
 		       "Default directory: " default-directory default-directory
 		       t nil 'file-directory-p))))))))
   (require 'ansi-color)
-  (setq buffer (get-buffer-create (or buffer "*shell*")))
+  (setq buffer (if (or buffer (not (derived-mode-p 'shell-mode))
+                       (comint-check-proc (current-buffer)))
+                   (get-buffer-create (or buffer "*shell*"))
+                 ;; If the current buffer is a dead shell buffer, use it.
+                 (current-buffer)))
   ;; Pop to buffer, so that the buffer's window will be correctly set
   ;; when we call comint (so that comint sets the COLUMNS env var properly).
   (pop-to-buffer buffer)
@@ -623,16 +640,6 @@
 ;; replace it with a process filter that watches for and strips out
 ;; these messages.
 
-(defcustom shell-dir-cookie-re nil
-  "Regexp matching your prompt, including some part of the current directory.
-If your prompt includes the current directory or the last few elements of it,
-set this to a pattern that matches your prompt and whose subgroup 1 matches
-the directory part of it.
-This is used by `shell-dir-cookie-watcher' to try and use this info
-to track your current directory.  It can be used instead of or in addition
-to `dirtrack-mode'."
-  :type '(choice (const nil) regexp))
-
 (defun shell-dir-cookie-watcher (text)
   ;; This is fragile: the TEXT could be split into several chunks and we'd
   ;; miss it.  Oh well.  It's a best effort anyway.  I'd expect that it's
@@ -646,7 +653,6 @@
        ((string-match "\\`\\(.*\\)\\(?:/.*\\)?\n\\(.*/\\)\\1\\(?:/.*\\)?\\'"
 		      (setq text (concat dir "\n" default-directory)))
 	(shell-cd (concat (match-string 2 text) dir)))))))
-	
 
 (defun shell-directory-tracker (str)
   "Tracks cd, pushd and popd commands issued to the shell.
--- a/lisp/simple.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/simple.el	Thu Dec 16 18:30:57 2010 -0500
@@ -441,7 +441,9 @@
 (define-derived-mode prog-mode fundamental-mode "Prog"
   "Major mode for editing programming language source code."
   (set (make-local-variable 'require-final-newline) mode-require-final-newline)
-  (set (make-local-variable 'parse-sexp-ignore-comments) t))
+  (set (make-local-variable 'parse-sexp-ignore-comments) t)
+  ;; Any programming language is always written left to right.
+  (setq bidi-paragraph-direction 'left-to-right))
 
 ;; Making and deleting lines.
 
@@ -759,10 +761,14 @@
        (constrain-to-field nil orig-pos)))))
 
 (defun just-one-space (&optional n)
-  "Delete all spaces and tabs around point, leaving one space (or N spaces)."
+  "Delete all spaces and tabs around point, leaving one space (or N spaces).
+If N is negative, delete newlines as well."
   (interactive "*p")
-  (let ((orig-pos (point)))
-    (skip-chars-backward " \t")
+  (unless n (setq n 1))
+  (let ((orig-pos (point))
+        (skip-characters (if (< n 0) " \t\n\r" " \t"))
+        (n (abs n)))
+    (skip-chars-backward skip-characters)
     (constrain-to-field nil orig-pos)
     (dotimes (i (or n 1))
       (if (= (following-char) ?\s)
@@ -771,7 +777,7 @@
     (delete-region
      (point)
      (progn
-       (skip-chars-forward " \t")
+       (skip-chars-forward skip-characters)
        (constrain-to-field nil orig-pos t)))))
 
 (defun beginning-of-buffer (&optional arg)
--- a/lisp/startup.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/startup.el	Thu Dec 16 18:30:57 2010 -0500
@@ -411,34 +411,31 @@
 	     (default-directory this-dir)
 	     (canonicalized (if (fboundp 'untranslated-canonical-name)
 				(untranslated-canonical-name this-dir))))
-	;; The Windows version doesn't report meaningful inode
-	;; numbers, so use the canonicalized absolute file name of the
-	;; directory instead.
+	;; The Windows version doesn't report meaningful inode numbers, so
+	;; use the canonicalized absolute file name of the directory instead.
 	(setq attrs (or canonicalized
 			(nthcdr 10 (file-attributes this-dir))))
 	(unless (member attrs normal-top-level-add-subdirs-inode-list)
 	  (push attrs normal-top-level-add-subdirs-inode-list)
 	  (dolist (file contents)
-	    ;; The lower-case variants of RCS and CVS are for DOS/Windows.
-	    (unless (member file '("." ".." "RCS" "CVS" "rcs" "cvs"))
-	      (when (and (string-match "\\`[[:alnum:]]" file)
-			 ;; Avoid doing a `stat' when it isn't necessary
-			 ;; because that can cause trouble when an NFS server
-			 ;; is down.
-			 (not (string-match "\\.elc?\\'" file))
-			 (file-directory-p file))
-		(let ((expanded (expand-file-name file)))
-		  (unless (file-exists-p (expand-file-name ".nosearch"
-							   expanded))
-		    (setq pending (nconc pending (list expanded)))))))))))
+	    (and (string-match "\\`[[:alnum:]]" file)
+		 ;; The lower-case variants of RCS and CVS are for DOS/Windows.
+		 (not (member file '("RCS" "CVS" "rcs" "cvs")))
+		 ;; Avoid doing a `stat' when it isn't necessary because
+		 ;; that can cause trouble when an NFS server is down.
+		 (not (string-match "\\.elc?\\'" file))
+		 (file-directory-p file)
+		 (let ((expanded (expand-file-name file)))
+		   (or (file-exists-p (expand-file-name ".nosearch" expanded))
+		       (setq pending (nconc pending (list expanded))))))))))
     (normal-top-level-add-to-load-path (cdr (nreverse dirs)))))
 
-;; This function is called from a subdirs.el file.
-;; It assumes that default-directory is the directory
-;; in which the subdirs.el file exists,
-;; and it adds to load-path the subdirs of that directory
-;; as specified in DIRS.  Normally the elements of DIRS are relative.
 (defun normal-top-level-add-to-load-path (dirs)
+  "This function is called from a subdirs.el file.
+It assumes that `default-directory' is the directory in which the
+subdirs.el file exists, and it adds to `load-path' the subdirs of
+that directory as specified in DIRS.  Normally the elements of
+DIRS are relative."
   (let ((tail load-path)
 	(thisdir (directory-file-name default-directory)))
     (while (and tail
@@ -615,8 +612,8 @@
 and initialize the window system environment to prepare for
 opening the first frame (e.g. open a connection to an X server).")
 
-;; Handle the X-like command-line arguments "-fg", "-bg", "-name", etc.
 (defun tty-handle-args (args)
+  "Handle the X-like command-line arguments \"-fg\", \"-bg\", \"-name\", etc."
   (let (rest)
     (message "%S" args)
     (while (and args
@@ -688,9 +685,6 @@
 
 (defvar server-name)
 (defvar server-process)
-;; Autoload in package.el, but when we bootstrap, we don't have loaddefs yet.
-(defvar package-enable-at-startup)
-(declare-function package-initialize "package" (&optional no-activate))
 
 (defun command-line ()
   (setq before-init-time (current-time)
--- a/lisp/subr.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/subr.el	Thu Dec 16 18:30:57 2010 -0500
@@ -417,7 +417,7 @@
   (assoc-string key alist nil))
 
 (defun member-ignore-case (elt list)
-  "Like `member', but ignores differences in case and text representation.
+  "Like `member', but ignore differences in case and text representation.
 ELT must be a string.  Upper-case and lower-case letters are treated as equal.
 Unibyte strings are converted to multibyte for comparison.
 Non-strings in LIST are ignored."
@@ -915,8 +915,9 @@
 
 (defsubst posn-x-y (position)
   "Return the x and y coordinates in POSITION.
-POSITION should be a list of the form returned by the `event-start'
-and `event-end' functions."
+The return value has the form (X . Y), where X and Y are given in
+pixels.  POSITION should be a list of the form returned by
+`event-start' and `event-end'."
   (nth 2 position))
 
 (declare-function scroll-bar-scale "scroll-bar" (num-denom whole))
@@ -955,7 +956,9 @@
 	       (setq spacing 0)))
 	(cons (/ (car pair) (frame-char-width frame))
 	      (- (/ (cdr pair) (+ (frame-char-height frame) spacing))
-		 (if (null header-line-format) 0 1))))))))
+		 (if (null (with-current-buffer (window-buffer window)
+			     header-line-format))
+		     0 1))))))))
 
 (defun posn-actual-col-row (position)
   "Return the actual column and row in POSITION, measured in characters.
@@ -996,14 +999,15 @@
 
 (defsubst posn-object-x-y (position)
   "Return the x and y coordinates relative to the object of POSITION.
-POSITION should be a list of the form returned by the `event-start'
-and `event-end' functions."
+The return value has the form (DX . DY), where DX and DY are
+given in pixels.  POSITION should be a list of the form returned
+by `event-start' and `event-end'."
   (nth 8 position))
 
 (defsubst posn-object-width-height (position)
   "Return the pixel width and height of the object of POSITION.
-POSITION should be a list of the form returned by the `event-start'
-and `event-end' functions."
+The return value has the form (WIDTH . HEIGHT).  POSITION should
+be a list of the form returned by `event-start' and `event-end'."
   (nth 9 position))
 
 
@@ -1355,9 +1359,8 @@
 
 (defun run-mode-hooks (&rest hooks)
   "Run mode hooks `delayed-mode-hooks' and HOOKS, or delay HOOKS.
-Execution is delayed if `delay-mode-hooks' is non-nil.
-If `delay-mode-hooks' is nil, run `after-change-major-mode-hook'
-after running the mode hooks.
+Execution is delayed if the variable `delay-mode-hooks' is non-nil.
+Otherwise, runs the mode hooks and then `after-change-major-mode-hook'.
 Major mode functions should use this instead of `run-hooks' when running their
 FOO-mode-hook."
   (if delay-mode-hooks
@@ -1479,26 +1482,6 @@
 
 ;;; Load history
 
-;; (defvar symbol-file-load-history-loaded nil
-;;   "Non-nil means we have loaded the file `fns-VERSION.el' in `exec-directory'.
-;; That file records the part of `load-history' for preloaded files,
-;; which is cleared out before dumping to make Emacs smaller.")
-
-;; (defun load-symbol-file-load-history ()
-;;   "Load the file `fns-VERSION.el' in `exec-directory' if not already done.
-;; That file records the part of `load-history' for preloaded files,
-;; which is cleared out before dumping to make Emacs smaller."
-;;   (unless symbol-file-load-history-loaded
-;;     (load (expand-file-name
-;; 	   ;; fns-XX.YY.ZZ.el does not work on DOS filesystem.
-;; 	   (if (eq system-type 'ms-dos)
-;; 	       "fns.el"
-;; 	     (format "fns-%s.el" emacs-version))
-;; 	   exec-directory)
-;; 	  ;; The file name fns-%s.el already has a .el extension.
-;; 	  nil nil t)
-;;     (setq symbol-file-load-history-loaded t)))
-
 (defun symbol-file (symbol &optional type)
   "Return the name of the file that defined SYMBOL.
 The value is normally an absolute file name.  It can also be nil,
@@ -2458,7 +2441,7 @@
  `yank-rectangle', PARAM may be a list of strings to insert as a
  rectangle.
 If NOEXCLUDE is present and non-nil, the normal removal of the
- yank-excluded-properties is not performed; instead FUNCTION is
+ `yank-excluded-properties' is not performed; instead FUNCTION is
  responsible for removing those properties.  This may be necessary
  if FUNCTION adjusts point before or after inserting the object.
 If UNDO is present and non-nil, it is a function that will be called
@@ -2816,7 +2799,7 @@
   (let ((err (make-symbol "err")))
     `(condition-case-no-debug ,err
          (progn ,@body)
-       (error (message "Error: %s" ,err) nil))))
+       (error (message "Error: %S" ,err) nil))))
 
 (defmacro combine-after-change-calls (&rest body)
   "Execute BODY, but don't call the after-change functions till the end.
@@ -3818,9 +3801,9 @@
 
 ;; The following statement ought to be in print.c, but `provide' can't
 ;; be used there.
+;; http://lists.gnu.org/archive/html/emacs-devel/2009-08/msg00236.html
 (when (hash-table-p (car (read-from-string
 			  (prin1-to-string (make-hash-table)))))
   (provide 'hashtable-print-readable))
 
-;; arch-tag: f7e0e6e5-70aa-4897-ae72-7a3511ec40bc
 ;;; subr.el ends here
--- a/lisp/term/common-win.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/term/common-win.el	Thu Dec 16 18:30:57 2010 -0500
@@ -125,9 +125,9 @@
 ;;;	       (cons (logior (lsh 0 16)   9) 'ns-insert-working-text)
 ;;;	       (cons (logior (lsh 0 16)  10) 'ns-delete-working-text)
 	       (cons (logior (lsh 0 16)  11) 'ns-spi-service-call)
-;;;	       (cons (logior (lsh 0 16)  12) 'ns-new-frame)
+	       (cons (logior (lsh 0 16)  12) 'ns-new-frame)
 	       (cons (logior (lsh 0 16)  13) 'ns-toggle-toolbar)
-;;;	       (cons (logior (lsh 0 16)  14) 'ns-show-prefs)
+	       (cons (logior (lsh 0 16)  14) 'ns-show-prefs)
 	       ))))
     (set-terminal-parameter frame 'x-setup-function-keys t)))
 
--- a/lisp/term/ns-win.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/term/ns-win.el	Thu Dec 16 18:30:57 2010 -0500
@@ -171,7 +171,9 @@
 (define-key global-map [ns-change-font] 'ns-respond-to-change-font)
 (define-key global-map [ns-open-file-line] 'ns-open-file-select-line)
 (define-key global-map [ns-spi-service-call] 'ns-spi-service-call)
+(define-key global-map [ns-new-frame] 'make-frame)
 (define-key global-map [ns-toggle-toolbar] 'ns-toggle-toolbar)
+(define-key global-map [ns-show-prefs] 'customize)
 
 
 ;; Set up a number of aliases and other layers to pretend we're using
--- a/lisp/term/pc-win.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/term/pc-win.el	Thu Dec 16 18:30:57 2010 -0500
@@ -288,6 +288,16 @@
   (if (x-selection-owner-p selection)
       t))
 
+;; x-get-selection-internal is used in select.el
+(defun x-get-selection-internal (selection type &optional time_stamp)
+  "Return text selected from some X window.
+SELECTION is a symbol, typically `PRIMARY', `SECONDARY', or `CLIPBOARD'.
+\(Those are literal upper-case symbol names, since that's what X expects.)
+TYPE is the type of data desired, typically `STRING'.
+TIME_STAMP is the time to use in the XConvertSelection call for foreign
+selections.  If omitted, defaults to the time for the last event."
+  (x-get-selection-value))
+
 ;; From src/fontset.c:
 (fset 'query-fontset 'ignore)
 
--- a/lisp/textmodes/sgml-mode.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/textmodes/sgml-mode.el	Thu Dec 16 18:30:57 2010 -0500
@@ -384,6 +384,9 @@
   (save-excursion
     (goto-char (point-min))
     (or (string= "xml" (file-name-extension (or buffer-file-name "")))
+        ;; Maybe the buffer-size check isn't needed, I don't know.
+        (and (zerop (buffer-size))
+             (string= "xhtml" (file-name-extension (or buffer-file-name ""))))
 	(looking-at "\\s-*<\\?xml")
 	(when (re-search-forward
 	       (eval-when-compile
@@ -2153,5 +2156,4 @@
 
 (provide 'sgml-mode)
 
-;; arch-tag: 9675da94-b7f9-4bda-ad19-73ed7b4fb401
 ;;; sgml-mode.el ends here
--- a/lisp/textmodes/texinfo.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/textmodes/texinfo.el	Thu Dec 16 18:30:57 2010 -0500
@@ -443,7 +443,9 @@
     (define-key map "\C-c\C-s"     'texinfo-show-structure)
 
     (define-key map "\C-c}"          'up-list)
+    ;; FIXME: This is often used for "close block" aka texinfo-insert-@end.
     (define-key map "\C-c]"          'up-list)
+    (define-key map "\C-c/"	     'texinfo-insert-@end)
     (define-key map "\C-c{"		'texinfo-insert-braces)
 
     ;; bindings for inserting strings
@@ -583,11 +585,8 @@
 	(concat "\b\\|@[a-zA-Z]*[ \n]\\|" paragraph-separate))
   (make-local-variable 'paragraph-start)
   (setq paragraph-start (concat "\b\\|@[a-zA-Z]*[ \n]\\|" paragraph-start))
-  (make-local-variable 'sentence-end-base)
-  (setq sentence-end-base
+  (set (make-local-variable 'sentence-end-base)
 	"\\(@\\(end\\)?dots{}\\|[.?!]\\)[]\"'”)}]*")
-  (make-local-variable 'adaptive-fill-mode)
-  (setq adaptive-fill-mode nil)
   (make-local-variable 'fill-column)
   (setq fill-column 70)
   (make-local-variable 'comment-start)
@@ -646,7 +645,13 @@
 	(completing-read (format "Block name [%s]: " texinfo-block-default)
 			 texinfo-environments
 			 nil nil nil nil texinfo-block-default))
-  \n "@" str \n _ \n "@end " str \n)
+  \n "@" str
+  ;; Blocks that take parameters: all the def* blocks take parameters,
+  ;;  plus a few others.
+  (if (or (string-match "\\`def" str)
+          (member str '("table" "ftable" "vtable")))
+      '(nil " " -))
+  \n _ \n "@end " str \n)
 
 (defun texinfo-inside-macro-p (macro &optional bound)
   "Non-nil if inside a macro matching the regexp MACRO."
@@ -717,163 +722,131 @@
 		(not (looking-at "@end"))))
     (texinfo-next-unmatched-end)))
 
-(defun texinfo-insert-@end ()
+(define-skeleton texinfo-insert-@end
   "Insert the matching `@end' for the last Texinfo command that needs one."
-  (interactive)
-  (let ((string
 	 (ignore-errors
 	   (save-excursion
+      (backward-word 1)
 	     (texinfo-last-unended-begin)
-	     (match-string 1)))))
-    (insert "@end ")
-    (if string (insert string "\n"))))
-
-;; The following insert commands accept a prefix arg N, which is the
-;; number of words (actually s-exprs) that should be surrounded by
-;; braces.  Thus you can first paste a variable name into a .texinfo
-;; buffer, then say C-u 1 C-c C-c v at the beginning of the just
-;; pasted variable name to put @var{...} *around* the variable name.
-;; Operate on previous word or words with negative arg.
+      (or (match-string 1) '-)))
+  \n "@end " str \n)
 
-;; These commands use texinfo-insert-@-with-arg
-(defun texinfo-insert-@-with-arg (string &optional arg)
-  (if arg
-      (progn
-        (setq arg (prefix-numeric-value arg))
-        (if (< arg 0)
-            (progn
-              (skip-chars-backward " \t\n\r\f")
-              (save-excursion
-                (forward-sexp arg)
-                (insert "@" string "{"))
-              (insert "}"))
-          (skip-chars-forward " \t\n\r\f")
-          (insert "@" string "{")
-          (forward-sexp arg)
-          (insert "}")))
-    (insert "@" string "{}")
-    (backward-char)))
-
-(defun texinfo-insert-braces ()
+(define-skeleton texinfo-insert-braces
   "Make a pair of braces and be poised to type inside of them.
 Use \\[up-list] to move forward out of the braces."
-  (interactive)
-  (insert "{}")
-  (backward-char))
+  nil
+  "{" _ "}")
 
-(defun texinfo-insert-@code (&optional arg)
+(define-skeleton texinfo-insert-@code
   "Insert a `@code{...}' command in a Texinfo buffer.
 A numeric argument says how many words the braces should surround.
 The default is not to surround any existing words with the braces."
-  (interactive "P")
-  (texinfo-insert-@-with-arg "code" arg))
+  nil
+  "@code{" _ "}")
 
-(defun texinfo-insert-@dfn (&optional arg)
+(define-skeleton texinfo-insert-@dfn
   "Insert a `@dfn{...}' command in a Texinfo buffer.
 A numeric argument says how many words the braces should surround.
 The default is not to surround any existing words with the braces."
-  (interactive "P")
-  (texinfo-insert-@-with-arg "dfn" arg))
+  nil
+  "@dfn{" _ "}")
 
-(defun texinfo-insert-@email (&optional arg)
+(define-skeleton texinfo-insert-@email
   "Insert a `@email{...}' command in a Texinfo buffer.
 A numeric argument says how many words the braces should surround.
 The default is not to surround any existing words with the braces."
-  (interactive "P")
-  (texinfo-insert-@-with-arg "email" arg))
+  nil
+  "@email{" _ "}")
 
-(defun texinfo-insert-@emph (&optional arg)
+(define-skeleton texinfo-insert-@emph
   "Insert a `@emph{...}' command in a Texinfo buffer.
 A numeric argument says how many words the braces should surround.
 The default is not to surround any existing words with the braces."
-  (interactive "P")
-  (texinfo-insert-@-with-arg "emph" arg))
+  nil
+  "@emph{" _ "}")
 
-(defun texinfo-insert-@example ()
+(define-skeleton texinfo-insert-@example
   "Insert the string `@example' in a Texinfo buffer."
-  (interactive)
-  (insert "@example\n"))
+  nil
+  \n "@example" \n)
 
-(defun texinfo-insert-@file (&optional arg)
+(define-skeleton texinfo-insert-@file
   "Insert a `@file{...}' command in a Texinfo buffer.
 A numeric argument says how many words the braces should surround.
 The default is not to surround any existing words with the braces."
-  (interactive "P")
-  (texinfo-insert-@-with-arg "file" arg))
+  nil
+  "@file{" _ "}")
 
-(defun texinfo-insert-@item ()
+(define-skeleton texinfo-insert-@item
   "Insert the string `@item' in a Texinfo buffer.
 If in a table defined by @table, follow said string with a space.
 Otherwise, follow with a newline."
-  (interactive)
-  (insert "@item"
+  nil
+  \n "@item"
 	  (if (equal (ignore-errors
 		      (save-excursion
 			(texinfo-last-unended-begin)
 			(match-string 1)))
 		     "table")
-	      ?\s
-	    ?\n)))
+      " " '\n)
+  _ \n)
 
-(defun texinfo-insert-@kbd (&optional arg)
+(define-skeleton texinfo-insert-@kbd
   "Insert a `@kbd{...}' command in a Texinfo buffer.
 A numeric argument says how many words the braces should surround.
 The default is not to surround any existing words with the braces."
-  (interactive "P")
-  (texinfo-insert-@-with-arg "kbd" arg))
+  nil
+  "@kbd{" _ "}")
 
-(defun texinfo-insert-@node ()
+(define-skeleton texinfo-insert-@node
   "Insert the string `@node' in a Texinfo buffer.
 Insert a comment on the following line indicating the order of
 arguments to @node.  Insert a carriage return after the comment line.
 Leave point after `@node'."
-  (interactive)
-  (insert "@node \n@comment  node-name,  next,  previous,  up\n")
-  (forward-line -2)
-  (forward-char 6))
+  nil
+  \n "@node " _ \n)
 
-(defun texinfo-insert-@noindent ()
+(define-skeleton texinfo-insert-@noindent
   "Insert the string `@noindent' in a Texinfo buffer."
-  (interactive)
-  (insert "@noindent\n"))
+  nil
+  \n "@noindent" \n)
 
-(defun texinfo-insert-@quotation ()
+(define-skeleton texinfo-insert-@quotation
   "Insert the string `@quotation' in a Texinfo buffer."
-  (interactive)
-  (insert "@quotation\n"))
+  \n "@quotation" \n)
 
-(defun texinfo-insert-@samp (&optional arg)
+(define-skeleton texinfo-insert-@samp
   "Insert a `@samp{...}' command in a Texinfo buffer.
 A numeric argument says how many words the braces should surround.
 The default is not to surround any existing words with the braces."
-  (interactive "P")
-  (texinfo-insert-@-with-arg "samp" arg))
+  nil
+  "@samp{" _ "}")
 
-(defun texinfo-insert-@strong (&optional arg)
+(define-skeleton texinfo-insert-@strong
   "Insert a `@strong{...}' command in a Texinfo buffer.
 A numeric argument says how many words the braces should surround.
 The default is not to surround any existing words with the braces."
-  (interactive "P")
-  (texinfo-insert-@-with-arg "strong" arg))
+  nil
+  "@strong{" _ "}")
 
-(defun texinfo-insert-@table ()
+(define-skeleton texinfo-insert-@table
   "Insert the string `@table' in a Texinfo buffer."
-  (interactive)
-  (insert "@table "))
+  nil
+  \n "@table " _ \n)
 
-(defun texinfo-insert-@var (&optional arg)
+(define-skeleton texinfo-insert-@var
   "Insert a `@var{}' command in a Texinfo buffer.
 A numeric argument says how many words the braces should surround.
 The default is not to surround any existing words with the braces."
-  (interactive "P")
-  (texinfo-insert-@-with-arg "var" arg))
+  nil
+  "@var{" _ "}")
 
-(defun texinfo-insert-@uref (&optional arg)
+(define-skeleton texinfo-insert-@uref
   "Insert a `@uref{}' command in a Texinfo buffer.
 A numeric argument says how many words the braces should surround.
 The default is not to surround any existing words with the braces."
-  (interactive "P")
-  (texinfo-insert-@-with-arg "uref" arg))
+  nil
+  "@uref{" _ "}")
 (defalias 'texinfo-insert-@url 'texinfo-insert-@uref)
 
 ;;; Texinfo file structure
--- a/lisp/url/ChangeLog	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/url/ChangeLog	Thu Dec 16 18:30:57 2010 -0500
@@ -1,3 +1,20 @@
+2010-12-16  Miles Bader  <Miles Bader <miles@gnu.org>>
+
+	* url-cookie.el: Require 'cl when compiling -- it's necessary for
+	defstruct.
+
+2010-12-14  Glenn Morris  <rgm@gnu.org>
+
+	* url-cookie.el: Don't require cl when compiling.
+	(url-cookie-clean-up, url-cookie-generate-header-lines): Use dolist.
+	(url-cookie-parse-file, url-cookie-store, url-cookie-retrieve)
+	(url-cookie-handle-set-cookie): Simplify.
+
+2010-12-13  Chong Yidong  <cyd@stupidchicken.com>
+
+	* url-cookie.el (url-cookie-retrieve): Handle null LOCALPART.
+	Suggested by Lennart Borgman (Bug#7543).
+
 2010-11-16  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
 	* url-file.el (url-file-build-filename): Avoid interpreting
@@ -14,8 +31,8 @@
 
 2010-10-04  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
-	* url-http.el (url-http-wait-for-headers-change-function): Protect
-	against url-http-response-status for degenerate documents.
+	* url-http.el (url-http-wait-for-headers-change-function):
+	Protect against url-http-response-status for degenerate documents.
 	(url-http-wait-for-headers-change-function): Revert previous
 	change.  It lead to really slow loads.
 
@@ -31,7 +48,7 @@
 
 2010-10-03  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
-	* url-vars.el (url-mime-charset-string): Changed the default to
+	* url-vars.el (url-mime-charset-string): Change the default to
 	nil to avoid sending 1171 bytes of not very useful data to the
 	HTTP server every request.
 
@@ -119,8 +136,8 @@
 2010-07-01  Mark A. Hershberger  <mah@everybody.org>
 
 	* url-http.el (url-http-create-request): Add a CRLF on the end so
-	that POSTs with content to https urls work.  See
-	<https://bugs.launchpad.net/mediawiki-el/+bug/540759>
+	that POSTs with content to https urls work.
+	See <https://bugs.launchpad.net/mediawiki-el/+bug/540759>
 
 2010-06-22  Mark A. Hershberger  <mah@everybody.org>
 
@@ -602,8 +619,8 @@
 	* url-http.el (url-http-proxy): New variable.
 	(url-http-create-request): Use it.  Don't use `url-proxy-object'.
 	(url-http): Treat `url' argument as resource to download, and
-	dynamic variable `url-using-proxy' as proxy to use.  Set
-	`url-current-object' to actual URL, and `url-http-proxy' to proxy
+	dynamic variable `url-using-proxy' as proxy to use.
+	Set `url-current-object' to actual URL, and `url-http-proxy' to proxy
 	used.
 	(url-http-handle-cookies): Assume that `url-current-object' does
 	not point to the proxy used.
@@ -619,24 +636,24 @@
 	(url-proxy): Bind it instead of `proxy-object'.
 
 	* url-http.el (url-http-create-request): Remove url argument, use
-	the buffer-local variable `url-http-target-url' instead.  Both
-	callers updated.  Simplify proxy handling.
+	the buffer-local variable `url-http-target-url' instead.
+	Both callers updated.  Simplify proxy handling.
 	(url-http): Don't make proxy-object buffer local.
 
 	* url.el (url-retrieve-internal): Bind url-proxy-object to nil.
 
 2006-11-26  Magnus Henoch  <mange@freemail.hu>
 
-	* url-http.el (url-http-wait-for-headers-change-function): Use
-	`when' instead of `if' when possible.
+	* url-http.el (url-http-wait-for-headers-change-function):
+	Use `when' instead of `if' when possible.
 	(url-http): Define url-http-response-version.
 	(url-http-parse-response): Set it.
 	(url-http-parse-headers): Use it to determine keep-alive behavior.
 
 2006-11-23  Diane Murray  <disumu@x3y2z1.net>  (tiny change)
 
-	* url-http.el (url-http-content-length-after-change-function): Use
-	`url-lazy-message'.
+	* url-http.el (url-http-content-length-after-change-function):
+	Use `url-lazy-message'.
 
 	* url-util.el (url-display-percentage): Only show a message if
 	`url-show-status' is non-nil.
@@ -1018,8 +1035,8 @@
 	(url-cookie-generate-header-lines): Likewise.
 	(url-cookie-handle-set-cookie): Likewise.
 	(url-cookie-create): Expect :localpart instead of :path.
-	(url-cookie-localpart): Renamed from url-cookie-path.
-	(url-cookie-set-localpart): Renamed from url-cookie-set-path.
+	(url-cookie-localpart): Rename from url-cookie-path.
+	(url-cookie-set-localpart): Rename from url-cookie-set-path.
 	(url-cookie-file): Doc fix.
 	(url-cookie-p): Add doc string.
 
@@ -2236,7 +2253,7 @@
 	message when we have to contact a host so the user always gets
 	at least some feedback.
 
-	* lisp/url-expand.el (url-expander-remove-relative-links): Moved and
+	* lisp/url-expand.el (url-expander-remove-relative-links): Move and
 	renamed function.
 	(url-default-expander): Use it.
 
@@ -2358,11 +2375,10 @@
 
 ;; Local variables:
 ;; coding: utf-8
-;; add-log-time-zone-rule: t
 ;; End:
 
-    Copyright (C) 1999, 2001, 2002, 2004, 2005,
-	2006, 2007, 2008, 2009, 2010  Free Software Foundation, Inc.
+  Copyright (C) 1999, 2001, 2002, 2004, 2005, 2006, 2007, 2008, 2009,
+    2010  Free Software Foundation, Inc.
 
   This file is part of GNU Emacs.
 
@@ -2379,4 +2395,3 @@
   You should have received a copy of the GNU General Public License
   along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
 
-;; arch-tag: ac117078-3091-4533-be93-098162ac2926
--- a/lisp/url/url-cookie.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/url/url-cookie.el	Thu Dec 16 18:30:57 2010 -0500
@@ -1,4 +1,4 @@
-;;; url-cookie.el --- Netscape Cookie support
+;;; url-cookie.el --- URL cookie support
 
 ;; Copyright (C) 1996, 1997, 1998, 1999, 2004, 2005, 2006, 2007, 2008,
 ;;   2009, 2010  Free Software Foundation, Inc.
@@ -26,10 +26,8 @@
 
 (require 'url-util)
 (require 'url-parse)
-(eval-when-compile (require 'cl))
 
-;; See http://home.netscape.com/newsref/std/cookie_spec.html for the
-;; 'open standard' defining this crap.
+(eval-when-compile (require 'cl))	; defstruct
 
 (defgroup url-cookie nil
   "URL cookies."
@@ -76,41 +74,23 @@
   "Whether the cookies list has changed since the last save operation.")
 
 (defun url-cookie-parse-file (&optional fname)
-  (setq fname (or fname url-cookie-file))
-  (condition-case ()
-      (load fname nil t)
-    (error
-     ;; It's completely normal for the cookies file not to exist yet.
-     ;; (message "Could not load cookie file %s" fname)
-     )))
+  "Load FNAME, default `url-cookie-file'."
+  ;; It's completely normal for the cookies file not to exist yet.
+  (load (or fname url-cookie-file) t t))
 
 (declare-function url-cookie-p "url-cookie" t t) ; defstruct
 
 (defun url-cookie-clean-up (&optional secure)
-  (let* (
-	 (var (if secure 'url-cookie-secure-storage 'url-cookie-storage))
-	 (val (symbol-value var))
-	 (cur nil)
-	 (new nil)
-	 (cookies nil)
-	 (cur-cookie nil)
-	 (new-cookies nil)
-	 )
-    (while val
-      (setq cur (car val)
-	    val (cdr val)
-	    new-cookies nil
-	    cookies (cdr cur))
-      (while cookies
-	(setq cur-cookie (car cookies)
-	      cookies (cdr cookies))
-	(if (or (not (url-cookie-p cur-cookie))
-		(url-cookie-expired-p cur-cookie)
-		(null (url-cookie-expires cur-cookie)))
-	    nil
-	  (setq new-cookies (cons cur-cookie new-cookies))))
-      (if (not new-cookies)
-	  nil
+  (let ((var (if secure 'url-cookie-secure-storage 'url-cookie-storage))
+	new new-cookies)
+    (dolist (cur (symbol-value var))
+      (setq new-cookies nil)
+      (dolist (cur-cookie (cdr cur))
+	(or (not (url-cookie-p cur-cookie))
+	    (url-cookie-expired-p cur-cookie)
+	    (null (url-cookie-expires cur-cookie))
+	    (setq new-cookies (cons cur-cookie new-cookies))))
+      (when new-cookies
 	(setcdr cur new-cookies)
 	(setq new (cons cur new))))
     (set var new)))
@@ -143,54 +123,42 @@
     (setq url-cookies-changed-since-last-save nil))))
 
 (defun url-cookie-store (name value &optional expires domain localpart secure)
-  "Store a netscape-style cookie."
-  (let* ((storage (if secure url-cookie-secure-storage url-cookie-storage))
-	 (tmp storage)
-	 (cur nil)
-	 (found-domain nil))
-
-    ;; First, look for a matching domain
-    (setq found-domain (assoc domain storage))
-
-    (if found-domain
+  "Store a cookie."
+  (let ((storage (if secure url-cookie-secure-storage url-cookie-storage))
+	tmp found-domain)
+    ;; First, look for a matching domain.
+    (if (setq found-domain (assoc domain storage))
 	;; Need to either stick the new cookie in existing domain storage
 	;; or possibly replace an existing cookie if the names match.
-	(progn
-	  (setq storage (cdr found-domain)
-		tmp nil)
-	  (while storage
-	    (setq cur (car storage)
-		  storage (cdr storage))
-	    (if (and (equal localpart (url-cookie-localpart cur))
-		     (equal name (url-cookie-name cur)))
-		(progn
-		  (setf (url-cookie-expires cur) expires)
-		  (setf (url-cookie-value cur) value)
-		  (setq tmp t))))
-	  (if (not tmp)
-	      ;; New cookie
-	      (setcdr found-domain (cons
-				    (url-cookie-create :name name
-						       :value value
-						       :expires expires
-						       :domain domain
-						       :localpart localpart
-						       :secure secure)
-				    (cdr found-domain)))))
-      ;; Need to add a new top-level domain
+	(unless (dolist (cur (setq storage (cdr found-domain)) tmp)
+		  (and (equal localpart (url-cookie-localpart cur))
+		       (equal name (url-cookie-name cur))
+		       (progn
+			 (setf (url-cookie-expires cur) expires)
+			 (setf (url-cookie-value cur) value)
+			 (setq tmp t))))
+	  ;; New cookie.
+	  (setcdr found-domain (cons
+				(url-cookie-create :name name
+						   :value value
+						   :expires expires
+						   :domain domain
+						   :localpart localpart
+						   :secure secure)
+				(cdr found-domain))))
+      ;; Need to add a new top-level domain.
       (setq tmp (url-cookie-create :name name
 				   :value value
 				   :expires expires
 				   :domain domain
 				   :localpart localpart
 				   :secure secure))
-      (cond
-       (storage
-	(setcdr storage (cons (list domain tmp) (cdr storage))))
-       (secure
-	(setq url-cookie-secure-storage (list (list domain tmp))))
-       (t
-	(setq url-cookie-storage (list (list domain tmp))))))))
+      (cond (storage
+	     (setcdr storage (cons (list domain tmp) (cdr storage))))
+	    (secure
+	     (setq url-cookie-secure-storage (list (list domain tmp))))
+	    (t
+	     (setq url-cookie-storage (list (list domain tmp))))))))
 
 (defun url-cookie-expired-p (cookie)
   "Return non-nil if COOKIE is expired."
@@ -198,19 +166,14 @@
     (and exp (> (float-time) (float-time (date-to-time exp))))))
 
 (defun url-cookie-retrieve (host &optional localpart secure)
-  "Retrieve all the netscape-style cookies for a specified HOST and LOCALPART."
+  "Retrieve all cookies for a specified HOST and LOCALPART."
   (let ((storage (if secure
 		     (append url-cookie-secure-storage url-cookie-storage)
 		   url-cookie-storage))
 	(case-fold-search t)
-	(cookies nil)
-	(cur nil)
-	(retval nil)
-	(localpart-match nil))
-    (while storage
-      (setq cur (car storage)
-	    storage (cdr storage)
-	    cookies (cdr cur))
+	cookies retval localpart-match)
+    (dolist (cur storage)
+      (setq cookies (cdr cur))
       (if (and (car cur)
 	       (string-match
                 (concat "^.*"
@@ -222,35 +185,28 @@
                            (car cur)))
                         "$") host))
 	  ;; The domains match - a possible hit!
-	  (while cookies
-	    (setq cur (car cookies)
-		  cookies (cdr cookies)
-		  localpart-match (url-cookie-localpart cur))
-	    (if (and (if (stringp localpart-match)
-			 (string-match (concat "^" (regexp-quote
-						    localpart-match))
-				       localpart)
-		       (equal localpart localpart-match))
-		     (not (url-cookie-expired-p cur)))
-		(setq retval (cons cur retval))))))
+	  (dolist (cur cookies)
+	    (and (if (and (stringp
+			   (setq localpart-match (url-cookie-localpart cur)))
+			  (stringp localpart))
+		     (string-match (concat "^" (regexp-quote localpart-match))
+				   localpart)
+		   (equal localpart localpart-match))
+		 (not (url-cookie-expired-p cur))
+		 (setq retval (cons cur retval))))))
     retval))
 
 (defun url-cookie-generate-header-lines (host localpart secure)
-  (let* ((cookies (url-cookie-retrieve host localpart secure))
-	 (retval nil)
-	 (cur nil)
-	 (chunk nil))
-    ;; Have to sort this for sending most specific cookies first
+  (let ((cookies (url-cookie-retrieve host localpart secure))
+	retval chunk)
+    ;; Have to sort this for sending most specific cookies first.
     (setq cookies (and cookies
 		       (sort cookies
-			     (function
-			      (lambda (x y)
-				(> (length (url-cookie-localpart x))
-				   (length (url-cookie-localpart y))))))))
-    (while cookies
-      (setq cur (car cookies)
-	    cookies (cdr cookies)
-	    chunk (format "%s=%s" (url-cookie-name cur) (url-cookie-value cur))
+			     (lambda (x y)
+			       (> (length (url-cookie-localpart x))
+				  (length (url-cookie-localpart y)))))))
+    (dolist (cur cookies)
+      (setq chunk (format "%s=%s" (url-cookie-name cur) (url-cookie-value cur))
 	    retval (if (and url-cookie-multiple-line
 			    (< 80 (+ (length retval) (length chunk) 4)))
 		       (concat retval "\r\nCookie: " chunk)
@@ -320,40 +276,38 @@
 			(file-name-directory
 			 (url-filename url-current-object))))
 	 (rest nil))
-    (while args
-      (if (not (member (downcase (car (car args)))
-		       '("secure" "domain" "expires" "path")))
-	  (setq rest (cons (car args) rest)))
-      (setq args (cdr args)))
+    (dolist (this args)
+      (or (member (downcase (car this)) '("secure" "domain" "expires" "path"))
+	  (setq rest (cons this rest))))
 
     ;; Sometimes we get dates that the timezone package cannot handle very
     ;; gracefully - take care of this here, instead of in url-cookie-expired-p
     ;; to speed things up.
-    (if (and expires
-	     (string-match
-	      (concat "^[^,]+, +\\(..\\)-\\(...\\)-\\(..\\) +"
-		      "\\(..:..:..\\) +\\[*\\([^\]]+\\)\\]*$")
-	      expires))
-	(setq expires (concat (match-string 1 expires) " "
-			      (match-string 2 expires) " "
-			      (match-string 3 expires) " "
-			      (match-string 4 expires) " ["
-			      (match-string 5 expires) "]")))
+    (and expires
+	 (string-match
+	  (concat "^[^,]+, +\\(..\\)-\\(...\\)-\\(..\\) +"
+		  "\\(..:..:..\\) +\\[*\\([^\]]+\\)\\]*$")
+	  expires)
+	 (setq expires (concat (match-string 1 expires) " "
+			       (match-string 2 expires) " "
+			       (match-string 3 expires) " "
+			       (match-string 4 expires) " ["
+			       (match-string 5 expires) "]")))
 
     ;; This one is for older Emacs/XEmacs variants that don't
     ;; understand this format without tenths of a second in it.
     ;; Wednesday, 30-Dec-2037 16:00:00 GMT
     ;;       - vs -
     ;; Wednesday, 30-Dec-2037 16:00:00.00 GMT
-    (if (and expires
-	     (string-match
-	      "\\([0-9]+\\)-\\([A-Za-z]+\\)-\\([0-9]+\\)[ \t]+\\([0-9]+:[0-9]+:[0-9]+\\)\\(\\.[0-9]+\\)*[ \t]+\\([-+a-zA-Z0-9]+\\)"
-	      expires))
-	(setq expires (concat (match-string 1 expires) "-"	; day
-			      (match-string 2 expires) "-"	; month
-			      (match-string 3 expires) " "	; year
-			      (match-string 4 expires) ".00 " ; hour:minutes:seconds
-			      (match-string 6 expires)))) ":" ; timezone
+    (and expires
+	 (string-match
+	  "\\([0-9]+\\)-\\([A-Za-z]+\\)-\\([0-9]+\\)[ \t]+\\([0-9]+:[0-9]+:[0-9]+\\)\\(\\.[0-9]+\\)*[ \t]+\\([-+a-zA-Z0-9]+\\)"
+	  expires)
+	 (setq expires (concat (match-string 1 expires) "-"	; day
+			       (match-string 2 expires) "-"	; month
+			       (match-string 3 expires) " "	; year
+			       (match-string 4 expires) ".00 " ; hour:minutes:seconds
+			       (match-string 6 expires)))) ":" ; timezone
 
     (while (consp trusted)
       (if (string-match (car trusted) current-url)
@@ -363,42 +317,36 @@
       (if (string-match (car untrusted) current-url)
 	  (setq untrusted (- (match-end 0) (match-beginning 0)))
 	(pop untrusted)))
-    (if (and trusted untrusted)
-	;; Choose the more specific match
-	(if (> trusted untrusted)
-	    (setq untrusted nil)
-	  (setq trusted nil)))
+    (and trusted untrusted
+	 ;; Choose the more specific match.
+	 (set (if (> trusted untrusted) 'untrusted 'trusted) nil))
     (cond
      (untrusted
-      ;; The site was explicity marked as untrusted by the user
+      ;; The site was explicity marked as untrusted by the user.
       nil)
      ((or (eq url-privacy-level 'paranoid)
 	  (and (listp url-privacy-level) (memq 'cookies url-privacy-level)))
-      ;; user never wants cookies
+      ;; User never wants cookies.
       nil)
      ((and url-cookie-confirmation
 	   (not trusted)
 	   (save-window-excursion
 	     (with-output-to-temp-buffer "*Cookie Warning*"
 	       (mapcar
-		(function
-		 (lambda (x)
-		   (princ (format "%s - %s" (car x) (cdr x))))) rest))
+		(lambda (x)
+		  (princ (format "%s - %s" (car x) (cdr x)))) rest))
 	     (prog1
 		 (not (funcall url-confirmation-func
 			       (format "Allow %s to set these cookies? "
 				       (url-host url-current-object))))
 	       (if (get-buffer "*Cookie Warning*")
 		   (kill-buffer "*Cookie Warning*")))))
-      ;; user wants to be asked, and declined.
+      ;; User wants to be asked, and declined.
       nil)
      ((url-cookie-host-can-set-p (url-host url-current-object) domain)
-      ;; Cookie is accepted by the user, and passes our security checks
-      (let ((cur nil))
-	(while rest
-	  (setq cur (pop rest))
-	  (url-cookie-store (car cur) (cdr cur)
-			    expires domain localpart secure))))
+      ;; Cookie is accepted by the user, and passes our security checks.
+      (dolist (cur rest)
+	(url-cookie-store (car cur) (cdr cur) expires domain localpart secure)))
      (t
       (url-lazy-message "%s tried to set a cookie for domain %s - rejected."
 			(url-host url-current-object) domain)))))
@@ -429,5 +377,4 @@
 
 (provide 'url-cookie)
 
-;; arch-tag: 2568751b-6452-4398-aa2d-303edadb54d7
 ;;; url-cookie.el ends here
--- a/lisp/vc/cvs-status.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/vc/cvs-status.el	Thu Dec 16 18:30:57 2010 -0500
@@ -223,7 +223,6 @@
   (let* ((eol (save-excursion (end-of-line) (current-column)))
 	 (column (max (+ eol 2) column)))
     (if (null tags) column
-      ;;(move-to-column-force column)
       (let* ((rev (cvs-car tags))
 	     (name (funcall printer (cvs-car rev)))
 	     (rest (append (cvs-cdr name) (cvs-cdr tags)))
--- a/lisp/vc/diff-mode.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/vc/diff-mode.el	Thu Dec 16 18:30:57 2010 -0500
@@ -1829,10 +1829,13 @@
   (eval-and-compile (require 'smerge-mode))
   (save-excursion
     (diff-beginning-of-hunk 'try-harder)
-    (let* ((style (diff-hunk-style))    ;Skips the hunk header as well.
+    (let* ((start (point))
+           (style (diff-hunk-style))    ;Skips the hunk header as well.
            (beg (point))
            (props '((diff-mode . fine) (face diff-refine-change)))
-           (end (progn (diff-end-of-hunk) (point))))
+           ;; Be careful to go back to `start' so diff-end-of-hunk gets
+           ;; to read the hunk header's line info.
+           (end (progn (goto-char start) (diff-end-of-hunk) (point))))
 
       (remove-overlays beg end 'diff-mode 'fine)
 
--- a/lisp/vc/diff.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/vc/diff.el	Thu Dec 16 18:30:57 2010 -0500
@@ -31,6 +31,8 @@
 
 ;;; Code:
 
+(eval-when-compile (require 'cl))
+
 (defgroup diff nil
   "Comparing files with `diff'."
   :group 'tools)
@@ -47,11 +49,6 @@
   :type 'string
   :group 'diff)
 
-(defvar diff-old-temp-file nil
-  "This is the name of a temp file to be deleted after diff finishes.")
-(defvar diff-new-temp-file nil
-  "This is the name of a temp file to be deleted after diff finishes.")
-
 ;; prompt if prefix arg present
 (defun diff-switches ()
   (if current-prefix-arg
@@ -60,12 +57,12 @@
 		       diff-switches
 		     (mapconcat 'identity diff-switches " ")))))
 
-(defun diff-sentinel (code)
+(defun diff-sentinel (code &optional old-temp-file new-temp-file)
   "Code run when the diff process exits.
 CODE is the exit code of the process.  It should be 0 only if no diffs
 were found."
-  (if diff-old-temp-file (delete-file diff-old-temp-file))
-  (if diff-new-temp-file (delete-file diff-new-temp-file))
+  (if old-temp-file (delete-file old-temp-file))
+  (if new-temp-file (delete-file new-temp-file))
   (save-excursion
     (goto-char (point-max))
     (let ((inhibit-read-only t))
@@ -75,10 +72,6 @@
 			    (t ""))
 		      (current-time-string))))))
 
-(defvar diff-old-file nil)
-(defvar diff-new-file nil)
-(defvar diff-extra-args nil)
-
 ;;;###autoload
 (defun diff (old new &optional switches no-async)
   "Find and display the differences between OLD and NEW files.
@@ -91,16 +84,14 @@
 interactively for diff switches.  Otherwise, the switches
 specified in `diff-switches' are passed to the diff command."
   (interactive
-   (let (oldf newf)
-     (setq newf (buffer-file-name)
-	   newf (if (and newf (file-exists-p newf))
+   (let* ((newf (if (and buffer-file-name (file-exists-p buffer-file-name))
 		    (read-file-name
 		     (concat "Diff new file (default "
-			     (file-name-nondirectory newf) "): ")
-		     nil newf t)
+			     (file-name-nondirectory buffer-file-name) "): ")
+		     nil buffer-file-name t)
 		  (read-file-name "Diff new file: " nil nil t)))
-     (setq oldf (file-newest-backup newf)
-	   oldf (if (and oldf (file-exists-p oldf))
+          (oldf (file-newest-backup newf)))
+     (setq oldf (if (and oldf (file-exists-p oldf))
 		    (read-file-name
 		     (concat "Diff original file (default "
 			     (file-name-nondirectory oldf) "): ")
@@ -108,63 +99,82 @@
 		  (read-file-name "Diff original file: "
 				  (file-name-directory newf) nil t)))
      (list oldf newf (diff-switches))))
-  (diff-into-buffer nil old new switches no-async))
+  (display-buffer
+   (diff-no-select old new switches no-async)))
+
+(defun diff-file-local-copy (file-or-buf)
+  (if (bufferp file-or-buf)
+      (with-current-buffer file-or-buf
+        (let ((tempfile (make-temp-file "buffer-content-")))
+          (write-region nil nil tempfile nil 'nomessage)
+          tempfile))
+    (file-local-copy file-or-buf)))
 
-(defun diff-into-buffer (buf old new &optional switches no-async)
-  ;; Noninteractive helper for creating and reverting diff buffers.
-  (setq new (expand-file-name new)
-	old (expand-file-name old))
+(defun diff-better-file-name (file)
+  (if (bufferp file) file
+    (let ((rel (file-relative-name file))
+          (abbr (abbreviate-file-name (expand-file-name file))))
+      (if (< (length abbr) (length rel))
+          abbr
+        rel))))
+
+(defun diff-no-select (old new &optional switches no-async buf)
+  ;; Noninteractive helper for creating and reverting diff buffers
+  (setq new (diff-better-file-name new)
+	old (diff-better-file-name old))
   (or switches (setq switches diff-switches)) ; If not specified, use default.
+  (unless (listp switches) (setq switches (list switches)))
   (or buf (setq buf (get-buffer-create "*Diff*")))
-  (let* ((old-alt (file-local-copy old))
-	 (new-alt (file-local-copy new))
+  (let* ((old-alt (diff-file-local-copy old))
+	 (new-alt (diff-file-local-copy new))
 	 (command
 	  (mapconcat 'identity
 		     `(,diff-command
 		       ;; Use explicitly specified switches
-		       ,@(if (listp switches) switches (list switches))
-		       ,@(if (or old-alt new-alt)
-			     (list "-L" old "-L" new))
-		       ,(shell-quote-argument (or old-alt old))
-		       ,(shell-quote-argument (or new-alt new)))
+		       ,@switches
+                       ,@(mapcar #'shell-quote-argument
+                                 (nconc
+                                  (when (or old-alt new-alt)
+                                    (list "-L" (if (stringp old)
+                                                   old (prin1-to-string old))
+                                          "-L" (if (stringp new)
+                                                   new (prin1-to-string new))))
+                                  (list (or old-alt old)
+                                        (or new-alt new)))))
 		     " "))
-	 (thisdir default-directory)
-	 proc)
-    (save-excursion
-      (display-buffer buf)
-      (set-buffer buf)
-      (setq buffer-read-only nil)
+	 (thisdir default-directory))
+    (with-current-buffer buf
+      (setq buffer-read-only t)
       (buffer-disable-undo (current-buffer))
       (let ((inhibit-read-only t))
 	(erase-buffer))
       (buffer-enable-undo (current-buffer))
       (diff-mode)
-      ;; Use below 2 vars for backward-compatibility.
-      (set (make-local-variable 'diff-old-file) old)
-      (set (make-local-variable 'diff-new-file) new)
-      (set (make-local-variable 'diff-extra-args) (list switches no-async))
       (set (make-local-variable 'revert-buffer-function)
-	   (lambda (ignore-auto noconfirm)
-             (apply 'diff diff-old-file diff-new-file diff-extra-args)))
-      (set (make-local-variable 'diff-old-temp-file) old-alt)
-      (set (make-local-variable 'diff-new-temp-file) new-alt)
+           (lexical-let ((old old) (new new)
+                         (switches switches)
+                         (no-async no-async))
+             (lambda (ignore-auto noconfirm)
+               (diff-no-select old new switches no-async (current-buffer)))))
       (setq default-directory thisdir)
       (let ((inhibit-read-only t))
 	(insert command "\n"))
       (if (and (not no-async) (fboundp 'start-process))
-	  (progn
-	    (setq proc (start-process "Diff" buf shell-file-name
-				      shell-command-switch command))
+	  (let ((proc (start-process "Diff" buf shell-file-name
+                                     shell-command-switch command)))
 	    (set-process-filter proc 'diff-process-filter)
-	    (set-process-sentinel
-	     proc (lambda (proc msg)
-		    (with-current-buffer (process-buffer proc)
-		      (diff-sentinel (process-exit-status proc))))))
+            (lexical-let ((old-alt old-alt) (new-alt new-alt))
+              (set-process-sentinel
+               proc (lambda (proc msg)
+                      (with-current-buffer (process-buffer proc)
+                        (diff-sentinel (process-exit-status proc)
+                                       old-alt new-alt))))))
 	;; Async processes aren't available.
 	(let ((inhibit-read-only t))
 	  (diff-sentinel
 	   (call-process shell-file-name nil buf nil
-			 shell-command-switch command)))))
+			 shell-command-switch command)
+           old-alt new-alt))))
     buf))
 
 (defun diff-process-filter (proc string)
@@ -203,7 +213,14 @@
 	(funcall handler 'diff-latest-backup-file fn)
       (file-newest-backup fn))))
 
+;;;###autoload
+(defun diff-buffer-with-file (&optional buffer)
+  "View the differences between BUFFER and its associated file.
+This requires the external program `diff' to be in your `exec-path'."
+  (interactive "bBuffer: ")
+  (with-current-buffer (get-buffer (or buffer (current-buffer)))
+    (diff buffer-file-name (current-buffer) nil 'noasync)))
+
 (provide 'diff)
 
-;; arch-tag: 7de2c29b-7ea5-4b85-9b9d-72dd860de2bd
 ;;; diff.el ends here
--- a/lisp/vc/log-edit.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/vc/log-edit.el	Thu Dec 16 18:30:57 2010 -0500
@@ -350,17 +350,16 @@
 (defvar log-edit-font-lock-keywords
   ;; Copied/inspired by message-font-lock-keywords.
   `((log-edit-match-to-eoh
-     (,(concat "^\\(\\([a-z]+\\):\\)" log-edit-header-contents-regexp
-               "\\|\\(.*\\)")
+     (,(concat "^\\(\\([a-z]+\\):\\)" log-edit-header-contents-regexp)
       (progn (goto-char (match-beginning 0)) (match-end 0)) nil
       (1 (if (assoc (match-string 2) log-edit-headers-alist)
              'log-edit-header
            'log-edit-unknown-header)
          nil lax)
+      ;; From `log-edit-header-contents-regexp':
       (3 (or (cdr (assoc (match-string 2) log-edit-headers-alist))
              'log-edit-header)
-         nil lax)
-      (4 font-lock-warning-face)))))
+         nil lax)))))
 
 ;;;###autoload
 (defun log-edit (callback &optional setup params buffer mode &rest ignore)
@@ -775,7 +774,7 @@
 		(setq pattern (file-name-nondirectory file)))
 
             (setq pattern (concat "\\(^\\|[^[:alnum:]]\\)"
-                                  pattern
+                                  (regexp-quote pattern)
                                   "\\($\\|[^[:alnum:]]\\)"))
 
 	    (let (texts
--- a/lisp/vc/vc-bzr.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/vc/vc-bzr.el	Thu Dec 16 18:30:57 2010 -0500
@@ -1,13 +1,13 @@
 ;;; vc-bzr.el --- VC backend for the bzr revision control system
 
-;; Copyright (C) 2006, 2007, 2008, 2009, 2010  Free Software Foundation, Inc.
+;; Copyright (C) 2006, 2007, 2008, 2009, 2010
+;;   Free Software Foundation, Inc.
 
 ;; Author: Dave Love <fx@gnu.org>
 ;; 	   Riccardo Murri <riccardo.murri@gmail.com>
+;; Maintainer: FSF
 ;; Keywords: vc tools
 ;; Created: Sept 2006
-;; Version: 2008-01-04
-;; URL: http://launchpad.net/vc-bzr
 ;; Package: vc
 
 ;; This file is part of GNU Emacs.
@@ -27,11 +27,9 @@
 
 ;;; Commentary:
 
-;; See <URL:http://bazaar-vcs.org/> concerning bzr.  See
-;; <URL:http://launchpad.net/vc-bzr> for alternate development
-;; branches of `vc-bzr'.
+;; See <URL:http://bazaar.canonical.com/> concerning bzr.
 
-;; Load this library to register bzr support in VC.
+;; This library provides bzr support in VC.
 
 ;; Known bugs
 ;; ==========
@@ -42,9 +40,6 @@
 ;; (that is, the target contents) are changed.
 ;; See https://bugs.launchpad.net/vc-bzr/+bug/116607
 
-;; For an up-to-date list of bugs, please see:
-;;   https://bugs.launchpad.net/vc-bzr/+bugs
-
 ;;; Properties of the backend
 
 (defun vc-bzr-revision-granularity () 'repository)
@@ -104,6 +99,7 @@
 ;;;###autoload
 (defconst vc-bzr-admin-dirname ".bzr"
   "Name of the directory containing Bzr repository status files.")
+;; Used in the autoloaded vc-bzr-registered; see below.
 ;;;###autoload
 (defconst vc-bzr-admin-checkout-format-file
   (concat vc-bzr-admin-dirname "/checkout/format"))
@@ -115,6 +111,8 @@
   (concat vc-bzr-admin-dirname "/branch/revision-history"))
 (defconst vc-bzr-admin-lastrev
   (concat vc-bzr-admin-dirname "/branch/last-revision"))
+(defconst vc-bzr-admin-branchconf
+  (concat vc-bzr-admin-dirname "/branch/branch.conf"))
 
 ;;;###autoload (defun vc-bzr-registered (file)
 ;;;###autoload   (if (vc-find-root file vc-bzr-admin-checkout-format-file)
@@ -129,6 +127,13 @@
       (let ((root (vc-find-root file vc-bzr-admin-checkout-format-file)))
 	(when root (vc-file-setprop file 'bzr-root root)))))
 
+(defun vc-bzr--branch-conf (file)
+  "Return the Bzr branch config for file FILE, as a string."
+  (with-temp-buffer
+    (insert-file-contents
+     (expand-file-name vc-bzr-admin-branchconf (vc-bzr-root file)))
+    (buffer-string)))
+
 (require 'sha1)                         ;For sha1-program
 
 (defun vc-bzr-sha1 (file)
@@ -145,7 +150,7 @@
 
 (defun vc-bzr-state-heuristic (file)
   "Like `vc-bzr-state' but hopefully without running Bzr."
-  ;; `bzr status' was excrutiatingly slow with large histories and
+  ;; `bzr status' was excruciatingly slow with large histories and
   ;; pending merges, so try to avoid using it until they fix their
   ;; performance problems.
   ;; This function tries first to parse Bzr internal file
@@ -179,12 +184,16 @@
                                "\\([^\0]*\\)\0" ;"a/f/d", a=removed?
                                "\\([^\0]*\\)\0" ;sha1 (empty if conflicted)?
                                "\\([^\0]*\\)\0" ;size?p
-                               "[^\0]*\0"       ;"y/n", executable?
+                               ;; y/n.  Whether or not the current copy
+                               ;; was executable the last time bzr checked?
+                               "[^\0]*\0"
                                "[^\0]*\0"       ;?
                                "\\([^\0]*\\)\0" ;"a/f/d" a=added?
                                "\\([^\0]*\\)\0" ;sha1 again?
                                "\\([^\0]*\\)\0" ;size again?
-                               "[^\0]*\0" ;"y/n", executable again?
+                               ;; y/n.  Whether or not the repo thinks
+                               ;; the file should be executable?
+                               "\\([^\0]*\\)\0"
                                "[^\0]*\0" ;last revid?
                                ;; There are more fields when merges are pending.
                                )
@@ -198,8 +207,22 @@
                        ((eq (char-after (match-beginning 4)) ?a) 'added)
                        ((or (and (eq (string-to-number (match-string 3))
                                  (nth 7 (file-attributes file)))
-                             (equal (match-string 5)
-                                    (vc-bzr-sha1 file)))
+                                 (equal (match-string 5)
+                                        (vc-bzr-sha1 file))
+                                 ;; For a file, does the executable state match?
+                                 ;; (Bug#7544)
+                                 (or (not
+                                      (eq (char-after (match-beginning 1)) ?f))
+                                     (let ((exe
+                                            (memq
+                                             ?x
+                                             (mapcar
+                                              'identity
+                                              (nth 8 (file-attributes file))))))
+                                       (if (eq (char-after (match-beginning 7))
+                                               ?y)
+                                           exe
+                                         (not exe)))))
 			    (and
 			     ;; It looks like for lightweight
 			     ;; checkouts \2 is empty and we need to
@@ -228,6 +251,9 @@
   "added\\|ignored\\|kind changed\\|modified\\|removed\\|renamed\\|unknown"
   "Regexp matching file status words as reported in `bzr' output.")
 
+;; History of Bzr commands.
+(defvar vc-bzr-history nil)
+
 (defun vc-bzr-file-name-relative (filename)
   "Return file name FILENAME stripped of the initial Bzr repository path."
   (lexical-let*
@@ -236,6 +262,94 @@
     (when rootdir
          (file-relative-name filename* rootdir))))
 
+(defun vc-bzr-async-command (command args)
+  "Run Bzr COMMAND asynchronously with ARGS, displaying the result.
+Send the output to a buffer named \"*vc-bzr : NAME*\", where NAME
+is the root of the current Bzr branch.  Display the buffer in
+some window, but don't select it."
+  ;; TODO: set up hyperlinks.
+  (let* ((dir default-directory)
+	 (root (vc-bzr-root default-directory))
+	 (buffer (get-buffer-create
+		  (format "*vc-bzr : %s*"
+			  (expand-file-name root)))))
+    (with-current-buffer buffer
+      (setq default-directory root)
+      (goto-char (point-max))
+      (unless (eq (point) (point-min))
+	(insert "\n"))
+      (insert "Running \"" vc-bzr-program " " command)
+      (dolist (arg args)
+	(insert " " arg))
+      (insert "\"...\n")
+      ;; Run bzr in the original working directory.
+      (let ((default-directory dir))
+	(apply 'vc-bzr-command command t 'async nil args)))
+    (display-buffer buffer)))
+
+(defun vc-bzr-pull (prompt)
+  "Pull changes into the current Bzr branch.
+Normally, this runs \"bzr pull\".  However, if the branch is a
+bound branch, run \"bzr update\" instead.  If there is no default
+location from which to pull or update, or if PROMPT is non-nil,
+prompt for the Bzr command to run."
+  (let* ((vc-bzr-program vc-bzr-program)
+	 (branch-conf (vc-bzr--branch-conf default-directory))
+	 ;; Check whether the branch is bound.
+	 (bound (string-match "^bound\\s-*=\\s-*True" branch-conf))
+	 ;; If we need to do a "bzr pull", check for a parent.  If it
+	 ;; does not exist, bzr will need a pull location.
+	 (parent (unless bound
+		   (string-match
+		    "^parent_location\\s-*=\\s-*[^\n[:space:]]+"
+		    branch-conf)))
+	 (command (if bound "update" "pull"))
+	 args)
+    ;; If necessary, prompt for the exact command.
+    (when (or prompt (not (or bound parent)))
+      (setq args (split-string
+		  (read-shell-command
+		   "Run Bzr (like this): "
+		   (concat vc-bzr-program " " command)
+		   'vc-bzr-history)
+		  " " t))
+      (setq vc-bzr-program (car  args)
+	    command        (cadr args)
+	    args           (cddr args)))
+    (vc-bzr-async-command command args)))
+
+(defun vc-bzr-merge-branch ()
+  "Merge another Bzr branch into the current one.
+Prompt for the Bzr command to run, providing a pre-defined merge
+source (an upstream branch or a previous merge source) as a
+default if it is available."
+  (let* ((branch-conf (vc-bzr--branch-conf default-directory))
+	 ;; "bzr merge" without an argument defaults to submit_branch,
+	 ;; then parent_location.  We extract the specific location
+	 ;; and add it explicitly to the command line.
+	 (location
+	  (cond
+	   ((string-match
+	     "^submit_branch\\s-*=\\s-*\\(?:file://\\)?\\([^\n[:space:]]+\\)$"
+	     branch-conf)
+	    (match-string 1 branch-conf))
+	   ((string-match
+	     "^parent_location\\s-*=\\s-*\\(?:file://\\)?\\([^\n[:space:]]+\\)$"
+	     branch-conf)
+	    (match-string 1 branch-conf))))
+	 (cmd
+	  (split-string
+	   (read-shell-command
+	    "Run Bzr (like this): "
+	    (concat vc-bzr-program " merge --pull"
+		    (if location (concat " " location) ""))
+	    'vc-bzr-history)
+	   " " t))
+	 (vc-bzr-program (car  cmd))
+	 (command        (cadr cmd))
+	 (args           (cddr cmd)))
+    (vc-bzr-async-command command args)))
+
 (defun vc-bzr-status (file)
   "Return FILE status according to Bzr.
 Return value is a cons (STATUS . WARNING), where WARNING is a
@@ -423,7 +537,7 @@
     (error "Don't know how to compute the next revision of %s" rev)))
 
 (defun vc-bzr-register (files &optional rev comment)
-  "Register FILE under bzr.
+  "Register FILES under bzr.
 Signal an error unless REV is nil.
 COMMENT is ignored."
   (if rev (error "Can't register explicit revision with bzr"))
@@ -455,7 +569,7 @@
 (declare-function log-edit-extract-headers "log-edit" (headers string))
 
 (defun vc-bzr-checkin (files rev comment)
-  "Check FILE in to bzr with log message COMMENT.
+  "Check FILES in to bzr with log message COMMENT.
 REV non-nil gets an error."
   (if rev (error "Can't check in a specific revision with bzr"))
   (apply 'vc-bzr-command "commit" nil 0
@@ -644,7 +758,7 @@
                       (string-to-number (substring str 0 4))))))))
 
 (defun vc-bzr-annotate-extract-revision-at-line ()
-  "Return revision for current line of annoation buffer, or nil.
+  "Return revision for current line of annotation buffer, or nil.
 Return nil if current line isn't annotated."
   (save-excursion
     (beginning-of-line)
@@ -940,7 +1054,7 @@
 (defun vc-bzr-shelve-delete-at-point ()
   (interactive)
   (let ((shelve (vc-bzr-shelve-get-at-point (point))))
-    (when (y-or-n-p (format "Remove shelf %s ?" shelve))
+    (when (y-or-n-p (format "Remove shelf %s ? " shelve))
       (vc-bzr-command "unshelve" nil 0 nil "--delete-only" shelve)
       (vc-dir-refresh))))
 
@@ -1050,9 +1164,6 @@
                                                vc-bzr-revision-keywords))
                               string pred))))))
 
-(eval-after-load "vc"
-  '(add-to-list 'vc-directory-exclusion-list vc-bzr-admin-dirname t))
+(provide 'vc-bzr)
 
-(provide 'vc-bzr)
-;; arch-tag: 8101bad8-4e92-4e7d-85ae-d8e08b4e7c06
 ;;; vc-bzr.el ends here
--- a/lisp/vc/vc-dir.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/vc/vc-dir.el	Thu Dec 16 18:30:57 2010 -0500
@@ -753,12 +753,11 @@
 
 (defun vc-dir-query-replace-regexp (from to &optional delimited)
   "Do `query-replace-regexp' of FROM with TO, on all marked files.
-For marked directories, use the files displayed from those directories.
 If a directory is marked, then use the files displayed for that directory.
 Third arg DELIMITED (prefix arg) means replace only word-delimited matches.
 If you exit (\\[keyboard-quit], RET or q), you can resume the query replace
 with the command \\[tags-loop-continue]."
-  ;; FIXME: this is almost a copy of `dired-do-replace-regexp'.  This
+  ;; FIXME: this is almost a copy of `dired-do-query-replace-regexp'.  This
   ;; should probably be made generic and used in both places instead of
   ;; duplicating it here.
   (interactive
--- a/lisp/vc/vc.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/vc/vc.el	Thu Dec 16 18:30:57 2010 -0500
@@ -100,7 +100,7 @@
 ;; In the list of functions below, each identifier needs to be prepended
 ;; with `vc-sys-'.  Some of the functions are mandatory (marked with a
 ;; `*'), others are optional (`-').
-;;
+
 ;; BACKEND PROPERTIES
 ;;
 ;; * revision-granularity
@@ -109,7 +109,7 @@
 ;;   that return 'file have per-file revision numbering; backends
 ;;   that return 'repository have per-repository revision numbering,
 ;;   so a revision level implicitly identifies a changeset
-;;
+
 ;; STATE-QUERYING FUNCTIONS
 ;;
 ;; * registered (file)
@@ -313,11 +313,24 @@
 ;;
 ;; - merge (file rev1 rev2)
 ;;
-;;   Merge the changes between REV1 and REV2 into the current working file.
+;;   Merge the changes between REV1 and REV2 into the current working file
+;;   (for non-distributed VCS).
+;;
+;; - merge-branch ()
+;;
+;;   Merge another branch into the current one, prompting for a
+;;   location to merge from.
 ;;
 ;; - merge-news (file)
 ;;
 ;;   Merge recent changes from the current branch into FILE.
+;;   (for non-distributed VCS).
+;;
+;; - pull (prompt)
+;;
+;;   Pull "upstream" changes into the current branch (for distributed
+;;   VCS).  If PROMPT is non-nil, or if necessary, prompt for a
+;;   location to pull from.
 ;;
 ;; - steal-lock (file &optional revision)
 ;;
@@ -335,7 +348,7 @@
 ;;
 ;;   Mark conflicts as resolved.  Some VC systems need to run a
 ;;   command to mark conflicts as resolved.
-;;
+
 ;; HISTORY FUNCTIONS
 ;;
 ;; * print-log (files buffer &optional shortlog start-revision limit)
@@ -440,7 +453,7 @@
 ;;   If the backend supports annotating through copies and renames,
 ;;   and displays a file name and a revision, then return a cons
 ;;   (REVISION . FILENAME).
-;;
+
 ;; TAG SYSTEM
 ;;
 ;; - create-tag (dir name branchp)
@@ -461,7 +474,7 @@
 ;;   does a sanity check whether there aren't any uncommitted changes at
 ;;   or below DIR, and then performs a tree walk, using the `checkout'
 ;;   function to retrieve the corresponding revisions.
-;;
+
 ;; MISCELLANEOUS
 ;;
 ;; - make-version-backups-p (file)
@@ -1816,53 +1829,65 @@
 
 ;;;###autoload
 (defun vc-merge ()
-  "Merge changes between two revisions into the current buffer's file.
-This asks for two revisions to merge from in the minibuffer.  If the
-first revision is a branch number, then merge all changes from that
-branch.  If the first revision is empty, merge news, i.e. recent changes
-from the current branch.
+  "Perform a version control merge operation.
+On a distributed version control system, this runs a \"merge\"
+operation to incorporate changes from another branch onto the
+current branch, prompting for an argument list.
 
-See Info node `Merging'."
+On a non-distributed version control system, this merges changes
+between two revisions into the current fileset.  This asks for
+two revisions to merge from in the minibuffer.  If the first
+revision is a branch number, then merge all changes from that
+branch.  If the first revision is empty, merge the most recent
+changes from the current branch."
   (interactive)
-  (vc-ensure-vc-buffer)
-  (vc-buffer-sync)
-  (let* ((file buffer-file-name)
-	 (backend (vc-backend file))
-	 (state (vc-state file))
-	 first-revision second-revision status)
+  (let* ((vc-fileset (vc-deduce-fileset t))
+	 (backend (car vc-fileset))
+	 (files (cadr vc-fileset)))
     (cond
-     ((stringp state)	;; Locking VCses only
-      (error "File is locked by %s" state))
-     ((not (vc-editable-p file))
-      (if (y-or-n-p
-	   "File must be checked out for merging.  Check out now? ")
-	  (vc-checkout file t)
-	(error "Merge aborted"))))
-    (setq first-revision
-	  (vc-read-revision
-           (concat "Branch or revision to merge from "
-                   "(default news on current branch): ")
-           (list file)
-           backend))
-    (if (string= first-revision "")
-        (setq status (vc-call-backend backend 'merge-news file))
-      (if (not (vc-find-backend-function backend 'merge))
-	  (error "Sorry, merging is not implemented for %s" backend)
-	(if (not (vc-branch-p first-revision))
-	    (setq second-revision
-		  (vc-read-revision
-                   "Second revision: "
-                   (list file) backend nil
-                   ;; FIXME: This is CVS/RCS/SCCS specific.
-                   (concat (vc-branch-part first-revision) ".")))
-	  ;; We want to merge an entire branch.  Set revisions
-	  ;; accordingly, so that vc-BACKEND-merge understands us.
-	  (setq second-revision first-revision)
-	  ;; first-revision must be the starting point of the branch
-	  (setq first-revision (vc-branch-part first-revision)))
-	(setq status (vc-call-backend backend 'merge file
-                                      first-revision second-revision))))
-    (vc-maybe-resolve-conflicts file status "WORKFILE" "MERGE SOURCE")))
+     ;; If a branch-merge operation is defined, use it.
+     ((vc-find-backend-function backend 'merge-branch)
+      (vc-call-backend backend 'merge-branch))
+     ;; Otherwise, do a per-file merge.
+     ((vc-find-backend-function backend 'merge)
+      (vc-buffer-sync)
+      (dolist (file files)
+	(let* ((state (vc-state file))
+	       first-revision second-revision status)
+	  (cond
+	   ((stringp state)	;; Locking VCses only
+	    (error "File %s is locked by %s" file state))
+	   ((not (vc-editable-p file))
+	    (vc-checkout file t)))
+	  (setq first-revision
+		(vc-read-revision
+		 (concat "Merge " file
+			 "from branch or revision "
+			 "(default news on current branch): ")
+		 (list file)
+		 backend))
+	  (cond
+	   ((string= first-revision "")
+	    (setq status (vc-call-backend backend 'merge-news file)))
+	   (t
+	    (if (not (vc-branch-p first-revision))
+		(setq second-revision
+		      (vc-read-revision
+		       "Second revision: "
+		       (list file) backend nil
+		       ;; FIXME: This is CVS/RCS/SCCS specific.
+		       (concat (vc-branch-part first-revision) ".")))
+	      ;; We want to merge an entire branch.  Set revisions
+	      ;; accordingly, so that vc-BACKEND-merge understands us.
+	      (setq second-revision first-revision)
+	      ;; first-revision must be the starting point of the branch
+	      (setq first-revision (vc-branch-part first-revision)))
+	    (setq status (vc-call-backend backend 'merge file
+					  first-revision second-revision))))
+	  (vc-maybe-resolve-conflicts file status "WORKFILE" "MERGE SOURCE"))))
+     (t
+      (error "Sorry, merging is not implemented for %s" backend)))))
+
 
 (defun vc-maybe-resolve-conflicts (file status &optional name-A name-B)
   (vc-resynch-buffer file t (not (buffer-modified-p)))
@@ -2274,35 +2299,47 @@
 (define-obsolete-function-alias 'vc-revert-buffer 'vc-revert "23.1")
 
 ;;;###autoload
-(defun vc-update ()
-  "Update the current fileset's files to their tip revisions.
-For each one that contains no changes, and is not locked, then this simply
-replaces the work file with the latest revision on its branch.  If the file
-contains changes, and the backend supports merging news, then any recent
-changes from the current branch are merged into the working file."
-  (interactive)
-  (let* ((vc-fileset (vc-deduce-fileset))
+(defun vc-update (&optional arg)
+  "Update the current fileset or branch.
+On a distributed version control system, this runs a \"pull\"
+operation to update the current branch, prompting for an argument
+list if required.  Optional prefix ARG forces a prompt.
+
+On a non-distributed version control system, update the current
+fileset to the tip revisions.  For each unchanged and unlocked
+file, this simply replaces the work file with the latest revision
+on its branch.  If the file contains changes, any changes in the
+tip revision are merged into the working file."
+  (interactive "P")
+  (let* ((vc-fileset (vc-deduce-fileset t))
 	 (backend (car vc-fileset))
 	 (files (cadr vc-fileset)))
-    (save-some-buffers          ; save buffers visiting files
-     nil (lambda ()
-           (and (buffer-modified-p)
-                (let ((file (buffer-file-name)))
-                  (and file (member file files))))))
-    (dolist (file files)
-      (if (vc-up-to-date-p file)
-	  (vc-checkout file nil t)
-	(if (eq (vc-checkout-model backend (list file)) 'locking)
-	    (if (eq (vc-state file) 'edited)
-		(error "%s"
-		       (substitute-command-keys
-			"File is locked--type \\[vc-revert] to discard changes"))
-	      (error "Unexpected file state (%s) -- type %s"
-		     (vc-state file)
-		     (substitute-command-keys
-		      "\\[vc-next-action] to correct")))
-          (vc-maybe-resolve-conflicts
-           file (vc-call-backend backend 'merge-news file)))))))
+    (cond
+     ;; If a pull operation is defined, use it.
+     ((vc-find-backend-function backend 'pull)
+      (vc-call-backend backend 'pull arg))
+     ;; If VCS has `merge-news' functionality (CVS and SVN), use it.
+     ((vc-find-backend-function backend 'merge-news)
+      (save-some-buffers ; save buffers visiting files
+       nil (lambda ()
+	     (and (buffer-modified-p)
+		  (let ((file (buffer-file-name)))
+		    (and file (member file files))))))
+      (dolist (file files)
+	(if (vc-up-to-date-p file)
+	    (vc-checkout file nil t)
+	  (vc-maybe-resolve-conflicts
+	   file (vc-call-backend backend 'merge-news file)))))
+     ;; For a locking VCS, check out each file.
+     ((eq (vc-checkout-model backend files) 'locking)
+      (dolist (file files)
+	(if (vc-up-to-date-p file)
+	    (vc-checkout file nil t))))
+     (t
+      (error "VC update is unsupported for `%s'" backend)))))
+
+;;;###autoload
+(defalias 'vc-pull 'vc-update)
 
 (defun vc-version-backup-file (file &optional rev)
   "Return name of backup file for revision REV of FILE.
--- a/lisp/whitespace.el	Thu Dec 16 17:43:45 2010 -0500
+++ b/lisp/whitespace.el	Thu Dec 16 18:30:57 2010 -0500
@@ -6,7 +6,7 @@
 ;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br>
 ;; Maintainer: Vinicius Jose Latorre <viniciusjl@ig.com.br>
 ;; Keywords: data, wp
-;; Version: 13.1
+;; Version: 13.2
 ;; X-URL: http://www.emacswiki.org/cgi-bin/wiki/ViniciusJoseLatorre
 
 ;; This file is part of GNU Emacs.
@@ -1103,7 +1103,7 @@
   :init-value nil
   :global     nil
   :group      'whitespace
-  (let ((whitespace-style '(newline-mark newline)))
+  (let ((whitespace-style '(face newline-mark newline)))
     (whitespace-mode whitespace-newline-mode)
     ;; sync states (running a batch job)
     (setq whitespace-newline-mode whitespace-mode)))
@@ -1652,12 +1652,12 @@
 	    (whitespace-replace-action
 	     (if whitespace-indent-tabs-mode 'tabify 'untabify)
 	     rstart rend whitespace-space-before-tab-regexp
-	     (if whitespace-indent-tabs-mode 1 2)))
+	     (if whitespace-indent-tabs-mode 0 2)))
 	   ;; ACTION: replace SPACEs before TAB by TABs.
 	   ((memq 'space-before-tab::tab whitespace-style)
 	    (whitespace-replace-action
 	     'tabify rstart rend
-	     whitespace-space-before-tab-regexp 1))
+	     whitespace-space-before-tab-regexp 0))
 	   ;; ACTION: replace TABs by SPACEs.
 	   ((memq 'space-before-tab::space whitespace-style)
 	    (whitespace-replace-action
--- a/make-dist	Thu Dec 16 17:43:45 2010 -0500
+++ b/make-dist	Thu Dec 16 18:30:57 2010 -0500
@@ -130,7 +130,6 @@
 ### (Accept only absolute file names.)
 if [ $update = yes ];
 then
-  unset EMACS_UNIBYTE
   if [ -f src/emacs ];
   then
     EMACS=`pwd`/src/emacs
@@ -442,7 +441,7 @@
 echo "Making links to \`etc' and its subdirectories"
 for f in `find etc -type f`; do
   case $f in
-    etc/DOC*) continue ;;
+    etc/DOC*|etc/*.pyc) continue ;;
   esac
   ln $f $tempdir/$f
 done
--- a/msdos/ChangeLog	Thu Dec 16 17:43:45 2010 -0500
+++ b/msdos/ChangeLog	Thu Dec 16 18:30:57 2010 -0500
@@ -1,3 +1,7 @@
+2010-12-04  Andreas Schwab  <schwab@linux-m68k.org>
+
+	* sed1v2.inp (M_FILE, S_FILE): Add $(srcdir)/ prefix.
+
 2010-10-15  Eli Zaretskii  <eliz@gnu.org>
 
 	* sed1v2.inp: Use $(..) instead of ${..} in all edit commands.
--- a/msdos/sed1v2.inp	Thu Dec 16 17:43:45 2010 -0500
+++ b/msdos/sed1v2.inp	Thu Dec 16 18:30:57 2010 -0500
@@ -128,8 +128,8 @@
 /^DEPFLAGS *=/s/@DEPFLAGS@//
 /^MKDEPDIR *=/s/@MKDEPDIR@//
 /^version *=/s/@[^@\n]*@//
-/^M_FILE *=/s!@[^@\n]*@!m/intel386.h!
-/^S_FILE *=/s!@[^@\n]*@!s/msdos.h!
+/^M_FILE *=/s!@M_FILE@!$(srcdir)/m/intel386.h!
+/^S_FILE *=/s!@S_FILE@!$(srcdir)/s/msdos.h!
 /^@SET_MAKE@$/s/@SET_MAKE@//
 /^.\$(libsrc)\/make-docfile.*>/s!make-docfile!make-docfile -o ../etc/DOC!
 /^.\$(libsrc)\/make-doc/s!>.*$!!
--- a/nt/ChangeLog	Thu Dec 16 17:43:45 2010 -0500
+++ b/nt/ChangeLog	Thu Dec 16 18:30:57 2010 -0500
@@ -1,3 +1,7 @@
+2010-11-23  Eli Zaretskii  <eliz@gnu.org>
+
+	* config.nt (EXTERNALLY_VISIBLE): Define.
+
 2010-10-13  Juanma Barranquero  <lekktu@gmail.com>
 
 	* INSTALL: Refer to `dynamic-library-alist'.
--- a/nt/config.nt	Thu Dec 16 17:43:45 2010 -0500
+++ b/nt/config.nt	Thu Dec 16 18:30:57 2010 -0500
@@ -281,6 +281,12 @@
 #define INLINE
 #endif
 
+#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1))
+#define EXTERNALLY_VISIBLE __attribute__((externally_visible))
+#else
+#define EXTERNALLY_VISIBLE
+#endif
+
 #undef EMACS_CONFIGURATION
 
 #undef EMACS_CONFIG_OPTIONS
--- a/src/ChangeLog	Thu Dec 16 17:43:45 2010 -0500
+++ b/src/ChangeLog	Thu Dec 16 18:30:57 2010 -0500
@@ -1,3 +1,217 @@
+2010-12-16  Jan Djärv  <jan.h.d@swipnet.se>
+
+	* nsterm.m (ns_draw_window_cursor): If the cursor color is the
+	same as the background, use the face forground as cursor.
+
+2010-12-13  Eli Zaretskii  <eliz@gnu.org>
+
+	* fileio.c (Fexpand_file_name): Doc fix.  (Bug#7617)
+
+2010-12-13  Eli Zaretskii  <eliz@gnu.org>
+
+	* xdisp.c (string_pos_nchars_ahead, c_string_pos)
+	(face_before_or_after_it_pos, next_element_from_string)
+	(next_element_from_c_string, produce_stretch_glyph): Remove unused
+	calculations of maximum string length before calling
+	string_char_and_length and STRING_CHAR_AND_LENGTH.
+	(string_char_and_length): Update commentary: MAXLEN is no longer
+	needed.
+
+2010-12-13  Jan Djärv  <jan.h.d@swipnet.se>
+
+	* keyboard.c (kbd_buffer_get_event): Construct SAVE_SESSION_EVENT
+	as (Qsave_session arg).
+
+	* xsmfns.c (smc_interact_CB): Set arg to Qnil.
+	(smc_die_CB): Make an event with arg Qt.
+	(Fhandle_save_session): If event has Qt as argument,
+	call Fkill_emacs (Bug#7552).
+
+2010-12-13  Chong Yidong  <cyd@stupidchicken.com>
+
+	* buffer.c (transient-mark-mode): Doc fix (Bug#7465).
+
+2010-12-13  Jan Djärv  <jan.h.d@swipnet.se>
+
+	* xsmfns.c (smc_die_CB): Call Fkill_emacs (Bug#7552).
+
+2010-12-13  Chong Yidong  <cyd@stupidchicken.com>
+
+	* dispextern.h (struct it): New member overlay_strings_charpos.
+
+	* xdisp.c (next_overlay_string, load_overlay_strings): Record the
+	charpos where we computed n_overlay_strings.
+	(next_overlay_string): Load overlay strings at recorded position,
+	which may not be the same as the iterator's charpos (Bug#7016).
+
+2010-12-13  Chong Yidong  <cyd@stupidchicken.com>
+
+	* xdisp.c (try_scrolling): Avoid infloop if the first line is
+	obscured due to a vscroll (Bug#7537).
+
+2010-12-13  Jan Djärv  <jhd@zeplinf.localdomain>
+
+	* nsterm.h (FRAME_NS_TOOLBAR_HEIGHT): Rename to FRAME_TOOLBAR_HEIGHT.
+
+	* nsterm.m (x_set_window_size, windowWillResize, initFrameFromEmacs):
+	Use FRAME_TOOLBAR_HEIGHT.
+	(x_set_offset): Handle XNegative and YNegative in
+	f->size_hint_flags (Bug#7510).
+
+2010-12-11  Eli Zaretskii  <eliz@gnu.org>
+
+	* w32fns.c (Fx_show_tip): Call try_window with last argument
+	TRY_WINDOW_IGNORE_FONTS_CHANGE.  Delete the TODO ifdef: problem
+	solved.  Round up the tip height to an integral multiple of the
+	frame's line height.  Add FRAME_COLUMN_WIDTH to the tip width.
+	(Bug#7398)
+
+2010-12-08  Glenn Morris  <rgm@gnu.org>
+
+	* fileio.c (Fverify_visited_file_modtime): Default to current buffer.
+
+2010-12-06  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+	* xml.c (parse_region): Ignore blank HTML nodes.
+	(make_dom): Return CDATA sections (like <style>foo</style>) as
+	text nodes.
+
+2010-12-06  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* lread.c (read1): Allow newstyle unquote outside of backquote.
+	Disallow old-style backquotes inside new-style backquotes.
+	Don't count unquotes to figure out when we're "syntactically inside
+	but semantically outside of a backquote" any more.
+	Extend the restriction no-unescaped-commas-and-backquotes-in-symbols
+	to all contexts.
+
+2010-12-05  Chong Yidong  <cyd@stupidchicken.com>
+
+	* process.c: Remove checks for HAVE_SYS_IOCTL_H (Bug#7484).
+
+2010-12-04  Andreas Schwab  <schwab@linux-m68k.org>
+
+	* Makefile.in (M_FILE): Substitute @M_FILE@ instead of @machfile@.
+	(S_FILE): Substitute @S_FILE@ instead of @opsysfile@.
+	* m/arm.h, m/sh3.h, m/xtensa.h: Remove files.
+
+2010-12-03  Andreas Schwab  <schwab@linux-m68k.org>
+
+	* lisp.h (union Lisp_Object): Explicitly declare signedness of
+	bit-field.
+	(XINT): Remove variant for EXPLICIT_SIGN_EXTEND.
+	* m/alpha.h (EXPLICIT_SIGN_EXTEND): Don't define.
+	* m/amdx86-64.h (EXPLICIT_SIGN_EXTEND): Likewise.
+	* m/ia64.h (EXPLICIT_SIGN_EXTEND): Likewise.
+	* m/ibms390.h (EXPLICIT_SIGN_EXTEND): Likewise.
+	* m/ibms390x.h (EXPLICIT_SIGN_EXTEND): Likewise.
+	* m/iris4d.h (EXPLICIT_SIGN_EXTEND): Likewise.
+	* m/m68k.h (EXPLICIT_SIGN_EXTEND): Likewise.
+	* m/sparc.h (EXPLICIT_SIGN_EXTEND): Likewise.
+	* m/template.h (EXPLICIT_SIGN_EXTEND): Likewise.
+	* m/hp800.h: Remove file.
+	* m/mips.h: Remove file.
+
+2010-12-03  Jan Djärv  <jan.h.d@swipnet.se>
+
+	* nsterm.m (ns_dumpglyphs_image): If drawing cursor, fill background
+	with cursor color and draw a rectangle around the image (Bug#7412).
+
+2010-12-03  Andreas Schwab  <schwab@linux-m68k.org>
+
+	* frame.c (x_set_font): Remove unused variable.
+
+2010-12-02  Jan Djärv  <jan.h.d@swipnet.se>
+
+	* nsmenu.m (update_frame_tool_bar): Remove NSLog on invalid image.
+
+	* nsterm.m (ns_draw_glyph_string): Switch fore- and background if
+	drawing text under filled box cursor (Bug#7479).
+
+2010-11-27  Kenichi Handa  <handa@m17n.org>
+
+	* charset.c (emacs_mule_charset): Make it an array of charset ID;
+	i.e. integer.
+	(Fdefine_charset_internal): Adjust for the above change.
+	(init_charset_once): Likewise.
+
+	* charset.h (emacs_mule_charset): Adjust the prototype.
+	Delete duplicated extern.
+
+	* coding.c (emacs_mule_char): Adjust for the change of
+	emacs_mule_charset.
+
+	* lread.c (read_emacs_mule_char): Adjust for the change of
+	emacs_mule_charset.
+
+2010-11-27  Eli Zaretskii  <eliz@gnu.org>
+
+	* w32.c (_PROCESS_MEMORY_COUNTERS_EX): Don't define with versions
+	of w32api >= 3.15.  (Bug#6989)  (Bug#7452)
+
+2010-11-27  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+	* alloc.c (mark_terminals): Ensure that the image cache is marked
+	even if the terminal object was marked earlier (Bug#6301).
+
+2010-11-21  Chong Yidong  <cyd@stupidchicken.com>
+
+	* editfns.c (Fbyte_to_string): Signal an error arg is not a byte.
+
+2010-11-27  Jan Djärv  <jan.h.d@swipnet.se>
+
+	* gtkutil.c (menubar_map_cb): New function (Bug#7425).
+	(xg_update_frame_menubar): Connect signal map to menubar_map_cb.
+	Use 23 as menubar height if 0. (Bug#7425).
+
+2010-11-26  Eli Zaretskii  <eliz@gnu.org>
+
+	* xdisp.c (set_message_1): Force paragraph direction in echo area
+	be left-to-right.
+
+	* keyboard.c (make_lispy_position): Put a meaningful value in yret
+	when the click is on the header or mode line.
+
+2010-11-25  Eli Zaretskii  <eliz@gnu.org>
+
+	* xdisp.c (set_cursor_from_row): Don't forget to consider the
+	`cursor' property of the first character in overlay strings.
+	(Bug#7474)  (Bug#7481)
+
+2010-11-24  Jan Djärv  <jan.h.d@swipnet.se>
+
+	* nsterm.m (NSLeftControlKeyMask, NSLeftCommandKeyMask)
+	(NSLeftAlternateKeyMask): New defines.
+	(keyDown): Parse left and right keys separately (Bug#7458).
+	Compare Left key masks exactly (Bug#7458).
+
+2010-11-23  Eli Zaretskii  <eliz@gnu.org>
+
+	* intervals.c (temp_set_point_both): Define before calling, to
+	avoid GCC warnings.
+
+2010-11-23  Dan Nicolaescu  <dann@ics.uci.edu>
+
+	* nsmenu.m: Use #include <config.h> instead of "config.h".
+
+	* term.c (Qglyphless_char,last_glyphless_glyph_frame)
+	(last_glyphless_glyph_face_id. last_glyphless_glyph_merged_face_id):
+	Move declarations ...
+	* lisp.h (Qglyphless_char,last_glyphless_glyph_frame)
+	(last_glyphless_glyph_face_id. last_glyphless_glyph_merged_face_id):
+	... here.
+
+	* emacs.c (gdb_use_union, gdb_valbits,gdb_gctypebits)
+	(gdb_data_seg_bits, gdb_array_mark_flag, PVEC_FLAG)
+	(gdb_pvec_type):
+	* print.c (print_output_debug_flag):
+	* lisp.h (debug_print): Mark as EXTERNALLY_VISIBLE.
+	(safe_debug_print): New declaration.
+
+	* xterm.c:
+	* systty.h:
+	* sound.c: Include <sys/ioctl.h> unconditionally.
+
 2010-11-22  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
 
 	* alloc.c (mark_maybe_object): Return early if given a Lisp
@@ -275,12 +489,12 @@
 
 	* xdisp.c (syms_of_xdisp) <glyphless-char-display>: Doc fix.
 
-	* dispextern.h (enum glyphless_display_method): Rename
-	GLYPHLESS_DISPLAY_HEXA_CODE to GLYPHLESS_DISPLAY_HEX_CODE.  All
-	users changed.
-
-	* term.c (append_glyphless_glyph, produce_glyphless_glyph): Fix
-	comments.
+	* dispextern.h (enum glyphless_display_method):
+	Rename GLYPHLESS_DISPLAY_HEXA_CODE to GLYPHLESS_DISPLAY_HEX_CODE.
+	All users changed.
+
+	* term.c (append_glyphless_glyph, produce_glyphless_glyph):
+	Fix comments.
 	(produce_glyphless_glyph): Enclose "U+nnnn" and "empty box"
 	whitespace in "[]", to simulate a box.  Don't use uninitialized
 	variable `width'.
@@ -413,8 +627,8 @@
 
 	* xterm.c (x_update_window_begin, x_update_window_end)
 	(x_update_end, XTframe_up_to_date, x_set_mouse_face_gc)
-	(handle_one_xevent, x_free_frame_resources, x_term_init): Replace
-	Display_Info with Mouse_HLInfo everywhere where mouse_face_*
+	(handle_one_xevent, x_free_frame_resources, x_term_init):
+	Replace Display_Info with Mouse_HLInfo everywhere where mouse_face_*
 	members were accessed for mouse highlight purposes.
 
 	* w32term.c (x_update_window_begin, x_update_window_end)
@@ -437,8 +651,8 @@
 	HAVE_WINDOW_SYSTEM conditional.
 	(x_y_to_hpos_vpos, frame_to_window_pixel_xy): Move out of the
 	HAVE_WINDOW_SYSTEM block.
-	(try_window_id) [HAVE_GPM || MSDOS]: Call
-	x_clear_window_mouse_face.
+	(try_window_id) [HAVE_GPM || MSDOS]:
+	Call x_clear_window_mouse_face.
 	(draw_row_with_mouse_face): Implementation for HAVE_WINDOW_SYSTEM
 	systems.  Call tty_draw_row_with_mouse_face for TTY systems.
 	(show_mouse_face): Call draw_row_with_mouse_face, instead of
@@ -454,8 +668,8 @@
 	Clear mouse highlight if pointer is over glyphs whose OBJECT is an
 	integer.
 	(mouse_face_from_buffer_pos): Add parentheses around && within ||.
-	(x_consider_frame_title, tool_bar_lines_needed): Move
-	prototypes to HAVE_WINDOW_SYSTEM-only part.
+	(x_consider_frame_title, tool_bar_lines_needed):
+	Move prototypes to HAVE_WINDOW_SYSTEM-only part.
 	(get_window_cursor_type): Move inside a HAVE_WINDOW_SYSTEM-only
 	part.  Remove "#ifdef HAVE_WINDOW_SYSTEM" from body of function.
 	(null_glyph_slice): Move declaration into HAVE_WINDOW_SYSTEM-only
@@ -504,8 +718,8 @@
 
 2010-11-05  Eli Zaretskii  <eliz@gnu.org>
 
-	* term.c (append_glyphless_glyph, produce_glyphless_glyph): Remove
-	unused variables.
+	* term.c (append_glyphless_glyph, produce_glyphless_glyph):
+	Remove unused variables.
 
 2010-11-05  Adrian Robert  <Adrian.B.Robert@gmail.com>
 
@@ -739,8 +953,8 @@
 	MOTIF (Bug#7263).
 
 	* xfns.c: Include Xm/TextF and Xm/List.
-	(file_dialog_cb, file_dialog_unmap_cb, clean_up_file_dialog): Make
-	ANSI prototypes.
+	(file_dialog_cb, file_dialog_unmap_cb, clean_up_file_dialog):
+	Make ANSI prototypes.
 
 2010-10-22  Glenn Morris  <rgm@gnu.org>
 
@@ -1021,8 +1235,8 @@
 	anything on any platform.
 
 	Remove unused code.
-	* sysdep.c (select_alarm, sys_select, read_input_waiting): Remove
-	select emulation, all systems support select.
+	* sysdep.c (select_alarm, sys_select, read_input_waiting):
+	Remove select emulation, all systems support select.
 	(set_exclusive_use): Remove, the only user is in an #if 0 block.
 	* process.c (create_process): Remove #if 0 code.
 
@@ -1087,7 +1301,7 @@
 2010-10-02  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
 	* xml.c (Flibxml_parse_xml_region, Flibxml_parse_html_region)
-	(parse_region): Reworked to take regions instead of strings, and
+	(parse_region): Rework to take regions instead of strings, and
 	renamed to reflect that these are the libxml functions.
 
 2010-10-01  Eli Zaretskii  <eliz@gnu.org>
@@ -1125,7 +1339,8 @@
 	* msdos.c:
 	* charset.c: Do not include stdlib.h and string.h, config.h does it.
 
-	* callproc.c (SIGCHLD): Remove conditional definition, syssignal.h defines it.
+	* callproc.c (SIGCHLD): Remove conditional definition, syssignal.h
+	defines it.
 
 	* process.c: Move #include <pty.h> earlier.
 	(SIGCHLD): Remove conditional definition, syssignal.h defines it.
@@ -1215,8 +1430,8 @@
 	(find_last_unchanged_at_beg_row)
 	(find_first_unchanged_at_end_row, row_containing_pos)
 	(trailing_whitespace_p, display_mode_element, decode_mode_spec)
-	(display_count_lines, x_produce_glyphs, note_mouse_highlight): Use
-	EMACS_INT for buffer and string positions.
+	(display_count_lines, x_produce_glyphs, note_mouse_highlight):
+	Use EMACS_INT for buffer and string positions.
 
 	* dispextern.h (struct it) <string_nchars>: Declare EMACS_INT.
 	(row_containing_pos): Adjust prototype.
@@ -1303,7 +1518,7 @@
 
 	* dispextern.h (struct glyph): Change the member "slice" to union.
 	Remove u.cmp.from and u.cmp.to.  Give more bits to u.cmp.id.
-	(GLYPH_SLICE_EQUAL_P): Adjusted for the above change.
+	(GLYPH_SLICE_EQUAL_P): Adjust for the above change.
 
 	* dispnew.c (buffer_posn_from_coords): Use glyph->slice.img
 	instead of glyph->slice.
@@ -1499,8 +1714,8 @@
 	positions.
 
 	* xdisp.c (redisplay_internal, try_window_id)
-	(set_cursor_from_row, find_first_unchanged_at_end_row): Use
-	EMACS_INT for buffer positions.
+	(set_cursor_from_row, find_first_unchanged_at_end_row):
+	Use EMACS_INT for buffer positions.
 
 	* dispextern.h (set_cursor_from_row): Adjust prototype.
 
@@ -1510,8 +1725,8 @@
 	positions.
 
 	* dispextern.h (mode_line_string, marginal_area_string)
-	(increment_matrix_positions, increment_row_positions): Adjust
-	prototypes.
+	(increment_matrix_positions, increment_row_positions):
+	Adjust prototypes.
 
 	* data.c (Faref, Faset): Use EMACS_INT for string length and
 	positions.
@@ -1524,8 +1739,8 @@
 
 	* syntax.c (scan_words, update_syntax_table)
 	(prev_char_comend_first, back_comment, skip_chars)
-	(skip_syntaxes, Fforward_comment, Fbackward_prefix_chars): Use
-	EMACS_INT for buffer and string positions.
+	(skip_syntaxes, Fforward_comment, Fbackward_prefix_chars):
+	Use EMACS_INT for buffer and string positions.
 
 	* syntax.h (scan_words, update_syntax_table): Adjust prototypes.
 
@@ -1573,8 +1788,8 @@
 	(modify_overlay, Fmove_overlay, report_overlay_modification)
 	(evaporate_overlays): Use EMACS_INT for buffer positions.
 
-	* lisp.h (fix_start_end_in_overlays, overlay_touches_p): Adjust
-	prototypes.
+	* lisp.h (fix_start_end_in_overlays, overlay_touches_p):
+	Adjust prototypes.
 
 	* dispextern.h (struct bidi_saved_info): Use EMACS_INT for buffer
 	positions.
@@ -1665,13 +1880,13 @@
 	* indent.c (compute_motion): Use EMACS_INT for arguments to
 	region_cache_forward.
 
-	* region-cache.c (struct boundary, struct region_cache): Use
-	EMACS_INT for positions.
+	* region-cache.c (struct boundary, struct region_cache):
+	Use EMACS_INT for positions.
 	(find_cache_boundary, move_cache_gap, insert_cache_boundary)
 	(delete_cache_boundaries, set_cache_region)
 	(invalidate_region_cache, know_region_cache)
-	(region_cache_forward, region_cache_backward, pp_cache): Use
-	EMACS_INT for buffer positions.
+	(region_cache_forward, region_cache_backward, pp_cache):
+	Use EMACS_INT for buffer positions.
 
 	* region-cache.h (know_region_cache, invalidate_region_cache)
 	(region_cache_forward, region_cache_backward): Adjust prototypes.
@@ -1692,8 +1907,8 @@
 	(Fline_beginning_position, Fline_end_position, Fprevious_char)
 	(Fchar_after, Fchar_before, Finsert_char)
 	(Finsert_buffer_substring, Fcompare_buffer_substrings)
-	(Fsubst_char_in_region, Fformat, Ftranspose_regions): Use
-	EMACS_INT for buffer and string position variables.
+	(Fsubst_char_in_region, Fformat, Ftranspose_regions):
+	Use EMACS_INT for buffer and string position variables.
 	(Finsert_char): Protect against too large insertions.
 
 	* lisp.h (clip_to_bounds): Adjust prototype.
@@ -1730,8 +1945,8 @@
 
 	* editfns.c (Fformat): Use EMACS_INT for string size variables.
 
-	* xdisp.c (store_mode_line_noprop, display_mode_element): Use
-	EMACS_INT for string positions.
+	* xdisp.c (store_mode_line_noprop, display_mode_element):
+	Use EMACS_INT for string positions.
 
 	* intervals.c (get_property_and_range): Use EMACS_INT for buffer
 	position arguments.
@@ -1741,13 +1956,13 @@
 	* character.c (parse_str_as_multibyte, str_as_multibyte)
 	(parse_str_to_multibyte, str_to_multibyte, str_as_unibyte)
 	(string_count_byte8, string_escape_byte8, c_string_width)
-	(strwidth, lisp_string_width, multibyte_chars_in_text): Use
-	EMACS_INT for string length variables and arguments.
+	(strwidth, lisp_string_width, multibyte_chars_in_text):
+	Use EMACS_INT for string length variables and arguments.
 
 	* character.h (parse_str_as_multibyte, str_as_multibyte)
 	(parse_str_to_multibyte, str_to_multibyte, str_as_unibyte)
-	(c_string_width, strwidth, lisp_string_width): Adjust
-	prototypes.
+	(c_string_width, strwidth, lisp_string_width):
+	Adjust prototypes.
 
 	* font.c (font_intern_prop): Use EMACS_INT for string length
 	variables.
@@ -1767,8 +1982,8 @@
 	(allocate_string_data, compact_small_strings, Fmake_string)
 	(Fmake_bool_vector, make_string, make_unibyte_string)
 	(make_multibyte_string, make_string_from_bytes)
-	(make_specified_string_string, Fmake_list, Fmake_vector): Use
-	EMACS_INT for string length variables and arguments.
+	(make_specified_string_string, Fmake_list, Fmake_vector):
+	Use EMACS_INT for string length variables and arguments.
 	(find_string_data_in_pure, make_pure_string, make_pure_c_string)
 	(Fpurecopy): Use EMACS_INT for string size.
 	(mark_vectorlike, mark_char_table, mark_object): Use EMACS_UINT
@@ -2033,8 +2248,8 @@
 
 2010-09-04  Eli Zaretskii  <eliz@gnu.org>
 
-	* w32uniscribe.c (uniscribe_shape): Update commentary.  Don't
-	try to reorder grapheme clusters, since LGSTRING should always
+	* w32uniscribe.c (uniscribe_shape): Update commentary.
+	Don't try to reorder grapheme clusters, since LGSTRING should always
 	hold them in the logical order.
 	(uniscribe_encode_char, uniscribe_shape): Force ScriptShape to
 	return glyph codes in the logical order.
@@ -2233,16 +2448,16 @@
 	Do not define EMACS_HAVE_TTY_PGRP.  Only define
 	EMACS_GET_TTY_PGRP for !DOS_NT.
 	* sysdep.c: Include sysselect.h unconditionally.  Do not include
-	sys/ioctl.h and termios.h, systty.h does it.  Use
-	HAVE_SYS_UTSNAME_H instead of USG as an include guard.
+	sys/ioctl.h and termios.h, systty.h does it.
+	Use HAVE_SYS_UTSNAME_H instead of USG as an include guard.
 	(init_baud_rate): Remove HAVE_TERMIO code.
 	(child_setup_tty): Remove HAVE_TERMIO code.
 	(emacs_get_tty, emacs_set_tty): Remove HAVE_TERMIO, HAVE_TCHARS
 	and HAVE_LTCHARS code.  Use !DOS_NT instead of HAVE_TCATTR.
 	(new_ltchars, new_tchars): Remove, unused.
 	(init_sys_modes): Remove HAVE_TERMIO, HAVE_TCHARS and HAVE_LTCHARS
-	code.  Remove special casing for __mips__, it was a no-op.  Remove
-	HAVE_TCATTR conditional, it is implied by HAVE_TERMIOS.
+	code.  Remove special casing for __mips__, it was a no-op.
+	Remove HAVE_TCATTR conditional, it is implied by HAVE_TERMIOS.
 	(init_sys_modes): Remove HPUX special case.
 	* process.c: Include stdlib.h unconditionally.  Do not include
 	fcntl.h, systty.h does it.  Remove conditional code for
@@ -2966,8 +3181,8 @@
 	(initial_argv, last_nonmenu_event, load_in_progress)
 	(noninteractive_need_newline, scroll_margin): Add declarations.
 
-	* keyboard.h (xmalloc_widget_value, digest_single_submenu): Remove
-	declarations, menu.h has them.
+	* keyboard.h (xmalloc_widget_value, digest_single_submenu):
+	Remove declarations, menu.h has them.
 	(QCbutton, QCtoggle, QCradio, QClabel, extra_keyboard_modifiers)
 	(Vinput_method_function, Qinput_method_function)
 	(Qevent_symbol_element_mask, last_event_timestamp):
@@ -3274,8 +3489,8 @@
 
 	* term.c (Qspace, QCalign_to, QCwidth): Remove declarations.
 	(encode_terminal_code, produce_composite_glyph): Remove unused variables.
-	(set_tty_color_mode, term_mouse_highlight, term_get_fkeys): Remove
-	local extern declarations.
+	(set_tty_color_mode, term_mouse_highlight, term_get_fkeys):
+	Remove local extern declarations.
 
 	* xmenu.c: Do not included lwlib.h, not needed.
 
@@ -3640,8 +3855,8 @@
 	(cvt_pixel_dtor, x_window_to_menu_bar, xt_action_hook)
 	(xaw_jump_callback, xaw_scroll_callback)
 	(x_create_toolkit_scroll_bar, x_set_toolkit_scroll_bar_thumb)
-	(x_wm_set_size_hint, x_activate_timeout_atimer): Convert
-	definitions to standard C.
+	(x_wm_set_size_hint, x_activate_timeout_atimer):
+	Convert definitions to standard C.
 	* xmenu.c (menubar_id_to_frame, popup_get_selection)
 	(popup_activate_callback, popup_deactivate_callback)
 	(menu_highlight_callback, menubar_selection_callback)
@@ -3754,7 +3969,7 @@
 	(Ffont_put): Accept font-entity and font-object too.
 	(Ffont_get_glyhphs): Renamed from Fget_font_glyphs.  Arguments and
 	return value changed.
-	(syms_of_font): Adjusted for the above change.
+	(syms_of_font): Adjust for the above change.
 
 2010-07-11  Andreas Schwab  <schwab@linux-m68k.org>
 
@@ -3845,8 +4060,8 @@
 
 	* frame.c (make_frame): Initialize menu_bar_lines and
 	tool_bar_lines members.
-	(make_initial_frame, make_terminal_frame): Initialize
-	menu_bar_lines using value of menu-bar-mode.
+	(make_initial_frame, make_terminal_frame):
+	Initialize menu_bar_lines using value of menu-bar-mode.
 
 	* msdos.c (IT_set_frame_parameters): Don't set menu-bar-lines.
 
@@ -4294,8 +4509,8 @@
 	* xsmfns.c (SSDATA): New macro.
 	(smc_save_yourself_CB, x_session_initialize): Use SSDATA for strings
 	passed to strlen/strcpy/strcat.
-	(create_client_leader_window): Surround with #ifndef USE_GTK.  Cast
-	7:th arg to XChangeProperty to (unsigned char *).
+	(create_client_leader_window): Surround with #ifndef USE_GTK.
+	Cast 7:th arg to XChangeProperty to (unsigned char *).
 
 	* xsettings.c (something_changedCB, parse_settings)
 	(apply_xft_settings): Reformat prototype.
@@ -4453,8 +4668,8 @@
 
 	* msdos.c (IT_set_frame_parameters): Fix setting of colors in
 	frames other than the initial one.  Fix reversal of colors when
-	`reverse' is specified in the frame parameters.  Call
-	update_face_from_frame_parameter instead of
+	`reverse' is specified in the frame parameters.
+	Call update_face_from_frame_parameter instead of
 	internal-set-lisp-face-attribute.  Initialize screen colors from
 	initial_screen_colors[] when f->default_face_done_p is zero,
 	instead of depending on being called with default-frame-alist as
@@ -4639,8 +4854,8 @@
 
 2010-06-30  Chong Yidong  <cyd@stupidchicken.com>
 
-	* frame.c (get_future_frame_param, Fmake_terminal_frame): Don't
-	check default-frame-alist.
+	* frame.c (get_future_frame_param, Fmake_terminal_frame):
+	Don't check default-frame-alist.
 
 2010-06-30  Andreas Schwab  <schwab@linux-m68k.org>
 
@@ -4732,8 +4947,8 @@
 	(Bug#6526).
 
 	* xterm.h (gtk_widget_get_window, gtk_widget_get_mapped)
-	(gtk_adjustment_get_page_size, gtk_adjustment_get_upper): New
-	defines based on what configure finds.
+	(gtk_adjustment_get_page_size, gtk_adjustment_get_upper):
+	New defines based on what configure finds.
 
 	* xterm.c (XTflash): Use gtk_widget_get_window.
 	(xg_scroll_callback): Use gtk_adjustment_get_upper and
@@ -4747,8 +4962,8 @@
 	* gtkutil.h: Replace HAVE_GTK_FILE_BOTH with
 	HAVE_GTK_FILE_SELECTION_NEW.
 
-	* gtkutil.c (xg_display_open, xg_display_close): Remove
-	HAVE_GTK_MULTIDISPLAY, it is always defined.
+	* gtkutil.c (xg_display_open, xg_display_close):
+	Remove HAVE_GTK_MULTIDISPLAY, it is always defined.
 	(xg_display_open): Return type is void.
 	(gtk_widget_set_has_window)
 	(gtk_dialog_get_action_area, gtk_dialog_get_content_area)
@@ -4757,8 +4972,8 @@
 	(gtk_adjustment_get_step_increment): #define these if not found
 	by configure.
 	(remove_submenu): New define based on Gtk+ version.
-	(xg_set_cursor, xg_frame_resized, xg_event_is_for_scrollbar): Use
-	gtk_widget_get_window.
+	(xg_set_cursor, xg_frame_resized, xg_event_is_for_scrollbar):
+	Use gtk_widget_get_window.
 	(xg_frame_resized, xg_update_frame_menubar): Use gtk_widget_get_mapped.
 	(xg_create_frame_widgets): Use gtk_widget_set_has_window.
 	(create_dialog): Use gtk_dialog_get_action_area and
@@ -4766,10 +4981,10 @@
 	(xg_uses_old_file_dialog, xg_get_file_name): Remove HAVE_GTK_FILE_BOTH
 	and HAVE_GTK_FILE_CHOOSER_DIALOG_NEW.  File chooser is always
 	available, so checking for HAVE_GTK_FILE_SELECTION_NEW is enough.
-	(xg_update_menubar, xg_update_submenu, xg_show_toolbar_item): Use
-	g_object_ref and g_object_unref.
-	(xg_update_menu_item, xg_tool_bar_menu_proxy): Use
-	gtk_widget_get_sensitive.
+	(xg_update_menubar, xg_update_submenu, xg_show_toolbar_item):
+	Use g_object_ref and g_object_unref.
+	(xg_update_menu_item, xg_tool_bar_menu_proxy):
+	Use gtk_widget_get_sensitive.
 	(xg_update_submenu): Use remove_submenu.
 	(xg_update_scrollbar_pos): Don't use GtkFixedChild, use child
 	properties instead to get old x and y position.
@@ -5302,8 +5517,8 @@
 	Move static/dynamic dependency stuff to deps.mk/autodeps.mk.
 	* deps.mk, autodeps.mk: New files, extracted from Makefile.in.
 
-	* bidi.c (bidi_cache_shrink, bidi_cache_iterator_state): Fix
-	reallocation of the cache.  (Bug#6210)
+	* bidi.c (bidi_cache_shrink, bidi_cache_iterator_state):
+	Fix reallocation of the cache.  (Bug#6210)
 
 2010-05-19  Glenn Morris  <rgm@gnu.org>
 
@@ -5543,7 +5758,7 @@
 	* s/netbsd.h (LIB_GCC):
 	Move to configure.
 
-2010-05-11  Karel Klic  <kklic@redhat.com>
+2010-05-11  Karel Klíč  <kklic@redhat.com>
 
 	* ftfont.c: Fix incorrect parentheses of #if condition for
 	definining M17N_FLT_USE_NEW_FEATURE.
@@ -6010,8 +6225,8 @@
 	Reduce CPP usage.
 	* Makefile.in (LIB_X11_LIB): Remove, inline in the only user.
 	(obj): Use autoconf for unexec instead of cpp.
-	(C_SWITCH_SYSTEM, C_SWITCH_MACHINE, C_SWITCH_X_SITE): Remove
-	definitions and undefs.  Inline definitions in the only user.
+	(C_SWITCH_SYSTEM, C_SWITCH_MACHINE, C_SWITCH_X_SITE):
+	Remove definitions and undefs.  Inline definitions in the only user.
 	(ALL_CFLAGS): Substitute C_SWITCH_X_SYSTEM using autoconf.
 
 2010-04-27  Glenn Morris  <rgm@gnu.org>
@@ -6122,8 +6337,8 @@
 	the only user: s/unixware.h.
 	* ecrt0.c: Remove #ifndef static.  Inline CRT0_DUMMIES definition
 	from m/intel386.h.
-	* s/unixware.h (LOAD_AVE_TYPE, LOAD_AVE_CVT, FSCALE): Definitions
-	moved here from m/intel386.h.
+	* s/unixware.h (LOAD_AVE_TYPE, LOAD_AVE_CVT, FSCALE):
+	Definitions moved here from m/intel386.h.
 
 	* m/mips.h: Remove #if 0 code.
 
@@ -6205,14 +6420,14 @@
 	HAVE_XFT.
 	(something_changedCB): store_font_changed_event is now
 	store_config_changed_event.
-	(parse_settings): Rename from parse_xft_settings.  Read
-	non-xft xsettings outside #ifdef HAVE_XFT.
+	(parse_settings): Rename from parse_xft_settings.
+	Read non-xft xsettings outside #ifdef HAVE_XFT.
 	(read_settings): Renamed from read_xft_settings.
 	(apply_xft_settings): Take current settings as parameter.  Do not
 	call read_(xft)_settings.
 	(read_and_apply_settings): New function.
-	(xft_settings_event): Do non-xft stuff out of HAVE_XFT.  Call
-	read_and_apply_settings if there are settings to be read.
+	(xft_settings_event): Do non-xft stuff out of HAVE_XFT.
+	Call read_and_apply_settings if there are settings to be read.
 	(init_xsettings): Renamed from init_xfd_settings.
 	Call read_and_apply_settings unconditionally.
 	(xsettings_initialize): Call init_xsettings.
@@ -6340,19 +6555,19 @@
 
 	* xdisp.c [HAVE_WINDOW_SYSTEM]: Add prototype for
 	append_stretch_glyph.
-	(set_cursor_from_row) <cursor_x>: Remove unused variable.  Fix
-	off-by-one error in computing x at end of text in the row.
+	(set_cursor_from_row) <cursor_x>: Remove unused variable.
+	Fix off-by-one error in computing x at end of text in the row.
 	(append_stretch_glyph): In reversed row, prepend the glyph rather
 	than append it.  Set resolved_level and bidi_type of the glyph.
 	(extend_face_to_end_of_line): If the row is reversed, prepend a
 	stretch glyph whose width is such that the rightmost glyph will be
 	drawn at the right margin of the window.  Fix off-by-one error on
-	TTY frames in testing whether a line needs face extension.  Fix
-	face extension at ZV.  If this is the last glyph row, use
+	TTY frames in testing whether a line needs face extension.
+	Fix face extension at ZV.  If this is the last glyph row, use
 	DEFAULT_FACE_ID, to avoid painting the rest of the window with the
 	region face.
-	(set_cursor_from_row, display_line): Use
-	MATRIX_ROW_CONTINUATION_LINE_P instead of testing value of
+	(set_cursor_from_row, display_line):
+	Use MATRIX_ROW_CONTINUATION_LINE_P instead of testing value of
 	row->continuation_lines_width.
 	(next_element_from_buffer): Don't call bidi_paragraph_init if we
 	are at ZV.  Fixes a crash when reseated to ZV by
@@ -6718,8 +6933,8 @@
 
 	* xmenu.c: include xsettings.h and xlwmenu.h if USE_LUCID.
 	(apply_systemfont_to_menu): New function.
-	(set_frame_menubar, create_and_show_popup_menu): Call
-	apply_systemfont_to_menu.
+	(set_frame_menubar, create_and_show_popup_menu):
+	Call apply_systemfont_to_menu.
 
 2010-04-07  Jan Djärv  <jan.h.d@swipnet.se>
 
@@ -6747,8 +6962,8 @@
 
 2010-04-03  Eli Zaretskii  <eliz@gnu.org>
 
-	* bidi.c (bidi_resolve_explicit, bidi_level_of_next_char): Check
-	bidi_it->bytepos against ZV_BYTE instead of bidi_it->ch against
+	* bidi.c (bidi_resolve_explicit, bidi_level_of_next_char):
+	Check bidi_it->bytepos against ZV_BYTE instead of bidi_it->ch against
 	BIDI_EOB.  Fixes infloop with vertical cursor motion at ZV.
 
 	* w32fns.c (x_create_tip_frame): Copy `parms' before we modify it
@@ -6971,8 +7186,8 @@
 	(prepare_desired_row): Preserve the reversed_p flag.
 	(row_equal_p): Compare the reversed_p attributes as well.
 
-	* xdisp.c (init_iterator): Initialize it->bidi_p.  Call
-	bidi_init_it and set it->paragraph_embedding from the current
+	* xdisp.c (init_iterator): Initialize it->bidi_p.
+	Call bidi_init_it and set it->paragraph_embedding from the current
 	buffer's value of bidi_paragraph_direction.
 	(reseat_1): Initialize bidi_it.first_elt.
 	(set_iterator_to_next, next_element_from_buffer): Use the value of
@@ -6983,8 +7198,8 @@
 	(next_element_from_buffer): If bidi_it.first_elt is set,
 	initialize paragraph direction and find the first character to
 	display in the visual order.  If reseated to a middle of a line,
-	prime the bidi iterator starting at the line's beginning.  Handle
-	the situation where we overstepped stop_charpos due to
+	prime the bidi iterator starting at the line's beginning.
+	Handle the situation where we overstepped stop_charpos due to
 	non-linearity of the bidi iteration.  Likewise for when we back up
 	beyond the previous stop_charpos.  When moving across stop_charpos,
 	record it in prev_stop.
@@ -7005,8 +7220,8 @@
 	now EMACS_INT; all callers changed.
 	(set_cursor_from_row): Rewritten to support bidirectional text and
 	reversed glyph rows.
-	(text_outside_line_unchanged_p, try_window_id): Disable
-	optimizations if we are reordering bidirectional text and the
+	(text_outside_line_unchanged_p, try_window_id):
+	Disable optimizations if we are reordering bidirectional text and the
 	paragraph direction can be affected by the change.
 	(append_glyph, append_composite_glyph)
 	(produce_image_glyph, append_stretch_glyph): Set the
@@ -9159,8 +9374,8 @@
 2009-09-18  Adrian Robert  <Adrian.B.Robert@gmail.com>
 
 	* emacs.c (inhibit_x_resources): Update doc string for NS.
-	(main) [HAVE_NS]: Don't process --no-init-file option.  Remove
-	legacy code for -NXHost.  Fix error printf in daemon case.
+	(main) [HAVE_NS]: Don't process --no-init-file option.
+	Remove legacy code for -NXHost.  Fix error printf in daemon case.
 
 	* nsterm.h (ns_no_defaults): Remove.
 
@@ -9169,8 +9384,8 @@
 	(ns_use_qd_smoothing): Remove legacy variable.
 	(EmacsView-windowShouldZoom:): Set frame left_pos, top_pos and
 	don't update the NSWindow itself.
-	(EmacsView-windowWillUseStandardFrame:defaultFrame:): Improve
-	state detection and store user rect ourselves.  (Bug #3581)
+	(EmacsView-windowWillUseStandardFrame:defaultFrame:):
+	Improve state detection and store user rect ourselves.  (Bug #3581)
 
 	* nsfont.m (nsfont_draw) [NS_IMPL_COCOA]: Don't use
 	ns_use_qd_smoothing.
@@ -9473,8 +9688,8 @@
 2009-08-21  Adrian Robert  <Adrian.B.Robert@gmail.com>
 
 	* nsterm.m (ns_get_color): Update documentation properly for last
-	change, and clean up loose ends in the code left by it.  Fix
-	longstanding bug with 16-bit hex parsing, and add support for
+	change, and clean up loose ends in the code left by it.
+	Fix longstanding bug with 16-bit hex parsing, and add support for
 	yet another X11 format (rgb:r/g/b) for compatibility.
 	* nsfns.m (EmacsDialogPanel-runDialogAt): Add declaration of
 	timer_check() to avoid crash on Leopard/PPC.  Bug #2154.
@@ -11369,8 +11584,8 @@
 	(Fdefine_coding_system_internal): Likewise.
 	(setup_coding_system): Likewise.  Remove unneeded casts.
 	(detect_coding_iso_2022): Compare Viso_2022_charset_list with
-	CODING_ATTR_CHARSET_LIST, not CODING_ATTR_SAFE_CHARSETS.  Remove
-	unneeded casts.
+	CODING_ATTR_CHARSET_LIST, not CODING_ATTR_SAFE_CHARSETS.
+	Remove unneeded casts.
 
 	* insdel.c (del_range_2): Don't modify gap contents when called
 	from decode_coding_object.  (Bug#1809)
@@ -11383,8 +11598,8 @@
 
 	* lisp.h: Define Qfont_spec, Qfont_entity, Qfont_object extern.
 
-	* font.c (Qfont_spec, Qfont_entity, Qfont_object): Definitions
-	moved to data.c.
+	* font.c (Qfont_spec, Qfont_entity, Qfont_object):
+	Definitions moved to data.c.
 
 2009-02-20  Adrian Robert  <Adrian.B.Robert@gmail.com>
 
@@ -12400,8 +12615,8 @@
 	here; it will be done in init_frame_faces.
 
 	* xterm.h (struct xim_inst_t): Definition moved from xterm.c.
-	(struct x_display_info): Remove unused member null_pixel.  New
-	member xim_callback_data.
+	(struct x_display_info): Remove unused member null_pixel.
+	New member xim_callback_data.
 
 	* xterm.c (struct xim_inst_t): Definition moved to xterm.h.
 	(xim_initialize): Save pointer to callback function data.
@@ -12426,8 +12641,8 @@
 
 2008-12-12  Jason Rumney  <jasonr@gnu.org>
 
-	* w32fns.c (x_display_info_for_name, Fx_open_connection): Set
-	Vwindow_system_version to the real w32 major version.
+	* w32fns.c (x_display_info_for_name, Fx_open_connection):
+	Set Vwindow_system_version to the real w32 major version.
 
 2008-12-12  Dan Nicolaescu  <dann@ics.uci.edu>
 
@@ -12677,7 +12892,7 @@
 	(set_category_set): Extern it.
 
 	* category.c (hash_get_category_set): New function.
-	(Fmodify_category_entry): Adjusted for the change of
+	(Fmodify_category_entry): Adjust for the change of
 	char_table_ref_and_range.  Call hash_get_category_set to get a
 	category set to store in the table.
 
@@ -12695,8 +12910,8 @@
 	(SET_TEMP_CHARSET_WORK_ENCODER, GET_TEMP_CHARSET_WORK_ENCODER)
 	(SET_TEMP_CHARSET_WORK_DECODER, GET_TEMP_CHARSET_WORK_DECODER):
 	New macros.
-	(load_charset_map): Meaning of control_flag changed.  If
-	inhibit_load_charset_map is nonzero, setup a table in
+	(load_charset_map): Meaning of control_flag changed.
+	If inhibit_load_charset_map is nonzero, setup a table in
 	temp_charset_work.
 	(load_charset): New argument control_flag.
 	(map_charset_for_dump): New function.
@@ -12715,18 +12930,18 @@
 	(syms_of_charset): Make `inhibit-load-charset-map' a Lisp
 	variable.
 
-	* chartab.c (sub_char_table_ref_and_range): Adjusted for the
+	* chartab.c (sub_char_table_ref_and_range): Adjust for the
 	change of char_table_ref_and_range.
 	(char_table_ref_and_range): Change the meaning of argument FROM
 	and TO.  Now the caller must provide initial values for *FROM
 	and *TO.
 
-	* fontset.c (fontset_add): Adjusted for the change of
+	* fontset.c (fontset_add): Adjust for the change of
 	char_table_ref_and_range.
 	(fontset_get_font_group): Likewise.
 	(Ffontset_info): Likewise.
 
-	* keymap.c (describe_vector): Adjusted for the change of
+	* keymap.c (describe_vector): Adjust for the change of
 	char_table_ref_and_range.  For char-table, put boundary between
 	non-ASCII and 8-bit characters.
 
@@ -14540,8 +14755,8 @@
 
 	* s/darwin.h: Add #define DARWIN_OS.  Get rid of C_SWITCH_SYSTEM def.
 	Change LIBS_MACGUI to LIBS_NSGUI.  Move temacs-conditionalized defs
-	closer to C_SWITCH_SYSTEM_TEMACS so usage is understood.  Expand
-	comment on NO_SOCK_SIGIO.
+	closer to C_SWITCH_SYSTEM_TEMACS so usage is understood.
+	Expand comment on NO_SOCK_SIGIO.
 
 2008-08-03  Chong Yidong  <cyd@stupidchicken.com>
 
@@ -15533,8 +15748,8 @@
 
 2008-07-15  Chris Hall  <chris@web.workinglinux.com>  (tiny change)
 
-	* callproc.c (set_initial_environment): Initialize
-	Vprocess_environment under CANNOT_DUMP (fixes crash when
+	* callproc.c (set_initial_environment):
+	Initialize Vprocess_environment under CANNOT_DUMP (fixes crash when
 	batch-compiling for bootstrap).
 
 2008-07-15  Chris Hall  <chris@web.workinglinux.com>  (tiny change)
@@ -15950,8 +16165,8 @@
 
 	* xftfont.c (struct xftfont_info): New member ft_size.  Make the
 	member order compatible with struct ftfont_info.
-	(xftfont_open): Add FC_CHARSET to the pattern.  Set
-	xftfont_info->ft_size.  Don't unlock the face.  Check BDF
+	(xftfont_open): Add FC_CHARSET to the pattern.
+	Set xftfont_info->ft_size.  Don't unlock the face.  Check BDF
 	properties if appropriate.
 	(xftfont_close): Unlock the face.
 	(xftfont_anchor_point, xftfont_shape): Deleted.
@@ -16377,8 +16592,8 @@
 	truncate only if the window width is below that integer.
 	(start_display, resize_mini_window, produce_stretch_glyph)
 	(display_string, move_it_in_display_line_to): Use line_wrap.
-	(back_to_previous_visible_line_start, reseat_1): Reset
-	string_from_display_prop_p.
+	(back_to_previous_visible_line_start, reseat_1):
+	Reset string_from_display_prop_p.
 	(display_line): Extend default face to end of line when wrapping.
 
 2008-06-24  Kim F. Storm  <storm@cua.dk>
@@ -17746,8 +17961,8 @@
 	(struct glyph_string): New member underline_position and
 	underline_thickness.
 	(enum lface_attribute_index): Remove LFACE_AVGWIDTH_INDEX.
-	(struct face): Change type of `font' to `struct font *'.  Remove
-	members `font_name', `font_info_id'.
+	(struct face): Change type of `font' to `struct font *'.
+	Remove members `font_name', `font_info_id'.
 	(per_char_metric, encode_char): Delete externs.
 	(calc_pixel_width_or_height): Adjust the prototype.
 
@@ -17775,8 +17990,8 @@
 	(CHECK_FONT_GET_OBJECT): Likewise.
 	(XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT, XSETFONT): New macros.
 	(PT_PER_INCH, POINT_TO_PIXEL, PIXEL_TO_POINT): Moved from font.h.
-	(struct font_driver): New members case_sensitive anc check.  Type
-	of the member list and open changed.
+	(struct font_driver): New members case_sensitive anc check.
+	Type of the member list and open changed.
 	(enable_font_backend, font_symbolic_weight, font_symbolic_slant)
 	(font_symbolic_width, font_find_object, font_get_spec)
 	(font_set_lface_from_name): Delete extern.
@@ -17796,7 +18011,7 @@
 	(font_make_spec, font_make_entity, font_make_object)
 	(font_intern_prop): Renamed from intern_downcase.  Don't downcase
 	the string.  Callers changed.
-	(font_pixel_size): Adjusted for the format change of font-related
+	(font_pixel_size): Adjust for the format change of font-related
 	objects.
 	(prop_name_to_numeric, prop_numeric_to_name): Delete them.
 	(font_style_to_value, font_style_symbolic): New function.
@@ -17804,19 +18019,19 @@
 	(font_registry_charsets): Use Fassoc_string instead of
 	assq_no_quit.
 	(font_prop_validate_symbol): Don't return null_string.
-	(font_prop_validate_style): Adjusted for the change of
+	(font_prop_validate_style): Adjust for the change of
 	style-related values in a font vector.
 	(font_property_table): Delete entries for QClanguage and
 	QCantialias, add entries for QCavgwidth.
 	(get_font_prop_index): Delete the 2nd argument FROM.
 	(font_prop_validate): Arguments changed.
-	(font_put_extra): Adjusted for the change of font-related objects.
+	(font_put_extra): Adjust for the change of font-related objects.
 	(font_expand_wildcards, font_parse_xlfd, font_unparse_xlfd)
 	(font_parse_fcname, font_unparse_fcname)
 	(font_prepare_composition): Likewise.
 	(font_parse_family_registry): Renamed from font_merge_old_spec.
 	(otf_open): Delete the 1st arg entity.
-	(font_otf_capability): Adjusted for the above change.
+	(font_otf_capability): Adjust for the above change.
 	(font_score): New arg alternate_families.  Adjusted for the change
 	of font-related objects.
 	(font_sort_entites): New arg best_only.
@@ -17825,27 +18040,27 @@
 	(font_match_p): Check alternate families.
 	(font_find_object): Delete it.
 	(font_check_object): New function.
-	(font_clear_cache): Adjusted for the change of font-related objects.
+	(font_clear_cache): Adjust for the change of font-related objects.
 	(font_delete_unmatched): New arg.
 	(font_list_entities): Call font_driver->list with a spec that
 	doesn't specify style-related properties.
 	(font_matching_entity): Arguments changed.  Caller changed.
-	(font_open_entity): Adjusted for the change of font-related objects.
+	(font_open_entity): Adjust for the change of font-related objects.
 	(font_close_object, font_has_char, font_encode_char)
 	(font_get_name, font_get_spec): Likewise.
 	(font_spec_from_name, font_clear_prop, font_update_lface):
 	New functions.
 	(font_find_for_lface, font_open_for_lface, font_load_for_lface)
 	(font_prepare_for_face, font_done_for_face, font_open_by_name)
-	(font_at): Adjusted for the change of font-related objects.
+	(font_at): Adjust for the change of font-related objects.
 	(font_range): New function.
 	(Ffontp, Ffont_spec, Ffont_get, Ffont_put, Flist_fonts)
-	(Ffont_xlfd_name): Adjusted for the change of font-related objects.
+	(Ffont_xlfd_name): Adjust for the change of font-related objects.
 	(Fcopy_font_spec, Fmerge_font_spec): New function.
 	(Ffont_family_list): Renamed from list-families.
 	(Finternal_set_font_style_table): Arguments changed.
 	(Ffont_fill_gstring, Ffont_shape_text, Fopen_font)
-	(Ffont_drive_otf, Fquery_font, Ffont_match_p): Adjusted for the
+	(Ffont_drive_otf, Fquery_font, Ffont_match_p): Adjust for the
 	change of font-related objects.
 	(syms_of_font): Delete "ifdef USE_FONT_BACKEND".  DEFSYM new symbols.
 
@@ -17855,8 +18070,8 @@
 	(enum FONT_SPEC_INDEX): Delete it.
 	(font_info, list_fonts_func, load_font_func, query_font_func)
 	(set_frame_fontset_func, find_ccl_program_func)
-	(get_font_repertory_func, new_fontset_from_font_name): Delete
-	externs.
+	(get_font_repertory_func, new_fontset_from_font_name):
+	Delete externs.
 	(fontset_from_font_name): Extern it.
 	(FS_LOAD_FONT, FONT_INFO_ID, FONT_INFO_FROM_ID)
 	(FONT_INFO_FROM_FACE): Deleted.
@@ -17886,7 +18101,7 @@
 	(face_for_char): Likewise.  Call face_for_char with font_object.
 	(fs_load_font): Delete.  Delete #pragma surrounding it.
 	(fs_query_fontset): Use strcasecmp instead of strcmp.
-	(generate_ascii_font_name): Adjusted for the format change of
+	(generate_ascii_font_name): Adjust for the format change of
 	font-spec.
 	(Fset_fontset_font): Likewise.  Use new macros to set elements of
 	font-def.
@@ -17897,7 +18112,7 @@
 	a fontset is already created for the font.  FIx updating of
 	Vfontset_alias_alist.
 	(fontset_ascii_font): Deleted.
-	(Ffont_info): Adjusted for the format change of font-spec.
+	(Ffont_info): Adjust for the format change of font-spec.
 	(Finternal_char_font): Likewise.
 	(Ffontset_info): Likewise.
 	(syms_of_fontset): Don't check load_font_func.
@@ -17913,13 +18128,13 @@
 	(x_set_font_backend): Use FRAME_FONT macro to check if a font is
 	already set for the frame.
 
-	* ftfont.c (ftfont_pattern_entity): Argument FRAME removed.  Make
-	a font-entity by font_make_entity.  Use font_intern_prop instead
+	* ftfont.c (ftfont_pattern_entity): Argument FRAME removed.
+	Make a font-entity by font_make_entity.  Use font_intern_prop instead
 	of intern_downcase.  Use FONT_SET_STYLE to set a style-related
 	font property.  If a font is scalable, set avgwidth property to 0.
 	Set font-entity property by font_put_extra.
 	(ftfont_list_generic_family): Argument SPEC and REGISTRY removed.
-	(ffont_driver): Adjusted for the change of struct font_driver.
+	(ffont_driver): Adjust for the change of struct font_driver.
 	(ftfont_spec_pattern): New function.
 	(ftfont_list): Return a list, not vector.
 	(ftfont_match): Use ftfont_spec_pattern to get a pattern.
@@ -17930,7 +18145,7 @@
 	font property.  Don't update dpyinfo->smallest_font_height and
 	dpyinfo->smallest_char_width.
 	(ftfont_close): Don't free `struct font'.
-	(ftfont_has_char): Adjusted for the format change of font-entity.
+	(ftfont_has_char): Adjust for the format change of font-entity.
 	(ftfont_encode_char, ftfont_text_extents): Likewise.
 
 	* ftxfont.c (ftxfont_list): Return a list, not vector.
@@ -17939,10 +18154,10 @@
 	font property.  Don't update dpyinfo->smallest_font_height and
 	dpyinfo->smallest_char_width.
 	(ftxfont_close): Don't decrease FRAME_X_DISPLAY_INFO (f)->n_fonts.
-	(ftxfont_draw): Adjusted for the change of struct font.
-
-	* image.c (image_ascent): Don't include "charset.h".  Include
-	"character.h" and "font.h".
+	(ftxfont_draw): Adjust for the change of struct font.
+
+	* image.c (image_ascent): Don't include "charset.h".
+	Include "character.h" and "font.h".
 
 	* lisp.h (enum pvec_type): New member PREV_FONT.
 	(Fassoc_string): EXFUN it.
@@ -17960,19 +18175,19 @@
 	'struct font *'.
 	(get_char_face_and_encoding): Assign the whole encoding task to
 	the `encode-char' method of a font driver.
-	(fill_composite_glyph_string): Adjusted for the change of `struct
+	(fill_composite_glyph_string): Adjust for the change of `struct
 	face' and `struct glyph_string'.
 	(fill_glyph_string): Likewise.
 	(get_per_char_metric): Arguments changed.
-	(x_get_glyph_overhangs): Adjusted for the change of `struct face'
+	(x_get_glyph_overhangs): Adjust for the change of `struct face'
 	and `struct glyph_string'.
 	(produce_stretch_glyph, calc_line_height_property)
 	(x_produce_glyphs): Likewise.
 
 	* xfaces.c: Throughout the file, delete all USE_FONT_BACKEND
 	conditionals.  Don't check enable_font_backend.  Delete all codes
-	used only when USE_FONT_BACKEND is not defined.  Use
-	FONT_XXX_NAME_NUMERIC instead of face_numeric_xxx.
+	used only when USE_FONT_BACKEND is not defined.
+	Use FONT_XXX_NAME_NUMERIC instead of face_numeric_xxx.
 	(QCfoundry, QCadstyle, QCregistry, QCspacing, QCsize, QCavgwidth)
 	(Qp): Extern them.
 	(clear_font_table, load_face_font, xlfd_lookup_field_contents):
@@ -18045,7 +18260,7 @@
 	(xfont_query_font): Deleted.
 	(xfont_find_ccl_program): Renamed from x_find_ccl_program and
 	moved from xterm.c.
-	(xfont_driver): Adjusted for the change of struct font_driver.
+	(xfont_driver): Adjust for the change of struct font_driver.
 	(compare_font_names): New function.
 	(xfont_list_pattern): Sort font names case insensitively.  Make
 	font_entity by calling font_make_entity.  Avoid auto-scaled fonts.
@@ -18057,16 +18272,16 @@
 	font property.  Don't update dpyinfo->smallest_font_height and
 	dpyinfo->smallest_char_width.
 	(xfont_close): Don't free struct font.
-	(xfont_prepare_face): Adjusted for the change of struct font.
+	(xfont_prepare_face): Adjust for the change of struct font.
 	(xfont_done_face): Deleted.
-	(xfont_has_char): Adjusted for the change of struct font.
+	(xfont_has_char): Adjust for the change of struct font.
 	(xfont_encode_char, xfont_draw): Likewise.
 	(xfont_check): New function.
 
-	* xftfont.c (xftfont_list): Adjusted for the change of `list'
+	* xftfont.c (xftfont_list): Adjust for the change of `list'
 	callback function.
-	(xftfont_match): Adjusted for the format change of font-entity.
-	(xftfont_open): Adjusted for the format change of font-entity and
+	(xftfont_match): Adjust for the format change of font-entity.
+	(xftfont_open): Adjust for the format change of font-entity and
 	font-object.  Adjusted for the change of struct font.  Return a
 	font-object.  Don't update dpyinfo->smallest_font_height and
 	dpyinfo->smallest_char_width.
@@ -18090,7 +18305,7 @@
 	used only when USE_FONT_BACKEND is not defined.  Don't include ccl.h.
 	(x_per_char_metric, x_encode_char): Deleted.
 	(x_set_cursor_gc, x_set_mouse_face_gc): Don't set GCFont.
-	(x_compute_glyph_string_overhangs): Adjusted for the change of
+	(x_compute_glyph_string_overhangs): Adjust for the change of
 	`struct face'.
 	(x_draw_glyph_string_foreground)
 	(x_draw_composite_glyph_string_foreground): Likewise.
@@ -18102,7 +18317,7 @@
 	(x_font_min_bounds, x_compute_min_glyph_bounds, x_load_font)
 	(x_query_font, x_get_font_repertory): Deleted.
 	(x_find_ccl_program): Renamed and moved to xfont.c.
-	(x_redisplay_interface): Adjusted for the change of `struct
+	(x_redisplay_interface): Adjust for the change of `struct
 	redisplay_interface'.
 
 	* w32fns.c: Throughout the file, delete all USE_FONT_BACKEND
@@ -18137,19 +18352,19 @@
 	Use FONT_SET_STYLE to set a style-related font property.  If a
 	font is scalable, set avgwidth property to 0.  Set font-entity
 	property by font_put_extra.
-	(font_matches_spec): Adjusted for the format change of font-entity.
+	(font_matches_spec): Adjust for the format change of font-entity.
 	(w32_weight_table, w32_decode_weight): New variables.
 	(w32_encode_weight): New function.
-	(fill_in_logfont): Adjusted for the format change of font-spec.
+	(fill_in_logfont): Adjust for the format change of font-spec.
 	(w32font_full_name): Use FONT_WEIGHT_SYMBOLIC to get a symbol
 	weight value.
-	(w32font_driver): Adjusted for the change of struct font_driver.
+	(w32font_driver): Adjust for the change of struct font_driver.
 
 	* w32term.h: Throughout the file, delete all USE_FONT_BACKEND
 	conditionals.  Don't check enable_font_backend.  Surround non-used
 	code by "#ifdef OLD_FONT" and "endif".
 	(FONT_WIDTH, FONT_HEIGHT, FONT_BASE, FONT_DESCENT)
-	(FONT_AVG_WIDTH): Adjusted for the change of struct font.
+	(FONT_AVG_WIDTH): Adjust for the change of struct font.
 
 	* w32term.c: Throughout the file, delete all USE_FONT_BACKEND
 	conditionals.  Don't check enable_font_backend.  Delete all codes
@@ -18159,9 +18374,9 @@
 	* w32uniscribe.c: Delete USE_FONT_BACKEND conditional.
 	(uniscribe_open): Return value changed to font-object.
 	Adjusted for the format change of font-object.
-	(uniscribe_otf_capability): Adjusted for the change of struct font.
+	(uniscribe_otf_capability): Adjust for the change of struct font.
 	(add_opentype_font_name_to_list): Don't downcase names.
-	(uniscribe_font_driver): Adjusted for the change of struct
+	(uniscribe_font_driver): Adjust for the change of struct
 	font_driver.
 
 2008-05-13  Chong Yidong  <cyd@stupidchicken.com>
@@ -20312,8 +20527,8 @@
 
 2008-02-01  Kenichi Handa  <handa@ni.aist.go.jp>
 
-	* coding.c (decode_coding_object, encode_coding_object): Adjust
-	marker positions after conversion.
+	* coding.c (decode_coding_object, encode_coding_object):
+	Adjust marker positions after conversion.
 
 	* lisp.h (struct Lisp_Marker): New member need_adjustment.
 
@@ -20882,8 +21097,8 @@
 
 2008-02-01  Jason Rumney  <jasonr@gnu.org>
 
-	* w32term.c (x_set_glyph_string_clipping): Use
-	get_glyph_string_clip_rects.
+	* w32term.c (x_set_glyph_string_clipping):
+	Use get_glyph_string_clip_rects.
 	(x_set_glyph_string_clipping_exactly, x_draw_glyph_string):
 	Adjust for the change of struct glyph_string.
 
@@ -20894,8 +21109,8 @@
 	* xftfont.c (xftfont_draw): Adjust for the change of struct
 	glyph_string.
 
-	* xterm.c (x_set_glyph_string_clipping): Use
-	get_glyph_string_clip_rects.
+	* xterm.c (x_set_glyph_string_clipping):
+	Use get_glyph_string_clip_rects.
 	(x_set_glyph_string_clipping_exactly, x_draw_glyph_string):
 	Adjust for the change of struct glyph_string.
 
@@ -21072,8 +21287,8 @@
 	constant.  Save QCspacing value.  Save list of scripts instead of
 	binary subranges.
 	(w32_generic_family, logfonts_match, font_matches_spec): New functions.
-	(add_font_entity_to_list): Use font_callback_data struct.  Filter
-	unwanted fonts.
+	(add_font_entity_to_list): Use font_callback_data struct.
+	Filter unwanted fonts.
 	(add_one_font_entity_to_list): Use font_callback_data struct.
 	(w32_registry): Default to iso10646_1.
 	(fill_in_logfont): Use dpi from extra slot.  Don't bother with
@@ -21294,8 +21509,8 @@
 
 2008-02-01  Kenichi Handa  <handa@m17n.org>
 
-	* xterm.c (x_draw_composite_glyph_string_foreground): Fix
-	indexing into elements of s->cmp and s->char2b.
+	* xterm.c (x_draw_composite_glyph_string_foreground):
+	Fix indexing into elements of s->cmp and s->char2b.
 
 2008-02-01  Juanma Barranquero  <lekktu@gmail.com>
 
@@ -21533,8 +21748,8 @@
 
 	* font.c (font_parse_fcname, font_parse_name): Don't change :name
 	property of FONT.
-	(LGSTRING_HEADER_SIZE, LGSTRING_GLYPH_SIZE, check_gstring): Define
-	them unconditionally.
+	(LGSTRING_HEADER_SIZE, LGSTRING_GLYPH_SIZE, check_gstring):
+	Define them unconditionally.
 	(font_matching_entity): New function.
 	(font_open_by_name): Try font_matching_entity if exact match is
 	not found.
@@ -21579,8 +21794,8 @@
 	(font_prepare_composition): Set cmp->glyph_len.
 	(font_open_entity): Set font->scalable.
 	(Ffont_get): Handle :otf property.
-	(Ffont_otf_gsub, Ffont_otf_gpos, Ffont_otf_alternates): New
-	functions.
+	(Ffont_otf_gsub, Ffont_otf_gpos, Ffont_otf_alternates):
+	New functions.
 	(Fquery_font): Use font->font.full_name.
 	(syms_of_font): Defsubr Sfont_otf_gsub, Sfont_otf_gpos, and
 	Sfont_otf_alternates.
@@ -21649,8 +21864,8 @@
 	(font_at): New function.
 	(Ffont_get): If FONT is a font-object, get entity from it.
 	(Ffont_make_gstring): Initialize elements of glyphs with nil.
-	(Ffont_fill_gstring): Use macro LGSTRING_XXX and LGLYPH_XXX.  Fix
-	range check.
+	(Ffont_fill_gstring): Use macro LGSTRING_XXX and LGLYPH_XXX.
+	Fix range check.
 	(Ffont_at): New function.
 	(syms_of_font): Defsubr Sfont_at.
 
@@ -21681,7 +21896,7 @@
 2008-02-01  Kenichi Handa  <handa@m17n.org>
 
 	* font.h (LGLYPH_XOFF, LGLYPH_YOFF, LGLYPH_WIDTH, LGLYPH_WADJUST)
-	(LGLYPH_SET_WIDTH): Adjusted for the change of LGLYPH format.
+	(LGLYPH_SET_WIDTH): Adjust for the change of LGLYPH format.
 	(LGLYPH_ADJUSTMENT, LGLYPH_SET_ADJUSTMENT): New macros.
 
 	* font.c (font_merge_old_spec): Treat '*' in foundry as a wild card.
@@ -21743,8 +21958,8 @@
 	(font_prop_validate_extra): Delete.
 	(font_prop_validate_spacing): New function.
 	(font_property_table): Add elements for all known properties.
-	(get_font_prop_index): Rename from check_font_prop_name.  New
-	argument FROM.  Change caller.
+	(get_font_prop_index): Rename from check_font_prop_name.
+	New argument FROM.  Change caller.
 	(font_prop_validate): Validate all known properties.
 	(font_put_extra): Delete argument force.  Change caller.
 	(font_expand_wildcards): Make it static.  Fix the way of shrinking
@@ -21816,8 +22031,8 @@
 	(font_open_for_lface, font_open_by_name): Fix handling of font size.
 	(Ffont_spec): Add QCname property that contains only unknown properties.
 
-	* ftfont.c (ftfont_list): Use assq_no_quit, not Fassq.  Don't
-	include weight in listing pattern, instead check weight of each
+	* ftfont.c (ftfont_list): Use assq_no_quit, not Fassq.
+	Don't include weight in listing pattern, instead check weight of each
 	listed font.  Don't include scalable in pattern.  Pay attention to
 	FONT_PIXEL_SIZE_QUANTUM.
 
@@ -21852,8 +22067,8 @@
 
 	* font.c (XLFD_SMALLNUM_MASK): Delete this macro.
 	(XLFD_LARGENUM_MASK): Delete XLFD_ENCODING_MASK from it.
-	(font_expand_wildcards): Fix handling ENCODING field.  Avoid
-	unnecessary checks for weight, slant, and swidth.
+	(font_expand_wildcards): Fix handling ENCODING field.
+	Avoid unnecessary checks for weight, slant, and swidth.
 	(font_parse_fcname): New function.
 	(font_unparse_fcname): New function.
 	(font_parse_name): New function.
@@ -22087,8 +22302,8 @@
 	* xfns.c [USE_FONT_BACKEND]: Include "font.h".
 	(x_default_font_parameter) [USE_FONT_BACKEND]: New function.
 	(Fx_create_frame) [USE_FONT_BACKEND]: If enable_font_backend is
-	nonzero, register all available font drivers.  Call
-	x_default_font_parameter for deciding a font.
+	nonzero, register all available font drivers.
+	Call x_default_font_parameter for deciding a font.
 	(x_create_tip_frame) [USE_FONT_BACKEND]: Likewise.
 
 	* xterm.c [USE_FONT_BACKEND]: Include "font.h".
@@ -22132,8 +22347,8 @@
 
 2008-02-01  Kenichi Handa  <handa@m17n.org>
 
-	* coding.c (DECODE_EMACS_MULE_20_RELATIVE_COMPOSITION): Fix
-	condition to terminate the loop.
+	* coding.c (DECODE_EMACS_MULE_20_RELATIVE_COMPOSITION):
+	Fix condition to terminate the loop.
 
 2008-02-01  Kenichi Handa  <handa@m17n.org>
 
@@ -22166,8 +22381,8 @@
 
 2008-02-01  Kenichi Handa  <handa@m17n.org>
 
-	* xterm.c (x_set_glyph_string_clipping_exactly): Set
-	src->clip_head and src->clip_tail temporarily instead of src->hl.
+	* xterm.c (x_set_glyph_string_clipping_exactly):
+	Set src->clip_head and src->clip_tail temporarily instead of src->hl.
 
 	* ccl.c (CCL_WRITE_STRING): Handle a flag bit for multibyte
 	character sequence.
@@ -22199,8 +22414,8 @@
 	(BUILD_COMPOSITE_GLYPH_STRING): If C is TAB, set s->face to NULL.
 	(x_produce_glyphs): If CH is TAB, set cmp->offsets properly.
 
-	* xterm.c (x_draw_composite_glyph_string_foreground): Check
-	s->face is NULL or not.
+	* xterm.c (x_draw_composite_glyph_string_foreground):
+	Check s->face is NULL or not.
 
 2008-02-01  Kenichi Handa  <handa@m17n.org>
 
@@ -22250,8 +22465,8 @@
 	Qnil.  Use JIS_TO_SJIS instead of ENCODE_SJIS.
 	(decode_mac_font_name): Use decode_coding_c_string instead of
 	decode_coding.
-	(x_load_font): Initialize fontp->fontset to -1.  Set
-	fontp->encoding_type.
+	(x_load_font): Initialize fontp->fontset to -1.
+	Set fontp->encoding_type.
 
 2008-02-01  Kenichi Handa  <handa@m17n.org>
 
@@ -22298,8 +22513,8 @@
 	(emacs${EXEEXT}): Run $(RUN_TEMACS) unconditionally.
 	(UNIDATA): New variable.
 	(${lispsource}international/charprop.el): Depends on ${UNIDATA}.
-	(bootstrap-emacs${EXEEXT}): Depends on charprop.el.  Run
-	$(RUN_TEMACS) unconditionally.
+	(bootstrap-emacs${EXEEXT}): Depends on charprop.el.
+	Run $(RUN_TEMACS) unconditionally.
 
 2008-02-01  Kenichi Handa  <handa@m17n.org>
 
@@ -22316,10 +22531,10 @@
 
 	* w32select.c (validate_coding_system)
 	(setup_windows_coding_system): New functions.
-	(convert_to_handle_as_coded, Fw32_get_clipboard_data): Use
-	setup_windows_coding_system.
-	(setup_config, Fw32_get_clipboard_data): Use
-	validate_coding_system.
+	(convert_to_handle_as_coded, Fw32_get_clipboard_data):
+	Use setup_windows_coding_system.
+	(setup_config, Fw32_get_clipboard_data):
+	Use validate_coding_system.
 	(Fx_selection_exists): Move call to setup_config to a place
 	where signals are allowed.
 
@@ -22401,8 +22616,8 @@
 
 	* fontset.c (fs_load_font): Use fast_string_match_ignore_case
 	instead of fast_c_string_match_ignore_case.
-	(find_font_encoding): Change argument to Lisp_Object.  Use
-	fast_string_match_ignore_case instead of
+	(find_font_encoding): Change argument to Lisp_Object.
+	Use fast_string_match_ignore_case instead of
 	fast_c_string_match_ignore_case.  Change caller.
 
 2008-02-01  Kenichi Handa  <handa@m17n.org>
@@ -22429,13 +22644,13 @@
 	Qundecided.
 	(Fterminal_coding_system): Return nil if terminal coding system is
 	`undecided'.
-	(syms_of_coding): Define coding-system `undecided' here.  Setup
-	terminal_coding as `undecided'.
-
-2008-02-01  Kenichi Handa  <handa@m17n.org>
-
-	* xdisp.c (message_dolog, set_message_1): Call
-	unibyte_char_to_multibyte with arg type int.
+	(syms_of_coding): Define coding-system `undecided' here.
+	Setup terminal_coding as `undecided'.
+
+2008-02-01  Kenichi Handa  <handa@m17n.org>
+
+	* xdisp.c (message_dolog, set_message_1):
+	Call unibyte_char_to_multibyte with arg type int.
 
 	* lread.c (read1): Fix reading of a char-table.
 
@@ -22533,8 +22748,8 @@
 
 2008-02-01  Kenichi Handa  <handa@m17n.org>
 
-	* coding.c (Ffind_coding_systems_region_internal): Include
-	raw-text and no-conversion in the result.
+	* coding.c (Ffind_coding_systems_region_internal):
+	Include raw-text and no-conversion in the result.
 
 2008-02-01  Kenichi Handa  <handa@m17n.org>
 
@@ -22590,16 +22805,16 @@
 
 	* fontset.c: Include "intervals.h".
 	(fontset_face): Fix comparing of Lisp_Objects.
-	(free_face_fontset, new_fontset_from_font_name): Fix
-	Lisp_Object/int mixup.
+	(free_face_fontset, new_fontset_from_font_name):
+	Fix Lisp_Object/int mixup.
 
 	* editfns.c (Ftranslate_region_internal): Fix Lisp_Object/int mixup.
 
 	* coding.c: Add many prototypes for static functions.
 	(get_translation_table): Allow max_lookup to be NULL.
 	(decode_coding, Ffind_coding_systems_region_internal)
-	(Funencodable_char_position, Fcheck_coding_systems_region): Call
-	get_translation_table with max_lookup NULL.
+	(Funencodable_char_position, Fcheck_coding_systems_region):
+	Call get_translation_table with max_lookup NULL.
 
 2008-02-01  Kenichi Handa  <handa@m17n.org>
 
@@ -22728,8 +22943,8 @@
 	(Fdefine_coding_system_internal): Accept list of translation
 	tables as :encode-translation-table and :decode-translation-table.
 	(Fcoding_system_put): New function.
-	(syms_of_coding): Declare new symbols.  Defsubr
-	Scoding_system_put.
+	(syms_of_coding): Declare new symbols.
+	Defsubr Scoding_system_put.
 	(decode_coding_sjis, encode_coding_sjis): Handle 4th charset,
 	typically JISX0212.
 
@@ -22850,8 +23065,8 @@
 	* chartab.c (map_sub_char_table_for_charset): Fix args to
 	c_function with.
 
-	* coding.h (enum coding_result_code): Delete
-	CODING_RESULT_INSUFFICIENT_CMP, add CODING_RESULT_INVALID_SRC.
+	* coding.h (enum coding_result_code):
+	Delete CODING_RESULT_INSUFFICIENT_CMP, add CODING_RESULT_INVALID_SRC.
 
 	* coding.c (Qinsufficient_source, Qinconsistent_eol)
 	(Qinvalid_source, Qinterrupted, Qinsufficient_memory): New variables.
@@ -23063,8 +23278,8 @@
 
 	* w32console.c: Include character.h.  Use terminal_encode_buffer
 	from term.c.
-	(write_glyphs): Use new version of encode_terminal_code.  Use
-	encode_coding_object in place of encode_coding.
+	(write_glyphs): Use new version of encode_terminal_code.
+	Use encode_coding_object in place of encode_coding.
 
 	* w32bdf.c (w32_load_bdf_font): Clear font_info before filling.
 	encoding becomes encoding_type.
@@ -23088,16 +23303,16 @@
 	* charset.h (charset_unicode): Extern it.
 
 	* charset.c (string_xstring_p): Check by (C >= 0x100).
-	(find_charsets_in_text): Change format of the arc CHARSETS.  New
-	arg MULTIBYTE.
+	(find_charsets_in_text): Change format of the arc CHARSETS.
+	New arg MULTIBYTE.
 	(Ffind_charset_region, Ffind_charset_string): Adjust for the
 	change of find_charsets_in_text.
 	(Fsplit_char): Fix doc.  Never return unknown.
 
 	* chartab.c (char_table_translate): Use CHARACTERP, not INTEGERP.
 
-	* coding.c (Fdefine_coding_system_alias): Update
-	Vcoding_system_list.
+	* coding.c (Fdefine_coding_system_alias):
+	Update Vcoding_system_list.
 
 	* fontset.c (load_font_get_repertory): Pay attention to the case
 	that ENCODING of a font is specified by a char-table.
@@ -23107,16 +23322,16 @@
 
 2008-02-01  Kenichi Handa  <handa@m17n.org>
 
-	* term.c (encode_terminal_code): Don't handle glyph-table.  Check
-	if a character is encodable by the terminal coding system.  If
-	not, produces proper number of `?'s.  Update
+	* term.c (encode_terminal_code): Don't handle glyph-table.
+	Check if a character is encodable by the terminal coding system.
+	If not, produces proper number of `?'s.  Update
 	terminal_encode_buffer and terminal_encode_buf_size if necessary.
 	(produce_glyphs): Check by CHAR_BYTE8_P, not SINGLE_BYTE_CHAR_P.
 
 2008-02-01  Kenichi Handa  <handa@m17n.org>
 
-	* term.c (terminal_encode_buffer, terminal_encode_buf_size): New
-	variables.
+	* term.c (terminal_encode_buffer, terminal_encode_buf_size):
+	New variables.
 	(encode_terminal_code): Change argument.  Encode multiple
 	characters at once.  Store the result of encoding in
 	terminal_encode_buffer.
@@ -23194,8 +23409,8 @@
 
 	* casetab.c (set_case_table): Remove unused var.
 
-	* window.c (Fdisplay_buffer, Fframe_selected_window): Remove
-	unused vars.
+	* window.c (Fdisplay_buffer, Fframe_selected_window):
+	Remove unused vars.
 
 2008-02-01  Dave Love  <fx@gnu.org>
 
@@ -23223,8 +23438,8 @@
 	(update_compositions, Ffind_composition_internal): Make buffer
 	positions EMACS_INT.
 
-	* composite.h (find_composition, update_compositions): Make
-	position args EMACS_INT.
+	* composite.h (find_composition, update_compositions):
+	Make position args EMACS_INT.
 
 	* keyboard.c (adjust_point_for_property): Make beg and end EMACS_INT.
 
@@ -23248,8 +23463,8 @@
 
 2008-02-01  Andreas Schwab  <schwab@suse.de>
 
-	* chartab.c (map_char_table, map_char_table_for_charset): Protect
-	`range' from GC.
+	* chartab.c (map_char_table, map_char_table_for_charset):
+	Protect `range' from GC.
 
 2008-02-01  Kenichi Handa  <handa@m17n.org>
 
@@ -23311,8 +23526,8 @@
 	(re_match_2_internal): Don't check RE_TARGET_MULTIBYTE_P (bufp).
 	It is the same as RE_MULTIBYTE_P (bufp) now.
 	<exactn>: Translate via multibyte.
-	<anychar>: Fetch a character by RE_STRING_CHAR_AND_LENGTH.  Don't
-	translate it.
+	<anychar>: Fetch a character by RE_STRING_CHAR_AND_LENGTH.
+	Don't translate it.
 	<charset, charset_not>: Fetch a character by
 	RE_STRING_CHAR_AND_LENGTH.  Translate via multibyte.
 	<duplicate>: Call bcmp_translate with the last arg `multibyte'.
@@ -23533,8 +23748,8 @@
 	FONT_SPEC_INDEX.  If font_spec is a string, extract the registry
 	name by using split_font_name_into_vector.
 	(Fnew_fontset): If no ASCII font is specified in FONTLIST,
-	generate a proper font name from the fontset name.  Update
-	Vfontset_alias_alist.
+	generate a proper font name from the fontset name.
+	Update Vfontset_alias_alist.
 	(n_auto_fontsets): New variable.
 	(new_fontset_from_font_name): New function.
 	(Ffont_info): Store the information about fonts generated from the
@@ -23599,8 +23814,8 @@
 	sequence is valid in this coding system.  Change callers.
 	(MAX_ANNOTATION_LENGTH): New macro.
 	(ADD_ANNOTATION_DATA): New macro.
-	(ADD_COMPOSITION_DATA): Change argument.  Change callers.  Call
-	ADD_ANNOTATION_DATA.  Change the format of annotation data.
+	(ADD_COMPOSITION_DATA): Change argument.  Change callers.
+	Call ADD_ANNOTATION_DATA.  Change the format of annotation data.
 	(ADD_CHARSET_DATA): New macro.
 	(emacs_mule_char): New argument ID.  Change callers.
 	(decode_coding_emacs_mule, decode_coding_iso_2022)
@@ -23614,8 +23829,8 @@
 	(produce_composition): Adjust for the new annotation data format.
 	(produce_charset): New function.
 	(produce_annotation): Handle charset annotation.
-	(handle_composition_annotation, handle_charset_annotation): New
-	functions.
+	(handle_composition_annotation, handle_charset_annotation):
+	New functions.
 	(consume_chars): Handle charset annotation.  Utilize the above two
 	functions.
 	(encode_coding_object): If SRC_OBJECT and DST_OBJECT are the same
@@ -23745,8 +23960,8 @@
 
 	* coding.c (detect_coding_charset): If only ASCII bytes are found,
 	return 0.
-	(Fdefine_coding_system_internal): Setup
-	CODING_ATTR_ASCII_COMPAT (attrs) correctly.
+	(Fdefine_coding_system_internal):
+	Setup CODING_ATTR_ASCII_COMPAT (attrs) correctly.
 
 2008-02-01  Dave Love  <fx@gnu.org>
 
@@ -23756,8 +23971,8 @@
 
 2008-02-01  Kenichi Handa  <handa@m17n.org>
 
-	* coding.c (decode_coding): Fix args to translate_chars.  Pay
-	attention to Vstandard_translation_table_for_decode.
+	* coding.c (decode_coding): Fix args to translate_chars.
+	Pay attention to Vstandard_translation_table_for_decode.
 	(encode_coding): Fix args to translate_chars.  Pay attention to
 	Vstandard_translation_table_for_encode.
 
@@ -23807,8 +24022,8 @@
 
 	* character.h (CHAR_STRING, CHAR_STRING_ADVANCE): Call char_string
 	if C is greater than MAX_3_BYTE_CHAR.
-	(STRING_CHAR, STRING_CHAR_AND_LENGTH, STRING_CHAR_ADVANCE): Call
-	string_char instead of string_char_with_unification.
+	(STRING_CHAR, STRING_CHAR_AND_LENGTH, STRING_CHAR_ADVANCE):
+	Call string_char instead of string_char_with_unification.
 
 2008-02-01  Dave Love  <fx@gnu.org>
 
@@ -23866,8 +24081,8 @@
 
 	* keyboard.c (read_key_sequence): Fix type error.
 
-	* buffer.c (Fset_buffer_multibyte, Fset_buffer_multibyte): Fix
-	type error.
+	* buffer.c (Fset_buffer_multibyte, Fset_buffer_multibyte):
+	Fix type error.
 
 	* fontset.c (fontset_add): Return Lisp_Object.
 
@@ -23919,8 +24134,8 @@
 	* regex.h (struct re_pattern_buffer): New member target_multibyte.
 
 	* regex.c (RE_TARGET_MULTIBYTE_P): New macro.
-	(GET_CHAR_BEFORE_2): Check target_multibyte, not multibyte.  If
-	that is zero, convert an eight-bit char to multibyte.
+	(GET_CHAR_BEFORE_2): Check target_multibyte, not multibyte.
+	If that is zero, convert an eight-bit char to multibyte.
 	(MAKE_CHAR_MULTIBYTE, CHAR_LEADING_CODE): New dummy new macros for
 	non-emacs case.
 	(PATFETCH): Convert an eight-bit char to multibyte.
@@ -23939,14 +24154,14 @@
 	multibyte always 1.
 	(re_search_2): In emacs, set the locale variable multibyte to 1,
 	otherwise to 0.  New local variable target_multibyte.  Check it
-	to decide the multibyteness of STR1 and STR2.  If
-	target_multibyte is zero, convert unibyte chars to multibyte
+	to decide the multibyteness of STR1 and STR2.
+	If target_multibyte is zero, convert unibyte chars to multibyte
 	before translating and checking fastmap.
 	(TARGET_CHAR_AND_LENGTH): New macro.
 	(re_match_2_internal): In emacs, set the locale variable multibyte
-	to 1, otherwise to 0.  New local variable target_multibyte.  Check
-	it to decide the multibyteness of STR1 and STR2.  Use
-	TARGET_CHAR_AND_LENGTH to fetch a character from D.
+	to 1, otherwise to 0.  New local variable target_multibyte.
+	Check it to decide the multibyteness of STR1 and STR2.
+	Use TARGET_CHAR_AND_LENGTH to fetch a character from D.
 	<charset, charset_not>: If multibyte is nonzero, check fastmap
 	only for ASCII chars.  Call bcmp_translate with
 	target_multibyte, not with multibyte.
@@ -24154,8 +24369,8 @@
 
 	* lisp.h (Fset_buffer_multibyte): Adjust prototype.
 
-	* xdisp.c (setup_echo_area_for_printing, set_message_1): Adjust
-	for the change of Fset_buffer_multibyte.
+	* xdisp.c (setup_echo_area_for_printing, set_message_1):
+	Adjust for the change of Fset_buffer_multibyte.
 
 	* fns.c (Fstring_to_multibyte): New function.
 	(syms_of_fns): Declare Fstring_to_multibyte as Lisp subroutine.
@@ -24250,11 +24465,11 @@
 	(find_font_encoding): New function.
 	(list_fontsets): Use STRINGP, not ! NILP.
 	(accumulate_script_ranges): New function.
-	(Fset_fontset_font, Fnew_fontset, Ffontset_info): Completely
-	re-written to handle new fontset structure.
+	(Fset_fontset_font, Fnew_fontset, Ffontset_info):
+	Completely re-written to handle new fontset structure.
 	(Ffontset_font): Return a copy of element.
-	(syms_of_fontset): Define symbols Qprepend and Qappend.  Fix
-	docstring of font-encoding-alist.
+	(syms_of_fontset): Define symbols Qprepend and Qappend.
+	Fix docstring of font-encoding-alist.
 
 	* lisp.h (CHAR_TABLE_REF): Remove unnecessary check (IDX >= 0).
 	(Fset_fotset_font): Fix arguments to 5.
@@ -24344,8 +24559,8 @@
 
 2008-02-01  Kenichi Handa  <handa@m17n.org>
 
-	* xdisp.c (face_before_or_after_it_pos): Call
-	FETCH_MULTIBYTE_CHAR with byte postion, not char position.
+	* xdisp.c (face_before_or_after_it_pos):
+	Call FETCH_MULTIBYTE_CHAR with byte postion, not char position.
 
 2008-02-01  Kenichi Handa  <handa@m17n.org>
 
@@ -24373,8 +24588,8 @@
 	deunify instead of unify a charset.
 	(string_xstring_p): Add `const' to local variables.
 	(find_charsets_in_text): Add `const' to arguments and local variables.
-	(encode_char): Adjust for the change of Funify_charset.  Fix
-	detecting of invalid code.
+	(encode_char): Adjust for the change of Funify_charset.
+	Fix detecting of invalid code.
 	(Fset_charset_priority): Increment charset_ordered_list_tick.
 	(Fmap_charset_chars): Fix handling of default value for FROM_CODE
 	and TO_CODE.
@@ -24407,8 +24622,8 @@
 
 2008-02-01  Dave Love  <fx@gnu.org>
 
-	* casetab.c (init_casetab_once, init_casetab_once): Fix
-	CHAR_TABLE_SET call.
+	* casetab.c (init_casetab_once, init_casetab_once):
+	Fix CHAR_TABLE_SET call.
 
 	* category.c (Fmodify_category_entry): Fix CATEGORY_MEMBER call.
 
@@ -24483,8 +24698,8 @@
 2008-02-01  Kenichi Handa  <handa@m17n.org>
 
 	* category.c (Fmodify_category_entry): Don't modify the contents
-	of category_set for characters out of the range.  Avoid
-	unnecessary modification.
+	of category_set for characters out of the range.
+	Avoid unnecessary modification.
 
 	* character.h (MAYBE_UNIFY_CHAR): Adjust for the change of
 	Vchar_unify_table.  The default value of the table is now nil.
@@ -24492,8 +24707,8 @@
 	* character.c (syms_of_character): Setup Vchar_width_table for
 	eight-bit-control and raw-byte chars.
 
-	* charset.h (enum define_charset_arg_index): Delete
-	charset_arg_parents and add charset_arg_subset and
+	* charset.h (enum define_charset_arg_index):
+	Delete charset_arg_parents and add charset_arg_subset and
 	charset_arg_superset.
 	(enum charset_attr_index): Delete charset_parents and add
 	charset_subset and charset_superset.
@@ -24509,8 +24724,8 @@
 
 	* charset.c (load_charset_map): Set the default value of encoder
 	and deunifier char-tables to nil.
-	(map_charset_chars): Change argument.  Change callers.  Use
-	map_char_table_for_charset instead of map_char_table.
+	(map_charset_chars): Change argument.  Change callers.
+	Use map_char_table_for_charset instead of map_char_table.
 	(Fmap_charset_chars): New optional args from_code and to_code.
 	(Fdefine_charset_internal): Adjust for the change of
 	`define-charset' (:parents -> :subset or :superset).
@@ -24519,8 +24734,8 @@
 	Fdefine_charset_internal.
 	(Ffind_charset_string): Setup the vector `charsets' correctly.
 
-	* chartab.c (sub_char_table_ref_and_range): New arg default.  Fix
-	the previous change.
+	* chartab.c (sub_char_table_ref_and_range): New arg default.
+	Fix the previous change.
 	(char_table_ref_and_range): Adjust for the above change.
 	(map_sub_char_table_for_charset): New function.
 	(map_char_table_for_charset): New function.
@@ -24663,8 +24878,8 @@
 2008-02-01  Kenichi Handa  <handa@m17n.org>
 
 	* coding.c (ONE_MORE_BYTE_NO_CHECK): Increment consumed_chars.
-	(emacs_mule_char): New arg src.  Delete arg `composition'.  Change
-	caller.  Handle 2-byte and 3-byte charsets correctly.
+	(emacs_mule_char): New arg src.  Delete arg `composition'.
+	Change caller.  Handle 2-byte and 3-byte charsets correctly.
 	(DECODE_EMACS_MULE_COMPOSITION_RULE_20): Rename from
 	DECODE_EMACS_MULE_COMPOSITION_RULE.  Change caller.
 	(DECODE_EMACS_MULE_COMPOSITION_RULE_21): New macro.
@@ -24709,8 +24924,8 @@
 
 	* character.h (string_escape_byte8): Declare.
 
-	* charset.c (load_charset_map, load_charset_map_from_file): Remove
-	unused vars.
+	* charset.c (load_charset_map, load_charset_map_from_file):
+	Remove unused vars.
 	(Fdefine_charset_internal, Fsplit_char, syms_of_charset)
 	(Fmap_charset_chars): Doc fix.
 
@@ -24781,8 +24996,8 @@
 	* coding.c (coding_set_source): Delete the local variable beg_byte.
 	(encode_coding_charset, Fdefine_coding_system_internal):
 	Delete the local variable charset.
-	(Fdefine_coding_system_internal): Setup
-	attrs[coding_attr_charset_valids] correctly.
+	(Fdefine_coding_system_internal):
+	Setup attrs[coding_attr_charset_valids] correctly.
 
 	* charset.c (CODE_POINT_TO_INDEX): Utilize `code_space_mask'
 	member to check if CODE is valid or not.
@@ -24804,8 +25019,8 @@
 
 2008-02-01  Kenichi Handa  <handa@m17n.org>
 
-	* coding.c (decode_coding_charset, encode_coding_charset): Handle
-	multiple charsets correctly.
+	* coding.c (decode_coding_charset, encode_coding_charset):
+	Handle multiple charsets correctly.
 
 2008-02-01  Kenichi Handa  <handa@m17n.org>
 
--- a/src/Makefile.in	Thu Dec 16 17:43:45 2010 -0500
+++ b/src/Makefile.in	Thu Dec 16 18:30:57 2010 -0500
@@ -54,8 +54,8 @@
 lispdir = ../lisp
 
 # Configuration files for .o files to depend on.
-M_FILE = $(srcdir)/@machfile@
-S_FILE = $(srcdir)/@opsysfile@
+M_FILE = @M_FILE@
+S_FILE = @S_FILE@
 config_h = config.h $(M_FILE) $(S_FILE)
 
 bootstrap_exe = $(abs_builddir)/bootstrap-emacs$(EXEEXT)
--- a/src/alloc.c	Thu Dec 16 17:43:45 2010 -0500
+++ b/src/alloc.c	Thu Dec 16 18:30:57 2010 -0500
@@ -5643,13 +5643,14 @@
   for (t = terminal_list; t; t = t->next_terminal)
     {
       eassert (t->name != NULL);
+#ifdef HAVE_WINDOW_SYSTEM
+      /* If a terminal object is reachable from a stacpro'ed object,
+	 it might have been marked already.  Make sure the image cache
+	 gets marked.  */
+      mark_image_cache (t->image_cache);
+#endif /* HAVE_WINDOW_SYSTEM */
       if (!VECTOR_MARKED_P (t))
-	{
-#ifdef HAVE_WINDOW_SYSTEM
-	  mark_image_cache (t->image_cache);
-#endif /* HAVE_WINDOW_SYSTEM */
-	  mark_vectorlike ((struct Lisp_Vector *)t);
-	}
+	mark_vectorlike ((struct Lisp_Vector *)t);
     }
 }
 
--- a/src/buffer.c	Thu Dec 16 17:43:45 2010 -0500
+++ b/src/buffer.c	Thu Dec 16 18:30:57 2010 -0500
@@ -6106,15 +6106,17 @@
 The variable `highlight-nonselected-windows' controls whether to highlight
 all windows or just the selected window.
 
-If the value is `lambda', that enables Transient Mark mode temporarily.
-After any subsequent action that would normally deactivate the mark
-\(such as buffer modification), Transient Mark mode is turned off.
-
-If the value is (only . OLDVAL), that enables Transient Mark mode
-temporarily.  After any subsequent point motion command that is not
-shift-translated, or any other action that would normally deactivate
-the mark (such as buffer modification), the value of
-`transient-mark-mode' is set to OLDVAL.  */);
+Lisp programs may give this variable certain special values:
+
+- A value of `lambda' enables Transient Mark mode temporarily.
+  It is disabled again after any subsequent action that would
+  normally deactivate the mark (e.g. buffer modification).
+
+- A value of (only . OLDVAL) enables Transient Mark mode
+  temporarily.  After any subsequent point motion command that is
+  not shift-translated, or any other action that would normally
+  deactivate the mark (e.g. buffer modification), the value of
+  `transient-mark-mode' is set to OLDVAL.  */);
   Vtransient_mark_mode = Qnil;
 
   DEFVAR_LISP ("inhibit-read-only", &Vinhibit_read_only,
--- a/src/charset.c	Thu Dec 16 17:43:45 2010 -0500
+++ b/src/charset.c	Thu Dec 16 18:30:57 2010 -0500
@@ -114,7 +114,7 @@
 /* List of emacs-mule charsets.  */
 Lisp_Object Vemacs_mule_charset_list;
 
-struct charset *emacs_mule_charset[256];
+int emacs_mule_charset[256];
 
 /* Mapping table from ISO2022's charset (specified by DIMENSION,
    CHARS, and FINAL-CHAR) to Emacs' charset.  */
@@ -1210,7 +1210,7 @@
 
   if (charset.emacs_mule_id >= 0)
     {
-      emacs_mule_charset[charset.emacs_mule_id] = CHARSET_FROM_ID (id);
+      emacs_mule_charset[charset.emacs_mule_id] = id;
       if (charset.emacs_mule_id < 0xA0)
 	emacs_mule_bytes[charset.emacs_mule_id] = charset.dimension + 1;
       else
@@ -2330,7 +2330,7 @@
 	iso_charset_table[i][j][k] = -1;
 
   for (i = 0; i < 256; i++)
-    emacs_mule_charset[i] = NULL;
+    emacs_mule_charset[i] = -1;
 
   charset_jisx0201_roman = -1;
   charset_jisx0208_1978 = -1;
--- a/src/charset.h	Thu Dec 16 17:43:45 2010 -0500
+++ b/src/charset.h	Thu Dec 16 18:30:57 2010 -0500
@@ -255,7 +255,7 @@
 extern Lisp_Object Viso_2022_charset_list;
 extern Lisp_Object Vemacs_mule_charset_list;
 
-extern struct charset *emacs_mule_charset[256];
+extern int emacs_mule_charset[256];
 
 extern Lisp_Object Vcurrent_iso639_language;
 
--- a/src/coding.c	Thu Dec 16 17:43:45 2010 -0500
+++ b/src/coding.c	Thu Dec 16 18:30:57 2010 -0500
@@ -2053,7 +2053,7 @@
   const unsigned char *src_end = coding->source + coding->src_bytes;
   const unsigned char *src_base = src;
   int multibytep = coding->src_multibyte;
-  struct charset *charset;
+  int charset_id;
   unsigned code;
   int c;
   int consumed_chars = 0;
@@ -2063,7 +2063,7 @@
   if (c < 0)
     {
       c = -c;
-      charset = emacs_mule_charset[0];
+      charset_id = emacs_mule_charset[0];
     }
   else
     {
@@ -2099,7 +2099,7 @@
       switch (emacs_mule_bytes[c])
 	{
 	case 2:
-	  if (! (charset = emacs_mule_charset[c]))
+	  if ((charset_id = emacs_mule_charset[c]) < 0)
 	    goto invalid_code;
 	  ONE_MORE_BYTE (c);
 	  if (c < 0xA0)
@@ -2112,7 +2112,7 @@
 	      || c == EMACS_MULE_LEADING_CODE_PRIVATE_12)
 	    {
 	      ONE_MORE_BYTE (c);
-	      if (c < 0xA0 || ! (charset = emacs_mule_charset[c]))
+	      if (c < 0xA0 || (charset_id = emacs_mule_charset[c]) < 0)
 		goto invalid_code;
 	      ONE_MORE_BYTE (c);
 	      if (c < 0xA0)
@@ -2121,7 +2121,7 @@
 	    }
 	  else
 	    {
-	      if (! (charset = emacs_mule_charset[c]))
+	      if ((charset_id = emacs_mule_charset[c]) < 0)
 		goto invalid_code;
 	      ONE_MORE_BYTE (c);
 	      if (c < 0xA0)
@@ -2136,7 +2136,7 @@
 
 	case 4:
 	  ONE_MORE_BYTE (c);
-	  if (c < 0 || ! (charset = emacs_mule_charset[c]))
+	  if (c < 0 || (charset_id = emacs_mule_charset[c]) < 0)
 	    goto invalid_code;
 	  ONE_MORE_BYTE (c);
 	  if (c < 0xA0)
@@ -2150,21 +2150,21 @@
 
 	case 1:
 	  code = c;
-	  charset = CHARSET_FROM_ID (ASCII_BYTE_P (code)
-				     ? charset_ascii : charset_eight_bit);
+	  charset_id = ASCII_BYTE_P (code) ? charset_ascii : charset_eight_bit;
 	  break;
 
 	default:
 	  abort ();
 	}
-      CODING_DECODE_CHAR (coding, src, src_base, src_end, charset, code, c);
+      CODING_DECODE_CHAR (coding, src, src_base, src_end,
+			  CHARSET_FROM_ID (charset_id), code, c);
       if (c < 0)
 	goto invalid_code;
     }
   *nbytes = src - src_base;
   *nchars = consumed_chars;
   if (id)
-    *id = charset->id;
+    *id = charset_id;
   return (mseq_found ? -c : c);
 
  no_more_source:
--- a/src/config.in	Thu Dec 16 17:43:45 2010 -0500
+++ b/src/config.in	Thu Dec 16 18:30:57 2010 -0500
@@ -663,9 +663,6 @@
 /* Define to 1 if you have the `sysinfo' function. */
 #undef HAVE_SYSINFO
 
-/* Define to 1 if you have the <sys/ioctl.h> header file. */
-#undef HAVE_SYS_IOCTL_H
-
 /* Define to 1 if you have the <sys/mman.h> header file. */
 #undef HAVE_SYS_MMAN_H
 
@@ -1092,7 +1089,9 @@
 
 /* Include the os and machine dependent files.  */
 #include config_opsysfile
-#include config_machfile
+#ifdef config_machfile
+# include config_machfile
+#endif
 
 /* GNUstep needs a bit more pure memory.  Of the existing knobs,
    SYSTEM_PURESIZE_EXTRA seems like the least likely to cause problems.
@@ -1200,6 +1199,12 @@
 #define NO_INLINE
 #endif
 
+#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1))
+#define EXTERNALLY_VISIBLE __attribute__((externally_visible))
+#else
+#define EXTERNALLY_VISIBLE
+#endif
+
 /* Some versions of GNU/Linux define noinline in their headers.  */
 #ifdef noinline
 #undef noinline
--- a/src/dispextern.h	Thu Dec 16 17:43:45 2010 -0500
+++ b/src/dispextern.h	Thu Dec 16 18:30:57 2010 -0500
@@ -2178,6 +2178,12 @@
      OVERLAY_STRING_CHUNK_SIZE.  */
   int n_overlay_strings;
 
+  /* The charpos where n_overlay_strings was calculated.  This should
+     be set at the same time as n_overlay_strings.  It is needed
+     because we show before-strings at the start of invisible text;
+     see handle_invisible_prop in xdisp.c.  */
+  int overlay_strings_charpos;
+
   /* Vector of overlays to process.  Overlay strings are processed
      OVERLAY_STRING_CHUNK_SIZE at a time.  */
 #define OVERLAY_STRING_CHUNK_SIZE 16
--- a/src/editfns.c	Thu Dec 16 17:43:45 2010 -0500
+++ b/src/editfns.c	Thu Dec 16 18:30:57 2010 -0500
@@ -218,11 +218,13 @@
 }
 
 DEFUN ("byte-to-string", Fbyte_to_string, Sbyte_to_string, 1, 1, 0,
-       doc: /* Convert arg BYTE to a string containing that byte.  */)
+       doc: /* Convert arg BYTE to a unibyte string containing that byte.  */)
   (Lisp_Object byte)
 {
   unsigned char b;
   CHECK_NUMBER (byte);
+  if (XINT (byte) < 0 || XINT (byte) > 255)
+    error ("Invalid byte");
   b = XINT (byte);
   return make_string_from_bytes (&b, 1, 1);
 }
--- a/src/emacs.c	Thu Dec 16 17:43:45 2010 -0500
+++ b/src/emacs.c	Thu Dec 16 18:30:57 2010 -0500
@@ -100,27 +100,27 @@
 /* Make these values available in GDB, which doesn't see macros.  */
 
 #ifdef USE_LSB_TAG
-int gdb_use_lsb = 1;
+int gdb_use_lsb EXTERNALLY_VISIBLE = 1;
 #else
-int gdb_use_lsb = 0;
+int gdb_use_lsb EXTERNALLY_VISIBLE = 0;
 #endif
 #ifndef USE_LISP_UNION_TYPE
-int gdb_use_union = 0;
+int gdb_use_union EXTERNALLY_VISIBLE  = 0;
 #else
-int gdb_use_union = 1;
+int gdb_use_union EXTERNALLY_VISIBLE = 1;
 #endif
-EMACS_INT gdb_valbits = VALBITS;
-EMACS_INT gdb_gctypebits = GCTYPEBITS;
+EMACS_INT gdb_valbits EXTERNALLY_VISIBLE = VALBITS;
+EMACS_INT gdb_gctypebits EXTERNALLY_VISIBLE = GCTYPEBITS;
 #if defined (DATA_SEG_BITS) && ! defined (USE_LSB_TAG)
-EMACS_INT gdb_data_seg_bits = DATA_SEG_BITS;
+EMACS_INT gdb_data_seg_bits EXTERNALLY_VISIBLE = DATA_SEG_BITS;
 #else
-EMACS_INT gdb_data_seg_bits = 0;
+EMACS_INT gdb_data_seg_bits EXTERNALLY_VISIBLE = 0;
 #endif
-EMACS_INT PVEC_FLAG = PSEUDOVECTOR_FLAG;
-EMACS_INT gdb_array_mark_flag = ARRAY_MARK_FLAG;
+EMACS_INT PVEC_FLAG EXTERNALLY_VISIBLE = PSEUDOVECTOR_FLAG;
+EMACS_INT gdb_array_mark_flag EXTERNALLY_VISIBLE = ARRAY_MARK_FLAG;
 /* GDB might say "No enum type named pvec_type" if we don't have at
    least one symbol with that type, and then xbacktrace could fail.  */
-enum pvec_type gdb_pvec_type = PVEC_TYPE_MASK;
+enum pvec_type gdb_pvec_type EXTERNALLY_VISIBLE = PVEC_TYPE_MASK;
 
 /* Command line args from shell, as list of strings.  */
 Lisp_Object Vcommand_line_args;
--- a/src/fileio.c	Thu Dec 16 17:43:45 2010 -0500
+++ b/src/fileio.c	Thu Dec 16 18:30:57 2010 -0500
@@ -786,6 +786,9 @@
 so are file name components followed by `..', along with the `..' itself;
 note that these simplifications are done without checking the resulting
 file names in the file system.
+Multiple consecutive slashes are collapsed into a single slash,
+except at the beginning of the file name when they are significant (e.g.,
+UNC file names on MS-Windows.)
 An initial `~/' expands to your home directory.
 An initial `~USER/' expands to USER's home directory.
 See also the function `substitute-in-file-name'.
@@ -793,7 +796,7 @@
 For technical reasons, this function can return correct but
 non-intuitive results for the root directory; for instance,
 \(expand-file-name ".." "/") returns "/..".  For this reason, use
-(directory-file-name (file-name-directory dirname)) to traverse a
+\(directory-file-name (file-name-directory dirname)) to traverse a
 filesystem tree, not (expand-file-name ".."  dirname).  */)
   (Lisp_Object name, Lisp_Object default_directory)
 {
@@ -5044,9 +5047,10 @@
 }
 
 DEFUN ("verify-visited-file-modtime", Fverify_visited_file_modtime,
-       Sverify_visited_file_modtime, 1, 1, 0,
+       Sverify_visited_file_modtime, 0, 1, 0,
        doc: /* Return t if last mod time of BUF's visited file matches what BUF records.
 This means that the file has not been changed since it was visited or saved.
+If BUF is omitted or nil, it defaults to the current buffer.
 See Info node `(elisp)Modification Time' for more details.  */)
   (Lisp_Object buf)
 {
@@ -5055,8 +5059,13 @@
   Lisp_Object handler;
   Lisp_Object filename;
 
-  CHECK_BUFFER (buf);
-  b = XBUFFER (buf);
+  if (NILP (buf))
+    b = current_buffer;
+  else
+    {
+      CHECK_BUFFER (buf);
+      b = XBUFFER (buf);
+    }
 
   if (!STRINGP (b->filename)) return Qt;
   if (b->modtime == 0) return Qt;
@@ -5863,5 +5872,3 @@
 #endif
 }
 
-/* arch-tag: 64ba3fd7-f844-4fb2-ba4b-427eb928786c
-   (do not change this comment) */
--- a/src/frame.c	Thu Dec 16 17:43:45 2010 -0500
+++ b/src/frame.c	Thu Dec 16 18:30:57 2010 -0500
@@ -3311,7 +3311,7 @@
 void
 x_set_font (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
 {
-  Lisp_Object frame, font_object, font_param = Qnil;
+  Lisp_Object font_object, font_param = Qnil;
   int fontset = -1;
 
   /* Set the frame parameter back to the old value because we may
--- a/src/gtkutil.c	Thu Dec 16 17:43:45 2010 -0500
+++ b/src/gtkutil.c	Thu Dec 16 18:30:57 2010 -0500
@@ -559,7 +559,7 @@
   FRAME_PTR f = (FRAME_PTR) user_data;
   struct x_output *x = f->output_data.x;
   GtkWidget *top = gtk_widget_get_toplevel (x->ttip_lbl);
-  
+
   if (! top || ! GTK_IS_WINDOW (top))
       gtk_widget_hide (previous_toplevel);
 }
@@ -580,7 +580,7 @@
 {
   FRAME_PTR f = (FRAME_PTR) user_data;
   struct x_output *x = f->output_data.x;
-  if (x->ttip_widget == NULL) 
+  if (x->ttip_widget == NULL)
     {
       g_object_set (G_OBJECT (widget), "has-tooltip", FALSE, NULL);
       x->ttip_widget = tooltip;
@@ -633,14 +633,14 @@
   screen = gdk_drawable_get_screen (gwin);
   settings = gtk_settings_get_for_screen (screen);
   g_object_get (settings, "gtk-enable-tooltips", &tt_enabled, NULL);
-  if (tt_enabled) 
+  if (tt_enabled)
     {
       g_object_set (settings, "gtk-enable-tooltips", FALSE, NULL);
       /* Record that we disabled it so it can be enabled again.  */
       g_object_set_data (G_OBJECT (x->ttip_window), "restore-tt",
                          (gpointer)f);
     }
-    
+
   /* Prevent Gtk+ from hiding tooltip on mouse move and such.  */
   g_object_set_data (G_OBJECT
                      (gtk_widget_get_display (GTK_WIDGET (x->ttip_window))),
@@ -654,7 +654,7 @@
   gtk_widget_size_request (GTK_WIDGET (x->ttip_window), &req);
   if (width) *width = req.width;
   if (height) *height = req.height;
-  
+
   UNBLOCK_INPUT;
 
   return 1;
@@ -801,7 +801,7 @@
                                    &pixelwidth, &pixelheight, 0);
       else return;
     }
-  
+
 
   rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, pixelheight);
   columns = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, pixelwidth);
@@ -1075,7 +1075,7 @@
   f->output_data.x->ttip_widget = 0;
   f->output_data.x->ttip_lbl = 0;
   f->output_data.x->ttip_window = 0;
-  gtk_widget_set_tooltip_text (wtop, "Dummy text");  
+  gtk_widget_set_tooltip_text (wtop, "Dummy text");
   g_signal_connect (wtop, "query-tooltip", G_CALLBACK (qttip_cb), f);
 #endif
 
@@ -1454,7 +1454,7 @@
 
   g_main_loop_quit (dd->loop);
   g_main_loop_unref (dd->loop);
-  
+
   UNBLOCK_INPUT;
 
   return Qnil;
@@ -1482,7 +1482,7 @@
   return FALSE;
 }
 
-     
+
 /* Pops up a modal dialog W and waits for response.
    We don't use gtk_dialog_run because we want to process emacs timers.
    The dialog W is not destroyed when this function returns.  */
@@ -1516,7 +1516,7 @@
 
   (void) xg_maybe_add_timer (&dd);
   g_main_loop_run (dd.loop);
-  
+
   dd.w = 0;
   unbind_to (count, Qnil);
 
@@ -3074,6 +3074,23 @@
   gtk_widget_show_all (menubar);
 }
 
+/* Callback called when the menu bar W is mapped.
+   Used to find the height of the menu bar if we didn't get it
+   after showing the widget.  */
+
+static void
+menubar_map_cb (GtkWidget *w, gpointer user_data)
+{
+  GtkRequisition req;
+  FRAME_PTR f = (FRAME_PTR) user_data;
+  gtk_widget_size_request (w, &req);
+  if (FRAME_MENUBAR_HEIGHT (f) != req.height)
+    {
+      FRAME_MENUBAR_HEIGHT (f) = req.height;
+      xg_height_or_width_changed (f);
+    }
+}
+
 /* Recompute all the widgets of frame F, when the menu bar has been
    changed.  Value is non-zero if widgets were updated.  */
 
@@ -3095,10 +3112,20 @@
                       FALSE, FALSE, 0);
   gtk_box_reorder_child (GTK_BOX (x->vbox_widget), x->menubar_widget, 0);
 
+  g_signal_connect (x->menubar_widget, "map", G_CALLBACK (menubar_map_cb), f);
   gtk_widget_show_all (x->menubar_widget);
   gtk_widget_size_request (x->menubar_widget, &req);
-  FRAME_MENUBAR_HEIGHT (f) = req.height;
-  xg_height_or_width_changed (f);
+
+  /* If menu bar doesn't know its height yet, cheat a little so the frame
+     doesn't jump so much when resized later in menubar_map_cb.  */
+  if (req.height == 0)
+    req.height = 23;
+
+  if (FRAME_MENUBAR_HEIGHT (f) != req.height)
+    {
+      FRAME_MENUBAR_HEIGHT (f) = req.height;
+      xg_height_or_width_changed (f);
+    }
   UNBLOCK_INPUT;
 
   return 1;
@@ -3341,7 +3368,7 @@
                     "button-release-event",
                     end_callback,
                     (gpointer) bar);
-  
+
   /* The scroll bar widget does not draw on a window of its own.  Instead
      it draws on the parent window, in this case the edit widget.  So
      whenever the edit widget is cleared, the scroll bar needs to redraw
@@ -3430,11 +3457,11 @@
                         FRAME_X_WINDOW (f),
                         oldx, oldy, oldw, oldh, 0);
         }
-      
+
       /* GTK does not redraw until the main loop is entered again, but
          if there are no X events pending we will not enter it.  So we sync
          here to get some events.  */
-            
+
       x_sync (f);
       SET_FRAME_GARBAGED (f);
       cancel_mouse_face (f);
@@ -3549,7 +3576,7 @@
       GtkWidget *w = gtk_grab_get_current ();
       retval = w != 0 && GTK_IS_SCROLLBAR (w);
     }
-  
+
   return retval;
 }
 
@@ -3637,7 +3664,7 @@
      this is written.  */
   event.modifiers = x_x_to_emacs_modifiers (FRAME_X_DISPLAY_INFO (f), mod);
   kbd_buffer_store_event (&event);
- 
+
    /* Return focus to the frame after we have clicked on a detached
       tool bar button. */
    Fx_focus_frame (frame);
@@ -3674,7 +3701,7 @@
 {
   GtkWidget *wbutton = GTK_WIDGET (g_object_get_data (G_OBJECT (w),
                                                       XG_TOOL_BAR_PROXY_BUTTON));
-  
+
   return xg_tool_bar_help_callback (wbutton, event, client_data);
 }
 
@@ -3777,7 +3804,7 @@
                     G_CALLBACK (xg_tool_bar_proxy_callback),
                     user_data);
 
-  
+
   g_object_set_data (G_OBJECT (wmenuitem), XG_TOOL_BAR_PROXY_BUTTON,
                      (gpointer) wbutton);
   gtk_tool_item_set_proxy_menu_item (toolitem, "Emacs toolbar item", wmenuitem);
@@ -3975,7 +4002,7 @@
                          x->toolbar_widget);
     }
 
-  if (into_hbox) 
+  if (into_hbox)
     {
       gtk_handle_box_set_handle_position (GTK_HANDLE_BOX (x->handlebox_widget),
                                           GTK_POS_TOP);
@@ -4066,7 +4093,7 @@
   Lisp_Object style = Ftool_bar_get_system_style ();
   int both_horiz = EQ (style, Qboth_horiz);
   int text_image = EQ (style, Qtext_image_horiz);
-  
+
   GtkWidget *vb = both_horiz || text_image
     ? gtk_hbox_new (FALSE, 0) : gtk_vbox_new (FALSE, 0);
   GtkWidget *wb = gtk_button_new ();
@@ -4120,7 +4147,7 @@
                         NULL);
 
       g_object_set_data (G_OBJECT (wb), XG_FRAME_DATA, (gpointer)f);
-          
+
       /* Use enter/leave notify to show help.  We use the events
          rather than the GtkButton specific signals "enter" and
          "leave", so we can have only one callback.  The event
@@ -4135,7 +4162,7 @@
                         G_CALLBACK (xg_tool_bar_help_callback),
                         (gpointer) (EMACS_INT) i);
     }
-  
+
   if (wbutton) *wbutton = wb;
 
   return ti;
@@ -4221,7 +4248,7 @@
       if (pos == 0 || (pos == 1 && x->menubar_widget)) nt = req.height;
       else nb = req.height;
     }
-  
+
   if (nl != FRAME_TOOLBAR_LEFT_WIDTH (f)
       || nr != FRAME_TOOLBAR_RIGHT_WIDTH (f)
       || nt != FRAME_TOOLBAR_TOP_HEIGHT (f)
@@ -4287,7 +4314,7 @@
 
   wtoolbar = GTK_TOOLBAR (x->toolbar_widget);
   dir = gtk_widget_get_direction (GTK_WIDGET (wtoolbar));
-  
+
   for (i = 0; i < f->n_tool_bar_items; ++i)
     {
       int enabled_p = !NILP (PROP (TOOL_BAR_ITEM_ENABLED_P));
@@ -4533,7 +4560,7 @@
       BLOCK_INPUT;
       /* We may have created the toolbar_widget in xg_create_tool_bar, but
          not the x->handlebox_widget which is created in xg_pack_tool_bar.  */
-      if (is_packed) 
+      if (is_packed)
         {
           if (x->toolbar_in_hbox)
             gtk_container_remove (GTK_CONTAINER (x->hbox_widget),
--- a/src/intervals.c	Thu Dec 16 17:43:45 2010 -0500
+++ b/src/intervals.c	Thu Dec 16 18:30:57 2010 -0500
@@ -1875,15 +1875,6 @@
 }
 
 
-/* Set point "temporarily", without checking any text properties.  */
-
-INLINE void
-temp_set_point (struct buffer *buffer, EMACS_INT charpos)
-{
-  temp_set_point_both (buffer, charpos,
-		       buf_charpos_to_bytepos (buffer, charpos));
-}
-
 /* Set point in BUFFER "temporarily" to CHARPOS, which corresponds to
    byte position BYTEPOS.  */
 
@@ -1906,6 +1897,15 @@
   BUF_PT (buffer) = charpos;
 }
 
+/* Set point "temporarily", without checking any text properties.  */
+
+INLINE void
+temp_set_point (struct buffer *buffer, EMACS_INT charpos)
+{
+  temp_set_point_both (buffer, charpos,
+		       buf_charpos_to_bytepos (buffer, charpos));
+}
+
 /* Set point in BUFFER to CHARPOS.  If the target position is
    before an intangible character, move to an ok place.  */
 
--- a/src/keyboard.c	Thu Dec 16 17:43:45 2010 -0500
+++ b/src/keyboard.c	Thu Dec 16 18:30:57 2010 -0500
@@ -4102,7 +4102,7 @@
 #endif
       else if (event->kind == SAVE_SESSION_EVENT)
         {
-          obj = Fcons (Qsave_session, Qnil);
+          obj = Fcons (Qsave_session, Fcons (event->arg, Qnil));
 	  kbd_fetch_ptr = event + 1;
         }
       /* Just discard these, by returning nil.
@@ -5283,9 +5283,9 @@
 	  xret = XINT (x) - window_box_left (w, TEXT_AREA);
 	  yret = wy - WINDOW_HEADER_LINE_HEIGHT (w);
 	}
-      /* For mode line and header line clicks, return X relative to
-	 the left window edge; ignore Y.  Use mode_line_string to look
-	 for a string on the click position.  */
+      /* For mode line and header line clicks, return X, Y relative to
+	 the left window edge.  Use mode_line_string to look for a
+	 string on the click position.  */
       else if (part == ON_MODE_LINE || part == ON_HEADER_LINE)
 	{
 	  Lisp_Object string;
@@ -5305,6 +5305,7 @@
 	    ? PT : XMARKER (w->pointm)->charpos;
 
 	  xret = wx;
+	  yret = wy;
 	}
       /* For fringes and margins, Y is relative to the area's (and the
 	 window's) top edge, while X is meaningless.  */
--- a/src/lisp.h	Thu Dec 16 17:43:45 2010 -0500
+++ b/src/lisp.h	Thu Dec 16 18:30:57 2010 -0500
@@ -267,7 +267,9 @@
 
     struct
       {
-	EMACS_INT val  : VALBITS;
+	/* Use explict signed, the signedness of a bit-field of type
+	   int is implementation defined.  */
+	signed EMACS_INT val  : VALBITS;
 	enum Lisp_Type type : GCTYPEBITS;
       } s;
     struct
@@ -290,7 +292,9 @@
     struct
       {
 	enum Lisp_Type type : GCTYPEBITS;
-	EMACS_INT val  : VALBITS;
+	/* Use explict signed, the signedness of a bit-field of type
+	   int is implementation defined.  */
+	signed EMACS_INT val  : VALBITS;
       } s;
     struct
       {
@@ -447,20 +451,8 @@
 #endif
 
 #define XHASH(a) ((a).i)
-
 #define XTYPE(a) ((enum Lisp_Type) (a).u.type)
-
-#ifdef EXPLICIT_SIGN_EXTEND
-/* Make sure we sign-extend; compilers have been known to fail to do so.
-   We additionally cast to EMACS_INT since it seems that some compilers
-   have been known to fail to do so, even though the bitfield is declared
-   as EMACS_INT already.  */
-#define XINT(a) ((((EMACS_INT) (a).s.val) << (BITS_PER_EMACS_INT - VALBITS)) \
-		 >> (BITS_PER_EMACS_INT - VALBITS))
-#else
 #define XINT(a) ((a).s.val)
-#endif /* EXPLICIT_SIGN_EXTEND */
-
 #define XUINT(a) ((a).u.val)
 
 #ifdef USE_LSB_TAG
@@ -2674,11 +2666,15 @@
 extern Lisp_Object Qspace, Qcenter, QCalign_to;
 extern Lisp_Object Qbar, Qhbar, Qbox, Qhollow;
 extern Lisp_Object Qleft_margin, Qright_margin;
+extern Lisp_Object Qglyphless_char;
 extern Lisp_Object Vmessage_log_max;
 extern Lisp_Object QCdata, QCfile;
 extern Lisp_Object QCmap;
 extern Lisp_Object Qrisky_local_variable;
 extern Lisp_Object Vinhibit_redisplay;
+extern struct frame *last_glyphless_glyph_frame;
+extern unsigned last_glyphless_glyph_face_id;
+extern int last_glyphless_glyph_merged_face_id;
 extern int message_enable_multibyte;
 extern int noninteractive_need_newline;
 extern EMACS_INT scroll_margin;
@@ -2832,7 +2828,8 @@
 /* Defined in print.c */
 extern Lisp_Object Vprin1_to_string_buffer;
 extern Lisp_Object Vprint_level, Vprint_length;
-extern void debug_print (Lisp_Object);
+extern void debug_print (Lisp_Object) EXTERNALLY_VISIBLE;
+extern void safe_debug_print (Lisp_Object) EXTERNALLY_VISIBLE;
 EXFUN (Fprin1, 2);
 EXFUN (Fprin1_to_string, 2);
 EXFUN (Fprinc, 2);
--- a/src/lread.c	Thu Dec 16 17:43:45 2010 -0500
+++ b/src/lread.c	Thu Dec 16 18:30:57 2010 -0500
@@ -582,7 +582,7 @@
 
   if (len == 2)
     {
-      charset = emacs_mule_charset[buf[0]];
+      charset = CHARSET_FROM_ID (emacs_mule_charset[buf[0]]);
       code = buf[1] & 0x7F;
     }
   else if (len == 3)
@@ -590,18 +590,18 @@
       if (buf[0] == EMACS_MULE_LEADING_CODE_PRIVATE_11
 	  || buf[0] == EMACS_MULE_LEADING_CODE_PRIVATE_12)
 	{
-	  charset = emacs_mule_charset[buf[1]];
+	  charset = CHARSET_FROM_ID (emacs_mule_charset[buf[1]]);
 	  code = buf[2] & 0x7F;
 	}
       else
 	{
-	  charset = emacs_mule_charset[buf[0]];
+	  charset = CHARSET_FROM_ID (emacs_mule_charset[buf[0]]);
 	  code = ((buf[1] << 8) | buf[2]) & 0x7F7F;
 	}
     }
   else
     {
-      charset = emacs_mule_charset[buf[1]];
+      charset = CHARSET_FROM_ID (emacs_mule_charset[buf[1]]);
       code = ((buf[2] << 8) | buf[3]) & 0x7F7F;
     }
   c = DECODE_CHAR (charset, code);
@@ -2637,7 +2637,7 @@
 	   old-style.  For Emacs-25, we should completely remove this
 	   first_in_list exception (old-style can still be obtained via
 	   "(\`" anyway).  */
-	if (first_in_list && next_char == ' ')
+	if (!new_backquote_flag && first_in_list && next_char == ' ')
 	  {
 	    Vold_style_backquotes = Qt;
 	    goto default_label;
@@ -2654,33 +2654,48 @@
 	  }
       }
     case ',':
-      if (new_backquote_flag)
-	{
-	  Lisp_Object comma_type = Qnil;
-	  Lisp_Object value;
-	  int ch = READCHAR;
-
-	  if (ch == '@')
-	    comma_type = Qcomma_at;
-	  else if (ch == '.')
-	    comma_type = Qcomma_dot;
-	  else
-	    {
-	      if (ch >= 0) UNREAD (ch);
-	      comma_type = Qcomma;
-	    }
-
-	  new_backquote_flag--;
-	  value = read0 (readcharfun);
-	  new_backquote_flag++;
-	  return Fcons (comma_type, Fcons (value, Qnil));
-	}
-      else
-	{
-	  Vold_style_backquotes = Qt;
-	  goto default_label;
-	}
-
+      {
+	int next_char = READCHAR;
+	UNREAD (next_char);
+	/* Transition from old-style to new-style:
+           It used to be impossible to have a new-style , other than within
+	   a new-style `.  This is sufficient when ` and , are used in the
+	   normal way, but ` and , can also appear in args to macros that
+	   will not interpret them in the usual way, in which case , may be
+	   used without any ` anywhere near.
+	   So we now use the same heuristic as for backquote: old-style
+	   unquotes are only recognized when first on a list, and when
+	   followed by a space.
+	   Because it's more difficult to peak 2 chars ahead, a new-style
+	   ,@ can still not be used outside of a `, unless it's in the middle
+	   of a list.  */
+	if (new_backquote_flag
+	    || !first_in_list
+	    || (next_char != ' ' && next_char != '@'))
+	  {
+	    Lisp_Object comma_type = Qnil;
+	    Lisp_Object value;
+	    int ch = READCHAR;
+
+	    if (ch == '@')
+	      comma_type = Qcomma_at;
+	    else if (ch == '.')
+	      comma_type = Qcomma_dot;
+	    else
+	      {
+		if (ch >= 0) UNREAD (ch);
+		comma_type = Qcomma;
+	      }
+
+	    value = read0 (readcharfun);
+	    return Fcons (comma_type, Fcons (value, Qnil));
+	  }
+	else
+	  {
+	    Vold_style_backquotes = Qt;
+	    goto default_label;
+	  }
+      }
     case '?':
       {
 	int modifiers;
@@ -2707,26 +2722,9 @@
 	c |= modifiers;
 
 	next_char = READCHAR;
-	if (next_char == '.')
-	  {
-	    /* Only a dotted-pair dot is valid after a char constant.  */
-	    int next_next_char = READCHAR;
-	    UNREAD (next_next_char);
-
-	    ok = (next_next_char <= 040
-		  || (next_next_char < 0200
-		      && (strchr ("\"';([#?", next_next_char)
-			  || (!first_in_list && next_next_char == '`')
-			  || (new_backquote_flag && next_next_char == ','))));
-	  }
-	else
-	  {
-	    ok = (next_char <= 040
-		  || (next_char < 0200
-		      && (strchr ("\"';()[]#?", next_char)
-			  || (!first_in_list && next_char == '`')
-			  || (new_backquote_flag && next_char == ','))));
-	  }
+	ok = (next_char <= 040
+	      || (next_char < 0200
+		  && (strchr ("\"';()[]#?`,.", next_char))));
 	UNREAD (next_char);
 	if (ok)
 	  return make_number (c);
@@ -2868,9 +2866,7 @@
 
 	if (next_char <= 040
 	    || (next_char < 0200
-		&& (strchr ("\"';([#?", next_char)
-		    || (!first_in_list && next_char == '`')
-		    || (new_backquote_flag && next_char == ','))))
+		&& (strchr ("\"';([#?`,", next_char))))
 	  {
 	    *pch = c;
 	    return Qnil;
@@ -2895,9 +2891,7 @@
 	  while (c > 040
 		 && c != 0x8a0 /* NBSP */
 		 && (c >= 0200
-		     || (!strchr ("\"';()[]#", c)
-			 && !(!first_in_list && c == '`')
-			 && !(new_backquote_flag && c == ','))))
+		     || !(strchr ("\"';()[]#`,", c))))
 	    {
 	      if (end - p < MAX_MULTIBYTE_LENGTH)
 		{
--- a/src/m/alpha.h	Thu Dec 16 17:43:45 2010 -0500
+++ b/src/m/alpha.h	Thu Dec 16 18:30:57 2010 -0500
@@ -30,13 +30,6 @@
 /* __alpha defined automatically */
 
 
-/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend
-   the 24-bit bit field into an int.  In other words, if bit fields
-   are always unsigned.
-
-   This flag only matters if you use USE_LISP_UNION_TYPE.  */
-#define EXPLICIT_SIGN_EXTEND
-
 /* Data type of load average, as read out of kmem.  */
 #define LOAD_AVE_TYPE long
 
--- a/src/m/amdx86-64.h	Thu Dec 16 17:43:45 2010 -0500
+++ b/src/m/amdx86-64.h	Thu Dec 16 18:30:57 2010 -0500
@@ -31,13 +31,6 @@
 #define EMACS_INT               long
 #define EMACS_UINT              unsigned long
 
-/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend
-   the 24-bit bit field into an int.  In other words, if bit fields
-   are always unsigned.
-
-   This flag only matters if you use USE_LISP_UNION_TYPE.  */
-#define EXPLICIT_SIGN_EXTEND
-
 /* Data type of load average, as read out of kmem.  */
 #define LOAD_AVE_TYPE long
 
--- a/src/m/arm.h	Thu Dec 16 17:43:45 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,22 +0,0 @@
-/* Machine description file for ARM-based non-RISCiX machines.
-
-Copyright (C) 1994, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
-  2009, 2010  Free Software Foundation, Inc.
-
-This file is part of GNU Emacs.
-
-GNU Emacs is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-GNU Emacs is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
-
-/* arch-tag: 07856f0c-f0c8-4bd8-99af-0b7fa1e5ee42
-   (do not change this comment) */
--- a/src/m/hp800.h	Thu Dec 16 17:43:45 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-/* machine description file for hp9000 series 800 machines.
-
-Copyright (C) 1987, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
-  2009, 2010  Free Software Foundation, Inc.
-
-This file is part of GNU Emacs.
-
-GNU Emacs is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-GNU Emacs is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
-
-/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend
-   the bit field into an int.  In other words, if bit fields
-   are always unsigned.
-
-   This flag only matters if you use USE_LISP_UNION_TYPE.  */
-#define EXPLICIT_SIGN_EXTEND
-
-/* arch-tag: 809436e6-1645-4b92-b40d-2de5d6e7227c
-   (do not change this comment) */
--- a/src/m/ia64.h	Thu Dec 16 17:43:45 2010 -0500
+++ b/src/m/ia64.h	Thu Dec 16 18:30:57 2010 -0500
@@ -31,13 +31,6 @@
 #define EMACS_INT		long
 #define EMACS_UINT		unsigned long
 
-/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend
-   the 24-bit bit field into an int.  In other words, if bit fields
-   are always unsigned.
-
-   This flag only matters if you use USE_LISP_UNION_TYPE.  */
-#define EXPLICIT_SIGN_EXTEND
-
 /* Data type of load average, as read out of kmem.  */
 #define LOAD_AVE_TYPE		long
 
--- a/src/m/ibms390.h	Thu Dec 16 17:43:45 2010 -0500
+++ b/src/m/ibms390.h	Thu Dec 16 18:30:57 2010 -0500
@@ -19,13 +19,6 @@
 along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 
-/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend
-   the 24-bit bit field into an int.  In other words, if bit fields
-   are always unsigned.
-
-   This flag only matters if you use USE_LISP_UNION_TYPE.  */
-#define EXPLICIT_SIGN_EXTEND
-
 /* Data type of load average, as read out of kmem.  */
 #define LOAD_AVE_TYPE long
 
--- a/src/m/ibms390x.h	Thu Dec 16 17:43:45 2010 -0500
+++ b/src/m/ibms390x.h	Thu Dec 16 18:30:57 2010 -0500
@@ -27,13 +27,6 @@
 #define EMACS_INT long
 #define EMACS_UINT unsigned long
 
-/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend
-   the 24-bit bit field into an int.  In other words, if bit fields
-   are always unsigned.
-
-   This flag only matters if you use USE_LISP_UNION_TYPE.  */
-#undef EXPLICIT_SIGN_EXTEND
-
 /* On the 64 bit architecture, we can use 60 bits for addresses */
 #define VALBITS         60
 
--- a/src/m/iris4d.h	Thu Dec 16 17:43:45 2010 -0500
+++ b/src/m/iris4d.h	Thu Dec 16 18:30:57 2010 -0500
@@ -19,13 +19,6 @@
 along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 
-/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend
-   the bit field into an int.  In other words, if bit fields
-   are always unsigned.
-
-   This flag only matters if you use USE_LISP_UNION_TYPE.  */
-#define EXPLICIT_SIGN_EXTEND
-
 /* DATA_SEG_BITS forces extra bits to be or'd in with any pointers which
    were stored in a Lisp_Object (as Emacs uses fewer than 32 bits for
    the value field of a LISP_OBJECT).  */
--- a/src/m/m68k.h	Thu Dec 16 17:43:45 2010 -0500
+++ b/src/m/m68k.h	Thu Dec 16 18:30:57 2010 -0500
@@ -24,13 +24,6 @@
 #define m68k
 #endif
 
-/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend
-   the 24-bit bit field into an int.  In other words, if bit fields
-   are always unsigned.
-
-   This flag only matters if you use USE_LISP_UNION_TYPE.  */
-#define EXPLICIT_SIGN_EXTEND
-
 #ifdef GNU_LINUX
 #ifdef __ELF__
 #define DATA_SEG_BITS 0x80000000
--- a/src/m/mips.h	Thu Dec 16 17:43:45 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-/* m- file for Mips machines.
-
-Copyright (C) 1987, 1992, 1999, 2001, 2002, 2003, 2004, 2005, 2006,
-  2007, 2008, 2009, 2010  Free Software Foundation, Inc.
-
-This file is part of GNU Emacs.
-
-GNU Emacs is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-GNU Emacs is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
-
-/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend
-   the 24-bit bit field into an int.  In other words, if bit fields
-   are always unsigned.
-
-   This flag only matters if you use USE_LISP_UNION_TYPE.  */
-#define EXPLICIT_SIGN_EXTEND
-
-/* arch-tag: 8fd020ee-78a7-4d87-96ce-6129f52f7bee
-   (do not change this comment) */
--- a/src/m/sh3.h	Thu Dec 16 17:43:45 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,4 +0,0 @@
-/* Machine description file for SuperH. */
-
-/* arch-tag: 1b01b84f-f044-4afa-aa4b-caa54ec38966
-   (do not change this comment) */
--- a/src/m/sparc.h	Thu Dec 16 17:43:45 2010 -0500
+++ b/src/m/sparc.h	Thu Dec 16 18:30:57 2010 -0500
@@ -20,10 +20,6 @@
 
 /* __sparc__ is defined by the compiler by default.  */
 
-/* XINT must explicitly sign-extend
-   This flag only matters if you use USE_LISP_UNION_TYPE.  */
-#define EXPLICIT_SIGN_EXTEND
-
 /* Data type of load average, as read out of kmem.  */
 #define LOAD_AVE_TYPE long
 
--- a/src/m/template.h	Thu Dec 16 17:43:45 2010 -0500
+++ b/src/m/template.h	Thu Dec 16 18:30:57 2010 -0500
@@ -22,13 +22,6 @@
    does not define it automatically.
    Ones defined so far include m68k and many others */
 
-/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend
-   the 24-bit bit field into an int.  In other words, if bit fields
-   are always unsigned.
-
-   This flag only matters if you use USE_LISP_UNION_TYPE.  */
-#define EXPLICIT_SIGN_EXTEND
-
 /* Data type of load average, as read out of kmem.  */
 #define LOAD_AVE_TYPE long
 
--- a/src/m/xtensa.h	Thu Dec 16 17:43:45 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-/* Machine description file for Tensilica Xtensa.
-
-Add a license notice if this grows to > 10 lines of code.  */
-
-/* arch-tag: fe5872de-d565-4d81-8fe0-ea19865b3e6a
-   (do not change this comment) */
--- a/src/nsmenu.m	Thu Dec 16 17:43:45 2010 -0500
+++ b/src/nsmenu.m	Thu Dec 16 18:30:57 2010 -0500
@@ -23,7 +23,7 @@
 
 /* This should be the first include, as it may set up #defines affecting
    interpretation of even the system includes. */
-#include "config.h"
+#include <config.h>
 #include <setjmp.h>
 
 #include "lisp.h"
@@ -1049,10 +1049,15 @@
         {
           idx = -1;
         }
+      helpObj = TOOLPROP (TOOL_BAR_ITEM_HELP);
+      if (NILP (helpObj))
+        helpObj = TOOLPROP (TOOL_BAR_ITEM_CAPTION);
+      helpText = NILP (helpObj) ? "" : (char *)SDATA (helpObj);
+
       /* Ignore invalid image specifications.  */
       if (!valid_image_p (image))
         {
-          NSLog (@"Invalid image for toolbar item");
+          /* Don't log anything, GNUS makes invalid images all the time.  */
           continue;
         }
 
@@ -1066,11 +1071,6 @@
           continue;
         }
 
-      helpObj = TOOLPROP (TOOL_BAR_ITEM_HELP);
-      if (NILP (helpObj))
-        helpObj = TOOLPROP (TOOL_BAR_ITEM_CAPTION);
-      helpText = NILP (helpObj) ? "" : (char *)SDATA (helpObj);
-
       [toolbar addDisplayItemWithImage: img->pixmap idx: i helpText: helpText
                                enabled: enabled_p];
 #undef TOOLPROP
--- a/src/nsterm.m	Thu Dec 16 17:43:45 2010 -0500
+++ b/src/nsterm.m	Thu Dec 16 18:30:57 2010 -0500
@@ -233,9 +233,12 @@
 
 /* Convert modifiers in a NeXTSTEP event to emacs style modifiers.  */
 #define NS_FUNCTION_KEY_MASK 0x800000
-#define NSRightAlternateKeyMask (0x000040 | NSAlternateKeyMask)
+#define NSLeftControlKeyMask    (0x000001 | NSControlKeyMask)
 #define NSRightControlKeyMask   (0x002000 | NSControlKeyMask)
+#define NSLeftCommandKeyMask    (0x000008 | NSCommandKeyMask)
 #define NSRightCommandKeyMask   (0x000010 | NSCommandKeyMask)
+#define NSLeftAlternateKeyMask  (0x000020 | NSAlternateKeyMask)
+#define NSRightAlternateKeyMask (0x000040 | NSAlternateKeyMask)
 #define EV_MODIFIERS(e)                               \
     ((([e modifierFlags] & NSHelpKeyMask) ?           \
            hyper_modifier : 0)                        \
@@ -1103,16 +1106,31 @@
 
   f->left_pos = xoff;
   f->top_pos = yoff;
-#ifdef NS_IMPL_GNUSTEP
-  if (xoff < 100)
-    f->left_pos = 100;  /* don't overlap menu */
-#endif
 
   if (view != nil && (screen = [[view window] screen]))
-    [[view window] setFrameTopLeftPoint:
-        NSMakePoint (SCREENMAXBOUND (f->left_pos),
-                     SCREENMAXBOUND ([screen frame].size.height
-                                     - NS_TOP_POS (f)))];
+    {
+      f->left_pos = f->size_hint_flags & XNegative
+        ? [screen visibleFrame].size.width + f->left_pos - FRAME_PIXEL_WIDTH (f)
+        : f->left_pos;
+      /* We use visibleFrame here to take menu bar into account.
+	 Ideally we should also adjust left/top with visibleFrame.offset.  */
+	 
+      f->top_pos = f->size_hint_flags & YNegative
+        ? ([screen visibleFrame].size.height + f->top_pos
+           - FRAME_PIXEL_HEIGHT (f) - FRAME_NS_TITLEBAR_HEIGHT (f)
+           - FRAME_TOOLBAR_HEIGHT (f))
+        : f->top_pos;
+#ifdef NS_IMPL_GNUSTEP
+      if (f->left_pos < 100)
+        f->left_pos = 100;  /* don't overlap menu */
+#endif
+      [[view window] setFrameTopLeftPoint:
+                       NSMakePoint (SCREENMAXBOUND (f->left_pos),
+                                    SCREENMAXBOUND ([screen frame].size.height
+                                                    - NS_TOP_POS (f)))];
+      f->size_hint_flags &= ~(XNegative|YNegative);
+    }
+
   UNBLOCK_INPUT;
 }
 
@@ -2283,6 +2301,8 @@
   struct glyph *phys_cursor_glyph;
   int overspill;
   struct glyph *cursor_glyph;
+  struct face *face;
+  NSColor *hollow_color = FRAME_BACKGROUND_COLOR (f);
 
   /* If cursor is out of bounds, don't draw garbage.  This can happen
      in mini-buffer windows when switching between echo area glyphs
@@ -2292,7 +2312,7 @@
 //fprintf(stderr, "drawcursor (%d,%d) activep = %d\tonp = %d\tc_type = %d\twidth = %d\n",x,y, active_p,on_p,cursor_type,cursor_width);
 
   if (!on_p)
-	return;
+    return;
 
   w->phys_cursor_type = cursor_type;
   w->phys_cursor_on_p = on_p;
@@ -2331,7 +2351,17 @@
   /* TODO: only needed in rare cases with last-resort font in HELLO..
      should we do this more efficiently? */
   ns_clip_to_row (w, glyph_row, -1, NO); /* do ns_focus(f, &r, 1); if remove */
-  [FRAME_CURSOR_COLOR (f) set];
+
+
+  face = FACE_FROM_ID (f, phys_cursor_glyph->face_id);
+  if (face && NS_FACE_BACKGROUND (face)
+      == ns_index_color (FRAME_CURSOR_COLOR (f), f))
+    {
+      [ns_lookup_indexed_color (NS_FACE_FOREGROUND (face), f) set];
+      hollow_color = FRAME_CURSOR_COLOR (f);
+    }
+  else
+    [FRAME_CURSOR_COLOR (f) set];
 
 #ifdef NS_IMPL_COCOA
   /* TODO: This makes drawing of cursor plus that of phys_cursor_glyph
@@ -2351,7 +2381,7 @@
       break;
     case HOLLOW_BOX_CURSOR:
       NSRectFill (r);
-      [FRAME_BACKGROUND_COLOR (f) set];
+      [hollow_color set];
       NSRectFill (NSInsetRect (r, 1, 1));
       [FRAME_CURSOR_COLOR (f) set];
       break;
@@ -2776,7 +2806,10 @@
   else
     face = FACE_FROM_ID (s->f, s->first_glyph->face_id);
 
-  [ns_lookup_indexed_color (NS_FACE_BACKGROUND (face), s->f) set];
+  if (s->hl == DRAW_CURSOR)
+      [FRAME_CURSOR_COLOR (s->f) set];
+  else
+    [ns_lookup_indexed_color (NS_FACE_BACKGROUND (face), s->f) set];
 
   if (bg_height > s->slice.height || s->img->hmargin || s->img->vmargin
       || s->img->mask || s->img->pixmap == 0 || s->width != s->background_width)
@@ -2839,6 +2872,16 @@
                       s->slice.x == 0,
                       s->slice.x + s->slice.width == s->img->width, s);
     }
+
+  /* If there is no mask, the background won't be seen,
+     so draw a rectangle on the image for the cursor.
+     Do this for all images, getting trancparency right is not reliable.  */
+  if (s->hl == DRAW_CURSOR)
+    {
+      int thickness = abs (s->img->relief);
+      if (thickness == 0) thickness = 1;
+      ns_draw_box (br, thickness, FRAME_CURSOR_COLOR (s->f), 1, 1);
+    }
 }
 
 
@@ -2993,11 +3036,25 @@
       if (ns_tmp_font == NULL)
           ns_tmp_font = (struct nsfont_info *)FRAME_FONT (s->f);
 
+      if (s->hl == DRAW_CURSOR && s->w->phys_cursor_type == FILLED_BOX_CURSOR)
+        {
+          unsigned long tmp = NS_FACE_BACKGROUND (s->face);
+          NS_FACE_BACKGROUND (s->face) = NS_FACE_FOREGROUND (s->face);
+          NS_FACE_FOREGROUND (s->face) = tmp;
+        }
+                    
       ns_tmp_font->font.driver->draw
         (s, 0, s->nchars, s->x, s->y,
          (ns_tmp_flags == NS_DUMPGLYPH_NORMAL && !s->background_filled_p)
          || ns_tmp_flags == NS_DUMPGLYPH_MOUSEFACE);
 
+      if (s->hl == DRAW_CURSOR && s->w->phys_cursor_type == FILLED_BOX_CURSOR)
+        {
+          unsigned long tmp = NS_FACE_BACKGROUND (s->face);
+          NS_FACE_BACKGROUND (s->face) = NS_FACE_FOREGROUND (s->face);
+          NS_FACE_FOREGROUND (s->face) = tmp;
+        }
+
       ns_unfocus (s->f);
       break;
 
@@ -4419,7 +4476,7 @@
       code = ([[theEvent charactersIgnoringModifiers] length] == 0) ?
         0 : [[theEvent charactersIgnoringModifiers] characterAtIndex: 0];
       /* (Carbon way: [theEvent keyCode]) */
-
+      
       /* is it a "function key"? */
       fnKeysym = ns_convert_key (code);
       if (fnKeysym)
@@ -4442,15 +4499,16 @@
       if (flags & NSShiftKeyMask)
         emacs_event->modifiers |= shift_modifier;
 
-      if (flags & NSCommandKeyMask)
+      if ((flags & NSRightCommandKeyMask) == NSRightCommandKeyMask)
+        emacs_event->modifiers |= parse_solitary_modifier
+          (EQ (ns_right_command_modifier, Qleft)
+           ? ns_command_modifier
+           : ns_right_command_modifier);
+
+      if ((flags & NSLeftCommandKeyMask) == NSLeftCommandKeyMask)
         {
-          if ((flags & NSRightCommandKeyMask) == NSRightCommandKeyMask
-              && !EQ (ns_right_command_modifier, Qleft))
-            emacs_event->modifiers |= parse_solitary_modifier
-              (ns_right_command_modifier);
-          else
-            emacs_event->modifiers |= parse_solitary_modifier
-              (ns_command_modifier);
+          emacs_event->modifiers |= parse_solitary_modifier
+            (ns_command_modifier);
 
           /* if super (default), take input manager's word so things like
              dvorak / qwerty layout work */
@@ -4484,30 +4542,43 @@
             }
         }
 
-      if (flags & NSControlKeyMask)
-        {
-          if ((flags & NSRightControlKeyMask) == NSRightControlKeyMask
-              && !EQ (ns_right_control_modifier, Qleft))
-            emacs_event->modifiers |= parse_solitary_modifier
-              (ns_right_control_modifier);
-          else
-            emacs_event->modifiers |= parse_solitary_modifier
-              (ns_control_modifier);
-        }
+      if ((flags & NSRightControlKeyMask) == NSRightControlKeyMask)
+          emacs_event->modifiers |= parse_solitary_modifier
+              (EQ (ns_right_control_modifier, Qleft)
+               ? ns_control_modifier
+               : ns_right_control_modifier);
+
+      if ((flags & NSLeftControlKeyMask) == NSLeftControlKeyMask)
+        emacs_event->modifiers |= parse_solitary_modifier
+          (ns_control_modifier);
 
       if (flags & NS_FUNCTION_KEY_MASK && !fnKeysym)
           emacs_event->modifiers |=
             parse_solitary_modifier (ns_function_modifier);
 
-      if (!EQ (ns_right_alternate_modifier, Qleft)
-          && ((flags & NSRightAlternateKeyMask) == NSRightAlternateKeyMask)) 
-	{
-	  emacs_event->modifiers |= parse_solitary_modifier
-            (ns_right_alternate_modifier);
-	}
-      else if (flags & NSAlternateKeyMask) /* default = meta */
+      if ((flags & NSRightAlternateKeyMask) == NSRightAlternateKeyMask)
         {
-          if ((NILP (ns_alternate_modifier) || EQ (ns_alternate_modifier, Qnone))
+          if ((NILP (ns_right_alternate_modifier)
+               || EQ (ns_right_alternate_modifier, Qnone))
+              && !fnKeysym)
+            {   /* accept pre-interp alt comb */
+              if ([[theEvent characters] length] > 0)
+                code = [[theEvent characters] characterAtIndex: 0];
+              /*HACK: clear lone shift modifier to stop next if from firing */
+              if (emacs_event->modifiers == shift_modifier)
+                emacs_event->modifiers = 0;
+            }
+          else
+            emacs_event->modifiers |= parse_solitary_modifier
+              (EQ (ns_right_alternate_modifier, Qleft)
+               ? ns_alternate_modifier
+               : ns_right_alternate_modifier);
+        }
+
+      if ((flags & NSLeftAlternateKeyMask) == NSLeftAlternateKeyMask) /* default = meta */
+        {
+          if ((NILP (ns_alternate_modifier)
+               || EQ (ns_alternate_modifier, Qnone))
               && !fnKeysym)
             {   /* accept pre-interp alt comb */
               if ([[theEvent characters] length] > 0)
--- a/src/print.c	Thu Dec 16 17:43:45 2010 -0500
+++ b/src/print.c	Thu Dec 16 18:30:57 2010 -0500
@@ -163,7 +163,7 @@
 void print_interval (INTERVAL interval, Lisp_Object printcharfun);
 
 /* GDB resets this to zero on W32 to disable OutputDebugString calls.  */
-int print_output_debug_flag = 1;
+int print_output_debug_flag EXTERNALLY_VISIBLE = 1;
 
 
 /* Low level output routines for characters and strings */
--- a/src/process.c	Thu Dec 16 17:43:45 2010 -0500
+++ b/src/process.c	Thu Dec 16 18:30:57 2010 -0500
@@ -3807,7 +3807,7 @@
 }
 
 
-#if defined(HAVE_NET_IF_H) && defined(HAVE_SYS_IOCTL_H)
+#if defined(HAVE_NET_IF_H)
 
 #ifdef SIOCGIFCONF
 DEFUN ("network-interface-list", Fnetwork_interface_list, Snetwork_interface_list, 0, 0, 0,
@@ -4050,7 +4050,7 @@
   return any ? res : Qnil;
 }
 #endif
-#endif	/* defined(HAVE_NET_IF_H) && defined(HAVE_SYS_IOCTL_H) */
+#endif	/* defined(HAVE_NET_IF_H) */
 
 /* Turn off input and output for process PROC.  */
 
@@ -7704,14 +7704,14 @@
   defsubr (&Sset_network_process_option);
   defsubr (&Smake_network_process);
   defsubr (&Sformat_network_address);
-#if defined(HAVE_NET_IF_H) && defined(HAVE_SYS_IOCTL_H)
+#if defined(HAVE_NET_IF_H)
 #ifdef SIOCGIFCONF
   defsubr (&Snetwork_interface_list);
 #endif
 #if defined(SIOCGIFADDR) || defined(SIOCGIFHWADDR) || defined(SIOCGIFFLAGS)
   defsubr (&Snetwork_interface_info);
 #endif
-#endif /* defined(HAVE_NET_IF_H) && defined(HAVE_SYS_IOCTL_H) */
+#endif /* defined(HAVE_NET_IF_H) */
 #ifdef DATAGRAM_SOCKETS
   defsubr (&Sprocess_datagram_address);
   defsubr (&Sset_process_datagram_address);
--- a/src/sound.c	Thu Dec 16 17:43:45 2010 -0500
+++ b/src/sound.c	Thu Dec 16 18:30:57 2010 -0500
@@ -56,9 +56,7 @@
 /* BEGIN: Non Windows Includes */
 #ifndef WINDOWSNT
 
-#ifndef MSDOS
 #include <sys/ioctl.h>
-#endif
 
 /* FreeBSD has machine/soundcard.h.  Voxware sound driver docs mention
    sys/soundcard.h.  So, let's try whatever's there.  */
--- a/src/systty.h	Thu Dec 16 17:43:45 2010 -0500
+++ b/src/systty.h	Thu Dec 16 18:30:57 2010 -0500
@@ -26,9 +26,7 @@
 #include <fcntl.h>
 #endif /* not DOS_NT */
 
-#ifdef HAVE_SYS_IOCTL_H
 #include <sys/ioctl.h>
-#endif
 
 #ifdef HPUX
 #include <sys/bsdtty.h>
--- a/src/term.c	Thu Dec 16 17:43:45 2010 -0500
+++ b/src/term.c	Thu Dec 16 18:30:57 2010 -0500
@@ -66,6 +66,10 @@
 extern int tgetflag (char *id);
 extern int tgetnum (char *id);
 
+char *tparam (char *, char *, int, int, ...);
+
+extern char *tgetstr (char *, char **);
+
 #include "cm.h"
 #ifdef HAVE_X_WINDOWS
 #include "xterm.h"
@@ -176,9 +180,6 @@
 
 static int system_uses_terminfo;
 
-char *tparam (char *, char *, int, int, ...);
-
-extern char *tgetstr (char *, char **);
 
 
 #ifdef HAVE_GPM
@@ -1914,12 +1915,6 @@
     }
 }
 
-/* Declared in xdisp.c */
-extern struct frame *last_glyphless_glyph_frame;
-extern unsigned last_glyphless_glyph_face_id;
-extern int last_glyphless_glyph_merged_face_id;
-extern Lisp_Object Qglyphless_char;
-
 /* Produce glyphs for a glyphless character for iterator IT.
    IT->glyphless_method specifies which method to use for displaying
    the character.  See the description of enum
--- a/src/w32fns.c	Thu Dec 16 17:43:45 2010 -0500
+++ b/src/w32fns.c	Thu Dec 16 18:30:57 2010 -0500
@@ -5782,7 +5782,7 @@
   clear_glyph_matrix (w->desired_matrix);
   clear_glyph_matrix (w->current_matrix);
   SET_TEXT_POS (pos, BEGV, BEGV_BYTE);
-  try_window (FRAME_ROOT_WINDOW (f), pos, 0);
+  try_window (FRAME_ROOT_WINDOW (f), pos, TRY_WINDOW_IGNORE_FONTS_CHANGE);
 
   /* Compute width and height of the tooltip.  */
   width = height = seen_reversed_p = 0;
@@ -5804,16 +5804,12 @@
 	{
 	  if (!row->reversed_p)
 	    {
-#ifdef TODO   /* Investigate why some fonts need more width than is
-		 calculated for some tooltips.  */
-
 	      /* There's a glyph at the end of rows that is used to
 		 place the cursor there.  Don't include the width of
 		 this glyph.  */
 	      last = &row->glyphs[TEXT_AREA][row->used[TEXT_AREA] - 1];
 	      if (INTEGERP (last->object))
 		row_width -= last->pixel_width;
-#endif
 	    }
 	  else
 	    {
@@ -5830,7 +5826,6 @@
 	    }
 	}
 
-      /* TODO: find why tips do not draw along baseline as instructed.  */
       height += row->height;
       width = max (width, row_width);
     }
@@ -5847,9 +5842,10 @@
       w->total_cols = make_number (width);
       FRAME_TOTAL_COLS (f) = width;
       adjust_glyphs (f);
+      w->pseudo_window_p = 1;
       clear_glyph_matrix (w->desired_matrix);
       clear_glyph_matrix (w->current_matrix);
-      try_window (FRAME_ROOT_WINDOW (f), pos, 0);
+      try_window (FRAME_ROOT_WINDOW (f), pos, TRY_WINDOW_IGNORE_FONTS_CHANGE);
       width = height = 0;
       /* Recompute width and height of the tooltip.  */
       for (i = 0; i < w->desired_matrix->nrows; ++i)
@@ -5862,21 +5858,22 @@
 	    break;
 	  row->full_width_p = 1;
 	  row_width = row->pixel_width;
-#ifdef TODO /* See above.  */
 	  if (row->used[TEXT_AREA] && !row->reversed_p)
 	    {
 	      last = &row->glyphs[TEXT_AREA][row->used[TEXT_AREA] - 1];
 	      if (INTEGERP (last->object))
 		row_width -= last->pixel_width;
 	    }
-#endif
 
 	  height += row->height;
 	  width = max (width, row_width);
 	}
     }
 
-  /* Add the frame's internal border to the width and height the X
+  /* Round up the height to an integral multiple of FRAME_LINE_HEIGHT.  */
+  if (height % FRAME_LINE_HEIGHT (f) != 0)
+    height += FRAME_LINE_HEIGHT (f) - height % FRAME_LINE_HEIGHT (f);
+  /* Add the frame's internal border to the width and height the w32
      window should have.  */
   height += 2 * FRAME_INTERNAL_BORDER_WIDTH (f);
   width += 2 * FRAME_INTERNAL_BORDER_WIDTH (f);
@@ -5895,11 +5892,13 @@
 		      FRAME_EXTERNAL_MENU_BAR (f));
 
     /* Position and size tooltip, and put it in the topmost group.
-       The add-on of 3 to the 5th argument is a kludge: without it,
-       some fonts cause the last character of the tip to be truncated,
-       for some obscure reason.  */
+       The add-on of FRAME_COLUMN_WIDTH to the 5th argument is a
+       peculiarity of w32 display: without it, some fonts cause the
+       last character of the tip to be truncated or wrapped around to
+       the next line.  */
     SetWindowPos (FRAME_W32_WINDOW (f), HWND_TOPMOST,
-		  root_x, root_y, rect.right - rect.left + 3,
+		  root_x, root_y,
+		  rect.right - rect.left + FRAME_COLUMN_WIDTH (f),
 		  rect.bottom - rect.top, SWP_NOACTIVATE);
 
     /* Ensure tooltip is on top of other topmost windows (eg menus).  */
--- a/src/xdisp.c	Thu Dec 16 17:43:45 2010 -0500
+++ b/src/xdisp.c	Thu Dec 16 18:30:57 2010 -0500
@@ -1544,11 +1544,10 @@
 }
 
 
-/* Return the next character from STR which is MAXLEN bytes long.
-   Return in *LEN the length of the character.  This is like
-   STRING_CHAR_AND_LENGTH but never returns an invalid character.  If
-   we find one, we return a `?', but with the length of the invalid
-   character.  */
+/* Return the next character from STR.  Return in *LEN the length of
+   the character.  This is like STRING_CHAR_AND_LENGTH but never
+   returns an invalid character.  If we find one, we return a `?', but
+   with the length of the invalid character.  */
 
 static INLINE int
 string_char_and_length (const unsigned char *str, int *len)
@@ -1577,15 +1576,13 @@
 
   if (STRING_MULTIBYTE (string))
     {
-      EMACS_INT rest = SBYTES (string) - BYTEPOS (pos);
       const unsigned char *p = SDATA (string) + BYTEPOS (pos);
       int len;
 
       while (nchars--)
 	{
 	  string_char_and_length (p, &len);
-	  p += len, rest -= len;
-	  xassert (rest >= 0);
+	  p += len;
 	  CHARPOS (pos) += 1;
 	  BYTEPOS (pos) += len;
 	}
@@ -1625,15 +1622,13 @@
 
   if (multibyte_p)
     {
-      EMACS_INT rest = strlen (s);
       int len;
 
       SET_TEXT_POS (pos, 0, 0);
       while (charpos--)
 	{
 	  string_char_and_length (s, &len);
-	  s += len, rest -= len;
-	  xassert (rest >= 0);
+	  s += len;
 	  CHARPOS (pos) += 1;
 	  BYTEPOS (pos) += len;
 	}
@@ -4823,6 +4818,7 @@
 		   && it->stop_charpos <= it->end_charpos));
       it->current.overlay_string_index = -1;
       it->n_overlay_strings = 0;
+      it->overlay_strings_charpos = -1;
 
       /* If we're at the end of the buffer, record that we have
 	 processed the overlay strings there already, so that
@@ -4835,11 +4831,13 @@
       /* There are more overlay strings to process.  If
 	 IT->current.overlay_string_index has advanced to a position
 	 where we must load IT->overlay_strings with more strings, do
-	 it.  */
+	 it.  We must load at the IT->overlay_strings_charpos where
+	 IT->n_overlay_strings was originally computed; when invisible
+	 text is present, this might not be IT_CHARPOS (Bug#7016).  */
       int i = it->current.overlay_string_index % OVERLAY_STRING_CHUNK_SIZE;
 
       if (it->current.overlay_string_index && i == 0)
-	load_overlay_strings (it, 0);
+	load_overlay_strings (it, it->overlay_strings_charpos);
 
       /* Initialize IT to deliver display elements from the overlay
          string.  */
@@ -5051,8 +5049,9 @@
   if (n > 1)
     qsort (entries, n, sizeof *entries, compare_overlay_entries);
 
-  /* Record the total number of strings to process.  */
+  /* Record number of overlay strings, and where we computed it.  */
   it->n_overlay_strings = n;
+  it->overlay_strings_charpos = charpos;
 
   /* IT->current.overlay_string_index is the number of overlay strings
      that have already been consumed by IT.  Copy some of the
@@ -9384,6 +9383,8 @@
     Fset_buffer_multibyte (message_enable_multibyte ? Qt : Qnil);
 
   current_buffer->truncate_lines = message_truncate_lines ? Qt : Qnil;
+  if (!NILP (current_buffer->bidi_display_reordering))
+    current_buffer->bidi_paragraph_direction = Qleft_to_right;
 
   /* Insert new message at BEG.  */
   TEMP_SET_PT_BOTH (BEG, BEG_BYTE);
@@ -12943,7 +12944,7 @@
 
 			  if (tem)
 			    cursor = glyph;
-			  for (glyph += incr;
+			  for ( ;
 			       (row->reversed_p ? glyph > stop : glyph < stop)
 				 && EQ (glyph->object, str);
 			       glyph += incr)
@@ -13424,7 +13425,11 @@
 
       /* If cursor ends up on a partially visible line,
 	 treat that as being off the bottom of the screen.  */
-      if (! cursor_row_fully_visible_p (w, extra_scroll_margin_lines <= 1, 0))
+      if (! cursor_row_fully_visible_p (w, extra_scroll_margin_lines <= 1, 0)
+	  /* It's possible that the cursor is on the first line of the
+	     buffer, which is partially obscured due to a vscroll
+	     (Bug#7537).  In that case, avoid looping forever . */
+	  && extra_scroll_margin_lines < w->desired_matrix->nrows - 1)
 	{
 	  clear_glyph_matrix (w->desired_matrix);
 	  ++extra_scroll_margin_lines;
--- a/src/xml.c	Thu Dec 16 17:43:45 2010 -0500
+++ b/src/xml.c	Thu Dec 16 18:30:57 2010 -0500
@@ -62,7 +62,7 @@
 
       return Fnreverse (result);
     }
-  else if (node->type == XML_TEXT_NODE)
+  else if (node->type == XML_TEXT_NODE || node->type == XML_CDATA_SECTION_NODE)
     {
       if (node->content)
 	return build_string (node->content);
@@ -105,7 +105,8 @@
     doc = htmlReadMemory (BYTE_POS_ADDR (CHAR_TO_BYTE (istart)),
 			  bytes, burl, "utf-8",
 			  HTML_PARSE_RECOVER|HTML_PARSE_NONET|
-			  HTML_PARSE_NOWARNING|HTML_PARSE_NOERROR);
+			  HTML_PARSE_NOWARNING|HTML_PARSE_NOERROR|
+			  HTML_PARSE_NOBLANKS);
   else
     doc = xmlReadMemory (BYTE_POS_ADDR (CHAR_TO_BYTE (istart)),
 			 bytes, burl, "utf-8",
--- a/src/xsmfns.c	Thu Dec 16 17:43:45 2010 -0500
+++ b/src/xsmfns.c	Thu Dec 16 18:30:57 2010 -0500
@@ -172,6 +172,7 @@
 {
   doing_interact = True;
   emacs_event.kind = SAVE_SESSION_EVENT;
+  emacs_event.arg = Qnil;
 }
 
 /* This is called when the session manager tells us to save ourselves.
@@ -308,8 +309,8 @@
 static void
 smc_die_CB (SmcConn smcConn, SmPointer clientData)
 {
-  SmcCloseConnection (smcConn, 0, 0);
-  ice_connection_closed ();
+  emacs_event.kind = SAVE_SESSION_EVENT;
+  emacs_event.arg = Qt;
 }
 
 /* We don't use the next two but they are mandatory, leave them empty.
@@ -522,9 +523,12 @@
 Do not call this function yourself. */)
   (Lisp_Object event)
 {
+  int kill_emacs = CONSP (event) && CONSP (XCDR (event))
+    && EQ (Qt, XCAR (XCDR (event)));
+
   /* Check doing_interact so that we don't do anything if someone called
      this at the wrong time. */
-  if (doing_interact)
+  if (doing_interact && ! kill_emacs)
     {
       Bool cancel_shutdown = False;
 
@@ -535,9 +539,20 @@
 
       doing_interact = False;
     }
+  else if (kill_emacs)
+    {
+      /* We should not do user interaction here, but it is not easy to
+         prevent.  Fix this in next version.  */
+      Fkill_emacs (Qnil);
 
+      /* This will not be reached, but we want kill-emacs-hook to be run.  */
+      SmcCloseConnection (smc_conn, 0, 0);
+      ice_connection_closed ();
+    }
+  
   return Qnil;
 }
+  
 
 
 /***********************************************************************
--- a/src/xterm.c	Thu Dec 16 17:43:45 2010 -0500
+++ b/src/xterm.c	Thu Dec 16 18:30:57 2010 -0500
@@ -47,9 +47,7 @@
 #include <sys/types.h>
 #endif /* makedev */
 
-#ifdef HAVE_SYS_IOCTL_H
 #include <sys/ioctl.h>
-#endif /* ! defined (HAVE_SYS_IOCTL_H) */
 
 #include "systime.h"