changeset 83510:2d2f6f096f6e

Merged from emacs@sv.gnu.org Patches applied: * emacs@sv.gnu.org/emacs--devo--0--patch-216 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-217 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-218 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-219 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-220 Improve tq.el. * emacs@sv.gnu.org/emacs--devo--0--patch-221 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-222 Update from CVS: src/puresize.h (PURESIZE_RATIO): Reduce to 10/6. * emacs@sv.gnu.org/emacs--devo--0--patch-223 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-224 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-225 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-226 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-227 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-228 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-229 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-230 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-231 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-232 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-233 Update from CVS: lisp/progmodes/python.el (python-mode): Fix typo. * emacs@sv.gnu.org/gnus--rel--5.10--patch-84 Merge from emacs--devo--0 * emacs@sv.gnu.org/gnus--rel--5.10--patch-85 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-86 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-550
author Karoly Lorentey <lorentey@elte.hu>
date Wed, 19 Apr 2006 16:23:46 +0000
parents 24cf4bf418dc (current diff) 15278e681be3 (diff)
children f714f11da40a
files admin/FOR-RELEASE etc/TODO lisp/ChangeLog lisp/allout.el lisp/env.el lisp/files.el lisp/mh-e/ChangeLog lisp/mh-e/mh-e.el lisp/progmodes/gdb-ui.el lisp/progmodes/tcl.el lisp/subr.el lisp/vc.el lispref/ChangeLog man/ChangeLog man/mh-e.texi src/coding.c src/dispnew.c src/fns.c src/image.c src/keyboard.c src/keymap.c src/lisp.h src/macfns.c src/macterm.c src/macterm.h src/print.c src/process.c src/puresize.h src/window.c src/xdisp.c src/xfaces.c src/xmenu.c
diffstat 120 files changed, 3996 insertions(+), 2016 deletions(-) [+]
line wrap: on
line diff
--- a/admin/FOR-RELEASE	Wed Apr 12 17:40:36 2006 +0000
+++ b/admin/FOR-RELEASE	Wed Apr 19 16:23:46 2006 +0000
@@ -37,6 +37,9 @@
 
 ** Is there a basic problem with cl-byte-compile-compiler-macro?
 
+** Recalculate the tool bar height after changing the default font.
+(Bug report by Yamamoto Mistuharu, 31 Mar 2006)
+
 ** Markus Gritsch's report about Emacs looping on Windoze with the following
 .emacs file, and then reduce Emacs frame width to "something quite narrow":
 	(setq-default truncate-lines t)
@@ -76,7 +79,7 @@
 DIRECTORY		STATUS		IN CHARGE
 ---------		------		---------
 etc (and subdirs)	done		Thien-Thi Nguyen (ttn(@gnu.org))
-leim			working		Kenichi Handa
+leim			done		Kenichi Handa
 lib-src			done		ttn
 lisp			done		ttn
 lisp/calc		done		Jay Belanger
@@ -85,8 +88,8 @@
 lisp/emulation		done		ttn
 lisp/eshell		done		ttn
 lisp/gnus		done		Romain Francoise
-lisp/international	working		Kenichi Handa
-lisp/language		working		Kenichi Handa
+lisp/international	done		Kenichi Handa
+lisp/language		done		Kenichi Handa
 lisp/mail		done		ttn
 lisp/mh-e		done		Bill Wohler
 lisp/net		done		ttn
--- a/etc/ChangeLog	Wed Apr 12 17:40:36 2006 +0000
+++ b/etc/ChangeLog	Wed Apr 19 16:23:46 2006 +0000
@@ -1,3 +1,20 @@
+2006-04-18  Reiner Steib  <Reiner.Steib@gmx.de>
+
+	* gnus-refcard.tex: Bump version to 5.11.  Remove duplicate
+	\def's.  Update date.
+
+2006-04-18  Bill Wohler  <wohler@newt.com>
+
+	* MORE.STUFF: Add MH-E.
+
+2006-04-18  Carsten Dominik  <dominik@science.uva.nl>
+
+	* orgcard.tex: Version number change only.
+
+2006-04-12  Kenichi Handa  <handa@m17n.org>
+
+	* PROBLEMS (C-SPC fails ...): Explicitly say fcitx in the header.
+
 2006-04-11  Carsten Dominik  <dominik@science.uva.nl>
 
 	* orgcard.tex: (section{Tables}): Document column narrowing.
@@ -19,7 +36,7 @@
 2006-03-28  Bill Wohler  <wohler@newt.com>
 
 	* images/README: Update with following information.
-	
+
 	* images/data-save.xpm, images/mail/flag-for-followup.xpm:
 	* images/zoom-in.xpm, images/zoom-out.xpm: New images from GNOME
 	2.12.
@@ -28,27 +45,27 @@
 	* images/mail/flag-for-followup.pbm, images/mail/inbox.pbm:
 	* images/mail/move.pbm, images/next-page.pbm, images/zoom-out.pbm:
 	New bitmaps for new images.
-	
-        * images/refresh.xpm, images/sort-ascending.xpm,
+
+	* images/refresh.xpm, images/sort-ascending.xpm,
 	* images/sort-descending.xpm: Update with GTK 2.x images. Note
 	that the default GTK icons are not overridden by the GNOME theme
 	due to a bug which was fixed in GNOME 2.15. Once GNOME 2.16 is in
 	wide circulation, then the GTK icons should be replaced with the
 	equivalent GNOME icons. Until then, we should be consistent with
 	GTK first, then GNOME.
-	
-        * images/mail/repack.xpm, images/mail/reply-from.xpm:
+
+	* images/mail/repack.xpm, images/mail/reply-from.xpm:
 	* images/mail/reply-to.xpm, images/search-replace.xpm:
 	* images/separator.xpm, images/show.xpm: Update custom icons to be
 	closer to their GNOME counterparts.
-	
-        * images/attach.pbm, images/exit.pbm, images/mail/compose.pbm:
+
+	* images/attach.pbm, images/exit.pbm, images/mail/compose.pbm:
 	* images/mail/repack.pbm, images/mail/reply-all.pbm:
 	* images/mail/reply-from.pbm, images/mail/reply-to.pbm:
 	* images/mail/reply.pbm, images/mail/send.pbm, images/show.pbm:
 	* images/search-replace.pbm: Update bitmaps.
-	
-        * images/execute.pbm, images/execute.xpm, images/fld-open.pbm:
+
+	* images/execute.pbm, images/execute.xpm, images/fld-open.pbm:
 	* images/fld-open.xpm, images/highlight.pbm, images/highlight.xpm:
 	* images/mail.pbm, images/mail.xpm, images/mail/alias.pbm:
 	* images/mail/alias.xpm, images/mail/refile.pbm:
--- a/etc/MORE.STUFF	Wed Apr 12 17:40:36 2006 +0000
+++ b/etc/MORE.STUFF	Wed Apr 19 16:23:46 2006 +0000
@@ -71,6 +71,8 @@
 
  * Ispell: <URL:http://www.eng.utah.edu/~kstevens/ispell-page.html>
 
+ * MH-E: <URL:http://mh-e.sourceforge.net/>
+
  * PC Selection: <URL:ftp://ftp.thp.uni-duisburg.de/pub/source/elisp/>
 
  * PS mode: <URL:http://odur.let.rug.nl/%7Ekleiweg/postscript/>
--- a/etc/PROBLEMS	Wed Apr 12 17:40:36 2006 +0000
+++ b/etc/PROBLEMS	Wed Apr 19 16:23:46 2006 +0000
@@ -991,7 +991,7 @@
 
 Use the shell command `xset bc' to make the old X Menu package work.
 
-*** C-SPC fails to work on Fedora GNU/Linux (or with some input method).
+*** C-SPC fails to work on Fedora GNU/Linux (or with fcitx input method).
 
 Fedora Core 4 steals the C-SPC key by default for the `iiimx' program
 which is the input method for some languages.  It blocks Emacs users
--- a/etc/TODO	Wed Apr 12 17:40:36 2006 +0000
+++ b/etc/TODO	Wed Apr 19 16:23:46 2006 +0000
@@ -9,12 +9,14 @@
 
 * Small but important fixes needed in existing features:
 
+** whitespace-cleanup should work only on the region if the region is active.
+
+** Distribute a bar cursor of width > 1 evenly between the two glyphs
+   on each side of the bar (what to do at the edges?).
+
 ** Make vc-checkin avoid reverting the buffer if has not changed after
    the checkin. Comparing (md5 BUFFER) to (md5 FILE) should be enough.
 
-** Make vc-annotate show place the cursor in the annotate buffer at the 
-   same line as the current buffer.
-
 ** buffer-offer-save should be a permanent local.
 
 ** revert-buffer should eliminate overlays and the mark.
@@ -69,7 +71,7 @@
 ** Redesign the load-history data structure so it can cope better
   with evaluating definitions of the same function from different files,
   recording which file the latest definition came from.
-  
+
 * Important features:
 
 ** Provide user-friendly ways to list all available font families,
@@ -158,7 +160,7 @@
 ** Emacs Lisp mode could put an overlay on the defun for every
   function that has advice.  The overlay could have `after-text' like "
   [Function has advice]".  It might look like
-     (defun foo [Function has advice] (x y) 
+     (defun foo [Function has advice] (x y)
   The overlay could also be a button that you could use to view the advice.
 
 ** ange-ftp
@@ -261,7 +263,7 @@
 ** Highlight rectangles (`mouse-track-rectangle-p' in XEmacs).  Already in CUA,
   but it's a valuable feature worth making more general.
 
-** Support simultaneous tty and X frames.  [See the multi-tty branch of Emacs 
+** Support simultaneous tty and X frames.  [See the multi-tty branch of Emacs
   at http://lorentey.hu/project/emacs.]
 
 ** Provide MIME support for Rmail using the Gnus MIME library.  [Maybe
--- a/etc/gnus-refcard.tex	Wed Apr 12 17:40:36 2006 +0000
+++ b/etc/gnus-refcard.tex	Wed Apr 19 16:23:46 2006 +0000
@@ -76,8 +76,9 @@
 % \input{gnusref} % % % % % % % % % % % % % % % % % % % % % % % % % %  
 %% include file for the Gnus refcard and booklet
 
-\def\progver{5.10}\def\refver{5.10-2} % program and refcard versions
-\def\date{Mar, 2005}
+\def\progver{5.11} % program version
+% \def\refver{5.10-2} % refcard version (not used)
+\def\date{April, 2006}
 \def\author{Gnus Bugfixing Girls + Boys $<$bugs@gnus.org$>$}
 
 %%
@@ -1267,10 +1268,6 @@
 
 \begin{document}
 
-\def\progver{5.10}\def\refver{5.10-1} % program and refcard versions
-\def\date{Jan 10th, 2004}
-\def\author{Gnus Bugfixing Girls + Boys $<$bugs@gnus.org$>$}
-
 \ifthenelse{\isundefined{\booklettrue}}{ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   \raggedbottom\raggedright
   \twocolumn
--- a/etc/orgcard.tex	Wed Apr 12 17:40:36 2006 +0000
+++ b/etc/orgcard.tex	Wed Apr 19 16:23:46 2006 +0000
@@ -1,5 +1,5 @@
 % Reference Card for Org Mode
-\def\orgversionnumber{4.21}
+\def\orgversionnumber{4.24}
 \def\year{2006}
 %
 %**start of header
--- a/leim/Makefile.in	Wed Apr 12 17:40:36 2006 +0000
+++ b/leim/Makefile.in	Wed Apr 19 16:23:46 2006 +0000
@@ -1,5 +1,5 @@
 # Makefile for leim subdirectory in GNU Emacs.
-# Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+# Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
 #   Free Software Foundation, Inc.
 # Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
 #   National Institute of Advanced Industrial Science and Technology (AIST)
@@ -47,7 +47,7 @@
 buildlisppath=${srcdir}/${dot}${dot}/lisp
 
 # How to run Emacs.
-RUN-EMACS = EMACSLOADPATH=$(buildlisppath) \
+RUN-EMACS = EMACSLOADPATH=$(buildlisppath) LC_ALL=C\
 	${BUILT-EMACS} -batch --no-init-file --no-site-file --multibyte
 
 # Subdirectories to be made if ${srcdir} is different from the current
--- a/leim/quail/croatian.el	Wed Apr 12 17:40:36 2006 +0000
+++ b/leim/quail/croatian.el	Wed Apr 19 16:23:46 2006 +0000
@@ -1,6 +1,6 @@
 ;;; quail/croatian.el -- Quail package for inputing Croatian  -*-coding: iso-8859-2;-*-
 
-;; Copyright (C) 2002 Free Software Foundation, Inc.
+;; Copyright (C) 2003 Free Software Foundation, Inc.
 
 ;; Author: Hrvoje Nik¹iæ <hniksic@xemacs.org>,
 ;;         modeled after czech.el by Milan Zamazal.
--- a/leim/quail/cyril-jis.el	Wed Apr 12 17:40:36 2006 +0000
+++ b/leim/quail/cyril-jis.el	Wed Apr 19 16:23:46 2006 +0000
@@ -1,7 +1,7 @@
 ;;; cyril-jis.el --- Quail package for inputting JISX0208 Cyrillic letters
 
 ;; Copyright (C) 2001  Free Software Foundation, Inc.
-;; Copyright (C) 1997, 2005
+;; Copyright (C) 1997
 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
 ;;   Registration Number H14PRO021
 
--- a/leim/quail/cyrillic.el	Wed Apr 12 17:40:36 2006 +0000
+++ b/leim/quail/cyrillic.el	Wed Apr 19 16:23:46 2006 +0000
@@ -2,7 +2,7 @@
 
 ;; Copyright (C) 1997, 1998, 2001, 2002, 2003, 2004, 2005
 ;;   Free Software Foundation, Inc.
-;; Copyright (C) 1997, 2005
+;; Copyright (C) 1997, 2003
 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
 ;;   Registration Number H14PRO021
 
--- a/leim/quail/hangul3.el	Wed Apr 12 17:40:36 2006 +0000
+++ b/leim/quail/hangul3.el	Wed Apr 19 16:23:46 2006 +0000
@@ -1,6 +1,6 @@
 ;;; hangul3.el --- Quail package for inputting Korean Hangul characters  -*-coding: iso-2022-7bit;-*-
 
-;; Copyright (C) 1997, 1998, 2001  Free Software Foundation, Inc.
+;; Copyright (C) 1997, 1998, 2001, 2002  Free Software Foundation, Inc.
 ;; Copyright (C) 1997, 2002
 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
 ;;   Registration Number H14PRO021
--- a/leim/quail/hanja.el	Wed Apr 12 17:40:36 2006 +0000
+++ b/leim/quail/hanja.el	Wed Apr 19 16:23:46 2006 +0000
@@ -1,5 +1,6 @@
 ;;; hanja.el --- Quail-package for Korean Hanja (KSC5601)  -*-coding: iso-2022-7bit;-*-
 
+;; Copyright (C) 1997 Free Software Foundation, Inc.
 ;; Copyright (C) 1997
 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
 ;;   Registration Number H14PRO021
--- a/leim/quail/japanese.el	Wed Apr 12 17:40:36 2006 +0000
+++ b/leim/quail/japanese.el	Wed Apr 19 16:23:46 2006 +0000
@@ -1,5 +1,6 @@
 ;;; japanese.el --- Quail package for inputting Japanese  -*-coding: iso-2022-7bit;-*-
 
+;; Copyright (C) 2001  Free Software Foundation, Inc.
 ;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2005
 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
 ;;   Registration Number H14PRO021
--- a/leim/quail/latin-alt.el	Wed Apr 12 17:40:36 2006 +0000
+++ b/leim/quail/latin-alt.el	Wed Apr 19 16:23:46 2006 +0000
@@ -1,7 +1,7 @@
 ;;; latin-alt.el --- Quail package for inputting various European characters -*-coding: iso-2022-7bit;-*-
 
 ;; Copyright (C) 1997, 1998, 2001, 2002  Free Software Foundation, Inc.
-;; Copyright (C) 1997, 1999
+;; Copyright (C) 1999
 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
 ;;   Registration Number H14PRO021
 
--- a/leim/quail/latin-ltx.el	Wed Apr 12 17:40:36 2006 +0000
+++ b/leim/quail/latin-ltx.el	Wed Apr 19 16:23:46 2006 +0000
@@ -1,7 +1,7 @@
 ;;; latin-ltx.el --- Quail package for TeX-style input -*-coding: utf-8;-*-
 
 ;; Copyright (C) 2001, 2003, 2004, 2005  Free Software Foundation, Inc.
-;; Copyright (C) 2001
+;; Copyright (C) 2001, 2005
 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
 ;;   Registration Number H14PRO021
 
--- a/leim/quail/latin-post.el	Wed Apr 12 17:40:36 2006 +0000
+++ b/leim/quail/latin-post.el	Wed Apr 19 16:23:46 2006 +0000
@@ -1,7 +1,7 @@
 ;;; latin-post.el --- Quail packages for inputting various European characters  -*-coding: iso-2022-7bit;-*-
 
 ;; Copyright (C) 1997, 1998, 2001, 2002 Free Software Foundation, Inc.
-;; Copyright (C) 1997
+;; Copyright (C) 1997, 1999
 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
 ;;   Registration Number H14PRO021
 
--- a/leim/quail/latin-pre.el	Wed Apr 12 17:40:36 2006 +0000
+++ b/leim/quail/latin-pre.el	Wed Apr 19 16:23:46 2006 +0000
@@ -1,8 +1,8 @@
 ;;; latin-pre.el --- Quail packages for inputting various European characters  -*-coding: iso-2022-7bit;-*-
 
-;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002
+;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003
 ;;   Free Software Foundation, Inc.
-;; Copyright (C) 1997, 1999, 2005
+;; Copyright (C) 1997, 1998, 1999, 2000, 2005
 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
 ;;   Registration Number H14PRO021
 
--- a/leim/quail/pypunct-b5.el	Wed Apr 12 17:40:36 2006 +0000
+++ b/leim/quail/pypunct-b5.el	Wed Apr 19 16:23:46 2006 +0000
@@ -1,6 +1,6 @@
 ;;; pypunct-b5.el --- Quail packages for Chinese (pinyin + extra symbols)
 
-;; Copyright (C) 1997, 2000
+;; Copyright (C) 1997, 2000, 2003
 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
 ;;   Registration Number H14PRO021
 
--- a/leim/quail/tibetan.el	Wed Apr 12 17:40:36 2006 +0000
+++ b/leim/quail/tibetan.el	Wed Apr 19 16:23:46 2006 +0000
@@ -1,7 +1,7 @@
 ;;; tibetan.el --- Quail package for inputting Tibetan characters
 
-;; Copyright (C) 1995  Free Software Foundation, Inc.
-;; Copyright (C) 1995, 1998, 1999, 2000
+;; Copyright (C) 1997  Free Software Foundation, Inc.
+;; Copyright (C) 1997, 1998, 1999, 2000
 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
 ;;   Registration Number H14PRO021
 
--- a/lisp/ChangeLog	Wed Apr 12 17:40:36 2006 +0000
+++ b/lisp/ChangeLog	Wed Apr 19 16:23:46 2006 +0000
@@ -1,3 +1,225 @@
+2006-04-18  Dan Nicolaescu  <dann@ics.uci.edu>
+
+	* progmodes/python.el (python-mode): Fix typo.
+
+2006-04-18  J.D. Smith  <jdsmith@as.arizona.edu>
+
+	* comint.el (comint-previous-input): Don't clobber input line
+	when moving off either end of the input history ring.
+	(comint-delete-input): New function, used by
+	`comint-previous-input' and others.
+	(comint-previous-matching-input): Use
+	`coming-delete-input'. Save the partial input if leaving the
+	edit line.  Goto point-max before deleting input to avoid
+	partial input fragments hanging around.
+	(comint-restore-input): New function, used by
+	`comint-previous-input', and bound to "C-c C-j".
+
+2006-04-18  Luc Teirlinck  <teirllm@auburn.edu>
+
+	* imenu.el (imenu--index-alist): Balance parentheses.
+
+2006-04-18  Dan Nicolaescu  <dann@ics.uci.edu>
+
+	* progmodes/python.el (python-mode): Add support for
+	hs-minor-mode.
+
+2006-04-19  Reiner Steib  <Reiner.Steib@gmx.de>
+
+	* abbrev.el (read-abbrev-file): Use abbrev-file-name if optional
+	file is nil.
+
+2006-04-18  Richard Stallman  <rms@gnu.org>
+
+	* tooltip.el (tooltip-mode, tooltip-use-echo-area): Doc fixes.
+
+	* imenu.el (imenu-create-index-function, imenu--index-alist)
+	(imenu--last-menubar-index-alist, imenu--make-index-alist)
+	(imenu-default-create-index-function, imenu--generic-function):
+	Doc fixes.
+
+	* image-mode.el (image-toggle-display): Handle tar and arc subfiles.
+
+	* help-mode.el (help-mode): Set view-exit-action to delete window.
+
+	* env.el (setenv): Get rid of arg UNSET.  Interactive unsetting
+	now works by passing nil as arg.
+
+	* apropos.el (apropos-print): Don't do where-is on self-insert-command.
+
+	* abbrev.el (edit-abbrevs-redefine): Temporarily widen.
+	(read-abbrev-file): Provide default when reading filename.
+
+	* files.el (enable-local-variables): Allow :all as value.
+	(hack-local-variables): Implement that value.
+	(safe-local-variable-values, safe-local-eval-forms)
+	(enable-local-variables): Mark as risky.
+	(find-file-visit-truename, kept-old-versions): Mark safe.
+
+	* time-stamp.el (time-stamp-format, time-stamp-line-limit)
+	(time-stamp-start, time-stamp-end, time-stamp-inserts-lines)
+	(time-stamp-count, time-stamp-pattern): Add safe-local-variable prop.
+
+2006-04-18  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* progmodes/tcl.el (tcl-send-string, tcl-send-region):
+	Use forward-line so as to get to BOL even in the presence of fields.
+	(tcl-eval-region): Strip surrounding space to avoid multiple prompts
+	in return.
+	(inferior-tcl): Tell tclsh to work in interactive mode.
+
+	* complete.el (partial-completion-mode):
+	Use 'choose-completion-string-functions to make sure that
+	choose-completion fills the minibuffer properly.
+
+	* complete.el (PC-old-read-file-name-internal): Remove.
+	(PC-read-include-file-name-internal): Remove.  Turn it into an advice
+	of read-file-name-internal.
+	(partial-completion-mode): Enable/disable this advice.
+
+2006-04-18  Juanma Barranquero  <lekktu@gmail.com>
+
+	* net/tramp.el (tramp-completion-file-name-handler): Revert change
+	of 2006-04-17.
+
+2006-04-18  Carsten Dominik  <dominik@science.uva.nl>
+
+	* textmodes/org.el (org-insert-heading): Insert heading before
+	current if at beginning of line.
+	(org-todo, org-date): New faces.
+	(org-table-align): Make sure tooltip window contains full text.
+	(org-no-properties): New defsubst.
+	(org-set-font-lock-defaults): Use new faces.
+
+2006-04-18  Nick Roberts  <nickrob@snap.net.nz>
+
+	* progmodes/gud.el (gud-speedbar-item-info): Display frame address
+	for root variables.
+
+	* progmodes/gdb-ui.el (gdb-pc-address): Rename from gdb-frame-address.
+	(gdb-frame-address): Re-use to identify frame for watch expression.
+	(gdb-var-list, gdb-var-create-handler): Add frame address for root
+	variables.
+	(gdb-init-1, gdb-source, gdb-post-prompt, )
+	(gdb-assembler-custom, gdb-invalidate-assembler): Use gdb-pc-address.
+	(gdb-frame-handler): Get gdb-frame-address.
+
+2006-04-17  Michael Albinus  <michael.albinus@gmx.de>
+
+	Sync with Tramp 2.0.53.
+
+	* net/tramp.el (tramp-completion-mode): ?\t has event-modifier
+	'control.  Reported by Matthias F,bv(Brste <slashdevslashnull@gmx.net>.
+	(tramp-completion-file-name-handler): Add autoload cookie for
+	adding to `file-name-handler-alist'.
+
+	* net/tramp-smb.el (tramp-smb-wait-for-output): Wait always for
+	the prompt.  If it returns earlier (when detecting an error
+	message), the rest of the output will merge accidently with the
+	output of the next command.  Reported by M Jared Finder
+	<jared@hpalace.com>.
+
+	* net/tramp-vc.el (vc-user-login-name): Wrap defadvice with a test
+	for `process-file', in order to let it work for older Emacsen too.
+
+2006-04-17  Ralf Angeli  <angeli@iwi.uni-sb.de>
+
+	* textmodes/tex-mode.el (tex-font-lock-match-suscript): New function.
+	(tex-font-lock-keywords-3): Use it.
+
+2006-04-16  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* newcomment.el (comment-add): New function.
+	(comment-region-default, comment-dwim): Use it.
+
+2006-04-15  Michael Olson  <mwolson@gnu.org>
+
+	* emacs-lisp/tq.el: Improve comments.
+	(tq-queue-head-question): New accessor function.
+	(tq-queue-head-regexp, tq-queue-head-closure, tq-queue-head-fn):
+	Update for modified queue structure.
+	(tq-queue-add): Accept `question' argument.
+	(tq-queue-pop): If a question is pending, send it.
+	(tq-enqueue): Accept new optional argument `delay-question'.
+	If this is non-nil, and at least one other question is pending a
+	response, queue the question rather than sending it immediately.
+
+2006-04-15  Roland Winkler  <Roland.Winkler@physik.uni-erlangen.de>
+
+	* calendar/appt.el (appt-add): Check whether an appointment is
+	already present in appt-time-msg-list.  Simplify code.
+
+2006-04-14  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* progmodes/cc-langs.el (c-mode-menu):
+	Don't presume c-subword-mode is bound.
+
+2006-04-13  Bill Wohler  <wohler@newt.com>
+
+	* cus-edit.el (customize-package-emacs-version-alist): Update docstring.
+	(customize-package-emacs-version): Use cdr instead of cadr now
+	that alists use dotted pairs.
+
+	* custom.el (defcustom): Fix docstring for :package-version.
+
+2006-04-13  Michael Albinus  <michael.albinus@gmx.de>
+
+	* net/tramp.el (tramp-display-shell-command-buffer): New defvar.
+	(tramp-handle-shell-command): Display output buffer only when
+	`tramp-display-shell-command-buffer' is true.
+	(tramp-handle-process-file): Set `tramp-display-shell-command-buffer'.
+
+2006-04-13  Carsten Dominik  <dominik@science.uva.nl>
+
+	* textmodes/org.el (org-set-autofill-regexps): Set only the local
+	values of `adaptive-fill-regexp' and `adaptive-fill-function'.
+
+2006-04-13  Romain Francoise  <romain@orebokech.com>
+
+	* pcvs-parse.el (cvs-parse-table): Use `with-temp-buffer' to avoid
+	leaving temporary .cvsignore buffers behind.
+
+2006-04-13  Carsten Dominik  <dominik@science.uva.nl>
+
+	* textmodes/org.el: (org-set-regexps-and-options)
+	(org-get-current-options): Better names for the startup folding
+	options.
+
+2006-04-13  Thien-Thi Nguyen  <ttn@gnu.org>
+
+	* vc.el (vc-annotate): Arrange for point to end up at the same
+	line number as in the original, but only when using a new buffer.
+
+2006-04-12  Davis Herring  <herring@lanl.gov>  (tiny change)
+
+	* files.el (hack-one-local-variable-eval-safep):
+	Recognize `edebug-form-spec' for `put', but only if it passes
+	`edebug-basic-spec'.  Generalize `put' handling.
+
+	* emacs-lisp/edebug.el (edebug-basic-spec): New function for
+	vetting file-local form specs.
+
+	* allout.el (allout-layout): Autoload its `safe-local-variable'
+	property.
+
+2006-04-13  Carsten Dominik  <dominik@science.uva.nl>
+
+	* textmodes/org.el: (org-ctrl-c-ctrl-c): Improve documentation string.
+	(org-agenda-mouse-1-follows-link)
+	(org-mouse-1-follows-link): New options.
+	(org-format-agenda-item): Fix bug if TAGS is nil.
+	(org-agenda-get-scheduled): Quote `priority' symbol in plist.
+
+2006-04-13  Nick Roberts  <nickrob@snap.net.nz>
+
+	* progmodes/gdb-ui.el (gdb-set-gud-minor-mode-existing-buffers):
+	GDB 6.1+ gives full filename for "info sources" so use
+	file-name-nondirectory.
+
+2006-04-12  Romain Francoise  <romain@orebokech.com>
+
+	* subr.el (read-passwd): Bind `message-log-max' to nil.
+
 2006-04-12  Stefan Monnier  <monnier@iro.umontreal.ca>
 
 	* progmodes/perl-mode.el (perl-indent-new-calculate):
@@ -2835,7 +3057,7 @@
 	(vc-default-update-changelog): Don't use vc-user-login-name, we
 	don't need it here.
 
-	* tramp-vc.el (vc-user-login-name): Comment out defadvice, it is
+	* net/tramp-vc.el (vc-user-login-name): Comment out defadvice, it is
 	no longer necessary.
 
 2006-01-25  Kenichi Handa  <handa@m17n.org>
--- a/lisp/abbrev.el	Wed Apr 12 17:40:36 2006 +0000
+++ b/lisp/abbrev.el	Wed Apr 19 16:23:46 2006 +0000
@@ -160,8 +160,10 @@
 (defun edit-abbrevs-redefine ()
   "Redefine abbrevs according to current buffer contents."
   (interactive)
-  (define-abbrevs t)
-  (set-buffer-modified-p nil))
+  (save-restriction
+    (widen)
+    (define-abbrevs t)
+    (set-buffer-modified-p nil)))
 
 (defun define-abbrevs (&optional arg)
   "Define abbrevs according to current visible buffer contents.
@@ -195,9 +197,12 @@
 Optional argument FILE is the name of the file to read;
 it defaults to the value of `abbrev-file-name'.
 Optional second argument QUIETLY non-nil means don't display a message."
-  (interactive "fRead abbrev file: ")
-  (load (if (and file (> (length file) 0)) file abbrev-file-name)
-	nil quietly)
+  (interactive
+   (list
+    (read-file-name (format "Read abbrev file (default %s): "
+			    abbrev-file-name)
+		    nil abbrev-file-name t)))
+  (load (or file abbrev-file-name) nil quietly)
   (setq abbrevs-changed nil))
 
 (defun quietly-read-abbrev-file (&optional file)
--- a/lisp/allout.el	Wed Apr 12 17:40:36 2006 +0000
+++ b/lisp/allout.el	Wed Apr 19 16:23:46 2006 +0000
@@ -666,6 +666,7 @@
 `allout-layout' can additionally have the value `t', in which
 case the value of `allout-default-layout' is used.")
 (make-variable-buffer-local 'allout-layout)
+;;;###autoload
 (put 'allout-layout 'safe-local-variable t)
 
 ;;;_  : Topic header format
--- a/lisp/apropos.el	Wed Apr 12 17:40:36 2006 +0000
+++ b/lisp/apropos.el	Wed Apr 19 16:23:46 2006 +0000
@@ -908,6 +908,7 @@
 	  ;; Calculate key-bindings if we want them.
 	  (and do-keys
 	       (commandp symbol)
+	       (not (eq symbol 'self-insert-command))
 	       (indent-to 30 1)
 	       (if (let ((keys
 			  (save-excursion
--- a/lisp/calendar/appt.el	Wed Apr 12 17:40:36 2006 +0000
+++ b/lisp/calendar/appt.el	Wed Apr 19 16:23:46 2006 +0000
@@ -498,11 +498,11 @@
   (interactive "sTime (hh:mm[am/pm]): \nsMessage: ")
   (unless (string-match appt-time-regexp new-appt-time)
     (error "Unacceptable time-string"))
-  (let* ((appt-time-string (concat new-appt-time " " new-appt-msg))
-         (appt-time (list (appt-convert-time new-appt-time)))
-         (time-msg (list appt-time appt-time-string t)))
-    (setq appt-time-msg-list (nconc appt-time-msg-list (list time-msg)))
-    (setq appt-time-msg-list (appt-sort-list appt-time-msg-list))))
+  (let ((time-msg (list (list (appt-convert-time new-appt-time))
+                        (concat new-appt-time " " new-appt-msg) t)))
+    (unless (member time-msg appt-time-msg-list)
+      (setq appt-time-msg-list
+            (appt-sort-list (nconc appt-time-msg-list (list time-msg)))))))
 
 ;;;###autoload
 (defun appt-delete ()
--- a/lisp/comint.el	Wed Apr 12 17:40:36 2006 +0000
+++ b/lisp/comint.el	Wed Apr 19 16:23:46 2006 +0000
@@ -465,6 +465,7 @@
     (define-key map "\C-c\C-l" 	  'comint-dynamic-list-input-ring)
     (define-key map "\C-c\C-n" 	  'comint-next-prompt)
     (define-key map "\C-c\C-p" 	  'comint-previous-prompt)
+    (define-key map "\C-c\C-j" 	  'comint-restore-input)
     (define-key map "\C-c\C-d" 	  'comint-send-eof)
     (define-key map "\C-c\C-s" 	  'comint-write-output)
     (define-key map "\C-c." 	  'comint-insert-previous-argument)
@@ -558,6 +559,9 @@
   "Non-nil if you are accumulating input lines to send as input together.
 The command \\[comint-accumulate] sets this.")
 
+(defvar comint-stored-incomplete-input nil
+  "Stored input for history cycling.")
+
 (put 'comint-replace-by-expanded-history 'menu-enable 'comint-input-autoexpand)
 (put 'comint-input-ring 'permanent-local t)
 (put 'comint-input-ring-index 'permanent-local t)
@@ -638,6 +642,7 @@
   (make-local-variable 'comint-scroll-to-bottom-on-input)
   (make-local-variable 'comint-move-point-for-output)
   (make-local-variable 'comint-scroll-show-maximum-output)
+  (make-local-variable 'comint-stored-incomplete-input)
   ;; This makes it really work to keep point at the bottom.
   (make-local-variable 'scroll-conservatively)
   (setq scroll-conservatively 10000)
@@ -1015,6 +1020,16 @@
 	(t
 	 arg)))
 
+(defun comint-restore-input ()
+  "Restore unfinished input."
+  (interactive)
+  (when comint-input-ring-index
+    (comint-delete-input)
+    (when (> (length comint-stored-incomplete-input) 0)
+      (insert comint-stored-incomplete-input)
+      (message "Input restored"))
+    (setq comint-input-ring-index nil)))
+
 (defun comint-search-start (arg)
   "Index to start a directional search, starting at `comint-input-ring-index'."
   (if comint-input-ring-index
@@ -1035,9 +1050,18 @@
 				arg)))
 
 (defun comint-previous-input (arg)
-  "Cycle backwards through input history."
+  "Cycle backwards through input history, saving input."
   (interactive "*p")
-  (comint-previous-matching-input "." arg))
+  (if (and comint-input-ring-index 
+	   (or		       ;; leaving the "end" of the ring
+	    (and (< arg 0)		; going down
+		 (eq comint-input-ring-index 0))
+	    (and (> arg 0)		; going up
+		 (eq comint-input-ring-index 
+		     (1- (ring-length comint-input-ring)))))
+	   comint-stored-incomplete-input)
+      (comint-restore-input)
+    (comint-previous-matching-input "." arg)))
 
 (defun comint-next-input (arg)
   "Cycle forwards through input history."
@@ -1077,6 +1101,14 @@
     (if (string-match regexp (ring-ref comint-input-ring n))
 	n)))
 
+(defun comint-delete-input ()
+  "Delete all input between accumulation or process mark and point."
+  (delete-region
+   ;; Can't use kill-region as it sets this-command
+   (or  (marker-position comint-accum-marker)
+	(process-mark (get-buffer-process (current-buffer))))
+   (point-max)))
+
 (defun comint-previous-matching-input (regexp n)
   "Search backwards through input history for match for REGEXP.
 \(Previous history elements are earlier commands.)
@@ -1088,13 +1120,13 @@
     ;; Has a match been found?
     (if (null pos)
 	(error "Not found")
+      ;; If leaving the edit line, save partial input
+      (if (null comint-input-ring-index)	;not yet on ring
+	  (setq comint-stored-incomplete-input
+		(funcall comint-get-old-input)))
       (setq comint-input-ring-index pos)
       (message "History item: %d" (1+ pos))
-      (delete-region
-       ;; Can't use kill-region as it sets this-command
-       (or  (marker-position comint-accum-marker)
-	    (process-mark (get-buffer-process (current-buffer))))
-       (point))
+      (comint-delete-input)
       (insert (ring-ref comint-input-ring pos)))))
 
 (defun comint-next-matching-input (regexp n)
--- a/lisp/complete.el	Wed Apr 12 17:40:36 2006 +0000
+++ b/lisp/complete.el	Wed Apr 19 16:23:46 2006 +0000
@@ -141,8 +141,6 @@
   "A list of the environment variable names and values.")
 
 
-(defvar PC-old-read-file-name-internal nil)
-
 (defun PC-bindings (bind)
   (let ((completion-map minibuffer-local-completion-map)
 	(must-match-map minibuffer-local-must-match-map))
@@ -219,21 +217,32 @@
 	((not PC-disable-includes)
 	 (add-hook 'find-file-not-found-functions 'PC-look-for-include-file)))
   ;; ... with some underhand redefining.
-  (cond ((and (not partial-completion-mode)
-	      (functionp PC-old-read-file-name-internal))
-	 (fset 'read-file-name-internal PC-old-read-file-name-internal))
-	((and (not PC-disable-includes) (not PC-old-read-file-name-internal))
-	 (setq PC-old-read-file-name-internal
-	       (symbol-function 'read-file-name-internal))
-	 (fset 'read-file-name-internal
-	       'PC-read-include-file-name-internal)))
-    (when (and partial-completion-mode (null PC-env-vars-alist))
-      (setq PC-env-vars-alist
-	    (mapcar (lambda (string)
-		      (let ((d (string-match "=" string)))
-			(cons (concat "$" (substring string 0 d))
-			      (and d (substring string (1+ d))))))
-		    process-environment))))
+  (cond ((not partial-completion-mode)
+         (ad-disable-advice 'read-file-name-internal 'around 'PC-include-file)
+         (ad-activate 'read-file-name-internal))
+	((not PC-disable-includes)
+         (ad-enable-advice 'read-file-name-internal 'around 'PC-include-file)
+         (ad-activate 'read-file-name-internal)))
+  ;; Adjust the completion selection in *Completion* buffers to the way
+  ;; we work.  The default minibuffer completion code only completes the
+  ;; text before point and leaves the text after point alone (new in
+  ;; Emacs-22).  In contrast we use the whole text and we even sometimes
+  ;; move point to a place before EOB, to indicate the first position where
+  ;; there's a difference, so when the user uses choose-completion, we have
+  ;; to trick choose-completion into replacing the whole minibuffer text
+  ;; rather than only the text before point.  --Stef
+  (funcall
+   (if partial-completion-mode 'add-hook 'remove-hook)
+   'choose-completion-string-functions
+   (lambda (&rest x) (goto-char (point-max)) nil))
+  ;; Build the env-completion and mapping table.
+  (when (and partial-completion-mode (null PC-env-vars-alist))
+    (setq PC-env-vars-alist
+          (mapcar (lambda (string)
+                    (let ((d (string-match "=" string)))
+                      (cons (concat "$" (substring string 0 d))
+                            (and d (substring string (1+ d))))))
+                  process-environment))))
 
 
 (defun PC-complete ()
@@ -930,20 +939,23 @@
 	  (setq sorted (cdr sorted)))
 	compressed))))
 
-(defun PC-read-include-file-name-internal (string dir action)
-  (if (string-match "<\\([^\"<>]*\\)>?$" string)
-      (let* ((name (substring string (match-beginning 1) (match-end 1)))
+(defadvice read-file-name-internal (around PC-include-file disable)
+  (if (string-match "<\\([^\"<>]*\\)>?\\'" (ad-get-arg 0))
+      (let* ((string (ad-get-arg 0))
+             (action (ad-get-arg 2))
+             (name (substring string (match-beginning 1) (match-end 1)))
 	     (str2 (substring string (match-beginning 0)))
 	     (completion-table
-	      (mapcar (function (lambda (x) (list (format "<%s>" x))))
+	      (mapcar (lambda (x) (format "<%s>" x))
 		      (PC-include-file-all-completions
 		       name (PC-include-file-path)))))
-	(cond
-	 ((not completion-table) nil)
-	 ((eq action nil) (try-completion str2 completion-table nil))
-	 ((eq action t) (all-completions str2 completion-table nil))
-	 ((eq action 'lambda) (test-completion str2 completion-table nil))))
-    (funcall PC-old-read-file-name-internal string dir action)))
+        (setq ad-return-value
+              (cond
+               ((not completion-table) nil)
+               ((eq action 'lambda) (test-completion str2 completion-table nil))
+               ((eq action nil) (try-completion str2 completion-table nil))
+               ((eq action t) (all-completions str2 completion-table nil)))))
+    ad-do-it))
 
 
 (provide 'complete)
--- a/lisp/cus-edit.el	Wed Apr 12 17:40:36 2006 +0000
+++ b/lisp/cus-edit.el	Wed Apr 19 16:23:46 2006 +0000
@@ -1082,14 +1082,29 @@
 ;; Packages will update this variable, so make it available.
 ;;;###autoload
 (defvar customize-package-emacs-version-alist nil
-  "Alist that maps packages to alists of package to Emacs versions.
-The value alists map all package versions used with
-the :package-version keyword to Emacs versions.  Packages are
-symbols and versions are strings.
-
-For example:
-  '((MH-E (\"7.4\" \"22.1\") (\"8.0\" \"22.1\"))
-    (Gnus (\"5.11\" \"22.1\")))")
+  "Alist mapping versions of Emacs to versions of a package.
+These package versions are listed in the :package-version
+keyword used in `defcustom', `defgroup', and `defface'. Its
+elements look like this:
+
+     (PACKAGE (PVERSION . EVERSION)...)
+
+For each PACKAGE, which is a symbol, there are one or more
+elements that contain a package version PVERSION with an
+associated Emacs version EVERSION.  These versions are strings.
+For example, the MH-E package updates this alist with the
+following:
+
+     (add-to-list 'customize-package-emacs-version-alist
+                  '(MH-E (\"6.0\" . \"22.1\") (\"6.1\" . \"22.1\")
+                         (\"7.0\" . \"22.1\") (\"7.1\" . \"22.1\")
+                         (\"7.2\" . \"22.1\") (\"7.3\" . \"22.1\")
+                         (\"7.4\" . \"22.1\") (\"8.0\" . \"22.1\")))
+
+The value of PACKAGE needs to be unique and it needs to match the
+PACKAGE value appearing in the :package-version keyword.  Since
+the user might see the value in a error message, a good choice is
+the official name of the package, such as MH-E or Gnus.")
 
 ;;;###autoload
 (defalias 'customize-changed 'customize-changed-options)
@@ -1154,7 +1169,7 @@
 
 (defun customize-package-emacs-version (symbol package-version)
   "Return Emacs version of SYMBOL.
-PACKAGE-VERSION has the form (PACKAGE VERSION).  The VERSION of
+PACKAGE-VERSION has the form (PACKAGE . VERSION).  The VERSION of
 PACKAGE is looked up in the associated list
 `customize-package-emacs-version-alist' to find the version of
 Emacs that is associated with it."
@@ -1167,9 +1182,10 @@
           ((setq package-versions (assq (car package-version)
                                         customize-package-emacs-version-alist))
            (setq emacs-version
-                 (cadr (assoc (cadr package-version) package-versions)))
+                 (cdr (assoc (cdr package-version) package-versions)))
            (unless emacs-version
-             (message "Package version of %s not found in %s" symbol
+             (message "%s version %s not found in %s" symbol
+                      (cdr package-version)
                       "customize-package-emacs-version-alist")))
           (t
            (message "Package %s neglected to update %s"
--- a/lisp/custom.el	Wed Apr 12 17:40:36 2006 +0000
+++ b/lisp/custom.el	Wed Apr 19 16:23:46 2006 +0000
@@ -272,11 +272,14 @@
         first introduced, or its default value was changed, in Emacs
         version VERSION.
 :package-version
-        VALUE should be a list with the form (PACKAGE VERSION)
+        VALUE should be a list with the form (PACKAGE . VERSION)
         specifying that the variable was first introduced, or its
         default value was changed, in PACKAGE version VERSION.  This
         keyword takes priority over :version.  The PACKAGE and VERSION
         must appear in the alist `customize-package-emacs-version-alist'.
+        Since PACKAGE must be unique and the user might see it in an
+        error message, a good choice is the official name of the
+        package, such as MH-E or Gnus.
 :tag LABEL
         Use LABEL, a string, instead of the item's name, to label the item
         in customization menus and buffers.
--- a/lisp/emacs-lisp/edebug.el	Wed Apr 12 17:40:36 2006 +0000
+++ b/lisp/emacs-lisp/edebug.el	Wed Apr 19 16:23:46 2006 +0000
@@ -258,6 +258,20 @@
     edebug-form-spec
     ))
 
+;;;###autoload
+(defun edebug-basic-spec (spec)
+  "Return t if SPEC uses only extant spec symbols.
+An extant spec symbol is a symbol that is not a function and has a
+`edebug-form-spec' property."
+  (cond ((listp spec)
+	 (catch 'basic
+	   (while spec
+	     (unless (edebug-basic-spec (car spec)) (throw 'basic nil))
+	     (setq spec (cdr spec)))
+	   t))
+	((symbolp spec)
+	 (unless (functionp spec) (get spec 'edebug-form-spec)))))
+
 ;;; Utilities
 
 ;; Define edebug-gensym - from old cl.el
--- a/lisp/emacs-lisp/find-func.el	Wed Apr 12 17:40:36 2006 +0000
+++ b/lisp/emacs-lisp/find-func.el	Wed Apr 19 16:23:46 2006 +0000
@@ -228,6 +228,14 @@
 	  (with-syntax-table emacs-lisp-mode-syntax-table
 	    (goto-char (point-min))
 	    (if (or (re-search-forward regexp nil t)
+                    ;; `regexp' matches definitions using known forms like
+                    ;; `defun', or `defvar'.  But some functions/variables
+                    ;; are defined using special macros (or functions), so
+                    ;; if `regexp' can't find the definition, we look for
+                    ;; something of the form "(SOMETHING <symbol> ...)".
+                    ;; This fails to distinguish function definitions from
+                    ;; variable declarations (or even uses thereof), but is
+                    ;; a good pragmatic fallback.
 		    (re-search-forward
 		     (concat "^([^ ]+" find-function-space-re "['(]?"
 			     (regexp-quote (symbol-name symbol))
--- a/lisp/emacs-lisp/tq.el	Wed Apr 12 17:40:36 2006 +0000
+++ b/lisp/emacs-lisp/tq.el	Wed Apr 19 16:23:46 2006 +0000
@@ -27,18 +27,56 @@
 
 ;;; Commentary:
 
-;; manages receiving a stream asynchronously,
-;; parsing it into transactions, and then calling
-;; handler functions
+;; This file manages receiving a stream asynchronously, parsing it
+;; into transactions, and then calling the associated handler function
+;; upon the completion of each transaction.
 
 ;; Our basic structure is the queue/process/buffer triple.  Each entry
-;; of the queue is a regexp/closure/function triple.  We buffer
-;; bytes from the process until we see the regexp at the head of the
-;; queue.  Then we call the function with the closure and the
-;; collected bytes.
+;; of the queue part is a list of question, regexp, closure, and
+;; function that is consed to the last element.
+
+;; A transaction queue may be created by calling `tq-create'.
+
+;; A request may be added to the queue by calling `tq-enqueue'.  If
+;; the `delay-question' argument is non-nil, we will wait to send the
+;; question to the process until it has finished sending other input.
+;; Otherwise, once a request is enqueued, we send the given question
+;; immediately to the process.
+
+;; We then buffer bytes from the process until we see the regexp that
+;; was provided in the call to `tq-enqueue'.  Then we call the
+;; provided function with the closure and the collected bytes.  If we
+;; have indicated that the question from the next transaction was not
+;; sent immediately, send it at this point, awaiting the response.
 
 ;;; Code:
 
+;;; Accessors
+
+;; This part looks like (queue . (process . buffer))
+(defun tq-queue               (tq) (car tq))
+(defun tq-process             (tq) (car (cdr tq)))
+(defun tq-buffer              (tq) (cdr (cdr tq)))
+
+;; The structure of `queue' is as follows
+;; ((question regexp closure . fn)
+;;  <other queue entries>)
+;; question: string to send to the process
+(defun tq-queue-head-question (tq) (car (car (tq-queue tq))))
+;; regexp: regular expression that matches the end of a response from
+;; the process
+(defun tq-queue-head-regexp   (tq) (car (cdr (car (tq-queue tq)))))
+;; closure: additional data to pass to function
+(defun tq-queue-head-closure  (tq) (car (cdr (cdr (car (tq-queue tq))))))
+;; fn: function to call upon receiving a complete response from the
+;; process
+(defun tq-queue-head-fn       (tq) (cdr (cdr (cdr (car (tq-queue tq))))))
+
+;; Determine whether queue is empty
+(defun tq-queue-empty         (tq) (not (tq-queue tq)))
+
+;;; Core functionality
+
 ;;;###autoload
 (defun tq-create (process)
   "Create and return a transaction queue communicating with PROCESS.
@@ -54,33 +92,37 @@
 			   (tq-filter ',tq string)))
     tq))
 
-;;; accessors
-(defun tq-queue   (tq) (car tq))
-(defun tq-process (tq) (car (cdr tq)))
-(defun tq-buffer  (tq) (cdr (cdr tq)))
-
-(defun tq-queue-add (tq re closure fn)
+(defun tq-queue-add (tq question re closure fn)
   (setcar tq (nconc (tq-queue tq)
-		    (cons (cons re (cons closure fn)) nil)))
+		    (cons (cons question (cons re (cons closure fn))) nil)))
   'ok)
 
-(defun tq-queue-head-regexp  (tq) (car (car (tq-queue tq))))
-(defun tq-queue-head-fn      (tq) (cdr (cdr (car (tq-queue tq)))))
-(defun tq-queue-head-closure (tq) (car (cdr (car (tq-queue tq)))))
-(defun tq-queue-empty        (tq) (not (tq-queue tq)))
-(defun tq-queue-pop          (tq) (setcar tq (cdr (car tq))) (null (car tq)))
+(defun tq-queue-pop (tq)
+  (setcar tq (cdr (car tq)))
+  (let ((question (tq-queue-head-question tq)))
+    (when question
+      (process-send-string (tq-process tq) question)))
+  (null (car tq)))
 
-
-;;; must add to queue before sending!
-(defun tq-enqueue (tq question regexp closure fn)
+(defun tq-enqueue (tq question regexp closure fn &optional delay-question)
   "Add a transaction to transaction queue TQ.
 This sends the string QUESTION to the process that TQ communicates with.
-When the corresponding answer comes back, we call FN
-with two arguments: CLOSURE, and the answer to the question.
+
+When the corresponding answer comes back, we call FN with two
+arguments: CLOSURE, which may contain additional data that FN
+needs, and the answer to the question.
+
 REGEXP is a regular expression to match the entire answer;
-that's how we tell where the answer ends."
-  (tq-queue-add tq regexp closure fn)
-  (process-send-string (tq-process tq) question))
+that's how we tell where the answer ends.
+
+If DELAY-QUESTION is non-nil, delay sending this question until
+the process has finished replying to any previous questions.
+This produces more reliable results with some processes."
+  (let ((sendp (or (not delay-question)
+		   (not (tq-queue-head-question tq)))))
+    (tq-queue-add tq (unless sendp question) regexp closure fn)
+    (when sendp
+      (process-send-string (tq-process tq) question))))
 
 (defun tq-close (tq)
   "Shut down transaction queue TQ, terminating the process."
--- a/lisp/env.el	Wed Apr 12 17:40:36 2006 +0000
+++ b/lisp/env.el	Wed Apr 19 16:23:46 2006 +0000
@@ -94,15 +94,10 @@
 
 ;; Fixme: Should the environment be recoded if LC_CTYPE &c is set?
 
-(defun setenv (variable &optional value unset substitute-env-vars frame)
+(defun setenv (variable &optional value substitute-env-vars frame)
   "Set the value of the environment variable named VARIABLE to VALUE.
 VARIABLE should be a string.  VALUE is optional; if not provided or
 nil, the environment variable VARIABLE will be removed.
-UNSET if non-nil means to remove VARIABLE from the environment.
-SUBSTITUTE-ENV-VARS, if non-nil, means to substitute environment
-variables in VALUE with `substitute-env-vars', where see.
-Value is the new value if VARIABLE, or nil if removed from the
-environment.
 
 Interactively, a prefix argument means to unset the variable, and
 otherwise the current value (if any) of the variable appears at
@@ -116,6 +111,13 @@
 belonging to the selected frame, depending on the value of
 `local-environment-variables'.
 
+SUBSTITUTE-ENV-VARS, if non-nil, means to substitute environment
+variables in VALUE with `substitute-env-vars', which see.
+This is normally used only for interactive calls.
+
+The return value is the new value of VARIABLE, or nil if
+it was removed from the environment.
+
 If optional parameter FRAME is non-nil, then it should be a a
 frame.  If the specified frame has its own set of environment
 variables, this function will modify VARIABLE in it.  Note that
@@ -127,7 +129,7 @@
 a side-effect."
   (interactive
    (if current-prefix-arg
-       (list (read-envvar-name "Clear environment variable: " 'exact) nil t)
+       (list (read-envvar-name "Clear environment variable: " 'exact) nil)
      (let* ((var (read-envvar-name "Set environment variable: " nil))
 	    (value (getenv var)))
        (when value
@@ -137,7 +139,6 @@
 	     (read-from-minibuffer (format "Set %s to value: " var)
 				   nil nil nil 'setenv-history
 				   value)
-	     nil
 	     t))))
   (if (and (multibyte-string-p variable) locale-coding-system)
       (let ((codings (find-coding-systems-string (concat variable value))))
@@ -145,10 +146,9 @@
 		    (memq (coding-system-base locale-coding-system) codings))
 	  (error "Can't encode `%s=%s' with `locale-coding-system'"
 		 variable (or value "")))))
-  (if unset
-      (setq value nil)
-    (if substitute-env-vars
-	(setq value (substitute-env-vars value))))
+  (and value
+       substitute-env-vars
+       (setq value (substitute-env-vars value)))
   (if (multibyte-string-p variable)
       (setq variable (encode-coding-string variable locale-coding-system)))
   (if (and value (multibyte-string-p value))
--- a/lisp/files.el	Wed Apr 12 17:40:36 2006 +0000
+++ b/lisp/files.el	Wed Apr 19 16:23:46 2006 +0000
@@ -452,6 +452,8 @@
 \(When you say yes to certain values, they are remembered as safe.)
 
 :safe means set the safe variables, and ignore the rest.
+:all means set all variables, whether safe or not.
+ (Don't set it permanently to :all.)
 nil means always ignore the file local variables.
 
 Any other value means always query you once whether to set them all.
@@ -464,8 +466,9 @@
 The command \\[normal-mode], when used interactively,
 always obeys file local variable specifications and the -*- line,
 and ignores this variable."
-  :type '(choice (const :tag "Obey" t)
+  :type '(choice (const :tag "Query Unsafe" t)
 		 (const :tag "Safe Only" :safe)
+		 (const :tag "Do all" :all)
 		 (const :tag "Ignore" nil)
 		 (other :tag "Query" other))
   :group 'find-file)
@@ -2283,6 +2286,7 @@
 	default-text-properties
 	display-time-string
 	enable-local-eval
+	enable-local-variables
 	eval
 	exec-directory
 	exec-path
@@ -2319,6 +2323,8 @@
 	parse-time-rules
 	process-environment
 	rmail-output-file-alist
+	safe-local-variable-values
+	safe-local-eval-forms
 	save-some-buffers-action-alist
 	special-display-buffer-names
 	standard-input
@@ -2356,9 +2362,11 @@
 	    (c-indent-level     .  integerp)
 	    (comment-column     .  integerp)
 	    (compile-command    .  string-or-null-p)
+	    (find-file-visit-truename . t)
 	    (fill-column        .  integerp)
 	    (fill-prefix        .  string-or-null-p)
 	    (indent-tabs-mode   .  t)
+	    (kept-old-versions  .  integerp)
 	    (kept-new-versions  .  integerp)
 	    (left-margin        .  t)
 	    (no-byte-compile    .  t)
@@ -2631,6 +2639,7 @@
 	      (if (or (and (eq enable-local-variables t)
 			   (null unsafe-vars)
 			   (null risky-vars))
+		      (eq enable-local-variables :all)
 		      (hack-local-variables-confirm
 		       result unsafe-vars risky-vars))
 		  (dolist (elt result)
@@ -2690,12 +2699,14 @@
       (and (eq (car exp) 'put)
 	   (hack-one-local-variable-quotep (nth 1 exp))
 	   (hack-one-local-variable-quotep (nth 2 exp))
-	   (memq (nth 1 (nth 2 exp))
-		 '(lisp-indent-hook))
-	   ;; Only allow safe values of lisp-indent-hook;
-	   ;; not functions.
-	   (or (numberp (nth 3 exp))
-	       (equal (nth 3 exp) ''defun)))
+	   (let ((prop (nth 1 (nth 2 exp))) (val (nth 3 exp)))
+	     (cond ((eq prop 'lisp-indent-hook)
+		    ;; Only allow safe values of lisp-indent-hook;
+		    ;; not functions.
+		    (or (numberp val) (equal val ''defun)))
+		   ((eq prop 'edebug-form-spec)
+		    ;; Only allow indirect form specs.
+		    (edebug-basic-spec val)))))
       ;; Allow expressions that the user requested.
       (member exp safe-local-eval-forms)
       ;; Certain functions can be allowed with safe arguments
--- a/lisp/gnus/ChangeLog	Wed Apr 12 17:40:36 2006 +0000
+++ b/lisp/gnus/ChangeLog	Wed Apr 19 16:23:46 2006 +0000
@@ -1,3 +1,52 @@
+2006-04-17  Reiner Steib  <Reiner.Steib@gmx.de>
+
+	[ Merge from Gnus trunk. ]
+
+	* mm-util.el (mm-charset-synonym-alist): Improve doc string.
+	(mm-charset-override-alist): New variable.
+	(mm-charset-to-coding-system): Use it.
+	(mm-codepage-setup): New helper function.
+	(mm-charset-eval-alist): New variable.
+	(mm-charset-to-coding-system): Use mm-charset-eval-alist.  Warn
+	about unknown charsets.  Add allow-override.  Use
+	`mm-charset-override-alist' only when decoding.
+	(mm-detect-mime-charset-region): Use :mime-charset.
+
+	* mm-bodies.el (mm-decode-body, mm-decode-string): Call
+	`mm-charset-to-coding-system' with allow-override argument.
+
+	* message.el (message-tool-bar-zap-list, message-tool-bar)
+	(message-tool-bar-gnome, message-tool-bar-retro): New variables.
+	(message-tool-bar-local-item-from-menu): Remove.
+	(message-tool-bar-map): Replace by `message-make-tool-bar'.
+	(message-make-tool-bar): New function.
+	(message-mode): Use `message-make-tool-bar'.
+
+	* gnus-sum.el (gnus-summary-tool-bar)
+	(gnus-summary-tool-bar-gnome, gnus-summary-tool-bar-retro)
+	(gnus-summary-tool-bar-zap-list): New variables.
+	(gnus-summary-make-tool-bar): Complete rewrite using
+	`gmm-tool-bar-from-list'.
+
+	* gnus-group.el (gnus-group-tool-bar, gnus-group-tool-bar-gnome)
+	(gnus-group-tool-bar-retro, gnus-group-tool-bar-zap-list): New
+	variables.
+	(gnus-group-make-tool-bar): Complete rewrite using
+	`gmm-tool-bar-from-list'.
+	(gnus-group-tool-bar-update): New function.
+
+	* gmm-utils.el: New file.
+
+2006-04-12  Ralf Angeli  <angeli@iwi.uni-sb.de>
+
+	* flow-fill.el (fill-flowed): Remove trailing space from blank
+	quoted lines.
+
+2006-04-12  Reiner Steib  <Reiner.Steib@gmx.de>
+
+	* gnus-art.el (gnus-article-mode): Set
+	cursor-in-non-selected-windows to nil.
+
 2006-04-12  Katsumi Yamaoka  <yamaoka@jpl.org>
 
 	* gnus-art.el (gnus-mime-view-part-as-charset): Ignore charset
@@ -12,13 +61,6 @@
 	* gnus-uu.el (gnus-uu-save-article): Put mml tags instead of part
 	tag to summarized topics part in order to encode non-ASCII text.
 
-2006-04-12  Kenichi Handa  <handa@m17n.org>
-
-	* rfc2231.el (rfc2231-decode-encoded-string): Work on unibyte
-	buffer and then decode the buffer text if necessary.
-	(rfc2231-encode-string): Be sure to work on multibyte buffer at
-	first, and after mm-encode-body, change the buffer to unibyte.
-
 2006-04-11  Reiner Steib  <Reiner.Steib@gmx.de>
 
 	* gnus-art.el (gnus-button-valid-localpart-regexp): Exclude `@'.
--- a/lisp/gnus/flow-fill.el	Wed Apr 12 17:40:36 2006 +0000
+++ b/lisp/gnus/flow-fill.el	Wed Apr 19 16:23:46 2006 +0000
@@ -114,7 +114,7 @@
     (set-buffer (or (current-buffer) buffer))
     (goto-char (point-min))
     ;; Remove space stuffing.
-    (while (re-search-forward "^ " nil t)
+    (while (re-search-forward "^\\( \\|>+ $\\)" nil t)
       (delete-char -1)
       (forward-line 1))
     (goto-char (point-min))
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lisp/gnus/gmm-utils.el	Wed Apr 19 16:23:46 2006 +0000
@@ -0,0 +1,413 @@
+;;; gmm-utils.el --- Utility functions for Gnus, Message and MML
+
+;; Copyright (C) 2006 Free Software Foundation, Inc.
+
+;; Author: Reiner Steib <reiner.steib@gmx.de>
+;; Keywords: news
+
+;; 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 library provides self-contained utility functions.  The functions are
+;; used in Gnus, Message and MML, but within this library there are no
+;; dependencies on Gnus, Message, or MML or Gnus.
+
+;;; Code:
+
+;; (require 'wid-edit)
+
+(defgroup gmm nil
+  "Utility functions for Gnus, Message and MML"
+  :prefix "gmm-"
+  :version "23.0" ;; No Gnus
+  :group 'lisp)
+
+;; Helper functions from `gnus-utils.el': gmm-verbose, gmm-message, gmm-error
+
+(defcustom gmm-verbose 7
+  "Integer that says how verbose gmm should be.
+The higher the number, the more messages will flash to say what
+it done.  At zero, it will be totally mute; at five, it will
+display most important messages; and at ten, it will keep on
+jabbering all the time."
+  :type 'integer
+  :group 'gmm)
+
+;;;###autoload
+(defun gmm-message (level &rest args)
+  "If LEVEL is lower than `gmm-verbose' print ARGS using `message'.
+
+Guideline for numbers:
+1 - error messages, 3 - non-serious error messages, 5 - messages for things
+that take a long time, 7 - not very important messages on stuff, 9 - messages
+inside loops."
+  (if (<= level gmm-verbose)
+      (apply 'message args)
+    ;; We have to do this format thingy here even if the result isn't
+    ;; shown - the return value has to be the same as the return value
+    ;; from `message'.
+    (apply 'format args)))
+
+;;;###autoload
+(defun gmm-error (level &rest args)
+  "Beep an error if LEVEL is equal to or less than `gmm-verbose'.
+ARGS are passed to `message'."
+  (when (<= (floor level) gmm-verbose)
+    (apply 'message args)
+    (ding)
+    (let (duration)
+      (when (and (floatp level)
+		 (not (zerop (setq duration (* 10 (- level (floor level)))))))
+	(sit-for duration))))
+  nil)
+
+;;;###autoload
+(defun gmm-widget-p (symbol)
+  "Non-nil iff SYMBOL is a widget."
+  (get symbol 'widget-type))
+
+;; Copy of the `nnmail-lazy' code from `nnmail.el':
+(define-widget 'gmm-lazy 'default
+  "Base widget for recursive datastructures.
+
+This is copy of the `lazy' widget in Emacs 22.1 provided for compatibility."
+  :format "%{%t%}: %v"
+  :convert-widget 'widget-value-convert-widget
+  :value-create (lambda (widget)
+                  (let ((value (widget-get widget :value))
+                        (type (widget-get widget :type)))
+                    (widget-put widget :children
+                                (list (widget-create-child-value
+                                       widget (widget-convert type) value)))))
+  :value-delete 'widget-children-value-delete
+  :value-get (lambda (widget)
+               (widget-value (car (widget-get widget :children))))
+  :value-inline (lambda (widget)
+                  (widget-apply (car (widget-get widget :children))
+                                :value-inline))
+  :default-get (lambda (widget)
+                 (widget-default-get
+                  (widget-convert (widget-get widget :type))))
+  :match (lambda (widget value)
+           (widget-apply (widget-convert (widget-get widget :type))
+                         :match value))
+  :validate (lambda (widget)
+              (widget-apply (car (widget-get widget :children)) :validate)))
+
+;; Note: The format of `gmm-tool-bar-item' may change if some future Emacs
+;; version will provide customizable tool bar buttons using a different
+;; interface.
+
+;; TODO: Extend API so that the "Command" entry can be a function or a plist.
+;; In case of a list it should have the format...
+;;
+;;  (:none command-without-modifier
+;;   :shift command-with-shift-pressed
+;;   :control command-with-ctrl-pressed
+;;   :control-shift command-with-control-and-shift-pressed
+;;   ;; mouse-2 and mouse-3 can't be used in Emacs yet.
+;;   :mouse-2 command-on-mouse-2-press
+;;   :mouse-3 command-on-mouse-3-press) ;; typically a menu of related commands
+;;
+;; Combinations of mouse-[23] plus shift and/or controll might be overkill.
+;;
+;; Then use (plist-get rs-command :none), (plist-get rs-command :shift)
+
+(define-widget 'gmm-tool-bar-item (if (gmm-widget-p 'lazy) 'lazy 'gmm-lazy)
+  "Tool bar list item."
+  :tag "Tool bar item"
+  :type '(choice
+	  (list :tag "Command and Icon"
+		(function :tag "Command")
+		(string :tag "Icon file")
+		(choice
+		 (const :tag "Default map" nil)
+		 ;; Note: Usually we need non-nil attributes if map is t.
+		 (const :tag "No menu" t)
+		 (sexp :tag "Other map"))
+		(plist :inline t :tag "Properties"))
+	  (list :tag "Separator"
+		(const :tag "No command" gmm-ignore)
+		(string :tag "Icon file")
+		(const :tag "No map")
+		(plist :inline t :tag "Properties"))))
+
+(define-widget 'gmm-tool-bar-zap-list (if (gmm-widget-p 'lazy) 'lazy 'gmm-lazy)
+  "Tool bar zap list."
+  :tag "Tool bar zap list"
+  :type '(choice (const :tag "Zap all" t)
+		 (const :tag "Keep all" nil)
+		 (list
+		  ;; :value
+		  ;; Work around (bug in customize?), see
+		  ;; <news:v9is48jrj1.fsf@marauder.physik.uni-ulm.de>
+		  ;; (new-file open-file dired kill-buffer write-file
+		  ;; 	    print-buffer customize help)
+		  (set :inline t
+		       (const new-file)
+		       (const open-file)
+		       (const dired)
+		       (const kill-buffer)
+		       (const save-buffer)
+		       (const write-file)
+		       (const undo)
+		       (const cut)
+		       (const copy)
+		       (const paste)
+		       (const search-forward)
+		       (const print-buffer)
+		       (const customize)
+		       (const help))
+		  (repeat :inline t
+			  :tag "Other"
+			  (symbol :tag "Icon item")))))
+
+;; (defun gmm-color-cells (&optional display)
+;;   "Return the number of color cells supported by DISPLAY.
+;; Compatibility function."
+;;   ;; `display-color-cells' doesn't return more than 256 even if color depth is
+;;   ;; > 8 in Emacs 21.
+;;   ;;
+;;   ;; Feel free to add proper XEmacs support.
+;;   (let* ((cells (and (fboundp 'display-color-cells)
+;; 		     (display-color-cells display)))
+;; 	 (plane (and (fboundp 'x-display-planes)
+;; 		     (ash 1 (x-display-planes))))
+;; 	 (none -1))
+;;     (max (if (integerp cells) cells none)
+;; 	 (if (integerp plane) plane none))))
+
+(defcustom gmm-tool-bar-style
+  (if (and (boundp 'tool-bar-mode)
+	   tool-bar-mode
+	   (and (fboundp 'display-visual-class)
+		(not (memq (display-visual-class)
+			   (list 'static-gray 'gray-scale
+				 'static-color 'pseudo-color)))))
+      'gnome
+    'retro)
+  "Prefered tool bar style."
+  :type '(choice (const :tag "GNOME style" 'gnome)
+		 (const :tag "Retro look"  'retro))
+  :group 'gmm)
+
+(defvar tool-bar-map)
+
+;;;###autoload
+(defun gmm-tool-bar-from-list (icon-list zap-list default-map)
+  "Make a tool bar from ICON-LIST.
+
+Within each entry of ICON-LIST, the first element is a menu
+command, the second element is an icon file name and the third
+element is a test function.  You can use \\[describe-key]
+<menu-entry> to find out the name of a menu command.  The fourth
+and all following elements are passed a the PROPS argument to the
+function `tool-bar-local-item'.
+
+If ZAP-LIST is a list, remove those item from the default
+`tool-bar-map'.  If it is t, start with a new sparse map.  You
+can use \\[describe-key] <icon> to find out the name of an icon
+item.  When \\[describe-key] <icon> shows \"<tool-bar> <new-file>
+runs the command find-file\", then use `new-file' in ZAP-LIST.
+
+DEFAULT-MAP specifies the default key map for ICON-LIST."
+  (let (;; For Emacs 21, we must let-bind `tool-bar-map'.  In Emacs 22, we
+	;; could use some other local variable.
+	(tool-bar-map (if (eq zap-list t)
+			  (make-sparse-keymap)
+			(copy-keymap tool-bar-map))))
+    (when (listp zap-list)
+      ;; Zap some items which aren't relevant for this mode and take up space.
+      (dolist (key zap-list)
+	(define-key tool-bar-map (vector key) nil)))
+    (mapc (lambda (el)
+	    (let ((command (car el))
+		  (icon (nth 1 el))
+		  (fmap (or (nth 2 el) default-map))
+		  (props  (cdr (cdr (cdr el)))) )
+	      ;; command may stem from different from-maps:
+	      (cond ((eq command 'gmm-ignore)
+		     ;; The dummy `gmm-ignore', see `gmm-tool-bar-item'
+		     ;; widget.  Suppress tooltip by adding `:enable nil'.
+		     (if (fboundp 'tool-bar-local-item)
+			 (apply 'tool-bar-local-item icon nil nil
+				tool-bar-map :enable nil props)
+		       ;; (tool-bar-local-item ICON DEF KEY MAP &rest PROPS)
+		       ;; (tool-bar-add-item ICON DEF KEY &rest PROPS)
+		       (apply 'tool-bar-add-item icon nil nil :enable nil props)))
+		    ((equal fmap t) ;; Not a menu command
+		     (if (fboundp 'tool-bar-local-item)
+			 (apply 'tool-bar-local-item
+				icon command
+				(intern icon) ;; reuse icon or fmap here?
+				tool-bar-map props)
+		       ;; Emacs 21 compatibility:
+		       (apply 'tool-bar-add-item
+			      icon command
+			      (intern icon)
+			      props)))
+		    (t ;; A menu command
+		     (if (fboundp 'tool-bar-local-item-from-menu)
+			 (apply 'tool-bar-local-item-from-menu
+				;; (apply 'tool-bar-local-item icon def key
+				;; tool-bar-map props)
+				command icon tool-bar-map (symbol-value fmap)
+				props)
+		       ;; Emacs 21 compatibility:
+		       (apply 'tool-bar-add-item-from-menu
+			      command icon (symbol-value fmap)
+			      props))))
+	      t))
+	  (if (symbolp icon-list)
+	      (eval icon-list)
+	    icon-list))
+    tool-bar-map))
+
+;; WARNING: The following is subject to change.  Don't rely on it yet.
+
+;; From MH-E without modifications:
+
+(defmacro gmm-defun-compat (name function arg-list &rest body)
+  "Create function NAME.
+If FUNCTION exists, then NAME becomes an alias for FUNCTION.
+Otherwise, create function NAME with ARG-LIST and BODY."
+  (let ((defined-p (fboundp function)))
+    (if defined-p
+        `(defalias ',name ',function)
+      `(defun ,name ,arg-list ,@body))))
+
+(gmm-defun-compat gmm-image-search-load-path
+  image-search-load-path (file &optional path)
+  "Emacs 21 and XEmacs don't have `image-search-load-path'.
+This function returns nil on those systems."
+  nil)
+
+;; From MH-E with modifications:
+
+;; Don't use `gmm-defun-compat' until API changes in
+;; `image-load-path-for-library' in Emacs CVS are completed.
+
+(defun gmm-image-load-path-for-library (library image &optional path no-error)
+  "Return a suitable search path for images relative to LIBRARY.
+
+First it searches for IMAGE in `image-load-path' (excluding
+\"`data-directory'/images\") and `load-path', followed by a path
+suitable for LIBRARY, which includes \"../../etc/images\" and
+\"../etc/images\" relative to the library file itself, and then
+in \"`data-directory'/images\".
+
+Then this function returns a list of directories which contains
+first the directory in which IMAGE was found, followed by the
+value of `load-path'. If PATH is given, it is used instead of
+`load-path'.
+
+If NO-ERROR is non-nil and a suitable path can't be found, don't
+signal an error. Instead, return a list of directories as before,
+except that nil appears in place of the image directory.
+
+Here is an example that uses a common idiom to provide
+compatibility with versions of Emacs that lack the variable
+`image-load-path':
+
+    ;; Shush compiler.
+    (defvar image-load-path)
+
+    (let* ((load-path (image-load-path-for-library \"mh-e\" \"mh-logo.xpm\"))
+           (image-load-path (cons (car load-path)
+                                  (when (boundp 'image-load-path)
+                                    image-load-path))))
+      (mh-tool-bar-folder-buttons-init))"
+  (unless library (error "No library specified"))
+  (unless image   (error "No image specified"))
+  (let (image-directory image-directory-load-path)
+    ;; Check for images in image-load-path or load-path.
+    (let ((img image)
+          (dir (or
+                ;; Images in image-load-path.
+                (gmm-image-search-load-path image) ;; "gmm-" prefix!
+                ;; Images in load-path.
+                (locate-library image)))
+          parent)
+      ;; Since the image might be in a nested directory (for
+      ;; example, mail/attach.pbm), adjust `image-directory'
+      ;; accordingly.
+      (when dir
+        (setq dir (file-name-directory dir))
+        (while (setq parent (file-name-directory img))
+          (setq img (directory-file-name parent)
+                dir (expand-file-name "../" dir))))
+      (setq image-directory-load-path dir))
+
+    ;; If `image-directory-load-path' isn't Emacs' image directory,
+    ;; it's probably a user preference, so use it. Then use a
+    ;; relative setting if possible; otherwise, use
+    ;; `image-directory-load-path'.
+    (cond
+     ;; User-modified image-load-path?
+     ((and image-directory-load-path
+           (not (equal image-directory-load-path
+                       (file-name-as-directory
+                        (expand-file-name "images" data-directory)))))
+      (setq image-directory image-directory-load-path))
+     ;; Try relative setting.
+     ((let (library-name d1ei d2ei)
+        ;; First, find library in the load-path.
+        (setq library-name (locate-library library))
+        (if (not library-name)
+            (error "Cannot find library %s in load-path" library))
+        ;; And then set image-directory relative to that.
+        (setq
+         ;; Go down 2 levels.
+         d2ei (file-name-as-directory
+               (expand-file-name
+                (concat (file-name-directory library-name) "../../etc/images")))
+         ;; Go down 1 level.
+         d1ei (file-name-as-directory
+               (expand-file-name
+                (concat (file-name-directory library-name) "../etc/images"))))
+        (setq image-directory
+              ;; Set it to nil if image is not found.
+              (cond ((file-exists-p (expand-file-name image d2ei)) d2ei)
+                    ((file-exists-p (expand-file-name image d1ei)) d1ei)))))
+     ;; Use Emacs' image directory.
+     (image-directory-load-path
+      (setq image-directory image-directory-load-path))
+     (no-error
+      (message "Could not find image %s for library %s" image library))
+     (t
+      (error "Could not find image %s for library %s" image library)))
+
+    ;; Return an augmented `path' or `load-path'.
+    (nconc (list image-directory)
+           (delete image-directory (copy-sequence (or path load-path))))))
+
+(defun gmm-customize-mode (&optional mode)
+  "Customize customization group for MODE.
+If mode is nil, use `major-mode' of the curent buffer."
+  (interactive)
+  (customize-group
+   (or mode
+       (intern (let ((mode (symbol-name major-mode)))
+		 (string-match "^\\(.+\\)-mode$" mode)
+		 (match-string 1 mode))))))
+
+(provide 'gmm-utils)
+
+;; arch-tag: e0b60920-2ce6-40c1-bfc0-cadbbe26b602
+;;; gmm-utils.el ends here
--- a/lisp/gnus/gnus-art.el	Wed Apr 12 17:40:36 2006 +0000
+++ b/lisp/gnus/gnus-art.el	Wed Apr 19 16:23:46 2006 +0000
@@ -3809,6 +3809,7 @@
   (make-local-variable 'gnus-article-ignored-charsets)
   ;; Prevent recent Emacsen from displaying non-break space as "\ ".
   (set (make-local-variable 'nobreak-char-display) nil)
+  (setq cursor-in-non-selected-windows nil)
   (gnus-set-default-directory)
   (buffer-disable-undo)
   (setq buffer-read-only t)
--- a/lisp/gnus/gnus-group.el	Wed Apr 12 17:40:36 2006 +0000
+++ b/lisp/gnus/gnus-group.el	Wed Apr 19 16:23:46 2006 +0000
@@ -39,6 +39,7 @@
 (require 'gnus-range)
 (require 'gnus-win)
 (require 'gnus-undo)
+(require 'gmm-utils)
 (require 'time-date)
 (require 'gnus-ems)
 
@@ -979,36 +980,135 @@
 
     (gnus-run-hooks 'gnus-group-menu-hook)))
 
-(defvar gnus-group-toolbar-map nil)
-
-;; Emacs 21 tool bar.  Should be no-op otherwise.
-(defun gnus-group-make-tool-bar ()
-  (if (and
-       (condition-case nil (require 'tool-bar) (error nil))
-       (fboundp 'tool-bar-add-item-from-menu)
-       (default-value 'tool-bar-mode)
-       (not gnus-group-toolbar-map))
-      (setq gnus-group-toolbar-map
-	    (let ((tool-bar-map (make-sparse-keymap))
-		  (load-path (mm-image-load-path)))
-	      (tool-bar-add-item-from-menu
-	       'gnus-group-get-new-news "get-news" gnus-group-mode-map)
-	      (tool-bar-add-item-from-menu
-	       'gnus-group-get-new-news-this-group "gnntg" gnus-group-mode-map)
-	      (tool-bar-add-item-from-menu
-	       'gnus-group-catchup-current "catchup" gnus-group-mode-map)
-	      (tool-bar-add-item-from-menu
-	       'gnus-group-describe-group "describe-group" gnus-group-mode-map)
-	      (tool-bar-add-item "subscribe" 'gnus-group-subscribe 'subscribe
-				 :help "Subscribe to the current group")
-	      (tool-bar-add-item "unsubscribe" 'gnus-group-unsubscribe
-				 'unsubscribe
-				 :help "Unsubscribe from the current group")
-	      (tool-bar-add-item-from-menu
-	       'gnus-group-exit "exit-gnus" gnus-group-mode-map)
-	      tool-bar-map)))
-  (if gnus-group-toolbar-map
-      (set (make-local-variable 'tool-bar-map) gnus-group-toolbar-map)))
+
+(defvar gnus-group-tool-bar-map nil)
+
+(defun gnus-group-tool-bar-update (&optional symbol value)
+  "Update group buffer toolbar.
+Setter function for custom variables."
+  (when symbol
+    (set-default symbol value))
+  ;; (setq-default gnus-group-tool-bar-map nil)
+  ;; (use-local-map gnus-group-mode-map)
+  (when (gnus-alive-p)
+    (with-current-buffer gnus-group-buffer
+      (gnus-group-make-tool-bar t))))
+
+(defcustom gnus-group-tool-bar (if (eq gmm-tool-bar-style 'gnome)
+				   'gnus-group-tool-bar-gnome
+				 'gnus-group-tool-bar-retro)
+  "Specifies the Gnus group tool bar.
+
+It can be either a list or a symbol refering to a list.  See
+`gmm-tool-bar-from-list' for the format of the list.  The
+default key map is `gnus-group-mode-map'.
+
+Pre-defined symbols include `gnus-group-tool-bar-gnome' and
+`gnus-group-tool-bar-retro'."
+  :type '(choice (const :tag "GNOME style" gnus-group-tool-bar-gnome)
+		 (const :tag "Retro look" gnus-group-tool-bar-retro)
+		 (repeat :tag "User defined list" gmm-tool-bar-item)
+		 (symbol))
+  :version "22.1" ;; Gnus 5.10.9
+  :initialize 'custom-initialize-default
+  :set 'gnus-group-tool-bar-update
+  :group 'gnus-group)
+
+(defcustom gnus-group-tool-bar-gnome
+  '((gnus-group-post-news "mail/compose")
+    ;; Some useful agent icons?  I don't use the agent so agent users should
+    ;; suggest useful commands:
+    (gnus-agent-toggle-plugged "connect" t
+     			       :visible (and gnus-agent (not gnus-plugged)))
+    (gnus-agent-toggle-plugged "disconnect" t
+     			       :visible (and gnus-agent gnus-plugged))
+    ;; FIXME: gnus-agent-toggle-plugged (in gnus-agent-group-make-menu-bar)
+    ;; should have a better help text.
+    (gnus-group-send-queue "mail/outbox" t
+			   :visible (and gnus-agent gnus-plugged)
+			   :help "Send articles from the queue group")
+    (gnus-group-get-new-news "mail/inbox" nil
+			     :visible (or (not gnus-agent)
+					  gnus-plugged))
+    ;; FIXME: gnus-*-read-group should have a better help text.
+    (gnus-topic-read-group "open" nil
+			   :visible (and (boundp 'gnus-topic-mode)
+					 gnus-topic-mode))
+    (gnus-group-read-group "open" nil
+			   :visible (not (and (boundp 'gnus-topic-mode)
+					      gnus-topic-mode)))
+    ;; (gnus-group-find-new-groups "???" nil)
+    (gnus-group-save-newsrc "save")
+    (gnus-group-describe-group "describe")
+    (gnus-group-unsubscribe-current-group "gnus/toggle-subscription")
+    (gnus-group-prev-unread-group "left-arrow")
+    (gnus-group-next-unread-group "right-arrow")
+    (gnus-group-exit "exit")
+    (gmm-customize-mode "preferences" t :help "Edit mode preferences")
+    (gnus-info-find-node "help"))
+  "List of functions for the group tool bar (GNOME style).
+
+See `gmm-tool-bar-from-list' for the format of the list."
+  :type '(repeat gmm-tool-bar-item)
+  :version "22.1" ;; Gnus 5.10.9
+  :initialize 'custom-initialize-default
+  :set 'gnus-group-tool-bar-update
+  :group 'gnus-group)
+
+(defcustom gnus-group-tool-bar-retro
+  '((gnus-group-get-new-news "gnus/get-news")
+    (gnus-group-get-new-news-this-group "gnus/gnntg")
+    (gnus-group-catchup-current "gnus/catchup")
+    (gnus-group-describe-group "gnus/describe-group")
+    (gnus-group-subscribe "gnus/subscribe" t
+			  :help "Subscribe to the current group")
+    (gnus-group-unsubscribe "gnus/unsubscribe" t
+			    :help "Unsubscribe from the current group")
+    (gnus-group-exit "gnus/exit-gnus" gnus-group-mode-map))
+  "List of functions for the group tool bar (retro look).
+
+See `gmm-tool-bar-from-list' for the format of the list."
+  :type '(repeat gmm-tool-bar-item)
+  :version "22.1" ;; Gnus 5.10.9
+  :initialize 'custom-initialize-default
+  :set 'gnus-group-tool-bar-update
+  :group 'gnus-group)
+
+(defcustom gnus-group-tool-bar-zap-list t
+  "List of icon items from the global tool bar.
+These items are not displayed in the Gnus group mode tool bar.
+
+See `gmm-tool-bar-from-list' for the format of the list."
+  :type 'gmm-tool-bar-zap-list
+  :version "22.1" ;; Gnus 5.10.9
+  :initialize 'custom-initialize-default
+  :set 'gnus-group-tool-bar-update
+  :group 'gnus-group)
+
+(defvar image-load-path)
+
+(defun gnus-group-make-tool-bar (&optional force)
+  "Make a group mode tool bar from `gnus-group-tool-bar'.
+When FORCE, rebuild the tool bar."
+  (when (and (not (featurep 'xemacs))
+	     (boundp 'tool-bar-mode)
+	     tool-bar-mode
+	     ;; The Gnus 5.10.6 code checked (default-value 'tool-bar-mode).
+	     ;; Why?  --rsteib
+	     (or (not gnus-group-tool-bar-map) force))
+    (let* ((load-path
+	    (gmm-image-load-path-for-library "gnus"
+					     "gnus/toggle-subscription.xpm"
+					     nil t))
+           (image-load-path (cons (car load-path)
+                                  (when (boundp 'image-load-path)
+                                    image-load-path)))
+	   (map (gmm-tool-bar-from-list gnus-group-tool-bar
+					gnus-group-tool-bar-zap-list
+					'gnus-group-mode-map)))
+      (if map
+	  (set (make-local-variable 'tool-bar-map) map))))
+  gnus-group-tool-bar-map)
 
 (defun gnus-group-mode ()
   "Major mode for reading news.
@@ -1379,6 +1479,17 @@
 		(gnus-range-difference (list active) (gnus-info-read info))
 		seen))))))
 
+;; Moving through the Group buffer (in topic mode) e.g. with C-n doesn't
+;; update the state (enabled/disabled) of the icon `gnus-group-describe-group'
+;; automatically.  After `C-l' the state is correct.  See the following report
+;; on emacs-devel
+;; <http://thread.gmane.org/v9acdmrcse.fsf@marauder.physik.uni-ulm.de>:
+;; From: Reiner Steib
+;; Subject: tool bar icons not updated according to :active condition
+;; Newsgroups: gmane.emacs.devel
+;; Date: Mon, 23 Jan 2006 19:59:13 +0100
+;; Message-ID: <v9acdmrcse.fsf@marauder.physik.uni-ulm.de>
+
 (defcustom gnus-group-update-tool-bar
   (and (not (featurep 'xemacs))
        (boundp 'tool-bar-mode)
--- a/lisp/gnus/gnus-sum.el	Wed Apr 12 17:40:36 2006 +0000
+++ b/lisp/gnus/gnus-sum.el	Wed Apr 19 16:23:46 2006 +0000
@@ -38,6 +38,7 @@
 (require 'gnus-int)
 (require 'gnus-undo)
 (require 'gnus-util)
+(require 'gmm-utils)
 (require 'mm-decode)
 (require 'nnoo)
 
@@ -2546,47 +2547,161 @@
 
 (defvar gnus-summary-tool-bar-map nil)
 
-;; Emacs 21 tool bar.  Should be no-op otherwise.
-(defun gnus-summary-make-tool-bar ()
-  (if (and (fboundp 'tool-bar-add-item-from-menu)
-	   (default-value 'tool-bar-mode)
-	   (not gnus-summary-tool-bar-map))
-      (setq gnus-summary-tool-bar-map
-	    (let ((tool-bar-map (make-sparse-keymap))
-		  (load-path (mm-image-load-path)))
-	      (tool-bar-add-item-from-menu
-	       'gnus-summary-prev-unread "prev-ur" gnus-summary-mode-map)
-	      (tool-bar-add-item-from-menu
-	       'gnus-summary-next-unread "next-ur" gnus-summary-mode-map)
-	      (tool-bar-add-item-from-menu
-	       'gnus-summary-post-news "post" gnus-summary-mode-map)
-	      (tool-bar-add-item-from-menu
-	       'gnus-summary-followup-with-original "fuwo" gnus-summary-mode-map)
-	      (tool-bar-add-item-from-menu
-	       'gnus-summary-followup "followup" gnus-summary-mode-map)
-	      (tool-bar-add-item-from-menu
-	       'gnus-summary-reply-with-original "reply-wo" gnus-summary-mode-map)
-	      (tool-bar-add-item-from-menu
-	       'gnus-summary-reply "reply" gnus-summary-mode-map)
-	      (tool-bar-add-item-from-menu
-	       'gnus-summary-caesar-message "rot13" gnus-summary-mode-map)
-	      (tool-bar-add-item-from-menu
-	       'gnus-uu-decode-uu "uu-decode" gnus-summary-mode-map)
-	      (tool-bar-add-item-from-menu
-	       'gnus-summary-save-article-file "save-aif" gnus-summary-mode-map)
-	      (tool-bar-add-item-from-menu
-	       'gnus-summary-save-article "save-art" gnus-summary-mode-map)
-	      (tool-bar-add-item-from-menu
-	       'gnus-uu-post-news "uu-post" gnus-summary-mode-map)
-	      (tool-bar-add-item-from-menu
-	       'gnus-summary-catchup "catchup" gnus-summary-mode-map)
-	      (tool-bar-add-item-from-menu
-	       'gnus-summary-catchup-and-exit "cu-exit" gnus-summary-mode-map)
-	      (tool-bar-add-item-from-menu
-	       'gnus-summary-exit "exit-summ" gnus-summary-mode-map)
-	      tool-bar-map)))
-  (if gnus-summary-tool-bar-map
-      (set (make-local-variable 'tool-bar-map) gnus-summary-tool-bar-map)))
+;; Note: The :set function in the `gnus-summary-tool-bar*' variables will only
+;; affect _new_ message buffers.  We might add a function that walks thru all
+;; summary-mode buffers and force the update.
+(defun gnus-summary-tool-bar-update (&optional symbol value)
+  "Update summary mode toolbar.
+Setter function for custom variables."
+  (setq-default gnus-summary-tool-bar-map nil)
+  (when symbol
+    ;; When used as ":set" function:
+    (set-default symbol value))
+  (when (gnus-buffer-live-p gnus-summary-buffer)
+    (with-current-buffer gnus-summary-buffer
+      (gnus-summary-make-tool-bar))))
+
+(defcustom gnus-summary-tool-bar (if (eq gmm-tool-bar-style 'gnome)
+				     'gnus-summary-tool-bar-gnome
+				   'gnus-summary-tool-bar-retro)
+  "Specifies the Gnus summary tool bar.
+
+It can be either a list or a symbol refering to a list.  See
+`gmm-tool-bar-from-list' for the format of the list.  The
+default key map is `gnus-summary-mode-map'.
+
+Pre-defined symbols include `gnus-summary-tool-bar-gnome' and
+`gnus-summary-tool-bar-retro'."
+  :type '(choice (const :tag "GNOME style" gnus-summary-tool-bar-gnome)
+		 (const :tag "Retro look"  gnus-summary-tool-bar-retro)
+		 (repeat :tag "User defined list" gmm-tool-bar-item)
+		 (symbol))
+  :version "22.1" ;; Gnus 5.10.9
+  :initialize 'custom-initialize-default
+  :set 'gnus-summary-tool-bar-update
+  :group 'gnus-summary)
+
+(defcustom gnus-summary-tool-bar-gnome
+  '((gnus-summary-post-news "mail/compose" nil)
+    (gnus-summary-insert-new-articles "mail/inbox" nil
+				      :visible (or (not gnus-agent)
+						   gnus-plugged))
+    (gnus-summary-reply-with-original "mail/reply")
+    (gnus-summary-reply "mail/reply" nil :visible nil)
+    (gnus-summary-followup-with-original "mail/reply-all")
+    (gnus-summary-followup "mail/reply-all" nil :visible nil)
+    (gnus-summary-mail-forward "mail/forward")
+    (gnus-summary-save-article "mail/save")
+    (gnus-summary-search-article-forward "search" nil :visible nil)
+    (gnus-summary-print-article "print")
+    (gnus-summary-tick-article-forward "flag-followup" nil :visible nil)
+    ;; Some new commands that may need more suitable icons:
+    (gnus-summary-save-newsrc "save" nil :visible nil)
+    ;; (gnus-summary-show-article "stock_message-display" nil :visible nil)
+    (gnus-summary-prev-article "left-arrow")
+    (gnus-summary-next-article "right-arrow")
+    (gnus-summary-next-page "next-page")
+    ;; (gnus-summary-enter-digest-group "right_arrow" nil :visible nil)
+    ;;
+    ;; Maybe some sort-by-... could be added:
+    ;; (gnus-summary-sort-by-author "sort-a-z" nil :visible nil)
+    ;; (gnus-summary-sort-by-date "sort-1-9" nil :visible nil)
+    (gnus-summary-mark-as-expirable
+     "delete" nil
+     :visible (gnus-check-backend-function 'request-expire-articles
+					   gnus-newsgroup-name))
+    (gnus-summary-mark-as-spam
+     "mail/spam" t
+     :visible (and (fboundp 'spam-group-ham-contents-p)
+		   (spam-group-ham-contents-p gnus-newsgroup-name))
+     :help "Mark as spam")
+    (gnus-summary-mark-as-read-forward
+     "mail/not-spam" nil
+     :visible (and (fboundp 'spam-group-spam-contents-p)
+		   (spam-group-spam-contents-p gnus-newsgroup-name)))
+    ;;
+    (gnus-summary-exit "exit")
+    (gmm-customize-mode "preferences" t :help "Edit mode preferences")
+    (gnus-info-find-node "help"))
+  "List of functions for the summary tool bar (GNOME style).
+
+See `gmm-tool-bar-from-list' for the format of the list."
+  :type '(repeat gmm-tool-bar-item)
+  :version "22.1" ;; Gnus 5.10.9
+  :initialize 'custom-initialize-default
+  :set 'gnus-summary-tool-bar-update
+  :group 'gnus-summary)
+
+(defcustom gnus-summary-tool-bar-retro
+  '((gnus-summary-prev-unread-article "gnus/prev-ur")
+    (gnus-summary-next-unread-article "gnus/next-ur")
+    (gnus-summary-post-news "gnus/post")
+    (gnus-summary-followup-with-original "gnus/fuwo")
+    (gnus-summary-followup "gnus/followup")
+    (gnus-summary-reply-with-original "gnus/reply-wo")
+    (gnus-summary-reply "gnus/reply")
+    (gnus-summary-caesar-message "gnus/rot13")
+    (gnus-uu-decode-uu "gnus/uu-decode")
+    (gnus-summary-save-article-file "gnus/save-aif")
+    (gnus-summary-save-article "gnus/save-art")
+    (gnus-uu-post-news "gnus/uu-post")
+    (gnus-summary-catchup "gnus/catchup")
+    (gnus-summary-catchup-and-exit "gnus/cu-exit")
+    (gnus-summary-exit "gnus/exit-summ")
+    ;; Some new command that may need more suitable icons:
+    (gnus-summary-print-article "gnus/print" nil :visible nil)
+    (gnus-summary-mark-as-expirable "gnus/close" nil :visible nil)
+    (gnus-summary-save-newsrc "gnus/save" nil :visible nil)
+    ;; (gnus-summary-enter-digest-group "gnus/right_arrow" nil :visible nil)
+    (gnus-summary-search-article-forward "gnus/search" nil :visible nil)
+    ;; (gnus-summary-insert-new-articles "gnus/paste" nil :visible nil)
+    ;; (gnus-summary-toggle-threads "gnus/open" nil :visible nil)
+    ;;
+    (gnus-info-find-node "gnus/help" nil :visible nil))
+  "List of functions for the summary tool bar (retro look).
+
+See `gmm-tool-bar-from-list' for the format of the list."
+  :type '(repeat gmm-tool-bar-item)
+  :version "22.1" ;; Gnus 5.10.9
+  :initialize 'custom-initialize-default
+  :set 'gnus-summary-tool-bar-update
+  :group 'gnus-summary)
+
+(defcustom gnus-summary-tool-bar-zap-list t
+  "List of icon items from the global tool bar.
+These items are not displayed in the Gnus summary mode tool bar.
+
+See `gmm-tool-bar-from-list' for the format of the list."
+  :type 'gmm-tool-bar-zap-list
+  :version "22.1" ;; Gnus 5.10.9
+  :initialize 'custom-initialize-default
+  :set 'gnus-summary-tool-bar-update
+  :group 'gnus-summary)
+
+(defvar image-load-path)
+
+(defun gnus-summary-make-tool-bar (&optional force)
+  "Make a summary mode tool bar from `gnus-summary-tool-bar'.
+When FORCE, rebuild the tool bar."
+  (when (and (not (featurep 'xemacs))
+	     (boundp 'tool-bar-mode)
+	     tool-bar-mode
+	     (or (not gnus-summary-tool-bar-map) force))
+    (let* ((load-path
+	    (gmm-image-load-path-for-library "gnus"
+					     "mail/save.xpm"
+					     nil t))
+           (image-load-path (cons (car load-path)
+                                  (when (boundp 'image-load-path)
+                                    image-load-path)))
+	   (map (gmm-tool-bar-from-list gnus-summary-tool-bar
+					gnus-summary-tool-bar-zap-list
+					'gnus-summary-mode-map)))
+      (when map
+	;; Need to set `gnus-summary-tool-bar-map' because `gnus-article-mode'
+	;; uses it's value.
+	(setq gnus-summary-tool-bar-map map))))
+  (set (make-local-variable 'tool-bar-map) gnus-summary-tool-bar-map))
 
 (defun gnus-score-set-default (var value)
   "A version of set that updates the GNU Emacs menu-bar."
--- a/lisp/gnus/message.el	Wed Apr 12 17:40:36 2006 +0000
+++ b/lisp/gnus/message.el	Wed Apr 19 16:23:46 2006 +0000
@@ -37,6 +37,7 @@
   (defvar gnus-list-identifiers)) ; gnus-sum is required where necessary
 (require 'canlock)
 (require 'mailheader)
+(require 'gmm-utils)
 (require 'nnheader)
 ;; This is apparently necessary even though things are autoloaded.
 ;; Because we dynamically bind mail-abbrev-mode-regexp, we'd better
@@ -2529,7 +2530,7 @@
     (set (make-local-variable 'font-lock-defaults)
 	 '(message-font-lock-keywords t))
     (if (boundp 'tool-bar-map)
-	(set (make-local-variable 'tool-bar-map) (message-tool-bar-map))))
+	(set (make-local-variable 'tool-bar-map) (message-make-tool-bar))))
   (easy-menu-add message-mode-menu message-mode-map)
   (easy-menu-add message-mode-field-menu message-mode-map)
   (gnus-make-local-hook 'after-change-functions)
@@ -6586,53 +6587,123 @@
 
 ;; Support for toolbar
 (eval-when-compile
-  (defvar tool-bar-map)
   (defvar tool-bar-mode))
 
-(defun message-tool-bar-local-item-from-menu (command icon in-map &optional from-map &rest props)
-  ;; We need to make tool bar entries in local keymaps with
-  ;; `tool-bar-local-item-from-menu' in Emacs >= 22
-  (if (fboundp 'tool-bar-local-item-from-menu)
-      (tool-bar-local-item-from-menu command icon in-map from-map props)
-    (tool-bar-add-item-from-menu command icon from-map props)))
-
-(defun message-tool-bar-map ()
-  (or message-tool-bar-map
-      (setq message-tool-bar-map
-	    (and
-	     (condition-case nil (require 'tool-bar) (error nil))
-	     (fboundp 'tool-bar-add-item-from-menu)
+;; Note: The :set function in the `message-tool-bar*' variables will only
+;; affect _new_ message buffers.  We might add a function that walks thru all
+;; message-mode buffers and force the update.
+(defun message-tool-bar-update (&optional symbol value)
+  "Update message mode toolbar.
+Setter function for custom variables."
+  (setq-default message-tool-bar-map nil)
+  (when symbol
+    ;; When used as ":set" function:
+    (set-default symbol value)))
+
+(defcustom message-tool-bar (if (eq gmm-tool-bar-style 'gnome)
+				'message-tool-bar-gnome
+			      'message-tool-bar-retro)
+  "Specifies the message mode tool bar.
+
+It can be either a list or a symbol refering to a list.  See
+`gmm-tool-bar-from-list' for the format of the list.  The
+default key map is `message-mode-map'.
+
+Pre-defined symbols include `message-tool-bar-gnome' and
+`message-tool-bar-retro'."
+  :type '(repeat gmm-tool-bar-list-item)
+  :type '(choice (const :tag "GNOME style" message-tool-bar-gnome)
+		 (const :tag "Retro look"  message-tool-bar-retro)
+		 (repeat :tag "User defined list" gmm-tool-bar-item)
+		 (symbol))
+  :version "22.1" ;; Gnus 5.10.9
+  :initialize 'custom-initialize-default
+  :set 'message-tool-bar-update
+  :group 'message)
+
+(defcustom message-tool-bar-gnome
+  '((ispell-message "spell" nil
+		    :visible (or (not (boundp 'flyspell-mode))
+				 (not flyspell-mode)))
+    (flyspell-buffer "spell" t
+		     :visible (and (boundp 'flyspell-mode)
+				   flyspell-mode)
+		     :help "Flyspell whole buffer")
+    (gmm-ignore "separator")
+    (message-send-and-exit "mail/send")
+    (message-dont-send "mail/save-draft")
+    (message-kill-buffer "close") ;; stock_cancel
+    (mml-attach-file "attach" mml-mode-map)
+    (mml-preview "mail/preview" mml-mode-map)
+    ;; (mml-secure-message-sign-encrypt "lock" mml-mode-map :visible nil)
+    (message-insert-importance-high "important" nil :visible nil)
+    (message-insert-importance-low "unimportant" nil :visible nil)
+    (message-insert-disposition-notification-to "receipt" nil :visible nil)
+    (gmm-customize-mode "preferences" t :help "Edit mode preferences")
+    (message-info "help" t :help "Message manual"))
+  "List of items for the message tool bar (GNOME style).
+
+See `gmm-tool-bar-from-list' for details on the format of the list."
+  :type '(repeat gmm-tool-bar-item)
+  :version "22.1" ;; Gnus 5.10.9
+  :initialize 'custom-initialize-default
+  :set 'message-tool-bar-update
+  :group 'message)
+
+(defcustom message-tool-bar-retro
+  '(;; Old Emacs 21 icon for consistency.
+    (message-send-and-exit "gnus/mail_send")
+    (message-kill-buffer "close")
+    (message-dont-send "cancel")
+    (mml-attach-file "attach" mml-mode-map)
+    (ispell-message "spell")
+    (mml-preview "preview" mml-mode-map)
+    (message-insert-importance-high "gnus/important")
+    (message-insert-importance-low "gnus/unimportant")
+    (message-insert-disposition-notification-to "gnus/receipt"))
+  "List of items for the message tool bar (retro style).
+
+See `gmm-tool-bar-from-list' for details on the format of the list."
+  :type '(repeat gmm-tool-bar-item)
+  :version "22.1" ;; Gnus 5.10.9
+  :initialize 'custom-initialize-default
+  :set 'message-tool-bar-update
+  :group 'message)
+
+(defcustom message-tool-bar-zap-list
+  '(new-file open-file dired kill-buffer write-file
+	     print-buffer customize help)
+  "List of icon items from the global tool bar.
+These items are not displayed on the message mode tool bar.
+
+See `gmm-tool-bar-from-list' for the format of the list."
+  :type 'gmm-tool-bar-zap-list
+  :version "22.1" ;; Gnus 5.10.9
+  :initialize 'custom-initialize-default
+  :set 'message-tool-bar-update
+  :group 'message)
+
+(defvar image-load-path)
+
+(defun message-make-tool-bar (&optional force)
+  "Make a message mode tool bar from `message-tool-bar-list'.
+When FORCE, rebuild the tool bar."
+  (when (and (not (featurep 'xemacs))
+	     (boundp 'tool-bar-mode)
 	     tool-bar-mode
-	     (let ((tool-bar-map (copy-keymap tool-bar-map))
-		   (load-path (mm-image-load-path)))
-	       ;; Zap some items which aren't so relevant and take
-	       ;; up space.
-	       (dolist (key '(print-buffer kill-buffer save-buffer
-					   write-file dired open-file))
-		 (define-key tool-bar-map (vector key) nil))
-	       (message-tool-bar-local-item-from-menu
-		'message-send-and-exit "mail/send" tool-bar-map message-mode-map)
-	       (message-tool-bar-local-item-from-menu
-		'message-kill-buffer "close" tool-bar-map message-mode-map)
-	       (message-tool-bar-local-item-from-menu
-		    'message-dont-send "cancel" tool-bar-map message-mode-map)
-	       (message-tool-bar-local-item-from-menu
-		'mml-attach-file "attach" tool-bar-map mml-mode-map)
-	       (message-tool-bar-local-item-from-menu
-		'ispell-message "spell" tool-bar-map message-mode-map)
-	       (message-tool-bar-local-item-from-menu
-		'mml-preview "preview"
-		tool-bar-map mml-mode-map)
-	       (message-tool-bar-local-item-from-menu
-		'message-insert-importance-high "important"
-		tool-bar-map message-mode-map)
-	       (message-tool-bar-local-item-from-menu
-		'message-insert-importance-low "unimportant"
-		tool-bar-map message-mode-map)
-	       (message-tool-bar-local-item-from-menu
-		'message-insert-disposition-notification-to "receipt"
-		tool-bar-map message-mode-map)
-	       tool-bar-map)))))
+	     (or (not message-tool-bar-map) force))
+    (setq message-tool-bar-map
+	  (let* ((load-path
+		  (gmm-image-load-path-for-library "message"
+						   "mail/save-draft.xpm"
+						   nil t))
+		 (image-load-path (cons (car load-path)
+					(when (boundp 'image-load-path)
+					  image-load-path))))
+	    (gmm-tool-bar-from-list message-tool-bar
+				    message-tool-bar-zap-list
+				    'message-mode-map))))
+  message-tool-bar-map)
 
 ;;; Group name completion.
 
--- a/lisp/gnus/mm-bodies.el	Wed Apr 12 17:40:36 2006 +0000
+++ b/lisp/gnus/mm-bodies.el	Wed Apr 19 16:23:46 2006 +0000
@@ -56,6 +56,8 @@
     ;; known to break servers.
     ;; Note: UTF-16 variants are invalid for text parts [RFC 2781],
     ;; so this can't happen :-/.
+    ;; PPS: Yes, it can happen if the user specifies UTF-16 in the MML
+    ;; markup. - jh.
     (utf-16 . base64)
     (utf-16be . base64)
     (utf-16le . base64))
@@ -251,7 +253,10 @@
       (mm-decode-content-transfer-encoding encoding type))
     (when (and (featurep 'mule) ;; Fixme: Wrong test for unibyte session.
 	       (not (eq charset 'gnus-decoded)))
-      (let ((coding-system (mm-charset-to-coding-system charset)))
+      (let ((coding-system (mm-charset-to-coding-system
+			    ;; Allow overwrite using
+			    ;; `mm-charset-override-alist'.
+			    charset nil t)))
 	(if (and (not coding-system)
 		 (listp mail-parse-ignored-charsets)
 		 (memq 'gnus-unknown mail-parse-ignored-charsets))
@@ -282,7 +287,11 @@
     (setq charset mail-parse-charset))
   (or
    (when (featurep 'mule)
-     (let ((coding-system (mm-charset-to-coding-system charset)))
+     (let ((coding-system (mm-charset-to-coding-system
+			   charset
+			   ;; Allow overwrite using
+			   ;; `mm-charset-override-alist'.
+			   nil t)))
        (if (and (not coding-system)
 		(listp mail-parse-ignored-charsets)
 		(memq 'gnus-unknown mail-parse-ignored-charsets))
--- a/lisp/gnus/mm-util.el	Wed Apr 12 17:40:36 2006 +0000
+++ b/lisp/gnus/mm-util.el	Wed Apr 19 16:23:46 2006 +0000
@@ -177,6 +177,29 @@
       ;; no-MULE XEmacs:
       (car (memq cs (mm-get-coding-system-list))))))
 
+(defun mm-codepage-setup (number &optional alias)
+  "Create a coding system cpNUMBER.
+The coding system is created using `codepage-setup'.  If ALIAS is
+non-nil, an alias is created and added to
+`mm-charset-synonym-alist'.  If ALIAS is a string, it's used as
+the alias.  Else windows-NUMBER is used."
+  (interactive
+   (let ((completion-ignore-case t)
+	 (candidates (cp-supported-codepages)))
+     (list (completing-read "Setup DOS Codepage: (default 437) " candidates
+			    nil t nil nil "437"))))
+  (when alias
+    (setq alias (if (stringp alias)
+		    (intern alias)
+		  (intern (format "windows-%s" number)))))
+  (let* ((cp (intern (format "cp%s" number))))
+    (unless (mm-coding-system-p cp)
+      (codepage-setup number))
+    (when (and alias
+	       ;; Don't add alias if setup of cp failed.
+	       (mm-coding-system-p cp))
+      (add-to-list 'mm-charset-synonym-alist (cons alias cp)))))
+
 (defvar mm-charset-synonym-alist
   `(
     ;; Not in XEmacs, but it's not a proper MIME charset anyhow.
@@ -200,8 +223,61 @@
     ,@(if (and (not (mm-coding-system-p 'windows-1250))
 	       (mm-coding-system-p 'cp1250))
 	  '((windows-1250 . cp1250)))
+    ;; A Microsoft misunderstanding.
+    ,@(if (and (not (mm-coding-system-p 'unicode))
+	       (mm-coding-system-p 'utf-16-le))
+	  '((unicode . utf-16-le)))
+    ;; A Microsoft misunderstanding.
+    ,@(unless (mm-coding-system-p 'ks_c_5601-1987)
+	(if (mm-coding-system-p 'cp949)
+	    '((ks_c_5601-1987 . cp949))
+	  '((ks_c_5601-1987 . euc-kr))))
     )
-  "A mapping from invalid charset names to the real charset names.")
+  "A mapping from unknown or invalid charset names to the real charset names.")
+
+(defcustom mm-charset-override-alist
+  `((iso-8859-1 . windows-1252))
+  "A mapping from undesired charset names to their replacement.
+
+You may add pairs like (iso-8859-1 . windows-1252) here,
+i.e. treat iso-8859-1 as windows-1252.  windows-1252 is a
+superset of iso-8859-1."
+  :type '(list (set :inline t
+		    (const (iso-8859-1 . windows-1252))
+		    (const (undecided  . windows-1252)))
+	       (repeat :inline t
+		       :tag "Other options"
+		       (cons (symbol :tag "From charset")
+			     (symbol :tag "To charset"))))
+  :version "23.0" ;; No Gnus
+  :group 'mime)
+
+(defcustom mm-charset-eval-alist
+  (if (featurep 'xemacs)
+      nil ;; I don't know what would be useful for XEmacs.
+    '(;; Emacs 21 offers 1250 1251 1253 1257.  Emacs 22 provides autoloads for
+      ;; 1250-1258 (i.e. `mm-codepage-setup' does nothing).
+      (windows-1250 . (mm-codepage-setup 1250 t))
+      (windows-1251 . (mm-codepage-setup 1251 t))
+      (windows-1253 . (mm-codepage-setup 1253 t))
+      (windows-1257 . (mm-codepage-setup 1257 t))))
+  "An alist of (CHARSET . FORM) pairs.
+If an article is encoded in an unknown CHARSET, FORM is
+evaluated.  This allows to load additional libraries providing
+charsets on demand.  If supported by your Emacs version, you
+could use `autoload-coding-system' here."
+  :version "23.0" ;; No Gnus
+  :type '(list (set :inline t
+		    (const (windows-1250 . (mm-codepage-setup 1250 t)))
+		    (const (windows-1251 . (mm-codepage-setup 1251 t)))
+		    (const (windows-1253 . (mm-codepage-setup 1253 t)))
+		    (const (windows-1257 . (mm-codepage-setup 1257 t)))
+		    (const (cp850 . (mm-codepage-setup 850 nil))))
+	       (repeat :inline t
+		       :tag "Other options"
+		       (cons (symbol :tag "charset")
+			     (symbol :tag "form"))))
+  :group 'mime)
 
 (defvar mm-binary-coding-system
   (cond
@@ -426,11 +502,17 @@
 	(pop alist))
       out)))
 
-(defun mm-charset-to-coding-system (charset &optional lbt)
+(defun mm-charset-to-coding-system (charset &optional lbt
+					    allow-override)
   "Return coding-system corresponding to CHARSET.
 CHARSET is a symbol naming a MIME charset.
 If optional argument LBT (`unix', `dos' or `mac') is specified, it is
-used as the line break code type of the coding system."
+used as the line break code type of the coding system.
+
+If ALLOW-OVERRIDE is given, use `mm-charset-override-alist' to
+map undesired charset names to their replacement.  This should
+only be used for decoding, not for encoding."
+  ;; OVERRIDE is used (only) in `mm-decode-body' and `mm-decode-string'.
   (when (stringp charset)
     (setq charset (intern (downcase charset))))
   (when lbt
@@ -442,6 +524,11 @@
    ((or (null (mm-get-coding-system-list))
 	(not (fboundp 'coding-system-get)))
     charset)
+   ;; Check override list quite early.  Should only used for decoding, not for
+   ;; encoding!
+   ((and allow-override
+	 (let ((cs (cdr (assq charset mm-charset-override-alist))))
+	   (and cs (mm-coding-system-p cs) cs))))
    ;; ascii
    ((eq charset 'us-ascii)
     'ascii)
@@ -454,9 +541,27 @@
 ;;; 	 (eq charset (coding-system-get charset 'mime-charset))
 	 )
     charset)
+   ;; Eval expressions from `mm-charset-eval-alist'
+   ((let* ((el (assq charset mm-charset-eval-alist))
+	   (cs (car el))
+	   (form (cdr el)))
+      (and cs
+	   form
+	   (prog2
+	       ;; Avoid errors...
+	       (condition-case nil (eval form) (error nil))
+	       ;; (message "Failed to eval `%s'" form))
+	       (mm-coding-system-p cs)
+	     (message "Added charset `%s' via `mm-charset-eval-alist'" cs))
+	   cs)))
    ;; Translate invalid charsets.
    ((let ((cs (cdr (assq charset mm-charset-synonym-alist))))
-      (and cs (mm-coding-system-p cs) cs)))
+      (and cs
+	   (mm-coding-system-p cs)
+	   ;; (message
+	   ;;  "Using synonym `%s' from `mm-charset-synonym-alist' for `%s'"
+	   ;;  cs charset)
+	   cs)))
    ;; Last resort: search the coding system list for entries which
    ;; have the right mime-charset in case the canonical name isn't
    ;; defined (though it should be).
@@ -468,6 +573,11 @@
 		 (eq charset (or (coding-system-get c :mime-charset)
 				 (coding-system-get c 'mime-charset))))
 	    (setq cs c)))
+      (unless cs
+	;; Warn the user about unknown charset:
+	(if (fboundp 'gnus-message)
+	    (gnus-message 7 "Unknown charset: %s" charset)
+	  (message "Unknown charset: %s" charset)))
       cs))))
 
 (defsubst mm-replace-chars-in-string (string from to)
@@ -1070,7 +1180,8 @@
     (defun mm-detect-mime-charset-region (start end)
       "Detect MIME charset of the text in the region between START and END."
       (let ((cs (mm-detect-coding-region start end)))
-	(coding-system-get cs 'mime-charset)))
+	(or (coding-system-get cs :mime-charset)
+	    (coding-system-get cs 'mime-charset))))
   (defun mm-detect-mime-charset-region (start end)
     "Detect MIME charset of the text in the region between START and END."
     (let ((cs (mm-detect-coding-region start end)))
--- a/lisp/help-mode.el	Wed Apr 12 17:40:36 2006 +0000
+++ b/lisp/help-mode.el	Wed Apr 19 16:23:46 2006 +0000
@@ -197,6 +197,7 @@
   (view-mode)
   (make-local-variable 'view-no-disable-on-exit)
   (setq view-no-disable-on-exit t)
+  (setq view-exit-action (lambda (buffer) (delete-window)))
   (run-mode-hooks 'help-mode-hook))
 
 ;;;###autoload
--- a/lisp/image-mode.el	Wed Apr 12 17:40:36 2006 +0000
+++ b/lisp/image-mode.el	Wed Apr 19 16:23:46 2006 +0000
@@ -139,7 +139,11 @@
     ;; was inserted
     (let* ((image
 	    (if (and (buffer-file-name)
-		     (not (buffer-modified-p)))
+		     (not (buffer-modified-p))
+		     (not (and (boundp 'archive-superior-buffer)
+			       archive-superior-buffer))
+		     (not (and (boundp 'tar-superior-buffer)
+			       tar-superior-buffer)))
 		(progn (clear-image-cache)
 		       (create-image (buffer-file-name)))
 	      (create-image
--- a/lisp/imenu.el	Wed Apr 12 17:40:36 2006 +0000
+++ b/lisp/imenu.el	Wed Apr 19 16:23:46 2006 +0000
@@ -208,18 +208,13 @@
 
 ;;;###autoload
 (defvar imenu-create-index-function 'imenu-default-create-index-function
-  "The function to use for creating a buffer index.
-
-It should be a function that takes no arguments and returns an index
-of the current buffer as an alist.
+  "The function to use for creating an index alist of the current buffer.
 
-Simple elements in the alist look like (INDEX-NAME . INDEX-POSITION).
-Special elements look like (INDEX-NAME INDEX-POSITION FUNCTION ARGUMENTS...).
-A nested sub-alist element looks like (INDEX-NAME SUB-ALIST).
-The function `imenu--subalist-p' tests an element and returns t
-if it is a sub-alist.
+It should be a function that takes no arguments and returns
+an index alist of the current buffer.  The function is
+called within a `save-excursion'.
 
-This function is called within a `save-excursion'.")
+See `imenu--index-alist' for the format of the buffer index alist.")
 ;;;###autoload
 (make-variable-buffer-local 'imenu-create-index-function)
 
@@ -431,15 +426,27 @@
 ;; The latest buffer index.
 ;; Buffer local.
 (defvar imenu--index-alist nil
-  "The buffer index computed for this buffer in Imenu.
-Simple elements in the alist look like (INDEX-NAME . INDEX-POSITION).
-Special elements look like (INDEX-NAME INDEX-POSITION FUNCTION ARGUMENTS...).
-A nested sub-alist element looks like (INDEX-NAME SUB-ALIST).")
+  "The buffer index alist computed for this buffer in Imenu.
+
+Simple elements in the alist look like (INDEX-NAME . POSITION).
+POSITION is the buffer position of the item; to go to the item
+is simply to move point to that position.
+
+Special elements look like (INDEX-NAME POSITION FUNCTION ARGUMENTS...).
+To \"go to\" a special element means applying FUNCTION
+to INDEX-NAME, POSITION, and the ARGUMENTS.
+
+A nested sub-alist element looks like (INDEX-NAME SUB-ALIST).
+The function `imenu--subalist-p' tests an element and returns t
+if it is a sub-alist.
+
+There is one simple element with negative POSITION; selecting that
+element recalculates the buffer's index alist.")
 
 (make-variable-buffer-local 'imenu--index-alist)
 
 (defvar imenu--last-menubar-index-alist nil
-  "The latest buffer index used to update the menu bar menu.")
+  "The latest buffer index alist used to update the menu bar menu.")
 
 (make-variable-buffer-local 'imenu--last-menubar-index-alist)
 
@@ -547,19 +554,12 @@
 
 
 (defun imenu--make-index-alist (&optional noerror)
-  "Create an index-alist for the definitions in the current buffer.
-
+  "Create an index alist for the definitions in the current buffer.
+This works by using the hook function `imenu-create-index-function'.
 Report an error if the list is empty unless NOERROR is supplied and
 non-nil.
 
-Simple elements in the alist look like (INDEX-NAME . INDEX-POSITION).
-Special elements look like (INDEX-NAME FUNCTION ARGUMENTS...).
-A nested sub-alist element looks like (INDEX-NAME SUB-ALIST).
-The function `imenu--subalist-p' tests an element and returns t
-if it is a sub-alist.
-
-There is one simple element with negative POSITION; that's intended
-as a way for the user to ask to recalculate the buffer's index alist."
+See `imenu--index-alist' for the format of the index alist."
   (or (and imenu--index-alist
 	   (or (not imenu-auto-rescan)
 	       (and imenu-auto-rescan
@@ -657,11 +657,15 @@
 (make-variable-buffer-local 'imenu-syntax-alist)
 
 (defun imenu-default-create-index-function ()
-  "*Wrapper for index searching functions.
+  "*Default function to create an index alist of the current buffer.
 
-Moves point to end of buffer and then repeatedly calls
+The most general method is to move point to end of buffer, then repeatedly call
 `imenu-prev-index-position-function' and `imenu-extract-index-name-function'.
-Their results are gathered into an index alist."
+All the results returned by the latter are gathered into an index alist.
+This method is used if those two variables are non-nil.
+
+The alternate method, which is the one most often used, is to call
+`imenu--generic-function' with `imenu-generic-expression' as argument."
   ;; These should really be done by setting imenu-create-index-function
   ;; in these major modes.  But save that change for later.
   (cond ((and imenu-prev-index-position-function
@@ -687,27 +691,6 @@
 	(t
 	 (error "This buffer cannot use `imenu-default-create-index-function'"))))
 
-;; Not used and would require cl at run time
-;; (defun imenu--flatten-index-alist (index-alist &optional concat-names prefix)
-;;   ;; Takes a nested INDEX-ALIST and returns a flat index alist.
-;;   ;; If optional CONCAT-NAMES is non-nil, then a nested index has its
-;;   ;; name and a space concatenated to the names of the children.
-;;   ;; Third argument PREFIX is for internal use only.
-;;   (mapcan
-;;    (lambda (item)
-;;      (let* ((name (car item))
-;; 	    (pos (cdr item))
-;; 	    (new-prefix (and concat-names
-;; 			     (if prefix
-;; 				 (concat prefix imenu-level-separator name)
-;; 			       name))))
-;;        (cond
-;; 	((or (markerp pos) (numberp pos))
-;; 	 (list (cons new-prefix pos)))
-;; 	(t
-;; 	 (imenu--flatten-index-alist pos new-prefix)))))
-;;    index-alist))
-
 ;;;
 ;;; Generic index gathering function.
 ;;;
@@ -724,7 +707,7 @@
 ;; This function can be called with quitting disabled,
 ;; so it needs to be careful never to loop!
 (defun imenu--generic-function (patterns)
-  "Return an index of the current buffer as an alist.
+  "Return an index alist of the current buffer based on PATTERNS.
 
 PATTERNS is an alist with elements that look like this:
  (MENU-TITLE REGEXP INDEX)
@@ -732,9 +715,8 @@
  (MENU-TITLE REGEXP INDEX FUNCTION ARGUMENTS...)
 with zero or more ARGUMENTS.  The former format creates a simple
 element in the index alist when it matches; the latter creates a
-special element of the form (NAME POSITION-MARKER FUNCTION
-ARGUMENTS...)  with FUNCTION and ARGUMENTS copied from
-`imenu-generic-expression'.
+special element of the form (INDEX-NAME POSITION-MARKER FUNCTION
+ARGUMENTS...) with FUNCTION and ARGUMENTS copied from PATTERNS.
 
 MENU-TITLE is a string used as the title for the submenu or nil
 if the entries are not nested.
--- a/lisp/mh-e/ChangeLog	Wed Apr 12 17:40:36 2006 +0000
+++ b/lisp/mh-e/ChangeLog	Wed Apr 19 16:23:46 2006 +0000
@@ -1,3 +1,172 @@
+2006-04-18  Bill Wohler  <wohler@newt.com>
+
+	* mh-e.el (defcustom-mh, defface-mh, defgroup-mh, mh-face-data)
+	(mh-strip-package-version, mh-face-data, mh-inherit-face-flag)
+	(mh-min-colors-defined-flag): Do not unbind these macros and
+	variables. Nice idea, but too many nasty side-effects. These
+	macros are needed by [Cc]ustom-make-dependencies when creating the
+	MH-E customization groups in mh-cus-load.el. These disappeared
+	when the macros above were introduced. Besides, if a developer
+	were to try to show the help for a macro or variable they were
+	looking at and got [No match] when they did so, that would be bad.
+
+2006-04-17  Bill Wohler  <wohler@newt.com>
+
+	* mh-comp.el (mh-insert-x-mailer): Strip build number from
+	version in X-Mailer field (closes SF #1466481).
+
+	* mh-acros.el (mh-defun-compat): Rename to defun-mh in order that
+	variables and functions with the same name are found correctly by
+	find-func (invoked by clicking on the filename link in the *Help*
+	buffer).
+	(mh-defmacro-compat): Rename to defmacro-mh. Ditto.
+	* mh-e.el: (mh-defgroup): Rename to defgroup-mh. Ditto.
+	(mh-defcustom): Rename to defcustom-mh. Ditto.
+	(mh-defface): Rename to defface-mh. Ditto.
+	(mh-font-lock-add-keywords): Make changes according to these
+	renamings.
+
+	* mh-e.el, mh-compat.el, mh-gnus.el: Use the new names (closes SF
+	#1472029).
+
+	* mh-utils.el (mh-sub-folders-actual): Mention that folder must
+	have been processed by mh-normalize-folder-name.
+	(mh-folder-completion-function): Handle completion of folders with
+	absolute names. Also, when flag is t, display complete folder name
+	to provide proper highlighting in Emacs 22 now that
+	minibuffer-completing-file-name is nil (closes SF #1470518).
+	(mh-folder-completing-read): No longer set
+	minibuffer-completing-file-name to t. This was causing "Can't set
+	current directory errors" when browsing absolute file names.
+	Another benefit of this change is that SPC can be used for
+	completion again (closes SF #1470518).
+
+2006-04-15  Bill Wohler  <wohler@newt.com>
+
+	* mh-compat.el (mh-font-lock-add-keywords): Fix typo in docstring.
+
+2006-04-14  Bill Wohler  <wohler@newt.com>
+
+	* mh-funcs.el (view-exit-action): No need to wrap defvar with
+	eval-when-compile when shushing compiler.
+
+	* mh-mime.el (mh-identity-pgg-default-user-id): Ditto.
+
+	* mh-seq.el (view-exit-action): Ditto.
+
+	* mh-show.el (font-lock-auto-fontify): Ditto.
+
+	* mh-utils.el (mh-speed-flists-cache): Ditto
+
+	* mh-acros.el (struct, x, y):  No need to wrap defvar with
+	eval-when-compile when shushing compiler, even when
+	mh-do-in-xemacs or another construct is used.
+
+	* mh-comp.el (sendmail-coding-system): Ditto.
+
+	* mh-e.el (mark-active): Ditto.
+
+	* mh-folder.el (desktop-save-buffer, font-lock-auto-fontify)
+	(image-load-path, font-lock-defaults): Ditto.
+
+	* mh-letter.el (image-load-path, font-lock-defaults): Ditto.
+
+	* mh-mime.el (dots, type, ov)
+	(mm-verify-function-alist, mm-decrypt-function-alist)
+	(pressed-details): Ditto.
+
+	* mh-search.el (pick-folder, mh-do-in-xemacs)
+	(mh-mairix-folder, mh-flists-search-folders)
+	(which-func-mode, mh-speed-flists-inhibit-flag): Ditto.
+
+	* mh-seq.el (tool-bar-mode): Ditto.
+
+	* mh-utils.el (completion-root-regexp)
+	(minibuffer-completing-file-name): Ditto.
+
+	* mh-xface.el (default-enable-multibyte-characters): Ditto.
+
+	* mh-compat.el (mh-font-lock-add-keywords): New alias for
+	font-lock-add-keywords. Returns nil on XEmacs.	
+
+	* mh-e.el: Add MH-E function and variable keywords such as
+	mh-defun-compat and mh-defcustom to font-lock-keywords.	
+
+2006-04-13  Bill Wohler  <wohler@newt.com>
+
+	* mh-e.el (customize-package-emacs-version-alist)
+	(mh-e, mh-alias, mh-folder, mh-folder-selection)
+	(mh-identity, mh-inc, mh-junk, mh-letter, mh-ranges)
+	(mh-scan-line-formats, mh-search, mh-sending-mail, )
+	(mh-sequences, mh-show, mh-speedbar, mh-thread, mh-tool-bar)
+	(mh-hooks, mh-faces, mh-alias-completion-ignore-case-flag)
+	(mh-alias-expand-aliases-flag, mh-alias-flash-on-comma)
+	(mh-alias-insert-file, mh-alias-insertion-location)
+	(mh-alias-local-users, mh-alias-local-users-prefix)
+	(mh-alias-passwd-gecos-comma-separator-flag)
+	(mh-new-messages-folders, mh-ticked-messages-folders)
+	(mh-large-folder, mh-recenter-summary-flag)
+	(mh-recursive-folders-flag, mh-sortm-args)
+	(mh-default-folder-for-message-function, )
+	(mh-default-folder-list, mh-default-folder-must-exist-flag)
+	(mh-default-folder-prefix, mh-identity-list)
+	(mh-auto-fields-list, mh-auto-fields-prompt-flag)
+	(mh-identity-default, mh-identity-handlers, mh-inc-prog)
+	(mh-inc-spool-list, mh-junk-background, mh-junk-disposition)
+	(mh-junk-program, mh-compose-insertion)
+	(mh-compose-skipped-header-fields)
+	(mh-compose-space-does-completion-flag)
+	(mh-delete-yanked-msg-window-flag)
+	(mh-extract-from-attribution-verb, mh-ins-buf-prefix)
+	(mh-letter-complete-function, mh-letter-fill-column)
+	(mh-mml-method-default, mh-signature-file-name)
+	(mh-signature-separator-flag, mh-x-face-file, )
+	(mh-yank-behavior, mh-interpret-number-as-range-flag)
+	(mh-adaptive-cmd-note-flag, mh-scan-format-file, mh-scan-prog)
+	(mh-search-program, mh-compose-forward-as-mime-flag)
+	(mh-compose-letter-function, mh-compose-prompt-flag)
+	(mh-forward-subject-format, mh-insert-x-mailer-flag)
+	(mh-redist-full-contents-flag, mh-reply-default-reply-to)
+	(mh-reply-show-message-flag, )
+	(mh-refile-preserves-sequences-flag, mh-tick-seq)
+	(mh-update-sequences-after-mh-show-flag)
+	(mh-bury-show-buffer-flag, mh-clean-message-header-flag)
+	(mh-decode-mime-flag, )
+	(mh-display-buttons-for-alternatives-flag)
+	(mh-display-buttons-for-inline-parts-flag)
+	(mh-do-not-confirm-flag, mh-fetch-x-image-url)
+	(mh-graphical-smileys-flag, mh-graphical-emphasis-flag)
+	(mh-highlight-citation-style, mh-invisible-header-fields)
+	(mh-invisible-header-fields-default, mh-lpr-command-format)
+	(mh-max-inline-image-height, mh-max-inline-image-width)
+	(mh-mhl-format-file, mh-mime-save-parts-default-directory)
+	(mh-print-background-flag, mh-show-maximum-size)
+	(mh-show-use-xface-flag, mh-store-default-directory)
+	(mh-summary-height, mh-speed-update-interval)
+	(mh-show-threads-flag, mh-tool-bar-search-function)
+	(mh-defcustom, mh-after-commands-processed-hook)
+	(mh-alias-reloaded-hook, mh-before-commands-processed-hook)
+	(mh-before-quit-hook, mh-before-send-letter-hook)
+	(mh-delete-msg-hook, mh-find-path-hook, mh-folder-mode-hook)
+	(mh-forward-hook, mh-inc-folder-hook, )
+	(mh-insert-signature-hook, )
+	(mh-kill-folder-suppress-prompt-hooks, mh-letter-mode-hook)
+	(mh-mh-to-mime-hook, mh-search-mode-hook, mh-quit-hook)
+	(mh-refile-msg-hook, mh-show-hook, mh-show-mode-hook)
+	(mh-unseen-updated-hook, mh-folder-address, mh-folder-body)
+	(mh-folder-cur-msg-number, mh-folder-date, mh-folder-deleted)
+	(mh-folder-followup, mh-folder-msg-number, mh-folder-refiled)
+	(mh-folder-sent-to-me-hint, mh-folder-sent-to-me-sender)
+	(mh-folder-subject, mh-folder-tick, mh-folder-to)
+	(mh-letter-header-field, mh-search-folder, mh-show-cc)
+	(mh-show-date, mh-show-from, mh-show-header, mh-show-pgg-bad)
+	(mh-show-pgg-good, mh-show-pgg-unknown, mh-show-signature)
+	(mh-show-subject, mh-show-to, mh-show-xface, )
+	(mh-speedbar-folder, mh-speedbar-folder-with-unseen-messages)
+	(mh-speedbar-selected-folder)
+	(mh-speedbar-selected-folder-with-unseen-messages): Use dotted
+	notation in :package-version keyword.
+
 2006-04-07  Bill Wohler  <wohler@newt.com>
 
 	* mh-e.el (mh-path, mh-variant): Define with mh-defcustom and add
@@ -21,7 +190,7 @@
 	(mh-scan-line-formats, mh-search, mh-sending-mail)
 	(mh-sequences, mh-show, mh-speedbar, mh-thread, mh-tool-bar)
 	(mh-hooks, mh-faces): Add :package-version keyword to these
-	groups.
+	groups (closes SF #1452724).
 	(mh-alias-completion-ignore-case-flag)
 	(mh-alias-expand-aliases-flag, mh-alias-flash-on-comma)
 	(mh-alias-insert-file, mh-alias-insertion-location)
@@ -67,7 +236,7 @@
 	(mh-show-use-xface-flag, mh-store-default-directory)
 	(mh-summary-height, mh-speed-update-interval)
 	(mh-show-threads-flag, mh-tool-bar-search-function): Add
-	:package-version keyword to these options.
+	:package-version keyword to these options (closes SF #1452724).
 	(mh-after-commands-processed-hook)
 	(mh-alias-reloaded-hook, mh-before-commands-processed-hook)
 	(mh-before-quit-hook, mh-before-send-letter-hook)
@@ -78,7 +247,7 @@
 	(mh-mh-to-mime-hook, mh-search-mode-hook, mh-quit-hook)
 	(mh-refile-msg-hook, mh-show-hook, mh-show-mode-hook)
 	(mh-unseen-updated-hook): Add :package-version keyword to these
-	hooks.
+	hooks (closes SF #1452724).
 	(mh-min-colors-defined-flag)
 	(mh-folder-address, mh-folder-body, mh-folder-cur-msg-number)
 	(mh-folder-date, mh-folder-deleted, mh-folder-followup)
@@ -92,10 +261,10 @@
 	(mh-speedbar-folder, mh-speedbar-folder-with-unseen-messages)
 	(mh-speedbar-selected-folder)
 	(mh-speedbar-selected-folder-with-unseen-messages): : Add
-	:package-version keyword to these faces.
+	:package-version keyword to these faces (closes SF #1452724).
 
 	* mh-tool-bar.el (mh-tool-bar-define): Added commented-out
-	:package-version keywords.
+	:package-version keywords (closes SF #1452724).
 
 2006-03-28  Bill Wohler  <wohler@newt.com>
 
--- a/lisp/mh-e/mh-acros.el	Wed Apr 12 17:40:36 2006 +0000
+++ b/lisp/mh-e/mh-acros.el	Wed Apr 19 16:23:46 2006 +0000
@@ -82,7 +82,7 @@
        (funcall ',function ,@args))))
 
 ;;;###mh-autoload
-(defmacro mh-defun-compat (name function arg-list &rest body)
+(defmacro defun-mh (name function arg-list &rest body)
   "Create function NAME.
 If FUNCTION exists, then NAME becomes an alias for FUNCTION.
 Otherwise, create function NAME with ARG-LIST and BODY."
@@ -90,10 +90,10 @@
     (if defined-p
         `(defalias ',name ',function)
       `(defun ,name ,arg-list ,@body))))
-(put 'mh-defun-compat 'lisp-indent-function 'defun)
+(put 'defun-mh 'lisp-indent-function 'defun)
 
 ;;;###mh-autoload
-(defmacro mh-defmacro-compat (name macro arg-list &rest body)
+(defmacro defmacro-mh (name macro arg-list &rest body)
   "Create macro NAME.
 If MACRO exists, then NAME becomes an alias for MACRO.
 Otherwise, create macro NAME with ARG-LIST and BODY."
@@ -101,7 +101,7 @@
     (if defined-p
         `(defalias ',name ',macro)
       `(defmacro ,name ,arg-list ,@body))))
-(put 'mh-defmacro-compat 'lisp-indent-function 'defun)
+(put 'defmacro-mh 'lisp-indent-function 'defun)
 
 
 
@@ -130,7 +130,9 @@
                (boundp 'mark-active) mark-active))))
 
 ;; Shush compiler.
-(eval-when-compile (mh-do-in-xemacs (defvar struct) (defvar x) (defvar y)))
+(defvar struct)                         ; XEmacs
+(defvar x)                              ; XEmacs
+(defvar y)                              ; XEmacs
 
 ;;;###mh-autoload
 (defmacro mh-defstruct (name-spec &rest fields)
--- a/lisp/mh-e/mh-comp.el	Wed Apr 12 17:40:36 2006 +0000
+++ b/lisp/mh-e/mh-comp.el	Wed Apr 19 16:23:46 2006 +0000
@@ -215,7 +215,7 @@
       (setq other-headers (cdr other-headers)))))
 
 ;; Shush compiler.
-(eval-when-compile (mh-do-in-xemacs (defvar sendmail-coding-system)))
+(defvar sendmail-coding-system)         ; XEmacs
 
 ;;;###autoload
 (defun mh-send-letter (&optional arg)
@@ -912,7 +912,10 @@
           (format "MH-E %s; %s; %sEmacs %s"
                   mh-version mh-variant-in-use
                   (if mh-xemacs-flag "X" "GNU ")
-                  (cond ((not mh-xemacs-flag) emacs-version)
+                  (cond ((not mh-xemacs-flag)
+                         (string-match "[0-9]+\\.[0-9]+\\(\\.[0-9]+\\)?"
+                                       emacs-version)
+                         (match-string 0 emacs-version))
                         ((string-match "[0-9.]*\\( +\([ a-z]+[0-9]+\)\\)?"
                                        emacs-version)
                          (match-string 0 emacs-version))
--- a/lisp/mh-e/mh-compat.el	Wed Apr 12 17:40:36 2006 +0000
+++ b/lisp/mh-e/mh-compat.el	Wed Apr 19 16:23:46 2006 +0000
@@ -40,7 +40,7 @@
 ;; versions of Gnus.
 
 ;; Items are listed alphabetically (except for mh-require which is
-;; needed by a lesser character).
+;; needed sooner it would normally appear).
 
 (require 'mh-acros)
 
@@ -62,7 +62,7 @@
             (load filename noerror t)
           (load (format "%s" feature) noerror t)))))
 
-(mh-defun-compat mh-assoc-string assoc-string (key list case-fold)
+(defun-mh mh-assoc-string assoc-string (key list case-fold)
   "Like `assoc' but specifically for strings.
 Case is ignored if CASE-FOLD is non-nil.
 This function is used by Emacs versions that lack `assoc-string',
@@ -77,7 +77,7 @@
       'cancel-timer
     'delete-itimer))
 
-(mh-defun-compat mh-display-color-cells display-color-cells (&optional display)
+(defun-mh mh-display-color-cells display-color-cells (&optional display)
   "Return the number of color cells supported by DISPLAY.
 This function is used by XEmacs to return 2 when
 `device-color-cells' returns nil. This happens when compiling or
@@ -115,7 +115,12 @@
       `(face-background ,face ,frame)
     `(face-background ,face ,frame ,inherit)))
 
-(mh-defun-compat mh-image-load-path-for-library
+(defun-mh mh-font-lock-add-keywords font-lock-add-keywords
+  (mode keywords &optional how)
+  "XEmacs does not have `font-lock-add-keywords'.
+This function returns nil on that system.")
+
+(defun-mh mh-image-load-path-for-library
   image-load-path-for-library (library image &optional path no-error)
   "Return a suitable search path for images used by LIBRARY.
 
@@ -210,7 +215,7 @@
     (nconc (list image-directory)
            (delete image-directory (copy-sequence (or path load-path))))))
 
-(mh-defun-compat mh-image-search-load-path
+(defun-mh mh-image-search-load-path
   image-search-load-path (file &optional path)
   "Emacs 21 and XEmacs don't have `image-search-load-path'.
 This function returns nil on those systems."
@@ -229,13 +234,13 @@
     'point-at-eol))
 
 (mh-require 'mailabbrev nil t)
-(mh-defun-compat mh-mail-abbrev-make-syntax-table
+(defun-mh mh-mail-abbrev-make-syntax-table
   mail-abbrev-make-syntax-table ()
   "Emacs 21 and XEmacs don't have `mail-abbrev-make-syntax-table'.
 This function returns nil on those systems."
   nil)
 
-(mh-defun-compat mh-match-string-no-properties
+(defun-mh mh-match-string-no-properties
   match-string-no-properties (num &optional string)
   "Return string of text matched by last search, without text properties.
 This function is used by XEmacs that lacks `match-string-no-properties'.
@@ -244,7 +249,7 @@
   (buffer-substring-no-properties
    (match-beginning num) (match-end num)))
 
-(mh-defun-compat mh-replace-regexp-in-string replace-regexp-in-string
+(defun-mh mh-replace-regexp-in-string replace-regexp-in-string
   (regexp rep string &optional fixedcase literal subexp start)
   "Replace REGEXP with REP everywhere in STRING and return result.
 This function is used by XEmacs that lacks `replace-regexp-in-string'.
@@ -264,7 +269,7 @@
       "A list of characters that are _NOT_ reserved in the URL spec.
 This is taken from RFC 2396."))
 
-(mh-defun-compat mh-url-hexify-string url-hexify-string (str)
+(defun-mh mh-url-hexify-string url-hexify-string (str)
   "Escape characters in a string.
 This is a copy of `url-hexify-string' from url-util.el in Emacs
 22; needed by Emacs 21."
@@ -278,7 +283,7 @@
        (char-to-string char)))
    str ""))
 
-(mh-defun-compat mh-view-mode-enter
+(defun-mh mh-view-mode-enter
   view-mode-enter (&optional return-to exit-action)
   "Enter View mode.
 This function is used by XEmacs that lacks `view-mode-enter'.
--- a/lisp/mh-e/mh-e.el	Wed Apr 12 17:40:36 2006 +0000
+++ b/lisp/mh-e/mh-e.el	Wed Apr 19 16:23:46 2006 +0000
@@ -109,6 +109,26 @@
 (require 'mh-buffers)
 (require 'mh-compat)
 
+(mh-font-lock-add-keywords
+ 'emacs-lisp-mode
+ (eval-when-compile
+   `((,(concat "(\\("
+               ;; Function declarations (use font-lock-function-name-face).
+               "\\(def\\(un\\|macro\\)-mh\\)\\|"
+               ;; Variable declarations (use font-lock-variable-name-face).
+               "\\(def\\(custom\\|face\\)-mh\\)\\|"
+               ;; Group declarations (use font-lock-type-face).
+               "\\(defgroup-mh\\)"
+               "\\)\\>"
+               ;; Any whitespace and defined object.
+               "[ \t'\(]*"
+               "\\(setf[ \t]+\\sw+)\\|\\sw+\\)?")
+      (1 font-lock-keyword-face)
+      (7 (cond ((match-beginning 2) font-lock-function-name-face)
+               ((match-beginning 4) font-lock-variable-name-face)
+               (t font-lock-type-face))
+         nil t)))))
+
 
 
 ;;; Global Variables
@@ -603,7 +623,7 @@
   (mh-exchange-point-and-mark-preserving-active-mark))
 
 ;; Shush compiler.
-(eval-when-compile (mh-do-in-xemacs (defvar mark-active)))
+(defvar mark-active)                    ; XEmacs
 
 (defun mh-exchange-point-and-mark-preserving-active-mark ()
   "Put the mark where point is now, and point where the mark is now.
@@ -664,7 +684,7 @@
                       (t t))
              collect keyword))))
 
-(defmacro mh-defgroup (symbol members doc &rest args)
+(defmacro defgroup-mh (symbol members doc &rest args)
   "Declare SYMBOL as a customization group containing MEMBERS.
 See documentation for `defgroup' for a description of the arguments
 SYMBOL, MEMBERS, DOC and ARGS.
@@ -672,9 +692,9 @@
 keyword, introduced in Emacs 22."
   (declare (doc-string 3))
   `(defgroup ,symbol ,members ,doc ,@(mh-strip-package-version args)))
-(put 'mh-defgroup 'lisp-indent-function 'defun)
-
-(defmacro mh-defcustom (symbol value doc &rest args)
+(put 'defgroup-mh 'lisp-indent-function 'defun)
+
+(defmacro defcustom-mh (symbol value doc &rest args)
   "Declare SYMBOL as a customizable variable that defaults to VALUE.
 See documentation for `defcustom' for a description of the arguments
 SYMBOL, VALUE, DOC and ARGS.
@@ -682,9 +702,9 @@
 keyword, introduced in Emacs 22."
   (declare (doc-string 3))
   `(defcustom ,symbol ,value ,doc ,@(mh-strip-package-version args)))
-(put 'mh-defcustom 'lisp-indent-function 'defun)
-
-(defmacro mh-defface (face spec doc &rest args)
+(put 'defcustom-mh 'lisp-indent-function 'defun)
+
+(defmacro defface-mh (face spec doc &rest args)
   "Declare FACE as a customizable face that defaults to SPEC.
 See documentation for `defface' for a description of the arguments
 FACE, SPEC, DOC and ARGS.
@@ -692,13 +712,13 @@
 keyword, introduced in Emacs 22."
   (declare (doc-string 3))
   `(defface ,face ,spec ,doc ,@(mh-strip-package-version args)))
-(put 'mh-defface 'lisp-indent-function 'defun)
+(put 'defface-mh 'lisp-indent-function 'defun)
 
 
 
 ;;; Variant Support
 
-(mh-defcustom mh-path nil
+(defcustom-mh mh-path nil
   "*Additional list of directories to search for MH.
 See `mh-variant'."
   :group 'mh-e
@@ -912,7 +932,7 @@
                (mapconcat '(lambda (x) (format "%s" (car x)))
                           (mh-variants) " or "))))))
 
-(mh-defcustom mh-variant 'autodetect
+(defcustom-mh mh-variant 'autodetect
   "*Specifies the variant used by MH-E.
 
 The default setting of this option is \"Auto-detect\" which means
@@ -989,148 +1009,148 @@
 
 (if (boundp 'customize-package-emacs-version-alist)
     (add-to-list 'customize-package-emacs-version-alist
-                 '(MH-E ("6.0" "22.1") ("6.1" "22.1") ("7.0" "22.1")
-                        ("7.1" "22.1") ("7.2" "22.1") ("7.3" "22.1")
-                        ("7.4" "22.1") ("8.0" "22.1"))))
+                 '(MH-E ("6.0" . "22.1") ("6.1" . "22.1") ("7.0" . "22.1")
+                        ("7.1" . "22.1") ("7.2" . "22.1") ("7.3" . "22.1")
+                        ("7.4" . "22.1") ("8.0" . "22.1"))))
 
 
 
 ;;; MH-E Customization Groups
 
-(mh-defgroup mh-e nil
+(defgroup-mh 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
-  :package-version '(MH-E "8.0"))
-
-(mh-defgroup mh-alias nil
+  :package-version '(MH-E . "8.0"))
+
+(defgroup-mh mh-alias nil
   "Aliases."
   :link '(custom-manual "(mh-e)Aliases")
   :prefix "mh-alias-"
   :group 'mh-e
-  :package-version '(MH-E "7.1"))
-
-(mh-defgroup mh-folder nil
+  :package-version '(MH-E . "7.1"))
+
+(defgroup-mh mh-folder nil
   "Organizing your mail with folders."
   :prefix "mh-"
   :link '(custom-manual "(mh-e)Folders")
   :group 'mh-e
-  :package-version '(MH-E "7.1"))
-
-(mh-defgroup mh-folder-selection nil
+  :package-version '(MH-E . "7.1"))
+
+(defgroup-mh mh-folder-selection nil
   "Folder selection."
   :prefix "mh-"
   :link '(custom-manual "(mh-e)Folder Selection")
   :group 'mh-e
-  :package-version '(MH-E "8.0"))
-
-(mh-defgroup mh-identity nil
+  :package-version '(MH-E . "8.0"))
+
+(defgroup-mh mh-identity nil
   "Identities."
   :link '(custom-manual "(mh-e)Identities")
   :prefix "mh-identity-"
   :group 'mh-e
-  :package-version '(MH-E "7.1"))
-
-(mh-defgroup mh-inc nil
+  :package-version '(MH-E . "7.1"))
+
+(defgroup-mh mh-inc nil
   "Incorporating your mail."
   :prefix "mh-inc-"
   :link '(custom-manual "(mh-e)Incorporating Mail")
   :group 'mh-e
-  :package-version '(MH-E "8.0"))
-
-(mh-defgroup mh-junk nil
+  :package-version '(MH-E . "8.0"))
+
+(defgroup-mh mh-junk nil
   "Dealing with junk mail."
   :link '(custom-manual "(mh-e)Junk")
   :prefix "mh-junk-"
   :group 'mh-e
-  :package-version '(MH-E "7.3"))
-
-(mh-defgroup mh-letter nil
+  :package-version '(MH-E . "7.3"))
+
+(defgroup-mh mh-letter nil
   "Editing a draft."
   :prefix "mh-"
   :link '(custom-manual "(mh-e)Editing Drafts")
   :group 'mh-e
-  :package-version '(MH-E "7.1"))
-
-(mh-defgroup mh-ranges nil
+  :package-version '(MH-E . "7.1"))
+
+(defgroup-mh mh-ranges nil
   "Ranges."
   :prefix "mh-"
   :link '(custom-manual "(mh-e)Ranges")
   :group 'mh-e
-  :package-version '(MH-E "8.0"))
-
-(mh-defgroup mh-scan-line-formats nil
+  :package-version '(MH-E . "8.0"))
+
+(defgroup-mh mh-scan-line-formats nil
   "Scan line formats."
   :link '(custom-manual "(mh-e)Scan Line Formats")
   :prefix "mh-"
   :group 'mh-e
-  :package-version '(MH-E "8.0"))
-
-(mh-defgroup mh-search nil
+  :package-version '(MH-E . "8.0"))
+
+(defgroup-mh mh-search nil
   "Searching."
   :link '(custom-manual "(mh-e)Searching")
   :prefix "mh-search-"
   :group 'mh-e
-  :package-version '(MH-E "8.0"))
-
-(mh-defgroup mh-sending-mail nil
+  :package-version '(MH-E . "8.0"))
+
+(defgroup-mh mh-sending-mail nil
   "Sending mail."
   :prefix "mh-"
   :link '(custom-manual "(mh-e)Sending Mail")
   :group 'mh-e
-  :package-version '(MH-E "8.0"))
-
-(mh-defgroup mh-sequences nil
+  :package-version '(MH-E . "8.0"))
+
+(defgroup-mh mh-sequences nil
   "Sequences."
   :prefix "mh-"
   :link '(custom-manual "(mh-e)Sequences")
   :group 'mh-e
-  :package-version '(MH-E "8.0"))
-
-(mh-defgroup mh-show nil
+  :package-version '(MH-E . "8.0"))
+
+(defgroup-mh mh-show nil
   "Reading your mail."
   :prefix "mh-"
   :link '(custom-manual "(mh-e)Reading Mail")
   :group 'mh-e
-  :package-version '(MH-E "7.1"))
-
-(mh-defgroup mh-speedbar nil
+  :package-version '(MH-E . "7.1"))
+
+(defgroup-mh mh-speedbar nil
   "The speedbar."
   :prefix "mh-speed-"
   :link '(custom-manual "(mh-e)Speedbar")
   :group 'mh-e
-  :package-version '(MH-E "8.0"))
-
-(mh-defgroup mh-thread nil
+  :package-version '(MH-E . "8.0"))
+
+(defgroup-mh mh-thread nil
   "Threading."
   :prefix "mh-thread-"
   :link '(custom-manual "(mh-e)Threading")
   :group 'mh-e
-  :package-version '(MH-E "8.0"))
-
-(mh-defgroup mh-tool-bar nil
+  :package-version '(MH-E . "8.0"))
+
+(defgroup-mh mh-tool-bar nil
   "The tool bar"
   :link '(custom-manual "(mh-e)Tool Bar")
   :prefix "mh-"
   :group 'mh-e
-  :package-version '(MH-E "8.0"))
-
-(mh-defgroup mh-hooks nil
+  :package-version '(MH-E . "8.0"))
+
+(defgroup-mh mh-hooks nil
   "MH-E hooks."
   :link '(custom-manual "(mh-e)Top")
   :prefix "mh-"
   :group 'mh-e
-  :package-version '(MH-E "7.1"))
-
-(mh-defgroup mh-faces nil
+  :package-version '(MH-E . "7.1"))
+
+(defgroup-mh mh-faces nil
   "Faces used in MH-E."
   :link '(custom-manual "(mh-e)Top")
   :prefix "mh-"
   :group 'faces
   :group 'mh-e
-  :package-version '(MH-E "7.1"))
+  :package-version '(MH-E . "7.1"))
 
 
 
@@ -1140,7 +1160,7 @@
 
 ;;; Aliases (:group 'mh-alias)
 
-(mh-defcustom mh-alias-completion-ignore-case-flag t
+(defcustom-mh mh-alias-completion-ignore-case-flag t
   "*Non-nil means don't consider case significant in MH alias completion.
 
 As MH ignores case in the aliases, so too does MH-E. However, you
@@ -1149,9 +1169,9 @@
 lowercase for mailing lists and uppercase for people."
   :type 'boolean
   :group 'mh-alias
-  :package-version '(MH-E "7.1"))
-
-(mh-defcustom mh-alias-expand-aliases-flag nil
+  :package-version '(MH-E . "7.1"))
+
+(defcustom-mh mh-alias-expand-aliases-flag nil
   "*Non-nil means to expand aliases entered in the minibuffer.
 
 In other words, aliases entered in the minibuffer will be
@@ -1159,9 +1179,9 @@
 this expansion is not performed."
   :type 'boolean
   :group 'mh-alias
-  :package-version '(MH-E "7.1"))
-
-(mh-defcustom mh-alias-flash-on-comma t
+  :package-version '(MH-E . "7.1"))
+
+(defcustom-mh mh-alias-flash-on-comma t
   "*Specify whether to flash address or warn on translation.
 
 This option controls the behavior when a [comma] is pressed while
@@ -1172,9 +1192,9 @@
                  (const :tag "Flash and Warn If No Alias" 1)
                  (const :tag "Don't Flash Nor Warn If No Alias" nil))
   :group 'mh-alias
-  :package-version '(MH-E "7.1"))
-
-(mh-defcustom mh-alias-insert-file nil
+  :package-version '(MH-E . "7.1"))
+
+(defcustom-mh mh-alias-insert-file nil
   "*Filename used to store a new MH-E alias.
 
 The default setting of this option is \"Use Aliasfile Profile
@@ -1186,9 +1206,9 @@
                  (file :tag "Alias File")
                  (repeat :tag "List of Alias Files" file))
   :group 'mh-alias
-  :package-version '(MH-E "7.1"))
-
-(mh-defcustom mh-alias-insertion-location 'sorted
+  :package-version '(MH-E . "7.1"))
+
+(defcustom-mh mh-alias-insertion-location 'sorted
   "Specifies where new aliases are entered in alias files.
 
 This option is set to \"Alphabetical\" by default. If you organize
@@ -1198,9 +1218,9 @@
                  (const :tag "Top" top)
                  (const :tag "Bottom" bottom))
   :group 'mh-alias
-  :package-version '(MH-E "7.1"))
-
-(mh-defcustom mh-alias-local-users t
+  :package-version '(MH-E . "7.1"))
+
+(defcustom-mh mh-alias-local-users t
   "*If on, local users are added to alias completion.
 
 Aliases are created from \"/etc/passwd\" entries with a user ID
@@ -1219,9 +1239,9 @@
 NIS password file."
   :type '(choice (boolean) (string))
   :group 'mh-alias
-  :package-version '(MH-E "7.1"))
-
-(mh-defcustom mh-alias-local-users-prefix "local."
+  :package-version '(MH-E . "7.1"))
+
+(defcustom-mh mh-alias-local-users-prefix "local."
   "*String prefixed to the real names of users from the password file.
 This option can also be set to \"Use Login\".
 
@@ -1241,9 +1261,9 @@
   :type '(choice (const :tag "Use Login" nil)
                  (string))
   :group 'mh-alias
-  :package-version '(MH-E "7.4"))
-
-(mh-defcustom mh-alias-passwd-gecos-comma-separator-flag t
+  :package-version '(MH-E . "7.4"))
+
+(defcustom-mh mh-alias-passwd-gecos-comma-separator-flag t
   "*Non-nil means the gecos field in the password file uses a comma separator.
 
 In the example in `mh-alias-local-users-prefix', commas are used
@@ -1253,11 +1273,11 @@
 whose contents may contain commas, you can turn this option off."
   :type 'boolean
   :group 'mh-alias
-  :package-version '(MH-E "7.4"))
+  :package-version '(MH-E . "7.4"))
 
 ;;; Organizing Your Mail with Folders (:group 'mh-folder)
 
-(mh-defcustom mh-new-messages-folders t
+(defcustom-mh mh-new-messages-folders t
   "Folders searched for the \"unseen\" sequence.
 
 Set this option to \"Inbox\" to search the \"+inbox\" folder or
@@ -1270,9 +1290,9 @@
                  (const :tag "All" nil)
                  (repeat :tag "Choose Folders" (string :tag "Folder")))
   :group 'mh-folder
-  :package-version '(MH-E "8.0"))
-
-(mh-defcustom mh-ticked-messages-folders t
+  :package-version '(MH-E . "8.0"))
+
+(defcustom-mh mh-ticked-messages-folders t
   "Folders searched for `mh-tick-seq'.
 
 Set this option to \"Inbox\" to search the \"+inbox\" folder or
@@ -1285,9 +1305,9 @@
                  (const :tag "All" nil)
                  (repeat :tag "Choose Folders" (string :tag "Folder")))
   :group 'mh-folder
-  :package-version '(MH-E "8.0"))
-
-(mh-defcustom mh-large-folder 200
+  :package-version '(MH-E . "8.0"))
+
+(defcustom-mh mh-large-folder 200
   "The number of messages that indicates a large folder.
 
 If a folder is deemed to be large, that is the number of messages
@@ -1297,24 +1317,24 @@
 folders are treated as if they are small."
   :type '(choice (const :tag "No Limit") integer)
   :group 'mh-folder
-  :package-version '(MH-E "7.0"))
-
-(mh-defcustom mh-recenter-summary-flag nil
+  :package-version '(MH-E . "7.0"))
+
+(defcustom-mh mh-recenter-summary-flag nil
   "*Non-nil means to recenter the summary window.
 
 If this option is turned on, recenter the summary window when the
 show window is toggled off."
   :type 'boolean
   :group 'mh-folder
-  :package-version '(MH-E "7.0"))
-
-(mh-defcustom mh-recursive-folders-flag nil
+  :package-version '(MH-E . "7.0"))
+
+(defcustom-mh mh-recursive-folders-flag nil
   "*Non-nil means that commands which operate on folders do so recursively."
   :type 'boolean
   :group 'mh-folder
-  :package-version '(MH-E "7.0"))
-
-(mh-defcustom mh-sortm-args nil
+  :package-version '(MH-E . "7.0"))
+
+(defcustom-mh mh-sortm-args nil
   "*Additional arguments for \"sortm\"\\<mh-folder-mode-map>.
 
 This option is consulted when a prefix argument is used with
@@ -1324,11 +1344,11 @@
 \"subject\")\" is a useful setting."
   :type 'string
   :group 'mh-folder
-  :package-version '(MH-E "8.0"))
+  :package-version '(MH-E . "8.0"))
 
 ;;; Folder Selection (:group 'mh-folder-selection)
 
-(mh-defcustom mh-default-folder-for-message-function nil
+(defcustom-mh mh-default-folder-for-message-function nil
   "Function to select a default folder for refiling or \"Fcc:\".
 
 When this function is called, the current buffer contains the message
@@ -1338,9 +1358,9 @@
 the default, or an empty string to suppress the default entirely."
   :type 'function
   :group 'mh-folder-selection
-  :package-version '(MH-E "8.0"))
-
-(mh-defcustom mh-default-folder-list nil
+  :package-version '(MH-E . "8.0"))
+
+(defcustom-mh mh-default-folder-list nil
   "*List of addresses and folders.
 
 The folder name associated with the first address found in this
@@ -1356,9 +1376,9 @@
                        (string :tag "Folder")
                        (boolean :tag "Check Recipient")))
   :group 'mh-folder-selection
-  :package-version '(MH-E "7.2"))
-
-(mh-defcustom mh-default-folder-must-exist-flag t
+  :package-version '(MH-E . "7.2"))
+
+(defcustom-mh mh-default-folder-must-exist-flag t
   "*Non-nil means guessed folder name must exist to be used.
 
 If the derived folder does not exist, and this option is on, then
@@ -1370,9 +1390,9 @@
 for more information."
   :type 'boolean
   :group 'mh-folder-selection
-  :package-version '(MH-E "7.2"))
-
-(mh-defcustom mh-default-folder-prefix ""
+  :package-version '(MH-E . "7.2"))
+
+(defcustom-mh mh-default-folder-prefix ""
   "*Prefix used for folder names generated from aliases.
 The prefix is used to prevent clutter in your mail directory.
 
@@ -1380,7 +1400,7 @@
 for more information."
   :type 'string
   :group 'mh-folder-selection
-  :package-version '(MH-E "7.2"))
+  :package-version '(MH-E . "7.2"))
 
 ;;; Identities (:group 'mh-identity)
 
@@ -1391,7 +1411,7 @@
 Real definition will take effect when mh-identity is loaded."
       nil)))
 
-(mh-defcustom mh-identity-list nil
+(defcustom-mh mh-identity-list nil
   "*List of identities.
 
 To customize this option, click on the \"INS\" button and enter a label
@@ -1458,9 +1478,9 @@
          (set-default symbol value)
          (mh-identity-make-menu-no-autoload))
   :group 'mh-identity
-  :package-version '(MH-E "7.1"))
-
-(mh-defcustom mh-auto-fields-list nil
+  :package-version '(MH-E . "7.1"))
+
+(defcustom-mh mh-auto-fields-list nil
   "List of recipients for which header lines are automatically inserted.
 
 This option can be used to set the identity depending on the
@@ -1519,16 +1539,16 @@
                                  (string :tag "Field")
                                  (string :tag "Value"))))))
   :group 'mh-identity
-  :package-version '(MH-E "7.3"))
-
-(mh-defcustom mh-auto-fields-prompt-flag t
+  :package-version '(MH-E . "7.3"))
+
+(defcustom-mh mh-auto-fields-prompt-flag t
   "*Non-nil means to prompt before sending if fields inserted.
 See `mh-auto-fields-list'."
   :type 'boolean
   :group 'mh-identity
-  :package-version '(MH-E "8.0"))
-
-(mh-defcustom mh-identity-default nil
+  :package-version '(MH-E . "8.0"))
+
+(defcustom-mh mh-identity-default nil
   "Default identity to use when `mh-letter-mode' is called.
 See `mh-identity-list'."
   :type (append
@@ -1537,9 +1557,9 @@
                (mapcar (function (lambda (arg) `(const ,arg)))
                        (mapcar 'car mh-identity-list))))
   :group 'mh-identity
-  :package-version '(MH-E "7.1"))
-
-(mh-defcustom mh-identity-handlers
+  :package-version '(MH-E . "7.1"))
+
+(defcustom-mh mh-identity-handlers
   '(("From" . mh-identity-handler-top)
     (":default" . mh-identity-handler-bottom)
     (":attribution-verb" . mh-identity-handler-attribution-verb)
@@ -1571,11 +1591,11 @@
 containing the VALUE for the field is given."
   :type '(repeat (cons (string :tag "Field") function))
   :group 'mh-identity
-  :package-version '(MH-E "8.0"))
+  :package-version '(MH-E . "8.0"))
 
 ;;; Incorporating Your Mail (:group 'mh-inc)
 
-(mh-defcustom mh-inc-prog "inc"
+(defcustom-mh mh-inc-prog "inc"
   "*Program to incorporate new mail into a folder.
 
 This program generates a one-line summary for each of the new
@@ -1585,7 +1605,7 @@
 several scan line format variables appropriately."
   :type 'string
   :group 'mh-inc
-  :package-version '(MH-E "6.0"))
+  :package-version '(MH-E . "6.0"))
 
 (eval-and-compile
   (unless (fboundp 'mh-inc-spool-make-no-autoload)
@@ -1594,7 +1614,7 @@
 Real definition will take effect when mh-inc is loaded."
       nil)))
 
-(mh-defcustom mh-inc-spool-list nil
+(defcustom-mh mh-inc-spool-list nil
   "*Alternate spool files.
 
 You can use the `mh-inc-spool-list' variable to direct MH-E to
@@ -1635,7 +1655,7 @@
          (set-default symbol value)
          (mh-inc-spool-make-no-autoload))
   :group 'mh-inc
-  :package-version '(MH-E "7.3"))
+  :package-version '(MH-E . "7.3"))
 
 ;;; Dealing with Junk Mail (:group 'mh-junk)
 
@@ -1667,7 +1687,7 @@
                   until (executable-find (symbol-name (car element)))
                   finally return (car element)))))
 
-(mh-defcustom mh-junk-background nil
+(defcustom-mh mh-junk-background nil
   "If on, spam programs are run in background.
 
 By default, the programs are run in the foreground, but this can
@@ -1677,16 +1697,16 @@
   :type '(choice (const :tag "Off" nil)
                  (const :tag "On" 0))
   :group 'mh-junk
-  :package-version '(MH-E "8.0"))
-
-(mh-defcustom mh-junk-disposition nil
+  :package-version '(MH-E . "8.0"))
+
+(defcustom-mh mh-junk-disposition nil
   "Disposition of junk mail."
   :type '(choice (const :tag "Delete Spam" nil)
                  (string :tag "Spam Folder"))
   :group 'mh-junk
-  :package-version '(MH-E "8.0"))
-
-(mh-defcustom mh-junk-program nil
+  :package-version '(MH-E . "8.0"))
+
+(defcustom-mh mh-junk-program nil
   "Spam program that MH-E should use.
 
 The default setting of this option is \"Auto-detect\" which means
@@ -1700,11 +1720,11 @@
                  (const :tag "SpamProbe" spamprobe))
   :set 'mh-junk-choose
   :group 'mh-junk
-  :package-version '(MH-E "7.3"))
+  :package-version '(MH-E . "7.3"))
 
 ;;; Editing a Draft (:group 'mh-letter)
 
-(mh-defcustom mh-compose-insertion (if (locate-library "mml") 'mml 'mh)
+(defcustom-mh mh-compose-insertion (if (locate-library "mml") 'mml 'mh)
   "Type of tags used when composing MIME messages.
 
 In addition to MH-style directives, MH-E also supports MML (MIME
@@ -1716,23 +1736,23 @@
   :type '(choice (const :tag "MML" mml)
                  (const :tag "MH"  mh))
   :group 'mh-letter
-  :package-version '(MH-E "7.0"))
-
-(mh-defcustom mh-compose-skipped-header-fields
+  :package-version '(MH-E . "7.0"))
+
+(defcustom-mh mh-compose-skipped-header-fields
   '("From" "Organization" "References" "In-Reply-To"
     "X-Face" "Face" "X-Image-URL" "X-Mailer")
   "List of header fields to skip over when navigating in draft."
   :type '(repeat (string :tag "Field"))
   :group 'mh-letter
-  :package-version '(MH-E "7.4"))
-
-(mh-defcustom mh-compose-space-does-completion-flag nil
+  :package-version '(MH-E . "7.4"))
+
+(defcustom-mh mh-compose-space-does-completion-flag nil
   "*Non-nil means \\<mh-letter-mode-map>\\[mh-letter-complete-or-space] does completion in message header."
   :type 'boolean
   :group 'mh-letter
-  :package-version '(MH-E "7.4"))
-
-(mh-defcustom mh-delete-yanked-msg-window-flag nil
+  :package-version '(MH-E . "7.4"))
+
+(defcustom-mh mh-delete-yanked-msg-window-flag nil
   "*Non-nil means delete any window displaying the message.
 
 This deletes the window containing the original message after
@@ -1740,9 +1760,9 @@
 more room on your screen for your reply."
   :type 'boolean
   :group 'mh-letter
-  :package-version '(MH-E "7.0"))
-
-(mh-defcustom mh-extract-from-attribution-verb "wrote:"
+  :package-version '(MH-E . "7.0"))
+
+(defcustom-mh mh-extract-from-attribution-verb "wrote:"
   "*Verb to use for attribution when a message is yanked by \\<mh-letter-mode-map>\\[mh-yank-cur-msg].
 
 The attribution consists of the sender's name and email address
@@ -1754,9 +1774,9 @@
                  (const "schrieb:")
                  (string :tag "Custom String"))
   :group 'mh-letter
-  :package-version '(MH-E "7.0"))
-
-(mh-defcustom mh-ins-buf-prefix "> "
+  :package-version '(MH-E . "7.0"))
+
+(defcustom-mh mh-ins-buf-prefix "> "
   "*String to put before each line of a yanked or inserted message.
 
 The prefix \"> \" is the default setting of this option. I
@@ -1770,9 +1790,9 @@
 `mail-citation-hook'."
   :type 'string
   :group 'mh-letter
-  :package-version '(MH-E "6.0"))
-
-(mh-defcustom mh-letter-complete-function 'ispell-complete-word
+  :package-version '(MH-E . "6.0"))
+
+(defcustom-mh mh-letter-complete-function 'ispell-complete-word
   "*Function to call when completing outside of address or folder fields.
 
 In the body of the message,
@@ -1780,18 +1800,18 @@
 which is set to \"ispell-complete-word\" by default."
   :type '(choice function (const nil))
   :group 'mh-letter
-  :package-version '(MH-E "7.1"))
-
-(mh-defcustom mh-letter-fill-column 72
+  :package-version '(MH-E . "7.1"))
+
+(defcustom-mh mh-letter-fill-column 72
   "*Fill column to use in MH Letter mode.
 
 By default, this option is 72 to allow others to quote your
 message without line wrapping."
   :type 'integer
   :group 'mh-letter
-  :package-version '(MH-E "6.0"))
-
-(mh-defcustom mh-mml-method-default (if mh-pgp-support-flag "pgpmime" "none")
+  :package-version '(MH-E . "6.0"))
+
+(defcustom-mh mh-mml-method-default (if mh-pgp-support-flag "pgpmime" "none")
   "Default method to use in security tags.
 
 This option is used to select between a variety of mail security
@@ -1812,9 +1832,9 @@
                  (const :tag "S/MIME" "smime")
                  (const :tag "None" "none"))
   :group 'mh-letter
-  :package-version '(MH-E "8.0"))
-
-(mh-defcustom mh-signature-file-name "~/.signature"
+  :package-version '(MH-E . "8.0"))
+
+(defcustom-mh mh-signature-file-name "~/.signature"
   "*Source of user's signature.
 
 By default, the text of your signature is taken from the file
@@ -1835,9 +1855,9 @@
 `mh-identity-list'."
   :type 'file
   :group 'mh-letter
-  :package-version '(MH-E "6.0"))
-
-(mh-defcustom mh-signature-separator-flag t
+  :package-version '(MH-E . "6.0"))
+
+(defcustom-mh mh-signature-separator-flag t
   "*Non-nil means a signature separator should be inserted.
 
 It is not recommended that you change this option since various
@@ -1846,9 +1866,9 @@
 replying or yanking a letter into a draft."
   :type 'boolean
   :group 'mh-letter
-  :package-version '(MH-E "8.0"))
-
-(mh-defcustom mh-x-face-file "~/.face"
+  :package-version '(MH-E . "8.0"))
+
+(defcustom-mh mh-x-face-file "~/.face"
   "*File containing face header field to insert in outgoing mail.
 
 If the file starts with either of the strings \"X-Face:\", \"Face:\"
@@ -1875,9 +1895,9 @@
 this option doesn't exist."
   :type 'file
   :group 'mh-letter
-  :package-version '(MH-E "7.0"))
-
-(mh-defcustom mh-yank-behavior 'attribution
+  :package-version '(MH-E . "7.0"))
+
+(defcustom-mh mh-yank-behavior 'attribution
   "*Controls which part of a message is yanked by \\<mh-letter-mode-map>\\[mh-yank-cur-msg].
 
 To include the entire message, including the entire header, use
@@ -1920,11 +1940,11 @@
                  (const :tag "Body With Attribution, Automatically"
                         autoattrib))
   :group 'mh-letter
-  :package-version '(MH-E "8.0"))
+  :package-version '(MH-E . "8.0"))
 
 ;;; Ranges (:group 'mh-ranges)
 
-(mh-defcustom mh-interpret-number-as-range-flag t
+(defcustom-mh mh-interpret-number-as-range-flag t
   "*Non-nil means interpret a number as a range.
 
 Since one of the most frequent ranges used is \"last:N\", MH-E
@@ -1933,7 +1953,7 @@
 message 200, then use the range \"200:200\"."
   :type 'boolean
   :group 'mh-ranges
-  :package-version '(MH-E "7.4"))
+  :package-version '(MH-E . "7.4"))
 
 ;;; Scan Line Formats (:group 'mh-scan-line-formats)
 
@@ -1944,7 +1964,7 @@
 Real definition, below, uses variables that aren't defined yet."
       (set-default symbol value))))
 
-(mh-defcustom mh-adaptive-cmd-note-flag t
+(defcustom-mh mh-adaptive-cmd-note-flag t
   "*Non-nil means that the message number width is determined dynamically.
 
 If you've created your own format to handle long message numbers,
@@ -1960,7 +1980,7 @@
   :type 'boolean
   :group 'mh-scan-line-formats
   :set 'mh-adaptive-cmd-note-flag-check
-  :package-version '(MH-E "7.0"))
+  :package-version '(MH-E . "7.0"))
 
 (defun mh-scan-format-file-check (symbol value)
   "Check if desired setting is legal.
@@ -1973,7 +1993,7 @@
              "unless you use \"Use MH-E scan Format\"")
     (set-default symbol value)))
 
-(mh-defcustom mh-scan-format-file t
+(defcustom-mh mh-scan-format-file t
   "Specifies the format file to pass to the scan program.
 
 The default setting for this option is \"Use MH-E scan Format\". This
@@ -1999,7 +2019,7 @@
                  (file  :tag "Specify a scan Format File"))
   :group 'mh-scan-line-formats
   :set 'mh-scan-format-file-check
-  :package-version '(MH-E "6.0"))
+  :package-version '(MH-E . "6.0"))
 
 (defun mh-adaptive-cmd-note-flag-check (symbol value)
   "Check if desired setting is legal.
@@ -2012,7 +2032,7 @@
              "is set to \"Use MH-E scan Format\"")
     (set-default symbol value)))
 
-(mh-defcustom mh-scan-prog "scan"
+(defcustom-mh mh-scan-prog "scan"
   "*Program used to scan messages.
 
 The name of the program that generates a listing of one line per
@@ -2022,12 +2042,12 @@
 \"mh-profile(5)\") to produce a different type of listing."
   :type 'string
   :group 'mh-scan-line-formats
-  :package-version '(MH-E "6.0"))
+  :package-version '(MH-E . "6.0"))
 (make-variable-buffer-local 'mh-scan-prog)
 
 ;;; Searching (:group 'mh-search)
 
-(mh-defcustom mh-search-program nil
+(defcustom-mh mh-search-program nil
   "Search program that MH-E shall use.
 
 The default setting of this option is \"Auto-detect\" which means
@@ -2046,11 +2066,11 @@
                  (const :tag "pick" pick)
                  (const :tag "grep" grep))
   :group 'mh-search
-  :package-version '(MH-E "8.0"))
+  :package-version '(MH-E . "8.0"))
 
 ;;; Sending Mail (:group 'mh-sending-mail)
 
-(mh-defcustom mh-compose-forward-as-mime-flag t
+(defcustom-mh mh-compose-forward-as-mime-flag t
   "*Non-nil means that messages are forwarded as attachments.
 
 By default, this option is on which means that the forwarded
@@ -2064,9 +2084,9 @@
 regardless of the settings of this option."
   :type 'boolean
   :group 'mh-sending-mail
-  :package-version '(MH-E "8.0"))
-
-(mh-defcustom mh-compose-letter-function nil
+  :package-version '(MH-E . "8.0"))
+
+(defcustom-mh mh-compose-letter-function nil
   "Invoked when starting a new draft.
 
 However, it is the last function called before you edit your
@@ -2076,15 +2096,15 @@
 fields."
   :type '(choice (const nil) function)
   :group 'mh-sending-mail
-  :package-version '(MH-E "6.0"))
-
-(mh-defcustom mh-compose-prompt-flag nil
+  :package-version '(MH-E . "6.0"))
+
+(defcustom-mh mh-compose-prompt-flag nil
   "*Non-nil means prompt for header fields when composing a new draft."
   :type 'boolean
   :group 'mh-sending-mail
-  :package-version '(MH-E "7.4"))
-
-(mh-defcustom mh-forward-subject-format "%s: %s"
+  :package-version '(MH-E . "7.4"))
+
+(defcustom-mh mh-forward-subject-format "%s: %s"
   "*Format string for forwarded message subject.
 
 This option is a string which includes two escapes (\"%s\"). The
@@ -2092,9 +2112,9 @@
 and the second one is replaced with the original \"Subject:\"."
   :type 'string
   :group 'mh-sending-mail
-  :package-version '(MH-E "6.0"))
-
-(mh-defcustom mh-insert-x-mailer-flag t
+  :package-version '(MH-E . "6.0"))
+
+(defcustom-mh mh-insert-x-mailer-flag t
   "*Non-nil means append an \"X-Mailer:\" header field to the header.
 
 This header field includes the version of MH-E and Emacs that you
@@ -2102,9 +2122,9 @@
 can turn this option off."
   :type 'boolean
   :group 'mh-sending-mail
-  :package-version '(MH-E "7.0"))
-
-(mh-defcustom mh-redist-full-contents-flag nil
+  :package-version '(MH-E . "7.0"))
+
+(defcustom-mh mh-redist-full-contents-flag nil
   "*Non-nil means the \"dist\" command needs entire letter for redistribution.
 
 This option must be turned on if \"dist\" requires the whole
@@ -2114,9 +2134,9 @@
 has been redistributed before, turn off this option."
   :type 'boolean
   :group 'mh-sending-mail
-  :package-version '(MH-E "8.0"))
-
-(mh-defcustom mh-reply-default-reply-to nil
+  :package-version '(MH-E . "8.0"))
+
+(defcustom-mh mh-reply-default-reply-to nil
   "*Sets the person or persons to whom a reply will be sent.
 
 This option is set to \"Prompt\" by default so that you are
@@ -2130,9 +2150,9 @@
                  (const "cc")
                  (const "all"))
   :group 'mh-sending-mail
-  :package-version '(MH-E "6.0"))
-
-(mh-defcustom mh-reply-show-message-flag t
+  :package-version '(MH-E . "6.0"))
+
+(defcustom-mh mh-reply-show-message-flag t
   "*Non-nil means the MH-Show buffer is displayed when replying.
 
 If you include the message automatically, you can hide the
@@ -2141,7 +2161,7 @@
 See also `mh-reply'."
   :type 'boolean
   :group 'mh-sending-mail
-  :package-version '(MH-E "7.0"))
+  :package-version '(MH-E . "7.0"))
 
 ;;; Sequences (:group 'mh-sequences)
 
@@ -2149,7 +2169,7 @@
 ;; the docstring: "Additional sequences that should not to be preserved can be
 ;; specified by setting `mh-unpropagated-sequences' appropriately." XXX
 
-(mh-defcustom mh-refile-preserves-sequences-flag t
+(defcustom-mh mh-refile-preserves-sequences-flag t
   "*Non-nil means that sequences are preserved when messages are refiled.
 
 If a message is in any sequence (except \"Previous-Sequence:\"
@@ -2158,9 +2178,9 @@
 desired, then turn off this option."
   :type 'boolean
   :group 'mh-sequences
-  :package-version '(MH-E "7.4"))
-
-(mh-defcustom mh-tick-seq 'tick
+  :package-version '(MH-E . "7.4"))
+
+(defcustom-mh mh-tick-seq 'tick
   "The name of the MH sequence for ticked messages.
 
 You can customize this option if you already use the \"tick\"
@@ -2170,9 +2190,9 @@
   :type '(choice (const :tag "Disable Ticking" nil)
                  symbol)
   :group 'mh-sequences
-  :package-version '(MH-E "7.3"))
-
-(mh-defcustom mh-update-sequences-after-mh-show-flag t
+  :package-version '(MH-E . "7.3"))
+
+(defcustom-mh mh-update-sequences-after-mh-show-flag t
   "*Non-nil means flush MH sequences to disk after message is shown\\<mh-folder-mode-map>.
 
 Three sequences are maintained internally by MH-E and pushed out
@@ -2185,11 +2205,11 @@
 commands."
   :type 'boolean
   :group 'mh-sequences
-  :package-version '(MH-E "7.0"))
+  :package-version '(MH-E . "7.0"))
 
 ;;; Reading Your Mail (:group 'mh-show)
 
-(mh-defcustom mh-bury-show-buffer-flag t
+(defcustom-mh mh-bury-show-buffer-flag t
   "*Non-nil means show buffer is buried.
 
 One advantage of not burying the show buffer is that one can
@@ -2198,18 +2218,18 @@
 running \\[electric-buffer-list] to see what I mean."
   :type 'boolean
   :group 'mh-show
-  :package-version '(MH-E "7.0"))
-
-(mh-defcustom mh-clean-message-header-flag t
+  :package-version '(MH-E . "7.0"))
+
+(defcustom-mh mh-clean-message-header-flag t
   "*Non-nil means remove extraneous header fields.
 
 See also `mh-invisible-header-fields-default' and
 `mh-invisible-header-fields'."
   :type 'boolean
   :group 'mh-show
-  :package-version '(MH-E "7.0"))
-
-(mh-defcustom mh-decode-mime-flag (not (not (locate-library "mm-decode")))
+  :package-version '(MH-E . "7.0"))
+
+(defcustom-mh mh-decode-mime-flag (not (not (locate-library "mm-decode")))
   "*Non-nil means attachments are handled\\<mh-folder-mode-map>.
 
 MH-E can handle attachments as well if the Gnus `mm-decode'
@@ -2225,9 +2245,9 @@
 `mh-graphical-smileys-flag' and `mh-graphical-emphasis-flag'."
   :type 'boolean
   :group 'mh-show
-  :package-version '(MH-E "7.0"))
-
-(mh-defcustom mh-display-buttons-for-alternatives-flag nil
+  :package-version '(MH-E . "7.0"))
+
+(defcustom-mh mh-display-buttons-for-alternatives-flag nil
   "*Non-nil means display buttons for all alternative attachments.
 
 Sometimes, a mail program will produce multiple alternatives of
@@ -2237,9 +2257,9 @@
 inline and buttons are shown for each of the other alternatives."
   :type 'boolean
   :group 'mh-show
-  :package-version '(MH-E "7.4"))
-
-(mh-defcustom mh-display-buttons-for-inline-parts-flag nil
+  :package-version '(MH-E . "7.4"))
+
+(defcustom-mh mh-display-buttons-for-inline-parts-flag nil
   "*Non-nil means display buttons for all inline attachments\\<mh-folder-mode-map>.
 
 The sender can request that attachments should be viewed inline so
@@ -2260,9 +2280,9 @@
 text (including HTML) and images."
   :type 'boolean
   :group 'mh-show
-  :package-version '(MH-E "7.0"))
-
-(mh-defcustom mh-do-not-confirm-flag nil
+  :package-version '(MH-E . "7.0"))
+
+(defcustom-mh mh-do-not-confirm-flag nil
   "*Non-nil means non-reversible commands do not prompt for confirmation.
 
 Commands such as `mh-pack-folder' prompt to confirm whether to
@@ -2272,9 +2292,9 @@
 retracted--without question."
   :type 'boolean
   :group 'mh-show
-  :package-version '(MH-E "7.0"))
-
-(mh-defcustom mh-fetch-x-image-url nil
+  :package-version '(MH-E . "7.0"))
+
+(defcustom-mh mh-fetch-x-image-url nil
   "*Control fetching of \"X-Image-URL:\" header field image.
 
 Ths option controls the fetching of the \"X-Image-URL:\" header
@@ -2308,9 +2328,9 @@
   :type '(choice (const :tag "Ask Before Fetching" ask)
                  (const :tag "Never Fetch" nil))
   :group 'mh-show
-  :package-version '(MH-E "7.3"))
-
-(mh-defcustom mh-graphical-smileys-flag t
+  :package-version '(MH-E . "7.3"))
+
+(defcustom-mh mh-graphical-smileys-flag t
   "*Non-nil means graphical smileys are displayed.
 
 It is a long standing custom to inject body language using a
@@ -2323,9 +2343,9 @@
 turned off."
   :type 'boolean
   :group 'mh-show
-  :package-version '(MH-E "7.0"))
-
-(mh-defcustom mh-graphical-emphasis-flag t
+  :package-version '(MH-E . "7.0"))
+
+(defcustom-mh mh-graphical-emphasis-flag t
   "*Non-nil means graphical emphasis is displayed.
 
 A few typesetting features are indicated in ASCII text with
@@ -2340,9 +2360,9 @@
 turned off."
   :type 'boolean
   :group 'mh-show
-  :package-version '(MH-E "7.0"))
-
-(mh-defcustom mh-highlight-citation-style 'gnus
+  :package-version '(MH-E . "7.0"))
+
+(defcustom-mh mh-highlight-citation-style 'gnus
   "Style for highlighting citations.
 
 If the sender of the message has cited other messages in his
@@ -2356,7 +2376,7 @@
                  (const :tag "Monochrome" font-lock)
                  (const :tag "None" nil))
   :group 'mh-show
-  :package-version '(MH-E "8.0"))
+  :package-version '(MH-E . "8.0"))
 
 ;; Keep fields alphabetized. Mention source, if known.
 (defvar mh-invisible-header-fields-internal
@@ -2569,7 +2589,7 @@
 `mh-invisible-header-fields' and `mh-invisible-header-fields', it
 cannot be run until both variables have been initialized.")
 
-(mh-defcustom mh-invisible-header-fields nil
+(defcustom-mh mh-invisible-header-fields nil
   "*Additional header fields to hide.
 
 Header fields that you would like to hide that aren't listed in
@@ -2588,9 +2608,9 @@
          (set-default symbol value)
          (mh-invisible-headers))
   :group 'mh-show
-  :package-version '(MH-E "7.1"))
-
-(mh-defcustom mh-invisible-header-fields-default nil
+  :package-version '(MH-E . "7.1"))
+
+(defcustom-mh mh-invisible-header-fields-default nil
   "*List of hidden header fields.
 
 The header fields listed in this option are hidden, although you
@@ -2606,7 +2626,7 @@
          (set-default symbol value)
          (mh-invisible-headers))
   :group 'mh-show
-  :package-version '(MH-E "8.0"))
+  :package-version '(MH-E . "8.0"))
 
 (defvar mh-invisible-header-fields-compiled nil
   "*Regexp matching lines in a message header that are not to be shown.
@@ -2643,7 +2663,7 @@
 ;; Compile invisible header fields.
 (mh-invisible-headers)
 
-(mh-defcustom mh-lpr-command-format "lpr -J '%s'"
+(defcustom-mh mh-lpr-command-format "lpr -J '%s'"
   "*Command used to print\\<mh-folder-mode-map>.
 
 This option contains the Unix command line which performs the
@@ -2658,9 +2678,9 @@
 \\[mh-ps-print-msg-file]."
   :type 'string
   :group 'mh-show
-  :package-version '(MH-E "6.0"))
-
-(mh-defcustom mh-max-inline-image-height nil
+  :package-version '(MH-E . "6.0"))
+
+(defcustom-mh mh-max-inline-image-height nil
   "*Maximum inline image height if \"Content-Disposition:\" is not present.
 
 Some older mail programs do not insert this needed plumbing to
@@ -2674,9 +2694,9 @@
 these numbers."
   :type '(choice (const nil) integer)
   :group 'mh-show
-  :package-version '(MH-E "7.0"))
-
-(mh-defcustom mh-max-inline-image-width nil
+  :package-version '(MH-E . "7.0"))
+
+(defcustom-mh mh-max-inline-image-width nil
   "*Maximum inline image width if \"Content-Disposition:\" is not present.
 
 Some older mail programs do not insert this needed plumbing to
@@ -2690,9 +2710,9 @@
 these numbers."
   :type '(choice (const nil) integer)
   :group 'mh-show
-  :package-version '(MH-E "7.0"))
-
-(mh-defcustom mh-mhl-format-file nil
+  :package-version '(MH-E . "7.0"))
+
+(defcustom-mh mh-mhl-format-file nil
   "*Specifies the format file to pass to the \"mhl\" program.
 
 Normally MH-E takes care of displaying messages itself (rather than
@@ -2714,9 +2734,9 @@
                  (const :tag "Use Default mhl Format" t)
                  (file :tag "Specify an mhl Format File"))
   :group 'mh-show
-  :package-version '(MH-E "8.0"))
-
-(mh-defcustom mh-mime-save-parts-default-directory t
+  :package-version '(MH-E . "8.0"))
+
+(defcustom-mh mh-mime-save-parts-default-directory t
   "Default directory to use for \\<mh-folder-mode-map>\\[mh-mime-save-parts].
 
 The default value for this option is \"Prompt Always\" so that
@@ -2730,9 +2750,9 @@
                  (const :tag "Prompt Always" t)
                  directory)
   :group 'mh-show
-  :package-version '(MH-E "7.0"))
-
-(mh-defcustom mh-print-background-flag nil
+  :package-version '(MH-E . "7.0"))
+
+(defcustom-mh mh-print-background-flag nil
   "*Non-nil means messages should be printed in the background\\<mh-folder-mode-map>.
 
 Normally messages are printed in the foreground. If this is slow on
@@ -2746,9 +2766,9 @@
 \\[mh-ps-print-msg-file]."
   :type 'boolean
   :group 'mh-show
-  :package-version '(MH-E "7.0"))
-
-(mh-defcustom mh-show-maximum-size 0
+  :package-version '(MH-E . "7.0"))
+
+(defcustom-mh mh-show-maximum-size 0
   "*Maximum size of message (in bytes) to display automatically.
 
 This option provides an opportunity to skip over large messages
@@ -2756,9 +2776,9 @@
 message are shown regardless of size."
   :type 'integer
   :group 'mh-show
-  :package-version '(MH-E "8.0"))
-
-(mh-defcustom mh-show-use-xface-flag (>= emacs-major-version 21)
+  :package-version '(MH-E . "8.0"))
+
+(defcustom-mh mh-show-use-xface-flag (>= emacs-major-version 21)
   "*Non-nil means display face images in MH-show buffers.
 
 MH-E can display the content of \"Face:\", \"X-Face:\", and
@@ -2796,9 +2816,9 @@
 \"X-Image-URL:\" header field image."
   :type 'boolean
   :group 'mh-show
-  :package-version '(MH-E "7.0"))
-
-(mh-defcustom mh-store-default-directory nil
+  :package-version '(MH-E . "7.0"))
+
+(defcustom-mh mh-store-default-directory nil
   "*Default directory for \\<mh-folder-mode-map>\\[mh-store-msg].
 
 If you would like to change the initial default directory,
@@ -2808,9 +2828,9 @@
   :type '(choice (const :tag "Current" nil)
                  directory)
   :group 'mh-show
-  :package-version '(MH-E "6.0"))
-
-(mh-defcustom mh-summary-height nil
+  :package-version '(MH-E . "6.0"))
+
+(defcustom-mh mh-summary-height nil
   "*Number of lines in MH-Folder buffer (including the mode line).
 
 The default value of this option is \"Automatic\" which means
@@ -2821,20 +2841,20 @@
   :type '(choice (const :tag "Automatic" nil)
                  (integer :tag "Fixed Size"))
   :group 'mh-show
-  :package-version '(MH-E "7.4"))
+  :package-version '(MH-E . "7.4"))
 
 ;;; The Speedbar (:group 'mh-speedbar)
 
-(mh-defcustom mh-speed-update-interval 60
+(defcustom-mh mh-speed-update-interval 60
   "Time between speedbar updates in seconds.
 Set to 0 to disable automatic update."
   :type 'integer
   :group 'mh-speedbar
-  :package-version '(MH-E "8.0"))
+  :package-version '(MH-E . "8.0"))
 
 ;;; Threading (:group 'mh-thread)
 
-(mh-defcustom mh-show-threads-flag nil
+(defcustom-mh mh-show-threads-flag nil
   "*Non-nil means new folders start in threaded mode.
 
 Threading large number of messages can be time consuming so this
@@ -2843,14 +2863,14 @@
 threaded is less than `mh-large-folder'."
   :type 'boolean
   :group 'mh-thread
-  :package-version '(MH-E "7.1"))
+  :package-version '(MH-E . "7.1"))
 
 ;;; The Tool Bar (:group 'mh-tool-bar)
 
 ;; mh-tool-bar-folder-buttons and mh-tool-bar-letter-buttons defined
 ;; dynamically in mh-tool-bar.el.
 
-(mh-defcustom mh-tool-bar-search-function 'mh-search
+(defcustom-mh mh-tool-bar-search-function 'mh-search
   "*Function called by the tool bar search button.
 
 By default, this is set to `mh-search'. You can also choose
@@ -2859,11 +2879,11 @@
   :type '(choice (const mh-search)
                  (function :tag "Other Function"))
   :group 'mh-tool-bar
-  :package-version '(MH-E "7.0"))
+  :package-version '(MH-E . "7.0"))
 
 ;; XEmacs has a couple of extra customizations...
 (mh-do-in-xemacs
-  (mh-defcustom mh-xemacs-use-tool-bar-flag mh-xemacs-has-tool-bar-flag
+  (defcustom-mh mh-xemacs-use-tool-bar-flag mh-xemacs-has-tool-bar-flag
     "*If non-nil, use tool bar.
 
 This option controls whether to show the MH-E icons at all. By
@@ -2877,9 +2897,9 @@
                     (not mh-xemacs-has-tool-bar-flag))
                (error "Tool bar not supported"))
            (set-default symbol value))
-    :package-version '(MH-E "7.3"))
-
-  (mh-defcustom mh-xemacs-tool-bar-position nil
+    :package-version '(MH-E . "7.3"))
+
+  (defcustom-mh mh-xemacs-tool-bar-position nil
     "*Tool bar location.
 
 This option controls the placement of the tool bar along the four
@@ -2895,13 +2915,13 @@
                   (const :tag "Left" :value left)
                   (const :tag "Right" :value right))
     :group 'mh-tool-bar
-    :package-version '(MH-E "7.3")))
+    :package-version '(MH-E . "7.3")))
 
 
 
 ;;; Hooks (:group 'mh-hooks + group where hook described)
 
-(mh-defcustom mh-after-commands-processed-hook nil
+(defcustom-mh mh-after-commands-processed-hook nil
   "Hook run by \\<mh-folder-mode-map>\\[mh-execute-commands] after performing outstanding refile and delete requests.
 
 Variables that are useful in this hook include
@@ -2911,16 +2931,16 @@
   :type 'hook
   :group 'mh-hooks
   :group 'mh-folder
-  :package-version '(MH-E "8.0"))
-
-(mh-defcustom mh-alias-reloaded-hook nil
+  :package-version '(MH-E . "8.0"))
+
+(defcustom-mh mh-alias-reloaded-hook nil
   "Hook run by `mh-alias-reload' after loading aliases."
   :type 'hook
   :group 'mh-hooks
   :group 'mh-alias
-  :package-version '(MH-E "8.0"))
-
-(mh-defcustom mh-before-commands-processed-hook nil
+  :package-version '(MH-E . "8.0"))
+
+(defcustom-mh mh-before-commands-processed-hook nil
   "Hook run by \\<mh-folder-mode-map>\\[mh-execute-commands] before performing outstanding refile and delete requests.
 
 Variables that are useful in this hook include `mh-delete-list'
@@ -2929,9 +2949,9 @@
   :type 'hook
   :group 'mh-hooks
   :group 'mh-folder
-  :package-version '(MH-E "8.0"))
-
-(mh-defcustom mh-before-quit-hook nil
+  :package-version '(MH-E . "8.0"))
+
+(defcustom-mh mh-before-quit-hook nil
   "Hook run by \\<mh-folder-mode-map>\\[mh-quit] before quitting MH-E.
 
 This hook is called before the quit occurs, so you might use it
@@ -2942,9 +2962,9 @@
   :type 'hook
   :group 'mh-hooks
   :group 'mh-folder
-  :package-version '(MH-E "6.0"))
-
-(mh-defcustom mh-before-send-letter-hook nil
+  :package-version '(MH-E . "6.0"))
+
+(defcustom-mh mh-before-send-letter-hook nil
   "Hook run at the beginning of the \\<mh-letter-mode-map>\\[mh-send-letter] command.
 
 For example, if you want to check your spelling in your message
@@ -2953,9 +2973,9 @@
   :options '(ispell-message)
   :group 'mh-hooks
   :group 'mh-letter
-  :package-version '(MH-E "6.0"))
-
-(mh-defcustom mh-delete-msg-hook nil
+  :package-version '(MH-E . "6.0"))
+
+(defcustom-mh mh-delete-msg-hook nil
   "Hook run by \\<mh-letter-mode-map>\\[mh-delete-msg] after marking each message for deletion.
 
 For example, a past maintainer of MH-E used this once when he
@@ -2963,9 +2983,9 @@
   :type 'hook
   :group 'mh-hooks
   :group 'mh-show
-  :package-version '(MH-E "6.0"))
-
-(mh-defcustom mh-find-path-hook nil
+  :package-version '(MH-E . "6.0"))
+
+(defcustom-mh mh-find-path-hook nil
   "Hook run by `mh-find-path' after reading the user's MH profile.
 
 This hook can be used the change the value of the variables that
@@ -2974,30 +2994,30 @@
   :type 'hook
   :group 'mh-hooks
   :group 'mh-e
-  :package-version '(MH-E "7.0"))
-
-(mh-defcustom mh-folder-mode-hook nil
+  :package-version '(MH-E . "7.0"))
+
+(defcustom-mh mh-folder-mode-hook nil
   "Hook run by `mh-folder-mode' when visiting a new folder."
   :type 'hook
   :group 'mh-hooks
   :group 'mh-folder
-  :package-version '(MH-E "6.0"))
-
-(mh-defcustom mh-forward-hook nil
+  :package-version '(MH-E . "6.0"))
+
+(defcustom-mh mh-forward-hook nil
   "Hook run by `mh-forward' on a forwarded letter."
   :type 'hook
   :group 'mh-hooks
   :group 'mh-sending-mail
-  :package-version '(MH-E "8.0"))
-
-(mh-defcustom mh-inc-folder-hook nil
+  :package-version '(MH-E . "8.0"))
+
+(defcustom-mh mh-inc-folder-hook nil
   "Hook run by \\<mh-folder-mode-map>\\[mh-inc-folder] after incorporating mail into a folder."
   :type 'hook
   :group 'mh-hooks
   :group 'mh-inc
-  :package-version '(MH-E "6.0"))
-
-(mh-defcustom mh-insert-signature-hook nil
+  :package-version '(MH-E . "6.0"))
+
+(defcustom-mh mh-insert-signature-hook nil
   "Hook run by \\<mh-letter-mode-map>\\[mh-insert-signature] after signature has been inserted.
 
 Hook functions may access the actual name of the file or the
@@ -3006,9 +3026,9 @@
   :type 'hook
   :group 'mh-hooks
   :group 'mh-letter
-  :package-version '(MH-E "8.0"))
-
-(mh-defcustom mh-kill-folder-suppress-prompt-hooks '(mh-search-p)
+  :package-version '(MH-E . "8.0"))
+
+(defcustom-mh mh-kill-folder-suppress-prompt-hooks '(mh-search-p)
   "Abnormal hook run at the beginning of \\<mh-folder-mode-map>\\[mh-kill-folder].
 
 The hook functions are called with no arguments and should return
@@ -3024,9 +3044,9 @@
   :type 'hook
   :group 'mh-hooks
   :group 'mh-folder
-  :package-version '(MH-E "7.4"))
-
-(mh-defcustom mh-letter-mode-hook nil
+  :package-version '(MH-E . "7.4"))
+
+(defcustom-mh mh-letter-mode-hook nil
   "Hook run by `mh-letter-mode' on a new letter.
 
 This hook allows you to do some processing before editing a
@@ -3037,16 +3057,16 @@
   :type 'hook
   :group 'mh-hooks
   :group 'mh-sending-mail
-  :package-version '(MH-E "6.0"))
-
-(mh-defcustom mh-mh-to-mime-hook nil
+  :package-version '(MH-E . "6.0"))
+
+(defcustom-mh mh-mh-to-mime-hook nil
   "Hook run on the formatted letter by \\<mh-letter-mode-map>\\[mh-mh-to-mime]."
   :type 'hook
   :group 'mh-hooks
   :group 'mh-letter
-  :package-version '(MH-E "8.0"))
-
-(mh-defcustom mh-search-mode-hook nil
+  :package-version '(MH-E . "8.0"))
+
+(defcustom-mh mh-search-mode-hook nil
   "Hook run upon entry to `mh-search-mode'\\<mh-folder-mode-map>.
 
 If you find that you do the same thing over and over when editing
@@ -3056,9 +3076,9 @@
   :type 'hook
   :group 'mh-hooks
   :group 'mh-search
-  :package-version '(MH-E "8.0"))
-
-(mh-defcustom mh-quit-hook nil
+  :package-version '(MH-E . "8.0"))
+
+(defcustom-mh mh-quit-hook nil
   "Hook run by \\<mh-folder-mode-map>\\[mh-quit] after quitting MH-E.
 
 This hook is not run in an MH-E context, so you might use it to
@@ -3068,16 +3088,16 @@
   :type 'hook
   :group 'mh-hooks
   :group 'mh-folder
-  :package-version '(MH-E "6.0"))
-
-(mh-defcustom mh-refile-msg-hook nil
+  :package-version '(MH-E . "6.0"))
+
+(defcustom-mh mh-refile-msg-hook nil
   "Hook run by \\<mh-folder-mode-map>\\[mh-refile-msg] after marking each message for refiling."
   :type 'hook
   :group 'mh-hooks
   :group 'mh-folder
-  :package-version '(MH-E "6.0"))
-
-(mh-defcustom mh-show-hook nil
+  :package-version '(MH-E . "6.0"))
+
+(defcustom-mh mh-show-hook nil
   "Hook run after \\<mh-folder-mode-map>\\[mh-show] shows a message.
 
 It is the last thing called after messages are displayed. It's
@@ -3086,9 +3106,9 @@
   :type 'hook
   :group 'mh-hooks
   :group 'mh-show
-  :package-version '(MH-E "6.0"))
-
-(mh-defcustom mh-show-mode-hook nil
+  :package-version '(MH-E . "6.0"))
+
+(defcustom-mh mh-show-mode-hook nil
   "Hook run upon entry to `mh-show-mode'.
 
 This hook is called early on in the process of the message
@@ -3097,9 +3117,9 @@
   :type 'hook
   :group 'mh-hooks
   :group 'mh-show
-  :package-version '(MH-E "6.0"))
-
-(mh-defcustom mh-unseen-updated-hook nil
+  :package-version '(MH-E . "6.0"))
+
+(defcustom-mh mh-unseen-updated-hook nil
   "Hook run after the unseen sequence has been updated.
 
 The variable `mh-seen-list' can be used by this hook to obtain
@@ -3108,7 +3128,7 @@
   :type 'hook
   :group 'mh-hooks
   :group 'mh-sequences
-  :package-version '(MH-E "6.0"))
+  :package-version '(MH-E . "6.0"))
 
 
 
@@ -3119,7 +3139,7 @@
 
 ;; To add a new face:
 ;; 1. Add entry to variable mh-face-data.
-;; 2. Create face using mh-defface (which removes min-color spec and
+;; 2. Create face using defface-mh (which removes min-color spec and
 ;;    :package-version keyword where these are not supported),
 ;;    accessing face data with function mh-face-data.
 ;; 3. Add inherit argument to function mh-face-data if applicable.
@@ -3268,7 +3288,7 @@
        (:underline t)))))
   "MH-E face data.
 Used by function `mh-face-data' which returns spec that is
-consumed by `mh-defface'.")
+consumed by `defface-mh'.")
 
 (require 'cus-face)
 
@@ -3321,14 +3341,14 @@
                   (setq new-spec (cons entry new-spec)))))
         new-spec))))
 
-(mh-defface mh-folder-address
+(defface-mh mh-folder-address
   (mh-face-data 'mh-folder-subject '((t (:inherit mh-folder-subject))))
   "Recipient face."
   :group 'mh-faces
   :group 'mh-folder
-  :package-version '(MH-E "8.0"))
-
-(mh-defface mh-folder-body
+  :package-version '(MH-E . "8.0"))
+
+(defface-mh mh-folder-body
   (mh-face-data 'mh-folder-msg-number
                 '((((class color))
                    (:inherit mh-folder-msg-number))
@@ -3337,49 +3357,49 @@
   "Body text face."
   :group 'mh-faces
   :group 'mh-folder
-  :package-version '(MH-E "8.0"))
-
-(mh-defface mh-folder-cur-msg-number
+  :package-version '(MH-E . "8.0"))
+
+(defface-mh mh-folder-cur-msg-number
   (mh-face-data 'mh-folder-msg-number
                 '((t (:inherit mh-folder-msg-number :bold t))))
   "Current message number face."
   :group 'mh-faces
   :group 'mh-folder
-  :package-version '(MH-E "8.0"))
-
-(mh-defface mh-folder-date
+  :package-version '(MH-E . "8.0"))
+
+(defface-mh mh-folder-date
   (mh-face-data 'mh-folder-msg-number '((t (:inherit mh-folder-msg-number))))
   "Date face."
   :group 'mh-faces
   :group 'mh-folder
-  :package-version '(MH-E "8.0"))
-
-(mh-defface mh-folder-deleted
+  :package-version '(MH-E . "8.0"))
+
+(defface-mh mh-folder-deleted
   (mh-face-data 'mh-folder-msg-number '((t (:inherit mh-folder-msg-number))))
   "Deleted message face."
   :group 'mh-faces
   :group 'mh-folder
-  :package-version '(MH-E "8.0"))
-
-(mh-defface mh-folder-followup (mh-face-data 'mh-folder-followup)
+  :package-version '(MH-E . "8.0"))
+
+(defface-mh mh-folder-followup (mh-face-data 'mh-folder-followup)
   "\"Re:\" face."
   :group 'mh-faces
   :group 'mh-folder
-  :package-version '(MH-E "8.0"))
-
-(mh-defface mh-folder-msg-number (mh-face-data 'mh-folder-msg-number)
+  :package-version '(MH-E . "8.0"))
+
+(defface-mh mh-folder-msg-number (mh-face-data 'mh-folder-msg-number)
   "Message number face."
   :group 'mh-faces
   :group 'mh-folder
-  :package-version '(MH-E "8.0"))
-
-(mh-defface mh-folder-refiled (mh-face-data 'mh-folder-refiled)
+  :package-version '(MH-E . "8.0"))
+
+(defface-mh mh-folder-refiled (mh-face-data 'mh-folder-refiled)
   "Refiled message face."
   :group 'mh-faces
   :group 'mh-folder
-  :package-version '(MH-E "8.0"))
-
-(mh-defface mh-folder-sent-to-me-hint
+  :package-version '(MH-E . "8.0"))
+
+(defface-mh mh-folder-sent-to-me-hint
   (mh-face-data 'mh-folder-msg-number '((t (:inherit mh-folder-date))))
   "Fontification hint face in messages sent directly to us.
 The detection of messages sent to us is governed by the scan
@@ -3387,9 +3407,9 @@
 `mh-scan-sent-to-me-sender-regexp'."
   :group 'mh-faces
   :group 'mh-folder
-  :package-version '(MH-E "8.0"))
-
-(mh-defface mh-folder-sent-to-me-sender
+  :package-version '(MH-E . "8.0"))
+
+(defface-mh mh-folder-sent-to-me-sender
   (mh-face-data 'mh-folder-followup '((t (:inherit mh-folder-followup))))
   "Sender face in messages sent directly to us.
 The detection of messages sent to us is governed by the scan
@@ -3397,145 +3417,135 @@
 `mh-scan-sent-to-me-sender-regexp'."
   :group 'mh-faces
   :group 'mh-folder
-  :package-version '(MH-E "8.0"))
-
-(mh-defface mh-folder-subject (mh-face-data 'mh-folder-subject)
+  :package-version '(MH-E . "8.0"))
+
+(defface-mh mh-folder-subject (mh-face-data 'mh-folder-subject)
   "Subject face."
   :group 'mh-faces
   :group 'mh-folder
-  :package-version '(MH-E "8.0"))
-
-(mh-defface mh-folder-tick (mh-face-data 'mh-folder-tick)
+  :package-version '(MH-E . "8.0"))
+
+(defface-mh mh-folder-tick (mh-face-data 'mh-folder-tick)
   "Ticked message face."
   :group 'mh-faces
   :group 'mh-folder
-  :package-version '(MH-E "8.0"))
-
-(mh-defface mh-folder-to (mh-face-data 'mh-folder-to)
+  :package-version '(MH-E . "8.0"))
+
+(defface-mh mh-folder-to (mh-face-data 'mh-folder-to)
   "\"To:\" face."
   :group 'mh-faces
   :group 'mh-folder
-  :package-version '(MH-E "8.0"))
-
-(mh-defface mh-letter-header-field (mh-face-data 'mh-letter-header-field)
+  :package-version '(MH-E . "8.0"))
+
+(defface-mh mh-letter-header-field (mh-face-data 'mh-letter-header-field)
   "Editable header field value face in draft buffers."
   :group 'mh-faces
   :group 'mh-letter
-  :package-version '(MH-E "8.0"))
-
-(mh-defface mh-search-folder (mh-face-data 'mh-search-folder)
+  :package-version '(MH-E . "8.0"))
+
+(defface-mh mh-search-folder (mh-face-data 'mh-search-folder)
   "Folder heading face in MH-Folder buffers created by searches."
   :group 'mh-faces
   :group 'mh-search
-  :package-version '(MH-E "8.0"))
-
-(mh-defface mh-show-cc (mh-face-data 'mh-show-cc)
+  :package-version '(MH-E . "8.0"))
+
+(defface-mh mh-show-cc (mh-face-data 'mh-show-cc)
   "Face used to highlight \"cc:\" header fields."
   :group 'mh-faces
   :group 'mh-show
-  :package-version '(MH-E "8.0"))
-
-(mh-defface mh-show-date (mh-face-data 'mh-show-date)
+  :package-version '(MH-E . "8.0"))
+
+(defface-mh mh-show-date (mh-face-data 'mh-show-date)
   "Face used to highlight \"Date:\" header fields."
   :group 'mh-faces
   :group 'mh-show
-  :package-version '(MH-E "8.0"))
-
-(mh-defface mh-show-from (mh-face-data 'mh-show-from)
+  :package-version '(MH-E . "8.0"))
+
+(defface-mh mh-show-from (mh-face-data 'mh-show-from)
   "Face used to highlight \"From:\" header fields."
   :group 'mh-faces
   :group 'mh-show
-  :package-version '(MH-E "8.0"))
-
-(mh-defface mh-show-header (mh-face-data 'mh-show-header)
+  :package-version '(MH-E . "8.0"))
+
+(defface-mh mh-show-header (mh-face-data 'mh-show-header)
   "Face used to deemphasize less interesting header fields."
   :group 'mh-faces
   :group 'mh-show
-  :package-version '(MH-E "8.0"))
-
-(mh-defface mh-show-pgg-bad (mh-face-data 'mh-show-pgg-bad)
+  :package-version '(MH-E . "8.0"))
+
+(defface-mh mh-show-pgg-bad (mh-face-data 'mh-show-pgg-bad)
   "Bad PGG signature face."
   :group 'mh-faces
   :group 'mh-show
-  :package-version '(MH-E "8.0"))
-
-(mh-defface mh-show-pgg-good (mh-face-data 'mh-show-pgg-good)
+  :package-version '(MH-E . "8.0"))
+
+(defface-mh mh-show-pgg-good (mh-face-data 'mh-show-pgg-good)
   "Good PGG signature face."
   :group 'mh-faces
   :group 'mh-show
-  :package-version '(MH-E "8.0"))
-
-(mh-defface mh-show-pgg-unknown (mh-face-data 'mh-show-pgg-unknown)
+  :package-version '(MH-E . "8.0"))
+
+(defface-mh mh-show-pgg-unknown (mh-face-data 'mh-show-pgg-unknown)
   "Unknown or untrusted PGG signature face."
   :group 'mh-faces
   :group 'mh-show
-  :package-version '(MH-E "8.0"))
-
-(mh-defface mh-show-signature (mh-face-data 'mh-show-signature)
+  :package-version '(MH-E . "8.0"))
+
+(defface-mh mh-show-signature (mh-face-data 'mh-show-signature)
   "Signature face."
   :group 'mh-faces
   :group 'mh-show
-  :package-version '(MH-E "8.0"))
-
-(mh-defface mh-show-subject
+  :package-version '(MH-E . "8.0"))
+
+(defface-mh mh-show-subject
   (mh-face-data 'mh-folder-subject '((t (:inherit mh-folder-subject))))
   "Face used to highlight \"Subject:\" header fields."
   :group 'mh-faces
   :group 'mh-show
-  :package-version '(MH-E "8.0"))
-
-(mh-defface mh-show-to (mh-face-data 'mh-show-to)
+  :package-version '(MH-E . "8.0"))
+
+(defface-mh mh-show-to (mh-face-data 'mh-show-to)
   "Face used to highlight \"To:\" header fields."
   :group 'mh-faces
   :group 'mh-show
-  :package-version '(MH-E "8.0"))
-
-(mh-defface mh-show-xface
+  :package-version '(MH-E . "8.0"))
+
+(defface-mh mh-show-xface
   (mh-face-data 'mh-show-from '((t (:inherit (mh-show-from highlight)))))
 "X-Face image face.
 The background and foreground are used in the image."
   :group 'mh-faces
   :group 'mh-show
-  :package-version '(MH-E "8.0"))
-
-(mh-defface mh-speedbar-folder (mh-face-data 'mh-speedbar-folder)
+  :package-version '(MH-E . "8.0"))
+
+(defface-mh mh-speedbar-folder (mh-face-data 'mh-speedbar-folder)
   "Basic folder face."
   :group 'mh-faces
   :group 'mh-speedbar
-  :package-version '(MH-E "8.0"))
-
-(mh-defface mh-speedbar-folder-with-unseen-messages
+  :package-version '(MH-E . "8.0"))
+
+(defface-mh mh-speedbar-folder-with-unseen-messages
   (mh-face-data 'mh-speedbar-folder
                 '((t (:inherit mh-speedbar-folder :bold t))))
   "Folder face when folder contains unread messages."
   :group 'mh-faces
   :group 'mh-speedbar
-  :package-version '(MH-E "8.0"))
-
-(mh-defface mh-speedbar-selected-folder
+  :package-version '(MH-E . "8.0"))
+
+(defface-mh mh-speedbar-selected-folder
   (mh-face-data 'mh-speedbar-selected-folder)
   "Selected folder face."
   :group 'mh-faces
   :group 'mh-speedbar
-  :package-version '(MH-E "8.0"))
-
-(mh-defface mh-speedbar-selected-folder-with-unseen-messages
+  :package-version '(MH-E . "8.0"))
+
+(defface-mh mh-speedbar-selected-folder-with-unseen-messages
   (mh-face-data 'mh-speedbar-selected-folder
                 '((t (:inherit mh-speedbar-selected-folder :bold t))))
   "Selected folder face when folder contains unread messages."
   :group 'mh-faces
   :group 'mh-speedbar
-  :package-version '(MH-E "8.0"))
-
-;; Get rid of temporary functions and data structures.
-(fmakunbound 'mh-defcustom)
-(fmakunbound 'mh-defface)
-(fmakunbound 'mh-defgroup)
-(fmakunbound 'mh-face-data)
-(fmakunbound 'mh-strip-package-version)
-(makunbound 'mh-face-data)
-(makunbound 'mh-inherit-face-flag)
-(makunbound 'mh-min-colors-defined-flag)
+  :package-version '(MH-E . "8.0"))
 
 (provide 'mh-e)
 
--- a/lisp/mh-e/mh-folder.el	Wed Apr 12 17:40:36 2006 +0000
+++ b/lisp/mh-e/mh-folder.el	Wed Apr 19 16:23:46 2006 +0000
@@ -522,11 +522,10 @@
   (add-to-list 'which-func-modes 'mh-folder-mode))
 
 ;; Shush compiler.
-(eval-when-compile
-  (defvar desktop-save-buffer)
-  (defvar font-lock-auto-fontify)
-  (defvar image-load-path)
-  (mh-do-in-xemacs (defvar font-lock-defaults)))
+(defvar desktop-save-buffer)
+(defvar font-lock-auto-fontify)
+(defvar image-load-path)
+(defvar font-lock-defaults)             ; XEmacs
 
 (defvar mh-folder-buttons-init-flag nil)
 
--- a/lisp/mh-e/mh-funcs.el	Wed Apr 12 17:40:36 2006 +0000
+++ b/lisp/mh-e/mh-funcs.el	Wed Apr 19 16:23:46 2006 +0000
@@ -138,7 +138,7 @@
     (display-buffer mh-temp-buffer)))
 
 ;; Shush compiler.
-(eval-when-compile (defvar view-exit-action))
+(defvar view-exit-action)
 
 ;;;###mh-autoload
 (defun mh-list-folders ()
--- a/lisp/mh-e/mh-gnus.el	Wed Apr 12 17:40:36 2006 +0000
+++ b/lisp/mh-e/mh-gnus.el	Wed Apr 19 16:23:46 2006 +0000
@@ -39,19 +39,19 @@
 (mh-require 'mml nil t)
 
 ;; Copy of function from gnus-util.el.
-(mh-defun-compat mh-gnus-local-map-property gnus-local-map-property (map)
+(defun-mh mh-gnus-local-map-property gnus-local-map-property (map)
   "Return a list suitable for a text property list specifying keymap MAP."
   (cond (mh-xemacs-flag (list 'keymap map))
         ((>= emacs-major-version 21) (list 'keymap map))
         (t (list 'local-map map))))
 
 ;; Copy of function from mm-decode.el.
-(mh-defun-compat mh-mm-merge-handles mm-merge-handles (handles1 handles2)
+(defun-mh mh-mm-merge-handles mm-merge-handles (handles1 handles2)
   (append (if (listp (car handles1)) handles1 (list handles1))
           (if (listp (car handles2)) handles2 (list handles2))))
 
 ;; Copy of function from mm-decode.el.
-(mh-defun-compat mh-mm-set-handle-multipart-parameter
+(defun-mh mh-mm-set-handle-multipart-parameter
   mm-set-handle-multipart-parameter (handle parameter value)
   ;; HANDLE could be a CTL.
   (if handle
@@ -59,7 +59,7 @@
                          (car handle))))
 
 ;; Copy of function from mm-view.el.
-(mh-defun-compat mh-mm-inline-text-vcard mm-inline-text-vcard (handle)
+(defun-mh mh-mm-inline-text-vcard mm-inline-text-vcard (handle)
   (let (buffer-read-only)
     (mm-insert-inline
      handle
@@ -73,17 +73,17 @@
 
 ;; Function from mm-decode.el used in PGP messages. Just define it with older
 ;; Gnus to avoid compiler warning.
-(mh-defun-compat mh-mm-possibly-verify-or-decrypt
+(defun-mh mh-mm-possibly-verify-or-decrypt
   mm-possibly-verify-or-decrypt (parts ctl)
   nil)
 
 ;; Copy of macro in mm-decode.el.
-(mh-defmacro-compat mh-mm-handle-multipart-ctl-parameter
+(defmacro-mh mh-mm-handle-multipart-ctl-parameter
   mm-handle-multipart-ctl-parameter (handle parameter)
   `(get-text-property 0 ,parameter (car ,handle)))
 
 ;; Copy of function in mm-decode.el.
-(mh-defun-compat mh-mm-readable-p mm-readable-p (handle)
+(defun-mh mh-mm-readable-p mm-readable-p (handle)
   "Say whether the content of HANDLE is readable."
   (and (< (with-current-buffer (mm-handle-buffer handle)
             (buffer-size)) 10000)
@@ -93,7 +93,7 @@
               (not (mh-mm-long-lines-p 76))))))
 
 ;; Copy of function in mm-bodies.el.
-(mh-defun-compat mh-mm-long-lines-p mm-long-lines-p (length)
+(defun-mh mh-mm-long-lines-p mm-long-lines-p (length)
   "Say whether any of the lines in the buffer is longer than LENGTH."
   (save-excursion
     (goto-char (point-min))
@@ -105,21 +105,21 @@
     (and (> (current-column) length)
          (current-column))))
 
-(mh-defun-compat mh-mm-keep-viewer-alive-p mm-keep-viewer-alive-p (handle)
+(defun-mh mh-mm-keep-viewer-alive-p mm-keep-viewer-alive-p (handle)
   ;; Released Gnus doesn't keep handles associated with externally displayed
   ;; MIME parts. So this will always return nil.
   nil)
 
-(mh-defun-compat mh-mm-destroy-parts mm-destroy-parts (list)
+(defun-mh mh-mm-destroy-parts mm-destroy-parts (list)
   "Older versions of Emacs don't have this function."
   nil)
 
-(mh-defun-compat mh-mm-uu-dissect-text-parts mm-uu-dissect-text-parts (handles)
+(defun-mh mh-mm-uu-dissect-text-parts mm-uu-dissect-text-parts (handles)
   "Emacs 21 and XEmacs don't have this function."
   nil)
 
 ;; Copy of function in mml.el.
-(mh-defun-compat mh-mml-minibuffer-read-disposition
+(defun-mh mh-mml-minibuffer-read-disposition
   mml-minibuffer-read-disposition (type &optional default)
   (unless default (setq default
                         (if (and (string-match "\\`text/" type)
--- a/lisp/mh-e/mh-letter.el	Wed Apr 12 17:40:36 2006 +0000
+++ b/lisp/mh-e/mh-letter.el	Wed Apr 19 16:23:46 2006 +0000
@@ -278,9 +278,8 @@
 (defvar mh-letter-buttons-init-flag nil)
 
 ;; Shush compiler.
-(eval-when-compile
-  (defvar image-load-path)
-  (mh-do-in-xemacs (defvar font-lock-defaults)))
+(defvar image-load-path)
+(defvar font-lock-defaults)             ; XEmacs
 
 ;; Ensure new buffers won't get this mode if default-major-mode is nil.
 (put 'mh-letter-mode 'mode-class 'special)
--- a/lisp/mh-e/mh-mime.el	Wed Apr 12 17:40:36 2006 +0000
+++ b/lisp/mh-e/mh-mime.el	Wed Apr 19 16:23:46 2006 +0000
@@ -825,7 +825,9 @@
 ;;; Button Display
 
 ;; Shush compiler.
-(eval-when-compile (mh-do-in-xemacs (defvar dots) (defvar type) (defvar ov)))
+(defvar dots)                           ; XEmacs
+(defvar type)                           ; XEmacs
+(defvar ov)                             ; XEmacs
 
 (defun mh-insert-mime-button (handle index displayed)
   "Insert MIME button for HANDLE.
@@ -870,12 +872,9 @@
       (mh-funcall-if-exists overlay-put ov 'evaporate t))))
 
 ;; Shush compiler.
-(eval-when-compile
-  (when (< emacs-major-version 22)
-    (defvar  mm-verify-function-alist)
-    (defvar  mm-decrypt-function-alist))
-  (mh-do-in-xemacs
-    (defvar pressed-details)))
+(defvar mm-verify-function-alist)       ; < Emacs 22
+(defvar mm-decrypt-function-alist)      ; < Emacs 22
+(defvar pressed-details)                ; XEmacs
 
 (defun mh-insert-mime-security-button (handle)
   "Display buttons for PGP message, HANDLE."
@@ -1537,7 +1536,7 @@
     (after-find-file nil)))
 
 ;; Shush compiler.
-(eval-when-compile (defvar mh-identity-pgg-default-user-id))
+(defvar mh-identity-pgg-default-user-id)
 
 ;;;###mh-autoload
 (defun mh-mml-secure-message-encrypt (method)
--- a/lisp/mh-e/mh-search.el	Wed Apr 12 17:40:36 2006 +0000
+++ b/lisp/mh-e/mh-search.el	Wed Apr 19 16:23:46 2006 +0000
@@ -324,7 +324,7 @@
                        count (> (hash-table-count msg-hash) 0)))))))
 
 ;; Shush compiler.
-(eval-when-compile (mh-do-in-xemacs (defvar pick-folder)))
+(defvar pick-folder)                    ; XEmacs
 
 (defun mh-search-folder (folder window-config)
   "Search FOLDER for messages matching a pattern.
@@ -404,10 +404,8 @@
   (mh-index-sequenced-messages folders mh-tick-seq))
 
 ;; Shush compiler.
-(eval-when-compile
-  (mh-do-in-xemacs
-    (defvar mh-mairix-folder)
-    (defvar mh-flists-search-folders)))
+(defvar mh-mairix-folder)               ; XEmacs
+(defvar mh-flists-search-folders)       ; XEmacs
 
 ;;;###mh-autoload
 (defun mh-index-sequenced-messages (folders sequence)
@@ -1414,9 +1412,7 @@
 (mh-require 'which-func nil t)
 
 ;; Shush compiler.
-(eval-when-compile
-  (if (or mh-xemacs-flag (< emacs-major-version 22))
-      (defvar which-func-mode)))
+(defvar which-func-mode)                ; < Emacs 22, XEmacs
 
 ;;;###mh-autoload
 (defun mh-index-create-imenu-index ()
@@ -1441,7 +1437,7 @@
   mh-index-data)
 
 ;; Shush compiler
-(eval-when-compile (if mh-xemacs-flag (defvar mh-speed-flists-inhibit-flag)))
+(defvar mh-speed-flists-inhibit-flag)   ; XEmacs
 
 ;;;###mh-autoload
 (defun mh-index-execute-commands ()
--- a/lisp/mh-e/mh-seq.el	Wed Apr 12 17:40:36 2006 +0000
+++ b/lisp/mh-e/mh-seq.el	Wed Apr 19 16:23:46 2006 +0000
@@ -134,7 +134,7 @@
       (apply #'mh-speed-flists t folders-changed))))
 
 ;; Shush compiler.
-(eval-when-compile (defvar view-exit-action))
+(defvar view-exit-action)
 
 ;;;###mh-autoload
 (defun mh-list-sequences ()
@@ -202,7 +202,7 @@
                         " "))))
 
 ;; Shush compiler.
-(eval-when-compile (mh-do-in-xemacs (defvar tool-bar-mode)))
+(defvar tool-bar-mode)                  ; XEmacs
 
 ;;;###mh-autoload
 (defun mh-narrow-to-seq (sequence)
--- a/lisp/mh-e/mh-show.el	Wed Apr 12 17:40:36 2006 +0000
+++ b/lisp/mh-e/mh-show.el	Wed Apr 19 16:23:46 2006 +0000
@@ -815,7 +815,7 @@
 (put 'mh-show-mode 'mode-class 'special)
 
 ;; Shush compiler.
-(eval-when-compile (defvar font-lock-auto-fontify))
+(defvar font-lock-auto-fontify)
 
 ;;;###mh-autoload
 (define-derived-mode mh-show-mode text-mode "MH-Show"
--- a/lisp/mh-e/mh-utils.el	Wed Apr 12 17:40:36 2006 +0000
+++ b/lisp/mh-e/mh-utils.el	Wed Apr 19 16:23:46 2006 +0000
@@ -556,10 +556,18 @@
                 sub-folders)
       sub-folders)))
 
+;; FIXME: This function does not do well if FOLDER does not exist. It
+;; then changes the context to that folder which causes problems down
+;; the line. Since a folder in the cache could later be deleted, it
+;; would be good for mh-sub-folders-actual to return nil in this case
+;; so that mh-sub-folders could delete it from the cache. This
+;; function could protect itself by using a temporary context.
 (defun mh-sub-folders-actual (folder)
   "Execute the command folders to return the sub-folders of FOLDER.
 Filters out the folder names that start with \".\" so that
-directories that aren't usually mail folders are hidden."
+directories that aren't usually mail folders are hidden.
+Expects FOLDER to have already been normalized with
+  (mh-normalize-folder-name folder nil nil t)"
   (let ((arg-list `(,(expand-file-name "folders" mh-progs)
                     nil (t nil) nil "-noheader" "-norecurse" "-nototal"
                     ,@(if (stringp folder) (list folder) ())))
@@ -657,7 +665,7 @@
 (defvar mh-folder-hist nil)
 
 ;; Shush compiler.
-(eval-when-compile (defvar mh-speed-flists-cache))
+(defvar mh-speed-flists-cache)
 
 (defvar mh-allow-root-folder-flag nil
   "Non-nil means \"+\" is an acceptable folder name.
@@ -683,53 +691,58 @@
 (defun mh-folder-completion-function (name predicate flag)
   "Programmable completion for folder names.
 NAME is the partial folder name that has been input. PREDICATE if
-non-nil is a function that is used to filter the possible choices
-and FLAG determines whether the completion is over."
+non-nil is a function that is used to filter the possible
+choices. FLAG is nil to indicate `try-completion', t for
+`all-completions', or the symbol lambda for `test-completion'.
+See Info node `(elisp) Programmed Completion' for details."
   (let* ((orig-name name)
+         ;; After normalization, name is nil, +, or +something. If a
+         ;; trailing slash is present, it is preserved.
          (name (mh-normalize-folder-name name nil t))
          (last-slash (mh-search-from-end ?/ name))
-         (last-complete (if last-slash (substring name 0 last-slash) nil))
+         ;; nil if + or +folder; +folder/ if slash present.
+         (last-complete (if last-slash (substring name 0 (1+ last-slash)) nil))
+         ;; Either +folder/remainder, +remainder, or "".
          (remainder (cond (last-complete (substring name (1+ last-slash)))
-                          ((and (> (length name) 0) (equal (aref name 0) ?+))
-                           (substring name 1))
+                          (name (substring name 1))
                           (t ""))))
     (cond ((eq flag nil)
-           (let ((try-res (try-completion
-                           name
-                           (mapcar (lambda (x)
-                                     (cons (if (not last-complete)
-                                               (concat "+" (car x))
-                                             (concat last-complete "/" (car x)))
-                                           (cdr x)))
-                                   (mh-sub-folders last-complete t))
-                           predicate)))
+           (let ((try-res
+                  (try-completion
+                   name
+                   (mapcar (lambda (x)
+                             (cons (concat (or last-complete "+") (car x))
+                                   (cdr x)))
+                    (mh-sub-folders last-complete t))
+                   predicate)))
              (cond ((eq try-res nil) nil)
                    ((and (eq try-res t) (equal name orig-name)) t)
                    ((eq try-res t) name)
                    (t try-res))))
           ((eq flag t)
-           (all-completions
-            remainder (mh-sub-folders last-complete t) predicate))
+           (mapcar (lambda (x)
+                     (concat (or last-complete "+") x))
+                   (all-completions
+                    remainder (mh-sub-folders last-complete t) predicate)))
           ((eq flag 'lambda)
-           (let ((path (concat mh-user-path
-                               (substring (mh-normalize-folder-name name) 1))))
+           (let ((path (concat (unless (and (> (length name) 1)
+                                            (eq (aref name 1) ?/))
+                                 mh-user-path)
+                               (substring name 1))))
              (cond (mh-allow-root-folder-flag (file-exists-p path))
                    ((equal path mh-user-path) nil)
                    (t (file-exists-p path))))))))
 
 ;; Shush compiler.
-(eval-when-compile
-  (mh-do-in-xemacs
-    (defvar completion-root-regexp)
-    (defvar minibuffer-completing-file-name)))
+(defvar completion-root-regexp)          ; XEmacs
+(defvar minibuffer-completing-file-name) ; XEmacs
 
 (defun mh-folder-completing-read (prompt default allow-root-folder-flag)
   "Read folder name with PROMPT and default result DEFAULT.
 If ALLOW-ROOT-FOLDER-FLAG is non-nil then \"+\" is allowed to be
 a folder name corresponding to `mh-user-path'."
   (mh-normalize-folder-name
-   (let ((minibuffer-completing-file-name t)
-         (completion-root-regexp "^[+/]")
+   (let ((completion-root-regexp "^[+/]")
          (minibuffer-local-completion-map mh-folder-completion-map)
          (mh-allow-root-folder-flag allow-root-folder-flag))
      (completing-read prompt 'mh-folder-completion-function nil nil nil
--- a/lisp/mh-e/mh-xface.el	Wed Apr 12 17:40:36 2006 +0000
+++ b/lisp/mh-e/mh-xface.el	Wed Apr 19 16:23:46 2006 +0000
@@ -60,8 +60,7 @@
     (funcall mh-show-xface-function)))
 
 ;; Shush compiler.
-(eval-when-compile
-  (mh-do-in-xemacs (defvar default-enable-multibyte-characters)))
+(defvar default-enable-multibyte-characters) ; XEmacs
 
 (defun mh-face-display-function ()
   "Display a Face, X-Face, or X-Image-URL header field.
--- a/lisp/net/tramp-smb.el	Wed Apr 12 17:40:36 2006 +0000
+++ b/lisp/net/tramp-smb.el	Wed Apr 19 16:23:46 2006 +0000
@@ -979,7 +979,7 @@
     ;; Algorithm: get waiting output.  See if last line contains
     ;; tramp-smb-prompt sentinel or tramp-smb-errors strings.
     ;; If not, wait a bit and again get waiting output.
-    (while (and (not found) (not err))
+    (while (not found)
 
       ;; Accept pending output.
       (tramp-accept-process-output proc)
--- a/lisp/net/tramp.el	Wed Apr 12 17:40:36 2006 +0000
+++ b/lisp/net/tramp.el	Wed Apr 19 16:23:46 2006 +0000
@@ -3584,6 +3584,10 @@
   "Global variable keeping asynchronous process object.
 Used in `tramp-handle-shell-command'")
 
+(defvar tramp-display-shell-command-buffer t
+  "Whether to display output buffer of `shell-command'.
+This is necessary for handling DISPLAY of `process-file'.")
+
 (defun tramp-handle-shell-command (command &optional output-buffer error-buffer)
   "Like `shell-command' for tramp files.
 This will break if COMMAND prints a newline, followed by the value of
@@ -3692,7 +3696,8 @@
 	      (skip-chars-forward "^ ")
 	      (setq status (read (current-buffer)))))
 	  (unless (zerop (buffer-size))
-	    (display-buffer output-buffer))
+	    (when tramp-display-shell-command-buffer
+	      (display-buffer output-buffer)))
 	  status))
     ;; The following is only executed if something strange was
     ;; happening.  Emit a helpful message and do it anyway.
@@ -3707,11 +3712,10 @@
   (when (and (numberp buffer) (zerop buffer))
     (error "Implementation does not handle immediate return"))
   (when (consp buffer) (error "Implementation does not handle error files"))
-  (shell-command
-   (mapconcat 'tramp-shell-quote-argument
-              (cons program args)
-              " ")
-   buffer))
+  (let ((tramp-display-shell-command-buffer display))
+    (shell-command
+     (mapconcat 'tramp-shell-quote-argument (cons program args) " ")
+     buffer)))
 
 ;; File Editing.
 
@@ -4454,24 +4458,28 @@
      file)
     (member (match-string 1 file) (mapcar 'car tramp-methods)))
    ((or (equal last-input-event 'tab)
-	;; Emacs
-	(and (integerp last-input-event)
-	     (not (event-modifiers last-input-event))
-	     (or (char-equal last-input-event ?\?)
-		 (char-equal last-input-event ?\t) ; handled by 'tab already?
-		 (char-equal last-input-event ?\ )))
+  	;; Emacs
+  	(and (integerp last-input-event)
+	     (or
+	      ;; ?\t has event-modifier 'control
+	      (char-equal last-input-event ?\t)
+	      (and (not (event-modifiers last-input-event))
+		   (or (char-equal last-input-event ?\?)
+		       (char-equal last-input-event ?\ )))))
 	;; XEmacs
 	(and (featurep 'xemacs)
-	     (not (event-modifiers last-input-event))
-	     (or (char-equal
-		  (funcall (symbol-function 'event-to-character)
-			   last-input-event) ?\?)
-		 (char-equal
-		  (funcall (symbol-function 'event-to-character)
-			   last-input-event) ?\t)
-		 (char-equal
-		  (funcall (symbol-function 'event-to-character)
-			   last-input-event) ?\ ))))
+	     (or
+	      ;; ?\t has event-modifier 'control
+	      (char-equal
+	       (funcall (symbol-function 'event-to-character)
+			last-input-event) ?\t)
+	      (and (not (event-modifiers last-input-event))
+		   (or (char-equal
+			(funcall (symbol-function 'event-to-character)
+				 last-input-event) ?\?)
+		       (char-equal
+			(funcall (symbol-function 'event-to-character)
+				 last-input-event) ?\ ))))))
     t)))
 
 (defun tramp-completion-handle-file-exists-p (filename)
--- a/lisp/net/trampver.el	Wed Apr 12 17:40:36 2006 +0000
+++ b/lisp/net/trampver.el	Wed Apr 19 16:23:46 2006 +0000
@@ -30,7 +30,7 @@
 ;; are auto-frobbed from configure.ac, so you should edit that file and run
 ;; "autoconf && ./configure" to change them.
 
-(defconst tramp-version "2.0.52"
+(defconst tramp-version "2.0.53"
   "This version of Tramp.")
 
 (defconst tramp-bug-report-address "tramp-devel@gnu.org"
--- a/lisp/newcomment.el	Wed Apr 12 17:40:36 2006 +0000
+++ b/lisp/newcomment.el	Wed Apr 19 16:23:46 2006 +0000
@@ -895,6 +895,11 @@
 		   (delete-char n)
 		   (setq ,bindent (- ,bindent n)))))))))))
 
+(defun comment-add (arg)
+  (if (and (null arg) (= (string-match "[ \t]*\\'" comment-start) 1))
+      comment-add
+    (1- (prefix-numeric-value arg))))
+
 (defun comment-region-internal (beg end cs ce
                                 &optional ccs cce block lines indent)
   "Comment region BEG .. END.
@@ -999,7 +1004,6 @@
 
 (defun comment-region-default (beg end &optional arg)
   (let* ((numarg (prefix-numeric-value arg))
-	 (add comment-add)
 	 (style (cdr (assoc comment-style comment-styles)))
 	 (lines (nth 2 style))
 	 (block (nth 1 style))
@@ -1032,8 +1036,7 @@
      ((consp arg) (uncomment-region beg end))
      ((< numarg 0) (uncomment-region beg end (- numarg)))
      (t
-      (setq numarg (if (and (null arg) (= (length comment-start) 1))
-		       add (1- numarg)))
+      (setq numarg (comment-add arg))
       (comment-region-internal
        beg end
        (let ((s (comment-padright comment-start numarg)))
@@ -1091,9 +1094,8 @@
 	;; FIXME: If there's no comment to kill on this line and ARG is
 	;; specified, calling comment-kill is not very clever.
 	(if arg (comment-kill (and (integerp arg) arg)) (comment-indent))
-      (let ((add (if arg (prefix-numeric-value arg)
-		   (if (= (length comment-start) 1) comment-add 0))))
-	;; Some modes insist on keeping column 0 comment in column 0
+      (let ((add (comment-add arg)))
+        ;; Some modes insist on keeping column 0 comment in column 0
 	;; so we need to move away from it before inserting the comment.
 	(indent-according-to-mode)
 	(insert (comment-padright comment-start add))
--- a/lisp/pcvs-parse.el	Wed Apr 12 17:40:36 2006 +0000
+++ b/lisp/pcvs-parse.el	Wed Apr 19 16:23:46 2006 +0000
@@ -271,8 +271,8 @@
 	;; on the current branch (either because it only exists in other
 	;; branches, or because it's been removed).
 	(if (ignore-errors
-	      (with-current-buffer
-		  (find-file-noselect (expand-file-name
+	      (with-temp-buffer
+		(insert-file-contents (expand-file-name
 				       ".cvsignore" (file-name-directory dir)))
 		(goto-char (point-min))
 		(re-search-forward
--- a/lisp/progmodes/cc-langs.el	Wed Apr 12 17:40:36 2006 +0000
+++ b/lisp/progmodes/cc-langs.el	Wed Apr 19 16:23:46 2006 +0000
@@ -267,7 +267,8 @@
        ["Hungry delete"         c-toggle-hungry-state
 	:style toggle :selected c-hungry-delete-key]
        ["Subword mode"          c-subword-mode
-	:style toggle :selected c-subword-mode])))
+	:style toggle :selected (and (boundp 'c-subword-mode)
+                                     c-subword-mode)])))
 
 
 ;;; Syntax tables.
--- a/lisp/progmodes/gdb-ui.el	Wed Apr 12 17:40:36 2006 +0000
+++ b/lisp/progmodes/gdb-ui.el	Wed Apr 19 16:23:46 2006 +0000
@@ -100,7 +100,9 @@
 (defvar tool-bar-map)
 (defvar speedbar-initial-expansion-list-name)
 
-(defvar gdb-frame-address "main" "Initialization for Assembler buffer.")
+(defvar gdb-pc-address nil "Initialization for Assembler buffer.
+Set to \"main\" at start if gdb-show-main is t.")
+(defvar gdb-frame-address nil "Identity of frame for watch expression.")
 (defvar gdb-previous-frame-address nil)
 (defvar gdb-memory-address "main")
 (defvar gdb-previous-frame nil)
@@ -109,8 +111,9 @@
 (defvar gdb-current-language nil)
 (defvar gdb-var-list nil
  "List of variables in watch window.
-Each element has the form (VARNUM EXPRESSION NUMCHILD TYPE VALUE STATUS) where
-STATUS is nil (unchanged), `changed' or `out-of-scope'.")
+Each element has the form (VARNUM EXPRESSION NUMCHILD TYPE VALUE STATUS FP)
+where STATUS is nil (unchanged), `changed' or `out-of-scope', FP the frame
+address for root variables.")
 (defvar gdb-force-update t
  "Non-nil means that view of watch expressions will be updated in the speedbar.")
 (defvar gdb-main-file nil "Source file from which program execution begins.")
@@ -417,7 +420,8 @@
   (goto-char (point-min))
   (when (search-forward "read in on demand:" nil t)
     (while (re-search-forward gdb-source-file-regexp nil t)
-      (push (or (match-string 1) (match-string 2)) gdb-source-file-list))
+      (push (file-name-nondirectory (or (match-string 1) (match-string 2)))
+	    gdb-source-file-list))
     (dolist (buffer (buffer-list))
       (with-current-buffer buffer
 	(when (and buffer-file-name
@@ -515,7 +519,7 @@
   (setq comint-input-sender 'gdb-send)
 
   ;; (re-)initialize
-  (setq gdb-frame-address (if gdb-show-main "main" nil))
+  (setq gdb-pc-address (if gdb-show-main "main" nil))
   (setq gdb-previous-frame-address nil
 	gdb-memory-address "main"
 	gdb-previous-frame nil
@@ -719,7 +723,7 @@
 		    expr)
 		  (match-string 2)
 		  (match-string 3)
-		  nil nil)))
+		  nil nil gdb-frame-address)))
 	(push var gdb-var-list)
 	(speedbar 1)
 	(unless (string-equal
@@ -1205,7 +1209,7 @@
 	(cons
 	 (match-string 1 args)
 	 (string-to-number (match-string 2 args))))
-  (setq gdb-frame-address (match-string 3 args))
+  (setq gdb-pc-address (match-string 3 args))
   ;; cover for auto-display output which comes *before*
   ;; stopped annotation
   (if (eq gdb-output-sink 'inferior) (setq gdb-output-sink 'user)))
@@ -1356,7 +1360,7 @@
     (gdb-get-buffer-create 'gdb-breakpoints-buffer)
     (gdb-invalidate-breakpoints)
     ;; Do this through gdb-get-selected-frame -> gdb-frame-handler
-    ;; so gdb-frame-address is updated.
+    ;; so gdb-pc-address is updated.
     ;; (gdb-invalidate-assembler)
 
     (if (string-equal gdb-version "pre-6.4")
@@ -3003,11 +3007,11 @@
 	(pos 1) (address) (flag) (bptno))
     (with-current-buffer buffer
       (save-excursion
-	(if (not (equal gdb-frame-address "main"))
+	(if (not (equal gdb-pc-address "main"))
 	    (progn
 	      (goto-char (point-min))
-	      (if (and gdb-frame-address
-		       (search-forward gdb-frame-address nil t))
+	      (if (and gdb-pc-address
+		       (search-forward gdb-pc-address nil t))
 		  (progn
 		    (setq pos (point))
 		    (beginning-of-line)
@@ -3037,7 +3041,7 @@
 		  (goto-char (point-min))
 		  (if (search-forward address nil t)
 		      (gdb-put-breakpoint-icon (eq flag ?y) bptno))))))))
-    (if (not (equal gdb-frame-address "main"))
+    (if (not (equal gdb-pc-address "main"))
 	(with-current-buffer buffer
 	  (set-window-point (get-buffer-window buffer 0) pos)))))
 
@@ -3099,7 +3103,7 @@
 	(special-display-frame-alist gdb-frame-parameters))
     (display-buffer (gdb-get-buffer-create 'gdb-assembler-buffer))))
 
-;; modified because if gdb-frame-address has changed value a new command
+;; modified because if gdb-pc-address has changed value a new command
 ;; must be enqueued to update the buffer with the new output
 (defun gdb-invalidate-assembler (&optional ignored)
   (if (gdb-get-buffer 'gdb-assembler-buffer)
@@ -3108,7 +3112,7 @@
 		     (string-equal gdb-selected-frame gdb-previous-frame))
 	  (if (or (not (member 'gdb-invalidate-assembler
 			       gdb-pending-triggers))
-		  (not (string-equal gdb-frame-address
+		  (not (string-equal gdb-pc-address
 				     gdb-previous-frame-address)))
 	  (progn
 	    ;; take previous disassemble command, if any, off the queue
@@ -3121,11 +3125,11 @@
 	    (gdb-enqueue-input
 	     (list
 	      (concat gdb-server-prefix "disassemble "
-		      (if (member gdb-frame-address '(nil "main")) nil "0x")
-			   gdb-frame-address "\n")
+		      (if (member gdb-pc-address '(nil "main")) nil "0x")
+			   gdb-pc-address "\n")
 		   'gdb-assembler-handler))
 	    (push 'gdb-invalidate-assembler gdb-pending-triggers)
-	    (setq gdb-previous-frame-address gdb-frame-address)
+	    (setq gdb-previous-frame-address gdb-pc-address)
 	    (setq gdb-previous-frame gdb-selected-frame)))))))
 
 (defun gdb-get-selected-frame ()
@@ -3140,8 +3144,10 @@
   (setq gdb-pending-triggers
 	(delq 'gdb-get-selected-frame gdb-pending-triggers))
   (goto-char (point-min))
-  (if (re-search-forward  "Stack level \\([0-9]+\\)" nil t)
-      (setq gdb-frame-number (match-string 1)))
+  (when (re-search-forward
+       "Stack level \\([0-9]+\\), frame at \\(0x[[:xdigit:]]+\\)" nil t)
+    (setq gdb-frame-number (match-string 1))
+    (setq gdb-frame-address (match-string 2)))
   (goto-char (point-min))
   (when (re-search-forward ".*=\\s-+0x0*\\(\\S-*\\)\\s-+in\\s-+\\(\\S-+?\\)\
 \\(?: (\\(\\S-+?\\):[0-9]+?)\\)*;? "
@@ -3153,7 +3159,7 @@
     (if (gdb-get-buffer 'gdb-assembler-buffer)
 	(with-current-buffer (gdb-get-buffer 'gdb-assembler-buffer)
 	  (setq mode-name (concat "Machine:" gdb-selected-frame))))
-    (setq gdb-frame-address (match-string 1))
+    (setq gdb-pc-address (match-string 1))
     (if (and (match-string 3) gud-overlay-arrow-position)
       (let ((buffer (marker-buffer gud-overlay-arrow-position))
 	    (position (marker-position gud-overlay-arrow-position)))
--- a/lisp/progmodes/gud.el	Wed Apr 12 17:40:36 2006 +0000
+++ b/lisp/progmodes/gud.el	Wed Apr 19 16:23:46 2006 +0000
@@ -374,8 +374,9 @@
 (defun gud-speedbar-item-info ()
   "Display the data type of the watch expression element."
   (let ((var (nth (- (line-number-at-pos (point)) 2) gdb-var-list)))
-    (if (nth 4 var)
-	(speedbar-message "%s" (nth 3 var)))))
+    (if (nth 6 var)
+	(speedbar-message "%s: %s" (nth 6 var) (nth 3 var))
+      (speedbar-message "%s" (nth 3 var)))))
 
 (defun gud-install-speedbar-variables ()
   "Install those variables used by speedbar to enhance gud/gdb."
--- a/lisp/progmodes/python.el	Wed Apr 12 17:40:36 2006 +0000
+++ b/lisp/progmodes/python.el	Wed Apr 19 16:23:46 2006 +0000
@@ -1744,6 +1744,14 @@
        #'python-eldoc-function)
   (add-hook 'eldoc-mode-hook
 	    '(lambda () (run-python nil t)) nil t) ; need it running
+  (unless (assoc 'python-mode hs-special-modes-alist)
+    (setq 
+     hs-special-modes-alist 
+     (cons (list 
+	    'python-mode "^\\s-*def\\>" nil "#" 
+	    (lambda (arg)(python-end-of-defun)(skip-chars-backward " \t\n")) 
+	    nil)
+    hs-special-modes-alist)))
   (if (featurep 'hippie-exp)
       (set (make-local-variable 'hippie-expand-try-functions-list)
 	   (cons 'python-try-complete hippie-expand-try-functions-list)))
--- a/lisp/progmodes/tcl.el	Wed Apr 12 17:40:36 2006 +0000
+++ b/lisp/progmodes/tcl.el	Wed Apr 19 16:23:46 2006 +0000
@@ -1042,7 +1042,7 @@
 (defun tcl-send-string (proc string)
   (with-current-buffer (process-buffer proc)
     (goto-char (process-mark proc))
-    (beginning-of-line)
+    (forward-line 0)             ;Not (beginning-of-line) because of fields.
     (if (looking-at comint-prompt-regexp)
 	(set-marker inferior-tcl-delete-prompt-marker (point))))
   (comint-send-string proc string))
@@ -1050,7 +1050,7 @@
 (defun tcl-send-region (proc start end)
   (with-current-buffer (process-buffer proc)
     (goto-char (process-mark proc))
-    (beginning-of-line)
+    (forward-line 0)             ;Not (beginning-of-line) because of fields.
     (if (looking-at comint-prompt-regexp)
 	(set-marker inferior-tcl-delete-prompt-marker (point))))
   (comint-send-region proc start end))
@@ -1080,7 +1080,11 @@
 Prefix argument means switch to the Tcl buffer afterwards."
   (interactive "r\nP")
   (let ((proc (inferior-tcl-proc)))
-    (tcl-send-region proc start end)
+    (tcl-send-region
+     proc
+     ;; Strip leading and trailing whitespace.
+     (save-excursion (goto-char start) (skip-chars-forward " \t\n") (point))
+     (save-excursion (goto-char end) (skip-chars-backward " \t\n") (point)))
     (tcl-send-string proc "\n")
     (if and-go (switch-to-tcl t))))
 
@@ -1149,7 +1153,12 @@
   (unless (comint-check-proc "*inferior-tcl*")
     (set-buffer (apply (function make-comint) "inferior-tcl" cmd nil
 		       tcl-command-switches))
-    (inferior-tcl-mode))
+    (inferior-tcl-mode)
+    ;; Make tclsh display a prompt on ms-windows (or under Unix, when a tty
+    ;; wasn't used).  Doesn't affect wish, unfortunately.
+    (unless (process-tty-name (inferior-tcl-proc))
+      (tcl-send-string (inferior-tcl-proc)
+                       "set ::tcl_interactive 1; concat\n")))
   (set (make-local-variable 'tcl-application) cmd)
   (setq inferior-tcl-buffer "*inferior-tcl*")
   (pop-to-buffer "*inferior-tcl*"))
--- a/lisp/subr.el	Wed Apr 12 17:40:36 2006 +0000
+++ b/lisp/subr.el	Wed Apr 19 16:23:46 2006 +0000
@@ -1540,7 +1540,8 @@
       (let ((pass nil)
 	    (c 0)
 	    (echo-keystrokes 0)
-	    (cursor-in-echo-area t))
+	    (cursor-in-echo-area t)
+	    (message-log-max nil))
 	(add-text-properties 0 (length prompt)
 			     minibuffer-prompt-properties prompt)
 	(while (progn (message "%s%s"
--- a/lisp/textmodes/org.el	Wed Apr 12 17:40:36 2006 +0000
+++ b/lisp/textmodes/org.el	Wed Apr 19 16:23:46 2006 +0000
@@ -5,7 +5,7 @@
 ;; Author: Carsten Dominik <dominik at science dot uva dot nl>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://www.astro.uva.nl/~dominik/Tools/org/
-;; Version: 4.21
+;; Version: 4.24
 ;;
 ;; This file is part of GNU Emacs.
 ;;
@@ -81,9 +81,17 @@
 ;;
 ;; Changes since version 4.00:
 ;; ---------------------------
-;; Version 4.21
+;; Version 4.24
+;;    - Bug fixes.
+;;
+;; Version 4.23
 ;;    - Bug fixes.
 ;;
+;; Version 4.22
+;;    - Bug fixes.
+;;    - In agenda buffer, mouse-1 no longer follows link.
+;;      See `org-agenda-mouse-1-follows-link' and `org-mouse-1-follows-link'.
+;;
 ;; Version 4.20
 ;;    - Links use now the [[link][description]] format by default.
 ;;      When inserting links, the user is prompted for a description.
@@ -174,7 +182,7 @@
 
 ;;; Customization variables
 
-(defvar org-version "4.21"
+(defvar org-version "4.24"
   "The version number of the file org.el.")
 (defun org-version ()
   (interactive)
@@ -227,7 +235,11 @@
 (defcustom org-startup-align-all-tables nil
   "Non-nil means, align all tables when visiting a file.
 This is useful when the column width in tables is forced with <N> cookies
-in table fields.  Such tables will look correct only after the first re-align."
+in table fields.  Such tables will look correct only after the first re-align.
+This can also be configured on a per-file basis by adding one of
+the following lines anywhere in the buffer:
+   #+STARTUP: align
+   #+STARTUP: noalign"
   :group 'org-startup
   :type 'boolean)
 
@@ -237,7 +249,6 @@
 immediate reminder of any due deadlines.
 This can also be configured on a per-file basis by adding one of
 the following lines anywhere in the buffer:
-
    #+STARTUP: dlcheck
    #+STARTUP: nodlcheck"
   :group 'org-startup
@@ -391,7 +402,12 @@
 promotion/demotion commands.  It also influences how levels are
 handled by the exporters.
 Changing it requires restart of `font-lock-mode' to become effective
-for fontification also in regions already fontified."
+for fontification also in regions already fontified.
+You may also set this on a per-file basis by adding one of the following
+lines to the buffer:
+
+   #+STARTUP: odd
+   #+STARTUP: oddeven"
   :group 'org-edit-structure
   :group 'org-font-lock
   :type 'boolean)
@@ -870,6 +886,13 @@
   :group 'org-link-follow
   :type 'boolean)
 
+(defcustom org-mouse-1-follows-link t
+  "Non-nil means, mouse-1 on a link will follow the link.
+A longer mouse click will still set point.  Does not wortk on XEmacs.
+Needs to be set before org.el is loaded."
+  :group 'org-link-follow
+  :type 'boolean)
+
 (defcustom org-mark-ring-length 4
   "Number of different positions to be recorded in the ring
 Changing this requires a restart of Emacs to work correctly."
@@ -1112,7 +1135,7 @@
   :type 'boolean)
 
 (defgroup org-priorities nil
-  "Keywords in Org-mode."
+  "Priorities in Org-mode."
   :tag "Org Priorities"
   :group 'org-todo)
 
@@ -1167,7 +1190,7 @@
   :type 'boolean)
 
 (defgroup org-tags nil
-  "Options concerning startup of Org-mode."
+  "Options concerning tags in Org-mode."
   :tag "Org Tags"
   :group 'org)
 
@@ -1301,21 +1324,28 @@
   :tag "Org Agenda Window Setup"
   :group 'org-agenda)
 
+(defcustom org-agenda-mouse-1-follows-link nil
+  "Non-nil means, mouse-1 on a link will follow the link in the agenda.
+A longer mouse click will still set point.  Does not wortk on XEmacs.
+Needs to be set before org.el is loaded."
+  :group 'org-agenda-setup
+  :type 'boolean)
+
 (defcustom org-select-timeline-window t
   "Non-nil means, after creating a timeline, move cursor into Timeline window.
 When nil, cursor will remain in the current window."
-  :group 'org-agenda-window-setup
+  :group 'org-agenda-setup
   :type 'boolean)
 
 (defcustom org-select-agenda-window t
   "Non-nil means, after creating an agenda, move cursor into Agenda window.
 When nil, cursor will remain in the current window."
-  :group 'org-agenda-window-setup
+  :group 'org-agenda-setup
   :type 'boolean)
 
 (defcustom org-fit-agenda-window t
   "Non-nil means, change window size of agenda to fit content."
-  :group 'org-agenda-window-setup
+  :group 'org-agenda-setup
   :type 'boolean)
 
 (defgroup org-agenda-display nil
@@ -1884,7 +1914,12 @@
 background.  You may have to customize the face `org-hide' to
 make this work.
 Changing it requires restart of `font-lock-mode' to become effective
-also in regions already fontified."
+also in regions already fontified.
+You may also set this on a per-file basis by adding one of the following
+lines to the buffer:
+
+   #+STARTUP: hidestars
+   #+STARTUP: showstars"
   :group 'org-font-lock
   :type 'boolean)
 
@@ -2051,6 +2086,14 @@
   "Face for links."
   :group 'org-faces)
 
+(defface org-date
+  '((((type tty) (class color)) (:foreground "cyan" :weight bold))
+    (((class color) (background light)) (:foreground "Purple" :underline t))
+    (((class color) (background dark)) (:foreground "Cyan" :underline t))
+    (t (:bold t)))
+  "Face for links."
+  :group 'org-faces)
+
 (defface org-tag
   '((((type tty) (class color)) (:weight bold))
     (((class color) (background light)) (:weight bold))
@@ -2059,6 +2102,15 @@
   "Face for tags."
   :group 'org-faces)
 
+(defface org-todo ;; font-lock-warning-face
+  '((((type tty) (class color)) (:foreground "red"))
+    (((class color) (background light)) (:foreground "Red" :bold t))
+    (((class color) (background dark)) (:foreground "Red1" :bold t))
+;    (((class color) (background dark)) (:foreground "Pink" :bold t))
+    (t (:inverse-video t :bold t)))
+  "Face for TODO keywords."
+  :group 'org-faces)
+
 (defface org-done ;; font-lock-type-face
   '((((type tty) (class color)) (:foreground "green"))
     (((class color) (background light)) (:foreground "ForestGreen" :bold t))
@@ -2165,7 +2217,9 @@
 	     ((equal key "STARTUP")
 	      (let ((opts (org-split-string value splitre))
 		    (set '(("fold" org-startup-folded t)
+			   ("overview" org-startup-folded t)
 			   ("nofold" org-startup-folded nil)
+			   ("showall" org-startup-folded nil)
 			   ("content" org-startup-folded content)
 			   ("hidestars" org-hide-leading-stars t)
 			   ("showstars" org-hide-leading-stars nil)
@@ -2379,6 +2433,10 @@
 	s)
     (match-string-no-properties num string)))
 
+(defsubst org-no-properties (s)
+  (remove-text-properties 0 (length s) org-rm-props s)
+  s)
+
 (defun org-current-time ()
   "Current time, possibly rounded to `org-time-stamp-rounding-minutes'."
   (if (> org-time-stamp-rounding-minutes 0)
@@ -2406,7 +2464,8 @@
   (if (featurep 'xemacs) [button2] [mouse-2]) 'org-open-at-mouse)
 (define-key org-mouse-map
   (if (featurep 'xemacs) [button3] [mouse-3]) 'org-find-file-at-mouse)
-(define-key org-mouse-map [follow-link] 'mouse-face)
+(when org-mouse-1-follows-link
+  (define-key org-mouse-map [follow-link] 'mouse-face))
 (when org-tab-follows-link
   (define-key org-mouse-map [(tab)] 'org-open-at-point)
   (define-key org-mouse-map "\C-i" 'org-open-at-point))
@@ -2508,7 +2567,9 @@
 (defun org-activate-bracket-links (limit)
   "Run through the buffer and add overlays to bracketed links."
   (if (re-search-forward org-bracket-link-regexp limit t)
-      (let* ((help (concat "LINK: " (org-match-string-no-properties 1)))
+      (let* ((help (concat "LINK: "
+			   (org-match-string-no-properties 1)))
+	     ;; FIXME: above we should remove the escapes.
 	     (ip (list 'invisible 'org-link 'intangible t 'rear-nonsticky t
 		       'keymap org-mouse-map 'mouse-face 'highlight
 		       'help-echo help))
@@ -2656,13 +2717,13 @@
 	   (if (memq 'plain lk) '(org-activate-plain-links (0 'org-link t)))
 	   (if (memq 'bracket lk) '(org-activate-bracket-links (0 'org-link t)))
 	   (if (memq 'radio lk) '(org-activate-target-links (0 'org-link t)))
-	   (if (memq 'date lk) '(org-activate-dates (0 'org-link t)))
+	   (if (memq 'date lk) '(org-activate-dates (0 'org-date t)))
 	   (if (memq 'camel lk) '(org-activate-camels (0 'org-link t)))
 	   (if (memq 'tag lk) '(org-activate-tags (1 'org-tag prepend)))
 	   (if org-table-limit-column-width
 	       '(org-hide-wide-columns (0 nil append)))
 	   (list (concat "^\\*+[ \t]*" org-not-done-regexp)
-		 '(1 'org-warning t))
+		 '(1 'org-todo t))
 	   (list (concat "\\[#[A-Z]\\]") '(0 'org-special-keyword t))
 	   (list (concat "\\<" org-deadline-string) '(0 'org-special-keyword t))
 	   (list (concat "\\<" org-scheduled-string) '(0 'org-special-keyword t))
@@ -2683,7 +2744,7 @@
 	   '("| *\\(:?=[^|\n]*\\)" (1 'org-formula t))
 	   '("^[ \t]*| *\\([#!$*_^]\\) *|" (1 'org-formula t))
 	   (if org-format-transports-properties-p
-	       '("| *\\(<[0-9]+>\\) *|" (1 'org-formula t)))
+	       '("| *\\(<[0-9]+>\\) *" (1 'org-formula t)))
 	   )))
     (setq org-font-lock-extra-keywords (delq nil org-font-lock-extra-keywords))
     ;; Now set the full font-lock-keywords
@@ -3048,7 +3109,10 @@
 		     (error (outline-next-heading)))
 		   (prog1 (match-string 0)
 		     (funcall outline-level)))))
-      (unless (bolp) (newline))
+      (if (and (bolp) 
+	       (save-excursion (backward-char 1) (not (org-invisible-p))))
+	  (open-line 1)
+	(newline))
       (insert head)
       (if (looking-at "[ \t]*")
 	  (replace-match " "))
@@ -4249,7 +4313,7 @@
 	   ;; the range start.
 	   (if (save-excursion
 		 (re-search-backward
-		  (concat org-ts-regexp "--\\=")
+		  (concat org-ts-regexp "--\\=") ; FIXME: exactly two minuses?
 		  (- (point) 20) t))
 	       (apply
 		'encode-time
@@ -4769,7 +4833,8 @@
   (if (featurep 'xemacs) [(button2)] [(mouse-2)]) 'org-agenda-goto-mouse)
 (define-key org-agenda-keymap
   (if (featurep 'xemacs) [(button3)] [(mouse-3)]) 'org-agenda-show-mouse)
-(define-key org-agenda-keymap [follow-link] 'mouse-face)
+(when org-agenda-mouse-1-follows-link
+  (define-key org-agenda-keymap [follow-link] 'mouse-face))
 (easy-menu-define org-agenda-menu org-agenda-mode-map "Agenda menu"
   '("Agenda"
     ("Agenda Files")
@@ -5156,7 +5221,7 @@
 			 (d (- nt n1)))
 		    (- sd (+ (if (< d 0) 7 0) d)))))
 	 (day-numbers (list start))
-;FIXME	 (inhibit-redisplay t)
+	 (inhibit-redisplay t)
 	 s e rtn rtnall file date d start-pos end-pos todayp nd)
     (setq org-agenda-redo-command
 	  (list 'org-agenda-list (list 'quote include-all) start-day ndays t))
@@ -5522,7 +5587,7 @@
 	 (org-disable-agenda-to-diary t))
     (save-excursion
       (save-window-excursion
-	(list-diary-entries date 1)))
+	(list-diary-entries date 1)))  ;; Keep this name for now, compatibility
     (if (not (get-buffer fancy-diary-buffer))
 	(setq entries nil)
       (with-current-buffer fancy-diary-buffer
@@ -5966,7 +6031,7 @@
 		    (org-add-props txt nil
 		      'face 'org-scheduled-today
 		      'undone-face 'org-scheduled-today 'done-face 'org-done
-		      'category category priority (+ 99 priority))
+		      'category category 'priority (+ 99 priority))
 		  (org-add-props txt nil 'priority priority 'category category)))
 	      (push txt ee))
 	    (outline-next-heading))))
@@ -6227,7 +6292,7 @@
 			     (file-name-sans-extension
 			      (file-name-nondirectory buffer-file-name))
 			   "")))
-	   (tag (or (nth (1- (or (length tags) 0)) tags) ""))
+	   (tag (if tags (nth (1- (length tags)) tags) ""))
 	   time              ;; needed for the eval of the prefix format
 	   (ts (if dotime (concat (if (stringp dotime) dotime "") txt)))
 	   (time-of-day (and dotime (org-get-time-of-day ts)))
@@ -7282,7 +7347,10 @@
 			   (format "Execute \"%s\" in shell? "
 				   (org-add-props cmd nil
 				     'face 'org-warning))))
-	      (shell-command cmd)
+	      (progn
+		(message "Executing %s..." cmd)
+		(shell-command cmd)
+		(message "Executing %s...done" cmd))
 	    (error "Abort"))))
 
        (t
@@ -7670,6 +7738,28 @@
       (kill-this-buffer)
       (error "Message not found"))))
 
+(defun org-upgrade-old-links (&optional query-description)
+  "Transfer old <...> style links to new [[...]] style links.
+With arg query-description, ask at each match for a description text to use
+for this link."
+  (interactive (list (y-or-n-p "Would you like to be queried for a description at each link?")))
+  (save-excursion
+    (goto-char (point-min))
+    (let ((re (concat "\\([^[]\\)<\\(" 
+		      "\\(" (mapconcat 'identity org-link-types "\\|") 
+		      "\\):"
+		      "[^" org-non-link-chars "]+\\)>"))
+	  l1 l2 (cnt 0))
+      (while (re-search-forward re nil t)
+	(setq cnt (1+ cnt)
+	      l1 (org-match-string-no-properties 2)
+	      l2 (save-match-data (org-link-escape l1)))
+	(when query-description (setq l1 (read-string "Desc: " l1)))
+	(if (equal l1 l2)
+	    (replace-match (concat (match-string 1) "[[" l1 "]]") t t)
+	  (replace-match (concat (match-string 1) "[[" l2 "][" l1 "]]") t t)))
+      (message "%d matches have beed treated" cnt))))
+
 (defun org-open-file (path &optional in-emacs line search)
   "Open the file at PATH.
 First, this expands any special file name abbreviations.  Then the
@@ -8619,7 +8709,7 @@
 			   (> (org-string-width xx) fmax))
 		  (org-add-props xx nil
 		    'help-echo
-		    (concat "Clipped table field, use C-c ` to edit. Full value is:\n" (copy-sequence xx)))
+		    (concat "Clipped table field, use C-c ` to edit. Full value is:\n" (org-no-properties (copy-sequence xx))))
 		  (setq f1 (min fmax (or (string-match org-bracket-link-regexp xx) fmax)))
 		  (unless (> f1 1)
 		    (error "Cannot narrow field starting with wide link \"%s\""
@@ -10153,7 +10243,8 @@
 			    (org-table-align)))))
 
 (defun org-table-recalculate (&optional all noalign)
-  "Recalculate the current table line by applying all stored formulas."
+  "Recalculate the current table line by applying all stored formulas.
+With prefix arg ALL, do this for all lines in the table."
   (interactive "P")
   (or (memq this-command org-recalc-commands)
       (setq org-recalc-commands (cons this-command org-recalc-commands)))
@@ -11376,7 +11467,7 @@
        (mapconcat 'identity org-todo-keywords " ")
      "Me Jason Marie DONE")
    (cdr (assoc org-startup-folded
-	       '((nil . "nofold")(t . "fold")(content . "content"))))
+	       '((nil . "showall") (t . "overview") (content . "content"))))
    (if org-startup-with-deadline-check "dlcheck" "nodlcheck")
    (if org-odd-levels-only "odd" "oddeven")
    (if org-hide-leading-stars "hidestars" "showstars")
@@ -11718,8 +11809,9 @@
 			      (concat "<img src=\"" thefile "\"/>")
 			    (concat "<a href=\"" thefile "\">" desc "</a>")))))
 	     ((member type '("bbdb" "vm" "wl" "mhe" "rmail" "gnus" "shell"))
-	      (setq rpl (concat "<i>&lt;" type ":" path "&gt;</i>"))))
-	    ;; FIXME: We get to see the escaped links!!!!!
+	      (setq rpl (concat "<i>&lt;" type ":"
+				(save-match-data (org-link-unescape path))
+				"&gt;</i>"))))
 	    (setq line (replace-match rpl t t line)
 		  start (+ start (length rpl))))
 	  ;; TODO items
@@ -12196,6 +12288,89 @@
   (interactive)
   (org-export-icalendar nil buffer-file-name))
 
+(defun org-export-as-xml ()
+  "Export current buffer as XOXO XML buffer."
+  (interactive)
+  (cond ((eq org-export-xml-type 'xoxo)
+	 (org-export-as-xoxo (current-buffer)))))
+
+(defun org-export-as-xoxo-insert-into (buffer &rest output)
+  (with-current-buffer buffer
+    (apply 'insert output)))
+
+(defun org-export-as-xoxo (&optional buffer)
+  "Export the org buffer as XOXO.
+The XOXO buffer is named *xoxo-<source buffer name>*"
+  (interactive (list (current-buffer)))
+  ;; A quickie abstraction
+
+  ;; Output everything as XOXO
+  (with-current-buffer (get-buffer buffer)
+    (goto-char (point-min))  ;; CD:  beginning-of-buffer is not allowed.
+    (let* ((filename (concat (file-name-sans-extension buffer-file-name)
+			     ".xml"))
+	   (out (find-file-noselect filename))
+	   (last-level 1)
+	   (hanging-li nil))
+      ;; Check the output buffer is empty.
+      (with-current-buffer out (erase-buffer))
+      ;; Kick off the output
+      (org-export-as-xoxo-insert-into out "<ol class='xoxo'>\n")
+      (while (re-search-forward "^\\(\\*+\\) \\(.+\\)" (point-max) 't)
+        (let* ((hd (match-string-no-properties 1))
+               (level (length hd))
+               (text (concat
+                      (match-string-no-properties 2)
+                      (save-excursion
+                        (goto-char (match-end 0))
+                        (let ((str ""))
+                          (catch 'loop
+                            (while 't
+                              (forward-line)
+                              (if (looking-at "^[ \t]\\(.*\\)")
+                                  (setq str (concat str (match-string-no-properties 1)))
+                                (throw 'loop str)))))))))
+
+          ;; Handle level rendering
+          (cond
+           ((> level last-level)
+            (org-export-as-xoxo-insert-into out "\n<ol>\n"))
+
+           ((< level last-level)
+            (dotimes (- (- last-level level) 1)
+              (if hanging-li
+                  (org-export-as-xoxo-insert-into out "</li>\n"))
+              (org-export-as-xoxo-insert-into out "</ol>\n"))
+            (when hanging-li
+              (org-export-as-xoxo-insert-into out "</li>\n")
+              (setq hanging-li nil)))
+
+           ((equal level last-level)
+            (if hanging-li
+                (org-export-as-xoxo-insert-into out "</li>\n")))
+           )
+
+          (setq last-level level)
+
+          ;; And output the new li
+          (setq hanging-li 't)
+          (if (equal ?+ (elt text 0))
+              (org-export-as-xoxo-insert-into out "<li class='" (substring text 1) "'>")
+            (org-export-as-xoxo-insert-into out "<li>" text))))
+
+      ;; Finally finish off the ol
+      (dotimes (- last-level 1)
+        (if hanging-li
+            (org-export-as-xoxo-insert-into out "</li>\n"))
+        (org-export-as-xoxo-insert-into out "</ol>\n"))
+
+      ;; Finish the buffer off and clean it up.
+      (switch-to-buffer-other-window out)
+      (indent-region (point-min) (point-max))
+      (save-buffer)
+      (goto-char (point-min))
+      )))
+
 ;;;###autoload
 (defun org-export-icalendar-all-agenda-files ()
   "Export all files in `org-agenda-files' to iCalendar .ics files.
@@ -12742,19 +12917,36 @@
     (org-paste-subtree arg)))
 
 (defun org-ctrl-c-ctrl-c (&optional arg)
-  "Call realign table, or recognize a table.el table, or update keywords.
-When the cursor is inside a table created by the table.el package,
-activate that table.  Otherwise, if the cursor is at a normal table
-created with org.el, re-align that table.  This command works even if
-the automatic table editor has been turned off.
-
-If the cursor is in a headline, prompt for tags and insert them into
-the current line, aligned to `org-tags-column'.  When in a headline and
-called with prefix arg, realign all tags in the current buffer.
-
-If the cursor is in one of the special #+KEYWORD lines, this triggers
-scanning the buffer for these lines and updating the information.
-If the cursor is on a #+TBLFM line, re-apply the formulae to the table."
+  "Set tags in headline, or update according to changed information at point.
+
+This command does many different things, depending on context:
+
+- If the cursor is in a headline, prompt for tags and insert them
+  into the current line, aligned to `org-tags-column'.  When called
+  with prefix arg, realign all tags in the current buffer.
+
+- If the cursor is in one of the special #+KEYWORD lines, this
+  triggers scanning the buffer for these lines and updating the
+  information. 
+
+- If the cursor is inside a table, realign the table.  This command
+  works even if the automatic table editor has been turned off.
+
+- If the cursor is on a #+TBLFM line, re-apply the formulas to
+  the entire table.
+
+- If the cursor is inside a table created by the table.el package,
+  activate that table.
+
+- If the current buffer is a remember buffer, close note and file it.
+  with a prefix argument, file it without further interaction to the default
+  location.
+
+- If the cursor is on a <<<target>>>, update radio targets and corresponding
+  links in this buffer.
+
+- If the cursor is on a numbered item in a plain list, renumber the
+  ordered list."
   (interactive "P")
   (let  ((org-enable-table-editor t))
     (cond
@@ -13091,9 +13283,10 @@
   ;; through to `fill-paragraph' when appropriate.
   (set (make-local-variable 'fill-paragraph-function) 'org-fill-paragraph)
   ;; Adaptive filling: To get full control, first make sure that
-  ;; `adaptive-fill-regexp' never matches.  Then install our won matcher.
-  (setq adaptive-fill-regexp "\000")
-  (setq adaptive-fill-function 'org-adaptive-fill-function))
+  ;; `adaptive-fill-regexp' never matches.  Then install our own matcher.
+  (set (make-local-variable 'adaptive-fill-regexp) "\000")
+  (set (make-local-variable 'adaptive-fill-function)
+       'org-adaptive-fill-function))
 
 (defun org-fill-paragraph (&optional justify)
   "Re-align a table, pass through to fill-paragraph if no table."
@@ -13368,7 +13561,6 @@
        (or (match-beginning 1) (point-max)))
      (if org-noutline-p nil ?\n))))
 
-
 (defun org-make-options-regexp (kwds)
   "Make a regular expression for keyword lines."
   (concat
@@ -13402,114 +13594,6 @@
 
 (run-hooks 'org-load-hook)
 
-;; Experimental code
-;; FIXME: Move this code when it is ready.
-
-(defun org-upgrade-old-links (&optional query-description)
-  "Transfer old <...> style links to new [[...]] style links.
-With arg query-description, ask at each match for a description text to use
-for this link."
-  (interactive (list (y-or-n-p "Would you like to be queried for a description at each link?")))
-  (save-excursion
-    (goto-char (point-min))
-    (let ((re (concat "\\([^[]\\)<\\(" 
-		      "\\(" (mapconcat 'identity org-link-types "\\|") 
-		      "\\):"
-		      "[^" org-non-link-chars "]+\\)>"))
-	  l1 l2 (cnt 0))
-      (while (re-search-forward re nil t)
-	(setq cnt (1+ cnt)
-	      l1 (org-match-string-no-properties 2)
-	      l2 (save-match-data (org-link-escape l1)))
-	(when query-description (setq l1 (read-string "Desc: " l1)))
-	(if (equal l1 l2)
-	    (replace-match (concat (match-string 1) "[[" l1 "]]") t t)
-	  (replace-match (concat (match-string 1) "[[" l2 "][" l1 "]]") t t)))
-      (message "%d matches have beed treated" cnt))))
-
-(defun org-export-as-xml ()
-  "Export current buffer as XOXO XML buffer."
-  (interactive)
-  (cond ((eq org-export-xml-type 'xoxo)
-	 (org-export-as-xoxo (current-buffer)))))
-
-(defun org-export-as-xoxo-insert-into (buffer &rest output)
-  (with-current-buffer buffer
-    (apply 'insert output)))
-
-(defun org-export-as-xoxo (&optional buffer)
-  "Export the org buffer as XOXO.
-The XOXO buffer is named *xoxo-<source buffer name>*"
-  (interactive (list (current-buffer)))
-  ;; A quickie abstraction
-
-  ;; Output everything as XOXO
-  (with-current-buffer (get-buffer buffer)
-    (goto-char (point-min))  ;; CD:  beginning-of-buffer is not allowed.
-    (let* ((filename (concat (file-name-sans-extension buffer-file-name)
-			     ".xml"))
-	   (out (find-file-noselect filename))
-	   (last-level 1)
-	   (hanging-li nil))
-      ;; Check the output buffer is empty.
-      (with-current-buffer out (erase-buffer))
-      ;; Kick off the output
-      (org-export-as-xoxo-insert-into out "<ol class='xoxo'>\n")
-      (while (re-search-forward "^\\(\\*+\\) \\(.+\\)" (point-max) 't)
-        (let* ((hd (match-string-no-properties 1))
-               (level (length hd))
-               (text (concat
-                      (match-string-no-properties 2)
-                      (save-excursion
-                        (goto-char (match-end 0))
-                        (let ((str ""))
-                          (catch 'loop
-                            (while 't
-                              (forward-line)
-                              (if (looking-at "^[ \t]\\(.*\\)")
-                                  (setq str (concat str (match-string-no-properties 1)))
-                                (throw 'loop str)))))))))
-
-          ;; Handle level rendering
-          (cond
-           ((> level last-level)
-            (org-export-as-xoxo-insert-into out "\n<ol>\n"))
-
-           ((< level last-level)
-            (dotimes (- (- last-level level) 1)
-              (if hanging-li
-                  (org-export-as-xoxo-insert-into out "</li>\n"))
-              (org-export-as-xoxo-insert-into out "</ol>\n"))
-            (when hanging-li
-              (org-export-as-xoxo-insert-into out "</li>\n")
-              (setq hanging-li nil)))
-
-           ((equal level last-level)
-            (if hanging-li
-                (org-export-as-xoxo-insert-into out "</li>\n")))
-           )
-
-          (setq last-level level)
-
-          ;; And output the new li
-          (setq hanging-li 't)
-          (if (equal ?+ (elt text 0))
-              (org-export-as-xoxo-insert-into out "<li class='" (substring text 1) "'>")
-            (org-export-as-xoxo-insert-into out "<li>" text))))
-
-      ;; Finally finish off the ol
-      (dotimes (- last-level 1)
-        (if hanging-li
-            (org-export-as-xoxo-insert-into out "</li>\n"))
-        (org-export-as-xoxo-insert-into out "</ol>\n"))
-
-      ;; Finish the buffer off and clean it up.
-      (switch-to-buffer-other-window out)
-      (indent-region (point-min) (point-max) nil)
-      (save-buffer)
-      (goto-char (point-min))
-      )))
-
 ;; arch-tag: e77da1a7-acc7-4336-b19e-efa25af3f9fd
 ;;; org.el ends here
 
--- a/lisp/textmodes/tex-mode.el	Wed Apr 12 17:40:36 2006 +0000
+++ b/lisp/textmodes/tex-mode.el	Wed Apr 19 16:23:46 2006 +0000
@@ -594,20 +594,24 @@
 	'(face subscript display (raise -0.3))
       '(face superscript display (raise +0.3)))))
 
+(defun tex-font-lock-match-suscript (limit)
+  "Match subscript and superscript patterns up to LIMIT."
+  (when (re-search-forward "[_^] *\\([^\n\\{}]\\|\
+\\\\\\([a-zA-Z@]+\\|[^ \t\n]\\)\\|{[^\\{]*}\\|\\({\\)\\)" limit t)
+    (when (match-end 3)
+      (let ((beg (match-beginning 3))
+	    (end (save-restriction
+		   (narrow-to-region (point-min) limit)
+		   (condition-case nil (scan-lists (point) 1 1) (error nil)))))
+	(store-match-data (if end
+			      (list (match-beginning 0) end beg end)
+                            (list beg beg beg beg)))))
+    t))
+
 (defconst tex-font-lock-keywords-3
   (append tex-font-lock-keywords-2
-   (eval-when-compile
-     (let ((general "\\([a-zA-Z@]+\\|[^ \t\n]\\)")
-	   (slash "\\\\")
-	   ;; This is not the same regexp as before: it has a `+' removed.
-	   ;; The + makes the matching faster in the above cases (where we can
-	   ;; exit as soon as the match fails) but would make this matching
-	   ;; degenerate to nasty complexity (because we try to match the
-	   ;; closing brace, which forces trying all matching combinations).
-	   (arg "{\\(?:[^{}\\]\\|\\\\.\\|{[^}]*}\\)*"))
-       `((,(concat "[_^] *\\([^\n\\{}#]\\|" slash general "\\|#[0-9]\\|" arg "}\\)")
-	  (1 (tex-font-lock-suscript (match-beginning 0))
-	     append))))))
+	  '((tex-font-lock-match-suscript
+	     (1 (tex-font-lock-suscript (match-beginning 0)) append))))
   "Experimental expressions to highlight in TeX modes.")
 
 (defvar tex-font-lock-keywords tex-font-lock-keywords-1
--- a/lisp/time-stamp.el	Wed Apr 12 17:40:36 2006 +0000
+++ b/lisp/time-stamp.el	Wed Apr 19 16:23:46 2006 +0000
@@ -5,7 +5,7 @@
 
 ;; This file is part of GNU Emacs.
 
-;; Maintainer's Time-stamp: <2006-02-06 15:11:58 ttn>
+;; Maintainer's Time-stamp: <2006-04-12 20:30:56 rms>
 ;; Maintainer: Stephen Gildea <gildea@stop.mail-abuse.org>
 ;; Keywords: tools
 
@@ -93,6 +93,7 @@
   :type 'string
   :group 'time-stamp
   :version "20.1")
+;;;###autoload(put 'time-stamp-format 'safe-local-variable 'stringp)
 
 (defcustom time-stamp-active t
   "*Non-nil to enable time-stamping of buffers by \\[time-stamp].
@@ -150,7 +151,7 @@
 incompatible with other people's files!  If you must change them for some
 application, do so in the local variables section of the time-stamped file
 itself.")
-
+;;;###autoload(put 'time-stamp-line-limit 'safe-local-variable 'integerp)
 
 (defvar time-stamp-start "Time-stamp:[ \t]+\\\\?[\"<]+"    ;Do not change!
   "Regexp after which the time stamp is written by \\[time-stamp].
@@ -163,7 +164,7 @@
 incompatible with other people's files!  If you must change them for some
 application, do so in the local variables section of the time-stamped file
 itself.")
-
+;;;###autoload(put 'time-stamp-start 'safe-local-variable t)
 
 (defvar time-stamp-end "\\\\?[\">]"    ;Do not change!
   "Regexp marking the text after the time stamp.
@@ -183,6 +184,7 @@
 or `time-stamp-inserts-lines' for yourself or you will be incompatible
 with other people's files!  If you must change them for some application,
 do so in the local variables section of the time-stamped file itself.")
+;;;###autoload(put 'time-stamp-end 'safe-local-variable t)
 
 
 (defvar time-stamp-inserts-lines nil    ;Do not change!
@@ -199,6 +201,7 @@
 yourself or you will be incompatible with other people's files!
 If you must change them for some application, do so in the local
 variables section of the time-stamped file itself.")
+;;;###autoload(put 'time-stamp-inserts-lines 'safe-local-variable t)
 
 
 (defvar time-stamp-count 1		;Do not change!
@@ -209,6 +212,7 @@
 incompatible with other people's files!  If you must change it for
 some application, do so in the local variables section of the
 time-stamped file itself.")
+;;;###autoload(put 'time-stamp-count 'safe-local-variable 'integerp)
 
 
 (defvar time-stamp-pattern nil		;Do not change!
@@ -244,6 +248,7 @@
 incompatible with other people's files!  If you must change them for
 some application, do so only in the local variables section of the
 time-stamped file itself.")
+;;;###autoload(put 'time-stamp-pattern 'safe-local-variable 'stringp)
 
 
 
--- a/lisp/tooltip.el	Wed Apr 12 17:40:36 2006 +0000
+++ b/lisp/tooltip.el	Wed Apr 19 16:23:46 2006 +0000
@@ -47,11 +47,15 @@
 ;; would be accompanied by a full redisplay.
 
 (define-minor-mode tooltip-mode
-  "Toggle Tooltip display.
-With ARG, turn tooltip mode on if and only if ARG is positive.
+  "Toggle Tooltip mode.
+With ARG, turn Tooltip mode on if and only if ARG is positive.
 When this minor mode is enabled, Emacs displays help text
-in a pop-up window on mouse-over.  When it is disabled,
-Emacs displays the help text in the echo area instead."
+in a pop-up window for buttons and menu items that you put the mouse on.
+\(However, if `tooltip-use-echo-area' is non-nil, this and
+all pop-up help appears in the echo area.)
+
+When Tooltip mode is disabled, Emacs displays one line of
+the help text in the echo area, and does not make a pop-up window."
   :global t
   :init-value (not (or noninteractive
 		       emacs-basic-display
@@ -142,7 +146,9 @@
   :group 'basic-faces)
 
 (defcustom tooltip-use-echo-area nil
-  "Use the echo area instead of tooltip frames for help and GUD tooltips."
+  "Use the echo area instead of tooltip frames for help and GUD tooltips.
+To display multi-line help text in the echo area, set this to t
+and enable `tooltip-mode'."
   :type 'boolean
   :group 'tooltip)
 
--- a/lisp/vc.el	Wed Apr 12 17:40:36 2006 +0000
+++ b/lisp/vc.el	Wed Apr 19 16:23:46 2006 +0000
@@ -3107,7 +3107,11 @@
   (vc-ensure-vc-buffer)
   (setq vc-annotate-display-mode display-mode) ;Not sure why.  --Stef
   (let* ((temp-buffer-name (format "*Annotate %s (rev %s)*" (buffer-name) rev))
-         (temp-buffer-show-function 'vc-annotate-display-select))
+         (temp-buffer-show-function 'vc-annotate-display-select)
+         ;; If BUF is specified, we presume the caller maintains current line,
+         ;; so we don't need to do it here.  This implementation may give
+         ;; strange results occasionally in the case of REV != WORKFILE-REV.
+         (current-line (unless buf (line-number-at-pos))))
     (message "Annotating...")
     ;; If BUF is specified it tells in which buffer we should put the
     ;; annotations.  This is used when switching annotations to another
@@ -3129,6 +3133,8 @@
         (set (make-local-variable 'vc-annotate-parent-rev) rev)
         (set (make-local-variable 'vc-annotate-parent-display-mode)
              display-mode)))
+    (when current-line
+      (goto-line current-line temp-buffer-name))
     (message "Annotating... done")))
 
 (defun vc-annotate-prev-version (prefix)
@@ -3310,8 +3316,8 @@
       (let* ((color (or (vc-annotate-compcar difference vc-annotate-color-map)
 			(cons nil vc-annotate-very-old-color)))
 	     ;; substring from index 1 to remove any leading `#' in the name
-	     (face-name (concat "vc-annotate-face-" 
-				(if (string-equal 
+	     (face-name (concat "vc-annotate-face-"
+				(if (string-equal
 				     (substring (cdr color) 0 1) "#")
 				    (substring (cdr color) 1)
 				  (cdr color))))
--- a/lispref/ChangeLog	Wed Apr 12 17:40:36 2006 +0000
+++ b/lispref/ChangeLog	Wed Apr 19 16:23:46 2006 +0000
@@ -1,3 +1,35 @@
+2006-04-18  Richard Stallman  <rms@gnu.org>
+
+	* tips.texi (Coding Conventions): Explain when the package's
+	prefix should appear later on (not at the start of the name).
+
+	* searching.texi (String Search): Clarify effect of NOERROR.
+
+	* modes.texi (Imenu): Clarify what special items do.
+
+	* hooks.texi (Standard Hooks): Delete text about old hook names.
+
+2006-04-17  Romain Francoise  <romain@orebokech.com>
+
+	* variables.texi (Local Variables): Update the default value of
+	`max-specpdl-size'.
+
+2006-04-15  Michael Olson  <mwolson@gnu.org>
+
+	* processes.texi (Transaction Queues): Mention the new optional
+	`delay-question' argument for `tq-enqueue'.
+
+2006-04-13  Bill Wohler  <wohler@newt.com>
+
+	* customize.texi (Common Keywords): Use dotted notation for
+	:package-version value. Specify its values. Improve documentation
+	for customize-package-emacs-version-alist.
+
+2006-04-12  Bill Wohler  <wohler@newt.com>
+
+	* customize.texi (Common Keywords): Move description of
+	customize-package-emacs-version-alist to @defvar.
+
 2006-04-10  Bill Wohler  <wohler@newt.com>
 
 	* customize.texi (Common Keywords): Add :package-version.
@@ -43,8 +75,7 @@
 
 2006-03-19  Alan Mackenzie  <acm@muc.de>
 
-	* text.texi (Special Properties): Clarify the definition of
-	'fontified.
+	* text.texi (Special Properties): Clarify `fontified' property.
 
 2006-03-16  Richard Stallman  <rms@gnu.org>
 
--- a/lispref/customize.texi	Wed Apr 12 17:40:36 2006 +0000
+++ b/lispref/customize.texi	Wed Apr 19 16:23:46 2006 +0000
@@ -131,25 +131,47 @@
 version @var{version}, or that its default value was changed in that
 version.  The value @var{version} must be a string.
 
-@item :package-version '(@var{package} @var{version})
+@item :package-version '(@var{package} . @var{version})
 This option specifies that the item was first introduced in
 @var{package} version @var{version}, or that its default value was
 changed in that version.  This keyword takes priority over :version.
+The value of @var{package} is a symbol and @var{version} is a string.
 The @var{package} and @var{version} must appear in the alist
-@code{customize-package-emacs-version-alist}.  This alist maps packages
-to alists that map all package versions used with the
-@code{:package-version} keyword to Emacs versions.  Packages are
-symbols and versions are strings.  For example, the MH-E package
-updates this alist with the following:
+@code{customize-package-emacs-version-alist}.  Since @var{package} must
+be unique and the user might see it in an error message, a good choice
+is the official name of the package, such as MH-E or Gnus.
+
+@end table
+
+Packages that use the @code{:package-version} keyword must also update
+the @code{customize-package-emacs-version-alist} variable.
+
+@defvar customize-package-emacs-version-alist
+This alist provides a mapping for the versions of Emacs that are
+associated with versions of a package listed in the
+@code{:package-version} keyword.  Its elements look like this:
+
+@example
+(@var{package} (@var{pversion} . @var{eversion})@dots{})
+@end example
+
+For each @var{package}, which is a symbol, there are one or more
+elements that contain a package version @var{pversion} with an
+associated Emacs version @var{eversion}.  These versions are strings.
+For example, the MH-E package updates this alist with the following:
 
 @smallexample
 (add-to-list 'customize-package-emacs-version-alist
-             '(MH-E ("6.0" "22.1") ("6.1" "22.1") ("7.0" "22.1")
-                    ("7.1" "22.1") ("7.2" "22.1") ("7.3" "22.1")
-                    ("7.4" "22.1") ("8.0" "22.1")))
+             '(MH-E ("6.0" . "22.1") ("6.1" . "22.1") ("7.0" . "22.1")
+                    ("7.1" . "22.1") ("7.2" . "22.1") ("7.3" . "22.1")
+                    ("7.4" . "22.1") ("8.0" . "22.1")))
 @end smallexample
 
-@end table
+The value of @var{package} needs to be unique and it needs to match
+the @var{package} value appearing in the @code{:package-version}
+keyword.  Since the user might see the value in a error message, a good
+choice is the official name of the package, such as MH-E or Gnus.
+@end defvar
 
 @node Group Definitions
 @section Defining Custom Groups
--- a/lispref/hooks.texi	Wed Apr 12 17:40:36 2006 +0000
+++ b/lispref/hooks.texi	Wed Apr 19 16:23:46 2006 +0000
@@ -31,11 +31,6 @@
 or their values are used). The variables whose names end in
 @samp{-function} have single functions as their values.
 
-(In older Emacs versions, some normal hooks had names ending in
-@samp{-hooks} or @samp{-functions}, and some abnormal hooks had names
-ending in @samp{-hook}.  We have renamed all of these to conform to
-the above conventions.)
-
 @c We need to xref to where each hook is documented or else document
 @c it here.
 
--- a/lispref/modes.texi	Wed Apr 12 17:40:36 2006 +0000
+++ b/lispref/modes.texi	Wed Apr 19 16:23:46 2006 +0000
@@ -2174,10 +2174,9 @@
 (@var{menu-title} @var{regexp} @var{index} @var{function} @var{arguments}@dots{})
 @end example
 
-Like in the previous case, each match for this element creates an
-index item.  However, if this index item is selected by the user, it
-calls @var{function} with arguments consisting of the item name, the
-buffer position, and @var{arguments}.
+Each match for this element creates an index item, and when the index
+item is selected by the user, it calls @var{function} with arguments
+consisting of the item name, the buffer position, and @var{arguments}.
 
 For Emacs Lisp mode, @code{imenu-generic-expression} could look like
 this:
--- a/lispref/processes.texi	Wed Apr 12 17:40:36 2006 +0000
+++ b/lispref/processes.texi	Wed Apr 19 16:23:46 2006 +0000
@@ -1508,7 +1508,7 @@
 machine.
 @end defun
 
-@defun tq-enqueue queue question regexp closure fn
+@defun tq-enqueue queue question regexp closure fn &optional delay-question
 This function sends a transaction to queue @var{queue}.  Specifying the
 queue has the effect of specifying the subprocess to talk to.
 
@@ -1521,6 +1521,10 @@
 text at the end of the entire answer, but nothing before; that's how
 @code{tq-enqueue} determines where the answer ends.
 
+If the argument @var{delay-question} is non-nil, delay sending this
+question until the process has finished replying to any previous
+questions.  This produces more reliable results with some processes."
+
 The return value of @code{tq-enqueue} itself is not meaningful.
 @end defun
 
--- a/lispref/searching.texi	Wed Apr 12 17:40:36 2006 +0000
+++ b/lispref/searching.texi	Wed Apr 19 16:23:46 2006 +0000
@@ -86,6 +86,10 @@
 return the new position of point in that case, but some existing
 programs may depend on a value of @code{nil}.)
 
+The argument @var{noerror} only affects valid searches which fail to
+find a match.  Invalid arguments cause errors regardless of
+@var{noerror}.
+
 If @var{repeat} is supplied (it must be a positive number), then the
 search is repeated that many times (each time starting at the end of the
 previous time's match).  If these successive searches succeed, the
--- a/lispref/tips.texi	Wed Apr 12 17:40:36 2006 +0000
+++ b/lispref/tips.texi	Wed Apr 19 16:23:46 2006 +0000
@@ -56,9 +56,13 @@
 benefits of a Common Lisp-style package system are considered not to
 outweigh the costs.}  Then take care to begin the names of all global
 variables, constants, and functions in your program with the chosen
-prefix.  This helps avoid name conflicts.  (Occasionally, for a command
-name intended for users to use, it is cleaner if some words come
-before the package name prefix.)
+prefix.  This helps avoid name conflicts.
+
+Occasionally, for a command name intended for users to use, it is more
+convenient if some words come before the package's name prefix.  And
+constructs that define functions, variables, etc., work better if they
+start with @samp{defun} or @samp{defvar}, so put the name prefix later
+on in the name.
 
 This recommendation applies even to names for traditional Lisp
 primitives that are not primitives in Emacs Lisp---such as
--- a/lispref/variables.texi	Wed Apr 12 17:40:36 2006 +0000
+++ b/lispref/variables.texi	Wed Apr 19 16:23:46 2006 +0000
@@ -276,7 +276,7 @@
 @code{max-lisp-eval-depth} provides another limit on depth of nesting.
 @xref{Definition of max-lisp-eval-depth,, Eval}.
 
-The default value is 600.  Entry to the Lisp debugger increases the
+The default value is 1000.  Entry to the Lisp debugger increases the
 value, if there is little room left, to make sure the debugger itself
 has room to execute.
 @end defvar
--- a/mac/ChangeLog	Wed Apr 12 17:40:36 2006 +0000
+++ b/mac/ChangeLog	Wed Apr 19 16:23:46 2006 +0000
@@ -1,3 +1,7 @@
+2006-04-12  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+	* inc/config.h (pid_t): Define to int.
+
 2006-02-10  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
 
 	* makefile.MPW (shortlisp, SOME_MACHINE_LISP): Sync with
--- a/mac/inc/config.h	Wed Apr 12 17:40:36 2006 +0000
+++ b/mac/inc/config.h	Wed Apr 19 16:23:46 2006 +0000
@@ -906,7 +906,7 @@
 /* #undef mbstate_t */
 
 /* Define to `int' if <sys/types.h> does not define. */
-/* #undef pid_t */
+#define pid_t int
 
 /* Define to any substitute for sys_siglist. */
 /* #undef sys_siglist */
--- a/man/ChangeLog	Wed Apr 12 17:40:36 2006 +0000
+++ b/man/ChangeLog	Wed Apr 19 16:23:46 2006 +0000
@@ -1,3 +1,54 @@
+2006-04-18  J.D. Smith  <jdsmith@as.arizona.edu>
+
+	* misc.texi (Shell Ring): Added notes on saved input when
+	navigating off the end of the history list.  
+
+2006-04-18  Chong Yidong  <cyd@mit.edu>
+
+	* misc.texi (Shell Options): Correct default value of
+	comint-scroll-show-maximum-output.
+
+2006-04-18  Carsten Dominik  <dominik@science.uva.nl>
+
+	* org.texi: (Formula syntax): Fixed link to Calc Manual.
+
+2006-04-17  Reiner Steib  <Reiner.Steib@gmx.de>
+
+	* gnus.texi (Emacsen): Don't support Emacs 20.7 and XEmacs 21.1.
+
+2006-04-17  Bill Wohler  <wohler@newt.com>
+
+	* mh-e.texi (Folders): Updated mh-before-quit-hook and
+	mh-quit-hook example with code that removes the buffers rather
+	than just bury them.
+
+2006-04-18  Nick Roberts  <nickrob@snap.net.nz>
+
+	* building.texi (Watch Expressions): Update.
+
+2006-04-17  Michael Albinus  <michael.albinus@gmx.de>
+
+	Sync with Tramp 2.0.53.
+
+2006-04-13  Carsten Dominik  <dominik@science.uva.nl>
+
+	* org.texi: (Updating settings): New section.
+	(Visibility cycling): Better names for the startup folding
+	options.
+	(Exporting): Completely restructured.
+	(The very busy C-c C-c key): New section.
+	(Summary of in-buffer settings): New section.
+
+2006-04-12  Richard Stallman  <rms@gnu.org>
+
+	* search.texi: Clean up previous change.
+
+2006-04-12  Eli Zaretskii  <eliz@gnu.org>
+
+	* search.texi (Regexp Backslash, Regexp Replace): Add index
+	entries for ``back reference'' and mention the term itself in the
+	text.
+
 2006-04-11  Richard Stallman  <rms@gnu.org>
 
 	* custom.texi (Safe File Variables):
--- a/man/building.texi	Wed Apr 12 17:40:36 2006 +0000
+++ b/man/building.texi	Wed Apr 19 16:23:46 2006 +0000
@@ -929,20 +929,26 @@
 @cindex Watching expressions in GDB
 
 @findex gud-watch
+@kindex C-x C-a C-w @r{(GUD)}
   If you want to see how a variable changes each time your program
 stops, move point into the variable name and click on the watch icon
-in the tool bar (@code{gud-watch}).
+in the tool bar (@code{gud-watch}) or type @kbd{C-x C-a C-w}.  If you
+specify a prefix argument, you can enter the variable name in the
+minibuffer.
 
   Each watch expression is displayed in the speedbar.  Complex data
 types, such as arrays, structures and unions are represented in a tree
 format.  Leaves and simple data types show the name of the expression
 and its value and, when the speedbar frame is selected, display the
 type as a tooltip.  Higher levels show the name, type and address
-value for pointers and just the name and type otherwise.
+value for pointers and just the name and type otherwise.  Root expressions
+also display the frame address as a tooltip to help identify the frame
+in which they were defined.
 
   To expand or contract a complex data type, click @kbd{Mouse-2}
 on the tag to the left of the expression.
 
+@kindex D @r{(GDB speedbar)}
 @findex gdb-var-delete
   To delete a complex watch expression, move point to the root
 expression in the speedbar and type @kbd{D} (@code{gdb-var-delete}).
@@ -965,9 +971,8 @@
 @vindex gdb-use-colon-colon-notation
   If the variable @code{gdb-use-colon-colon-notation} is
 non-@code{nil}, Emacs uses the @samp{@var{function}::@var{variable}}
-format to display variables in the speedbar.  Since this does not work
-for variables defined in compound statements, the default value is
-@code{nil}.
+format.  This allows the user to display watch expressions which share
+the same variable name.  The default value is @code{nil}.
 
 @vindex gdb-speedbar-auto-raise
 To automatically raise the speedbar every time the display of watch
--- a/man/gnus.texi	Wed Apr 12 17:40:36 2006 +0000
+++ b/man/gnus.texi	Wed Apr 19 16:23:46 2006 +0000
@@ -24870,16 +24870,17 @@
 @itemize @bullet
 
 @item
-Emacs 20.7 and up.
-
-@item
-XEmacs 21.1 and up.
+Emacs 21.1 and up.
+
+@item
+XEmacs 21.4 and up.
 
 @end itemize
 
 This Gnus version will absolutely not work on any Emacsen older than
 that.  Not reliably, at least.  Older versions of Gnus may work on older
-Emacs versions.
+Emacs versions.  Particularly, Gnus 5.10.8 should also work on Emacs
+20.7 and XEmacs 21.1.
 
 There are some vague differences between Gnus on the various
 platforms---XEmacs features more graphics (a logo and a toolbar)---but
--- a/man/mh-e.texi	Wed Apr 12 17:40:36 2006 +0000
+++ b/man/mh-e.texi	Wed Apr 19 16:23:46 2006 +0000
@@ -11,8 +11,8 @@
 @set VERSION 7.93
 @c Edition of the manual. It is either empty for the first edition or
 @c has the form ", nth Edition" (without the quotes).
-@set EDITION , 6th Edition
-@set UPDATED 2006-04-02
+@set EDITION , 7th Edition
+@set UPDATED 2006-04-17
 @set UPDATE-MONTH April, 2006
 
 @c Other variables.
@@ -3724,33 +3724,36 @@
 @findex mh-execute-commands
 @kindex q
 @vindex mh-before-quit-hook
+@vindex mh-before-quit-hook, example
 @vindex mh-quit-hook
+@vindex mh-quit-hook, example
 
 The two hooks @code{mh-before-quit-hook} and @code{mh-quit-hook} are
 called by @kbd{q}. The former one is called before the quit occurs, so
 you might use it to perform any MH-E operations; you could perform
 some query and abort the quit or call @code{mh-execute-commands}, for
 example. The latter is not run in an MH-E context, so you might use it
-to modify the window setup. For example, if the window configuration
-was saved as in the example in @ref{Miscellaneous Commands and
-Options}, you would also want to set @code{mh-quit-hook} to the
-following:
-
-@c XXX Replace this with my example for killing the mail buffers.
-
-@vindex mh-quit-hook, example
+to modify the window setup. If you find that @kbd{q} buries a lot of
+buffers that you would rather remove, you can use both
+@code{mh-before-quit-hook} and @code{mh-quit-hook} to accomplish that.
 
 @smalllisp
 @group
+(defvar my-mh-folder-buffer-to-delete nil
+  "Folder buffer that is being quit.")
+
+(defun my-mh-before-quit-hook ()
+  "Save folder buffer that is to be deleted."
+  (setq my-mh-folder-buffer-to-delete (current-buffer)))
+
 (defun my-mh-quit-hook ()
-  "Clear window configuration variables as the MH window is gone."
-  (setq my-mh-screen-saved nil)
-  (setq my-mh-screen nil)
-  (if my-normal-screen
-      (set-window-configuration my-normal-screen))
-  (setq my-normal-screen nil))
-
-@i{Clean up window setup in mh-quit-hook}
+  "Kill folder buffer rather than just bury it."
+  (set-buffer my-mh-folder-buffer-to-delete)
+  (if (get-buffer mh-show-buffer)
+      (kill-buffer mh-show-buffer))
+  (kill-buffer (current-buffer)))
+
+@i{Kill MH-Folder buffer instead of burying it}
 @end group
 @end smalllisp
 
--- a/man/misc.texi	Wed Apr 12 17:40:36 2006 +0000
+++ b/man/misc.texi	Wed Apr 19 16:23:46 2006 +0000
@@ -967,14 +967,14 @@
 @vindex comint-scroll-to-bottom-on-input
   If the variable @code{comint-scroll-to-bottom-on-input} is
 non-@code{nil}, insertion and yank commands scroll the selected window
-to the bottom before inserting.
+to the bottom before inserting.  The default is @code{nil}.
 
 @vindex comint-scroll-show-maximum-output
   If @code{comint-scroll-show-maximum-output} is non-@code{nil}, then
 arrival of output when point is at the end tries to place the last line of
 text at the bottom line of the window, so as to show as much useful
-text as possible.  (This mimics the scrolling behavior of many
-terminals.)  The default is @code{nil}.
+text as possible.  (This mimics the scrolling behavior of most
+terminals.)  The default is @code{t}.
 
 @vindex comint-move-point-for-output
   By setting @code{comint-move-point-for-output}, you can opt for
--- a/man/org.texi	Wed Apr 12 17:40:36 2006 +0000
+++ b/man/org.texi	Wed Apr 19 16:23:46 2006 +0000
@@ -4,7 +4,7 @@
 @setfilename ../info/org
 @settitle Org Mode Manual
 
-@set VERSION 4.21
+@set VERSION 4.24
 @set DATE April 2006
 
 @dircategory Emacs
@@ -22,8 +22,7 @@
 
 @c Macro definitions
 
-@c FIXME: does not look good in html
-@c Subheadings inside a table.  Need a difference between info and the rest.
+@c Subheadings inside a table.
 @macro tsubheading{text}
 @ifinfo
 @subsubheading \text\
@@ -183,21 +182,24 @@
 
 Exporting
 
-* ASCII export::                Export as a structured ASCII file
-* HTML export::                 Export as an HTML file
-* iCalendar export::            Create calendar entries.
-
-HTML export
-
-* HTML formatting::             Interpretation of the buffer content
-* Export options::              How to influence exports
-* Comment lines::               Lines which will not be exported
+* ASCII export::                Exporting to plain ASCII
+* HTML export::                 Exporting to HTML
+* XML export::                  Exporting to XML
+* iCalendar export::            Exporting in iCalendar format
+* Text interpretation::         How the exporter looks at the file
+
+Text interpretation by the exporter
+
+* Comment lines::               Some lines will not be exported
+* Enhancing text::              Subscripts, symbols and more
+* Export options::              How to influence the export settings
 
 Miscellaneous
 
 * Completion::                  M-TAB knows what you need
 * Customization::               Adapting Org-mode to your taste
-* Updating settings::           How to tell Org-mode that settings have changed
+* Summary of in-buffer settings::  Using special lines to set options
+* The very busy C-c C-c key::   When in doubt, press C-c C-c
 * Clean view::                  Getting rid of leading stars in the outline
 * TTY keys::                    Using Org-mode on a tty
 * FAQ::                         Frequently asked questions
@@ -451,9 +453,9 @@
 buffer:
 
 @example
-#+STARTUP: fold
-#+STARTUP: nofold
+#+STARTUP: overview
 #+STARTUP: content
+#+STARTUP: showall
 @end example
 
 @node Motion, Structure editing, Visibility cycling, Document Structure
@@ -786,8 +788,8 @@
 Convert the active region to table. If every line contains at least one
 TAB character, the function assumes that the material is tab separated.
 If not, lines are split at whitespace into fields.  You can use a prefix
-argument to indicate the minimum number of consequtive spaces required
-to indentify a field separator (default: just one).@* 
+argument to indicate the minimum number of consecutive spaces required
+to identify a field separator (default: just one).@* 
 If there is no active region, this command creates an empty Org-mode
 table.  However, it's easier to just start typing, like
 @kbd{|Name|Phone|Age @key{RET} |- @key{TAB}}.
@@ -982,7 +984,7 @@
 
 The width of columns is automatically determined by the table editor.
 Sometimes a single field or a few fields need to carry more text,
-leading to unconveniently wide columns.  To limit@footnote{This feature
+leading to inconveniently wide columns.  To limit@footnote{This feature
 does not work on XEmacs.} the width of a column, one field anywhere in
 the column must carry the string @samp{<N>} where @samp{N} is an integer
 specifying the width of the column in characters.  The next re-align
@@ -1054,7 +1056,7 @@
 @file{calc} package.  Note that @file{calc} has the slightly
 non-standard convention that @samp{/} has lower precedence than
 @samp{*}, so that @samp{a/b*c} is interpreted as @samp{a/(b*c)}.  Before
-evaluation by @code{calc-eval} (@pxref{Calling Calc from Your Lisp
+evaluation by @code{calc-eval} (@pxref{Calling Calc from Your
 Programs,calc-eval,Calling calc from Your Lisp Programs,calc,GNU Emacs
 Calc Manual}), variable substitution takes place:
 
@@ -2888,21 +2890,34 @@
 @chapter Exporting
 @cindex exporting
 
-For printing and sharing of notes, Org-mode documents can be exported
-as ASCII or HTML files.  To incorporate entries with associated times
-like deadlines or appointments into a desktop calendar program like
-iCal, Org-mode can also produce extracts in the iCalendar format.
+Org-mode documents can be exported into a variety of other formats.  For
+printing and sharing of notes, ASCII export produces a readable and
+simple version of an Org-mode file.  HTML export allows to publish a
+notes file on the web, while the XML format provides a solid base for
+exchange with a broad range of other applications.  To incorporate
+entries with associated times like deadlines or appointments into a
+desktop calendar program like iCal, Org-mode can also produce extracts
+in the iCalendar format.  Currently Org-mode only supports export, not
+import of these different formats.
+
+When exporting, Org-mode uses special conventions to enrich the output
+produced.  @xref{Text interpretation}, for more details.
 
 @menu
-* ASCII export::                Export as a structured ASCII file
-* HTML export::                 Export as an HTML file
-* iCalendar export::            Create calendar entries.
+* ASCII export::                Exporting to plain ASCII
+* HTML export::                 Exporting to HTML
+* XML export::                  Exporting to XML
+* iCalendar export::            Exporting in iCalendar format
+* Text interpretation::         How the exporter looks at the file
 @end menu
 
 @node ASCII export, HTML export, Exporting, Exporting
 @section ASCII export
 @cindex ASCII export
 
+ASCII export produces an simple and very readable version of an Org-mode
+file.
+
 @cindex region, active
 @cindex active region
 @cindex transient-mark-mode
@@ -2926,11 +2941,9 @@
 @end example
 
 @noindent
-creates only top level headlines and does the rest as items.  Lines
-starting with @samp{#} and subtrees starting with the word @samp{COMMENT}
-will not be exported.
-
-@node HTML export, iCalendar export, ASCII export, Exporting
+creates only top level headlines and does the rest as items.
+
+@node HTML export, XML export, ASCII export, Exporting
 @section HTML export
 @cindex HTML export
 
@@ -2948,12 +2961,6 @@
 @kindex C-c C-x b
 @item C-c C-x b
 Export as HTML file and open it with a browser.
-@kindex C-c C-x t
-@item C-c C-x t
-Insert template with export options, see below.
-@kindex C-c :
-@item C-c :
-Toggle fixed-width for entry (QUOTE) or region, see below.
 @end table
 
 @cindex headline levels, for exporting
@@ -2969,118 +2976,10 @@
 @noindent
 creates two levels of headings and does the rest as items.
 
-@menu
-* HTML formatting::             Interpretation of the buffer content
-* Export options::              How to influence exports
-* Comment lines::               Lines which will not be exported
-@end menu
-
-@node HTML formatting, Export options, HTML export, HTML export
-@subsection HTML formatting
-
-Not all text is transferred literally to the exported HTML file.  The
-exporter implements the following interpretation:
-
-@itemize @bullet
-
-@cindex hand-formatted lists
-@cindex lists, hand-formatted
-@item
-Hand-formatted lists with @samp{-}, @samp{*} or @samp{+} as
-bullet, or with @samp{1.} or @samp{2)} as enumerator will be recognized and
-transformed into HTML lists.  See @xref{Plain Lists}.
-
-@cindex underlined text
-@cindex bold text
-@cindex italic text
-@item
-You can make words @b{*bold*}, @i{/italic/}, and _underlined_
-
-@cindex @TeX{} interpretation
-@item
-Simple @TeX{}-like math constructs are interpreted:
-
-@cindex completion, of @TeX{} symbols
-@itemize @minus
-@item
-@samp{10^22} and @samp{J_n} are super- and subscripts.  You can quote
-@samp{^} and @samp{_} with a backslash: @samp{\_} and @samp{\^}
-@item
-@samp{\alpha} indicates a Greek letter, @samp{\to} an arrow.  You can
-use completion for these macros, just type @samp{\} and maybe a few
-letters, and press @kbd{M-@key{TAB}} to see possible completions.
-@end itemize
-
-@cindex tables, export to HTML
-@item
-Tables are transformed into HTML tables.  Data fields before the first
-horizontal separator line will be formatted as table header fields.
-
-@cindex fixed width
-@item
-If a headline starts with the word @samp{QUOTE}, the text below the
-headline will be typeset as fixed-width, to allow quoting of computer
-codes etc.  Lines starting with @samp{:} are also typeset in
-fixed-width font.
-
-@cindex HTML tags
-@item
 If you want to include HTML tags which should be interpreted as such,
 mark them with a @samp{@@} like in @samp{@@<b>bold text@@</b>}.
 Plain @samp{<} and @samp{>} are always transformed to @samp{&lt;} and
 @samp{&gt;} in HTML export.
-@end itemize
-
-If these conversions conflict with your habits of typing ASCII text,
-they can all be turned off with corresponding variables.
-
-@node Export options, Comment lines, HTML formatting, HTML export
-@subsection Export options
-@cindex options, for export
-
-@cindex completion, of option keywords
-The exporter recognizes special lines in the buffer which provide
-additional information.  These lines may be put anywhere in the file.
-The whole set of lines can be inserted into the buffer with @kbd{C-c
-C-x t}.  For individual lines, a good way to make sure the keyword is
-correct is to type @samp{#+} and then use @kbd{M-@key{TAB}} completion
-(@pxref{Completion}).
-
-@example
-#+TITLE:     the title to be shown (default is the buffer name)
-#+AUTHOR:    the author (default taken from @code{user-full-name})
-#+EMAIL:     his/her email address (default from @code{user-mail-address})
-#+LANGUAGE:  language for HTML, e.g. @samp{en} (@code{org-export-default-language})
-#+TEXT:      Some descriptive text to be inserted at the beginning.
-#+TEXT:      Several lines may be given.
-#+OPTIONS:   H:2  num:t  toc:t  \n:nil  @:t  ::t  |:t  ^:t  *:nil  TeX:t
-@end example
-
-@noindent
-The OPTIONS line is a compact form to specify export settings.  Here
-you can:
-@cindex headline levels
-@cindex section-numbers
-@cindex table of contents
-@cindex linebreak preservation
-@cindex quoted html tags
-@cindex fixed-width sections
-@cindex tables
-@cindex @TeX{}-like syntax for sub- and superscripts
-@cindex emphasized text
-@cindex @TeX{} macros
-@example
-H:      @r{set the number of headline levels for export}
-num:    @r{turn on/off section-numbers}
-toc:    @r{turn on/off table of contents}
-\n:     @r{turn on/off linebreak-preservation}
-@@:      @r{turn on/off quoted html tags}
-::      @r{turn on/off fixed-width sections}
-|:      @r{turn on/off tables}
-^:      @r{turn on/off @TeX{}-like syntax for sub- and superscripts.}
-*:      @r{turn on/off emphasized text (bold, italic, underlined)}
-TeX:    @r{turn on/off @TeX{} macros}
-@end example
 
 You can also give style information for the exported file.  The
 default specification can be configured through the option
@@ -3100,28 +2999,25 @@
 @end example
 
 Remember to execute @kbd{M-x normal-mode} after changing this to make
-the new style visible to Emacs.  This command reastarts org-mode for the
-current buffer and forces Emacs to re-evaluate the loval variables
+the new style visible to Emacs.  This command restarts org-mode for the
+current buffer and forces Emacs to re-evaluate the local variables
 section in the buffer.
 
-@node Comment lines,  , Export options, HTML export
-@subsection Comment lines
-@cindex comment lines
-@cindex exporting, not
-
-Lines starting with @samp{#} in column zero are treated as comments
-and will never be exported.  Also entire subtrees starting with the
-word @samp{COMMENT} will never be exported.  Finally, any text before
-the first headline will not be exported either.  This applies also for
-ASCII export.
+@node XML export, iCalendar export, HTML export, Exporting
+@section XML export
+@cindex XML export
+
+Org-mode contains an XML exporter that produces XOXO-style XML.
+Currently, this exporter only handles the general outline structure and
+does not interpret any additional Org-mode features.
 
 @table @kbd
-@kindex C-c ;
-@item C-c ;
-Toggle the COMMENT keyword at the beginning of an entry.
+@kindex C-c C-x C-x
+@item C-c C-x C-x
+Export as XML file @file{myfile.xml}.
 @end table
 
-@node iCalendar export,  , HTML export, Exporting
+@node iCalendar export, Text interpretation, XML export, Exporting
 @section iCalendar export
 @cindex iCalendar export
 
@@ -3170,13 +3066,164 @@
    "osascript -e 'tell application \"iCal\" to reload calendars'")))
 @end lisp
 
+@node Text interpretation,  , iCalendar export, Exporting
+@section Text interpretation by the exporter
+
+The exporter backends interpret additional structure in the Org-mode file
+in order to produce better output.
+
+@menu
+* Comment lines::               Some lines will not be exported
+* Enhancing text::              Subscripts, symbols and more
+* Export options::              How to influence the export settings
+@end menu
+
+@node Comment lines, Enhancing text, Text interpretation, Text interpretation
+@subsection Comment lines
+@cindex comment lines
+@cindex exporting, not
+
+Lines starting with @samp{#} in column zero are treated as comments
+and will never be exported.  Also entire subtrees starting with the
+word @samp{COMMENT} will never be exported.  Finally, any text before
+the first headline will not be exported either.
+
+@table @kbd
+@kindex C-c ;
+@item C-c ;
+Toggle the COMMENT keyword at the beginning of an entry.
+@end table
+
+
+
+@node Enhancing text, Export options, Comment lines, Text interpretation
+@subsection Enhancing text for export
+@cindex enhancing text
+@cindex richer text
+
+Some of the export backends of Org-mode allow for sophisticated text
+formatting, this is true in particular for the HTML backend.  Org-mode
+has a number of typing conventions that allow to produce a richly
+formatted output.
+
+
+@itemize @bullet
+
+@cindex hand-formatted lists
+@cindex lists, hand-formatted
+@item
+Plain lists @samp{-}, @samp{*} or @samp{+} as bullet, or with @samp{1.}
+or @samp{2)} as enumerator will be recognized and transformed if the
+backend supports lists.  See @xref{Plain Lists}.
+
+@cindex underlined text
+@cindex bold text
+@cindex italic text
+@item
+You can make words @b{*bold*}, @i{/italic/}, and _underlined_
+
+@cindex @TeX{} interpretation
+@item
+Simple @TeX{}-like math constructs are interpreted:
+
+@cindex completion, of @TeX{} symbols
+@itemize @minus
+@item
+@samp{10^22} and @samp{J_n} are super- and subscripts.  You can quote
+@samp{^} and @samp{_} with a backslash: @samp{\_} and @samp{\^}
+@item
+@samp{\alpha} indicates a Greek letter, @samp{\to} an arrow.  You can
+use completion for these macros, just type @samp{\} and maybe a few
+letters, and press @kbd{M-@key{TAB}} to see possible completions.
+@end itemize
+
+@cindex tables, export
+@item
+Tables are transformed into native tables under the exporter, if the
+export backend supports this. Data fields before the first horizontal
+separator line will be formatted as table header fields.
+
+@cindex fixed width
+@item
+If a headline starts with the word @samp{QUOTE}, the text below the
+headline will be typeset as fixed-width, to allow quoting of computer
+codes etc.  Lines starting with @samp{:} are also typeset in
+fixed-width font.
+@table @kbd
+@kindex C-c :
+@item C-c :
+Toggle fixed-width for entry (QUOTE) or region, see below.
+@end table
+@end itemize
+
+If these conversions conflict with your habits of typing ASCII text,
+they can all be turned off with corresponding variables (see the
+customization group @code{org-export-general}, and the following section
+which explains how to set export options with special lines in a
+buffer.
+
+@node Export options,  , Enhancing text, Text interpretation
+@subsection Export options
+@cindex options, for export
+
+@cindex completion, of option keywords
+The exporter recognizes special lines in the buffer which provide
+additional information.  These lines may be put anywhere in the file.
+The whole set of lines can be inserted into the buffer with @kbd{C-c
+C-x t}.  For individual lines, a good way to make sure the keyword is
+correct is to type @samp{#+} and then use @kbd{M-@key{TAB}} completion
+(@pxref{Completion}).
+
+@table @kbd
+@kindex C-c C-x t
+@item C-c C-x t
+Insert template with export options, see example below.
+@end table
+
+@example
+#+TITLE:     the title to be shown (default is the buffer name)
+#+AUTHOR:    the author (default taken from @code{user-full-name})
+#+EMAIL:     his/her email address (default from @code{user-mail-address})
+#+LANGUAGE:  language for HTML, e.g. @samp{en} (@code{org-export-default-language})
+#+TEXT:      Some descriptive text to be inserted at the beginning.
+#+TEXT:      Several lines may be given.
+#+OPTIONS:   H:2  num:t  toc:t  \n:nil  @:t  ::t  |:t  ^:t  *:nil  TeX:t
+@end example
+
+@noindent
+The OPTIONS line is a compact form to specify export settings.  Here
+you can:
+@cindex headline levels
+@cindex section-numbers
+@cindex table of contents
+@cindex linebreak preservation
+@cindex quoted html tags
+@cindex fixed-width sections
+@cindex tables
+@cindex @TeX{}-like syntax for sub- and superscripts
+@cindex emphasized text
+@cindex @TeX{} macros
+@example
+H:      @r{set the number of headline levels for export}
+num:    @r{turn on/off section-numbers}
+toc:    @r{turn on/off table of contents}
+\n:     @r{turn on/off linebreak-preservation}
+@@:      @r{turn on/off quoted html tags}
+::      @r{turn on/off fixed-width sections}
+|:      @r{turn on/off tables}
+^:      @r{turn on/off @TeX{}-like syntax for sub- and superscripts.}
+*:      @r{turn on/off emphasized text (bold, italic, underlined)}
+TeX:    @r{turn on/off @TeX{} macros}
+@end example
+
 @node Miscellaneous, Index, Exporting, Top
 @chapter Miscellaneous
 
 @menu
 * Completion::                  M-TAB knows what you need
 * Customization::               Adapting Org-mode to your taste
-* Updating settings::           How to tell Org-mode that settings have changed
+* Summary of in-buffer settings::  Using special lines to set options
+* The very busy C-c C-c key::   When in doubt, press C-c C-c
 * Clean view::                  Getting rid of leading stars in the outline
 * TTY keys::                    Using Org-mode on a tty
 * FAQ::                         Frequently asked questions
@@ -3229,7 +3276,7 @@
 @end table
 
 
-@node Customization, Updating settings, Completion, Miscellaneous
+@node Customization, Summary of in-buffer settings, Completion, Miscellaneous
 @section Customization
 @cindex customization
 @cindex options, for customization
@@ -3239,43 +3286,112 @@
 Org-mode.  For the sake of compactness of the manual, we are not
 describing the variables here.  A structured overview of customization
 variables is available with @kbd{M-x org-customize}.  Or select
-@code{Browse Org Group} from the @code{Org->Customization} menu.
-
-@node Updating settings, Clean view, Customization, Miscellaneous
-@section Updating settings after changes
-@cindex updating, after setting changes
+@code{Browse Org Group} from the @code{Org->Customization} menu.  Many
+settings can also be activated on a per-file basis, by putting special
+lines into the buffer (@pxref{Summary of in-buffer settings}).
+
+@node Summary of in-buffer settings, The very busy C-c C-c key, Customization, Miscellaneous
+@section Summary of in-buffer settings
+@cindex in-buffer settings
+@cindex special keywords
+
+Org-mode uses special lines in the buffer to define settings on a
+per-file basis.  These lines start with a @samp{#+} followed by a
+keyword, a colon, and then individual words defining a setting.  Several
+settings words con be in the same line, but you can also have multiple
+lines for the keyword.  While these settings are described throughout
+the manual, here is a summary.  After changing any of those lines in the
+buffer, press @kbd{C-c C-c} with the cursor still in the line to
+activate the changes immediately.  Otherwise they become effective only
+when the file is visited again in a new Emacs session.
+
+@table @kbd
+@item #+STARTUP:
+This line sets options to be used at startup of org-mode, when an
+Org-mode file is being visited.  The first set of options deals with the
+initial visibility of the outline tree.  The corresponding variable for
+global default settings is @code{org-startup-folded}, with a default
+value @code{t}, which means @code{overview}.
+@example
+overview   @r{top-level headlines only}
+content    @r{all headlines}
+showall    @r{no folding at all, show everything}
+@end example
+Then there are options for aligning tables upon visiting a file.  This
+is useful in files containing narrowed table columns.  The corresponding
+variable is @code{org-startup-align-all-tables}, with a default value
+@code{nil}. 
+@example
+align      @r{align all tables}
+noalign    @r{don't align table on startup}
+@end example
+Here are the options for hiding leading stars in outline headings.  The
+corresponding variables are @code{org-hide-leading-stars} and
+@code{org-odd-levels-only}, both with a default setting @code{nil}
+(meaning @code{showstars} and @code{oddeven}).
+@example
+hidestars  @r{make all but one of the stars starting a headline invisible.}
+showstars  @r{show all stars starting a headline}
+odd        @r{allow only odd outline levels (1,3,...)}
+oddeven    @r{allow all outline levels}
+@end example
+@item #+SEQ_TODO:   #+TYP_TODO:
+These lines that the TODO keywords and their interpretation in the
+current file.  The corresponding variables are @code{org-todo-keywords}
+and @code{org-todo-interpretation}.
+@item #+CATEGORY:
+This line sets the category for the agenda file.  The category applies
+for all subsequent lines until the next @samp{#+CATEGORY} line, or the
+end of the file.
+@item #+TBLFM:
+This line contains the formulas for the table directly above the line.
+@item #+TITLE:, #+AUTHOR:, #+EMAIL:, #+LANGUAGE:, #+TEXT:, #+OPTIONS:
+These line provide setting for exporting files.  For more details see
+@ref{Export options}.
+@end table
+
+@node The very busy C-c C-c key, Clean view, Summary of in-buffer settings, Miscellaneous
+@section The very busy C-c C-c key
 @kindex C-c C-c
 
-Org-mode uses special lines in the buffer to set file-local values for a
-number of user options.  When such settings are changed, you need to
-inform Org-mode that something has be modified and that it should
-recheck the buffer for setting.  This is done with the command @kbd{C-c
-C-c} in the following situations:
-
-@itemize @bullet
+The key @kbd{C-c C-c} has many purposes in org-mode, which are all
+mentioned scattered throughout this manual.  One specific function of
+this key is to add @emph{tags} to a headline (@pxref{Tags}).  In many
+other circumstances it means something like @emph{Hey Org-mode, look
+here and update according to what you see here}.  Here is a summary what
+this means in different contexts.
+
+@itemize @minus
+@c @item
+@c If the cursor is in a headline, prompt for tags and insert them
+@c into the current line, aligned to `org-tags-column'.  When called
+@c with prefix arg, realign all tags in the current buffer.
 @item
-After changing any of the special buffer lines starting with @samp{#+},
-for example @samp{#+STARTUP}, @samp{#+CATEGORY}.  Org-mode will then
-read these settings and activate them (see @ref{Visibility cycling},
-@ref{Narrow columns}, @ref{Clean view}, @ref{Per file keywords},
-@ref{Categories})
+If the cursor is in one of the special #+KEYWORD lines, this
+triggers scanning the buffer for these lines and updating the
+information. 
 @item
-After editing by hand a @samp{#+TBLFM} line containing formulas for a
-table.  When pressing @kbd{C-c C-c} in that line, all formulas are
-re-applied to the entire table (@pxref{Editing/debugging formulas}).
+If the cursor is inside a table, realign the table.  This command
+works even if the automatic table editor has been turned off.
+@item
+If the cursor is on a #+TBLFM line, re-apply the formulas to
+the entire table.
+@item
+If the cursor is inside a table created by the @file{table.el} package,
+activate that table.
 @item
-In a table, @kbd{C-c C-c} does force a re-align, even if the table
-editor is turned off (@pxref{Built-in table editor})
-@item
-In an ordered plain list, @kbd{C-c C-c} forces a renumbering of the list
-(@pxref{Plain Lists}).
+If the current buffer is a remember buffer, close note and file it.
+with a prefix argument, file it without further interaction to the default
+location.
 @item
-After adding a new radio target @samp{<<<New target>>>}, @kbd{C-c C-c}
-must be used with the cursor on that target to activate it throughout
-the buffer.
+If the cursor is on a <<<target>>>, update radio targets and corresponding
+links in this buffer.
+@item
+If the cursor is on a numbered item in a plain list, renumber the
+ordered list.
 @end itemize
 
-@node Clean view, TTY keys, Updating settings, Miscellaneous
+@node Clean view, TTY keys, The very busy C-c C-c key, Miscellaneous
 @section A cleaner outline view
 @cindex hiding leading stars
 @cindex clean outline view
@@ -3371,12 +3487,10 @@
 #+STARTUP: oddeven
 @end example
 
-You can convert an Org-mode file from single-star-per-level to
-the double-star-per-level convention with @kbd{M-x org-convert-to-odd-levels
-RET} in that file.  There is no command for the back conversion because
-such a command might merge levels and in this way destroy the
-structure of the tree.
-@c FIXME: Maybe we should have such a command...
+You can convert an Org-mode file from single-star-per-level to the
+double-star-per-level convention with @kbd{M-x org-convert-to-odd-levels
+RET} in that file.  The reverse operation is @kbd{M-x
+org-convert-to-oddeven-levels}.
 
 @node TTY keys, FAQ, Clean view, Miscellaneous
 @section Using org-mode on a tty
@@ -3448,8 +3562,8 @@
 link text.  Please give them back to me, don't tell me it is not
 possible!}@*
 @c
-Would I let you down like that?  If you must (even if I don't understand
-why), you can do this
+Would I let you down like that?  If you must, you can do this
+
 @lisp
 (setq org-link-style 'plain
       org-link-format "<%s>")
@@ -3574,12 +3688,14 @@
 &%%(org-diary) ~/path/to/another/org-file.org
 @end example
 
-If you now launch the calendar and press @kbd{d} to display a diary,
-the headlines of entries containing a timestamp, date range, schedule,
-or deadline referring to the selected date will be listed.  Just like
-in Org-mode's agenda view, the diary for @emph{today} contains
-additional entries for overdue deadlines and scheduled items.  See
-also the documentation of the @command{org-diary} function.
+If you now launch the calendar and press @kbd{d} to display a diary, the
+headlines of entries containing a timestamp, date range, schedule, or
+deadline referring to the selected date will be listed.  Just like in
+Org-mode's agenda view, the diary for @emph{today} contains additional
+entries for overdue deadlines and scheduled items.  See also the
+documentation of the @command{org-diary} function.  Under XEmacs, it is
+not possible to jump back from the diary to the org, this works only in
+the agenda buffer.
 
 @end enumerate
 
@@ -3594,9 +3710,9 @@
 @item @file{org-mouse.el} by Piotr Zielinski
 This package implements extended mouse functionality for Org-mode.  It
 allows you to cycle visibility and to edit the document structure with
-the mouse.  It also provides a context-sensitive menu that changes
-depending on the context of a mouse-click.  Use a search engine to find
-this package on the web.
+the mouse.  Best of all, it provides a context-sensitive menu on
+@key{mouse-3} that changes depending on the context of a mouse-click.
+Use a search engine to find this package on the web.
 @cindex @file{table.el}
 @item @file{table.el} by Takaaki Ota
 Org mode cooperates with table.el, see @ref{table.el}.  @file{table.el}
@@ -3687,12 +3803,6 @@
 If a formula uses @emph{calculated} fields further down the row,
 multiple recalculation may be needed to get all fields consistent.
 @item
-Under XEmacs, if Org-mode entries are included into the diary, it is
-not possible to jump back from the diary to the org file.  Apparently,
-the text properties are lost when the fancy-diary-display is used.
-However, from Org-mode's timeline and agenda buffers (created with
-@kbd{C-c C-r} and @kbd{C-c a}), things do work correctly.
-@item
 You can only make a single word boldface or italic.  To emphasize
 several words in a row, each must have the emphasize markers, like in
 @samp{*three* *bold* *words*}.
@@ -3725,6 +3835,8 @@
 @item
 Sacha Chua suggested to copy some linking code from Planner.
 @item
+Kees Dullemond inspired the use of narrowed tabled columns.
+@item
 Christian Egli converted the documentation into TeXInfo format, patched
 CSS formatting into the HTML exporter, and inspired the agenda.
 @item
--- a/man/search.texi	Wed Apr 12 17:40:36 2006 +0000
+++ b/man/search.texi	Wed Apr 19 16:23:46 2006 +0000
@@ -750,8 +750,10 @@
 the numbering of the groups that are meant to be referred to.
 
 @item \@var{d}
+@cindex back reference, in regexp
 matches the same text that matched the @var{d}th occurrence of a
-@samp{\( @dots{} \)} construct.
+@samp{\( @dots{} \)} construct.  This is called a @dfn{back
+reference}.
 
 After the end of a @samp{\( @dots{} \)} construct, the matcher remembers
 the beginning and end of the text matched by that construct.  Then,
@@ -1002,15 +1004,17 @@
 Replace every match for @var{regexp} with @var{newstring}.
 @end table
 
+@cindex back reference, in regexp replacement
   In @code{replace-regexp}, the @var{newstring} need not be constant:
 it can refer to all or part of what is matched by the @var{regexp}.
 @samp{\&} in @var{newstring} stands for the entire match being
 replaced.  @samp{\@var{d}} in @var{newstring}, where @var{d} is a
 digit, stands for whatever matched the @var{d}th parenthesized
-grouping in @var{regexp}.  @samp{\#} refers to the count of
-replacements already made in this command, as a decimal number.  In
-the first replacement, @samp{\#} stands for @samp{0}; in the second,
-for @samp{1}; and so on.  For example,
+grouping in @var{regexp}.  (This is called a ``back reference''.)
+@samp{\#} refers to the count of replacements already made in this
+command, as a decimal number.  In the first replacement, @samp{\#}
+stands for @samp{0}; in the second, for @samp{1}; and so on.  For
+example,
 
 @example
 M-x replace-regexp @key{RET} c[ad]+r @key{RET} \&-safe @key{RET}
--- a/man/trampver.texi	Wed Apr 12 17:40:36 2006 +0000
+++ b/man/trampver.texi	Wed Apr 19 16:23:46 2006 +0000
@@ -4,7 +4,7 @@
 @c In the Tramp CVS, the version number is auto-frobbed from
 @c configure.ac, so you should edit that file and run
 @c "autoconf && ./configure" to change the version number.
-@set trampver 2.0.52
+@set trampver 2.0.53
 
 @c Other flags from configuration
 @set prefix /usr/local
--- a/src/ChangeLog	Wed Apr 12 17:40:36 2006 +0000
+++ b/src/ChangeLog	Wed Apr 19 16:23:46 2006 +0000
@@ -1,3 +1,194 @@
+2006-04-18  Richard Stallman  <rms@gnu.org>
+
+	* xmenu.c (restore_menu_items, save_menu_items): New fns.
+	(set_frame_menubar): Use save_menu_items.  Save updated vector in
+	the frame before unwinding it.  Don't use unuse_menu_items.  Don't
+	use discard_menu_items.
+	(digest_single_submenu): Abort if an item is not in a pane.
+	(init_menu_items): Put the error check at the top.
+
+	* keymap.c (describe_map): Make "shadowed" warning more verbose.
+
+	* window.c (adjust_window_trailing_edge): Correctly distinguish
+	series vs parallel cases, even when window has no parent.
+
+	* abbrev.c (record_symbol): New function.
+	(Finsert_abbrev_table_description): Sort the abbrevs alphabetically.
+
+2006-04-18  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+	* image.c (x_create_bitmap_from_data) [MAC_OS]: Don't check return
+	value of xmalloc.
+
+	* mac.c (mac_coerce_file_name_ptr, mac_coerce_file_name_desc)
+	(create_apple_event_from_event_ref, xrm_get_preference_database)
+	(cfstring_create_normalized): Don't check return value of xmalloc.
+
+	* macselect.c (get_scrap_target_type_list, defer_apple_events)
+	(copy_scrap_flavor_data, mac_handle_service_event): Don't check
+	return value of xmalloc/xrealloc.
+
+	* macterm.c (XCreateGC, x_per_char_metric, xlfdpat_create)
+	(init_font_name_table, init_font_name_table, mac_do_list_fonts)
+	(XLoadQueryFont, mac_store_apple_event): Don't check
+	return value of xmalloc.
+
+2006-04-17  Kim F. Storm  <storm@cua.dk>
+
+	* window.c (coordinates_in_window): On the vertical border,
+	calculate the row number measured from the top of the window, not
+	the top of the frame.
+	(window_loop): Test w->dedicated with !NILP instead of EQ Qt.
+	(window_scroll_pixel_based): Fix off-by-one bug in 2002-12-23 change.
+
+2006-04-16  Eli Zaretskii  <eliz@gnu.org>
+
+	* s/ms-w32.h (SYSTEM_PURESIZE_EXTRA): Reduce to 24000.
+
+2006-04-16  Romain Francoise  <romain@orebokech.com>
+
+	* puresize.h (BASE_PURESIZE): Decrement back to 1200000.
+
+2006-04-16  Andreas Schwab  <schwab@suse.de>
+
+	* puresize.h (PURESIZE_RATIO): Reduce to 10/6.
+
+2006-04-15  Romain Francoise  <romain@orebokech.com>
+
+	* puresize.h (BASE_PURESIZE): Increment to 1210000.
+
+2006-04-13  Micha,Ak(Bl Cadilhac  <michael.cadilhac@lrde.org>  (tiny change)
+
+	* print.c (Fprin1_to_string): Mention in the `doc' that the
+	behavior is modified by `print-level' and `print-length'.
+
+2006-04-13  Kenichi Handa  <handa@m17n.org>
+
+	* coding.c (setup_coding_system): If eol-type is not yet decided
+	and system_eol_type is not LF, set CODING_REQUIRE_ENCODING_MASK.
+	If coding_system is nil, return 0.
+	(code_convert_region1): Even if coding_system is nil, don't skip
+	conversion if system_eol_type is not LF.
+	(code_convert_string1): Likewise.
+	(code_convert_string_norecord): Likewise.
+
+2006-04-13  Kenichi Handa  <handa@m17n.org>
+
+	* coding.c (setup_coding_system): Fix previous change.
+	(encode_coding): If eol_type is not yet decided, use
+	system_eol_type.
+	(shrink_encoding_region): If eol_type is not yet decided and
+	system_eol_type is not LF, don't shrink.
+
+2006-04-13  Nick Roberts  <nickrob@snap.net.nz>
+
+	* xdisp.c (note_mouse_highlight): Add help echo for dragging vertical
+	line.
+
+2006-04-12  Richard Stallman  <rms@gnu.org>
+
+	* keyboard.c (read_key_sequence): Explicitly avoid keybuf[-1].
+
+	* process.c (conv_lisp_to_sockaddr): If FAMILY unknown, just return.
+	(Fprocess_send_eof): Abort if fail to open null device.
+
+2006-04-12  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+	* fns.c [HAVE_MENUS && MAC_OS]: Include macterm.h.
+
+	* image.c [MAC_OS] (xpm_load_image): Add parentheses around
+	assignment used as truth value.  Add explicit braces to avoid
+	ambiguous `else'.
+	[MAC_OS] (gif_load): Remove unused variable `gcpro1'.
+
+	* lisp.h (syms_of_fontset, Fset_fontset_font): Put extern and
+	EXFUN in #ifdef HAVE_WINDOW_SYSTEM.
+	(syms_of_xfns, syms_of_xsmfns, syms_of_xselect, syms_of_xterm):
+	Put externs in #ifdef HAVE_X_WINDOWS.
+	(syms_of_macfns, syms_of_macselect, syms_of_macterm)
+	(syms_of_macmenu, syms_of_mac) [MAC_OS]: Add externs.
+	(init_mac_osx_environment) [MAC_OSX]: Add extern.
+
+	* mac.c (init_process): Remove undef.
+	(select) [MAC_OSX]: Undefine before including sysselect.h.
+	(posix_pathname_to_fsspec, fsspec_to_posix_pathname) [MAC_OSX]:
+	Remove functions and prototypes.
+	(parse_value): Add parentheses around + inside shift.
+	(path_from_vol_dir_name): Make static.
+	(get_temp_dir_name): Remove unused variables `cpb' and `dir_name'.
+	[!MAC_OSX] (get_path_to_system_folder): Likewise.
+	(Fmac_get_file_creator, Fmac_get_file_type): Remove unused
+	variable `cCode'.
+	(Fmac_coerce_ae_data): Remove unused variables `fref' and `fs'.
+	(Fmac_get_preference): Add explicit braces to avoid ambiguous `else'.
+
+	* macfns.c (x_to_mac_color): Remove unused variable `tail'.
+	(x_set_mouse_color): Remove unused variable `dpy'.
+	(Fx_create_frame): Remove unused variable `x_frame_count'.
+	(Fx_server_version): Add explicit braces to avoid ambiguous `else'.
+	(x_sync): Move from macterm.c.
+	(Fx_file_dialog): Remove unused variable `default_filter_index'.
+
+	* macmenu.c (min_menu_id): Make element type explicit.
+
+	* macselect.c (get_flavor_type_from_symbol): Remove unused
+	variable `val'.
+	(get_scrap_private_timestamp, x_get_foreign_selection)
+	(copy_scrap_flavor_data): Add explicit braces to avoid ambiguous `else'.
+	(Fmac_process_deferred_apple_events): Remove unused variables
+	`keyword', `reply', `apple_event', `count', and `err'.
+
+	* macterm.c: Don't include gnu.h.
+	(x_io_error_quitter, x_draw_image_foreground_1): Remove prototypes.
+	(x_sync): Move to macfns.c.
+	[USE_CG_DRAWING] (mac_define_fringe_bitmap): Remove unused
+	variable `mask_bits'.
+	(mac_compute_glyph_string_overhangs): Avoid ambiguous `else'.
+	(x_draw_image_glyph_string): Remove unused variable `pixmap'.
+	(x_mac_to_emacs_modifiers): Remove function.
+	(XTset_vertical_scroll_bar, mac_handle_visibility_change)
+	(x_make_frame_visible, xlfdpat_create, mac_handle_command_event):
+	Add explicit braces to avoid ambiguous `else'.
+	(x_make_frame_visible): Remove unused variables `type',
+	`original_top', and `original_left'.
+	(mac_do_list_fonts, XTread_socket): Add parentheses around && within ||.
+	(x_load_font): Remove unused variables `full_name', and `value'.
+	(do_get_menus, do_init_managers, do_check_ram_size) [!MAC_OS8]:
+	Remove functions.
+	(do_zoom_window): Reorganize variables with respect to conditionals.
+	(init_command_handler): Remove unused variable `err'.
+	[MAC_OSX] (mac_check_bundle): Remove unused variable `child'.
+
+	* macterm.h (x_set_mouse_position, x_set_mouse_pixel_position)
+	(x_make_frame_invisible, x_iconify_frame, x_free_frame_resources)
+	(x_destroy_window, x_wm_set_size_hint, x_delete_display, XFreeGC)
+	(do_menu_choice, have_menus_p, x_real_positions)
+	(x_set_menu_bar_lines, x_pixel_width, x_pixel_height, x_char_width)
+	(x_char_height, x_sync, x_set_tool_bar_lines, x_activate_menubar)
+	(free_frame_menubar): Add externs.
+
+	* unexmacosx.c: Include config.h before using HAVE_MALLOC_MALLOC_H.
+	(malloc, realloc, free): Add undefs.
+	(read_load_commands): Remove unused variable `n' and `j'.
+	(copy_data_segment): Remove unused variable `r'.
+
+	* xdisp.c (get_glyph_string_clip_rects): Add parentheses around &&
+	within ||.  Add explicit braces to avoid ambiguous `else'.
+	(dump_glyph_row): Remove label for `inverse_p' from legend.
+
+	* xfaces.c (Finternal_merge_in_global_face, try_font_list): Add
+	explicit braces to avoid ambiguous `else'.
+
+2006-04-11  Micha,Ak(Bl Cadilhac  <michael.cadilhac@lrde.org>  (tiny change)
+
+	* dispnew.c (init_display): Don't init X display if the user asked
+	for a non-X display.
+
+2006-04-12  Kenichi Handa  <handa@m17n.org>
+
+	* coding.c (setup_coding_system): Use system_eol_type for default
+	coding->eol_type.
+
 2006-04-11  Dan Nicolaescu  <dann@ics.uci.edu>
 
 	* lisp.h (wrong_type_argument): Mark as NO_RETURN.
--- a/src/abbrev.c	Wed Apr 12 17:40:36 2006 +0000
+++ b/src/abbrev.c	Wed Apr 19 16:23:46 2006 +0000
@@ -531,6 +531,13 @@
   Fterpri (stream);
 }
 
+static void
+record_symbol (sym, list)
+     Lisp_Object sym, list;
+{
+  XSETCDR (list, Fcons (sym, XCDR (list)));
+}
+
 DEFUN ("insert-abbrev-table-description", Finsert_abbrev_table_description,
        Sinsert_abbrev_table_description, 1, 2, 0,
        doc: /* Insert before point a full description of abbrev table named NAME.
@@ -546,6 +553,7 @@
      Lisp_Object name, readable;
 {
   Lisp_Object table;
+  Lisp_Object symbols;
   Lisp_Object stream;
 
   CHECK_SYMBOL (name);
@@ -554,12 +562,22 @@
 
   XSETBUFFER (stream, current_buffer);
 
+  symbols = Fcons (Qnil, Qnil);
+  map_obarray (table, record_symbol, symbols);
+  symbols = XCDR (symbols);
+  symbols = Fsort (symbols, Qstring_lessp);
+
   if (!NILP (readable))
     {
       insert_string ("(");
       Fprin1 (name, stream);
       insert_string (")\n\n");
-      map_obarray (table, describe_abbrev, stream);
+      while (! NILP (symbols))
+	{
+	  describe_abbrev (XCAR (symbols), stream);
+	  symbols = XCDR (symbols);
+	}
+
       insert_string ("\n\n");
     }
   else
@@ -567,7 +585,11 @@
       insert_string ("(define-abbrev-table '");
       Fprin1 (name, stream);
       insert_string (" '(\n");
-      map_obarray (table, write_abbrev, stream);
+      while (! NILP (symbols))
+	{
+	  write_abbrev (XCAR (symbols), stream);
+	  symbols = XCDR (symbols);
+	}
       insert_string ("    ))\n\n");
     }
 
--- a/src/coding.c	Wed Apr 12 17:40:36 2006 +0000
+++ b/src/coding.c	Wed Apr 19 16:23:46 2006 +0000
@@ -3603,6 +3603,8 @@
     {
       coding->eol_type = CODING_EOL_UNDECIDED;
       coding->common_flags = CODING_REQUIRE_DETECTION_MASK;
+      if (system_eol_type != CODING_EOL_LF)
+	coding->common_flags |= CODING_REQUIRE_ENCODING_MASK;
     }
   else if (XFASTINT (eol_type) == 1)
     {
@@ -3918,9 +3920,12 @@
   coding->type = coding_type_no_conversion;
   coding->category_idx = CODING_CATEGORY_IDX_BINARY;
   coding->common_flags = 0;
-  coding->eol_type = CODING_EOL_LF;
+  coding->eol_type = NILP (coding_system) ? system_eol_type : CODING_EOL_LF;
+  if (coding->eol_type != CODING_EOL_LF)
+    coding->common_flags
+      |= CODING_REQUIRE_DECODING_MASK | CODING_REQUIRE_ENCODING_MASK;
   coding->pre_write_conversion = coding->post_read_conversion = Qnil;
-  return -1;
+  return NILP (coding_system) ? 0 : -1;
 }
 
 /* Free memory blocks allocated for storing composition information.  */
@@ -4994,6 +4999,8 @@
   coding->consumed = coding->consumed_char = 0;
   coding->errors = 0;
   coding->result = CODING_FINISH_NORMAL;
+  if (coding->eol_type == CODING_EOL_UNDECIDED)
+    coding->eol_type = system_eol_type;
 
   switch (coding->type)
     {
@@ -5250,6 +5257,8 @@
   if (coding->type == coding_type_ccl
       || coding->eol_type == CODING_EOL_CRLF
       || coding->eol_type == CODING_EOL_CR
+      || (coding->eol_type == CODING_EOL_UNDECIDED
+	  && system_eol_type != CODING_EOL_LF)
       || (coding->cmp_data && coding->cmp_data->used > 0))
     {
       /* We can't skip any data.  */
@@ -7105,7 +7114,7 @@
   from = XFASTINT (start);
   to = XFASTINT (end);
 
-  if (NILP (coding_system))
+  if (NILP (coding_system) && system_eol_type == CODING_EOL_LF)
     return make_number (to - from);
 
   if (setup_coding_system (Fcheck_coding_system (coding_system), &coding) < 0)
@@ -7160,7 +7169,7 @@
   CHECK_STRING (string);
   CHECK_SYMBOL (coding_system);
 
-  if (NILP (coding_system))
+  if (NILP (coding_system) && system_eol_type == CODING_EOL_LF)
     return (NILP (nocopy) ? Fcopy_sequence (string) : string);
 
   if (setup_coding_system (Fcheck_coding_system (coding_system), &coding) < 0)
@@ -7219,7 +7228,7 @@
   CHECK_STRING (string);
   CHECK_SYMBOL (coding_system);
 
-  if (NILP (coding_system))
+  if (NILP (coding_system) && system_eol_type == CODING_EOL_LF)
     return string;
 
   if (setup_coding_system (Fcheck_coding_system (coding_system), &coding) < 0)
--- a/src/dispnew.c	Wed Apr 12 17:40:36 2006 +0000
+++ b/src/dispnew.c	Wed Apr 19 16:23:46 2006 +0000
@@ -6695,7 +6695,7 @@
      try to use X, and die with an error message if that doesn't work.  */
 
 #ifdef HAVE_X_WINDOWS
-  if (! display_arg)
+  if (! inhibit_window_system && ! display_arg)
     {
       char *display;
 #ifdef VMS
--- a/src/eval.c	Wed Apr 12 17:40:36 2006 +0000
+++ b/src/eval.c	Wed Apr 19 16:23:46 2006 +0000
@@ -204,6 +204,7 @@
   specpdl_size = 50;
   specpdl = (struct specbinding *) xmalloc (specpdl_size * sizeof (struct specbinding));
   specpdl_ptr = specpdl;
+  /* Don't forget to update docs (lispref node "Local Variables").  */
   max_specpdl_size = 1000;
   max_lisp_eval_depth = 300;
 
--- a/src/fns.c	Wed Apr 12 17:40:36 2006 +0000
+++ b/src/fns.c	Wed Apr 19 16:23:46 2006 +0000
@@ -48,9 +48,12 @@
 #include "frame.h"
 #include "window.h"
 #include "blockinput.h"
-#include "termhooks.h"  /* For display->kboard reference in terminal-local-value. */
-#if defined (HAVE_MENUS) && defined (HAVE_X_WINDOWS)
+#ifdef HAVE_MENUS
+#if defined (HAVE_X_WINDOWS)
 #include "xterm.h"
+#elif defined (MAC_OS)
+#include "macterm.h"
+#endif
 #endif
 
 #ifndef NULL
--- a/src/image.c	Wed Apr 12 17:40:36 2006 +0000
+++ b/src/image.c	Wed Apr 19 16:23:46 2006 +0000
@@ -201,7 +201,7 @@
     }
   else
 #endif
- if (depth == 1)
+  if (depth == 1)
     {
       char *base_addr = GetPixBaseAddr (pixmap);
       short row_bytes = GetPixRowBytes (pixmap);
@@ -444,8 +444,6 @@
   id = x_allocate_bitmap_record (f);
 #ifdef MAC_OS
   dpyinfo->bitmaps[id - 1].bitmap_data = (char *) xmalloc (height * width);
-  if (! dpyinfo->bitmaps[id - 1].bitmap_data)
-    return -1;
   bcopy (bits, dpyinfo->bitmaps[id - 1].bitmap_data, height * width);
 #endif  /* MAC_OS */
 
@@ -4381,7 +4379,7 @@
 	  if (color == NULL)
 	    goto failure;
 
-	  while (str = strtok (NULL, " \t"))
+	  while ((str = strtok (NULL, " \t")) != NULL)
 	    {
 	      next_key = xpm_str_to_color_key (str);
 	      if (next_key >= 0)
@@ -4409,17 +4407,21 @@
 	  Lisp_Object specified_color = Fassoc (symbol_color, color_symbols);
 
 	  if (CONSP (specified_color) && STRINGP (XCDR (specified_color)))
-	    if (xstricmp (SDATA (XCDR (specified_color)), "None") == 0)
-	      color_val = Qt;
-	    else if (x_defined_color (f, SDATA (XCDR (specified_color)),
-				      &cdef, 0))
-	      color_val = make_number (cdef.pixel);
+	    {
+	      if (xstricmp (SDATA (XCDR (specified_color)), "None") == 0)
+		color_val = Qt;
+	      else if (x_defined_color (f, SDATA (XCDR (specified_color)),
+					&cdef, 0))
+		color_val = make_number (cdef.pixel);
+	    }
 	}
       if (NILP (color_val) && max_key > 0)
-	if (xstricmp (max_color, "None") == 0)
-	  color_val = Qt;
-	else if (x_defined_color (f, max_color, &cdef, 0))
-	  color_val = make_number (cdef.pixel);
+	{
+	  if (xstricmp (max_color, "None") == 0)
+	    color_val = Qt;
+	  else if (x_defined_color (f, max_color, &cdef, 0))
+	    color_val = make_number (cdef.pixel);
+	}
       if (!NILP (color_val))
 	(*put_color_table) (color_table, beg, chars_per_pixel, color_val);
 
@@ -7848,7 +7850,6 @@
   int width, height;
   XImagePtr ximg;
   TimeValue time;
-  struct gcpro gcpro1;
   int ino;
   CGrafPtr old_port;
   GDHandle old_gdh;
--- a/src/keyboard.c	Wed Apr 12 17:40:36 2006 +0000
+++ b/src/keyboard.c	Wed Apr 19 16:23:46 2006 +0000
@@ -9684,6 +9684,7 @@
   /* Don't downcase the last character if the caller says don't.
      Don't downcase it if the result is undefined, either.  */
   if ((dont_downcase_last || first_binding >= nmaps)
+      && t > 0
       && t - 1 == original_uppercase_position)
     keybuf[t - 1] = original_uppercase;
 
--- a/src/keymap.c	Wed Apr 12 17:40:36 2006 +0000
+++ b/src/keymap.c	Wed Apr 19 16:23:46 2006 +0000
@@ -3365,7 +3365,7 @@
       if (vect[i].shadowed)
 	{
 	  SET_PT (PT - 1);
-	  insert_string ("  (shadowed)");
+	  insert_string ("\n  (that binding is currently shadowed by another mode)");
 	  SET_PT (PT + 1);
 	}
     }
--- a/src/lisp.h	Wed Apr 12 17:40:36 2006 +0000
+++ b/src/lisp.h	Wed Apr 19 16:23:46 2006 +0000
@@ -3209,10 +3209,14 @@
 /* Defined in terminal.c */
 extern void syms_of_terminal P_ ((void));
 
-#ifdef HAVE_X_WINDOWS
+#ifdef HAVE_WINDOW_SYSTEM
 /* Defined in fontset.c */
 extern void syms_of_fontset P_ ((void));
 EXFUN (Fset_fontset_font, 4);
+
+/* Defined in xfns.c, w32fns.c, or macfns.c */
+EXFUN (Fxw_display_color_p, 1);
+EXFUN (Fx_file_dialog, 5);
 #endif
 
 /* Defined in xfaces.c */
@@ -3226,12 +3230,6 @@
 #ifdef HAVE_X_WINDOWS
 /* Defined in xfns.c */
 extern void syms_of_xfns P_ ((void));
-#endif /* HAVE_X_WINDOWS */
-#ifdef HAVE_WINDOW_SYSTEM
-/* Defined in xfns.c, w32fns.c, or macfns.c */
-EXFUN (Fxw_display_color_p, 1);
-EXFUN (Fx_file_dialog, 5);
-#endif /* HAVE_WINDOW_SYSTEM */
 
 /* Defined in xsmfns.c */
 extern void syms_of_xsmfns P_ ((void));
@@ -3241,11 +3239,32 @@
 
 /* Defined in xterm.c */
 extern void syms_of_xterm P_ ((void));
+#endif /* HAVE_X_WINDOWS */
 
 #ifdef MSDOS
 /* Defined in msdos.c */
 EXFUN (Fmsdos_downcase_filename, 1);
 #endif
+
+#ifdef MAC_OS
+/* Defined in macfns.c */
+extern void syms_of_macfns P_ ((void));
+
+/* Defined in macselect.c */
+extern void syms_of_macselect P_ ((void));
+
+/* Defined in macterm.c */
+extern void syms_of_macterm P_ ((void));
+
+/* Defined in macmenu.c */
+extern void syms_of_macmenu P_ ((void));
+
+/* Defined in mac.c */
+extern void syms_of_mac P_ ((void));
+#ifdef MAC_OSX
+extern void init_mac_osx_environment P_ ((void));
+#endif /* MAC_OSX */
+#endif /* MAC_OS */
 
 /* Nonzero means Emacs has already been initialized.
    Used during startup to detect startup of dumped Emacs.  */
--- a/src/mac.c	Wed Apr 12 17:40:36 2006 +0000
+++ b/src/mac.c	Wed Apr 19 16:23:46 2006 +0000
@@ -28,7 +28,9 @@
 
 #include "lisp.h"
 #include "process.h"
-#undef init_process
+#ifdef MAC_OSX
+#undef select
+#endif
 #include "systime.h"
 #include "sysselect.h"
 #include "blockinput.h"
@@ -79,8 +81,10 @@
 /* The single script context used for all script executions.  */
 static OSAID as_script_context;
 
+#ifndef MAC_OSX
 static OSErr posix_pathname_to_fsspec P_ ((const char *, FSSpec *));
 static OSErr fsspec_to_posix_pathname P_ ((const FSSpec *, char *, int));
+#endif
 
 /* When converting from Mac to Unix pathnames, /'s in folder names are
    converted to :'s.  This function, used in copying folder names,
@@ -449,15 +453,10 @@
       char *buf;
 
       buf = xmalloc (data_size + 1);
-      if (buf)
-	{
-	  memcpy (buf, data_ptr, data_size);
-	  buf[data_size] = '\0';
-	  err = posix_pathname_to_fsspec (buf, &fs);
-	  xfree (buf);
-	}
-      else
-	err = memFullErr;
+      memcpy (buf, data_ptr, data_size);
+      buf[data_size] = '\0';
+      err = posix_pathname_to_fsspec (buf, &fs);
+      xfree (buf);
       if (err == noErr)
 	err = AECoercePtr (typeFSS, &fs, sizeof (FSSpec), to_type, result);
 #endif
@@ -485,14 +484,11 @@
 	    {
 	      size = AEGetDescDataSize (&desc);
 	      buf = xmalloc (size);
-	      if (buf)
-		{
-		  err = AEGetDescData (&desc, buf, size);
-		  if (err == noErr)
-		    url = CFURLCreateWithBytes (NULL, buf, size,
-						kCFStringEncodingUTF8, NULL);
-		  xfree (buf);
-		}
+	      err = AEGetDescData (&desc, buf, size);
+	      if (err == noErr)
+		url = CFURLCreateWithBytes (NULL, buf, size,
+					    kCFStringEncodingUTF8, NULL);
+	      xfree (buf);
 	      AEDisposeDesc (&desc);
 	    }
 	}
@@ -577,21 +573,16 @@
       data_size = GetHandleSize (from_desc->dataHandle);
 #endif
       data_ptr = xmalloc (data_size);
-      if (data_ptr)
-	{
 #if TARGET_API_MAC_CARBON
-	  err = AEGetDescData (from_desc, data_ptr, data_size);
+      err = AEGetDescData (from_desc, data_ptr, data_size);
 #else
-	  memcpy (data_ptr, *(from_desc->dataHandle), data_size);
+      memcpy (data_ptr, *(from_desc->dataHandle), data_size);
 #endif
-	  if (err == noErr)
-	    err = mac_coerce_file_name_ptr (from_type, data_ptr,
-					    data_size, to_type,
-					    handler_refcon, result);
-	  xfree (data_ptr);
-	}
-      else
-	err = memFullErr;
+      if (err == noErr)
+	err = mac_coerce_file_name_ptr (from_type, data_ptr,
+					data_size, to_type,
+					handler_refcon, result);
+      xfree (data_ptr);
     }
 
   if (err != noErr)
@@ -687,8 +678,6 @@
 	if (err != noErr)
 	  break;
 	buf = xmalloc (size);
-	if (buf == NULL)
-	  break;
 	err = GetEventParameter (event, names[i], types[i], NULL,
 				 size, NULL, buf);
 	if (err == noErr)
@@ -1222,7 +1211,7 @@
 		       && '0' <= P[1] && P[1] <= '7'
 		       && '0' <= P[2] && P[2] <= '7')
 		{
-		  *q++ = (P[0] - '0' << 6) + (P[1] - '0' << 3) + (P[2] - '0');
+		  *q++ = ((P[0] - '0') << 6) + ((P[1] - '0') << 3) + (P[2] - '0');
 		  P += 3;
 		}
 	      else
@@ -1592,8 +1581,6 @@
 
   count = CFSetGetCount (key_set);
   keys = xmalloc (sizeof (CFStringRef) * count);
-  if (keys == NULL)
-    goto out;
   CFSetGetValues (key_set, (const void **)keys);
   for (index = 0; index < count; index++)
     {
@@ -2789,7 +2776,7 @@
 /* Determine the path name of the file specified by VREFNUM, DIRID,
    and NAME and place that in the buffer PATH of length
    MAXPATHLEN.  */
-int
+static int
 path_from_vol_dir_name (char *path, int man_path_len, short vol_ref_num,
 			long dir_id, ConstStr255Param name)
 {
@@ -2834,6 +2821,8 @@
 }
 
 
+#ifndef MAC_OSX
+
 static OSErr
 posix_pathname_to_fsspec (ufn, fs)
      const char *ufn;
@@ -2866,8 +2855,6 @@
     return fnfErr;
 }
 
-#ifndef MAC_OSX
-
 int
 readlink (const char *path, char *buf, int bufsiz)
 {
@@ -3124,8 +3111,7 @@
   short vol_ref_num;
   long dir_id;
   OSErr err;
-  Str255 dir_name, full_path;
-  CInfoPBRec cpb;
+  Str255 full_path;
   char unix_dir_name[MAXPATHLEN+1];
   DIR *dir;
 
@@ -3217,8 +3203,7 @@
   short vol_ref_num;
   long dir_id;
   OSErr err;
-  Str255 dir_name, full_path;
-  CInfoPBRec cpb;
+  Str255 full_path;
   static char system_folder_unix_name[MAXPATHLEN+1];
   DIR *dir;
 
@@ -3947,7 +3932,6 @@
 #else
   FSSpec fss;
 #endif
-  OSType cCode;
   Lisp_Object result = Qnil;
   CHECK_STRING (filename);
 
@@ -4002,7 +3986,6 @@
 #else
   FSSpec fss;
 #endif
-  OSType cCode;
   Lisp_Object result = Qnil;
   CHECK_STRING (filename);
 
@@ -4296,11 +4279,6 @@
   Lisp_Object result = Qnil;
   DescType src_desc_type, dst_desc_type;
   AEDesc dst_desc;
-#ifdef MAC_OSX
-  FSRef fref;
-#else
-  FSSpec fs;
-#endif
 
   CHECK_STRING (src_data);
   if (EQ (src_type, Qundecoded_file_name))
@@ -4422,18 +4400,20 @@
     }
 
   if (NILP (key))
-    if (EQ (format, Qxml))
-      {
-	CFDataRef data = CFPropertyListCreateXMLData (NULL, plist);
-	if (data == NULL)
-	  goto out;
-	result = cfdata_to_lisp (data);
-	CFRelease (data);
-      }
-    else
-      result =
-	cfproperty_list_to_lisp (plist, EQ (format, Qt),
-				 NILP (hash_bound) ? -1 : XINT (hash_bound));
+    {
+      if (EQ (format, Qxml))
+	{
+	  CFDataRef data = CFPropertyListCreateXMLData (NULL, plist);
+	  if (data == NULL)
+	    goto out;
+	  result = cfdata_to_lisp (data);
+	  CFRelease (data);
+	}
+      else
+	result =
+	  cfproperty_list_to_lisp (plist, EQ (format, Qt),
+				   NILP (hash_bound) ? -1 : XINT (hash_bound));
+    }
 
  out:
   if (app_plist)
@@ -4550,11 +4530,8 @@
       if (in_text == NULL)
 	{
 	  buffer = xmalloc (sizeof (UniChar) * length);
-	  if (buffer)
-	    {
-	      CFStringGetCharacters (str, CFRangeMake (0, length), buffer);
-	      in_text = buffer;
-	    }
+	  CFStringGetCharacters (str, CFRangeMake (0, length), buffer);
+	  in_text = buffer;
 	}
 
       if (in_text)
@@ -4562,15 +4539,12 @@
       while (err == noErr)
 	{
 	  out_buf = xmalloc (out_size);
-	  if (out_buf == NULL)
-	    err = mFulErr;
-	  else
-	    err = ConvertFromUnicodeToText (uni, length * sizeof (UniChar),
-					    in_text,
-					    kUnicodeDefaultDirectionMask,
-					    0, NULL, NULL, NULL,
-					    out_size, &out_read, &out_len,
-					    out_buf);
+	  err = ConvertFromUnicodeToText (uni, length * sizeof (UniChar),
+					  in_text,
+					  kUnicodeDefaultDirectionMask,
+					  0, NULL, NULL, NULL,
+					  out_size, &out_read, &out_len,
+					  out_buf);
 	  if (err == noErr && out_read < length * sizeof (UniChar))
 	    {
 	      xfree (out_buf);
@@ -4701,7 +4675,6 @@
 
 
 #ifdef MAC_OSX
-#undef select
 
 extern int inhibit_window_system;
 extern int noninteractive;
--- a/src/macfns.c	Wed Apr 12 17:40:36 2006 +0000
+++ b/src/macfns.c	Wed Apr 19 16:23:46 2006 +0000
@@ -1024,7 +1024,7 @@
 x_to_mac_color (colorname)
      char * colorname;
 {
-  register Lisp_Object tail, ret = Qnil;
+  register Lisp_Object ret = Qnil;
 
   BLOCK_INPUT;
 
@@ -1359,7 +1359,6 @@
      Lisp_Object arg, oldval;
 {
   struct x_output *x = f->output_data.x;
-  Display *dpy = FRAME_MAC_DISPLAY (f);
   Cursor cursor, nontext_cursor, mode_cursor, hand_cursor;
   Cursor hourglass_cursor, horizontal_drag_cursor;
   unsigned long pixel = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f));
@@ -2387,7 +2386,6 @@
   struct mac_display_info *dpyinfo = NULL;
   Lisp_Object parent;
   struct kboard *kb;
-  static int x_frame_count = 2;  /* begins at 2 because terminal frame is F1 */
 
   check_mac ();
 
@@ -2910,23 +2908,25 @@
   BLOCK_INPUT;
   err = Gestalt (gestaltSystemVersion, &response);
   if (err == noErr)
-    if (response >= 0x00001040)
-      {
-	err = Gestalt ('sys1', &major); /* gestaltSystemVersionMajor */
-	if (err == noErr)
-	  err = Gestalt ('sys2', &minor); /* gestaltSystemVersionMinor */
-	if (err == noErr)
-	  err = Gestalt ('sys3', &bugfix); /* gestaltSystemVersionBugFix */
-      }
-    else
-      {
-	bugfix = response & 0xf;
-	response >>= 4;
-	minor = response & 0xf;
-	response >>= 4;
-	/* convert BCD to int */
-	major = response - (response >> 4) * 6;
-      }
+    {
+      if (response >= 0x00001040)
+	{
+	  err = Gestalt ('sys1', &major); /* gestaltSystemVersionMajor */
+	  if (err == noErr)
+	    err = Gestalt ('sys2', &minor); /* gestaltSystemVersionMinor */
+	  if (err == noErr)
+	    err = Gestalt ('sys3', &bugfix); /* gestaltSystemVersionBugFix */
+	}
+      else
+	{
+	  bugfix = response & 0xf;
+	  response >>= 4;
+	  minor = response & 0xf;
+	  response >>= 4;
+	  /* convert BCD to int */
+	  major = response - (response >> 4) * 6;
+	}
+    }
   UNBLOCK_INPUT;
 
   if (err != noErr)
@@ -3210,6 +3210,14 @@
   return Qnil;
 }
 
+/* x_sync is a no-op on Mac.  */
+
+void
+x_sync (f)
+     FRAME_PTR f;
+{
+}
+
 
 /***********************************************************************
                            Window properties
@@ -4187,7 +4195,6 @@
   int count = SPECPDL_INDEX ();
   struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5, gcpro6;
   char filename[MAXPATHLEN];
-  int default_filter_index = 1; /* 1: All Files, 2: Directories only  */
   static NavEventUPP mac_nav_event_callbackUPP = NULL;
 
   GCPRO6 (prompt, dir, default_filename, mustmatch, file, only_dir_p);
--- a/src/macmenu.c	Wed Apr 12 17:40:36 2006 +0000
+++ b/src/macmenu.c	Wed Apr 19 16:23:46 2006 +0000
@@ -72,7 +72,7 @@
   MAC_MENU_END			/* 32768          */
 };
 
-static const min_menu_id[] = {0, 1, 235, 236, 256, 16384, 32768};
+static const int min_menu_id[] = {0, 1, 235, 236, 256, 16384, 32768};
 
 #define DIALOG_WINDOW_RESOURCE 130
 
--- a/src/macselect.c	Wed Apr 12 17:40:36 2006 +0000
+++ b/src/macselect.c	Wed Apr 19 16:23:46 2006 +0000
@@ -153,7 +153,6 @@
 get_flavor_type_from_symbol (sym)
      Lisp_Object sym;
 {
-  ScrapFlavorType val;
   Lisp_Object str = Fget (sym, Qmac_ostype);
 
   if (STRINGP (str) && SBYTES (str) == 4)
@@ -322,17 +321,19 @@
 
   err = GetScrapFlavorFlags (scrap, SCRAP_FLAVOR_TYPE_EMACS_TIMESTAMP, &flags);
   if (err == noErr)
-    if (!(flags & kScrapFlavorMaskSenderOnly))
-      err = noTypeErr;
-    else
-      {
-	Size size = sizeof (*timestamp);
+    {
+      if (!(flags & kScrapFlavorMaskSenderOnly))
+	err = noTypeErr;
+      else
+	{
+	  Size size = sizeof (*timestamp);
 
-	err = GetScrapFlavorData (scrap, SCRAP_FLAVOR_TYPE_EMACS_TIMESTAMP,
-				  &size, timestamp);
-	if (err == noErr && size != sizeof (*timestamp))
-	  err = noTypeErr;
-      }
+	  err = GetScrapFlavorData (scrap, SCRAP_FLAVOR_TYPE_EMACS_TIMESTAMP,
+				    &size, timestamp);
+	  if (err == noErr && size != sizeof (*timestamp))
+	    err = noTypeErr;
+	}
+    }
 #else  /* !TARGET_API_MAC_CARBON */
   Handle handle;
   SInt32 size, offset;
@@ -372,14 +373,11 @@
   err = GetScrapFlavorCount (scrap, &count);
   if (err == noErr)
     flavor_info = xmalloc (sizeof (ScrapFlavorInfo) * count);
-  if (flavor_info)
+  err = GetScrapFlavorInfoList (scrap, &count, flavor_info);
+  if (err != noErr)
     {
-      err = GetScrapFlavorInfoList (scrap, &count, flavor_info);
-      if (err != noErr)
-	{
-	  xfree (flavor_info);
-	  flavor_info = NULL;
-	}
+      xfree (flavor_info);
+      flavor_info = NULL;
     }
   if (flavor_info == NULL)
     count = 0;
@@ -683,18 +681,20 @@
 
   err = get_scrap_from_symbol (selection_symbol, 0, &scrap);
   if (err == noErr && scrap)
-    if (EQ (target_type, QTARGETS))
-      {
-	result = get_scrap_target_type_list (scrap);
-	result = Fvconcat (1, &result);
-      }
-    else
-      {
-	result = get_scrap_string (scrap, target_type);
-	if (STRINGP (result))
-	  Fput_text_property (make_number (0), make_number (SBYTES (result)),
-			      Qforeign_selection, target_type, result);
-      }
+    {
+      if (EQ (target_type, QTARGETS))
+	{
+	  result = get_scrap_target_type_list (scrap);
+	  result = Fvconcat (1, &result);
+	}
+      else
+	{
+	  result = get_scrap_string (scrap, target_type);
+	  if (STRINGP (result))
+	    Fput_text_property (make_number (0), make_number (SBYTES (result)),
+				Qforeign_selection, target_type, result);
+	}
+    }
 
   UNBLOCK_INPUT;
 
@@ -1009,7 +1009,7 @@
   /* Mac OS 10.3 Xcode manual says AESuspendTheCurrentEvent makes
      copies of the Apple event and the reply, but Mac OS 10.4 Xcode
      manual says it doesn't.  Anyway we create copies of them and save
-     it in `deferred_apple_events'.  */
+     them in `deferred_apple_events'.  */
   if (err == noErr)
     {
       if (deferred_apple_events.buf == NULL)
@@ -1018,20 +1018,13 @@
 	  deferred_apple_events.count = 0;
 	  deferred_apple_events.buf =
 	    xmalloc (sizeof (AppleEvent) * deferred_apple_events.size);
-	  if (deferred_apple_events.buf == NULL)
-	    err = memFullErr;
 	}
       else if (deferred_apple_events.count == deferred_apple_events.size)
 	{
-	  AppleEvent *newbuf;
-
 	  deferred_apple_events.size *= 2;
-	  newbuf = xrealloc (deferred_apple_events.buf,
-			     sizeof (AppleEvent) * deferred_apple_events.size);
-	  if (newbuf)
-	    deferred_apple_events.buf = newbuf;
-	  else
-	    err = memFullErr;
+	  deferred_apple_events.buf
+	    = xrealloc (deferred_apple_events.buf,
+			sizeof (AppleEvent) * deferred_apple_events.size);
 	}
     }
 
@@ -1123,11 +1116,8 @@
        doc: /* Process Apple events that are deferred at the startup time.  */)
   ()
 {
-  OSErr err;
   Lisp_Object result = Qnil;
-  long i, count;
-  AppleEvent apple_event, reply;
-  AEKeyword keyword;
+  long i;
 
   if (mac_ready_for_apple_events)
     return Qnil;
@@ -1192,29 +1182,21 @@
 	  buf = NULL;
 	}
       else if (size_allocated < size)
-	{
-	  char *newbuf = xrealloc (buf, size);
-
-	  if (newbuf)
-	    buf = newbuf;
-	  else
-	    {
-	      xfree (buf);
-	      buf = NULL;
-	    }
-	}
+	buf = xrealloc (buf, size);
       else
 	break;
     }
   if (err == noErr)
-    if (buf == NULL)
-      err = memFullErr;
-    else
-      {
-	err = PutScrapFlavor (to_scrap, flavor_type, kScrapFlavorMaskNone,
-			      size, buf);
-	xfree (buf);
-      }
+    {
+      if (buf == NULL)
+	err = memFullErr;
+      else
+	{
+	  err = PutScrapFlavor (to_scrap, flavor_type, kScrapFlavorMaskNone,
+				size, buf);
+	  xfree (buf);
+	}
+    }
 
   return err;
 }
@@ -1300,14 +1282,11 @@
 	err = GetScrapFlavorCount (cur_scrap, &count);
 	if (err == noErr)
 	  flavor_info = xmalloc (sizeof (ScrapFlavorInfo) * count);
-	if (flavor_info)
+	err = GetScrapFlavorInfoList (cur_scrap, &count, flavor_info);
+	if (err != noErr)
 	  {
-	    err = GetScrapFlavorInfoList (cur_scrap, &count, flavor_info);
-	    if (err != noErr)
-	      {
-		xfree (flavor_info);
-		flavor_info = NULL;
-	      }
+	    xfree (flavor_info);
+	    flavor_info = NULL;
 	  }
 	if (flavor_info == NULL)
 	  break;
--- a/src/macterm.c	Wed Apr 12 17:40:36 2006 +0000
+++ b/src/macterm.c	Wed Apr 19 16:23:46 2006 +0000
@@ -77,7 +77,6 @@
 #include "termhooks.h"
 #include "termopts.h"
 #include "termchar.h"
-#include "gnu.h"
 #include "disptab.h"
 #include "buffer.h"
 #include "window.h"
@@ -215,7 +214,6 @@
 
 struct mac_display_info *mac_display_info_for_display (Display *);
 static void x_update_window_end P_ ((struct window *, int, int));
-static int x_io_error_quitter P_ ((Display *));
 int x_catch_errors P_ ((Display *));
 void x_uncatch_errors P_ ((Display *, int));
 void x_lower_frame P_ ((struct frame *));
@@ -1510,11 +1508,8 @@
 {
   GC gc = xmalloc (sizeof (*gc));
 
-  if (gc)
-    {
-      bzero (gc, sizeof (*gc));
-      XChangeGC (display, gc, mask, xgcv);
-    }
+  bzero (gc, sizeof (*gc));
+  XChangeGC (display, gc, mask, xgcv);
 
   return gc;
 }
@@ -1697,14 +1692,6 @@
 #endif
 }
 
-/* x_sync is a no-op on Mac.  */
-void
-x_sync (f)
-     void *f;
-{
-}
-
-
 /* Flush display of frame F, or of all frames if F is null.  */
 
 static void
@@ -2080,7 +2067,6 @@
      unsigned short *bits;
      int h, wd;
 {
-  unsigned short *mask_bits;
   int i;
   CGDataProviderRef provider;
 
@@ -2171,21 +2157,17 @@
       if (*row == NULL)
 	{
 	  *row = xmalloc (sizeof (XCharStructRow));
-	  if (*row)
-	    bzero (*row, sizeof (XCharStructRow));
+	  bzero (*row, sizeof (XCharStructRow));
 	}
-      if (*row)
+      pcm = (*row)->per_char + char2b->byte2;
+      if (!XCHARSTRUCTROW_CHAR_VALID_P (*row, char2b->byte2))
 	{
-	  pcm = (*row)->per_char + char2b->byte2;
-	  if (!XCHARSTRUCTROW_CHAR_VALID_P (*row, char2b->byte2))
-	    {
-	      BLOCK_INPUT;
-	      mac_query_char_extents (font->mac_style,
-				      (char2b->byte1 << 8) + char2b->byte2,
-				      NULL, NULL, pcm, NULL);
-	      UNBLOCK_INPUT;
-	      XCHARSTRUCTROW_SET_CHAR_VALID (*row, char2b->byte2);
-	    }
+	  BLOCK_INPUT;
+	  mac_query_char_extents (font->mac_style,
+				  (char2b->byte1 << 8) + char2b->byte2,
+				  NULL, NULL, pcm, NULL);
+	  UNBLOCK_INPUT;
+	  XCHARSTRUCTROW_SET_CHAR_VALID (*row, char2b->byte2);
 	}
     }
   else
@@ -2366,7 +2348,6 @@
 static void x_draw_image_glyph_string P_ ((struct glyph_string *));
 static void x_draw_image_relief P_ ((struct glyph_string *));
 static void x_draw_image_foreground P_ ((struct glyph_string *));
-static void x_draw_image_foreground_1 P_ ((struct glyph_string *, Pixmap));
 static void x_clear_glyph_string_rect P_ ((struct glyph_string *, int,
 					   int, int, int));
 static void x_draw_relief_rect P_ ((struct frame *, int, int, int, int,
@@ -2567,34 +2548,36 @@
 mac_compute_glyph_string_overhangs (s)
      struct glyph_string *s;
 {
-  if (s->cmp == NULL
-      && s->first_glyph->type == CHAR_GLYPH)
-    if (!s->two_byte_p
+  if (!(s->cmp == NULL
+	&& s->first_glyph->type == CHAR_GLYPH))
+    return;
+
+  if (!s->two_byte_p
 #if USE_ATSUI
-	|| s->font->mac_style
-#endif
-	)
-      {
-	XCharStruct cs;
-
-	mac_text_extents_16 (s->font, s->char2b, s->nchars, &cs);
-	s->right_overhang = cs.rbearing > cs.width ? cs.rbearing - cs.width : 0;
-	s->left_overhang = cs.lbearing < 0 ? -cs.lbearing : 0;
-      }
-    else
-      {
-	Rect r;
-	MacFontStruct *font = s->font;
-
-	TextFont (font->mac_fontnum);
-	TextSize (font->mac_fontsize);
-	TextFace (font->mac_fontface);
-
-	QDTextBounds (s->nchars * 2, (char *)s->char2b, &r);
-
-	s->right_overhang = r.right > s->width ? r.right - s->width : 0;
-	s->left_overhang = r.left < 0 ? -r.left : 0;
-      }
+      || s->font->mac_style
+#endif
+      )
+    {
+      XCharStruct cs;
+
+      mac_text_extents_16 (s->font, s->char2b, s->nchars, &cs);
+      s->right_overhang = cs.rbearing > cs.width ? cs.rbearing - cs.width : 0;
+      s->left_overhang = cs.lbearing < 0 ? -cs.lbearing : 0;
+    }
+  else
+    {
+      Rect r;
+      MacFontStruct *font = s->font;
+
+      TextFont (font->mac_fontnum);
+      TextSize (font->mac_fontsize);
+      TextFace (font->mac_fontface);
+
+      QDTextBounds (s->nchars * 2, (char *)s->char2b, &r);
+
+      s->right_overhang = r.right > s->width ? r.right - s->width : 0;
+      s->left_overhang = r.left < 0 ? -r.left : 0;
+    }
 }
 
 
@@ -3430,7 +3413,6 @@
   int box_line_hwidth = abs (s->face->box_line_width);
   int box_line_vwidth = max (s->face->box_line_width, 0);
   int height;
-  Pixmap pixmap = 0;
 
   height = s->height - 2 * box_line_vwidth;
 
@@ -4176,142 +4158,6 @@
 
 
 
-/* Keyboard processing - modifier keys, vendor-specific keysyms, etc.  */
-
-#if 0 /* MAC_TODO */
-/* Initialize mode_switch_bit and modifier_meaning.  */
-static void
-x_find_modifier_meanings (dpyinfo)
-     struct x_display_info *dpyinfo;
-{
-  int min_code, max_code;
-  KeySym *syms;
-  int syms_per_code;
-  XModifierKeymap *mods;
-
-  dpyinfo->meta_mod_mask = 0;
-  dpyinfo->shift_lock_mask = 0;
-  dpyinfo->alt_mod_mask = 0;
-  dpyinfo->super_mod_mask = 0;
-  dpyinfo->hyper_mod_mask = 0;
-
-#ifdef HAVE_X11R4
-  XDisplayKeycodes (dpyinfo->display, &min_code, &max_code);
-#else
-  min_code = dpyinfo->display->min_keycode;
-  max_code = dpyinfo->display->max_keycode;
-#endif
-
-  syms = XGetKeyboardMapping (dpyinfo->display,
-			      min_code, max_code - min_code + 1,
-			      &syms_per_code);
-  mods = XGetModifierMapping (dpyinfo->display);
-
-  /* Scan the modifier table to see which modifier bits the Meta and
-     Alt keysyms are on.  */
-  {
-    int row, col;	/* The row and column in the modifier table.  */
-
-    for (row = 3; row < 8; row++)
-      for (col = 0; col < mods->max_keypermod; col++)
-	{
-	  KeyCode code
-	    = mods->modifiermap[(row * mods->max_keypermod) + col];
-
-	  /* Zeroes are used for filler.  Skip them.  */
-	  if (code == 0)
-	    continue;
-
-	  /* Are any of this keycode's keysyms a meta key?  */
-	  {
-	    int code_col;
-
-	    for (code_col = 0; code_col < syms_per_code; code_col++)
-	      {
-		int sym = syms[((code - min_code) * syms_per_code) + code_col];
-
-		switch (sym)
-		  {
-		  case XK_Meta_L:
-		  case XK_Meta_R:
-		    dpyinfo->meta_mod_mask |= (1 << row);
-		    break;
-
-		  case XK_Alt_L:
-		  case XK_Alt_R:
-		    dpyinfo->alt_mod_mask |= (1 << row);
-		    break;
-
-		  case XK_Hyper_L:
-		  case XK_Hyper_R:
-		    dpyinfo->hyper_mod_mask |= (1 << row);
-		    break;
-
-		  case XK_Super_L:
-		  case XK_Super_R:
-		    dpyinfo->super_mod_mask |= (1 << row);
-		    break;
-
-		  case XK_Shift_Lock:
-		    /* Ignore this if it's not on the lock modifier.  */
-		    if ((1 << row) == LockMask)
-		      dpyinfo->shift_lock_mask = LockMask;
-		    break;
-		  }
-	      }
-	  }
-	}
-  }
-
-  /* If we couldn't find any meta keys, accept any alt keys as meta keys.  */
-  if (! dpyinfo->meta_mod_mask)
-    {
-      dpyinfo->meta_mod_mask = dpyinfo->alt_mod_mask;
-      dpyinfo->alt_mod_mask = 0;
-    }
-
-  /* If some keys are both alt and meta,
-     make them just meta, not alt.  */
-  if (dpyinfo->alt_mod_mask & dpyinfo->meta_mod_mask)
-    {
-      dpyinfo->alt_mod_mask &= ~dpyinfo->meta_mod_mask;
-    }
-
-  XFree ((char *) syms);
-  XFreeModifiermap (mods);
-}
-
-#endif /* MAC_TODO */
-
-/* Convert between the modifier bits X uses and the modifier bits
-   Emacs uses.  */
-
-static unsigned int
-x_mac_to_emacs_modifiers (dpyinfo, state)
-     struct x_display_info *dpyinfo;
-     unsigned short state;
-{
-  return (((state & shiftKey) ? shift_modifier : 0)
-	  | ((state & controlKey) ? ctrl_modifier : 0)
-	  | ((state & cmdKey) ? meta_modifier : 0)
-	  | ((state & optionKey) ? alt_modifier : 0));
-}
-
-#if 0 /* MAC_TODO */
-static unsigned short
-x_emacs_to_x_modifiers (dpyinfo, state)
-     struct x_display_info *dpyinfo;
-     unsigned int state;
-{
-  return (  ((state & alt_modifier)	? dpyinfo->alt_mod_mask   : 0)
-	  | ((state & super_modifier)	? dpyinfo->super_mod_mask : 0)
-	  | ((state & hyper_modifier)	? dpyinfo->hyper_mod_mask : 0)
-	  | ((state & shift_modifier)	? ShiftMask        : 0)
-	  | ((state & ctrl_modifier)	? ControlMask      : 0)
-	  | ((state & meta_modifier)	? dpyinfo->meta_mod_mask  : 0));
-}
-#endif /* MAC_TODO */
-
 /* Convert a keysym to its name.  */
 
 char *
@@ -5102,41 +4948,43 @@
 
 #ifdef USE_TOOLKIT_SCROLL_BARS
   if (NILP (bar->track_top))
-    if (sb_width >= disp_height)
-      {
-	XSETINT (bar->track_top, 0);
-	XSETINT (bar->track_height, 0);
-      }
-    else
-      {
-	ControlHandle ch = SCROLL_BAR_CONTROL_HANDLE (bar);
-	Rect r0, r1;
-
-	BLOCK_INPUT;
-
-	SetControl32BitMinimum (ch, 0);
-	SetControl32BitMaximum (ch, 1);
-	SetControlViewSize (ch, 1);
-
-	/* Move the scroll bar thumb to the top.  */
-	SetControl32BitValue (ch, 0);
-	get_control_part_bounds (ch, kControlIndicatorPart, &r0);
-
-	/* Move the scroll bar thumb to the bottom.  */
-	SetControl32BitValue (ch, 1);
-	get_control_part_bounds (ch, kControlIndicatorPart, &r1);
-
-	UnionRect (&r0, &r1, &r0);
-	XSETINT (bar->track_top, r0.top);
-	XSETINT (bar->track_height, r0.bottom - r0.top);
-
-	/* Don't show the scroll bar if its height is not enough to
-	   display the scroll bar thumb.  */
-	if (r0.bottom - r0.top > 0)
-	  ShowControl (ch);
-
-	UNBLOCK_INPUT;
-      }
+    {
+      if (sb_width >= disp_height)
+	{
+	  XSETINT (bar->track_top, 0);
+	  XSETINT (bar->track_height, 0);
+	}
+      else
+	{
+	  ControlHandle ch = SCROLL_BAR_CONTROL_HANDLE (bar);
+	  Rect r0, r1;
+
+	  BLOCK_INPUT;
+
+	  SetControl32BitMinimum (ch, 0);
+	  SetControl32BitMaximum (ch, 1);
+	  SetControlViewSize (ch, 1);
+
+	  /* Move the scroll bar thumb to the top.  */
+	  SetControl32BitValue (ch, 0);
+	  get_control_part_bounds (ch, kControlIndicatorPart, &r0);
+
+	  /* Move the scroll bar thumb to the bottom.  */
+	  SetControl32BitValue (ch, 1);
+	  get_control_part_bounds (ch, kControlIndicatorPart, &r1);
+
+	  UnionRect (&r0, &r1, &r0);
+	  XSETINT (bar->track_top, r0.top);
+	  XSETINT (bar->track_height, r0.bottom - r0.top);
+
+	  /* Don't show the scroll bar if its height is not enough to
+	     display the scroll bar thumb.  */
+	  if (r0.bottom - r0.top > 0)
+	    ShowControl (ch);
+
+	  UNBLOCK_INPUT;
+	}
+    }
 
   x_set_toolkit_scroll_bar_thumb (bar, portion, position, whole);
 #else /* not USE_TOOLKIT_SCROLL_BARS */
@@ -6205,10 +6053,12 @@
   struct input_event buf;
 
   if (IsWindowVisible (wp))
-    if (IsWindowCollapsed (wp))
-      iconified = 1;
-    else
-      visible = 1;
+    {
+      if (IsWindowCollapsed (wp))
+	iconified = 1;
+      else
+	visible = 1;
+    }
 
   if (!f->async_visible && visible)
     {
@@ -6254,9 +6104,6 @@
 x_make_frame_visible (f)
      struct frame *f;
 {
-  Lisp_Object type;
-  int original_top, original_left;
-
   BLOCK_INPUT;
 
   if (! FRAME_VISIBLE_P (f))
@@ -6267,27 +6114,29 @@
 	 before the window gets really visible.  */
       if (! FRAME_ICONIFIED_P (f)
 	  && ! f->output_data.mac->asked_for_visible)
+	{
 #if TARGET_API_MAC_CARBON
-	if (!(FRAME_SIZE_HINTS (f)->flags & (USPosition | PPosition)))
-	  {
-	    struct frame *sf = SELECTED_FRAME ();
-	    if (!FRAME_MAC_P (sf))
-	      RepositionWindow (FRAME_MAC_WINDOW (f), NULL,
-				kWindowCenterOnMainScreen);
-	    else
-	      RepositionWindow (FRAME_MAC_WINDOW (f),
-				FRAME_MAC_WINDOW (sf),
+	  if (!(FRAME_SIZE_HINTS (f)->flags & (USPosition | PPosition)))
+	    {
+	      struct frame *sf = SELECTED_FRAME ();
+	      if (!FRAME_MAC_P (sf))
+		RepositionWindow (FRAME_MAC_WINDOW (f), NULL,
+				  kWindowCenterOnMainScreen);
+	      else
+		RepositionWindow (FRAME_MAC_WINDOW (f),
+				  FRAME_MAC_WINDOW (sf),
 #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1020
-				kWindowCascadeStartAtParentWindowScreen
+				  kWindowCascadeStartAtParentWindowScreen
 #else
-				kWindowCascadeOnParentWindowScreen
-#endif
-				);
-	    x_real_positions (f, &f->left_pos, &f->top_pos);
-	  }
-	else
-#endif
-	  x_set_offset (f, f->left_pos, f->top_pos, 0);
+				  kWindowCascadeOnParentWindowScreen
+#endif
+				  );
+	      x_real_positions (f, &f->left_pos, &f->top_pos);
+	    }
+	  else
+#endif
+	    x_set_offset (f, f->left_pos, f->top_pos, 0);
+	}
 
       f->output_data.mac->asked_for_visible = 1;
 
@@ -6707,12 +6556,7 @@
   struct xlfdpat_block *blk;
 
   pat = xmalloc (sizeof (struct xlfdpat));
-  if (pat == NULL)
-    goto error;
-
   pat->buf = xmalloc (strlen (pattern) + 1);
-  if (pat->buf == NULL)
-    goto error;
 
   /* Normalize the pattern string and store it to `pat->buf'.  */
   nblocks = 0;
@@ -6730,15 +6574,17 @@
 	else
 	  {
 	    if (last_char == '?')
-	      if (anychar_head > pat->buf && *(anychar_head - 1) == '*')
-		/*  ...*??* -> ...*??  */
-		continue;
-	      else
-		/*  ...a??* -> ...a*??  */
-		{
-		  *anychar_head++ = '*';
-		  c = '?';
-		}
+	      {
+		if (anychar_head > pat->buf && *(anychar_head - 1) == '*')
+		  /*  ...*??* -> ...*??  */
+		  continue;
+		else
+		  /*  ...a??* -> ...a*??  */
+		  {
+		    *anychar_head++ = '*';
+		    c = '?';
+		  }
+	      }
 	    nblocks++;
 	  }
       else if (c == '?')
@@ -6774,8 +6620,6 @@
     }
 
   pat->blocks = xmalloc (sizeof (struct xlfdpat_block) * nblocks);
-  if (pat->blocks == NULL)
-    goto error;
 
   /* Divide the normalized pattern into blocks.  */
   p = pat->buf;
@@ -7235,9 +7079,10 @@
 			 Qnil, Qnil, Qnil);;
       err = ATSUFontCount (&nfonts);
       if (err == noErr)
-	font_ids = xmalloc (sizeof (ATSUFontID) * nfonts);
-      if (font_ids)
-	err = ATSUGetFontIDs (font_ids, nfonts, NULL);
+	{
+	  font_ids = xmalloc (sizeof (ATSUFontID) * nfonts);
+	  err = ATSUGetFontIDs (font_ids, nfonts, NULL);
+	}
       if (err == noErr)
 	for (i = 0; i < nfonts; i++)
 	  {
@@ -7247,8 +7092,6 @@
 	    if (err != noErr)
 	      continue;
 	    name = xmalloc (name_len + 1);
-	    if (name == NULL)
-	      continue;
 	    name[name_len] = '\0';
 	    err = ATSUFindFontName (font_ids[i], kFontFamilyName,
 				    kFontMacintoshPlatform, kFontNoScript,
@@ -7569,7 +7412,7 @@
       if (xlfdpat_match (pat, font_name_table[i]))
 	{
 	  font_list = Fcons (build_string (font_name_table[i]), font_list);
-	  if (exact || maxnames > 0 && ++n_fonts >= maxnames)
+	  if (exact || (maxnames > 0 && ++n_fonts >= maxnames))
 	    break;
 	}
       else if (scl_val[XLFD_SCL_PIXEL_SIZE] > 0
@@ -7578,8 +7421,6 @@
 	  int former_len = ptr - font_name_table[i];
 
 	  scaled = xmalloc (strlen (font_name_table[i]) + 20 + 1);
-	  if (scaled == NULL)
-	    continue;
 	  memcpy (scaled, font_name_table[i], former_len);
 	  sprintf (scaled + former_len,
 		   "-%d-%d-72-72-m-%d-%s",
@@ -7592,7 +7433,7 @@
 	    {
 	      font_list = Fcons (build_string (scaled), font_list);
 	      xfree (scaled);
-	      if (exact || maxnames > 0 && ++n_fonts >= maxnames)
+	      if (exact || (maxnames > 0 && ++n_fonts >= maxnames))
 		  break;
 	    }
 	  else
@@ -7912,18 +7753,8 @@
       font->max_char_or_byte2 = 0xff;
 
       font->bounds.rows = xmalloc (sizeof (XCharStructRow *) * 0x100);
-      if (font->bounds.rows == NULL)
-	{
-	  mac_unload_font (&one_mac_display_info, font);
-	  return NULL;
-	}
       bzero (font->bounds.rows, sizeof (XCharStructRow *) * 0x100);
       font->bounds.rows[0] = xmalloc (sizeof (XCharStructRow));
-      if (font->bounds.rows[0] == NULL)
-	{
-	  mac_unload_font (&one_mac_display_info, font);
-	  return NULL;
-	}
       bzero (font->bounds.rows[0], sizeof (XCharStructRow));
 
 #if USE_CG_TEXT_DRAWING
@@ -7945,9 +7776,10 @@
       }
 
       if (font->cg_font)
-	font->cg_glyphs = xmalloc (sizeof (CGGlyph) * 0x100);
-      if (font->cg_glyphs)
-	bzero (font->cg_glyphs, sizeof (CGGlyph) * 0x100);
+	{
+	  font->cg_glyphs = xmalloc (sizeof (CGGlyph) * 0x100);
+	  bzero (font->cg_glyphs, sizeof (CGGlyph) * 0x100);
+	}
 #endif
       space_bounds = font->bounds.rows[0]->per_char + 0x20;
       err = mac_query_char_extents (font->mac_style, 0x20,
@@ -8093,11 +7925,6 @@
 
 	  font->bounds.per_char =
 	    xmalloc (sizeof (XCharStruct) * (0xff - 0x20 + 1));
-	  if (font->bounds.per_char == NULL)
-	    {
-	      mac_unload_font (&one_mac_display_info, font);
-	      return NULL;
-	    }
 	  bzero (font->bounds.per_char,
 		 sizeof (XCharStruct) * (0xff - 0x20 + 1));
 
@@ -8241,10 +8068,8 @@
 
   /* Load the font and add it to the table.  */
   {
-    char *full_name;
     struct MacFontStruct *font;
     struct font_info *fontp;
-    unsigned long value;
     int i;
 
     fontname = (char *) SDATA (XCAR (font_names));
@@ -8756,6 +8581,7 @@
 
 #endif
 
+#ifdef MAC_OS8
 static void
 do_get_menus (void)
 {
@@ -8817,6 +8643,7 @@
       exit (1);
     }
 }
+#endif /* MAC_OS8 */
 
 static void
 do_window_update (WindowPtr win)
@@ -8998,42 +8825,41 @@
 static void
 do_zoom_window (WindowPtr w, int zoom_in_or_out)
 {
-  GrafPtr save_port;
   Rect zoom_rect, port_rect;
-  Point top_left;
-  int w_title_height, columns, rows, width, height;
+  int columns, rows, width, height;
   struct frame *f = mac_window_to_frame (w);
   struct mac_display_info *dpyinfo = FRAME_MAC_DISPLAY_INFO (f);
-
 #if TARGET_API_MAC_CARBON
-  {
-    Point standard_size;
-
-    standard_size.h = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, DEFAULT_NUM_COLS);
-    standard_size.v = dpyinfo->height;
-
-    if (IsWindowInStandardState (w, &standard_size, &zoom_rect))
-      zoom_in_or_out = inZoomIn;
-    else
-      {
-	/* Adjust the standard size according to character boundaries.  */
-
-	columns = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, zoom_rect.right - zoom_rect.left);
-	rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, zoom_rect.bottom - zoom_rect.top);
-	standard_size.h = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, columns);
-	standard_size.v = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, rows);
-	GetWindowBounds (w, kWindowContentRgn, &port_rect);
-	if (IsWindowInStandardState (w, &standard_size, &zoom_rect)
-	    && port_rect.left == zoom_rect.left
-	    && port_rect.top == zoom_rect.top)
-	  zoom_in_or_out = inZoomIn;
-	else
-	  zoom_in_or_out = inZoomOut;
-      }
-
-    ZoomWindowIdeal (w, zoom_in_or_out, &standard_size);
-  }
+  Point standard_size;
+
+  standard_size.h = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, DEFAULT_NUM_COLS);
+  standard_size.v = dpyinfo->height;
+
+  if (IsWindowInStandardState (w, &standard_size, &zoom_rect))
+    zoom_in_or_out = inZoomIn;
+  else
+    {
+      /* Adjust the standard size according to character boundaries.  */
+
+      columns = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, zoom_rect.right - zoom_rect.left);
+      rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, zoom_rect.bottom - zoom_rect.top);
+      standard_size.h = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, columns);
+      standard_size.v = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, rows);
+      GetWindowBounds (w, kWindowContentRgn, &port_rect);
+      if (IsWindowInStandardState (w, &standard_size, &zoom_rect)
+	  && port_rect.left == zoom_rect.left
+	  && port_rect.top == zoom_rect.top)
+	zoom_in_or_out = inZoomIn;
+      else
+	zoom_in_or_out = inZoomOut;
+    }
+
+  ZoomWindowIdeal (w, zoom_in_or_out, &standard_size);
 #else /* not TARGET_API_MAC_CARBON */
+  GrafPtr save_port;
+  Point top_left;
+  int w_title_height;
+
   GetPort (&save_port);
 
   SetPortWindowPort (w);
@@ -9101,15 +8927,12 @@
      Lisp_Object class, id;
      const AEDesc *desc;
 {
-  OSErr err = noErr;
+  OSErr err;
   struct input_event buf;
   AEDesc *desc_copy;
 
   desc_copy = xmalloc (sizeof (AEDesc));
-  if (desc_copy == NULL)
-    err = memFullErr;
-  else
-    err = AEDuplicateDesc (desc, desc_copy);
+  err = AEDuplicateDesc (desc, desc_copy);
   if (err == noErr)
     {
       EVENT_INIT (buf);
@@ -9168,26 +8991,27 @@
   mac_find_apple_event_spec (0, command.commandID,
 			     &class_key, &id_key, &binding);
   if (!NILP (binding) && !EQ (binding, Qundefined))
-    if (INTEGERP (binding))
-      return XINT (binding);
-    else
-      {
-	AppleEvent apple_event;
-	UInt32 modifiers;
-	static EventParamName names[] = {kEventParamDirectObject,
-					 kEventParamKeyModifiers};
-	static EventParamType types[] = {typeHICommand,
-					 typeUInt32};
-	err = create_apple_event_from_event_ref (event, 2, names, types,
-						 &apple_event);
-	if (err == noErr)
-	  {
-	    err = mac_store_apple_event (class_key, id_key, &apple_event);
-	    AEDisposeDesc (&apple_event);
-	  }
-	if (err == noErr)
-	  return noErr;
-      }
+    {
+      if (INTEGERP (binding))
+	return XINT (binding);
+      else
+	{
+	  AppleEvent apple_event;
+	  static EventParamName names[] = {kEventParamDirectObject,
+					   kEventParamKeyModifiers};
+	  static EventParamType types[] = {typeHICommand,
+					   typeUInt32};
+	  err = create_apple_event_from_event_ref (event, 2, names, types,
+						   &apple_event);
+	  if (err == noErr)
+	    {
+	      err = mac_store_apple_event (class_key, id_key, &apple_event);
+	      AEDisposeDesc (&apple_event);
+	    }
+	  if (err == noErr)
+	    return noErr;
+	}
+    }
 
   return eventNotHandledErr;
 }
@@ -9195,7 +9019,6 @@
 static OSErr
 init_command_handler ()
 {
-  OSErr err = noErr;
   EventTypeSpec specs[] = {{kEventClassCommand, kEventCommandProcess}};
   static EventHandlerUPP handle_command_eventUPP = NULL;
 
@@ -10071,18 +9894,18 @@
 		    XSETINT (inev.x, mouse_loc.h);
 		    XSETINT (inev.y, mouse_loc.v);
 
-		    if (dpyinfo->grabbed && tracked_scroll_bar
-			|| ch != 0
+		    if ((dpyinfo->grabbed && tracked_scroll_bar)
+			|| (ch != 0
 #ifndef USE_TOOLKIT_SCROLL_BARS
-			/* control_part_code becomes kControlNoPart if
- 			   a progress indicator is clicked.  */
-			&& control_part_code != kControlNoPart
+			    /* control_part_code becomes kControlNoPart if
+			       a progress indicator is clicked.  */
+			    && control_part_code != kControlNoPart
 #else  /* USE_TOOLKIT_SCROLL_BARS */
 #ifdef MAC_OSX
-			&& control_kind.kind == kControlKindScrollBar
+			    && control_kind.kind == kControlKindScrollBar
 #endif	/* MAC_OSX */
 #endif	/* USE_TOOLKIT_SCROLL_BARS */
-			)
+			    ))
 		      {
 			struct scroll_bar *bar;
 
@@ -10882,7 +10705,6 @@
   extern int inhibit_window_system;
   extern int noninteractive;
   CFBundleRef appsBundle;
-  pid_t child;
 
   /* No need to test if already -nw*/
   if (inhibit_window_system || noninteractive)
--- a/src/macterm.h	Wed Apr 12 17:40:36 2006 +0000
+++ b/src/macterm.h	Wed Apr 19 16:23:46 2006 +0000
@@ -547,7 +547,15 @@
 /* Defined in macterm.c.  */
 
 extern void x_set_window_size P_ ((struct frame *, int, int, int));
+extern void x_set_mouse_position P_ ((struct frame *, int, int));
+extern void x_set_mouse_pixel_position P_ ((struct frame *, int, int));
 extern void x_make_frame_visible P_ ((struct frame *));
+extern void x_make_frame_invisible P_ ((struct frame *));
+extern void x_iconify_frame P_ ((struct frame *));
+extern void x_free_frame_resources P_ ((struct frame *));
+extern void x_destroy_window P_ ((struct frame *));
+extern void x_wm_set_size_hint P_ ((struct frame *, long, int));
+extern void x_delete_display P_ ((struct x_display_info *));
 extern void mac_initialize P_ ((void));
 extern Pixmap XCreatePixmap P_ ((Display *, WindowPtr, unsigned int,
 				 unsigned int, unsigned int));
@@ -557,6 +565,7 @@
 					       unsigned int));
 extern void XFreePixmap P_ ((Display *, Pixmap));
 extern GC XCreateGC P_ ((Display *, Window, unsigned long, XGCValues *));
+extern void XFreeGC P_ ((Display *, GC));
 extern void XSetForeground P_ ((Display *, GC, unsigned long));
 extern void XSetBackground P_ ((Display *, GC, unsigned long));
 extern void XSetWindowBackground P_ ((Display *, WindowPtr, unsigned long));
@@ -568,6 +577,7 @@
 extern OSErr install_window_handler P_ ((WindowPtr));
 extern void remove_window_handler P_ ((WindowPtr));
 extern Lisp_Object mac_make_lispy_event_code P_ ((int));
+extern void do_menu_choice P_ ((SInt32));
 #if USE_CG_DRAWING
 extern void mac_prepare_for_quickdraw P_ ((struct frame *));
 #endif
@@ -581,6 +591,24 @@
 
 extern void x_clear_frame_selections P_ ((struct frame *));
 
+/* Defined in macfns.c */
+
+extern int have_menus_p P_ ((void));
+
+extern void x_real_positions P_ ((struct frame *, int *, int *));
+extern void x_set_menu_bar_lines P_ ((struct frame *, Lisp_Object, Lisp_Object));
+extern int x_pixel_width P_ ((struct frame *));
+extern int x_pixel_height P_ ((struct frame *));
+extern int x_char_width P_ ((struct frame *));
+extern int x_char_height P_ ((struct frame *));
+extern void x_sync P_ ((struct frame *));
+extern void x_set_tool_bar_lines P_ ((struct frame *, Lisp_Object, Lisp_Object));
+
+/* Defined in macmenu.c */
+
+extern void x_activate_menubar P_ ((struct frame *));
+extern void free_frame_menubar P_ ((struct frame *));
+
 /* Defined in mac.c.  */
 
 extern void mac_clear_font_name_table P_ ((void));
--- a/src/print.c	Wed Apr 12 17:40:36 2006 +0000
+++ b/src/print.c	Wed Apr 19 16:23:46 2006 +0000
@@ -759,7 +759,8 @@
        doc: /* Return a string containing the printed representation of OBJECT.
 OBJECT can be any Lisp object.  This function outputs quoting characters
 when necessary to make output that `read' can handle, whenever possible,
-unless the optional second argument NOESCAPE is non-nil.
+unless the optional second argument NOESCAPE is non-nil.  For complex objects,
+the behavior is controlled by `print-level' and `print-length', which see.
 
 OBJECT is any of the Lisp data types: a number, a string, a symbol,
 a list, a buffer, a window, a frame, etc.
--- a/src/process.c	Wed Apr 12 17:40:36 2006 +0000
+++ b/src/process.c	Wed Apr 19 16:23:46 2006 +0000
@@ -2322,7 +2322,11 @@
 }
 
 /* Convert an address object (vector or string) to an internal sockaddr.
-   Format of address has already been validated by size_lisp_to_sockaddr.  */
+
+   The address format has been basically validated by
+   get_lisp_to_sockaddr_size, but this does not mean FAMILY is valid;
+   it could have come from user data.  So if FAMILY is not valid,
+   we return after zeroing *SA.  */
 
 static void
 conv_lisp_to_sockaddr (family, address, sa, len)
@@ -2336,7 +2340,6 @@
   register int i;
 
   bzero (sa, len);
-  sa->sa_family = family;
 
   if (VECTORP (address))
     {
@@ -2348,6 +2351,7 @@
 	  i = XINT (p->contents[--len]);
 	  sin->sin_port = htons (i);
 	  cp = (unsigned char *)&sin->sin_addr;
+	  sa->sa_family = family;
 	}
 #ifdef AF_INET6
       else if (family == AF_INET6)
@@ -2363,9 +2367,10 @@
 		int j = XFASTINT (p->contents[i]) & 0xffff;
 		ip6[i] = ntohs (j);
 	      }
-	  return;
+	  sa->sa_family = family;
 	}
 #endif
+      return;
     }
   else if (STRINGP (address))
     {
@@ -2376,6 +2381,7 @@
 	  cp = SDATA (address);
 	  for (i = 0; i < sizeof (sockun->sun_path) && *cp; i++)
 	    sockun->sun_path[i] = *cp++;
+	  sa->sa_family = family;
 	}
 #endif
       return;
@@ -6236,6 +6242,8 @@
       emacs_close (XINT (XPROCESS (proc)->outfd));
 #endif /* not HAVE_SHUTDOWN */
       new_outfd = emacs_open (NULL_DEVICE, O_WRONLY, 0);
+      if (new_outfd < 0)
+	abort ();
       old_outfd = XINT (XPROCESS (proc)->outfd);
 
       if (!proc_encode_coding_system[new_outfd])
--- a/src/puresize.h	Wed Apr 12 17:40:36 2006 +0000
+++ b/src/puresize.h	Wed Apr 19 16:23:46 2006 +0000
@@ -49,7 +49,7 @@
 /* Increase BASE_PURESIZE by a ratio depending on the machine's word size.  */
 #ifndef PURESIZE_RATIO
 #if BITS_PER_EMACS_INT > 32
-#define PURESIZE_RATIO 9/5	/* Don't surround with `()'. */
+#define PURESIZE_RATIO 10/6	/* Don't surround with `()'. */
 #else
 #define PURESIZE_RATIO 1
 #endif
--- a/src/s/ms-w32.h	Wed Apr 12 17:40:36 2006 +0000
+++ b/src/s/ms-w32.h	Wed Apr 19 16:23:46 2006 +0000
@@ -465,8 +465,10 @@
 #endif
 #include <string.h>
 
-/* We need a little extra space, see ../../lisp/loadup.el */
-#define SYSTEM_PURESIZE_EXTRA 137500
+/* We need a little extra space, see ../../lisp/loadup.el.
+   The number below comes from 22038 bytes worth (as of 2006-04)
+   of w32-specific files loaded by loadup.el, plus 2K spare.  */
+#define SYSTEM_PURESIZE_EXTRA 24000
 
 /* For unexec to work on Alpha systems, we need to put Emacs'
    initialized data into a separate section from the CRT initialized
--- a/src/unexmacosx.c	Wed Apr 12 17:40:36 2006 +0000
+++ b/src/unexmacosx.c	Wed Apr 19 16:23:46 2006 +0000
@@ -100,7 +100,11 @@
 #if defined (__ppc__)
 #include <mach-o/ppc/reloc.h>
 #endif
-#if defined (HAVE_MALLOC_MALLOC_H)
+#include <config.h>
+#undef malloc
+#undef realloc
+#undef free
+#ifdef HAVE_MALLOC_MALLOC_H
 #include <malloc/malloc.h>
 #else
 #include <objc/malloc.h>
@@ -558,7 +562,7 @@
 static void
 read_load_commands ()
 {
-  int n, i, j;
+  int i;
 
   if (!unexec_read (&mh, sizeof (struct mach_header)))
     unexec_error ("cannot read mach-o header");
@@ -680,7 +684,6 @@
   struct section *sectp;
   int j;
   unsigned long header_offset, file_offset, old_file_offset;
-  struct region_t *r;
 
   printf ("Writing segment %-16.16s at %#8x - %#8x (sz: %#8x)\n",
 	  scp->segname, scp->fileoff, scp->fileoff + scp->filesize,
--- a/src/window.c	Wed Apr 12 17:40:36 2006 +0000
+++ b/src/window.c	Wed Apr 19 16:23:46 2006 +0000
@@ -663,12 +663,24 @@
 	  || WINDOW_RIGHTMOST_P (w))
 	{
 	  if (!WINDOW_LEFTMOST_P (w) && abs (*x - x0) < grabbable_width)
-	    return ON_VERTICAL_BORDER;
+	    {
+	      /* Convert X and Y to window relative coordinates.
+		 Vertical border is at the left edge of window.  */
+	      *x = max (0, *x - x0);
+	      *y -= top_y;
+	      return ON_VERTICAL_BORDER;
+	    }
 	}
       else
 	{
 	  if (abs (*x - x1) < grabbable_width)
-	    return ON_VERTICAL_BORDER;
+	    {
+	      /* Convert X and Y to window relative coordinates.
+		 Vertical border is at the right edge of window.  */
+	      *x = min (x1, *x) - x0;
+	      *y -= top_y;
+	      return ON_VERTICAL_BORDER;
+	    }
 	}
 
       if (*x < x0 || *x >= x1)
@@ -710,7 +722,13 @@
 	  && !WINDOW_HAS_VERTICAL_SCROLL_BAR (w)
 	  && !WINDOW_RIGHTMOST_P (w)
 	  && (abs (*x - right_x) < grabbable_width))
-	return ON_VERTICAL_BORDER;
+	{
+	  /* Convert X and Y to window relative coordinates.
+	     Vertical border is at the right edge of window.  */
+	  *x = min (right_x, *x) - left_x;
+	  *y -= top_y;
+	  return ON_VERTICAL_BORDER;
+	}
     }
   else
     {
@@ -722,6 +740,8 @@
 	{
 	  /* On the border on the right side of the window?  Assume that
 	     this area begins at RIGHT_X minus a canonical char width.  */
+	  *x = min (right_x, *x) - left_x;
+	  *y -= top_y;
 	  return ON_VERTICAL_BORDER;
 	}
     }
@@ -2015,7 +2035,7 @@
 	       `obj & 1' means consider only full-width windows.
 	       `obj & 2' means consider also dedicated windows. */
 	    if (((XINT (obj) & 1) && !WINDOW_FULL_WIDTH_P (w))
-		|| (!(XINT (obj) & 2) && EQ (w->dedicated, Qt))
+		|| (!(XINT (obj) & 2) && !NILP (w->dedicated))
 		/* Minibuffer windows are always ignored.  */
 		|| MINI_WINDOW_P (w))
 	      break;
@@ -2070,7 +2090,7 @@
 	  case GET_LARGEST_WINDOW:
 	    { /* nil `obj' means to ignore dedicated windows.  */
 	      /* Ignore dedicated windows and minibuffers.  */
-	      if (MINI_WINDOW_P (w) || (NILP (obj) && EQ (w->dedicated, Qt)))
+	      if (MINI_WINDOW_P (w) || (NILP (obj) && !NILP (w->dedicated)))
 		break;
 
 	      if (NILP (best_window))
@@ -4257,18 +4277,30 @@
 
   while (1)
     {
+      Lisp_Object first_parallel = Qnil;
+
       p = XWINDOW (window);
       parent = p->parent;
 
-      /* Make sure there is a following window.  */
-      if (NILP (parent)
-	  && (horiz_flag ? 1
-	      : NILP (XWINDOW (window)->next)))
+      if (NILP (XWINDOW (window)->next))
 	{
 	  Fset_window_configuration (old_config);
 	  error ("No other window following this one");
 	}
 
+      /* See if this level has windows in parallel in the specified
+	 direction.  If so, set FIRST_PARALLEL to the first one.  */
+      if (horiz_flag)
+	{
+	  if (! NILP (parent) && !NILP (XWINDOW (parent)->vchild))
+	    first_parallel = XWINDOW (parent)->vchild;
+	}
+      else
+	{
+	  if (! NILP (parent) && !NILP (XWINDOW (parent)->hchild))
+	    first_parallel = XWINDOW (parent)->hchild;
+	}
+
       /* Don't make this window too small.  */
       if (XINT (CURSIZE (window)) + delta
 	  < (horiz_flag ? window_min_width : window_min_height))
@@ -4286,12 +4318,11 @@
 	       XINT (CURSIZE (window)) + delta);
 
       /* If this window has following siblings in the desired dimension,
-	 make them smaller.
+	 make them smaller, and exit the loop.
+
 	 (If we reach the top of the tree and can never do this,
 	 we will fail and report an error, above.)  */
-      if (horiz_flag
-	  ? !NILP (XWINDOW (parent)->hchild)
-	  : !NILP (XWINDOW (parent)->vchild))
+      if (NILP (first_parallel))
 	{
 	  if (!NILP (XWINDOW (window)->next))
 	    {
@@ -4313,9 +4344,7 @@
       else
 	/* Here we have a chain of parallel siblings, in the other dimension.
 	   Change the size of the other siblings.  */
-	for (child = (horiz_flag
-		      ? XWINDOW (parent)->vchild
-		      : XWINDOW (parent)->hchild);
+	for (child = first_parallel;
 	     ! NILP (child);
 	     child = XWINDOW (child)->next)
 	  if (! EQ (child, window))
@@ -4856,7 +4885,7 @@
 	{
 	  if (it.current_y < it.last_visible_y
 	      && (it.current_y + it.max_ascent + it.max_descent
-		  >= it.last_visible_y))
+		  > it.last_visible_y))
 	    {
 	      /* The last line was only partially visible, make it fully
 		 visible.  */
--- a/src/xdisp.c	Wed Apr 12 17:40:36 2006 +0000
+++ b/src/xdisp.c	Wed Apr 19 16:23:46 2006 +0000
@@ -14879,7 +14879,7 @@
 {
   if (glyphs != 1)
     {
-      fprintf (stderr, "Row Start   End Used oEI><\\CTZFesm     X    Y    W    H    V    A    P\n");
+      fprintf (stderr, "Row Start   End Used oE><\\CTZFesm     X    Y    W    H    V    A    P\n");
       fprintf (stderr, "======================================================================\n");
 
       fprintf (stderr, "%3d %5d %5d %4d %1.1d%1.1d%1.1d%1.1d\
@@ -22371,7 +22371,10 @@
     }
 
   if (part == ON_VERTICAL_BORDER)
-    cursor = FRAME_X_OUTPUT (f)->horizontal_drag_cursor;
+    {
+      cursor = FRAME_X_OUTPUT (f)->horizontal_drag_cursor;
+      help_echo_string = make_string ("drag-mouse-1: resize", 20);
+    }
   else if (part == ON_LEFT_FRINGE || part == ON_RIGHT_FRINGE
 	   || part == ON_SCROLL_BAR)
     cursor = FRAME_X_OUTPUT (f)->nontext_cursor;
--- a/src/xfaces.c	Wed Apr 12 17:40:36 2006 +0000
+++ b/src/xfaces.c	Wed Apr 19 16:23:46 2006 +0000
@@ -4991,10 +4991,12 @@
   gvec = XVECTOR (global_lface)->contents;
   for (i = 1; i < LFACE_VECTOR_SIZE; ++i)
     if (! UNSPECIFIEDP (gvec[i]))
-      if (IGNORE_DEFFACE_P (gvec[i]))
-	lvec[i] = Qunspecified;
-      else
-	lvec[i] = gvec[i];
+      {
+	if (IGNORE_DEFFACE_P (gvec[i]))
+	  lvec[i] = Qunspecified;
+	else
+	  lvec[i] = gvec[i];
+      }
 
   return Qnil;
 }
@@ -6814,20 +6816,22 @@
 
 #ifdef MAC_OS
   if (nfonts == 0 && STRINGP (try_family) && STRINGP (registry))
-    if (xstricmp (SDATA (registry), "mac-roman") == 0)
-      /* When realizing the default face and a font spec does not
-	 matched exactly, Emacs looks for ones with the same registry
-	 as the default font.  On the Mac, this is mac-roman, which
-	 does not work if the family is -etl-fixed, e.g.  The
-	 following widens the choices and fixes that problem.  */
-      nfonts = try_alternative_families (f, try_family, Qnil, fonts);
-    else if (SBYTES (try_family) > 0
-	     && SREF (try_family, SBYTES (try_family) - 1) != '*')
-      /* Some Central European/Cyrillic font family names have the
-	 Roman counterpart name as their prefix.  */
-      nfonts = try_alternative_families (f, concat2 (try_family,
-						     build_string ("*")),
-					 registry, fonts);
+    {
+      if (xstricmp (SDATA (registry), "mac-roman") == 0)
+	/* When realizing the default face and a font spec does not
+	   matched exactly, Emacs looks for ones with the same registry
+	   as the default font.  On the Mac, this is mac-roman, which
+	   does not work if the family is -etl-fixed, e.g.  The
+	   following widens the choices and fixes that problem.  */
+	nfonts = try_alternative_families (f, try_family, Qnil, fonts);
+      else if (SBYTES (try_family) > 0
+	       && SREF (try_family, SBYTES (try_family) - 1) != '*')
+	/* Some Central European/Cyrillic font family names have the
+	   Roman counterpart name as their prefix.  */
+	nfonts = try_alternative_families (f, concat2 (try_family,
+						       build_string ("*")),
+					   registry, fonts);
+    }
 #endif
 
   if (EQ (try_family, family))
--- a/src/xmenu.c	Wed Apr 12 17:40:36 2006 +0000
+++ b/src/xmenu.c	Wed Apr 19 16:23:46 2006 +0000
@@ -266,14 +266,15 @@
 static void
 init_menu_items ()
 {
+  if (!NILP (menu_items_inuse))
+    error ("Trying to use a menu from within a menu-entry");
+
   if (NILP (menu_items))
     {
       menu_items_allocated = 60;
       menu_items = Fmake_vector (make_number (menu_items_allocated), Qnil);
     }
 
-  if (!NILP (menu_items_inuse))
-    error ("Trying to use a menu from within a menu-entry");
   menu_items_inuse = Qt;
   menu_items_used = 0;
   menu_items_n_panes = 0;
@@ -310,6 +311,39 @@
   xassert (NILP (menu_items_inuse));
 }
 
+/* This undoes save_menu_items, and it is called by the specpdl unwind
+   mechanism.  */
+
+static Lisp_Object
+restore_menu_items (saved)
+     Lisp_Object saved;
+{
+  menu_items = XCAR (saved);
+  menu_items_inuse = (! NILP (menu_items) ? Qt : Qnil);
+  menu_items_allocated = (VECTORP (menu_items) ? ASIZE (menu_items) : 0);
+  saved = XCDR (saved);
+  menu_items_used = XINT (XCAR (saved));
+  saved = XCDR (saved);
+  menu_items_n_panes = XINT (XCAR (saved));
+  saved = XCDR (saved);  
+  menu_items_submenu_depth = XINT (XCAR (saved));
+}
+
+/* Push the whole state of menu_items processing onto the specpdl.
+   It will be restored when the specpdl is unwound.  */
+
+static void
+save_menu_items ()
+{
+  Lisp_Object saved = list4 (!NILP (menu_items_inuse) ? menu_items : Qnil,
+			     make_number (menu_items_used),
+			     make_number (menu_items_n_panes),
+			     make_number (menu_items_submenu_depth));
+  record_unwind_protect (restore_menu_items, saved);
+  menu_items_inuse = Qnil;
+  menu_items = Qnil;
+}
+
 /* Make the menu_items vector twice as large.  */
 
 static void
@@ -320,6 +354,7 @@
   old = menu_items;
 
   menu_items_allocated *= 2;
+
   menu_items = Fmake_vector (make_number (menu_items_allocated), Qnil);
   bcopy (XVECTOR (old)->contents, XVECTOR (menu_items)->contents,
 	 old_size * sizeof (Lisp_Object));
@@ -1740,6 +1775,7 @@
   int i;
   int submenu_depth = 0;
   widget_value **submenu_stack;
+  int panes_seen = 0;
 
   submenu_stack
     = (widget_value **) alloca (menu_items_used * sizeof (widget_value *));
@@ -1786,6 +1822,8 @@
 	  Lisp_Object pane_name, prefix;
 	  char *pane_string;
 
+	  panes_seen++;
+
 	  pane_name = XVECTOR (menu_items)->contents[i + MENU_ITEMS_PANE_NAME];
 	  prefix = XVECTOR (menu_items)->contents[i + MENU_ITEMS_PANE_PREFIX];
 
@@ -1833,6 +1871,10 @@
 	  Lisp_Object item_name, enable, descrip, def, type, selected;
 	  Lisp_Object help;
 
+	  /* All items should be contained in panes.  */
+	  if (panes_seen == 0)
+	    abort ();
+
 	  item_name = AREF (menu_items, i + MENU_ITEMS_ITEM_NAME);
 	  enable = AREF (menu_items, i + MENU_ITEMS_ITEM_ENABLE);
 	  descrip = AREF (menu_items, i + MENU_ITEMS_ITEM_EQUIV_KEY);
@@ -2067,7 +2109,6 @@
       specbind (Qdebug_on_next_call, Qnil);
 
       record_unwind_save_match_data ();
-      record_unwind_protect (unuse_menu_items, Qnil);
       if (NILP (Voverriding_local_map_menu_flag))
 	{
 	  specbind (Qoverriding_terminal_local_map, Qnil);
@@ -2095,6 +2136,8 @@
 
       /* Fill in menu_items with the current menu bar contents.
 	 This can evaluate Lisp code.  */
+      save_menu_items ();
+
       menu_items = f->menu_bar_vector;
       menu_items_allocated = VECTORP (menu_items) ? ASIZE (menu_items) : 0;
       submenu_start = (int *) alloca (XVECTOR (items)->size * sizeof (int *));
@@ -2154,23 +2197,33 @@
 	}
 
       set_buffer_internal_1 (prev);
-      unbind_to (specpdl_count, Qnil);
 
       /* If there has been no change in the Lisp-level contents
 	 of the menu bar, skip redisplaying it.  Just exit.  */
 
+      /* Compare the new menu items with the ones computed last time.  */
       for (i = 0; i < previous_menu_items_used; i++)
 	if (menu_items_used == i
 	    || (!EQ (previous_items[i], XVECTOR (menu_items)->contents[i])))
 	  break;
       if (i == menu_items_used && i == previous_menu_items_used && i != 0)
 	{
+	  /* The menu items have not changed.  Don't bother updating
+	     the menus in any form, since it would be a no-op.  */
 	  free_menubar_widget_value_tree (first_wv);
 	  discard_menu_items ();
-
+	  unbind_to (specpdl_count, Qnil);
 	  return;
 	}
 
+      /* The menu items are different, so store them in the frame.  */
+      f->menu_bar_vector = menu_items;
+      f->menu_bar_items_used = menu_items_used;
+
+      /* This calls restore_menu_items to restore menu_items, etc.,
+	 as they were outside.  */
+      unbind_to (specpdl_count, Qnil);
+
       /* Now GC cannot happen during the lifetime of the widget_value,
 	 so it's safe to store data from a Lisp_String.  */
       wv = first_wv->contents;
@@ -2185,9 +2238,6 @@
           wv = wv->next;
 	}
 
-      f->menu_bar_vector = menu_items;
-      f->menu_bar_items_used = menu_items_used;
-      discard_menu_items ();
     }
   else
     {