changeset 112071:108420a304c2

merge emacs-23
author Kenichi Handa <handa@m17n.org>
date Fri, 24 Dec 2010 17:49:24 +0900
parents 7cf6b779fb96 (current diff) 4bb564da3320 (diff)
children 60c81b6836dc
files
diffstat 65 files changed, 2610 insertions(+), 978 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri Dec 24 17:47:22 2010 +0900
+++ b/ChangeLog	Fri Dec 24 17:49:24 2010 +0900
@@ -1,3 +1,7 @@
+2010-12-11  Glenn Morris  <rgm@gnu.org>
+
+	* make-dist: Exclude etc/*.pyc.  [Backport from trunk]
+
 2010-11-13  Dan Nicolaescu  <dann@ics.uci.edu>
 
 	Fix alloca definition when using gcc on non-gnu systems.
--- a/README	Fri Dec 24 17:47:22 2010 +0900
+++ b/README	Fri Dec 24 17:49:24 2010 +0900
@@ -3,7 +3,7 @@
 See the end of the file for license conditions.
 
 
-This directory tree holds version 23.2.90 of GNU Emacs, the extensible,
+This directory tree holds version 23.2.91 of GNU Emacs, the extensible,
 customizable, self-documenting real-time display editor.
 
 The file INSTALL in this directory says how to build and install GNU
--- a/configure	Fri Dec 24 17:47:22 2010 +0900
+++ b/configure	Fri Dec 24 17:49:24 2010 +0900
@@ -1,11 +1,11 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.65 for emacs 23.2.90.
+# Generated by GNU Autoconf 2.67 for emacs 23.2.91.
 #
 #
 # 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
@@ -316,7 +316,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 +356,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 +530,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`
 
@@ -549,8 +549,8 @@
 # Identity of this package.
 PACKAGE_NAME='emacs'
 PACKAGE_TARNAME='emacs'
-PACKAGE_VERSION='23.2.90'
-PACKAGE_STRING='emacs 23.2.90'
+PACKAGE_VERSION='23.2.91'
+PACKAGE_STRING='emacs 23.2.91'
 PACKAGE_BUGREPORT=''
 PACKAGE_URL=''
 
@@ -840,8 +840,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.
@@ -886,7 +887,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
@@ -912,7 +913,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
@@ -1116,7 +1117,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
@@ -1132,7 +1133,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
@@ -1162,8 +1163,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"
     ;;
 
   *=*)
@@ -1171,7 +1172,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 ;;
@@ -1189,13 +1190,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
@@ -1218,7 +1219,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'
@@ -1232,8 +1233,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
@@ -1248,9 +1249,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.
@@ -1289,11 +1290,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
@@ -1319,7 +1320,7 @@
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures emacs 23.2.90 to adapt to many kinds of systems.
+\`configure' configures emacs 23.2.91 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1333,7 +1334,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
@@ -1393,7 +1394,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of emacs 23.2.90:";;
+     short | recursive ) echo "Configuration of emacs 23.2.91:";;
    esac
   cat <<\_ACEOF
 
@@ -1539,10 +1540,10 @@
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-emacs configure 23.2.90
-generated by GNU Autoconf 2.65
-
-Copyright (C) 2009 Free Software Foundation, Inc.
+emacs configure 23.2.91
+generated by GNU Autoconf 2.67
+
+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
@@ -1658,7 +1659,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 :
@@ -1682,10 +1683,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 "test \"\${$3+set}\"" = set; 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 "test \"\${$3+set}\"" = set; then :
   $as_echo_n "(cached) " >&6
 fi
 eval ac_res=\$$3
@@ -1721,7 +1722,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; }
 
@@ -1748,7 +1749,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 "test \"\${$3+set}\"" = set; then :
   $as_echo_n "(cached) " >&6
 else
   eval "$3=\$ac_header_compiler"
@@ -1812,7 +1813,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 "test \"\${$3+set}\"" = set; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -1842,7 +1843,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 "test \"\${$3+set}\"" = set; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -1854,7 +1855,7 @@
 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
@@ -1863,15 +1864,18 @@
 
 } # ac_fn_c_check_header_preproc
 
-# 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 "test \"\${$3+set}\"" = set; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -1880,8 +1884,12 @@
 int
 main ()
 {
-#ifndef $2
-  (void) $2;
+#ifndef $as_decl_name
+#ifdef __cplusplus
+  (void) $as_decl_use;
+#else
+  (void) $as_decl_name;
+#endif
 #endif
 
   ;
@@ -1911,7 +1919,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 "test \"\${$4+set}\"" = set; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -1967,7 +1975,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 "test \"\${$3+set}\"" = set; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -2035,7 +2043,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 "test \"\${$3+set}\"" = set; then :
   $as_echo_n "(cached) " >&6
 else
   eval "$3=no"
@@ -2083,8 +2091,8 @@
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by emacs $as_me 23.2.90, which was
-generated by GNU Autoconf 2.65.  Invocation command line was
+It was created by emacs $as_me 23.2.91, which was
+generated by GNU Autoconf 2.67.  Invocation command line was
 
   $ $0 $@
 
@@ -2194,11 +2202,9 @@
   {
     echo
 
-    cat <<\_ASBOX
-## ---------------- ##
+    $as_echo "## ---------------- ##
 ## Cache variables. ##
-## ---------------- ##
-_ASBOX
+## ---------------- ##"
     echo
     # The following way of writing the cache mishandles newlines in values,
 (
@@ -2232,11 +2238,9 @@
 )
     echo
 
-    cat <<\_ASBOX
-## ----------------- ##
+    $as_echo "## ----------------- ##
 ## Output variables. ##
-## ----------------- ##
-_ASBOX
+## ----------------- ##"
     echo
     for ac_var in $ac_subst_vars
     do
@@ -2249,11 +2253,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
@@ -2267,11 +2269,9 @@
     fi
 
     if test -s confdefs.h; then
-      cat <<\_ASBOX
-## ----------- ##
+      $as_echo "## ----------- ##
 ## confdefs.h. ##
-## ----------- ##
-_ASBOX
+## ----------- ##"
       echo
       cat confdefs.h
       echo
@@ -2326,7 +2326,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
@@ -2341,7 +2346,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
 
@@ -2422,7 +2431,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. ##
@@ -2556,7 +2565,7 @@
 	    m | mo | mot | moti | motif )	val=motif ;;
 	    g | gt | gtk  )	val=gtk ;;
 	    * )
-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' or \`gtk'.
 \`yes' and \`gtk' are synonyms. \`athena' and \`lucid' are synonyms." "$LINENO" 5
 	    ;;
@@ -2712,7 +2721,7 @@
 
 # Check whether --with-gtk was given.
 if test "${with_gtk+set}" = set; then :
-  withval=$with_gtk; as_fn_error "--with-gtk has been removed.  Use --with-x-toolkit to
+  withval=$with_gtk; as_fn_error $? "--with-gtk has been removed.  Use --with-x-toolkit to
 specify a toolkit." "$LINENO" 5
 fi
 
@@ -2720,7 +2729,7 @@
 
 # Check whether --with-gcc was given.
 if test "${with_gcc+set}" = set; then :
-  withval=$with_gcc; as_fn_error "--with-gcc has been removed.  Set the \`CC' environment
+  withval=$with_gcc; as_fn_error $? "--with-gcc has been removed.  Set the \`CC' environment
 variable to specify a compiler." "$LINENO" 5
 fi
 
@@ -2826,7 +2835,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"
@@ -2931,16 +2940,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,
@@ -2954,7 +2969,7 @@
 
 # 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; }
@@ -2965,16 +2980,16 @@
 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='-'
@@ -2999,7 +3014,7 @@
   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
@@ -3007,7 +3022,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='-'
@@ -3353,7 +3368,7 @@
 
 
 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
 
@@ -3667,8 +3682,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
@@ -3782,9 +3797,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; }
@@ -3826,8 +3840,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
@@ -3884,9 +3898,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
@@ -3937,8 +3951,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
@@ -4274,7 +4288,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.
@@ -4290,11 +4304,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
@@ -4333,7 +4347,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.
@@ -4349,18 +4363,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
@@ -4421,7 +4435,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
@@ -4487,7 +4501,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
@@ -4619,8 +4633,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
@@ -4809,7 +4822,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.
@@ -4825,11 +4838,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
@@ -4868,7 +4881,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.
@@ -4884,18 +4897,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
@@ -5314,7 +5327,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
@@ -5722,7 +5735,7 @@
    fi
 
    test -e $CRT_DIR/crtn.o || test -e $CRT_DIR/crt0.o || \
-     as_fn_error "crt*.o not found.  Use --with-crt-dir to specify the location." "$LINENO" 5
+     as_fn_error $? "crt*.o not found.  Use --with-crt-dir to specify the location." "$LINENO" 5
    ;;
 esac
 test "X$CRT_DIR" = "X" && CRT_DIR=/usr/lib
@@ -5737,8 +5750,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
@@ -5929,7 +5941,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
@@ -5953,8 +5965,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
@@ -6796,7 +6807,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 "test \"\${ac_cv_prog_make_${ac_make}_set+set}\"" = set; then :
   $as_echo_n "(cached) " >&6
 else
   cat >conftest.make <<\_ACEOF
@@ -6804,7 +6815,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;;
@@ -6929,7 +6940,7 @@
   have_x=disabled
 else
   case $x_includes,$x_libraries in #(
-    *\'*) as_fn_error "cannot use X directory names containing '" "$LINENO" 5;; #(
+    *\'*) as_fn_error $? "cannot use X directory names containing '" "$LINENO" 5;; #(
     *,NONE | NONE,*) if test "${ac_cv_have_x+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
@@ -6947,7 +6958,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
@@ -7033,7 +7044,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
@@ -7203,7 +7214,7 @@
 if test "x$ac_cv_header_AppKit_AppKit_h" = x""yes; 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
 
@@ -7305,7 +7316,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.
@@ -7397,8 +7408,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
@@ -7504,6 +7514,7 @@
 main ()
 {
   char *data, *data2, *data3;
+  const char *cdata2;
   int i, pagesize;
   int fd, fd2;
 
@@ -7528,10 +7539,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)
@@ -7888,8 +7899,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
@@ -8158,7 +8168,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
 
@@ -8184,7 +8194,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
@@ -8666,7 +8676,7 @@
 $as_echo "yes; using Lucid toolkit" >&6; }
       USE_X_TOOLKIT=LUCID
     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; }
@@ -9826,8 +9836,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
@@ -10078,7 +10087,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
@@ -10400,8 +10409,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
@@ -10465,7 +10473,7 @@
 
 
 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.
@@ -10652,7 +10660,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
   else :
@@ -10695,8 +10703,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
@@ -10727,8 +10734,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
@@ -10780,8 +10786,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]))
@@ -10798,7 +10804,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;
@@ -10811,16 +10817,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))
@@ -10844,8 +10848,7 @@
 }
 
 static int
-bigtime_test (j)
-     int j;
+bigtime_test (int j)
 {
   struct tm tm;
   time_t now;
@@ -10889,7 +10892,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);
 
@@ -10924,7 +10927,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))
@@ -10976,7 +10979,7 @@
 
 # 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
 
@@ -12807,8 +12810,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
@@ -13182,14 +13184,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 'defconst[	 ]*emacs-version' ${srcdir}/lisp/version.el \
 	 | sed -e 's/^[^"]*"\([^"]*\)".*$/\1/'`
 if test x"${version}" = x; then
-  as_fn_error "can't find current emacs version in \`${srcdir}/lisp/version.el'." "$LINENO" 5
+  as_fn_error $? "can't find current emacs version in \`${srcdir}/lisp/version.el'." "$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}/lisp/version.el'." >&5
@@ -13520,6 +13522,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$//'
@@ -13681,19 +13684,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
 
@@ -13889,7 +13892,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
@@ -13942,8 +13945,8 @@
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by emacs $as_me 23.2.90, which was
-generated by GNU Autoconf 2.65.  Invocation command line was
+This file was extended by emacs $as_me 23.2.91, which was
+generated by GNU Autoconf 2.67.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
   CONFIG_HEADERS  = $CONFIG_HEADERS
@@ -14008,11 +14011,11 @@
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-emacs config.status 23.2.90
-configured by $0, generated by GNU Autoconf 2.65,
+emacs config.status 23.2.91
+configured by $0, generated by GNU Autoconf 2.67,
   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."
 
@@ -14028,11 +14031,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
@@ -14054,6 +14062,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;;
@@ -14066,7 +14075,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 ;;
@@ -14075,7 +14084,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"
@@ -14143,7 +14152,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
 
@@ -14181,7 +14190,7 @@
 {
   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
 
 # Set up the scripts for CONFIG_FILES section.
 # No need to generate them if there are no CONFIG_FILES.
@@ -14198,7 +14207,7 @@
 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
@@ -14212,18 +14221,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
@@ -14312,20 +14321,28 @@
 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
+  || 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
@@ -14353,7 +14370,7 @@
   if test -z "$ac_t"; 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
@@ -14438,7 +14455,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"
 
 
@@ -14451,7 +14468,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
@@ -14479,7 +14496,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'"
@@ -14506,7 +14523,7 @@
 
     case $ac_tag in
     *:-:* | *:-) cat >"$tmp/stdin" \
-      || as_fn_error "could not create $ac_file" "$LINENO" 5 ;;
+      || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
     esac
     ;;
   esac
@@ -14637,22 +14654,22 @@
 $ac_datarootdir_hack
 "
 eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
-  || as_fn_error "could not create $ac_file" "$LINENO" 5
+  || 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"; } &&
   { $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;}
+which seems to be undefined.  Please make sure it is defined" >&2;}
 
   rm -f "$tmp/stdin"
   case $ac_file in
   -) cat "$tmp/out" && rm -f "$tmp/out";;
   *) rm -f "$ac_file" && mv "$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)
   #
@@ -14663,19 +14680,19 @@
       $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
+      || as_fn_error $? "could not create $ac_file" "$LINENO" 5
     if diff "$ac_file" "$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
+	|| 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
+      || as_fn_error $? "could not create -" "$LINENO" 5
   fi
  ;;
 
@@ -14755,7 +14772,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.
@@ -14776,7 +14793,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	Fri Dec 24 17:47:22 2010 +0900
+++ b/configure.in	Fri Dec 24 17:49:24 2010 +0900
@@ -22,7 +22,7 @@
 dnl  along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
 
 AC_PREREQ(2.62)
-AC_INIT(emacs, 23.2.90)
+AC_INIT(emacs, 23.2.91)
 AC_CONFIG_HEADER(src/config.h:src/config.in)
 AC_CONFIG_SRCDIR(src/lisp.h)
 
--- a/doc/emacs/ChangeLog	Fri Dec 24 17:47:22 2010 +0900
+++ b/doc/emacs/ChangeLog	Fri Dec 24 17:49:24 2010 +0900
@@ -1,3 +1,25 @@
+2010-12-18  Glenn Morris  <rgm@gnu.org>
+
+	* maintaining.texi: Move inclusion of emerge after EDE, so that it
+	matches its position in the menu.  (Bug#7674)
+
+2010-12-14  Glenn Morris  <rgm@gnu.org>
+
+	* trouble.texi (Checklist): Mention not replying via news either.
+
+2010-12-11  Eli Zaretskii  <eliz@gnu.org>
+
+	* custom.texi (Init Syntax): Add index entries for "character syntax".
+	(Bug#7576)
+
+2010-12-11  Karel Klíč  <kklic@redhat.com>
+
+	* text.texi (HTML Mode): Small fixes.  (Bug#7607)
+
+2010-12-10  Glenn Morris  <rgm@gnu.org>
+
+	* trouble.texi (Checklist): Fix typo in newsgroup name.
+
 2010-12-05  Chong Yidong  <cyd@stupidchicken.com>
 
 	* search.texi (Word Search): Note that the lazy highlight always
@@ -7289,11 +7311,11 @@
 ;; Local Variables:
 ;; coding: utf-8
 ;; fill-column: 79
-;; add-log-time-zone-rule: t
 ;; End:
 
-    Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2002,
-      2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010  Free Software Foundation, Inc.
+  Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2002,
+    2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+    Free Software Foundation, Inc.
 
   This file is part of GNU Emacs.
 
@@ -7310,4 +7332,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: f1d62776-3ed5-4811-9d96-267252577dbd
--- a/doc/emacs/custom.texi	Fri Dec 24 17:47:22 2010 +0900
+++ b/doc/emacs/custom.texi	Fri Dec 24 17:49:24 2010 +0900
@@ -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/emacs.texi	Fri Dec 24 17:47:22 2010 +0900
+++ b/doc/emacs/emacs.texi	Fri Dec 24 17:49:24 2010 +0900
@@ -5,7 +5,7 @@
 
 @c The edition number appears in several places in this file
 @set EDITION   Sixteenth
-@set EMACSVER  23.2.90
+@set EMACSVER  23.2.91
 
 @copying
 This is the @value{EDITION} edition of the @cite{GNU Emacs Manual},@*
--- a/doc/emacs/maintaining.texi	Fri Dec 24 17:47:22 2010 +0900
+++ b/doc/emacs/maintaining.texi	Fri Dec 24 17:49:24 2010 +0900
@@ -2280,10 +2280,6 @@
   You can also use the collection of tag names to complete a symbol
 name in the buffer.  @xref{Symbol Completion}.
 
-@ifnottex
-@include emerge-xtra.texi
-@end ifnottex
-
 @node EDE
 @section Emacs Development Environment
 @cindex EDE (Emacs Development Environment)
@@ -2347,6 +2343,7 @@
 (@code{ede-compile-project}).  EDE uses the file types to guess how
 the target should be built.
 
-@ignore
-   arch-tag: b9d83dfb-82ea-4ff6-bab5-05a3617091fb
-@end ignore
+@ifnottex
+@include emerge-xtra.texi
+@end ifnottex
+
--- a/doc/emacs/text.texi	Fri Dec 24 17:47:22 2010 +0900
+++ b/doc/emacs/text.texi	Fri Dec 24 17:49:24 2010 +0900
@@ -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	Fri Dec 24 17:47:22 2010 +0900
+++ b/doc/emacs/trouble.texi	Fri Dec 24 17:49:24 2010 +0900
@@ -629,10 +629,11 @@
 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
-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.
+gatewayed to the @samp{gnu.emacs.bug} newsgroup.  The reverse is also
+true, but we ask you not to post bug reports (or replies) 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.
 
 If your data is more than 500,000 bytes, please don't include it
 directly in the bug report; instead, offer to send it on request, or
@@ -1127,6 +1128,3 @@
 @lowersections
 @end ifnottex
 
-@ignore
-   arch-tag: c9cba76d-b2cb-4e0c-ae3f-19d5ef35817c
-@end ignore
--- a/doc/lispref/ChangeLog	Fri Dec 24 17:47:22 2010 +0900
+++ b/doc/lispref/ChangeLog	Fri Dec 24 17:49:24 2010 +0900
@@ -1,3 +1,25 @@
+2010-12-18  Eli Zaretskii  <eliz@gnu.org>
+
+	* modes.texi (Emulating Mode Line): Update documentation of
+	format-mode-line according to changes that fixed bug #7587.
+
+2010-12-11  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-07  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-04  Eli Zaretskii  <eliz@gnu.org>
 
 	* display.texi (Other Display Specs): Document left-fringe and
@@ -12,8 +34,8 @@
 
 2010-11-21  Chong Yidong  <cyd@stupidchicken.com>
 
-	* nonascii.texi (Converting Representations): Document
-	byte-to-string.
+	* nonascii.texi (Converting Representations):
+	Document byte-to-string.
 
 	* strings.texi (Creating Strings): Don't mention semi-obsolete
 	function char-to-string.
@@ -44,8 +66,8 @@
 
 	* 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-10  Glenn Morris  <rgm@gnu.org>
 
@@ -152,8 +174,8 @@
 
 	* keymaps.texi (Menu Bar): Document :advertised-binding property.
 
-	* functions.texi (Obsolete Functions): Document
-	set-advertised-calling-convention.
+	* functions.texi (Obsolete Functions):
+	Document set-advertised-calling-convention.
 
 	* minibuf.texi (Basic Completion): Document completion-in-region.
 	(Programmed Completion): Document completion-annotate-function.
@@ -278,8 +300,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>
 
@@ -726,8 +748,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.
@@ -831,8 +853,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>
@@ -874,8 +896,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.
@@ -951,13 +973,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.
@@ -1019,8 +1041,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.
@@ -1063,8 +1085,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>
@@ -1118,8 +1140,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>
@@ -1230,8 +1252,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.
 
@@ -1260,8 +1282,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>
 
@@ -1328,8 +1350,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>
@@ -1337,8 +1359,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.
 
@@ -1359,8 +1381,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>
@@ -1588,8 +1610,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.
 
@@ -1661,8 +1683,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>
 
@@ -1775,8 +1797,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>
 
@@ -1792,13 +1814,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'.
@@ -2143,7 +2165,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>
@@ -2187,8 +2209,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>
 
@@ -2315,8 +2337,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.
@@ -2395,8 +2417,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>
 
@@ -2463,8 +2485,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>
 
@@ -2519,8 +2541,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>
@@ -2926,8 +2948,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>
 
@@ -2998,8 +3020,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>
@@ -3086,8 +3108,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>
 
@@ -3386,8 +3408,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>
 
@@ -3449,7 +3471,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.
@@ -3480,7 +3502,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.
@@ -3979,7 +4001,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):
@@ -4028,8 +4050,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>
 
@@ -4079,8 +4101,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>
 
@@ -4564,8 +4586,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>
 
@@ -4788,8 +4810,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>
 
@@ -5030,7 +5052,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.
@@ -6345,8 +6367,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.
 
@@ -6582,8 +6604,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>
 
@@ -6596,8 +6618,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
@@ -6985,8 +7007,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.
 
@@ -7165,7 +7187,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>
 
@@ -7188,12 +7210,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.
@@ -7268,8 +7290,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'.
@@ -8065,7 +8087,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>
 
@@ -8098,7 +8120,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.
@@ -8114,7 +8136,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>
@@ -8154,8 +8176,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.
@@ -8293,8 +8315,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.
 
@@ -8489,7 +8511,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>
 
@@ -8561,11 +8583,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/book-spine.texinfo	Fri Dec 24 17:47:22 2010 +0900
+++ b/doc/lispref/book-spine.texinfo	Fri Dec 24 17:49:24 2010 +0900
@@ -11,7 +11,7 @@
 @center @titlefont{GNU Emacs Lisp Reference Manual}
 @sp 5
 @center GNU
-@center Emacs Version 23.2.90
+@center Emacs Version 23.2.91
 @center for Unix Users
 @sp 5
 
--- a/doc/lispref/elisp.texi	Fri Dec 24 17:47:22 2010 +0900
+++ b/doc/lispref/elisp.texi	Fri Dec 24 17:49:24 2010 +0900
@@ -8,7 +8,7 @@
 @c Please remember to update the edition number in README as well.
 @c And also the copies in vol1.texi and vol2.texi.
 @set VERSION  3.0
-@set EMACSVER 23.2.90
+@set EMACSVER 23.2.91
 @set DATE July 2009
 
 @c in general, keep the following line commented out, unless doing a
--- a/doc/lispref/modes.texi	Fri Dec 24 17:47:22 2010 +0900
+++ b/doc/lispref/modes.texi	Fri Dec 24 17:49:24 2010 +0900
@@ -24,10 +24,11 @@
 * 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
+* 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
 
@@ -332,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
@@ -2110,29 +2111,43 @@
 based on a certain mode-line specification.
 
 @defun format-mode-line format &optional face window buffer
-This function formats a line of text according to @var{format} as if
-it were generating the mode line for @var{window}, but instead of
-displaying the text in the mode line or the header line, it returns
-the text as a string.  The argument @var{window} defaults to the
-selected window.  If @var{buffer} is non-@code{nil}, all the
-information used is taken from @var{buffer}; by default, it comes from
-@var{window}'s buffer.
+This function formats a line of text according to @var{format} as if it
+were generating the mode line for @var{window}, but it also returns the
+text as a string.  The argument @var{window} defaults to the selected
+window.  If @var{buffer} is non-@code{nil}, all the information used is
+taken from @var{buffer}; by default, it comes from @var{window}'s
+buffer.
 
 The value string normally has text properties that correspond to the
 faces, keymaps, etc., that the mode line would have.  And any character
-for which no @code{face} property is specified gets a default
-value which is usually @var{face}.  (If @var{face} is @code{t},
-that stands for either @code{mode-line} if @var{window} is selected,
-otherwise @code{mode-line-inactive}.  If @var{face} is @code{nil} or
-omitted, that stands for no face property.)
+for which no @code{face} property is specified gets a default value
+determined by @var{face}.  If @var{face} is @code{t}, that stands for
+either @code{mode-line} if @var{window} is selected, otherwise
+@code{mode-line-inactive}.  If @var{face} is @code{nil} or omitted, that
+stands for no face property.
 
 However, if @var{face} is an integer, the value has no text properties.
 
+You can also specify other valid faces as the value of @var{face}.
+If the value is a @dfn{basic face}, one of @code{default}, @code{mode-line},
+@code{mode-line-inactive}, @code{header-line}, or @code{tool-bar}, that
+face provides the @code{face} property for characters whose face is not
+specified by @var{format}.  Any other face is treated as @code{default},
+but you can remap one of the basic faces (@pxref{Face Remapping}) to get
+the same effect as with non-basic faces.
+
+Note that using @code{mode-line}, @code{mode-line-inactive}, or
+@code{header-line} as @var{face} will actually redisplay the mode line
+or the header line, respectively, using the current definitions of the
+corresponding face, in addition to returning the formatted string.
+(Other faces do not cause redisplay.)
+
 For example, @code{(format-mode-line header-line-format)} returns the
 text that would appear in the selected window's header line (@code{""}
 if it has no header line).  @code{(format-mode-line header-line-format
 'header-line)} returns the same text, with each character
-carrying the face that it will have in the header line itself.
+carrying the face that it will have in the header line itself, and also
+redraws the header line.
 @end defun
 
 @node Imenu
@@ -3214,6 +3229,665 @@
 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, 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
+(eval-when-compile (require 'cl))       ;For the `case' macro.
+(defun sample-smie-rules (kind token)
+  (case kind
+    (:elem (case token
+             (basic sample-indent-basic)))
+    (:after
+     (cond
+      ((equal token ",") (smie-rule-separator kind))
+      ((equal token ":=") sample-indent-basic)))
+    (:before
+     (cond
+      ((equal token ",") (smie-rule-separator kind))
+      ((member token '("begin" "(" "@{"))
+       (if (smie-rule-hanging-p) (smie-rule-parent)))
+      ((equal token "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 two (identical) rules 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
--- a/doc/lispref/processes.texi	Fri Dec 24 17:47:22 2010 +0900
+++ b/doc/lispref/processes.texi	Fri Dec 24 17:49:24 2010 +0900
@@ -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	Fri Dec 24 17:47:22 2010 +0900
+++ b/doc/lispref/strings.texi	Fri Dec 24 17:49:24 2010 +0900
@@ -348,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
--- a/doc/lispref/text.texi	Fri Dec 24 17:47:22 2010 +0900
+++ b/doc/lispref/text.texi	Fri Dec 24 17:49:24 2010 +0900
@@ -2209,7 +2209,7 @@
 
 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/vol1.texi	Fri Dec 24 17:47:22 2010 +0900
+++ b/doc/lispref/vol1.texi	Fri Dec 24 17:49:24 2010 +0900
@@ -27,7 +27,7 @@
 @c Version of the manual and of Emacs.
 @c Please remember to update the edition number in README as well.
 @set VERSION  3.0
-@set EMACSVER 23.2.90
+@set EMACSVER 23.2.91
 @set DATE July 2009
 
 @dircategory Emacs
--- a/doc/lispref/vol2.texi	Fri Dec 24 17:47:22 2010 +0900
+++ b/doc/lispref/vol2.texi	Fri Dec 24 17:49:24 2010 +0900
@@ -27,7 +27,7 @@
 @c Version of the manual and of Emacs.
 @c Please remember to update the edition number in README as well.
 @set VERSION  3.0
-@set EMACSVER 23.2.90
+@set EMACSVER 23.2.91
 @set DATE July 2009
 
 @dircategory Emacs
--- a/doc/man/emacs.1	Fri Dec 24 17:47:22 2010 +0900
+++ b/doc/man/emacs.1	Fri Dec 24 17:49:24 2010 +0900
@@ -1,5 +1,5 @@
 .\" See section COPYING for copyright and redistribution information.
-.TH EMACS 1 "2007 April 13" "GNU Emacs 23.2.90"
+.TH EMACS 1 "2007 April 13" "GNU Emacs 23.2.91"
 .
 .
 .SH NAME
--- a/doc/misc/faq.texi	Fri Dec 24 17:47:22 2010 +0900
+++ b/doc/misc/faq.texi	Fri Dec 24 17:49:24 2010 +0900
@@ -5,7 +5,7 @@
 @c %**end of header
 
 @c This is used in many places
-@set VER 23.2.90
+@set VER 23.2.91
 
 @c This file is maintained by Romain Francoise <rfrancoise@gnu.org>.
 @c Feel free to install changes without prior permission (but I'd
--- a/etc/AUTHORS	Fri Dec 24 17:47:22 2010 +0900
+++ b/etc/AUTHORS	Fri Dec 24 17:49:24 2010 +0900
@@ -334,7 +334,8 @@
 
 Bob Olson: co-wrote cperl-mode.el
 
-Bob Rogers: changed vc-svn.el cperl-mode.el ffap.el thingatpt.el
+Bob Rogers: changed vc-svn.el cperl-mode.el ffap.el maintaining.texi
+  thingatpt.el vc-dir.el vc1-xtra.texi
 
 Bob Weiner: changed info.el quail.el
 
@@ -437,7 +438,7 @@
 and changed xdisp.c simple.el files.el display.texi frames.texi
   files.texi emacs.texi xterm.c keyboard.c cus-edit.el faces.el
   Makefile.in xfaces.c misc.texi xfns.c font.c image.c startup.el
-  compile.el custom.texi text.texi and 650 other files
+  text.texi compile.el custom.texi and 653 other files
 
 Chris Chase: co-wrote idlw-shell.el idlwave.el
 
@@ -838,8 +839,9 @@
 
 Ed Swarthout: changed hexl.el table.el
 
-Eduard Wiebe: changed browse-url.el flymake.texi footnote.el
-  javascript.el korean.el mule-conf.el objects.texi ps-print.el vc-rcs.el
+Eduard Wiebe: changed browse-url.el dired.el flymake.texi footnote.el
+  javascript.el korean.el locate.el mule-conf.el objects.texi ps-print.el
+  vc-rcs.el
 
 Eduardo Muñoz: changed dired.el ls-lisp.el
 
@@ -876,7 +878,7 @@
 Eli Zaretskii: wrote rxvt.el tty-colors.el
 and changed msdos.c makefile.w32-in Makefile.in files.el info.el rmail.el
   fileio.c mainmake.v2 pc-win.el startup.el config.bat simple.el msdos.h
-  dired.c w32.c frame.c internal.el menu-bar.el process.c INSTALL
+  w32.c dired.c frame.c menu-bar.el process.c internal.el INSTALL
   xfaces.c and 604 other files
 
 Elias Oltmanns: changed tls.el gnus-agent.el gnus-int.el gnus-srvr.el
@@ -1145,7 +1147,7 @@
   cal-menu.el cal-hebrew.el fortran.el holidays.el configure.in
   calendar.texi cal-islam.el bytecomp.el cal-bahai.el appt.el emacs.texi
   files.el cal-china.el rmailsum.el cal-tex.el simple.el
-  and 1010 other files
+  and 1011 other files
 
 Glynn Clements: wrote gamegrid.el snake.el tetris.el
 
@@ -1333,7 +1335,7 @@
   rng-match.el rng-nxml.el rng-parse.el rng-pttrn.el rng-uri.el
   rng-util.el rng-valid.el rng-xsd.el sgml-mode.el xmltok.el
   xsd-regexp.el
-and changed fns.c window.c xselect.c
+and changed  fns.c nxml-mode.texi window.c xselect.c
 
 James Cloos: wrote arabic.el
 and changed url-history.el
@@ -1360,10 +1362,10 @@
 and changed gtkutil.c xterm.c xfns.c xterm.h configure.in xmenu.c
   x-win.el Makefile.in gtkutil.h keyboard.c frame.c frames.texi config.in
   emacs.c xselect.c xresources.texi cus-start.el startup.el alloc.c
-  process.c xlwmenu.c and 205 other files
+  process.c xlwmenu.c and 207 other files
 
 Jan Moringen: co-wrote cpp.el
-and changed eieio.el zeroconf.el
+and changed eieio.el log-edit.el zeroconf.el
 
 Jan Nieuwenhuizen: changed info.el TUTORIAL.nl add-log.el emacs.c
   emacsclient.c gnus-start.el gud.el nnmh.el server.el startup.el
@@ -1517,6 +1519,8 @@
 
 Joe Hildebrand: co-wrote nndb.el
 
+Joe Matarazzo: changed ebrowse.c
+
 Joe Ramey: changed filelock.c rmailsum.el
 
 Joe Reiss: changed gnus-art.el
@@ -1796,8 +1800,8 @@
 and co-wrote ps-def.el ps-mule.el ps-print.el ps-samp.el quail.el
 and changed coding.c mule-cmds.el mule.el fontset.c charset.c fontset.el
   xdisp.c xterm.c font.c fileio.c Makefile.in mule-conf.el characters.el
-  fns.c mule-diag.el ftfont.c ccl.c charset.h coding.h xfaces.c
-  japanese.el and 378 other files
+  fns.c mule-diag.el charset.h ftfont.c ccl.c coding.h xfaces.c
+  japanese.el and 379 other files
 
 Kenichi Okada: co-wrote sasl-cram.el sasl-digest.el
 
@@ -1942,8 +1946,8 @@
 and changed erc.el erc-match.el erc-nets.el erc-nickserv.el erc-button.el
   erc-compat.el erc-dcc.el erc-fill.el erc-list.el erc-track.el ielm.el
   erc-autoaway.el erc-autojoin.el erc-bbdb.el erc-ezbounce.el erc-menu.el
-  erc-netsplit.el erc-nicklist.el erc-notify.el erc-sound.el lread.c
-  and 4 other files
+  erc-netsplit.el erc-nicklist.el erc-notify.el erc-sound.el format.el
+  and 5 other files
 
 Lawrence R. Dodd: co-wrote dired-x.el
 and changed fortran.el ispell.el sendmail.el cmuscheme.el comint.el
@@ -2042,9 +2046,9 @@
   and 23 other files
 
 Mark A. Hershberger: changed xml.el nnrss.el mm-url.el cperl-mode.el
-  vc-bzr.el Makefile.in NXML-NEWS cc-mode.texi compilation.txt compile.el
-  ede.texi eieio.texi esh-mode.el flymake.el gnus-group.el isearch.el
-  makefile.w32-in nxml nxml-mode.texi programs.texi python.el
+  vc-bzr.el  Makefile.in NXML-NEWS cc-mode.texi compilation.txt
+  compile.el ede.texi eieio.texi esh-mode.el flymake.el gnus-group.el
+  isearch.el makefile.w32-in nxml-mode.texi programs.texi python.el
   and 5 other files
 
 Mark D. Baushke: changed mh-e.el mh-utils.el mh-mime.el mh-comp.el
@@ -2123,8 +2127,8 @@
 Martin Pohlack: changed pc-select.el
 
 Martin Rudalics: changed window.el window.c windows.texi cus-edit.el
-  frame.c frame.el cus-start.el files.el subr.el add-log.el buffer.c
-  buffers.texi dired.el font-lock.el help-fns.el wid-edit.el xdisp.c
+  frame.c frame.el cus-start.el dired.el files.el subr.el add-log.el
+  buffer.c buffers.texi font-lock.el help-fns.el wid-edit.el xdisp.c
   display.texi find-func.el help.el help.texi and 129 other files
 
 Martin Stjernholm: wrote cc-bytecomp.el
@@ -2982,7 +2986,7 @@
 and changed vc.el subr.el lisp.h keyboard.c simple.el files.el pcvs.el
   keymap.c xdisp.c Makefile.in vc-hooks.el alloc.c newcomment.el
   tex-mode.el bytecomp.el compile.el buffer.c info.el fill.el fileio.c
-  window.c and 908 other files
+  window.c and 909 other files
 
 Stefan Reichör: changed gnus-agent.el
 
@@ -3006,7 +3010,7 @@
 
 Stephen A. Wood: changed fortran.el
 
-Stephen Berman: changed todo-mode.el allout.el diary-lib.el dired.el
+Stephen Berman: changed diary-lib.el todo-mode.el allout.el dired.el
   files.el find-dired.el gtkutil.c info.el newcomment.el recentf.el
   rfc822.el
 
@@ -3205,7 +3209,7 @@
 
 Tokuya Kameshima: wrote org-mew.el org-wl.el
 
-Tom Breton: changed autoinsert.el gnus-agent.el lread.c
+Tom Breton: changed autoinsert.el cus-edit.el gnus-agent.el lread.c
 
 Tom Hageman: changed etags.c
 
@@ -3285,10 +3289,9 @@
 Ulrich Leodolter: changed w32proc.c
 
 Ulrich Mueller: changed configure.in Makefile.in files.el gud.el
-  ChgPane.c ChgSel.c INSTALL XMakeAssoc.c authors.el bytecomp.el
-  calc-units.el case-table.el configure doctor.el emacs.1 emacs.c
-  emacs.desktop emacsclient.c fortran.el gnu-linux.h iso-acc.el
-  and 13 other files
+  server.el ChgPane.c ChgSel.c HELLO INSTALL XMakeAssoc.c authors.el
+  bytecomp.el calc-units.el case-table.el configure doctor.el emacs.1
+  emacs.c emacs.desktop emacsclient.c fortran.el and 14 other files
 
 Ulrich Neumerkel: changed xterm.c
 
@@ -3330,6 +3333,8 @@
 
 Vladimir Volovich: changed smime.el
 
+W. Martin Borgert: changed files.el schemas.xml
+
 Walter C. Pelissero: changed browse-url.el url-methods.el
 
 Werner Benger: changed keyboard.c
@@ -3397,8 +3402,8 @@
 
 Yamamoto Mitsuharu: changed macterm.c macfns.c mac-win.el mac.c macterm.h
   macmenu.c macgui.h image.c xdisp.c macselect.c keyboard.c xterm.c
-  Makefile.in emacs.c darwin.h w32term.c dispextern.h macos.texi
-  process.c unexmacosx.c alloc.c and 83 other files
+  Makefile.in emacs.c darwin.h w32term.c alloc.c dispextern.h macos.texi
+  process.c unexmacosx.c and 84 other files
 
 Yann Dirson: changed imenu.el
 
@@ -3426,6 +3431,8 @@
 
 Yukihiro Matsumoto: co-wrote ruby-mode.el
 
+Yuri Karaban: changed pop3.el
+
 Yuri Shtil: changed etags.c
 
 Yutaka Niibe: changed indent.c xdisp.c configure.in Makefile.in dispnew.c
--- a/etc/NEWS	Fri Dec 24 17:47:22 2010 +0900
+++ b/etc/NEWS	Fri Dec 24 17:49:24 2010 +0900
@@ -72,6 +72,27 @@
 Git, Mercurial, and Monotone recognize "Author" and "Date".
 Any unknown header is left as is in the message, so it is not lost.
 
+** Rmail
+
+** The default value of `rmail-enable-mime' is now t.  Rmail decodes
+MIME contents automatically.  You can customize the variable
+`rmail-enable-mime' back to `nil' to disable this automatic MIME
+decoding.
+
+** The command `rmail-mime' change the displaying of a MIME message
+between decoded presentation form and raw data if `rmail-enable-mime'
+is non-nil.  And, with prefix argument, it change only the displaying
+of the MIME entity at point.
+
+** The new command TAB (rmail-mime-next-item) moves point to the next
+item of MIME message.
+
+** The new command backtab (rmail-mime-previous-item) moves point to
+the previous item of MIME message.
+
+** The new command RET (rmail-mime-toggle-hidden) hide or show the
+body of the MIME entity at point.
+
 ** Obsolete packages
 
 +++
@@ -1845,6 +1866,11 @@
 ** `mode-name' is no longer guaranteed to be a string.
 Use `(format-mode-line mode-name)' to ensure a string value.
 
+** `format-mode-line' now supports only a few basic faces as its FACE argument.
+The FACE argument to `format-mode-line' should be one of `default',
+`mode-line', `mode-line-inactive', `header-line', or `tool-bar'.  Any
+other face is treated as `default'.
+
 ** The function x-font-family-list has been removed.
 Use the new function font-family-list (see Lisp Changes, below).
 
--- a/lib-src/makefile.w32-in	Fri Dec 24 17:47:22 2010 +0900
+++ b/lib-src/makefile.w32-in	Fri Dec 24 17:49:24 2010 +0900
@@ -22,7 +22,7 @@
 
 .PHONY: $(ALL)
 
-VERSION		= 23.2.90
+VERSION		= 23.2.91
 
 LOCAL_FLAGS	= -DWINDOWSNT -DDOS_NT -DSTDC_HEADERS=1 -DNO_LDAV=1 \
 		  -DNO_ARCHIVES=1 -DHAVE_CONFIG_H=1 -I../nt/inc \
--- a/lisp/ChangeLog	Fri Dec 24 17:47:22 2010 +0900
+++ b/lisp/ChangeLog	Fri Dec 24 17:49:24 2010 +0900
@@ -1,3 +1,164 @@
+2010-12-24  Kenichi Handa  <handa@m17n.org>
+
+	* mail/rmailmm.el: New key bindings for rmail-mime-next-item,
+	rmail-mime-previous-item, and rmail-mime-toggle-hidden.
+	(rmail-mime-mbox-buffer)
+	(rmail-mime-view-buffer, rmail-mime-coding-system): New variables.
+	(rmail-mime-entity): Argument changed.  All codes handling an
+	entity object are changed.
+	(rmail-mime-entity-header, rmail-mime-entity-body): Adjusted for
+	the above change.
+	(rmail-mime-entity-children, rmail-mime-entity-handler)
+	(rmail-mime-entity-tagline): New functions.
+	(rmail-mime-message-p): New function.
+	(rmail-mime-save): Bind rmail-mime-mbox-buffer.
+	(rmail-mime-entity-segment, rmail-mime-next-item)
+	(rmail-mime-previous-item, rmail-mime-shown-mode)
+	(rmail-mime-hidden-mode, rmail-mime-raw-mode)
+	(rmail-mime-toggle-raw, rmail-mime-toggle-hidden)
+	(rmail-mime-insert-tagline, rmail-mime-insert-header): New
+	functions.
+	(rmail-mime-text-handler): Call rmail-mime-insert-text.
+	(rmail-mime-insert-decoded-text): New function.
+	(rmail-mime-insert-text): Call rmail-mime-insert-decoded-text.
+	(rmail-mime-insert-image): Argument changed.  Caller changed.
+	(rmail-mime-image): Call rmail-mime-toggle-hidden.
+	(rmail-mime-set-bulk-data): New funciton.
+	(rmail-mime-insert-bulk): Argument changed.
+	(rmail-mime-multipart-handler): Return t.
+	(rmail-mime-process-multipart): Argument changed.  Handle
+	"multipart/alternative" here.
+	(rmail-mime-process): Argument changed.
+	(rmail-mime-parse): Bind rmail-mime-mbox-buffer.
+	(rmail-mime-insert): Argument changed.  Handle raw display mode.
+	(rmail-mime): Argument changed.  Handle toggling of raw display
+	mode.
+	(rmail-show-mime): Bind rmail-mime-mbox-buffer and
+	rmail-mime-view-buffer.
+	(rmail-insert-mime-forwarded-message): Likewise.
+	(rmail-search-mime-message): Likewise.  Don't bind rmail-buffer.
+
+	* mail/rmail.el (rmail-show-message-1): If rmail-enable-mime is
+	non-nil, handle the header in rmail-show-mime-function.
+
+2010-12-20  Leo  <sdl.web@gmail.com>
+
+	* help-fns.el (describe-variable): Fix 2010-12-17 change.
+
+2010-12-20  Juri Linkov  <juri@jurta.org>
+
+	* isearch.el (isearch-lazy-highlight-error): New variable.
+	(isearch-lazy-highlight-new-loop): Compare `isearch-error' and
+	`isearch-lazy-highlight-error'.  Set `isearch-lazy-highlight-error'
+	to the current value of `isearch-error' (Bug#7468).
+
+2010-12-17  Chong Yidong  <cyd@stupidchicken.com>
+
+	* help-fns.el (describe-variable): Don't emit trailing whitespace
+	(Bug#7511).
+
+2010-12-17  Leo  <sdl.web@gmail.com>
+
+	* eshell/em-hist.el (eshell-previous-matching-input): Signal error
+	if point is not behind eshell-last-output-end (Bug#7585).
+
+2010-12-16  Chong Yidong  <cyd@stupidchicken.com>
+
+	* textmodes/rst.el (rst-compile-pdf-preview)
+	(rst-compile-slides-preview): Use make-temp-file (Bug#7646).
+
+2010-12-15  Kevin Gallagher  <Kevin.Gallagher@boeing.com>
+
+	* emulation/edt-mapper.el: Override mapping of function keys so
+	that the later call to read-key-sequence works.
+
+2010-12-13  Eli Zaretskii  <eliz@gnu.org>
+
+	* mail/smtpmail.el (smtpmail-send-it): Write queued mail body with
+	Unix EOLs.  (Bug#7589)
+
+2010-12-12  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-11  Glenn Morris  <rgm@gnu.org>
+
+	* subr.el (member-ignore-case, run-mode-hooks, insert-for-yank-1)
+	(with-silent-modifications): Doc fixes.
+
+2010-12-10  Michael Albinus  <michael.albinus@gmx.de>
+
+	* net/tramp.el (tramp-action-password, tramp-process-actions):
+	Revert patch from 2010-12-08.  Use `save-restriction'.
+
+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.  (Bug#1077)
+
+2010-12-09  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-09  Glenn Morris  <rgm@gnu.org>
+
+	* mail/smtpmail.el (smtpmail-send-it): Revert previous change.
+
+2010-12-08  Michael Albinus  <michael.albinus@gmx.de>
+
+	* net/tramp.el (tramp-handle-start-file-process): Protect
+	buffer-modified value.  (Bug#7557)
+	(tramp-action-password): Delete region, do not narrow.
+	(tramp-process-actions): Do not widen.
+
+2010-12-08   Jan Moringen  <jmoringe@techfak.uni-bielefeld.de>
+
+	* log-edit.el (log-edit-changelog-entries):
+	Regexp quote filename.  (Bug#7505)
+
+2010-12-08  Tom Breton  <tehom@panix.com>
+
+	* cus-edit.el (custom-save-all):
+	Bind print-length and print-level to nil.  (Bug#7581)
+
+2010-12-08  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-07  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-06  Leo  <sdl.web@gmail.com>
+
+	* dired-aux.el (dired-do-redisplay): Postpone dired-after-readin-hook
+	while mapping over marks (Bug#6810).
+
+2010-12-06  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-06  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-06  Jan Djärv  <jan.h.d@swipnet.se>
+
+	* frame.el (blink-cursor-mode): Make default t for ns.
+
 2010-12-05  Bob Rogers  <rogers-emacs@rgrjr.dyndns.org>
 
 	* vc-dir.el (vc-dir-query-replace-regexp): Doc fix (Bug#7501).
--- a/lisp/calendar/diary-lib.el	Fri Dec 24 17:47:22 2010 +0900
+++ b/lisp/calendar/diary-lib.el	Fri Dec 24 17:49:24 2010 +0900
@@ -1744,7 +1744,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
--- a/lisp/cus-edit.el	Fri Dec 24 17:47:22 2010 +0900
+++ b/lisp/cus-edit.el	Fri Dec 24 17:49:24 2010 +0900
@@ -4279,7 +4279,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/diff-mode.el	Fri Dec 24 17:47:22 2010 +0900
+++ b/lisp/diff-mode.el	Fri Dec 24 17:49:24 2010 +0900
@@ -1827,10 +1827,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/dired-aux.el	Fri Dec 24 17:47:22 2010 +0900
+++ b/lisp/dired-aux.el	Fri Dec 24 17:49:24 2010 +0900
@@ -1017,10 +1017,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	Fri Dec 24 17:47:22 2010 +0900
+++ b/lisp/dired.el	Fri Dec 24 17:49:24 2010 +0900
@@ -3532,7 +3532,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" "07676ea25af17f5d50cc5db4f53bddc0")
+;;;;;;  dired-diff) "dired-aux" "dired-aux.el" "03cf081d2aac54764123d2407c3196a2")
 ;;; Generated autoloads from dired-aux.el
 
 (autoload 'dired-diff "dired-aux" "\
--- a/lisp/emulation/edt-mapper.el	Fri Dec 24 17:47:22 2010 +0900
+++ b/lisp/emulation/edt-mapper.el	Fri Dec 24 17:49:24 2010 +0900
@@ -141,6 +141,48 @@
   (setq edt-term (getenv "TERM")))
 
 ;;;
+;;; Implements a workaround for a feature that was added to simple.el.
+;;;
+;;; Many function keys have no Emacs functions assigned to them by
+;;; default. A subset of these are typically assigned functions in the
+;;; EDT emulation. This includes all the keypad keys and a some others
+;;; like Delete.
+;;;
+;;; Logic in simple.el maps some of these unassigned function keys to
+;;; ordinary typing keys.  Where this is the case, a call to
+;;; read-key-sequence, below, does not return the name of the function
+;;; key pressd by the user but, instead, it returns the name of the
+;;; key to which it has been mapped.  It needs to know the name of the
+;;; key pressed by the user. As a workaround, we assign a function to
+;;; each of the unassigned function keys of interest, here.  These
+;;; assignments override the mapping to other keys and are only
+;;; temporary since, when edt-mapper is finished executing, it causes
+;;; Emacs to exit.
+;;;
+
+(mapc
+ (lambda (function-key)
+   (if (not (lookup-key (current-global-map) function-key))
+       (define-key (current-global-map) function-key 'forward-char)))
+ '([kp-0] [kp-1] [kp-2] [kp-3] [kp-4]
+   [kp-5] [kp-6] [kp-7] [kp-8] [kp-9]
+   [kp-space]
+   [kp-tab]
+   [kp-enter]
+   [kp-multiply]
+   [kp-add]
+   [kp-separator]
+   [kp-subtract]
+   [kp-decimal]
+   [kp-divide]
+   [kp-equal]
+   [backspace]
+   [delete]
+   [tab]
+   [linefeed]
+   [clear]))
+
+;;;
 ;;;  Make sure the window is big enough to display the instructions,
 ;;;  except where window cannot be re-sized.
 ;;;
--- a/lisp/eshell/em-hist.el	Fri Dec 24 17:47:22 2010 +0900
+++ b/lisp/eshell/em-hist.el	Fri Dec 24 17:49:24 2010 +0900
@@ -837,6 +837,8 @@
 If N is negative, find the next or Nth next match."
   (interactive (eshell-regexp-arg "Previous input matching (regexp): "))
   (setq arg (eshell-search-arg arg))
+  (if (> eshell-last-output-end (point))
+      (error "Point not located after prompt"))
   (let ((pos (eshell-previous-matching-input-string-position regexp arg)))
     ;; Has a match been found?
     (if (null pos)
@@ -844,7 +846,7 @@
       (setq eshell-history-index pos)
       (unless (minibuffer-window-active-p (selected-window))
 	(message "History item: %d" (- (ring-length eshell-history-ring) pos)))
-       ;; Can't use kill-region as it sets this-command
+      ;; Can't use kill-region as it sets this-command
       (delete-region eshell-last-output-end (point))
       (insert-and-inherit (eshell-get-history pos)))))
 
--- a/lisp/format.el	Fri Dec 24 17:47:22 2010 +0900
+++ b/lisp/format.el	Fri Dec 24 17:49:24 2010 +0900
@@ -180,8 +180,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	Fri Dec 24 17:47:22 2010 +0900
+++ b/lisp/frame.el	Fri Dec 24 17:49:24 2010 +0900
@@ -1614,7 +1614,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/help-fns.el	Fri Dec 24 17:47:22 2010 +0900
+++ b/lisp/help-fns.el	Fri Dec 24 17:49:24 2010 +0900
@@ -632,21 +632,17 @@
 		(if valvoid
 		    (princ " is void as a variable.")
 		  (princ "'s "))))
-	    (if valvoid
-		nil
+	    (unless valvoid
 	      (with-current-buffer standard-output
 		(setq val-start-pos (point))
 		(princ "value is ")
-		(terpri)
 		(let ((from (point)))
+		  (terpri)
 		  (pp val)
-		  ;; Hyperlinks in variable's value are quite frequently
-		  ;; inappropriate e.g C-h v <RET> features <RET>
-		  ;; (help-xref-on-pp from (point))
-		  (if (< (point) (+ from 20))
-		      (delete-region (1- from) from)))))
+		  (if (< (point) (+ 68 (line-beginning-position 0)))
+		      (delete-region from (1+ from))
+		    (delete-region (1- from) from)))))
 	    (terpri)
-
 	    (when locus
 	      (if (bufferp locus)
 		  (princ (format "%socal in buffer %s; "
--- a/lisp/image-dired.el	Fri Dec 24 17:47:22 2010 +0900
+++ b/lisp/image-dired.el	Fri Dec 24 17:49:24 2010 +0900
@@ -186,19 +186,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."
@@ -343,7 +343,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/isearch.el	Fri Dec 24 17:47:22 2010 +0900
+++ b/lisp/isearch.el	Fri Dec 24 17:49:24 2010 +0900
@@ -2579,6 +2579,7 @@
 (defvar isearch-lazy-highlight-regexp nil)
 (defvar isearch-lazy-highlight-space-regexp nil)
 (defvar isearch-lazy-highlight-forward nil)
+(defvar isearch-lazy-highlight-error nil)
 
 (defun lazy-highlight-cleanup (&optional force)
   "Stop lazy highlighting and remove extra highlighting from current buffer.
@@ -2620,9 +2621,13 @@
                  (not (= (window-end)   ; Window may have been split/joined.
 			 isearch-lazy-highlight-window-end))
 		 (not (eq isearch-forward
-			  isearch-lazy-highlight-forward))))
+			  isearch-lazy-highlight-forward))
+		 ;; In case we are recovering from an error.
+		 (not (equal isearch-error
+			     isearch-lazy-highlight-error))))
     ;; something important did indeed change
     (lazy-highlight-cleanup t) ;kill old loop & remove overlays
+    (setq isearch-lazy-highlight-error isearch-error)
     (when (not isearch-error)
       (setq isearch-lazy-highlight-start-limit beg
 	    isearch-lazy-highlight-end-limit end)
--- a/lisp/ldefs-boot.el	Fri Dec 24 17:47:22 2010 +0900
+++ b/lisp/ldefs-boot.el	Fri Dec 24 17:49:24 2010 +0900
@@ -1492,7 +1492,7 @@
 
 ;;;### (autoloads (batch-update-autoloads update-directory-autoloads
 ;;;;;;  update-file-autoloads) "autoload" "emacs-lisp/autoload.el"
-;;;;;;  (19636 58496))
+;;;;;;  (19683 64086))
 ;;; Generated autoloads from emacs-lisp/autoload.el
 
 (put 'generated-autoload-file 'safe-local-variable 'stringp)
@@ -2601,19 +2601,14 @@
 ;;;### (autoloads (batch-byte-recompile-directory batch-byte-compile
 ;;;;;;  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
-;;;;;;  byte-compile-warnings-safe-p) "bytecomp" "emacs-lisp/bytecomp.el"
-;;;;;;  (19636 58496))
+;;;;;;  byte-force-recompile byte-compile-enable-warning byte-compile-disable-warning)
+;;;;;;  "bytecomp" "emacs-lisp/bytecomp.el" (19678 47007))
 ;;; 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)
 (put 'byte-compile-dynamic-docstrings 'safe-local-variable 'booleanp)
-(put 'byte-compile-warnings 'safe-local-variable 'byte-compile-warnings-safe-p)
-
-(autoload 'byte-compile-warnings-safe-p "bytecomp" "\
-Return non-nil if X is valid as a value of `byte-compile-warnings'.
-
-\(fn X)" nil nil)
+
+(put 'byte-compile-warnings 'safe-local-variable (lambda (v) (or (symbolp v) (null (delq nil (mapcar (lambda (x) (not (symbolp x))) v))))))
 
 (autoload 'byte-compile-disable-warning "bytecomp" "\
 Change `byte-compile-warnings' to disable WARNING.
@@ -2860,8 +2855,8 @@
 
 ;;;***
 
-;;;### (autoloads (calendar) "calendar" "calendar/calendar.el" (19636
-;;;;;;  58496))
+;;;### (autoloads (calendar) "calendar" "calendar/calendar.el" (19678
+;;;;;;  47007))
 ;;; Generated autoloads from calendar/calendar.el
 
 (autoload 'calendar "calendar" "\
@@ -3910,7 +3905,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"
-;;;;;;  (19652 24589))
+;;;;;;  (19706 58029))
 ;;; Generated autoloads from comint.el
 
 (defvar comint-output-filter-functions '(comint-postoutput-scroll-to-bottom comint-watch-for-password-prompt) "\
@@ -4858,7 +4853,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"
-;;;;;;  (19636 58496))
+;;;;;;  (19711 45554))
 ;;; Generated autoloads from cus-edit.el
 
 (defvar custom-browse-sort-alphabetically nil "\
@@ -5943,7 +5938,7 @@
 ;;;***
 
 ;;;### (autoloads (diary-mode diary-mail-entries diary) "diary-lib"
-;;;;;;  "calendar/diary-lib.el" (19636 58496))
+;;;;;;  "calendar/diary-lib.el" (19714 24709))
 ;;; Generated autoloads from calendar/diary-lib.el
 
 (autoload 'diary "diary-lib" "\
@@ -6024,7 +6019,7 @@
 ;;;***
 
 ;;;### (autoloads (diff-minor-mode diff-mode) "diff-mode" "diff-mode.el"
-;;;;;;  (19661 51722))
+;;;;;;  (19711 45554))
 ;;; Generated autoloads from diff-mode.el
 
 (autoload 'diff-mode "diff-mode" "\
@@ -6065,7 +6060,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" (19636 58496))
+;;;;;;  dired-listing-switches) "dired" "dired.el" (19714 24826))
 ;;; Generated autoloads from dired.el
 
 (defvar dired-listing-switches (purecopy "-al") "\
@@ -8268,7 +8263,7 @@
 
 ;;;***
 
-;;;### (autoloads (epg-make-context) "epg" "epg.el" (19636 58496))
+;;;### (autoloads (epg-make-context) "epg" "epg.el" (19708 34240))
 ;;; Generated autoloads from epg.el
 
 (autoload 'epg-make-context "epg" "\
@@ -13688,8 +13683,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" (19636
-;;;;;;  58496))
+;;;;;;  ido-switch-buffer ido-mode ido-mode) "ido" "ido.el" (19705
+;;;;;;  10058))
 ;;; Generated autoloads from ido.el
 
 (defvar ido-mode nil "\
@@ -14165,7 +14160,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-insert-marked-thumbs)
-;;;;;;  "image-dired" "image-dired.el" (19636 58496))
+;;;;;;  "image-dired" "image-dired.el" (19709 15556))
 ;;; Generated autoloads from image-dired.el
 
 (autoload 'image-dired-dired-insert-marked-thumbs "image-dired" "\
@@ -15945,7 +15940,7 @@
 ;;;***
 
 ;;;### (autoloads (locate-with-filter locate locate-ls-subdir-switches)
-;;;;;;  "locate" "locate.el" (19662 53673))
+;;;;;;  "locate" "locate.el" (19697 24269))
 ;;; Generated autoloads from locate.el
 
 (defvar locate-ls-subdir-switches (purecopy "-al") "\
@@ -15997,7 +15992,7 @@
 
 ;;;***
 
-;;;### (autoloads (log-edit) "log-edit" "log-edit.el" (19661 52402))
+;;;### (autoloads (log-edit) "log-edit" "log-edit.el" (19714 24709))
 ;;; Generated autoloads from log-edit.el
 
 (autoload 'log-edit "log-edit" "\
@@ -16057,8 +16052,8 @@
 ;;;***
 
 ;;;### (autoloads (print-region lpr-region print-buffer lpr-buffer
-;;;;;;  lpr-command lpr-switches printer-name) "lpr" "lpr.el" (19636
-;;;;;;  58496))
+;;;;;;  lpr-command lpr-switches printer-name) "lpr" "lpr.el" (19688
+;;;;;;  11756))
 ;;; Generated autoloads from lpr.el
 
 (defvar lpr-windows-system (memq system-type '(ms-dos windows-nt)))
@@ -16152,7 +16147,7 @@
 ;;;***
 
 ;;;### (autoloads (ls-lisp-support-shell-wildcards) "ls-lisp" "ls-lisp.el"
-;;;;;;  (19672 43471))
+;;;;;;  (19678 47007))
 ;;; Generated autoloads from ls-lisp.el
 
 (defvar ls-lisp-support-shell-wildcards t "\
@@ -17575,8 +17570,8 @@
 
 ;;;***
 
-;;;### (autoloads (mouse-sel-mode) "mouse-sel" "mouse-sel.el" (19636
-;;;;;;  58496))
+;;;### (autoloads (mouse-sel-mode) "mouse-sel" "mouse-sel.el" (19678
+;;;;;;  47007))
 ;;; Generated autoloads from mouse-sel.el
 
 (defvar mouse-sel-mode nil "\
@@ -18410,7 +18405,7 @@
 ;;;***
 
 ;;;### (autoloads (disable-command enable-command disabled-command-function)
-;;;;;;  "novice" "novice.el" (19636 58496))
+;;;;;;  "novice" "novice.el" (19678 47007))
 ;;; Generated autoloads from novice.el
 
 (defvar disabled-command-function 'disabled-command-function "\
@@ -20721,7 +20716,7 @@
 ;;;***
 
 ;;;### (autoloads (picture-mode) "picture" "textmodes/picture.el"
-;;;;;;  (19636 58496))
+;;;;;;  (19678 64521))
 ;;; Generated autoloads from textmodes/picture.el
 
 (autoload 'picture-mode "picture" "\
@@ -20899,7 +20894,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"
-;;;;;;  (19636 58496))
+;;;;;;  (19678 47007))
 ;;; Generated autoloads from printing.el
 
 (autoload 'pr-interface "printing" "\
@@ -21589,8 +21584,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" (19641
-;;;;;;  1314))
+;;;;;;  ps-page-dimensions-database) "ps-print" "ps-print.el" (19705
+;;;;;;  10058))
 ;;; 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"))) "\
@@ -21787,7 +21782,7 @@
 ;;;***
 
 ;;;### (autoloads (python-shell jython-mode python-mode run-python)
-;;;;;;  "python" "progmodes/python.el" (19672 43471))
+;;;;;;  "python" "progmodes/python.el" (19689 20360))
 ;;; Generated autoloads from progmodes/python.el
 
 (add-to-list 'interpreter-mode-alist (cons (purecopy "jython") 'jython-mode))
@@ -21798,20 +21793,24 @@
 
 (autoload 'run-python "python" "\
 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.
-
-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'.
-
-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.)
+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').
+
+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.
+
+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.
 
 \(fn &optional CMD NOSHOW NEW)" t nil)
 
@@ -21873,7 +21872,7 @@
 process is started.  If you use this, you will probably want to ensure
 that the current arguments are retained (they will be included in the
 prompt).  This argument is ignored when this function is called
-programmatically, or when running in Emacs 19.34 or older.
+programmatically.
 
 Note: You can toggle between using the CPython interpreter and the
 JPython interpreter by hitting \\[python-toggle-shells].  This toggles
@@ -22864,8 +22863,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" (19641
-;;;;;;  1152))
+;;;;;;  rmail-movemail-variant-p) "rmail" "mail/rmail.el" (19705
+;;;;;;  10467))
 ;;; Generated autoloads from mail/rmail.el
 
 (autoload 'rmail-movemail-variant-p "rmail" "\
@@ -24128,8 +24127,8 @@
 ;;;***
 
 ;;;### (autoloads (server-save-buffers-kill-terminal server-mode
-;;;;;;  server-force-delete server-start) "server" "server.el" (19662
-;;;;;;  13261))
+;;;;;;  server-force-delete server-start) "server" "server.el" (19682
+;;;;;;  58511))
 ;;; Generated autoloads from server.el
 
 (autoload 'server-start "server" "\
@@ -24729,7 +24728,7 @@
 ;;;***
 
 ;;;### (autoloads (smtpmail-send-queued-mail smtpmail-send-it) "smtpmail"
-;;;;;;  "mail/smtpmail.el" (19636 58496))
+;;;;;;  "mail/smtpmail.el" (19714 24709))
 ;;; Generated autoloads from mail/smtpmail.el
 
 (autoload 'smtpmail-send-it "smtpmail" "\
@@ -25095,7 +25094,7 @@
 ;;;***
 
 ;;;### (autoloads (speedbar-get-focus speedbar-frame-mode) "speedbar"
-;;;;;;  "speedbar.el" (19658 61388))
+;;;;;;  "speedbar.el" (19678 47007))
 ;;; Generated autoloads from speedbar.el
 
 (defalias 'speedbar 'speedbar-frame-mode)
@@ -26529,7 +26528,7 @@
 ;;;***
 
 ;;;### (autoloads (tcl-help-on-word inferior-tcl tcl-mode) "tcl"
-;;;;;;  "progmodes/tcl.el" (19636 58496))
+;;;;;;  "progmodes/tcl.el" (19673 50265))
 ;;; Generated autoloads from progmodes/tcl.el
 
 (autoload 'tcl-mode "tcl" "\
@@ -28011,7 +28010,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" (19672 43471))
+;;;;;;  "net/tramp.el" (19714 24709))
 ;;; Generated autoloads from net/tramp.el
 
 (defvar tramp-mode t "\
@@ -29566,7 +29565,7 @@
 
 ;;;***
 
-;;;### (autoloads (vc-dir) "vc-dir" "vc-dir.el" (19661 53223))
+;;;### (autoloads (vc-dir) "vc-dir" "vc-dir.el" (19706 58306))
 ;;; Generated autoloads from vc-dir.el
 
 (autoload 'vc-dir "vc-dir" "\
@@ -29625,7 +29624,7 @@
 
 ;;;***
 
-;;;### (autoloads nil "vc-hg" "vc-hg.el" (19661 52523))
+;;;### (autoloads nil "vc-hg" "vc-hg.el" (19683 64086))
 ;;; Generated autoloads from vc-hg.el
  (defun vc-hg-registered (file)
   "Return non-nil if FILE is registered with hg."
@@ -30940,7 +30939,7 @@
 ;;;***
 
 ;;;### (autoloads (which-function-mode) "which-func" "progmodes/which-func.el"
-;;;;;;  (19636 58496))
+;;;;;;  (19694 49287))
 ;;; Generated autoloads from progmodes/which-func.el
  (put 'which-func-format 'risky-local-variable t)
  (put 'which-func-current 'risky-local-variable t)
@@ -31401,8 +31400,8 @@
 ;;;***
 
 ;;;### (autoloads (widget-setup widget-insert widget-delete widget-create
-;;;;;;  widget-prompt-value widgetp) "wid-edit" "wid-edit.el" (19636
-;;;;;;  58496))
+;;;;;;  widget-prompt-value widgetp) "wid-edit" "wid-edit.el" (19678
+;;;;;;  47007))
 ;;; Generated autoloads from wid-edit.el
 
 (autoload 'widgetp "wid-edit" "\
@@ -32012,8 +32011,8 @@
 ;;;;;;  "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-dav.el" "vcursor.el" "vt-control.el"
-;;;;;;  "vt100-led.el" "w32-fns.el" "w32-vars.el" "x-dnd.el") (19672
-;;;;;;  46342 903499))
+;;;;;;  "vt100-led.el" "w32-fns.el" "w32-vars.el" "x-dnd.el") (19714
+;;;;;;  25843 484853))
 
 ;;;***
 
--- a/lisp/log-edit.el	Fri Dec 24 17:47:22 2010 +0900
+++ b/lisp/log-edit.el	Fri Dec 24 17:49:24 2010 +0900
@@ -773,7 +773,7 @@
 		(setq pattern (file-name-nondirectory file)))
 
             (setq pattern (concat "\\(^\\|[^[:alnum:]]\\)"
-                                  pattern
+                                  (regexp-quote pattern)
                                   "\\($\\|[^[:alnum:]]\\)"))
 
 	    (let (texts
--- a/lisp/mail/binhex.el	Fri Dec 24 17:47:22 2010 +0900
+++ b/lisp/mail/binhex.el	Fri Dec 24 17:49:24 2010 +0900
@@ -1,4 +1,4 @@
-;;; binhex.el --- elisp native binhex decode
+;;; binhex.el --- decode BinHex-encoded text
 
 ;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004,
 ;;   2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
@@ -23,6 +23,11 @@
 
 ;;; Commentary:
 
+;; BinHex is a binary-to-text encoding scheme similar to uuencode.
+;; The command `binhex-decode-region' decodes BinHex-encoded text, via
+;; the external program "hexbin" if that is available, or an Emacs
+;; Lisp implementation if not.
+
 ;;; Code:
 
 (eval-when-compile (require 'cl))
--- a/lisp/mail/rmail.el	Fri Dec 24 17:47:22 2010 +0900
+++ b/lisp/mail/rmail.el	Fri Dec 24 17:49:24 2010 +0900
@@ -2691,75 +2691,72 @@
 	  (message "Showing message %d" msg))
 	(narrow-to-region beg end)
 	(goto-char beg)
+	(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))
 	(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)
-	(save-excursion
-	  (if (re-search-forward "^X-Coding-System: *\\(.*\\)$" nil t)
-	      (setq coding-system (intern (match-string 1)))
-	    (setq coding-system (rmail-get-coding-system))))
-	(setq character-coding (mail-fetch-field "content-transfer-encoding")
-	      is-text-message (rmail-is-text-p))
-	(if character-coding
-	    (setq character-coding (downcase character-coding)))
-	(narrow-to-region beg end)
-	;; Decode the message body into an empty view buffer using a
-	;; unibyte temporary buffer where the character decoding takes
-	;; place.
-	(with-current-buffer rmail-view-buffer
-	  (erase-buffer))
-	(if (null character-coding)
-	    ;; Do it directly since that is fast.
-	    (rmail-decode-region body-start end coding-system view-buf)
-	  ;; Can this be done directly, skipping the temp buffer?
-	  (with-temp-buffer
-	    (set-buffer-multibyte nil)
-	    (insert-buffer-substring mbox-buf body-start end)
-	    (cond
-	     ((string= character-coding "quoted-printable")
-	      ;; See bug#5441.
-	      (or (mail-unquote-printable-region (point-min) (point-max)
-						 nil t 'unibyte)
-		  (message "Malformed MIME quoted-printable message")))
-	     ((and (string= character-coding "base64") is-text-message)
-	      (condition-case err
-		  (base64-decode-region (point-min) (point-max))
-		(error (message "%s" (cdr err)))))
-	     ((eq character-coding 'uuencode)
-	      (error "uuencoded messages are not supported yet"))
-	     (t))
-	    (rmail-decode-region (point-min) (point-max)
-				 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)
-	    (beginning-of-line)
-	    (delete-char 1)
-	    (forward-line))
-	  (goto-char (point-min)))
-	;; Copy the headers to the front of the message view buffer.
-	(rmail-copy-headers beg end)
-	;; Add the separator (blank line) between headers and body;
+	  (setq body-start (search-forward "\n\n" nil t))
+	  (narrow-to-region beg (point))
+	  (goto-char beg)
+	  (save-excursion
+	    (if (re-search-forward "^X-Coding-System: *\\(.*\\)$" nil t)
+		(setq coding-system (intern (match-string 1)))
+	      (setq coding-system (rmail-get-coding-system))))
+	  (setq character-coding (mail-fetch-field "content-transfer-encoding")
+		is-text-message (rmail-is-text-p))
+	  (if character-coding
+	      (setq character-coding (downcase character-coding)))
+	  (narrow-to-region beg end)
+	  ;; Decode the message body into an empty view buffer using a
+	  ;; unibyte temporary buffer where the character decoding takes
+	  ;; place.
+	  (with-current-buffer rmail-view-buffer
+	    (erase-buffer))
+	  (if (null character-coding)
+	      ;; Do it directly since that is fast.
+	      (rmail-decode-region body-start end coding-system view-buf)
+	    ;; Can this be done directly, skipping the temp buffer?
+	    (with-temp-buffer
+	      (set-buffer-multibyte nil)
+	      (insert-buffer-substring mbox-buf body-start end)
+	      (cond
+	       ((string= character-coding "quoted-printable")
+		;; See bug#5441.
+		(or (mail-unquote-printable-region (point-min) (point-max)
+						   nil t 'unibyte)
+		    (message "Malformed MIME quoted-printable message")))
+	       ((and (string= character-coding "base64") is-text-message)
+		(condition-case err
+		    (base64-decode-region (point-min) (point-max))
+		  (error (message "%s" (cdr err)))))
+	       ((eq character-coding 'uuencode)
+		(error "uuencoded messages are not supported yet"))
+	       (t))
+	      (rmail-decode-region (point-min) (point-max)
+				   coding-system view-buf)))
+	  (with-current-buffer rmail-view-buffer
+	    ;; Prepare the separator (blank line) before the body.
+	    (goto-char (point-min))
+	    (insert "\n")
+	    ;; Unquote quoted From lines
+	    (while (re-search-forward "^>+From " nil t)
+	      (beginning-of-line)
+	      (delete-char 1)
+	      (forward-line))
+	    (goto-char (point-min)))
+	  ;; Copy the headers to the front of the message view buffer.
+	  (rmail-copy-headers beg end))
 	;; highlight the message, activate any URL like text and add
 	;; special highlighting for and quoted material.
 	(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)
@@ -4290,18 +4287,28 @@
 
 ;;;***
 
-;;;### (autoloads (rmail-mime) "rmailmm" "rmailmm.el" "4a7502b4aeb3bd5f2111b48cc6512924")
+;;;### (autoloads (rmail-mime) "rmailmm" "rmailmm.el" "faa9e26c7781c426785e671a040128ad")
 ;;; Generated autoloads from rmailmm.el
 
 (autoload 'rmail-mime "rmailmm" "\
-Process the current Rmail message as a MIME message.
-This creates a temporary \"*RMAIL*\" buffer holding a decoded
-copy of the message.  Inline content-types are handled according to
+Toggle displaying of a MIME message.
+
+The actualy behavior depends on the value of `rmail-enable-mime'.
+
+If `rmail-enable-mime' is t (default), this command change the
+displaying of a MIME message between decoded presentation form
+and raw data.
+
+With ARG, toggle the displaying of the current MIME entity only.
+
+If `rmail-enable-mime' is nil, this creates a temporary
+\"*RMAIL*\" buffer holding a decoded copy of the message.  Inline
+content-types are handled according to
 `rmail-mime-media-type-handlers-alist'.  By default, this
 displays text and multipart messages, and offers to download
 attachments as specfied by `rmail-mime-attachment-dirs-alist'.
 
-\(fn)" t nil)
+\(fn &optional ARG)" t nil)
 
 ;;;***
 
@@ -4381,7 +4388,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" "26b95919c7e1f8c5609ce7323aee77ae")
+;;;;;;  rmail-summary) "rmailsum" "rmailsum.el" "d855683972baef7111d4508dffbb54b6")
 ;;; Generated autoloads from rmailsum.el
 
 (autoload 'rmail-summary "rmailsum" "\
--- a/lisp/mail/rmailmm.el	Fri Dec 24 17:47:22 2010 +0900
+++ b/lisp/mail/rmailmm.el	Fri Dec 24 17:49:24 2010 +0900
@@ -96,7 +96,9 @@
 The remaining elements are handler functions to run, in order of
 decreasing preference.  These are called until one returns non-nil.
 Note that this only applies to items with an inline Content-Disposition,
-all others are handled by `rmail-mime-bulk-handler'."
+all others are handled by `rmail-mime-bulk-handler'.
+Note also that this alist is ignored when the variable
+`rmail-enable-mime' is non-nil."
   :type '(alist :key-type regexp :value-type (repeat function))
   :version "23.1"
   :group 'rmail-mime)
@@ -130,18 +132,36 @@
 
 ;;; End of user options.
 
+;;; Global variables that always have let-binding when referred.
+
+(defvar rmail-mime-mbox-buffer nil
+  "Buffer containing the mbox data.
+The value is usually nil, and bound to a proper value while
+processing MIME.")
+
+(defvar rmail-mime-view-buffer nil
+  "Buffer showing a message.
+The value is usually nil, and bound to a proper value while
+processing MIME.")
+
+(defvar rmail-mime-coding-system nil
+  "The first coding-system used for decoding a MIME entity.
+The value is usually nil, and bound to non-nil while inserting
+MIME entities.")
+
 ;;; MIME-entity object
 
 (defun rmail-mime-entity (type disposition transfer-encoding
-			       header body children)
-  "Retrun a newly created MIME-entity object.
+			       display header tagline body children handler)
+  "Retrun a newly created MIME-entity object from arguments.
 
-A MIME-entity is a vector of 6 elements:
+A MIME-entity is a vector of 9 elements:
 
-  [ TYPE DISPOSITION TRANSFER-ENCODING HEADER BODY CHILDREN ]
+  [TYPE DISPOSITION TRANSFER-ENCODING DISPLAY HEADER TAGLINE BODY
+   CHILDREN HANDLER]
   
-TYPE and DISPOSITION correspond to MIME headers Content-Type: and
-Cotent-Disposition: respectively, and has this format:
+TYPE and DISPOSITION correspond to MIME headers Content-Type and
+Cotent-Disposition respectively, and has this format:
 
   \(VALUE (ATTRIBUTE . VALUE) (ATTRIBUTE . VALUE) ...)
 
@@ -160,31 +180,61 @@
 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.
+DISPLAY is a vector [CURRENT NEW], where CURRENT indicates how
+the header, tagline, and body of the entity are displayed now,
+and NEW indicates how their displaying should be updated.
+Both elements are vector [HEADER-DISPLAY TAGLINE-DISPLAY BODY-DISPLAY],
+where each element is a symbol for the corresponding item that
+has these values:
+  nil: not displayed
+  t: displayed by the decoded presentation form
+  raw: displayed by the raw MIME data (for the header and body only)
 
-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))
+HEADER and BODY are vectors [BEG END DISPLAY-FLAG], where BEG and
+END specify the region of the header or body lines in RMAIL's
+data (mbox) buffer, and DISPLAY-FLAG non-nil means that the
+header or body is, by default, displayed by the decoded
+presentation form.
+
+TAGLINE is a vector [TAG BULK-DATA DISPLAY-FLAG], where TAG is a
+string indicating the depth and index number of the entity,
+BULK-DATA is a cons (SIZE . TYPE) indicating the size and type of
+an attached data, DISPLAY-FLAG non-nil means that the tagline is,
+by default, displayed.
+
+CHILDREN is a list of child MIME-entities.  A \"multipart/*\"
+entity have one or more children.  A \"message/rfc822\" entity
+has just one child.  Any other entity has no child.
+
+HANDLER is a function to insert the entity according to DISPLAY.
+It is called with one argument ENTITY."
+  (vector type disposition transfer-encoding
+	  display header tagline body children handler))
 
 ;; 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))
+(defsubst rmail-mime-entity-display (entity) (aref entity 3))
+(defsubst rmail-mime-entity-header (entity) (aref entity 4))
+(defsubst rmail-mime-entity-tagline (entity) (aref entity 5))
+(defsubst rmail-mime-entity-body (entity) (aref entity 6))
+(defsubst rmail-mime-entity-children (entity) (aref entity 7))
+(defsubst rmail-mime-entity-handler (entity) (aref entity 8))
+
+(defsubst rmail-mime-message-p ()
+  "Non-nil if and only if the current message is a MIME."
+  (or (get-text-property (point) 'rmail-mime-entity)
+      (get-text-property (point-min) 'rmail-mime-entity)))
 
 ;;; Buttons
 
 (defun rmail-mime-save (button)
   "Save the attachment using info in the BUTTON."
-  (let* ((filename (button-get button 'filename))
+  (let* ((rmail-mime-mbox-buffer rmail-view-buffer)
+	 (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)
@@ -209,7 +259,8 @@
 	;; 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))
+	  (insert-buffer-substring rmail-mime-mbox-buffer
+				   (aref body 0) (aref body 1))
 	  (cond ((string= transfer-encoding "base64")
 		 (ignore-errors (base64-decode-region (point-min) (point-max))))
 		((string= transfer-encoding "quoted-printable")
@@ -218,34 +269,293 @@
 
 (define-button-type 'rmail-mime-save 'action 'rmail-mime-save)
 
+(defun rmail-mime-entity-segment (pos &optional entity)
+  "Return a vector describing the displayed region of a MIME-entity at POS.
+Optional 2nd argument ENTITY is the MIME-entity at POS.
+The value is a vector [ INDEX HEADER TAGLINE BODY END], where
+  HEADER: the position of the beginning of a header
+  TAGLINE: the position of the beginning of a tagline
+  BODY: the position of the beginning of a body
+  END: the position of the end of the entity.
+  INDEX: index into the returned vector indicating where POS is."
+  (save-excursion
+    (or entity
+	(setq entity (get-text-property pos 'rmail-mime-entity)))
+    (if (not entity)
+	(vector 1 (point) (point) (point) (point))
+      (let ((current (aref (rmail-mime-entity-display entity) 0))
+	    (beg (if (and (> pos (point-min))
+			  (eq (get-text-property (1- pos) 'rmail-mime-entity)
+			      entity))
+		     (previous-single-property-change pos 'rmail-mime-entity
+						      nil (point-min))
+		   pos))
+	    (index 1)
+	    tagline-beg body-beg end)
+	(goto-char beg)
+	(if (aref current 0)
+	    (search-forward "\n\n" nil t))
+	(setq tagline-beg (point))
+	(if (>= pos tagline-beg)
+	    (setq index 2))
+	(if (aref current 1)
+	    (forward-line 1))
+	(setq body-beg (point))
+	(if (>= pos body-beg)
+	    (setq index 3))
+	(if (aref current 2)
+	    (let ((tag (aref (rmail-mime-entity-tagline entity) 0))
+		  tag2)
+	      (setq end (next-single-property-change beg 'rmail-mime-entity
+						     nil (point-max)))
+	      (while (and (< end (point-max))
+			  (setq entity (get-text-property end 'rmail-mime-entity)
+				tag2 (aref (rmail-mime-entity-tagline entity) 0))
+			  (and (> (length tag2) 0)
+			       (eq (string-match tag tag2) 0)))
+		(setq end (next-single-property-change end 'rmail-mime-entity
+						       nil (point-max)))))
+	  (setq end body-beg))
+	(vector index beg tagline-beg body-beg end)))))
+
+(defun rmail-mime-next-item ()
+  "Move point to the next displayed item of the current MIME entity.
+A MIME entity has three items; header, tagline, and body. 
+If we are in the last item of the entity, move point to the first
+item of the next entity.  If we reach the end of buffer, move
+point to the first item of the first entity (i.e. the beginning
+of buffer)."
+  (interactive)
+  (if (rmail-mime-message-p)
+      (let* ((segment (rmail-mime-entity-segment (point)))
+	     (next-pos (aref segment (1+ (aref segment 0))))
+	     (button (next-button (point))))
+	(goto-char (if (and button (< (button-start button) next-pos))
+		       (button-start button)
+		     next-pos))
+	(if (eobp)
+	    (goto-char (point-min))))))
+
+(defun rmail-mime-previous-item ()
+  "Move point to the previous displayed item of the current MIME message.
+A MIME entity has three items; header, tagline, and body.
+If we are at the beginning of the first item of the entity, move
+point to the last item of the previous entity.  If we reach the
+beginning of buffer, move point to the last item of the last
+entity."
+  (interactive)
+  (when (rmail-mime-message-p)
+    (if (bobp)
+	(goto-char (point-max)))
+    (let* ((segment (rmail-mime-entity-segment (1- (point))))
+	   (prev-pos (aref segment (aref segment 0)))
+	   (button (previous-button (point))))
+      (goto-char (if (and button (> (button-start button) prev-pos))
+		     (button-start button)
+		   prev-pos)))))
+
+(defun rmail-mime-shown-mode (entity)
+  "Make MIME-entity ENTITY displayed by the default way."
+  (let ((new (aref (rmail-mime-entity-display entity) 1)))
+    (aset new 0 (aref (rmail-mime-entity-header entity) 2))
+    (aset new 1 (aref (rmail-mime-entity-tagline entity) 2))
+    (aset new 2 (aref (rmail-mime-entity-body entity) 2))))
+  
+(defun rmail-mime-hidden-mode (entity top)
+  "Make MIME-entity ENTITY displayed in the hidden mode.
+If TOP is non-nil, display ENTITY only by the tagline.
+Otherwise, don't display ENTITY."
+  (if top
+      (let ((new (aref (rmail-mime-entity-display entity) 1)))
+	(aset new 0 nil)
+	(aset new 1 top)
+	(aset new 2 nil)
+	(aset (rmail-mime-entity-body entity) 2 nil))
+    (let ((current (aref (rmail-mime-entity-display entity) 0)))
+      (aset current 0 nil)
+      (aset current 1 nil)
+      (aset current 2 nil)))
+  (dolist (child (rmail-mime-entity-children entity))
+    (rmail-mime-hidden-mode child nil)))
+
+(defun rmail-mime-raw-mode (entity)
+  "Make MIME-entity ENTITY displayed in the raw mode."
+  (let ((new (aref (rmail-mime-entity-display entity) 1)))
+    (aset new 0 'raw)
+    (aset new 1 nil)
+    (aset new 2 'raw)
+    (dolist (child (rmail-mime-entity-children entity))
+      (rmail-mime-hidden-mode child nil))))
+
+(defun rmail-mime-toggle-raw (entity)
+  "Toggle on and off the raw display mode of MIME-entity ENTITY."
+  (let* ((pos (if (eobp) (1- (point-max)) (point)))
+	 (entity (get-text-property pos 'rmail-mime-entity))
+	 (current (aref (rmail-mime-entity-display entity) 0))
+	 (segment (rmail-mime-entity-segment pos entity)))
+    (if (not (eq (aref current 0) 'raw))
+	;; Enter the raw mode.
+	(rmail-mime-raw-mode entity)
+      ;; Enter the shown mode.
+      (rmail-mime-shown-mode entity))
+    (let ((inhibit-read-only t)
+	  (modified (buffer-modified-p)))
+      (save-excursion
+	(goto-char (aref segment 1))
+	(rmail-mime-insert entity)
+	(restore-buffer-modified-p modified)))))
+
+(defun rmail-mime-toggle-hidden ()
+  "Toggle on and off the hidden display mode of MIME-entity ENTITY."
+  (interactive)
+  (when (rmail-mime-message-p)
+    (let* ((rmail-mime-mbox-buffer rmail-view-buffer)
+	   (rmail-mime-view-buffer (current-buffer))
+	   (pos (if (eobp) (1- (point-max)) (point)))
+	   (entity (get-text-property pos 'rmail-mime-entity))
+	   (current (aref (rmail-mime-entity-display entity) 0))
+	   (segment (rmail-mime-entity-segment pos entity)))
+      (if (aref current 2)
+	  ;; Enter the hidden mode.
+	  (progn
+	    ;; If point is in the body part, move it to the tagline
+	    ;; (or the header if headline is not displayed).
+	    (if (= (aref segment 0) 3)
+		(goto-char (aref segment 2)))
+	    (rmail-mime-hidden-mode entity t)
+	    ;; If the current entity is the topmost one, display the
+	    ;; header.
+	    (if (and rmail-mime-mbox-buffer (= (aref segment 1) (point-min)))
+		(let ((new (aref (rmail-mime-entity-display entity) 1)))
+		  (aset new 0 t))))
+	;; Enter the shown mode.
+	(aset (rmail-mime-entity-body entity) 2 t)
+	(rmail-mime-shown-mode entity))
+      (let ((inhibit-read-only t)
+	    (modified (buffer-modified-p))
+	    (rmail-mime-mbox-buffer rmail-view-buffer)
+	    (rmail-mime-view-buffer rmail-buffer))
+	(save-excursion
+	  (goto-char (aref segment 1))
+	  (rmail-mime-insert entity)
+	  (restore-buffer-modified-p modified))))))
+
+(define-key rmail-mode-map "\t" 'rmail-mime-next-item)
+(define-key rmail-mode-map [backtab] 'rmail-mime-previous-item)
+(define-key rmail-mode-map "\r" 'rmail-mime-toggle-hidden)
+
 ;;; Handlers
 
+(defun rmail-mime-insert-tagline (entity &rest item-list)
+  "Insert a tag line for MIME-entity ENTITY.
+ITEM-LIST is a list of strings or button-elements (list) to be added
+to the tag line."
+  (insert "[")
+  (let ((tag (aref (rmail-mime-entity-tagline entity) 0)))
+    (if (> (length tag) 0) (insert (substring tag 1) ":")))
+  (insert (car (rmail-mime-entity-type entity)))
+  (dolist (item item-list)
+    (when item
+      (if (stringp item)
+	  (insert item)
+	(apply 'insert-button item))))
+  (insert "]\n"))
+  
+(defun rmail-mime-insert-header (header)
+  "Decode and insert a MIME-entity header HEADER in the current buffer.
+HEADER is a vector [BEG END DEFAULT-STATUS].
+See `rmail-mime-entity' for the detail."
+  (let ((pos (point))
+	(last-coding-system-used nil))
+    (save-restriction
+      (narrow-to-region pos pos)
+      (with-current-buffer rmail-mime-mbox-buffer
+	(let ((rmail-buffer rmail-mime-mbox-buffer)
+	      (rmail-view-buffer rmail-mime-view-buffer))
+	  (save-excursion
+	    (goto-char (aref header 0))
+	    (rmail-copy-headers (point) (aref header 1)))))
+      (rfc2047-decode-region pos (point))
+      (if (and last-coding-system-used (not rmail-mime-coding-system))
+	  (setq rmail-mime-coding-system last-coding-system-used))
+      (goto-char (point-min))
+      (rmail-highlight-headers)
+      (goto-char (point-max))
+      (insert "\n"))))
+
 (defun rmail-mime-text-handler (content-type
 				content-disposition
 				content-transfer-encoding)
   "Handle the current buffer as a plain text MIME part."
-  (let* ((charset (cdr (assq 'charset (cdr content-type))))
-	 (coding-system (when charset
-			  (intern (downcase charset)))))
-    (when (coding-system-p coding-system)
-      (decode-coding-region (point-min) (point-max) coding-system))))
+  (rmail-mime-insert-text
+   (rmail-mime-entity content-type content-disposition
+		      content-transfer-encoding
+		      (vector (vector nil nil nil) (vector nil nil t))
+		      (vector nil nil nil) (vector "" (cons nil nil) t)
+		      (vector nil nil nil) nil 'rmail-mime-insert-text))
+  t)
 
-(defun rmail-mime-insert-text (entity)
-  "Insert MIME-entity ENTITY as a plain text MIME part in the current buffer."
+(defun rmail-mime-insert-decoded-text (entity)
+  "Decode and insert the text body of MIME-entity ENTITY."
   (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)))))
+	 (coding-system (if charset
+			    (coding-system-from-name charset)))
+	 (body (rmail-mime-entity-body entity))
+	 (pos (point)))
+    (or (and coding-system (coding-system-p coding-system))
+	(setq coding-system 'undecided))
+    (if (stringp (aref body 0))
+	(insert (aref body 0))
+      (let ((transfer-encoding (rmail-mime-entity-transfer-encoding entity)))
+	(insert-buffer-substring rmail-mime-mbox-buffer
+				 (aref body 0) (aref body 1))
+	(cond ((string= transfer-encoding "base64")
+	       (ignore-errors (base64-decode-region pos (point))))
+	      ((string= transfer-encoding "quoted-printable")
+	       (quoted-printable-decode-region pos (point))))))
+    (decode-coding-region pos (point) coding-system)
+    (or rmail-mime-coding-system
+	(setq rmail-mime-coding-system coding-system))
+    (or (bolp) (insert "\n"))))
+
+(defun rmail-mime-insert-text (entity)
+  "Presentation handler for a plain text MIME entity."
+  (let ((current (aref (rmail-mime-entity-display entity) 0))
+	(new (aref (rmail-mime-entity-display entity) 1))
+	(header (rmail-mime-entity-header entity))
+	(tagline (rmail-mime-entity-tagline entity))
+	(body (rmail-mime-entity-body entity))
+	(beg (point))
+	(segment (rmail-mime-entity-segment (point) entity)))
+
+    (or (integerp (aref body 0))
+	(let ((data (buffer-string)))
+	  (aset body 0 data)
+	  (delete-region (point-min) (point-max))))
+
+    ;; header
+    (if (eq (aref current 0) (aref new 0))
+	(goto-char (aref segment 2))
+      (if (aref current 0)
+	  (delete-char (- (aref segment 2) (aref segment 1))))
+      (if (aref new 0)
+	  (rmail-mime-insert-header header)))
+    ;; tagline
+    (if (eq (aref current 1) (aref new 1))
+	(forward-char (- (aref segment 3) (aref segment 2)))
+      (if (aref current 1)
+	  (delete-char (- (aref segment 3) (aref segment 2))))
+      (if (aref new 1)
+	  (rmail-mime-insert-tagline entity)))
+    ;; body
+    (if (eq (aref current 2) (aref new 2))
+	(forward-char (- (aref segment 4) (aref segment 3)))
+      (if (aref current 2)
+	  (delete-char (- (aref segment 4) (aref segment 3))))
+      (if (aref new 2)
+	  (rmail-mime-insert-decoded-text entity)))
+    (put-text-property beg (point) 'rmail-mime-entity entity)))
 
 ;; FIXME move to the test/ directory?
 (defun test-rmail-mime-handler ()
@@ -264,35 +574,35 @@
     (set-buffer-multibyte t)))
 
 
-(defun rmail-mime-insert-image (type 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)
-  (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))
+(defun rmail-mime-insert-image (entity)
+  "Decode and insert the image body of MIME-entity ENTITY."
+  (let* ((content-type (car (rmail-mime-entity-type entity)))
+	 (bulk-data (aref (rmail-mime-entity-tagline entity) 1))
+	 (body (rmail-mime-entity-body entity))
+	 data)
+    (if (stringp (aref body 0))
+	(setq data (aref body 0))
+      (let ((rmail-mime-mbox-buffer rmail-view-buffer)
+	    (transfer-encoding (rmail-mime-entity-transfer-encoding entity)))
 	(with-temp-buffer
 	  (set-buffer-multibyte nil)
 	  (setq buffer-undo-list t)
-	  (insert-buffer-substring mbox-buffer (car body) (cdr body))
+	  (insert-buffer-substring rmail-mime-mbox-buffer
+				   (aref body 0) (aref body 1))
 	  (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)))
+    (insert-image (create-image data (cdr bulk-data) t))
+    (insert "\n")))
 
 (defun rmail-mime-image (button)
   "Display the image associated with BUTTON."
-  (let ((inhibit-read-only t))
-    (rmail-mime-insert-image (button-get button 'image-type)
-			     (button-get button 'image-data))))
+  (save-excursion
+    (goto-char (button-end button))
+    (rmail-mime-toggle-hidden)))
 
 (define-button-type 'rmail-mime-image 'action 'rmail-mime-image)
 
@@ -305,15 +615,60 @@
 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)))
+		      (vector (vector nil nil nil) (vector nil t nil))
+		      (vector nil nil nil) (vector "" (cons nil nil) t)
+		      (vector nil nil nil) nil 'rmail-mime-insert-bulk)))
+
+(defun rmail-mime-set-bulk-data (entity)
+  "Setup the information about the attachment object for MIME-entity ENTITY.
+The value is non-nil if and only if the attachment object should be shown
+directly."
+  (let ((content-type (car (rmail-mime-entity-type entity)))
+	(size (cdr (assq 'size (cdr (rmail-mime-entity-disposition entity)))))
+	(bulk-data (aref (rmail-mime-entity-tagline entity) 1))
+	(body (rmail-mime-entity-body entity))
+	size type to-show)
+    (cond (size
+	   (setq size (string-to-number size)))
+	  ((stringp (aref body 0))
+	   (setq size (length (aref body 0))))
+	  (t
+	   ;; Rough estimation of the size.
+	   (let ((encoding (rmail-mime-entity-transfer-encoding entity)))
+	     (setq size (- (aref body 1) (aref body 0)))
+	     (cond ((string= encoding "base64")
+		    (setq size (/ (* size 3) 4)))
+		   ((string= encoding "quoted-printable")
+		    (setq size (/ (* size 7) 3)))))))
+
+    (cond
+     ((string-match "text/" content-type)
+      (setq type 'text))
+     ((string-match "image/\\(.*\\)" content-type)
+      (setq type (image-type-from-file-name
+		  (concat "." (match-string 1 content-type))))
+      (if (and (memq type image-types)
+	       (image-type-available-p type))
+	  (if (and rmail-mime-show-images
+		   (not (eq rmail-mime-show-images 'button))
+		   (or (not (numberp rmail-mime-show-images))
+		       (< size rmail-mime-show-images)))
+	      (setq to-show t))
+	(setq type nil))))
+    (setcar bulk-data size)
+    (setcdr bulk-data type)
+    to-show))
 
 (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."
+  "Presentation handler for an attachment MIME entity."
   ;; Find the default directory for this media type.
   (let* ((content-type (rmail-mime-entity-type entity))
 	 (content-disposition (rmail-mime-entity-disposition entity))
+	 (current (aref (rmail-mime-entity-display entity) 0))
+	 (new (aref (rmail-mime-entity-display entity) 1))
+	 (header (rmail-mime-entity-header entity))
+	 (tagline (rmail-mime-entity-tagline entity))
+	 (bulk-data (aref tagline 1))
 	 (body (rmail-mime-entity-body entity))
 	 (directory (catch 'directory
 		      (dolist (entry rmail-mime-attachment-dirs-alist)
@@ -324,47 +679,70 @@
 	 (filename (or (cdr (assq 'name (cdr content-type)))
 		       (cdr (assq 'filename (cdr content-disposition)))
 		       "noname"))
-	 (label (format "\nAttached %s file: " (car content-type)))
 	 (units '(B kB MB GB))
-	 data udata size osize type)
-    (if body
+	 (segment (rmail-mime-entity-segment (point) entity))
+	 beg data size)
+
+    (if (integerp (aref body 0))
 	(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)
+	      size (car bulk-data))
+      (if (stringp (aref body 0))
+	  (setq data (aref body 0))
+	(setq data (string-as-unibyte (buffer-string)))
+	(aset body 0 data)
+	(rmail-mime-set-bulk-data entity)
+	(delete-region (point-min) (point-max)))
+      (setq size (length data)))
     (while (and (> size 1024.0) ; cribbed from gnus-agent-expire-done-message
 		(cdr units))
       (setq size (/ size 1024.0)
 	    units (cdr units)))
-    (insert label)
-    (insert-button filename
-		   :type 'rmail-mime-save
-		   'help-echo "mouse-2, RET: Save attachment"
-		   'filename filename
-		   'directory (file-name-as-directory directory)
-		   'data data)
-    (insert (format " (%.0f%s)" size (car units)))
-    (when (and rmail-mime-show-images
-	       (string-match "image/\\(.*\\)" (setq type (car content-type)))
-	       (setq type (concat "." (match-string 1 type))
-		     type (image-type-from-file-name type))
-	       (memq type image-types)
-	       (image-type-available-p type))
-      (insert " ")
-      (cond ((or (eq rmail-mime-show-images 'button)
-		 (and (numberp rmail-mime-show-images)
-		      (>= osize rmail-mime-show-images)))
-	     (insert-button "Display"
-			    :type 'rmail-mime-image
-			    'help-echo "mouse-2, RET: Show image"
-			    'image-type type
-			    'image-data udata))
-	    (t
-	     (rmail-mime-insert-image type udata))))))
+
+    (setq beg (point))
+
+    ;; header
+    (if (eq (aref current 0) (aref new 0))
+	(goto-char (aref segment 2))
+      (if (aref current 0)
+	  (delete-char (- (aref segment 2) (aref segment 1))))
+      (if (aref new 0)
+	  (rmail-mime-insert-header header)))
+
+    ;; tagline
+    (if (eq (aref current 1) (aref new 1))
+	(forward-char (- (aref segment 3) (aref segment 2)))
+      (if (aref current 1)
+	  (delete-char (- (aref segment 3) (aref segment 2))))
+      (if (aref new 1)
+	  (rmail-mime-insert-tagline
+	   entity
+	   " file:"
+	   (list filename
+		 :type 'rmail-mime-save
+		 'help-echo "mouse-2, RET: Save attachment"
+		 'filename filename
+		 'directory (file-name-as-directory directory)
+		 'data data)
+	   (format " (%.0f%s)" size (car units))
+	   (if (cdr bulk-data)
+	       " ")
+	   (if (cdr bulk-data)
+	       (list "Toggle show/hide"
+		     :type 'rmail-mime-image
+		     'help-echo "mouse-2, RET: Toggle show/hide"
+		     'image-type (cdr bulk-data)
+		     'image-data data)))))
+    ;; body
+    (if (eq (aref current 2) (aref new 2))
+	(forward-char (- (aref segment 4) (aref segment 3)))
+      (if (aref current 2)
+	  (delete-char (- (aref segment 4) (aref segment 3))))
+      (if (aref new 2)
+	  (cond ((eq (cdr bulk-data) 'text)
+		 (rmail-mime-insert-decoded-text entity))
+		((cdr bulk-data)
+		 (rmail-mime-insert-image entity)))))
+    (put-text-property beg (point) 'rmail-mime-entity entity)))
 
 (defun test-rmail-mime-bulk-handler ()
   "Test of a mail used as an example in RFC 2183."
@@ -396,19 +774,21 @@
 of the respective parsed headers.  See `rmail-mime-handle' for their
 format."
   (rmail-mime-process-multipart
-   content-type content-disposition content-transfer-encoding nil))
+   content-type content-disposition content-transfer-encoding nil)
+  t)
 
 (defun rmail-mime-process-multipart (content-type
 				     content-disposition
 				     content-transfer-encoding
-				     parse-only)
+				     parse-tag)
   "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.
+If PARSE-TAG 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.
+Otherwise, PARSE-TAG is a string indicating the depth and index
+number of the entity.  In this case, 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
@@ -419,6 +799,8 @@
   ;;    of the preceding part.
   ;; We currently don't handle that.
   (let ((boundary (cdr (assq 'boundary content-type)))
+	(subtype (cadr (split-string (car content-type) "/")))
+	(index 0)
 	beg end next entities)
     (unless boundary
       (rmail-mm-get-boundary-error-message
@@ -429,12 +811,20 @@
     (goto-char (point-min))
     (when (and (search-forward boundary nil t)
 	       (looking-at "[ \t]*\n"))
-      (if parse-only
+      (if parse-tag
 	  (narrow-to-region (match-end 0) (point-max))
 	(delete-region (point-min) (match-end 0))))
+
+    ;; Change content-type to the proper default one for the children.
+    (cond ((string-match "mixed" subtype)
+	   (setq content-type '("text/plain")))
+	  ((string-match "digest" subtype)
+	   (setq content-type '("message/rfc822"))))
+
     ;; 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.
+    ;; the beginning of the next part.  The current point is just
+    ;; after the boundary tag.
     (setq beg (point-min))
     (while (search-forward boundary nil t)
       (setq end (match-beginning 0))
@@ -449,17 +839,46 @@
 	     (rmail-mm-get-boundary-error-message
 	      "Malformed boundary" content-type content-disposition
 	      content-transfer-encoding)))
+
+      (setq index (1+ index))
       ;; Handle the part.
-      (if parse-only
+      (if parse-tag
 	  (save-restriction
 	    (narrow-to-region beg end)
-	    (setq entities (cons (rmail-mime-process nil t) entities)))
+	    (let ((child (rmail-mime-process
+			  nil (format "%s/%d" parse-tag index)
+			  content-type content-disposition)))
+	      ;; Display a tagline.
+	      (aset (aref (rmail-mime-entity-display child) 1) 1
+		    (aset (rmail-mime-entity-tagline child) 2 t))
+	      (push child entities)))
+
 	(delete-region end next)
 	(save-restriction
 	  (narrow-to-region beg end)
 	  (rmail-mime-show)))
       (goto-char (setq beg next)))
-    (nreverse entities)))
+
+    (when parse-tag
+      (setq entities (nreverse entities))
+      (if (string-match "alternative" subtype)
+	  ;; Find the best entity to show, and hide all the others.
+	  (let (best second)
+	    (dolist (child entities)
+	      (if (string= (or (car (rmail-mime-entity-disposition child))
+			       (car content-disposition))
+			   "inline")
+		  (if (string-match "text/plain"
+				    (car (rmail-mime-entity-type child)))
+		      (setq best child)
+		    (if (string-match "text/.*"
+				      (car (rmail-mime-entity-type child)))
+			(setq second child)))))
+	    (or best (not second) (setq best second))
+	    (dolist (child entities)
+	      (or (eq best child)
+		  (rmail-mime-hidden-mode child t)))))
+      entities)))
 
 (defun test-rmail-mime-multipart-handler ()
   "Test of a mail used as an example in RFC 2046."
@@ -492,6 +911,40 @@
     (insert mail)
     (rmail-mime-show t)))
 
+(defun rmail-mime-insert-multipart (entity)
+  "Presentation handler for a multipart MIME entity."
+  (let ((current (aref (rmail-mime-entity-display entity) 0))
+	(new (aref (rmail-mime-entity-display entity) 1))
+	(header (rmail-mime-entity-header entity))
+	(tagline (rmail-mime-entity-tagline entity))
+	(body (rmail-mime-entity-body entity))
+	(beg (point))
+	(segment (rmail-mime-entity-segment (point) entity)))
+    ;; header
+    (if (eq (aref current 0) (aref new 0))
+	(goto-char (aref segment 2))
+      (if (aref current 0)
+	  (delete-char (- (aref segment 2) (aref segment 1))))
+      (if (aref new 0)
+	  (rmail-mime-insert-header header)))
+    ;; tagline
+    (if (eq (aref current 1) (aref new 1))
+	(forward-char (- (aref segment 3) (aref segment 2)))
+      (if (aref current 1)
+	  (delete-char (- (aref segment 3) (aref segment 2))))
+      (if (aref new 1)
+	  (rmail-mime-insert-tagline entity)))
+
+    (put-text-property beg (point) 'rmail-mime-entity entity)
+    ;; body
+    (if (eq (aref current 2) (aref new 2))
+	(forward-char (- (aref segment 4) (aref segment 3)))
+      (if (aref current 2)
+	  (delete-char (- (aref segment 4) (aref segment 3))))
+      (if (aref new 2)
+	  (dolist (child (rmail-mime-entity-children entity))
+	    (rmail-mime-insert child))))))
+
 ;;; Main code
 
 (defun rmail-mime-handle (content-type
@@ -564,7 +1017,9 @@
 modified."
   (rmail-mime-process show-headers nil))
 
-(defun rmail-mime-process (show-headers parse-only)
+(defun rmail-mime-process (show-headers parse-tag &optional
+					default-content-type
+					default-content-disposition)
   (let ((end (point-min))
 	content-type
 	content-transfer-encoding
@@ -595,45 +1050,76 @@
     (setq content-type
 	  (if content-type
 	      (mail-header-parse-content-type content-type)
-	    ;; FIXME: Default "message/rfc822" in a "multipart/digest"
-	    ;; according to RFC 2046.
-	    '("text/plain")))
+	    (or default-content-type '("text/plain"))))
     (setq content-disposition
 	  (if content-disposition
 	      (mail-header-parse-content-disposition content-disposition)
 	    ;; If none specified, we are free to choose what we deem
 	    ;; suitable according to RFC 2183.  We like inline.
-	    '("inline")))
+	    (or default-content-disposition '("inline"))))
     ;; Unrecognized disposition types are to be treated like
     ;; attachment according to RFC 2183.
     (unless (member (car content-disposition) '("inline" "attachment"))
       (setq content-disposition '("attachment")))
 
-    (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))))
+    (if parse-tag
+	(let* ((is-inline (string= (car content-disposition) "inline"))
+	       (header (vector (point-min) end nil))
+	       (tagline (vector parse-tag (cons nil nil) t))
+	       (body (vector end (point-max) is-inline))
+	       (new (vector (aref header 2) (aref tagline 2) (aref body 2)))
+	       children handler entity)
+	  (cond ((string-match "multipart/.*" (car content-type))
+		 (save-restriction
+		   (narrow-to-region (1- end) (point-max))
+		   (setq children (rmail-mime-process-multipart
+				   content-type
+				   content-disposition
+				   content-transfer-encoding
+				   parse-tag)
+			 handler 'rmail-mime-insert-multipart)))
+		((string-match "message/rfc822" (car content-type))
+		 (save-restriction
 		   (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)))
+		   (let* ((msg (rmail-mime-process t parse-tag
+						   '("text/plain") '("inline")))
+			  (msg-new (aref (rmail-mime-entity-display msg) 1)))
+		     ;; Show header of the child.
+		     (aset msg-new 0 t)
+		     (aset (rmail-mime-entity-header msg) 2 t)
+		     ;; Hide tagline of the child.
+		     (aset msg-new 1 nil)
+		     (aset (rmail-mime-entity-tagline msg) 2 nil)
+		     (setq children (list msg)
+			   handler 'rmail-mime-insert-multipart))))
+		((and is-inline (string-match "text/" (car content-type)))
+		 ;; Don't need a tagline.
+		 (aset new 1 (aset tagline 2 nil))
+		 (setq handler 'rmail-mime-insert-text))
+		(t
+		 ;; Force hidden mode.
+		 (aset new 1 (aset tagline 2 t))
+		 (aset new 2 (aset body 2 nil))
+		 (setq handler 'rmail-mime-insert-bulk)))
+	  (setq entity (rmail-mime-entity content-type
+					  content-disposition
+					  content-transfer-encoding
+					  (vector (vector nil nil nil) new)
+					  header tagline body children handler))
+	  (if (and (eq handler 'rmail-mime-insert-bulk)
+		   (rmail-mime-set-bulk-data entity))
+	      ;; Show the body.
+	      (aset new 2 (aset body 2 t)))
+	  entity)
+
       ;; Hide headers and handle the part.
+      (put-text-property (point-min) (point-max) 'rmail-mime-entity
+			 (rmail-mime-entity 
+			 content-type content-disposition
+			 content-transfer-encoding
+			 (vector (vector 'raw nil 'raw) (vector 'raw nil 'raw))
+			 (vector nil nil 'raw) (vector "" (cons nil nil) nil)
+			 (vector nil nil 'raw) nil nil))
       (save-restriction
 	(cond ((string= (car content-type) "message/rfc822")
 	       (narrow-to-region end (point-max)))
@@ -642,102 +1128,117 @@
 	(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))))
+The value is a MIME-entiy object (see `rmail-mime-entity')."
+  (let ((rmail-mime-mbox-buffer (if (rmail-buffers-swapped-p)
+				    rmail-view-buffer
+				  (current-buffer))))
+    ;;(condition-case err
+	(with-current-buffer rmail-mime-mbox-buffer
+	  (save-excursion
+	    (goto-char (point-min))
+	    (let* ((entity (rmail-mime-process t ""
+					       '("text/plain") '("inline")))
+		   (new (aref (rmail-mime-entity-display entity) 1)))
+	      ;; Show header.
+	      (aset new 0 (aset (rmail-mime-entity-header entity) 2 t))
+	      ;; Show tagline if and only if body is not shown.
+	      (if (aref new 2)
+		  (aset new 1 (aset (rmail-mime-entity-tagline entity) 2 nil))
+		(aset new 1 (aset (rmail-mime-entity-tagline entity) 2 t)))
+	      entity)))
+	;;(error (error (format "%s" err))))
+    ))
 
-(defun rmail-mime-insert (entity &optional content-type disposition)
+(defun rmail-mime-insert (entity)
   "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))))
+  (let ((current (aref (rmail-mime-entity-display entity) 0))
+	(new (aref (rmail-mime-entity-display entity) 1)))
+    (if (not (eq (aref new 0) 'raw))
+	;; Not a raw-mode.  Each handler should handle it.
+	(funcall (rmail-mime-entity-handler entity) entity)
+      (let ((header (rmail-mime-entity-header entity))
+	    (tagline (rmail-mime-entity-tagline entity))
+	    (body (rmail-mime-entity-body entity))
+	    (beg (point))
+	    (segment (rmail-mime-entity-segment (point) entity)))
+	;; header
+	(if (eq (aref current 0) (aref new 0))
+	    (goto-char (aref segment 2))
+	  (if (aref current 0)
+	      (delete-char (- (aref segment 2) (aref segment 1))))
+	  (insert-buffer-substring rmail-mime-mbox-buffer
+				     (aref header 0) (aref header 1)))
+	;; tagline
+	(if (aref current 1)
+	    (delete-char (- (aref segment 3) (aref segment 2))))
+	;; body
+	(if (eq (aref current 2) (aref new 2))
+	    (forward-char (- (aref segment 4) (aref segment 3)))
+	  (if (aref current 2)
+	      (delete-char (- (aref segment 4) (aref segment 3))))
+	  (insert-buffer-substring rmail-mime-mbox-buffer
+				   (aref body 0) (aref body 1)))
+	(put-text-property beg (point) 'rmail-mime-entity entity)))
+    (dotimes (i 3)
+      (aset current i (aref new i)))))
 
 (define-derived-mode rmail-mime-mode fundamental-mode "RMIME"
   "Major mode used in `rmail-mime' buffers."
   (setq font-lock-defaults '(rmail-font-lock-keywords t t nil nil)))
 
 ;;;###autoload
-(defun rmail-mime ()
-  "Process the current Rmail message as a MIME message.
-This creates a temporary \"*RMAIL*\" buffer holding a decoded
-copy of the message.  Inline content-types are handled according to
+(defun rmail-mime (&optional arg)
+  "Toggle displaying of a MIME message.
+
+The actualy behavior depends on the value of `rmail-enable-mime'.
+
+If `rmail-enable-mime' is t (default), this command change the
+displaying of a MIME message between decoded presentation form
+and raw data.
+
+With ARG, toggle the displaying of the current MIME entity only.
+
+If `rmail-enable-mime' is nil, this creates a temporary
+\"*RMAIL*\" buffer holding a decoded copy of the message.  Inline
+content-types are handled according to
 `rmail-mime-media-type-handlers-alist'.  By default, this
 displays text and multipart messages, and offers to download
 attachments as specfied by `rmail-mime-attachment-dirs-alist'."
-  (interactive)
-  (let ((data (rmail-apply-in-message rmail-current-message 'buffer-string))
-	(buf (get-buffer-create "*RMAIL*")))
-    (set-buffer buf)
-    (setq buffer-undo-list t)
-    (let ((inhibit-read-only t))
-      ;; Decoding the message in fundamental mode for speed, only
-      ;; switching to rmail-mime-mode at the end for display.  Eg
-      ;; quoted-printable-decode-region gets very slow otherwise (Bug#4993).
-      (fundamental-mode)
-      (erase-buffer)
-      (insert data)
-      (rmail-mime-show t)
-      (rmail-mime-mode)
-      (set-buffer-modified-p nil))
-    (view-buffer buf)))
+  (interactive "P")
+  (if rmail-enable-mime
+      (if (rmail-mime-message-p)
+	  (let ((rmail-mime-mbox-buffer rmail-view-buffer)
+		(rmail-mime-view-buffer rmail-buffer)
+		(entity (get-text-property (point) 'rmail-mime-entity)))
+	    (if arg
+		(if entity
+		    (rmail-mime-toggle-raw entity))
+	      (goto-char (point-min))
+	      (rmail-mime-toggle-raw
+	       (get-text-property (point) 'rmail-mime-entity))))
+	(message "Not a MIME message"))
+    (let* ((data (rmail-apply-in-message rmail-current-message 'buffer-string))
+	   (buf (get-buffer-create "*RMAIL*"))
+	   (rmail-mime-mbox-buffer rmail-view-buffer)
+	   (rmail-mime-view-buffer buf))
+      (set-buffer buf)
+      (setq buffer-undo-list t)
+      (let ((inhibit-read-only t))
+	;; Decoding the message in fundamental mode for speed, only
+	;; switching to rmail-mime-mode at the end for display.  Eg
+	;; quoted-printable-decode-region gets very slow otherwise (Bug#4993).
+	(fundamental-mode)
+	(erase-buffer)
+	(insert data)
+	(rmail-mime-show t)
+	(rmail-mime-mode)
+	(set-buffer-modified-p nil))
+      (view-buffer buf))))
 
 (defun rmail-mm-get-boundary-error-message (message type disposition encoding)
   "Return MESSAGE with more information on the main mime components."
@@ -746,34 +1247,39 @@
 
 (defun rmail-show-mime ()
   "Function to set in `rmail-show-mime-function' (which see)."
-  (let ((mbox-buf rmail-buffer)
-	(entity (rmail-mime-parse)))
+  (let ((entity (rmail-mime-parse))
+	(rmail-mime-mbox-buffer rmail-buffer)
+	(rmail-mime-view-buffer rmail-view-buffer)
+	(rmail-mime-coding-system nil))
     (if entity
-	(with-current-buffer rmail-view-buffer
-	  (let ((inhibit-read-only t)
-		(rmail-buffer mbox-buf))
-	    (erase-buffer)
-	    (rmail-mime-insert entity)))
+	(with-current-buffer rmail-mime-view-buffer
+	  (erase-buffer)
+	  (rmail-mime-insert entity)
+	  (if rmail-mime-coding-system
+	      (set-buffer-file-coding-system rmail-mime-coding-system t t)))
       ;; Decoding failed.  Insert the original message body as is.
-      (let ((region (with-current-buffer mbox-buf
+      (let ((region (with-current-buffer rmail-mime-mbox-buffer
 		      (goto-char (point-min))
 		      (re-search-forward "^$" nil t)
 		      (forward-line 1)
 		      (cons (point) (point-max)))))
-	(with-current-buffer rmail-view-buffer
+	(with-current-buffer rmail-mime-view-buffer
 	  (let ((inhibit-read-only t))
 	    (erase-buffer)
-	    (insert-buffer-substring mbox-buf (car region) (cdr region))))
+	    (insert-buffer-substring rmail-mime-mbox-buffer
+				     (car region) (cdr region))))
+	(set-buffer-file-coding-system 'no-conversion t t)
 	(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)))
+  (let ((rmail-mime-mbox-buffer
+	 (with-current-buffer forward-buffer rmail-view-buffer)))
     (save-restriction
       (narrow-to-region (point) (point))
-      (message-forward-make-body-mime mbox-buf))))
+      (message-forward-make-body-mime rmail-mime-mbox-buffer))))
 
 (setq rmail-insert-mime-forwarded-message-function
       'rmail-insert-mime-forwarded-message)
@@ -794,15 +1300,16 @@
   "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)))
+    (let* ((rmail-mime-mbox-buffer (current-buffer))
+	   (rmail-mime-view-buffer rmail-view-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)
+	 (insert-buffer-substring rmail-mime-mbox-buffer nil header-end)
 	 (rfc2047-decode-region (point-min) (point))
 	 (goto-char (point-min))
 	 (re-search-forward regexp nil t))
@@ -815,8 +1322,7 @@
 			   (not (string= (downcase charset) "us-ascii"))))))
 	   ;; Search the decoded MIME message.
 	   (with-temp-buffer
-	     (let ((rmail-buffer mbox-buf))
-	       (rmail-mime-insert entity))
+	     (rmail-mime-insert entity)
 	     (goto-char (point-min))
 	     (re-search-forward regexp nil t))
 	 ;; Search the body without decoding.
--- a/lisp/mail/smtpmail.el	Fri Dec 24 17:47:22 2010 +0900
+++ b/lisp/mail/smtpmail.el	Fri Dec 24 17:49:24 2010 +0900
@@ -392,7 +392,14 @@
 		(make-directory smtpmail-queue-dir t))
 	      (with-current-buffer buffer-data
 		(erase-buffer)
-		(set-buffer-file-coding-system smtpmail-code-conv-from nil t)
+		(set-buffer-file-coding-system
+		 ;; We will be reading the file with no-conversion in
+		 ;; smtpmail-send-queued-mail below, so write it out
+		 ;; with Unix EOLs.
+		 (coding-system-change-eol-conversion
+		  (or smtpmail-code-conv-from 'undecided)
+		  'unix)
+		 nil t)
 		(insert-buffer-substring tembuf)
 		(write-file file-data)
 		(set-buffer buffer-elisp)
@@ -1007,5 +1014,4 @@
 
 (provide 'smtpmail)
 
-;; arch-tag: a76992df-6d71-43b7-9e72-4bacc6c05466
 ;;; smtpmail.el ends here
--- a/lisp/menu-bar.el	Fri Dec 24 17:47:22 2010 +0900
+++ b/lisp/menu-bar.el	Fri Dec 24 17:49:24 2010 +0900
@@ -980,16 +980,33 @@
 	      :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)))))
 
 (define-key menu-bar-showhide-menu [showhide-tool-bar]
   `(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))
--- a/lisp/mouse.el	Fri Dec 24 17:47:22 2010 +0900
+++ b/lisp/mouse.el	Fri Dec 24 17:49:24 2010 +0900
@@ -181,6 +181,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)
@@ -213,6 +214,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]))
@@ -2607,5 +2609,4 @@
 (make-obsolete 'mldrag-drag-vertical-line 'mouse-drag-vertical-line "21.1")
 (provide 'mldrag)
 
-;; arch-tag: 9a710ce1-914a-4923-9b81-697f7bf82ab3
 ;;; mouse.el ends here
--- a/lisp/net/tramp.el	Fri Dec 24 17:47:22 2010 +0900
+++ b/lisp/net/tramp.el	Fri Dec 24 17:49:24 2010 +0900
@@ -4522,60 +4522,65 @@
 (defun tramp-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 (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-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 (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-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-handle-process-file
   (program &optional infile destination display &rest args)
@@ -6810,26 +6815,27 @@
   (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/simple.el	Fri Dec 24 17:47:22 2010 +0900
+++ b/lisp/simple.el	Fri Dec 24 17:49:24 2010 +0900
@@ -4115,6 +4115,11 @@
 	 ;; When already vscrolled, we vscroll some more if we can,
 	 ;; or clear vscroll and move forward at end of tall image.
 	 ((> (setq vs (window-vscroll nil t)) 0)
+
+	  ;; If we are vscrolling an image at the top of the screen,
+	  ;; we could actually advance point if this yields space
+	  ;; below....
+
 	  (when (> rbot 0)
 	    (set-window-vscroll nil (+ vs (min rbot (frame-char-height))) t)))
 	 ;; If cursor just entered the bottom scroll margin, move forward,
--- a/lisp/subr.el	Fri Dec 24 17:47:22 2010 +0900
+++ b/lisp/subr.el	Fri Dec 24 17:49:24 2010 +0900
@@ -1,7 +1,8 @@
 ;;; subr.el --- basic lisp subroutines for Emacs
 
 ;; Copyright (C) 1985, 1986, 1992, 1994, 1995, 1999, 2000, 2001, 2002, 2003,
-;;   2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+;;   2004, 2005, 2006, 2007, 2008, 2009, 2010
+;;   Free Software Foundation, Inc.
 
 ;; Maintainer: FSF
 ;; Keywords: internal
@@ -418,7 +419,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."
@@ -957,7 +958,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.
@@ -1392,9 +1395,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
@@ -2495,7 +2497,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
@@ -2767,7 +2769,7 @@
                 (kill-buffer ,temp-buffer)))))))
 
 (defmacro with-silent-modifications (&rest body)
-  "Execute BODY, pretending it does not modifies the buffer.
+  "Execute BODY, pretending it does not modify the buffer.
 If BODY performs real modifications to the buffer's text, other
 than cosmetic ones, undo data may become corrupted.
 Typically used around modifications of text-properties which do not really
@@ -3778,9 +3780,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/textmodes/rst.el	Fri Dec 24 17:47:22 2010 +0900
+++ b/lisp/textmodes/rst.el	Fri Dec 24 17:49:24 2010 +0900
@@ -3307,7 +3307,7 @@
 (defun rst-compile-pdf-preview ()
   "Convert the document to a PDF file and launch a preview program."
   (interactive)
-  (let* ((tmp-filename "/tmp/out.pdf")
+  (let* ((tmp-filename (make-temp-file "rst-out" nil ".pdf"))
 	 (command (format "rst2pdf.py %s %s && %s %s"
 			  buffer-file-name tmp-filename
 			  rst-pdf-program tmp-filename)))
@@ -3322,7 +3322,7 @@
 (defun rst-compile-slides-preview ()
   "Convert the document to an S5 slide presentation and launch a preview program."
   (interactive)
-  (let* ((tmp-filename "/tmp/slides.html")
+  (let* ((tmp-filename (make-temp-file "rst-slides" nil ".html"))
 	 (command (format "rst2s5.py %s %s && %s %s"
 			  buffer-file-name tmp-filename
 			  rst-slides-program tmp-filename)))
--- a/lisp/version.el	Fri Dec 24 17:47:22 2010 +0900
+++ b/lisp/version.el	Fri Dec 24 17:49:24 2010 +0900
@@ -32,7 +32,7 @@
 (defconst emacs-copyright "Copyright (C) 2010 Free Software Foundation, Inc." "\
 Short copyright string for this version of Emacs.")
 
-(defconst emacs-version "23.2.90" "\
+(defconst emacs-version "23.2.91" "\
 Version numbers of this version of Emacs.")
 
 (defconst emacs-major-version (progn (string-match "^[0-9]+" emacs-version) (string-to-number (match-string 0 emacs-version))) "\
--- a/make-dist	Fri Dec 24 17:47:22 2010 +0900
+++ b/make-dist	Fri Dec 24 17:49:24 2010 +0900
@@ -602,7 +602,7 @@
    fi
  done
  cd ../${tempdir}/etc
- rm -f fns*.el
+ rm -f fns*.el *.pyc
  rm -f DOC* *~ \#*\# *.dvi *.log *.orig *.rej *,v =* core
  rm -f TAGS)
 
--- a/nextstep/Cocoa/Emacs.base/Contents/Info.plist	Fri Dec 24 17:47:22 2010 +0900
+++ b/nextstep/Cocoa/Emacs.base/Contents/Info.plist	Fri Dec 24 17:49:24 2010 +0900
@@ -553,7 +553,7 @@
 	<key>CFBundleExecutable</key>
 	<string>Emacs</string>
 	<key>CFBundleGetInfoString</key>
-	<string>Emacs 23.2.90 Copyright (C) 2010 Free Software Foundation, Inc.</string>
+	<string>Emacs 23.2.91 Copyright (C) 2010 Free Software Foundation, Inc.</string>
 	<key>CFBundleIconFile</key>
 	<string>Emacs.icns</string>
 	<key>CFBundleIdentifier</key>
@@ -566,7 +566,7 @@
 	<string>APPL</string>
 	<!-- This should be the emacs version number. -->
 	<key>CFBundleShortVersionString</key>
-	<string>23.2.90</string>
+	<string>23.2.91</string>
 	<key>CFBundleSignature</key>
 	<string>EMAx</string>
 	<!-- This SHOULD be a build number. -->
--- a/nextstep/Cocoa/Emacs.base/Contents/Resources/English.lproj/InfoPlist.strings	Fri Dec 24 17:47:22 2010 +0900
+++ b/nextstep/Cocoa/Emacs.base/Contents/Resources/English.lproj/InfoPlist.strings	Fri Dec 24 17:49:24 2010 +0900
@@ -1,6 +1,6 @@
 /* Localized versions of Info.plist keys */
 
 CFBundleName = "Emacs";
-CFBundleShortVersionString = "Version 23.2.90";
-CFBundleGetInfoString = "Emacs version 23.2.90, NS Windowing";
+CFBundleShortVersionString = "Version 23.2.91";
+CFBundleGetInfoString = "Emacs version 23.2.91, NS Windowing";
 NSHumanReadableCopyright = "Copyright (C) 2010 Free Software Foundation, Inc.";
--- a/nextstep/GNUstep/Emacs.base/Resources/Emacs.desktop	Fri Dec 24 17:47:22 2010 +0900
+++ b/nextstep/GNUstep/Emacs.base/Resources/Emacs.desktop	Fri Dec 24 17:49:24 2010 +0900
@@ -1,7 +1,7 @@
 [Desktop Entry]
 Encoding=UTF-8
 Type=Application
-Version=23.2.90
+Version=23.2.91
 Categories=GNUstep
 Name=Emacs
 Comment=GNU Emacs for NeXT/Open/GNUstep and OS X
--- a/nextstep/GNUstep/Emacs.base/Resources/Info-gnustep.plist	Fri Dec 24 17:47:22 2010 +0900
+++ b/nextstep/GNUstep/Emacs.base/Resources/Info-gnustep.plist	Fri Dec 24 17:49:24 2010 +0900
@@ -2,7 +2,7 @@
     ApplicationDescription = "GNU Emacs for GNUstep / OS X";
     ApplicationIcon = emacs.tiff;
     ApplicationName = Emacs;
-    ApplicationRelease = "23.2.90";
+    ApplicationRelease = "23.2.91";
     Authors = (
 	"Adrian Robert (GNUstep)",
 	"Christophe de Dinechin (MacOS X)",
@@ -13,7 +13,7 @@
     );
     Copyright = "Copyright (C) 2010 Free Software Foundation, Inc.";
     CopyrightDescription = "Released under the GNU General Public License Version 3 or later";
-    FullVersionID = "Emacs 23.2.90, NS Windowing";
+    FullVersionID = "Emacs 23.2.91, NS Windowing";
     NSExecutable = Emacs;
     NSIcon = emacs.tiff;
     NSPrincipalClass = NSApplication;
--- a/nt/emacs.rc	Fri Dec 24 17:47:22 2010 +0900
+++ b/nt/emacs.rc	Fri Dec 24 17:49:24 2010 +0900
@@ -7,8 +7,8 @@
 #endif
 
 VS_VERSION_INFO VERSIONINFO
- FILEVERSION 23,2,90,0
- PRODUCTVERSION 23,2,90,0
+ FILEVERSION 23,2,91,0
+ PRODUCTVERSION 23,2,91,0
  FILEFLAGSMASK 0x3FL
 #ifdef EMACSDEBUG
  FILEFLAGS 0x1L
@@ -25,12 +25,12 @@
 	BEGIN
 	    VALUE "CompanyName", "Free Software Foundation\0"
 	    VALUE "FileDescription", "GNU Emacs: The extensible self-documenting text editor\0"
-	    VALUE "FileVersion", "23, 2, 90, 0\0"
+	    VALUE "FileVersion", "23, 2, 91, 0\0"
 	    VALUE "InternalName", "Emacs\0"
 	    VALUE "LegalCopyright", "Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010\0"
 	    VALUE "OriginalFilename", "emacs.exe"
 	    VALUE "ProductName", "Emacs\0"
-	    VALUE "ProductVersion", "23, 2, 90, 0\0"
+	    VALUE "ProductVersion", "23, 2, 91, 0\0"
 	    VALUE "OLESelfRegister", "\0"
 	 END
      END
--- a/nt/emacsclient.rc	Fri Dec 24 17:47:22 2010 +0900
+++ b/nt/emacsclient.rc	Fri Dec 24 17:49:24 2010 +0900
@@ -5,8 +5,8 @@
 #endif
 
 VS_VERSION_INFO VERSIONINFO
- FILEVERSION 23,2,90,0
- PRODUCTVERSION 23,2,90,0
+ FILEVERSION 23,2,91,0
+ PRODUCTVERSION 23,2,91,0
  FILEFLAGSMASK 0x3FL
 #ifdef EMACSDEBUG
  FILEFLAGS 0x1L
@@ -23,12 +23,12 @@
 	BEGIN
 	    VALUE "CompanyName", "Free Software Foundation\0"
 	    VALUE "FileDescription", "GNU EmacsClient: Client for the extensible self-documenting text editor\0"
-	    VALUE "FileVersion", "23, 2, 90, 0\0"
+	    VALUE "FileVersion", "23, 2, 91, 0\0"
 	    VALUE "InternalName", "EmacsClient\0"
 	    VALUE "LegalCopyright", "Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010\0"
 	    VALUE "OriginalFilename", "emacsclientw.exe"
 	    VALUE "ProductName", "EmacsClient\0"
-	    VALUE "ProductVersion", "23, 2, 90, 0\0"
+	    VALUE "ProductVersion", "23, 2, 91, 0\0"
 	    VALUE "OLESelfRegister", "\0"
 	 END
      END
--- a/src/ChangeLog	Fri Dec 24 17:47:22 2010 +0900
+++ b/src/ChangeLog	Fri Dec 24 17:49:24 2010 +0900
@@ -1,3 +1,64 @@
+2010-12-17  Eli Zaretskii  <eliz@gnu.org>
+
+	* xdisp.c (Fformat_mode_line): Fix last change.
+
+2010-12-16  Chong Yidong  <cyd@stupidchicken.com>
+
+	* xdisp.c (Fformat_mode_line): Restrict the FACE argument to basic
+	faces (Bug#7587).
+
+2010-12-13  Eli Zaretskii  <eliz@gnu.org>
+
+	* fileio.c (Fexpand_file_name): One more doc fix.
+
+2010-12-12  Eli Zaretskii  <eliz@gnu.org>
+
+	* fileio.c (Fexpand_file_name): Doc fix.  (Bug#7617)
+
+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)
+
+	* 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-10  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-07  Jan Djärv  <jan.h.d@swipnet.se>
+
+	* xsmfns.c (smc_die_CB): Call Fkill_emacs (Bug#7552).
+
+2010-12-06  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-05  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-05  Chong Yidong  <cyd@stupidchicken.com>
 
 	* xdisp.c (try_scrolling): Avoid infloop if the first line is
--- a/src/dispextern.h	Fri Dec 24 17:47:22 2010 +0900
+++ b/src/dispextern.h	Fri Dec 24 17:49:24 2010 +0900
@@ -1989,6 +1989,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/fileio.c	Fri Dec 24 17:47:22 2010 +0900
+++ b/src/fileio.c	Fri Dec 24 17:49:24 2010 +0900
@@ -828,10 +828,15 @@
 Second arg DEFAULT-DIRECTORY is directory to start with if NAME is relative
 \(does not start with slash or tilde); if DEFAULT-DIRECTORY is nil or missing,
 the current buffer's value of `default-directory' is used.
+NAME should be a string that is a valid file name for the underlying
+filesystem.
 File name components that are `.' are removed, and
 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'.
@@ -839,7 +844,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).  */)
      (name, default_directory)
      Lisp_Object name, default_directory;
--- a/src/keyboard.c	Fri Dec 24 17:47:22 2010 +0900
+++ b/src/keyboard.c	Fri Dec 24 17:49:24 2010 +0900
@@ -4305,7 +4305,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.
--- a/src/nsterm.m	Fri Dec 24 17:47:22 2010 +0900
+++ b/src/nsterm.m	Fri Dec 24 17:49:24 2010 +0900
@@ -2753,7 +2753,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)
@@ -2816,6 +2819,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);
+    }
 }
 
 
--- a/src/w32fns.c	Fri Dec 24 17:47:22 2010 +0900
+++ b/src/w32fns.c	Fri Dec 24 17:49:24 2010 +0900
@@ -5892,7 +5892,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 = 0;
@@ -5909,9 +5909,7 @@
       /* Let the row go over the full width of the frame.  */
       row->full_width_p = 1;
 
-#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 use to place
+      /* 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.  */
       if (row->used[TEXT_AREA])
 	{
@@ -5919,15 +5917,16 @@
 	  row_width = row->pixel_width - last->pixel_width;
 	}
       else
-#endif
 	row_width = row->pixel_width;
 
-      /* TODO: find why tips do not draw along baseline as instructed.  */
       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);
@@ -5946,11 +5945,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	Fri Dec 24 17:47:22 2010 +0900
+++ b/src/xdisp.c	Fri Dec 24 17:49:24 2010 +0900
@@ -229,7 +229,7 @@
 extern int minibuffer_auto_raise;
 extern Lisp_Object Vminibuffer_list;
 
-extern Lisp_Object Qface;
+extern Lisp_Object Qface, Qdefault;
 extern Lisp_Object Qmode_line, Qmode_line_inactive, Qheader_line;
 
 extern Lisp_Object Voverriding_local_map;
@@ -1454,11 +1454,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 (str, len)
@@ -1492,15 +1491,13 @@
 
   if (STRING_MULTIBYTE (string))
     {
-      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;
 	}
@@ -1545,14 +1542,13 @@
 
   if (multibyte_p)
     {
-      int rest = strlen (s), len;
+      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;
 	}
@@ -3614,7 +3610,6 @@
       if (STRING_MULTIBYTE (it->string))
 	{
 	  const unsigned char *p = SDATA (it->string) + BYTEPOS (pos);
-	  int rest = SBYTES (it->string) - BYTEPOS (pos);
 	  int c, len;
 	  struct face *face = FACE_FROM_ID (it->f, face_id);
 
@@ -4717,6 +4712,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
@@ -4729,11 +4725,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.  */
@@ -4949,8 +4947,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
@@ -6260,7 +6259,6 @@
 	}
       else if (STRING_MULTIBYTE (it->string))
 	{
-	  int remaining = SBYTES (it->string) - IT_STRING_BYTEPOS (*it);
 	  const unsigned char *s = (SDATA (it->string)
 				    + IT_STRING_BYTEPOS (*it));
 	  it->c = string_char_and_length (s, &it->len);
@@ -6296,7 +6294,6 @@
 	}
       else if (STRING_MULTIBYTE (it->string))
 	{
-	  int maxlen = SBYTES (it->string) - IT_STRING_BYTEPOS (*it);
 	  const unsigned char *s = (SDATA (it->string)
 				    + IT_STRING_BYTEPOS (*it));
 	  it->c = string_char_and_length (s, &it->len);
@@ -6350,13 +6347,7 @@
       BYTEPOS (it->position) = CHARPOS (it->position) = -1;
     }
   else if (it->multibyte_p)
-    {
-      /* Implementation note: The calls to strlen apparently aren't a
-	 performance problem because there is no noticeable performance
-	 difference between Emacs running in unibyte or multibyte mode.  */
-      int maxlen = strlen (it->s) - IT_BYTEPOS (*it);
-      it->c = string_char_and_length (it->s + IT_BYTEPOS (*it), &it->len);
-    }
+    it->c = string_char_and_length (it->s + IT_BYTEPOS (*it), &it->len);
   else
     it->c = it->s[IT_BYTEPOS (*it)], it->len = 1;
 
@@ -17892,12 +17883,13 @@
 First arg FORMAT specifies the mode line format (see `mode-line-format'
 for details) to use.
 
-Optional second arg FACE specifies the face property to put
-on all characters for which no face is specified.
-The value t means whatever face the window's mode line currently uses
-\(either `mode-line' or `mode-line-inactive', depending).
-A value of nil means the default is no face property.
-If FACE is an integer, the value string has no text properties.
+Optional second arg FACE specifies the face property to put on all
+characters for which no face is specified.  The value nil means the
+default face.  The value t means whatever face the window's mode line
+currently uses \(either `mode-line' or `mode-line-inactive',
+depending).  An integer value means the value string has no text
+properties.  Otherwise, the value should be one of `default',
+`mode-line', `mode-line-inactive', `header-line', or `tool-bar'.
 
 Optional third and fourth args WINDOW and BUFFER specify the window
 and buffer to use as the context for the formatting (defaults
@@ -17909,7 +17901,7 @@
   int len;
   struct window *w;
   struct buffer *old_buffer = NULL;
-  int face_id = -1;
+  int face_id;
   int no_props = INTEGERP (face);
   int count = SPECPDL_INDEX ();
   Lisp_Object str;
@@ -17932,15 +17924,14 @@
   if (no_props)
     face = Qnil;
 
-  if (!NILP (face))
-    {
-      if (EQ (face, Qt))
-	face = (EQ (window, selected_window) ? Qmode_line : Qmode_line_inactive);
-      face_id = lookup_named_face (XFRAME (WINDOW_FRAME (w)), face, 0);
-    }
-
-  if (face_id < 0)
-    face_id = DEFAULT_FACE_ID;
+  face_id = (NILP (face) || EQ (face, Qdefault)) ? DEFAULT_FACE_ID
+    : EQ (face, Qt) ? (EQ (window, selected_window)
+		       ? MODE_LINE_FACE_ID : MODE_LINE_INACTIVE_FACE_ID)
+    : EQ (face, Qmode_line) ? MODE_LINE_FACE_ID
+    : EQ (face, Qmode_line_inactive) ? MODE_LINE_INACTIVE_FACE_ID
+    : EQ (face, Qheader_line) ? HEADER_LINE_FACE_ID
+    : EQ (face, Qtool_bar) ? TOOL_BAR_FACE_ID
+    : DEFAULT_FACE_ID;
 
   if (XBUFFER (buffer) != current_buffer)
     old_buffer = current_buffer;
@@ -20913,11 +20904,7 @@
 
       it2 = *it;
       if (it->multibyte_p)
-	{
-	  int maxlen = ((IT_BYTEPOS (*it) >= GPT ? ZV : GPT)
-			- IT_BYTEPOS (*it));
-	  it2.c = it2.char_to_display = STRING_CHAR_AND_LENGTH (p, it2.len);
-	}
+	it2.c = it2.char_to_display = STRING_CHAR_AND_LENGTH (p, it2.len);
       else
 	{
 	  it2.c = it2.char_to_display = *p, it2.len = 1;
--- a/src/xsmfns.c	Fri Dec 24 17:47:22 2010 +0900
+++ b/src/xsmfns.c	Fri Dec 24 17:49:24 2010 +0900
@@ -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.
@@ -298,8 +299,8 @@
      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.
@@ -536,9 +537,12 @@
      (event)
      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;
 
@@ -549,9 +553,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;
 }
+  
 
 
 /***********************************************************************