changeset 83309:6aee1e9b0bd7

Merged from miles@gnu.org--gnu-2005 (patch 74-79, 332-349) Patches applied: * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-332 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-333 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-334 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-335 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-336 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-337 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-338 etc/emacs-buffer.gdb: Remove RCS keywords * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-339 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-340 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-341 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-342 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-343 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-344 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-345 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-346 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-347 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-348 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-349 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-74 Merge from emacs--cvs-trunk--0 * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-75 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-76 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-77 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-78 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-79 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-349
author Karoly Lorentey <lorentey@elte.hu>
date Fri, 03 Jun 2005 05:49:26 +0000
parents 63b7247f4be6 (current diff) 6ab08ae41502 (diff)
children e58cb448e07c
files lisp/ChangeLog lisp/emacs-lisp/bytecomp.el lisp/faces.el lisp/files.el lisp/font-lock.el lisp/help-fns.el lisp/mh-e/mh-loaddefs.el lisp/progmodes/gdb-ui.el lisp/progmodes/vhdl-mode.el lisp/recentf.el lisp/simple.el lisp/subr.el lispref/ChangeLog man/ChangeLog src/buffer.c src/fileio.c src/macterm.c src/xdisp.c src/xfaces.c
diffstat 135 files changed, 3824 insertions(+), 1860 deletions(-) [+]
line wrap: on
line diff
--- a/etc/ChangeLog	Sat May 28 21:04:38 2005 +0000
+++ b/etc/ChangeLog	Fri Jun 03 05:49:26 2005 +0000
@@ -1,3 +1,20 @@
+2005-05-30  Miles Bader  <miles@gnu.org>
+
+	* emacs-buffer.gdb: Remove RCS keywords.
+
+2005-05-30  Noah Friedman  <friedman@splode.com>
+
+	* emacs-buffer.gdb: New file.
+	* NEWS: Mention it.
+
+2005-05-28  Richard M. Stallman  <rms@gnu.org>
+
+	* TUTORIAL.fr: Change NBSP to space.
+
+2005-05-28  Bill Wohler  <wohler@newt.com>
+
+	* NEWS, MH-E-NEWS: Upgraded to MH-E version 7.84.
+
 2005-05-19  Nick Roberts  <nickrob@snap.net.nz>
 
 	* TODO: post-command-idle-hook has gone.
--- a/etc/MH-E-NEWS	Sat May 28 21:04:38 2005 +0000
+++ b/etc/MH-E-NEWS	Fri Jun 03 05:49:26 2005 +0000
@@ -1,16 +1,94 @@
 * COPYRIGHT
 
-Copyright (C) 2003, 2004 Free Software Foundation, Inc.
-
+Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
+	
 Copying and distribution of this file, with or without modification,
 are permitted in any medium without royalty provided the copyright
 notice and this notice are preserved.
 
+* Changes in MH-E 7.84
+
+Version 7.84 contains no user-visible changes. This version
+incorporates changes made in CVS Emacs such as the removal of some
+deprecated software.
+
+* Changes in MH-E 7.83
+
+Version 7.83 fixes a handful of bugs, adds colors to buttons for
+signed or encrypted messages, and contains some documentation changes
+related to the upcoming release of the manual. Some options were moved
+to other customization groups as a result.
+
+While not related to this release, the MH-E mailing lists are now
+gatewayed at gmane.org (closes SF #979308).
+
+** New Variables in MH-E 7.83
+
+*** mh-show-pgg-bad-face
+
+Face used to highlight a bad PGG signature.
+
+*** mh-show-pgg-good-face
+
+Face used to highlight a good PGG signature.
+
+*** mh-show-pgg-unknown-face
+
+Face used to highlight a PGG signature whose status is unknown. This
+face is also used for a signature when the signer is untrusted.
+
+** Bug Fixes in MH-E 7.83
+
+*** Whitespace in pick Expressions
+
+The "C-u / s RET" command now works. In addition, you can now add
+whitespace to any of the limiting (/) commands (closes SF #1122655).
+
+*** auto-mode-alist Updated
+
+MH-E originally updated auto-mode-alist to set the major mode of
+drafts. Now that we explicitly set the mode, there is no reason to do
+this, and this behavior caused problems for people who didn't use MH-E
+who were editing files that looked like MH message files (closes SF
+#1032353).
+
+*** mh-show-unquote-From Fails (read-only buffer)
+
+MH-E quotes the "From " header field that is inserted by MTAs.
+However, it was trying to do this in a read-only buffer. This has been
+fixed (closes SF #1089870).
+
+*** rmmproc Refile Complains No Such Message
+
+MH-E would get confused about which folder to delete messages from if
+you were refiling and deleting messages at the same time. This has
+been fixed (closes SF #1023959).
+
+*** ! Doesn't Do Regions
+
+Now it does (closes SF #1046330).
+
+*** Swish Fixes
+
+Items in swish indexes that aren't mail messages are now handled more
+gracefully.
+
+*** Spamassassin Fixes
+
+If you use spamassassin, there was an error when you tried to junk
+mail if the option mh-junk-background was set. This has been fixed.
+
+*** Mairix Support
+
+Indexing now compatible with Mairix version 0.12 and later.
+
+
+
 * Changes in MH-E 7.82
 
 Version 7.82 continues to address the saga surrounding the use of CL
-macros in CVS Emacs and fixes the auto-detection of vanilla MH (SF
-#1014781).
+macros in CVS Emacs and fixes the auto-detection of vanilla MH (closes
+SF #1014781).
 
 * Changes in MH-E 7.81
 
@@ -23,6 +101,8 @@
 to ":default". This release also corrects the release numbering; the
 previous version number was intended to be 7.80.
 
+
+
 * Changes in MH-E 7.4.80
 
 Version 7.4.80 now supports GNU mailutils, S/MIME, picons,
--- a/etc/NEWS	Sat May 28 21:04:38 2005 +0000
+++ b/etc/NEWS	Fri Jun 03 05:49:26 2005 +0000
@@ -108,6 +108,11 @@
 ---
 ** When pure storage overflows while dumping, Emacs now prints how
 much pure storage it will approximately need.
+
+** The script etc/emacs-buffer.gdb can be used with gdb to retrieve the
+contents of buffers from a core dump and save them to files easily, should
+emacs crash.
+
 
 * Startup Changes in Emacs 22.1
 
@@ -344,6 +349,10 @@
 ** The default for the paper size (variable ps-paper-type) is taken
 from the locale.
 
+** The command `list-faces-display' now accepts a prefix arg.
+When passed, the function prompts for a regular expression and lists
+only faces matching this regexp.
+
 ** Mark command changes:
 
 +++
@@ -2651,7 +2660,7 @@
 ---
 ** MH-E changes.
 
-Upgraded to MH-E version 7.82. There have been major changes since
+Upgraded to MH-E version 7.84. There have been major changes since
 version 5.0.2; see MH-E-NEWS for details.
 
 ** Calendar changes:
@@ -3132,6 +3141,10 @@
 dangerous; otherwise it returns a reason why the form might be unsafe
 (calls unknown function, alters global variable, etc).
 
+*** `list-faces-display' takes an optional argument, REGEXP.
+
+If it is non-nil, the function lists only faces matching this regexp.
+
 ** Lisp code indentation features:
 
 +++
--- a/etc/TUTORIAL.fr	Sat May 28 21:04:38 2005 +0000
+++ b/etc/TUTORIAL.fr	Fri Jun 03 05:49:26 2005 +0000
@@ -746,14 +746,14 @@
 périodiquement un fichier de « sauvegarde automatique » pour chaque
 fichier en cours d'édition. Le nom de ce fichier commence et se
 termine par un # : si, par exemple, votre fichier s'appelle
-« hello.c », son fichier de sauvegarde automatique s'appellera
-« #hello.c# ». Lorsque vous sauvegardez le fichier de la façon
+« hello.c », son fichier de sauvegarde automatique s'appellera
+« #hello.c# ». Lorsque vous sauvegardez le fichier de la façon
 habituelle, Emacs détruit son fichier de sauvegarde automatique.
 
 Si l'ordinateur se plante, vous pouvez récupérer ce qui a été
 sauvegardé automatiquement en ouvrant normalement le fichier (celui
 que vous éditiez, pas la sauvegarde automatique), puis en faisant
-M-x recover file<Entrée>. Lorsqu'Emacs vous demande de confirmer,
+M-x recover file<Entrée>. Lorsqu'Emacs vous demande de confirmer,
 tapez yes<Entrée> pour continuer et récupérer ainsi les données
 sauvées par la sauvegarde automatique.
 
@@ -847,7 +847,7 @@
 
 Vous pouvez activer le mode Auto Fill en faisant M-x auto fill
 mode<Entrée>.  Lorsqu'il est activé, vous pouvez le désactiver en
-faisant à nouveau M-x auto fill mode<Entrée>.  Si le mode est
+faisant à nouveau M-x auto fill mode<Entrée>.  Si le mode est
 désactivé, cette commande l'active et, s'il est activé, elle le
 désactive : on dit que la commande « fait basculer le mode ».
 
@@ -913,10 +913,10 @@
 
 REMARQUE : Sur certains systèmes, C-s gèlera l'écran et vous ne verrez
 plus rien se produire dans Emacs.  Cela indique qu'une
-« fonctionnalité » du système d'exploitation, appelée « contrôle de
+« fonctionnalité » du système d'exploitation, appelée « contrôle de
 flux », a intercepté le C-s et ne lui permet pas de parvenir à
 Emacs. Pour décoincer l'écran, faites C-q puis consultez la section
-« Spontaneous Entry to Incremental Search » dans le manuel d'Emacs
+« Spontaneous Entry to Incremental Search » dans le manuel d'Emacs
 pour avoir des avis sur la gestion de cette « fonctionnalité ».
 
 Si vous vous trouvez au milieu d'une recherche incrémentale et que
@@ -924,7 +924,7 @@
 caractère de la chaîne recherchée et que la recherche reprend à
 l'endroit où elle se trouvait précédemment. Supposons, par exemple,
 que vous ayiez tapé « c » pour trouver la première occurrence de
-« c ». Si vous tapez maintenant « u », le curseur ira sur la première
+« c ». Si vous tapez maintenant « u », le curseur ira sur la première
 occurrence de « cu ». Faites <Delback> : cela supprime le « u » de la
 chaîne de recherche et le curseur revient à la première occurrence de
 « c ».
@@ -1038,7 +1038,7 @@
 ici. Cependant, vous pouvez vouloir en apprendre plus, car il a bien
 d'autres fonctionnalités utiles. Emacs dispose de commandes pour lire
 la documentation sur ses commandes. Ces commandes d'« aide »
-commencent toutes par le caractère C-h, le « caractère d'aide ».
+commencent toutes par le caractère C-h, le « caractère d'aide ».
 
 Pour utiliser l'aide, tapez C-h suivi d'un caractère indiquant le type
 d'aide que vous souhaitez. Si vous êtes VRAIMENT perdu, faites C-h ?
@@ -1113,7 +1113,7 @@
    C-h i 	Manuels en ligne (alias Info). Cette commande vous place dans
          	un tampon spéciale, appelé « *info* », où vous pouvez
 		lire les manuels en ligne des paquetages installés sur
-		votre système. Faites m emacs <Entrée> pour lire le
+		votre système. Faites m emacs <Entrée> pour lire le
 		manuel d'Emacs. Si vous n'avez jamais utilisé Info
 		auparavant, tapez ? et Emacs vous fera faire une visite
 		guidée des fonctionnalités du mode Info. Lorsque vous
@@ -1133,7 +1133,7 @@
 
 La complétion permet d'éviter les frappes inutiles. Si, par exemple,
 vous voulez basculer vers le tampon *Messages*, tapez simplement
-C-x b *M<Tab> et Emacs complètera le nom du tampon s'il peut le
+C-x b *M<Tab> et Emacs complètera le nom du tampon s'il peut le
 déterminer à partir de ce que vous avez saisi avant la tabulation. La
 complétion est décrite dans la version Info du manuel Emacs, à la
 rubrique "Completion".
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/etc/emacs-buffer.gdb	Fri Jun 03 05:49:26 2005 +0000
@@ -0,0 +1,270 @@
+# emacs-buffer.gdb --- gdb macros for recovering buffers from emacs coredumps
+
+# Copyright (C) 2005 Free Software Foundation, Inc.
+
+# Maintainer: Noah Friedman <friedman@splode.com>
+# Status: tested with Emacs 22
+# Created: 2005-04-28
+
+# This file is part of GNU Emacs.
+#
+# GNU Emacs is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# GNU Emacs is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Emacs; see the file COPYING.  If not, write to the
+# Free Software Foundation, Inc.; 51 Franklin Street, Fifth Floor;
+# Boston, MA 02110-1301, USA.
+
+# Commentary:
+
+# This is a set of gdb macros for recovering the contents of buffers from
+# an Emacs coredump; they may not always be file-backed or have a recent
+# autosave.
+#
+# The Emacs executable must have debugging symbols for this to work.  But
+# you never strip Emacs, right?  Right!
+#
+# The main commands of interest are `ybuffer-list', `yfile-buffers',
+# `ysave-buffer', and `ybuffer-contents'.  The `y' prefix avoids any
+# namespace collisions with emacs/src/.gdbinit.
+
+# Example usage:
+#
+#     $ gdb /export/src/emacs/2005-05-02--03-17/src/emacs core.emacs.6.9845
+#     Current directory is /u/noah/
+#     GNU gdb (6.1post-1.20040607.43rh)
+#     ...
+#     #0  0x400007a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
+#     (gdb) source emacs-buffer.gdb
+#     (gdb) ybuffer-list
+#     B# M       Size Name                 Mode       File
+#     -- -       ---- ----                 ----       ----
+#      0 *        556 mail to emacs-devel@gnu.org Mail
+#      1 *          0  *Minibuf-1*         Fundamental
+#      2       145769 ChangeLog            Change Log /u/noah/lib/elisp/noahf/ChangeLog
+#      3         6619 ascii-table.el       Elisp      /u/noah/lib/elisp/noahf/ascii-table.el
+#      4 *      48396 *Messages*           Fundamental
+#      5         3191 *Apropos*            Apropos
+#      6        17642 init-21.el           Elisp      /u/noah/etc/init/emacs/init-21.el
+#      7          333 cpuid.c              C          /u/noah/cpuid.c
+#      8          230 src                  Dired
+#      9          218 noah                 Dired
+#     10 *         21  *Echo Area 0*       Fundamental
+#     11 *          0  *Echo Area 1*       Fundamental
+#     12       319952  *bbdb data*         Text       /u/noah/.bbdb
+#     (gdb) ysave-buffer 0 mail.save
+#     [Wrote buffer "mail to emacs-devel@gnu.org" to file mail.save]
+#     (gdb) quit
+#     $ ls -l mail.save
+#     -rw-rw-rw-  1 noah user 556 May  2 04:05 mail.save
+#     $
+
+# Code:
+
+# Force loading of symbols, enough to give us gdb_valbits etc.
+set main
+
+# When nonzero, display some extra diagnostics in various commands
+set $yverbose = 1
+set $yfile_buffers_only = 0
+
+set $tagmask = (((long)1 << gdb_gctypebits) - 1)
+set $valmask = gdb_use_lsb ? ~($tagmask) : ((long)1 << gdb_valbits) - 1
+
+define ygetptr
+  set $ptr = $arg0
+  set $ptr = (gdb_use_union ? $ptr.u.val : $ptr & $valmask) | gdb_data_seg_bits
+end
+
+define ybuffer-list
+  set $files_only         = $yfile_buffers_only
+  set $yfile_buffers_only = 0
+
+  if $yverbose
+    printf "B# M       Size Name                 Mode       File\n"
+    printf "-- -       ---- ----                 ----       ----\n"
+  end
+
+  set $i = 0
+  set $alist = Vbuffer_alist
+  while $alist != Qnil
+    ygetptr $alist
+    set $this  = ((struct Lisp_Cons *) $ptr)->car
+    set $alist = ((struct Lisp_Cons *) $ptr)->cdr
+
+    # Vbuffer_alist elts are pairs of the form (name . buffer)
+    ygetptr $this
+    set $buf  = ((struct Lisp_Cons *) $ptr)->cdr
+    ygetptr $buf
+    set $buf = (struct buffer *) $ptr
+
+    if ! ($files_only && $buf->filename == Qnil)
+      ygetptr $buf->name
+      set $name = ((struct Lisp_String *) $ptr)->data
+      set $modp = ($buf->text->modiff > $buf->text->save_modiff) ? '*' : ' '
+
+      ygetptr $buf->mode_name
+      set $mode = ((struct Lisp_String *) $ptr)->data
+
+      if $buf->filename != Qnil
+        ygetptr $buf->filename
+        set $filename = ((struct Lisp_String *) $ptr)->data
+      else
+        set $filename = ' '
+      end
+
+      printf "%2d %c  %9d %-20s %-10s %s\n", \
+             $i, $modp, ($buf->text->z_byte - 1), $name, $mode, $filename
+    end
+
+    set $i++
+  end
+end
+document ybuffer-list
+  Display a list of buffer names, sizes, and other attributes.
+  The buffer number in the first column is used as an argument
+  to some other emacs-buffer recovery commands, e.g. `ysave-buffer'.
+end
+
+define yfile-buffers
+  set $yfile_buffers_only = 1
+  ybuffer-list
+end
+document yfile-buffers
+  Display a list of buffers which are associated with files.
+  This is like `ybuffer-list', but only buffers that were visiting files
+  are displayed.
+end
+
+define yset-buffer
+  set $i = $arg0
+
+  set $alist = Vbuffer_alist
+  while ($alist != Qnil && $i > 0)
+    ygetptr $alist
+    set $alist = ((struct Lisp_Cons *) $ptr)->cdr
+    set $i--
+  end
+
+  # Get car of alist; this is a pair (name . buffer)
+  ygetptr $alist
+  set $this = ((struct Lisp_Cons *) $ptr)->car
+
+  # Get the buffer object
+  ygetptr $this
+  set $this = ((struct Lisp_Cons *) $ptr)->cdr
+
+  ygetptr $this
+  set $ycurrent_buffer = (struct buffer *) $ptr
+end
+document yset-buffer
+  Set current buffer (for other emacs-buffer recovery commands) to the ARG'th
+  buffer as displayed by `ybuffer-list'.
+end
+
+define yget-buffer-pointers
+  yset-buffer $arg0
+  set $buf = $ycurrent_buffer->text
+
+  set $beg     = $buf->beg
+  set $gap     = $beg + $buf->gpt_byte
+  set $gap_end = $gap + $buf->gap_size - 1
+  set $end     = $gap_end + ($buf->z_byte - $buf->gpt_byte)
+
+  set $modp    = $buf->modiff > $buf->save_modiff
+
+  #print *$beg@($gap - $beg)
+  #print *$gap_end@($end - $gap_end)
+end
+document yget-buffer-pointers
+  Update convenience variables with address pointers for the ARG'th buffer
+  as displayed by `ybuffer-list'.
+
+  This also sets the current buffer using `yset-buffer' (which see).
+end
+
+define yget-current-buffer-name
+  set $this = $ycurrent_buffer->name
+  ygetptr $this
+  set $ycurrent_buffer_name = ((struct Lisp_String *) $ptr)->data
+end
+document yget-current-buffer-name
+  Set $ycurrent_buffer_name to the name of the currently selected buffer.
+end
+
+define ycurrent-buffer
+  yget-current-buffer-name
+  printf "%s\n", $ycurrent_buffer_name
+end
+document ycurrent-buffer
+  Display the currently selected buffer.
+end
+
+define ydump-buffer
+  yget-buffer-pointers $arg0
+  if $buf->z_byte > 1
+    if $buf->z_byte <= $buf->gpt_byte
+      set $endptr = $beg + $buf->gpt_byte - 1
+      dump binary memory $arg1 $beg $endptr
+    else
+      dump   binary memory $arg1 $beg $gap-1
+      append binary memory $arg1 $gap_end $end
+      set $endptr = $end
+    end
+  end
+end
+document ydump-buffer
+  Write contents of buffer N (as numbered according to `ybuffer-list') to
+  file FILE.
+
+  This is mainly used as an internal subroutine for `ysave-buffer' and
+  `ybuffer-contents', which see.
+end
+
+define ysave-buffer
+  ydump-buffer $arg0 $arg1
+  if $yverbose
+    yget-current-buffer-name
+    if $buf->z_byte <= 1
+      printf "[Buffer \"%s\" is empty.]\n", $ycurrent_buffer_name
+    else
+      # Output string broken into separate calls as necessary to avoid
+      # requiring a running process for evaluation.
+      printf "[Wrote buffer \"%s\" to file ", $ycurrent_buffer_name
+      echo $arg1]\n
+    end
+  end
+end
+document ysave-buffer
+  Save contents of buffer N (as numbered according to `ybuffer-list') to
+  file FILE.
+end
+
+define ybuffer-contents
+  ydump-buffer $arg0 /dev/stdout
+  if $yverbose && $buf->z_byte <= 1
+    yget-current-buffer-name
+    printf "[Buffer \"%s\" is empty.]\n", $ycurrent_buffer_name
+  else
+    if *($endptr-1) != '\n'
+      echo \n
+    end
+  end
+end
+document ybuffer-contents
+  Write contents of buffer N (numbered according to `ybuffer-list') to stdout.
+end
+
+# local variables:
+# mode: gdb-script
+# end:
+
+# arch-tag: 02087f62-2663-4868-977a-1fbb2fc2e7ef
--- a/lisp/ChangeLog	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/ChangeLog	Fri Jun 03 05:49:26 2005 +0000
@@ -1,3 +1,272 @@
+2005-06-01  Luc Teirlinck  <teirllm@auburn.edu>
+
+	* autorevert.el (auto-revert-buffers): Use save-match-data.
+
+2005-06-01  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* emacs-lisp/easymenu.el (easy-menu-return-item): Quick fix to find
+	menu items with a nil command binding.
+
+2005-06-01  Juanma Barranquero  <lekktu@gmail.com>
+
+	* emacs-lisp/cl-macs.el (defsetf):
+	Improve argument/docstring consistency.
+
+	* faces.el (list-faces-display): Improve the formatting by
+	computing the maximum length required for any face-name (reworked
+	patch of 1999-01-11, accidentally deleted on 1999-07-21).
+	(internal-find-face): Remove redundant info in docstring.
+
+2005-06-01  Nick Roberts  <nickrob@snap.net.nz>
+
+	* progmodes/gdb-ui.el (gdb-set-gud-minor-mode-1)
+	(gdb-info-breakpoints-custom, gdb-delete-breakpoint)
+	(gdb-goto-breakpoint, gdb-source-info, gdb-get-location)
+	(gdb-assembler-custom): Improve regexps.
+	(def-gdb-auto-update-handler): Use window point to ensure it
+	is preserved.
+
+2005-05-31  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* thumbs.el (thumbs-mode): Fix misuse of make-variable-buffer-local.
+
+2005-05-31  Jay Belanger  <belanger@truman.edu>
+
+	* calc/calc-embed.el (calc-embedded-word): Change argument passed
+	to calc-embedded.
+	(calc-embedded-make-info): Have plain prefix argument select
+	entire line.
+
+2005-05-31  Juanma Barranquero  <lekktu@gmail.com>
+
+	* faces.el (list-faces-display): Signal error if passed a regexp
+	that matches no face name.
+
+	* simple.el (filter-buffer-substring): Fix typo in docstring.
+
+2005-05-31  Richard M. Stallman  <rms@gnu.org>
+
+	* progmodes/vhdl-mode.el (vhdl-fill-region): Test ARG, not INTERACTIVE.
+	(vhdl-emacs-21): Doc fix.
+	(vhdl-mode): Unconditionally set comment-padding.
+	(vhdl-fixup-whitespace-region): Insert spaces only where
+	there are none.
+	(vhdl-statistics-buffer): Make the Emacs 21 behavior universal.
+
+2005-05-30  John Wiegley  <johnw@newartisans.com>
+
+	* eshell/em-cmpl.el, eshell/em-dirs.el, eshell/em-glob.el
+	* eshell/em-unix.el, eshell/esh-ext.el, eshell/esh-io.el
+	* eshell/esh-util.el, eshell/esh-var.el: Change all uses of
+	`directory-sep-char' to ?/, and all uses of `string-to-int' to
+	`string-to-number'.
+
+2005-05-30  Jay Belanger  <belanger@truman.edu>
+
+	* calc/calc.el (calc-bug-address): Fix docstring.
+	(calc-window-hook, calc-trail-window-hook): New variables.
+	(calc-trail-display): Restore use of calc-trail-window-hook.
+	(calc): Restore use of calc-window-hook.
+
+2005-05-31  Masatake YAMATO  <jet@gyve.org>
+
+	* emacs-lisp/find-func.el (find-function-noselect): Handle subroutines.
+
+	* help-fns.el (help-C-file-name): Add autoload mark for
+	`find-function-noselect'.
+
+2005-05-30  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* textmodes/tex-mode.el (tex-compile-commands, tex-compile)
+	(tex-start-tex): Undo all but the last part of the 2005-05-28 change.
+
+2005-05-30  Glenn Morris  <gmorris@ast.cam.ac.uk>
+
+	* calendar/diary-lib.el (mark-included-diary-files): Only kill
+	included diary buffer if it was not already being visited.
+	Reported by Stephen Berman <Stephen.Berman@gmx.net>.
+
+	* calendar/icalendar.el (top-level): Do not require 'appt.
+
+	* mail/supercite.el (sc-select-attribution): Only use a list
+	element from sc-attrib-selection-list if it returns a string.
+	Reported by Davide G. M. Salvetti <salve@debian.org>.
+
+2005-05-30  Juanma Barranquero  <lekktu@gmail.com>
+
+	* thumbs.el (thumbs-thumbname): The resulting thubname now
+	includes a hash value to improve its uniqueness, and has a ".jpg"
+	extension.  Also, it is now a valid filename on all systems.
+	(thumbs-make-thumb): Use `let', not `let*'.
+	(thumbs-show-thumbs-list): Check for JPEG availability.
+
+2005-05-30  Richard M. Stallman  <rms@gnu.org>
+
+	* filesets.el (filesets-menu-ensure-use-cached):
+	Prevent warning when emacs-version>= is undefined.
+
+	* printing.el (pr-interactive-n-up): Use string-to-number.
+
+	* emulation/tpu-mapper.el: Use eval-buffer, not eval-current-buffer.
+
+	* emacs-lisp/bytecomp.el (byte-compile-nogroup-warn):
+	Warn only when name to be defined is quoted.
+
+2005-05-30  Nick Roberts  <nickrob@snap.net.nz>
+
+	* progmodes/gdb-ui.el (gdb-toggle-breakpoint):
+	Make regexp more robust.
+	(gdb-display-assembler-buffer, gdb-frame-assembler-buffer):
+	Force regeneration of disassembly.
+
+2005-05-29  Jay Belanger  <belanger@truman.edu>
+
+	* calc/calc.el (calc-user-invocation): Check if
+	calc-invocation-macro is non-nil.
+
+2005-05-29  Juri Linkov  <juri@jurta.org>
+
+	* add-log.el (change-log-font-lock-keywords):
+	Add `+' to e-mail regexp to accept mail address with keywords.
+
+	* man.el (Man-name-regexp): Add `:' to accept qualified names.
+
+2005-05-29  Luc Teirlinck  <teirllm@auburn.edu>
+
+	* progmodes/inf-lisp.el (inferior-lisp-mode): Use delay-mode-hooks.
+
+	* ielm.el (inferior-emacs-lisp-mode): Ditto.
+
+2005-05-29  Richard M. Stallman  <rms@gnu.org>
+
+	* textmodes/flyspell.el (flyspell-auto-correct-previous-word):
+	Undo the change that moves to end of the current word.
+
+2005-05-29  Nick Roberts  <nickrob@snap.net.nz>
+
+	* progmodes/gdb-ui.el (gdb-memory-set-repeat-count):
+	Throw error when count <= 0 to ensure input is a number.
+	(gdb-read-memory-custom): Pick up address from buffer.
+	(gdb-memory-mode): Allow user to increment and decrement
+	memory address from header line.
+
+2005-05-29  Richard M. Stallman  <rms@gnu.org>
+
+	* flyspell.el (flyspell-version): Function deleted.
+	(flyspell-auto-correct-previous-hook): Doc fix.
+
+	* jit-lock.el (jit-lock-function, jit-lock-after-change):
+	Do nothing if memory is full.
+
+	* font-lock.el (font-lock-fontify-syntactically-region):
+	Pass t for GREEDY to looking-back.
+
+	* saveplace.el (save-place-alist-to-file): Write the file
+	using write-region.
+
+	* subr.el (looking-back): New argument GREEDY.
+
+	* progmodes/compile.el (compilation-start): Set the mode
+	before inserting the initial text.
+
+	* progmodes/which-func.el (which-func-update-1): Turn the mode
+	off in case of error by setting which-func-mode.
+
+2005-05-29  Peter Heslin  <p.j.heslin@durham.ac.uk>  (tiny change)
+
+	* flyspell.el (flyspell-auto-correct-previous-word):
+	Narrow down to what's on the screen, and recenter overlays
+	at the end of the next word.
+
+2005-05-29  Manuel Serrano  <Manuel.Serrano@sophia.inria.fr>
+
+	* flyspell.el (flyspell-emacs, flyspell-use-local-map): Vars moved up.
+	(flyspell-default-delayed-commands): Add backward-delete-char-untabify.
+	(flyspell-abbrev-p): Default to nil.
+	(flyspell-use-global-abbrev-table-p): Doc fix.
+	(flyspell-large-region): Allow nil as value.
+	(flyspell-use-meta-tab, flyspell-auto-correct-binding): New variables.
+
+	(mail-mode-flyspell-verify): More robust handling
+	of `mail-header-separator'.  More efficient signature detection.
+	Allow for regexp metacharacters in message-header-separator.
+	Adding `To' not to be checked in mail-mode-flyspell-verify.
+
+	(flyspell-prog-mode): Run flyspell-prog-mode-hook.
+	(flyspell-mouse-map): Bind M-TAB only if flyspell-use-meta-tab.
+	Bind flyspell-auto-correct-binding.
+	Bind C-. and C-, .
+	(flyspell-mode-map): Likewise.
+	(flyspell-mode): Doc fix.
+	(flyspell-accept-buffer-local-defs): Preserve current buffer.
+	(flyspell-mode-on): Bind flyspell-mouse-map and flyspell-mode-map.
+	(flyspell-word-cache-result): New var, always local.
+	(flyspell-check-pre-word-p): Doc fix.
+	(flyspell-check-changed-word-p): Handle spc like newline.
+	(flyspell-post-command-hook): Set flyspell-word-cache-result.
+	(flyspell-word-search-backward, flyspell-word-search-forward):
+	New functions.
+	(flyspell-word): Return t if nothing to check.
+	When parsing TeX code, check for after } or \.
+	Use flyspell-word-search-backward to find previous word.
+	Return nil if duplicated word.
+	For word already checked, return same value as last time.
+	Set flyspell-word-cache-result after checking.
+	Don't clobber the return value.
+	(flyspell-get-word): Major rewrite.
+	(flyspell-external-point-words): New locals pword, pcount.
+	Fix size used in progress message.
+	Find the proper corresponding word in flyspell-large-region-buffer.
+	(flyspell-region): Check for flyspell-large-region = nil.
+	(flyspell-highlight-incorrect-region): Clean up overlays in region.
+	(flyspell-auto-correct-word): Check that WORD is a cons.
+	(flyspell-correct-word): Likewise.
+
+2005-05-29  Daniel Pfeiffer  <occitan@esperanto.org>
+
+	* progmodes/make-mode.el (makefile-rule-action-regex)
+	(makefile-macroassign-regex, makefile-makepp-mode)
+	(makefile-bsdmake-mode): Continuation lines may be empty.
+	Reported by Joshua Varner.
+	(makefile-makepp-font-lock-keywords): Add $(stem).
+
+2005-05-28  Karl Berry  <karl@gnu.org>
+
+	* textmodes/tex-mode.el: Now that tex-send-command calls
+	shell-quote-argument (2005-03-31 change), remove all calls to
+	shell-quote-argument; they all end up invoking tex-send-command.
+	The double quoting loses on filenames with non-safe characters,
+	such as "@".  Reported by Frederik Fouvry.
+
+2005-05-29  Nick Roberts  <nickrob@snap.net.nz>
+
+	* progmodes/gdb-ui.el (gdb-assembler-custom): Be more careful
+	about preserving point.
+
+2005-05-27  Jay Belanger  <belanger@truman.edu>
+
+	* calc/calc-misc.el (calc-info-goto-node): Use info instead of
+	Info-goto-node.
+
+	* calc/calc-embed.el (calc-embed-arg): New variable.
+	(calc-do-embedded-activate, calc-embedded-activate-formula)
+	(calc-embedded-edit, calc-do-embedded-activate): Replace undeclared
+	variable by new variable.
+	(calc-embedded-make-info): Replace undeclared variable by new
+	variable.  When selecting region with positive prefix
+	argument, use end of previous line instead of beginning of line.
+
+	* calc/calc-aent.el (calc-arg-values): Declare it.
+
+	* calc/calc-ext.el (calc-help-map, calc-alg-map, calc-alg-esc-map):
+	Declare them.
+
+	* calc/calc-stuff.el (math-decls-cache-tag): Declare it.
+
+	* calc/calc.el (calc-alg-map): Declare it.
+
+	* calc/calcalg2.el (math-decls-cache, math-decls-all): Declare them.
+
 2005-05-28  Nick Roberts  <nickrob@snap.net.nz>
 
 	* progmodes/gdb-ui.el (gdb-all-registers): New variable.
@@ -5,7 +274,7 @@
 	Toggle display of floating point registers.
 	(gdb-registers-mode-map): Bind SPC to toggle-gdb-all-registers.
 
-	* progmodes/gud.el (gud-goto-info): Use info. Don't use require.
+	* progmodes/gud.el (gud-goto-info): Use info.  Don't use require.
 	(toggle-gud-tooltip-dereference):
 	Rename from gud-toggle-tooltip-dereference.
 
@@ -414,7 +683,7 @@
 
 	* emacs-lisp/bytecomp.el: Remove make-obsolete-variable for
 	already deleted variables: auto-fill-hook, blink-paren-hook,
-	lisp-indent-hook, inhibit-local-variables, unread-command-event
+	lisp-indent-hook, inhibit-local-variables, unread-command-event,
 	suspend-hooks, comment-indent-hook, meta-flag,
 	before-change-function, after-change-function,
 	font-lock-doc-string-face.
@@ -656,7 +925,7 @@
 	post-command-idle-delay.
 
 	* faces.el (list-faces-display): Provide button when describe-face
-	is called to take user back to  the list of faces.
+	is called to take user back to the list of faces.
 
 	* help-fns.el (describe-variable): Remove hyperlinks in a
 	variable's value as these are quite frequently inappropriate.
@@ -926,8 +1195,8 @@
 
 	* progmodes/compile.el (compilation-setup): Set local value of
 	overlay-arrow-string to "" always.
-	(compilation-set-window): Left fringe then don't scroll. No left
-	fringe then no arrow and scroll message to top.
+	(compilation-set-window): Left fringe then don't scroll.
+	No left fringe then no arrow and scroll message to top.
 	(compilation-context-lines): Adjust doc string accordingly.
 
 2005-05-16  Kim F. Storm  <storm@cua.dk>
@@ -1186,7 +1455,7 @@
 
 2005-05-11  Stefan Monnier  <monnier@iro.umontreal.ca>
 
-	* files.el (executable-find): Move from executable.el. Use locate-file.
+	* files.el (executable-find): Move from executable.el.  Use locate-file.
 	* progmodes/executable.el (executable-find): Move to files.el.
 
 	* font-lock.el (font-lock-fontify-keywords-region): Use a marker
@@ -1236,10 +1505,10 @@
 
 	* progmodes/gdb-ui.el (gdb-macro-info): New variable.
 	(gdb-source-info): Check for preprocessor info.
-	(gdb-tooltip-print-1): New function. Don't print tooltip if it is
+	(gdb-tooltip-print-1): New function.  Don't print tooltip if it is
 	a macro for a function.
+	(gdb-info-breakpoints-custom): Try to find file again if not already
 	found (user might have used GDB dir command).
-	(gdb-info-breakpoints-custom): Try to find file again if not already
 	(gdb-get-location): Update gdb-location-alist correctly for change
 	to gdb-info-breakpoints-custom.
 
@@ -1335,7 +1604,7 @@
 	* tooltip.el: Move code for GUD tooltips into gud.el.
 	(require): CL no longer needed to compile case.
 	(tooltip-mode): Do not toggle functions for GUD tooltips.
-	(tooltip-gud-tips-p): Remove. Replace with minor mode
+	(tooltip-gud-tips-p): Remove.  Replace with minor mode
 	gud-tooltip-mode in gud.el.
 	(tooltip-gud-modes, tooltip-gud-display, tooltip-gud-echo-area)
 	(tooltip-gud-toggle-dereference): Rename in gud.el by replacing
@@ -1347,14 +1616,14 @@
 	(tooltip-gud-original-filter, tooltip-gud-dereference)
 	(tooltip-gud-event, tooltip-toggle-gud-tips)
 	(tooltip-gud-process-output, tooltip-gud-print-command)
-	(tooltip-gud-tips): GUD tooltip functions/variables. Rename in
+	(tooltip-gud-tips): GUD tooltip functions/variables.  Rename in
 	gud.el by replacing tooltip-gud prefix with gud-tooltip.
 	(gdb-tooltip-print): Move to gdb-ui.el.
 
 	* progmodes/gud.el: Move code for GUD tooltips from tooltip.el.
 	(require): CL needed to compile case.
 	(gud-tooltip-mode): Use to toggle GUD tooltips unstead of
-	tooltip-gud-tips-p. Make it a minor-mode.
+	tooltip-gud-tips-p.  Make it a minor-mode.
 	(gud-find-file): Only prepare GUD tooltips if gud-tooltip-mode is t.
 	(gud-menu-map): GUD tooltips use gud-tooltip-mode now.
 	(gud-tooltip-modes, gud-tooltip-display, gud-tooltip-echo-area)
@@ -1450,7 +1719,7 @@
 	* ido.el (ido-setup-hook): New hook.
 	(ido-define-mode-map-hook): Remove hook; use ido-setup-hook instead.
 	(ido-input-stack): New var.
-	(ido-define-mode-map): Bind M-b to ido-push-dir. Move old
+	(ido-define-mode-map): Bind M-b to ido-push-dir.  Move old
 	ido-next-work-file binding to M-O.
 	Bind M-f to ido-wide-find-file-or-pop-dir.
 	(ido-define-mode-map): Don't run ido-define-mode-map-hook.
@@ -1543,7 +1812,7 @@
 	(gdb-set-gud-minor-mode-1): Handle gdb-define-alist.
 	(gdb-source, gdb-memory-set-repeat-count): Replace string-to-int
 	with string-to-number.
-	(gdb-reset): Kill gdb-define-alist. Move assignments outside loop.
+	(gdb-reset): Kill gdb-define-alist.  Move assignments outside loop.
 
 	* progmodes/gud.el: Replace string-to-int with string-to-number.
 	(gud-find-file): Handle gdb-define-alist.
@@ -1589,7 +1858,7 @@
 	move to cc-vars.el.
 
 	* progmodes/cc-vars.el (cc-define-list-program):
-	Change to "gcc -E -dM -". Make customizable.
+	Change to "gcc -E -dM -".  Make customizable.
 
 2005-05-02  Kim F. Storm  <storm@cua.dk>
 
@@ -1640,7 +1909,7 @@
 	* subr.el (dot, dot-marker, dot-min, dot-max, buffer-flush-undo)
 	(compiled-function-p, focus-frame, unfocus-frame):
 	Remove aliases and obsolete declarations.
-	Back out inadvertant changes from previous commit.
+	Back out inadvertent changes from previous commit.
 
 2005-05-01  Luc Teirlinck  <teirllm@auburn.edu>
 
@@ -1695,7 +1964,7 @@
 2005-04-30  Nick Roberts  <nickrob@snap.net.nz>
 
 	* progmodes/cc-mode.el (cc-create-define-alist): Check that file
-	exists. Initialise cc-define-alist.
+	exists.  Initialise cc-define-alist.
 	(c-mode): Add cc-create-define-alist locally to after-save-hook.
 	If there is no file (Macroexpansion) don't create an alist.
 
@@ -1785,7 +2054,7 @@
 
 2005-04-28  Nick Roberts  <nickrob@snap.net.nz>
 
-	* progmodes/cc-mode.el: (cc-create-define-alist): New function.
+	* progmodes/cc-mode.el (cc-create-define-alist): New function.
 	(cc-define-alist): New variable.
 	(c-mode): Make it local and initialise it.
 
@@ -1914,7 +2183,7 @@
 2005-04-25  Dan Nicolaescu  <dann@ics.uci.edu>
 
 	* term.el (ansi-term-color-vector): Use the xterm colors.
-	(term-raw-map): Don't add mappings for \eO and \e[. Map deletechar.
+	(term-raw-map): Don't add mappings for \eO and \e[.  Map deletechar.
 
 2005-04-25  Lute Kamstra  <lute@gnu.org>
 
@@ -2936,13 +3205,13 @@
 	* add-log.el (change-log-font-lock-keywords): The manual
 	describing a Change Log entry, says: (...) "Aside from these
 	header lines, every line in the change log starts with a space or
-	a tab.". The font-lock was not highlighting lines started with
+	a tab.".  The font-lock was not highlighting lines started with
 	spaces, added support for it.
 
 2005-04-03  Roland Winkler  <Roland.Winkler@physik.uni-erlangen.de>
 
 	* textmodes/bibtex.el (bibtex-url): Use format to generate the url.
-	(bibtex-generate-url-list): Update docstring accordingly. Put the
+	(bibtex-generate-url-list): Update docstring accordingly.  Put the
 	complex example in the docstring.
 	(bibtex-font-lock-url): Use pop.
 
@@ -2975,7 +3244,7 @@
 
 2005-04-02  Sergey Poznyakoff  <gray@Mirddin.farlep.net>  (tiny change)
 
-	* mail/rmail.el (rmail-parse-url): Bugfix. Parse traditional
+	* mail/rmail.el (rmail-parse-url): Bugfix.  Parse traditional
 	mailbox specifications as well as URLs.
 	(rmail-insert-inbox-text): Remove unused conditional branches.
 
@@ -3077,12 +3346,7 @@
 	(fill-newline): Use fill-text-properties-at instead of
 	text-properties-at.
 
-2005-03-31  Karl Berry  <karl@freefriends.org>
-
-	* textmodes/tex-mode.el (tex-compile): Use shell-quote-argument,
-	not comint-quote-filename.
-
-2005-03-31  Olive Lin  <olive.lin@versateladsl.be> (tiny change)
+2005-03-31  Olive Lin  <olive.lin@versateladsl.be>  (tiny change)
 
 	* textmodes/tex-mode.el (tex-start-tex) Use shell-quote-argument,
 	not comint-quote-filename.
@@ -3221,12 +3485,12 @@
 	(hs-special-modes-alist): Add a Fortran entry.
 	(fortran-mode-map): Bind fortran-end-of-block,
 	fortran-beginning-of-block to \M-\C-n, \M-\C-p.
-	(fortran-mode): Doc fix. Add fortran-font-lock-keywords-4.
+	(fortran-mode): Doc fix.  Add fortran-font-lock-keywords-4.
 	(fortran-looking-at-if-then, fortran-end-of-block)
 	(fortran-beginning-of-block): New functions, for hideshow.
 
-	* progmodes/f90.el (f90-end-block-re, f90-start-block-re): Doc
-	fix. Tweak regexp.
+	* progmodes/f90.el (f90-end-block-re, f90-start-block-re):
+	Doc fix.  Tweak regexp.
 	(f90-beginning-of-block): Push mark first.
 
 2005-03-29  Jay Belanger  <belanger@truman.edu>
@@ -3244,7 +3508,7 @@
 	* vc.el (vc-do-command): Use a pipe for async processes, so password
 	prompts don't show up at places where the user can't reply.
 
-2005-03-29  Olive Lin  <olive.lin@versateladsl.be> (tiny change)
+2005-03-29  Olive Lin  <olive.lin@versateladsl.be>  (tiny change)
 
 	* textmodes/tex-mode.el (tex-send-command): shell-quote-argument
 	on the file name we pass to the inferior shell.
@@ -3474,11 +3738,11 @@
 	* calendar/calendar.el: Replace `legal' with `valid'.
 	* emacs-lisp/advice.el: Replace `legal' with `valid'.
 	* mail/supercite.el: Replace `legal' with `valid'.
-	* progmodes/cperl-mode.el, progmodes/idlw-shell.el,
-	progmodes/idlwave.el, progmodes/vhdl-mode.el: Replace `legal' with
-	`valid'.
-	* textmodes/reftex-vars.el, textmodes/reftex.el: Replace `legal'
-	with `valid'.
+	* progmodes/cperl-mode.el, progmodes/idlw-shell.el
+	* progmodes/idlwave.el, progmodes/vhdl-mode.el:
+	Replace `legal' with `valid'.
+	* textmodes/reftex-vars.el, textmodes/reftex.el:
+	Replace `legal' with `valid'.
 
 2005-03-25  Werner Lemberg  <wl@gnu.org>
 
@@ -3488,15 +3752,15 @@
 	* emulation/vip.el: Replace `illegal' with `invalid'.
 	* eshell/esh-io.el, eshell/esh-var.el: Replace `illegal' with `invalid'.
 	* mail/supercite.el: Replace `illegal' with `invalid'.
-	* progmodes/ebnf-abn.el, progmodes/ebnf-bnf.el,
-	progmodes/ebnf-ebx.el, progmodes/ebnf-dtd.el, progmodes/ebnf-iso.el,
-	progmodes/ebnf-yac.el, progmodes/ebnf2ps.el, progmodes/idlwave.el,
-	progmodes/sh-script.el, progmodes/xscheme.el: Replace `illegal' with
-	`invalid'.
-	* textmodes/refbib.el, textmodes/refer.el, textmodes/reftex-cite.el,
-	textmodes/reftex-index.el, textmodes/reftex-parse.el,
-	textmodes/reftex-ref.el, textmodes/reftex-vars.el,
-	textmodes/reftex.el, textmodes/org.el: Replace `illegal' with `invalid'.
+	* progmodes/ebnf-abn.el, progmodes/ebnf-bnf.el
+	* progmodes/ebnf-ebx.el, progmodes/ebnf-dtd.el, progmodes/ebnf-iso.el
+	* progmodes/ebnf-yac.el, progmodes/ebnf2ps.el, progmodes/idlwave.el
+	* progmodes/sh-script.el, progmodes/xscheme.el:
+	Replace `illegal' with `invalid'.
+	* textmodes/refbib.el, textmodes/refer.el, textmodes/reftex-cite.el
+	* textmodes/reftex-index.el, textmodes/reftex-parse.el
+	* textmodes/reftex-ref.el, textmodes/reftex-vars.el
+	* textmodes/reftex.el, textmodes/org.el: Replace `illegal' with `invalid'.
 
 2005-03-24  Stefan Monnier  <monnier@iro.umontreal.ca>
 
@@ -3617,11 +3881,11 @@
 	(recentf-include-p): More robust.
 	(recentf-keep-p): New function.
 	(recentf-remove-if-non-kept): Rename from
-	`recentf-remove-if-non-readable'. Use `recentf-keep-p'.
+	`recentf-remove-if-non-readable'.  Use `recentf-keep-p'.
 	All callers updated.
 	(recentf-menu-items-for-commands): Fix help string.
-	(recentf-track-closed-file): Update. Doc fix.
-	(recentf-cleanup): Update. Count removed files. Doc fix.
+	(recentf-track-closed-file): Update.  Doc fix.
+	(recentf-cleanup): Update.  Count removed files.  Doc fix.
 
 2005-03-23  Kim F. Storm  <storm@cua.dk>
 
@@ -4337,7 +4601,7 @@
 
 	* files.el (mode-require-final-newline): Doc fix.
 
-2005-03-03  Stephan Stahl  <stahl@eos.franken.de> (tiny change)
+2005-03-03  Stephan Stahl  <stahl@eos.franken.de>  (tiny change)
 
 	* progmodes/which-func.el (which-function):
 	Specify NOERROR when calling imenu--make-index-alist.
@@ -4932,7 +5196,7 @@
 	* progmodes/gdb-ui.el (gdb-find-file-unhook): New variable.
 	(gdb-set-gud-minor-mode, gdb-set-gud-minor-mode-1)
 	(gdb-set-gud-minor-mode-existing-buffers): New functions.
-	(gdb-find-file-hook): New hook. Add it to find-file-hook.
+	(gdb-find-file-hook): New hook.  Add it to find-file-hook.
 	(gdb-info-breakpoints-custom, gdb-source-info): Simplify.
 
 2005-02-14  Luc Teirlinck  <teirllm@auburn.edu>
@@ -5096,13 +5360,13 @@
 
 2005-02-05  Nick Roberts  <nickrob@snap.net.nz>
 
-	* progmodes/gdb-ui.el: Update copyright. Put GDB-Frames before
+	* progmodes/gdb-ui.el: Update copyright.  Put GDB-Frames before
 	GDB-Windows on the menu-bar as this works better.
 
 2005-02-04  Jay Belanger  <belanger@truman.edu>
 
 	* calc/calc-embed.el (calc-embedded-update): Don't put in
-	unnecessary newlines. Adjust the end of formula marker.
+	unnecessary newlines.  Adjust the end of formula marker.
 
 	* calc/calc-lang.el (math-latex-parse-frac): Don't use arguments.
 	(math-latex-parse-two-args): New function.
@@ -5164,7 +5428,7 @@
 
 2005-02-02  Nick Roberts  <nickrob@snap.net.nz>
 
-	* progmodes/gdb-ui.el: (gdb-goto-info): Delete.
+	* progmodes/gdb-ui.el (gdb-goto-info): Delete.
 
 	* progmodes/gud.el (gud-goto-info): New function.
 	(gud-tool-bar-map): Use correct icon.
@@ -5872,8 +6136,8 @@
 
 2005-01-11  Juri Linkov  <juri@jurta.org>
 
-	* toolbar/back_arrow.xpm, toolbar/back_arrow.pbm,
-	* toolbar/lc-back_arrow.xpm, toolbar/lc-fwd_arrow.xpm,
+	* toolbar/back_arrow.xpm, toolbar/back_arrow.pbm
+	* toolbar/lc-back_arrow.xpm, toolbar/lc-fwd_arrow.xpm
 	* toolbar/fwd_arrow.xpm, toolbar/fwd_arrow.pbm: New icons.
 
 	* info.el (Info-history-forward): New variable.
@@ -6597,7 +6861,7 @@
 
 2004-12-21  Eli Barzilay  <eli@barzilay.org>
 
-	* calculator.el: (calculator-radix-grouping-mode)
+	* calculator.el (calculator-radix-grouping-mode)
 	(calculator-radix-grouping-digits)
 	(calculator-radix-grouping-separator):
 	New defcustoms for the new radix grouping mode functionality.
@@ -6798,11 +7062,11 @@
 	(zone-replace-char): New defsubst.
 	(zone-park/sit-for): Likewise.
 	(zone-fret): Take window-start arg.
-	Update callers. Use `zone-park/sit-for'.
+	Update callers.  Use `zone-park/sit-for'.
 	(zone-fill-out-screen): Rewrite.
-	(zone-fall-through-ws): Likewise. Update callers.
+	(zone-fall-through-ws): Likewise.  Update callers.
 	(zone-pgm-drip): Use `zone-replace-char'.
-	Move var inits before while-loop. Use `zone-park/sit-for'.
+	Move var inits before while-loop.  Use `zone-park/sit-for'.
 	(zone-pgm-random-life): Handle empty initial field.
 	Use `zone-replace-char' and `zone-park/sit-for'.
 
@@ -7643,16 +7907,16 @@
 	(tramp-file-name-handler-alist): Delete file-directory-files, add
 	directory-files-and-attributes.
 	(tramp-perl-file-attributes): Surround uid and gid by double
-	quotes. Change parameter id-format from nonnumeric.
+	quotes.  Change parameter id-format from nonnumeric.
 	(tramp-convert-file-attributes): New function.
 	(tramp-handle-file-attributes): Use it.
 	(tramp-maybe-send-perl-script): New function.
-	(tramp-handle-file-attributes-with-perl): Use it. Don't convert
-	file mode. Change parameter id-format from nonnumeric.
+	(tramp-handle-file-attributes-with-perl): Use it.  Don't convert
+	file mode.  Change parameter id-format from nonnumeric.
 	(tramp-handle-file-attributes-with-ls): Change parameter id-format
 	from nonnumeric.
 	(tramp-post-connection): Don't send tramp-perl-file-attributes
-	script. Reset connection property "perl-scripts".
+	script.  Reset connection property "perl-scripts".
 	(tramp-handle-insert-directory): Run real handler when ls-lisp is
 	in use.
 
@@ -7675,7 +7939,7 @@
 	(gdb-view-source-function, gdb-view-assembler): Delete functions.
 	(menu): Delete menu bindings for viewing source/assembler.
 	(gdb-setup-windows, gdb-restore-windows):
-	Don't dedicate GUD. No assembler now.
+	Don't dedicate GUD.  No assembler now.
 	(gdb-reset): No need to undedicate source buffers now.
 	(gdb-source-info): No assembler now.
 
@@ -7802,7 +8066,7 @@
 	(gdb-var-evaluate-expression-handler, gdb-put-string):
 	Remove unused variable bindings.
 	(gdb-setup-windows, gdb-display-buffer):
-	Simplify. Use pop-to-buffer.
+	Simplify.  Use pop-to-buffer.
 	(gdb-view-source-function): Simplify.
 	(gdb-frame-breakpoints-buffer):
 	Use pop-to-buffer, special-display-regexps.
@@ -7886,8 +8150,8 @@
 	* progmodes/gdb-ui.el (dedicated-switch-to-buffer): New function.
 	(gdb-ann3, gdb-setup-windows, gdb-restore-windows):
 	Dedicate gdb-related windows.
-	(gdb-display-buffer): Dedicate gdb-related windows. Don't grab
-	other frames.
+	(gdb-display-buffer): Dedicate gdb-related windows.
+	Don't grab other frames.
 	(gdb-reset): Remove dedicated property after debugging.
 
 2004-11-24  Jay Belanger  <belanger@truman.edu>
@@ -8753,8 +9017,8 @@
 
 2004-11-10  Nick Roberts  <nickrob@snap.net.nz>
 
-	* tooltip.el: Don't require cl, comint, gud, gdb-ui for
-	compilation. The resulting compiler warnings appear to be harmless.
+	* tooltip.el: Don't require cl, comint, gud, gdb-ui for compilation.
+	The resulting compiler warnings appear to be harmless.
 
 2004-11-10  Daniel Pfeiffer  <occitan@esperanto.org>
 
@@ -9982,7 +10246,7 @@
 	* kmacro.el (kmacro-insert-counter, kmacro-add-counter): Use and
 	reset kmacro-initial-counter-value if set.
 	(kmacro-set-counter): Only set kmacro-counter if defining or executing
-	macro.  Set kmacro-initial-counter-value otherwise. Never set both.
+	macro.  Set kmacro-initial-counter-value otherwise.  Never set both.
 	(kmacro-display): Show macro counter if non-zero.
 
 	* subr.el (substitute-key-definition): Mention command remapping
@@ -10169,8 +10433,8 @@
 
 	* term.el (term-adjust-current-row-cache): Don't allow the current
 	row to become negative.
-	(term-emulate-terminal): Fix insert mode. Handle tab insertion at
-	the end of the line. Fix scroll down. Add comments.
+	(term-emulate-terminal): Fix insert mode.  Handle tab insertion at
+	the end of the line.  Fix scroll down.  Add comments.
 	(term-handle-ansi-escape): Don't exceed terminal width when moving
 	right.
 	(term-scroll-region): Move the cursor after setting the scroll region.
@@ -10325,7 +10589,7 @@
 	* calendar/holidays.el (holiday-advent): Report on a specified day
 	offset from advent, not just advent.
 	(holiday-easter-etc): Report on one specified day offset from
-	easter, not all easter holidays. Various Easter holidays moved to
+	easter, not all easter holidays.  Various Easter holidays moved to
 	`christian-holidays' variable in calendar.el.
 	* calendar/calendar.el (christian-holidays): Adapt for new
 	behaviour of `holiday-advent' and `holiday-easter-etc' functions.
@@ -10340,7 +10604,7 @@
 	(ido-read-internal): Handle new `list' context.
 	Handle insert-buffer and insert-file ido-exit values.
 	(ido-buffer-internal): New arg switch-cmd.  Use it to setup
-	ido-context-switch-command. Handle insert-file ido-exit value.
+	ido-context-switch-command.  Handle insert-file ido-exit value.
 	(ido-read-buffer): Set ido-context-switch-command to 'ignore
 	unless it is already bound by caller.
 	(ido-file-internal): New arg switch-cmd.  Use it to setup
@@ -10670,7 +10934,7 @@
 	Do not call obsolete function compilation-parse-errors.
 	(bibtex-remove-delimiters): Only remove delimiters if present.
 	(bibtex-copy-entry-as-kill): Add docstring.
-	(bibtex-clean-entry): Use bibtex-string=. Handle empty keys.
+	(bibtex-clean-entry): Use bibtex-string=.  Handle empty keys.
 	Detect duplicate keys if bibtex-maintain-sorted-entries is nil.
 	(bibtex-complete): Use bibtex-predefined-month-strings,
 	bibtex-string=, and new function bibtex-complete-key-cleanup.
@@ -11356,8 +11620,8 @@
 	when `c-opt-type-concat-key' is used (i.e. in Pike).
 
 	* progmodes/cc-engine.el (c-looking-at-special-brace-list):
-	Fix bug when the inner char pair doesn't have paren syntax, i.e. "(<
-	>)".
+	Fix bug when the inner char pair doesn't have paren syntax,
+	i.e. "(<>)".
 
 	* progmodes/cc-align.el (c-lineup-multi-inher): Made it syntactic
 	whitespace safe.
@@ -11437,7 +11701,7 @@
 	string.  (2) Check that settings to `c-offsets-alist' are not
 	spuriously quoted.
 
-	* progmodes/cc-cmds.el: (c-electric-brace): Don't delete a comment
+	* progmodes/cc-cmds.el (c-electric-brace): Don't delete a comment
 	which precedes the newly inserted `{'.
 
 2004-08-10  Michael Albinus  <michael.albinus@gmx.de>
@@ -12090,7 +12354,7 @@
 
 2004-06-23  Nick Roberts  <nickrob@gnu.org>
 
-	* comint.el: (comint-insert-clicked-input, comint-copy-old-input):
+	* comint.el (comint-insert-clicked-input, comint-copy-old-input):
 	Remove.
 	(comint-insert-input, comint-mouse-insert-input): New functions
 	based on comint-insert-clicked-input for two bindings but just
@@ -12601,7 +12865,7 @@
 
 2004-06-04  Karl Fogel  <kfogel@red-bean.com>
 
-	* vc-svn.el (vc-svn-checkin): Use 'nconc' instead of 'list*',
+	* vc-svn.el (vc-svn-checkin): Use `nconc' instead of `list*',
 	because the latter is a CL-ism.  This fixes the bug reported by
 	Shawn Boyette <mdxi@collapsar.net> in
 	http://lists.gnu.org/archive/html/emacs-devel/2004-05/msg00442.html.
@@ -13541,9 +13805,9 @@
 	of 19 months of 19 days, with 4 intercalary days.  Each year
 	begins on March 21, with the calendar starting in 1844.
 
-	* calendar/cal-menu.el, calendar/calendar.el,
-	calendar/diary-lib.el, calendar/holidays.el: Added support for
-	using cal-bahai.el.
+	* calendar/cal-menu.el, calendar/calendar.el
+	* calendar/diary-lib.el, calendar/holidays.el:
+	Added support for using cal-bahai.el.
 
 	* eshell/em-glob.el (eshell-glob-initialize): Move initialization
 	of `eshell-glob-chars-regexp' into `eshell-glob-regexp', so that
@@ -14367,7 +14631,7 @@
 	* emacs-lisp/rx.el (rx-syntax): Move sregex style syntax to code.
 	(rx-bracket, rx-check-any, rx-any): Clean up name space.
 
-	* wdired.el: (wdired-mode-map): Move init into declaration.
+	* wdired.el (wdired-mode-map): Move init into declaration.
 	Fix `return' binding.
 	(wdired-change-to-wdired-mode, wdired-change-to-dired-mode):
 	Use force-mode-line-update.
@@ -15910,7 +16174,7 @@
 
 2004-03-15  David Ponce  <david@dponce.com>
 
-	* ruler-mode.el: (ruler-mode-left-fringe-cols)
+	* ruler-mode.el (ruler-mode-left-fringe-cols)
 	(ruler-mode-right-fringe-cols, ruler-mode-left-scroll-bar-cols)
 	(ruler-mode-right-scroll-bar-cols): Remove.
 	(ruler-mode-window-col, ruler-mode-mouse-set-left-margin)
@@ -16657,7 +16921,7 @@
 
 2004-02-16  Eli Tziperman  <eli@deas.harvard.edu>
 
-	* rmail-spam-filter.el: (vm-use-spam-filter)
+	* rmail-spam-filter.el (vm-use-spam-filter)
 	(rsf-min-region-length-added-to-spam-list): New	variables.
 	(rsf-bbdb-auto-delete-spam-bbdb-entries): Rename from
 	rmail-bbdb-auto-delete-spam-entries.  Add cc: to recipients for
@@ -17315,7 +17579,7 @@
 
 	* mail/smtpmail.el (smtpmail-send-data): Don't append spurious newline.
 
-2004-01-18   David Ponce  <david@dponce.com>  (tiny change)
+2004-01-18  David Ponce  <david@dponce.com>  (tiny change)
 
 	* progmodes/which-func.el (which-function-mode): Don't cancel
 	which-func-update-timer if not set.
@@ -19829,10 +20093,10 @@
 	* calendar/cal-tex.el (cal-tex-day-name-format): Doc fix.
 	(cal-tex-LaTeX-hourbox): Move definition before use.
 
-	* calendar/cal-china.el, cal-hebrew.el, cal-islam.el,
-	cal-julian.el, cal-menu.el, cal-move.el, holidays.el,
-	lunar.el, solar.el
-	(displayed-month, displayed-year): Define for compiler.
+	* calendar/cal-china.el, cal-hebrew.el, cal-islam.el
+	* cal-julian.el, cal-menu.el, cal-move.el, holidays.el
+	* lunar.el, solar.el (displayed-month, displayed-year):
+	Define for compiler.
 
 2003-08-03  Martin Stjernholm  <bug-cc-mode@gnu.org>
 
--- a/lisp/add-log.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/add-log.el	Fri Jun 03 05:49:26 2005 +0000
@@ -220,7 +220,7 @@
     ("^\\sw.........[0-9:+ ]*"
      (0 'change-log-date-face)
      ;; Name and e-mail; some people put e-mail in parens, not angles.
-     ("\\([^<(]+?\\)[ \t]*[(<]\\([A-Za-z0-9_.-]+@[A-Za-z0-9_.-]+\\)[>)]" nil nil
+     ("\\([^<(]+?\\)[ \t]*[(<]\\([A-Za-z0-9_.+-]+@[A-Za-z0-9_.-]+\\)[>)]" nil nil
       (1 'change-log-name-face)
       (2 'change-log-email-face)))
     ;;
--- a/lisp/autorevert.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/autorevert.el	Fri Jun 03 05:49:26 2005 +0000
@@ -484,46 +484,47 @@
 This function is also responsible for removing buffers no longer in
 Auto-Revert mode from `auto-revert-buffer-list', and for canceling
 the timer when no buffers need to be checked."
-  (let ((bufs (if global-auto-revert-mode
-		  (buffer-list)
-		auto-revert-buffer-list))
-	(remaining ())
-	(new ()))
-    ;; Partition `bufs' into two halves depending on whether or not
-    ;; the buffers are in `auto-revert-remaining-buffers'.  The two
-    ;; halves are then re-joined with the "remaining" buffers at the
-    ;; head of the list.
-    (dolist (buf auto-revert-remaining-buffers)
-      (if (memq buf bufs)
-	  (push buf remaining)))
-    (dolist (buf bufs)
-      (if (not (memq buf remaining))
-	  (push buf new)))
-    (setq bufs (nreverse (nconc new remaining)))
-    (while (and bufs
-		(not (and auto-revert-stop-on-user-input
-			  (input-pending-p))))
-      (let ((buf (car bufs)))
-	(if (buffer-name buf)		; Buffer still alive?
-	    (with-current-buffer buf
-	      ;; Test if someone has turned off Auto-Revert Mode in a
-	      ;; non-standard way, for example by changing major mode.
-	      (if (and (not auto-revert-mode)
-		       (not auto-revert-tail-mode)
-		       (memq buf auto-revert-buffer-list))
-		  (setq auto-revert-buffer-list
-			(delq buf auto-revert-buffer-list)))
-	      (when (auto-revert-active-p) (auto-revert-handler)))
-	  ;; Remove dead buffer from `auto-revert-buffer-list'.
-	  (setq auto-revert-buffer-list
-		(delq buf auto-revert-buffer-list))))
-      (setq bufs (cdr bufs)))
-    (setq auto-revert-remaining-buffers bufs)
-    ;; Check if we should cancel the timer.
-    (when (and (not global-auto-revert-mode)
-	       (null auto-revert-buffer-list))
-      (cancel-timer auto-revert-timer)
-      (setq auto-revert-timer nil))))
+  (save-match-data
+    (let ((bufs (if global-auto-revert-mode
+		    (buffer-list)
+		  auto-revert-buffer-list))
+	  (remaining ())
+	  (new ()))
+      ;; Partition `bufs' into two halves depending on whether or not
+      ;; the buffers are in `auto-revert-remaining-buffers'.  The two
+      ;; halves are then re-joined with the "remaining" buffers at the
+      ;; head of the list.
+      (dolist (buf auto-revert-remaining-buffers)
+	(if (memq buf bufs)
+	    (push buf remaining)))
+      (dolist (buf bufs)
+	(if (not (memq buf remaining))
+	    (push buf new)))
+      (setq bufs (nreverse (nconc new remaining)))
+      (while (and bufs
+		  (not (and auto-revert-stop-on-user-input
+			    (input-pending-p))))
+	(let ((buf (car bufs)))
+	  (if (buffer-name buf)		; Buffer still alive?
+	      (with-current-buffer buf
+		;; Test if someone has turned off Auto-Revert Mode in a
+		;; non-standard way, for example by changing major mode.
+		(if (and (not auto-revert-mode)
+			 (not auto-revert-tail-mode)
+			 (memq buf auto-revert-buffer-list))
+		    (setq auto-revert-buffer-list
+			  (delq buf auto-revert-buffer-list)))
+		(when (auto-revert-active-p) (auto-revert-handler)))
+	    ;; Remove dead buffer from `auto-revert-buffer-list'.
+	    (setq auto-revert-buffer-list
+		  (delq buf auto-revert-buffer-list))))
+	(setq bufs (cdr bufs)))
+      (setq auto-revert-remaining-buffers bufs)
+      ;; Check if we should cancel the timer.
+      (when (and (not global-auto-revert-mode)
+		 (null auto-revert-buffer-list))
+	(cancel-timer auto-revert-timer)
+	(setq auto-revert-timer nil)))))
 
 
 ;; The end:
--- a/lisp/calc/calc-aent.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/calc/calc-aent.el	Fri Jun 03 05:49:26 2005 +0000
@@ -947,6 +947,9 @@
 	    first nil))
     x))
 
+;; calc-arg-values is defined in calc-ext.el, but is used here.
+(defvar calc-arg-values)
+
 (defun calc-check-user-syntax (&optional x prec)
   (let ((p calc-user-parse-table)
 	(matches nil)
--- a/lisp/calc/calc-embed.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/calc/calc-embed.el	Fri Jun 03 05:49:26 2005 +0000
@@ -192,8 +192,15 @@
 (defvar calc-embed-top)
 (defvar calc-embed-bot)
 
+;; The variable calc-embed-arg is local to calc-do-embedded,
+;; calc-embedded-update-formula, calc-embedded-edit and
+;; calc-do-embedded-activate, but is used by 
+;; calc-embedded-make-info, which is called by the above
+;; functions.
+(defvar calc-embed-arg)
+
 (defvar calc-embedded-quiet nil)
-(defun calc-do-embedded (arg end obeg oend)
+(defun calc-do-embedded (calc-embed-arg end obeg oend)
   (if calc-embedded-info
 
       ;; Turn embedded mode off or switch to a new buffer.
@@ -237,7 +244,7 @@
 					 (buffer-name)))
 		       (keyboard-quit))
 		   (calc-embedded nil)))
-	     (calc-embedded arg end obeg oend)))
+	     (calc-embedded calc-embed-arg end obeg oend)))
 
     ;; Turn embedded mode on.
     (calc-plain-buffer-only)
@@ -250,7 +257,8 @@
       (calc-embedded-save-original-modes)
       (or calc-embedded-globals
 	  (calc-find-globals))
-      (setq info (calc-embedded-make-info (point) nil t arg end obeg oend))
+      (setq info 
+            (calc-embedded-make-info (point) nil t calc-embed-arg end obeg oend))
       (if (eq (car-safe (aref info 8)) 'error)
 	  (progn
             (setq calc-embedded-original-modes nil)
@@ -311,13 +319,13 @@
        (calc-select-part 2)))
 
 
-(defun calc-embedded-update-formula (arg)
+(defun calc-embedded-update-formula (calc-embed-arg)
   (interactive "P")
-  (if arg
+  (if calc-embed-arg
       (let ((entry (assq (current-buffer) calc-embedded-active)))
 	(while (setq entry (cdr entry))
 	  (and (eq (car-safe (aref (car entry) 8)) 'calcFunc-evalto)
-	       (or (not (consp arg))
+	       (or (not (consp calc-embed-arg))
 		   (and (<= (aref (car entry) 2) (region-beginning))
 			(>= (aref (car entry) 3) (region-end))))
 	       (save-excursion
@@ -337,9 +345,9 @@
 	      (goto-char (+ (aref info 4) pt))))))))
 
 
-(defun calc-embedded-edit (arg)
+(defun calc-embedded-edit (calc-embed-arg)
   (interactive "P")
-  (let ((info (calc-embedded-make-info (point) nil t arg))
+  (let ((info (calc-embedded-make-info (point) nil t calc-embed-arg))
 	str)
     (if (eq (car-safe (aref info 8)) 'error)
 	(progn
@@ -374,12 +382,12 @@
       (aset info 8 val)
       (calc-embedded-update info 14 t t))))
 
-(defun calc-do-embedded-activate (arg cbuf)
+(defun calc-do-embedded-activate (calc-embed-arg cbuf)
   (calc-plain-buffer-only)
-  (if arg
+  (if calc-embed-arg
       (calc-embedded-forget))
   (calc-find-globals)
-  (if (< (prefix-numeric-value arg) 0)
+  (if (< (prefix-numeric-value calc-embed-arg) 0)
       (message "Deactivating %s for Calc Embedded mode" (buffer-name))
     (message "Activating %s for Calc Embedded mode..." (buffer-name))
     (save-excursion
@@ -432,7 +440,7 @@
 
 (defun calc-embedded-word ()
   (interactive)
-  (calc-embedded '(4)))
+  (calc-embedded '(t)))
 
 (defun calc-embedded-mark-formula (&optional body-only)
   "Put point at the beginning of this Calc formula, mark at the end.
@@ -799,16 +807,26 @@
       (aset info 1 (or cbuf (save-excursion
 			      (calc-create-buffer)
 			      (current-buffer)))))
-    (if (and (integerp calc-embed-top) (not calc-embed-bot))  
+    (if (and 
+         (or (integerp calc-embed-top) (equal calc-embed-top '(4)))
+         (not calc-embed-bot))  
                                         ; started with a user-supplied argument
 	(progn
-	  (if (= (setq arg (prefix-numeric-value arg)) 0)
-	      (progn
-		(aset info 2 (copy-marker (region-beginning)))
-		(aset info 3 (copy-marker (region-end))))
-	    (aset info (if (> arg 0) 2 3) (point-marker))
-	    (forward-line arg)
-	    (aset info (if (> arg 0) 3 2) (point-marker)))
+          (if (equal calc-embed-top '(4))
+              (progn
+                (aset info 2 (copy-marker (line-beginning-position)))
+                (aset info 3 (copy-marker (line-end-position))))
+            (if (= (setq calc-embed-arg (prefix-numeric-value calc-embed-arg)) 0)
+                (progn
+                  (aset info 2 (copy-marker (region-beginning)))
+                  (aset info 3 (copy-marker (region-end))))
+              (aset info (if (> calc-embed-arg 0) 2 3) (point-marker))
+              (if (> calc-embed-arg 0)
+                  (progn
+                    (forward-line (1- calc-embed-arg))
+                    (end-of-line))
+                (forward-line (1+ calc-embed-arg)))
+              (aset info (if (> calc-embed-arg 0) 3 2) (point-marker))))
 	  (aset info 4 (copy-marker (aref info 2)))
 	  (aset info 5 (copy-marker (aref info 3))))
       (if (aref info 4)
--- a/lisp/calc/calc-ext.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/calc/calc-ext.el	Fri Jun 03 05:49:26 2005 +0000
@@ -43,6 +43,9 @@
 (defvar math-comp-sel-cpos nil)
 (defvar math-compose-hash-args nil)
 
+(defvar calc-alg-map)
+(defvar calc-alg-esc-map)
+
 ;;; The following was made a function so that it could be byte-compiled.
 (defun calc-init-extensions ()
 
@@ -1192,8 +1195,9 @@
 	   (math-normalize val)))))
 
 
-
-(if (boundp 'calc-help-map)
+(defvar calc-help-map nil)
+
+(if calc-help-map
     nil
   (setq calc-help-map (make-keymap))
   (define-key calc-help-map "b" 'calc-describe-bindings)
--- a/lisp/calc/calc-misc.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/calc/calc-misc.el	Fri Jun 03 05:49:26 2005 +0000
@@ -160,7 +160,7 @@
   "Go to a node in the Calculator info documentation."
   (interactive)
   (select-window (get-largest-window))
-  (Info-goto-node (concat "(Calc)" node)))
+  (info (concat "(Calc)" node)))
 
 (defun calc-tutorial ()
   "Run the Emacs Info system on the Calculator Tutorial."
--- a/lisp/calc/calc-stuff.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/calc/calc-stuff.el	Fri Jun 03 05:49:26 2005 +0000
@@ -171,6 +171,7 @@
 (defvar math-max-digits-cache) ; calc-bin.el
 (defvar math-integral-cache) ; calcalg2.el
 (defvar math-units-table) ; calc-units.el
+(defvar math-decls-cache-tag) ; calc-arith.el
 (defvar math-format-date-cache) ; calc-forms.el
 (defvar math-holidays-cache-tag) ; calc-forms.el
 
--- a/lisp/calc/calc.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/calc/calc.el	Fri Jun 03 05:49:26 2005 +0000
@@ -325,7 +325,7 @@
   :type '(choice (string) (sexp)))
 
 (defvar calc-bug-address "belanger@truman.edu"
-  "Address of the author of Calc, for use by `report-calc-bug'.")
+  "Address of the maintainer of Calc, for use by `report-calc-bug'.")
 
 (defvar calc-scan-for-dels t
   "If t, scan keymaps to find all DEL-like keys.
@@ -720,6 +720,12 @@
 (defvar calc-load-hook nil
   "Hook run when calc.el is loaded.")
 
+(defvar calc-window-hook nil
+  "Hook called to create the Calc window.")
+
+(defvar calc-trail-window-hook nil
+  "Hook called to create the Calc trail window.")
+
 ;; Verify that Calc is running on the right kind of system.
 (defvar calc-emacs-type-lucid (not (not (string-match "Lucid" emacs-version))))
 
@@ -1053,7 +1059,7 @@
 	(use-global-map glob)
 	(use-local-map loc)))))
 
-
+(defvar calc-alg-map) ; Defined in calc-ext.el
 
 (defun calc-mode ()
   "Calculator major mode.
@@ -1205,18 +1211,20 @@
 	    (switch-to-buffer (current-buffer) t)
 	  (if (get-buffer-window (current-buffer))
 	      (select-window (get-buffer-window (current-buffer)))
-            (let ((w (get-largest-window)))
-              (if (and pop-up-windows
-                       (> (window-height w)
-                          (+ window-min-height calc-window-height 2)))
-                  (progn
-                    (setq w (split-window w
-                                          (- (window-height w)
-                                             calc-window-height 2)
-                                          nil))
-                    (set-window-buffer w (current-buffer))
-                    (select-window w))
-                (pop-to-buffer (current-buffer))))))
+            (if calc-window-hook
+                (run-hooks 'calc-window-hook)
+              (let ((w (get-largest-window)))
+                (if (and pop-up-windows
+                         (> (window-height w)
+                            (+ window-min-height calc-window-height 2)))
+                    (progn
+                      (setq w (split-window w
+                                            (- (window-height w)
+                                               calc-window-height 2)
+                                            nil))
+                      (set-window-buffer w (current-buffer))
+                      (select-window w))
+                  (pop-to-buffer (current-buffer)))))))
 	(save-excursion
 	  (set-buffer (calc-trail-buffer))
 	  (and calc-display-trail
@@ -1823,15 +1831,17 @@
 	      (not (if flag (memq flag '(nil 0)) win)))
 	(if (null win)
 	    (progn
-              (let ((w (split-window nil (/ (* (window-width) 2) 3) t)))
-                (set-window-buffer w calc-trail-buffer))
-	      (calc-wrapper
-	       (setq overlay-arrow-string calc-trail-overlay
-		     overlay-arrow-position calc-trail-pointer)
-	       (or no-refresh
-		   (if interactive
-		       (calc-do-refresh)
-		     (calc-refresh))))))
+              (if calc-trail-window-hook
+                  (run-hooks 'calc-trail-window-hook)
+                (let ((w (split-window nil (/ (* (window-width) 2) 3) t)))
+                  (set-window-buffer w calc-trail-buffer)))
+              (calc-wrapper
+               (setq overlay-arrow-string calc-trail-overlay
+                     overlay-arrow-position calc-trail-pointer)
+               (or no-refresh
+                   (if interactive
+                       (calc-do-refresh)
+                     (calc-refresh))))))
       (if win
 	  (progn
 	    (delete-window win)
@@ -3431,7 +3441,7 @@
 
 (defun calc-user-invocation ()
   (interactive)
-  (unless (stringp calc-invocation-macro)
+  (unless calc-invocation-macro
     (error "Use `Z I' inside Calc to define a `M-# Z' keyboard macro"))
   (execute-kbd-macro calc-invocation-macro nil))
 
--- a/lisp/calc/calcalg2.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/calc/calcalg2.el	Fri Jun 03 05:49:26 2005 +0000
@@ -202,6 +202,8 @@
 (defvar math-deriv-var)
 (defvar math-deriv-total)
 (defvar math-deriv-symb)
+(defvar math-decls-cache)
+(defvar math-decls-all)
 
 (defun math-derivative (expr)
   (cond ((equal expr math-deriv-var)
--- a/lisp/calendar/diary-lib.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/calendar/diary-lib.el	Fri Jun 03 05:49:26 2005 +0000
@@ -1050,15 +1050,16 @@
            (regexp-quote diary-include-string)
            " \"\\([^\"]*\\)\"")
           nil t)
-    (let ((diary-file (substitute-in-file-name
-                       (buffer-substring-no-properties
-                        (match-beginning 2) (match-end 2))))
-          (mark-diary-entries-hook 'mark-included-diary-files))
+    (let* ((diary-file (substitute-in-file-name
+                        (match-string-no-properties 2)))
+           (mark-diary-entries-hook 'mark-included-diary-files)
+           (dbuff (find-buffer-visiting diary-file)))
       (if (file-exists-p diary-file)
           (if (file-readable-p diary-file)
               (progn
                 (mark-diary-entries)
-                (kill-buffer (find-buffer-visiting diary-file)))
+                (unless dbuff
+                  (kill-buffer (find-buffer-visiting diary-file))))
             (beep)
             (message "Can't read included diary file %s" diary-file)
             (sleep-for 2))
--- a/lisp/calendar/icalendar.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/calendar/icalendar.el	Fri Jun 03 05:49:26 2005 +0000
@@ -165,7 +165,6 @@
 ;; all the other libs we need
 ;; ======================================================================
 (require 'calendar)
-(require 'appt)
 
 ;; ======================================================================
 ;; misc
--- a/lisp/emacs-lisp/bytecomp.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/emacs-lisp/bytecomp.el	Fri Jun 03 05:49:26 2005 +0000
@@ -1248,15 +1248,15 @@
 (defun byte-compile-nogroup-warn (form)
   (let ((keyword-args (cdr (cdr (cdr (cdr form)))))
 	(name (cadr form)))
-    (unless (plist-get keyword-args :group)
-      (byte-compile-warn
-       "%s for `%s' fails to specify containing group"
-       (cdr (assq (car form)
-		  '((custom-declare-group . defgroup)
-		    (custom-declare-face . defface)
-		    (custom-declare-variable . defcustom))))
-       (if (and (consp name) (eq (car name) 'quote))
-	   (cadr name) name)))))
+    (or (plist-get keyword-args :group)
+	(not (and (consp name) (eq (car name) 'quote)))
+	(byte-compile-warn
+	 "%s for `%s' fails to specify containing group"
+	 (cdr (assq (car form)
+		    '((custom-declare-group . defgroup)
+		      (custom-declare-face . defface)
+		      (custom-declare-variable . defcustom))))
+	 (cadr name)))))
 
 ;; Warn if the function or macro is being redefined with a different
 ;; number of arguments.
--- a/lisp/emacs-lisp/cl-macs.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/emacs-lisp/cl-macs.el	Fri Jun 03 05:49:26 2005 +0000
@@ -1565,14 +1565,21 @@
 This macro is an easy-to-use substitute for `define-setf-method' that works
 well for simple place forms.  In the simple `defsetf' form, `setf's of
 the form (setf (NAME ARGS...) VAL) are transformed to function or macro
-calls of the form (FUNC ARGS... VAL).  Example: (defsetf aref aset).
+calls of the form (FUNC ARGS... VAL).  Example:
+
+  (defsetf aref aset)
+
 Alternate form: (defsetf NAME ARGLIST (STORE) BODY...).
 Here, the above `setf' call is expanded by binding the argument forms ARGS
 according to ARGLIST, binding the value form VAL to STORE, then executing
 BODY, which must return a Lisp form that does the necessary `setf' operation.
 Actually, ARGLIST and STORE may be bound to temporary variables which are
 introduced automatically to preserve proper execution order of the arguments.
-Example: (defsetf nth (n x) (v) (list 'setcar (list 'nthcdr n x) v))."
+Example:
+
+  (defsetf nth (n x) (v) (list 'setcar (list 'nthcdr n x) v))
+
+\(fn NAME [FUNC | ARGLIST (STORE) BODY...])"
   (if (listp arg1)
       (let* ((largs nil) (largsr nil)
 	     (temps nil) (tempsr nil)
--- a/lisp/emacs-lisp/easymenu.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/emacs-lisp/easymenu.el	Fri Jun 03 05:49:26 2005 +0000
@@ -1,6 +1,7 @@
 ;;; easymenu.el --- support the easymenu interface for defining a menu
 
-;; Copyright (C) 1994,96,98,1999,2000,2004  Free Software Foundation, Inc.
+;; Copyright (C) 1994, 1996, 1998, 1999, 2000, 2004, 2005
+;;           Free Software Foundation, Inc.
 
 ;; Keywords: emulations
 ;; Author: Richard Stallman <rms@gnu.org>
@@ -534,7 +535,7 @@
     (easy-menu-do-add-item map item before)))
 
 (defun easy-menu-item-present-p (map path name)
-  "In submenu of MAP with path PATH, return true iff item NAME is present.
+  "In submenu of MAP with path PATH, return non-nil iff item NAME is present.
 MAP and PATH are defined as in `easy-menu-add-item'.
 NAME should be a string, the name of the element to be looked for."
   (easy-menu-return-item (easy-menu-get-map map path) name))
@@ -552,7 +553,14 @@
   "In menu MENU try to look for menu item with name NAME.
 If a menu item is found, return (NAME . item), otherwise return nil.
 If item is an old format item, a new format item is returned."
-  (let ((item (lookup-key menu (vector (easy-menu-intern name))))
+  ;; The call to `lookup-key' also calls the C function `get_keyelt' which
+  ;; looks inside a menu-item to only return the actual command.  This is
+  ;; not what we want here.  We should either add an arg to lookup-key to be
+  ;; able to turn off this "feature", or else we could use map-keymap here.
+  ;; In the mean time, I just use `assq' which is an OK approximation since
+  ;; menus are rarely built from vectors or char-tables.
+  (let ((item (or (cdr (assq name menu))
+                  (lookup-key menu (vector (easy-menu-intern name)))))
 	ret enable cache label)
     (cond
      ((stringp (car-safe item))
--- a/lisp/emacs-lisp/find-func.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/emacs-lisp/find-func.el	Fri Jun 03 05:49:26 2005 +0000
@@ -246,8 +246,6 @@
 in `load-path'."
   (if (not function)
       (error "You didn't specify a function"))
-  (and (subrp (symbol-function function))
-       (error "%s is a primitive function" function))
   (let ((def (symbol-function function))
 	aliases)
     (while (symbolp def)
@@ -265,6 +263,8 @@
     (let ((library
 	   (cond ((eq (car-safe def) 'autoload)
 		  (nth 1 def))
+		 ((subrp def)
+		  (help-C-file-name def 'subr))
 		 ((symbol-file function 'defun)))))
       (find-function-search-for-symbol function nil library))))
 
--- a/lisp/emulation/tpu-mapper.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/emulation/tpu-mapper.el	Fri Jun 03 05:49:26 2005 +0000
@@ -375,7 +375,7 @@
 ;;;
 ;;;  Load the newly defined keys and clean up
 ;;;
-(eval-current-buffer)
+(eval-buffer)
 (kill-buffer (current-buffer))
 (kill-buffer "*scratch*")
 (kill-buffer "Gold-Keys")
--- a/lisp/eshell/em-cmpl.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/eshell/em-cmpl.el	Fri Jun 03 05:49:26 2005 +0000
@@ -136,8 +136,7 @@
   :type (get 'pcomplete-file-ignore 'custom-type)
   :group 'eshell-cmpl)
 
-(defcustom eshell-cmpl-dir-ignore
-  (format "\\`\\(\\.\\.?\\|CVS\\)%c\\'" directory-sep-char)
+(defcustom eshell-cmpl-dir-ignore "\\`\\(\\.\\.?\\|CVS\\)/\\'"
   (documentation-property 'pcomplete-dir-ignore
 			  'variable-documentation)
   :type (get 'pcomplete-dir-ignore 'custom-type)
@@ -155,7 +154,7 @@
   :type (get 'pcomplete-autolist 'custom-type)
   :group 'eshell-cmpl)
 
-(defcustom eshell-cmpl-suffix-list (list directory-sep-char ?:)
+(defcustom eshell-cmpl-suffix-list (list ?/ ?:)
   (documentation-property 'pcomplete-suffix-list
 			  'variable-documentation)
   :type (get 'pcomplete-suffix-list 'custom-type)
--- a/lisp/eshell/em-dirs.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/eshell/em-dirs.el	Fri Jun 03 05:49:26 2005 +0000
@@ -276,8 +276,7 @@
     (let* ((letter (match-string 1))
 	   (regexp (concat "\\`" letter))
 	   (path (eshell-find-previous-directory regexp)))
-      (concat (or path letter)
-	      (char-to-string directory-sep-char)))))
+      (concat (or path letter) "/"))))
 
 (defun eshell-complete-user-reference ()
   "If there is a user reference, complete it."
@@ -300,7 +299,7 @@
   (let* ((path default-directory)
 	 (len (length path)))
     (if (and (> len 1)
-	     (eq (aref path (1- len)) directory-sep-char)
+	     (eq (aref path (1- len)) ?/)
 	     (not (and (eshell-under-windows-p)
 		       (string-match "\\`[A-Za-z]:[\\\\/]\\'" path))))
 	(setq path (substring path 0 (1- (length path)))))
@@ -324,9 +323,7 @@
 	   (len (length extra-dots))
 	   replace-text)
       (while (> len 0)
-	(setq replace-text
-	      (concat replace-text
-		      (char-to-string directory-sep-char) "..")
+	(setq replace-text (concat replace-text "/..")
 	      len (1- len)))
       (setq path
 	    (replace-match replace-text t t path 1))))
@@ -371,7 +368,7 @@
 	(setq path
 	      (ring-remove eshell-last-dir-ring
 			   (if index
-			       (string-to-int index)
+			       (string-to-number index)
 			     0)))))
      ((and path (string-match "^=\\(.*\\)$" path))
       (let ((oldpath (eshell-find-previous-directory
--- a/lisp/eshell/em-glob.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/eshell/em-glob.el	Fri Jun 03 05:49:26 2005 +0000
@@ -265,9 +265,6 @@
   (defvar matches)
   (defvar message-shown))
 
-;; jww (1999-11-18): this function assumes that directory-sep-char is
-;; a forward slash (/)
-
 (defun eshell-glob-entries (path globs &optional recurse-p)
   "Glob the entries in PATHS, possibly recursing if RECURSE-P is non-nil."
   (let* ((entries (ignore-errors
@@ -303,11 +300,11 @@
     ;; can't use `directory-file-name' because it strips away text
     ;; properties in the string
     (let ((len (1- (length incl))))
-      (if (eq (aref incl len) directory-sep-char)
+      (if (eq (aref incl len) ?/)
 	  (setq incl (substring incl 0 len)))
       (when excl
 	(setq len (1- (length excl)))
-	(if (eq (aref excl len) directory-sep-char)
+	(if (eq (aref excl len) ?/)
 	    (setq excl (substring excl 0 len)))))
     (setq incl (eshell-glob-regexp incl)
 	  excl (and excl (eshell-glob-regexp excl)))
@@ -329,7 +326,7 @@
     (while entries
       (setq name (car entries)
 	    len (length name)
-	    isdir (eq (aref name (1- len)) directory-sep-char))
+	    isdir (eq (aref name (1- len)) ?/))
       (if (let ((fname (directory-file-name name)))
 	    (and (not (and excl (string-match excl fname)))
 		 (string-match incl fname)))
--- a/lisp/eshell/em-unix.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/eshell/em-unix.el	Fri Jun 03 05:49:26 2005 +0000
@@ -877,7 +877,7 @@
        (unless by-bytes
 	 (setq block-size (or block-size 1024)))
        (if (and max-depth (stringp max-depth))
-	   (setq max-depth (string-to-int max-depth)))
+	   (setq max-depth (string-to-number max-depth)))
        ;; filesystem support means nothing under Windows
        (if (eshell-under-windows-p)
 	   (setq only-one-filesystem nil))
--- a/lisp/eshell/esh-ext.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/eshell/esh-ext.el	Fri Jun 03 05:49:26 2005 +0000
@@ -103,7 +103,7 @@
   "Invoke a .BAT or .CMD file on DOS/Windows systems."
   ;; since CMD.EXE can't handle forward slashes in the initial
   ;; argument...
-  (setcar args (subst-char-in-string directory-sep-char ?\\ (car args)))
+  (setcar args (subst-char-in-string ?/ ?\\ (car args)))
   (throw 'eshell-replace-command
 	 (eshell-parse-command eshell-windows-shell-file (cons "/c" args))))
 
--- a/lisp/eshell/esh-io.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/eshell/esh-io.el	Fri Jun 03 05:49:26 2005 +0000
@@ -192,7 +192,7 @@
 	  (eshell-finish-arg
 	   (prog1
 	       (list 'eshell-set-output-handle
-		     (or (and sh (string-to-int sh)) 1)
+		     (or (and sh (string-to-number sh)) 1)
 		     (list 'quote
 			   (aref [overwrite append insert]
 				 (1- (length oper)))))
--- a/lisp/eshell/esh-util.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/eshell/esh-util.el	Fri Jun 03 05:49:26 2005 +0000
@@ -253,14 +253,13 @@
 	parts)
     (if (and (eshell-under-windows-p)
 	     (> len 2)
-	     (eq (aref path 0) directory-sep-char)
-	     (eq (aref path 1) directory-sep-char))
+	     (eq (aref path 0) ?/)
+	     (eq (aref path 1) ?/))
 	(setq i 2))
     (while (< i len)
-      (if (and (eq (aref path i) directory-sep-char)
+      (if (and (eq (aref path i) ?/)
 	       (not (get-text-property i 'escaped path)))
-	  (setq parts (cons (if (= li i)
-				(char-to-string directory-sep-char)
+	  (setq parts (cons (if (= li i) "/"
 			      (substring path li (1+ i))) parts)
 		li (1+ i)))
       (setq i (1+ i)))
@@ -268,9 +267,7 @@
 	(setq parts (cons (substring path li i) parts)))
     (if (and (eshell-under-windows-p)
 	     (string-match "\\`[A-Za-z]:\\'" (car (last parts))))
-	(setcar (last parts)
-		(concat (car (last parts))
-			(char-to-string directory-sep-char))))
+	(setcar (last parts) (concat (car (last parts)) "/")))
     (nreverse parts)))
 
 (defun eshell-to-flat-string (value)
@@ -450,8 +447,8 @@
 				 (point) (progn (end-of-line)
 						(point))) ":")))
 	    (if (and (and fields (nth 0 fields) (nth 2 fields))
-		     (not (assq (string-to-int (nth 2 fields)) names)))
-		(setq names (cons (cons (string-to-int (nth 2 fields))
+		     (not (assq (string-to-number (nth 2 fields)) names)))
+		(setq names (cons (cons (string-to-number (nth 2 fields))
 					(nth 0 fields))
 				  names))))
 	  (forward-line))))
--- a/lisp/eshell/esh-var.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/eshell/esh-var.el	Fri Jun 03 05:49:26 2005 +0000
@@ -631,7 +631,7 @@
 	    (if (and value
 		     (stringp value)
 		     (file-directory-p value))
-		(concat varname (char-to-string directory-sep-char))
+		(concat varname "/")
 	      varname))))
        (eshell-envvar-names (eshell-environment-variables)))
       (all-completions argname obarray 'boundp)
--- a/lisp/faces.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/faces.el	Fri Jun 03 05:49:26 2005 +0000
@@ -183,10 +183,7 @@
 If the optional argument FRAME is given, this gets the face NAME for
 that frame; otherwise, it uses the selected frame.
 If FRAME is the symbol t, then the global, non-frame face is returned.
-If NAME is already a face, it is simply returned.
-
-This function is defined for compatibility with Emacs 20.2.  It
-should not be used anymore."
+If NAME is already a face, it is simply returned."
   (facep name))
 (make-obsolete 'internal-find-face 'facep "21.1")
 
@@ -1154,16 +1151,24 @@
 arg, prompt for a regular expression."
   (interactive (list (and current-prefix-arg
                           (read-string "List faces matching regexp: "))))
-  (let ((faces (sort (face-list) #'string-lessp))
+  (let ((all-faces (zerop (length regexp)))
 	(frame (selected-frame))
+	(max-length 0)
+	faces line-format
 	disp-frame window face-name)
-    (when (> (length regexp) 0)
-      (setq faces
-            (delq nil
-                  (mapcar (lambda (f)
-                            (when (string-match regexp (symbol-name f))
-                              f))
-                          faces))))
+    ;; We filter and take the max length in one pass
+    (setq faces
+	  (delq nil
+		(mapcar (lambda (f)
+			  (let ((s (symbol-name f)))
+			    (when (or all-faces (string-match regexp s))
+			      (setq max-length (max (length s) max-length))
+			      f)))
+			(sort (face-list) #'string-lessp))))
+    (unless faces
+      (error "No faces matching \"%s\"" regexp))
+    (setq max-length (1+ max-length)
+	  line-format (format "%%-%ds" max-length))
     (with-output-to-temp-buffer "*Faces*"
       (save-excursion
 	(set-buffer standard-output)
@@ -1178,7 +1183,7 @@
 	(setq help-xref-stack nil)
 	(dolist (face faces)
 	  (setq face-name (symbol-name face))
-	  (insert (format "%25s " face-name))
+	  (insert (format line-format face-name))
 	  ;; Hyperlink to a customization buffer for the face.  Using
 	  ;; the help xref mechanism may not be the best way.
 	  (save-excursion
@@ -1203,7 +1208,7 @@
 	    (goto-char beg)
 	    (forward-line 1)
 	    (while (not (eobp))
-	      (insert "                          ")
+	      (insert-char ?\s max-length)
 	      (forward-line 1))))
 	(goto-char (point-min)))
       (print-help-return-message))
--- a/lisp/files.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/files.el	Fri Jun 03 05:49:26 2005 +0000
@@ -514,6 +514,10 @@
 This means to guarantee valid names and perhaps to canonicalize
 certain patterns.
 
+FILENAME should be an absolute file name since the conversion rules
+sometimes vary depending on the position in the file name.  E.g. c:/foo
+is a valid DOS file name, but c:/bar/c:/foo is not.
+
 This function's standard definition is trivial; it just returns
 the argument.  However, on Windows and DOS, replace invalid
 characters.  On DOS, make sure to obey the 8.3 limitations.  On
--- a/lisp/filesets.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/filesets.el	Fri Jun 03 05:49:26 2005 +0000
@@ -132,7 +132,8 @@
 
 (defvar filesets-menu-ensure-use-cached
   (and filesets-running-xemacs
-       (not (emacs-version>= 21 5)))
+       (if (fboundp 'emacs-version>=)
+	   (not (emacs-version>= 21 5))))
   "Make sure (X)Emacs uses filesets' cache.
 
 Well, if you use XEmacs (prior to 21.5?) custom.el is loaded after
--- a/lisp/font-lock.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/font-lock.el	Fri Jun 03 05:49:26 2005 +0000
@@ -1351,7 +1351,7 @@
 				    comment-start-skip))
 		    (put-text-property beg (match-end 0) 'face
 				       font-lock-comment-delimiter-face)))
-	      (if (looking-back comment-end-regexp (point-at-bol))
+	      (if (looking-back comment-end-regexp (point-at-bol) t)
 		  (put-text-property (match-beginning 0) (point) 'face
 				     font-lock-comment-delimiter-face))))
 	  (< (point) end))
--- a/lisp/gnus/ChangeLog	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/gnus/ChangeLog	Fri Jun 03 05:49:26 2005 +0000
@@ -1,3 +1,146 @@
+2005-06-02  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+	* pop3.el (pop3-md5): Run md5 in the binary mode.
+	(pop3-md5-program-args): New variable.
+
+	* starttls.el (starttls-set-process-query-on-exit-flag): Use
+	eval-and-compile.
+
+2005-05-31  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+	* gnus-art.el (article-display-x-face): Replace
+	process-kill-without-query by gnus-set-process-query-on-exit-flag.
+
+	* gnus-group.el: Bind gnus-cache-active-hashtb when compiling.
+
+	* gnus-util.el (gnus-set-process-query-on-exit-flag): Alias to
+	set-process-query-on-exit-flag or process-kill-without-query.
+
+	* html2text.el (html2text-fix-paragraphs): Use `while - re-search'
+	loop instead of replace-regexp.
+
+	* imap.el (imap-ssl-open): Use set-process-query-on-exit-flag
+	instead of process-kill-without-query if it is available.
+
+	* mm-util.el (mm-insert-file-contents): Bind find-file-hook
+	instead of find-file-hooks if it is available.
+
+	* mml1991.el: Bind pgg-default-user-id when compiling.
+
+	* mml2015.el: Bind pgg-default-user-id when compiling.
+
+	* nndraft.el (nndraft-request-associate-buffer): Use
+	write-contents-functions instead of write-contents-hooks if it is
+	available.
+
+	* nnheader.el (nnheader-find-file-noselect): Bind find-file-hook
+	instead of find-file-hooks if it is available.
+
+	* nntp.el (nntp-open-connection): Replace
+	process-kill-without-query by gnus-set-process-query-on-exit-flag.
+	(nntp-open-ssl-stream): Ditto.
+	(nntp-open-tls-stream): Ditto.
+
+	* pgg.el: Don't bind itimer vars; don't autoload itimer functions.
+	(pgg-run-at-time-1): New macro.
+	(pgg-run-at-time): Use it.
+
+	* starttls.el (starttls-set-process-query-on-exit-flag): Alias to
+	set-process-query-on-exit-flag or process-kill-without-query.
+	(starttls-open-stream-gnutls): Use it instead of
+	process-kill-without-query.
+	(starttls-open-stream): Ditto.
+
+2005-05-31  Simon Josefsson  <jas@extundo.com>
+
+	* imap.el (imap-ssl-open): Use imap-process-connection-type,
+	instead of hard coding to nil.
+
+2005-05-31  Kevin Greiner  <kgreiner@xpediantsolutions.com>
+
+	* gnus-group.el (): Require gnus-sum and autoload functions to
+	resolve warnings when gnus-group.el compiled alone.
+
+2005-05-30  Reiner Steib  <Reiner.Steib@gmx.de>
+
+	* gnus-agent.el (gnus-agent-regenerate-group)
+	(gnus-agent-fetch-articles): Replace `string-to-int' by
+	`string-to-number'.
+	* gnus-art.el (gnus-button-fetch-group): Ditto.
+	* gnus-cache.el (gnus-cache-generate-active)
+	(gnus-cache-articles-in-group): Ditto.
+	* gnus-group.el (gnus-group-set-current-level)
+	(gnus-group-insert-group-line): Ditto.
+	* gnus-score.el (gnus-score-set-expunge-below)
+	(gnus-score-set-mark-below, gnus-summary-score-effect)
+	(gnus-summary-score-entry): Ditto.
+	* gnus-soup.el (gnus-soup-send-packet, gnus-soup-parse-areas)
+	(gnus-soup-pack): Ditto.
+	* gnus-spec.el (gnus-xmas-format): Ditto.
+	* gnus-start.el (gnus-newsrc-to-gnus-format): Ditto.
+	* gnus-sum.el (gnus-create-xref-hashtb): Ditto.
+	* gnus-uu.el (gnus-uu-expand-numbers): Ditto.
+	* nnbabyl.el (nnbabyl-article-group-number): Ditto.
+	* nndb.el (nndb-get-remote-expire-response): Ditto.
+	* nndiary.el (nndiary-parse-schedule-value)
+	(nndiary-string-to-number, nndiary-request-replace-article)
+	(nndiary-request-article): Ditto.
+	* nndoc.el (nndoc-rnews-body-end, nndoc-mbox-body-end): Ditto.
+	* nndraft.el (nndraft-articles, nndraft-request-group): Ditto.
+	* nneething.el (nneething-make-head): Ditto.
+	* nnfolder.el (nnfolder-request-article)
+	(nnfolder-retrieve-headers): Ditto.
+	* nnheader.el (nnheader-file-to-number): Ditto.
+	* nnkiboze.el (nnkiboze-request-article): Ditto.
+	* nnmail.el (nnmail-process-unix-mail-format)
+	(nnmail-process-babyl-mail-format): Ditto.
+	* nnmbox.el (nnmbox-read-mbox, nnmbox-article-group-number): Ditto.
+	* nnmh.el (nnmh-update-gnus-unreads, nnmh-active-number)
+	(nnmh-request-create-group, nnmh-request-list-1)
+	(nnmh-request-group, nnmh-request-article): Ditto.
+	* nnml.el (nnml-request-replace-article, nnml-request-article): Ditto.
+	* nnrss.el (nnrss-find-rss-via-syndic8): Ditto.
+	* nnsoup.el (nnsoup-make-active): Ditto.
+	* nnspool.el (nnspool-find-id, nnspool-request-group): Ditto.
+	* nntp.el (nntp-find-group-and-number)
+	(nntp-retrieve-headers-with-xover): Ditto.
+	* pgg-gpg.el (pgg-gpg-snarf-keys-region): Ditto.
+	* pgg-parse.el (pgg-read-body, pgg-read-bytes)
+	(pgg-format-key-identifier): Ditto.
+	* pop3.el (pop3-last, pop3-stat): Ditto.
+	* qp.el (quoted-printable-decode-region): Ditto.
+
+	* spam-report.el (spam-report-url-ping-mm-url): Use format instead
+	of concat.
+
+2005-05-30  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+	* gnus-agent.el (gnus-category-mode): Use gnus-run-mode-hooks.
+
+	* gnus-art.el (gnus-article-mode): Use gnus-run-mode-hooks.
+
+	* gnus-cus.el (gnus-custom-mode): Use gnus-run-mode-hooks.
+
+	* gnus-eform.el (gnus-edit-form-mode): Use gnus-run-mode-hooks.
+
+	* gnus-group.el (gnus-group-mode): Use gnus-run-mode-hooks.
+
+	* gnus-kill.el (gnus-kill-file-mode): Use gnus-run-mode-hooks.
+
+	* gnus-salt.el (gnus-tree-mode): Use gnus-run-mode-hooks.
+	(gnus-carpal-mode): Ditto.
+
+	* gnus-srvr.el (gnus-server-mode): Use gnus-run-mode-hooks.
+	(gnus-browse-mode): Ditto.
+
+	* gnus-sum.el (gnus-summary-mode): Use gnus-run-mode-hooks.
+
+	* gnus-util.el (gnus-run-mode-hooks): Save current buffer.
+
+2005-05-29  Richard M. Stallman  <rms@gnu.org>
+
+	* gnus-cite.el (gnus-cite-add-face): Set overlay's evaporate property.
+
 2005-05-27  Katsumi Yamaoka  <yamaoka@jpl.org>
 
 	* gnus-util.el (gnus-run-mode-hooks): New function.
--- a/lisp/gnus/gnus-agent.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/gnus/gnus-agent.el	Fri Jun 03 05:49:26 2005 +0000
@@ -1540,7 +1540,7 @@
                           (while (looking-at "\\([^: \n]+\\):\\([0-9]+\\) *")
                             (push (cons (buffer-substring (match-beginning 1)
                                                           (match-end 1))
-                                        (string-to-int
+                                        (string-to-number
 					 (buffer-substring (match-beginning 2)
 							   (match-end 2))))
                                   crosses)
@@ -2552,7 +2552,7 @@
   (buffer-disable-undo)
   (setq truncate-lines t)
   (setq buffer-read-only t)
-  (gnus-run-hooks 'gnus-category-mode-hook))
+  (gnus-run-mode-hooks 'gnus-category-mode-hook))
 
 (defalias 'gnus-category-position-point 'gnus-goto-colon)
 
@@ -3703,7 +3703,7 @@
              (dir (file-name-directory file))
              point
              (downloaded (if (file-exists-p dir)
-                             (sort (mapcar (lambda (name) (string-to-int name))
+                             (sort (mapcar (lambda (name) (string-to-number name))
                                            (directory-files dir nil "^[0-9]+$" t))
                                    '>)
                            (progn (gnus-make-directory dir) nil)))
--- a/lisp/gnus/gnus-art.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/gnus/gnus-art.el	Fri Jun 03 05:49:26 2005 +0000
@@ -2181,10 +2181,11 @@
 		   ;; The command is a string, so we interpret the command
 		   ;; as a, well, command, and fork it off.
 		   (let ((process-connection-type nil))
-		     (process-kill-without-query
+		     (gnus-set-process-query-on-exit-flag
 		      (start-process
 		       "article-x-face" nil shell-file-name
-		       shell-command-switch gnus-article-x-face-command))
+		       shell-command-switch gnus-article-x-face-command)
+		      nil)
 		     (with-temp-buffer
 		       (insert face)
 		       (process-send-region "article-x-face"
@@ -3742,7 +3743,7 @@
   (setq buffer-read-only t)
   (set-syntax-table gnus-article-mode-syntax-table)
   (mm-enable-multibyte)
-  (gnus-run-hooks 'gnus-article-mode-hook))
+  (gnus-run-mode-hooks 'gnus-article-mode-hook))
 
 (defun gnus-article-setup-buffer ()
   "Initialize the article buffer."
@@ -6787,7 +6788,7 @@
 				     (match-string 3 address)
 				   "nntp")))
        nil nil nil
-       (and (match-end 6) (list (string-to-int (match-string 6 address))))))))
+       (and (match-end 6) (list (string-to-number (match-string 6 address))))))))
 
 (defun gnus-url-parse-query-string (query &optional downcase)
   (let (retval pairs cur key val)
--- a/lisp/gnus/gnus-cache.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/gnus/gnus-cache.el	Fri Jun 03 05:49:26 2005 +0000
@@ -487,7 +487,7 @@
 	articles)
     (when (file-exists-p dir)
       (setq articles
-	    (sort (mapcar (lambda (name) (string-to-int name))
+	    (sort (mapcar (lambda (name) (string-to-number name))
 			  (directory-files dir nil "^[0-9]+$" t))
 		  '<))
       ;; Update the cache active file, just to synch more.
@@ -681,7 +681,7 @@
     ;; Separate articles from all other files and directories.
     (while files
       (if (string-match "^[0-9]+$" (file-name-nondirectory (car files)))
-	  (push (string-to-int (file-name-nondirectory (pop files))) nums)
+	  (push (string-to-number (file-name-nondirectory (pop files))) nums)
 	(push (pop files) alphs)))
     ;; If we have nums, then this is probably a valid group.
     (when (setq nums (sort nums '<))
--- a/lisp/gnus/gnus-cite.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/gnus/gnus-cite.el	Fri Jun 03 05:49:26 2005 +0000
@@ -1017,6 +1017,7 @@
 	(when (< from to)
 	  (push (setq overlay (gnus-make-overlay from to))
 		gnus-cite-overlay-list)
+	  (gnus-overlay-put overlay 'evaporate t)
 	  (gnus-overlay-put overlay 'face face))))))
 
 (defun gnus-cite-toggle (prefix)
--- a/lisp/gnus/gnus-cus.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/gnus/gnus-cus.el	Fri Jun 03 05:49:26 2005 +0000
@@ -1,6 +1,6 @@
 ;;; gnus-cus.el --- customization commands for Gnus
 ;;
-;; Copyright (C) 1996, 1999, 2000, 2001, 2002, 2003, 2004
+;; Copyright (C) 1996, 1999, 2000, 2001, 2002, 2003, 2004, 2005
 ;;        Free Software Foundation, Inc.
 
 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
@@ -67,7 +67,7 @@
     (set (make-local-variable 'widget-push-button-suffix) "")
     (set (make-local-variable 'widget-link-prefix) "")
     (set (make-local-variable 'widget-link-suffix) ""))
-  (gnus-run-hooks 'gnus-custom-mode-hook))
+  (gnus-run-mode-hooks 'gnus-custom-mode-hook))
 
 ;;; Group Customization:
 
--- a/lisp/gnus/gnus-eform.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/gnus/gnus-eform.el	Fri Jun 03 05:49:26 2005 +0000
@@ -1,5 +1,5 @@
 ;;; gnus-eform.el --- a mode for editing forms for Gnus
-;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2004
+;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2004, 2005
 ;;        Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
@@ -83,7 +83,7 @@
   (use-local-map gnus-edit-form-mode-map)
   (make-local-variable 'gnus-edit-form-done-function)
   (make-local-variable 'gnus-prev-winconf)
-  (gnus-run-hooks 'gnus-edit-form-mode-hook))
+  (gnus-run-mode-hooks 'gnus-edit-form-mode-hook))
 
 (defun gnus-edit-form (form documentation exit-func)
   "Edit FORM in a new buffer.
--- a/lisp/gnus/gnus-group.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/gnus/gnus-group.el	Fri Jun 03 05:49:26 2005 +0000
@@ -1,5 +1,5 @@
 ;;; gnus-group.el --- group mode commands for Gnus
-;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
+;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
 ;;        Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
@@ -41,7 +41,11 @@
 (require 'time-date)
 (require 'gnus-ems)
 
-(eval-when-compile (require 'mm-url))
+(eval-when-compile
+  (require 'mm-url)
+  (let ((features (cons 'gnus-group features)))
+    (require 'gnus-sum))
+  (defvar gnus-cache-active-hashtb))
 
 (defcustom gnus-group-archive-directory
   "/ftp@ftp.hpc.uh.edu:/pub/emacs/ding-list/"
@@ -1042,7 +1046,7 @@
     (gnus-undo-mode 1))
   (when gnus-slave
     (gnus-slave-mode))
-  (gnus-run-hooks 'gnus-group-mode-hook))
+  (gnus-run-mode-hooks 'gnus-group-mode-hook))
 
 (defun gnus-update-group-mark-positions ()
   (save-excursion
@@ -1452,7 +1456,7 @@
 	 (eval gnus-group-line-format-spec)))
      `(gnus-group ,(gnus-intern-safe gnus-tmp-group gnus-active-hashtb)
 		  gnus-unread ,(if (numberp number)
-				   (string-to-int gnus-tmp-number-of-unread)
+				   (string-to-number gnus-tmp-number-of-unread)
 				 t)
 		  gnus-marked ,gnus-tmp-marked-mark
 		  gnus-indentation ,gnus-group-indentation
@@ -3246,7 +3250,7 @@
     (progn
       (unless (gnus-group-process-prefix current-prefix-arg)
 	(error "No group on the current line"))
-      (string-to-int
+      (string-to-number
        (let ((s (read-string
 		 (format "Level (default %s): "
 			 (or (gnus-group-group-level)
--- a/lisp/gnus/gnus-kill.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/gnus/gnus-kill.el	Fri Jun 03 05:49:26 2005 +0000
@@ -1,5 +1,5 @@
 ;;; gnus-kill.el --- kill commands for Gnus
-;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2003
+;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005
 ;;        Free Software Foundation, Inc.
 
 ;; Author: Masanobu UMEDA <umerin@flab.flab.fujitsu.junet>
@@ -161,7 +161,7 @@
   (setq major-mode 'gnus-kill-file-mode)
   (setq mode-name "Kill")
   (lisp-mode-variables nil)
-  (gnus-run-hooks 'emacs-lisp-mode-hook 'gnus-kill-file-mode-hook))
+  (gnus-run-mode-hooks 'emacs-lisp-mode-hook 'gnus-kill-file-mode-hook))
 
 (defun gnus-kill-file-edit-file (newsgroup)
   "Begin editing a kill file for NEWSGROUP.
--- a/lisp/gnus/gnus-salt.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/gnus/gnus-salt.el	Fri Jun 03 05:49:26 2005 +0000
@@ -1,6 +1,6 @@
 ;;; gnus-salt.el --- alternate summary mode interfaces for Gnus
 
-;; Copyright (C) 1996, 1997, 1998, 1999, 2001
+;; Copyright (C) 1996, 1997, 1998, 1999, 2001, 2002, 2004, 2005
 ;;        Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
@@ -496,7 +496,7 @@
     (gnus-set-work-buffer)
     (gnus-tree-node-insert (make-mail-header "") nil)
     (setq gnus-tree-node-length (1- (point))))
-  (gnus-run-hooks 'gnus-tree-mode-hook))
+  (gnus-run-mode-hooks 'gnus-tree-mode-hook))
 
 (defun gnus-tree-read-summary-keys (&optional arg)
   "Read a summary buffer key sequence and execute it."
@@ -1009,7 +1009,7 @@
   (buffer-disable-undo)
   (setq buffer-read-only t)
   (make-local-variable 'gnus-carpal-attached-buffer)
-  (gnus-run-hooks 'gnus-carpal-mode-hook))
+  (gnus-run-mode-hooks 'gnus-carpal-mode-hook))
 
 (defun gnus-carpal-setup-buffer (type)
   (let ((buffer (symbol-value (intern (format "gnus-carpal-%s-buffer" type)))))
--- a/lisp/gnus/gnus-score.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/gnus/gnus-score.el	Fri Jun 03 05:49:26 2005 +0000
@@ -826,7 +826,7 @@
     ;; If this is an integer comparison, we transform from string to int.
     (if (eq (nth 2 (assoc header gnus-header-index)) 'gnus-score-integer)
 	(if (stringp match)
-	    (setq match (string-to-int match)))
+	    (setq match (string-to-number match)))
       (set-text-properties 0 (length match) nil match))
 
     (unless (eq date 'now)
@@ -891,7 +891,7 @@
 				      t)
 		     (read-string "Match: ")
 		     (if (y-or-n-p "Use regexp match? ") 'r 's)
-		     (string-to-int (read-string "Score: "))))
+		     (string-to-number (read-string "Score: "))))
   (save-excursion
     (unless (and (stringp match) (> (length match) 0))
       (error "No match"))
@@ -945,7 +945,7 @@
   "Automatically mark articles with score below SCORE as read."
   (interactive
    (list (or (and current-prefix-arg (prefix-numeric-value current-prefix-arg))
-	     (string-to-int (read-string "Mark below: ")))))
+	     (string-to-number (read-string "Mark below: ")))))
   (setq score (or score gnus-summary-default-score 0))
   (gnus-score-set 'mark (list score))
   (gnus-score-set 'touched '(t))
@@ -979,7 +979,7 @@
   "Automatically expunge articles with score below SCORE."
   (interactive
    (list (or (and current-prefix-arg (prefix-numeric-value current-prefix-arg))
-	     (string-to-int (read-string "Set expunge below: ")))))
+	     (string-to-number (read-string "Set expunge below: ")))))
   (setq score (or score gnus-summary-default-score 0))
   (gnus-score-set 'expunge (list score))
   (gnus-score-set 'touched '(t)))
--- a/lisp/gnus/gnus-soup.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/gnus/gnus-soup.el	Fri Jun 03 05:49:26 2005 +0000
@@ -349,9 +349,9 @@
 	 (packer (if (< (string-match "%s" packer)
 			(string-match "%d" packer))
 		     (format packer files
-			     (string-to-int (gnus-soup-unique-prefix dir)))
+			     (string-to-number (gnus-soup-unique-prefix dir)))
 		   (format packer
-			   (string-to-int (gnus-soup-unique-prefix dir))
+			   (string-to-number (gnus-soup-unique-prefix dir))
 			   files)))
 	 (dir (expand-file-name dir)))
     (gnus-make-directory dir)
@@ -385,7 +385,7 @@
 			(and (eq (preceding-char) ?\t)
 			     (gnus-soup-field))
 			(and (eq (preceding-char) ?\t)
-			     (string-to-int (gnus-soup-field))))
+			     (string-to-number (gnus-soup-field))))
 		areas)
 	  (when (eq (preceding-char) ?\t)
 	    (beginning-of-line 2)))
@@ -535,7 +535,7 @@
 		(error "Bad header"))
 	      (forward-line 1)
 	      (setq beg (point)
-		    end (+ (point) (string-to-int
+		    end (+ (point) (string-to-number
 				    (buffer-substring
 				     (match-beginning 1) (match-end 1)))))
 	      (switch-to-buffer tmp-buf)
--- a/lisp/gnus/gnus-spec.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/gnus/gnus-spec.el	Fri Jun 03 05:49:26 2005 +0000
@@ -509,7 +509,7 @@
 	 (t
 	  (if (null args)
 	      (error 'wrong-number-of-arguments #'my-format n fstring))
-	  (let* ((minlen (string-to-int (or (match-string 2) "")))
+	  (let* ((minlen (string-to-number (or (match-string 2) "")))
 		 (arg (car args))
 		 (str (if (stringp arg) arg (format "%s" arg)))
 		 (lpad (null (match-string 1)))
--- a/lisp/gnus/gnus-srvr.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/gnus/gnus-srvr.el	Fri Jun 03 05:49:26 2005 +0000
@@ -1,5 +1,6 @@
 ;;; gnus-srvr.el --- virtual server support for Gnus
-;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
+;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
+;; 2004, 2005
 ;;        Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
@@ -269,7 +270,7 @@
       (put 'gnus-server-mode 'font-lock-defaults '(gnus-server-font-lock-keywords t))
     (set (make-local-variable 'font-lock-defaults)
 	 '(gnus-server-font-lock-keywords t)))
-  (gnus-run-hooks 'gnus-server-mode-hook))
+  (gnus-run-mode-hooks 'gnus-server-mode-hook))
 
 (defun gnus-server-insert-server-line (gnus-tmp-name method)
   (let* ((gnus-tmp-how (car method))
@@ -849,7 +850,7 @@
   (setq truncate-lines t)
   (gnus-set-default-directory)
   (setq buffer-read-only t)
-  (gnus-run-hooks 'gnus-browse-mode-hook))
+  (gnus-run-mode-hooks 'gnus-browse-mode-hook))
 
 (defun gnus-browse-read-group (&optional no-article number)
   "Enter the group at the current line.
--- a/lisp/gnus/gnus-start.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/gnus/gnus-start.el	Fri Jun 03 05:49:26 2005 +0000
@@ -2517,7 +2517,7 @@
 	    (cond
 	     ((looking-at "[0-9]+")
 	      ;; We narrow and read a number instead of buffer-substring/
-	      ;; string-to-int because it's faster.  narrow/widen is
+	      ;; string-to-number because it's faster.  narrow/widen is
 	      ;; faster than save-restriction/narrow, and save-restriction
 	      ;; produces a garbage object.
 	      (setq num1 (progn
--- a/lisp/gnus/gnus-sum.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/gnus/gnus-sum.el	Fri Jun 03 05:49:26 2005 +0000
@@ -2722,7 +2722,7 @@
   (make-local-variable 'gnus-summary-mark-positions)
   (gnus-make-local-hook 'pre-command-hook)
   (add-hook 'pre-command-hook 'gnus-set-global-variables nil t)
-  (gnus-run-hooks 'gnus-summary-mode-hook)
+  (gnus-run-mode-hooks 'gnus-summary-mode-hook)
   (turn-on-gnus-mailing-list-mode)
   (mm-enable-multibyte)
   (gnus-update-format-specifications nil 'summary 'summary-mode 'summary-dummy)
@@ -5660,7 +5660,7 @@
 						    (match-end 1)))
 			(substring xrefs (match-beginning 1) (match-end 1))))
 	  (setq number
-		(string-to-int (substring xrefs (match-beginning 2)
+		(string-to-number (substring xrefs (match-beginning 2)
 					  (match-end 2))))
 	  (if (setq entry (gnus-gethash group xref-hashtb))
 	      (setcdr entry (cons number (cdr entry)))
--- a/lisp/gnus/gnus-util.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/gnus/gnus-util.el	Fri Jun 03 05:49:26 2005 +0000
@@ -1016,10 +1016,11 @@
     (apply 'run-hooks funcs)))
 
 (defun gnus-run-mode-hooks (&rest funcs)
-  "Run `run-mode-hooks' if it is available.  Otherwise run `run-hooks'."
+  "Run `run-mode-hooks' if it is available, otherwise `run-hooks'.
+This function saves the current buffer."
   (if (fboundp 'run-mode-hooks)
-      (apply 'run-mode-hooks funcs)
-    (apply 'run-hooks funcs)))
+      (save-current-buffer (apply 'run-mode-hooks funcs))
+    (save-current-buffer (apply 'run-hooks funcs))))
 
 ;;; Various
 
@@ -1570,6 +1571,11 @@
 			 (file-truename
 			  (concat old-dir "..")))))))))
 
+(if (fboundp 'set-process-query-on-exit-flag)
+    (defalias 'gnus-set-process-query-on-exit-flag
+      'set-process-query-on-exit-flag)
+  (defalias 'gnus-set-process-query-on-exit-flag
+    'process-kill-without-query))
 
 (provide 'gnus-util)
 
--- a/lisp/gnus/gnus-uu.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/gnus/gnus-uu.el	Fri Jun 03 05:49:26 2005 +0000
@@ -1185,7 +1185,7 @@
 	  (ignore-errors
 	    (replace-match
 	     (format "%06d"
-		     (string-to-int (buffer-substring
+		     (string-to-number (buffer-substring
 				     (match-beginning 0) (match-end 0)))))))
 	(setq string (buffer-substring 1 (point-max)))
 	(setcar (car string-list) string)
--- a/lisp/gnus/html2text.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/gnus/html2text.el	Fri Jun 03 05:49:26 2005 +0000
@@ -1,5 +1,5 @@
 ;;; html2text.el --- a simple html to plain text converter
-;; Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+;; Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
 
 ;; Author: Joakim Hove <hove@phys.ntnu.no>
 
@@ -374,7 +374,8 @@
 fashion, quite close to pure guess-work. It does work in some cases though."
   (interactive)
   (goto-char (point-min))
-  (replace-regexp "^<br>$" "")
+  (while (re-search-forward "^<br>$" nil t)
+    (delete-region (match-beginning 0) (match-end 0)))
   ;; Removing lonely <br> on a single line, if they are left intact we
   ;; dont have any paragraphs at all.
   (goto-char (point-min))
--- a/lisp/gnus/imap.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/gnus/imap.el	Fri Jun 03 05:49:26 2005 +0000
@@ -640,7 +640,11 @@
       (let* ((port (or port imap-default-ssl-port))
 	     (coding-system-for-read imap-coding-system-for-read)
 	     (coding-system-for-write imap-coding-system-for-write)
-	     (process-connection-type nil)
+	     (process-connection-type imap-process-connection-type)
+	     (set-process-query-on-exit-flag
+	      (if (fboundp 'set-process-query-on-exit-flag)
+		  'set-process-query-on-exit-flag
+		'process-kill-without-query))
 	     process)
 	(when (progn
 		(setq process (start-process
@@ -650,7 +654,7 @@
 					    (format-spec-make
 					     ?s server
 					     ?p (number-to-string port)))))
-		(process-kill-without-query process)
+		(funcall set-process-query-on-exit-flag process nil)
 		process)
 	  (with-current-buffer buffer
 	    (goto-char (point-min))
--- a/lisp/gnus/mm-util.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/gnus/mm-util.el	Fri Jun 03 05:49:26 2005 +0000
@@ -889,22 +889,28 @@
 `find-file-hooks', etc.
 If INHIBIT is non-nil, inhibit `mm-inhibit-file-name-handlers'.
   This function ensures that none of these modifications will take place."
-  (let ((format-alist nil)
-	(auto-mode-alist (if inhibit nil (mm-auto-mode-alist)))
-	(default-major-mode 'fundamental-mode)
-	(enable-local-variables nil)
-	(after-insert-file-functions nil)
-	(enable-local-eval nil)
-	(find-file-hooks nil)
-	(inhibit-file-name-operation (if inhibit
-					 'insert-file-contents
-				       inhibit-file-name-operation))
-	(inhibit-file-name-handlers
-	 (if inhibit
-	     (append mm-inhibit-file-name-handlers
-		     inhibit-file-name-handlers)
-	   inhibit-file-name-handlers)))
-    (insert-file-contents filename visit beg end replace)))
+  (let* ((format-alist nil)
+	 (auto-mode-alist (if inhibit nil (mm-auto-mode-alist)))
+	 (default-major-mode 'fundamental-mode)
+	 (enable-local-variables nil)
+	 (after-insert-file-functions nil)
+	 (enable-local-eval nil)
+	 (inhibit-file-name-operation (if inhibit
+					  'insert-file-contents
+					inhibit-file-name-operation))
+	 (inhibit-file-name-handlers
+	  (if inhibit
+	      (append mm-inhibit-file-name-handlers
+		      inhibit-file-name-handlers)
+	    inhibit-file-name-handlers))
+	 (ffh (if (boundp 'find-file-hook)
+		  'find-file-hook
+		'find-file-hooks))
+	 (val (symbol-value ffh)))
+    (set ffh nil)
+    (unwind-protect
+	(insert-file-contents filename visit beg end replace)
+      (set ffh val))))
 
 (defun mm-append-to-file (start end filename &optional codesys inhibit)
   "Append the contents of the region to the end of file FILENAME.
--- a/lisp/gnus/mml1991.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/gnus/mml1991.el	Fri Jun 03 05:49:26 2005 +0000
@@ -1,5 +1,6 @@
 ;;; mml1991.el --- Old PGP message format (RFC 1991) support for MML
-;; Copyright (C) 1998, 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
+;; Copyright (C) 1998, 1999, 2000, 2001, 2003, 2005
+;;        Free Software Foundation, Inc.
 
 ;; Author: Sascha Lüdecke <sascha@meta-x.de>,
 ;;	Simon Josefsson <simon@josefsson.org> (Mailcrypt interface, Gnus glue)
@@ -219,8 +220,10 @@
 
 ;; pgg wrapper
 
-(defvar pgg-output-buffer)
-(defvar pgg-errors-buffer)
+(eval-when-compile
+  (defvar pgg-default-user-id)
+  (defvar pgg-errors-buffer)
+  (defvar pgg-output-buffer))
 
 (defun mml1991-pgg-sign (cont)
   (let (headers cte)
--- a/lisp/gnus/mml2015.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/gnus/mml2015.el	Fri Jun 03 05:49:26 2005 +0000
@@ -1,5 +1,6 @@
 ;;; mml2015.el --- MIME Security with Pretty Good Privacy (PGP)
-;; Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+;; Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005
+;;        Free Software Foundation, Inc.
 
 ;; Author: Shenghuo Zhu <zsh@cs.rochester.edu>
 ;; Keywords: PGP MIME MML
@@ -632,6 +633,7 @@
 ;;; pgg wrapper
 
 (eval-when-compile
+  (defvar pgg-default-user-id)
   (defvar pgg-errors-buffer)
   (defvar pgg-output-buffer))
 
--- a/lisp/gnus/nnbabyl.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/gnus/nnbabyl.el	Fri Jun 03 05:49:26 2005 +0000
@@ -493,7 +493,7 @@
     (when (re-search-forward "^X-Gnus-Newsgroup: +\\([^:]+\\):\\([0-9]+\\) "
 			     nil t)
       (cons (buffer-substring (match-beginning 1) (match-end 1))
-	    (string-to-int
+	    (string-to-number
 	     (buffer-substring (match-beginning 2) (match-end 2)))))))
 
 (defun nnbabyl-insert-lines ()
--- a/lisp/gnus/nndb.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/gnus/nndb.el	Fri Jun 03 05:49:26 2005 +0000
@@ -196,7 +196,7 @@
       ;; otherwise, pull all of the following numbers into the list
       (re-search-forward "follows\r?\n?" nil t)
       (while (re-search-forward "^[0-9]+$" nil t)
-      (push (string-to-int (match-string 0)) list)))
+      (push (string-to-number (match-string 0)) list)))
     list))
 
 (defun nndb-request-expire-articles-remote
--- a/lisp/gnus/nndiary.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/gnus/nndiary.el	Fri Jun 03 05:49:26 2005 +0000
@@ -601,7 +601,7 @@
       (nnheader-report 'nndiary "Article %s retrieved" id)
       ;; We return the article number.
       (cons (if group-num (car group-num) group)
-	    (string-to-int (file-name-nondirectory path)))))))
+	    (string-to-number (file-name-nondirectory path)))))))
 
 (deffoo nndiary-request-group (group &optional server dont-check)
   (let ((file-name-coding-system nnmail-pathname-coding-system))
@@ -820,7 +820,7 @@
 	    ;; we should insert it.  (This situation should never
 	    ;; occur, but one likes to make sure...)
 	    (while (and (looking-at "[0-9]+\t")
-			(< (string-to-int
+			(< (string-to-number
 			    (buffer-substring
 			     (match-beginning 0) (match-end 0)))
 			   article)
@@ -1281,14 +1281,14 @@
 	  (nnheader-article-to-file-alist nndiary-current-directory))))
 
 
-(defun nndiary-string-to-int (str min &optional max)
-  ;; Like `string-to-int' but barf if STR is not exactly an integer, and not
+(defun nndiary-string-to-number (str min &optional max)
+  ;; Like `string-to-number' but barf if STR is not exactly an integer, and not
   ;; within the specified bounds.
   ;; Signals are caught by `nndiary-schedule'.
   (if (not (string-match "^[ \t]*[0-9]+[ \t]*$" str))
       (nndiary-error "not an integer value")
     ;; else
-    (let ((val (string-to-int str)))
+    (let ((val (string-to-number str)))
       (and (or (< val min)
 	       (and max (> val max)))
 	   (nndiary-error "value out of range"))
@@ -1315,12 +1315,12 @@
 	 (let ((res (split-string val "-")))
 	   (cond
 	    ((= (length res) 1)
-	     (nndiary-string-to-int (car res) min-or-values max))
+	     (nndiary-string-to-number (car res) min-or-values max))
 	    ((= (length res) 2)
 	     ;; don't know if crontab accepts this, but ensure
 	     ;; that BEG is <= END
-	     (let ((beg (nndiary-string-to-int (car res) min-or-values max))
-		   (end (nndiary-string-to-int (cadr res) min-or-values max)))
+	     (let ((beg (nndiary-string-to-number (car res) min-or-values max))
+		   (end (nndiary-string-to-number (cadr res) min-or-values max)))
 	       (cond ((< beg end)
 		      (cons beg end))
 		     ((= beg end)
--- a/lisp/gnus/nndoc.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/gnus/nndoc.el	Fri Jun 03 05:49:26 2005 +0000
@@ -421,7 +421,7 @@
 	       (search-forward "\n\n" beg t)
 	       (re-search-backward
 		"^Content-Length:[ \t]*\\([0-9]+\\) *$" end t)
-	       (setq len (string-to-int (match-string 1)))
+	       (setq len (string-to-number (match-string 1)))
 	       (search-forward "\n\n" beg t)
 	       (unless (= (setq len (+ (point) len)) (point-max))
 		 (and (< len (point-max))
@@ -444,7 +444,7 @@
 (defun nndoc-rnews-body-end ()
   (and (re-search-backward nndoc-article-begin nil t)
        (forward-line 1)
-       (goto-char (+ (point) (string-to-int (match-string 1))))))
+       (goto-char (+ (point) (string-to-number (match-string 1))))))
 
 (defun nndoc-babyl-type-p ()
   (when (re-search-forward "\^_\^L *\n" nil t)
--- a/lisp/gnus/nndraft.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/gnus/nndraft.el	Fri Jun 03 05:49:26 2005 +0000
@@ -1,6 +1,6 @@
 ;;; nndraft.el --- draft article access for Gnus
 
-;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2003
+;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2005
 ;;        Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
@@ -174,8 +174,11 @@
     (setq buffer-file-name (expand-file-name file)
 	  buffer-auto-save-file-name (make-auto-save-file-name))
     (clear-visited-file-modtime)
-    (make-local-variable 'write-contents-hooks)
-    (push 'nndraft-generate-headers write-contents-hooks)
+    (let ((hook (if (boundp 'write-contents-functions)
+		    'write-contents-functions
+		  'write-contents-hooks)))
+      (gnus-make-local-hook hook)
+      (add-hook hook 'nndraft-generate-headers nil t))
     article))
 
 (deffoo nndraft-request-group (group &optional server dont-check)
@@ -185,7 +188,7 @@
 	   (file-name-coding-system nnmail-pathname-coding-system)
 	   dir file)
       (nnheader-re-read-dir pathname)
-      (setq dir (mapcar (lambda (name) (string-to-int (substring name 1)))
+      (setq dir (mapcar (lambda (name) (string-to-number (substring name 1)))
 			(ignore-errors (directory-files
 					pathname nil "^#[0-9]+#$" t))))
       (dolist (n dir)
@@ -293,7 +296,7 @@
   "Return the list of messages in the group."
   (gnus-make-directory nndraft-current-directory)
   (sort
-   (mapcar 'string-to-int
+   (mapcar 'string-to-number
 	   (directory-files nndraft-current-directory nil "\\`[0-9]+\\'" t))
    '<))
 
--- a/lisp/gnus/nneething.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/gnus/nneething.el	Fri Jun 03 05:49:26 2005 +0000
@@ -329,7 +329,7 @@
 	     (when (re-search-forward "<[a-zA-Z0-9_]@[-a-zA-Z0-9_]>" 1000 t)
 	       (concat "From: " (match-string 0) "\n"))))
 	 (nneething-from-line (nth 2 atts) file))
-     (if (> (string-to-int (int-to-string (nth 7 atts))) 0)
+     (if (> (string-to-number (int-to-string (nth 7 atts))) 0)
 	 (concat "Chars: " (int-to-string (nth 7 atts)) "\n")
        "")
      (if buffer
--- a/lisp/gnus/nnfolder.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/gnus/nnfolder.el	Fri Jun 03 05:49:26 2005 +0000
@@ -200,7 +200,7 @@
 		       ((search-backward (concat "\n" nnfolder-article-marker)
 					 nil t)
 			(goto-char (match-end 0))
-			(setq num (string-to-int
+			(setq num (string-to-number
 				   (buffer-substring
 				    (point) (gnus-point-at-eol))))
 			(goto-char start)
@@ -210,7 +210,7 @@
 		      (search-forward (concat "\n" nnfolder-article-marker)
 				      nil t)
 		      (progn
-			(setq num (string-to-int
+			(setq num (string-to-number
 				   (buffer-substring
 				    (point) (gnus-point-at-eol))))
 			(> num article))
@@ -285,7 +285,7 @@
 	    (cons nnfolder-current-group
 		  (if (search-forward (concat "\n" nnfolder-article-marker)
 				      nil t)
-		      (string-to-int (buffer-substring
+		      (string-to-number (buffer-substring
 				      (point) (gnus-point-at-eol)))
 		    -1))))))))
 
--- a/lisp/gnus/nnheader.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/gnus/nnheader.el	Fri Jun 03 05:49:26 2005 +0000
@@ -1,7 +1,7 @@
 ;;; nnheader.el --- header access macros for Gnus and its backends
 
 ;; Copyright (C) 1987, 1988, 1989, 1990, 1993, 1994, 1995, 1996,
-;;        1997, 1998, 2000, 2001, 2002, 2003, 2004
+;;        1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005
 ;;        Free Software Foundation, Inc.
 
 ;; Author: Masanobu UMEDA <umerin@flab.flab.fujitsu.junet>
@@ -683,9 +683,9 @@
 (defsubst nnheader-file-to-number (file)
   "Take a FILE name and return the article number."
   (if (string= nnheader-numerical-short-files "^[0-9]+$")
-      (string-to-int file)
+      (string-to-number file)
     (string-match nnheader-numerical-short-files file)
-    (string-to-int (match-string 0 file))))
+    (string-to-number (match-string 0 file))))
 
 (defvar nnheader-directory-files-is-safe
   (or (eq system-type 'windows-nt)
@@ -953,15 +953,21 @@
 (defun nnheader-find-file-noselect (&rest args)
   "Open a file with some variables bound.
 See `find-file-noselect' for the arguments."
-  (let ((format-alist nil)
-	(auto-mode-alist (mm-auto-mode-alist))
-	(default-major-mode 'fundamental-mode)
-	(enable-local-variables nil)
-	(after-insert-file-functions nil)
-	(enable-local-eval nil)
-	(find-file-hooks nil)
-	(coding-system-for-read nnheader-file-coding-system))
-    (apply 'find-file-noselect args)))
+  (let* ((format-alist nil)
+	 (auto-mode-alist (mm-auto-mode-alist))
+	 (default-major-mode 'fundamental-mode)
+	 (enable-local-variables nil)
+	 (after-insert-file-functions nil)
+	 (enable-local-eval nil)
+	 (coding-system-for-read nnheader-file-coding-system)
+	 (ffh (if (boundp 'find-file-hook)
+		  'find-file-hook
+		'find-file-hooks))
+	 (val (symbol-value ffh)))
+    (set ffh nil)
+    (unwind-protect
+	(apply 'find-file-noselect args)
+      (set ffh val))))
 
 (defun nnheader-directory-regular-files (dir)
   "Return a list of all regular files in DIR."
--- a/lisp/gnus/nnkiboze.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/gnus/nnkiboze.el	Fri Jun 03 05:49:26 2005 +0000
@@ -106,7 +106,7 @@
 	(error "nnkiboze: No xref"))
       (unless (string-match " \\([^ ]+\\):\\([0-9]+\\)" xref)
 	(error "nnkiboze: Malformed xref"))
-      (setq num (string-to-int (match-string 2 xref))
+      (setq num (string-to-number (match-string 2 xref))
 	    group (match-string 1 xref))
       (or (with-current-buffer buffer
 	    (or (and gnus-use-cache (gnus-cache-request-article num group))
--- a/lisp/gnus/nnmail.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/gnus/nnmail.el	Fri Jun 03 05:49:26 2005 +0000
@@ -769,7 +769,7 @@
       (if (not (save-excursion
 		 (and (re-search-backward
 		       "^Content-Length:[ \t]*\\([0-9]+\\)" start t)
-		      (setq content-length (string-to-int
+		      (setq content-length (string-to-number
 					    (buffer-substring
 					     (match-beginning 1)
 					     (match-end 1))))
@@ -906,7 +906,7 @@
 	(if (not (re-search-forward
 		  "^Content-Length:[ \t]*\\([0-9]+\\)" nil t))
 	    (setq content-length nil)
-	  (setq content-length (string-to-int (match-string 1)))
+	  (setq content-length (string-to-number (match-string 1)))
 	  ;; We destroy the header, since none of the backends ever
 	  ;; use it, and we do not want to confuse other mailers by
 	  ;; having a (possibly) faulty header.
--- a/lisp/gnus/nnmbox.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/gnus/nnmbox.el	Fri Jun 03 05:49:26 2005 +0000
@@ -475,7 +475,7 @@
     (when (re-search-forward "^X-Gnus-Newsgroup: +\\([^:]+\\):\\([0-9]+\\) "
 			     nil t)
       (cons (buffer-substring (match-beginning 1) (match-end 1))
-	    (string-to-int
+	    (string-to-number
 	     (buffer-substring (match-beginning 2) (match-end 2)))))))
 
 (defun nnmbox-in-header-p (pos)
@@ -681,7 +681,7 @@
 		    (let (alist)
 		      (while (re-search-forward " \\([^:]+\\):\\([0-9]+\\)" end-header t)
 			(push (cons (match-string 1)
-				    (string-to-int (match-string 2))) alist))
+				    (string-to-number (match-string 2))) alist))
 		      (nnmbox-insert-newsgroup-line alist))
 		  ;; this is really a new article
 		  (nnmbox-save-mail
--- a/lisp/gnus/nnmh.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/gnus/nnmh.el	Fri Jun 03 05:49:26 2005 +0000
@@ -150,7 +150,7 @@
 	 (file-exists-p file)
 	 (not (file-directory-p file))
 	 (save-excursion (nnmail-find-file file))
-	 (string-to-int (file-name-nondirectory file)))))
+	 (string-to-number (file-name-nondirectory file)))))
 
 (deffoo nnmh-request-group (group &optional server dont-check)
   (nnheader-init-server-buffer)
@@ -176,7 +176,7 @@
 	(nnheader-re-read-dir pathname)
 	(setq dir
 	      (sort
-	       (mapcar (lambda (name) (string-to-int name))
+	       (mapcar (lambda (name) (string-to-number name))
 		       (directory-files pathname nil "^[0-9]+$" t))
 	       '<))
 	(cond
@@ -224,7 +224,7 @@
   ;; For each directory, generate an active file line.
   (unless (string= (expand-file-name nnmh-toplev) dir)
     (let ((files (mapcar
-		  (lambda (name) (string-to-int name))
+		  (lambda (name) (string-to-number name))
 		  (directory-files dir nil "^[0-9]+$" t))))
       (when files
 	(save-excursion
@@ -358,7 +358,7 @@
       (nnmh-possibly-change-directory group server)
       (let ((articles (mapcar
 		       (lambda (file)
-			 (string-to-int file))
+			 (string-to-number file))
 		       (directory-files
 			nnmh-current-directory nil "^[0-9]+$"))))
 	(when articles
@@ -486,7 +486,7 @@
       (let ((files (sort
 		    (mapcar
 		     (lambda (f)
-		       (string-to-int f))
+		       (string-to-number f))
 		     (directory-files dir nil "^[0-9]+$"))
 		    '>)))
 	(when files
@@ -509,7 +509,7 @@
   ;; articles in this folder.  The articles that are "new" will be
   ;; marked as unread by Gnus.
   (let* ((dir nnmh-current-directory)
-	 (files (sort (mapcar (function (lambda (name) (string-to-int name)))
+	 (files (sort (mapcar (function (lambda (name) (string-to-number name)))
 			      (directory-files nnmh-current-directory
 					       nil "^[0-9]+$" t))
 		      '<))
--- a/lisp/gnus/nnml.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/gnus/nnml.el	Fri Jun 03 05:49:26 2005 +0000
@@ -212,7 +212,7 @@
       (nnheader-report 'nnml "Article %s retrieved" id)
       ;; We return the article number.
       (cons (if group-num (car group-num) group)
-	    (string-to-int (file-name-nondirectory path)))))))
+	    (string-to-number (file-name-nondirectory path)))))))
 
 (deffoo nnml-request-group (group &optional server dont-check)
   (let ((file-name-coding-system nnmail-pathname-coding-system))
@@ -426,7 +426,7 @@
 	    ;; we should insert it.  (This situation should never
 	    ;; occur, but one likes to make sure...)
 	    (while (and (looking-at "[0-9]+\t")
-			(< (string-to-int
+			(< (string-to-number
 			    (buffer-substring
 			     (match-beginning 0) (match-end 0)))
 			   article)
--- a/lisp/gnus/nnrss.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/gnus/nnrss.el	Fri Jun 03 05:49:26 2005 +0000
@@ -899,7 +899,7 @@
 		  (selection
 		   (mapcar (lambda (listinfo)
 			     (cons (cdr (assoc "sitename" listinfo))
-				   (string-to-int
+				   (string-to-number
 				    (cdr (assoc "feedid" listinfo)))))
 			   feedinfo)))
 	      (cdr (assoc
--- a/lisp/gnus/nnsoup.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/gnus/nnsoup.el	Fri Jun 03 05:49:26 2005 +0000
@@ -752,9 +752,9 @@
   (let ((files (sort (directory-files nnsoup-directory t "IDX$")
 		     (lambda (f1 f2)
 		       (< (progn (string-match "/\\([0-9]+\\)\\." f1)
-				 (string-to-int (match-string 1 f1)))
+				 (string-to-number (match-string 1 f1)))
 			  (progn (string-match "/\\([0-9]+\\)\\." f2)
-				 (string-to-int (match-string 1 f2)))))))
+				 (string-to-number (match-string 1 f2)))))))
 	active group lines ident elem min)
     (set-buffer (get-buffer-create " *nnsoup work*"))
     (while files
--- a/lisp/gnus/nnspool.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/gnus/nnspool.el	Fri Jun 03 05:49:26 2005 +0000
@@ -248,7 +248,7 @@
 	;; Fix by Sudish Joseph <joseph@cis.ohio-state.edu>
 	(when (setq dir (directory-files pathname nil "^[0-9]+$" t))
 	  (setq dir
-		(sort (mapcar (lambda (name) (string-to-int name)) dir) '<)))
+		(sort (mapcar (lambda (name) (string-to-number name)) dir) '<)))
 	(if dir
 	    (nnheader-insert
 	     "211 %d %d %d %s\n" (length dir) (car dir)
@@ -440,7 +440,7 @@
     (goto-char (point-min))
     (prog1
 	(when (looking-at "<[^>]+>[ \t]+[-0-9~]+[ \t]+\\([^ /\t\n]+\\)/\\([0-9]+\\)[ \t\n]")
-	  (cons (match-string 1) (string-to-int (match-string 2))))
+	  (cons (match-string 1) (string-to-number (match-string 2))))
       (kill-buffer (current-buffer)))))
 
 (defun nnspool-find-file (file)
--- a/lisp/gnus/nntp.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/gnus/nntp.el	Fri Jun 03 05:49:26 2005 +0000
@@ -1128,7 +1128,7 @@
       (nntp-kill-buffer pbuffer))
     (when (and (buffer-name pbuffer)
 	       process)
-      (process-kill-without-query process)
+      (gnus-set-process-query-on-exit-flag process nil)
       (if (and (nntp-wait-for process "^2.*\n" buffer nil t)
 	       (memq (process-status process) '(open run)))
 	  (prog1
@@ -1162,7 +1162,7 @@
 					   (format-spec-make
 					    ?s nntp-address
 					    ?p nntp-port-number)))))
-    (process-kill-without-query proc)
+    (gnus-set-process-query-on-exit-flag proc nil)
     (save-excursion
       (set-buffer buffer)
       (let ((nntp-connection-alist (list proc buffer nil)))
@@ -1173,7 +1173,7 @@
 
 (defun nntp-open-tls-stream (buffer)
   (let ((proc (open-tls-stream "nntpd" buffer nntp-address nntp-port-number)))
-    (process-kill-without-query proc)
+    (gnus-set-process-query-on-exit-flag proc nil)
     (save-excursion
       (set-buffer buffer)
       (let ((nntp-connection-alist (list proc buffer nil)))
@@ -1499,7 +1499,7 @@
         (when (<= count 1)
           (goto-char (point-min))
           (when (re-search-forward "^[0-9][0-9][0-9] .*\n\\([0-9]+\\)" nil t)
-            (let ((low-limit (string-to-int
+            (let ((low-limit (string-to-number
 			      (buffer-substring (match-beginning 1) 
 						(match-end 1)))))
               (while (and articles (<= (car articles) low-limit))
@@ -1571,7 +1571,7 @@
       (goto-char (point-min))
       ;; We first find the number by looking at the status line.
       (let ((number (and (looking-at "2[0-9][0-9] +\\([0-9]+\\) ")
-			 (string-to-int
+			 (string-to-number
 			  (buffer-substring (match-beginning 1)
 					    (match-end 1)))))
 	    newsgroups xref)
@@ -1609,7 +1609,7 @@
 		    "\\([^ :]+\\):\\([0-9]+\\)")
 		  xref))
 	    (setq group (match-string 1 xref)
-		  number (string-to-int (match-string 2 xref))))
+		  number (string-to-number (match-string 2 xref))))
 	   ((and (setq newsgroups
 		       (mail-fetch-field "newsgroups"))
 		 (not (string-match "," newsgroups)))
--- a/lisp/gnus/pgg-gpg.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/gnus/pgg-gpg.el	Fri Jun 03 05:49:26 2005 +0000
@@ -252,7 +252,7 @@
     (when (re-search-forward "^\\[GNUPG:] IMPORT_RES\\>" nil t)
       (setq status (buffer-substring (match-end 0)
 				     (progn (end-of-line)(point)))
-	    status (vconcat (mapcar #'string-to-int (split-string status))))
+	    status (vconcat (mapcar #'string-to-number (split-string status))))
       (erase-buffer)
       (insert (format "Imported %d key(s).
 \tArmor contains %d key(s) [%d bad, %d old].\n"
--- a/lisp/gnus/pgg-parse.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/gnus/pgg-parse.el	Fri Jun 03 05:49:26 2005 +0000
@@ -113,7 +113,7 @@
   `(mapconcat (lambda (c) (format "%02X" (pgg-char-int c)))
 	      ,string "")
   ;; `(upcase (apply #'format "%02x%02x%02x%02x%02x%02x%02x%02x"
-  ;;                 (string-to-int-list ,string)))
+  ;;                 (string-to-number-list ,string)))
   )
 
 (defmacro pgg-parse-time-field (bytes)
@@ -136,7 +136,7 @@
 
 (defmacro pgg-read-bytes (nbytes)
   `(mapcar #'pgg-char-int (pgg-read-bytes-string ,nbytes))
-  ;; `(string-to-int-list (pgg-read-bytes-string ,nbytes))
+  ;; `(string-to-number-list (pgg-read-bytes-string ,nbytes))
   )
 
 (defmacro pgg-read-body-string (ptag)
@@ -146,7 +146,7 @@
 
 (defmacro pgg-read-body (ptag)
   `(mapcar #'pgg-char-int (pgg-read-body-string ,ptag))
-  ;; `(string-to-int-list (pgg-read-body-string ,ptag))
+  ;; `(string-to-number-list (pgg-read-body-string ,ptag))
   )
 
 (defalias 'pgg-skip-bytes 'forward-char)
--- a/lisp/gnus/pgg.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/gnus/pgg.el	Fri Jun 03 05:49:26 2005 +0000
@@ -1,6 +1,6 @@
 ;;; pgg.el --- glue for the various PGP implementations.
 
-;; Copyright (C) 1999, 2000, 2003 Free Software Foundation, Inc.
+;; Copyright (C) 1999, 2000, 2003, 2005 Free Software Foundation, Inc.
 
 ;; Author: Daiki Ueno <ueno@unixuser.org>
 ;; Created: 1999/10/28
@@ -97,82 +97,76 @@
       (read-passwd prompt)))
 
 (eval-when-compile
-  (defvar itimer-process)
-  (defvar itimer-timer)
-  (autoload 'delete-itimer "itimer")
-  (autoload 'itimer-driver-start "itimer")
-  (autoload 'itimer-value "itimer")
-  (autoload 'set-itimer-function "itimer")
-  (autoload 'set-itimer-function-arguments "itimer")
-  (autoload 'set-itimer-restart "itimer")
-  (autoload 'start-itimer "itimer"))
+  (defmacro pgg-run-at-time-1 (time repeat function args)
+    (when (featurep 'xemacs)
+      (if (condition-case nil
+	      (let ((delete-itimer 'delete-itimer)
+		    (itimer-driver-start 'itimer-driver-start)
+		    (itimer-value 'itimer-value)
+		    (start-itimer 'start-itimer))
+		(unless (or (symbol-value 'itimer-process)
+			    (symbol-value 'itimer-timer))
+		  (funcall itimer-driver-start))
+		;; Check whether there is a bug to which the difference of
+		;; the present time and the time when the itimer driver was
+		;; woken up is subtracted from the initial itimer value.
+		(let* ((inhibit-quit t)
+		       (ctime (current-time))
+		       (itimer-timer-last-wakeup
+			(prog1
+			    ctime
+			  (setcar ctime (1- (car ctime)))))
+		       (itimer-list nil)
+		       (itimer (funcall start-itimer "pgg-run-at-time"
+					'ignore 5)))
+		  (sleep-for 0.1) ;; Accept the timeout interrupt.
+		  (prog1
+		      (> (funcall itimer-value itimer) 0)
+		    (funcall delete-itimer itimer))))
+	    (error nil))
+	  `(let ((time ,time))
+	     (apply #'start-itimer "pgg-run-at-time"
+		    ,function (if time (max time 1e-9) 1e-9)
+		    ,repeat nil t ,args)))
+      `(let ((time ,time)
+	     (itimers (list nil)))
+	 (setcar
+	  itimers
+	  (apply #'start-itimer "pgg-run-at-time"
+		 (lambda (itimers repeat function &rest args)
+		   (let ((itimer (car itimers)))
+		     (if repeat
+			 (progn
+			   (set-itimer-function
+			    itimer
+			    (lambda (itimer repeat function &rest args)
+			      (set-itimer-restart itimer repeat)
+			      (set-itimer-function itimer function)
+			      (set-itimer-function-arguments itimer args)
+			      (apply function args)))
+			   (set-itimer-function-arguments
+			    itimer
+			    (append (list itimer repeat function) args)))
+		       (set-itimer-function
+			itimer
+			(lambda (itimer function &rest args)
+			  (delete-itimer itimer)
+			  (apply function args)))
+		       (set-itimer-function-arguments
+			itimer
+			(append (list itimer function) args)))))
+		 1e-9 (if time (max time 1e-9) 1e-9)
+		 nil t itimers ,repeat ,function ,args))))))
 
 (eval-and-compile
-  (defalias
-    'pgg-run-at-time
-    (if (featurep 'xemacs)
-	(if (condition-case nil
-		(progn
-		  (unless (or itimer-process itimer-timer)
-		    (itimer-driver-start))
-		  ;; Check whether there is a bug to which the difference of
-		  ;; the present time and the time when the itimer driver was
-		  ;; woken up is subtracted from the initial itimer value.
-		  (let* ((inhibit-quit t)
-			 (ctime (current-time))
-			 (itimer-timer-last-wakeup
-			  (prog1
-			      ctime
-			    (setcar ctime (1- (car ctime)))))
-			 (itimer-list nil)
-			 (itimer (start-itimer "pgg-run-at-time" 'ignore 5)))
-		    (sleep-for 0.1) ;; Accept the timeout interrupt.
-		    (prog1
-			(> (itimer-value itimer) 0)
-		      (delete-itimer itimer))))
-	      (error nil))
-	    (lambda (time repeat function &rest args)
-	      "Emulating function run as `run-at-time'.
+  (if (featurep 'xemacs)
+      (defun pgg-run-at-time (time repeat function &rest args)
+	"Emulating function run as `run-at-time'.
 TIME should be nil meaning now, or a number of seconds from now.
 Return an itimer object which can be used in either `delete-itimer'
 or `cancel-timer'."
-	      (apply #'start-itimer "pgg-run-at-time"
-		     function (if time (max time 1e-9) 1e-9)
-		     repeat nil t args))
-	  (lambda (time repeat function &rest args)
-	    "Emulating function run as `run-at-time' in the right way.
-TIME should be nil meaning now, or a number of seconds from now.
-Return an itimer object which can be used in either `delete-itimer'
-or `cancel-timer'."
-	    (let ((itimers (list nil)))
-	      (setcar
-	       itimers
-	       (apply #'start-itimer "pgg-run-at-time"
-		      (lambda (itimers repeat function &rest args)
-			(let ((itimer (car itimers)))
-			  (if repeat
-			      (progn
-				(set-itimer-function
-				 itimer
-				 (lambda (itimer repeat function &rest args)
-				   (set-itimer-restart itimer repeat)
-				   (set-itimer-function itimer function)
-				   (set-itimer-function-arguments itimer args)
-				   (apply function args)))
-				(set-itimer-function-arguments
-				 itimer
-				 (append (list itimer repeat function) args)))
-			    (set-itimer-function
-			     itimer
-			     (lambda (itimer function &rest args)
-			       (delete-itimer itimer)
-			       (apply function args)))
-			    (set-itimer-function-arguments
-			     itimer
-			     (append (list itimer function) args)))))
-		      1e-9 (if time (max time 1e-9) 1e-9)
-		      nil t itimers repeat function args)))))
-      'run-at-time)))
+	(pgg-run-at-time-1 time repeat function args))
+    (defalias 'pgg-run-at-time 'run-at-time)))
 
 (defun pgg-add-passphrase-cache (key passphrase)
   (setq key (pgg-truncate-key-identifier key))
--- a/lisp/gnus/pop3.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/gnus/pop3.el	Fri Jun 03 05:49:26 2005 +0000
@@ -1,6 +1,7 @@
 ;;; pop3.el --- Post Office Protocol (RFC 1460) interface
 
-;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
+;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+;; 2005
 ;;        Free Software Foundation, Inc.
 
 ;; Author: Richard L. Pieri <ratinox@peorth.gweep.net>
@@ -348,21 +349,36 @@
 
 ;; AUTHORIZATION STATE
 
+(eval-when-compile
+  (if (not (fboundp 'md5)) ;; Emacs 20
+      (defalias 'md5 'ignore)))
+
 (eval-and-compile
-  (if (fboundp 'md5)
-      (defalias 'pop3-md5 'md5)
+  (if (and (fboundp 'md5)
+	   ;; There might be an incompatible implementation.
+	   (condition-case nil
+	       (md5 "Check whether the 4th argument is allowed"
+		    nil nil 'binary)
+	     (error nil)))
+      (defun pop3-md5 (string)
+	(md5 string nil nil 'binary))
     (defvar pop3-md5-program "md5"
-      "*Program to encode its input in MD5.")
-
+      "*Program to encode its input in MD5.
+\"openssl\" is a popular alternative; set `pop3-md5-program-args' to
+'(\"md5\") if you use it.")
+    (defvar pop3-md5-program-args nil
+      "*List of arguments passed to `pop3-md5-program'.")
     (defun pop3-md5 (string)
-      (with-temp-buffer
-	(insert string)
-	(call-process-region (point-min) (point-max)
-			     pop3-md5-program
-			     t (current-buffer) nil)
-	;; The meaningful output is the first 32 characters.
-	;; Don't return the newline that follows them!
-	(buffer-substring (point-min) (+ 32 (point-min)))))))
+      (let ((default-enable-multibyte-characters t)
+	    (coding-system-for-write 'binary))
+	(with-temp-buffer
+	  (insert string)
+	  (apply 'call-process-region (point-min) (point-max)
+		 pop3-md5-program t (current-buffer) nil
+		 pop3-md5-program-args)
+	  ;; The meaningful output is the first 32 characters.
+	  ;; Don't return the newline that follows them!
+	  (buffer-substring (point-min) (+ 32 (point-min))))))))
 
 (defun pop3-user (process user)
   "Send USER information to POP3 server."
@@ -398,8 +414,8 @@
   "Return the number of messages in the maildrop and the maildrop's size."
   (pop3-send-command process "STAT")
   (let ((response (pop3-read-response process t)))
-    (list (string-to-int (nth 1 (split-string response " ")))
-	  (string-to-int (nth 2 (split-string response " "))))
+    (list (string-to-number (nth 1 (split-string response " ")))
+	  (string-to-number (nth 2 (split-string response " "))))
     ))
 
 (defun pop3-list (process &optional msg)
@@ -449,7 +465,7 @@
   "Return highest accessed message-id number for the session."
   (pop3-send-command process "LAST")
   (let ((response (pop3-read-response process t)))
-    (string-to-int (nth 1 (split-string response " ")))
+    (string-to-number (nth 1 (split-string response " ")))
     ))
 
 (defun pop3-rset (process)
--- a/lisp/gnus/qp.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/gnus/qp.el	Fri Jun 03 05:49:26 2005 +0000
@@ -69,9 +69,9 @@
 	  (cond ((eq (char-after (1+ (point))) ?\n)
 		 (delete-char 2))
 		((looking-at "=[0-9A-F][0-9A-F]")
-		 (let ((byte (string-to-int (buffer-substring (1+ (point))
-							      (+ 3 (point)))
-					    16)))
+		 (let ((byte (string-to-number (buffer-substring (1+ (point))
+								 (+ 3 (point)))
+					       16)))
 		   (mm-insert-byte byte 1)
 		   (delete-char 3)))
 		(t
--- a/lisp/gnus/spam-report.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/gnus/spam-report.el	Fri Jun 03 05:49:26 2005 +0000
@@ -183,14 +183,14 @@
 the external program specified in `mm-url-program' to connect to
 server."
   (with-temp-buffer
-    (let ((url (concat "http://" host report)))
+    (let ((url (format "http://%s%s" host report)))
       (mm-url-insert url t))))
 
 ;;;###autoload
 (defun spam-report-url-to-file (host report)
   "Collect spam report requests in `spam-report-requests-file'.
 Customize `spam-report-url-ping-function' to use this function."
-  (let ((url (concat "http://" host report))
+  (let ((url (format "http://%s%s" host report))
 	(file spam-report-requests-file))
     (gnus-make-directory (file-name-directory file))
     (gnus-message 9 "Writing URL `%s' to file `%s'" url file)
--- a/lisp/gnus/starttls.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/gnus/starttls.el	Fri Jun 03 05:49:26 2005 +0000
@@ -1,6 +1,7 @@
 ;;; starttls.el --- STARTTLS functions
 
-;; Copyright (C) 1999, 2000, 2003, 2004 Free Software Foundation, Inc.
+;; Copyright (C) 1999, 2000, 2003, 2004, 2005
+;;        Free Software Foundation, Inc.
 
 ;; Author: Daiki Ueno <ueno@unixuser.org>
 ;; Author: Simon Josefsson <simon@josefsson.org>
@@ -235,6 +236,13 @@
       (starttls-negotiate-gnutls process)
     (signal-process (process-id process) 'SIGALRM)))
 
+(eval-and-compile
+  (if (fboundp 'set-process-query-on-exit-flag)
+      (defalias 'starttls-set-process-query-on-exit-flag
+	'set-process-query-on-exit-flag)
+    (defalias 'starttls-set-process-query-on-exit-flag
+      'process-kill-without-query)))
+
 (defun starttls-open-stream-gnutls (name buffer host service)
   (message "Opening STARTTLS connection to `%s'..." host)
   (let* (done
@@ -246,7 +254,7 @@
 				  (int-to-string service)
 				service)
 			 starttls-extra-arguments)))
-    (process-kill-without-query process)
+    (starttls-set-process-query-on-exit-flag process nil)
     (while (and (processp process)
 		(eq (process-status process) 'run)
 		(save-excursion
@@ -286,7 +294,7 @@
 			   name buffer starttls-program
 			   host (format "%s" service)
 			   starttls-extra-args)))
-      (process-kill-without-query process)
+      (starttls-set-process-query-on-exit-flag process nil)
       process)))
 
 (provide 'starttls)
--- a/lisp/help-fns.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/help-fns.el	Fri Jun 03 05:49:26 2005 +0000
@@ -224,7 +224,7 @@
 ;;;   (symbol-file (if (symbolp subr-or-var) subr-or-var
 ;;; 		 (subr-name subr-or-var))
 ;;; 	       (if (eq kind 'var) 'defvar 'defun)))
-
+;;;###autoload
 (defun help-C-file-name (subr-or-var kind)
   "Return the name of the C file where SUBR-OR-VAR is defined.
 KIND should be `var' for a variable or `subr' for a subroutine."
--- a/lisp/ielm.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/ielm.el	Fri Jun 03 05:49:26 2005 +0000
@@ -480,7 +480,8 @@
 Customized bindings may be defined in `ielm-map', which currently contains:
 \\{ielm-map}"
   (interactive)
-  (comint-mode)
+  (delay-mode-hooks
+   (comint-mode))
   (setq comint-prompt-regexp (concat "^" (regexp-quote ielm-prompt)))
   (set (make-local-variable 'paragraph-separate) "\\'")
   (make-local-variable 'paragraph-start)
--- a/lisp/jit-lock.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/jit-lock.el	Fri Jun 03 05:49:26 2005 +0000
@@ -298,7 +298,7 @@
   "Fontify current buffer starting at position START.
 This function is added to `fontification-functions' when `jit-lock-mode'
 is active."
-  (when jit-lock-mode
+  (when (and jit-lock-mode (not (memory-full-p)))
     (if (null jit-lock-defer-time)
 	;; No deferral.
 	(jit-lock-fontify-now start (+ start jit-lock-chunk-size))
@@ -540,7 +540,7 @@
 This function ensures that lines following the change will be refontified
 in case the syntax of those lines has changed.  Refontification
 will take place when text is fontified stealthily."
-  (when jit-lock-mode
+  (when (and jit-lock-mode (not (memory-full-p)))
     (save-excursion
       (with-buffer-prepared-for-jit-lock
        ;; It's important that the `fontified' property be set from the
--- a/lisp/mail/supercite.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/mail/supercite.el	Fri Jun 03 05:49:26 2005 +0000
@@ -3,7 +3,7 @@
 ;; Copyright (C) 1993, 1997, 2003, 2004, 2005 Free Software Foundation, Inc.
 
 ;; Author: 1993 Barry A. Warsaw <bwarsaw@python.org>
-;; Maintainer:    FSF
+;; Maintainer:    Glenn Morris <gmorris@ast.cam.ac.uk>
 ;; Created:       February 1993
 ;; Last Modified: 1993/09/22 18:58:46
 ;; Keywords: mail, news
@@ -1182,8 +1182,11 @@
 	      (setq attribution attrib
 		    attriblist nil))
 	     ((listp attrib)
-	      (setq attribution (eval attrib)
-		    attriblist nil))
+	      (setq attribution (eval attrib))
+              (if (stringp attribution)
+                  (setq attriblist nil)
+                (setq attribution nil
+                      attriblist (cdr attriblist))))
 	     (t (error "%s did not evaluate to a string or list!"
 		       "sc-attrib-selection-list"))
 	     )))
--- a/lisp/man.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/man.el	Fri Jun 03 05:49:26 2005 +0000
@@ -259,7 +259,7 @@
 (defvar Man-cooked-hook nil
   "Hook run after removing backspaces but before `Man-mode' processing.")
 
-(defvar Man-name-regexp "[-a-zA-Z0-9_­+][-a-zA-Z0-9_.­+]*"
+(defvar Man-name-regexp "[-a-zA-Z0-9_­+][-a-zA-Z0-9_.:­+]*"
   "Regular expression describing the name of a manpage (without section).")
 
 (defvar Man-section-regexp "[0-9][a-zA-Z+]*\\|[LNln]"
--- a/lisp/mh-e/ChangeLog	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/mh-e/ChangeLog	Fri Jun 03 05:49:26 2005 +0000
@@ -1,32 +1,305 @@
-2005-05-26  Lute Kamstra  <lute@gnu.org>
-
-	* mh-utils.el (mh-show-mode): 
-	* mh-pick.el (mh-pick-mode): Remove spurious run-hooks.
-
-2005-04-08  Dan Nicolaescu  <dann@ics.uci.edu>
+2005-05-28  Bill Wohler  <wohler@newt.com>
+
+	 Released MH-E version 7.84.
+
+         * MH-E-NEWS, README: Updated for release 7.84.
+
+         * mh-e.el (Version, mh-version): Updated for release 7.84.
+
+2005-05-28  Bill Wohler  <wohler@newt.com>
+
+	* mh-e.el, mh-comp.el: Don't autoload Info-goto-node. It's not
+	used, and if it were, the code should use the info function
+	instead.
+
+	Use full year in copyright notices (for example, 2005, not 05).
+
+	* Makefile (mh-loaddefs.el, mh-e-autoloads.el): Added 2005 to
+	copyright notice.
+
+	* mh-inc.el: Use three ;;; to precede Local Variables to be
+	consistent with other files. Will have to ask Stefan Monnier why
+	he changed it.
+
+	* README: This version of MH-E to appear in GNU Emacs 22.1, not
+	21.5.
+
+	* ChangeLog: The * in a ChangeLog entry must only be used before a
+	filename.
+
+	Fixed compilation warnings in CVS Emacs. This included using
+	"public" functions instead of "private" ones (info instead of
+	Info-goto-node, view-mode-enter instead of view-mode), and
+	removing a customization group that didn't have a parent group. In
+	addition, string-to-int was recently deprecated; use
+	string-to-number instead.
+
+	* mh-customize.el (Info-goto-node): Deleted autoload.
+	(mh-e): Deleted mh group. Use single mh-e group instead.
+	(mh-tool-bar-folder-help, mh-tool-bar-letter-help): Use info
+	instead of Info-goto-node.
+
+	* mh-e.el (mh-read-msg-list): string-to-int deprecated; use
+	string-to-number.
+
+	* mh-funcs.el (mh-list-folders): Use view-mode-enter instead of
+	view-mode.
+
+	* mh-seq.el (mh-list-sequences): Use view-mode-enter instead of
+	view-mode.
+
+	* mh-utils.el (mh-get-msg-num): string-to-int deprecated; use
+	string-to-number.
+
+	Merged in changes from CVS Emacs including:
+
+	* mh-utils.el (mh-show-mode):
+	* mh-pick.el (mh-pick-mode): Remove spurious run-hooks. Lute
+	Kamstra  <lute@gnu.org> 2005-05-26.
+
+2005-05-25  Bill Wohler  <wohler@newt.com>
+
+	Merged in changes from CVS Emacs including:
 
 	* mh-customize.el (mh-speedbar-selected-folder-face): Special case
-	high number of colors displays.
-
-2005-03-25  Werner Lemberg  <wl@gnu.org>
-
-	* mh-e.el, mh-identity.el, mh-mime.el: Replace `legal' with `valid'.
-
-2005-03-25  Werner Lemberg  <wl@gnu.org>
-
-	* mh-e.el: Replace `illegal' with `invalid'.
-
-2004-09-07  Stefan  <monnier@iro.umontreal.ca>
-
-	* mh-inc.el (mh-inc-spool-list): Correctly declare the external var.
-
-2004-08-21  Bill Wohler  <wohler@newt.com>
-
-	* Released MH-E version 7.82.
+	high number of colors displays. Dan Nicolaescu <dann@ics.uci.edu>
+	2005-04-08.
+
+	* mh-e.el, mh-identity.el, mh-mime.el: Replace `legal' with
+	`valid'. Replace `illegal' with `invalid'. Werner Lemberg
+	<wl@gnu.org> 2005-03-25.
+
+	* mh-inc.el (mh-inc-spool-list): Correctly declare the external
+	var. Stefan <monnier@iro.umontreal.ca> 2004-09-07.
+
+2005-05-18  Bill Wohler  <wohler@newt.com>
+
+	* mh-comp.el (mh-reply): Mention use of mh-repl-group-formfile in
+	docstring.
+
+2005-05-05  Bill Wohler  <wohler@newt.com>
+
+	* mh-e.el (Version, mh-version): Added +cvs to release number.
+
+2005-05-05  Bill Wohler  <wohler@newt.com>
+
+	Released MH-E version 7.83.
+
+	* MH-E-NEWS, README: Updated for release 7.83.
+
+	* mh-e.el (Version, mh-version): Updated for release 7.83.
+
+2005-05-05  Bill Wohler  <wohler@newt.com>
+
+	* README: To appear in Emacs 21.5, since 21.4 was released (but
+	without the latest MH-E).
+
+	* release-utils (usage): Added --variable-changes.
+
+2005-05-04  Bill Wohler  <wohler@newt.com>
+
+	* mh-customize.el (*-face): Made docstrings consistent.
+
+	* mh-seq.el (mh-pick-args-list): Extracted function for turning
+	string of pick arguments to list. Fixed list so that multi-word
+	arguments were put in a single string (closes SF #1122655).
+	(mh-edit-pick-expr): Use it.
+
+	* mh-unit.el (mh-unit): Since 21.4 snuck out but didn't contain
+	updated lm-verify, don't run lm-verify on versions before 21.5.
+	(mh-unit-test-pick-args-list): Added.
+
+	* mh-customize.el (mh-yank-from-start-of-msg): Use headline
+	capitalization. Changed wording of some choices to be more consistent.
+	(mh-invisible-header-fields-internal): Added fields from usa.net.
+
+2005-04-24  Satyaki Das  <satyaki@theforce.stanford.edu>
+
+	* mh-mime.el (mh-mime-security-button-face): New function which
+	determines the face to use to colorize encrypted or signed emails.
+	(mh-insert-mime-security-button): Modified to colorize the button
+	differently based on whether the signature was valid or not,
+	whether the decryption was successful or not, etc.
+
+	* mh-customize.el (mh-show-pgg-good-face)
+	(mh-show-pgg-unknown-face, mh-show-pgg-bad-face): Faces added to
+	highlight buttons introduced for encrpted or signed MIME parts.
+
+2005-03-19  Bill Wohler  <wohler@newt.com>
+
+	* mh-customize.el (mh-mml-method-default): Sorted alphabetically.
+	(mh-insert-x-mailer-flag, mh-reply-show-message-flag): Moved from
+	mh-letter group to mh-sending-mail group. The writing of the
+	documentation revealed that these options were misplaced.
+
+2005-03-17  Bill Wohler  <wohler@newt.com>
+
+	* mh-customize.el (mh-junk-background): Put in alphabetical order.
+	Synced with manual.
+	(mh-junk-program): Use double-quotes on non-symbols.
+
+	* mh-pick.el: (mh-search-folder): Synced docstrings with manual.
+
+	* mh-index.el: (mh-index-search, mh-pick-execute-search)
+	(mh-grep-execute-search, mh-mairix-execute-search)
+	(mh-swish-execute-search, mh-swish++-execute-search)
+	(mh-namazu-execute-search): Synced docstrings with manual. Note
+	that I'm now grabbing the output of an Info buffer which is why
+	the indents on the examples has changed a bit. If we all use that
+	methodology in the future, we shouldn't produce as many gratuitous
+	diffs. I also noticed that `grep' and `search' became links to
+	unrelated things, so let's use double-quotes for quoting
+	non-symbols in the docstrings.
+
+	* mh-customize.el (mh-index-new-messages-folders)
+	(mh-index-ticked-messages-folders): Synced docstrings with manual.
+
+2005-02-16  Satyaki Das  <satyaki@theforce.stanford.edu>
+
+	* mh-index.el (mh-swish-execute-search): Simplify the indexing
+	recipe for swish. Thanks to Eric Jensen for the suggestion.
+
+2005-02-11  Satyaki Das  <satyaki@theforce.stanford.edu>
+
+	* mh-index.el (mh-swish-execute-search)
+	(mh-swish++-execute-search): Make the indexing recipes better.
+	(mh-swish-next-result): The indexer might find matches in files
+	that aren't messages. Make the function handle that case
+	gracefully.
+
+2005-02-07  Bill Wohler  <wohler@newt.com>
+
+	* mh-customize.el (mh-inc-prog, mh-inc-spool-list): Synced
+	docstrings with manual.
+
+2005-02-06  Bill Wohler  <wohler@newt.com>
+
+	* mh-junk.el (mh-spamassassin-blacklist): Removed trailing
+	whitespace.
+
+	* mh-e.el (mh-refile-or-write-again): Checkdoc fix.
+
+	* mh-identity.el (mh-identity-list-set)
+	(mh-identity-field-handler, mh-identity-handler-gpg-identity)
+	(mh-identity-handler-signature)
+	(mh-identity-handler-attribution-verb)
+	(mh-identity-handler-default, mh-identity-handler-top): Docstring
+	editing.
+
+	* mh-customize.el (mh-identity-list, mh-auto-fields-list)
+	(mh-identity-default, mh-identity-handlers): Synced docstrings
+	with manual.
+
+2005-02-03  Bill Wohler  <wohler@newt.com>
+
+	* mh-xemacs.el (define-behavior 'mh): Moved Ben's code here from
+	mh-e.el and added standard documentation.
+
+	* mh-e.el: Received patch from Ben Wing <ben@666.com> to add
+	define-behavior on XEmacs.
+
+2005-01-28  Jeffrey C Honig  <jch@honig.net>
+
+	* mh-customize.el (mh-invisible-header-fields-internal): Added
+	X-Evolution header added by Evolution mai client.
+
+2005-01-18  Bill Wohler  <wohler@newt.com>
+
+	* mh-customize.el (mh-invisible-header-fields-internal): Added
+	DomainKey-Signature (http://antispam.yahoo.com/domainkeys/).
+	There's a Comment field that goes with it, but I thought it was
+	too general to add.
+
+2005-01-06  Bill Wohler  <wohler@newt.com>
+
+	* mh-junk.el (mh-spamassassin-blacklist): Fixed typo to fix an
+	error when junking spamassassin mail when mh-junk-background is
+	turned on.
+
+2004-12-25  Satyaki Das  <satyaki@theforce.stanford.edu>
+
+	* mh-utils.el (mh-show-unquote-From): Make the buffer writable
+	before trying to change it (closes SF #1089870).
+
+	* mh-comp.el (mh-complete-word): Fix a typo in a variable
+	name (closes SF #1089870)
+
+2004-11-28  Jeffrey C Honig  <jch@honig.net>
+
+	* mh-comp.el (mh-complete-word): Kill the *Completions* buffer in
+	any cases where we belive we are done with it.  Not perfect, but
+	better than just leaving it around.
+
+2004-11-08  Satyaki Das  <satyaki@theforce.stanford.edu>
+
+	* mh-acros.el (mh-funcall-if-exists): In XEmacs, presence of a
+	function at compile time doesn't guarantee it's existence at run
+	time. So make the macro handle that situation better.
+
+2004-11-05  Satyaki Das  <satyaki@theforce.stanford.edu>
+
+	* mh-acros.el (advice): Load advice, since it isn't loaded in
+	XEmacs causing compilation problems.
+
+2004-10-24  Satyaki Das  <satyaki@theforce.stanford.edu>
+
+	* mh-index.el (mh-mairix-execute-search)
+	(mh-mairix-regexp-builder): Update the interface to mairix so that
+	it will work with versions of mairix 0.12 and later.
+
+	* mh-funcs.el (mh-rmf-daemon): Avoid using
+	beginning-of-buffer since it clobbers the mark and it was pointed
+	out on the Emacs developers list to be the wrong thing to do.
+
+	* mh-e.el (mh-inc-folder): Only remove the window on the show
+	buffer. This means if the user has BBDB enabled then the window
+	displaying BBDB information isn't clobbered.
+	(mh-refile-or-write-again): Don't use the function
+	interactive-p. There was a long thread on the Emacs developers
+	list where it was pointed out that it is incorrect to use this
+	function most of the time.
+
+	* mh-comp.el (autoload): Don't set auto-mode-alist. This could
+	screw things up for users that don't use MH-E (closes SF #1032353).
+
+2004-10-13  Satyaki Das  <satyaki@theforce.stanford.edu>
+
+	* mh-e.el (mh-refile-or-write-again): Generalize the function to
+	work on a range of messages (closes SF #1046330).
+
+2004-09-02  Satyaki Das  <satyaki@theforce.stanford.edu>
+
+	* mh-e.el (mh-process-commands): The concurrent execution of mark
+	and refile can cause problems since both the commands change the
+	current folder. This change avoids that by getting rid of the
+	concurrency. Another change covers the corner case where we refile
+	messages to a previously empty folder. Before the modification
+	sequences weren't preserved even if the appropriate flag was
+	set. That is no longer the case.
+
+2004-08-26  Satyaki Das  <satyaki@theforce.stanford.edu>
+
+	* mh-e.el (mh-get-new-mail): Also, update the unseen sequence from
+	disk. Otherwise, the new messages aren't highlighted.
+
+	* mh-seq.el (mh-thread-inc): Fix a bug which appears when inc is
+	run in a narrowed folder. The user sequence notation was getting
+	lost. The change fixes that.
+
+	* mh-e.el (mh-get-new-mail): Make inc more efficient by reusing
+	the existing user sequence notation and deleted/refiled notation.
+
+2004-08-24  Bill Wohler  <wohler@newt.com>
+
+	* mh-e.el (Version, mh-version): Added +cvs to release number.
+
+2004-08-24  Bill Wohler  <wohler@newt.com>
+
+	Released MH-E version 7.82.
 
 	* MH-E-NEWS, README: Updated for release 7.82.
 
-	* mh-e.el (Version, mh-version): Update for release 7.82.
+	* mh-e.el (Version, mh-version): Updated for release 7.82.
 
 2004-08-24  Bill Wohler  <wohler@newt.com>
 
@@ -57,11 +330,11 @@
 
 2004-08-21  Bill Wohler  <wohler@newt.com>
 
-	* Released MH-E version 7.81.
+	Released MH-E version 7.81.
 
 	* MH-E-NEWS, README: Updated for release 7.81.
 
-	* mh-e.el (Version, mh-version): Update for release 7.81.
+	* mh-e.el (Version, mh-version): Updated for release 7.81.
 
 2004-08-21  Bill Wohler  <wohler@newt.com>
 
@@ -94,7 +367,7 @@
 
 2004-08-15  Bill Wohler  <wohler@newt.com>
 
-	* Released MH-E version 7.4.80.
+	Released MH-E version 7.4.80.
 
 	* MH-E-NEWS, README: Updated for release 7.4.80.
 
@@ -324,13 +597,13 @@
 	are more useful than a key sequence in these cases. Use "See also"
 	instead of "See also documentation for".
 
-	* Merged in 7.4.4 changes, described below.
+	Merged in 7.4.4 changes, described below.
 
 	* mh-e.el (Version, mh-version):  Set to 7.4.4+cvs.
 
 2004-07-10  Bill Wohler  <wohler@newt.com>
 
-	* Released MH-E version 7.4.4.
+	Released MH-E version 7.4.4.
 
 	* MH-E-NEWS, README: Updated for release 7.4.4.
 
@@ -399,9 +672,9 @@
 	routines in the best way possible (closes SF #930012).
 	(require 'mouse): To shush compiler.
 
-	* Use new function mh-require-cl throughout.
-
-	* Add arch taglines (courtesy Miles Bader).
+	Use new function mh-require-cl throughout.
+
+	Add arch taglines (courtesy Miles Bader).
 
 	* mh-unit.el (mh-unit-files): Replaced mh-xemacs-compat.el and
 	mh-xemacs-icons.el with mh-xemacs.el.
@@ -541,7 +814,7 @@
 
 2003-11-18  Bill Wohler  <wohler@newt.com>
 
-	* Released MH-E version 7.4.3.
+	Released MH-E version 7.4.3.
 
 	* MH-E-NEWS, README: Updated for release 7.4.3.
 
@@ -684,8 +957,8 @@
 
 2003-11-04  Steve Youngs  <sryoungs@bigpond.net.au>
 
-	* Makefile (XEMACS_LOADDEFS_FILE): New.  Used to generate mh-loaddefs.el
-	in XEmacs.
+	* Makefile (XEMACS_LOADDEFS_FILE): New. Used to generate
+	mh-loaddefs.el in XEmacs.
 	(XEMACS_LOADDEFS_COOKIE): Ditto.
 	(XEMACS_LOADDEFS_PKG_NAME): Ditto.
 	(xemacs): Add target to build mh-loaddefs.el in XEmacs
@@ -1363,7 +1636,7 @@
 
 2003-08-19  Bill Wohler  <wohler@newt.com>
 
-	* Released MH-E version 7.4.2.
+	Released MH-E version 7.4.2.
 
 	* MH-E-NEWS, README: Updated for release 7.4.2.
 
@@ -2233,7 +2506,7 @@
 
 2003-06-25  Bill Wohler  <wohler@newt.com>
 
-	* Released MH-E version 7.4.1.
+	Released MH-E version 7.4.1.
 
 	* MH-E-NEWS, README: Updated for release 7.4.1.
 
@@ -2255,7 +2528,7 @@
 
 2003-06-24  Bill Wohler  <wohler@newt.com>
 
-	* Released MH-E version 7.4.
+	Released MH-E version 7.4.
 
 	* MH-E-NEWS, README: Updated for release 7.4.
 
@@ -3362,7 +3635,7 @@
 
 2003-04-24  Bill Wohler  <wohler@newt.com>
 
-	* Released MH-E version 7.3.
+	Released MH-E version 7.3.
 
 	* MH-E-NEWS, README: Updated for release 7.3.
 
@@ -4920,7 +5193,7 @@
 
 2003-02-03  Bill Wohler  <wohler@newt.com>
 
-	* Released MH-E version 7.2.
+	Released MH-E version 7.2.
 
 	* MH-E-NEWS, README: Updated for release 7.2.
 
@@ -5584,7 +5857,7 @@
 
 2003-01-07  Bill Wohler  <wohler@newt.com>
 
-	* Released MH-E version 7.1.
+	Released MH-E version 7.1.
 
 	* MH-E-NEWS, README: Updated for release 7.1.
 
@@ -6678,7 +6951,7 @@
 
 2002-11-29  Bill Wohler  <wohler@newt.com>
 
-	* Released MH-E version 7.0.
+	Released MH-E version 7.0.
 
 	* mh-e.el (Version, mh-version): Updated for release 7.0.
 
@@ -6703,7 +6976,7 @@
 
 2002-11-21  Bill Wohler  <wohler@newt.com>
 
-	* Released MH-E version 6.1.91.
+	Released MH-E version 6.1.91.
 
 	* mh-e.el (Version, mh-version): Updated for release 6.1.91.
 
@@ -6727,7 +7000,7 @@
 
 2002-11-15  Bill Wohler  <wohler@newt.com>
 
-	* Released MH-E version 6.1.90.
+	Released MH-E version 6.1.90.
 
 	* README (Compile): New section. Users must now compile MH-E due
 	to the vagaries of the various versions of gnus.
@@ -9688,7 +9961,7 @@
 
 2002-04-08  Bill Wohler  <wohler@newt.com>
 
-	* Released mh-e version 6.1.
+	Released mh-e version 6.1.
 
 	* mh-e.el (mh-folder-unseen-seq-name): Use "mhparam -component
 	Unseen-Sequence" command and "Unseen-Sequence: \\(.*\\)$" regexp
@@ -9792,7 +10065,7 @@
 
 2001-12-16  Bill Wohler  <wohler@newt.com>
 
-	* Released mh-e version 6.0.
+	Released mh-e version 6.0.
 
 	* MH-E-NEWS: Be a little more specific about incompatible changes.
 	Added info about outdated manual.
@@ -9815,7 +10088,7 @@
 
 2001-12-14  Bill Wohler  <wohler@newt.com>
 
-	* Released mh-e version 5.0.93.
+	Released mh-e version 5.0.93.
 
 	* Makefile (MH-E-SRC): Added mh-xemacs-compat.el.
 	(MH-E-IMG): Added .pbm images for all. Removed mail_ prefix from
@@ -10000,7 +10273,7 @@
 
 2001-12-04  Bill Wohler  <wohler@newt.com>
 
-	* Released mh-e version 5.0.92.
+	Released mh-e version 5.0.92.
 
 	* mh-utils.el (gnus-cite-face-list)
 	(mh-gnus-article-highlight-citation): Don't autoload. Revert to
@@ -10010,7 +10283,7 @@
 
 2001-12-03  Bill Wohler  <wohler@newt.com>
 
-	* Released mh-e version 5.0.91.
+	Released mh-e version 5.0.91.
 
 	* MH-E-NEWS: Removed info about bumping up `max-specpdl-size' now
 	that workaround has been implemented.
@@ -10916,17 +11189,17 @@
 
 2001-04-14  chad brown  <y@mit.edu>
 
-	* rearrange the font-lock keywords a bit
+	Rearrange the font-lock keywords a bit.
 
 2001-04-12  chad brown  <y@mit.edu>
 
-	* preliminary (somewhat boring) font-lock support for mh-e.  More
+	Preliminary (somewhat boring) font-lock support for mh-e.  More
 	interesting font-lock support probably wants to have better
 	support for multiple format files
 
 2001-02-24  chad brown  <y@mit.edu>
 
-	* add default nmh paths to mh-find-prog in mh-utils.el.
+	Add default nmh paths to mh-find-prog in mh-utils.el.
 	change to mh-kill-folder in mh-funcs.el to make it more general.
 
 2001-02-19  Bill Wohler  <wohler@newt.com>
@@ -10939,10 +11212,10 @@
 	(dist): Leave release in current directory.
 
 
-Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
-
-Copying and distribution of this file, with or without modification,
-are permitted in any medium without royalty provided the copyright
-notice and this notice are preserved.
+  Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
+
+  Copying and distribution of this file, with or without modification,
+  are permitted in any medium without royalty provided the copyright
+  notice and this notice are preserved.
 
 ;;; arch-tag: 87324964-69b6-4925-a3c2-9c1df53d7d51
--- a/lisp/mh-e/mh-acros.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/mh-e/mh-acros.el	Fri Jun 03 05:49:26 2005 +0000
@@ -1,6 +1,6 @@
 ;;; mh-acros.el --- Macros used in MH-E
 
-;; Copyright (C) 2005 Free Software Foundation, Inc.
+;; Copyright (C) 2004 Free Software Foundation, Inc.
 
 ;; Author: Satyaki Das <satyaki@theforce.stanford.edu>
 ;; Maintainer: Bill Wohler <wohler@newt.com>
@@ -40,6 +40,7 @@
 ;;; Code:
 
 (require 'cl)
+(require 'advice)
 
 ;; The Emacs coding conventions require that the cl package not be required at
 ;; runtime. However, the cl package in versions of Emacs prior to 21.4 left cl
@@ -68,8 +69,9 @@
 
 (defmacro mh-funcall-if-exists (function &rest args)
   "Call FUNCTION with ARGS as parameters if it exists."
-  (if (fboundp function)
-      `(funcall ',function ,@args)))
+  (when (fboundp function)
+    `(when (fboundp ',function)
+       (funcall ',function ,@args))))
 
 (defmacro mh-make-local-hook (hook)
   "Make HOOK local if needed.
--- a/lisp/mh-e/mh-alias.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/mh-e/mh-alias.el	Fri Jun 03 05:49:26 2005 +0000
@@ -1,6 +1,7 @@
 ;;; mh-alias.el --- MH-E mail alias completion and expansion
 ;;
-;; Copyright (C) 2005 Free Software Foundation, Inc.
+;; Copyright (C) 1994, 1995, 1996, 1997,
+;;  2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 
 ;; Author: Peter S. Galbraith <psg@debian.org>
 ;; Maintainer: Bill Wohler <wohler@newt.com>
@@ -162,16 +163,16 @@
       (while  (< (point) (point-max))
         (cond
          ((looking-at "\\([^:]*\\):[^:]*:\\([^:]*\\):[^:]*:\\([^:]*\\):")
-          (when (> (string-to-int (match-string 2)) 200)
+          (when (> (string-to-number (match-string 2)) 200)
             (let* ((username (match-string 1))
                    (gecos-name (match-string 3))
                    (realname (mh-alias-gecos-name
                               gecos-name username
                               mh-alias-passwd-gecos-comma-separator-flag))
                    (alias-name (if mh-alias-local-users-prefix
-                                  (concat mh-alias-local-users-prefix
-                                          (mh-alias-suggest-alias realname t))
-                                username))
+                                   (concat mh-alias-local-users-prefix
+                                           (mh-alias-suggest-alias realname t))
+                                 username))
                    (alias-translation
                     (if (string-equal username realname)
                         (concat "<" username ">")
--- a/lisp/mh-e/mh-comp.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/mh-e/mh-comp.el	Fri Jun 03 05:49:26 2005 +0000
@@ -1,6 +1,7 @@
 ;;; mh-comp.el --- MH-E functions for composing messages
 
-;; Copyright (C) 1993, 95, 1997, 2000, 2005 Free Software Foundation, Inc.
+;; Copyright (C) 1993, 1995, 1997,
+;;  2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 
 ;; Author: Bill Wohler <wohler@newt.com>
 ;; Maintainer: Bill Wohler <wohler@newt.com>
@@ -52,7 +53,6 @@
 (defvar mh-identity-menu)
 
 ;;; Autoloads
-(autoload 'Info-goto-node "info")
 (autoload 'mail-mode-fill-paragraph "sendmail")
 (autoload 'mm-handle-displayed-p "mm-decode")
 
@@ -490,8 +490,10 @@
    cc/all  sender and all recipients.
 If optional prefix argument INCLUDEP provided, then include the message
 in the reply using filter `mhl.reply' in your MH directory.
-If the file named by `mh-repl-formfile' exists, it is used as a skeleton
-for the reply.
+If the file named by `mh-repl-formfile' exists, it is used as a skeleton for
+the reply. If REPLY-TO is cc or all and you're using either the nmh or GNU
+mailutils variants and the file names by `mh-repl-group-formfile' exists, it
+is used instead.
 
 See also `mh-send'."
   (interactive (list
@@ -1629,15 +1631,22 @@
 (defun mh-complete-word (word choices begin end)
   "Complete WORD at from CHOICES.
 Any match found replaces the text from BEGIN to END."
-  (let ((completion (try-completion word choices)))
+  (let ((completion (try-completion word choices))
+        (completions-buffer "*Completions*"))
     (cond ((eq completion t)
+           (ignore-errors
+             (kill-buffer completions-buffer))
            (message "Completed: %s" word))
           ((null completion)
+           (ignore-errors
+             (kill-buffer completions-buffer))
            (message "No completion for `%s'" word))
           ((stringp completion)
            (if (equal word completion)
-               (with-output-to-temp-buffer "*Completions*"
+               (with-output-to-temp-buffer completions-buffer
                  (display-completion-list (all-completions word choices)))
+             (ignore-errors
+               (kill-buffer completions-buffer))
              (delete-region begin end)
              (insert completion))))))
 
@@ -1965,8 +1974,6 @@
 
 ;; "C-c /" prefix is used in mh-letter-mode by pgp.el and mailcrypt.el.
 
-;;;###autoload(add-to-list 'auto-mode-alist '("/drafts/[0-9]+\\'" . mh-letter-mode))
-
 (provide 'mh-comp)
 
 ;;; Local Variables:
--- a/lisp/mh-e/mh-customize.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/mh-e/mh-customize.el	Fri Jun 03 05:49:26 2005 +0000
@@ -1,6 +1,6 @@
 ;;; mh-customize.el --- MH-E customization
 
-;; Copyright (C) 2005 Free Software Foundation, Inc.
+;; Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
 
 ;; Author: Bill Wohler <wohler@newt.com>
 ;; Maintainer: Bill Wohler <wohler@newt.com>
@@ -69,8 +69,6 @@
 (mh-require-cl)
 (require 'mh-loaddefs)
 
-(autoload 'Info-goto-node "info")
-
 (eval-and-compile
   (defvar mh-xemacs-flag (featurep 'xemacs)
     "Non-nil means the current Emacs is XEmacs."))
@@ -102,121 +100,115 @@
 
 ;;; MH-E Customization Groups
 
-(defgroup mh nil
+(defgroup mh-e nil
   "Emacs interface to the MH mail system.
 MH is the Rand Mail Handler. Other implementations include nmh and GNU
 mailutils."
   :link '(custom-manual "(mh-e)Top")
   :group 'mail)
 
-(defgroup mh-e '((mh custom-group))     ; Sort of an alias for 'mh group
-  "Emacs interface to the MH mail system.
-MH is the Rand Mail Handler. Other implementations include nmh and GNU
-mailutils."
-  :link '(custom-manual "(mh-e)Top"))
-
 (defgroup mh-alias nil
   "Aliases."
   :link '(custom-manual "(mh-e)Aliases")
   :prefix "mh-alias-"
-  :group 'mh)
+  :group 'mh-e)
 
 (defgroup mh-folder nil
   "Organizing your mail with folders."
   :prefix "mh-"
   :link '(custom-manual "(mh-e)Organizing")
-  :group 'mh)
+  :group 'mh-e)
 
 (defgroup mh-folder-selection nil
   "Folder selection."
   :prefix "mh-"
   :link '(custom-manual "(mh-e)Folder Selection")
-  :group 'mh)
+  :group 'mh-e)
 
 (defgroup mh-identity nil
   "Identities."
   :link '(custom-manual "(mh-e)Identities")
   :prefix "mh-identity-"
-  :group 'mh)
+  :group 'mh-e)
 
 (defgroup mh-inc nil
   "Incorporating your mail."
   :prefix "mh-inc-"
   :link '(custom-manual "(mh-e)Incorporating Mail")
-  :group 'mh)
+  :group 'mh-e)
 
 (defgroup mh-index nil
   "Searching."
   :link '(custom-manual "(mh-e)Searching")
   :prefix "mh-index-"
-  :group 'mh)
+  :group 'mh-e)
 
 (defgroup mh-junk nil
   "Dealing with junk mail."
   :link '(custom-manual "(mh-e)Junk")
   :prefix "mh-junk-"
-  :group 'mh)
+  :group 'mh-e)
 
 (defgroup mh-letter nil
   "Editing a draft."
   :prefix "mh-"
   :link '(custom-manual "(mh-e)Editing Drafts")
-  :group 'mh)
+  :group 'mh-e)
 
 (defgroup mh-ranges nil
   "Ranges."
   :prefix "mh-"
   :link '(custom-manual "(mh-e)Ranges")
-  :group 'mh)
+  :group 'mh-e)
 
 (defgroup mh-scan-line-formats nil
   "Scan line formats."
   :link '(custom-manual "(mh-e)Scan Line Formats")
   :prefix "mh-"
-  :group 'mh)
+  :group 'mh-e)
 
 (defgroup mh-sending-mail nil
   "Sending mail."
   :prefix "mh-"
   :link '(custom-manual "(mh-e)Sending Mail")
-  :group 'mh)
+  :group 'mh-e)
 
 (defgroup mh-sequences nil
   "Sequences."
   :prefix "mh-"
   :link '(custom-manual "(mh-e)Sequences")
-  :group 'mh)
+  :group 'mh-e)
 
 (defgroup mh-show nil
   "Reading your mail."
   :prefix "mh-"
   :link '(custom-manual "(mh-e)Reading Mail")
-  :group 'mh)
+  :group 'mh-e)
 
 (defgroup mh-speed nil
   "The speedbar."
   :prefix "mh-speed-"
   :link '(custom-manual "(mh-e)Speedbar")
-  :group 'mh)
+  :group 'mh-e)
 
 (defgroup mh-toolbar nil
   "The toolbar"
   :link '(custom-manual "(mh-e)Toolbar")
   :prefix "mh-"
-  :group 'mh)
+  :group 'mh-e)
 
 (defgroup mh-faces nil
   "Faces used in MH-E."
   :link '(custom-manual "(mh-e)Top")
   :prefix "mh-"
   :group 'faces
-  :group 'mh)
+  :group 'mh-e)
 
 (defgroup mh-hooks nil
   "MH-E hooks."
   :link '(custom-manual "(mh-e)Top")
   :prefix "mh-"
-  :group 'mh)
+  :group 'mh-e)
 
 ;;; Faces
 
@@ -280,7 +272,7 @@
   :set (lambda (symbol value)
          (set-default symbol value)     ;Done in mh-variant-set-variant!
          (mh-variant-set value))
-  :group 'mh)
+  :group 'mh-e)
 
 
 
@@ -448,14 +440,34 @@
 (defcustom mh-identity-list nil
   "*List of identities.
 
-Each element consists of an identity label, and a collection of header fields
-and a signature to insert if the identity is selected (see
-`mh-identity-default', `mh-insert-identity' and the `Identity' menu in a
-MH-Letter buffer). The `Value Menu' contains the common header fields `From'
-and `Organization'. Other header fields may be added using the `Other Field'
-menu item. The `Signature' menu item is used to insert a signature with
-`mh-insert-signature'. The `GPG Key ID' menu item is used to specify a
-different key to sign or encrypt messages."
+To customize this option, click on the `INS' button and enter a label such as
+`Home' or `Work'. Then click on the `INS' button with the label `Add at least
+one item below'. Then choose one of the items in the `Value Menu'.
+
+You can specify an alternate `From:' header field using the `From Field' menu
+item. You must include a valid email address. A standard format is `First Last
+<login@@host.domain>'. If you use an initial with a period, then you must
+quote your name as in `\"First I. Last\" <login@@host.domain>'. People usually
+list the name of the company where they work using the `Organization Field'
+menu item. Set any arbitrary header field and value in the `Other Field' menu
+item. Unless the header field is a standard one, precede the name of your
+field's label with `X-', as in `X-Fruit-of-the-Day:'. The value of
+`Attribution Verb' overrides the setting of
+`mh-extract-from-attribution-verb'. Set your signature with the `Signature'
+menu item. You can specify the contents of `mh-signature-file-name', a file,
+or a function. Specify a different key to sign or encrypt messages with the
+`GPG Key ID' menu item.
+
+You can select the identities you have added via the menu called `Identity' in
+the MH-Letter buffer. You can also use \\[mh-insert-identity]. To clear the
+fields and signature added by the identity, select the `None' identity.
+
+The `Identity' menu contains two other items to save you from having to set
+the identity on every message. The menu item `Set Default for Session' can be
+used to set the default identity to the current identity until you exit Emacs.
+The menu item `Save as Default' sets the option `mh-identity-default' to the
+current identity setting. You can also customize the `mh-identity-default'
+option in the usual fashion."
   :type '(repeat (list :tag ""
                        (string :tag "Label")
                        (repeat :tag "Add at least one item below"
@@ -489,12 +501,38 @@
 
 (defcustom mh-auto-fields-list nil
   "List of recipients for which header lines are automatically inserted.
-Each element consists of the recipient, which is a regular expression, and a
-collection of header fields and identities to insert if the message is sent to
-this recipient. The `Value Menu' contains the common header fields `Fcc' and
-`Mail-Followup-To'. Other header fields may be added using the `Other Field'
-menu item. The `Identity' menu item is used to insert entire identities with
-`mh-insert-identity'."
+
+This option can be used to set the identity depending on the recipient. To
+customize this option, click on the `INS' button and enter a regular
+expression for the recipient's address. Click on the `INS' button with the
+`Add at least one item below' label. Then choose one of the items in the
+`Value Menu'.
+
+The `Identity' menu item is used to select an identity from those configured
+in `mh-identity-list'. All of the information for that identity will be added
+if the recipient matches. The `Fcc Field' menu item is used to select a folder
+that is used in the `Fcc:' header. When you send the message, MH will put a
+copy of your message in this folder. The `Mail-Followup-To Field' menu item is
+used to insert an `Mail-Followup-To:' header field with the recipients you
+provide. If the recipient's mail user agent supports this header field (as nmh
+does), then their replies will go to the addresses listed. This is useful if
+their replies go both to the list and to you and you don't have a mechanism to
+suppress duplicates. If you reply to someone not on the list, you must either
+remove the `Mail-Followup-To:' field, or ensure the recipient is also listed
+there so that he receives replies to your reply. Other header fields may be
+added using the `Other Field' menu item.
+
+These fields can only be added after the recipient is known. Once the header
+contains one or more recipients, run the \\[mh-insert-auto-fields] command or
+choose the `Identity -> Insert Auto Fields' menu item to insert these fields
+manually. However, you can just send the message and the fields will be added
+automatically. You are given a chance to see these fields and to confirm them
+before the message is actually sent. You can do away with this confirmation by
+turning off the option `mh-auto-fields-prompt-flag'.
+
+You should avoid using the same header field in `mh-auto-fields-list' and
+`mh-identity-list' definitions that may apply to the same message as the
+result is undefined."
   :type `(repeat
           (list :tag ""
                 (string :tag "Recipient")
@@ -525,7 +563,8 @@
   :group 'mh-identity)
 
 (defcustom mh-identity-default nil
-  "Default identity to use when `mh-letter-mode' is called."
+  "Default identity to use when `mh-letter-mode' is called.
+See `mh-identity-list'."
   :type (append
          '(radio)
          (cons '(const :tag "None" nil)
@@ -534,16 +573,32 @@
   :group 'mh-identity)
 
 (defcustom mh-identity-handlers
-  '((":default" . mh-identity-handler-bottom)
-    ("from" . mh-identity-handler-top)
+  '(("From" . mh-identity-handler-top)
+    (":default" . mh-identity-handler-bottom)
     (":attribution-verb" . mh-identity-handler-attribution-verb)
     (":signature" . mh-identity-handler-signature)
     (":pgg-default-user-id" . mh-identity-handler-gpg-identity))
   "Handler functions for fields in `mh-identity-list'.
-This is an alist of fields (strings) and handlers (functions). Strings are
-lowercase. Use \":signature\" for Signature and \":pgg-default-user-id\" for
-GPG Key ID. The function associated with the string \":default\" is used if no
-other functions are appropriate."
+
+This option is used to change the way that fields, signatures, and
+attributions in `mh-identity-list' are added. To customize
+`mh-identity-handlers', replace the name of an existing handler function
+associated with the field you want to change with the name of a function you
+have written. You can also click on an `INS' button and insert a field of your
+choice and the name of the function you have written to handle it.
+
+The `Field' field can be any field that you've used in your
+`mh-identity-list'. The special fields `:attribution-verb', `:signature', or
+`:pgg-default-user-id' are used for the `mh-identity-list' choices
+`Attribution Verb', `Signature', and `GPG Key ID' respectively.
+
+The handler associated with the `:default' field is used when no other field
+matches.
+
+The handler functions are passed two or three arguments: the FIELD itself (for
+example, `From'), or one of the special fields (for example, `:signature'),
+and the ACTION `'remove' or `'add'. If the action is `'add', an additional
+argument containing the VALUE for the field is given."
   :type '(repeat (cons (string :tag "Field") function))
   :group 'mh-identity)
 
@@ -552,45 +607,45 @@
 ;;; Incorporating Your Mail (:group 'mh-inc)
 
 (defcustom mh-inc-prog "inc"
-  "*Program to run to incorporate new mail into a folder.
-Normally \"inc\". This program is relative to the `mh-progs' directory unless
-it is an absolute pathname."
+  "*Program to incorporate new mail into a folder.
+
+This program generates a one-line summary for each of the new messages. Unless
+it is an absolute pathname, the file is assumed to be in the `mh-progs'
+directory. You may also link a file to `inc' that uses a different format.
+You'll then need to modify several scan line format variables appropriately."
   :type 'string
   :group 'mh-inc)
 
 (defcustom mh-inc-spool-list nil
-  "*Alist of alternate spool files, corresponding folders and keybindings.
-This option will be described by example.
+  "*Alternate spool files.
 
-Suppose you have subscribed to the mh-e-devel mailing list and you use
-procmail to filter its mail into `~/mail/mh-e' with the following
-`.procmailrc' recipe:
+You can use the `mh-inc-spool-list' variable to direct MH-E to retrieve mail
+from arbitrary spool files other than your system mailbox, file it in folders
+other than your `+inbox', and assign key bindings to incorporate this mail.
+
+Suppose you are subscribed to the `mh-e-devel' mailing list and you use
+`procmail' to filter this mail into `~/mail/mh-e' with the following recipe in
+`.procmailrc':
 
     MAILDIR=$HOME/mail
     :0:
-    * ^From mh-e-devel-admin@lists.sourceforge.net
+    * ^From mh-e-devel-admin@stop.mail-abuse.org
     mh-e
 
-If you wanted to incorporate that spool file into an MH folder called mh-e
-with the \"I m\" or \\[mh-inc-spool-mh-e] commands, you would use the
-following:
+In order to incorporate `~/mail/mh-e' into `+mh-e' with an `I m'
+\(`mh-inc-spool-mh-e'\) command, customize this option, and click on the `INS'
+button. Enter a `Spool File' of `~/mail/mh-e', a `Folder' of `mh-e', and a
+`Key Binding' of `m'.
 
-    Spool File:  ~/mail/mh-e
-    Folder:      mh-e
-    Key Binding: m
-
-Then, you could also install `xbuffy' and configure an extra mailbox using the
-gnuserv package to run the `mh-inc-spool-mh-e' command in Emacs:
+You can use `xbuffy' to automate the incorporation of this mail using the
+`gnudoit' command in the `gnuserv' package as follows:
 
     box ~/mail/mh-e
         title mh-e
         origMode
         polltime 10
         headertime 0
-        command gnudoit -q '(mh-inc-spool-mh-e)'
-
-To incorporate the spool file, click the xbuffy box with the middle mouse
-button."
+        command gnudoit -q '(mh-inc-spool-mh-e)'"
   :type '(repeat (list (file :tag "Spool File")
                        (string :tag "Folder")
                        (character :tag "Key Binding")))
@@ -602,10 +657,10 @@
 ;;; Searching (:group 'mh-index)
 
 (defcustom mh-index-new-messages-folders t
-  "Folders searched for the `unseen' sequence.
-This option can be set to `Inbox' to search the `+inbox' folder or `All' to
+  "Folders searched for the \"unseen\" sequence.
+Set this option to \"Inbox\" to search the \"+inbox\" folder or \"All\" to
 search all of the top level folders. Otherwise, list the folders that should
-be searched with the `Choose Folders' menu item.
+be searched with the \"Choose Folders\" menu item.
 
 See also `mh-recursive-folders-flag'."
   :group 'mh-index
@@ -633,9 +688,9 @@
 
 (defcustom mh-index-ticked-messages-folders t
   "Folders searched for `mh-tick-seq'.
-This option can be set to `Inbox' to search the `+inbox' folder or `All' to
+Set this option to \"Inbox\" to search the \"+inbox\" folder or \"All\" to
 search all of the top level folders. Otherwise, list the folders that should
-be searched with the `Choose Folders' menu item.
+be searched with the \"Choose Folders\" menu item.
 
 See also `mh-recursive-folders-flag'."
   :group 'mh-index
@@ -672,25 +727,6 @@
                   finally return (car element)))))
 
 ;; User customizable variables
-(defcustom mh-junk-disposition nil
-  "Disposition of junk mail."
-  :type '(choice (const :tag "Delete Spam" nil)
-                 (string :tag "Spam Folder"))
-  :group 'mh-junk)
-
-(defcustom mh-junk-program nil
-  "Spam program that MH-E should use.
-The default setting of this option is `Auto-detect' which means that MH-E will
-automatically choose one of SpamAssassin, Bogofilter, or SpamProbe in that
-order. If, for example, you have both SpamAssassin and Bogofilter installed
-and you want to use BogoFilter, then you can set this option to `Bogofilter'."
-  :type '(choice (const :tag "Auto-detect" nil)
-                 (const :tag "SpamAssassin" spamassassin)
-                 (const :tag "Bogofilter" bogofilter)
-                 (const :tag "SpamProbe" spamprobe))
-  :set 'mh-junk-choose
-  :group 'mh-junk)
-
 (defcustom mh-junk-background nil
   "If on, spam programs are run in background.
 By default, the programs are run in the foreground, but this can be slow when
@@ -700,23 +736,31 @@
                  (const :tag "On" 0))
   :group 'mh-junk)
 
+(defcustom mh-junk-disposition nil
+  "Disposition of junk mail."
+  :type '(choice (const :tag "Delete Spam" nil)
+                 (string :tag "Spam Folder"))
+  :group 'mh-junk)
+
+(defcustom mh-junk-program nil
+  "Spam program that MH-E should use.
+
+The default setting of this option is \"Auto-detect\" which means that MH-E
+will automatically choose one of SpamAssassin, Bogofilter, or SpamProbe in
+that order. If, for example, you have both SpamAssassin and Bogofilter
+installed and you want to use BogoFilter, then you can set this option to
+\"Bogofilter\"."
+  :type '(choice (const :tag "Auto-detect" nil)
+                 (const :tag "SpamAssassin" spamassassin)
+                 (const :tag "Bogofilter" bogofilter)
+                 (const :tag "SpamProbe" spamprobe))
+  :set 'mh-junk-choose
+  :group 'mh-junk)
+
 
 
 ;;; Editing a Draft (:group 'mh-letter)
 
-(defcustom mh-mml-method-default (if mh-gnus-pgp-support-flag "pgpmime" "none")
-  "Default method to use in security directives."
-  :type '(choice (const :tag "PGP (MIME)" "pgpmime")
-                 (const :tag "PGP" "pgp")
-                 (const :tag "S/MIME" "smime")
-                 (const :tag "None" "none"))
-  :group 'mh-letter)
-
-(defcustom mh-compose-forward-as-mime-flag t
-  "Non-nil means that messages are forwarded as a MIME part."
-  :type 'boolean
-  :group 'mh-letter)
-
 (defcustom mh-compose-insertion (if (locate-library "mml") 'gnus 'mhn)
   "Type of MIME message directives in messages.
 
@@ -761,11 +805,6 @@
   :type 'string
   :group 'mh-letter)
 
-(defcustom mh-insert-x-mailer-flag t
-  "*Non-nil means append an X-Mailer field to the header."
-  :type 'boolean
-  :group 'mh-letter)
-
 (defcustom mh-letter-complete-function 'ispell-complete-word
   "*Function to call when completing outside of address or folder fields.
 By default, this is set to `ispell-complete-word'."
@@ -780,16 +819,12 @@
   :type 'integer
   :group 'mh-letter)
 
-(defcustom mh-reply-show-message-flag t
-  "*Non-nil means the show buffer is displayed using \\<mh-letter-mode-map>\\[mh-reply].
-
-The setting of this variable determines whether the MH `show-buffer' is
-displayed with the current message when using `mh-reply' without a prefix
-argument.  Set it to nil if you already include the message automatically
-in your draft using
- repl: -filter repl.filter
-in your ~/.mh_profile file."
-  :type 'boolean
+(defcustom mh-mml-method-default (if mh-gnus-pgp-support-flag "pgpmime" "none")
+  "Default method to use in security directives."
+  :type '(choice (const :tag "PGP (MIME)" "pgpmime")
+                 (const :tag "PGP" "pgp")
+                 (const :tag "S/MIME" "smime")
+                 (const :tag "None" "none"))
   :group 'mh-letter)
 
 (defcustom mh-signature-file-name "~/.signature"
@@ -881,14 +916,14 @@
 If the show buffer has a region, this variable is ignored unless its value is
 one of `attribution' or `autoattrib' in which case the attribution is added
 to the yanked region."
-  :type '(choice (const :tag "Below point" nil)
-                 (const :tag "Without header" body)
+  :type '(choice (const :tag "Body and Header" t)
+                 (const :tag "Body" body)
+                 (const :tag "Below Point" nil)
                  (const :tag "Invoke supercite" supercite)
-                 (const :tag "Invoke supercite, automatically" autosupercite)
-                 (const :tag "Without header, with attribution" attribution)
-                 (const :tag "Without header, with attribution, automatically"
-                        autoattrib)
-                 (const :tag "Entire message with headers" t))
+                 (const :tag "Invoke supercite, Automatically" autosupercite)
+                 (const :tag "Body With Attribution" attribution)
+                 (const :tag "Body With Attribution, Automatically"
+                        autoattrib))
   :group 'mh-letter)
 
 
@@ -947,6 +982,11 @@
 
 ;;; Sending Mail (:group 'mh-sending-mail)
 
+(defcustom mh-compose-forward-as-mime-flag t
+  "Non-nil means that messages are forwarded as a MIME part."
+  :type 'boolean
+  :group 'mh-sending-mail)
+
 (defcustom mh-compose-letter-function nil
   "Invoked when setting up a letter draft.
 It is passed three arguments: TO recipients, SUBJECT, and CC recipients."
@@ -965,6 +1005,11 @@
   :type 'string
   :group 'mh-sending-mail)
 
+(defcustom mh-insert-x-mailer-flag t
+  "*Non-nil means append an X-Mailer field to the header."
+  :type 'boolean
+  :group 'mh-sending-mail)
+
 (defcustom mh-reply-default-reply-to nil
   "*Sets the person or persons to whom a reply will be sent.
 If nil, prompt for recipient.  If non-nil, then \\<mh-folder-mode-map>`\\[mh-reply]' will use this
@@ -975,6 +1020,18 @@
                  (const "cc") (const "all"))
   :group 'mh-sending-mail)
 
+(defcustom mh-reply-show-message-flag t
+  "*Non-nil means the show buffer is displayed using \\<mh-letter-mode-map>\\[mh-reply].
+
+The setting of this variable determines whether the MH `show-buffer' is
+displayed with the current message when using `mh-reply' without a prefix
+argument.  Set it to nil if you already include the message automatically
+in your draft using
+ repl: -filter repl.filter
+in your ~/.mh_profile file."
+  :type 'boolean
+  :group 'mh-sending-mail)
+
 
 
 ;;; Sequences (:group 'mh-sequences)
@@ -1120,6 +1177,7 @@
     "Delivered-To:"              ; Egroups/yahoogroups mailing list manager
     "Delivery-Date:"                    ; MH
     "Delivery:"
+    "DomainKey-Signature:"              ;http://antispam.yahoo.com/domainkeys
     "Encoding:"
     "Envelope-to:"
     "Errors-To:"
@@ -1188,6 +1246,7 @@
     "X-Envelope-From:"
     "X-Envelope-Sender:"
     "X-Envelope-To:"
+    "X-Evolution:"			; Evolution mail client
     "X-Face:"
     "X-Folder:"                         ; Spam
     "X-From-Line"
@@ -1264,6 +1323,7 @@
     "X-Trace:"
     "X-UID"
     "X-UIDL:"
+    "X-USANET-"                         ; usa.net
     "X-UserInfo1:"
     "X-VSMLoop:"                        ; NTMail
     "X-Vms-To:"
@@ -1527,13 +1587,13 @@
 (defun mh-tool-bar-folder-help ()
   "Visit \"(mh-e)Top\"."
   (interactive)
-  (Info-goto-node "(mh-e)Top")
+  (info "(mh-e)Top")
   (delete-other-windows))
 
 (defun mh-tool-bar-letter-help ()
   "Visit \"(mh-e)Draft Editing\"."
   (interactive)
-  (Info-goto-node "(mh-e)Draft Editing")
+  (info "(mh-e)Draft Editing")
   (delete-other-windows))
 
 (defmacro mh-tool-bar-reply-generator (function recipient folder-buffer-flag)
@@ -1907,9 +1967,9 @@
   ;; Common buttons
   (mh-tool-bar-customize (folder letter) "preferences" "MH-E Preferences")
   (mh-tool-bar-folder-help (folder) "help"
-    "Help! (general help)\nThis button runs `Info-goto-node'")
+    "Help! (general help)\nThis button runs `info'")
   (mh-tool-bar-letter-help (letter) "help"
-    "Help! (general help)\nThis button runs `Info-goto-node'")
+    "Help! (general help)\nThis button runs `info'")
   ;; Folder narrowed to sequence buttons
   (mh-widen (sequence) "widen"
     "Widen from the sequence\nThis button runs `mh-widen'"))
@@ -2085,7 +2145,7 @@
 ;;; Faces Used in Scan Listing (:group 'mh-folder-faces)
 
 (defvar mh-folder-body-face 'mh-folder-body-face
-  "Face for highlighting body text in MH-Folder buffers.")
+  "Face used to highlight body text in MH-Folder buffers.")
 (defface mh-folder-body-face
   '((((type tty) (class color)) (:foreground "green"))
     (((class grayscale) (background light)) (:foreground "DimGray" :italic t))
@@ -2093,11 +2153,11 @@
     (((class color) (background light)) (:foreground "RosyBrown"))
     (((class color) (background dark)) (:foreground "LightSalmon"))
     (t (:italic t)))
-  "Face for highlighting body text in MH-Folder buffers."
+  "Face used to highlight body text in MH-Folder buffers."
   :group 'mh-folder-faces)
 
 (defvar mh-folder-cur-msg-face 'mh-folder-cur-msg-face
-  "Face for the current message line in MH-Folder buffers.")
+  "Face used for the current message line in MH-Folder buffers.")
 (defface mh-folder-cur-msg-face
   '((((type tty pc) (class color))
      (:background "LightGreen"))
@@ -2108,11 +2168,11 @@
     (((class color) (background dark))
      (:background "DarkOliveGreen4"))
     (t (:underline t)))
-  "Face for the current message line in MH-Folder buffers."
+  "Face used for the current message line in MH-Folder buffers."
   :group 'mh-folder-faces)
 
 (defvar mh-folder-cur-msg-number-face 'mh-folder-cur-msg-number-face
-  "Face for highlighting the current message in MH-Folder buffers.")
+  "Face used to highlight the current message in MH-Folder buffers.")
 (defface mh-folder-cur-msg-number-face
   '((((type tty) (class color)) (:foreground "cyan" :weight bold))
     (((class grayscale) (background light)) (:foreground "LightGray" :bold t))
@@ -2120,11 +2180,11 @@
     (((class color) (background light)) (:foreground "Purple"))
     (((class color) (background dark)) (:foreground "Cyan"))
     (t (:bold t)))
-  "Face for highlighting the current message in MH-Folder buffers."
+  "Face used to highlight the current message in MH-Folder buffers."
   :group 'mh-folder-faces)
 
 (defvar mh-folder-date-face 'mh-folder-date-face
-  "Face for highlighting the date in MH-Folder buffers.")
+  "Face used to highlight the date in MH-Folder buffers.")
 (defface mh-folder-date-face
   '((((class color) (background light))
      (:foreground "snow4"))
@@ -2132,11 +2192,11 @@
      (:foreground "snow3"))
     (t
      (:bold t)))
-  "Face for highlighting the date in MH-Folder buffers."
+  "Face used to highlight the date in MH-Folder buffers."
   :group 'mh-folder-faces)
 
 (defvar mh-folder-followup-face 'mh-folder-followup-face
-  "Face for highlighting Re: (followup) subject text in MH-Folder buffers.")
+  "Face used to highlight Re: subject text in MH-Folder buffers.")
 (defface mh-folder-followup-face
   '((((class color) (background light))
      (:foreground "blue3"))
@@ -2144,11 +2204,11 @@
      (:foreground "LightGoldenRod"))
     (t
      (:bold t)))
-  "Face for highlighting Re: (followup) subject text in MH-Folder buffers."
+  "Face used to highlight Re: subject text in MH-Folder buffers."
   :group 'mh-folder-faces)
 
 (defvar mh-folder-msg-number-face 'mh-folder-msg-number-face
-  "Face for highlighting the message number in MH-Folder buffers.")
+  "Face used to highlight the message number in MH-Folder buffers.")
 (defface mh-folder-msg-number-face
   '((((class color) (background light))
      (:foreground "snow4"))
@@ -2156,15 +2216,15 @@
      (:foreground "snow3"))
     (t
      (:bold t)))
-  "Face for highlighting the message number in MH-Folder buffers."
+  "Face used to highlight the message number in MH-Folder buffers."
   :group 'mh-folder-faces)
 
 (defvar mh-folder-deleted-face 'mh-folder-deleted-face
-  "Face for highlighting deleted messages in MH-Folder buffers.")
+  "Face used to highlight deleted messages in MH-Folder buffers.")
 (copy-face 'mh-folder-msg-number-face 'mh-folder-deleted-face)
 
 (defvar mh-folder-refiled-face 'mh-folder-refiled-face
-  "Face for highlighting refiled messages in MH-Folder buffers.")
+  "Face used to highlight refiled messages in MH-Folder buffers.")
 (defface mh-folder-refiled-face
   '((((type tty) (class color)) (:foreground "yellow" :weight light))
     (((class grayscale) (background light))
@@ -2174,11 +2234,11 @@
     (((class color) (background light)) (:foreground "DarkGoldenrod"))
     (((class color) (background dark)) (:foreground "LightGoldenrod"))
     (t (:bold t :italic t)))
-  "Face for highlighting refiled messages in MH-Folder buffers."
+  "Face used to highlight refiled messages in MH-Folder buffers."
   :group 'mh-folder-faces)
 
 (defvar mh-folder-subject-face 'mh-folder-subject-face
-  "Face for highlighting subject text in MH-Folder buffers.")
+  "Face used to highlight subject text in MH-Folder buffers.")
 (if (boundp 'facemenu-unlisted-faces)
     (add-to-list 'facemenu-unlisted-faces "^mh-folder"))
 (defface mh-folder-subject-face
@@ -2188,7 +2248,7 @@
      (:foreground "yellow"))
     (t
      (:bold t)))
-  "Face for highlighting subject text in MH-Folder buffers."
+  "Face used to highlight subject text in MH-Folder buffers."
   :group 'mh-folder-faces)
 
 (defface mh-folder-tick-face
@@ -2199,15 +2259,15 @@
   :group 'mh-folder-faces)
 
 (defvar mh-folder-address-face 'mh-folder-address-face
-  "Face for highlighting the address in MH-Folder buffers.")
+  "Face used to highlight the address in MH-Folder buffers.")
 (copy-face 'mh-folder-subject-face 'mh-folder-address-face)
 
 (defvar mh-folder-scan-format-face 'mh-folder-scan-format-face
-  "Face for highlighting `mh-scan-format-regexp' matches in MH-Folder buffers.")
+  "Face used to highlight `mh-scan-format-regexp' matches in MH-Folder buffers.")
 (copy-face 'mh-folder-followup-face 'mh-folder-scan-format-face)
 
 (defvar mh-folder-to-face 'mh-folder-to-face
-  "Face for highlighting the To: string in MH-Folder buffers.")
+  "Face used to highlight the To: string in MH-Folder buffers.")
 (defface mh-folder-to-face
   '((((type tty) (class color)) (:foreground "green"))
     (((class grayscale) (background light)) (:foreground "DimGray" :italic t))
@@ -2215,7 +2275,7 @@
     (((class color) (background light)) (:foreground "RosyBrown"))
     (((class color) (background dark)) (:foreground "LightSalmon"))
     (t (:italic t)))
-  "Face for highlighting the To: string in MH-Folder buffers."
+  "Face used to highlight the To: string in MH-Folder buffers."
   :group 'mh-folder-faces)
 
 
@@ -2223,7 +2283,7 @@
 ;;; Faces Used in Searching (:group 'mh-index-faces)
 
 (defvar mh-index-folder-face 'mh-index-folder-face
-  "Face for highlighting folders in MH-Index buffers.")
+  "Face used to highlight folders in MH-Index buffers.")
 (defface mh-index-folder-face
   '((((class color) (background light))
      (:foreground "dark green" :bold t))
@@ -2231,7 +2291,7 @@
      (:foreground "indian red" :bold t))
     (t
      (:bold t)))
-  "Face for highlighting folders in MH-Index buffers."
+  "Face used to highlight folders in MH-Index buffers."
   :group 'mh-index-faces)
 
 
@@ -2244,7 +2304,7 @@
     (((class color) (background dark))
      (:background "gray10"))
     (t (:bold t)))
-  "Face for displaying header fields in draft buffers."
+  "Face used to display header fields in draft buffers."
   :group 'mh-letter-faces)
 
 
@@ -2252,7 +2312,7 @@
 ;;; Faces Used in Message Display (:group 'mh-show-faces)
 
 (defvar mh-show-cc-face 'mh-show-cc-face
-  "Face for highlighting cc header fields.")
+  "Face used to highlight cc: header fields.")
 (defface mh-show-cc-face
   '((((type tty) (class color)) (:foreground "yellow" :weight light))
     (((class grayscale) (background light))
@@ -2262,11 +2322,11 @@
     (((class color) (background light)) (:foreground "DarkGoldenrod"))
     (((class color) (background dark)) (:foreground "LightGoldenrod"))
     (t (:bold t :italic t)))
-  "Face for highlighting cc header fields."
+  "Face used to highlight cc: header fields."
   :group 'mh-show-faces)
 
 (defvar mh-show-date-face 'mh-show-date-face
-  "Face for highlighting the Date header field.")
+  "Face used to highlight the Date: header field.")
 (defface mh-show-date-face
   '((((type tty) (class color)) (:foreground "green"))
     (((class grayscale) (background light)) (:foreground "Gray90" :bold t))
@@ -2274,7 +2334,7 @@
     (((class color) (background light)) (:foreground "ForestGreen"))
     (((class color) (background dark)) (:foreground "PaleGreen"))
     (t (:bold t :underline t)))
-  "Face for highlighting the Date header field."
+  "Face used to highlight the Date: header field."
   :group 'mh-show-faces)
 
 (defvar mh-show-header-face 'mh-show-header-face
@@ -2289,13 +2349,36 @@
   "Face used to deemphasize unspecified header fields."
   :group 'mh-show-faces)
 
+(defvar mh-show-pgg-good-face 'mh-show-pgg-good-face
+  "Face used to highlight a good PGG signature.")
+(defface mh-show-pgg-good-face
+  '((t (:bold t :foreground "LimeGreen")))
+  "Face used to highlight a good PGG signature."
+  :group 'mh-show-faces)
+
+(defvar mh-show-pgg-unknown-face 'mh-show-pgg-unknown-face
+  "Face used to highlight a PGG signature whose status is unknown.
+This face is also used for a signature when the signer is untrusted.")
+(defface mh-show-pgg-unknown-face
+  '((t (:bold t :foreground "DarkGoldenrod2")))
+  "Face used to highlight a PGG signature whose status is unknown.
+This face is also used for a signature when the signer is untrusted."
+  :group 'mh-show-faces)
+
+(defvar mh-show-pgg-bad-face 'mh-show-pgg-bad-face
+  "Face used to highlight a bad PGG signature.")
+(defface mh-show-pgg-bad-face
+  '((t (:bold t :foreground "DeepPink1")))
+  "Face used to highlight a bad PGG signature."
+  :group 'mh-show-faces)
+
 (defface mh-show-signature-face
   '((t (:italic t)))
-  "Face for highlighting message signature."
+  "Face used to highlight the message signature."
   :group 'mh-show-faces)
 
 (defvar mh-show-to-face 'mh-show-to-face
-  "Face for highlighting the To: header field.")
+  "Face used to highlight the To: header field.")
 (if (boundp 'facemenu-unlisted-faces)
     (add-to-list 'facemenu-unlisted-faces "^mh-show"))
 (defface mh-show-to-face
@@ -2306,11 +2389,11 @@
     (((class color) (background light)) (:foreground "SaddleBrown"))
     (((class color) (background dark))  (:foreground "burlywood"))
     (t (:underline t)))
-  "Face for highlighting the To: header field."
+  "Face used to highlight the To: header field."
   :group 'mh-show-faces)
 
 (defvar mh-show-from-face 'mh-show-from-face
-  "Face for highlighting the From: header field.")
+  "Face used to highlight the From: header field.")
 (defface mh-show-from-face
   '((((class color) (background light))
      (:foreground "red3"))
@@ -2318,17 +2401,17 @@
      (:foreground "cyan"))
     (t
      (:bold t)))
-  "Face for highlighting the From: header field."
+  "Face used to highlight the From: header field."
   :group 'mh-show-faces)
 
 (defface mh-show-xface-face
   '((t (:foreground "black" :background "white")))
-  "Face for displaying the X-Face image.
+  "Face used to display the X-Face image.
 The background and foreground is used in the image."
   :group 'mh-show-faces)
 
 (defvar mh-show-subject-face 'mh-show-subject-face
-  "Face for highlighting the Subject header field.")
+  "Face used to highlight the Subject: header field.")
 (copy-face 'mh-folder-subject-face 'mh-show-subject-face)
 
 
--- a/lisp/mh-e/mh-e.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/mh-e/mh-e.el	Fri Jun 03 05:49:26 2005 +0000
@@ -1,11 +1,12 @@
 ;;; mh-e.el --- GNU Emacs interface to the MH mail system
 
-;; Copyright (C) 1985, 86, 87, 88, 90, 92, 93, 94, 95, 97, 1999,
-;;  2000, 2005 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 1986, 1987, 1988,
+;;  1990, 1992, 1993, 1994, 1995, 1997, 1999,
+;;  2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
 
 ;; Author: Bill Wohler <wohler@newt.com>
 ;; Maintainer: Bill Wohler <wohler@newt.com>
-;; Version: 7.82
+;; Version: 7.84
 ;; Keywords: mail
 
 ;; This file is part of GNU Emacs.
@@ -97,10 +98,7 @@
 (defvar font-lock-auto-fontify)
 (defvar font-lock-defaults)
 
-(defconst mh-version "7.82" "Version number of MH-E.")
-
-;;; Autoloads
-(autoload 'Info-goto-node "info")
+(defconst mh-version "7.84" "Version number of MH-E.")
 
 (defvar mh-partial-folder-mode-line-annotation "select"
   "Annotation when displaying part of a folder.
@@ -578,7 +576,8 @@
       (setq folder mh-inbox))
   (let ((threading-needed-flag nil))
     (let ((config (current-window-configuration)))
-      (delete-other-windows)
+      (when (and mh-show-buffer (get-buffer mh-show-buffer))
+        (delete-windows-on mh-show-buffer))
       (cond ((not (get-buffer folder))
              (mh-make-folder folder)
              (setq threading-needed-flag mh-show-threads-flag)
@@ -717,22 +716,24 @@
     (mh-refile-a-msg nil folder))
   (when (looking-at mh-scan-refiled-msg-regexp) (mh-next-msg)))
 
-(defun mh-refile-or-write-again (message)
-  "Re-execute the last refile or write command on the given MESSAGE.
+(defun mh-refile-or-write-again (range &optional interactive-flag)
+  "Re-execute the last refile or write command on the given RANGE.
 Default is the displayed message. Use the same folder or file as the previous
-refile or write command."
-  (interactive (list (mh-get-msg-num t)))
+refile or write command.
+If INTERACTIVE-FLAG is non-nil then the function was called interactively."
+  (interactive (list (mh-interactive-range "Redo") t))
   (if (null mh-last-destination)
       (error "No previous refile or write"))
   (let (output)
     (setq output
           (cond ((eq (car mh-last-destination) 'refile)
-                 (mh-refile-a-msg message (cdr mh-last-destination))
+                 (mh-refile-msg range (cdr mh-last-destination))
                  (format "Destination folder: %s" (cdr mh-last-destination)))
                 (t
-                 (apply 'mh-write-msg-to-file message (cdr mh-last-destination))
+                 (mh-iterate-on-range msg range
+                   (apply 'mh-write-msg-to-file msg (cdr mh-last-destination)))
+                 (mh-next-msg interactive-flag)
                  (format "Destination: %s" (cdr mh-last-destination)))))
-    (mh-next-msg (interactive-p))
     (message output)))
 
 (defun mh-quit ()
@@ -1801,7 +1802,7 @@
         (message "inc %s..." folder))
       (setq mh-next-direction 'forward)
       (goto-char (point-max))
-      (mh-remove-all-notation)
+      (mh-remove-cur-notation)
       (let ((start-of-inc (point)))
         (if maildrop-name
             ;; I think MH 5 used "-ms-file" instead of "-file",
@@ -1827,7 +1828,7 @@
                                          start-of-inc (point-max))))
                         (delete-region start-of-inc (point-max))
                         (unwind-protect (mh-widen t)
-                          (mh-remove-all-notation)
+                          (mh-remove-cur-notation)
                           (goto-char (point-max))
                           (setq start-of-inc (point))
                           (insert saved-text)
@@ -1846,7 +1847,15 @@
               (t
                (setq new-mail-flag t)))
         (keep-lines mh-scan-valid-regexp) ; Flush random scan lines
-        (setq mh-seq-list (mh-read-folder-sequences folder t))
+        (let* ((sequences (mh-read-folder-sequences folder t))
+               (new-cur (assoc 'cur sequences))
+               (new-unseen (assoc mh-unseen-seq sequences)))
+          (unless (assoc 'cur mh-seq-list)
+            (push (list 'cur) mh-seq-list))
+          (unless (assoc mh-unseen-seq mh-seq-list)
+            (push (list mh-unseen-seq) mh-seq-list))
+          (setcdr (assoc 'cur mh-seq-list) (cdr new-cur))
+          (setcdr (assoc mh-unseen-seq mh-seq-list) (cdr new-unseen)))
         (when (equal (point-max) start-of-inc)
           (mh-notate-cur))
         (if new-mail-flag
@@ -1858,8 +1867,7 @@
                 (mh-thread-inc folder start-of-inc))
               (mh-goto-cur-msg))
           (goto-char point-before-inc))
-        (mh-notate-user-sequences)
-        (mh-notate-deleted-and-refiled)))))
+        (mh-notate-user-sequences (cons start-of-inc (point-max)))))))
 
 (defun mh-make-folder-mode-line (&optional ignored)
   "Set the fields of the mode line for a folder buffer.
@@ -2033,18 +2041,18 @@
                             (mh-coalesce-msg-list msgs))
                      (mh-delete-scan-msgs msgs)
                      ;; Preserve sequences in destination folder...
-                     (when (and mh-refile-preserves-sequences-flag
-                                (numberp last))
+                     (when mh-refile-preserves-sequences-flag
                        (clrhash dest-map)
-                       (loop for i from (1+ last)
+                       (loop for i from (1+ (or last 0))
                              for msg in (sort (copy-sequence msgs) #'<)
                              do (loop for seq-name in (gethash msg seq-map)
                                       do (push i (gethash seq-name dest-map))))
                        (maphash
                         #'(lambda (seq msgs)
-                            ;; Run it in the background, since we don't care
-                            ;; about the results.
-                            (apply #'mh-exec-cmd-daemon "mark" #'ignore
+                            ;; Can't be run in the background, since the
+                            ;; current folder is changed by mark this could
+                            ;; lead to a race condition with the next refile.
+                            (apply #'mh-exec-cmd "mark"
                                    "-sequence" (symbol-name seq) dest-folder
                                    "-add" (mapcar #'(lambda (x) (format "%s" x))
                                                   (mh-coalesce-msg-list msgs))))
@@ -2201,13 +2209,14 @@
         (end-of-line (save-excursion (end-of-line) (point)))
         num)
     (while (re-search-forward "[0-9]+" end-of-line t)
-      (setq num (string-to-int (buffer-substring (match-beginning 0)
-                                                 (match-end 0))))
+      (setq num (string-to-number (buffer-substring (match-beginning 0)
+                                                    (match-end 0))))
       (cond ((looking-at "-")           ; Message range
              (forward-char 1)
              (re-search-forward "[0-9]+" end-of-line t)
-             (let ((num2 (string-to-int (buffer-substring (match-beginning 0)
-                                                          (match-end 0)))))
+             (let ((num2 (string-to-number
+                          (buffer-substring (match-beginning 0)
+                                            (match-end 0)))))
                (if (< num2 num)
                    (error "Bad message range: %d-%d" num num2))
                (while (<= num num2)
--- a/lisp/mh-e/mh-funcs.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/mh-e/mh-funcs.el	Fri Jun 03 05:49:26 2005 +0000
@@ -1,6 +1,7 @@
 ;;; mh-funcs.el --- MH-E functions not everyone will use right away
 
-;; Copyright (C) 1993, 1995, 2005 Free Software Foundation, Inc.
+;; Copyright (C) 1993, 1995,
+;; 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 
 ;; Author: Bill Wohler <wohler@newt.com>
 ;; Maintainer: Bill Wohler <wohler@newt.com>
@@ -127,7 +128,7 @@
   (set-buffer (get-buffer-create mh-temp-buffer))
   (insert-before-markers output)
   (when (save-excursion
-          (beginning-of-buffer)
+          (goto-char (point-min))
           (re-search-forward "^rmf: " (point-max) t))
     (display-buffer mh-temp-buffer)))
 
@@ -148,7 +149,7 @@
                                             "-recurse"
                                           "-norecurse"))
         (goto-char (point-min))
-        (view-mode 1)
+        (view-mode-enter)
         (setq view-exit-action 'kill-buffer)
         (message "Listing folders...done")))))
 
--- a/lisp/mh-e/mh-gnus.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/mh-e/mh-gnus.el	Fri Jun 03 05:49:26 2005 +0000
@@ -1,6 +1,6 @@
 ;;; mh-gnus.el --- Make MH-E compatible with installed version of Gnus.
 
-;; Copyright (C) 2005 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2004 Free Software Foundation, Inc.
 
 ;; Author: Satyaki Das <satyaki@theforce.stanford.edu>
 ;; Maintainer: Bill Wohler <wohler@newt.com>
--- a/lisp/mh-e/mh-identity.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/mh-e/mh-identity.el	Fri Jun 03 05:49:26 2005 +0000
@@ -1,6 +1,6 @@
 ;;; mh-identity.el --- Multiple identify support for MH-E.
 
-;; Copyright (C) 2005 Free Software Foundation, Inc.
+;; Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
 
 ;; Author: Peter S. Galbraith <psg@debian.org>
 ;; Maintainer: Bill Wohler <wohler@newt.com>
@@ -87,18 +87,18 @@
 ;;;###mh-autoload
 (defun mh-identity-list-set (symbol value)
   "Update the `mh-identity-list' variable, and rebuild the menu.
-Sets the default for SYMBOL (e.g. `mh-identity-list') to VALUE (as set in
-customization).  This is called after 'customize is used to alter
+Sets the default for SYMBOL (for example, `mh-identity-list') to VALUE (as set
+in customization). This is called after 'customize is used to alter
 `mh-identity-list'."
   (set-default symbol value)
   (mh-identity-make-menu))
 
 (defvar mh-identity-local nil
-  "Buffer-local variable holding the identity currently in use.")
+  "Buffer-local variable that holds the identity currently in use.")
 (make-variable-buffer-local 'mh-identity-local)
 
 (defun mh-header-field-delete (field value-only)
-  "Delete FIELD in the mail header, or only its value if VALUE-ONLY is t.
+  "Delete header FIELD, or only its value if VALUE-ONLY is t.
 Return t if anything is deleted."
   (let ((field-colon (if (string-match "^.*:$" field)
                          field
@@ -119,11 +119,11 @@
   "Marker for the end of a signature inserted by `mh-insert-identity'.")
 
 (defun mh-identity-field-handler (field)
-  "Return the handler for a FIELD or nil if none set.
+  "Return the handler for header FIELD or nil if none set.
 The field name is downcased. If the FIELD begins with the character
 `:', then it must have a special handler defined in
 `mh-identity-handlers', else return an error since it is not a valid
-message header."
+header field."
   (or (cdr (assoc (downcase field) mh-identity-handlers))
       (and (eq (aref field 0) ?:)
            (error (format "Field %s - unknown mh-identity-handler" field)))
@@ -132,8 +132,8 @@
 
 ;;;###mh-autoload
 (defun mh-insert-identity (identity)
-  "Insert proper fields for given IDENTITY.
-Edit the `mh-identity-list' variable to define identity."
+  "Insert fields specified by given IDENTITY.
+See `mh-identity-list'."
   (interactive
    (list (completing-read
           "Identity: "
@@ -167,7 +167,8 @@
 
 ;;;###mh-autoload
 (defun mh-identity-handler-gpg-identity (field action &optional value)
-  "For FIELD \"pgg-default-user-id\", process for ACTION 'remove or 'add.
+  "Process header FIELD \":pgg-default-user-id\".
+The ACTION is one of 'remove or 'add. If 'add, the VALUE is added.
 The buffer-local variable `mh-identity-pgg-default-user-id' is set to VALUE
 when action 'add is selected."
   (cond
@@ -180,8 +181,8 @@
 
 ;;;###mh-autoload
 (defun mh-identity-handler-signature (field action &optional value)
-  "For FIELD \"signature\", process headers for ACTION 'remove or 'add.
-The VALUE is added."
+  "Process header FIELD \":signature\".
+The ACTION is one of 'remove or 'add. If 'add, the VALUE is added."
   (cond
    ((equal action 'remove)
     (when (and (markerp mh-identity-signature-start)
@@ -210,8 +211,8 @@
 
 ;;;###mh-autoload
 (defun mh-identity-handler-attribution-verb (field action &optional value)
-  "For FIELD \"attribution_verb\", process headers for ACTION 'remove or 'add.
-The VALUE is added."
+  "Process header FIELD \":attribution-verb\".
+The ACTION is one of 'remove or 'add. If 'add, the VALUE is added."
   (when (and (markerp mh-identity-attribution-verb-start)
              (markerp mh-identity-attribution-verb-end))
     (delete-region mh-identity-attribution-verb-start
@@ -239,9 +240,10 @@
          (point-max-marker))))
 
 (defun mh-identity-handler-default (field action top &optional value)
-  "For FIELD, process mh-identity headers for ACTION 'remove or 'add.
-if TOP is non-nil, add the field and it's VALUE at the top of the header, else
-add it at the bottom of the header."
+  "Process header FIELD.
+The ACTION is one of 'remove or 'add. If TOP is non-nil, add the field and its
+VALUE at the top of the header, else add it at the bottom of the header. If
+action is 'add, the VALUE is added."
   (let ((field-colon (if (string-match "^.*:$" field)
                          field
                        (concat field ":"))))
@@ -266,14 +268,16 @@
 
 ;;;###mh-autoload
 (defun mh-identity-handler-top (field action &optional value)
-  "For FIELD, process mh-identity headers for ACTION 'remove or 'add.
-If the field wasn't present, the VALUE is added at the top of the header."
+  "Process header FIELD.
+The ACTION is one of 'remove or 'add. If 'add, the VALUE is added.
+If the field wasn't present, it is added to the top of the header."
   (mh-identity-handler-default field action t value))
 
 ;;;###mh-autoload
 (defun mh-identity-handler-bottom (field action &optional value)
-  "For FIELD, process mh-identity headers for ACTION 'remove or 'add.
-If the field wasn't present, the VALUE is added at the bottom of the header."
+  "Process header FIELD.
+The ACTION is one of 'remove or 'add. If 'add, the VALUE is added.
+If the field wasn't present, it is added to the bottom of the header."
   (mh-identity-handler-default field action nil value))
 
 (provide 'mh-identity)
--- a/lisp/mh-e/mh-inc.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/mh-e/mh-inc.el	Fri Jun 03 05:49:26 2005 +0000
@@ -1,6 +1,6 @@
 ;;; mh-inc.el --- MH-E `inc' and separate mail spool handling
 ;;
-;; Copyright (C) 2005 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2004 Free Software Foundation, Inc.
 
 ;; Author: Peter S. Galbraith <psg@debian.org>
 ;; Maintainer: Bill Wohler <wohler@newt.com>
@@ -98,10 +98,10 @@
 
 (provide 'mh-inc)
 
-;; Local Variables:
-;; indent-tabs-mode: nil
-;; sentence-end-double-space: nil
-;; End:
+;;; Local Variables:
+;;; indent-tabs-mode: nil
+;;; sentence-end-double-space: nil
+;;; End:
 
-;; arch-tag: 3713cf2a-6082-4cb4-8ce2-99d9acaba835
+;;; arch-tag: 3713cf2a-6082-4cb4-8ce2-99d9acaba835
 ;;; mh-inc.el ends here
--- a/lisp/mh-e/mh-index.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/mh-e/mh-index.el	Fri Jun 03 05:49:26 2005 +0000
@@ -1,6 +1,6 @@
 ;;; mh-index  --  MH-E interface to indexing programs
 
-;; Copyright (C) 2005 Free Software Foundation, Inc.
+;; Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
 
 ;; Author: Satyaki Das <satyaki@theforce.stanford.edu>
 ;; Maintainer: Bill Wohler <wohler@newt.com>
@@ -31,6 +31,7 @@
 ;;;        swish-e
 ;;;        mairix
 ;;;        namazu
+;;;        pick
 ;;;        grep
 ;;;
 ;;;  (2) To use this package, you first have to build an index. Please read
@@ -352,43 +353,74 @@
 (defun* mh-index-search (redo-search-flag folder search-regexp
                         &optional window-config)
   "Perform an indexed search in an MH mail folder.
-Use a prefix argument to repeat the search, as in REDO-SEARCH-FLAG below.
+Use a prefix argument to repeat the search.
+
+Unlike regular searches, the prompt for the folder to search can be `all' to
+search all folders; in addition, the search works recursively on the listed
+folder. The search criteria are entered in an MH-Pick buffer as described in
+`mh-search-folder'.
+
+To perform the search, type \\<mh-pick-mode-map>\\[mh-do-search]. Another
+difference from the regular searches is that because the search operates on
+more than one folder, the messages that are found are put in a temporary
+sub-folder of `+mhe-index' and are displayed in an MH-Folder buffer. This
+buffer is special because it displays messages from multiple folders; each set
+of messages from a given folder has a heading with the folder name.
+
+In addition, the \\<mh-folder-mode-map>\\[mh-index-visit-folder] command can
+be used to visit the folder of the message at point. Initially, only the
+messages that matched the search criteria are displayed in the folder. While
+the temporary buffer has its own set of message numbers, the actual messages
+numbers are shown in the visited folder. Thus, the \\[mh-index-visit-folder]
+command is useful to find the actual message number of an interesting message,
+or to view surrounding messages with the \\[mh-rescan-folder] command.
+
+Because this folder is temporary, you'll probably get in the habit of killing
+it when you're done with \\[mh-kill-folder].
 
-If REDO-SEARCH-FLAG is non-nil and the current folder buffer was generated by a
-index search, then the search is repeated. Otherwise, FOLDER is searched with
-SEARCH-REGEXP and the results are presented in an MH-E folder. If FOLDER is
-\"+\" then mail in all folders are searched. Optional argument WINDOW-CONFIG
-stores the window configuration that will be restored after the user quits the
-folder containing the index search results.
+If you have run the \\[mh-search-folder] command, but change your mind while
+entering the search criteria and actually want to run an indexed search, then
+you can use the \\<mh-pick-mode-map>\\[mh-index-do-search] command in the
+MH-Pick buffer.
+
+The \\<mh-folder-mode-map>\\[mh-index-search] command runs the command defined
+by the `mh-index-program' option. The default value is \"Auto-detect\" which
+means that MH-E will automatically choose one of \"swish++\", \"swish-e\",
+\"mairix\", \"namazu\", \"pick\" and \"grep\" in that order. If, for example,
+you have both \"swish++\" and \"mairix\" installed and you want to use
+\"mairix\", then you can set this option to \"mairix\".
+
+                                *NOTE*
 
-Four indexing programs are supported; if none of these are present, then grep
-is used. This function picks the first program that is available on your
-system. If you would prefer to use a different program, set the customization
-variable `mh-index-program' accordingly.
+     The \"pick\" and \"grep\" commands do not perform a recursive search on
+     the given folder.
 
-The documentation for the following functions describes how to generate the
-index for each program:
+This command uses an \"X-MHE-Checksum:\" header field to cache the MD5
+checksum of a message. This means that if an incoming message already contains
+an \"X-MHE-Checksum:\" field, that message might not be found by this command.
+The following \"procmail\" recipe avoids this problem by renaming the existing
+header field:
+
+     :0 wf
+     | formail -R \"X-MHE-Checksum\" \"X-Old-MHE-Checksum\"
+
+The documentation for the following commands describe how to set up the
+various indexing programs to use with MH-E. The \"pick\" and \"grep\" commands
+do not require additional configuration.
 
     - `mh-swish++-execute-search'
     - `mh-swish-execute-search'
     - `mh-mairix-execute-search'
     - `mh-namazu-execute-search'
-
-If none of these programs are present then we use pick. If desired grep can be
-used instead. Details about these methods can be found in:
-
     - `mh-pick-execute-search'
     - `mh-grep-execute-search'
 
-This and related functions use an X-MHE-Checksum header to cache the MD5
-checksum of a message. This means that already present X-MHE-Checksum headers
-in the incoming email could result in messages not being found. The following
-procmail recipe should avoid this:
-
-  :0 wf
-  | formail -R \"X-MHE-Checksum\" \"Old-X-MHE-Checksum\"
-
-This has the effect of renaming already present X-MHE-Checksum headers."
+In a program, if REDO-SEARCH-FLAG is non-nil and the current folder buffer was
+generated by a index search, then the search is repeated. Otherwise, FOLDER is
+searched with SEARCH-REGEXP and the results are presented in an MH-E folder.
+If FOLDER is \"+\" then mail in all folders are searched. Optional argument
+WINDOW-CONFIG stores the window configuration that will be restored after the
+user quits the folder containing the index search results."
   (interactive
    (list current-prefix-arg
          (progn
@@ -998,8 +1030,8 @@
 in the folder itself and does not descend into any sub-folders that may be
 present.
 
-FOLDER-PATH is the directory containing the mails to be searched and
-SEARCH-REGEXP is the pattern that pick gets."
+In a program, FOLDER-PATH is the directory in which SEARCH-REGEXP is used
+to search."
   (set-buffer (get-buffer-create mh-index-temp-buffer))
   (erase-buffer)
   (setq mh-index-pick-folder
@@ -1029,7 +1061,13 @@
 
 (defun mh-grep-execute-search (folder-path search-regexp)
   "Execute grep and read the results.
-FOLDER-PATH is the directory in which SEARCH-REGEXP is used to search."
+
+Unlike the other index search programs \"grep\" only searches messages present
+in the folder itself and does not descend into any sub-folders that may be
+present.
+
+In a program, FOLDER-PATH is the directory in which SEARCH-REGEXP is used
+to search."
   (set-buffer (get-buffer-create mh-index-temp-buffer))
   (erase-buffer)
   (call-process mh-grep-binary nil '(t nil) nil
@@ -1081,34 +1119,34 @@
 (defun mh-mairix-execute-search (folder-path search-regexp-list)
   "Execute mairix and read the results.
 
-In the examples below replace /home/user/Mail with the path to your MH
+In the examples below, replace \"/home/user/Mail\" with the path to your MH
 directory.
 
-First create the directory /home/user/Mail/.mairix. Then create the file
-/home/user/Mail/.mairix/config with the following contents:
+First create the directory \"/home/user/Mail/.mairix\". Then create the file
+\"/home/user/Mail/.mairix/config\" with the following contents:
 
-   # This should contain the same thing as your `mh-user-path'
-   base=/home/user/Mail
+     base=/home/user/Mail
 
-   # List of folders that should be indexed. 3 dots at the end means there are
-   # subfolders within the folder
-   mh_folders=archive...:inbox:drafts:news:sent:trash
+     # List of folders that should be indexed. 3 dots at the end means there
+     # are subfolders within the folder
+     mh=archive...:inbox:drafts:news:sent:trash
 
-   vfolder_format=raw
-   database=/home/user/Mail/mairix/database
+     vfolder_format=raw
+     database=/home/user/Mail/mairix/database
 
 Use the following command line to generate the mairix index. Run this daily
 from cron:
 
-    mairix -f /home/user/Mail/.mairix/config
+     mairix -f /home/user/Mail/.mairix/config
 
-FOLDER-PATH is the directory in which SEARCH-REGEXP-LIST is used to search."
+In a program, FOLDER-PATH is the directory in which SEARCH-REGEXP-LIST is used
+to search."
   (set-buffer (get-buffer-create mh-index-temp-buffer))
   (erase-buffer)
   (unless mh-mairix-binary
     (error "Set mh-mairix-binary appropriately"))
   (apply #'call-process mh-mairix-binary nil '(t nil) nil
-         "-f" (format "%s%s/config" mh-user-path mh-mairix-directory)
+         "-r" "-f" (format "%s%s/config" mh-user-path mh-mairix-directory)
          search-regexp-list)
   (goto-char (point-min))
   (setq mh-mairix-folder
@@ -1167,10 +1205,10 @@
               (let ((expr-list (cdr conjunct))
                     (expr-string ""))
                 (dolist (e expr-list)
-                  (setq expr-string (concat expr-string "+"
+                  (setq expr-string (concat expr-string ","
                                             (if (atom e) "" "~")
                                             (if (atom e) e (cadr e)))))
-                (setq final (concat final "," (substring expr-string 1)))))
+                (setq final (concat final "/" (substring expr-string 1)))))
             (substring final 1)))
          result)))
     result))
@@ -1327,52 +1365,49 @@
 (defun mh-swish-execute-search (folder-path search-regexp)
   "Execute swish-e and read the results.
 
-In the examples below, replace /home/user/Mail with the path to your MH
-directory.
+In the examples below, replace \"/home/user/Mail\" with the path to your
+MH directory.
 
-First create the directory /home/user/Mail/.swish. Then create the file
-/home/user/Mail/.swish/config with the following contents:
+First create the directory \"/home/user/Mail/.swish\". Then create the file
+\"/home/user/Mail/.swish/config\" with the following contents:
 
-    IndexDir /home/user/Mail
-    IndexFile /home/user/Mail/.swish/index
-    IndexName \"Mail Index\"
-    IndexDescription \"Mail Index\"
-    IndexPointer \"http://nowhere\"
-    IndexAdmin \"nobody\"
-    #MetaNames automatic
-    IndexReport 3
-    FollowSymLinks no
-    UseStemming no
-    IgnoreTotalWordCountWhenRanking yes
-    WordCharacters abcdefghijklmnopqrstuvwxyz0123456789-
-    BeginCharacters abcdefghijklmnopqrstuvwxyz
-    EndCharacters abcdefghijklmnopqrstuvwxyz0123456789
-    IgnoreLimit 50 1000
-    IndexComments 0
-    FileRules pathname contains /home/user/Mail/.swish
-    FileRules pathname contains /home/user/Mail/mhe-index
-    FileRules filename is index
-    FileRules filename is \\..*
-    FileRules filename is #.*
-    FileRules filename is ,.*
-    FileRules filename is .*~
+     DefaultContents TXT*
+     IndexDir /home/user/Mail
+     IndexFile /home/user/Mail/.swish/index
+     IndexName \"Mail Index\"
+     IndexDescription \"Mail Index\"
+     IndexPointer \"http://nowhere\"
+     IndexAdmin \"nobody\"
+     #MetaNames automatic
+     IndexReport 3
+     FollowSymLinks no
+     UseStemming no
+     IgnoreTotalWordCountWhenRanking yes
+     WordCharacters abcdefghijklmnopqrstuvwxyz0123456789-
+     BeginCharacters abcdefghijklmnopqrstuvwxyz
+     EndCharacters abcdefghijklmnopqrstuvwxyz0123456789
+     IgnoreLimit 50 1000
+     IndexComments 0
+     FileRules filename contains \\D
+     FileRules pathname contains /home/user/Mail/.swish
+     FileRules pathname contains /home/user/Mail/mhe-index
+
+This configuration does not index the folders that hold the results of your
+searches in \"+mhe-index\" since they tend to be ephemeral and the original
+messages are indexed anyway.
 
 If there are any directories you would like to ignore, append lines like the
-following to config:
+following to \"config\":
 
-    FileRules pathname contains /home/user/Mail/scripts
+     FileRules pathname contains /home/user/Mail/scripts
 
-You do not want to index the folders that hold the results of your searches
-since they tend to be ephemeral and the original messages are indexed anyway.
-The configuration file above assumes that the results are found in sub-folders
-of `mh-index-folder' which is +mhe-index by default.
+Use the following command line to generate the swish index. Run this daily
+from cron:
 
-Use the following command line to generate the swish index. Run this
-daily from cron:
+         swish-e -c /home/user/Mail/.swish/config
 
-    swish-e -c /home/user/Mail/.swish/config
-
-FOLDER-PATH is the directory in which SEARCH-REGEXP is used to search."
+In a program, FOLDER-PATH is the directory in which SEARCH-REGEXP is used to
+search."
   (set-buffer (get-buffer-create mh-index-temp-buffer))
   (erase-buffer)
   (unless mh-swish-binary
@@ -1407,7 +1442,8 @@
           (list (let* ((s (buffer-substring-no-properties start (1+ (point)))))
                   (unless (string-match mh-swish-folder s)
                     (return 'error))
-                  (if (string-match mh-user-path s)
+                  (if (and (string-match mh-user-path s)
+                           (< (match-end 0) (1- (length s))))
                       (format "+%s"
                               (substring s (match-end 0) (1- (length s))))
                     (return 'error)))
@@ -1431,34 +1467,35 @@
 (defun mh-swish++-execute-search (folder-path search-regexp)
   "Execute swish++ and read the results.
 
-In the examples below, replace /home/user/Mail with the path to your MH
+In the examples below, replace \"/home/user/Mail\" with the path to your MH
 directory.
 
-First create the directory /home/user/Mail/.swish++. Then create the file
-/home/user/Mail/.swish++/swish++.conf with the following contents:
+First create the directory \"/home/user/Mail/.swish++\". Then create the file
+\"/home/user/Mail/.swish++/swish++.conf\" with the following contents:
 
-    IncludeMeta         Bcc Cc Comments Content-Description From Keywords
-    IncludeMeta         Newsgroups Resent-To Subject To
-    IncludeMeta         Message-Id References In-Reply-To
-    IncludeFile         Mail    *
-    IndexFile           /home/user/Mail/.swish++/swish++.index
+     IncludeMeta         Bcc Cc Comments Content-Description From Keywords
+     IncludeMeta         Newsgroups Resent-To Subject To
+     IncludeMeta         Message-Id References In-Reply-To
+     IncludeFile         Mail    *
+     IndexFile           /home/user/Mail/.swish++/swish++.index
 
-Use the following command line to generate the swish index. Run this
-daily from cron:
+Use the following command line to generate the swish index. Run this daily
+from cron:
 
- find /home/user/Mail -path /home/user/Mail/mhe-index -prune \\
-                   -o -path /home/user/Mail/.swish++ -prune \\
-                   -o -name \"[0-9]*\" -print \\
-    | index -c /home/user/Mail/.swish++/swish++.conf /home/user/Mail
+     find /home/user/Mail -path /home/user/Mail/mhe-index -prune \\
+                          -o -path /home/user/Mail/.swish++ -prune \\
+                          -o -name \"[0-9]*\" -print \\
+         | index -c /home/user/Mail/.swish++/swish++.conf -
 
-You do not want to index the folders that hold the results of your searches
-since they tend to be ephemeral and the original messages are indexed anyway.
-The command above assumes that the results are found in sub-folders of
-`mh-index-folder' which is +mhe-index by default.
+This command does not index the folders that hold the results of your searches
+in \"+mhe-index\" since they tend to be ephemeral and the original messages
+are indexed anyway.
 
-On some systems (Debian GNU/Linux, for example), use index++ instead of index.
+On some systems (Debian GNU/Linux, for example), use \"index++\" instead of
+\"index\".
 
-FOLDER-PATH is the directory in which SEARCH-REGEXP is used to search."
+In a program, FOLDER-PATH is the directory in which SEARCH-REGEXP is used to
+search."
   (set-buffer (get-buffer-create mh-index-temp-buffer))
   (erase-buffer)
   (unless mh-swish++-binary
@@ -1512,32 +1549,29 @@
 (defun mh-namazu-execute-search (folder-path search-regexp)
   "Execute namazu and read the results.
 
-In the examples below, replace /home/user/Mail with the path to your MH
+In the examples below, replace \"/home/user/Mail\" with the path to your MH
 directory.
 
-First create the directory /home/user/Mail/.namazu. Then create the file
-/home/user/Mail/.namazu/mknmzrc with the following contents:
+First create the directory \"/home/user/Mail/.namazu\". Then create the file
+\"/home/user/Mail/.namazu/mknmzrc\" with the following contents:
 
-    package conf;  # Don't remove this line!
-    $ADDRESS = 'user@localhost';
-    $ALLOW_FILE = \"[0-9]*\";
-    $EXCLUDE_PATH = \"^/home/user/Mail/(mhe-index|spam)\";
-
-In the above example configuration, none of the mail files contained in the
-directories /home/user/Mail/mhe-index and /home/user/Mail/spam are indexed.
+     package conf;  # Don't remove this line!
+     $ADDRESS = 'user@localhost';
+     $ALLOW_FILE = \"[0-9]*\";
+     $EXCLUDE_PATH = \"^/home/user/Mail/(mhe-index|spam)\";
 
-You do not want to index the folders that hold the results of your searches
-since they tend to be ephemeral and the original messages are indexed anyway.
-The configuration file above assumes that the results are found in sub-folders
-of `mh-index-folder' which is +mhe-index by default.
+This configuration does not index the folders that hold the results of your
+searches in \"+mhe-index\" since they tend to be ephemeral and the original
+messages are indexed anyway.
 
-Use the following command line to generate the namazu index. Run this
-daily from cron:
+Use the following command line to generate the namazu index. Run this daily
+from cron:
 
-   mknmz -f /home/user/Mail/.namazu/mknmzrc -O /home/user/Mail/.namazu \\
-         /home/user/Mail
+     mknmz -f /home/user/Mail/.namazu/mknmzrc -O /home/user/Mail/.namazu \\
+              /home/user/Mail
 
-FOLDER-PATH is the directory in which SEARCH-REGEXP is used to search."
+In a program, FOLDER-PATH is the directory in which SEARCH-REGEXP is used to
+search."
   (let ((namazu-index-directory
          (format "%s%s" mh-user-path mh-namazu-directory)))
     (unless (file-exists-p namazu-index-directory)
--- a/lisp/mh-e/mh-init.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/mh-e/mh-init.el	Fri Jun 03 05:49:26 2005 +0000
@@ -1,6 +1,6 @@
 ;;; mh-init.el --- MH-E initialization.
 
-;; Copyright (C) 2005 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2004 Free Software Foundation, Inc.
 
 ;; Author: Peter S. Galbraith <psg@debian.org>
 ;; Maintainer: Bill Wohler <wohler@newt.com>
--- a/lisp/mh-e/mh-junk.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/mh-e/mh-junk.el	Fri Jun 03 05:49:26 2005 +0000
@@ -1,6 +1,6 @@
 ;;; mh-junk.el --- Interface to anti-spam measures
 
-;; Copyright (C) 2005 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2004 Free Software Foundation, Inc.
 
 ;; Author: Satyaki Das <satyaki@theforce.stanford.edu>,
 ;;         Bill Wohler <wohler@newt.com>
@@ -191,8 +191,8 @@
       (message (format "Blacklisting message %d..." msg))
       (set-buffer (get-buffer-create mh-temp-buffer))
       (erase-buffer)
-      (call-process (expand-file-name mh-scan-prog mh-progs) mh-junk-background
-                    t nil
+      (call-process (expand-file-name mh-scan-prog mh-progs)
+                    nil mh-junk-background nil
                     (format "%s" msg) current-folder
                     "-format" "%<(mymbox{from})%|%(addr{from})%>")
       (goto-char (point-min))
--- a/lisp/mh-e/mh-loaddefs.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/mh-e/mh-loaddefs.el	Fri Jun 03 05:49:26 2005 +0000
@@ -1,6 +1,6 @@
 ;;; mh-loaddefs.el --- automatically extracted autoloads
 ;;
-;;; Copyright (C) 2005 Free Software Foundation, Inc.
+;;; Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
 ;;; Author: Bill Wohler <wohler@newt.com>
 ;;; Keywords: mail
 ;;; Commentary:
@@ -13,7 +13,7 @@
 ;;;;;;  mh-check-whom mh-insert-signature mh-to-fcc mh-to-field mh-fill-paragraph-function
 ;;;;;;  mh-get-header-field mh-send-other-window mh-send mh-reply
 ;;;;;;  mh-redistribute mh-forward mh-extract-rejected-mail mh-edit-again)
-;;;;;;  "mh-comp" "mh-comp.el" (16665 53716))
+;;;;;;  "mh-comp" "mh-comp.el" (17048 51103))
 ;;; Generated autoloads from mh-comp.el
 
 (autoload (quote mh-edit-again) "mh-comp" "\
@@ -56,8 +56,10 @@
    cc/all  sender and all recipients.
 If optional prefix argument INCLUDEP provided, then include the message
 in the reply using filter `mhl.reply' in your MH directory.
-If the file named by `mh-repl-formfile' exists, it is used as a skeleton
-for the reply.
+If the file named by `mh-repl-formfile' exists, it is used as a skeleton for
+the reply. If REPLY-TO is cc or all and you're using either the nmh or GNU
+mailutils variants and the file names by `mh-repl-group-formfile' exists, it
+is used instead.
 
 See also `mh-send'." t nil)
 
@@ -183,7 +185,7 @@
 ;;;;;;  mh-store-msg mh-undo-folder mh-sort-folder mh-page-digest-backwards
 ;;;;;;  mh-page-digest mh-pipe-msg mh-pack-folder mh-list-folders
 ;;;;;;  mh-kill-folder mh-copy-msg mh-burst-digest) "mh-funcs" "mh-funcs.el"
-;;;;;;  (16671 48788))
+;;;;;;  (17048 47864))
 ;;; Generated autoloads from mh-funcs.el
 
 (autoload (quote mh-burst-digest) "mh-funcs" "\
@@ -261,7 +263,7 @@
 ;;;;;;  mh-identity-insert-attribution-verb mh-identity-handler-attribution-verb
 ;;;;;;  mh-identity-handler-signature mh-identity-handler-gpg-identity
 ;;;;;;  mh-insert-identity mh-identity-list-set mh-identity-make-menu)
-;;;;;;  "mh-identity" "mh-identity.el" (16671 57010))
+;;;;;;  "mh-identity" "mh-identity.el" (17044 63778))
 ;;; Generated autoloads from mh-identity.el
 
 (autoload (quote mh-identity-make-menu) "mh-identity" "\
@@ -271,43 +273,46 @@
 
 (autoload (quote mh-identity-list-set) "mh-identity" "\
 Update the `mh-identity-list' variable, and rebuild the menu.
-Sets the default for SYMBOL (e.g. `mh-identity-list') to VALUE (as set in
-customization).  This is called after 'customize is used to alter
+Sets the default for SYMBOL (for example, `mh-identity-list') to VALUE (as set
+in customization). This is called after 'customize is used to alter
 `mh-identity-list'." nil nil)
 
 (autoload (quote mh-insert-identity) "mh-identity" "\
-Insert proper fields for given IDENTITY.
-Edit the `mh-identity-list' variable to define identity." t nil)
+Insert fields specified by given IDENTITY.
+See `mh-identity-list'." t nil)
 
 (autoload (quote mh-identity-handler-gpg-identity) "mh-identity" "\
-For FIELD \"pgg-default-user-id\", process for ACTION 'remove or 'add.
+Process header FIELD \":pgg-default-user-id\".
+The ACTION is one of 'remove or 'add. If 'add, the VALUE is added.
 The buffer-local variable `mh-identity-pgg-default-user-id' is set to VALUE
 when action 'add is selected." nil nil)
 
 (autoload (quote mh-identity-handler-signature) "mh-identity" "\
-For FIELD \"signature\", process headers for ACTION 'remove or 'add.
-The VALUE is added." nil nil)
+Process header FIELD \":signature\".
+The ACTION is one of 'remove or 'add. If 'add, the VALUE is added." nil nil)
 
 (autoload (quote mh-identity-handler-attribution-verb) "mh-identity" "\
-For FIELD \"attribution_verb\", process headers for ACTION 'remove or 'add.
-The VALUE is added." nil nil)
+Process header FIELD \":attribution-verb\".
+The ACTION is one of 'remove or 'add. If 'add, the VALUE is added." nil nil)
 
 (autoload (quote mh-identity-insert-attribution-verb) "mh-identity" "\
 Insert VALUE as attribution verb, setting up delimiting markers.
 If VALUE is nil, use `mh-extract-from-attribution-verb'." nil nil)
 
 (autoload (quote mh-identity-handler-top) "mh-identity" "\
-For FIELD, process mh-identity headers for ACTION 'remove or 'add.
-If the field wasn't present, the VALUE is added at the top of the header." nil nil)
+Process header FIELD.
+The ACTION is one of 'remove or 'add. If 'add, the VALUE is added.
+If the field wasn't present, it is added to the top of the header." nil nil)
 
 (autoload (quote mh-identity-handler-bottom) "mh-identity" "\
-For FIELD, process mh-identity headers for ACTION 'remove or 'add.
-If the field wasn't present, the VALUE is added at the bottom of the header." nil nil)
+Process header FIELD.
+The ACTION is one of 'remove or 'add. If 'add, the VALUE is added.
+If the field wasn't present, it is added to the bottom of the header." nil nil)
 
 ;;;***
 
-;;;### (autoloads (mh-inc-spool-list-set) "mh-inc" "mh-inc.el" (16671
-;;;;;;  48848))
+;;;### (autoloads (mh-inc-spool-list-set) "mh-inc" "mh-inc.el" (17048
+;;;;;;  44143))
 ;;; Generated autoloads from mh-inc.el
 
 (autoload (quote mh-inc-spool-list-set) "mh-inc" "\
@@ -326,7 +331,7 @@
 ;;;;;;  mh-index-parse-search-regexp mh-index-do-search mh-index-p
 ;;;;;;  mh-index-read-data mh-index-search mh-index-create-sequences
 ;;;;;;  mh-create-sequence-map mh-index-update-maps) "mh-index" "mh-index.el"
-;;;;;;  (16665 53754))
+;;;;;;  (17044 64025))
 ;;; Generated autoloads from mh-index.el
 
 (autoload (quote mh-index-update-maps) "mh-index" "\
@@ -346,43 +351,74 @@
 
 (autoload (quote mh-index-search) "mh-index" "\
 Perform an indexed search in an MH mail folder.
-Use a prefix argument to repeat the search, as in REDO-SEARCH-FLAG below.
+Use a prefix argument to repeat the search.
+
+Unlike regular searches, the prompt for the folder to search can be `all' to
+search all folders; in addition, the search works recursively on the listed
+folder. The search criteria are entered in an MH-Pick buffer as described in
+`mh-search-folder'.
+
+To perform the search, type \\<mh-pick-mode-map>\\[mh-do-search]. Another
+difference from the regular searches is that because the search operates on
+more than one folder, the messages that are found are put in a temporary
+sub-folder of `+mhe-index' and are displayed in an MH-Folder buffer. This
+buffer is special because it displays messages from multiple folders; each set
+of messages from a given folder has a heading with the folder name.
+
+In addition, the \\<mh-folder-mode-map>\\[mh-index-visit-folder] command can
+be used to visit the folder of the message at point. Initially, only the
+messages that matched the search criteria are displayed in the folder. While
+the temporary buffer has its own set of message numbers, the actual messages
+numbers are shown in the visited folder. Thus, the \\[mh-index-visit-folder]
+command is useful to find the actual message number of an interesting message,
+or to view surrounding messages with the \\[mh-rescan-folder] command.
+
+Because this folder is temporary, you'll probably get in the habit of killing
+it when you're done with \\[mh-kill-folder].
 
-If REDO-SEARCH-FLAG is non-nil and the current folder buffer was generated by a
-index search, then the search is repeated. Otherwise, FOLDER is searched with
-SEARCH-REGEXP and the results are presented in an MH-E folder. If FOLDER is
-\"+\" then mail in all folders are searched. Optional argument WINDOW-CONFIG
-stores the window configuration that will be restored after the user quits the
-folder containing the index search results.
+If you have run the \\[mh-search-folder] command, but change your mind while
+entering the search criteria and actually want to run an indexed search, then
+you can use the \\<mh-pick-mode-map>\\[mh-index-do-search] command in the
+MH-Pick buffer.
+
+The \\<mh-folder-mode-map>\\[mh-index-search] command runs the command defined
+by the `mh-index-program' option. The default value is \"Auto-detect\" which
+means that MH-E will automatically choose one of \"swish++\", \"swish-e\",
+\"mairix\", \"namazu\", \"pick\" and \"grep\" in that order. If, for example,
+you have both \"swish++\" and \"mairix\" installed and you want to use
+\"mairix\", then you can set this option to \"mairix\".
+
+                                *NOTE*
 
-Four indexing programs are supported; if none of these are present, then grep
-is used. This function picks the first program that is available on your
-system. If you would prefer to use a different program, set the customization
-variable `mh-index-program' accordingly.
+     The \"pick\" and \"grep\" commands do not perform a recursive search on
+     the given folder.
 
-The documentation for the following functions describes how to generate the
-index for each program:
+This command uses an \"X-MHE-Checksum:\" header field to cache the MD5
+checksum of a message. This means that if an incoming message already contains
+an \"X-MHE-Checksum:\" field, that message might not be found by this command.
+The following \"procmail\" recipe avoids this problem by renaming the existing
+header field:
+
+     :0 wf
+     | formail -R \"X-MHE-Checksum\" \"X-Old-MHE-Checksum\"
+
+The documentation for the following commands describe how to set up the
+various indexing programs to use with MH-E. The \"pick\" and \"grep\" commands
+do not require additional configuration.
 
     - `mh-swish++-execute-search'
     - `mh-swish-execute-search'
     - `mh-mairix-execute-search'
     - `mh-namazu-execute-search'
-
-If none of these programs are present then we use pick. If desired grep can be
-used instead. Details about these methods can be found in:
-
     - `mh-pick-execute-search'
     - `mh-grep-execute-search'
 
-This and related functions use an X-MHE-Checksum header to cache the MD5
-checksum of a message. This means that already present X-MHE-Checksum headers
-in the incoming email could result in messages not being found. The following
-procmail recipe should avoid this:
-
-  :0 wf
-  | formail -R \"X-MHE-Checksum\" \"Old-X-MHE-Checksum\"
-
-This has the effect of renaming already present X-MHE-Checksum headers." t nil)
+In a program, if REDO-SEARCH-FLAG is non-nil and the current folder buffer was
+generated by a index search, then the search is repeated. Otherwise, FOLDER is
+searched with SEARCH-REGEXP and the results are presented in an MH-E folder.
+If FOLDER is \"+\" then mail in all folders are searched. Optional argument
+WINDOW-CONFIG stores the window configuration that will be restored after the
+user quits the folder containing the index search results." t nil)
 
 (autoload (quote mh-index-read-data) "mh-index" "\
 Read index data from file." nil nil)
@@ -463,114 +499,109 @@
 (autoload (quote mh-swish-execute-search) "mh-index" "\
 Execute swish-e and read the results.
 
-In the examples below, replace /home/user/Mail with the path to your MH
-directory.
+In the examples below, replace \"/home/user/Mail\" with the path to your
+MH directory.
 
-First create the directory /home/user/Mail/.swish. Then create the file
-/home/user/Mail/.swish/config with the following contents:
+First create the directory \"/home/user/Mail/.swish\". Then create the file
+\"/home/user/Mail/.swish/config\" with the following contents:
 
-    IndexDir /home/user/Mail
-    IndexFile /home/user/Mail/.swish/index
-    IndexName \"Mail Index\"
-    IndexDescription \"Mail Index\"
-    IndexPointer \"http://nowhere\"
-    IndexAdmin \"nobody\"
-    #MetaNames automatic
-    IndexReport 3
-    FollowSymLinks no
-    UseStemming no
-    IgnoreTotalWordCountWhenRanking yes
-    WordCharacters abcdefghijklmnopqrstuvwxyz0123456789-
-    BeginCharacters abcdefghijklmnopqrstuvwxyz
-    EndCharacters abcdefghijklmnopqrstuvwxyz0123456789
-    IgnoreLimit 50 1000
-    IndexComments 0
-    FileRules pathname contains /home/user/Mail/.swish
-    FileRules pathname contains /home/user/Mail/mhe-index
-    FileRules filename is index
-    FileRules filename is \\..*
-    FileRules filename is #.*
-    FileRules filename is ,.*
-    FileRules filename is .*~
+     DefaultContents TXT*
+     IndexDir /home/user/Mail
+     IndexFile /home/user/Mail/.swish/index
+     IndexName \"Mail Index\"
+     IndexDescription \"Mail Index\"
+     IndexPointer \"http://nowhere\"
+     IndexAdmin \"nobody\"
+     #MetaNames automatic
+     IndexReport 3
+     FollowSymLinks no
+     UseStemming no
+     IgnoreTotalWordCountWhenRanking yes
+     WordCharacters abcdefghijklmnopqrstuvwxyz0123456789-
+     BeginCharacters abcdefghijklmnopqrstuvwxyz
+     EndCharacters abcdefghijklmnopqrstuvwxyz0123456789
+     IgnoreLimit 50 1000
+     IndexComments 0
+     FileRules filename contains \\D
+     FileRules pathname contains /home/user/Mail/.swish
+     FileRules pathname contains /home/user/Mail/mhe-index
+
+This configuration does not index the folders that hold the results of your
+searches in \"+mhe-index\" since they tend to be ephemeral and the original
+messages are indexed anyway.
 
 If there are any directories you would like to ignore, append lines like the
-following to config:
+following to \"config\":
 
-    FileRules pathname contains /home/user/Mail/scripts
+     FileRules pathname contains /home/user/Mail/scripts
 
-You do not want to index the folders that hold the results of your searches
-since they tend to be ephemeral and the original messages are indexed anyway.
-The configuration file above assumes that the results are found in sub-folders
-of `mh-index-folder' which is +mhe-index by default.
+Use the following command line to generate the swish index. Run this daily
+from cron:
 
-Use the following command line to generate the swish index. Run this
-daily from cron:
+         swish-e -c /home/user/Mail/.swish/config
 
-    swish-e -c /home/user/Mail/.swish/config
-
-FOLDER-PATH is the directory in which SEARCH-REGEXP is used to search." nil nil)
+In a program, FOLDER-PATH is the directory in which SEARCH-REGEXP is used to
+search." nil nil)
 
 (autoload (quote mh-swish++-execute-search) "mh-index" "\
 Execute swish++ and read the results.
 
-In the examples below, replace /home/user/Mail with the path to your MH
+In the examples below, replace \"/home/user/Mail\" with the path to your MH
 directory.
 
-First create the directory /home/user/Mail/.swish++. Then create the file
-/home/user/Mail/.swish++/swish++.conf with the following contents:
+First create the directory \"/home/user/Mail/.swish++\". Then create the file
+\"/home/user/Mail/.swish++/swish++.conf\" with the following contents:
 
-    IncludeMeta         Bcc Cc Comments Content-Description From Keywords
-    IncludeMeta         Newsgroups Resent-To Subject To
-    IncludeMeta         Message-Id References In-Reply-To
-    IncludeFile         Mail    *
-    IndexFile           /home/user/Mail/.swish++/swish++.index
+     IncludeMeta         Bcc Cc Comments Content-Description From Keywords
+     IncludeMeta         Newsgroups Resent-To Subject To
+     IncludeMeta         Message-Id References In-Reply-To
+     IncludeFile         Mail    *
+     IndexFile           /home/user/Mail/.swish++/swish++.index
 
-Use the following command line to generate the swish index. Run this
-daily from cron:
+Use the following command line to generate the swish index. Run this daily
+from cron:
 
- find /home/user/Mail -path /home/user/Mail/mhe-index -prune \\
-                   -o -path /home/user/Mail/.swish++ -prune \\
-                   -o -name \"[0-9]*\" -print \\
-    | index -c /home/user/Mail/.swish++/swish++.conf /home/user/Mail
+     find /home/user/Mail -path /home/user/Mail/mhe-index -prune \\
+                          -o -path /home/user/Mail/.swish++ -prune \\
+                          -o -name \"[0-9]*\" -print \\
+         | index -c /home/user/Mail/.swish++/swish++.conf -
 
-You do not want to index the folders that hold the results of your searches
-since they tend to be ephemeral and the original messages are indexed anyway.
-The command above assumes that the results are found in sub-folders of
-`mh-index-folder' which is +mhe-index by default.
+This command does not index the folders that hold the results of your searches
+in \"+mhe-index\" since they tend to be ephemeral and the original messages
+are indexed anyway.
 
-On some systems (Debian GNU/Linux, for example), use index++ instead of index.
+On some systems (Debian GNU/Linux, for example), use \"index++\" instead of
+\"index\".
 
-FOLDER-PATH is the directory in which SEARCH-REGEXP is used to search." nil nil)
+In a program, FOLDER-PATH is the directory in which SEARCH-REGEXP is used to
+search." nil nil)
 
 (autoload (quote mh-namazu-execute-search) "mh-index" "\
 Execute namazu and read the results.
 
-In the examples below, replace /home/user/Mail with the path to your MH
+In the examples below, replace \"/home/user/Mail\" with the path to your MH
 directory.
 
-First create the directory /home/user/Mail/.namazu. Then create the file
-/home/user/Mail/.namazu/mknmzrc with the following contents:
+First create the directory \"/home/user/Mail/.namazu\". Then create the file
+\"/home/user/Mail/.namazu/mknmzrc\" with the following contents:
 
-    package conf;  # Don't remove this line!
-    $ADDRESS = 'user@localhost';
-    $ALLOW_FILE = \"[0-9]*\";
-    $EXCLUDE_PATH = \"^/home/user/Mail/(mhe-index|spam)\";
-
-In the above example configuration, none of the mail files contained in the
-directories /home/user/Mail/mhe-index and /home/user/Mail/spam are indexed.
+     package conf;  # Don't remove this line!
+     $ADDRESS = 'user@localhost';
+     $ALLOW_FILE = \"[0-9]*\";
+     $EXCLUDE_PATH = \"^/home/user/Mail/(mhe-index|spam)\";
 
-You do not want to index the folders that hold the results of your searches
-since they tend to be ephemeral and the original messages are indexed anyway.
-The configuration file above assumes that the results are found in sub-folders
-of `mh-index-folder' which is +mhe-index by default.
+This configuration does not index the folders that hold the results of your
+searches in \"+mhe-index\" since they tend to be ephemeral and the original
+messages are indexed anyway.
 
-Use the following command line to generate the namazu index. Run this
-daily from cron:
+Use the following command line to generate the namazu index. Run this daily
+from cron:
 
-   mknmz -f /home/user/Mail/.namazu/mknmzrc -O /home/user/Mail/.namazu \\
-         /home/user/Mail
+     mknmz -f /home/user/Mail/.namazu/mknmzrc -O /home/user/Mail/.namazu \\
+              /home/user/Mail
 
-FOLDER-PATH is the directory in which SEARCH-REGEXP is used to search." nil nil)
+In a program, FOLDER-PATH is the directory in which SEARCH-REGEXP is used to
+search." nil nil)
 
 (autoload (quote mh-index-choose) "mh-index" "\
 Choose an indexing function.
@@ -582,7 +613,7 @@
 ;;;***
 
 ;;;### (autoloads (mh-variants mh-variant-p mh-variant-set) "mh-init"
-;;;;;;  "mh-init.el" (16684 6777))
+;;;;;;  "mh-init.el" (17044 64253))
 ;;; Generated autoloads from mh-init.el
 
 (autoload (quote mh-variant-set) "mh-init" "\
@@ -604,7 +635,7 @@
 ;;;***
 
 ;;;### (autoloads (mh-junk-whitelist mh-junk-blacklist) "mh-junk"
-;;;;;;  "mh-junk.el" (16671 48929))
+;;;;;;  "mh-junk.el" (17044 64253))
 ;;; Generated autoloads from mh-junk.el
 
 (autoload (quote mh-junk-blacklist) "mh-junk" "\
@@ -644,7 +675,7 @@
 ;;;;;;  mh-mhn-compose-external-compressed-tar mh-mhn-compose-anon-ftp
 ;;;;;;  mh-mhn-compose-insertion mh-file-mime-type mh-have-file-command
 ;;;;;;  mh-compose-forward mh-compose-insertion) "mh-mime" "mh-mime.el"
-;;;;;;  (16684 7323))
+;;;;;;  (17048 47895))
 ;;; Generated autoloads from mh-mime.el
 
 (autoload (quote mh-compose-insertion) "mh-mime" "\
@@ -857,15 +888,79 @@
 ;;;***
 
 ;;;### (autoloads (mh-do-search mh-pick-do-search mh-search-folder)
-;;;;;;  "mh-pick" "mh-pick.el" (16671 49140))
+;;;;;;  "mh-pick" "mh-pick.el" (17048 47905))
 ;;; Generated autoloads from mh-pick.el
 
 (autoload (quote mh-search-folder) "mh-pick" "\
 Search FOLDER for messages matching a pattern.
-This function uses the MH command `pick' to do the work.
-Add the messages found to the sequence named `search'.
-Argument WINDOW-CONFIG is the current window configuration and is used when
-the search folder is dismissed." t nil)
+
+With this command, you can search a folder for messages to or from a
+particular person or about a particular subject. In fact, you can also search
+for messages containing selected strings in any arbitrary header field or any
+string found within the messages.
+
+You are first prompted for the name of the folder to search and then placed in
+the following buffer in MH-Pick mode:
+
+     From:
+     To:
+     Cc:
+     Date:
+     Subject:
+     --------
+
+Edit this template by entering your search criteria in an appropriate header
+field that is already there, or create a new field yourself. If the string
+you're looking for could be anywhere in a message, then place the string
+underneath the row of dashes. The \\[mh-search-folder] command uses the MH
+command \"pick\" to do the real work.
+
+There are no semantics associated with the search criteria--they are simply
+treated as strings. Case is ignored when all lowercase is used, and regular
+expressions (a la \"ed\") are available. It is all right to specify several
+search criteria. What happens then is that a logical _and_ of the various
+fields is performed. If you prefer a logical _or_ operation, run
+\\[mh-search-folder] multiple times.
+
+As an example, let's say that we want to find messages from Ginnean about
+horseback riding in the Kosciusko National Park (Australia) during January,
+1994. Normally we would start with a broad search and narrow it down if
+necessary to produce a manageable amount of data, but we'll cut to the chase
+and create a fairly restrictive set of criteria as follows:
+
+     From: ginnean
+     To:
+     Cc:
+     Date: Jan 1994
+     Subject: horse.*kosciusko
+     --------
+
+As with MH-Letter mode, MH-Pick provides commands like
+\\<mh-pick-mode-map>\\[mh-to-field] to help you fill in the blanks.
+
+To perform the search, type \\[mh-do-search]. The selected messages are placed
+in the \"search\" sequence, which you can use later in forwarding, printing,
+or narrowing your field of view. Subsequent searches are appended to the
+\"search\" sequence. If, however, you wish to start with a clean slate, first
+delete the \"search\" sequence.
+
+If you're searching in a folder that is already displayed in an MH-Folder
+buffer, only those messages contained in the buffer are used for the search.
+Therefore, if you want to search in all messages, first kill the folder's
+buffer with \\<mh-folder-mode-map>\\[kill-buffer] or scan the entire folder
+with \\[mh-rescan-folder].
+
+If you find that you do the same thing over and over when editing the search
+template, you may wish to bind some shortcuts to keys. This can be done with
+the variable `mh-pick-mode-hook', which is called when \\[mh-search-folder] is
+run on a new pattern.
+
+If you have run the \\[mh-index-search] command, but change your mind while
+entering the search criteria and actually want to run a regular search, then
+you can use the \\<mh-pick-mode-map>\\[mh-pick-do-search] command.
+
+In a program, argument WINDOW-CONFIG is the current window configuration and
+is used when the search folder is dismissed." t nil)
 
 (autoload (quote mh-pick-do-search) "mh-pick" "\
 Find messages that match the qualifications in the current pattern buffer.
@@ -882,7 +977,7 @@
 
 ;;;### (autoloads (mh-print-msg mh-ps-print-toggle-mime mh-ps-print-toggle-color
 ;;;;;;  mh-ps-print-toggle-faces mh-ps-print-msg-show mh-ps-print-msg-file
-;;;;;;  mh-ps-print-msg) "mh-print" "mh-print.el" (16680 11171))
+;;;;;;  mh-ps-print-msg) "mh-print" "mh-print.el" (17044 64253))
 ;;; Generated autoloads from mh-print.el
 
 (autoload (quote mh-ps-print-msg) "mh-print" "\
@@ -935,7 +1030,7 @@
 ;;;;;;  mh-rename-seq mh-translate-range mh-read-range mh-read-seq-default
 ;;;;;;  mh-notate-deleted-and-refiled mh-widen mh-put-msg-in-seq
 ;;;;;;  mh-narrow-to-seq mh-msg-is-in-seq mh-list-sequences mh-delete-seq)
-;;;;;;  "mh-seq" "mh-seq.el" (16671 65286))
+;;;;;;  "mh-seq" "mh-seq.el" (17048 47921))
 ;;; Generated autoloads from mh-seq.el
 
 (autoload (quote mh-delete-seq) "mh-seq" "\
@@ -1157,7 +1252,7 @@
 
 ;;;### (autoloads (mh-speed-add-folder mh-speed-invalidate-map mh-speed-flists
 ;;;;;;  mh-speed-view mh-speed-toggle mh-folder-speedbar-buttons)
-;;;;;;  "mh-speed" "mh-speed.el" (16665 53793))
+;;;;;;  "mh-speed" "mh-speed.el" (17044 64253))
 ;;; Generated autoloads from mh-speed.el
 
 (autoload (quote mh-folder-speedbar-buttons) "mh-speed" "\
@@ -1196,7 +1291,7 @@
 ;;;;;;  mh-alias-grab-from-field mh-alias-add-alias mh-alias-for-from-p
 ;;;;;;  mh-alias-address-to-alias mh-alias-letter-expand-alias mh-alias-minibuffer-confirm-address
 ;;;;;;  mh-read-address mh-alias-reload-maybe mh-alias-reload) "mh-alias"
-;;;;;;  "mh-alias.el" (16671 49382))
+;;;;;;  "mh-alias.el" (17048 47789))
 ;;; Generated autoloads from mh-alias.el
 
 (autoload (quote mh-alias-reload) "mh-alias" "\
--- a/lisp/mh-e/mh-mime.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/mh-e/mh-mime.el	Fri Jun 03 05:49:26 2005 +0000
@@ -1,6 +1,7 @@
 ;;; mh-mime.el --- MH-E support for composing MIME messages
 
-;; Copyright (C) 1993, 1995, 2005 Free Software Foundation, Inc.
+;; Copyright (C) 1993, 1995,
+;; 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 
 ;; Author: Bill Wohler <wohler@newt.com>
 ;; Maintainer: Bill Wohler <wohler@newt.com>
@@ -1325,6 +1326,18 @@
              (point-max)))
         (forward-line -1)))))
 
+(defun mh-mime-security-button-face (info)
+  "Return the button face to use for encrypted/signed mail based on INFO."
+  (cond ((string-match "OK" info)       ;Decrypted mail
+         mh-show-pgg-good-face)
+        ((string-match "Failed" info)   ;Decryption failed or signature invalid
+         mh-show-pgg-bad-face)
+        ((string-match "Undecided" info);Unprocessed mail
+         mh-show-pgg-unknown-face)
+        ((string-match "Untrusted" info);Key not trusted
+         mh-show-pgg-unknown-face)
+        (t mh-show-pgg-good-face)))
+
 (defun mh-mime-security-press-button (handle)
   "Callback from security button for part HANDLE."
   (if (mm-handle-multipart-ctl-parameter handle 'gnus-info)
@@ -1364,9 +1377,10 @@
          (info (or (mm-handle-multipart-ctl-parameter handle 'gnus-info)
                    "Undecided"))
          (details (mm-handle-multipart-ctl-parameter handle 'gnus-details))
-         pressed-details begin end)
+         pressed-details begin end face)
     (setq details (if details (concat "\n" details) ""))
     (setq pressed-details (if mh-mime-security-button-pressed details ""))
+    (setq face (mh-mime-security-button-face info))
     (unless (bolp) (insert "\n"))
     (setq begin (point))
     (gnus-eval-format
@@ -1382,6 +1396,7 @@
                            :mime-handle handle
                            :action 'mh-widget-press-button
                            :button-keymap mh-mime-security-button-map
+                           :button-face face
                            :help-echo "Mouse-2 click or press RET (in show buffer) to see security details.")
     (dolist (ov (mh-funcall-if-exists overlays-in begin end))
       (mh-funcall-if-exists overlay-put ov 'evaporate t))
--- a/lisp/mh-e/mh-pick.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/mh-e/mh-pick.el	Fri Jun 03 05:49:26 2005 +0000
@@ -1,6 +1,7 @@
 ;;; mh-pick.el --- make a search pattern and search for a message in MH-E
 
-;; Copyright (C) 1993, 1995, 2005 Free Software Foundation, Inc.
+;; Copyright (C) 1993, 1995,
+;; 2001, 2003, 2004, 2005 Free Software Foundation, Inc.
 
 ;; Author: Bill Wohler <wohler@newt.com>
 ;; Maintainer: Bill Wohler <wohler@newt.com>
@@ -52,10 +53,74 @@
 ;;;###mh-autoload
 (defun mh-search-folder (folder window-config)
   "Search FOLDER for messages matching a pattern.
-This function uses the MH command `pick' to do the work.
-Add the messages found to the sequence named `search'.
-Argument WINDOW-CONFIG is the current window configuration and is used when
-the search folder is dismissed."
+
+With this command, you can search a folder for messages to or from a
+particular person or about a particular subject. In fact, you can also search
+for messages containing selected strings in any arbitrary header field or any
+string found within the messages.
+
+You are first prompted for the name of the folder to search and then placed in
+the following buffer in MH-Pick mode:
+
+     From:
+     To:
+     Cc:
+     Date:
+     Subject:
+     --------
+
+Edit this template by entering your search criteria in an appropriate header
+field that is already there, or create a new field yourself. If the string
+you're looking for could be anywhere in a message, then place the string
+underneath the row of dashes. The \\[mh-search-folder] command uses the MH
+command \"pick\" to do the real work.
+
+There are no semantics associated with the search criteria--they are simply
+treated as strings. Case is ignored when all lowercase is used, and regular
+expressions (a la \"ed\") are available. It is all right to specify several
+search criteria. What happens then is that a logical _and_ of the various
+fields is performed. If you prefer a logical _or_ operation, run
+\\[mh-search-folder] multiple times.
+
+As an example, let's say that we want to find messages from Ginnean about
+horseback riding in the Kosciusko National Park (Australia) during January,
+1994. Normally we would start with a broad search and narrow it down if
+necessary to produce a manageable amount of data, but we'll cut to the chase
+and create a fairly restrictive set of criteria as follows:
+
+     From: ginnean
+     To:
+     Cc:
+     Date: Jan 1994
+     Subject: horse.*kosciusko
+     --------
+
+As with MH-Letter mode, MH-Pick provides commands like
+\\<mh-pick-mode-map>\\[mh-to-field] to help you fill in the blanks.
+
+To perform the search, type \\[mh-do-search]. The selected messages are placed
+in the \"search\" sequence, which you can use later in forwarding, printing,
+or narrowing your field of view. Subsequent searches are appended to the
+\"search\" sequence. If, however, you wish to start with a clean slate, first
+delete the \"search\" sequence.
+
+If you're searching in a folder that is already displayed in an MH-Folder
+buffer, only those messages contained in the buffer are used for the search.
+Therefore, if you want to search in all messages, first kill the folder's
+buffer with \\<mh-folder-mode-map>\\[kill-buffer] or scan the entire folder
+with \\[mh-rescan-folder].
+
+If you find that you do the same thing over and over when editing the search
+template, you may wish to bind some shortcuts to keys. This can be done with
+the variable `mh-pick-mode-hook', which is called when \\[mh-search-folder] is
+run on a new pattern.
+
+If you have run the \\[mh-index-search] command, but change your mind while
+entering the search criteria and actually want to run a regular search, then
+you can use the \\<mh-pick-mode-map>\\[mh-pick-do-search] command.
+
+In a program, argument WINDOW-CONFIG is the current window configuration and
+is used when the search folder is dismissed."
   (interactive (list (mh-prompt-for-folder "Search" mh-current-folder nil nil t)
                      (current-window-configuration)))
   (let ((pick-folder (if (equal folder "+") mh-current-folder folder)))
--- a/lisp/mh-e/mh-print.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/mh-e/mh-print.el	Fri Jun 03 05:49:26 2005 +0000
@@ -1,6 +1,6 @@
 ;;; mh-print.el --- MH-E printing support
 
-;; Copyright (C) 2005 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2004 Free Software Foundation, Inc.
 
 ;; Author: Jeffrey C Honig <jch@honig.net>
 ;; Maintainer: Bill Wohler <wohler@newt.com>
--- a/lisp/mh-e/mh-seq.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/mh-e/mh-seq.el	Fri Jun 03 05:49:26 2005 +0000
@@ -1,6 +1,7 @@
 ;;; mh-seq.el --- MH-E sequences support
 
-;; Copyright (C) 1993, 1995, 2005 Free Software Foundation, Inc.
+;; Copyright (C) 1993, 1995,
+;; 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
 
 ;; Author: Bill Wohler <wohler@newt.com>
 ;; Maintainer: Bill Wohler <wohler@newt.com>
@@ -195,7 +196,7 @@
             (insert "\n"))
           (setq seq-list (cdr seq-list)))
         (goto-char (point-min))
-        (view-mode 1)
+        (view-mode-enter)
         (setq view-exit-action 'kill-buffer)
         (message "Listing sequences...done")))))
 
@@ -788,10 +789,33 @@
 If no prefix arg is given, then return DEFAULT."
   (let ((default-string (loop for x in default concat (format " %s" x))))
     (if (or current-prefix-arg (equal default-string ""))
-        (delete "" (split-string (read-string "Pick expression: "
-                                              default-string)))
+        (mh-pick-args-list (read-string "Pick expression: "
+                                        default-string))
       default)))
 
+(defun mh-pick-args-list (s)
+  "Form list by grouping elements in string S suitable for pick arguments.
+For example, the string \"-subject a b c -from Joe User <user@domain.com>\"
+is converted to (\"-subject\" \"a b c\" \"-from\"
+\"Joe User <user@domain.com>\""
+  (let ((full-list (split-string s))
+        current-arg collection arg-list)
+    (while full-list
+      (setq current-arg (car full-list))
+      (if (null (string-match "^-" current-arg))
+          (setq collection
+                (if (null collection)
+                    current-arg
+                  (format "%s %s" collection current-arg)))
+        (when collection
+          (setq arg-list (append arg-list (list collection)))
+          (setq collection nil))
+        (setq arg-list (append arg-list (list current-arg))))
+      (setq full-list (cdr full-list)))
+    (when collection
+      (setq arg-list (append arg-list (list collection))))
+    arg-list))
+
 ;;;###mh-autoload
 (defun mh-narrow-to-subject (&optional pick-expr)
   "Limit to messages with same subject.
@@ -1315,6 +1339,7 @@
           (old-buffer-modified-flag (buffer-modified-p)))
       (delete-region (point-min) (point-max))
       (mh-thread-print-scan-lines thread-tree)
+      (mh-notate-user-sequences)
       (mh-notate-deleted-and-refiled)
       (mh-notate-cur)
       (set-buffer-modified-p old-buffer-modified-flag))))
--- a/lisp/mh-e/mh-speed.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/mh-e/mh-speed.el	Fri Jun 03 05:49:26 2005 +0000
@@ -1,6 +1,6 @@
 ;;; mh-speed.el --- Speedbar interface for MH-E.
 
-;; Copyright (C) 2005 Free Software Foundation, Inc.
+;; Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
 
 ;; Author: Satyaki Das <satyaki@theforce.stanford.edu>
 ;; Maintainer: Bill Wohler <wohler@newt.com>
--- a/lisp/mh-e/mh-utils.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/mh-e/mh-utils.el	Fri Jun 03 05:49:26 2005 +0000
@@ -1,6 +1,7 @@
 ;;; mh-utils.el --- MH-E code needed for both sending and reading
 
-;; Copyright (C) 1993, 95, 1997, 2000, 01, 2005 Free Software Foundation, Inc.
+;; Copyright (C) 1993, 1995, 1997,
+;; 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 
 ;; Author: Bill Wohler <wohler@newt.com>
 ;; Maintainer: Bill Wohler <wohler@newt.com>
@@ -703,8 +704,8 @@
   (save-excursion
     (beginning-of-line)
     (cond ((looking-at mh-scan-msg-number-regexp)
-           (string-to-int (buffer-substring (match-beginning 1)
-                                            (match-end 1))))
+           (string-to-number (buffer-substring (match-beginning 1)
+                                               (match-end 1))))
           (error-if-no-message
            (error "Cursor not pointing to message"))
           (t nil))))
@@ -1672,7 +1673,8 @@
   "Decode >From at beginning of lines for `mh-show-mode'."
   (save-excursion
     (let ((modified (buffer-modified-p))
-          (case-fold-search nil))
+          (case-fold-search nil)
+          (buffer-read-only nil))
       (goto-char (mh-mail-header-end))
       (while (re-search-forward "^>From" nil t)
         (replace-match "From"))
--- a/lisp/printing.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/printing.el	Fri Jun 03 05:49:26 2005 +0000
@@ -5466,7 +5466,7 @@
 	   (str (pr-f-read-string (format fmt-prompt prompt mess) "1" nil "1"))
 	   int)
       (while (if (string-match "^\\s *[0-9]+$" str)
-		 (setq int (string-to-int str)
+		 (setq int (string-to-number str)
 		       prompt (cond ((< int 1)   "Integer below 1; ")
 				    ((> int 100) "Integer above 100; ")
 				    (t           nil)))
--- a/lisp/progmodes/compile.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/progmodes/compile.el	Fri Jun 03 05:49:26 2005 +0000
@@ -935,12 +935,20 @@
 		    (substitute-env-vars (match-string 1 command))
 		  "~")
 	      default-directory))
+	;; Select the desired mode.
+	(if (not (eq mode t))
+	    (funcall mode)
+	  (setq buffer-read-only nil)
+	  (with-no-warnings (comint-mode))
+	  (compilation-shell-minor-mode))
+	(if highlight-regexp
+	    (set (make-local-variable 'compilation-highlight-regexp)
+		 highlight-regexp))
 	(erase-buffer)
-	;; output a mode setter, for saving and later reloading this buffer
+	;; Output a mode setter, for saving and later reloading this buffer.
 	(insert "-*- mode: " name-of-mode
 		"; default-directory: " (prin1-to-string default-directory)
-		" -*-\n" command "\n")
-	(setq thisdir default-directory))
+		" -*-\n" command "\n")	(setq thisdir default-directory))
       (set-buffer-modified-p nil))
     ;; If we're already in the compilation buffer, go to the end
     ;; of the buffer, so point will track the compilation output.
@@ -963,14 +971,6 @@
 	      ;; don't override users' setting of $EMACS.
 	      (unless (getenv "EMACS") '("EMACS=t"))
 	      (copy-sequence process-environment))))
-	(if (not (eq mode t))
-	    (funcall mode)
-	  (setq buffer-read-only nil)
-	  (with-no-warnings (comint-mode))
-	  (compilation-shell-minor-mode))
-	(if highlight-regexp
-	    (set (make-local-variable 'compilation-highlight-regexp)
-		 highlight-regexp))
 	(set (make-local-variable 'compilation-arguments)
 	     (list command mode name-function highlight-regexp))
 	(set (make-local-variable 'revert-buffer-function)
--- a/lisp/progmodes/gdb-ui.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/progmodes/gdb-ui.el	Fri Jun 03 05:49:26 2005 +0000
@@ -277,7 +277,7 @@
 (defun gdb-set-gud-minor-mode-1 (buffer)
   (goto-char (point-min))
   (when (and (search-forward "Located in " nil t)
-	     (looking-at "\\S-*")
+	     (looking-at "\\S-+")
 	     (string-equal (buffer-file-name buffer)
 			   (match-string 0)))
     (with-current-buffer buffer
@@ -1161,12 +1161,12 @@
      (let ((buf (gdb-get-buffer ',buf-key)))
        (and buf
 	    (with-current-buffer buf
-	      (let ((p (point))
+	      (let ((p (window-point (get-buffer-window buf 0)))
 		    (buffer-read-only nil))
 		(erase-buffer)
 		(insert-buffer-substring (gdb-get-create-buffer
 					  'gdb-partial-output-buffer))
-		(goto-char p)))))
+		(set-window-point (get-buffer-window buf 0) p)))))
      ;; put customisation here
      (,custom-defun)))
 
@@ -1304,7 +1304,7 @@
 	(goto-char (point-min))
 	(while (< (point) (- (point-max) 1))
 	  (forward-line 1)
-	  (if (looking-at "[^\t].*breakpoint")
+	  (if (looking-at "[^\t].*?breakpoint")
 	      (progn
 		(looking-at "\\([0-9]+\\)\\s-+\\S-+\\s-+\\S-+\\s-+\\(.\\)")
 		(setq bptno (match-string 1))
@@ -1446,9 +1446,9 @@
   (save-excursion
     (beginning-of-line 1)
     (if (if (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba))
-	    (looking-at "\\([0-9]+\\).*point\\s-*\\S-*\\s-*\\(.\\)")
+	    (looking-at "\\([0-9]+\\).*?point\\s-+\\S-+\\s-+\\(.\\)\\s-+")
 	  (looking-at
-     "\\([0-9]+\\)\\s-*\\S-*\\s-*\\S-*\\s-*\\(.\\)\\s-*\\S-*\\s-*\\S-*:[0-9]+"))
+     "\\([0-9]+\\)\\s-+\\S-+\\s-+\\S-+\\s-+\\(.\\)\\s-+\\S-+\\s-+\\S-+:[0-9]+"))
 	(gdb-enqueue-input
 	 (list
 	  (concat gdb-server-prefix
@@ -1463,9 +1463,9 @@
   (interactive)
   (beginning-of-line 1)
   (if (if (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba))
-	  (looking-at "\\([0-9]+\\).*point\\s-*\\S-*\\s-*\\(.\\)")
+	  (looking-at "\\([0-9]+\\).*?point\\s-+\\S-+\\s-+\\(.\\)")
 	(looking-at
-	 "\\([0-9]+\\)\\s-*\\S-*\\s-*\\S-*\\s-*.\\s-*\\S-*\\s-*\\S-*:[0-9]+"))
+	 "\\([0-9]+\\)\\s-+\\S-+\\s-+\\S-+\\s-+\\s-+\\S-+\\s-+\\S-+:[0-9]+"))
       (gdb-enqueue-input
        (list
 	(concat gdb-server-prefix "delete " (match-string 1) "\n") 'ignore))
@@ -1478,10 +1478,10 @@
   (save-excursion
     (beginning-of-line 1)
     (if (if (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba))
-	    (looking-at "\\([0-9]+\\) .* in .* at\\s-+\\(\\S-*\\):\\([0-9]+\\)")
+	    (looking-at "\\([0-9]+\\) .+ in .+ at\\s-+\\(\\S-+\\):\\([0-9]+\\)")
 	  (looking-at
-	   "\\([0-9]+\\)\\s-*\\S-*\\s-*\\S-*\\s-*.\\s-*\\S-*\\s-*\
-\\(\\S-*\\):\\([0-9]+\\)"))
+	   "\\([0-9]+\\)\\s-+\\S-+\\s-+\\S-+\\s-+.\\s-+\\S-+\\s-+\
+\\(\\S-+\\):\\([0-9]+\\)"))
 	(let ((bptno (match-string 1))
 	      (file  (match-string 2))
 	      (line  (match-string 3)))
@@ -1766,7 +1766,11 @@
   gdb-read-memory-handler
   gdb-read-memory-custom)
 
-(defun gdb-read-memory-custom ())
+(defun gdb-read-memory-custom ()
+  (save-excursion
+    (goto-char (point-min))
+    (if (looking-at "0x[[:xdigit:]]+")
+	(setq gdb-memory-address (match-string 0)))))
 
 (defvar gdb-memory-mode-map
   (let ((map (make-sparse-keymap)))
@@ -1790,8 +1794,8 @@
     (select-window (posn-window (event-start event)))
     (let* ((arg (read-from-minibuffer "Repeat count: "))
 	  (count (string-to-number arg)))
-      (if (< count 0)
-	  (error "Non-negative numbers only")
+      (if (<= count 0)
+	  (error "Positive numbers only")
 	(customize-set-variable 'gdb-memory-repeat-count count)
 	(gdb-invalidate-memory)))))
 
@@ -1944,7 +1948,38 @@
   (setq header-line-format
 	'(:eval
 	  (concat
-	   "Read address: "
+	   "Read address["
+	   (propertize
+	    "-"
+	    'face font-lock-warning-face
+	    'help-echo "mouse-1: Decrement address"
+	    'mouse-face 'mode-line-highlight
+	    'local-map
+	    (gdb-make-header-line-mouse-map
+	     'mouse-1
+	     #'(lambda () (interactive)
+		 (let ((gdb-memory-address
+			;; let GDB do the arithmetic
+			(concat
+			 gdb-memory-address " - "
+			 (number-to-string
+			  (* gdb-memory-repeat-count
+			     (cond ((string= gdb-memory-unit "b") 1)
+				   ((string= gdb-memory-unit "h") 2)
+				   ((string= gdb-memory-unit "w") 4)
+				   ((string= gdb-memory-unit "g") 8)))))))
+		       (gdb-invalidate-memory)))))
+	   "|"
+	   (propertize "+"
+		       'face font-lock-warning-face
+		       'help-echo "mouse-1: Increment address"
+		       'mouse-face 'mode-line-highlight
+		       'local-map (gdb-make-header-line-mouse-map
+				   'mouse-1
+				   #'(lambda () (interactive)
+				       (let ((gdb-memory-address nil))
+					 (gdb-invalidate-memory)))))
+	   "]: "
 	   (propertize gdb-memory-address
 		       'face font-lock-warning-face
 		       'help-echo "mouse-1: Set memory address"
@@ -2266,7 +2301,7 @@
 buffers."
   (goto-char (point-min))
   (if (and (search-forward "Located in " nil t)
-	   (looking-at "\\S-*"))
+	   (looking-at "\\S-+"))
       (setq gdb-main-file (match-string 0)))
   (goto-char (point-min))
   (if (search-forward "Includes preprocessor macro info." nil t)
@@ -2284,7 +2319,7 @@
   (goto-char (point-min))
   (catch 'file-not-found
     (if (search-forward "Located in " nil t)
-	(when (looking-at "\\S-*")
+	(when (looking-at "\\S-+")
 	  (delete (cons bptno "File not found") gdb-location-alist)
 	  (push (cons bptno (match-string 0)) gdb-location-alist))
       (gdb-resync)
@@ -2439,25 +2474,26 @@
   (let ((buffer (gdb-get-buffer 'gdb-assembler-buffer))
 	(pos 1) (address) (flag) (bptno))
     (with-current-buffer buffer
-      (if (not (equal gdb-frame-address "main"))
-	  (progn
-	    (goto-char (point-min))
-	    (if (and gdb-frame-address
-		     (re-search-forward gdb-frame-address nil t))
-		(progn
-		  (setq pos (point))
-		  (beginning-of-line)
-		  (or gdb-overlay-arrow-position
-		      (setq gdb-overlay-arrow-position (make-marker)))
-		  (set-marker gdb-overlay-arrow-position
-			      (point) (current-buffer))))))
-      ;; remove all breakpoint-icons in assembler buffer before updating.
-      (gdb-remove-breakpoint-icons (point-min) (point-max)))
+      (save-excursion
+	(if (not (equal gdb-frame-address "main"))
+	    (progn
+	      (goto-char (point-min))
+	      (if (and gdb-frame-address
+		       (re-search-forward gdb-frame-address nil t))
+		  (progn
+		    (setq pos (point))
+		    (beginning-of-line)
+		    (or gdb-overlay-arrow-position
+			(setq gdb-overlay-arrow-position (make-marker)))
+		    (set-marker gdb-overlay-arrow-position
+				(point) (current-buffer))))))
+	;; remove all breakpoint-icons in assembler buffer before updating.
+	(gdb-remove-breakpoint-icons (point-min) (point-max))))
     (with-current-buffer (gdb-get-buffer 'gdb-breakpoints-buffer)
       (goto-char (point-min))
       (while (< (point) (- (point-max) 1))
 	(forward-line 1)
-	(if (looking-at "[^\t].*breakpoint")
+	(if (looking-at "[^\t].*?breakpoint")
 	    (progn
 	      (looking-at
 	    "\\([0-9]+\\)\\s-+\\S-+\\s-+\\S-+\\s-+\\(.\\)\\s-+0x0*\\(\\S-+\\)")
@@ -2465,9 +2501,10 @@
 	      (setq flag (char-after (match-beginning 2)))
 	      (setq address (match-string 3))
 	      (with-current-buffer buffer
+		(save-excursion
 		  (goto-char (point-min))
 		  (if (re-search-forward address nil t)
-		      (gdb-put-breakpoint-icon (eq flag ?y) bptno)))))))
+		      (gdb-put-breakpoint-icon (eq flag ?y) bptno))))))))
     (if (not (equal gdb-frame-address "main"))
 	(set-window-point (get-buffer-window buffer 0) pos))))
 
@@ -2517,12 +2554,14 @@
 (defun gdb-display-assembler-buffer ()
   "Display disassembly view."
   (interactive)
+  (setq gdb-previous-frame nil)
   (gdb-display-buffer
    (gdb-get-create-buffer 'gdb-assembler-buffer)))
 
 (defun gdb-frame-assembler-buffer ()
   "Display disassembly view in a new frame."
   (interactive)
+  (setq gdb-previous-frame nil)
   (let ((special-display-regexps (append special-display-regexps '(".*")))
 	(special-display-frame-alist gdb-frame-parameters))
     (display-buffer (gdb-get-create-buffer 'gdb-assembler-buffer))))
--- a/lisp/progmodes/inf-lisp.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/progmodes/inf-lisp.el	Fri Jun 03 05:49:26 2005 +0000
@@ -260,7 +260,8 @@
 If you accidentally suspend your process, use \\[comint-continue-subjob]
 to continue it."
   (interactive)
-  (comint-mode)
+  (delay-mode-hooks
+    (comint-mode))
   (setq comint-prompt-regexp inferior-lisp-prompt)
   (setq major-mode 'inferior-lisp-mode)
   (setq mode-name "Inferior Lisp")
--- a/lisp/progmodes/make-mode.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/progmodes/make-mode.el	Fri Jun 03 05:49:26 2005 +0000
@@ -266,14 +266,14 @@
   "Characters to skip to find a line that might be a dependency.")
 
 (defvar makefile-rule-action-regex
-  "^\t[ \t]*\\([-@]*\\)[ \t]*\\(\\(?:.+\\\\\n\\)*.+\\)"
+  "^\t[ \t]*\\([-@]*\\)[ \t]*\\(\\(?:.*\\\\\n\\)*.*\\)"
   "Regex used to highlight rule action lines in font lock mode.")
 
 ;; Note that the first and second subexpression is used by font lock.  Note
 ;; that if you change this regexp you might have to fix the imenu index in
 ;; makefile-imenu-generic-expression.
 (defconst makefile-macroassign-regex
-  "^ *\\([^ \n\t][^:#= \t\n]*\\)[ \t]*\\(?:!=[ \t]*\\(\\(?:.+\\\\\n\\)*.+\\)\\|[*:+]?[:?]?=[ \t]*\\(\\(?:.+\\\\\n\\)*.+\\)\\)"
+  "^ *\\([^ \n\t][^:#= \t\n]*\\)[ \t]*\\(?:!=[ \t]*\\(\\(?:.+\\\\\n\\)*.+\\)\\|[*:+]?[:?]?=[ \t]*\\(\\(?:.*\\\\\n\\)*.*\\)\\)"
   "Regex used to find macro assignment lines in a makefile.")
 
 (defconst makefile-var-use-regex
@@ -420,7 +420,7 @@
    nil
    "^\\(?: [ \t]*\\)?\\(?:and[ \t]+\\|else[ \t]+\\|or[ \t]+\\)?if\\(n\\)\\(?:def\\|eq\\|sys\\)\\>"
 
-   '("[^$]\\(\\$[({]\\(?:target\\|output\\)s?\\_>.*?[})]\\)"
+   '("[^$]\\(\\$[({]\\(?:output\\|stem\\|target\\)s?\\_>.*?[})]\\)"
      1 'makefile-targets-face prepend)
 
    ;; Colon modifier keywords.
@@ -851,7 +851,7 @@
   "An adapted `makefile-mode' that knows about makepp."
    (set (make-local-variable 'makefile-rule-action-regex)
 	;; Don't care about initial tab, but I don't know how to font-lock correctly without.
-	"^\t[ \t]*\\(\\(?:\\(?:noecho\\|ignore[-_]error\\|[-@]+\\)[ \t]*\\)*\\)\\(\\(&\\S +\\)?\\(?:.+\\\\\n\\)*.+\\)")
+	"^\t[ \t]*\\(\\(?:\\(?:noecho\\|ignore[-_]error\\|[-@]+\\)[ \t]*\\)*\\)\\(\\(&\\S +\\)?\\(?:.*\\\\\n\\)*.*\\)")
 
   (setq font-lock-defaults
 	`(makefile-makepp-font-lock-keywords ,@(cdr font-lock-defaults))
@@ -867,7 +867,7 @@
        "^ *\\(\\(?: *\\$\\(?:[({]\\(?:\\$\\(?:[({]\\(?:\\$\\(?:[^({]\\|.[^\n$#})]+?[})]\\)\\|[^\n$#)}]\\)+?[})]\\|[^({]\\)\\|[^\n$#)}]\\)+?[})]\\|[^({]\\)\\| *[^ \n$#:=]+\\)+?\\)[ \t]*\\([:!]\\)\\(?:[ \t]*$\\|[^=\n]\\(?:[^#\n]*?;[ \t]*\\(.+\\)\\)?\\)")
   (set (make-local-variable 'makefile-dependency-skip) "^:!")
   (set (make-local-variable 'makefile-rule-action-regex)
-       "^\t[ \t]*\\([-+@]*\\)[ \t]*\\(\\(?:.+\\\\\n\\)*.+\\)")
+       "^\t[ \t]*\\([-+@]*\\)[ \t]*\\(\\(?:.*\\\\\n\\)*.*\\)")
   (setq font-lock-defaults
 	`(makefile-bsdmake-font-lock-keywords ,@(cdr font-lock-defaults))))
 
--- a/lisp/progmodes/vhdl-mode.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/progmodes/vhdl-mode.el	Fri Jun 03 05:49:26 2005 +0000
@@ -127,7 +127,7 @@
   "Non-nil if XEmacs is used.")
 ;; Emacs 21 handling
 (defconst vhdl-emacs-21 (and (= emacs-major-version 21) (not vhdl-xemacs))
-  "Non-nil if GNU Emacs 21 is used.")
+  "Non-nil if Emacs 21 is used.")
 
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -4568,8 +4568,7 @@
   (set (make-local-variable 'indent-line-function) 'vhdl-indent-line)
   (set (make-local-variable 'comment-start) "--")
   (set (make-local-variable 'comment-end) "")
-  (when vhdl-emacs-21
-    (set (make-local-variable 'comment-padding) ""))
+  (set (make-local-variable 'comment-padding) "")
   (set (make-local-variable 'comment-column) vhdl-inline-comment-column)
   (set (make-local-variable 'end-comment-column) vhdl-end-comment-column)
   (set (make-local-variable 'comment-start-skip) "--+\\s-*")
@@ -7484,7 +7483,13 @@
     (while (re-search-forward "\\(--.*\n\\|\"[^\"\n]*[\"\n]\\)\\|\\(\\([^/:<>=]\\)\\(:\\|=\\|<\\|>\\|:=\\|<=\\|>=\\|=>\\|/=\\)\\([^=>]\\|$\\)\\)" end t)
       (if (match-string 1)
 	  (goto-char (match-end 1))
-	(replace-match "\\3 \\4 \\5")
+	(save-excursion
+	  (goto-char (match-beginning 4))
+	  (unless (eq (preceding-char) ?\ )
+	    (insert " "))
+	  (goto-char (match-end 4))
+	  (unless (eq (following-char) ?\ )
+	    (insert " ")))
 	(goto-char (match-end 4))))
     ;; eliminate multiple spaces and spaces at end of line
     (goto-char beg)
@@ -7540,7 +7545,7 @@
   (interactive "r\np")
   (save-excursion
     (goto-char beg)
-    (let ((margin (if interactive (current-indentation) (current-column))))
+    (let ((margin (if arg (current-indentation) (current-column))))
       (goto-char end)
       (setq end (point-marker))
       ;; remove inline comments, newlines and whitespace
@@ -12055,8 +12060,7 @@
 # statements  : %5d\n\
 # code lines  : %5d\n\
 # total lines : %5d\n\ "
-	     (buffer-file-name) no-stats no-code-lines no-lines)
-    (unless vhdl-emacs-21 (vhdl-show-messages))))
+	     (buffer-file-name) no-stats no-code-lines no-lines)))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Help functions
--- a/lisp/progmodes/which-func.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/progmodes/which-func.el	Fri Jun 03 05:49:26 2005 +0000
@@ -196,7 +196,7 @@
 	      (puthash window current which-func-table)
 	      (force-mode-line-update)))
 	(error
-	 (which-func-mode -1)
+	 (setq which-func-mode nil)
 	 (error "Error in which-func-update: %s" info))))))
 
 ;;;###autoload
--- a/lisp/recentf.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/recentf.el	Fri Jun 03 05:49:26 2005 +0000
@@ -76,7 +76,7 @@
   :type 'file)
 
 (defcustom recentf-exclude nil
-"*List of regexps and predicates for filenames excluded from the recent list.
+  "*List of regexps and predicates for filenames excluded from the recent list.
 When a filename matches any of the regexps or satisfies any of the
 predicates it is excluded from the recent list.
 A predicate is a function that is passed a filename to check and that
--- a/lisp/saveplace.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/saveplace.el	Fri Jun 03 05:49:26 2005 +0000
@@ -222,7 +222,8 @@
               (t
                t))))
 	(condition-case nil
-	    (write-file file)
+	    ;; Don't use write-file; we don't want this buffer to visit it.
+	    (write-region (point-min) (point-max) file)
 	  (file-error (message "Can't write %s" file)))
         (kill-buffer (current-buffer))
         (message "Saving places to %s...done" file)))))
--- a/lisp/simple.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/simple.el	Fri Jun 03 05:49:26 2005 +0000
@@ -2247,7 +2247,7 @@
 If DELETE is non-nil, the text between BEG and END is deleted
 from the buffer.
 
-Point is temporarily set to BEG before caling
+Point is temporarily set to BEG before calling
 `buffer-substring-filters', in case the functions need to know
 where the text came from.
 
--- a/lisp/subr.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/subr.el	Fri Jun 03 05:49:26 2005 +0000
@@ -2008,14 +2008,34 @@
 	(buffer-substring-no-properties (match-beginning num)
 					(match-end num)))))
 
-(defun looking-back (regexp &optional limit)
+(defun looking-back (regexp &optional limit greedy)
   "Return non-nil if text before point matches regular expression REGEXP.
 Like `looking-at' except matches before point, and is slower.
 LIMIT if non-nil speeds up the search by specifying how far back the
-match can start."
-  (not (null
-	(save-excursion
-	  (re-search-backward (concat "\\(?:" regexp "\\)\\=") limit t)))))
+match can start.
+
+If GREEDY is non-nil, extend the match backwards as far as possible,
+stopping when a single additional previous character cannot be part
+of a match for REGEXP."
+  (let ((start (point))
+	(pos
+	 (save-excursion
+	   (and (re-search-backward (concat "\\(?:" regexp "\\)\\=") limit t)
+		(point)))))
+    (if (and greedy pos)
+	(save-restriction
+	  (narrow-to-region (point-min) start)
+	  (while (and (> pos (point-min))
+		      (save-excursion
+			(goto-char pos)
+			(backward-char 1)
+			(looking-at (concat "\\(?:"  regexp "\\)\\'"))))
+	    (setq pos (1- pos)))
+	  (save-excursion
+	    (goto-char pos)
+	    (looking-at (concat "\\(?:"  regexp "\\)\\'")))))
+    (not (null pos))))
+
 
 (defconst split-string-default-separators "[ \f\t\n\r\v]+"
   "The default value of separators for `split-string'.
--- a/lisp/textmodes/flyspell.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/textmodes/flyspell.el	Fri Jun 03 05:49:26 2005 +0000
@@ -1,6 +1,6 @@
 ;;; flyspell.el --- on-the-fly spell checker
 
-;; Copyright (C) 1998, 2000, 2001, 2002, 2004  Free Software Foundation, Inc.
+;; Copyright (C) 1998, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
 
 ;; Author: Manuel Serrano <Manuel.Serrano@sophia.inria.fr>
 ;; Maintainer: FSF
@@ -56,6 +56,21 @@
   :group 'processes)
 
 ;*---------------------------------------------------------------------*/
+;*    Which emacs are we currently running                             */
+;*---------------------------------------------------------------------*/
+(defvar flyspell-emacs
+  (cond
+   ((string-match "XEmacs" emacs-version)
+    'xemacs)
+   (t
+    'emacs))
+  "The type of Emacs we are currently running.")
+
+(defvar flyspell-use-local-map
+  (or (eq flyspell-emacs 'xemacs)
+      (not (string< emacs-version "20"))))
+
+;*---------------------------------------------------------------------*/
 ;*    User configuration ...                                           */
 ;*---------------------------------------------------------------------*/
 (defcustom flyspell-highlight-flag t
@@ -109,7 +124,8 @@
     delete-backward-char
     backward-or-forward-delete-char
     delete-char
-    scrollbar-vertical-drag)
+    scrollbar-vertical-drag
+    backward-delete-char-untabify)
   "The standard list of delayed commands for Flyspell.
 See `flyspell-delayed-commands'."
   :group 'flyspell
@@ -199,15 +215,15 @@
   :type '(repeat (string)))
 
 (defcustom flyspell-abbrev-p
-  t
-  "*If true, add correction to abbreviation table."
+  nil
+  "*If non-nil, add correction to abbreviation table."
   :group 'flyspell
   :version "21.1"
   :type 'boolean)
 
 (defcustom flyspell-use-global-abbrev-table-p
   nil
-  "*If true, prefer global abbrev table to local abbrev table."
+  "*If non-nil, prefer global abbrev table to local abbrev table."
   :group 'flyspell
   :version "21.1"
   :type 'boolean)
@@ -224,10 +240,12 @@
 If the region is smaller than this number of characters,
 `flyspell-region' checks the words sequentially using regular
 flyspell methods.  Else, if the region is large, a new Ispell process is
-spawned for speed."
+spawned for speed.
+
+If `flyspell-large-region' is nil, all regions are treated as small."
   :group 'flyspell
   :version "21.1"
-  :type 'number)
+  :type '(choice number boolean))
 
 (defcustom flyspell-insert-function (function insert)
   "*Function for inserting word by flyspell upon correction."
@@ -244,6 +262,20 @@
   :group 'flyspell
   :type '(choice string (const nil)))
 
+(defcustom flyspell-use-meta-tab t
+  "*Non-nil means that flyspell uses META-TAB to correct word."
+  :group 'flyspell
+  :type 'boolean)
+
+(defcustom flyspell-auto-correct-binding
+  (cond
+   ((eq flyspell-emacs 'xemacs)
+    [(control \;)])
+   (t
+    [?\C-\;]))
+  "The key binding for flyspell auto correction."
+  :group 'flyspell)
+
 ;*---------------------------------------------------------------------*/
 ;*    Mode specific options                                            */
 ;*    -------------------------------------------------------------    */
@@ -267,17 +299,24 @@
 (put 'message-mode 'flyspell-mode-predicate 'mail-mode-flyspell-verify)
 (defun mail-mode-flyspell-verify ()
   "This function is used for `flyspell-generic-check-word-p' in Mail mode."
-  (let ((in-headers (save-excursion
-		      ;; When mail-header-separator is "",
-		      ;; it is likely to be found in both directions.
-		      (not (re-search-backward (concat "^" (regexp-quote mail-header-separator) "$") nil t))))
-	(in-signature (save-excursion
-			(re-search-backward message-signature-separator nil t))))
-    (cond (in-headers
+  (let ((header-end (save-excursion
+		      (goto-char (point-min))
+		      (re-search-forward
+		       (concat "^"
+			       (regexp-quote mail-header-separator)
+			       "$")
+		       nil t)
+		      (point)))
+	(signature-begin (save-excursion
+			   (goto-char (point-max))
+			   (re-search-backward message-signature-separator
+					       nil t)
+			   (point))))
+    (cond ((< (point) header-end)
 	   (and (save-excursion (beginning-of-line)
 				(looking-at "^Subject:"))
 		(> (point) (match-end 0))))
-	  (in-signature
+	  ((> (point) signature-begin)
 	   nil)
 	  (t
 	   (save-excursion
@@ -351,7 +390,8 @@
   "Turn on `flyspell-mode' for comments and strings."
   (interactive)
   (setq flyspell-generic-check-word-p 'flyspell-generic-progmode-verify)
-  (flyspell-mode 1))
+  (flyspell-mode 1)
+  (run-hooks 'flyspell-prog-mode-hook))
 
 ;*---------------------------------------------------------------------*/
 ;*    Overlay compatibility                                            */
@@ -366,21 +406,6 @@
 (autoload 'previous-overlay-change "overlay" "Overlay compatibility kit." t)
 
 ;*---------------------------------------------------------------------*/
-;*    Which emacs are we currently running                             */
-;*---------------------------------------------------------------------*/
-(defvar flyspell-emacs
-  (cond
-   ((string-match "XEmacs" emacs-version)
-    'xemacs)
-   (t
-    'emacs))
-  "The type of Emacs we are currently running.")
-
-(defvar flyspell-use-local-map
-  (or (eq flyspell-emacs 'xemacs)
-      (not (string< emacs-version "20"))))
-
-;*---------------------------------------------------------------------*/
 ;*    The minor mode declaration.                                      */
 ;*---------------------------------------------------------------------*/
 (eval-when-compile (defvar flyspell-local-mouse-map))
@@ -391,9 +416,13 @@
 
 (defvar flyspell-mouse-map
   (let ((map (make-sparse-keymap)))
+    (if flyspell-use-meta-tab
+	(define-key map "\M-\t" #'flyspell-auto-correct-word))
     (define-key map (if (featurep 'xemacs) [button2] [down-mouse-2])
       #'flyspell-correct-word)
-    (define-key map "\M-\t" #'flyspell-auto-correct-word)
+    (define-key map flyspell-auto-correct-binding 'flyspell-auto-correct-previous-word)
+    (define-key map [(control \,)] 'flyspell-goto-next-error)
+    (define-key map [(control \.)] 'flyspell-auto-correct-word)
     map))
 
 ;;;###autoload
@@ -404,7 +433,18 @@
 	  (setq minor-mode-map-alist
 		(cons (cons 'flyspell-mode flyspell-mode-map)
 		      minor-mode-map-alist)))
-  (define-key flyspell-mode-map "\M-\t" 'flyspell-auto-correct-word))
+  (if flyspell-use-meta-tab
+      (define-key flyspell-mode-map "\M-\t" 'flyspell-auto-correct-word))
+  (cond
+   ((eq flyspell-emacs 'xemacs)
+    (define-key flyspell-mode-map flyspell-auto-correct-binding 'flyspell-auto-correct-previous-word)
+    (define-key flyspell-mode-map [(control \,)] 'flyspell-goto-next-error)
+    (define-key flyspell-mode-map [(control \.)] 'flyspell-auto-correct-word))
+   (flyspell-use-local-map
+    (define-key flyspell-mode-map flyspell-auto-correct-binding 'flyspell-auto-correct-previous-word)
+    (define-key flyspell-mode-map [?\C-\,] 'flyspell-goto-next-error)
+    (define-key flyspell-mode-map [?\C-\.] 'flyspell-auto-correct-word))))
+
 
 ;; the name of the overlay property that defines the keymap
 (defvar flyspell-overlay-keymap-property-name 'keymap)
@@ -456,7 +496,8 @@
 Bindings:
 \\[ispell-word]: correct words (using Ispell).
 \\[flyspell-auto-correct-word]: automatically correct word.
-\\[flyspell-correct-word] (or mouse-2): popup correct words.
+\\[flyspell-auto-correct-previous-word]: automatically correct the last misspelled word.
+\\[flyspell-correct-word] (or down-mouse-2): popup correct words.
 
 Hooks:
 This runs `flyspell-mode-hook' after flyspell is entered.
@@ -512,22 +553,19 @@
     (and (consp ws) (window-minibuffer-p (car ws)))))
 
 ;*---------------------------------------------------------------------*/
-;*    flyspell-version ...                                             */
-;*---------------------------------------------------------------------*/
-;;;###autoload
-(defun flyspell-version ()
-  "The flyspell version"
-  (interactive)
-  "1.6h")
-
-;*---------------------------------------------------------------------*/
 ;*    flyspell-accept-buffer-local-defs ...                            */
 ;*---------------------------------------------------------------------*/
 (defun flyspell-accept-buffer-local-defs ()
-  (ispell-accept-buffer-local-defs)
+  ;; strange problem.  If buffer in current window has font-lock turned on,
+  ;; but SET-BUFFER was called to point to an invisible buffer, this ispell
+  ;; call will reset the buffer to the buffer in the current window.  However,
+  ;; it only happens at startup (fix by Albert L. Ting).
+  (let ((buf (current-buffer)))
+    (ispell-accept-buffer-local-defs)
+    (set-buffer buf))
   (if (not (and (eq flyspell-dash-dictionary ispell-dictionary)
 		(eq flyspell-dash-local-dictionary ispell-local-dictionary)))
-      ;; the dictionary has changed
+      ;; The dictionary has changed
       (progn
 	(setq flyspell-dash-dictionary ispell-dictionary)
 	(setq flyspell-dash-local-dictionary ispell-local-dictionary)
@@ -566,6 +604,22 @@
   (let ((mode-predicate (get major-mode 'flyspell-mode-predicate)))
     (if mode-predicate
 	(setq flyspell-generic-check-word-p mode-predicate)))
+  ;; work around the fact that the `local-map' text-property replaces the
+  ;; buffer's local map rather than shadowing it.
+  (set (make-local-variable 'flyspell-mouse-map)
+       (let ((map (copy-keymap flyspell-mouse-map)))
+	 (set-keymap-parent map (current-local-map))
+	 (if (and (eq flyspell-emacs 'emacs)
+		  (not (string< emacs-version "20")))
+	     (define-key map '[tool-bar] nil))
+	 map))
+  (set (make-local-variable 'flyspell-mode-map)
+       (let ((map (copy-keymap flyspell-mode-map)))
+ 	 (set-keymap-parent map (current-local-map))
+	 (if (and (eq flyspell-emacs 'emacs)
+		  (not (string< emacs-version "20")))
+	     (define-key map '[tool-bar] nil))
+ 	 map))
   ;; the welcome message
   (if (and flyspell-issue-message-flag
 	   flyspell-issue-welcome-flag
@@ -624,9 +678,11 @@
 (defvar flyspell-word-cache-start  nil)
 (defvar flyspell-word-cache-end    nil)
 (defvar flyspell-word-cache-word   nil)
+(defvar flyspell-word-cache-result '_)
 (make-variable-buffer-local 'flyspell-word-cache-start)
 (make-variable-buffer-local 'flyspell-word-cache-end)
 (make-variable-buffer-local 'flyspell-word-cache-word)
+(make-variable-buffer-local 'flyspell-word-cache-result)
 
 ;*---------------------------------------------------------------------*/
 ;*    The flyspell pre-hook, store the current position. In the        */
@@ -678,7 +734,7 @@
 ;*    flyspell-check-pre-word-p ...                                    */
 ;*---------------------------------------------------------------------*/
 (defun flyspell-check-pre-word-p ()
-  "Return non-nil if we should to check the word before point.
+  "Return non-nil if we should check the word before point.
 More precisely, it applies to the word that was before point
 before the current command."
   (cond
@@ -735,7 +791,7 @@
 The answer depends of several criteria.
 Mostly we check word delimiters."
   (cond
-   ((and (eq (char-after start) ?\n) (> stop start))
+   ((and (memq (char-after start) '(?\n ? )) (> stop start))
     t)
    ((not (numberp flyspell-pre-point))
     t)
@@ -924,7 +980,9 @@
 	;; when a word is not checked because of a delayed command
 	;; we do not disable the ispell cache.
 	(if (and (symbolp this-command) (get this-command 'flyspell-delayed))
-	    (setq flyspell-word-cache-end -1))))
+	    (progn
+	      (setq flyspell-word-cache-end -1)
+	      (setq flyspell-word-cache-result '_)))))
     (while (consp flyspell-changes)
       (let ((start (car (car flyspell-changes)))
 	    (stop  (cdr (car flyspell-changes))))
@@ -949,6 +1007,34 @@
 	(message (format "mispelling `%s'  %S" word replacements)))))
 
 ;*---------------------------------------------------------------------*/
+;*    flyspell-word-search-backward ...                                */
+;*---------------------------------------------------------------------*/
+(defun flyspell-word-search-backward (word bound)
+  (save-excursion
+    (let ((r '())
+	  p)
+      (while (and (not r) (setq p (search-backward word bound t)))
+	(let ((lw (flyspell-get-word '())))
+	  (if (and (consp lw) (string-equal (car lw) word))
+	      (setq r p)
+	    (goto-char p))))
+      r)))
+	  
+;*---------------------------------------------------------------------*/
+;*    flyspell-word-search-forward ...                                 */
+;*---------------------------------------------------------------------*/
+(defun flyspell-word-search-forward (word bound)
+  (save-excursion
+    (let ((r '())
+	  p)
+      (while (and (not r) (setq p (search-forward word bound t)))
+	(let ((lw (flyspell-get-word '())))
+	  (if (and (consp lw) (string-equal (car lw) word))
+	      (setq r p)
+	    (goto-char (1+ p)))))
+      r)))
+	  
+;*---------------------------------------------------------------------*/
 ;*    flyspell-word ...                                                */
 ;*---------------------------------------------------------------------*/
 (defun flyspell-word (&optional following)
@@ -963,7 +1049,7 @@
       (if (or (eq flyspell-word nil)
  	      (and (fboundp flyspell-generic-check-word-p)
  		   (not (funcall flyspell-generic-check-word-p))))
-	  '()
+	  t
 	(progn
 	  ;; destructure return flyspell-word info list.
 	  (setq start (car (cdr flyspell-word))
@@ -972,21 +1058,24 @@
 	  ;; before checking in the directory, we check for doublons.
 	  (cond
 	   ((and (or (not (eq ispell-parser 'tex))
-		     (not (eq (char-after start) ?\\)))
+		     (and (> start (point-min))
+			  (not (eq (char-after (1- start)) ?}))
+			  (not (eq (char-after (1- start)) ?\\))))
 		 flyspell-mark-duplications-flag
 		 (save-excursion
-		   (goto-char start)
-		   (word-search-backward word
-					 (- start
-					    (+ 1 (- end start)))
-					 t)))
+		   (goto-char (1- start))
+		   (let ((p (flyspell-word-search-backward 
+			     word
+			     (- start (1+ (- end start))))))
+		     (and p (/= p (1- start))))))
 	    ;; yes, this is a doublon
-	    (flyspell-highlight-incorrect-region start end 'doublon))
+	    (flyspell-highlight-incorrect-region start end 'doublon)
+	    nil)
 	   ((and (eq flyspell-word-cache-start start)
 		 (eq flyspell-word-cache-end end)
 		 (string-equal flyspell-word-cache-word word))
 	    ;; this word had been already checked, we skip
-	    nil)
+	    flyspell-word-cache-result)
 	   ((and (eq ispell-parser 'tex)
 		 (flyspell-tex-command-p flyspell-word))
 	    ;; this is a correct word (because a tex command)
@@ -1016,59 +1105,68 @@
 	    (setq ispell-filter (cdr ispell-filter))
 	    (if (consp ispell-filter)
 		(setq poss (ispell-parse-output (car ispell-filter))))
-	    (cond ((eq poss t)
-		   ;; correct
-		   (flyspell-unhighlight-at start)
-		   (if (> end start)
-		       (flyspell-unhighlight-at (- end 1)))
-		   t)
-		  ((and (stringp poss) flyspell-highlight-flag)
-		   ;; correct
-		   (flyspell-unhighlight-at start)
-		   (if (> end start)
-		       (flyspell-unhighlight-at (- end 1)))
-		   t)
-		  ((null poss)
-		   (flyspell-unhighlight-at start)
-		   (if (> end start)
-		       (flyspell-unhighlight-at (- end 1))))
-		  ((or (and (< flyspell-duplicate-distance 0)
-			    (or (save-excursion
-				  (goto-char start)
-				  (word-search-backward word
-							(point-min)
-							t))
-				(save-excursion
-				  (goto-char end)
-				  (word-search-forward word
-						       (point-max)
-						       t))))
-		       (and (> flyspell-duplicate-distance 0)
-			    (or (save-excursion
-				  (goto-char start)
-				  (word-search-backward
-				   word
-				   (- start
-				      flyspell-duplicate-distance)
-				   t))
-				(save-excursion
-				  (goto-char end)
-				  (word-search-forward
-				   word
-				   (+ end
-				      flyspell-duplicate-distance)
-				   t)))))
-		   (if flyspell-highlight-flag
-		       (flyspell-highlight-duplicate-region start end poss)
-		     (message (format "duplicate `%s'" word))))
-		  (t
-		   ;; incorrect highlight the location
-		   (if flyspell-highlight-flag
-		       (flyspell-highlight-incorrect-region start end poss)
-		     (flyspell-notify-misspell start end word poss))))
-	    ;; return to original location
-	    (goto-char cursor-location)
-	    (if ispell-quit (setq ispell-quit nil)))))))))
+	    (let ((res (cond ((eq poss t)
+			      ;; correct
+			      (setq flyspell-word-cache-result t)
+			      (flyspell-unhighlight-at start)
+			      (if (> end start)
+				  (flyspell-unhighlight-at (- end 1)))
+			      t)
+			     ((and (stringp poss) flyspell-highlight-flag)
+			      ;; correct
+			      (setq flyspell-word-cache-result t)
+			      (flyspell-unhighlight-at start)
+			      (if (> end start)
+				  (flyspell-unhighlight-at (- end 1)))
+			      t)
+			     ((null poss)
+			      (setq flyspell-word-cache-result t)
+			      (flyspell-unhighlight-at start)
+			      (if (> end start)
+				  (flyspell-unhighlight-at (- end 1)))
+			      t)
+			     ((or (and (< flyspell-duplicate-distance 0)
+				       (or (save-excursion
+					     (goto-char start)
+					     (flyspell-word-search-backward
+					      word
+					      (point-min)))
+					   (save-excursion
+					     (goto-char end)
+					     (flyspell-word-search-forward
+					      word
+					      (point-max)))))
+				  (and (> flyspell-duplicate-distance 0)
+				       (or (save-excursion
+					     (goto-char start)
+					     (flyspell-word-search-backward
+					      word
+					      (- start
+						 flyspell-duplicate-distance)))
+					   (save-excursion
+					     (goto-char end)
+					     (flyspell-word-search-forward
+					      word
+					      (+ end
+						 flyspell-duplicate-distance))))))
+			      (setq flyspell-word-cache-result nil)
+			      (if flyspell-highlight-flag
+				  (flyspell-highlight-duplicate-region
+				   start end poss)
+				(message (format "duplicate `%s'" word)))
+			      nil)
+			     (t
+			      (setq flyspell-word-cache-result nil)
+			      ;; incorrect highlight the location
+			      (if flyspell-highlight-flag
+				  (flyspell-highlight-incorrect-region
+				   start end poss)
+				(flyspell-notify-misspell start end word poss))
+			      nil))))
+	      ;; return to original location
+	      (goto-char cursor-location) 
+	      (if ispell-quit (setq ispell-quit nil))
+	      res))))))))
 
 ;*---------------------------------------------------------------------*/
 ;*    flyspell-tex-math-initialized ...                                */
@@ -1175,30 +1273,31 @@
 ;*---------------------------------------------------------------------*/
 ;*    flyspell-get-word ...                                            */
 ;*---------------------------------------------------------------------*/
-(defun flyspell-get-word (following)
+(defun flyspell-get-word (following &optional extra-otherchars)
   "Return the word for spell-checking according to Ispell syntax.
-If argument FOLLOWING is non-nil or if `ispell-following-word'
+If optional argument FOLLOWING is non-nil or if `flyspell-following-word'
 is non-nil when called interactively, then the following word
 \(rather than preceding\) is checked when the cursor is not over a word.
-Optional second argument contains other chars that can be included in word
+Optional second argument contains otherchars that can be included in word
 many times.
 
-Word syntax described by `ispell-dictionary-alist' (which see)."
+Word syntax described by `flyspell-dictionary-alist' (which see)."
   (let* ((flyspell-casechars (flyspell-get-casechars))
 	 (flyspell-not-casechars (flyspell-get-not-casechars))
 	 (ispell-otherchars (ispell-get-otherchars))
 	 (ispell-many-otherchars-p (ispell-get-many-otherchars-p))
-	 (word-regexp (if (string< "" ispell-otherchars)
-			  (concat flyspell-casechars
-				  "+\\("
-				  ispell-otherchars
-				  "?"
-				  flyspell-casechars
-				  "+\\)"
-				  (if ispell-many-otherchars-p
-				      "*" "?"))
-			(concat flyspell-casechars "+")))
-	 did-it-once
+	 (word-regexp (concat flyspell-casechars
+			      "+\\("
+			      (if (not (string= "" ispell-otherchars))
+				  (concat ispell-otherchars "?"))
+			      (if extra-otherchars
+				  (concat extra-otherchars "?"))
+			      flyspell-casechars
+			      "+\\)"
+			      (if (or ispell-many-otherchars-p
+				      extra-otherchars)
+				  "*" "?")))
+	 did-it-once prevpt
 	 start end word)
     ;; find the word
     (if (not (looking-at flyspell-casechars))
@@ -1207,21 +1306,26 @@
 	  (re-search-backward flyspell-casechars (point-min) t)))
     ;; move to front of word
     (re-search-backward flyspell-not-casechars (point-min) 'start)
-    (let ((pos nil))
-      (if (string< "" ispell-otherchars)
-	  (while (and (looking-at ispell-otherchars)
-		      (not (bobp))
-		      (or (not did-it-once)
-			  ispell-many-otherchars-p)
-		      (not (eq pos (point))))
-	    (setq pos (point))
-	    (setq did-it-once t)
+    (while (and (or (and (not (string= "" ispell-otherchars))
+			 (looking-at ispell-otherchars))
+		    (and extra-otherchars (looking-at extra-otherchars)))
+		(not (bobp))
+		(or (not did-it-once)
+		    ispell-many-otherchars-p)
+		(not (eq prevpt (point))))
+      (if (and extra-otherchars (looking-at extra-otherchars))
+	  (progn
 	    (backward-char 1)
 	    (if (looking-at flyspell-casechars)
-		(re-search-backward flyspell-not-casechars (point-min) 'move)
-	      (backward-char -1)))))
+		(re-search-backward flyspell-not-casechars (point-min) 'move)))
+	(setq did-it-once t
+	      prevpt (point))
+	(backward-char 1)
+	(if (looking-at flyspell-casechars)
+	    (re-search-backward flyspell-not-casechars (point-min) 'move)
+	  (backward-char -1))))
     ;; Now mark the word and save to string.
-    (if (eq (re-search-forward word-regexp (point-max) t) nil)
+    (if (not (re-search-forward word-regexp (point-max) t))
 	nil
       (progn
 	(setq start (match-beginning 0)
@@ -1280,25 +1384,37 @@
     (set-buffer buffer)
     (goto-char (point-min))
     (let ((size (- flyspell-large-region-end flyspell-large-region-beg))
-	  (start flyspell-large-region-beg))
+	  (start flyspell-large-region-beg)
+	  (pword "")
+	  (pcount 1))
       ;; now we are done with ispell, we have to find the word in
       ;; the initial buffer
       (while (< (point) (- (point-max) 1))
 	;; we have to fetch the incorrect word
 	(if (re-search-forward "\\([^\n]+\\)\n" (point-max) t)
 	    (let ((word (match-string 1)))
+	      (if (string= word pword)
+		  (setq pcount (1+ pcount))
+		(progn
+		  (setq pword word)
+		  (setq pcount 1)))
 	      (goto-char (match-end 0))
-	      (set-buffer flyspell-large-region-buffer)
-	      (goto-char flyspell-large-region-beg)
 	      (if flyspell-issue-message-flag
 		  (message "Spell Checking...%d%% [%s]"
-			   (* 100 (/ (float (- (point) start)) size))
+			   (* 100 (/ (float (point)) (point-max)))
 			   word))
-	      (if (search-forward word flyspell-large-region-end t)
+	      (set-buffer flyspell-large-region-buffer)
+	      (goto-char flyspell-large-region-beg)
+	      (let ((keep t)
+		    (n 0))
+		(while (and (or (< n pcount) keep)
+			    (search-forward word flyspell-large-region-end t))
 		  (progn
-		    (setq flyspell-large-region-beg (point))
 		    (goto-char (- (point) 1))
-		    (flyspell-word)))
+		    (setq n (1+ n))
+		    (setq keep (flyspell-word))))
+		(if (= n pcount)
+		    (setq flyspell-large-region-beg (point))))
 	      (set-buffer buffer))
 	  (goto-char (point-max)))))
     ;; we are done
@@ -1370,7 +1486,7 @@
 	  (let ((old beg))
 	    (setq beg end)
 	    (setq end old)))
-      (if (> (- end beg) flyspell-large-region)
+      (if (and flyspell-large-region (> (- end beg) flyspell-large-region))
 	  (flyspell-large-region beg end)
 	(flyspell-small-region beg end)))))
 
@@ -1517,15 +1633,23 @@
       (if (or flyspell-highlight-properties
 	      (not (flyspell-properties-at-p beg)))
 	  (progn
+	    ;; we cleanup all the overlay that are in the region, not
+	    ;; beginning at the word start position
+	    (if (< (1+ beg) end)
+		(let ((os (overlays-in (1+ beg) end)))
+		  (while (consp os)
+		    (if (flyspell-overlay-p (car os))
+			(delete-overlay (car os)))
+		    (setq os (cdr os)))))
 	    ;; we cleanup current overlay at the same position
 	    (if (and (not flyspell-persistent-highlight)
 		     (overlayp flyspell-overlay))
 		(delete-overlay flyspell-overlay)
-	      (let ((overlays (overlays-at beg)))
-		(while (consp overlays)
-		  (if (flyspell-overlay-p (car overlays))
-		      (delete-overlay (car overlays)))
-		  (setq overlays (cdr overlays)))))
+	      (let ((os (overlays-at beg)))
+		(while (consp os)
+		  (if (flyspell-overlay-p (car os))
+		      (delete-overlay (car os)))
+		  (setq os (cdr os)))))
 	    ;; now we can use a new overlay
 	    (setq flyspell-overlay
 		  (make-flyspell-overlay
@@ -1677,69 +1801,71 @@
 	  (flyspell-ajust-cursor-point pos (point) old-max)
 	  (setq flyspell-auto-correct-pos (point)))
       ;; fetch the word to be checked
-      (let ((word (flyspell-get-word nil))
-	    start end poss)
-	;; destructure return word info list.
-	(setq start (car (cdr word))
-	      end (car (cdr (cdr word)))
-	      word (car word))
-	(setq flyspell-auto-correct-word word)
-	;; now check spelling of word.
-	(process-send-string ispell-process "%\n") ;put in verbose mode
-	(process-send-string ispell-process (concat "^" word "\n"))
-	;; wait until ispell has processed word
-	(while (progn
-		 (accept-process-output ispell-process)
-		 (not (string= "" (car ispell-filter)))))
-	(setq ispell-filter (cdr ispell-filter))
-	(if (consp ispell-filter)
-	    (setq poss (ispell-parse-output (car ispell-filter))))
-	(cond ((or (eq poss t) (stringp poss))
-	       ;; don't correct word
-	       t)
-	      ((null poss)
-	       ;; ispell error
-	       (error "Ispell: error in Ispell process"))
-	      (t
-	       ;; the word is incorrect, we have to propose a replacement
-	       (let ((replacements (if flyspell-sort-corrections
-				       (sort (car (cdr (cdr poss))) 'string<)
-				     (car (cdr (cdr poss))))))
-		 (setq flyspell-auto-correct-region nil)
-		 (if (consp replacements)
-		     (progn
-		       (let ((replace (car replacements)))
-			 (let ((new-word replace))
-			   (if (not (equal new-word (car poss)))
-			       (progn
-				 ;; the save the current replacements
-				 (setq flyspell-auto-correct-region
-				       (cons start (length new-word)))
-				 (let ((l replacements))
-				   (while (consp (cdr l))
-				     (setq l (cdr l)))
-				   (rplacd l (cons (car poss) replacements)))
-				 (setq flyspell-auto-correct-ring
-				       replacements)
-				 (flyspell-unhighlight-at start)
-				 (delete-region start end)
-				 (funcall flyspell-insert-function new-word)
-				 (if flyspell-abbrev-p
-				     (if (flyspell-already-abbrevp
-					  (flyspell-abbrev-table) word)
-					 (flyspell-change-abbrev
-					  (flyspell-abbrev-table)
-					  word
-					  new-word)
-				       (flyspell-define-abbrev word new-word)))
-				 (flyspell-word)
-				 (flyspell-display-next-corrections
-				  (cons new-word flyspell-auto-correct-ring))
-				 (flyspell-ajust-cursor-point pos
-							      (point)
-							      old-max))))))))))
-	(setq flyspell-auto-correct-pos (point))
-	(ispell-pdict-save t)))))
+      (let ((word (flyspell-get-word nil)))
+	(if (consp word)
+	    (let ((start (car (cdr word)))
+		  (end (car (cdr (cdr word))))
+		  (word (car word))
+		  poss)
+	      (setq flyspell-auto-correct-word word)
+	      ;; now check spelling of word.
+	      (process-send-string ispell-process "%\n") ;put in verbose mode
+	      (process-send-string ispell-process (concat "^" word "\n"))
+	      ;; wait until ispell has processed word
+	      (while (progn
+		       (accept-process-output ispell-process)
+		       (not (string= "" (car ispell-filter)))))
+	      (setq ispell-filter (cdr ispell-filter))
+	      (if (consp ispell-filter)
+		  (setq poss (ispell-parse-output (car ispell-filter))))
+	      (cond
+	       ((or (eq poss t) (stringp poss))
+		;; don't correct word
+		t)
+	       ((null poss)
+		;; ispell error
+		(error "Ispell: error in Ispell process"))
+	       (t
+		;; the word is incorrect, we have to propose a replacement
+		(let ((replacements (if flyspell-sort-corrections
+					(sort (car (cdr (cdr poss))) 'string<)
+				      (car (cdr (cdr poss))))))
+		  (setq flyspell-auto-correct-region nil)
+		  (if (consp replacements)
+		      (progn
+			(let ((replace (car replacements)))
+			  (let ((new-word replace))
+			    (if (not (equal new-word (car poss)))
+				(progn
+				  ;; the save the current replacements
+				  (setq flyspell-auto-correct-region
+					(cons start (length new-word)))
+				  (let ((l replacements))
+				    (while (consp (cdr l))
+				      (setq l (cdr l)))
+				    (rplacd l (cons (car poss) replacements)))
+				  (setq flyspell-auto-correct-ring
+					replacements)
+				  (flyspell-unhighlight-at start)
+				  (delete-region start end)
+				  (funcall flyspell-insert-function new-word)
+				  (if flyspell-abbrev-p
+				      (if (flyspell-already-abbrevp
+					   (flyspell-abbrev-table) word)
+					  (flyspell-change-abbrev
+					   (flyspell-abbrev-table)
+					   word
+					   new-word)
+					(flyspell-define-abbrev word
+								new-word)))
+				  (flyspell-word)
+				  (flyspell-display-next-corrections
+				   (cons new-word flyspell-auto-correct-ring))
+				  (flyspell-ajust-cursor-point pos
+							       (point)
+							       old-max))))))))))
+	      (setq flyspell-auto-correct-pos (point))
+	      (ispell-pdict-save t)))))))
 
 ;*---------------------------------------------------------------------*/
 ;*    flyspell-auto-correct-previous-pos ...                           */
@@ -1752,8 +1878,8 @@
 ;*---------------------------------------------------------------------*/
 (defun flyspell-auto-correct-previous-hook ()
   "Hook to track successive calls to `flyspell-auto-correct-previous-word'.
-Sets flyspell-auto-correct-previous-pos to nil"
-  (interactive)
+Sets `flyspell-auto-correct-previous-pos' to nil"
+  (interactive) 
   (remove-hook 'pre-command-hook (function flyspell-auto-correct-previous-hook) t)
   (unless (eq this-command (function flyspell-auto-correct-previous-word))
     (setq flyspell-auto-correct-previous-pos nil)))
@@ -1761,45 +1887,56 @@
 ;*---------------------------------------------------------------------*/
 ;*    flyspell-auto-correct-previous-word ...                          */
 ;*---------------------------------------------------------------------*/
-(defun flyspell-auto-correct-previous-word (position)
-  "*Auto correct the first mispelled word that occurs before point."
+(defun flyspell-auto-correct-previous-word (position) 
+  "*Auto correct the first mispelled word that occurs before point.
+But don't look beyond what's visible on the screen."
   (interactive "d")
 
-  (add-hook 'pre-command-hook
-	    (function flyspell-auto-correct-previous-hook) t t)
+  (let (top bot)
+    (save-excursion
+      (move-to-window-line 0)
+      (setq top (point))
+      (move-to-window-line -1)
+      (setq bot (point)))
+    (save-excursion
+      (save-restriction
+	(narrow-to-region top bot)
+	(overlay-recenter (point))
 
-  (save-excursion
-    (unless flyspell-auto-correct-previous-pos
-      ;; only reset if a new overlay exists
-      (setq flyspell-auto-correct-previous-pos nil)
-
-      (let ((overlay-list (overlays-in (point-min) position))
-	    (new-overlay 'dummy-value))
+	(add-hook 'pre-command-hook 
+		  (function flyspell-auto-correct-previous-hook) t t)
 
-	;; search for previous (new) flyspell overlay
-	(while (and new-overlay
-		    (or (not (flyspell-overlay-p new-overlay))
-			;; check if its face has changed
-			(not (eq (get-char-property
-				  (overlay-start new-overlay) 'face)
-				 'flyspell-incorrect-face))))
-	  (setq new-overlay (car-safe overlay-list))
-	  (setq overlay-list (cdr-safe overlay-list)))
+	(unless flyspell-auto-correct-previous-pos
+	  ;; only reset if a new overlay exists
+	  (setq flyspell-auto-correct-previous-pos nil)
+      
+	  (let ((overlay-list (overlays-in (point-min) position))
+		(new-overlay 'dummy-value))
+	
+	    ;; search for previous (new) flyspell overlay
+	    (while (and new-overlay
+			(or (not (flyspell-overlay-p new-overlay))
+			    ;; check if its face has changed
+			    (not (eq (get-char-property 
+				      (overlay-start new-overlay) 'face) 
+				     'flyspell-incorrect-face))))
+	      (setq new-overlay (car-safe overlay-list))
+	      (setq overlay-list (cdr-safe overlay-list)))
+	
+	    ;; if nothing new exits new-overlay should be nil
+	    (if new-overlay ;; the length of the word may change so go to the start
+		(setq flyspell-auto-correct-previous-pos 
+		      (overlay-start new-overlay)))))
 
-	;; if nothing new exits new-overlay should be nil
-	(if new-overlay;; the length of the word may change so go to the start
-	    (setq flyspell-auto-correct-previous-pos
-		  (overlay-start new-overlay)))))
-
-    (when flyspell-auto-correct-previous-pos
-      (save-excursion
-	(goto-char flyspell-auto-correct-previous-pos)
-	(let ((ispell-following-word t));; point is at start
-	  (if (numberp flyspell-auto-correct-previous-pos)
-	      (goto-char flyspell-auto-correct-previous-pos))
-	  (flyspell-auto-correct-word))
-	;; the point may have moved so reset this
-	(setq flyspell-auto-correct-previous-pos (point))))))
+	(when flyspell-auto-correct-previous-pos
+	  (save-excursion
+	    (goto-char flyspell-auto-correct-previous-pos)
+	    (let ((ispell-following-word t)) ;; point is at start
+	      (if (numberp flyspell-auto-correct-previous-pos)
+		  (goto-char flyspell-auto-correct-previous-pos))
+	      (flyspell-auto-correct-word))
+	    ;; the point may have moved so reset this
+	    (setq flyspell-auto-correct-previous-pos (point))))))))
 
 ;*---------------------------------------------------------------------*/
 ;*    flyspell-correct-word ...                                        */
@@ -1814,72 +1951,76 @@
   (let ((save (point)))
     (mouse-set-point event)
     (let ((cursor-location (point))
-	  (word (flyspell-get-word nil))
-	  start end poss replace)
-      ;; destructure return word info list.
-      (setq start (car (cdr word))
-	    end (car (cdr (cdr word)))
-	    word (car word))
-      ;; now check spelling of word.
-      (process-send-string ispell-process "%\n") ;put in verbose mode
-      (process-send-string ispell-process (concat "^" word "\n"))
-      ;; wait until ispell has processed word
-      (while (progn
-	       (accept-process-output ispell-process)
-	       (not (string= "" (car ispell-filter)))))
-      (setq ispell-filter (cdr ispell-filter))
-      (if (consp ispell-filter)
-	  (setq poss (ispell-parse-output (car ispell-filter))))
-      (cond ((or (eq poss t) (stringp poss))
-	     ;; don't correct word
-	     t)
-	    ((null poss)
-	     ;; ispell error
-	     (error "Ispell: error in Ispell process"))
-	    ((string-match "GNU" (emacs-version))
-	     ;; the word is incorrect, we have to propose a replacement
-	     (setq replace (flyspell-emacs-popup event poss word))
-	     (cond ((eq replace 'ignore)
-		    (goto-char save)
-		    nil)
-		   ((eq replace 'save)
-		    (goto-char save)
-		    (process-send-string ispell-process (concat "*" word "\n"))
-		    (flyspell-unhighlight-at cursor-location)
-		    (setq ispell-pdict-modified-p '(t)))
-		   ((or (eq replace 'buffer) (eq replace 'session))
-		    (process-send-string ispell-process (concat "@" word "\n"))
-		    (if (null ispell-pdict-modified-p)
-			(setq ispell-pdict-modified-p
-			      (list ispell-pdict-modified-p)))
-		    (flyspell-unhighlight-at cursor-location)
-		    (goto-char save)
-		    (if (eq replace 'buffer)
-			(ispell-add-per-file-word-list word)))
-		   (replace
-		    (flyspell-unhighlight-at cursor-location)
-		    (let ((new-word (if (atom replace)
-					replace
-				      (car replace)))
-			  (cursor-location (+ (- (length word) (- end start))
-					      cursor-location)))
-		      (if (not (equal new-word (car poss)))
-			  (let ((old-max (point-max)))
-			    (delete-region start end)
-			    (funcall flyspell-insert-function new-word)
-			    (if flyspell-abbrev-p
-				(flyspell-define-abbrev word new-word))
-			    (flyspell-ajust-cursor-point save
-							 cursor-location
-							 old-max)))))
-		   (t
-		    (goto-char save)
-		    nil)))
-	    ((eq flyspell-emacs 'xemacs)
-	     (flyspell-xemacs-popup
-	      event poss word cursor-location start end save)
-	     (goto-char save)))
-      (ispell-pdict-save t))))
+	  (word (flyspell-get-word nil)))
+      (if (consp word)
+	  (let ((start (car (cdr word)))
+		(end (car (cdr (cdr word))))
+		(word (car word))
+		poss replace)
+	    ;; now check spelling of word.
+	    (process-send-string ispell-process "%\n") ;put in verbose mode
+	    (process-send-string ispell-process (concat "^" word "\n"))
+	    ;; wait until ispell has processed word
+	    (while (progn
+		     (accept-process-output ispell-process)
+		     (not (string= "" (car ispell-filter)))))
+	    (setq ispell-filter (cdr ispell-filter))
+	    (if (consp ispell-filter)
+		(setq poss (ispell-parse-output (car ispell-filter))))
+	    (cond
+	     ((or (eq poss t) (stringp poss))
+	      ;; don't correct word
+	      t)
+	     ((null poss)
+	      ;; ispell error
+	      (error "Ispell: error in Ispell process"))
+	     ((string-match "GNU" (emacs-version))
+	      ;; the word is incorrect, we have to propose a replacement
+	      (setq replace (flyspell-emacs-popup event poss word))
+	      (cond ((eq replace 'ignore)
+		     (goto-char save)
+		     nil)
+		    ((eq replace 'save)
+		     (goto-char save)
+		     (process-send-string ispell-process
+					  (concat "*" word "\n"))
+		     (flyspell-unhighlight-at cursor-location)
+		     (setq ispell-pdict-modified-p '(t)))
+		    ((or (eq replace 'buffer) (eq replace 'session))
+		     (process-send-string ispell-process
+					  (concat "@" word "\n"))
+		     (if (null ispell-pdict-modified-p)
+			 (setq ispell-pdict-modified-p
+			       (list ispell-pdict-modified-p)))
+		     (flyspell-unhighlight-at cursor-location)
+		     (goto-char save)
+		     (if (eq replace 'buffer)
+			 (ispell-add-per-file-word-list word)))
+		    (replace
+		     (flyspell-unhighlight-at cursor-location)
+		     (let ((new-word (if (atom replace)
+					 replace
+				       (car replace)))
+			   (cursor-location
+			    (+ (- (length word) (- end start))
+			       cursor-location)))
+		       (if (not (equal new-word (car poss)))
+			   (let ((old-max (point-max)))
+			     (delete-region start end)
+			     (funcall flyspell-insert-function new-word)
+			     (if flyspell-abbrev-p
+				 (flyspell-define-abbrev word new-word))
+			     (flyspell-ajust-cursor-point save
+							  cursor-location
+							  old-max)))))
+		    (t
+		     (goto-char save)
+		     nil)))
+	     ((eq flyspell-emacs 'xemacs)
+	      (flyspell-xemacs-popup
+	       event poss word cursor-location start end save)
+	      (goto-char save)))
+	    (ispell-pdict-save t))))))
 
 ;*---------------------------------------------------------------------*/
 ;*    flyspell-xemacs-correct ...                                      */
--- a/lisp/textmodes/tex-mode.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/textmodes/tex-mode.el	Fri Jun 03 05:49:26 2005 +0000
@@ -2232,8 +2232,7 @@
         (tex-start-shell))
       (tex-send-command
        (if alt tex-alt-dvi-print-command tex-dvi-print-command)
-       (shell-quote-argument
-	print-file-name-dvi)
+       print-file-name-dvi
        t))))
 
 (defun tex-alt-print ()
--- a/lisp/thumbs.el	Sat May 28 21:04:38 2005 +0000
+++ b/lisp/thumbs.el	Fri Jun 03 05:49:26 2005 +0000
@@ -302,18 +302,21 @@
 
 (defun thumbs-thumbname (img)
   "Return a thumbnail name for the image IMG."
-  (concat thumbs-thumbsdir "/"
-	  (subst-char-in-string
-	   ?\  ?\_
-	   (apply
-	    'concat
-	    (split-string
-	     (expand-file-name img) "/")))))
+  (convert-standard-filename
+   (let ((filename (expand-file-name img)))
+     (format "%s/%08x-%s.jpg"
+             thumbs-thumbsdir
+             (sxhash filename)
+             (subst-char-in-string
+              ?\s ?\_
+              (apply
+               'concat
+               (split-string filename "/")))))))
 
 (defun thumbs-make-thumb (img)
   "Create the thumbnail for IMG."
-  (let* ((fn (expand-file-name img))
-	 (tn (thumbs-thumbname img)))
+  (let ((fn (expand-file-name img))
+        (tn (thumbs-thumbname img)))
     (if (or (not (file-exists-p tn))
 	    ;;  This is not the right fix, but I don't understand
 	    ;;  the external program or why it produces a geometry
@@ -378,8 +381,9 @@
     (unless (bobp) (newline))))
 
 (defun thumbs-show-thumbs-list (L &optional buffer-name same-window)
-  (when (not (display-images-p))
-    (error "Images are not supported in this Emacs session"))
+  (unless (and (display-images-p)
+               (image-type-available-p 'jpeg))
+    (error "Required image type is not supported in this Emacs session"))
   (funcall (if same-window 'switch-to-buffer 'pop-to-buffer)
 	   (or buffer-name "*THUMB-View*"))
   (let ((inhibit-read-only t))
@@ -754,9 +758,8 @@
 (define-derived-mode thumbs-mode
   fundamental-mode "thumbs"
   "Preview images in a thumbnails buffer"
-  (make-variable-buffer-local 'thumbs-markedL)
   (setq buffer-read-only t)
-  (setq thumbs-markedL nil))
+  (set (make-local-variable 'thumbs-markedL) nil))
 
 (defvar thumbs-view-image-mode-map
   (let ((map (make-sparse-keymap)))
@@ -793,7 +796,5 @@
 
 (provide 'thumbs)
 
+;; arch-tag: f9ac1ef8-83fc-42c0-8069-1fae43fd2e5c
 ;;; thumbs.el ends here
-
-
-;;; arch-tag: f9ac1ef8-83fc-42c0-8069-1fae43fd2e5c
--- a/lispref/ChangeLog	Sat May 28 21:04:38 2005 +0000
+++ b/lispref/ChangeLog	Fri Jun 03 05:49:26 2005 +0000
@@ -1,3 +1,23 @@
+2005-05-29  Luc Teirlinck  <teirllm@auburn.edu>
+
+	* modes.texi (Major Mode Conventions): A derived mode only needs
+	to put the call to the parent mode inside `delay-mode-hooks'.
+
+2005-05-29  Richard M. Stallman  <rms@gnu.org>
+
+	* modes.texi (Mode Hooks): Explain that after-change-major-mode-hook is
+	new, and what that implies.  Clarify.
+
+	* files.texi (Locating Files): Clean up the text.
+
+	* frames.texi (Window Frame Parameters): Document user-size.
+	Shorten entry for top by referring to left.
+
+2005-05-26  Richard M. Stallman  <rms@gnu.org>
+
+	* modes.texi (Mode Hooks): Explain that after-change-major-mode-hook
+	is new, and what the implications are.  Other clarifications.
+
 2005-05-24  Richard M. Stallman  <rms@gnu.org>
 
 	* frames.texi (Dialog Boxes): Minor fixes.
--- a/lispref/files.texi	Sat May 28 21:04:38 2005 +0000
+++ b/lispref/files.texi	Fri Jun 03 05:49:26 2005 +0000
@@ -1261,36 +1261,36 @@
 @cindex locate files
 @cindex find files
 
-  Sometimes, you need to find a file that could reside in one of the
-standard directories.  One example is when you need to look for a
-program's executable file, e.g., to find out whether a given program
-is installed on the user's system.  Another example is the search for
+  This section explains how to search for a file in a list of
+directories.  One example is when you need to look for a program's
+executable file, e.g., to find out whether a given program is
+installed on the user's system.  Another example is the search for
 Lisp libraries (@pxref{Library Search}).  Such searches generally need
-to try several alternative file name extensions, in addition to
-looking in every standard directory where the file could be found.
-Emacs provides a function for such a generalized search for a file.
+to try various possible file name extensions, in addition to various
+possible directories.  Emacs provides a function for such a
+generalized search for a file.
 
 @defun locate-file filename path &optional suffixes predicate
-This function searches for the file whose name is @var{filename} in
-a list of directories given by @var{path}.  If it finds the file, it
-returns its full @dfn{absolute file name} (@pxref{Relative File
-Names}); if the file is not found, the function returns @code{nil}.
+This function searches for a file whose name is @var{filename} in a
+list of directories given by @var{path}, trying the suffixes in
+@var{suffixes}.  If it finds such a file, it returns the full
+@dfn{absolute file name} of the file (@pxref{Relative File Names});
+otherwise it returns @code{nil}.
 
 The optional argument @var{suffixes} gives the list of file-name
-suffixes to append to @var{filename} when searching.  If
-@var{suffixes} is @code{nil}, it's equivalent to passing a list with a
-single element that is an empty string @code{""}.
-
-Typical values of @var{path} are @code{exec-path} (@pxref{Subprocess
+suffixes to append to @var{filename} when searching.
+@code{locate-file} tries each possible directory with each of these
+suffixes.  If @var{suffixes} is @code{nil}, or @code{("")}, then there
+are no suffixes, and @var{filename} is used only as-is.  Typical
+values of @var{suffixes} are @code{exec-suffixes} (@pxref{Subprocess
+Creation, exec-suffixes}) and @code{load-suffixes} (@pxref{Library
+Search, load-suffixes}).
+
+Typical values for @var{path} are @code{exec-path} (@pxref{Subprocess
 Creation, exec-path}) when looking for executable programs or
 @code{load-path} (@pxref{Library Search, load-path}) when looking for
-Lisp files.  Use @code{("/")} to disable the path search (e.g., if
-@var{filename} already includes the leading directories), but still
-try the extensions in @var{suffixes}.
-
-Typical values of @var{suffixes} are @code{exec-suffixes}
-(@pxref{Subprocess Creation, exec-suffixes}) and @code{load-suffixes}
-(@pxref{Library Search, load-suffixes}).
+Lisp files.  If @var{filename} is absolute, @var{path} has no effect,
+but the suffixes in @var{suffixes} are still tried.
 
 The optional argument @var{predicate}, if non-@code{nil}, specifies
 the predicate function to use for testing whether a candidate file is
@@ -1316,7 +1316,6 @@
 @code{exec-suffixes}.
 @end defun
 
-
 @node Changing Files
 @section Changing File Names and Attributes
 @cindex renaming files
--- a/lispref/frames.texi	Sat May 28 21:04:38 2005 +0000
+++ b/lispref/frames.texi	Fri Jun 03 05:49:26 2005 +0000
@@ -362,20 +362,8 @@
 
 @item top
 The screen position of the top edge, in pixels, with respect to the
-top edge of the screen.  The value may be a positive number @var{pos},
-or a list of the form @code{(+ @var{pos})} which permits specifying a
-negative @var{pos} value.
-
-A negative number @minus{}@var{pos}, or a list of the form @code{(-
-@var{pos})}, actually specifies the position of the bottom edge of the
-window with respect to the bottom edge of the screen.  A positive value
-of @var{pos} counts toward the top.  @strong{Reminder:} if the
-parameter is a negative integer @minus{}@var{pos}, then @var{pos} is
-positive.
-
-Some window managers ignore program-specified positions.  If you want to
-be sure the position you specify is not ignored, specify a
-non-@code{nil} value for the @code{user-position} parameter as well.
+top edge of the screen.  It works just like @code{left}, except vertically
+instead of horizontally.
 
 @item icon-left
 The screen position of the left edge @emph{of the frame's icon}, in
@@ -418,6 +406,11 @@
 The width of the frame contents, in characters.  (To get the height in
 pixels, call @code{frame-pixel-width}; see @ref{Size and Position}.)
 
+@item user-size
+This does for the size parameters @code{height} and @code{width} what
+the @code{user-position} parameter (see above) does for the position
+parameters @code{top} and @code{left}.
+
 @item fullscreen
 Specify that width, height or both shall be set to the size of the screen.
 The value @code{fullwidth} specifies that width shall be the size of the
--- a/lispref/modes.texi	Sat May 28 21:04:38 2005 +0000
+++ b/lispref/modes.texi	Fri Jun 03 05:49:26 2005 +0000
@@ -437,10 +437,8 @@
 command (called the @dfn{parent mode}) and then alter some of its
 settings.  A mode that does this is called a @dfn{derived mode}.  The
 recommended way to define one is to use @code{define-derived-mode},
-but this is not required.  Such a mode should use
-@code{delay-mode-hooks} around its entire body (including the call to
-the parent mode command) @emph{except} for the final call to
-@code{run-mode-hooks}, which runs the derived mode's hook.  (Using
+but this is not required.  Such a mode should call the parent mode
+command inside a @code{delay-mode-hooks} form.  (Using
 @code{define-derived-mode} does this automatically.)  @xref{Derived
 Modes}, and @ref{Mode Hooks}.
 
@@ -1117,7 +1115,7 @@
 @node Mode Hooks
 @subsection Mode Hooks
 
-The two last things a major mode function does is to run its mode
+  The two last things a major mode function should do is run its mode
 hook and finally the mode independent normal hook
 @code{after-change-major-mode-hook}.  If the major mode is a derived
 mode, that is if it calls another major mode (the parent mode) in its
@@ -1125,45 +1123,53 @@
 mode's hook.  Neither the parent's mode hook nor
 @code{after-change-major-mode-hook} are run at the end of the actual
 call to the parent mode.  This applies recursively if the parent mode
-has itself a parent.  That is, the mode hooks of all major modes called
-directly or indirectly by the major mode function are all run in
-sequence at the end, just before @code{after-change-major-mode-hook}.
-
-If you are customizing a major mode, rather than defining one, the
-above is all you need to know about the hooks run at the end of a
-major mode.  This also applies if you use @code{define-derived-mode}
-to define a major mode, because that macro will automatically
-implement the above for you.
-
-Programmers wishing to define a major mode without using
-@code{define-derived-mode}, should make sure that their major mode
-follows the above conventions.  @xref{Major Mode Conventions}, for how
-this should be accomplished.  Below, we give some implementation
-details.
+has itself a parent.  That is, the mode hooks of all major modes
+called directly or indirectly by the major mode function are all run
+in sequence at the end, just before
+@code{after-change-major-mode-hook}.
+
+  These conventions are new in Emacs 22, and some major modes
+implemented by users do not follow them yet.  So if you put a function
+onto @code{after-change-major-mode-hook}, keep in mind that some modes
+will fail to run it.  If a user complains about that, you can respond,
+``That major mode fails to follow Emacs conventions, and that's why it
+fails to work.  Please fix the major mode.''  In most cases, that is
+good enough, so go ahead and use @code{after-change-major-mode-hook}.
+However, if a certain feature needs to be completely reliable,
+it should not use @code{after-change-major-mode-hook} as of yet.
+
+  When you defined a major mode using @code{define-derived-mode}, it
+automatically makes sure these conventions are followed.  If you
+define a major mode ``from scratch'', not using
+@code{define-derived-mode}, make sure the major mode command follows
+these and other conventions.  @xref{Major Mode Conventions}.  You use
+these functions to do it properly.
 
 @defun run-mode-hooks &rest hookvars
 Major modes should run their mode hook using this function.  It is
-similar to @code{run-hooks} (@pxref{Hooks}), but if run inside a
+similar to @code{run-hooks} (@pxref{Hooks}), but it also runs
+@code{after-change-major-mode-hook}.
+
+When the call to this function is dynamically inside a
 @code{delay-mode-hooks} form, this function does not run any hooks.
-Instead, it arranges for @var{hookvars} to be run at a later call to
-the function.  Otherwise, @code{run-mode-hooks} runs any delayed hooks
-in order, then @var{hookvars} and finally
-@code{after-change-major-mode-hook}.
+Instead, it arranges for the next call to @code{run-mode-hooks} to run
+@var{hookvars}.
 @end defun
 
 @defmac delay-mode-hooks body...
 This macro executes @var{body} like @code{progn}, but all calls to
 @code{run-mode-hooks} inside @var{body} delay running their hooks.
 They will be run by the first call to @code{run-mode-hooks} after exit
-from @code{delay-mode-hooks}.
+from @code{delay-mode-hooks}.  This is the proper way for a major mode
+command to invoke its parent mode.
 @end defmac
 
 @defvar after-change-major-mode-hook
 Every major mode function should run this normal hook at its very end.
 It normally does not need to do so explicitly.  Indeed, a major mode
 function should normally run its mode hook with @code{run-mode-hooks}
-as the very last thing it does and @code{run-mode-hooks} runs
-@code{after-change-major-mode-hook} at its very end.
+as the very last thing it does, and the last thing
+@code{run-mode-hooks} does is run @code{after-change-major-mode-hook}.
 @end defvar
 
 @node Minor Modes
--- a/man/ChangeLog	Sat May 28 21:04:38 2005 +0000
+++ b/man/ChangeLog	Fri Jun 03 05:49:26 2005 +0000
@@ -1,3 +1,37 @@
+2005-05-31  Jay Belanger  <belanger@truman.edu>
+
+	* calc.texi (Notations Used in This Manual): Use @kbd for key
+	sequence.
+	(Demonstration of Calc): Mention another way of starting Calc.
+	(Starting Calc): Mention long name of M-#.
+	(Embedded Mode Overview): Remove unnecessary instruction.
+	(Other M-# commands): Rephrase `M-# 0' explanation.
+	(Basic Embedded Mode): Rewrite discussion of prefix arguments to
+	reflect current behavior.
+
+2005-05-30  Jay Belanger  <belanger@truman.edu>
+
+	* calc.texi (Hooks): Change description of calc-window-hook and
+	calc-trail-window-hook to match usage.
+	(Computational Functions): Add more constant-generating functions.
+	(Customizable Variables): Use defvar.
+
+2005-05-30  Noah Friedman  <friedman@splode.com>
+
+	* trouble.texi (After a Crash): Mention emacs-buffer.gdb as a
+	recovery mechanism.
+
+2005-05-28  Jay Belanger  <belanger@truman.edu>
+
+	* calc.texi (Assignments in Embedded Mode): Fix variable name.
+	(Basic Embedded Mode): Explain behavior of arguments to
+	calc-embedded-mode.
+
+2005-05-28  Nick Roberts  <nickrob@snap.net.nz>
+
+	* building.texi (Other Buffers): SPC toggles display of
+	floating point registers.
+
 2005-05-27  Jay Belanger  <belanger@truman.edu>
 
 	* calc.texi (Queries in Keyboard Macros): Rewrite to reflect
--- a/man/building.texi	Sat May 28 21:04:38 2005 +0000
+++ b/man/building.texi	Fri Jun 03 05:49:26 2005 +0000
@@ -932,7 +932,8 @@
 
 @item Registers Buffer
 The registers buffer displays the values held by the registers
-(@pxref{Registers,,, gdb, The GNU debugger}).
+(@pxref{Registers,,, gdb, The GNU debugger}).  Press @key{SPC} to
+toggle the display of floating point registers.
 
 @item Assembler Buffer
 The assembler buffer displays the current frame as machine code.  An
@@ -944,7 +945,7 @@
 
 The threads buffer displays a summary of all threads currently in your
 program (@pxref{Threads,,, gdb, The GNU debugger}).  Move point to
-any thread in the list and type @key{RET} to make it become the
+any thread in the list and press @key{RET} to make it become the
 current thread (@code{gdb-threads-select}) and display the associated
 source in the source buffer.  Alternatively, click @kbd{Mouse-2} to
 make the selected thread become the current one.
--- a/man/calc.texi	Sat May 28 21:04:38 2005 +0000
+++ b/man/calc.texi	Fri Jun 03 05:49:26 2005 +0000
@@ -583,6 +583,7 @@
 * What is Calc::
 * About This Manual::
 * Notations Used in This Manual::
+* Demonstration of Calc::
 * Using Calc::
 * Demonstration of Calc::
 * History and Acknowledgements::
@@ -764,7 +765,7 @@
 (If you don't have the @key{LFD} or @key{TAB} keys on your keyboard,
 the @kbd{C-j} and @kbd{C-i} keys are equivalent to them, respectively.
 If you don't have a Meta key, look for Alt or Extend Char.  You can
-also press @key{ESC} or @key{C-[} first to get the same effect, so
+also press @key{ESC} or @kbd{C-[} first to get the same effect, so
 that @kbd{M-x}, @kbd{@key{ESC} x}, and @kbd{C-[ x} are all equivalent.)
 
 Sometimes the @key{RET} key is not shown when it is ``obvious''
@@ -797,7 +798,8 @@
 
 To begin, start Emacs if necessary (usually the command @code{emacs}
 does this), and type @kbd{M-# c} (or @kbd{@key{ESC} # c}) to start the
-Calculator.  (@xref{Starting Calc}, if this doesn't work for you.)
+Calculator.  (You can also use @kbd{M-x calc} if this doesn't work.
+@xref{Starting Calc}, for various ways of starting the Calculator.)
 
 Be sure to type all the sample input exactly, especially noting the
 difference between lower-case and upper-case letters.  Remember,
@@ -987,11 +989,15 @@
 Control or @key{CTRL} while typing a left square bracket
 (that's @kbd{C-[} in Emacs notation).
 
-@kbd{M-#} is a @dfn{prefix key}; when you press it, Emacs waits for
-you to press a second key to complete the command.  In this case,
-you will follow @kbd{M-#} with a letter (upper- or lower-case, it
-doesn't matter for @kbd{M-#}) that says which Calc interface you
-want to use.
+The key @kbd{M-#} is bound to the command @code{calc-dispatch}, 
+which can be rebound if convenient.  
+(@xref{Key Bindings,,Customizing Key Bindings,emacs,
+The GNU Emacs Manual}.)
+
+When you press @kbd{M-#}, Emacs waits for you to press a second key to
+complete the command.  In this case, you will follow @kbd{M-#} with a
+letter (upper- or lower-case, it doesn't matter for @kbd{M-#}) that says
+which Calc interface you want to use.
 
 To get Calc's standard interface, type @kbd{M-# c}.  To get
 Keypad mode, type @kbd{M-# k}.  Type @kbd{M-# ?} to get a brief
@@ -1335,9 +1341,7 @@
 @end smallexample
 
 To leave Embedded mode, type @kbd{M-# e} again.  The mode line
-and keyboard will revert to the way they were before.  (If you have
-actually been trying this as you read along, you'll want to press
-@kbd{M-# 0} [with the digit zero] now to reset the modes you changed.)
+and keyboard will revert to the way they were before.
 
 The related command @kbd{M-# w} operates on a single word, which
 generally means a single number, inside text.  It uses any
@@ -1520,8 +1524,7 @@
 
 @item 0
 (This is the ``zero'' digit key.)  Reset the Calculator to
-its default state:  Empty stack, and default mode settings.
-With any prefix argument, reset everything but the stack.
+its initial state:  Empty stack, and initial mode settings.
 @end table
 
 @node History and Acknowledgements, , Using Calc, Getting Started
@@ -1589,7 +1592,7 @@
 features, large and small.  A few deserve special mention:  Tim Peters,
 who helped develop the ideas that led to the selection commands, rewrite
 rules, and many other algebra features; 
-@texline Fran\c cois
+@texline Fran\c{c}ois
 @infoline Francois
 Pinard, who contributed an early prototype of the Calc Summary appendix
 as well as providing valuable suggestions in many other areas of Calc;
@@ -30113,20 +30116,21 @@
 on their own separate lines or in-line with the formula.
 
 If you give a positive or negative numeric prefix argument, Calc
-instead uses the current point as one end of the formula, and moves
-forward or backward (respectively) by that many lines to find the
-other end.  Explicit delimiters are not necessary in this case.
-
-With a prefix argument of zero, Calc uses the current region
-(delimited by point and mark) instead of formula delimiters.
+instead uses the current point as one end of the formula, and includes
+that many lines forward or backward (respectively, including the current
+line). Explicit delimiters are not necessary in this case.
+
+With a prefix argument of zero, Calc uses the current region (delimited
+by point and mark) instead of formula delimiters.  With a prefix
+argument of @kbd{C-u} only, Calc uses the current line as the formula.
 
 @kindex M-# w
 @pindex calc-embedded-word
-With a prefix argument of @kbd{C-u} only, Calc scans for the first
-non-numeric character (i.e., the first character that is not a
-digit, sign, decimal point, or upper- or lower-case @samp{e})
-forward and backward to delimit the formula.  @kbd{M-# w}
-(@code{calc-embedded-word}) is equivalent to @kbd{C-u M-# e}.
+The @kbd{M-# w} (@code{calc-embedded-word}) command will start Embedded
+mode on the current ``word''; in this case Calc will scan for the first
+non-numeric character (i.e., the first character that is not a digit,
+sign, decimal point, or upper- or lower-case @samp{e}) forward and
+backward to delimit the formula.
 
 When you enable Embedded mode for a formula, Calc reads the text
 between the delimiters and tries to interpret it as a Calc formula.
@@ -30495,7 +30499,7 @@
 
 @kindex M-# u
 @kindex M-# =
-@pindex calc-embedded-update
+@pindex calc-embedded-update-formula
 Another way to change the assignment to @code{foo} would simply be
 to edit the number using regular Emacs editing rather than Embedded
 mode.  Then, we have to find a way to get Embedded mode to notice
@@ -33640,22 +33644,25 @@
 the absolute values of the components.
 @end defun
 
-@findex two-pi
+@findex e
+@findex gamma-const
+@findex ln-2
+@findex ln-10
+@findex phi
 @findex pi-over-2
 @findex pi-over-4
 @findex pi-over-180
 @findex sqrt-two-pi
 @findex sqrt-e
-@findex e
-@findex ln-2
-@findex ln-10
+@findex two-pi
 @defun pi
 The function @samp{(pi)} computes @samp{pi} to the current precision.
 Other related constant-generating functions are @code{two-pi},
 @code{pi-over-2}, @code{pi-over-4}, @code{pi-over-180}, @code{sqrt-two-pi},
-@code{e}, @code{sqrt-e}, @code{ln-2}, and @code{ln-10}.  Each function
-returns a floating-point value in the current precision, and each uses
-caching so that all calls after the first are essentially free.
+@code{e}, @code{sqrt-e}, @code{ln-2}, @code{ln-10}, @code{phi} and
+@code{gamma-const}.  Each function returns a floating-point value in the
+current precision, and each uses caching so that all calls after the
+first are essentially free.
 @end defun
 
 @defmac math-defcache @var{func} @var{initial} @var{form}
@@ -34704,7 +34711,7 @@
 @end defvar
 
 @defvar calc-window-hook
-If this hook exists, it is called to create the Calc window.
+If this hook is non-@code{nil}, it is called to create the Calc window.
 Upon return, this new Calc window should be the current window.
 (The Calc buffer will already be the current buffer when the
 hook is called.)  If the hook is not defined, Calc will
@@ -34713,10 +34720,10 @@
 @end defvar
 
 @defvar calc-trail-window-hook
-If this hook exists, it is called to create the Calc Trail window.
-The variable @code{calc-trail-buffer} will contain the buffer
-which the window should use.  Unlike @code{calc-window-hook},
-this hook must @emph{not} switch into the new window.
+If this hook is non-@code{nil}, it is called to create the Calc Trail
+window.  The variable @code{calc-trail-buffer} will contain the buffer
+which the window should use.  Unlike @code{calc-window-hook}, this hook
+must @emph{not} switch into the new window.
 @end defvar
 
 @defvar calc-edit-mode-hook
@@ -34820,11 +34827,7 @@
 See @ref{Regexp Search,, Regular Expression Search, emacs, The GNU Emacs Manual}
 to see how regular expressions work.
 
-@table @code
-
-@item calc-settings-file
-
-@vindex calc-settings-file
+@defvar calc-settings-file
 The variable @code{calc-settings-file} holds the file name in
 which commands like @kbd{m m} and @kbd{Z P} store ``permanent''
 definitions.  
@@ -34834,9 +34837,9 @@
 exists) the first time Calc is invoked.
 
 The default value for this variable is @code{"~/.calc.el"}.
-
-@item calc-gnuplot-name
-
+@end defvar
+
+@defvar calc-gnuplot-name
 See @ref{Graphics}.@*
 The variable @code{calc-gnuplot-name} should be the name of the
 GNUPLOT program (a string).  If you have GNUPLOT installed on your
@@ -34845,10 +34848,10 @@
 You may also need to set some Lisp variables to show Calc how to run
 GNUPLOT on your system, see @ref{Devices, ,Graphical Devices} .  The default value
 of @code{calc-gnuplot-name} is @code{"gnuplot"}.
-
-@item  calc-gnuplot-plot-command
-@itemx calc-gnuplot-print-command
-
+@end defvar
+
+@defvar  calc-gnuplot-plot-command
+@defvarx calc-gnuplot-print-command
 See @ref{Devices, ,Graphical Devices}.@*
 The variables @code{calc-gnuplot-plot-command} and
 @code{calc-gnuplot-print-command} represent system commands to
@@ -34861,9 +34864,9 @@
 The default value of @code{calc-gnuplot-plot-command} is @code{nil},
 and the default value of @code{calc-gnuplot-print-command} is
 @code{"lp %s"}.
-
-@item calc-language-alist
-
+@end defvar
+
+@defvar calc-language-alist
 See @ref{Basic Embedded Mode}.@*
 The variable @code{calc-language-alist} controls the languages that
 Calc will associate with major modes.  When Calc embedded mode is
@@ -34889,9 +34892,9 @@
     (fortran-mode . fortran)
     (f90-mode . fortran))
 @end example
-
-@item calc-embedded-announce-formula
-
+@end defvar
+
+@defvar calc-embedded-announce-formula
 See @ref{Customizing Embedded Mode}.@*
 The variable @code{calc-embedded-announce-formula} helps determine
 what formulas @kbd{M-# a} will activate in a buffer.  It is a
@@ -34903,10 +34906,10 @@
 The default pattern is @code{"%Embed\n\\(% .*\n\\)*"}, which checks
 for @samp{%Embed} followed by any number of lines beginning with
 @samp{%} and a space.
-
-@item  calc-embedded-open-formula
-@itemx calc-embedded-close-formula
-
+@end defvar
+
+@defvar  calc-embedded-open-formula
+@defvarx calc-embedded-close-formula
 See @ref{Customizing Embedded Mode}.@*
 The variables @code{calc-embedded-open-formula} and
 @code{calc-embedded-open-formula} control the region that Calc will
@@ -34931,10 +34934,10 @@
 @item
 Lines containing a single @samp{%} or @samp{.\"} symbol and nothing else.
 @end enumerate
-
-@item  calc-embedded-open-word
-@itemx calc-embedded-close-word
-
+@end defvar
+
+@defvar  calc-embedded-open-word
+@defvarx calc-embedded-close-word
 See @ref{Customizing Embedded Mode}.@*
 The variables @code{calc-embedded-open-word} and
 @code{calc-embedded-close-word} control the region that Calc will
@@ -34944,10 +34947,10 @@
 The default values of @code{calc-embedded-open-word} and
 @code{calc-embedded-close-word} are @code{"^\\|[^-+0-9.eE]"} and 
 @code{"$\\|[^-+0-9.eE]"} respectively.
-
-@item  calc-embedded-open-plain
-@itemx calc-embedded-close-plain
-
+@end defvar
+
+@defvar  calc-embedded-open-plain
+@defvarx calc-embedded-close-plain
 See @ref{Customizing Embedded Mode}.@*
 The variables @code{calc-embedded-open-plain} and
 @code{calc-embedded-open-plain} are used to delimit ``plain''
@@ -34960,10 +34963,10 @@
 @code{calc-embedded-close-plain} is @code{" %%%\n"}, without
 the trailing newline here, the first line of a Big mode formula
 that followed might be shifted over with respect to the other lines.
-
-@item  calc-embedded-open-new-formula
-@itemx calc-embedded-close-new-formula
-
+@end defvar
+
+@defvar  calc-embedded-open-new-formula
+@defvarx calc-embedded-close-new-formula
 See @ref{Customizing Embedded Mode}.@*
 The variables @code{calc-embedded-open-new-formula} and
 @code{calc-embedded-close-new-formula} are strings which are
@@ -34978,10 +34981,10 @@
 if typed at the end of a line.  (It follows that if @kbd{M-# f} is
 typed on a blank line, both a leading opening newline and a trailing
 closing newline are omitted.)
-
-@item  calc-embedded-open-mode
-@itemx calc-embedded-close-mode
-
+@end defvar
+
+@defvar  calc-embedded-open-mode
+@defvarx calc-embedded-close-mode
 See @ref{Customizing Embedded Mode}.@*
 The variables @code{calc-embedded-open-mode} and
 @code{calc-embedded-close-mode} are strings which Calc will place before
@@ -34995,8 +34998,7 @@
 If you change the value of @code{calc-embedded-close-mode}, it is a good
 idea still to end with a newline so that mode annotations will appear on
 lines by themselves.
-
-@end table
+@end defvar
 
 @node Reporting Bugs, Summary, Customizable Variables, Top
 @appendix Reporting Bugs
@@ -35101,11 +35103,12 @@
 @r{       @:     M-# r  @:             @:    36  @:calc-grab-rectangle@:}
 @r{       @:     M-# s  @:             @:        @:calc-info-summary@:}
 @r{       @:     M-# t  @:             @:        @:calc-tutorial@:}
-@r{       @:     M-# u  @:             @:        @:calc-embedded-update@:}
+@r{       @:     M-# u  @:             @:        @:calc-embedded-update-formula@:}
 @r{       @:     M-# w  @:             @:        @:calc-embedded-word@:}
 @r{       @:     M-# x  @:             @:        @:calc-quit@:}
 @r{       @:     M-# y  @:            @:1,28,49  @:calc-copy-to-buffer@:}
 @r{       @:     M-# z  @:             @:        @:calc-user-invocation@:}
+@r{       @:     M-# =  @:             @:        @:calc-embedded-update-formula@:}
 @r{       @:     M-# :  @:             @:    36  @:calc-grab-sum-down@:}
 @r{       @:     M-# _  @:             @:    36  @:calc-grab-sum-across@:}
 @r{       @:     M-# `  @:editing      @:    30  @:calc-embedded-edit@:}
--- a/man/trouble.texi	Sat May 28 21:04:38 2005 +0000
+++ b/man/trouble.texi	Fri Jun 03 05:49:26 2005 +0000
@@ -351,6 +351,26 @@
 recover are present in Emacs buffers.  You should then save them.  Only
 this---saving them---updates the files themselves.
 
+
+  As a last resort, if you had buffers with content which were not
+associated with any files, or if the autosave was not recent enough to
+have recorded important changes, you can use the
+@file{etc/emacs-buffer.gdb} script with GDB (the GNU Debugger) to
+retrieve them from a core dump--provided that a core dump was saved,
+and that the Emacs executable was not stripped of its debugging
+symbols.
+
+  To use this script, run @code{gdb} with the file name of your
+Emacs executable and the file name of the core dump, e.g. @samp{gdb
+/usr/bin/emacs core.emacs}.  At the @code{(gdb)} prompt, load the
+recovery script: @samp{source /usr/src/emacs/etc/emacs-buffer.gdb}.
+You can now use the commands @code{ybuffer-list} and
+@code{ysave-buffer} to list and save buffers.  The @code{ysave-buffer}
+command takes a buffer number (as listed by @code{ybuffer-list}) and a
+file name to which to write the buffer contents.  You should use a
+file name which does not already exist; no backups of the previous
+contents of the file will be saved, if any.
+
 @node Emergency Escape
 @subsection Emergency Escape
 
--- a/src/ChangeLog	Sat May 28 21:04:38 2005 +0000
+++ b/src/ChangeLog	Fri Jun 03 05:49:26 2005 +0000
@@ -1,3 +1,63 @@
+2005-06-02  Kim F. Storm  <storm@cua.dk>
+
+	* xdisp.c (MODE_LINE_NOPROP_LEN): New macro.
+	(x_consider_frame_title, Fformat_mode_line): Save offset into
+	mode_line_noprop_buf rather than pointer, in case buffer is relocated.
+
+2005-06-01  Kim F. Storm  <storm@cua.dk>
+
+	* fns.c (mapcar1): Maybe exit loop if original sequence was modified.
+
+2005-06-01  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+	* macterm.c (mac_to_x_fontname, mac_do_list_fonts): Set XLFD
+	resolution fields for scalable fonts to 0.
+
+	* xfaces.c (build_scalable_font_name): Round pixel size to the
+	nearest integer.
+
+2005-06-01  Kim F. Storm  <storm@cua.dk>
+
+	* xdisp.c (display_mode_line): Support nested calls to redisplay
+	and format-mode-line.  Set mode_line_target to MODE_LINE_DISPLAY.
+
+2005-05-31  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* fileio.c (Finsert_file_contents):
+	* xdisp.c (note_mode_line_or_margin_highlight): Lisp_Object/int mixup.
+
+2005-05-31  Kim F. Storm  <storm@cua.dk>
+
+	* xdisp.c (mode_line_noprop_buf, mode_line_noprop_buf_end)
+	(mode_line_noprop_ptr): Rename from frame_title_*.
+	(store_mode_line_noprop_char): Rename from store_frame_title_char.
+	(store_mode_line_noprop): Rename from store_frame_title.
+	(mode_line_target): New enum to specify current output target
+	for mode line formatting.
+	(display_mode_element): Test it rather than frame_title_ptr and
+	mode_line_string_list to determine where output should go.
+	(mode_line_proptrans_alist, mode_line_string_alist): Make static.
+	(Vmode_line_unwind_vector): New variable.
+	(format_mode_line_unwind_data, unwind_format_mode_line):
+	New functions for unwind protection in mode line formatting.
+	(x_consider_frame_title): Use them and new local var 'title_start'
+	to support nested calls to format-mode-line and redisplay.  Set
+	mode_line_target to MODE_LINE_TITLE.
+	(Fformat_mode_line): Use them and new local var 'string_start' to
+	support nested calls to format-mode-line and redisplay.  Set
+	mode_line_target to MODE_LINE_NOPROP or MODE_LINE_STRING.
+	Don't trim trailing dashes.
+	(decode_mode_spec): Don't make infinite number of trailing dashes
+	for MODE_LINE_NOPROP and MODE_LINE_STRING targets.
+	(syms_of_xdisp): Initialize and staticpro mode_line_string_face,
+	mode_line_string_face_prop, and Vmode_line_unwind_vector.
+	(init_xdisp): Initialize mode_line_noprop_ptr to start of _buf.
+	Initialize mode_line_target to MODE_LINE_DISPLAY.
+
+2005-05-29  Richard M. Stallman  <rms@gnu.org>
+
+	* buffer.c (Fbuffer_local_value): Call indirect_variable.
+
 2005-05-28  Masatake YAMATO  <jet@gyve.org>
 
 	* xdisp.c (note_mode_line_or_margin_highlight): Change the
@@ -9,10 +69,9 @@
 
 	* ccl.c: Now an element of Vccl_program_table is a vector of
 	length 4, not 3.
-	(ccl_get_compiled_code): New arg idx.  Caller changed.  Adjusted
-	for the change of Vccl_program_table.
-	(setup_ccl_program): Adjusted for the change of
-	Vccl_program_table.
+	(ccl_get_compiled_code): New arg idx.  Caller changed.
+	Adjust for the change of Vccl_program_table.
+	(setup_ccl_program): Adjust for the change of Vccl_program_table.
 	(check_ccl_update): New function.
 	(Fregister_ccl_program): Use ASET to set an element of a vector.
 	Adjusted for the change of Vccl_program_table.
@@ -22,7 +81,7 @@
 
 2005-05-27  Juanma Barranquero  <lekktu@gmail.com>
 
-	* image.c (Vimage_library_alist): Moved from image.el.
+	* image.c (Vimage_library_alist): Move from image.el.
 	(syms_of_image): Defvar it.
 	(lookup_image_type): Use it.
 
@@ -119,8 +178,7 @@
 
 2005-05-16  Andreas Schwab  <schwab@suse.de>
 
-	* unexmacosx.c (unexec_realloc): Move declarations before
-	statements.
+	* unexmacosx.c (unexec_realloc): Move declarations before statements.
 
 2005-05-14  Richard M. Stallman  <rms@gnu.org>
 
@@ -148,8 +206,8 @@
 
 	* emacs.c (main) [MAC_OS8]: Call init_atimer before mac_term_init.
 
-	* keyboard.c (readable_events) [USE_TOOLKIT_SCROLL_BARS]: Regard
-	toolkit scroll bar thumb drag events as squeezable and prevent
+	* keyboard.c (readable_events) [USE_TOOLKIT_SCROLL_BARS]:
+	Regard toolkit scroll bar thumb drag events as squeezable and prevent
 	redisplay from being paused by them.
 
 	* mac.c [!MAC_OSX]: Include keyboard.h and syssignal.h.
@@ -157,12 +215,11 @@
 	[!MAC_OSX] (check_alarm, pause, index): Remove functions.
 	[!MAC_OSX && __MRC__] (sys_strftime): Likewise.
 	[!MAC_OSX] (select): If fd 0 is not set in rfds and some input
-	event occurs before timeout, behave as if the function were
-	interrupted.
+	event occurs before timeout, behave as if the function were interrupted.
 	[!MAC_OSX] (sigblock, sigsetmask, alarm): Simulate SIGALRM
 	handling using Time Manager routines.
-	[!MAC_OSX] (mac_atimer_task, mac_atimer_qlink, signal_mask): New
-	variables.
+	[!MAC_OSX] (mac_atimer_task, mac_atimer_qlink, signal_mask):
+	New variables.
 	[!MAC_OSX] (mac_atimer_handler, set_mac_atimer, remove_mac_atimer)
 	(setitimer): New functions.
 
@@ -176,8 +233,8 @@
 	(x_scroll_bar_handle_click): Change type of second argument from
 	int to ControlPartCode.
 	(check_alarm): Remove declaration.
-	(XTread_Socket) [!TARGET_API_MAC_CARBON]: Don't call it.
-	(XTread_Socket): Use ControlPartCode instead of SInt16.
+	(XTread_socket) [!TARGET_API_MAC_CARBON]: Don't call it.
+	(XTread_socket): Use ControlPartCode instead of SInt16.
 
 2005-05-13  Nozomu Ando  <nand@mac.com>
 
@@ -1981,7 +2038,7 @@
 2005-01-13  Kim F. Storm  <storm@cua.dk>
 
 	* xdisp.c (Fformat_mode_line): Fix last change.  Remove NO_PROPS arg
-	(specify 0 for FACE instead). Reorder arg list.  Doc fix.
+	(specify 0 for FACE instead).  Reorder arg list.  Doc fix.
 
 2005-01-12  Richard M. Stallman  <rms@gnu.org>
 
@@ -2132,7 +2189,7 @@
 	fontp->space_width to FONT_WIDTH so they are valid.
 
 	* w32fns.c (w32_load_system_font): Set FONT_WIDTH to maximum, not
-	average width. Set fontp->average_width and fontp->space_width to
+	average width.  Set fontp->average_width and fontp->space_width to
 	their appropriate values.
 
 	* w32term.c (x_new_font): Set FRAME_COLUMN_WIDTH to
@@ -2159,7 +2216,7 @@
 	* xdisp.c (setup_for_ellipsis, get_next_display_element):
 	Set it->ellipsis_p to 1 or 0.
 	(display_line): Record whether row ends in mid-ellipsis.
-	(set_cursor_from_row): If ends in ellipsis. find start of it.
+	(set_cursor_from_row): If ends in ellipsis, find start of it.
 	(cursor_row_p): If PT's at the end of the ellipsis the row
 	ends within, don't display cursor on this row.
 
@@ -2862,7 +2919,7 @@
 	* fringe.c (update_window_fringes): Prefer truncation bitmaps over
 	angle bitmaps at top/bottom line.
 
-	* xdisp.c: Undo recent changes for restoring saved_face_id. Instead,
+	* xdisp.c: Undo recent changes for restoring saved_face_id.  Instead,
 	set it when it->method is set to next_element_from_display_vector.
 	(setup_for_ellipsis): Add LEN argument.  Callers changed.
 	Set it->saved_face_id.
@@ -3058,7 +3115,7 @@
 	* xfns.c (Fx_file_dialog): Call popup_activated instead of
 	x_menu_in_use.  Call x_menu_set_in_use in Motif version also.
 
-	* xterm.h: (x_menu_in_use): Remove.
+	* xterm.h (x_menu_in_use): Remove.
 
 2004-11-16  Richard M. Stallman  <rms@gnu.org>
 
@@ -3192,7 +3249,7 @@
 	(MR_PARTIALLY_VISIBLE_AT_BOTTOM): New helper macros.
 	(MATRIX_ROW_PARTIALLY_VISIBLE_P): Fix to return false if invisible
 	part of last line is only extra line spacing (so the text on the
-	line is fully visible). Use helper macros.
+	line is fully visible).  Use helper macros.
 	Add W arg (to use them).  All callers changed.
 	(MATRIX_ROW_PARTIALLY_VISIBLE_AT_TOP_P)
 	(MATRIX_ROW_PARTIALLY_VISIBLE_AT_BOTTOM_P): Use helper macros.
@@ -3878,7 +3935,7 @@
 
 	* keyboard.c (timer_resume_idle): New function to resume idle
 	timer without resetting timers on the idle list.
-	(read_char): Use timer_resume_idle. Remove local var last_idle_start.
+	(read_char): Use timer_resume_idle.  Remove local var last_idle_start.
 	(timer_start_idle, timer_stop_idle): Declare static.
 	(read_key_sequence): Use timer_resume_idle instead of timer_start_idle.
 
@@ -5952,7 +6009,7 @@
 	elt_prefix combined with Fsingle_key_description.
 	(describe_vector): Declare static.  Replace arg `elt_prefix' with
 	`prefix'.  Add KEYMAP_P arg.  Add local var `elt_prefix'; use it
-	if !KEYMAP_P. Use Fkey_description with prefix instead of
+	if !KEYMAP_P.  Use Fkey_description with prefix instead of
 	Fsingle_key_description.
 
 	* keymap.h (Fkey_description): Fix prototype.
@@ -6167,7 +6224,7 @@
 	(display_mode_line): Set mode_line_p before displaying line.
 	(calc_pixel_width_or_height): Declare extern.  Add separate :align-to
 	handling.  Remove complex cases for fringes and scroll-bars.
-	Add left, right, and center alignment positions. Add text (area)
+	Add left, right, and center alignment positions.  Add text (area)
 	width/height.  Return width or height for image specs.
 	(produce_stretch_glyph): Improve handling of :align-to.  Is now
 	relative to left of text area by default, but other base offsets
@@ -10475,7 +10532,7 @@
 	* intervals.h (CHECK_TOTAL_LENGTH): New macro.
 	* intervals.c: Add many calls to CHECK_TOTAL_LENGTH.
 
-	* alloc.c: (VALIDATE_LISP_STORAGE): Macro deleted.
+	* alloc.c (VALIDATE_LISP_STORAGE): Macro deleted.
 	All calls deleted.
 	(lisp_malloc): Do the work here directly.
 
@@ -10634,7 +10691,7 @@
 	(syms_of_w32fns): Don't intern/staticpro removed vars.
 
 	* w32term.c: Remove unnecessary extern declarations.
-	(x_fullscreen_adjust): Remove. Use generic instead.
+	(x_fullscreen_adjust): Remove.  Use generic instead.
 	(x_redisplay_interface): Add w32_frame_parm_handlers member.
 
 	* w32reg.c (x_get_string_resource): Use XrmDatabase.
@@ -11860,9 +11917,9 @@
 2003-01-21  David Ponce  <david@dponce.com>
 
 	* w32term.c (w32_encode_char): For DIM=1 charset, set
-	ccl->reg[2] to -1 before calling ccl_driver.  (Sync. with xterm.c
-	x_encode_char change by Kenichi Handa <handa@m17n.org> on
-	2002-09-30.)
+	ccl->reg[2] to -1 before calling ccl_driver.
+	(Sync. with xterm.c x_encode_char change by Kenichi Handa
+	<handa@m17n.org> on 2002-09-30.)
 	(w32_draw_relief_rect): Declare all args.
 	(w32_define_cursor): New.
 
@@ -14545,7 +14602,7 @@
 
 2002-06-27  Kim F. Storm  <storm@cua.dk>
 
-	* xdisp.c: (mode_line_string_list, mode_line_string_face)
+	* xdisp.c (mode_line_string_list, mode_line_string_face)
 	(mode_line_string_face_prop): New variables.
 	(store_mode_line_string): New function.
 	(display_mode_element): Use store_mode_line_string to
@@ -14588,7 +14645,7 @@
 
 2002-06-24  Juanma Barranquero  <lektu@terra.es>
 
-	* w32select.c: Include composite.h
+	* w32select.c: Include composite.h.
 
 	* w16select.c: Likewise.
 
@@ -15579,7 +15636,7 @@
 
 	* config.in: Add HAVE_SHARED_GAME_DIR.
 
-	* callproc.c: (Vgame_score_directory): New variable.
+	* callproc.c (Vgame_score_directory): New variable.
 	(syms_of_callproc) <Vgame_score_directory>: DEFVAR_LISP.
 
 2002-04-10  Richard M. Stallman  <rms@gnu.org>
@@ -16127,7 +16184,7 @@
 
 	* xterm.h (x_session_check_input, x_session_initialize): Declare.
 
-	* xterm.c: (XTread_socket): Add call to x_session_check_input and
+	* xterm.c (XTread_socket): Add call to x_session_check_input and
 	x_session_have_connection.
 	(x_initialize): Add call to x_session_initialize.
 
@@ -16544,10 +16601,10 @@
 
 2002-02-17  Kim F. Storm  <storm@cua.dk>
 
-	* frame.c: (Vmouse_highlight): New variable.
+	* frame.c (Vmouse_highlight): New variable.
 	(syms_of_frame): DEFVAR_LISP it.
 
-	* frame.h: (Vmouse_highlight): Declare extern.
+	* frame.h (Vmouse_highlight): Declare extern.
 
 	* xterm.h (struct x_display_info): Add mouse_face_hidden.
 
@@ -18072,7 +18129,7 @@
 
 2001-11-16  Eli Zaretskii  <eliz@is.elta.co.il>
 
-	* syswait.h: (HAVE_SYS_WAIT_H): Undef for ISC 4.1.  Reported by
+	* syswait.h (HAVE_SYS_WAIT_H): Undef for ISC 4.1.  Reported by
 	Andrew Wiseman <a.wiseman@btclick.com>.
 
 2001-11-16  Kim F. Storm  <storm@cua.dk>
@@ -18760,7 +18817,7 @@
 
 	* xterm.c: Fix typo in a comment.
 
-	* lisp.h: (gdb_lisp_params): Remove code in #if 0 which is now in
+	* lisp.h (gdb_lisp_params): Remove code in #if 0 which is now in
 	emacs.c.
 
 2001-10-27  Gerd Moellmann  <gerd@gnu.org>
@@ -18884,7 +18941,7 @@
 
 2001-10-24  Pavel Jan,Am(Bk  <Pavel@Janik.cz>
 
-	* xterm.c: (x_insert_glyphs): Remove unused variables `real_end'
+	* xterm.c (x_insert_glyphs): Remove unused variables `real_end'
 	and `real_start'.
 	(x_draw_image_foreground): Remove unused variables `mask' and `xgcv'.
 	(glyph_rect): Remove unused variable `area'.
@@ -18916,7 +18973,7 @@
 	(HAVE_BOXES): Fix typo in comment.
 	(push_menu_pane): Fix typo in comment.
 
-	* xdisp.c: (display_prop_string_p): Remove unused local declaration
+	* xdisp.c (display_prop_string_p): Remove unused local declaration
 	of `Qwhen'.
 	(single_display_prop_string_p): Remove unused local declarations
 	of `Qwhen' and `Qmargin'.
--- a/src/buffer.c	Sat May 28 21:04:38 2005 +0000
+++ b/src/buffer.c	Fri Jun 03 05:49:26 2005 +0000
@@ -889,6 +889,9 @@
   CHECK_BUFFER (buffer);
   buf = XBUFFER (buffer);
 
+  if (SYMBOLP (variable))
+    variable = indirect_variable (variable);
+
   /* Look in local_var_list */
   result = Fassoc (variable, buf->local_var_alist);
   if (NILP (result))
--- a/src/fileio.c	Sat May 28 21:04:38 2005 +0000
+++ b/src/fileio.c	Fri Jun 03 05:49:26 2005 +0000
@@ -3747,7 +3747,7 @@
   int set_coding_system = 0;
   int coding_system_decided = 0;
   int read_quit = 0;
-  int old_Vdeactivate_mark = Vdeactivate_mark;
+  Lisp_Object old_Vdeactivate_mark = Vdeactivate_mark;
   int we_locked_file = 0;
 
   if (current_buffer->base_buffer && ! NILP (visit))
--- a/src/fns.c	Sat May 28 21:04:38 2005 +0000
+++ b/src/fns.c	Fri Jun 03 05:49:26 2005 +0000
@@ -3132,9 +3132,9 @@
   else   /* Must be a list, since Flength did not get an error */
     {
       tail = seq;
-      for (i = 0; i < leni; i++)
+      for (i = 0; i < leni && CONSP (tail); i++)
 	{
-	  dummy = call1 (fn, Fcar (tail));
+	  dummy = call1 (fn, XCAR (tail));
 	  if (vals)
 	    vals[i] = dummy;
 	  tail = XCDR (tail);
@@ -3172,7 +3172,7 @@
   mapcar1 (leni, args, function, sequence);
   UNGCPRO;
 
-  for (i = leni - 1; i >= 0; i--)
+  for (i = leni - 1; i > 0; i--)
     args[i + i] = args[i];
 
   for (i = 1; i < nargs; i += 2)
--- a/src/macterm.c	Sat May 28 21:04:38 2005 +0000
+++ b/src/macterm.c	Fri Jun 03 05:49:26 2005 +0000
@@ -6256,9 +6256,10 @@
       strcpy(family, name);
     }
 
-  sprintf(xf, "-%s-%s-%s-%c-normal--%d-%d-75-75-m-%d-%s",
+  sprintf(xf, "-%s-%s-%s-%c-normal--%d-%d-%d-%d-m-%d-%s",
           foundry, family, style & bold ? "bold" : "medium",
-	  style & italic ? 'i' : 'r', size, size * 10, size * 10, charset);
+	  style & italic ? 'i' : 'r', size, size * 10,
+	  size ? 75 : 0, size ? 75 : 0, size * 10, charset);
 
   result = (char *) xmalloc (strlen (xf) + 1);
   strcpy (result, xf);
@@ -6714,7 +6715,7 @@
 	    break;
 	}
       else if (scl_val[XLFD_SCL_PIXEL_SIZE] > 0
-	       && (ptr = strstr (font_name_table[i], "-0-0-75-75-m-0-")))
+	       && (ptr = strstr (font_name_table[i], "-0-0-0-0-m-0-")))
 	{
 	  int former_len = ptr - font_name_table[i];
 
@@ -6724,7 +6725,7 @@
 		   scl_val[XLFD_SCL_PIXEL_SIZE],
 		   scl_val[XLFD_SCL_POINT_SIZE],
 		   scl_val[XLFD_SCL_AVGWIDTH],
-		   ptr + sizeof ("-0-0-75-75-m-0-") - 1);
+		   ptr + sizeof ("-0-0-0-0-m-0-") - 1);
 	  fontname = mac_c_string_match (pattern_regex, scaled,
 					 nonspecial, exact);
 	  if (!NILP (fontname))
--- a/src/xdisp.c	Sat May 28 21:04:38 2005 +0000
+++ b/src/xdisp.c	Fri Jun 03 05:49:26 2005 +0000
@@ -830,8 +830,8 @@
 							struct text_pos));
 static void reconsider_clip_changes P_ ((struct window *, struct buffer *));
 static int text_outside_line_unchanged_p P_ ((struct window *, int, int));
-static void store_frame_title_char P_ ((char));
-static int store_frame_title P_ ((const unsigned char *, int, int));
+static void store_mode_line_noprop_char P_ ((char));
+static int store_mode_line_noprop P_ ((const unsigned char *, int, int));
 static void x_consider_frame_title P_ ((Lisp_Object));
 static void handle_stop P_ ((struct it *));
 static int tool_bar_lines_needed P_ ((struct frame *));
@@ -8161,52 +8161,126 @@
 
 
 /***********************************************************************
-			     Frame Titles
+		     Mode Lines and Frame Titles
  ***********************************************************************/
 
-
-/* The frame title buffering code is also used by Fformat_mode_line.
-   So it is not conditioned by HAVE_WINDOW_SYSTEM.  */
-
-/* A buffer for constructing frame titles in it; allocated from the
-   heap in init_xdisp and resized as needed in store_frame_title_char.  */
-
-static char *frame_title_buf;
+/* A buffer for constructing non-propertized mode-line strings and
+   frame titles in it; allocated from the heap in init_xdisp and
+   resized as needed in store_mode_line_noprop_char.  */
+
+static char *mode_line_noprop_buf;
 
 /* The buffer's end, and a current output position in it.  */
 
-static char *frame_title_buf_end;
-static char *frame_title_ptr;
-
-
-/* Store a single character C for the frame title in frame_title_buf.
-   Re-allocate frame_title_buf if necessary.  */
+static char *mode_line_noprop_buf_end;
+static char *mode_line_noprop_ptr;
+
+#define MODE_LINE_NOPROP_LEN(start) \
+  ((mode_line_noprop_ptr - mode_line_noprop_buf) - start)
+
+static enum {
+  MODE_LINE_DISPLAY = 0,
+  MODE_LINE_TITLE,
+  MODE_LINE_NOPROP,
+  MODE_LINE_STRING
+} mode_line_target;
+
+/* Alist that caches the results of :propertize.
+   Each element is (PROPERTIZED-STRING . PROPERTY-LIST).  */
+static Lisp_Object mode_line_proptrans_alist;
+
+/* List of strings making up the mode-line.  */
+static Lisp_Object mode_line_string_list;
+
+/* Base face property when building propertized mode line string.  */
+static Lisp_Object mode_line_string_face;
+static Lisp_Object mode_line_string_face_prop;
+
+
+/* Unwind data for mode line strings */
+
+static Lisp_Object Vmode_line_unwind_vector;
+
+static Lisp_Object
+format_mode_line_unwind_data (obuf)
+     struct buffer *obuf;
+{
+  int i = 0;
+  Lisp_Object vector;
+
+  /* Reduce consing by keeping one vector in
+     Vwith_echo_area_save_vector.  */
+  vector = Vmode_line_unwind_vector;
+  Vmode_line_unwind_vector = Qnil;
+
+  if (NILP (vector))
+    vector = Fmake_vector (make_number (7), Qnil);
+
+  AREF (vector, 0) = make_number (mode_line_target);
+  AREF (vector, 1) = make_number (MODE_LINE_NOPROP_LEN (0));
+  AREF (vector, 2) = mode_line_string_list;
+  AREF (vector, 3) = mode_line_proptrans_alist;
+  AREF (vector, 4) = mode_line_string_face;
+  AREF (vector, 5) = mode_line_string_face_prop;
+
+  if (obuf)
+    XSETBUFFER (AREF (vector, 6), obuf);
+  else
+    AREF (vector, 6) = Qnil;
+
+  return vector;
+}
+
+static Lisp_Object
+unwind_format_mode_line (vector)
+     Lisp_Object vector;
+{
+  mode_line_target = XINT (AREF (vector, 0));
+  mode_line_noprop_ptr = mode_line_noprop_buf + XINT (AREF (vector, 1));
+  mode_line_string_list = AREF (vector, 2);
+  mode_line_proptrans_alist = AREF (vector, 3);
+  mode_line_string_face = AREF (vector, 4);
+  mode_line_string_face_prop = AREF (vector, 5);
+
+  if (!NILP (AREF (vector, 6)))
+    {
+      set_buffer_internal_1 (XBUFFER (AREF (vector, 6)));
+      AREF (vector, 6) = Qnil;
+    }
+
+  Vmode_line_unwind_vector = vector;
+  return Qnil;
+}
+
+
+/* Store a single character C for the frame title in mode_line_noprop_buf.
+   Re-allocate mode_line_noprop_buf if necessary.  */
 
 static void
 #ifdef PROTOTYPES
-store_frame_title_char (char c)
+store_mode_line_noprop_char (char c)
 #else
-store_frame_title_char (c)
+store_mode_line_noprop_char (c)
     char c;
 #endif
 {
   /* If output position has reached the end of the allocated buffer,
      double the buffer's size.  */
-  if (frame_title_ptr == frame_title_buf_end)
-    {
-      int len = frame_title_ptr - frame_title_buf;
-      int new_size = 2 * len * sizeof *frame_title_buf;
-      frame_title_buf = (char *) xrealloc (frame_title_buf, new_size);
-      frame_title_buf_end = frame_title_buf + new_size;
-      frame_title_ptr = frame_title_buf + len;
-    }
-
-  *frame_title_ptr++ = c;
-}
-
-
-/* Store part of a frame title in frame_title_buf, beginning at
-   frame_title_ptr.  STR is the string to store.  Do not copy
+  if (mode_line_noprop_ptr == mode_line_noprop_buf_end)
+    {
+      int len = MODE_LINE_NOPROP_LEN (0);
+      int new_size = 2 * len * sizeof *mode_line_noprop_buf;
+      mode_line_noprop_buf = (char *) xrealloc (mode_line_noprop_buf, new_size);
+      mode_line_noprop_buf_end = mode_line_noprop_buf + new_size;
+      mode_line_noprop_ptr = mode_line_noprop_buf + len;
+    }
+
+  *mode_line_noprop_ptr++ = c;
+}
+
+
+/* Store part of a frame title in mode_line_noprop_buf, beginning at
+   mode_line_noprop_ptr.  STR is the string to store.  Do not copy
    characters that yield more columns than PRECISION; PRECISION <= 0
    means copy the whole string.  Pad with spaces until FIELD_WIDTH
    number of characters have been copied; FIELD_WIDTH <= 0 means don't
@@ -8214,7 +8288,7 @@
    frame title.  */
 
 static int
-store_frame_title (str, field_width, precision)
+store_mode_line_noprop (str, field_width, precision)
      const unsigned char *str;
      int field_width, precision;
 {
@@ -8225,19 +8299,23 @@
   nbytes = strlen (str);
   n += c_string_width (str, nbytes, precision, &dummy, &nbytes);
   while (nbytes--)
-    store_frame_title_char (*str++);
+    store_mode_line_noprop_char (*str++);
 
   /* Fill up with spaces until FIELD_WIDTH reached.  */
   while (field_width > 0
 	 && n < field_width)
     {
-      store_frame_title_char (' ');
+      store_mode_line_noprop_char (' ');
       ++n;
     }
 
   return n;
 }
 
+/***********************************************************************
+			     Frame Titles
+ ***********************************************************************/
+
 #ifdef HAVE_WINDOW_SYSTEM
 
 /* Set the title of FRAME, if it has changed.  The title format is
@@ -8257,9 +8335,11 @@
       /* Do we have more than one visible frame on this X display?  */
       Lisp_Object tail;
       Lisp_Object fmt;
-      struct buffer *obuf;
+      int title_start;
+      char *title;
       int len;
       struct it it;
+      int count = SPECPDL_INDEX ();
 
       for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail))
 	{
@@ -8278,18 +8358,22 @@
       multiple_frames = CONSP (tail);
 
       /* Switch to the buffer of selected window of the frame.  Set up
-	 frame_title_ptr so that display_mode_element will output into it;
-	 then display the title.  */
-      obuf = current_buffer;
+	 mode_line_target so that display_mode_element will output into
+	 mode_line_noprop_buf; then display the title.  */
+      record_unwind_protect (unwind_format_mode_line,
+			     format_mode_line_unwind_data (current_buffer));
+
       set_buffer_internal_1 (XBUFFER (XWINDOW (f->selected_window)->buffer));
       fmt = FRAME_ICONIFIED_P (f) ? Vicon_title_format : Vframe_title_format;
-      frame_title_ptr = frame_title_buf;
+
+      mode_line_target = MODE_LINE_TITLE;
+      title_start = MODE_LINE_NOPROP_LEN (0);
       init_iterator (&it, XWINDOW (f->selected_window), -1, -1,
 		     NULL, DEFAULT_FACE_ID);
       display_mode_element (&it, 0, -1, -1, fmt, Qnil, 0);
-      len = frame_title_ptr - frame_title_buf;
-      frame_title_ptr = NULL;
-      set_buffer_internal_1 (obuf);
+      len = MODE_LINE_NOPROP_LEN (title_start);
+      title = mode_line_noprop_buf + title_start;
+      unbind_to (count, Qnil);
 
       /* Set the title only if it's changed.  This avoids consing in
 	 the common case where it hasn't.  (If it turns out that we've
@@ -8298,8 +8382,8 @@
 	 higher level than this.)  */
       if (! STRINGP (f->name)
 	  || SBYTES (f->name) != len
-	  || bcmp (frame_title_buf, SDATA (f->name), len) != 0)
-	x_implicitly_set_name (f, make_string (frame_title_buf, len), Qnil);
+	  || bcmp (title, SDATA (f->name), len) != 0)
+	x_implicitly_set_name (f, make_string (title, len), Qnil);
     }
 }
 
@@ -15600,6 +15684,7 @@
 {
   struct it it;
   struct face *face;
+  int count = SPECPDL_INDEX ();
 
   init_iterator (&it, w, -1, -1, NULL, face_id);
   prepare_desired_row (it.glyph_row);
@@ -15610,6 +15695,11 @@
     /* Force the mode-line to be displayed in the default face.  */
     it.base_face_id = it.face_id = DEFAULT_FACE_ID;
 
+  record_unwind_protect (unwind_format_mode_line,
+			 format_mode_line_unwind_data (NULL));
+
+  mode_line_target = MODE_LINE_DISPLAY;
+
   /* Temporarily make frame's keyboard the current kboard so that
      kboard-local variables in the mode_line_format will get the right
      values.  */
@@ -15617,6 +15707,8 @@
   display_mode_element (&it, 0, 0, 0, format, Qnil, 0);
   pop_frame_kboard ();
 
+  unbind_to (count, Qnil);
+
   /* Fill up with spaces.  */
   display_string (" ", Qnil, Qnil, 0, 0, &it, 10000, -1, -1, 0);
 
@@ -15639,18 +15731,6 @@
   return it.glyph_row->height;
 }
 
-/* Alist that caches the results of :propertize.
-   Each element is (PROPERTIZED-STRING . PROPERTY-LIST).  */
-Lisp_Object mode_line_proptrans_alist;
-
-/* List of strings making up the mode-line.  */
-Lisp_Object mode_line_string_list;
-
-/* Base face property when building propertized mode line string.  */
-static Lisp_Object mode_line_string_face;
-static Lisp_Object mode_line_string_face_prop;
-
-
 /* Contribute ELT to the mode line for window IT->w.  How it
    translates into text depends on its data type.
 
@@ -15671,8 +15751,9 @@
    If RISKY is nonzero, remove (disregard) any properties in any string
    we encounter, and ignore :eval and :propertize.
 
-   If the global variable `frame_title_ptr' is non-NULL, then the output
-   is passed to `store_frame_title' instead of `display_string'.  */
+   The global variable `mode_line_target' determines whether the
+   output is passed to `store_mode_line_noprop',
+   `store_mode_line_string', or `display_string'.  */
 
 static int
 display_mode_element (it, depth, field_width, precision, elt, props, risky)
@@ -15761,21 +15842,27 @@
 	if (literal)
 	  {
 	    prec = precision - n;
-	    if (frame_title_ptr)
-	      n += store_frame_title (SDATA (elt), -1, prec);
-	    else if (!NILP (mode_line_string_list))
-	      n += store_mode_line_string (NULL, elt, 1, 0, prec, Qnil);
-	    else
-	      n += display_string (NULL, elt, Qnil, 0, 0, it,
-				   0, prec, 0, STRING_MULTIBYTE (elt));
+	    switch (mode_line_target)
+	      {
+	      case MODE_LINE_NOPROP:
+	      case MODE_LINE_TITLE:
+		n += store_mode_line_noprop (SDATA (elt), -1, prec);
+		break;
+	      case MODE_LINE_STRING:
+		n += store_mode_line_string (NULL, elt, 1, 0, prec, Qnil);
+		break;
+	      case MODE_LINE_DISPLAY:
+		n += display_string (NULL, elt, Qnil, 0, 0, it,
+				     0, prec, 0, STRING_MULTIBYTE (elt));
+		break;
+	      }
 
 	    break;
 	  }
 
 	while ((precision <= 0 || n < precision)
 	       && *this
-	       && (frame_title_ptr
-		   || !NILP (mode_line_string_list)
+	       && (mode_line_target != MODE_LINE_DISPLAY
 		   || it->current_x < it->last_visible_x))
 	  {
 	    const unsigned char *last = this;
@@ -15796,29 +15883,36 @@
 		prec = c_string_width (last, this - last, precision - n,
 				       &nchars, &nbytes);
 
-		if (frame_title_ptr)
-		  n += store_frame_title (last, 0, prec);
-		else if (!NILP (mode_line_string_list))
+		switch (mode_line_target)
 		  {
-		    int bytepos = last - lisp_string;
-		    int charpos = string_byte_to_char (elt, bytepos);
-		    int endpos = (precision <= 0
-				  ? string_byte_to_char (elt,
-							 this - lisp_string)
-				  : charpos + nchars);
-
-		    n += store_mode_line_string (NULL,
-						 Fsubstring (elt, make_number (charpos),
-							     make_number (endpos)),
-						 0, 0, 0, Qnil);
-		  }
-		else
-		  {
-		    int bytepos = last - lisp_string;
-		    int charpos = string_byte_to_char (elt, bytepos);
-		    n += display_string (NULL, elt, Qnil, 0, charpos,
-					 it, 0, prec, 0,
-					 STRING_MULTIBYTE (elt));
+		  case MODE_LINE_NOPROP:
+		  case MODE_LINE_TITLE:
+		    n += store_mode_line_noprop (last, 0, prec);
+		    break;
+		  case MODE_LINE_STRING:
+		    {
+		      int bytepos = last - lisp_string;
+		      int charpos = string_byte_to_char (elt, bytepos);
+		      int endpos = (precision <= 0
+				    ? string_byte_to_char (elt,
+							   this - lisp_string)
+				    : charpos + nchars);
+
+		      n += store_mode_line_string (NULL,
+						   Fsubstring (elt, make_number (charpos),
+							       make_number (endpos)),
+						   0, 0, 0, Qnil);
+		    }
+		    break;
+		  case MODE_LINE_DISPLAY:
+		    {
+		      int bytepos = last - lisp_string;
+		      int charpos = string_byte_to_char (elt, bytepos);
+		      n += display_string (NULL, elt, Qnil, 0, charpos,
+					   it, 0, prec, 0,
+					   STRING_MULTIBYTE (elt));
+		    }
+		    break;
 		  }
 	      }
 	    else /* c == '%' */
@@ -15856,44 +15950,51 @@
 		    spec
 		      = decode_mode_spec (it->w, c, field, prec, &multibyte);
 
-		    if (frame_title_ptr)
-		      n += store_frame_title (spec, field, prec);
-		    else if (!NILP (mode_line_string_list))
-		      {
-			int len = strlen (spec);
-			Lisp_Object tem = make_string (spec, len);
-			props = Ftext_properties_at (make_number (charpos), elt);
-			/* Should only keep face property in props */
-			n += store_mode_line_string (NULL, tem, 0, field, prec, props);
-		      }
-		    else
+		    switch (mode_line_target)
 		      {
-			int nglyphs_before, nwritten;
-
-			nglyphs_before = it->glyph_row->used[TEXT_AREA];
-			nwritten = display_string (spec, Qnil, elt,
-						   charpos, 0, it,
-						   field, prec, 0,
-						   multibyte);
-
-			/* Assign to the glyphs written above the
-			   string where the `%x' came from, position
-			   of the `%'.  */
-			if (nwritten > 0)
-			  {
-			    struct glyph *glyph
-			      = (it->glyph_row->glyphs[TEXT_AREA]
-				 + nglyphs_before);
-			    int i;
-
-			    for (i = 0; i < nwritten; ++i)
-			      {
-				glyph[i].object = elt;
-				glyph[i].charpos = charpos;
-			      }
-
-			    n += nwritten;
-			  }
+		      case MODE_LINE_NOPROP:
+		      case MODE_LINE_TITLE:
+			n += store_mode_line_noprop (spec, field, prec);
+			break;
+		      case MODE_LINE_STRING:
+			{
+			  int len = strlen (spec);
+			  Lisp_Object tem = make_string (spec, len);
+			  props = Ftext_properties_at (make_number (charpos), elt);
+			  /* Should only keep face property in props */
+			  n += store_mode_line_string (NULL, tem, 0, field, prec, props);
+			}
+			break;
+		      case MODE_LINE_DISPLAY:
+			{
+			  int nglyphs_before, nwritten;
+
+			  nglyphs_before = it->glyph_row->used[TEXT_AREA];
+			  nwritten = display_string (spec, Qnil, elt,
+						     charpos, 0, it,
+						     field, prec, 0,
+						     multibyte);
+
+			  /* Assign to the glyphs written above the
+			     string where the `%x' came from, position
+			     of the `%'.  */
+			  if (nwritten > 0)
+			    {
+			      struct glyph *glyph
+				= (it->glyph_row->glyphs[TEXT_AREA]
+				   + nglyphs_before);
+			      int i;
+
+			      for (i = 0; i < nwritten; ++i)
+				{
+				  glyph[i].object = elt;
+				  glyph[i].charpos = charpos;
+				}
+
+			      n += nwritten;
+			    }
+			}
+			break;
 		      }
 		  }
 		else /* c == 0 */
@@ -16064,13 +16165,20 @@
   /* Pad to FIELD_WIDTH.  */
   if (field_width > 0 && n < field_width)
     {
-      if (frame_title_ptr)
-	n += store_frame_title ("", field_width - n, 0);
-      else if (!NILP (mode_line_string_list))
-	n += store_mode_line_string ("", Qnil, 0, field_width - n, 0, Qnil);
-      else
-	n += display_string ("", Qnil, Qnil, 0, 0, it, field_width - n,
-			     0, 0, 0);
+      switch (mode_line_target)
+	{
+	case MODE_LINE_NOPROP:
+	case MODE_LINE_TITLE:
+	  n += store_mode_line_noprop ("", field_width - n, 0);
+	  break;
+	case MODE_LINE_STRING:
+	  n += store_mode_line_string ("", Qnil, 0, field_width - n, 0, Qnil);
+	  break;
+	case MODE_LINE_DISPLAY:
+	  n += display_string ("", Qnil, Qnil, 0, 0, it, field_width - n,
+			       0, 0, 0);
+	  break;
+	}
     }
 
   return n;
@@ -16202,6 +16310,9 @@
   struct buffer *old_buffer = NULL;
   int face_id = -1;
   int no_props = INTEGERP (face);
+  int count = SPECPDL_INDEX ();
+  Lisp_Object str;
+  int string_start = 0;
 
   if (NILP (window))
     window = selected_window;
@@ -16229,64 +16340,50 @@
     face_id = DEFAULT_FACE_ID;
 
   if (XBUFFER (buffer) != current_buffer)
-    {
-      old_buffer = current_buffer;
-      set_buffer_internal_1 (XBUFFER (buffer));
-    }
+    old_buffer = current_buffer;
+
+  record_unwind_protect (unwind_format_mode_line,
+			 format_mode_line_unwind_data (old_buffer));
+
+  if (old_buffer)
+    set_buffer_internal_1 (XBUFFER (buffer));
 
   init_iterator (&it, w, -1, -1, NULL, face_id);
 
-  if (!no_props)
-    {
+  if (no_props)
+    {
+      mode_line_target = MODE_LINE_NOPROP;
+      mode_line_string_face_prop = Qnil;
+      mode_line_string_list = Qnil;
+      string_start = MODE_LINE_NOPROP_LEN (0);
+    }
+  else
+    {
+      mode_line_target = MODE_LINE_STRING;
+      mode_line_string_list = Qnil;
       mode_line_string_face = face;
       mode_line_string_face_prop
 	= (NILP (face) ? Qnil : Fcons (Qface, Fcons (face, Qnil)));
-
-      /* We need a dummy last element in mode_line_string_list to
-	 indicate we are building the propertized mode-line string.
-	 Using mode_line_string_face_prop here GC protects it.  */
-      mode_line_string_list
-	= Fcons (mode_line_string_face_prop, Qnil);
-      frame_title_ptr = NULL;
-    }
-  else
-    {
-      mode_line_string_face_prop = Qnil;
-      mode_line_string_list = Qnil;
-      frame_title_ptr = frame_title_buf;
     }
 
   push_frame_kboard (it.f);
   display_mode_element (&it, 0, 0, 0, format, Qnil, 0);
   pop_frame_kboard ();
 
-  if (old_buffer)
-    set_buffer_internal_1 (old_buffer);
-
-  if (!no_props)
-    {
-      Lisp_Object str;
+  if (no_props)
+    {
+      len = MODE_LINE_NOPROP_LEN (string_start);
+      str = make_string (mode_line_noprop_buf + string_start, len);
+    }
+  else
+    {
       mode_line_string_list = Fnreverse (mode_line_string_list);
-      str = Fmapconcat (intern ("identity"), XCDR (mode_line_string_list),
+      str = Fmapconcat (intern ("identity"), mode_line_string_list,
 			make_string ("", 0));
-      mode_line_string_face_prop = Qnil;
-      mode_line_string_list = Qnil;
-      return str;
-    }
-
-  len = frame_title_ptr - frame_title_buf;
-  if (len > 0 && frame_title_ptr[-1] == '-')
-    {
-      /* Mode lines typically ends with numerous dashes; reduce to two dashes.  */
-      while (frame_title_ptr > frame_title_buf && *--frame_title_ptr == '-')
-	;
-      frame_title_ptr += 3;  /* restore last non-dash + two dashes */
-      if (len > frame_title_ptr - frame_title_buf)
-	len = frame_title_ptr - frame_title_buf;
-    }
-
-  frame_title_ptr = NULL;
-  return make_string (frame_title_buf, len);
+    }
+
+  unbind_to (count, Qnil);
+  return str;
 }
 
 /* Write a null-terminated, right justified decimal representation of
@@ -16604,7 +16701,8 @@
 	register int i;
 
 	/* Let lots_of_dashes be a string of infinite length.  */
-	if (!NILP (mode_line_string_list))
+	if (mode_line_target == MODE_LINE_NOPROP ||
+	    mode_line_target == MODE_LINE_STRING)
 	  return "--";
 	if (field_width <= 0
 	    || field_width > sizeof (lots_of_dashes))
@@ -21407,7 +21505,7 @@
 	       tmp_glyph->charpos >= XINT (b);
 	       tmp_glyph--, gpos++)
 	    {
-	      if (tmp_glyph->object != glyph->object)
+	      if (!EQ (tmp_glyph->object, glyph->object))
 		break;
 	    }
 
@@ -21420,7 +21518,7 @@
 	       tmp_glyph->charpos < XINT (e);
 	       tmp_glyph++, gseq_length++)
 	      {
-		if (tmp_glyph->object != glyph->object)
+		if (!EQ (tmp_glyph->object, glyph->object))
 		  break;
 	      }
 
@@ -22698,9 +22796,14 @@
 
   mode_line_proptrans_alist = Qnil;
   staticpro (&mode_line_proptrans_alist);
-
   mode_line_string_list = Qnil;
   staticpro (&mode_line_string_list);
+  mode_line_string_face = Qnil;
+  staticpro (&mode_line_string_face);
+  mode_line_string_face_prop = Qnil;
+  staticpro (&mode_line_string_face_prop);
+  Vmode_line_unwind_vector = Qnil;
+  staticpro (&Vmode_line_unwind_vector);
 
   help_echo_string = Qnil;
   staticpro (&help_echo_string);
@@ -23050,9 +23153,10 @@
     /* Allocate the buffer for frame titles.
        Also used for `format-mode-line'.  */
     int size = 100;
-    frame_title_buf = (char *) xmalloc (size);
-    frame_title_buf_end = frame_title_buf + size;
-    frame_title_ptr = NULL;
+    mode_line_noprop_buf = (char *) xmalloc (size);
+    mode_line_noprop_buf_end = mode_line_noprop_buf + size;
+    mode_line_noprop_ptr = mode_line_noprop_buf;
+    mode_line_target = MODE_LINE_DISPLAY;
   }
 
   help_echo_showing_p = 0;
--- a/src/xfaces.c	Sat May 28 21:04:38 2005 +0000
+++ b/src/xfaces.c	Fri Jun 03 05:49:26 2005 +0000
@@ -6452,12 +6452,12 @@
   if (font->numeric[XLFD_RESY] != 0)
     {
       pt = resy / font->numeric[XLFD_RESY] * specified_pt + 0.5;
-      pixel_value = font->numeric[XLFD_RESY] / (PT_PER_INCH * 10.0) * pt;
+      pixel_value = font->numeric[XLFD_RESY] / (PT_PER_INCH * 10.0) * pt + 0.5;
     }
   else
     {
       pt = specified_pt;
-      pixel_value = resy / (PT_PER_INCH * 10.0) * pt;
+      pixel_value = resy / (PT_PER_INCH * 10.0) * pt + 0.5;
     }
   /* We may need a font of the different size.  */
   pixel_value *= font->rescale_ratio;