changeset 90386:2ecafc6d5db7

Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-58 Merge from emacs--devo--0 Patches applied: * emacs--devo--0 (patch 239-258) - Update from CVS - (Ffield_beginning, find_field): Undo change of 2006-04-23. - Rcirc patch from Ryan Yeske - Merge from gnus--rel--5.10 - Clean up lisp/gnus/ChangeLog a bit * gnus--rel--5.10 (patch 91-98) - Merge from emacs--devo--0 - Update from CVS
author Miles Bader <miles@gnu.org>
date Tue, 02 May 2006 05:51:52 +0000
parents 72dea2ff0142 (current diff) 24d59f7263b8 (diff)
children 0aa60bfbc7ce
files etc/ChangeLog etc/MH-E-NEWS etc/NEWS lib-src/ChangeLog lib-src/etags.c lib-src/fakemail.c lib-src/movemail.c lib-src/sorted-doc.c lib-src/yow.c lisp/ChangeLog lisp/abbrev.el lisp/add-log.el lisp/allout.el lisp/bindings.el lisp/calc/calc-embed.el lisp/calendar/cal-menu.el lisp/calendar/cal-tex.el lisp/calendar/diary-lib.el lisp/comint.el lisp/cus-edit.el lisp/cvs-status.el lisp/diff-mode.el lisp/emacs-lisp/warnings.el lisp/faces.el lisp/files.el lisp/follow.el lisp/gnus/ChangeLog lisp/gnus/message.el lisp/gnus/mm-decode.el lisp/gnus/mm-uu.el lisp/gnus/mml.el lisp/gnus/nnweb.el lisp/help-fns.el lisp/help-mode.el lisp/image.el lisp/international/mule.el lisp/log-edit.el lisp/log-view.el lisp/mh-e/ChangeLog lisp/mh-e/mh-e.el lisp/net/rcirc.el lisp/net/tramp.el lisp/pcvs-defs.el lisp/pcvs-info.el lisp/pcvs-parse.el lisp/pcvs-util.el lisp/progmodes/antlr-mode.el lisp/progmodes/asm-mode.el lisp/progmodes/grep.el lisp/progmodes/gud.el lisp/progmodes/python.el lisp/reveal.el lisp/simple.el lisp/smerge-mode.el lisp/startup.el lisp/subr.el lisp/term/mac-win.el lisp/textmodes/bibtex.el lisp/textmodes/fill.el lisp/textmodes/org.el lisp/textmodes/paragraphs.el lisp/textmodes/reftex-vars.el lisp/time-stamp.el lispref/ChangeLog lispref/intro.texi lispref/modes.texi lispref/objects.texi lispref/syntax.texi lispref/variables.texi man/ChangeLog man/building.texi man/calendar.texi man/custom.texi man/emacs.texi man/macos.texi man/mh-e.texi man/misc.texi man/msdog.texi man/xresources.texi src/.gdbinit src/ChangeLog src/dispextern.h src/dispnew.c src/editfns.c src/frame.c src/image.c src/keymap.c src/mac.c src/macfns.c src/macgui.h src/macmenu.c src/macterm.c src/macterm.h src/process.h src/puresize.h src/s/ms-w32.h src/syntax.c src/unexmacosx.c src/w32fns.c src/w32term.c src/window.c src/xdisp.c src/xmenu.c
diffstat 119 files changed, 4122 insertions(+), 1939 deletions(-) [+]
line wrap: on
line diff
--- a/etc/ChangeLog	Fri Apr 21 05:39:14 2006 +0000
+++ b/etc/ChangeLog	Tue May 02 05:51:52 2006 +0000
@@ -1,3 +1,15 @@
+2006-04-28  Bill Wohler  <wohler@newt.com>
+
+	Release MH-E version 7.95.
+
+	* NEWS, MH-E-NEWS: Update for MH-E release 7.95.
+
+2006-04-21  Bill Wohler  <wohler@newt.com>
+
+	Release MH-E version 7.94.
+
+	* NEWS, MH-E-NEWS: Update for MH-E release 7.94.
+
 2006-04-21  Nick Roberts  <nickrob@snap.net.nz>
 
 	* NEWS: Mention t-mouse.el.  Touch up description of gdb-ui.el.
--- a/etc/MH-E-NEWS	Fri Apr 21 05:39:14 2006 +0000
+++ b/etc/MH-E-NEWS	Tue May 02 05:51:52 2006 +0000
@@ -6,6 +6,103 @@
 are permitted in any medium without royalty provided the copyright
 notice and this notice are preserved.
 
+* Changes in MH-E 7.95
+
+Version 7.95, the second 8.0 release candidate, fixes a single bug.
+It would be good to check this version ASAP since the Emacs pretest is
+coming in days: if no showstopper problems are found in this version
+it will be promoted to 8.0 before the pretest. Thanks for your help!
+
+** Bug Fixes in MH-E 7.95
+
+*** Folder Completion Fails in fcc: Field
+
+This has been fixed (closes SF #1476270).
+
+* Changes in MH-E 7.94
+
+Version 7.94, the first 8.0 release candidate, fixes a bunch of bugs,
+incorporates new features introduced in Emacs 22.1, improves folder
+completion, and spruces up the tool bar.
+
+** New Features in MH-E 7.94
+
+*** Add :package-version Keyword to Options
+
+This `defcustom', `defgroup', and `defface' keyword was introduced in
+Emacs 22.1. MH-E has been extended to take advantage of it. With this
+keyword, you can now use `M-x customize-changed-options' to see what
+options in MH-E have changed between versions of Emacs. In a future
+version of Emacs, you'll be able to see changes between MH-E versions
+as well (closes SF #1452724).
+
+** Bug Fixes in MH-E 7.94
+
+*** mhparam -components Fails on mailutils
+
+This error prevented MH-E from loading when using GNU mailutils. GNU
+mailutils drops the `s' in this argument, so we did too since
+-component still works in nmh and MH (closes SF #1446985).
+
+*** "/ s" Still Has Problems With []'d Mail
+
+On XEmacs, subjects that had special characters would prevent `/ s'
+from narrowing to the given subject. These characters are now quoted
+correctly in XEmacs (closes SF #1447598).
+
+*** Incorrect Example in mh-folder-list Docstring
+
+This has been fixed (closes SF #1448498).
+
+*** Variable mh-send-args Is a String, Not a List
+
+This was causing errors when sending under GNU mailutils. The internal
+variable `mh-send-args' is now a list which fixes the problem (closes
+SF #1448604).
+
+*** Update Icons
+
+Most of the tool bar icons have been replaced by GTK or GNOME 2 icons
+(closes SF #1452715).
+
+*** Can't customize tool bar for current session
+
+If you customized `mh-tool-bar-folder-buttons' or
+`mh-tool-bar-letter-buttons', and clicked Set for Current Session, the
+tool bar was not updated. This has been fixed (closes SF #1452718).
+
+*** Strip Build Number From emacs-version in X-Mailer
+
+This has been done (closes SF #1466481).
+
+*** mh-folder-completion-function Problems
+
+One could not longer browse folders outside of the standard MH Mail
+directory. This has been fixed. As a beneficial side-effect, you can
+once again use SPC to complete folders (closes SF #1470518).
+
+*** Rename Function and Variable Definers
+
+If you had ever shown help for an MH-E symbol that was both a function
+or variable, you might have found that the hyperlink to the file
+brought you to the wrong definition. This has been fixed by renaming
+the macros `mh-defgroup', `mh-defcustom', `mh-defface',
+`mh-defun-compat', and `mh-defmacro-compat' to `defgroup-mh',
+`defcustom-mh', `defface-mh', `defun-mh', `defmacro-mh' respectively
+(closes SF #1472029).
+
+*** mh-insert-letter Uses Wrong Default
+
+If you had used `C-c TAB' (`mh-insert-letter') to insert a letter into
+your draft, specified a different folder, and chose the default
+message number, you got the wrong message. This has been fixed (closes
+SF #1473729).
+
+*** "echo -e" in Makefile Causes Solaris 10 Problem
+
+This construct has been replaced with printf, which is reputed to be
+more portable (closes SF #1467222, #1473908).
+
 * Changes in MH-E 7.93
 
 Version 7.93, the fourth 8.0 beta release, fixes a handful of bugs in
--- a/etc/NEWS	Fri Apr 21 05:39:14 2006 +0000
+++ b/etc/NEWS	Tue May 02 05:51:52 2006 +0000
@@ -1479,20 +1479,35 @@
 There's a new separate package grep.el, with its own submenu and
 customization group.
 
----
-*** M-x grep provides highlighting support.
++++
+*** `grep-find' is now also available under the name `find-grep' where
+people knowing `find-grep-dired' would probably expect it.
+
++++
+*** New commands `lgrep' (local grep) and `rgrep' (recursive grep) are
+more user-friendly versions of `grep' and `grep-find', which prompt
+separately for the regular expression to match, the files to search,
+and the base directory for the search (rgrep only).  Case sensitivitivy
+of the search is controlled by the current value of `case-fold-search'.
+
+These commands build the shell commands based on the new variables
+`grep-template' (lgrep) and `grep-find-template' (rgrep).
+
+The files to search can use aliases defined in `grep-files-aliases'.
+
+Subdirectories listed in `grep-find-ignored-directories' such as those
+typically used by various version control systems, like CVS and arch,
+are automatically skipped by `rgrep'.
+
+---
+*** The grep commands provide highlighting support.
 
 Hits are fontified in green, and hits in binary files in orange.  Grep buffers
 can be saved and automatically revisited.
 
-+++
-*** `grep-find' is now also available under the name `find-grep' where
-people knowing `find-grep-dired' would probably expect it.
-
----
-*** The new variables `grep-window-height', `grep-auto-highlight', and
-`grep-scroll-output' override the corresponding compilation mode
-settings, for grep commands only.
+---
+*** The new variables `grep-window-height' and `grep-scroll-output' override
+the corresponding compilation mode settings, for grep commands only.
 
 +++
 *** New option `grep-highlight-matches' highlights matches in *grep*
@@ -2027,6 +2042,21 @@
 ** M-x diff uses Diff mode instead of Compilation mode.
 
 +++
+** Diff mode key bindings changed.
+
+These are the new bindings:
+
+C-c C-e   diff-ediff-patch  (old M-A)
+C-c C-n   diff-restrict-view   (old M-r)
+C-c C-r   diff-reverse-direction  (old M-R)
+C-c C-u   diff-context->unified   (old M-U)
+C-c C-w   diff-refine-hunk  (old C-c C-r)
+
+To convert unified to context format, use C-u C-c C-u.
+In addition, C-c C-u now operates on the region
+in Transient Mark mode when the mark is active.
+
++++
 ** You can now customize `fill-nobreak-predicate' to control where
 filling can break lines.  The value is now normally a list of
 functions, but it can also be a single function, for compatibility.
@@ -3100,7 +3130,7 @@
 ---
 ** MH-E changes.
 
-Upgraded to MH-E version 7.93. There have been major changes since
+Upgraded to MH-E version 7.95. There have been major changes since
 version 5.0.2; see MH-E-NEWS for details.
 
 ** Calendar changes:
@@ -3705,9 +3735,10 @@
 If it is non-nil, the function lists only faces matching this regexp.
 
 +++
-*** New function `string-or-null-p'.
-
-Return t if OBJECT is a string or nil.  Otherwise, return nil.
+*** New functions `string-or-null-p' and `booleanp'.
+
+`string-or-null-p' returns non-nil iff OBJECT is a string or nil.
+`booleanp' returns non-nil iff OBJECT is a t or nil.
 
 ** Lisp code indentation features:
 
@@ -5952,6 +5983,8 @@
 - Mouse-2 on the read-only or modified status in the mode line (`%' or
 `*') toggles the status.
 
+- Mouse-3 on the major mode name displays a major mode menu.
+
 - Mouse-3 on the mode name displays a minor-mode menu.
 
 ** Hourglass pointer
--- a/etc/orgcard.tex	Fri Apr 21 05:39:14 2006 +0000
+++ b/etc/orgcard.tex	Tue May 02 05:51:52 2006 +0000
@@ -1,5 +1,5 @@
 % Reference Card for Org Mode
-\def\orgversionnumber{4.25}
+\def\orgversionnumber{4.26}
 \def\year{2006}
 %
 %**start of header
--- a/lib-src/ChangeLog	Fri Apr 21 05:39:14 2006 +0000
+++ b/lib-src/ChangeLog	Tue May 02 05:51:52 2006 +0000
@@ -1,3 +1,17 @@
+2006-04-29  Dan Nicolaescu  <dann@ics.uci.edu>
+
+	* sorted-doc.c (main): Initialize docs to NULL.
+
+	* yow.c (yow): Free buf.
+
+	* etags.c: Delete c-indentation-style local variable.
+
+2006-04-29  Richard Stallman  <rms@gnu.org>
+
+	* movemail.c (main): Check for negative value from `read'.
+
+	* fakemail.c (read_header): Give fatal error if input has no header.
+
 2006-04-02  Paul Eggert  <eggert@cs.ucla.edu>
 
 	* b2m.c (main): Don't include <limits.h>.
--- a/lib-src/etags.c	Fri Apr 21 05:39:14 2006 +0000
+++ b/lib-src/etags.c	Tue May 02 05:51:52 2006 +0000
@@ -6887,7 +6887,6 @@
 
 /*
  * Local Variables:
- * c-indentation-style: gnu
  * indent-tabs-mode: t
  * tab-width: 8
  * fill-column: 79
--- a/lib-src/fakemail.c	Fri Apr 21 05:39:14 2006 +0000
+++ b/lib-src/fakemail.c	Tue May 02 05:51:52 2006 +0000
@@ -694,6 +694,8 @@
 
     } while (true);
 
+  if (! the_header)
+    fatal ("input message has no header");
   return the_header->next;
 }
 
--- a/lib-src/movemail.c	Fri Apr 21 05:39:14 2006 +0000
+++ b/lib-src/movemail.c	Tue May 02 05:51:52 2006 +0000
@@ -466,6 +466,8 @@
 	while (1)
 	  {
 	    nread = read (indesc, buf, sizeof buf);
+	    if (nread < 0)
+	      pfatal_with_name (inname);
 	    if (nread != write (outdesc, buf, nread))
 	      {
 		int saved_errno = errno;
--- a/lib-src/sorted-doc.c	Fri Apr 21 05:39:14 2006 +0000
+++ b/lib-src/sorted-doc.c	Tue May 02 05:51:52 2006 +0000
@@ -131,7 +131,7 @@
   register enum state state = WAITING; /* state at start */
   int cnt = 0;			/* number of DOCSTRs read */
 
-  DOCSTR *docs;			/* chain of allocated DOCSTRS */
+  DOCSTR *docs = NULL;          /* chain of allocated DOCSTRS */
   char buf[512];		/* line buffer */
 
   while (1)			/* process one char at a time */
--- a/lib-src/yow.c	Fri Apr 21 05:39:14 2006 +0000
+++ b/lib-src/yow.c	Tue May 02 05:51:52 2006 +0000
@@ -176,6 +176,7 @@
   }
   buf[i++] = 0;
   printf("%s\n", buf);
+  free (buf);
 }
 
 /* arch-tag: e40fc0df-bafb-4001-af24-5c883d1c685e
--- a/lisp/ChangeLog	Fri Apr 21 05:39:14 2006 +0000
+++ b/lisp/ChangeLog	Tue May 02 05:51:52 2006 +0000
@@ -1,6 +1,303 @@
+2006-05-01  Richard Stallman  <rms@gnu.org>
+
+	* diff-mode.el (diff-mode-shared-map): Don't bind M-W, M-U, M-C,
+	M-r, M-R, M-A, M-SPC or M-DEL.
+	(diff-mode-map): diff-refine-hunk now on C-c C-w
+	(diff-mode-map): Bind C-c C-e, C-c C-n, C-c C-r, C-c C-u.
+
+	* help-mode.el (help-mode): view-exit-action calls delete-window
+	only when it is safe and possible.
+
+	* simple.el (undo-outer-limit-truncate): Put quotes around buffer name
+	in messages.
+
+	* emacs-lisp/warnings.el (display-warning, lwarn): Doc fixes.
+
+	* tool-bar.el (tool-bar-setup): Put Help and Preferences items
+	in the default tool-bar-map.
+
+2006-05-01  Michael Albinus  <michael.albinus@gmx.de>
+
+	* net/tramp.el (tramp-completion-file-name-handler-alist)
+	(tramp-run-real-handler, tramp-completion-run-real-handler)
+	(tramp-completion-handle-file-name-all-completions)
+	(tramp-completion-handle-file-name-completion): Autoload them.
+	(tramp-completion-handle-file-exists-p)
+	(tramp-completion-handle-file-name-directory)
+	(tramp-completion-handle-file-name-nondirectory)
+	(tramp-completion-handle-expand-file-name): Remove them.
+	(tramp-handle-file-name-directory): Return the real directory
+	name.  Returning "/" only doesn't need to be necessary any longer.
+	(tramp-file-name-handler): Make special attention when in hostname
+	completion mode.
+	(tramp-completion-file-name-handler): Revert patch from
+	2006-04-28.
+	(tramp-register-file-name-handlers): Register
+	`tramp-completion-file-name-handler' only when
+	`partial-completion-mode is enabled.
+	(tramp-completion-handle-file-name-all-completions): Delete
+	directory part from results.
+	(tramp-get-completion-methods, tramp-get-completion-user-host):
+	Discard deleting "/", it doesn't work after the change of
+	`tramp-handle-file-name-directory' above.
+
+2006-05-01  Kim F. Storm  <storm@cua.dk>
+
+	* progmodes/grep.el (grep-expand-template): Use save-match-data.
+
+2006-05-01  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+	* term/mac-win.el (mac-ae-open-documents, mac-drag-n-drop): Use
+	select-frame-set-input-focus instead of raise-frame.
+	(global-map): Bind M-drag-n-drop to mac-drag-n-drop.
+
+2006-05-01  Nick Roberts  <nickrob@snap.net.nz>
+
+	* progmodes/gud.el (gud-def): Add %c case.
+	(gud-speedbar-buttons): Don'bind case-fold-search unnecessarily.
+	(gud-format-command): Make match case sensitive.  Match on %F.
+
+2006-04-30  Glenn Morris  <rgm@gnu.org>
+
+	* calendar/cal-tex.el (cal-tex-preamble-extra): New variable.
+	(cal-tex-preamble): Use cal-tex-preamble-extra.
+	(cal-tex-list-diary-entries): Refer to `diary-list-entries' rather
+	than alias `list-diary-entries'.
+
+2006-04-29  Dan Nicolaescu  <dann@ics.uci.edu>
+
+	* help-fns.el (describe-variable): Add info about safe local variables.
+
+2006-04-29  Richard Stallman  <rms@gnu.org>
+
+	* bindings.el (mode-line-format): help-echo doc fixes.
+
+	* net/tramp.el (tramp-file-name-handler-alist): Delete
+	expand-file-name and other operations that can cause spurious loading.
+
+2006-04-29  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* files.el (safe-local-variable-p): Remove support for the special
+	value t.
+
+	* textmodes/paragraphs.el (sentence-end-without-space):
+	Fix safety predicate.
+	(sentence-end-double-space, sentence-end-without-period)
+	(paragraph-ignore-fill-prefix):
+	* textmodes/fill.el (colon-double-space):
+	* abbrev.el (abbrev-mode): Tighten the safety predicate.
+
+	* subr.el (booleanp): New fun.
+
+	* textmodes/reftex-vars.el (reftex-guess-label-type):
+	Tighten the safety predicate.
+
+2006-04-28  Kim F. Storm  <storm@cua.dk>
+
+	* progmodes/grep.el (defgroup grep): Doc fix.
+	(grep-auto-highlight): Remove.
+	(grep-template): New defcustom.
+	(grep-find-template): Rename from grep-tree-template.
+	(grep-files-aliases): Rename from grep-tree-files-aliases.
+	Remove "all" alias, add "l" alias.
+	(grep-tree-ignore-case, grep-tree-ignore-CVS-directories): Remove.
+	(grep-find-ignored-directories): New defcustom to replace
+	grep-tree-ignore-CVS-directories, to facilitate ignoring
+	subdirectories for multiple version control systems.
+	(grep-mode-map): Add Recursive grep item to GREP menu.
+	(grep-regexp-history, grep-files-history): New defvars.
+	(grep-probe): New helper function.
+	(grep-compute-defaults): Use it to simplify code.
+	Adapt to name changes.
+	Use `.' as base in grep-find-template rather than <D>.
+	(grep): Remove superfluous highlight-regexp arg.  Fix doc.
+	Call grep-compute-defaults unconditionally.
+	(grep-expand-keywords): New defconst.
+	(grep-expand-template): Rename from grep-expand-command-macros.
+	Simplify via grep-expand-keywords.  Look at case-fold-search instead
+	of grep-tree-ignore-case to add -i option.
+	Bind case-fold-search to nil while matching keywords.
+	(grep-tree-last-regexp, grep-tree-last-files): Remove.
+	(grep-read-regexp, grep-read-files): New helper functions.
+	(rgrep): Rename from grep-tree.  Rework to use proper histories.
+	Adapt to changes in defcustoms and functions above.
+	(lgrep): New command, as grep, but using same interactive api as rgrep.
+
+2006-04-28  Michael Albinus  <michael.albinus@gmx.de>
+
+	* net/tramp.el (tramp-completion-file-name-handler):
+	Disable Tramp's functionality while loading Tramp itself.
+	(tramp-register-file-name-handlers): That's a defsubst now.
+	Code from `tramp-repair-jka-compr' moved here.  Apply it via
+	`after-init-hook'.
+	(tramp-repair-jka-compr): Remove.
+
+2006-04-27  Jay Belanger  <belanger@truman.edu>
+
+	* calc-embed.el (calc-embedded-make-info): Use `math-read-expr' to
+	read expression when `math-read-big-expr' doesn't work.
+
+2006-04-27  Reiner Steib  <Reiner.Steib@gmx.de>
+
+	* startup.el (command-line-1): Display warning when
+	pure-space-overflow is non-nil.
+
+2006-04-26  Roland Winkler  <Roland.Winkler@physik.uni-erlangen.de>
+
+	* textmodes/bibtex.el (bibtex-user-optional-fields): Mark as
+	risky.
+
+2006-04-26  Roland Winkler  <Roland.Winkler@physik.uni-erlangen.de>
+
+	* textmodes/bibtex.el (bibtex-url): New optional arg no-browse.
+	Return the URL or nil if none can be generated.
+
+2006-04-27  Nick Roberts  <nickrob@snap.net.nz>
+
+	* progmodes/gud.el (gud-comint-buffer): Move forward to stop
+	byte compiler warnings.
+	(gud-basic-call, gud-find-expr): Let user select an expression
+	for printing.  Print expression as well as value in GUD buffer.
+
+2006-04-17  Ken Manheimer  <ken.manheimer@gmail.com>
+
+	* allout.el: Remove local autoload declaration for
+	pgg-gpg-symmetric-key-p, since that's now done in pgg-gpg.el.
+	(allout-show-bodies, allout-header-prefix, allout-primary-bullet)
+	(allout-plain-bullets-string, allout-distinctive-bullets-string)
+	(allout-use-mode-specific-leader, allout-old-style-prefixes)
+	(allout-stylish-prefixes, allout-numbered-bullet)
+	(allout-file-xref-bullet, allout-presentation-padding)
+	(allout-use-hanging-indents, allout-reindent-bodies): Mark as
+	safe-local-variable with suitable value spec, and add autoload
+	cookie for loaddefs inclusion.  We now use an explicit spec everywhere.
+	(move-beginning-of-line, move-end-of-line): Repair so these compat
+	functions now actually resituate the point, when appropriate.
+
+2006-04-26  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* progmodes/cc-subword.el (c-subword-mode-map): Use command remapping.
+
+	* add-log.el (add-log-iso8601-time-zone): Make parameter optional.
+	(add-log-iso8601-time-string): Fix call to format-time-string.
+
+2006-04-26  Kim F. Storm  <storm@cua.dk>
+
+	* subr.el (posn-string, posn-image, posn-object): Doc fix.
+
+2006-04-26  Masatake YAMATO  <jet@gyve.org>
+
+	* progmodes/asm-mode.el (asm-mode, asm-mode-syntax-table):
+	Add support for "//" style comments.  Remove `b' flag
+	from ?* in `asm-mode-syntax-table'.
+
+2006-04-26  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* follow.el: Use (featurep 'xemacs) everywhere.
+	(follow-mode): Use define-minor-mode.
+	(follow-mode-map): Move initialization into the declaration.
+	Use command remapping.
+	(follow-emacs-version-xemacs-p): Remove.
+	(follow-submit-feedback): Remove.
+
+	* allout.el (allout-layout, allout-passphrase-verifier-string)
+	(allout-passphrase-hint-string): Tighten up a bit the safety predicate.
+
+	* textmodes/reftex-vars.el (reftex-vref-is-default)
+	(reftex-fref-is-default, reftex-guess-label-type):
+	Tighten up a bit the safety predicate.
+
+	* textmodes/paragraphs.el (sentence-end-double-space)
+	(sentence-end-without-period, sentence-end-without-space)
+	(page-delimiter, paragraph-ignore-fill-prefix):
+	Tighten up a bit the safety predicate.
+
+	* textmodes/fill.el (colon-double-space): Tighten up the safety pred.
+
+	* progmodes/python.el (python-continuation-line-p)
+	(python-beginning-of-statement): syntax-ppss may return
+	a negative depth.
+	(python-mode): Don't forcefully enable font-lock.
+
+	* time-stamp.el (time-stamp-start, time-stamp-end)
+	(time-stamp-inserts-lines): Tighten up a bit the safety predicate.
+
+	* add-log.el: Remove spurious * in docstrings.
+	(add-log-time-zone-rule): Rename from change-log-time-zone-rule.
+	(add-change-log-entry): Use it here, since it's not specific
+	to iso8601.
+	(add-log-iso8601-time-string): Don't use it here any more.
+	(change-log-indent-text, change-log-indent): Rename from add-log-*.
+
+	* abbrev.el (abbrev-mode): Tighten up a bit the safety predicate.
+
+2006-04-25  Ryan Yeske  <rcyeske@gmail.com>
+
+	* net/rcirc.el (rcirc-print): Revert last change with ignored nicks.
+	(rcirc-toggle-low-priority): Doc fix.
+	(rcirc-handler-NOTICE): Remove beginning of line anchor in
+	ChanServ regexp.
+	(rcirc-startup-channels-alist): Connect to #rcirc by default, not
+	#emacs.
+	(rcirc-bright-nick-regexp, rcirc-dim-nick-regexp): Add variables.
+	(rcirc-decode-coding-system): Use utf-8 as the default.
+	(rcirc-multiline-minor-mode): Set the fill-column.
+	(rcirc-format-response-string): Display bright and dim nicks.
+	(rcirc-browse-url): Update interactive spec to fill ARG.
+	(rcirc-bright-nick, rcirc-dim-nick): Add faces.
+	(rcirc-print): Ignore dim-nick messages wrt modeline-activity.
+
+2006-04-24  J.D. Smith  <jdsmith@as.arizona.edu>
+
+	* textmodes/bibtex.el (bibtex-find-entry): Don't demand matching
+	case for @Article, etc.
+
+2006-04-23  Michael Albinus  <michael.albinus@gmx.de>
+
+	* net/tramp.el (tramp-register-file-name-handlers): New defun.
+	Added with autoload cookie.
+	(tramp-unload-file-name-handlers): Rename from
+	`tramp-unload-file-name-handler-alist'.
+
+2006-04-23  Romain Francoise  <romain@orebokech.com>
+
+	* comint.el (comint-match-partial-filename): Doc fix.
+
+2006-04-21  Glenn Morris  <rgm@gnu.org>
+
+	* calendar/cal-menu.el (calendar-mode-map): Refer to
+	`diary-view-entries' rather than alias `view-diary-entries'.
+	* calendar/diary-lib.el (view-other-diary-entries): Ditto.
+
+2006-04-21  Luc Teirlinck  <teirllm@auburn.edu>
+
+	* progmodes/antlr-mode.el (antlr-default):
+	* cus-edit.el (custom-documentation):
+	* faces.el (scroll-bar, border, cursor, mouse): Avoid nil spec
+	in defface.
+
+2006-04-21  Kim F. Storm  <storm@cua.dk>
+
+	* image.el (image-type): New defun split out of create-image.
+	(create-image): Use it.
+
+2006-04-21  Carsten Dominik  <dominik@science.uva.nl>
+
+	* textmodes/org.el (org-mode-map): Catch conflict with old allout.el.
+	(org-open-at-point): Remove the "...done" message to keep output
+	in the echo area visible.
+	(org-export-as-xoxo): Fix call to `indent-region'.
+
+2006-04-21  Kevin Ryde  <user42@zip.com.au>
+
+	* international/mule.el (keyboard-coding-system): defcustom
+	info-link fixes: "Specify Coding" has been split, keyboard now in
+	"Terminal Coding", and "Single-Byte Character Support" is now
+	"Unibyte Mode".
+
 2006-04-21  Nick Roberts  <nickrob@snap.net.nz>
 
-	* progmodes/gdb-ui.el (gdb-data-list-register-values-handler): 
+	* progmodes/gdb-ui.el (gdb-data-list-register-values-handler):
 	Use font-lock-warning-face for any errors e.g. no stack.
 	(gdb-stack-list-locals-handler): Display any errors e.g. no stack.
 
@@ -13,26 +310,26 @@
 
 2006-04-20  Carsten Dominik  <dominik@science.uva.nl>
 
-	* textmodes/org.el: (org-deadline-announce): Face removed.
-        (org-level-faces, org-n-levels): Converted to constant.
-        (org-compatible-face): New function.
-        (org-hide, org-level-1, org-level-2, org-level-3, org-level-4)
-        (org-level-5, org-level-6, org-level-7, org-level-8)
-        (org-special-keyword, org-warning, org-headline-done, org-link)
-        (org-date, org-tag, org-todo, org-done, org-table, org-formula)
-        (org-scheduled-today, org-scheduled-previously, org-time-grid):
+	* textmodes/org.el (org-deadline-announce): Face removed.
+	(org-level-faces, org-n-levels): Convert to constant.
+	(org-compatible-face): New function.
+	(org-hide, org-level-1, org-level-2, org-level-3, org-level-4)
+	(org-level-5, org-level-6, org-level-7, org-level-8)
+	(org-special-keyword, org-warning, org-headline-done, org-link)
+	(org-date, org-tag, org-todo, org-done, org-table, org-formula)
+	(org-scheduled-today, org-scheduled-previously, org-time-grid):
 	Face definition revised for better color tty support.
-        (org-bold-re, org-italic-re, org-underline-re): New constants.
-        (org-set-font-lock-defaults): Use the new constants.
-        (org-agenda-highlight-todo): New function.
-        (org-agenda-todo): Fixed bug with point at end of line.
-        (org-agenda-change-all-lines, org-finalize-agenda-entries):
+	(org-bold-re, org-italic-re, org-underline-re): New constants.
+	(org-set-font-lock-defaults): Use the new constants.
+	(org-agenda-highlight-todo): New function.
+	(org-agenda-todo): Fix bug with point at end of line.
+	(org-agenda-change-all-lines, org-finalize-agenda-entries):
 	Fontify TODO keywords.
-        (org-insert-link): Preserve relative path in ../ links.
-        (org-export-as-html): Convert links pointing to .org files into
+	(org-insert-link): Preserve relative path in ../ links.
+	(org-export-as-html): Convert links pointing to .org files into
 	links that will work beteen the exported HTML files.
-        (org-todo-list): Fix bug when arg=0.
-        (org-insert-heading): More fine-tuning.
+	(org-todo-list): Fix bug when arg=0.
+	(org-insert-heading): More fine-tuning.
 
 2006-04-19  Romain Francoise  <romain@orebokech.com>
 
@@ -49,12 +346,11 @@
 	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
+	(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".
+	(comint-restore-input): New function, used by `comint-previous-input'.
 
 2006-04-18  Luc Teirlinck  <teirllm@auburn.edu>
 
@@ -62,8 +358,7 @@
 
 2006-04-18  Dan Nicolaescu  <dann@ics.uci.edu>
 
-	* progmodes/python.el (python-mode): Add support for
-	hs-minor-mode.
+	* progmodes/python.el (python-mode): Add support for hs-minor-mode.
 
 2006-04-19  Reiner Steib  <Reiner.Steib@gmx.de>
 
@@ -141,7 +436,7 @@
 	(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-init-1, gdb-source, gdb-post-prompt)
 	(gdb-assembler-custom, gdb-invalidate-assembler): Use gdb-pc-address.
 	(gdb-frame-handler): Get gdb-frame-address.
 
@@ -222,7 +517,7 @@
 
 2006-04-13  Carsten Dominik  <dominik@science.uva.nl>
 
-	* textmodes/org.el: (org-set-regexps-and-options)
+	* textmodes/org.el (org-set-regexps-and-options)
 	(org-get-current-options): Better names for the startup folding
 	options.
 
@@ -231,7 +526,7 @@
 	* 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)
+2006-04-12  Stuart 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
@@ -245,7 +540,7 @@
 
 2006-04-13  Carsten Dominik  <dominik@science.uva.nl>
 
-	* textmodes/org.el: (org-ctrl-c-ctrl-c): Improve documentation string.
+	* 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.
@@ -2437,7 +2732,7 @@
 	(describe-key-briefly-internal, describe-key-internal):
 	Functions merged back into their callers.
 
-2006-02-13  Martin Rudalics  <rudalics@gmx.at>  (tiny change)
+2006-02-13  Martin Rudalics  <rudalics@gmx.at>
 
 	* info.el (info-xref-visited): Inherit from info-xref too.
 	(Info-set-mode-line): Replace occurrences of `%' by `%%'
@@ -3585,7 +3880,7 @@
 	* add-log.el (add-change-log-entry, change-log-merge):
 	Conditionally use `hard-newline'.
 
-2006-01-13  Martin Rudalics  <rudalics@gmx.at>  (tiny change)
+2006-01-13  Martin Rudalics  <rudalics@gmx.at>
 
 	* wid-edit.el (widget-field-end): If the overlay is no longer
 	associated with a buffer, behave as if the overlay didn't exist.
@@ -4595,7 +4890,7 @@
 	display-multi-frame-p, use selected-frame when menu-updating-frame
 	is nil.
 
-2005-12-20  Davis Herring  <herring@lanl.gov>  (tiny change)
+2005-12-20  Stuart Herring  <herring@lanl.gov>  (tiny change)
 
 	* align.el (align-rules-list): Use [ \t] instead of \s-
 	for column separators in text mode.
@@ -4675,7 +4970,7 @@
 	* emacs-lisp/edebug.el (edebug-safe-prin1-to-string):
 	Capture error from printing circular structures.
 
-2005-12-17  Martin Rudalics  <rudalics@gmx.at>  (tiny change)
+2005-12-17  Martin Rudalics  <rudalics@gmx.at>
 
 	* wid-edit.el (widget-checkbox-action): Clear undo info.
 
@@ -6658,7 +6953,7 @@
 	scrolling the help window.  Doc fix.
 	(help-return-method): Doc fix.
 
-2005-12-03  Martin Rudalics  <rudalics@gmx.at>  (tiny change)
+2005-12-03  Martin Rudalics  <rudalics@gmx.at>
 
 	* emacs-lisp/lisp-mode.el (lisp-imenu-generic-expression): Fix bug
 	whereby names of length one or names starting with a
@@ -7212,7 +7507,7 @@
 
 	* custom.el (defcustom): Update link types in docstring.
 
-2005-11-20  Martin Rudalics  <rudalics@gmx.at>  (tiny change)
+2005-11-20  Martin Rudalics  <rudalics@gmx.at>
 
 	* custom.el (defgroup): Add doc-string-elt info.
 
@@ -7485,7 +7780,7 @@
 
 	* apropos.el (apropos-calc-scores): Use apropos-pattern.
 
-2005-11-16  Martin Rudalics  <rudalics@gmx.at>  (tiny change)
+2005-11-16  Martin Rudalics  <rudalics@gmx.at>
 
 	* wid-edit.el (color): Enclose %t in %{...%}.
 
@@ -14401,7 +14696,7 @@
 	* emulation/edt-mapper.el (edt-save-function-key-map)
 	(EDT-key-name): `defvar' to silence the byte-compiler.
 
-2005-07-02  Martin Rudalics  <rudalics@gmx.at>  (tiny change)
+2005-07-02  Martin Rudalics  <rudalics@gmx.at>
 
 	* font-lock.el (font-lock-regexp-grouping-backslash): Rename from
 	font-lock-regexp-backslash.  Doc fix.
--- a/lisp/ChangeLog.11	Fri Apr 21 05:39:14 2006 +0000
+++ b/lisp/ChangeLog.11	Tue May 02 05:51:52 2006 +0000
@@ -5065,7 +5065,7 @@
 
 	* imenu.el: Several doc fixes: don't say variables are buffer-local.
 
-2004-08-16  Davis Herring  <herring@lanl.gov>
+2004-08-16  Stuart Herring  <herring@lanl.gov>
 
 	* isearch.el (isearch-string, isearch-message-string, isearch-point)
 	(isearch-success, isearch-forward-flag, isearch-other-end)
@@ -5082,7 +5082,7 @@
 	* term/x-win.el (x-selection-value): If utf8 was successful but
 	ctext was not, use utf8 string.
 
-2004-08-14  Davis Herring  <herring@lanl.gov>
+2004-08-14  Stuart Herring  <herring@lanl.gov>
 
 	* isearch.el: Remove accidental changes of March 4.  Fix backing
 	up when a regexp isearch is made more general.  Use symbolic
@@ -11471,7 +11471,7 @@
 
 	* files.el (kill-some-buffers): Doc fix.
 
-2003-12-29  David Herring  <sdh6@ra.msstate.edu>  (tiny change)
+2003-12-29  Stuart Herring  <herring@lanl.gov>  (tiny change)
 
 	* comint.el (comint-watch-for-password-prompt): Pass `string' as
 	arg to send-invisible
--- a/lisp/abbrev.el	Fri Apr 21 05:39:14 2006 +0000
+++ b/lisp/abbrev.el	Tue May 02 05:51:52 2006 +0000
@@ -58,7 +58,7 @@
 to enable or disable Abbrev mode in the current buffer."
   :type 'boolean
   :group 'abbrev-mode)
-;;;###autoload(put 'abbrev-mode 'safe-local-variable t)
+;;;###autoload(put 'abbrev-mode 'safe-local-variable 'booleanp)
 
 
 (defvar edit-abbrevs-map
@@ -363,5 +363,5 @@
 	    (if (or noquery (y-or-n-p (format "Expand `%s'? " string)))
 		(expand-abbrev)))))))
 
-;;; arch-tag: dbd6f3ae-dfe3-40ba-b00f-f9e3ff960df5
+;; arch-tag: dbd6f3ae-dfe3-40ba-b00f-f9e3ff960df5
 ;;; abbrev.el ends here
--- a/lisp/add-log.el	Fri Apr 21 05:39:14 2006 +0000
+++ b/lisp/add-log.el	Tue May 02 05:51:52 2006 +0000
@@ -72,7 +72,7 @@
 
 ;;;###autoload
 (defcustom add-log-mailing-address nil
-  "*Email addresses of user, for inclusion in ChangeLog headers.
+  "Email addresses of user, for inclusion in ChangeLog headers.
 This defaults to the value of `user-mail-address'.  In addition to
 being a simple string, this value can also be a list.  All elements
 will be recognized as referring to the same user; when creating a new
@@ -83,7 +83,7 @@
   :group 'change-log)
 
 (defcustom add-log-time-format 'add-log-iso8601-time-string
-  "*Function that defines the time format.
+  "Function that defines the time format.
 For example, `add-log-iso8601-time-string', which gives the
 date in international ISO 8601 format,
 and `current-time-string' are two valid values."
@@ -95,7 +95,7 @@
   :group 'change-log)
 
 (defcustom add-log-keep-changes-together nil
-  "*If non-nil, normally keep day's log entries for one file together.
+  "If non-nil, normally keep day's log entries for one file together.
 
 Log entries for a given file made with \\[add-change-log-entry] or
 \\[add-change-log-entry-other-window] will only be added to others \
@@ -127,20 +127,20 @@
   :group 'change-log)
 
 (defcustom add-log-always-start-new-record nil
-  "*If non-nil, `add-change-log-entry' will always start a new record."
+  "If non-nil, `add-change-log-entry' will always start a new record."
   :version "22.1"
   :type 'boolean
   :group 'change-log)
 
 (defcustom add-log-buffer-file-name-function nil
-  "*If non-nil, function to call to identify the full filename of a buffer.
+  "If non-nil, function to call to identify the full filename of a buffer.
 This function is called with no argument.  If this is nil, the default is to
 use `buffer-file-name'."
   :type '(choice (const nil) function)
   :group 'change-log)
 
 (defcustom add-log-file-name-function nil
-  "*If non-nil, function to call to identify the filename for a ChangeLog entry.
+  "If non-nil, function to call to identify the filename for a ChangeLog entry.
 This function is called with one argument, the value of variable
 `buffer-file-name' in that buffer.  If this is nil, the default is to
 use the file's name relative to the directory of the change log file."
@@ -286,12 +286,16 @@
     map)
   "Keymap for Change Log major mode.")
 
-(defvar change-log-time-zone-rule nil
+;; It used to be called change-log-time-zone-rule but really should be
+;; called add-log-time-zone-rule since it's only used from add-log-* code.
+(defvaralias 'change-log-time-zone-rule 'add-log-time-zone-rule)
+(defvar add-log-time-zone-rule nil
   "Time zone used for calculating change log time stamps.
 It takes the same format as the TZ argument of `set-time-zone-rule'.
-If nil, use local time.")
+If nil, use local time.
+If t, use universal time.")
 
-(defun add-log-iso8601-time-zone (time)
+(defun add-log-iso8601-time-zone (&optional time)
   (let* ((utc-offset (or (car (current-time-zone time)) 0))
 	 (sign (if (< utc-offset 0) ?- ?+))
 	 (sec (abs utc-offset))
@@ -304,18 +308,14 @@
 		  (t "%c%02d"))
 	    sign hh mm ss)))
 
+(defvar add-log-iso8601-with-time-zone nil)
+
 (defun add-log-iso8601-time-string ()
-  (if change-log-time-zone-rule
-      (let ((tz (getenv "TZ"))
-	    (now (current-time)))
-	(unwind-protect
-	    (progn
-	      (set-time-zone-rule change-log-time-zone-rule)
-	      (concat
-	       (format-time-string "%Y-%m-%d " now)
-	       (add-log-iso8601-time-zone now)))
-	  (set-time-zone-rule tz)))
-    (format-time-string "%Y-%m-%d")))
+  (let ((time (format-time-string "%Y-%m-%d"
+                                  nil (eq t add-log-time-zone-rule))))
+    (if add-log-iso8601-with-time-zone
+        (concat time " " (add-log-iso8601-time-zone))
+      time)))
 
 (defun change-log-name ()
   "Return (system-dependent) default name for a change log file."
@@ -494,7 +494,7 @@
 permission notice.  The first blank line indicates the end of these
 notices.
 
-Today's date is calculated according to `change-log-time-zone-rule' if
+Today's date is calculated according to `add-log-time-zone-rule' if
 non-nil, otherwise in local time."
   (interactive (list current-prefix-arg
 		     (prompt-for-change-log-name)))
@@ -538,13 +538,22 @@
       (skip-chars-forward "\n"))
 
     ;; Advance into first entry if it is usable; else make new one.
-    (let ((new-entries (mapcar (lambda (addr)
-				 (concat (funcall add-log-time-format)
-					 "  " full-name
-					 "  <" addr ">"))
-			       (if (consp mailing-address)
-				   mailing-address
-				 (list mailing-address)))))
+    (let ((new-entries
+           (mapcar (lambda (addr)
+                     (concat
+                      (if (stringp add-log-time-zone-rule)
+                          (let ((tz (getenv "TZ")))
+                            (unwind-protect
+                                (progn
+                                  (set-time-zone-rule add-log-time-zone-rule)
+                                  (funcall add-log-time-format))
+                              (set-time-zone-rule tz)))
+                        (funcall add-log-time-format))
+                      "  " full-name
+                      "  <" addr ">"))
+                   (if (consp mailing-address)
+                       mailing-address
+                     (list mailing-address)))))
       (if (and (not add-log-always-start-new-record)
                (let ((hit nil))
 		 (dolist (entry new-entries hit)
@@ -652,21 +661,21 @@
   (add-change-log-entry whoami file-name t))
 ;;;###autoload (define-key ctl-x-4-map "a" 'add-change-log-entry-other-window)
 
-(defvar add-log-indent-text 0)
+(defvar change-log-indent-text 0)
 
-(defun add-log-indent ()
+(defun change-log-indent ()
   (let* ((indent
 	  (save-excursion
 	    (beginning-of-line)
 	    (skip-chars-forward " \t")
 	    (cond
-	     ((and (looking-at "\\(.*\\)  [^ \n].*[^ \n]  <.*>$")
+	     ((and (looking-at "\\(.*\\)  [^ \n].*[^ \n]  <.*>\\(?: +(.*)\\)? *$")
 		   ;; Matching the output of add-log-time-format is difficult,
 		   ;; but I'll get it has at least two adjacent digits.
 		   (string-match "[[:digit:]][[:digit:]]" (match-string 1)))
 	      0)
 	     ((looking-at "[^*(]")
-	      (+ (current-left-margin) add-log-indent-text))
+	      (+ (current-left-margin) change-log-indent-text))
 	     (t (current-left-margin)))))
 	 (pos (save-excursion (indent-line-to indent) (point))))
     (if (> pos (point)) (goto-char pos))))
@@ -688,7 +697,7 @@
 	tab-width 8)
   (set (make-local-variable 'fill-paragraph-function)
        'change-log-fill-paragraph)
-  (set (make-local-variable 'indent-line-function) 'add-log-indent)
+  (set (make-local-variable 'indent-line-function) 'change-log-indent)
   (set (make-local-variable 'tab-always-indent) nil)
   ;; We really do want "^" in paragraph-start below: it is only the
   ;; lines that begin at column 0 (despite the left-margin of 8) that
@@ -722,23 +731,23 @@
 
 (defcustom add-log-current-defun-header-regexp
   "^\\([[:upper:]][[:upper:]_ ]*[[:upper:]_]\\|[-_[:alpha:]]+\\)[ \t]*[:=]"
-  "*Heuristic regexp used by `add-log-current-defun' for unknown major modes."
+  "Heuristic regexp used by `add-log-current-defun' for unknown major modes."
   :type 'regexp
   :group 'change-log)
 
 ;;;###autoload
 (defvar add-log-lisp-like-modes
-    '(emacs-lisp-mode lisp-mode scheme-mode dsssl-mode lisp-interaction-mode)
+  '(emacs-lisp-mode lisp-mode scheme-mode dsssl-mode lisp-interaction-mode)
   "*Modes that look like Lisp to `add-log-current-defun'.")
 
 ;;;###autoload
 (defvar add-log-c-like-modes
-    '(c-mode c++-mode c++-c-mode objc-mode)
+  '(c-mode c++-mode c++-c-mode objc-mode)
   "*Modes that look like C to `add-log-current-defun'.")
 
 ;;;###autoload
 (defvar add-log-tex-like-modes
-    '(TeX-mode plain-TeX-mode LaTeX-mode plain-tex-mode latex-mode)
+  '(TeX-mode plain-TeX-mode LaTeX-mode plain-tex-mode latex-mode)
   "*Modes that look like TeX to `add-log-current-defun'.")
 
 ;;;###autoload
@@ -1103,5 +1112,5 @@
 
 (provide 'add-log)
 
-;;; arch-tag: 81eee6fc-088f-4372-a37f-80ad9620e762
+;; arch-tag: 81eee6fc-088f-4372-a37f-80ad9620e762
 ;;; add-log.el ends here
--- a/lisp/allout.el	Fri Apr 21 05:39:14 2006 +0000
+++ b/lisp/allout.el	Tue May 02 05:51:52 2006 +0000
@@ -84,8 +84,6 @@
                           (require 'pgg-gpg)
                           (require 'overlay)
 			  ))
-(autoload 'pgg-gpg-symmetric-key-p "pgg-gpg"
-  "True if decoded armor MESSAGE-KEYS has symmetric encryption indicator.")
 
 ;;;_* USER CUSTOMIZATION VARIABLES:
 
@@ -199,6 +197,9 @@
   :type 'boolean
   :group 'allout)
 (make-variable-buffer-local 'allout-show-bodies)
+;;;###autoload
+(put 'allout-show-bodies 'safe-local-variable
+     (lambda (x) (member x '(t nil))))
 
 ;;;_  = allout-header-prefix
 (defcustom allout-header-prefix "."
@@ -212,6 +213,8 @@
   :type 'string
   :group 'allout)
 (make-variable-buffer-local 'allout-header-prefix)
+;;;###autoload
+(put 'allout-header-prefix 'safe-local-variable 'stringp)
 ;;;_  = allout-primary-bullet
 (defcustom allout-primary-bullet "*"
   "Bullet used for top-level outline topics.
@@ -227,6 +230,8 @@
   :type 'string
   :group 'allout)
 (make-variable-buffer-local 'allout-primary-bullet)
+;;;###autoload
+(put 'allout-primary-bullet 'safe-local-variable 'stringp)
 ;;;_  = allout-plain-bullets-string
 (defcustom allout-plain-bullets-string ".,"
   "*The bullets normally used in outline topic prefixes.
@@ -241,6 +246,8 @@
   :type 'string
   :group 'allout)
 (make-variable-buffer-local 'allout-plain-bullets-string)
+;;;###autoload
+(put 'allout-plain-bullets-string 'safe-local-variable 'stringp)
 ;;;_  = allout-distinctive-bullets-string
 (defcustom allout-distinctive-bullets-string "*+-=>()[{}&!?#%\"X@$~_\\:;^"
   "*Persistent outline header bullets used to distinguish special topics.
@@ -274,6 +281,8 @@
   :type 'string
   :group 'allout)
 (make-variable-buffer-local 'allout-distinctive-bullets-string)
+;;;###autoload
+(put 'allout-distinctive-bullets-string 'safe-local-variable 'stringp)
 
 ;;;_  = allout-use-mode-specific-leader
 (defcustom allout-use-mode-specific-leader t
@@ -305,6 +314,9 @@
 		 (const allout-mode-leaders)
 		 (const comment-start))
   :group 'allout)
+;;;###autoload
+(put 'allout-use-mode-specific-leader 'safe-local-variable
+     (lambda (x) (or (member x '(t nil)) (stringp x))))
 ;;;_  = allout-mode-leaders
 (defvar allout-mode-leaders '()
   "Specific allout-prefix leading strings per major modes.
@@ -330,6 +342,9 @@
   :type 'boolean
   :group 'allout)
 (make-variable-buffer-local 'allout-old-style-prefixes)
+;;;###autoload
+(put 'allout-old-style-prefixes 'safe-local-variable
+     (lambda (x) (member x '(t nil))))
 ;;;_  = allout-stylish-prefixes - alternating bullets
 (defcustom allout-stylish-prefixes t
   "*Do fancy stuff with topic prefix bullets according to level, etc.
@@ -376,6 +391,9 @@
   :type 'boolean
   :group 'allout)
 (make-variable-buffer-local 'allout-stylish-prefixes)
+;;;###autoload
+(put 'allout-stylish-prefixes 'safe-local-variable
+     (lambda (x) (member x '(t nil))))
 
 ;;;_  = allout-numbered-bullet
 (defcustom allout-numbered-bullet "#"
@@ -388,6 +406,9 @@
   :type '(choice (const nil) string)
   :group 'allout)
 (make-variable-buffer-local 'allout-numbered-bullet)
+;;;###autoload
+(put 'allout-numbered-bullet 'safe-local-variable
+     (lambda (x) (or (not x) (stringp x))))
 ;;;_  = allout-file-xref-bullet
 (defcustom allout-file-xref-bullet "@"
   "*Bullet signifying file cross-references, for `allout-resolve-xref'.
@@ -395,6 +416,9 @@
 Set this var to the bullet you want to use for file cross-references."
   :type '(choice (const nil) string)
   :group 'allout)
+;;;###autoload
+(put 'allout-file-xref-bullet 'safe-local-variable
+     (lambda (x) (or (not x) (stringp x))))
 ;;;_  = allout-presentation-padding
 (defcustom allout-presentation-padding 2
   "*Presentation-format white-space padding factor, for greater indent."
@@ -402,6 +426,8 @@
   :group 'allout)
 
 (make-variable-buffer-local 'allout-presentation-padding)
+;;;###autoload
+(put 'allout-presentation-padding 'safe-local-variable 'integerp)
 
 ;;;_  = allout-abbreviate-flattened-numbering
 (defcustom allout-abbreviate-flattened-numbering nil
@@ -455,11 +481,16 @@
   :group 'allout)
 
 ;;;_ + Topic encryption
+;;;_  = allout-encryption group
+(defgroup allout-encryption nil
+  "Settings for topic encryption features of allout outliner."
+  :group 'allout)
 ;;;_  = allout-topic-encryption-bullet
 (defcustom allout-topic-encryption-bullet "~"
   "*Bullet signifying encryption of the entry's body."
   :type '(choice (const nil) string)
-  :group 'allout)
+  :version "22.0"
+  :group 'allout-encryption)
 ;;;_  = allout-passphrase-verifier-handling
 (defcustom allout-passphrase-verifier-handling t
   "*Enable use of symmetric encryption passphrase verifier if non-nil.
@@ -467,7 +498,8 @@
 See the docstring for the `allout-enable-file-variable-adjustment'
 variable for details about allout ajustment of file variables."
   :type 'boolean
-  :group 'allout)
+  :version "22.0"
+  :group 'allout-encryption)
 (make-variable-buffer-local 'allout-passphrase-verifier-handling)
 ;;;_  = allout-passphrase-hint-handling
 (defcustom allout-passphrase-hint-handling 'always
@@ -482,7 +514,8 @@
   :type '(choice (const always)
                  (const needed)
                  (const disabled))
-  :group 'allout)
+  :version "22.0"
+  :group 'allout-encryption)
 (make-variable-buffer-local 'allout-passphrase-hint-handling)
 ;;;_  = allout-encrypt-unencrypted-on-saves
 (defcustom allout-encrypt-unencrypted-on-saves t
@@ -514,7 +547,8 @@
   :type '(choice (const :tag "Yes" t)
                  (const :tag "All except current topic" except-current)
                  (const :tag "No" nil))
-  :group 'allout)
+  :version "22.0"
+  :group 'allout-encryption)
 (make-variable-buffer-local 'allout-encrypt-unencrypted-on-saves)
 
 ;;;_ + Miscellaneous customization
@@ -585,6 +619,9 @@
   :type 'boolean
   :group 'allout)
 (make-variable-buffer-local 'allout-use-hanging-indents)
+;;;###autoload
+(put 'allout-use-hanging-indents 'safe-local-variable
+     (lambda (x) (member x '(t nil))))
 
 ;;;_  = allout-reindent-bodies
 (defcustom allout-reindent-bodies (if allout-use-hanging-indents
@@ -602,6 +639,9 @@
   :group 'allout)
 
 (make-variable-buffer-local 'allout-reindent-bodies)
+;;;###autoload
+(put 'allout-reindent-bodies 'safe-local-variable
+     (lambda (x) (member x '(nil t text force))))
 
 ;;;_  = allout-enable-file-variable-adjustment
 (defcustom allout-enable-file-variable-adjustment t
@@ -667,7 +707,9 @@
 case the value of `allout-default-layout' is used.")
 (make-variable-buffer-local 'allout-layout)
 ;;;###autoload
-(put 'allout-layout 'safe-local-variable t)
+(put 'allout-layout 'safe-local-variable
+     (lambda (x) (or (numberp x) (listp x) (integerp x)
+                     (member x '(: * + -)))))
 
 ;;;_  : Topic header format
 ;;;_   = allout-regexp
@@ -1053,7 +1095,8 @@
 the emacs buffer state, if file variable adjustments are enabled.  See
 `allout-enable-file-variable-adjustment' for details about that.")
 (make-variable-buffer-local 'allout-passphrase-verifier-string)
-(put 'allout-passphrase-verifier-string 'safe-local-variable t)
+;;;###autoload
+(put 'allout-passphrase-verifier-string 'safe-local-variable 'stringp)
 ;;;_   = allout-passphrase-hint-string
 (defvar allout-passphrase-hint-string ""
   "Variable used to retain reminder string for file's encryption passphrase.
@@ -1065,8 +1108,9 @@
 state, if file variable adjustments are enabled.  See
 `allout-enable-file-variable-adjustment' for details about that.")
 (make-variable-buffer-local 'allout-passphrase-hint-string)
-(put 'allout-passphrase-hint-string 'safe-local-variable t)
 (setq-default allout-passphrase-hint-string "")
+;;;###autoload
+(put 'allout-passphrase-hint-string 'safe-local-variable 'stringp)
 ;;;_   = allout-after-save-decrypt
 (defvar allout-after-save-decrypt nil
   "Internal variable, is nil or has the value of two points:
@@ -1573,6 +1617,12 @@
 				       ; epoch, minor-mode key bindings:
 	   (setq allout-mode-map
 		 (produce-allout-mode-map allout-keybindings-list))
+           (substitute-key-definition 'beginning-of-line
+                                      'move-beginning-of-line
+                                      allout-mode-map global-map)
+           (substitute-key-definition 'end-of-line
+                                      'move-end-of-line
+                                      allout-mode-map global-map)
 	   (produce-allout-mode-menubar-entries)
 	   (fset 'allout-mode-map allout-mode-map)
 				       ; Include on minor-mode-map-alist,
@@ -5778,17 +5828,14 @@
       (if (/= arg 1)
           (condition-case nil (line-move (1- arg)) (error nil)))
 
-      (let ((orig (point)))
-        ;; Move to beginning-of-line, ignoring fields and invisibles.
-        (skip-chars-backward "^\n")
-        (while (and (not (bobp)) (line-move-invisible-p (1- (point))))
-          (goto-char (if (featurep 'xemacs)
-                         (previous-property-change (point))
-                       (previous-char-property-change (point))))
-          (skip-chars-backward "^\n"))
-        (vertical-motion 0)
-        (if (/= orig (point))
-            (goto-char orig))))
+      ;; Move to beginning-of-line, ignoring fields and invisibles.
+      (skip-chars-backward "^\n")
+      (while (and (not (bobp)) (line-move-invisible-p (1- (point))))
+        (goto-char (if (featurep 'xemacs)
+                       (previous-property-change (point))
+                     (previous-char-property-change (point))))
+        (skip-chars-backward "^\n"))
+      (vertical-motion 0))
 )
 ;;;_  > move-end-of-line if necessary - older emacs, xemacs
 (if (not (fboundp 'move-end-of-line))
@@ -5802,8 +5849,7 @@
 To ignore intangibility, bind `inhibit-point-motion-hooks' to t."
       (interactive "p")
       (or arg (setq arg 1))
-      (let ((orig (point))
-            done)
+      (let (done)
         (while (not done)
           (let ((newpos
                  (save-excursion
@@ -5813,8 +5859,10 @@
                             (error nil))
                           (not (bobp))
                           (progn
-                            (while (and (not (bobp)) (line-move-invisible-p (1- (point))))
-                              (goto-char (previous-char-property-change (point))))
+                            (while (and (not (bobp))
+                                        (line-move-invisible-p (1- (point))))
+                              (goto-char
+                               (previous-char-property-change (point))))
                             (backward-char 1)))
                      (point)))))
             (goto-char newpos)
@@ -5827,9 +5875,7 @@
                   ;; and now we're not really at eol,
                   ;; keep going.
                   (setq arg 1)
-                (setq done t)))))
-        (if (/= orig (point))
-            (goto-char orig))))
+                (setq done t)))))))
   )
 ;;;_  > line-move-invisible-p if necessary
 (if (not (fboundp 'line-move-invisible-p))
--- a/lisp/bindings.el	Fri Apr 21 05:39:14 2006 +0000
+++ b/lisp/bindings.el	Tue May 02 05:51:52 2006 +0000
@@ -310,13 +310,13 @@
     (list
      (propertize "%[(" 'help-echo help-echo)
      `(:propertize ("" mode-name)
-		   help-echo "mouse-1: major-mode-menu mouse-2: help for current major mode"
+		   help-echo "mouse-1: major mode, mouse-2: major mode help, mouse-3: toggle minor modes"
 		   mouse-face mode-line-highlight
 		   local-map ,mode-line-major-mode-keymap)
      '("" mode-line-process)
      `(:propertize ("" minor-mode-alist)
 		   mouse-face mode-line-highlight
-		   help-echo "mouse-2: help for minor modes, mouse-3: minor mode menu"
+		   help-echo "mouse-2: minor mode help, mouse-3: toggle minor modes"
 		   local-map ,mode-line-minor-mode-keymap)
      (propertize "%n" 'help-echo "mouse-2: widen"
 		 'mouse-face 'mode-line-highlight
--- a/lisp/calc/calc-embed.el	Fri Apr 21 05:39:14 2006 +0000
+++ b/lisp/calc/calc-embed.el	Tue May 02 05:51:52 2006 +0000
@@ -932,7 +932,9 @@
 			     (substring str pref-len suff-pos)))
 		(if (string-match "[^ \t\n]" str)
 		    (setq pref-len 0
-			  val (math-read-big-expr str))
+			  val (condition-case nil
+                                  (math-read-big-expr str)
+                                (error (math-read-expr str))))
 		  (setq val nil))))
 	    (if (eq (car-safe val) 'error)
 		(setq val (list 'error
--- a/lisp/calendar/cal-menu.el	Fri Apr 21 05:39:14 2006 +0000
+++ b/lisp/calendar/cal-menu.el	Tue May 02 05:51:52 2006 +0000
@@ -89,7 +89,7 @@
 (define-key calendar-mode-map [menu-bar diary mark]
  '("Mark All" . mark-diary-entries))
 (define-key calendar-mode-map [menu-bar diary view]
-  '("Cursor Date" . view-diary-entries))
+  '("Cursor Date" . diary-view-entries))
 (define-key calendar-mode-map [menu-bar diary view]
   '("Other File" . view-other-diary-entries))
 
--- a/lisp/calendar/cal-tex.el	Fri Apr 21 05:39:14 2006 +0000
+++ b/lisp/calendar/cal-tex.el	Tue May 02 05:51:52 2006 +0000
@@ -45,7 +45,7 @@
 
 (require 'calendar)
 
-(autoload 'list-diary-entries "diary-lib" nil t)
+(autoload 'diary-list-entries "diary-lib" nil t)
 (autoload 'calendar-holiday-list "holidays" nil t)
 (autoload 'calendar-iso-from-absolute "cal-iso" nil t)
 
@@ -121,6 +121,14 @@
   :type 'integer
   :group 'calendar-tex)
 
+(defcustom cal-tex-preamble-extra nil
+  "A string giving extra LaTeX commands to insert in the calendar preamble.
+For example, to include extra packages:
+\"\\\\usepackage{foo}\\n\\\\usepackage{bar}\\n\"."
+  :type 'string
+  :group 'calendar-tex
+  :version "22.1")
+
 (defcustom cal-tex-hook nil
   "*List of functions called after any LaTeX calendar buffer is generated.
 You can use this to do postprocessing on the buffer.  For example, to change
@@ -240,7 +248,7 @@
   "Generate a list of all diary-entries from absolute date D1 to D2."
   (let ((diary-list-include-blanks nil)
         (diary-display-hook 'ignore))
-    (list-diary-entries
+    (diary-list-entries
      (calendar-gregorian-from-absolute d1)
      (1+ (- d2 d1)))))
 
@@ -253,8 +261,10 @@
   (insert "\\documentclass")
   (if args
       (insert "[" args "]"))
-  (insert "{article}\n"
-          "\\hbadness 20000
+  (insert "{article}\n")
+  (if (stringp cal-tex-preamble-extra)
+      (insert cal-tex-preamble-extra "\n"))
+  (insert "\\hbadness 20000
 \\hfuzz=1000pt
 \\vbadness 20000
 \\lineskip 0pt
@@ -357,6 +367,8 @@
        (cal-tex-noindent)
        (cal-tex-nl)
        (let ((month-names; don't use default in case user changed it
+              ;; These are only used to define the command names, not
+              ;; the names of the months they insert.
               ["January" "February" "March" "April" "May" "June"
                "July" "August" "September" "October" "November" "December"]))
          (calendar-for-loop i from 1 to 12 do
--- a/lisp/calendar/diary-lib.el	Fri Apr 21 05:39:14 2006 +0000
+++ b/lisp/calendar/diary-lib.el	Tue May 02 05:51:52 2006 +0000
@@ -79,7 +79,7 @@
    (list (prefix-numeric-value current-prefix-arg)
          (read-file-name "Enter diary file name: " default-directory nil t)))
   (let ((diary-file d-file))
-    (view-diary-entries arg)))
+    (diary-view-entries arg)))
 
 (autoload 'check-calendar-holidays "holidays"
   "Check the list of holidays for any that occur on DATE.
--- a/lisp/comint.el	Fri Apr 21 05:39:14 2006 +0000
+++ b/lisp/comint.el	Tue May 02 05:51:52 2006 +0000
@@ -2703,7 +2703,7 @@
     name))
 
 (defun comint-match-partial-filename ()
-  "Return the filename at point, or nil if non is found.
+  "Return the filename at point, or nil if none is found.
 Environment variables are substituted.  See `comint-word'."
   (let ((filename (comint-word comint-file-name-chars)))
     (and filename (comint-substitute-in-file-name
--- a/lisp/cus-edit.el	Fri Apr 21 05:39:14 2006 +0000
+++ b/lisp/cus-edit.el	Tue May 02 05:51:52 2006 +0000
@@ -2089,7 +2089,7 @@
       'custom-button-pressed
     'custom-button-pressed-unraised))
 
-(defface custom-documentation nil
+(defface custom-documentation '((t nil))
   "Face used for documentation strings in customization buffers."
   :group 'custom-faces)
 ;; backward-compatibility alias
--- a/lisp/cvs-status.el	Fri Apr 21 05:39:14 2006 +0000
+++ b/lisp/cvs-status.el	Tue May 02 05:51:52 2006 +0000
@@ -3,7 +3,7 @@
 ;; Copyright (C) 1999, 2000, 2002, 2003, 2004,
 ;;   2005, 2006 Free Software Foundation, Inc.
 
-;; Author: Stefan Monnier <monnier@cs.yale.edu>
+;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
 ;; Keywords: pcl-cvs cvs status tree tools
 
 ;; This file is part of GNU Emacs.
--- a/lisp/diff-mode.el	Fri Apr 21 05:39:14 2006 +0000
+++ b/lisp/diff-mode.el	Tue May 02 05:51:52 2006 +0000
@@ -3,7 +3,7 @@
 ;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004,
 ;;   2005, 2006 Free Software Foundation, Inc.
 
-;; Author: Stefan Monnier <monnier@cs.yale.edu>
+;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
 ;; Keywords: convenience patch diff
 
 ;; This file is part of GNU Emacs.
@@ -118,7 +118,8 @@
     ("\C-m" . diff-goto-source)
     ([mouse-2] . diff-goto-source)
     ;; From XEmacs' diff-mode.
-    ("W" . widen)
+;; Standard M-w is useful, so don't change M-W.
+;;    ("W" . widen)
     ;;("." . diff-goto-source)		;display-buffer
     ;;("f" . diff-goto-source)		;find-file
     ("o" . diff-goto-source)		;other-window
@@ -127,14 +128,14 @@
     ;;("h" . diff-show-header)
     ;;("j" . diff-show-difference)	;jump to Nth diff
     ;;("q" . diff-quit)
-    (" " . scroll-up)
-    ("\177" . scroll-down)
-    ;; Our very own bindings.
-    ("A" . diff-ediff-patch)
-    ("r" . diff-restrict-view)
-    ("R" . diff-reverse-direction)
-    ("U" . diff-context->unified)
-    ("C" . diff-unified->context)
+;; Not useful if you have to metafy them.
+;;    (" " . scroll-up)
+;;    ("\177" . scroll-down)
+;; Standard M-a is useful, so don't change M-A.
+;;    ("A" . diff-ediff-patch)
+;; Standard M-r is useful, so don't change M-r or M-R.
+;;    ("r" . diff-restrict-view)
+;;    ("R" . diff-reverse-direction)
     ("q" . quit-window))
   "Basic keymap for `diff-mode', bound to various prefix keys.")
 
@@ -143,10 +144,14 @@
     ;; From compilation-minor-mode.
     ("\C-c\C-c" . diff-goto-source)
     ;; Misc operations.
-    ("\C-c\C-r" . diff-refine-hunk)
+    ("\C-c\C-a" . diff-apply-hunk)
+    ("\C-c\C-e" . diff-ediff-patch)
+    ("\C-c\C-n" . diff-restrict-view)
+    ("\C-c\C-r" . diff-reverse-direction)
     ("\C-c\C-s" . diff-split-hunk)
-    ("\C-c\C-a" . diff-apply-hunk)
     ("\C-c\C-t" . diff-test-hunk)
+    ("\C-c\C-u" . diff-context->unified)
+    ("\C-c\C-w" . diff-refine-hunk)
     ("\C-c\C-f" . next-error-follow-minor-mode))
   "Keymap for `diff-mode'.  See also `diff-mode-shared-map'.")
 
@@ -711,77 +716,80 @@
 			    (delete-region last-pt (point))
 			    (setq delete nil)))))))))))))))
 
-(defun diff-context->unified (start end)
+(defun diff-context->unified (start end &optional to-context)
   "Convert context diffs to unified diffs.
-START and END are either taken from the region (if a prefix arg is given) or
-else cover the whole bufer."
-  (interactive (if current-prefix-arg
-		   (list (mark) (point))
-		 (list (point-min) (point-max))))
-  (unless (markerp end) (setq end (copy-marker end)))
-  (let (;;(diff-inhibit-after-change t)
-	(inhibit-read-only t))
-    (save-excursion
-      (goto-char start)
-      (while (and (re-search-forward "^\\(\\(\\*\\*\\*\\) .+\n\\(---\\) .+\\|\\*\\{15\\}.*\n\\*\\*\\* \\([0-9]+\\),\\(-?[0-9]+\\) \\*\\*\\*\\*\\)$" nil t)
-		  (< (point) end))
-	(combine-after-change-calls
-	  (if (match-beginning 2)
-	      ;; we matched a file header
-	      (progn
-		;; use reverse order to make sure the indices are kept valid
-		(replace-match "+++" t t nil 3)
-		(replace-match "---" t t nil 2))
-	    ;; we matched a hunk header
-	    (let ((line1s (match-string 4))
-		  (line1e (match-string 5))
-		  (pt1 (match-beginning 0)))
-	      (replace-match "")
-	      (unless (re-search-forward
-		       "^--- \\([0-9]+\\),\\(-?[0-9]+\\) ----$" nil t)
-		(error "Can't find matching `--- n1,n2 ----' line"))
-	      (let ((line2s (match-string 1))
-		    (line2e (match-string 2))
-		    (pt2 (progn
-			   (delete-region (progn (beginning-of-line) (point))
-					  (progn (forward-line 1) (point)))
-			   (point-marker))))
-		(goto-char pt1)
-		(forward-line 1)
-		(while (< (point) pt2)
-		  (case (char-after)
-		    ((?! ?-) (delete-char 2) (insert "-") (forward-line 1))
-		    (?\s		;merge with the other half of the chunk
-		     (let* ((endline2
-			     (save-excursion
-			       (goto-char pt2) (forward-line 1) (point)))
-			    (c (char-after pt2)))
-		       (case c
-			 ((?! ?+)
-			  (insert "+"
-				  (prog1 (buffer-substring (+ pt2 2) endline2)
-				    (delete-region pt2 endline2))))
-			 (?\s		;FIXME: check consistency
-			  (delete-region pt2 endline2)
-			  (delete-char 1)
-			  (forward-line 1))
-			 (?\\ (forward-line 1))
-			 (t (delete-char 1) (forward-line 1)))))
-		    (t (forward-line 1))))
-		(while (looking-at "[+! ] ")
-		  (if (/= (char-after) ?!) (forward-char 1)
-		    (delete-char 1) (insert "+"))
-		  (delete-char 1) (forward-line 1))
-		(save-excursion
+START and END are either taken from the region
+\(when it is highlighted) or else cover the whole buffer.
+With a prefix argument, convert unified format to context format."
+  (interactive (if (and transient-mark-mode mark-active)
+		   (list (mark) (point) current-prefix-arg)
+		 (list (point-min) (point-max) current-prefix-arg)))
+  (if to-context
+      (diff-unified->context start end)
+    (unless (markerp end) (setq end (copy-marker end)))
+    (let ( ;;(diff-inhibit-after-change t)
+	  (inhibit-read-only t))
+      (save-excursion
+	(goto-char start)
+	(while (and (re-search-forward "^\\(\\(\\*\\*\\*\\) .+\n\\(---\\) .+\\|\\*\\{15\\}.*\n\\*\\*\\* \\([0-9]+\\),\\(-?[0-9]+\\) \\*\\*\\*\\*\\)$" nil t)
+		    (< (point) end))
+	  (combine-after-change-calls
+	    (if (match-beginning 2)
+		;; we matched a file header
+		(progn
+		  ;; use reverse order to make sure the indices are kept valid
+		  (replace-match "+++" t t nil 3)
+		  (replace-match "---" t t nil 2))
+	      ;; we matched a hunk header
+	      (let ((line1s (match-string 4))
+		    (line1e (match-string 5))
+		    (pt1 (match-beginning 0)))
+		(replace-match "")
+		(unless (re-search-forward
+			 "^--- \\([0-9]+\\),\\(-?[0-9]+\\) ----$" nil t)
+		  (error "Can't find matching `--- n1,n2 ----' line"))
+		(let ((line2s (match-string 1))
+		      (line2e (match-string 2))
+		      (pt2 (progn
+			     (delete-region (progn (beginning-of-line) (point))
+					    (progn (forward-line 1) (point)))
+			     (point-marker))))
 		  (goto-char pt1)
-		  (insert "@@ -" line1s ","
-			  (number-to-string (- (string-to-number line1e)
-					       (string-to-number line1s)
-					       -1))
-			  " +" line2s ","
-			  (number-to-string (- (string-to-number line2e)
-					       (string-to-number line2s)
-					       -1)) " @@"))))))))))
+		  (forward-line 1)
+		  (while (< (point) pt2)
+		    (case (char-after)
+		      ((?! ?-) (delete-char 2) (insert "-") (forward-line 1))
+		      (?\s     ;merge with the other half of the chunk
+		       (let* ((endline2
+			       (save-excursion
+				 (goto-char pt2) (forward-line 1) (point)))
+			      (c (char-after pt2)))
+			 (case c
+			   ((?! ?+)
+			    (insert "+"
+				    (prog1 (buffer-substring (+ pt2 2) endline2)
+				      (delete-region pt2 endline2))))
+			   (?\s		;FIXME: check consistency
+			    (delete-region pt2 endline2)
+			    (delete-char 1)
+			    (forward-line 1))
+			   (?\\ (forward-line 1))
+			   (t (delete-char 1) (forward-line 1)))))
+		      (t (forward-line 1))))
+		  (while (looking-at "[+! ] ")
+		    (if (/= (char-after) ?!) (forward-char 1)
+		      (delete-char 1) (insert "+"))
+		    (delete-char 1) (forward-line 1))
+		  (save-excursion
+		    (goto-char pt1)
+		    (insert "@@ -" line1s ","
+			    (number-to-string (- (string-to-number line1e)
+						 (string-to-number line1s)
+						 -1))
+			    " +" line2s ","
+			    (number-to-string (- (string-to-number line2e)
+						 (string-to-number line2s)
+						 -1)) " @@")))))))))))
 
 (defun diff-reverse-direction (start end)
   "Reverse the direction of the diffs.
--- a/lisp/emacs-lisp/warnings.el	Fri Apr 21 05:39:14 2006 +0000
+++ b/lisp/emacs-lisp/warnings.el	Tue May 02 05:51:52 2006 +0000
@@ -209,6 +209,7 @@
 
 LEVEL should be either :debug, :warning, :error, or :emergency
 \(but see `warning-minimum-level' and `warning-minimum-log-level').
+Default is :warning.
 
 :emergency -- a problem that will seriously impair Emacs operation soon
 	      if you do not attend to it promptly.
@@ -292,7 +293,7 @@
 Aside from generating the message with `format',
 this is equivalent to `display-warning'.
 
-TYPE is the warning type: either a custom group name (a symbol).
+TYPE is the warning type: either a custom group name (a symbol),
 or a list of symbols whose first element is a custom group name.
 \(The rest of the symbols represent subcategories and
 can be whatever you like.)
--- a/lisp/faces.el	Fri Apr 21 05:39:14 2006 +0000
+++ b/lisp/faces.el	Tue May 02 05:51:52 2006 +0000
@@ -2144,19 +2144,19 @@
   :group 'frames
   :group 'basic-faces)
 
-(defface scroll-bar '()
+(defface scroll-bar '((t nil))
   "Basic face for the scroll bar colors under X."
   :version "21.1"
   :group 'frames
   :group 'basic-faces)
 
-(defface border '()
+(defface border '((t nil))
   "Basic face for the frame border under X."
   :version "21.1"
   :group 'frames
   :group 'basic-faces)
 
-(defface cursor '()
+(defface cursor '((t nil))
   "Basic face for the cursor color under X.
 Note: Other faces cannot inherit from the cursor face."
   :version "21.1"
@@ -2165,7 +2165,7 @@
 
 (put 'cursor 'face-no-inherit t)
 
-(defface mouse '()
+(defface mouse '((t nil))
   "Basic face for the mouse color under X."
   :version "21.1"
   :group 'mouse
--- a/lisp/files.el	Fri Apr 21 05:39:14 2006 +0000
+++ b/lisp/files.el	Tue May 02 05:51:52 2006 +0000
@@ -2652,15 +2652,11 @@
  * There is a matching entry (SYM . VAL) in the
    `safe-local-variable-values' user option.
 
- * The `safe-local-variable' property of SYM is t.
-
  * The `safe-local-variable' property of SYM is a function that
    evaluates to a non-nil value with VAL as an argument."
   (or (member (cons sym val) safe-local-variable-values)
       (let ((safep (get sym 'safe-local-variable)))
-	(or (eq safep t)
-	    (and (functionp safep)
-		 (funcall safep val))))))
+        (and (functionp safep) (funcall safep val)))))
 
 (defun risky-local-variable-p (sym &optional ignored)
   "Non-nil if SYM could be dangerous as a file-local variable.
--- a/lisp/follow.el	Fri Apr 21 05:39:14 2006 +0000
+++ b/lisp/follow.el	Tue May 02 05:51:52 2006 +0000
@@ -7,7 +7,6 @@
 ;; Maintainer: FSF (Anders' email bounces, Sep 2005)
 ;; Created: 1995-05-25
 ;; Keywords: display, window, minor-mode, convenience
-;; Last Changed: 1999-11-17
 
 ;; This file is part of GNU Emacs.
 
@@ -46,14 +45,14 @@
 ;;   movement commands.
 ;;
 ;; Follow mode comes to its prime when a large screen and two
-;; side-by-side window are used. The user can, with the help of Follow
+;; side-by-side window are used.  The user can, with the help of Follow
 ;; mode, use two full-height windows as though they would have been
-;; one. Imagine yourself editing a large function, or section of text,
+;; one.  Imagine yourself editing a large function, or section of text,
 ;; and being able to use 144 lines instead of the normal 72... (your
 ;; mileage may vary).
 
 ;; To test this package, make sure `follow' is loaded, or will be
-;; autoloaded when activated (see below). Then do the following:
+;; autoloaded when activated (see below).  Then do the following:
 ;;
 ;; * Find your favorite file (preferably a long one).
 ;;
@@ -77,13 +76,13 @@
 ;;		    +----------+----------+
 ;;
 ;;   As you can see, the right-hand window starts at line 73, the line
-;;   immediately below the end of the left-hand window. As long as
+;;   immediately below the end of the left-hand window.  As long as
 ;;   `follow-mode' is active, the two windows will follow eachother!
 ;;
 ;; * Play around and enjoy! Scroll one window and watch the other.
-;;   Jump to the beginning or end. Press `Cursor down' at the last
-;;   line of the left-hand window. Enter new lines into the
-;;   text. Enter long lines spanning several lines, or several
+;;   Jump to the beginning or end.  Press `Cursor down' at the last
+;;   line of the left-hand window.  Enter new lines into the
+;;   text.  Enter long lines spanning several lines, or several
 ;;   windows.
 ;;
 ;; * Should you find `Follow' mode annoying, just type
@@ -146,7 +145,7 @@
 ;; Usage:
 ;;
 ;; To activate issue the command "M-x follow-mode"
-;; and press return. To deactivate, do it again.
+;; and press return.  To deactivate, do it again.
 ;;
 ;; The following is a list of commands useful when follow-mode is active.
 ;;
@@ -197,7 +196,7 @@
 ;;    in the same frame. (My apoligies to you who can't use frames.)
 ;;
 ;; 2) Bind `follow-mode' to key so you can turn it off whenever
-;;    you want to view two locations. Of course, `follow' mode can
+;;    you want to view two locations.  Of course, `follow' mode can
 ;;    be reactivated by hitting the same key again.
 ;;
 ;;    Example from my ~/.emacs:
@@ -208,7 +207,7 @@
 ;;
 ;; In an ideal world, follow mode would have been implemented in the
 ;; kernel of the display routines, making sure that the windows (using
-;; follow mode) ALWAYS are aligned. On planet earth, however, we must
+;; follow mode) ALWAYS are aligned.  On planet earth, however, we must
 ;; accept a solution where we ALMOST ALWAYS can make sure that the
 ;; windows are aligned.
 ;;
@@ -222,7 +221,7 @@
 ;;
 ;; Note that only the selected window is checked, for the reason of
 ;; efficiency and code complexity. (I.e. it is possible to make a
-;; non-selected windows unaligned. It will, however, pop right back
+;; non-selected windows unaligned.  It will, however, pop right back
 ;; when it is selected.)
 
 ;;}}}
@@ -259,7 +258,7 @@
 (eval-when-compile
   (if (or (featurep 'bytecomp)
 	  (featurep 'byte-compile))
-      (cond ((string-match "XEmacs" emacs-version)
+      (cond ((featurep 'xemacs)
 	     ;; Make XEmacs shut up!  I'm using standard Emacs
 	     ;; functions, they are NOT obsolete!
 	     (if (eq (get 'force-mode-line-update 'byte-compile)
@@ -278,53 +277,202 @@
   :group 'windows
   :group 'convenience)
 
-(defvar follow-mode nil
-  "Variable indicating if Follow mode is active.")
-
 (defcustom follow-mode-hook nil
-  "*Hooks to run when follow-mode is turned on."
+  "Hooks to run when follow-mode is turned on."
   :type 'hook
   :group 'follow)
 
 (defcustom follow-mode-off-hook nil
-  "*Hooks to run when follow-mode is turned off."
+  "Hooks to run when follow-mode is turned off."
   :type 'hook
   :group 'follow)
 
-(defvar follow-mode-map nil
-  "*Minor mode keymap for Follow mode.")
+
+;;{{{ Keymap/Menu
+
+;; Define keys for the follow-mode minor mode map and replace some
+;; functions in the global map.  All `follow' mode special functions
+;; can be found on (the somewhat cumbersome) "C-c . <key>"
+;; (Control-C dot <key>). (As of Emacs 19.29 the keys
+;; C-c <punctuation character> are reserved for minor modes.)
+;;
+;; To change the prefix, redefine `follow-mode-prefix' before
+;; `follow' is loaded, or see the section on `follow-mode-hook'
+;; above for an example of how to bind the keys the way you like.
+;;
+;; Please note that the keymap is defined the first time this file is
+;; loaded.  Also note that the only legal way to manipulate the
+;; keymap is to use `define-key'.  Don't change it using `setq' or
+;; similar!
+
+(defcustom follow-mode-prefix "\C-c."
+  "Prefix key to use for follow commands in Follow mode.
+The value of this variable is checked as part of loading Follow mode.
+After that, changing the prefix key requires manipulating keymaps."
+  :type 'string
+  :group 'follow)
+
+(defvar follow-mode-map
+  (let ((mainmap (make-sparse-keymap))
+        (map (make-sparse-keymap)))
+    (define-key map "\C-v"	'follow-scroll-up)
+    (define-key map "\M-v"	'follow-scroll-down)
+    (define-key map "v"		'follow-scroll-down)
+    (define-key map "1"		'follow-delete-other-windows-and-split)
+    (define-key map "b"		'follow-switch-to-buffer)
+    (define-key map "\C-b"	'follow-switch-to-buffer-all)
+    (define-key map "\C-l"	'follow-recenter)
+    (define-key map "<"		'follow-first-window)
+    (define-key map ">"		'follow-last-window)
+    (define-key map "n"		'follow-next-window)
+    (define-key map "p"		'follow-previous-window)
+
+    (define-key mainmap follow-mode-prefix map)
+
+    ;; Replace the standard `end-of-buffer', when in Follow Mode.  (I
+    ;; don't see the point in trying to replace every function that
+    ;; could be enhanced in Follow mode.  End-of-buffer is a special
+    ;; case since it is very simple to define and it greatly enhances
+    ;; the look and feel of Follow mode.)
+    (define-key mainmap [remap end-of-buffer] 'follow-end-of-buffer)
+
+    ;;
+    ;; The menu.
+    ;;
+
+    (if (not (featurep 'xemacs))
+
+	;;
+	;; Emacs
+	;;
+	(let ((menumap (funcall (symbol-function 'make-sparse-keymap)
+                                "Follow"))
+	      (count 0)
+	      id)
+	  (mapcar
+	   (function
+	    (lambda (item)
+	      (setq id
+		    (or (cdr item)
+			(progn
+			  (setq count (+ count 1))
+			  (intern (format "separator-%d" count)))))
+	      (define-key menumap (vector id) item)
+	      (or (eq id 'follow-mode)
+		  (put id 'menu-enable 'follow-mode))))
+	   ;; In reverse order:
+	   '(("Toggle Follow mode" . follow-mode)
+	     ("--")
+	     ("Recenter"           . follow-recenter)
+	     ("--")
+	     ("Previous Window"    . follow-previous-window)
+	     ("Next Windows"       . follow-next-window)
+	     ("Last Window"        . follow-last-window)
+	     ("First Window"       . follow-first-window)
+	     ("--")
+	     ("Switch To Buffer (all windows)"
+              . follow-switch-to-buffer-all)
+	     ("Switch To Buffer"   . follow-switch-to-buffer)
+	     ("--")
+	     ("Delete Other Windows and Split"
+              . follow-delete-other-windows-and-split)
+	     ("--")
+	     ("Scroll Down"        . follow-scroll-down)
+	     ("Scroll Up"          . follow-scroll-up)))
+
+	  ;; If there is a `tools' menu, we use it.  However, we can't add a
+	  ;; minor-mode specific item to it (it's broken), so we make the
+	  ;; contents ghosted when not in use, and add ourselves to the
+	  ;; global map.  If no `tools' menu is present, just make a
+	  ;; top-level menu visible when the mode is activated.
+
+	  (let ((tools-map (lookup-key (current-global-map) [menu-bar tools]))
+		(last nil))
+	    (if (sequencep tools-map)
+		(progn
+		  ;; Find the last entry in the menu and store it in `last'.
+		  (mapcar (function
+			   (lambda (x)
+			     (setq last (or (cdr-safe
+					     (cdr-safe
+					      (cdr-safe x)))
+					    last))))
+			  tools-map)
+		  (if last
+		      (progn
+			(funcall (symbol-function 'define-key-after)
+                                 tools-map [separator-follow] '("--") last)
+			(funcall (symbol-function 'define-key-after)
+				 tools-map [follow] (cons "Follow" menumap)
+				 'separator-follow))
+		    ;; Didn't find the last item, Adding to the top of
+		    ;; tools.  (This will probably never happend...)
+		    (define-key (current-global-map) [menu-bar tools follow]
+		      (cons "Follow" menumap))))
+	      ;; No tools menu, add "Follow" to the menubar.
+	      (define-key mainmap [menu-bar follow]
+		(cons "Follow" menumap)))))
+
+      ;;
+      ;; XEmacs.
+      ;;
+
+      ;; place the menu in the `Tools' menu.
+      (let ((menu '("Follow"
+		    :filter follow-menu-filter
+		    ["Scroll Up" follow-scroll-up t]
+		    ["Scroll Down" follow-scroll-down t]
+		    ["Delete Other Windows and Split"
+		     follow-delete-other-windows-and-split t]
+		    ["Switch To Buffer" follow-switch-to-buffer t]
+		    ["Switch To Buffer (all windows)"
+		     follow-switch-to-buffer-all t]
+		    ["First Window" follow-first-window t]
+		    ["Last Window" follow-last-window t]
+		    ["Next Windows" follow-next-window t]
+		    ["Previous Window" follow-previous-window t]
+		    ["Recenter" follow-recenter t]
+		    ["Deactivate" follow-mode t])))
+
+	;; Why not just `(set-buffer-menubar current-menubar)'?  The
+	;; question is a very good question.  The reason is that under
+	;; Emacs, neither `set-buffer-menubar' nor
+	;; `current-menubar' is defined, hence the byte-compiler will
+	;; warn.
+	(funcall (symbol-function 'set-buffer-menubar)
+		 (symbol-value 'current-menubar))
+	(funcall (symbol-function 'add-submenu) '("Tools") menu))
+
+      ;; When the mode is not activated, only one item is visible:
+      ;; "Activate".
+      (defun follow-menu-filter (menu)
+	(if follow-mode
+	    menu
+	  '(["Activate          " follow-mode t]))))
+    
+    mainmap)
+  "Minor mode keymap for Follow mode.")
+
+;;}}}
 
 (defcustom follow-mode-line-text " Follow"
-  "*Text shown in the mode line when Follow mode is active.
+  "Text shown in the mode line when Follow mode is active.
 Defaults to \" Follow\".  Examples of other values
 are \" Fw\", or simply \"\"."
   :type 'string
   :group 'follow)
 
 (defcustom follow-auto nil
-  "*Non-nil activates Follow mode whenever a file is loaded."
+  "Non-nil activates Follow mode whenever a file is loaded."
   :type 'boolean
   :group 'follow)
 
-(defcustom follow-mode-prefix "\C-c."
-  "*Prefix key to use for follow commands in Follow mode.
-The value of this variable is checked as part of loading Follow mode.
-After that, changing the prefix key requires manipulating keymaps."
-  :type 'string
-  :group 'follow)
-
-(defcustom follow-intercept-processes
-  (fboundp 'start-process)
-  "*When non-nil, Follow Mode will monitor process output."
+(defcustom follow-intercept-processes (fboundp 'start-process)
+  "When non-nil, Follow Mode will monitor process output."
   :type 'boolean
   :group 'follow)
 
-(defvar follow-emacs-version-xemacs-p
-  (string-match "XEmacs" emacs-version)
-  "Non-nil when running under XEmacs.")
-
-(defvar follow-avoid-tail-recenter-p
-  (not follow-emacs-version-xemacs-p)
+(defvar follow-avoid-tail-recenter-p (not (featurep 'xemacs))
   "*When non-nil, patch emacs so that tail windows won't be recentered.
 
 A \"tail window\" is a window that displays only the end of
@@ -381,38 +529,6 @@
   "Cache used by `follow-window-start-end'.")
 
 ;;}}}
-;;{{{ Bug report
-
-(eval-when-compile (require 'reporter))
-
-(defun follow-submit-feedback ()
-  "Submit feedback on Follow mode to the author: andersl@andersl.com"
-  (interactive)
-  (require 'reporter)
-  (and (y-or-n-p "Do you really want to submit a report on Follow mode? ")
-       (reporter-submit-bug-report
-	"Anders Lindgren <andersl@andersl.com>"
-	"follow.el"
-	'(post-command-hook
-	  pre-command-hook
-	  window-size-change-functions
-	  window-scroll-functions
-	  follow-mode-hook
-	  follow-mode-off-hook
-	  follow-auto
-	  follow-intercept-processes
-	  follow-avoid-tail-recenter-p
-	  follow-process-filter-alist)
-	nil
-	nil
-	(concat
-	 "Hi Anders!\n\n"
-	 "(I have read the section on how to report bugs in the "
-	 "Emacs manual.)\n\n"
-	 "Even though I know you are busy, I thought you might "
-	 "want to know...\n\n"))))
-
-;;}}}
 ;;{{{ Debug messages
 
 ;; This inline function must be as small as possible!
@@ -425,189 +541,10 @@
       (apply 'message args)))
 
 ;;}}}
-
-;;{{{ Keymap/Menu
-
-;;; Define keys for the follow-mode minor mode map and replace some
-;;; functions in the global map.  All `follow' mode special functions
-;;; can be found on (the somewhat cumbersome) "C-c . <key>"
-;;; (Control-C dot <key>). (As of Emacs 19.29 the keys
-;;; C-c <punctuation character> are reserved for minor modes.)
-;;;
-;;; To change the prefix, redefine `follow-mode-prefix' before
-;;; `follow' is loaded, or see the section on `follow-mode-hook'
-;;; above for an example of how to bind the keys the way you like.
-;;;
-;;; Please note that the keymap is defined the first time this file is
-;;; loaded.  Also note that the only legal way to manipulate the
-;;; keymap is to use `define-key'.  Don't change it using `setq' or
-;;; similar!
-
-
-(if follow-mode-map
-    nil
-  (setq follow-mode-map (make-sparse-keymap))
-  (let ((map (make-sparse-keymap)))
-    (define-key map "\C-v"	'follow-scroll-up)
-    (define-key map "\M-v"	'follow-scroll-down)
-    (define-key map "v"		'follow-scroll-down)
-    (define-key map "1"		'follow-delete-other-windows-and-split)
-    (define-key map "b"		'follow-switch-to-buffer)
-    (define-key map "\C-b"	'follow-switch-to-buffer-all)
-    (define-key map "\C-l"	'follow-recenter)
-    (define-key map "<"		'follow-first-window)
-    (define-key map ">"		'follow-last-window)
-    (define-key map "n"		'follow-next-window)
-    (define-key map "p"		'follow-previous-window)
-
-    (define-key follow-mode-map follow-mode-prefix map)
-
-    ;; Replace the standard `end-of-buffer', when in Follow Mode.  (I
-    ;; don't see the point in trying to replace every function that
-    ;; could be enhanced in Follow mode.  End-of-buffer is a special
-    ;; case since it is very simple to define and it greatly enhances
-    ;; the look and feel of Follow mode.)
-    ;;
-    ;; (The function `substitute-key-definition' does not work
-    ;; in all versions of Emacs.)
-    (mapcar
-     (function
-      (lambda (pair)
-	(let ((old (car pair))
-	      (new (cdr pair)))
-	  (mapcar (function (lambda (key)
-			      (define-key follow-mode-map key new)))
-		  (where-is-internal old global-map)))))
-     '((end-of-buffer      . follow-end-of-buffer)
-       (fkey-end-of-buffer . follow-end-of-buffer)))
-
-    ;;;
-    ;;; The menu.
-    ;;;
-
-    (if (not follow-emacs-version-xemacs-p)
-
-	;;
-	;; Emacs
-	;;
-	(let ((menumap (funcall (symbol-function 'make-sparse-keymap)
-			"Follow"))
-	      (count 0)
-	      id)
-	  (mapcar
-	   (function
-	    (lambda (item)
-	      (setq id
-		    (or (cdr item)
-			(progn
-			  (setq count (+ count 1))
-			  (intern (format "separator-%d" count)))))
-	      (define-key menumap (vector id) item)
-	      (or (eq id 'follow-mode)
-		  (put id 'menu-enable 'follow-mode))))
-	   ;; In reverse order:
-	   '(("Toggle Follow mode" . follow-mode)
-	     ("--")
-	     ("Recenter"           . follow-recenter)
-	     ("--")
-	     ("Previous Window"    . follow-previous-window)
-	     ("Next Windows"       . follow-next-window)
-	     ("Last Window"        . follow-last-window)
-	     ("First Window"       . follow-first-window)
-	     ("--")
-	     ("Switch To Buffer (all windows)"
-	                           . follow-switch-to-buffer-all)
-	     ("Switch To Buffer"   . follow-switch-to-buffer)
-	     ("--")
-	     ("Delete Other Windows and Split"
-	                           . follow-delete-other-windows-and-split)
-	     ("--")
-	     ("Scroll Down"        . follow-scroll-down)
-	     ("Scroll Up"          . follow-scroll-up)))
-
-	  ;; If there is a `tools' meny, we use it. However, we can't add a
-	  ;; minor-mode specific item to it (it's broken), so we make the
-	  ;; contents ghosted when not in use, and add ourselves to the
-	  ;; global map.  If no `tools' menu is present, just make a
-	  ;; top-level menu visible when the mode is activated.
-
-	  (let ((tools-map (lookup-key (current-global-map) [menu-bar tools]))
-		(last nil))
-	    (if (sequencep tools-map)
-		(progn
-		  ;; Find the last entry in the menu and store it in `last'.
-		  (mapcar (function
-			   (lambda (x)
-			     (setq last (or (cdr-safe
-					     (cdr-safe
-					      (cdr-safe x)))
-					    last))))
-			  tools-map)
-		  (if last
-		      (progn
-			(funcall (symbol-function 'define-key-after)
-				  tools-map [separator-follow] '("--") last)
-			(funcall (symbol-function 'define-key-after)
-				 tools-map [follow] (cons "Follow" menumap)
-				 'separator-follow))
-		    ;; Didn't find the last item, Adding to the top of
-		    ;; tools.  (This will probably never happend...)
-		    (define-key (current-global-map) [menu-bar tools follow]
-		      (cons "Follow" menumap))))
-	      ;; No tools menu, add "Follow" to the menubar.
-	      (define-key follow-mode-map [menu-bar follow]
-		(cons "Follow" menumap)))))
-
-      ;;
-      ;; XEmacs.
-      ;;
-
-      ;; place the menu in the `Tools' menu.
-      (let ((menu '("Follow"
-		    :filter follow-menu-filter
-		    ["Scroll Up" follow-scroll-up t]
-		    ["Scroll Down" follow-scroll-down t]
-		    ["Delete Other Windows and Split"
-		     follow-delete-other-windows-and-split t]
-		    ["Switch To Buffer" follow-switch-to-buffer t]
-		    ["Switch To Buffer (all windows)"
-		     follow-switch-to-buffer-all t]
-		    ["First Window" follow-first-window t]
-		    ["Last Window" follow-last-window t]
-		    ["Next Windows" follow-next-window t]
-		    ["Previous Window" follow-previous-window t]
-		    ["Recenter" follow-recenter t]
-		    ["Deactivate" follow-mode t])))
-
-	;; Why not just `(set-buffer-menubar current-menubar)'?  The
-	;; question is a very good question.  The reason is that under
-	;; Emacs, neither `set-buffer-menubar' nor
-	;; `current-menubar' is defined, hence the byte-compiler will
-	;; warn.
-	(funcall (symbol-function 'set-buffer-menubar)
-		 (symbol-value 'current-menubar))
-	(funcall (symbol-function 'add-submenu) '("Tools") menu))
-
-      ;; When the mode is not activated, only one item is visible:
-      ;; "Activate".
-      (defun follow-menu-filter (menu)
-	(if follow-mode
-	    menu
-	  '(["Activate          " follow-mode t]))))))
-
-
-;;; Register the follow mode keymap.
-(or (assq 'follow-mode minor-mode-map-alist)
-    (setq minor-mode-map-alist
-	  (cons (cons 'follow-mode follow-mode-map) minor-mode-map-alist)))
-
-;;}}}
 ;;{{{ Cache
 
-(let ((cmds follow-cache-command-list))
-  (while cmds
-    (put (car cmds) 'follow-mode-use-cache t)
-    (setq cmds (cdr cmds))))
+(dolist (cmd follow-cache-command-list)
+  (put cmd 'follow-mode-use-cache t))
 
 ;;}}}
 
@@ -615,20 +552,20 @@
 
 ;;;###autoload
 (defun turn-on-follow-mode ()
-  "Turn on Follow mode. Please see the function `follow-mode'."
+  "Turn on Follow mode.  Please see the function `follow-mode'."
   (interactive)
   (follow-mode 1))
 
 
 ;;;###autoload
 (defun turn-off-follow-mode ()
-  "Turn off Follow mode. Please see the function `follow-mode'."
+  "Turn off Follow mode.  Please see the function `follow-mode'."
   (interactive)
   (follow-mode -1))
 
-
+(put 'follow-mode 'permanent-local t)
 ;;;###autoload
-(defun follow-mode (arg)
+(define-minor-mode follow-mode
   "Minor mode that combines windows into one tall virtual window.
 
 The feeling of a \"virtual window\" has been accomplished by the use
@@ -665,39 +602,21 @@
 
 Keys specific to Follow mode:
 \\{follow-mode-map}"
-  (interactive "P")
-  (make-local-variable 'follow-mode)
-  (put 'follow-mode 'permanent-local t)
-  (let ((follow-mode-orig follow-mode))
-    (setq follow-mode
-	  (if (null arg)
-	      (not follow-mode)
-	    (> (prefix-numeric-value arg) 0)))
-    (if (and follow-mode follow-intercept-processes)
-	(follow-intercept-process-output))
-    (cond ((and follow-mode (not follow-mode-orig)) ; On
-	   ;; XEmacs: If this is non-nil, the window will scroll before
-	   ;; the point will have a chance to get into the next window.
-	   (if (boundp 'scroll-on-clipped-lines)
-	       (set 'scroll-on-clipped-lines nil))
-	   (force-mode-line-update)
-	   (add-hook 'post-command-hook 'follow-post-command-hook t)
-	   (run-hooks 'follow-mode-hook))
+  :keymap follow-mode-map
+  (if (and follow-mode follow-intercept-processes)
+      (follow-intercept-process-output))
+  (cond (follow-mode ; On
+         ;; XEmacs: If this is non-nil, the window will scroll before
+         ;; the point will have a chance to get into the next window.
+         (if (boundp 'scroll-on-clipped-lines)
+             (setq scroll-on-clipped-lines nil))
+         (force-mode-line-update)
+         (add-hook 'post-command-hook 'follow-post-command-hook t)
+         (run-hooks 'follow-mode-hook))
 
-	  ((and (not follow-mode) follow-mode-orig) ; Off
-	   (force-mode-line-update)
-	   (run-hooks 'follow-mode-off-hook)))))
-
-
-;; Register follow-mode as a minor mode.
-
-(if (fboundp 'add-minor-mode)
-    ;; XEmacs
-    (funcall (symbol-function 'add-minor-mode)
-	     'follow-mode 'follow-mode-line-text)
-  (or (assq 'follow-mode minor-mode-alist)
-      (setq minor-mode-alist
-	    (cons '(follow-mode follow-mode-line-text) minor-mode-alist))))
+        ((not follow-mode) ; Off
+         (force-mode-line-update)
+         (run-hooks 'follow-mode-off-hook))))
 
 ;;}}}
 ;;{{{ Find file hook
@@ -1033,7 +952,7 @@
 If WIN is nil, the selected window is used.
 
 Returns (end-pos end-of-buffer-p)"
-  (if follow-emacs-version-xemacs-p
+  (if (featurep 'xemacs)
       ;; XEmacs can calculate the end of the window by using
       ;; the 'guarantee options. GOOD!
       (let ((end (window-end win t)))
@@ -1511,7 +1430,7 @@
 ;;}}}
 ;;{{{ Post Command Hook
 
-;;; The magic little box. This function is called after every command.
+;; The magic little box. This function is called after every command.
 
 ;; This is not as complicated as it seems. It is simply a list of common
 ;; display situations and the actions to take, plus commands for redrawing
@@ -1735,17 +1654,17 @@
 
 ;;;; Scroll-bar support code.
 
-;;; Why is it needed? Well, if the selected window is in follow mode,
-;;; all its follower stick to it blindly. If one of them is scrolled,
-;;; it immediately returns to the original position when the mouse is
-;;; released. If the selected window is not a follower of the dragged
-;;; window the windows will be unaligned.
+;; Why is it needed? Well, if the selected window is in follow mode,
+;; all its follower stick to it blindly. If one of them is scrolled,
+;; it immediately returns to the original position when the mouse is
+;; released. If the selected window is not a follower of the dragged
+;; window the windows will be unaligned.
 
-;;; The advices doesn't get compiled. Aestetically, this might be a
-;;; problem but in practical life it isn't.
+;; The advices doesn't get compiled. Aestetically, this might be a
+;; problem but in practical life it isn't.
 
-;;; Discussion: Now when the other windows in the chain follow the
-;;; dragged, should we really select it?
+;; Discussion: Now when the other windows in the chain follow the
+;; dragged, should we really select it?
 
 (cond ((fboundp 'scroll-bar-drag)
        ;;;
@@ -1851,29 +1770,29 @@
 ;;}}}
 ;;{{{ Process output
 
-;;; The following sections installs a spy that listens to process
-;;; output and tries to reposition the windows whose buffers are in
-;;; Follow mode.  We play safe as much as possible...
-;;;
-;;; When follow-mode is activated all active processes are
-;;; intercepted.  All new processes that change their filter function
-;;; using `set-process-filter' are also intercepted.  The reason is
-;;; that a process can cause a redisplay recentering "tail" windows.
-;;; Note that it doesn't hurt to spy on more processes than needed.
-;;;
-;;; Technically, we set the process filter to `follow-generic-filter'.
-;;; The original filter is stored in `follow-process-filter-alist'.
-;;; Our generic filter calls the original filter, or inserts the
-;;; output into the buffer, if the buffer originally didn't have an
-;;; output filter.  It also makes sure that the windows connected to
-;;; the buffer are aligned.
-;;;
-;;; Discussion: How do we find processes that don't call
-;;; `set-process-filter'?  (How often are processes created in a
-;;; buffer after Follow mode are activated?)
-;;;
-;;; Discussion: Should we also advice `process-filter' to make our
-;;; filter invisible to others?
+;; The following sections installs a spy that listens to process
+;; output and tries to reposition the windows whose buffers are in
+;; Follow mode.  We play safe as much as possible...
+;;
+;; When follow-mode is activated all active processes are
+;; intercepted.  All new processes that change their filter function
+;; using `set-process-filter' are also intercepted.  The reason is
+;; that a process can cause a redisplay recentering "tail" windows.
+;; Note that it doesn't hurt to spy on more processes than needed.
+;;
+;; Technically, we set the process filter to `follow-generic-filter'.
+;; The original filter is stored in `follow-process-filter-alist'.
+;; Our generic filter calls the original filter, or inserts the
+;; output into the buffer, if the buffer originally didn't have an
+;; output filter.  It also makes sure that the windows connected to
+;; the buffer are aligned.
+;;
+;; Discussion: How do we find processes that don't call
+;; `set-process-filter'?  (How often are processes created in a
+;; buffer after Follow mode are activated?)
+;;
+;; Discussion: Should we also advice `process-filter' to make our
+;; filter invisible to others?
 
 ;;{{{ Advice for `set-process-filter'
 
@@ -1980,7 +1899,7 @@
 
 The only reason to call this function is if the Follow mode spy filter
 would interfere with some other package.  If this happens, please
-report this using the `follow-submit-feedback' function."
+report this using the `report-emacs-bug' function."
   (interactive)
   (follow-tidy-process-filter-alist)
   (let ((list (process-list)))
@@ -1999,12 +1918,12 @@
 ;;}}}
 ;;{{{ The filter
 
-;;; The following section is a naive method to make buffers with
-;;; process output to work with Follow mode. Whenever the start of the
-;;; window displaying the buffer is moved, we moves it back to its
-;;; original position and try to select a new window.  (If we fail,
-;;; the normal redisplay functions of Emacs will scroll it right
-;;; back!)
+;; The following section is a naive method to make buffers with
+;; process output to work with Follow mode. Whenever the start of the
+;; window displaying the buffer is moved, we moves it back to its
+;; original position and try to select a new window.  (If we fail,
+;; the normal redisplay functions of Emacs will scroll it right
+;; back!)
 
 (defun follow-generic-filter (proc output)
   "Process output filter for process connected to buffers in Follow mode."
@@ -2219,7 +2138,7 @@
 ;; unless we are in `slow-search-mode', i.e. only a few lines
 ;; of text is visible.
 
-(if follow-emacs-version-xemacs-p
+(if (featurep 'xemacs)
     (defadvice isearch-done (before follow-isearch-done activate)
       (if (and (boundp 'follow-mode)
 	       follow-mode
@@ -2235,28 +2154,28 @@
 ;;}}}
 ;;{{{ Tail window handling
 
-;;; In Emacs (not XEmacs) windows showing nothing are sometimes
-;;; recentered.  When in Follow Mode, this is not desireable for
-;;; non-first windows in the window chain.  This section tries to
-;;; make the windows stay where they should be.
-;;;
-;;; If the display is updated, all windows starting at (point-max) are
-;;; going to be recentered at the next redisplay, unless we do a
-;;; read-and-write cycle to update the `force' flag inside the windows.
-;;;
-;;; In 19.30, a new varible `window-scroll-functions' is called every
-;;; time a window is recentered.  It is not perfect for our situation,
-;;; since when it is called for a tail window, it is to late.  However,
-;;; if it is called for another window, we can try to update our
-;;; windows.
-;;;
-;;; By patching `sit-for' we can make sure that to catch all explicit
-;;; updates initiated by lisp programs.  Internal calls, on the other
-;;; hand, are not handled.
-;;;
-;;; Please note that the function `follow-avoid-tail-recenter' is also
-;;; called from other places, e.g. `post-command-hook' and
-;;; `post-command-idle-hook'.
+;; In Emacs (not XEmacs) windows showing nothing are sometimes
+;; recentered.  When in Follow Mode, this is not desireable for
+;; non-first windows in the window chain.  This section tries to
+;; make the windows stay where they should be.
+;;
+;; If the display is updated, all windows starting at (point-max) are
+;; going to be recentered at the next redisplay, unless we do a
+;; read-and-write cycle to update the `force' flag inside the windows.
+;;
+;; In 19.30, a new varible `window-scroll-functions' is called every
+;; time a window is recentered.  It is not perfect for our situation,
+;; since when it is called for a tail window, it is to late.  However,
+;; if it is called for another window, we can try to update our
+;; windows.
+;;
+;; By patching `sit-for' we can make sure that to catch all explicit
+;; updates initiated by lisp programs.  Internal calls, on the other
+;; hand, are not handled.
+;;
+;; Please note that the function `follow-avoid-tail-recenter' is also
+;; called from other places, e.g. `post-command-hook' and
+;; `post-command-idle-hook'.
 
 ;; If this function is called it is too late for this window, but
 ;; we might save other windows from being recentered.
@@ -2328,9 +2247,9 @@
 
 ;;{{{ The end
 
-;;;
-;;; We're done!
-;;;
+;;
+;; We're done!
+;;
 
 (provide 'follow)
 
--- a/lisp/gnus/ChangeLog	Fri Apr 21 05:39:14 2006 +0000
+++ b/lisp/gnus/ChangeLog	Tue May 02 05:51:52 2006 +0000
@@ -1,3 +1,68 @@
+2006-04-28  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+	* mm-uu.el (mm-uu-pgp-encrypted-extract-1): Assume buffer is made
+	unibyte after clear-decrypt function runs.
+
+	* mml2015.el (mml2015-pgg-clear-decrypt): Treat data which pgg
+	returns as a unibyte string.
+
+2006-04-27  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+	* mml1991.el (mml1991-pgg-sign): No need to load pgg.el, which is
+	always loaded by way of gnus-art.el -> mm-uu.el -> mml2015.el.
+	(mml1991-pgg-encrypt): Ditto.
+
+2006-04-26  Reiner Steib  <Reiner.Steib@gmx.de>
+
+	* deuglify.el (gnus-outlook-deuglify-unwrap-min)
+	(gnus-outlook-deuglify-unwrap-max): Remove autoload.
+
+	* mml-sec.el (mml-secure-method): New internal variable.
+	(mml-secure-sign, mml-secure-encrypt, mml-secure-message-sign)
+	(mml-secure-message-sign-encrypt, mml-secure-message-encrypt): New
+	functions using mml-secure-method.  Sync from the trunk.
+
+	* mml.el (mml-mode-map): Add key bindings for those functions.
+	(mml-menu): Simplify security menu entries.  Suggested by Jesper
+	Harder <harder@myrealbox.com>.  Sync from the trunk.
+
+	* message.el (message-valid-fqdn-regexp): Add TLDs .cat, jobs,
+	.mobi and .travel.  Remove .nato, .bitnet and .uucp.
+	(message-in-body-p): New function.  Sync from the trunk.
+
+	* mml.el (mml-mode, mml-dnd-protocol-alist)
+	(mml-dnd-attach-options, mml-dnd-attach-file)
+	(mml-attach-file, mml-attach-buffer, mml-attach-external): Sync
+	DND support and use of message-in-body-p from the trunk.
+
+2006-04-26  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+	* mml1991.el (mml1991-pgg-sign): Make sure to load pgg.el before
+	binding pgg-* variables; reimplement the section which prevents
+	MIME header from being signed.
+	(mml1991-pgg-encrypt): Make sure to load pgg.el before binding
+	pgg-text-mode; remove a blank line at the top of body.
+
+	* mm-uu.el (mm-uu-pgp-encrypted-extract-1): Don't remove blank
+	lines at the top of body; use gnus-newsgroup-charset if there's no
+	Charset header.
+
+2006-04-25  Andreas Seltenreich  <uwi7@rz.uni-karlsruhe.de>
+
+	* nnweb.el (nnweb-google-wash-article): Sync up to new Google
+	HTML.
+
+2006-04-25  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+	* mm-uu.el (mm-uu-pgp-signed-test): Erase prompt.
+	(mm-uu-pgp-encrypted-test): Ditto.
+	(mm-uu-pgp-encrypted-extract-1): Make sure there's a blank line
+	between header and body; return application/pgp-encrypted handle
+	if decryption failed; decode decrypted body by charset.
+
+	* mm-decode.el (mm-automatic-display): Don't make application/pgp
+	element match to application/pgp-*.
+
 2006-04-20  Reiner Steib  <Reiner.Steib@gmx.de>
 
 	* gnus-util.el (gnus-replace-in-string): Prefer
@@ -419,13 +484,6 @@
 
 2006-02-09  Daiki Ueno  <ueno@unixuser.org>
 
-	* pgg-gpg.el (pgg-gpg-encrypt-region): Don't convert line-endings
-	in elisp.
-	(pgg-gpg-encrypt-symmetric-region): Ditto.
-	(pgg-gpg-sign-region): Ditto.
-
-	* pgg-def.el (pgg-text-mode): New variable.
-
 	* mml2015.el (mml2015-pgg-sign): Enable pgg-text-mode.
 	(mml2015-pgg-encrypt): Ditto.
 
--- a/lisp/gnus/deuglify.el	Fri Apr 21 05:39:14 2006 +0000
+++ b/lisp/gnus/deuglify.el	Tue May 02 05:51:52 2006 +0000
@@ -234,14 +234,12 @@
   :version "22.1"
   :group 'gnus)
 
-;;;###autoload
 (defcustom gnus-outlook-deuglify-unwrap-min 45
   "Minimum length of the cited line above the (possibly) wrapped line."
   :version "22.1"
   :type 'integer
   :group 'gnus-outlook-deuglify)
 
-;;;###autoload
 (defcustom gnus-outlook-deuglify-unwrap-max 95
   "Maximum length of the cited line after unwrapping."
   :version "22.1"
@@ -288,7 +286,6 @@
   :type 'string
   :group 'gnus-outlook-deuglify)
 
-;;;###autoload
 (defcustom gnus-outlook-display-hook nil
   "A hook called after an deuglified article has been prepared.
 It is run after `gnus-article-prepare-hook'."
--- a/lisp/gnus/message.el	Fri Apr 21 05:39:14 2006 +0000
+++ b/lisp/gnus/message.el	Tue May 02 05:51:52 2006 +0000
@@ -1586,11 +1586,16 @@
 (defcustom message-valid-fqdn-regexp
   (concat "[a-z0-9][-.a-z0-9]+\\." ;; [hostname.subdomain.]domain.
 	  ;; valid TLDs:
-	  "\\([a-z][a-z]" ;; two letter country TDLs
-	  "\\|biz\\|com\\|edu\\|gov\\|int\\|mil\\|net\\|org"
-	  "\\|aero\\|coop\\|info\\|name\\|museum"
-	  "\\|arpa\\|pro\\|uucp\\|bitnet\\|bofh" ;; old style?
-	  "\\)")
+	  "\\([a-z][a-z]\\|" ;; two letter country TDLs
+	  "aero\\|arpa\\|bitnet\\|biz\\|bofh\\|"
+	  "cat\\|com\\|coop\\|edu\\|gov\\|"
+	  "info\\|int\\|jobs\\|"
+	  "mil\\|mobi\\|museum\\|name\\|net\\|"
+	  "org\\|pro\\|travel\\|uucp\\)")
+  ;; http://en.wikipedia.org/wiki/List_of_Internet_top-level_domains
+  ;; http://en.wikipedia.org/wiki/GTLD
+  ;; `in the process of being approved': .asia .post .tel .sex
+  ;; "dead" nato bitnet uucp
   "Regular expression that matches a valid FQDN."
   ;; see also: gnus-button-valid-fqdn-regexp
   :version "22.1"
@@ -2679,6 +2684,11 @@
   (or (search-forward (concat "\n" mail-header-separator "\n") nil t)
       (search-forward-regexp "[^:]+:\\([^\n]\\|\n[ \t]\\)+\n\n" nil t)))
 
+(defun message-in-body-p ()
+  "Return t if point is in the message body."
+  (let ((body (save-excursion (message-goto-body) (point))))
+    (>= (point) body)))
+
 (defun message-goto-eoh ()
   "Move point to the end of the headers."
   (interactive)
--- a/lisp/gnus/mm-decode.el	Fri Apr 21 05:39:14 2006 +0000
+++ b/lisp/gnus/mm-decode.el	Tue May 02 05:51:52 2006 +0000
@@ -307,7 +307,7 @@
     "application/pkcs7-signature" "application/x-pkcs7-mime"
     "application/pkcs7-mime"
     ;; Mutt still uses this even though it has already been withdrawn.
-    "application/pgp")
+    "application/pgp\\'")
   "A list of MIME types to be displayed automatically."
   :type '(repeat regexp)
   :group 'mime-display)
--- a/lisp/gnus/mm-uu.el	Fri Apr 21 05:39:14 2006 +0000
+++ b/lisp/gnus/mm-uu.el	Tue May 02 05:51:52 2006 +0000
@@ -352,7 +352,9 @@
     ((eq mm-verify-option 'never) nil)
     ((eq mm-verify-option 'always) t)
     ((eq mm-verify-option 'known) t)
-    (t (y-or-n-p "Verify pgp signed part? ")))))
+    (t (prog1
+	   (y-or-n-p "Verify pgp signed part? ")
+	 (message ""))))))
 
 (eval-when-compile
   (defvar gnus-newsgroup-charset))
@@ -403,15 +405,51 @@
     ((eq mm-decrypt-option 'never) nil)
     ((eq mm-decrypt-option 'always) t)
     ((eq mm-decrypt-option 'known) t)
-    (t (y-or-n-p "Decrypt pgp encrypted part? ")))))
+    (t (prog1
+	   (y-or-n-p "Decrypt pgp encrypted part? ")
+	 (message ""))))))
 
 (defun mm-uu-pgp-encrypted-extract-1 (handles ctl)
-  (let ((buf (mm-uu-copy-to-buffer (point-min) (point-max))))
-    (if (mm-uu-pgp-encrypted-test)
-	(with-current-buffer buf
-	  (mml2015-clean-buffer)
-	  (funcall (mml2015-clear-decrypt-function))))
-    (list (mm-make-handle buf mm-uu-text-plain-type))))
+  (let ((buf (mm-uu-copy-to-buffer (point-min) (point-max)))
+	(first t)
+	charset)
+    ;; Make sure there's a blank line between header and body.
+    (with-current-buffer buf
+      (goto-char (point-min))
+      (while (prog2
+		 (forward-line 1)
+		 (if first
+		     (looking-at "[^\t\n ]+:")
+		   (looking-at "[^\t\n ]+:\\|[\t ]"))
+	       (setq first nil)))
+      (unless (memq (char-after) '(?\n nil))
+	(insert "\n"))
+      (save-restriction
+	(narrow-to-region (point-min) (point))
+	(setq charset (mail-fetch-field "charset")))
+      (if (and (mm-uu-pgp-encrypted-test)
+	       (progn
+		 (mml2015-clean-buffer)
+		 (funcall (mml2015-clear-decrypt-function))
+		 (equal (mm-handle-multipart-ctl-parameter mm-security-handle
+							   'gnus-info)
+			"OK")))
+	  (progn
+	    ;; Decode charset.
+	    (if (and (or charset
+			 (setq charset gnus-newsgroup-charset))
+		     (setq charset (mm-charset-to-coding-system charset))
+		     (not (eq charset 'ascii)))
+		;; Assume that buffer's multibyteness is turned off.
+		;; See `mml2015-pgg-clear-decrypt'.
+		(insert (mm-decode-coding-string (prog1
+						     (buffer-string)
+						   (erase-buffer)
+						   (mm-enable-multibyte))
+						 charset))
+	      (mm-enable-multibyte))
+	    (list (mm-make-handle buf mm-uu-text-plain-type)))
+	(list (mm-make-handle buf '("application/pgp-encrypted")))))))
 
 (defun mm-uu-pgp-encrypted-extract ()
   (let ((mm-security-handle (list (format "multipart/encrypted"))))
--- a/lisp/gnus/mml-sec.el	Fri Apr 21 05:39:14 2006 +0000
+++ b/lisp/gnus/mml-sec.el	Tue May 02 05:51:52 2006 +0000
@@ -188,6 +188,29 @@
 						(cons method tags))))
 	    (t (error "The message is corrupted. No mail header separator"))))))
 
+(defvar mml-secure-method
+  (if (equal mml-default-encrypt-method mml-default-sign-method)
+      mml-default-sign-method
+    "pgpmime")
+  "Current security method.  Internal variable.")
+
+(defun mml-secure-sign (&optional method)
+  "Add MML tags to sign this MML part.
+Use METHOD if given.  Else use `mml-secure-method' or
+`mml-default-sign-method'."
+  (interactive)
+  (mml-secure-part
+   (or method mml-secure-method mml-default-sign-method)
+   'sign))
+
+(defun mml-secure-encrypt (&optional method)
+  "Add MML tags to encrypt this MML part.
+Use METHOD if given.  Else use `mml-secure-method' or
+`mml-default-sign-method'."
+  (interactive)
+  (mml-secure-part
+   (or method mml-secure-method mml-default-sign-method)))
+
 (defun mml-secure-sign-pgp ()
   "Add MML tags to PGP sign this MML part."
   (interactive)
@@ -249,6 +272,34 @@
     (when (re-search-backward "^<#secure.*>\n" nil t)
       (delete-region (match-beginning 0) (match-end 0)))))
 
+
+(defun mml-secure-message-sign (&optional method)
+  "Add MML tags to sign this MML part.
+Use METHOD if given. Else use `mml-secure-method' or
+`mml-default-sign-method'."
+  (interactive)
+  (mml-secure-part
+   (or method mml-secure-method mml-default-sign-method)
+   'sign))
+
+(defun mml-secure-message-sign-encrypt (&optional method)
+  "Add MML tag to sign and encrypt the entire message.
+Use METHOD if given. Else use `mml-secure-method' or
+`mml-default-sign-method'."
+  (interactive)
+  (mml-secure-message
+   (or method mml-secure-method mml-default-sign-method)
+   'signencrypt))
+
+(defun mml-secure-message-encrypt (&optional method)
+  "Add MML tag to encrypt the entire message.
+Use METHOD if given. Else use `mml-secure-method' or
+`mml-default-sign-method'."
+  (interactive)
+  (mml-secure-message
+   (or method mml-secure-method mml-default-sign-method)
+   'encrypt))
+
 (defun mml-secure-message-sign-smime ()
   "Add MML tag to encrypt/sign the entire message."
   (interactive)
--- a/lisp/gnus/mml.el	Fri Apr 21 05:39:14 2006 +0000
+++ b/lisp/gnus/mml.el	Tue May 02 05:51:52 2006 +0000
@@ -40,7 +40,8 @@
   (autoload 'message-fetch-field "message")
   (autoload 'message-info "message")
   (autoload 'fill-flowed-encode "flow-fill")
-  (autoload 'message-posting-charset "message"))
+  (autoload 'message-posting-charset "message")
+  (autoload 'dnd-get-local-file-name "dnd"))
 
 (defvar gnus-article-mime-handles)
 (defvar gnus-mouse-2)
@@ -51,6 +52,7 @@
 (defvar message-posting-charset)
 (defvar message-required-mail-headers)
 (defvar message-required-news-headers)
+(defvar dnd-protocol-alist)
 
 (defcustom mml-content-type-parameters
   '(name access-type expiration size permission format)
@@ -877,6 +879,11 @@
 	(encryptpart (make-sparse-keymap))
 	(map (make-sparse-keymap))
 	(main (make-sparse-keymap)))
+    (define-key map "\C-s" 'mml-secure-message-sign)
+    (define-key map "\C-c" 'mml-secure-message-encrypt)
+    (define-key map "\C-e" 'mml-secure-message-sign-encrypt)
+    (define-key map "\C-p\C-s" 'mml-secure-sign)
+    (define-key map "\C-p\C-c" 'mml-secure-encrypt)
     (define-key sign "p" 'mml-secure-message-sign-pgpmime)
     (define-key sign "o" 'mml-secure-message-sign-pgp)
     (define-key sign "s" 'mml-secure-message-sign-smime)
@@ -914,26 +921,54 @@
     ["Attach File..." mml-attach-file
      ,@(if (featurep 'xemacs) '(t)
 	 '(:help "Attach a file at point"))]
-    ["Attach Buffer..." mml-attach-buffer t]
-    ["Attach External..." mml-attach-external t]
-    ["Insert Part..." mml-insert-part t]
-    ["Insert Multipart..." mml-insert-multipart t]
-    ["PGP/MIME Sign" mml-secure-message-sign-pgpmime t]
-    ["PGP/MIME Encrypt" mml-secure-message-encrypt-pgpmime t]
-    ["PGP Sign" mml-secure-message-sign-pgp t]
-    ["PGP Encrypt" mml-secure-message-encrypt-pgp t]
-    ["S/MIME Sign" mml-secure-message-sign-smime t]
-    ["S/MIME Encrypt" mml-secure-message-encrypt-smime t]
-    ("Secure MIME part"
-     ["PGP/MIME Sign Part" mml-secure-sign-pgpmime t]
-     ["PGP/MIME Encrypt Part" mml-secure-encrypt-pgpmime t]
-     ["PGP Sign Part" mml-secure-sign-pgp t]
-     ["PGP Encrypt Part" mml-secure-encrypt-pgp t]
-     ["S/MIME Sign Part" mml-secure-sign-smime t]
-     ["S/MIME Encrypt Part" mml-secure-encrypt-smime t])
-    ["Encrypt/Sign off" mml-unsecure-message t]
+    ["Attach Buffer..." mml-attach-buffer
+     ,@(if (featurep 'xemacs) '(t)
+	 '(:help "Attach a buffer to the outgoing MIME message"))]
+    ["Attach External..." mml-attach-external
+     ,@(if (featurep 'xemacs) '(t)
+	 '(:help "Attach reference to file"))]
+    ;;
+    ("Change Security Method"
+     ["PGP/MIME"
+      (lambda () (interactive) (setq mml-secure-method "pgpmime"))
+      ,@(if (featurep 'xemacs) nil
+	  '(:help "Set Security Method to PGP/MIME"))
+      :style radio
+      :selected (equal mml-secure-method "pgpmime") ]
+     ["S/MIME"
+      (lambda () (interactive) (setq mml-secure-method "smime"))
+      ,@(if (featurep 'xemacs) nil
+	  '(:help "Set Security Method to S/MIME"))
+      :style radio
+      :selected (equal mml-secure-method "smime") ]
+     ["Inline PGP"
+      (lambda () (interactive) (setq mml-secure-method "pgp"))
+      ,@(if (featurep 'xemacs) nil
+	  '(:help "Set Security Method to inline PGP"))
+      :style radio
+      :selected (equal mml-secure-method "pgp") ] )
+    ;;
+    ["Sign Message" mml-secure-message-sign t]
+    ["Encrypt Message" mml-secure-message-encrypt t]
+    ["Sign and Encrypt Message" mml-secure-message-sign-encrypt t]
+    ["Encrypt/Sign off" mml-unsecure-message
+     ,@(if (featurep 'xemacs) '(t)
+	 '(:help "Don't Encrypt/Sign Message"))]
+    ;; Maybe we could remove these, because people who write MML most probably
+    ;; don't use the menu:
+    ["Insert Part..." mml-insert-part
+     :active (message-in-body-p)]
+    ["Insert Multipart..." mml-insert-multipart
+     :active (message-in-body-p)]
+    ;;
+    ;; Do we have separate encrypt and encrypt/sign commands for parts?
+    ["Sign Part" mml-secure-sign t]
+    ["Encrypt Part" mml-secure-encrypt t]
     ;;["Narrow" mml-narrow-to-part t]
-    ["Quote MML" mml-quote-region t]
+    ["Quote MML in region" mml-quote-region
+     :active (message-mark-active-p)
+     ,@(if (featurep 'xemacs) nil
+	 '(:help "Quote MML tags in region"))]
     ["Validate MML" mml-validate t]
     ["Preview" mml-preview t]
     "----"
@@ -957,8 +992,11 @@
   (when (set (make-local-variable 'mml-mode)
 	     (if (null arg) (not mml-mode)
 	       (> (prefix-numeric-value arg) 0)))
-    (gnus-add-minor-mode 'mml-mode " MML" mml-mode-map)
+    (add-minor-mode 'mml-mode " MML" mml-mode-map)
     (easy-menu-add mml-menu mml-mode-map)
+    (when (boundp 'dnd-protocol-alist)
+      (set (make-local-variable 'dnd-protocol-alist)
+	   (append mml-dnd-protocol-alist dnd-protocol-alist)))
     (run-hooks 'mml-mode-hook)))
 
 ;;;
@@ -1056,6 +1094,36 @@
 
 ;;; Attachment functions.
 
+(defcustom mml-dnd-protocol-alist
+  '(("^file:///" . mml-dnd-attach-file)
+    ("^file://"  . dnd-open-file)
+    ("^file:"    . mml-dnd-attach-file))
+  "The functions to call when a drop in `mml-mode' is made.
+See `dnd-protocol-alist' for more information.  When nil, behave
+as in other buffers."
+  :type '(choice (repeat (cons (regexp) (function)))
+		 (const :tag "Behave as in other buffers" nil))
+  :version "22.1" ;; Gnus 5.10.9
+  :group 'message)
+
+(defcustom mml-dnd-attach-options nil
+  "Which options should be queried when attaching a file via drag and drop.
+
+If it is a list, valid members are `type', `description' and
+`disposition'.  `disposition' implies `type'.  If it is nil,
+don't ask for options.  If it is t, ask the user whether or not
+to specify options."
+  :type '(choice
+	  (const :tag "Non" nil)
+	  (const :tag "Query" t)
+	  (list :value (type description disposition)
+	   (set :inline t
+		(const type)
+		(const description)
+		(const disposition))))
+  :version "22.1" ;; Gnus 5.10.9
+  :group 'message)
+
 (defun mml-attach-file (file &optional type description disposition)
   "Attach a file to the outgoing MIME message.
 The file is not inserted or encoded until you send the message with
@@ -1073,11 +1141,37 @@
 	  (description (mml-minibuffer-read-description))
 	  (disposition (mml-minibuffer-read-disposition type)))
      (list file type description disposition)))
-  (mml-insert-empty-tag 'part
-			'type type
-			'filename file
-			'disposition (or disposition "attachment")
-			'description description))
+  (save-excursion
+    (unless (message-in-body-p) (goto-char (point-max)))
+    (mml-insert-empty-tag 'part
+			  'type type
+			  'filename file
+			  'disposition (or disposition "attachment")
+			  'description description)))
+
+(defun mml-dnd-attach-file (uri action)
+  "Attach a drag and drop file.
+
+Ask for type, description or disposition according to
+`mml-dnd-attach-options'."
+  (let ((file (dnd-get-local-file-name uri t)))
+    (when (and file (file-regular-p file))
+      (let ((mml-dnd-attach-options mml-dnd-attach-options)
+	    type description disposition)
+	(setq mml-dnd-attach-options
+	      (when (and (eq mml-dnd-attach-options t)
+			 (not
+			  (y-or-n-p
+			   "Use default type, disposition and description? ")))
+		'(type description disposition)))
+	(when (or (memq 'type mml-dnd-attach-options)
+		  (memq 'disposition mml-dnd-attach-options))
+	  (setq type (mml-minibuffer-read-type file)))
+	(when (memq 'description mml-dnd-attach-options)
+	  (setq description (mml-minibuffer-read-description)))
+	(when (memq 'disposition mml-dnd-attach-options)
+	  (setq disposition (mml-minibuffer-read-disposition type)))
+	(mml-attach-file file type description disposition)))))
 
 (defun mml-attach-buffer (buffer &optional type description)
   "Attach a buffer to the outgoing MIME message.
@@ -1087,8 +1181,11 @@
 	  (type (mml-minibuffer-read-type buffer "text/plain"))
 	  (description (mml-minibuffer-read-description)))
      (list buffer type description)))
-  (mml-insert-empty-tag 'part 'type type 'buffer buffer
-			'disposition "attachment" 'description description))
+  (save-excursion
+    (unless (message-in-body-p) (goto-char (point-max)))
+    (mml-insert-empty-tag 'part 'type type 'buffer buffer
+			  'disposition "attachment"
+			  'description description)))
 
 (defun mml-attach-external (file &optional type description)
   "Attach an external file into the buffer.
@@ -1099,8 +1196,10 @@
 	  (type (mml-minibuffer-read-type file))
 	  (description (mml-minibuffer-read-description)))
      (list file type description)))
-  (mml-insert-empty-tag 'external 'type type 'name file
-			'disposition "attachment" 'description description))
+  (save-excursion
+    (unless (message-in-body-p) (goto-char (point-max)))
+    (mml-insert-empty-tag 'external 'type type 'name file
+			  'disposition "attachment" 'description description)))
 
 (defun mml-insert-multipart (&optional type)
   (interactive (list (completing-read "Multipart type (default mixed): "
--- a/lisp/gnus/mml1991.el	Fri Apr 21 05:39:14 2006 +0000
+++ b/lisp/gnus/mml1991.el	Tue May 02 05:51:52 2006 +0000
@@ -230,22 +230,22 @@
 
 (defun mml1991-pgg-sign (cont)
   (let ((pgg-text-mode t)
+	(pgg-default-user-id (or (message-options-get 'mml-sender)
+				 pgg-default-user-id))
 	headers cte)
     ;; Don't sign headers.
     (goto-char (point-min))
-    (while (not (looking-at "^$"))
-      (forward-line))
-    (unless (eobp) ;; no headers?
+    (when (re-search-forward "^$" nil t)
       (setq headers (buffer-substring (point-min) (point)))
-      (forward-line) ;; skip header/body separator
-      (delete-region (point-min) (point)))
-    (when (string-match "^Content-Transfer-Encoding: \\(.+\\)" headers)
-      (setq cte (intern (match-string 1 headers))))
-    (mm-decode-content-transfer-encoding cte)
-    (unless (let ((pgg-default-user-id
-		   (or (message-options-get 'mml-sender)
-		       pgg-default-user-id)))
-	      (pgg-sign-region (point-min) (point-max) t))
+      (save-restriction
+	(narrow-to-region (point-min) (point))
+	(setq cte (mail-fetch-field "content-transfer-encoding")))
+      (forward-line 1)
+      (delete-region (point-min) (point))
+      (when cte
+	(setq cte (intern (downcase cte)))
+	(mm-decode-content-transfer-encoding cte)))
+    (unless (pgg-sign-region (point-min) (point-max) t)
       (pop-to-buffer pgg-errors-buffer)
       (error "Encrypt error"))
     (delete-region (point-min) (point-max))
@@ -254,7 +254,8 @@
       (goto-char (point-min))
       (while (re-search-forward "\r+$" nil t)
 	(replace-match "" t t))
-      (mm-encode-content-transfer-encoding cte)
+      (when cte
+	(mm-encode-content-transfer-encoding cte))
       (goto-char (point-min))
       (when headers
 	(insert headers))
@@ -262,18 +263,18 @@
     t))
 
 (defun mml1991-pgg-encrypt (cont &optional sign)
-  (let ((pgg-text-mode t)
-	cte)
-    ;; Strip MIME Content[^ ]: headers since it will be ASCII ARMOURED
-    (goto-char (point-min))
-    (while (looking-at "^Content[^ ]+:")
-      (when (looking-at "^Content-Transfer-Encoding: \\(.+\\)")
-	(setq cte (intern (match-string 1))))
-      (forward-line))
-    (unless (bobp)
-      (delete-region (point-min) (point)))
-    (mm-decode-content-transfer-encoding cte)
-    (unless (pgg-encrypt-region
+  (goto-char (point-min))
+  (when (re-search-forward "^$" nil t)
+    (let ((cte (save-restriction
+		 (narrow-to-region (point-min) (point))
+		 (mail-fetch-field "content-transfer-encoding"))))
+      ;; Strip MIME headers since it will be ASCII armoured.
+      (forward-line 1)
+      (delete-region (point-min) (point))
+      (when cte
+	(mm-decode-content-transfer-encoding (intern (downcase cte))))))
+  (unless (let ((pgg-text-mode t))
+	    (pgg-encrypt-region
 	     (point-min) (point-max)
 	     (split-string
 	      (or
@@ -281,15 +282,13 @@
 	       (message-options-set 'message-recipients
 				    (read-string "Recipients: ")))
 	      "[ \f\t\n\r\v,]+")
-	     sign)
-      (pop-to-buffer pgg-errors-buffer)
-      (error "Encrypt error"))
-    (delete-region (point-min) (point-max))
-    ;;(insert "Content-Type: application/pgp-encrypted\n\n")
-    ;;(insert "Version: 1\n\n")
-    (insert "\n")
-    (insert-buffer-substring pgg-output-buffer)
-    t))
+	     sign))
+    (pop-to-buffer pgg-errors-buffer)
+    (error "Encrypt error"))
+  (delete-region (point-min) (point-max))
+  (insert "\n")
+  (insert-buffer-substring pgg-output-buffer)
+  t)
 
 ;;;###autoload
 (defun mml1991-encrypt (cont &optional sign)
--- a/lisp/gnus/mml2015.el	Fri Apr 21 05:39:14 2006 +0000
+++ b/lisp/gnus/mml2015.el	Tue May 02 05:51:52 2006 +0000
@@ -707,6 +707,8 @@
 	     (buffer-string))))
 	(progn
 	  (erase-buffer)
+	  ;; Treat data which pgg returns as a unibyte string.
+	  (mm-disable-multibyte)
 	  (insert-buffer-substring pgg-output-buffer)
 	  (goto-char (point-min))
 	  (while (search-forward "\r\n" nil t)
--- a/lisp/gnus/nnweb.el	Fri Apr 21 05:39:14 2006 +0000
+++ b/lisp/gnus/nnweb.el	Tue May 02 05:51:52 2006 +0000
@@ -307,8 +307,8 @@
 (defun nnweb-google-wash-article ()
   ;; We have Google's masked e-mail addresses here.  :-/
   (let ((case-fold-search t)
-	(start-re "<pre>\n *")
-	(end-re "\n *</pre>"))
+	(start-re "<pre>[\r\n ]*")
+	(end-re "[\r\n ]*</pre>"))
     (goto-char (point-min))
     (if (save-excursion
 	  (or (re-search-forward "The requested message.*could not be found."
--- a/lisp/help-fns.el	Fri Apr 21 05:39:14 2006 +0000
+++ b/lisp/help-fns.el	Tue May 02 05:51:52 2006 +0000
@@ -630,6 +630,7 @@
                              (indirect-variable variable)
                            (error variable)))
                    (obsolete (get variable 'byte-obsolete-variable))
+		   (safe-var (get variable 'safe-local-variable))
                    (doc (or (documentation-property variable 'variable-documentation)
                             (documentation-property alias 'variable-documentation))))
               (unless (eq alias variable)
@@ -641,6 +642,11 @@
                 (princ (if (stringp (car obsolete)) (car obsolete)
                          (format "use `%s' instead." (car obsolete))))
                 (terpri))
+	      (when safe-var 
+		(princ "This variable is safe to use as a file local variable")
+		(princ (format " only if its value\nsatisfies the predicate `%s'.\n"
+			       safe-var))
+		(terpri))
 	      (princ "Documentation:\n")
               (princ (or doc "Not documented as a variable.")))
 	    ;; Make a link to customize if this variable can be customized.
--- a/lisp/help-mode.el	Fri Apr 21 05:39:14 2006 +0000
+++ b/lisp/help-mode.el	Tue May 02 05:51:52 2006 +0000
@@ -197,7 +197,10 @@
   (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)))
+  (setq view-exit-action (lambda (buffer)
+			   (or (window-minibuffer-p (selected-window))
+			       (one-window-p t)
+			       (delete-window))))
   (run-mode-hooks 'help-mode-hook))
 
 ;;;###autoload
--- a/lisp/image.el	Fri Apr 21 05:39:14 2006 +0000
+++ b/lisp/image.el	Tue May 02 05:51:52 2006 +0000
@@ -280,6 +280,35 @@
 
 
 ;;;###autoload
+(defun image-type (file-or-data &optional type data-p)
+  "Determine and return image type.
+FILE-OR-DATA is an image file name or image data.
+Optional TYPE is a symbol describing the image type.  If TYPE is omitted
+or nil, try to determine the image type from its first few bytes
+of image data.  If that doesn't work, and FILE-OR-DATA is a file name,
+use its file extension as image type.
+Optional DATA-P non-nil means FILE-OR-DATA is a string containing image data."
+  (when (and (not data-p) (not (stringp file-or-data)))
+    (error "Invalid image file name `%s'" file-or-data))
+  (cond ((null data-p)
+	 ;; FILE-OR-DATA is a file name.
+	 (unless (or type
+		     (setq type (image-type-from-file-header file-or-data)))
+	   (let ((extension (file-name-extension file-or-data)))
+	     (unless extension
+	       (error "Cannot determine image type"))
+	     (setq type (intern extension)))))
+	(t
+	 ;; FILE-OR-DATA contains image data.
+	 (unless type
+	   (setq type (image-type-from-data file-or-data)))))
+  (unless type
+    (error "Cannot determine image type"))
+  (unless (symbolp type)
+    (error "Invalid image type `%s'" type))
+  type)
+
+;;;###autoload
 (defun image-type-available-p (type)
   "Return non-nil if image type TYPE is available.
 Image types are symbols like `xbm' or `jpeg'."
@@ -301,24 +330,7 @@
 Value is the image created, or nil if images of type TYPE are not supported.
 
 Images should not be larger than specified by `max-image-size'."
-  (when (and (not data-p) (not (stringp file-or-data)))
-    (error "Invalid image file name `%s'" file-or-data))
-  (cond ((null data-p)
-	 ;; FILE-OR-DATA is a file name.
-	 (unless (or type
-		     (setq type (image-type-from-file-header file-or-data)))
-	   (let ((extension (file-name-extension file-or-data)))
-	     (unless extension
-	       (error "Cannot determine image type"))
-	     (setq type (intern extension)))))
-	(t
-	 ;; FILE-OR-DATA contains image data.
-	 (unless type
-	   (setq type (image-type-from-data file-or-data)))))
-  (unless type
-    (error "Cannot determine image type"))
-  (unless (symbolp type)
-    (error "Invalid image type `%s'" type))
+  (setq type (image-type file-or-data type data-p))
   (when (image-type-available-p type)
     (append (list 'image :type type (if data-p :data :file) file-or-data)
 	    props)))
--- a/lisp/international/mule.el	Fri Apr 21 05:39:14 2006 +0000
+++ b/lisp/international/mule.el	Tue May 02 05:51:52 2006 +0000
@@ -1265,15 +1265,15 @@
   "Specify coding system for keyboard input.
 If you set this on a terminal which can't distinguish Meta keys from
 8-bit characters, you will have to use ESC to type Meta characters.
-See Info node `Specify Coding' and Info node `Single-Byte Character Support'.
+See Info node `Terminal Coding' and Info node `Unibyte Mode'.
 
 On non-windowing terminals, this is set from the locale by default.
 
 Setting this variable directly does not take effect;
 use either \\[customize] or \\[set-keyboard-coding-system]."
   :type '(coding-system :tag "Coding system")
-  :link '(info-link "(emacs)Specify Coding")
-  :link '(info-link "(emacs)Single-Byte Character Support")
+  :link '(info-link "(emacs)Terminal Coding")
+  :link '(info-link "(emacs)Unibyte Mode")
   :set (lambda (symbol value)
 	 ;; Don't load encoded-kbd-mode unnecessarily.
 	 (if (or value (boundp 'encoded-kbd-mode))
--- a/lisp/log-edit.el	Fri Apr 21 05:39:14 2006 +0000
+++ b/lisp/log-edit.el	Tue May 02 05:51:52 2006 +0000
@@ -3,7 +3,7 @@
 ;; Copyright (C) 1999, 2000, 2002, 2003, 2004,
 ;;   2005, 2006 Free Software Foundation, Inc.
 
-;; Author: Stefan Monnier <monnier@cs.yale.edu>
+;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
 ;; Keywords: pcl-cvs cvs commit log
 
 ;; This file is part of GNU Emacs.
--- a/lisp/log-view.el	Fri Apr 21 05:39:14 2006 +0000
+++ b/lisp/log-view.el	Tue May 02 05:51:52 2006 +0000
@@ -3,7 +3,7 @@
 ;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005,
 ;;   2006 Free Software Foundation, Inc.
 
-;; Author: Stefan Monnier <monnier@cs.yale.edu>
+;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
 ;; Keywords: rcs sccs cvs log version-control
 
 ;; This file is part of GNU Emacs.
--- a/lisp/mh-e/ChangeLog	Fri Apr 21 05:39:14 2006 +0000
+++ b/lisp/mh-e/ChangeLog	Tue May 02 05:51:52 2006 +0000
@@ -1,3 +1,40 @@
+2006-04-28  Bill Wohler  <wohler@newt.com>
+
+	Release MH-E version 7.95.
+
+	* mh-e.el (Version, mh-version): Update for release 7.95.
+
+2006-04-26  Eric Ding  <ericding@alum.mit.edu>
+
+	* mh-e.el (mh-invisible-header-fields-internal): Add entry
+	"X-Provags-ID:"
+
+2006-04-25  Bill Wohler  <wohler@newt.com>
+
+	* mh-letter.el (mh-folder-expand-at-point): Fix folder completion.
+	Folders returned by mh-folder-completion-function no longer need
+	adornment (closes SF #1476270).
+
+2006-04-21  Bill Wohler  <wohler@newt.com>
+
+	* mh-e.el (Version, mh-version): Add +cvs to version.
+
+2006-04-21  Bill Wohler  <wohler@newt.com>
+
+	Release MH-E version 7.94.
+
+	* mh-e.el (Version, mh-version): Update for release 7.94.
+
+2006-04-21  Bill Wohler  <wohler@newt.com>
+
+	* mh-letter.el (mh-insert-letter): If a message number isn't
+	given, throw an error rather than using a potentially incorrect
+	message number (closes SF #1473729). In addition, use the cur
+	message if mh-sent-from-msg is nil (when sending a message, in
+	contrast to replying). Move conversion of int to string into
+	interactive stanza so body can assume variables are of proper
+	type.
+
 2006-04-20  Bill Wohler  <wohler@newt.com>
 
 	* mh-tool-bar.el (image-load-path): Define to shush compiler.
--- a/lisp/mh-e/mh-e.el	Fri Apr 21 05:39:14 2006 +0000
+++ b/lisp/mh-e/mh-e.el	Tue May 02 05:51:52 2006 +0000
@@ -6,7 +6,7 @@
 
 ;; Author: Bill Wohler <wohler@newt.com>
 ;; Maintainer: Bill Wohler <wohler@newt.com>
-;; Version: 7.93+cvs
+;; Version: 7.95
 ;; Keywords: mail
 
 ;; This file is part of GNU Emacs.
@@ -136,7 +136,7 @@
 ;; Try to keep variables local to a single file. Provide accessors if
 ;; variables are shared. Use this section as a last resort.
 
-(defconst mh-version "7.93+cvs" "Version number of MH-E.")
+(defconst mh-version "7.95" "Version number of MH-E.")
 
 ;; Variants
 
@@ -2526,6 +2526,7 @@
     "X-Originating-IP:"                 ; Hotmail
     "X-Postfilter:"
     "X-Priority:"                       ; MS Outlook
+    "X-Provags-ID:"
     "X-Qotd-"                           ; User added
     "X-RM"
     "X-Received-Date:"
--- a/lisp/mh-e/mh-letter.el	Fri Apr 21 05:39:14 2006 +0000
+++ b/lisp/mh-e/mh-letter.el	Tue May 02 05:51:52 2006 +0000
@@ -393,24 +393,26 @@
 This command leaves the mark before the letter and point after it."
   (interactive
    (let* ((folder
-           (mh-prompt-for-folder "Message from"
-                                 mh-sent-from-folder nil))
+           (mh-prompt-for-folder "Message from" mh-sent-from-folder nil))
           (default
-            (if (and (equal folder mh-sent-from-folder)
-                     (numberp mh-sent-from-msg))
-                mh-sent-from-msg
+            (if (equal folder mh-sent-from-folder)
+                (or mh-sent-from-msg (nth 0 (mh-translate-range folder "cur")))
               (nth 0 (mh-translate-range folder "cur"))))
           (message
            (read-string (concat "Message number"
                                 (or (and default
                                          (format " (default %d): " default))
-                                    ": ")))))
+                                    ": "))
+                        nil nil
+                        (if (numberp default)
+                            (int-to-string default)
+                          default))))
      (list folder message current-prefix-arg)))
+  (if (equal message "")
+      (error "No message number given"))
   (save-restriction
     (narrow-to-region (point) (point))
     (let ((start (point-min)))
-      (if (and (equal message "") (numberp mh-sent-from-msg))
-          (setq message (int-to-string mh-sent-from-msg)))
       (insert-file-contents
        (expand-file-name message (mh-expand-file-name folder)))
       (when (not verbatim)
@@ -864,15 +866,12 @@
   "Do folder name completion in Fcc header field."
   (let* ((end (point))
          (beg (mh-beginning-of-word))
-         (folder (buffer-substring beg end))
+         (folder (buffer-substring-no-properties beg end))
          (leading-plus (and (> (length folder) 0) (equal (aref folder 0) ?+)))
-         (last-slash (mh-search-from-end ?/ folder))
-         (prefix (and last-slash (substring folder 0 last-slash)))
-         (choices (mapcar #'(lambda (x)
-                              (list (cond (prefix (format "%s/%s" prefix x))
-                                          (leading-plus (format "+%s" x))
-                                          (t x))))
+         (choices (mapcar (lambda (x) (list x))
                           (mh-folder-completion-function folder nil t))))
+    (unless leading-plus
+      (setq folder (concat "+" folder)))
     (mh-complete-word folder choices beg end)))
 
 ;;;###mh-autoload
--- a/lisp/net/rcirc.el	Fri Apr 21 05:39:14 2006 +0000
+++ b/lisp/net/rcirc.el	Tue May 02 05:51:52 2006 +0000
@@ -74,13 +74,13 @@
   :group 'rcirc)
 
 (defcustom rcirc-default-user-full-name (if (string= (user-full-name) "")
-				 rcirc-user-name
-			       (user-full-name))
+					    rcirc-user-name
+					  (user-full-name))
   "The full name sent to the server when connecting."
   :type 'string
   :group 'rcirc)
 
-(defcustom rcirc-startup-channels-alist '(("^irc.freenode.net$" "#emacs"))
+(defcustom rcirc-startup-channels-alist '(("^irc.freenode.net$" "#rcirc"))
   "Alist of channels to join at startup.
 Each element looks like (SERVER-REGEXP . CHANNEL-LIST)."
   :type '(alist :key-type string :value-type (repeat string))
@@ -206,6 +206,18 @@
 Nicks will be removed from the automatic list on follow-up renamings or
 parts.")
 
+(defcustom rcirc-bright-nick-regexp nil
+  "Regexp matching nicks to be emphasized.
+See `rcirc-bright-nick' face."
+  :type 'regexp
+  :group 'rcirc)
+
+(defcustom rcirc-dim-nick-regexp nil
+  "Regexp matching nicks to be deemphasized.
+See `rcirc-dim-nick' face."
+  :type 'regexp
+  :group 'rcirc)
+
 (defcustom rcirc-print-hooks nil
   "Hook run after text is printed.
 Called with 5 arguments, PROCESS, SENDER, RESPONSE, TARGET and TEXT."
@@ -217,7 +229,7 @@
   :type 'boolean
   :group 'rcirc)
 
-(defcustom rcirc-decode-coding-system 'undecided
+(defcustom rcirc-decode-coding-system 'utf-8
   "Coding system used to decode incoming irc messages."
   :type 'coding-system
   :group 'rcirc)
@@ -546,7 +558,7 @@
     (with-current-buffer rcirc-server-buffer
       (or rcirc-nick rcirc-default-nick))))
 
-(defvar rcirc-max-message-length 450
+(defvar rcirc-max-message-length 420
   "Messages longer than this value will be split.")
 
 (defun rcirc-send-message (process target message &optional noticep)
@@ -955,7 +967,8 @@
   :global nil
   :group 'rcirc
   (make-local-variable 'rcirc-parent-buffer)
-  (put 'rcirc-parent-buffer 'permanent-local t))
+  (put 'rcirc-parent-buffer 'permanent-local t)
+  (setq fill-column rcirc-max-message-length))
 
 (defun rcirc-multiline-minor-submit ()
   "Send the text in buffer back to parent buffer."
@@ -1029,6 +1042,7 @@
 	 (split-string (or (cdr (assoc response rcirc-response-formats))
 			   (cdr (assq t rcirc-response-formats)))
 		       "%"))
+	(sender (or sender ""))
 	(result "")
 	(face nil)
 	key face-key repl)
@@ -1054,9 +1068,16 @@
 		     (rcirc-facify nick
 				   (if (eq key ?n)
 				       face
-				     (if (string= sender (rcirc-nick process))
-					 'rcirc-my-nick
-				       'rcirc-other-nick)))))
+				     (cond ((string= sender (rcirc-nick process))
+					    'rcirc-my-nick)
+					   ((and rcirc-bright-nick-regexp
+						 (string-match rcirc-bright-nick-regexp sender))
+					    'rcirc-bright-nick)
+					   ((and rcirc-dim-nick-regexp
+						 (string-match rcirc-dim-nick-regexp sender))
+					    'rcirc-dim-nick)
+					   (t
+					    'rcirc-other-nick))))))
 		  ((eq key ?T)
 		   ;; %T -- timestamp
 		   (rcirc-facify
@@ -1130,8 +1151,9 @@
   (or text (setq text ""))
   (unless (or (member sender rcirc-ignore-list)
 	      (member (with-syntax-table rcirc-nick-syntax-table
-			(when (string-match "^\\([^/]\\w*\\)\\b" text)
-			  (match-string 1 text))) rcirc-ignore-list))
+			(when (string-match "^\\([^/]\\w*\\)[:,]" text)
+			  (match-string 1 text)))
+		      rcirc-ignore-list))
     (let* ((buffer (rcirc-target-buffer process sender response target text))
 	   (inhibit-read-only t))
       (with-current-buffer buffer
@@ -1222,10 +1244,12 @@
 				       (regexp-quote (rcirc-nick process))
 				       "\\b")
 			       text)))
-	    (when (or (not rcirc-ignore-buffer-activity-flag)
-		      ;; always notice when our nick is mentioned, even
-		      ;; if ignoring channel activity
-		      nick-match)
+	    (when (if rcirc-ignore-buffer-activity-flag
+		      ;; - Always notice when our nick is mentioned
+		      nick-match
+		    ;; - Never bother us if a dim-nick spoke
+		    (not (and rcirc-dim-nick-regexp sender
+			      (string-match rcirc-dim-nick-regexp sender))))
 	      (rcirc-record-activity
 	       (current-buffer)
 	       (when (or nick-match (and (not (rcirc-channel-p rcirc-target))
@@ -1375,7 +1399,7 @@
   (force-mode-line-update))
 
 (defun rcirc-toggle-low-priority ()
-  "Toggle the value of `rcirc-ignore-buffer-activity-flag'."
+  "Toggle the value of `rcirc-low-priority-flag'."
   (interactive)
   (setq rcirc-low-priority-flag
 	(not rcirc-low-priority-flag))
@@ -1788,7 +1812,7 @@
 
 (defun rcirc-browse-url (&optional arg)
   "Prompt for URL to browse based on URLs in buffer."
-  (interactive)
+  (interactive "P")
   (let ((completions (mapcar (lambda (x) (cons x nil)) rcirc-urls))
         (initial-input (car rcirc-urls))
         (history (cdr rcirc-urls)))
@@ -1910,7 +1934,7 @@
 		   (cond ((rcirc-channel-p target)
 			  target)
 			 ;;; -ChanServ- [#gnu] Welcome...
-			 ((string-match "^\\[\\(#[^ ]+\\)\\]" message)
+			 ((string-match "\\[\\(#[^\] ]+\\)\\]" message)
 			  (match-string 1 message))
 			 (sender
 			  (if (string= sender (rcirc-server-name process))
@@ -2211,6 +2235,25 @@
   "The face used to highlight other messages."
   :group 'rcirc-faces)
 
+(defface rcirc-bright-nick
+  '((((class grayscale) (background light))
+     (:foreground "LightGray" :weight bold :underline t))
+    (((class grayscale) (background dark))
+     (:foreground "Gray50" :weight bold :underline t))
+    (((class color) (min-colors 88) (background light)) (:foreground "CadetBlue"))
+    (((class color) (min-colors 88) (background dark)) (:foreground "Aquamarine"))
+    (((class color) (min-colors 16) (background light)) (:foreground "CadetBlue"))
+    (((class color) (min-colors 16) (background dark)) (:foreground "Aquamarine"))
+    (((class color) (min-colors 8)) (:foreground "magenta"))
+    (t (:weight bold :underline t)))
+  "Face used for nicks matched by `rcirc-bright-nick-regexp'."
+  :group 'rcirc-faces)
+
+(defface rcirc-dim-nick
+  '((t :inherit default))
+  "Face used for nicks matched by `rcirc-dim-nick-regexp'."
+  :group 'rcirc-faces)
+
 (defface rcirc-server			; font-lock-comment-face
   '((((class grayscale) (background light))
      (:foreground "DimGray" :weight bold :slant italic))
--- a/lisp/net/tramp.el	Fri Apr 21 05:39:14 2006 +0000
+++ b/lisp/net/tramp.el	Tue May 02 05:51:52 2006 +0000
@@ -1821,8 +1821,6 @@
 Escape sequence %s is replaced with name of Perl binary.
 This string is passed to `format', so percent characters need to be doubled.")
 
-; These values conform to `file-attributes' from XEmacs 21.2.
-; GNU Emacs and other tools not checked.
 (defconst tramp-file-mode-type-map '((0  . "-")  ; Normal file (SVID-v2 and XPG2)
 				     (1  . "p")  ; fifo
 				     (2  . "c")  ; character device
@@ -1927,17 +1925,12 @@
   "Alist of handler functions.
 Operations not mentioned here will be handled by the normal Emacs functions.")
 
-;; Handlers for partial tramp file names. For GNU Emacs just
-;; `file-name-all-completions' is needed. The other ones are necessary
-;; for XEmacs.
+;; Handlers for partial tramp file names.  For Emacs just
+;; `file-name-all-completions' is needed.
+;;;###autoload
 (defconst tramp-completion-file-name-handler-alist
-  '(
-    (file-name-directory . tramp-completion-handle-file-name-directory)
-    (file-name-nondirectory . tramp-completion-handle-file-name-nondirectory)
-    (file-exists-p . tramp-completion-handle-file-exists-p)
-    (file-name-all-completions . tramp-completion-handle-file-name-all-completions)
-    (file-name-completion . tramp-completion-handle-file-name-completion)
-    (expand-file-name . tramp-completion-handle-expand-file-name))
+  '((file-name-all-completions . tramp-completion-handle-file-name-all-completions)
+    (file-name-completion . tramp-completion-handle-file-name-completion))
   "Alist of completion handler functions.
 Used for file names matching `tramp-file-name-regexp'. Operations not
 mentioned here will be handled by `tramp-file-name-handler-alist' or the
@@ -2172,28 +2165,11 @@
 ;; Localname manipulation functions that grok TRAMP localnames...
 (defun tramp-handle-file-name-directory (file)
   "Like `file-name-directory' but aware of TRAMP files."
-  ;; everything except the last filename thing is the directory
+  ;; Everything except the last filename thing is the directory.
   (with-parsed-tramp-file-name file nil
-    ;; For the following condition, two possibilities should be tried:
-    ;; (1) (string= localname "")
-    ;; (2) (or (string= localname "") (string= localname "/"))
-    ;; The second variant fails when completing a "/" directory on
-    ;; the remote host, that is a filename which looks like
-    ;; "/user@host:/".  But maybe wildcards fail with the first variant.
-    ;; We should do some investigation.
-    (if (string= localname "")
-	;; For a filename like "/[foo]", we return "/".  The `else'
-	;; case would return "/[foo]" unchanged.  But if we do that,
-	;; then `file-expand-wildcards' ceases to work.  It's not
-	;; quite clear to me what's the intuition that tells that this
-	;; behavior is the right behavior, but oh, well.
-	"/"
-      ;; run the command on the localname portion only
-      ;; CCC: This should take into account the remote machine type, no?
-      ;;  --daniel <daniel@danann.net>
-      (tramp-make-tramp-file-name multi-method method user host
-				  ;; This will not recurse...
-				  (or (file-name-directory localname) "")))))
+    ;; Run the command on the localname portion only.
+    (tramp-make-tramp-file-name
+     multi-method method user host (file-name-directory (or localname "")))))
 
 (defun tramp-handle-file-name-nondirectory (file)
   "Like `file-name-nondirectory' but aware of TRAMP files."
@@ -4144,7 +4120,8 @@
 ;;         (inhibit-file-name-operation operation))
 ;;     (apply operation args)))
 
-(defun tramp-run-real-handler (operation args)
+;;;###autoload
+(progn (defun tramp-run-real-handler (operation args)
   "Invoke normal file name handler for OPERATION.
 First arg specifies the OPERATION, second arg is a list of arguments to
 pass to the OPERATION."
@@ -4157,13 +4134,14 @@
 	    ,(and (eq inhibit-file-name-operation operation)
 		  inhibit-file-name-handlers)))
 	 (inhibit-file-name-operation operation))
-    (apply operation args)))
+    (apply operation args))))
 
 ;; This function is used from `tramp-completion-file-name-handler' functions
 ;; only, if `tramp-completion-mode' is true. But this cannot be checked here
 ;; because the check is based on a full filename, not available for all
 ;; basic I/O operations.
-(defun tramp-completion-run-real-handler (operation args)
+;;;###autoload
+(progn (defun tramp-completion-run-real-handler (operation args)
   "Invoke `tramp-file-name-handler' for OPERATION.
 First arg specifies the OPERATION, second arg is a list of arguments to
 pass to the OPERATION."
@@ -4175,7 +4153,7 @@
 	    ,(and (eq inhibit-file-name-operation operation)
 		  inhibit-file-name-handlers)))
 	 (inhibit-file-name-operation operation))
-    (apply operation args)))
+    (apply operation args))))
 
 ;; We handle here all file primitives.  Most of them have the file
 ;; name as first parameter; nevertheless we check for them explicitly
@@ -4272,12 +4250,25 @@
 (defun tramp-file-name-handler (operation &rest args)
   "Invoke Tramp file name handler.
 Falls back to normal file name handler if no tramp file name handler exists."
+;;  (setq edebug-trace t)
+;;  (edebug-trace "%s" (with-output-to-string (backtrace)))
   (save-match-data
     (let* ((filename (apply 'tramp-file-name-for-operation operation args))
+	   (completion (tramp-completion-mode filename))
 	   (foreign (tramp-find-foreign-file-name-handler filename)))
-      (cond
-       (foreign (apply foreign operation args))
-       (t (tramp-run-real-handler operation args))))))
+      (with-parsed-tramp-file-name filename nil
+	(cond
+	 ;; When we are in completion mode, some operations shouldn' be
+	 ;; handled by backend.
+	 ((and completion (memq operation '(expand-file-name)))
+	  (tramp-run-real-handler operation args))
+	 ((and completion (zerop (length localname))
+	       (memq operation '(file-exists-p file-directory-p)))
+	  t)
+	 ;; Call the backend function.
+	 (foreign (apply foreign operation args))
+	 ;; Nothing to do for us.
+	 (t (tramp-run-real-handler operation args)))))))
 
 
 ;; In Emacs, there is some concurrency due to timers.  If a timer
@@ -4325,31 +4316,43 @@
       (setq tramp-locked tl))))
 
 ;;;###autoload
-(defun tramp-completion-file-name-handler (operation &rest args)
+(progn (defun tramp-completion-file-name-handler (operation &rest args)
   "Invoke tramp file name completion handler.
 Falls back to normal file name handler if no tramp file name handler exists."
-;;   (setq tramp-debug-buffer t)
-;;   (tramp-message 1 "%s %s" operation args)
-;;   (tramp-message 1 "%s %s\n%s"
-;; 		 operation args (with-output-to-string (backtrace)))
+;;  (setq edebug-trace t)
+;;  (edebug-trace "%s" (with-output-to-string (backtrace)))
   (let ((fn (assoc operation tramp-completion-file-name-handler-alist)))
     (if fn
 	(save-match-data (apply (cdr fn) args))
-      (tramp-completion-run-real-handler operation args))))
+      (tramp-completion-run-real-handler operation args)))))
 
 ;;;###autoload
-(put 'tramp-completion-file-name-handler 'safe-magic t)
-
-;; Register in file name handler alist
-;;;###autoload
-(add-to-list 'file-name-handler-alist
-	     (cons tramp-file-name-regexp 'tramp-file-name-handler))
-(add-to-list 'file-name-handler-alist
-	     (cons tramp-completion-file-name-regexp
-		   'tramp-completion-file-name-handler))
+(defsubst tramp-register-file-name-handlers ()
+  "Add tramp file name handlers to `file-name-handler-alist'."
+  (add-to-list 'file-name-handler-alist
+	       (cons tramp-file-name-regexp 'tramp-file-name-handler))
+  (when partial-completion-mode
+    (add-to-list 'file-name-handler-alist
+		 (cons tramp-completion-file-name-regexp
+		       'tramp-completion-file-name-handler))
+    (put 'tramp-completion-file-name-handler 'safe-magic t))
+  ;; If jka-compr is already loaded, move it to the front of
+  ;; `file-name-handler-alist'.
+  (let ((jka (rassoc 'jka-compr-handler file-name-handler-alist)))
+    (when jka
+      (setq file-name-handler-alist
+	    (cons jka (delete jka file-name-handler-alist))))))
+
+;; During autoload, it shall be checked whether
+;; `partial-completion-mode' is active.  Therefore registering will be
+;; delayed.
+;;;###autoload(add-hook
+;;;###autoload 'after-init-hook
+;;;###autoload '(lambda () (tramp-register-file-name-handlers)))
+(tramp-register-file-name-handlers)
 
 ;;;###autoload
-(defun tramp-unload-file-name-handler-alist ()
+(defun tramp-unload-file-name-handlers ()
   (setq file-name-handler-alist
 	(delete (rassoc 'tramp-file-name-handler
 			file-name-handler-alist)
@@ -4357,17 +4360,7 @@
 				file-name-handler-alist)
 			file-name-handler-alist))))
 
-(add-hook 'tramp-unload-hook 'tramp-unload-file-name-handler-alist)
-
-(defun tramp-repair-jka-compr ()
-  "If jka-compr is already loaded, move it to the front of
-`file-name-handler-alist'.  On Emacs 22 or so this will not be
-necessary anymore."
-  (let ((jka (rassoc 'jka-compr-handler file-name-handler-alist)))
-    (when jka
-      (setq file-name-handler-alist
-	    (cons jka (delete jka file-name-handler-alist))))))
-(tramp-repair-jka-compr)
+(add-hook 'tramp-unload-hook 'tramp-unload-file-name-handlers)
 
 
 ;;; Interactions with other packages:
@@ -4482,31 +4475,10 @@
 				 last-input-event) ?\ ))))))
     t)))
 
-(defun tramp-completion-handle-file-exists-p (filename)
-  "Like `file-exists-p' for tramp files."
-  (if (tramp-completion-mode filename)
-      (tramp-run-real-handler
-       'file-exists-p (list filename))
-    (tramp-completion-run-real-handler
-     'file-exists-p (list filename))))
-
-;; Localname manipulation in case of partial TRAMP file names.
-(defun tramp-completion-handle-file-name-directory (file)
-  "Like `file-name-directory' but aware of TRAMP files."
-  (if (tramp-completion-mode file)
-      "/"
-    (tramp-completion-run-real-handler
-     'file-name-directory (list file))))
-
-;; Localname manipulation in case of partial TRAMP file names.
-(defun tramp-completion-handle-file-name-nondirectory (file)
-  "Like `file-name-nondirectory' but aware of TRAMP files."
-  (substring
-   file (length (tramp-completion-handle-file-name-directory file))))
-
 ;; Method, host name and user name completion.
 ;; `tramp-completion-dissect-file-name' returns a list of
 ;; tramp-file-name structures. For all of them we return possible completions.
+;;;###autoload
 (defun tramp-completion-handle-file-name-all-completions (filename directory)
   "Like `file-name-all-completions' for partial tramp files."
 
@@ -4561,7 +4533,8 @@
 	  ;; unify list, remove nil elements
 	  (while result
 	    (let ((car (car result)))
-	      (when car (add-to-list 'result1 car))
+	      (when car (add-to-list
+			 'result1 (substring car (length directory))))
 	      (setq result (cdr result))))
 
 	  ;; Complete local parts
@@ -4580,6 +4553,7 @@
     (setq tramp-completion-mode nil)))
 
 ;; Method, host name and user name completion for a file.
+;;;###autoload
 (defun tramp-completion-handle-file-name-completion (filename directory)
   "Like `file-name-completion' for tramp files."
   (try-completion filename
@@ -4706,8 +4680,7 @@
    (lambda (method)
      (and method
 	  (string-match (concat "^" (regexp-quote partial-method)) method)
-	  ;; we must remove leading "/".
-	  (substring (tramp-make-tramp-file-name nil method nil nil nil) 1)))
+	  (tramp-make-tramp-file-name nil method nil nil nil)))
    (delete "multi" (mapcar 'car tramp-methods))))
 
 ;; Compares partial user and host names with possible completions.
@@ -4740,8 +4713,7 @@
 	    host nil)))
 
   (unless (zerop (+ (length user) (length host)))
-    ;; we must remove leading "/".
-    (substring (tramp-make-tramp-file-name nil method user host nil) 1)))
+    (tramp-make-tramp-file-name nil method user host nil)))
 
 (defun tramp-parse-rhosts (filename)
   "Return a list of (user host) tuples allowed to access.
@@ -4960,15 +4932,6 @@
      (forward-line 1)
      result))
 
-(defun tramp-completion-handle-expand-file-name (name &optional dir)
-  "Like `expand-file-name' for tramp files."
-  (let ((fullname (concat (or dir default-directory) name)))
-    (if (tramp-completion-mode fullname)
-	(tramp-run-real-handler
-	 'expand-file-name (list name dir))
-      (tramp-completion-run-real-handler
-       'expand-file-name (list name dir)))))
-
 ;;; Internal Functions:
 
 (defun tramp-maybe-send-perl-script (multi-method method user host script name)
@@ -7629,7 +7592,7 @@
 (defun tramp-unload-tramp ()
   (interactive)
   ;; When Tramp is not loaded yet, its autoloads are still active.
-  (tramp-unload-file-name-handler-alist)
+  (tramp-unload-file-name-handlers)
   ;; ange-ftp settings must be enabled.
   (when (functionp 'tramp-ftp-enable-ange-ftp)
     (funcall (symbol-function 'tramp-ftp-enable-ange-ftp)))
--- a/lisp/pcvs-defs.el	Fri Apr 21 05:39:14 2006 +0000
+++ b/lisp/pcvs-defs.el	Tue May 02 05:51:52 2006 +0000
@@ -3,7 +3,7 @@
 ;; Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
 ;;   2000, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
 
-;; Author: Stefan Monnier <monnier@cs.yale.edu>
+;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
 ;; Keywords: pcl-cvs
 
 ;; This file is part of GNU Emacs.
--- a/lisp/pcvs-info.el	Fri Apr 21 05:39:14 2006 +0000
+++ b/lisp/pcvs-info.el	Tue May 02 05:51:52 2006 +0000
@@ -3,7 +3,7 @@
 ;; Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
 ;;   2000, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
 
-;; Author: Stefan Monnier <monnier@cs.yale.edu>
+;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
 ;; Keywords: pcl-cvs
 
 ;; This file is part of GNU Emacs.
--- a/lisp/pcvs-parse.el	Fri Apr 21 05:39:14 2006 +0000
+++ b/lisp/pcvs-parse.el	Tue May 02 05:51:52 2006 +0000
@@ -3,7 +3,7 @@
 ;; Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
 ;;   2000, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
 
-;; Author: Stefan Monnier <monnier@cs.yale.edu>
+;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
 ;; Keywords: pcl-cvs
 
 ;; This file is part of GNU Emacs.
--- a/lisp/pcvs-util.el	Fri Apr 21 05:39:14 2006 +0000
+++ b/lisp/pcvs-util.el	Tue May 02 05:51:52 2006 +0000
@@ -3,7 +3,7 @@
 ;; Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
 ;;   2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
 
-;; Author: Stefan Monnier <monnier@cs.yale.edu>
+;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
 ;; Keywords: pcl-cvs
 
 ;; This file is part of GNU Emacs.
--- a/lisp/progmodes/antlr-mode.el	Fri Apr 21 05:39:14 2006 +0000
+++ b/lisp/progmodes/antlr-mode.el	Tue May 02 05:51:52 2006 +0000
@@ -829,7 +829,7 @@
 `antlr-font-lock-maximum-decoration'.")
 
 (defvar antlr-default-face 'antlr-default)
-(defface antlr-default nil
+(defface antlr-default '((t nil))
   "Face to prevent strings from language dependent highlighting.
 Do not change."
   :group 'antlr)
--- a/lisp/progmodes/asm-mode.el	Fri Apr 21 05:39:14 2006 +0000
+++ b/lisp/progmodes/asm-mode.el	Tue May 02 05:51:52 2006 +0000
@@ -62,9 +62,9 @@
 
 (defvar asm-mode-syntax-table
   (let ((st (make-syntax-table)))
-    (modify-syntax-entry ?\n ">" st)
-    (modify-syntax-entry ?/  ". 14b" st)
-    (modify-syntax-entry ?*  ". 23b" st)
+    (modify-syntax-entry ?\n "> b" st)
+    (modify-syntax-entry ?/  ". 124b" st)
+    (modify-syntax-entry ?*  ". 23" st)
     st)
   "Syntax table used while in Asm mode.")
 
@@ -136,14 +136,14 @@
   (use-local-map (nconc (make-sparse-keymap) asm-mode-map))
   (local-set-key (vector asm-comment-char) 'asm-comment)
   (set-syntax-table (make-syntax-table asm-mode-syntax-table))
-  (modify-syntax-entry	asm-comment-char "<")
+  (modify-syntax-entry	asm-comment-char "< b")
 
   (make-local-variable 'comment-start)
   (setq comment-start (string asm-comment-char))
   (make-local-variable 'comment-add)
   (setq comment-add 1)
   (make-local-variable 'comment-start-skip)
-  (setq comment-start-skip "\\(?:\\s<+\\|/\\*+\\)[ \t]*")
+  (setq comment-start-skip "\\(?:\\s<+\\|/[/*]+\\)[ \t]*")
   (make-local-variable 'comment-end-skip)
   (setq comment-end-skip "[ \t]*\\(\\s>\\|\\*+/\\)")
   (make-local-variable 'comment-end)
--- a/lisp/progmodes/cc-subword.el	Fri Apr 21 05:39:14 2006 +0000
+++ b/lisp/progmodes/cc-subword.el	Tue May 02 05:51:52 2006 +0000
@@ -91,8 +91,8 @@
 ;; Don't complain about the `define-minor-mode' form if it isn't defined.
 (cc-bytecomp-defvar c-subword-mode)
 
-;;; Autoload directives must be on the top level, so we construct an
-;;; autoload form instead.
+;; Autoload directives must be on the top level, so we construct an
+;; autoload form instead.
 ;;;###autoload (autoload 'c-subword-mode "cc-subword" "Mode enabling subword movement and editing keys." t)
 
 (if (not (fboundp 'define-minor-mode))
@@ -107,36 +107,19 @@
 
   (defvar c-subword-mode-map
     (let ((map (make-sparse-keymap)))
-      (substitute-key-definition 'forward-word
-				 'c-forward-subword
-				 map global-map)
-      (substitute-key-definition 'backward-word
-				 'c-backward-subword
-				 map global-map)
-      (substitute-key-definition 'mark-word
-				 'c-mark-subword
-				 map global-map)
-    
-      (substitute-key-definition 'kill-word
-				 'c-kill-subword
-				 map global-map)
-      (substitute-key-definition 'backward-kill-word
-				 'c-backward-kill-subword
-				 map global-map)
-    
-      (substitute-key-definition 'transpose-words
-				 'c-transpose-subwords
-				 map global-map)
-    
-      (substitute-key-definition 'capitalize-word
-				 'c-capitalize-subword
-				 map global-map)
-      (substitute-key-definition 'upcase-word
-				 'c-upcase-subword
-				 map global-map)
-      (substitute-key-definition 'downcase-word
-				 'c-downcase-subword
-				 map global-map)
+      (dolist (cmd '(forward-word backward-word mark-word
+                     kill-word backward-kill-word
+                     transpose-words
+                     capitalize-word upcase-word downcase-word))
+        (let ((othercmd (let ((name (symbol-name cmd)))
+                          (string-match "\\(.*-\\)\\(word.*\\)" name)
+                          (intern (concat "c-"
+                                          (match-string 1 name)
+                                          "sub"
+                                          (match-string 2 name))))))
+          (if (fboundp 'command-remapping)
+              (define-key map (vector 'remap cmd) othercmd)
+            (substitute-key-definition cmd othercmd map global-map))))
       map)
     "Keymap used in command `c-subword-mode' minor mode.")
 
@@ -308,5 +291,5 @@
 
 (cc-provide 'cc-subword)
 
-;;; arch-tag: 2be9d294-7f30-4626-95e6-9964bb93c7a3
+;; arch-tag: 2be9d294-7f30-4626-95e6-9964bb93c7a3
 ;;; cc-subword.el ends here
--- a/lisp/progmodes/grep.el	Fri Apr 21 05:39:14 2006 +0000
+++ b/lisp/progmodes/grep.el	Tue May 02 05:51:52 2006 +0000
@@ -35,7 +35,7 @@
 
 
 (defgroup grep nil
-  "Run compiler as inferior of Emacs, parse error messages."
+  "Run grep as inferior of Emacs, parse error messages."
   :group 'tools
   :group 'processes)
 
@@ -48,23 +48,6 @@
   :version "22.1"
   :group 'grep)
 
-(defcustom grep-auto-highlight t
-  "*Specify how many grep matches to highlight (and parse) initially.
-\(Highlighting applies to an grep match when the mouse is over it.)
-If this is a number N, all grep matches in the first N lines
-are highlighted and parsed as soon as they arrive in Emacs.
-If t, highlight and parse the whole grep output as soon as it arrives.
-If nil, don't highlight or parse any of the grep buffer until you try to
-move to the error messages.
-
-Those grep matches which are not parsed and highlighted initially
-will be parsed and highlighted as soon as you try to move to them."
-  :type '(choice (const :tag "All" t)
-		 (const :tag "None" nil)
-		 (integer :tag "First N lines"))
-  :version "22.1"
-  :group 'grep)
-
 (defcustom grep-highlight-matches 'auto-detect
   "If t, use special markers to highlight grep matches.
 
@@ -108,6 +91,20 @@
 		 (const :tag "Not Set" nil))
   :group 'grep)
 
+(defcustom grep-template nil
+  "The default command to run for \\[lgrep].
+The default value of this variable is set up by `grep-compute-defaults';
+call that function before using this variable in your program.
+The following place holders should be present in the string:
+ <C> - place to put -i if case insensitive grep.
+ <F> - file names and wildcards to search.
+ <R> - the regular expression searched for.
+ <N> - place to insert null-device."
+  :type '(choice string
+		 (const :tag "Not Set" nil))
+  :version "22.1"
+  :group 'grep)
+
 (defcustom grep-use-null-device 'auto-detect
   "If t, append the value of `null-device' to `grep' commands.
 This is done to ensure that the output of grep includes the filename of
@@ -130,8 +127,8 @@
 		 (const :tag "Not Set" nil))
   :group 'grep)
 
-(defcustom grep-tree-command nil
-  "The default find command for \\[grep-tree].
+(defcustom grep-find-template nil
+  "The default command to run for \\[rgrep].
 The default value of this variable is set up by `grep-compute-defaults';
 call that function before using this variable in your program.
 The following place holders should be present in the string:
@@ -145,27 +142,22 @@
   :version "22.1"
   :group 'grep)
 
-(defcustom grep-tree-files-aliases '(
+(defcustom grep-files-aliases '(
+	("el" .	"*.el")
 	("ch" .	"*.[ch]")
 	("c" .	"*.c")
 	("h" .	"*.h")
+	("asm" . "*.[sS]")
 	("m" .	"[Mm]akefile*")
-	("asm" . "*.[sS]")
-	("all" . "*")
-	("el" .	"*.el")
+	("l" . "[Cc]hange[Ll]og*")
 	)
-  "*Alist of aliases for the FILES argument to `grep-tree'."
+  "*Alist of aliases for the FILES argument to `lgrep' and `rgrep'."
   :type 'alist
   :group 'grep)
 
-(defcustom grep-tree-ignore-case t
-  "*If non-nil, `grep-tree' ignores case in matches."
-  :type 'boolean
-  :group 'grep)
-
-(defcustom grep-tree-ignore-CVS-directories t
-  "*If non-nil, `grep-tree' does no recurse into CVS directories."
-  :type 'boolean
+(defcustom grep-find-ignored-directories '("CVS" ".hg" "{arch}")
+  "*List of names of sub-directories which `rgrep' shall not recurse into."
+  :type '(repeat string)
   :group 'grep)
 
 (defcustom grep-error-screen-columns nil
@@ -208,6 +200,8 @@
       '("Compile..." . compile))
     (define-key map [menu-bar grep compilation-grep]
       '("Another grep..." . grep))
+    (define-key map [menu-bar grep compilation-grep-find]
+      '("Recursive grep..." . grep-find))
     (define-key map [menu-bar grep compilation-recompile]
       '("Repeat grep" . recompile))
     (define-key map [menu-bar grep compilation-separator2]
@@ -353,6 +347,11 @@
 ;;;###autoload
 (defvar grep-find-history nil)
 
+;; History of lgrep and rgrep regexp and files args.
+(defvar grep-regexp-history nil)
+(defvar grep-files-history '("ch" "el"))
+
+
 ;;;###autoload
 (defun grep-process-setup ()
   "Setup compilation variables and buffer for `grep'.
@@ -378,6 +377,12 @@
 	   (cons msg code))))
   (run-hooks 'grep-setup-hook))
 
+(defun grep-probe (command args &optional func result)
+  (equal (condition-case nil
+	     (apply (or func 'call-process) command args)
+	   (error nil))
+	 (or result 0)))
+
 ;;;###autoload
 (defun grep-compute-defaults ()
   (unless (or (not grep-use-null-device) (eq grep-use-null-device t))
@@ -385,73 +390,67 @@
 	  (with-temp-buffer
 	    (let ((hello-file (expand-file-name "HELLO" data-directory)))
 	      (not
-	       (and (equal (condition-case nil
-			       (if grep-command
-				   ;; `grep-command' is already set, so
-				   ;; use that for testing.
-				   (call-process-shell-command
-				    grep-command nil t nil
-				    "^English" hello-file)
-				 ;; otherwise use `grep-program'
-				 (call-process grep-program nil t nil
-					       "-nH" "^English" hello-file))
-			     (error nil))
-			   0)
+	       (and (if grep-command
+			;; `grep-command' is already set, so
+			;; use that for testing.
+			(grep-probe grep-command
+				    `(nil t nil "^English" ,hello-file)
+				    #'call-process-shell-command)
+		      ;; otherwise use `grep-program'
+		      (grep-probe grep-program
+				  `(nil t nil "-nH" "^English" ,hello-file)))
 		    (progn
 		      (goto-char (point-min))
 		      (looking-at
 		       (concat (regexp-quote hello-file)
 			       ":[0-9]+:English")))))))))
-  (unless grep-command
-    (setq grep-command
-	  (let ((required-options (if grep-use-null-device "-n" "-nH")))
-	    (if (equal (condition-case nil ; in case "grep" isn't in exec-path
-			   (call-process grep-program nil nil nil
-					 "-e" "foo" null-device)
-			 (error nil))
-		       1)
-		(format "%s %s -e " grep-program required-options)
-	      (format "%s %s " grep-program required-options)))))
-  (unless grep-find-use-xargs
-    (setq grep-find-use-xargs
-	  (if (and
-               (equal (call-process "find" nil nil nil
-                                    null-device "-print0")
-                      0)
-               (equal (call-process "xargs" nil nil nil
-                                    "-0" "-e" "echo")
-		      0))
-	      'gnu)))
-  (unless grep-find-command
-    (setq grep-find-command
-          (cond ((eq grep-find-use-xargs 'gnu)
-		 (format "%s . -type f -print0 | xargs -0 -e %s"
-			 find-program grep-command))
-		(grep-find-use-xargs
-		 (format "%s . -type f -print | xargs %s"
-                         find-program grep-command))
-		(t (cons (format "%s . -type f -exec %s {} %s \\;"
-				 find-program grep-command null-device)
-			 (+ 22 (length grep-command)))))))
-  (unless grep-tree-command
-    (setq grep-tree-command
-	  (let* ((glen (length grep-program))
-		 (gcmd (concat grep-program " <C>" (substring grep-command glen))))
-	    (cond ((eq grep-find-use-xargs 'gnu)
-		   (format "%s <D> <X> -type f <F> -print0 | xargs -0 -e %s <R>"
-			   find-program gcmd))
-		  (grep-find-use-xargs
-		   (format "%s <D> <X> -type f <F> -print | xargs %s <R>"
-			   find-program gcmd))
-		  (t (format "%s <D> <X> -type f <F> -exec %s <R> {} %s \\;"
-			     find-program gcmd null-device))))))
+  (unless (and grep-command grep-find-command
+	       grep-template grep-find-template)
+    (let ((grep-options
+	   (concat (if grep-use-null-device "-n" "-nH")
+		   (if (grep-probe grep-program
+				   `(nil nil nil "-e" "foo" ,null-device)
+				   nil 1)
+		       " -e"))))
+      (unless grep-command
+	(setq grep-command
+	      (format "%s %s " grep-program grep-options)))
+      (unless grep-template
+	(setq grep-template
+	      (format "%s <C> %s <R> <F>" grep-program grep-options)))
+      (unless grep-find-use-xargs
+	(setq grep-find-use-xargs
+	      (if (and
+		   (grep-probe find-program `(nil nil nil ,null-device "-print0"))
+		   (grep-probe "xargs" `(nil nil nil "-0" "-e" "echo")))
+		  'gnu)))
+      (unless grep-find-command
+	(setq grep-find-command
+	      (cond ((eq grep-find-use-xargs 'gnu)
+		     (format "%s . -type f -print0 | xargs -0 -e %s"
+			     find-program grep-command))
+		    (grep-find-use-xargs
+		     (format "%s . -type f -print | xargs %s"
+			     find-program grep-command))
+		    (t (cons (format "%s . -type f -exec %s {} %s \\;"
+				     find-program grep-command null-device)
+			     (+ 22 (length grep-command)))))))
+      (unless grep-find-template
+	(setq grep-find-template
+	      (let ((gcmd (format "%s <C> %s <R>"
+				  grep-program grep-options)))
+		(cond ((eq grep-find-use-xargs 'gnu)
+		       (format "%s . <X> -type f <F> -print0 | xargs -0 -e %s"
+			       find-program gcmd))
+		      (grep-find-use-xargs
+		       (format "%s . <X> -type f <F> -print | xargs %s"
+			       find-program gcmd))
+		      (t (format "%s . <X> -type f <F> -exec %s {} %s \\;"
+				 find-program gcmd null-device))))))))
   (unless (or (not grep-highlight-matches) (eq grep-highlight-matches t))
     (setq grep-highlight-matches
 	  (with-temp-buffer
-	    (and (equal (condition-case nil
-			    (call-process grep-program nil t nil "--help")
-			  (error nil))
-			0)
+	    (and (grep-probe grep-program '(nil t nil "--help"))
 		 (progn
 		   (goto-char (point-min))
 		   (search-forward "--color" nil t))
@@ -487,42 +486,6 @@
 				   (file-name-extension buffer-file-name))))
       (replace-match tag-default t t grep-default 1))))
 
-;;;###autoload
-(defun grep (command-args &optional highlight-regexp)
-  "Run grep, with user-specified args, and collect output in a buffer.
-While grep runs asynchronously, you can use \\[next-error] (M-x next-error),
-or \\<grep-mode-map>\\[compile-goto-error] in the grep \
-output buffer, to go to the lines
-where grep found matches.
-
-This command uses a special history list for its COMMAND-ARGS, so you can
-easily repeat a grep command.
-
-A prefix argument says to default the argument based upon the current
-tag the cursor is over, substituting it into the last grep command
-in the grep command history (or into `grep-command'
-if that history list is empty).
-
-If specified, optional second arg HIGHLIGHT-REGEXP is the regexp to
-temporarily highlight in visited source lines."
-  (interactive
-   (progn
-     (unless (and grep-command
-		  (or (not grep-use-null-device) (eq grep-use-null-device t)))
-       (grep-compute-defaults))
-     (let ((default (grep-default-command)))
-       (list (read-from-minibuffer "Run grep (like this): "
-				   (if current-prefix-arg
-				       default grep-command)
-				   nil nil 'grep-history
-				   (if current-prefix-arg nil default))))))
-
-  ;; Setting process-setup-function makes exit-message-function work
-  ;; even when async processes aren't supported.
-  (compilation-start (if (and grep-use-null-device null-device)
-			 (concat command-args " " null-device)
-		       command-args)
-		     'grep-mode nil highlight-regexp))
 
 ;;;###autoload
 (define-compilation-mode grep-mode "Grep"
@@ -536,6 +499,40 @@
        'grep-process-setup)
   (set (make-local-variable 'compilation-disable-input) t))
 
+
+;;;###autoload
+(defun grep (command-args)
+  "Run grep, with user-specified args, and collect output in a buffer.
+While grep runs asynchronously, you can use \\[next-error] (M-x next-error),
+or \\<grep-mode-map>\\[compile-goto-error] in the grep \
+output buffer, to go to the lines
+where grep found matches.
+
+This command uses a special history list for its COMMAND-ARGS, so you can
+easily repeat a grep command.
+
+A prefix argument says to default the argument based upon the current
+tag the cursor is over, substituting it into the last grep command
+in the grep command history (or into `grep-command'
+if that history list is empty)."
+  (interactive
+   (progn
+     (grep-compute-defaults)
+     (let ((default (grep-default-command)))
+       (list (read-from-minibuffer "Run grep (like this): "
+				   (if current-prefix-arg
+				       default grep-command)
+				   nil nil 'grep-history
+				   (if current-prefix-arg nil default))))))
+
+  ;; Setting process-setup-function makes exit-message-function work
+  ;; even when async processes aren't supported.
+  (compilation-start (if (and grep-use-null-device null-device)
+			 (concat command-args " " null-device)
+		       command-args)
+		     'grep-mode))
+
+
 ;;;###autoload
 (defun grep-find (command-args)
   "Run grep via find, with user-specified args COMMAND-ARGS.
@@ -547,9 +544,7 @@
 easily repeat a find command."
   (interactive
    (progn
-     (unless (and grep-command
-		  (or (not grep-use-null-device) (eq grep-use-null-device t)))
-       (grep-compute-defaults))
+     (grep-compute-defaults)
      (if grep-find-command
 	 (list (read-from-minibuffer "Run find (like this): "
 				     grep-find-command nil nil
@@ -565,84 +560,190 @@
 ;;;###autoload
 (defalias 'find-grep 'grep-find)
 
-(defun grep-expand-command-macros (command &optional regexp files dir excl case-fold)
-  "Patch grep COMMAND replacing <D>, etc."
-  (setq command
-	(replace-regexp-in-string "<D>"
-				  (or dir ".") command t t))
-  (setq command
-	(replace-regexp-in-string "<X>"
-				  (or excl "") command t t))
-  (setq command
-	(replace-regexp-in-string "<F>"
-				  (or files "") command t t))
-  (setq command
-	(replace-regexp-in-string "<C>"
-				  (if case-fold "-i" "") command t t))
-  (setq command
-	(replace-regexp-in-string "<R>"
-				  (or regexp "") command t t))
-  command)
+
+;; User-friendly interactive API.
+
+(defconst grep-expand-keywords
+  '(("<C>" . (and cf (isearch-no-upper-case-p regexp t) "-i"))
+    ("<D>" . dir)
+    ("<F>" . files)
+    ("<N>" . null-device)
+    ("<X>" . excl)
+    ("<R>" . (shell-quote-argument (or regexp ""))))
+  "List of substitutions performed by `grep-expand-template'.
+If car of an element matches, the cdr is evalled in to get the
+substitution string.  Note dynamic scoping of variables.")
+
+(defun grep-expand-template (template &optional regexp files dir excl)
+  "Patch grep COMMAND string replacing <C>, <D>, <F>, <R>, and <X>."
+  (let ((command template)
+	(cf case-fold-search)
+	(case-fold-search nil))
+    (dolist (kw grep-expand-keywords command)
+      (if (string-match (car kw) command)
+	  (setq command
+		(replace-match
+		 (or (if (symbolp (cdr kw))
+			 (eval (cdr kw))
+		       (save-match-data (eval (cdr kw))))
+		     "")
+		 t t command))))))
 
-(defvar grep-tree-last-regexp "")
-(defvar grep-tree-last-files (car (car grep-tree-files-aliases)))
+(defun grep-read-regexp ()
+  "Read regexp arg for interactive grep."
+  (let ((default
+	  (or (funcall (or find-tag-default-function
+			   (get major-mode 'find-tag-default-function)
+			   'find-tag-default))
+	      "")))
+    (read-string
+     (concat "Search for"
+	     (if (and default (> (length default) 0))
+		 (format " (default %s): " default) ": "))
+     nil 'grep-regexp-history default)))
+
+(defun grep-read-files (regexp)
+  "Read files arg for interactive grep."
+  (let* ((bn (or (buffer-file-name) (buffer-name)))
+	 (fn (and bn
+		  (stringp bn)
+		  (file-name-nondirectory bn)))
+	 (default
+	   (or (and fn
+		    (let ((aliases grep-files-aliases)
+			  alias)
+		      (while aliases
+			(setq alias (car aliases)
+			      aliases (cdr aliases))
+			(if (string-match (wildcard-to-regexp (cdr alias)) fn)
+			    (setq aliases nil)
+			  (setq alias nil)))
+		      (cdr alias)))
+	       (and fn
+		    (let ((ext (file-name-extension fn)))
+		      (and ext (concat "*." ext))))))
+	 (files (read-string
+		 (concat "Search for \"" regexp
+			 "\" in files"
+			 (if default (concat " (default " default ")"))
+			 ": ")
+		 nil 'grep-files-history default)))
+    (and files
+	 (or (cdr (assoc files grep-files-aliases))
+	     files))))
 
 ;;;###autoload
-(defun grep-tree (regexp files dir &optional subdirs)
-  "Grep for REGEXP in FILES in directory tree rooted at DIR.
-Collect output in a buffer.
-Interactively, prompt separately for each search parameter.
-With prefix arg, reuse previous REGEXP.
+(defun lgrep (regexp &optional files)
+  "Run grep, searching for REGEXP in FILES in current directory.
 The search is limited to file names matching shell pattern FILES.
-FILES may use abbreviations defined in `grep-tree-files-aliases', e.g.
+FILES may use abbreviations defined in `grep-files-aliases', e.g.
 entering `ch' is equivalent to `*.[ch]'.
 
-While find runs asynchronously, you can use the \\[next-error] command
-to find the text that grep hits refer to.
+With \\[universal-argument] prefix, allow user to edit the constructed
+shell command line before it is executed.
+With two \\[universal-argument] prefixes, edit and run grep shell command.
 
-This command uses a special history list for its arguments, so you can
-easily repeat a find command.
+Collect output in a buffer.  While grep runs asynchronously, you
+can use \\[next-error] (M-x next-error), or \\<grep-mode-map>\\[compile-goto-error]
+in the grep output buffer, to go to the lines where grep found matches.
 
-When used non-interactively, optional arg SUBDIRS limits the search to
-those sub directories of DIR."
+This command shares argument histories with \\[rgrep] and \\[grep]."
   (interactive
-   (let* ((regexp
-	   (if current-prefix-arg
-	       grep-tree-last-regexp
-	     (let* ((default (current-word))
-		    (spec (read-string
-			   (concat "Search for"
-				   (if (and default (> (length default) 0))
-				       (format " (default %s): " default) ": ")))))
-	       (if (equal spec "") default spec))))
-	  (files
-	   (read-string (concat "Search for \"" regexp "\" in files (default "   grep-tree-last-files  "): ")))
-	  (dir
-	   (read-directory-name "Base directory: " nil default-directory t)))
-     (list regexp files dir)))
-  (unless grep-tree-command
-    (grep-compute-defaults))
-  (unless (and (stringp files) (> (length files) 0))
-    (setq files grep-tree-last-files))
-  (when files
-    (setq grep-tree-last-files files)
-    (let ((mf (assoc files grep-tree-files-aliases)))
-      (if mf
-	  (setq files (cdr mf)))))
-  (let ((command-args (grep-expand-command-macros
-		       grep-tree-command
-		       (setq grep-tree-last-regexp regexp)
-		       (and files (concat "-name '" files "'"))
-		       (if subdirs
-			   (if (stringp subdirs)
-			       subdirs
-			     (mapconcat 'identity subdirs " "))
-			 nil)  ;; we change default-directory to dir
-		       (and grep-tree-ignore-CVS-directories "-path '*/CVS' -prune -o ")
-		       grep-tree-ignore-case))
-	(default-directory (file-name-as-directory (expand-file-name dir)))
-	(null-device nil))		; see grep
-    (grep command-args regexp)))
+   (progn
+     (grep-compute-defaults)
+     (cond
+      ((and grep-command (equal current-prefix-arg '(16)))
+       (list (read-from-minibuffer "Run: " grep-command
+				   nil nil 'grep-history)
+	     nil))
+      ((not grep-template)
+       (list nil
+	     (read-string "grep.el: No `grep-template' available. Press RET.")))
+      (t (let* ((regexp (grep-read-regexp))
+		(files (grep-read-files regexp)))
+	   (list regexp files))))))
+  (when (and (stringp regexp) (> (length regexp) 0))
+    (let ((command regexp))
+      (if (null files)
+	  (if (string= command grep-command)
+	      (setq command nil))
+	(setq command (grep-expand-template
+		       grep-template
+		       regexp
+		       files))
+	(when command
+	  (if (equal current-prefix-arg '(4))
+	      (setq command
+		    (read-from-minibuffer "Confirm: "
+					  command nil nil 'grep-history))
+	    (push command grep-history))))
+      (when command
+	;; Setting process-setup-function makes exit-message-function work
+	;; even when async processes aren't supported.
+	(compilation-start (if (and grep-use-null-device null-device)
+			       (concat command " " null-device)
+			     command) 'grep-mode)))))
+
+
+;;;###autoload
+(defun rgrep (regexp &optional files dir)
+  "Recusively grep for REGEXP in FILES in directory tree rooted at DIR.
+The search is limited to file names matching shell pattern FILES.
+FILES may use abbreviations defined in `grep-files-aliases', e.g.
+entering `ch' is equivalent to `*.[ch]'.
+
+With \\[universal-argument] prefix, allow user to edit the constructed
+shell command line before it is executed.
+With two \\[universal-argument] prefixes, edit and run grep-find shell command.
+
+Collect output in a buffer.  While find runs asynchronously, you
+can use \\[next-error] (M-x next-error), or \\<grep-mode-map>\\[compile-goto-error]
+in the grep output buffer, to go to the lines where grep found matches.
+
+This command shares argument histories with \\[lgrep] and \\[grep-find]."
+  (interactive
+   (progn
+     (grep-compute-defaults)
+     (cond
+      ((and grep-find-command (equal current-prefix-arg '(16)))
+       (list (read-from-minibuffer "Run: " grep-find-command
+				   nil nil 'grep-find-history)
+	     nil))
+      ((not grep-find-template)
+       (list nil nil
+	     (read-string "grep.el: No `grep-find-template' available. Press RET.")))
+      (t (let* ((regexp (grep-read-regexp))
+		(files (grep-read-files regexp))
+		(dir (read-directory-name "Base directory: "
+					  nil default-directory t)))
+	   (list regexp files dir))))))
+  (when (and (stringp regexp) (> (length regexp) 0))
+    (if (null files)
+	(if (not (string= regexp grep-find-command))
+	    (compilation-start regexp 'grep-mode))
+      (let* ((default-directory (file-name-as-directory (expand-file-name dir)))
+	     (command (grep-expand-template
+		       grep-find-template
+		       regexp
+		       (concat "\\( -name "
+			       (mapconcat #'shell-quote-argument
+					  (split-string files)
+					  " -o -name ")
+			       " \\)")
+		       default-directory
+		       (and grep-find-ignored-directories
+			    (concat "\\( -path '*/"
+				    (mapconcat #'identity
+					       grep-find-ignored-directories
+					       "' -o -path '*/")
+				    "' \\) -prune -o ")))))
+	(when command
+	  (if current-prefix-arg
+	      (setq command
+		    (read-from-minibuffer "Confirm: "
+					  command nil nil 'grep-find-history))
+	    (push command grep-find-history))
+	  (compilation-start command 'grep-mode))))))
 
 
 (provide 'grep)
--- a/lisp/progmodes/gud.el	Fri Apr 21 05:39:14 2006 +0000
+++ b/lisp/progmodes/gud.el	Tue May 02 05:51:52 2006 +0000
@@ -83,6 +83,8 @@
 (defvar gud-minor-mode nil)
 (put 'gud-minor-mode 'permanent-local t)
 
+(defvar gud-comint-buffer nil)
+
 (defvar gud-keep-buffer nil)
 
 (defun gud-symbol (sym &optional soft minor-mode)
@@ -301,13 +303,15 @@
 optional doc string DOC.  Certain %-escapes in the string arguments
 are interpreted specially if present.  These are:
 
-  %f    name (without directory) of current source file.
-  %F    name (without directory or extension) of current source file.
-  %d    directory of current source file.
-  %l    number of current source line
-  %e    text of the C lvalue or function-call expression surrounding point.
-  %a    text of the hexadecimal address surrounding point
-  %p    prefix argument to the command (if any) as a number
+  %f -- Name (without directory) of current source file.
+  %F -- Name (without directory or extension) of current source file.
+  %d -- Directory of current source file.
+  %l -- Number of current source line.
+  %e -- Text of the C lvalue or function-call expression surrounding point.
+  %a -- Text of the hexadecimal address surrounding point.
+  %p -- Prefix argument to the command (if any) as a number.
+  %c -- Fully qualified class name derived from the expression
+        surrounding point (jdb only).
 
   The `current' source file is the file of the current buffer (if
 we're in a C file) or the source file current at the last break or
@@ -444,8 +448,7 @@
 	(when (or gdb-force-update
 		  (not (save-excursion
 			 (goto-char (point-min))
-			 (let ((case-fold-search t))
-			   (looking-at "Watch Expressions:")))))
+			 (looking-at "Watch Expressions:"))))
 	  (erase-buffer)
 	  (insert "Watch Expressions:\n")
 	  (if gdb-speedbar-auto-raise
@@ -740,8 +743,6 @@
 ;; The completion list is constructed by the process filter.
 (defvar gud-gdb-fetched-lines)
 
-(defvar gud-comint-buffer nil)
-
 (defun gud-gdb-complete-command (&optional command a b)
   "Perform completion on the GDB command preceding point.
 This is implemented using the GDB `complete' command which isn't
@@ -2804,7 +2805,9 @@
   (let ((insource (not (eq (current-buffer) gud-comint-buffer)))
 	(frame (or gud-last-frame gud-last-last-frame))
 	result)
-    (while (and str (string-match "\\([^%]*\\)%\\([adeflpc]\\)" str))
+    (while (and str
+		(let ((case-fold-search nil))
+		  (string-match "\\([^%]*\\)%\\([adefFlpc]\\)" str)))
       (let ((key (string-to-char (match-string 2 str)))
 	    subst)
 	(cond
@@ -2889,8 +2892,11 @@
       (set-buffer gud-comint-buffer)
       (save-restriction
 	(widen)
-	(goto-char (process-mark proc))
-	(forward-line 0)
+	(if (marker-position gud-delete-prompt-marker)
+	    ;; We get here when printing an expression.
+	    (goto-char gud-delete-prompt-marker)
+	  (goto-char (process-mark proc))
+	  (forward-line 0))
 	(if (looking-at comint-prompt-regexp)
 	    (set-marker gud-delete-prompt-marker (point)))
 	(if (memq gud-minor-mode '(gdbmi gdba))
@@ -2911,7 +2917,21 @@
 (defvar gud-find-expr-function 'gud-find-c-expr)
 
 (defun gud-find-expr (&rest args)
-  (apply gud-find-expr-function args))
+  (let ((expr (if (and transient-mark-mode mark-active)
+		  (buffer-substring (region-beginning) (region-end))
+		(apply gud-find-expr-function args))))
+    (save-match-data
+      (if (string-match "\n" expr)
+	  (error "Expression must not include a newline"))
+      (with-current-buffer gud-comint-buffer
+	(save-excursion
+	  (goto-char (process-mark (get-buffer-process gud-comint-buffer)))
+	  (forward-line 0)
+	  (when (looking-at comint-prompt-regexp)
+	    (set-marker gud-delete-prompt-marker (point))
+	    (set-marker-insertion-type gud-delete-prompt-marker t))
+	  (insert (concat  expr " = ")))))
+    expr))
 
 ;; The next eight functions are hacked from gdbsrc.el by
 ;; Debby Ayers <ayers@asc.slb.com>,
--- a/lisp/progmodes/python.el	Fri Apr 21 05:39:14 2006 +0000
+++ b/lisp/progmodes/python.el	Tue May 02 05:51:52 2006 +0000
@@ -292,9 +292,9 @@
 comments and strings, or that the bracket/paren nesting depth is nonzero."
   (or (and (eq ?\\ (char-before (line-end-position 0)))
 	   (not (syntax-ppss-context (syntax-ppss))))
-      (/= 0 (syntax-ppss-depth
-	     (save-excursion	  ; syntax-ppss with arg changes point
-	       (syntax-ppss (line-beginning-position)))))))
+      (< 0 (syntax-ppss-depth
+            (save-excursion	  ; syntax-ppss with arg changes point
+              (syntax-ppss (line-beginning-position)))))))
 
 (defun python-comment-line-p ()
   "Return non-nil iff current line has only a comment."
@@ -719,7 +719,10 @@
 	(python-beginning-of-string)
 	;; Skip forward out of nested brackets.
 	(condition-case ()		; beware invalid syntax
-	    (progn (backward-up-list (syntax-ppss-depth (syntax-ppss))) t)
+	    (let ((depth (syntax-ppss-depth (syntax-ppss))))
+              ;; Beware negative depths.
+              (if (> depth 0) (backward-up-list depth))
+              t)
 	  (error (throw 'foo nil))))))
   (back-to-indentation))
 
@@ -1755,7 +1758,6 @@
   (if (featurep 'hippie-exp)
       (set (make-local-variable 'hippie-expand-try-functions-list)
 	   (cons 'python-try-complete hippie-expand-try-functions-list)))
-  (unless font-lock-mode (font-lock-mode 1))
   (when python-guess-indent (python-guess-indent))
   (set (make-local-variable 'python-command) python-python-command)
   (unless (boundp 'python-mode-running)	; kill the recursion from jython-mode
--- a/lisp/reveal.el	Fri Apr 21 05:39:14 2006 +0000
+++ b/lisp/reveal.el	Tue May 02 05:51:52 2006 +0000
@@ -3,7 +3,7 @@
 ;; Copyright (C) 2000, 2001, 2002, 2003, 2004,
 ;;   2005, 2006 Free Software Foundation, Inc.
 
-;; Author: Stefan Monnier <monnier@cs.yale.edu>
+;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
 ;; Keywords: outlines
 
 ;; This file is part of GNU Emacs.
--- a/lisp/simple.el	Fri Apr 21 05:39:14 2006 +0000
+++ b/lisp/simple.el	Tue May 02 05:51:52 2006 +0000
@@ -1709,7 +1709,7 @@
 	;; but we don't want to ask the question again.
 	(setq undo-extra-outer-limit (+ size 50000))
 	(if (let (use-dialog-box track-mouse executing-kbd-macro )
-	      (yes-or-no-p (format "Buffer %s undo info is %d bytes long; discard it? "
+	      (yes-or-no-p (format "Buffer `%s' undo info is %d bytes long; discard it? "
 				   (buffer-name) size)))
 	    (progn (setq buffer-undo-list nil)
 		   (setq undo-extra-outer-limit nil)
@@ -1717,7 +1717,7 @@
 	  nil))
     (display-warning '(undo discard-info)
 		     (concat
-		      (format "Buffer %s undo info was %d bytes long.\n"
+		      (format "Buffer `%s' undo info was %d bytes long.\n"
 			      (buffer-name) size)
 		      "The undo info was discarded because it exceeded \
 `undo-outer-limit'.
--- a/lisp/smerge-mode.el	Fri Apr 21 05:39:14 2006 +0000
+++ b/lisp/smerge-mode.el	Tue May 02 05:51:52 2006 +0000
@@ -3,7 +3,7 @@
 ;; Copyright (C) 1999, 2000, 2001, 2002, 2003,
 ;;   2004, 2005, 2006 Free Software Foundation, Inc.
 
-;; Author: Stefan Monnier <monnier@cs.yale.edu>
+;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
 ;; Keywords: tools revision-control merge diff3 cvs conflict
 
 ;; This file is part of GNU Emacs.
--- a/lisp/startup.el	Fri Apr 21 05:39:14 2006 +0000
+++ b/lisp/startup.el	Tue May 02 05:51:52 2006 +0000
@@ -1620,6 +1620,15 @@
   (when init-file-had-error
     (sit-for 2))
 
+  (when (and pure-space-overflow
+	     (not noninteractive))
+    (display-warning
+     'initialization
+     "Building Emacs overflowed pure space."
+     ;; FIXME: Tell the user what kind of problems are possible and how to fix
+     ;; the overflow.
+     :warning))
+
   (when command-line-args-left
     ;; We have command args; process them.
     (let ((dir command-line-default-directory)
--- a/lisp/subr.el	Fri Apr 21 05:39:14 2006 +0000
+++ b/lisp/subr.el	Tue May 02 05:51:52 2006 +0000
@@ -851,19 +851,23 @@
   (nth 3 position))
 
 (defsubst posn-string (position)
-  "Return the string object of POSITION, or nil if a buffer position.
+  "Return the string object of POSITION.
+Value is a cons (STRING . STRING-POS), or nil if not a string.
 POSITION should be a list of the form returned by the `event-start'
 and `event-end' functions."
   (nth 4 position))
 
 (defsubst posn-image (position)
-  "Return the image object of POSITION, or nil if a not an image.
+  "Return the image object of POSITION.
+Value is an list (image ...), or nil if not an image.
 POSITION should be a list of the form returned by the `event-start'
 and `event-end' functions."
   (nth 7 position))
 
 (defsubst posn-object (position)
   "Return the object (image or string) of POSITION.
+Value is a list (image ...) for an image object, a cons cell
+\(STRING . STRING-POS) for a string object, and nil for a buffer position.
 POSITION should be a list of the form returned by the `event-start'
 and `event-end' functions."
   (or (posn-image position) (posn-string position)))
@@ -1258,25 +1262,25 @@
 
 ;;; Load history
 
-;;; (defvar symbol-file-load-history-loaded nil
-;;;   "Non-nil means we have loaded the file `fns-VERSION.el' in `exec-directory'.
-;;; That file records the part of `load-history' for preloaded files,
-;;; which is cleared out before dumping to make Emacs smaller.")
-
-;;; (defun load-symbol-file-load-history ()
-;;;   "Load the file `fns-VERSION.el' in `exec-directory' if not already done.
-;;; That file records the part of `load-history' for preloaded files,
-;;; which is cleared out before dumping to make Emacs smaller."
-;;;   (unless symbol-file-load-history-loaded
-;;;     (load (expand-file-name
-;;; 	   ;; fns-XX.YY.ZZ.el does not work on DOS filesystem.
-;;; 	   (if (eq system-type 'ms-dos)
-;;; 	       "fns.el"
-;;; 	     (format "fns-%s.el" emacs-version))
-;;; 	   exec-directory)
-;;; 	  ;; The file name fns-%s.el already has a .el extension.
-;;; 	  nil nil t)
-;;;     (setq symbol-file-load-history-loaded t)))
+;; (defvar symbol-file-load-history-loaded nil
+;;   "Non-nil means we have loaded the file `fns-VERSION.el' in `exec-directory'.
+;; That file records the part of `load-history' for preloaded files,
+;; which is cleared out before dumping to make Emacs smaller.")
+
+;; (defun load-symbol-file-load-history ()
+;;   "Load the file `fns-VERSION.el' in `exec-directory' if not already done.
+;; That file records the part of `load-history' for preloaded files,
+;; which is cleared out before dumping to make Emacs smaller."
+;;   (unless symbol-file-load-history-loaded
+;;     (load (expand-file-name
+;; 	   ;; fns-XX.YY.ZZ.el does not work on DOS filesystem.
+;; 	   (if (eq system-type 'ms-dos)
+;; 	       "fns.el"
+;; 	     (format "fns-%s.el" emacs-version))
+;; 	   exec-directory)
+;; 	  ;; The file name fns-%s.el already has a .el extension.
+;; 	  nil nil t)
+;;     (setq symbol-file-load-history-loaded t)))
 
 (defun symbol-file (symbol &optional type)
   "Return the input source in which SYMBOL was defined.
@@ -1923,6 +1927,10 @@
 Otherwise, return nil."
   (or (stringp object) (null object)))
 
+(defun booleanp (object)
+  "Return non-nil if OBJECT is one of the two canonical boolean values: t or nil."
+  (memq object '(nil t)))
+
 
 ;;;; Support for yanking and text properties.
 
--- a/lisp/term/mac-win.el	Fri Apr 21 05:39:14 2006 +0000
+++ b/lisp/term/mac-win.el	Tue May 02 05:51:52 2006 +0000
@@ -1480,7 +1480,7 @@
 	     (re-search-forward
 	      (mapconcat 'regexp-quote (split-string search-text) "\\|")
 	      nil t)))))
-  (raise-frame))
+  (select-frame-set-input-focus (selected-frame)))
 
 (defun mac-ae-text (ae)
   (or (cdr (mac-ae-parameter ae nil "TEXT"))
@@ -1911,9 +1911,10 @@
     (dolist (file-name (nth 2 event))
       (dnd-handle-one-url window 'private
 			  (concat "file:" file-name))))
-  (raise-frame))
+  (select-frame-set-input-focus (selected-frame)))
 
 (global-set-key [drag-n-drop] 'mac-drag-n-drop)
+(global-set-key [M-drag-n-drop] 'mac-drag-n-drop)
 
 ;;;; Non-toolkit Scroll bars
 
--- a/lisp/textmodes/bibtex.el	Fri Apr 21 05:39:14 2006 +0000
+++ b/lisp/textmodes/bibtex.el	Tue May 02 05:51:52 2006 +0000
@@ -103,6 +103,7 @@
                                        (choice :tag "Init" :value ""
                                                string
                                                function))))))
+(put 'bibtex-user-optional-fields 'risky-local-variable t)
 
 (defcustom bibtex-entry-format
   '(opts-or-alts required-fields numerical-fields)
@@ -3303,7 +3304,7 @@
               (display (message "Key `%s' not found" key)))
         found)
 
-    (let* (case-fold-search
+    (let* ((case-fold-search t)
            (pnt (save-excursion
                   (goto-char (or start (point-min)))
                   (if (re-search-forward (concat "^[ \t]*\\("
@@ -4330,11 +4331,12 @@
             "\n")
     (goto-char endpos)))
 
-(defun bibtex-url (&optional pos)
+(defun bibtex-url (&optional pos no-browse)
   "Browse a URL for the BibTeX entry at point.
 Optional POS is the location of the BibTeX entry.
 The URL is generated using the schemes defined in `bibtex-generate-url-list'
-\(see there\).  Then the URL is passed to `browse-url'."
+\(see there\).  Then the URL is passed to `browse-url' unless NO-BROWSE is nil.
+Return the URL or nil if none can be generated."
   (interactive)
   (save-excursion
     (if pos (goto-char pos))
@@ -4369,8 +4371,10 @@
                           (error "Match failed: %s" field)))
                       (if fmt (apply 'format fmt (nreverse obj))
                         (apply 'concat (nreverse obj)))))
-          (browse-url (message "%s" url))))
-      (unless url (message "No URL known.")))))
+          (if (interactive-p) (message "%s" url))
+          (unless no-browse (browse-url url))))
+      (if (and (not url) (interactive-p)) (message "No URL known."))
+      url)))
 
 
 ;; Make BibTeX a Feature
--- a/lisp/textmodes/fill.el	Fri Apr 21 05:39:14 2006 +0000
+++ b/lisp/textmodes/fill.el	Tue May 02 05:51:52 2006 +0000
@@ -48,7 +48,7 @@
   "*Non-nil means put two spaces after a colon when filling."
   :type 'boolean
   :group 'fill)
-;;;###autoload(put 'colon-double-space 'safe-local-variable t)
+;;;###autoload(put 'colon-double-space 'safe-local-variable 'booleanp)
 
 (defvar fill-paragraph-function nil
   "Mode-specific function to fill a paragraph, or nil if there is none.
--- a/lisp/textmodes/org.el	Fri Apr 21 05:39:14 2006 +0000
+++ b/lisp/textmodes/org.el	Tue May 02 05:51:52 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.25
+;; Version: 4.26
 ;;
 ;; This file is part of GNU Emacs.
 ;;
@@ -79,8 +79,11 @@
 ;; excellent reference card made by Philip Rooke.  This card can be found
 ;; in the etc/ directory of Emacs 22.
 ;;
-;; Changes since version 4.00:
+;; Changes since version 4.10:
 ;; ---------------------------
+;; Version 4.26
+;;    - Bug fixes.
+;;
 ;; Version 4.25
 ;;    - Revision of the font-lock faces section, with better tty support.
 ;;    - TODO keywords in Agenda buffer are fontified.
@@ -119,60 +122,6 @@
 ;;      `org-time-stamp-rounding-minutes'.
 ;;    - Bug fixes (there are *always* more bugs).
 ;;
-;; Version 4.10
-;;    - Bug fixes.
-;;
-;; Version 4.09
-;;    - Bug fixes.
-;;    - Small improvements to font-lock support.
-;;    - MHE support finalized.
-;;
-;; Version 4.08
-;;    - Bug fixes.
-;;    - Improved MHE support
-;;
-;; Version 4.07
-;;    - Bug fixes.
-;;    - Leading stars in headlines can be hidden, so make the outline look
-;;      cleaner.
-;;    - Mouse-1 can be used to follow links.
-;;
-;; Version 4.06
-;;    - HTML exporter treats targeted internal links.
-;;    - Bug fixes.
-;;
-;; Version 4.05
-;;    - Changes to internal link system (thanks to David Wainberg for ideas).
-;;      - in-file links: [[Search String]] instead of <file:::Search String>
-;;      - automatic links to "radio targets".
-;;      - CamelCase not longer active by default, configure org-activate-camels
-;;        if you want to turn it back on.
-;;      - After following a link, `C-c &' jumps back to it.
-;;    - MH-E link support (thanks to Thomas Baumann).
-;;    - Special table lines are no longer exported.
-;;    - Bug fixes and minor improvements.
-;;
-;; Version 4.04
-;;    - Cleanup tags display in agenda.
-;;    - Bug fixes.
-;;
-;; Version 4.03
-;;    - Table alignment fixed for use with wide characters.
-;;    - `C-c -' leaves cursor in current table line.
-;;    - The current TAG can be incorporated into the agenda prefix.
-;;      See option `org-agenda-prefix-format' for details.
-;;
-;; Version 4.02
-;;    - Minor bug fixes and improvements around tag searches.
-;;    - XEmacs compatibility fixes.
-;;
-;; Version 4.01
-;;    - Tags can also be set remotely from agenda buffer.
-;;    - Boolean logic for tag searches.
-;;    - Additional agenda commands can be configured through the variable
-;;      `org-agenda-custom-commands'.
-;;    - Minor bug fixes.
-;;
 ;;; Code:
 
 (eval-when-compile 
@@ -188,7 +137,7 @@
 
 ;;; Customization variables
 
-(defvar org-version "4.25"
+(defvar org-version "4.26"
   "The version number of the file org.el.")
 (defun org-version ()
   (interactive)
@@ -198,7 +147,7 @@
 ;; of outline.el.
 (defconst org-noutline-p (featurep 'noutline)
   "Are we using the new outline mode?")
-(defconst org-xemacs-p (featurep 'xemacs))  ;; FIXME: used by external code?
+(defconst org-xemacs-p (featurep 'xemacs)) ; not used by org.el itself
 (defconst org-format-transports-properties-p
   (let ((x "a"))
     (add-text-properties 0 1 '(test t) x)
@@ -2383,7 +2332,10 @@
 (defvar orgtbl-mode) ; defined later in this file
 ;;; Define the mode
 
-(defvar org-mode-map (copy-keymap outline-mode-map)
+(defvar org-mode-map 
+  (if (and (not (keymapp outline-mode-map)) (featurep 'allout))
+      (error "Conflict with outdated version of allout.el.  Load org.el before allout.el, or ugrade to newer allout, for example by switching to Emacs 22.")
+    (copy-keymap outline-mode-map))
   "Keymap for Org-mode.")
 
 (defvar org-struct-menu) ; defined later in this file
@@ -7448,9 +7400,8 @@
 				   (org-add-props cmd nil
 				     'face 'org-warning))))
 	      (progn
-		(message "Executing %s..." cmd)
-		(shell-command cmd)
-		(message "Executing %s...done" cmd))
+		(message "Executing %s" cmd)
+		(shell-command cmd))
 	    (error "Abort"))))
 
        (t
@@ -7904,8 +7855,7 @@
 	  (setq cmd 'emacs))))
     (cond
      ((and (stringp cmd) (not (string-match "^\\s-*$" cmd)))
-;      (setq cmd (format cmd (concat "\"" file "\"")))
-      ;; FIXME: normalize use of quotes
+      ;; Normalize use of quote, this can vary.
       (if (string-match "['\"]%s['\"]" cmd)
 	  (setq cmd (replace-match "'%s'" t t cmd)))
       (setq cmd (format cmd file))
@@ -8958,10 +8908,10 @@
 		    e (not (= (match-beginning 2) (match-end 2))))
 	      (setq f (format (if num " %%%ds %s" " %%-%ds %s")
 			      l (if e "|" (setq org-table-may-need-update t) ""))
-		    n (format f s t t))
+		    n (format f s))
 	      (if new
-		  (if (<= (length new) l)
-		      (setq n (format f new t t))  ;; FIXME: why t t?????
+		  (if (<= (length new) l)      ;; FIXME: length -> str-width?
+		      (setq n (format f new t t))  ;; FIXME: t t?
 		    (setq n (concat new "|") org-table-may-need-update t)))
 	      (or (equal n o)
 		  (let (org-table-may-need-update)
@@ -12277,16 +12227,6 @@
       (setq string (replace-match (match-string 1 string) t t string))))
   string)
 
-;(defun org-export-html-convert-emphasize (string)
-;  (let (c (s 0))
-;    (while (string-match "\\(\\W\\|^\\)\\([*/_]\\)\\(\\w+\\)\\2\\(\\W\\|$\\)" string s)
-;      (setq c (cdr (assoc (match-string 2 string)
-;			  '(("*" . "b") ("/" . "i") ("_" . "u"))))
-;	    s (+ (match-end 0) 3)
-;	    string (replace-match
-;		    (concat "\\1<" c ">\\3</" c ">\\4") t nil string)))
-;    string))
-
 (defun org-export-html-convert-emphasize (string)
   (while (string-match org-italic-re string)
     (setq string (replace-match "\\1<i>\\3</i>\\4" t nil string)))
@@ -12496,7 +12436,7 @@
 
       ;; Finish the buffer off and clean it up.
       (switch-to-buffer-other-window out)
-      (indent-region (point-min) (point-max))
+      (indent-region (point-min) (point-max) nil)
       (save-buffer)
       (goto-char (point-min))
       )))
@@ -12719,6 +12659,8 @@
 (define-key org-mode-map [?\C-c ?\C-x (right)] 'org-shiftright)
 
 ;; All the other keys
+
+(define-key org-mode-map "\C-c\C-a" 'show-all)  ; in case allout messed up.
 (define-key org-mode-map "\C-c$"    'org-archive-subtree)
 (define-key org-mode-map "\C-c\C-j" 'org-goto)
 (define-key org-mode-map "\C-c\C-t" 'org-todo)
--- a/lisp/textmodes/paragraphs.el	Fri Apr 21 05:39:14 2006 +0000
+++ b/lisp/textmodes/paragraphs.el	Tue May 02 05:51:52 2006 +0000
@@ -81,7 +81,7 @@
 		  (set-hard-newline-properties (point) (1+ (point)))))))))))
 
 (defcustom paragraph-start "\f\\|[ \t]*$" "\
-*Regexp for beginning of a line that starts OR separates paragraphs.
+Regexp for beginning of a line that starts OR separates paragraphs.
 This regexp should match lines that separate paragraphs
 and should also match lines that start a paragraph
 \(and are part of that paragraph).
@@ -107,7 +107,7 @@
 ;; start a new paragraph).
 
 (defcustom paragraph-separate "[ \t\f]*$"
-  "*Regexp for beginning of a line that separates paragraphs.
+  "Regexp for beginning of a line that separates paragraphs.
 If you change this, you may have to change `paragraph-start' also.
 
 This is matched against the text at the left margin, which is not necessarily
@@ -119,7 +119,7 @@
 ;;;###autoload(put 'paragraph-separate 'safe-local-variable 'stringp)
 
 (defcustom sentence-end-double-space t
-  "*Non-nil means a single space does not end a sentence.
+  "Non-nil means a single space does not end a sentence.
 This is relevant for filling.  See also `sentence-end-without-period'
 and `colon-double-space'.
 
@@ -128,10 +128,10 @@
 `sentence-end' is nil.  See Info node `(elisp)Standard Regexps'."
   :type 'boolean
   :group 'fill)
-;;;###autoload(put 'sentence-end-double-space 'safe-local-variable t)
+;;;###autoload(put 'sentence-end-double-space 'safe-local-variable 'booleanp)
 
 (defcustom sentence-end-without-period nil
-  "*Non-nil means a sentence will end without a period.
+  "Non-nil means a sentence will end without a period.
 For example, a sentence in Thai text ends with double space but
 without a period.
 
@@ -140,21 +140,21 @@
 `sentence-end' is nil.  See Info node `(elisp)Standard Regexps'."
   :type 'boolean
   :group 'fill)
-;;;###autoload(put 'sentence-end-without-period 'safe-local-variable t)
+;;;###autoload(put 'sentence-end-without-period 'safe-local-variable 'booleanp)
 
 (defcustom sentence-end-without-space
   "$B!#!%!)!*$A!##.#?#!$(0!$!%!)!*$(G!$!%!)!*(B"
-  "*String of characters that end sentence without following spaces.
+  "String of characters that end sentence without following spaces.
 
 This value is used by the function `sentence-end' to construct the
 regexp describing the end of a sentence, when the value of the variable
 `sentence-end' is nil.  See Info node `(elisp)Standard Regexps'."
   :group 'paragraphs
   :type 'string)
-;;;###autoload(put 'sentence-end-without-space 'safe-local-variable t)
+;;;###autoload(put 'sentence-end-without-space 'safe-local-variable 'stringp)
 
 (defcustom sentence-end nil
-  "*Regexp describing the end of a sentence.
+  "Regexp describing the end of a sentence.
 The value includes the whitespace following the sentence.
 All paragraph boundaries also end sentences, regardless.
 
@@ -166,7 +166,7 @@
 ;;;###autoload(put 'sentence-end 'safe-local-variable 'string-or-null-p)
 
 (defcustom sentence-end-base "[.?!][]\"'$B!I$,1r}(B)}]*"
-  "*Regexp matching the basic end of a sentence, not including following space."
+  "Regexp matching the basic end of a sentence, not including following space."
   :group 'paragraphs
   :type 'string
   :version "22.1")
@@ -195,17 +195,17 @@
               "[ \t\n]*")))
 
 (defcustom page-delimiter "^\014"
-  "*Regexp describing line-beginnings that separate pages."
+  "Regexp describing line-beginnings that separate pages."
   :group 'paragraphs
   :type 'regexp)
-;;;###autoload(put 'page-delimiter 'safe-local-variable t)
+;;;###autoload(put 'page-delimiter 'safe-local-variable 'stringp)
 
 (defcustom paragraph-ignore-fill-prefix nil
-  "*Non-nil means the paragraph commands are not affected by `fill-prefix'.
+  "Non-nil means the paragraph commands are not affected by `fill-prefix'.
 This is desirable in modes where blank lines are the paragraph delimiters."
   :group 'paragraphs
   :type 'boolean)
-;;;###autoload(put 'paragraph-ignore-fill-prefix 'safe-local-variable t)
+;;;###autoload(put 'paragraph-ignore-fill-prefix 'safe-local-variable 'booleanp)
 
 (defun forward-paragraph (&optional arg)
   "Move forward to end of paragraph.
--- a/lisp/textmodes/reftex-vars.el	Fri Apr 21 05:39:14 2006 +0000
+++ b/lisp/textmodes/reftex-vars.el	Tue May 02 05:51:52 2006 +0000
@@ -948,7 +948,7 @@
 the label types for which it should be true."
   :group  'reftex-referencing-labels
   :type `(choice :tag "\\vref is default macro" ,@reftex-tmp))
-;;;###autoload(put 'reftex-vref-is-default 'safe-local-variable t)
+;;;###autoload(put 'reftex-vref-is-default 'safe-local-variable (lambda (x) (or (stringp x) (symbolp x))))
 
 (defcustom reftex-fref-is-default nil
   "*Non-nil means, the fancyref macro \\fref is used as default.
@@ -959,7 +959,7 @@
 the label types for which it should be true."
   :group  'reftex-referencing-labels
   :type `(choice :tag "\\fref is default macro" ,@reftex-tmp))
-;;;###autoload(put 'reftex-fref-is-default 'safe-local-variable t)
+;;;###autoload(put 'reftex-fref-is-default 'safe-local-variable (lambda (x) (or (stringp x) (symbolp x))))
 
 (defcustom reftex-level-indent 2
   "*Number of spaces to be used for indentation per section level."
@@ -975,7 +975,7 @@
 a label type.  If you set this variable to nil, RefTeX will always prompt."
   :group 'reftex-referencing-labels
   :type 'boolean)
-;;;###autoload(put 'reftex-guess-label-type 'safe-local-variable t)
+;;;###autoload(put 'reftex-guess-label-type 'safe-local-variable (lambda (x) (memq x '(nil t))))
 
 (defcustom reftex-format-ref-function nil
   "Function which produces the string to insert as a reference.
--- a/lisp/time-stamp.el	Fri Apr 21 05:39:14 2006 +0000
+++ b/lisp/time-stamp.el	Tue May 02 05:51:52 2006 +0000
@@ -164,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)
+;;;###autoload(put 'time-stamp-start 'safe-local-variable 'stringp)
 
 (defvar time-stamp-end "\\\\?[\">]"    ;Do not change!
   "Regexp marking the text after the time stamp.
@@ -184,7 +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)
+;;;###autoload(put 'time-stamp-end 'safe-local-variable 'stringp)
 
 
 (defvar time-stamp-inserts-lines nil    ;Do not change!
@@ -201,7 +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)
+;;;###autoload(put 'time-stamp-inserts-lines 'safe-local-variable 'symbolp)
 
 
 (defvar time-stamp-count 1		;Do not change!
--- a/lisp/tool-bar.el	Fri Apr 21 05:39:14 2006 +0000
+++ b/lisp/tool-bar.el	Tue May 02 05:51:52 2006 +0000
@@ -267,14 +267,20 @@
   ;;(tool-bar-add-item-from-menu 'compose-mail "mail/compose")
 
   (tool-bar-add-item-from-menu 'print-buffer "print")
-  (tool-bar-add-item "preferences" 'customize 'customize
-		     :help "Edit preferences (customize)")
+
+  ;; tool-bar-add-item-from-menu itself operates on
+  ;; (default-value 'tool-bar-map), but when we don't use that function,
+  ;; we must explicitly operate on the default value.
 
-  (tool-bar-add-item "help" (lambda ()
-			      (interactive)
-			      (popup-menu menu-bar-help-menu))
-		     'help
-		     :help "Pop up the Help menu")
+  (let ((tool-bar-map (default-value 'tool-bar-map)))
+    (tool-bar-add-item "preferences" 'customize 'customize
+		       :help "Edit preferences (customize)")
+
+    (tool-bar-add-item "help" (lambda ()
+				(interactive)
+				(popup-menu menu-bar-help-menu))
+		       'help
+		       :help "Pop up the Help menu"))
   )
 
 (provide 'tool-bar)
--- a/lisp/url/ChangeLog	Fri Apr 21 05:39:14 2006 +0000
+++ b/lisp/url/ChangeLog	Tue May 02 05:51:52 2006 +0000
@@ -1,3 +1,11 @@
+2006-04-26  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* url-gw.el (url-open-stream): Don't hide errors.
+	(url-gateway-nslookup-host, url-open-telnet): Use with-current-buffer.
+
+	* url-handlers.el (url-insert): New function.
+	(url-insert-file-contents): Use it.
+
 2006-03-29  Stefan Monnier  <monnier@iro.umontreal.ca>
 
 	* url-handlers.el (url-handler-directory-file-name): New handler.
--- a/lisp/url/url-gw.el	Fri Apr 21 05:39:14 2006 +0000
+++ b/lisp/url/url-gw.el	Tue May 02 05:51:52 2006 +0000
@@ -118,8 +118,7 @@
 				 url-gateway-nslookup-program host))
 	    (res host))
 	(set-process-query-on-exit-flag proc nil)
-	(save-excursion
-	  (set-buffer (process-buffer proc))
+	(with-current-buffer (process-buffer proc)
 	  (while (memq (process-status proc) '(run open))
 	    (accept-process-output proc))
 	  (goto-char (point-min))
@@ -168,8 +167,7 @@
 (defun url-open-telnet (name buffer host service)
   (if (not (stringp service))
       (setq service (int-to-string service)))
-  (save-excursion
-    (set-buffer (get-buffer-create buffer))
+  (with-current-buffer (get-buffer-create buffer)
     (erase-buffer)
     (let ((proc (start-process name buffer "telnet" "-8"))
 	  (case-fold-search t))
@@ -261,11 +259,15 @@
 			 (otherwise
 			  (error "Bad setting of url-gateway-method: %s"
 				 url-gateway-method)))))
-	(error
-	 (setq conn nil)))
+        ;; Ignoring errors here seems wrong.  E.g. it'll throw away the
+        ;; error signalled two lines above.  It was also found inconvenient
+        ;; during debugging.
+	;; (error
+	;;  (setq conn nil))
+	)
       conn)))
 
 (provide 'url-gw)
 
-;;; arch-tag: 1c4c0317-6d03-45b8-b3f3-838bd8f9d838
+;; arch-tag: 1c4c0317-6d03-45b8-b3f3-838bd8f9d838
 ;;; url-gw.el ends here
--- a/lisp/url/url-handlers.el	Fri Apr 21 05:39:14 2006 +0000
+++ b/lisp/url/url-handlers.el	Tue May 02 05:51:52 2006 +0000
@@ -216,33 +216,47 @@
     (url-copy-file url filename)
     filename))
 
+(defun url-insert (buffer &optional beg end)
+  "Insert the body of a URL object.
+BUFFER should be a complete URL buffer as returned by `url-retrieve'.
+If the headers specify a coding-system, it is applied to the body before it is inserted.
+Returns a list of the form (SIZE CHARSET), where SIZE is the size in bytes
+of the inserted text and CHARSET is the charset that was specified in the header,
+or nil if none was found.
+BEG and END can be used to only insert a subpart of the body.
+They count bytes from the beginning of the body."
+  (let* ((handle (with-current-buffer buffer (mm-dissect-buffer t)))
+         (data (with-current-buffer (mm-handle-buffer handle)
+                 (if beg
+                     (buffer-substring (+ (point-min) beg)
+                                       (if end (+ (point-min) end) (point-max)))
+		   (buffer-string))))
+         (charset (mail-content-type-get (mm-handle-type handle)
+                                          'charset)))
+    (mm-destroy-parts handle)
+    (if charset
+        (insert (mm-decode-string data (mm-charset-to-coding-system charset)))
+      (insert data))
+    (list (length data) charset)))
+
 ;;;###autoload
 (defun url-insert-file-contents (url &optional visit beg end replace)
-  (let ((buffer (url-retrieve-synchronously url))
-	(handle nil)
-	(charset nil)
-	(data nil))
+  (let ((buffer (url-retrieve-synchronously url)))
     (if (not buffer)
 	(error "Opening input file: No such file or directory, %s" url))
     (if visit (setq buffer-file-name url))
-    (with-current-buffer buffer
-      (setq handle (mm-dissect-buffer t))
-      (set-buffer (mm-handle-buffer handle))
-      (setq data (if beg (buffer-substring beg end)
-		   (buffer-string))))
-    (kill-buffer buffer)
-    (mm-destroy-parts handle)
-    (if replace (delete-region (point-min) (point-max)))
     (save-excursion
-      (setq charset (mail-content-type-get (mm-handle-type handle)
-					     'charset))
-      (let ((start (point)))
-	(if charset
-	    (insert (mm-decode-string data (mm-charset-to-coding-system charset)))
-	  (progn
-	    (insert data)
-	    (decode-coding-inserted-region start (point) url visit beg end replace)))))
-    (list url (length data))))
+      (let* ((start (point))
+             (size-and-charset (url-insert buffer beg end)))
+        (kill-buffer buffer)
+        (when replace
+          (delete-region (point-min) start)
+          (delete-region (point) (point-max)))
+        (unless (cadr size-and-charset)
+          ;; If the headers don't specify any particular charset, use the
+          ;; usual heuristic/rules that we apply to files.
+          (decode-coding-inserted-region start (point) url visit beg end replace))
+        (list url (car size-and-charset))))))
 
 (defun url-file-name-completion (url directory)
   (error "Unimplemented"))
--- a/lispref/ChangeLog	Fri Apr 21 05:39:14 2006 +0000
+++ b/lispref/ChangeLog	Tue May 02 05:51:52 2006 +0000
@@ -1,3 +1,35 @@
+2006-05-01  Richard Stallman  <rms@gnu.org>
+
+	* intro.texi (nil and t): Clarify.
+
+	* variables.texi (File Local Variables): Suggest using booleanp.
+
+2006-05-01  Juanma Barranquero  <lekktu@gmail.com>
+
+	* objects.texi (Type Predicates): Fix typos.
+
+2006-05-01  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* intro.texi (nil and t): Add booleanp.
+
+	* objects.texi (Type Predicates): Add links for booleanp and
+	string-or-null-p.
+
+2006-04-29  Richard Stallman  <rms@gnu.org>
+
+	* modes.texi (Multiline Font Lock): Rename from
+	Multi line Font Lock Elements.  Much clarification.
+	(Font Lock Multiline, Region to Fontify): Much clarification.
+
+2006-04-29  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* variables.texi (File Local Variables): Remove the special case t for
+	safe-local-variable.
+
+2006-04-26  Richard Stallman  <rms@gnu.org>
+
+	* syntax.texi (Parsing Expressions): Minor cleanup.
+
 2006-04-18  Richard Stallman  <rms@gnu.org>
 
 	* tips.texi (Coding Conventions): Explain when the package's
@@ -60,7 +92,7 @@
 
 2006-03-25  Karl Berry  <karl@gnu.org>
 
-	* elisp.texi: use @copyright{} instead of (C), and do not indent
+	* elisp.texi: Use @copyright{} instead of (C), and do not indent
 	the year list.
 
 2006-03-21  Nick Roberts  <nickrob@snap.net.nz>
@@ -94,7 +126,7 @@
 
 	* display.texi (Defining Images): Fix example in
 	image-load-path-for-library by not recommending that one binds
-	image-load-path. Just defvar it to placate compiler and only use
+	image-load-path.  Just defvar it to placate compiler and only use
 	it if previously defined.
 
 2006-03-14  Bill Wohler  <wohler@newt.com>
@@ -566,11 +598,11 @@
 
 2005-09-26  Chong Yidong  <cyd@stupidchicken.com>
 
-	* errors.texi (Standard Errors): Corrected xrefs.
+	* errors.texi (Standard Errors): Correct xrefs.
 
 2005-09-18  Chong Yidong  <cyd@stupidchicken.com>
 
-	* display.texi (Defining Images): Updated documentation for
+	* display.texi (Defining Images): Update documentation for
 	`image-load-path'.
 
 2005-09-17  Richard M. Stallman  <rms@gnu.org>
--- a/lispref/intro.texi	Fri Apr 21 05:39:14 2006 +0000
+++ b/lispref/intro.texi	Tue May 02 05:51:52 2006 +0000
@@ -163,7 +163,7 @@
 addressed as ``you''.  ``The user'' is the person who uses Lisp
 programs, including those you write.
 
-@cindex fonts
+@cindex fonts in this manual
   Examples of Lisp code are formatted like this: @code{(list 1 2 3)}.
 Names that represent metasyntactic variables, or arguments to a function
 being described, are formatted like this: @var{first-number}.
@@ -187,14 +187,14 @@
 there is no way to determine which representation was actually written
 by the programmer.
 
-  In this manual, we use @code{()} when we wish to emphasize that it
-means the empty list, and we use @code{nil} when we wish to emphasize
+  In this manual, we write @code{()} when we wish to emphasize that it
+means the empty list, and we write @code{nil} when we wish to emphasize
 that it means the truth value @var{false}.  That is a good convention to use
 in Lisp programs also.
 
 @example
 (cons 'foo ())                ; @r{Emphasize the empty list}
-(not nil)                     ; @r{Emphasize the truth value @var{false}}
+(setq foo-flag nil)           ; @r{Emphasize the truth value @var{false}}
 @end example
 
 @cindex @code{t}, uses of
@@ -212,6 +212,11 @@
 values results in a @code{setting-constant} error.  @xref{Constant
 Variables}.
 
+@defun booleanp object
+Return non-nil iff @var{object} is one of the two canonical boolean
+values: @code{t} or @code{nil}.
+@end defun
+
 @node Evaluation Notation
 @subsection Evaluation Notation
 @cindex evaluation notation
--- a/lispref/modes.texi	Fri Apr 21 05:39:14 2006 +0000
+++ b/lispref/modes.texi	Tue May 02 05:51:52 2006 +0000
@@ -2336,8 +2336,6 @@
 * Font Lock Basics::            Overview of customizing Font Lock.
 * Search-based Fontification::  Fontification based on regexps.
 * Customizing Keywords::        Customizing search-based fontification.
-* Region to Fontify::           Controlling which region gets refontified
-                                  after a buffer change.
 * Other Font Lock Variables::   Additional customization facilities.
 * Levels of Font Lock::         Each mode can define alternative levels
                                   so that the user can select more or less.
@@ -2347,6 +2345,8 @@
 * Syntactic Font Lock::         Fontification based on syntax tables.
 * Setting Syntax Properties::   Defining character syntax based on context
                                   using the Font Lock mechanism.
+* Multiline Font Lock::         How to coerce Font Lock into properly
+                                  highlighting multiline constructs.
 @end menu
 
 @node Font Lock Basics
@@ -2623,16 +2623,9 @@
 Its value should have one of the forms described in this table.
 @end table
 
-@vindex font-lock-multiline
 @strong{Warning:} Do not design an element of @code{font-lock-keywords}
-to match text which spans lines; this does not work reliably.  While
-@code{font-lock-fontify-buffer} handles multi-line patterns correctly,
-updating when you edit the buffer does not, since it considers text one
-line at a time.  If you have patterns that typically only span one
-line but can occasionally span two or three, such as
-@samp{<title>...</title>}, you can ask Font Lock to be more careful by
-setting @code{font-lock-multiline} to @code{t}.  But it still will not
-work in all cases.
+to match text which spans lines; this does not work reliably.
+For details, see @xref{Multiline Font Lock}.
 
 You can use @var{case-fold} in @code{font-lock-defaults} to specify
 the value of @code{font-lock-keywords-case-fold-search} which says
@@ -2718,36 +2711,6 @@
       font-lock-keyword-face)))))
 @end smallexample
 
-@node Region to Fontify
-@subsection Region to Fontify after a Buffer Change
-
-  When a buffer is changed, the region that Font Lock refontifies is by
-default the smallest sequence of whole lines that spans the change.
-While this works well most of the time, sometimes it doesn't---for
-example, when a buffer change has changed the syntactic meaning of text
-on an earlier line.
-
-You can enlarge (or even reduce) the region to fontify by setting either
-of the following variables:
-
-@defvar font-lock-extend-region-function
-This buffer-local variable is either @code{nil} or is a function that
-determines the region to fontify, which Emacs then calls after each
-buffer change.
-
-The function is given three parameters, the standard @var{beg},
-@var{end}, and @var{old-len} from after-change-functions (@pxref{Change
-Hooks}).  It should return either a cons of the beginning and end buffer
-positions (in that order) of the region to fontify, or @code{nil} (which
-directs the caller to fontify the default region).  This function need
-not preserve point or the match-data, but must preserve the current
-restriction.  The region it returns may start or end in the middle of a
-line.
-
-Since this function is called after every buffer change, it should be
-reasonably fast.
-@end defvar
-
 @node Other Font Lock Variables
 @subsection Other Font Lock Variables
 
@@ -2981,8 +2944,8 @@
 
 This can be used to highlighting different kinds of strings or
 comments differently.  It is also sometimes abused together with
-@code{font-lock-syntactic-keywords} to highlight elements that span
-multiple lines, but this is too obscure to document in this manual.
+@code{font-lock-syntactic-keywords} to highlight constructs that span
+multiple lines, but this is too esoteric to document here.
 
 Specify this variable using @var{other-vars} in
 @code{font-lock-defaults}.
@@ -3052,6 +3015,145 @@
 @code{font-lock-defaults}.
 @end defvar
 
+@node Multiline Font Lock
+@subsection Multiline Font Lock Constructs
+@cindex multiline font lock
+
+  Normally, elements of @code{font-lock-keywords} should not match
+across multiple lines; that doesn't work reliably, because Font Lock
+usually scans just part of the buffer, and it can miss a multi-line
+construct that crosses the line boundary where the scan starts.  (The
+scan normally starts at the beginning of a line.)
+
+  Making elements that match multiline constructs work properly has
+two aspects: correct @emph{identification} and correct
+@emph{rehighlighting}.  The first means that Font Lock finds all
+multiline constructs.  The second means that Font Lock will correctly
+rehighlight all the relevant text when a multiline construct is
+changed---for example, if some of the text that was previously part of
+a multiline construct ceases to be part of it.  The two aspects are
+closely related, and often getting one of them to work will appear to
+make the other also work.  However, for reliable results you must
+attend explicitly to both aspects.
+
+  There are two ways to ensure correct identification of multiline
+constructs:
+
+@itemize
+@item
+Place a @code{font-lock-multiline} or @code{jit-lock-defer-multiline}
+property on the construct when it is added to the buffer.
+@item
+Use @code{font-lock-fontify-region-function} hook to extend the scan
+so that the scanned text never starts or ends in the middle of a
+multiline construct.
+@end itemize
+
+  There are three ways to do rehighlighting of multiline constructs:
+
+@itemize
+@item
+Place a @code{font-lock-multiline} property on the construct.  This
+will rehighlight the whole construct if any part of it is changed.  In
+some cases you can do this automatically by setting the
+@code{font-lock-multiline} variable.
+@item
+Use @code{jit-lock-contextually}.  This will only rehighlight the part
+of the construct that follows the actual change, and will do it after
+a short delay.  This only works if the highlighting of the various
+parts of your multiline construct never depends on text in subsequent
+lines.  Since @code{jit-lock-contextually} is activated by default,
+this can be an attractive solution.
+@item
+Place a @code{jit-lock-defer-multiline} property on the construct.
+This works only if @code{jit-lock-contextually} is used, but it can
+handle the case where highlighting depends on subsequent lines.
+@item
+@end itemize
+
+@menu
+* Font Lock Multiline::         Marking multiline chunks with a text property
+* Region to Fontify::           Controlling which region gets refontified
+                                  after a buffer change.
+@end menu
+
+@node Font Lock Multiline
+@subsubsection Font Lock Multiline
+
+  One way to ensure reliable rehighlighting of multiline Font Lock
+constructs is to put on the text property @code{font-lock-multiline}.
+It should be present and non-@code{nil} for text that is part of a
+multiline construct.
+
+  When Font Lock is about to highlight a range of text, it first
+extends the boundaries of the range as necessary so that they do not
+fall within text marked with the @code{font-lock-multiline} property.
+Then it removes any @code{font-lock-multiline} properties from the
+range, and highlights it.  The highlighting specification (mostly
+@code{font-lock-keywords}) must reinstall this property each time,
+whenever it is appropriate.
+
+  @strong{Warning:} don't use the @code{font-lock-multiline} property
+on large ranges of text, because that will make rehighlighting slow.
+
+@defvar font-lock-multiline
+If the @code{font-lock-multiline} variable is set to @code{t}, Font
+Lock will try to add the @code{font-lock-multiline} property
+automatically on multiline constructs.  This is not a universal
+solution, however, since it slows down Font Lock somewhat.  It can
+miss some multiline constructs, or make the property larger or smaller
+than necessary.
+
+For elements whose @var{matcher} is a function, the function should
+ensure that submatch 0 covers the whole relevant multiline construct,
+even if only a small subpart will be highlighted.  It is often just as
+easy to add the @code{font-lock-multiline} property by hand.
+@end defvar
+
+  The @code{font-lock-multiline} property is meant to ensure proper
+refontification; it does not automatically identify new multiline
+constructs.  Identifying the requires that Font-Lock operate on large
+enough chunks at a time.  This will happen by accident on many cases,
+which may give the impression that multiline constructs magically work.
+If you set the @code{font-lock-multiline} variable non-@code{nil},
+this impression will be even stronger, since the highlighting of those
+constructs which are found will be properly updated from then on.
+But that does not work reliably.
+
+  To find multiline constructs reliably, you must either manually
+place the @code{font-lock-multiline} property on the text before
+Font-Lock looks at it, or use
+@code{font-lock-fontify-region-function}.
+
+@node Region to Fontify
+@subsubsection Region to Fontify after a Buffer Change
+
+  When a buffer is changed, the region that Font Lock refontifies is
+by default the smallest sequence of whole lines that spans the change.
+While this works well most of the time, sometimes it doesn't---for
+example, when a change alters the syntactic meaning of text on an
+earlier line.
+
+  You can enlarge (or even reduce) the region to fontify by setting
+one the following variables:
+
+@defvar font-lock-extend-region-function
+This buffer-local variable is either @code{nil} or a function for
+Font-Lock to call to determine the region to scan and fontify.
+
+The function is given three parameters, the standard @var{beg},
+@var{end}, and @var{old-len} from after-change-functions
+(@pxref{Change Hooks}).  It should return either a cons of the
+beginning and end buffer positions (in that order) of the region to
+fontify, or @code{nil} (which means choose the region in the standard
+way).  This function needs to preserve point, the match-data, and the
+current restriction.  The region it returns may start or end in the
+middle of a line.
+
+Since this function is called after every buffer change, it should be
+reasonably fast.
+@end defvar
+
 @node Desktop Save Mode
 @section Desktop Save Mode
 @cindex desktop save mode
--- a/lispref/objects.texi	Fri Apr 21 05:39:14 2006 +0000
+++ b/lispref/objects.texi	Tue May 02 05:51:52 2006 +0000
@@ -1779,6 +1779,12 @@
 
 @item windowp
 @xref{Basic Windows, windowp}.
+
+@item booleanp
+@xref{nil and t, booleanp}.
+
+@item string-or-null-p
+@xref{Predicates for Strings, string-or-null-p}.
 @end table
 
   The most general way to check the type of an object is to call the
--- a/lispref/syntax.texi	Fri Apr 21 05:39:14 2006 +0000
+++ b/lispref/syntax.texi	Tue May 02 05:51:52 2006 +0000
@@ -672,7 +672,9 @@
 
 @enumerate 0
 @item
-The depth in parentheses, counting from 0.
+The depth in parentheses, counting from 0.  @strong{Warning:} this can
+be negative if there are more close parens than open parens between
+the start of the defun and point.
 
 @item
 @cindex innermost containing parentheses
--- a/lispref/variables.texi	Fri Apr 21 05:39:14 2006 +0000
+++ b/lispref/variables.texi	Tue May 02 05:51:52 2006 +0000
@@ -1778,13 +1778,13 @@
 
 @cindex safe local variable
   You can specify safe values for a variable with a
-@code{safe-local-variable} property.  If the property is @code{t},
-setting that variable in a file is always considered safe, regardless
-of the value used.  If the property is a function of one argument,
-then any value is safe if the function returns non-@code{nil} given
-that value.  Many commonly encountered file variables standardly have
-@code{safe-local-variable} properties, including @code{fill-column},
-@code{fill-prefix}, and @code{indent-tabs-mode}.
+@code{safe-local-variable} property.  The property has to be
+a function of one argument; any value is safe if the function
+returns non-@code{nil} given that value.  Many commonly encountered
+file variables standardly have @code{safe-local-variable} properties,
+including @code{fill-column}, @code{fill-prefix}, and
+@code{indent-tabs-mode}.  For boolean-valued variables that are safe,
+use @code{booleanp} as the property value.
 
 @defopt safe-local-variable-values
 This variable provides another way to mark some variable values as
--- a/man/ChangeLog	Fri Apr 21 05:39:14 2006 +0000
+++ b/man/ChangeLog	Tue May 02 05:51:52 2006 +0000
@@ -1,3 +1,80 @@
+2006-05-01  Richard Stallman  <rms@gnu.org>
+
+	* emacs.texi (Top): Add Diff Mode to menu.
+
+2006-05-01  Aaron S. Hawley  <Aaron.Hawley@uvm.edu>
+
+	* misc.texi (Diff Mode): New node.
+
+2006-05-01  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+	* macos.texi (Mac International): Now Carbon Emacs has ATSUI support.
+	(Mac Environment Variables): Shorten example line.
+	(Mac Font Specs): Shorten lisp lines.  Add descriptions for ATSUI.
+
+2006-05-01  Nick Roberts  <nickrob@snap.net.nz>
+
+	* building.texi (GUD Customization): Describe cases %d and %c.
+	Update description for %e.
+
+2006-04-30  Glenn Morris  <rgm@gnu.org>
+
+	* calendar.texi (LaTeX Calendar): Mention cal-tex-preamble-extra.
+
+2006-04-29  Dan Nicolaescu  <dann@ics.uci.edu>
+
+	* custom.texi (Examining): Update C-h v output example.
+
+2006-04-29  Kim F. Storm  <storm@cua.dk>
+
+	* building.texi (Grep Searching): Add lgrep and rgrep.
+
+2006-04-26  Reiner Steib  <Reiner.Steib@gmx.de>
+
+	* pgg.texi (Caching passphrase): Fix markup and typos.  Simplify.
+
+2006-04-26  Sascha Wilde  <wilde@sha-bang.de>
+
+	* pgg.texi (Caching passphrase): Add pgg-gpg-use-agent.
+
+2006-04-24  Bill Wohler  <wohler@newt.com>
+
+	* mh-e.texi (Getting Started): Make it more explicit that you need
+	to install MH.  Add pointers to current MH implementations.
+
+2006-04-23  Richard Stallman  <rms@gnu.org>
+
+	* emacs.texi [TeX]: Use xresmini.texi instead of xresources.texi.
+
+	* xresmini.texi: New file.
+
+	* xresources.texi (Face Resources): Split table into font resources
+	and the rest.  Combine similar attributes for brevity.
+
+2006-04-21  Bill Wohler  <wohler@newt.com>
+
+	Release MH-E manual version 7.94.
+
+	* mh-e.texi (VERSION, EDITION, UPDATED, UPDATE-MONTH): Update for
+	release 7.94.
+
+2006-04-21  Carsten Dominik  <dominik@science.uva.nl>
+
+	* org.texi: Many small fixes.
+	(Handling links): Rename from "Managing links".
+
+2006-04-21  Eli Zaretskii  <eliz@gnu.org>
+
+	* emacs-xtra.texi (MS-DOS File Names): Remove section about
+	backslashes and case-insensitivity in file names (moved to the
+	main manual).
+	(MS-DOS Printing): Move most of the text to the main manual.
+
+	* msdog.texi (Windows Files, Windows HOME, MS-Windows Printing):
+	New nodes.
+	(Windows Processes, Windows System Menu): Add index entries and
+	fix wording.
+
 2006-04-20  Reiner Steib  <Reiner.Steib@gmx.de>
 
 	* gnus.texi (Spam Statistics Package): Fix typo in @pxref.
@@ -10,7 +87,7 @@
 
 2006-04-20  Carsten Dominik  <dominik@science.uva.nl>
 
-	* org.texi: (Time stamps): Better explanation of the purpose of
+	* org.texi (Time stamps): Better explanation of the purpose of
 	different time stamps.
 	(Structure editing, Plain lists): More details on how new items
 	and headings are inserted.
@@ -27,7 +104,7 @@
 
 2006-04-18  Carsten Dominik  <dominik@science.uva.nl>
 
-	* org.texi: (Formula syntax): Fixed link to Calc Manual.
+	* org.texi (Formula syntax): Fixed link to Calc Manual.
 
 2006-04-17  Reiner Steib  <Reiner.Steib@gmx.de>
 
@@ -49,7 +126,7 @@
 
 2006-04-13  Carsten Dominik  <dominik@science.uva.nl>
 
-	* org.texi: (Updating settings): New section.
+	* org.texi (Updating settings): New section.
 	(Visibility cycling): Better names for the startup folding
 	options.
 	(Exporting): Completely restructured.
--- a/man/building.texi	Fri Apr 21 05:39:14 2006 +0000
+++ b/man/building.texi	Tue May 02 05:51:52 2006 +0000
@@ -335,10 +335,12 @@
 
 @table @kbd
 @item M-x grep
+@item M-x lgrep
 Run @code{grep} asynchronously under Emacs, with matching lines
 listed in the buffer named @samp{*grep*}.
 @item M-x grep-find
 @itemx M-x find-grep
+@itemx M-x rgrep
 Run @code{grep} via @code{find}, with user-specified arguments, and
 collect output in the buffer named @samp{*grep*}.
 @item M-x kill-grep
@@ -373,6 +375,27 @@
 @code{grep}, so as to search every file in a directory tree.  See also
 the @code{find-grep-dired} command, in @ref{Dired and Find}.
 
+@findex lgrep
+@findex rgrep
+  The commands @kbd{M-x lgrep} (local grep) and @kbd{M-x rgrep}
+(recursive grep) are more user-friendly versions of @code{grep} and
+@code{grep-find}, which prompt separately for the regular expression
+to match, the files to search, and the base directory for the search
+(rgrep only).  Case sensitivitivy of the search is controlled by the
+current value of @code{case-fold-search}.
+
+These commands build the shell commands based on the variables
+@code{grep-template} (for @code{lgrep}) and @code{grep-find-template}
+(for @code{rgrep}).
+
+The files to search can use aliases defined in the variable
+@code{grep-files-aliases}.
+
+Subdirectories listed in the variable
+@code{grep-find-ignored-directories} such as those typically used by
+various version control systems, like CVS and arch, are automatically
+skipped by @code{rgrep}.
+
 @node Flymake
 @section Finding Syntax Errors On The Fly
 @cindex checking syntax
@@ -676,7 +699,7 @@
 @kindex C-c C-f @r{(GUD)}
 @itemx C-x C-a C-f
 @findex gud-finish
-Run the program until the selected stack frame returns or 
+Run the program until the selected stack frame returns or
 stops for some other reason (@code{gud-finish}).
 
 @item C-x C-a C-j
@@ -743,8 +766,6 @@
 The name of the current source file.  If the current buffer is the GUD
 buffer, then the ``current source file'' is the file that the program
 stopped in.
-@c This said, ``the name of the file the program counter was in at the last breakpoint.''
-@c But I suspect it is really the last stop file.
 
 @item %l
 The number of the current source line.  If the current buffer is the GUD
@@ -752,7 +773,9 @@
 stopped in.
 
 @item %e
-The text of the C lvalue or function-call expression at or adjacent to point.
+In transient-mark-mode the text in the region, if it is active.
+Otherwise the text of the C lvalue or function-call expression at or
+adjacent to point.
 
 @item %a
 The text of the hexadecimal address at or adjacent to point.
@@ -764,6 +787,13 @@
 
 If you don't use @samp{%p} in the command string, the command you define
 ignores any numeric argument.
+
+@item %d
+The name of the directory of the current source file.
+
+@item %c
+Fully qualified class name derived from the expression surrounding point
+(jdb only).
 @end table
 
 @node GDB Graphical Interface
--- a/man/calendar.texi	Fri Apr 21 05:39:14 2006 +0000
+++ b/man/calendar.texi	Tue May 02 05:51:52 2006 +0000
@@ -395,7 +395,9 @@
 @code{nil}), diary entries are included also (in weekly and monthly
 calendars only).  If the variable @code{cal-tex-rules} is non-@code{nil}
 (the default is @code{nil}), the calendar displays ruled pages
-in styles that have sufficient room.
+in styles that have sufficient room.  You can use the variable
+@code{cal-tex-preamble-extra} to insert extra LaTeX commands in the
+preamble of the generated document if you need to.
 
 @node Holidays
 @section Holidays
--- a/man/custom.texi	Fri Apr 21 05:39:14 2006 +0000
+++ b/man/custom.texi	Tue May 02 05:51:52 2006 +0000
@@ -822,6 +822,9 @@
 Local in buffer custom.texi; global value is 70
 Automatically becomes buffer-local when set in any fashion.
 
+This variable is safe to use as a file local variable only if its value
+satisfies the predicate `integerp'.
+
 Documentation:
 *Column beyond which automatic line-wrapping should happen.
 Interactively, you can set the buffer local value using C-x f.
--- a/man/emacs-xtra.texi	Fri Apr 21 05:39:14 2006 +0000
+++ b/man/emacs-xtra.texi	Tue May 02 05:51:52 2006 +0000
@@ -3316,7 +3316,7 @@
 * Mouse: MS-DOS Mouse.         Mouse conventions on MS-DOS.
 * Display: MS-DOS Display.     Fonts, frames and display size on MS-DOS.
 * Files: MS-DOS File Names.    File name conventions on MS-DOS.
-* Printing: MS-DOS Printing.   How to specify the printer on MS-DOS.
+* Printing: MS-DOS Printing.   Printing specifics on MS-DOS.
 * I18N: MS-DOS and MULE.       Support for internationalization on MS-DOS.
 * Processes: MS-DOS Processes. Running subprocesses on MS-DOS.
 @end menu
@@ -3534,11 +3534,6 @@
 @cindex file names under MS-DOS
 @cindex init file, default name under MS-DOS
 
-  MS-DOS normally uses a backslash, @samp{\}, to separate name units
-within a file name, instead of the slash used on other systems.  Emacs
-on MS-DOS permits use of either slash or backslash, and also knows
-about drive letters in file names.
-
   On MS-DOS, file names are case-insensitive and limited to eight
 characters, plus optionally a period and three more characters.  Emacs
 knows enough about these limitations to handle file names that were
@@ -3593,55 +3588,14 @@
 @section Printing and MS-DOS
 
   Printing commands, such as @code{lpr-buffer}
-(@pxref{Printing,,,emacs, the Emacs Manual }) and
+(@pxref{Printing,,,emacs, the Emacs Manual}) and
 @code{ps-print-buffer} (@pxref{PostScript,,,emacs, the Emacs Manual})
-can work in MS-DOS and MS-Windows by sending the output to one of the
-printer ports, if a Posix-style @code{lpr} program is unavailable.
-The same Emacs variables control printing on all systems, but in some
-cases they have different default values on MS-DOS and MS-Windows.
-
-@vindex printer-name @r{(MS-DOS)}
-  If you want to use your local printer, printing on it in the usual DOS
-manner, then set the Lisp variable @code{lpr-command} to @code{""} (its
-default value) and @code{printer-name} to the name of the printer
-port---for example, @code{"PRN"}, the usual local printer port (that's
-the default), or @code{"LPT2"}, or @code{"COM1"} for a serial printer.
-You can also set @code{printer-name} to a file name, in which case
-``printed'' output is actually appended to that file.  If you set
-@code{printer-name} to @code{"NUL"}, printed output is silently
-discarded (sent to the system null device).
-
-  On MS-Windows, when the Windows network software is installed, you can
-also use a printer shared by another machine by setting
-@code{printer-name} to the UNC share name for that printer---for example,
-@code{"//joes_pc/hp4si"}.  (It doesn't matter whether you use forward
-slashes or backslashes here.)  To find out the names of shared printers,
-run the command @samp{net view} at a DOS command prompt to obtain a list
-of servers, and @samp{net view @var{server-name}} to see the names of printers
-(and directories) shared by that server.  Alternatively, click the
-@samp{Network Neighborhood} icon on your desktop, and look for machines
-which share their printers via the network.
-
-@cindex @samp{net use}, and printing on MS-Windows
-@cindex networked printers (MS-Windows)
-  If the printer doesn't appear in the output of @samp{net view}, or
-if setting @code{printer-name} to the UNC share name doesn't produce a
-hardcopy on that printer, you can use the @samp{net use} command to
-connect a local print port such as @code{"LPT2"} to the networked
-printer.  For example, typing @kbd{net use LPT2:
-\\joes_pc\hp4si}@footnote{
-Note that the @samp{net use} command requires the UNC share name to be
-typed with the Windows-style backslashes, while the value of
-@code{printer-name} can be set with either forward- or backslashes.}
-causes Windows to @dfn{capture} the LPT2 port and redirect the printed
-material to the printer connected to the machine @code{joes_pc}.
-After this command, setting @code{printer-name} to @code{"LPT2"}
-should produce the hardcopy on the networked printer.
-
-  With some varieties of Windows network software, you can instruct
-Windows to capture a specific printer port such as @code{"LPT2"}, and
-redirect it to a networked printer via the @w{@code{Control
-Panel->Printers}} applet instead of @samp{net use}.
+can work on MS-DOS by sending the output to one of the printer ports,
+if a Posix-style @code{lpr} program is unavailable.  The same Emacs
+variables control printing on all systems, but in some cases they have
+different default values on MS-DOS.
+
+@xref{MS-Windows Printing,,,emacs, the Emacs Manual}, for details.
 
   Some printers expect DOS codepage encoding of non-@acronym{ASCII} text, even
 though they are connected to a Windows machine which uses a different
@@ -3655,95 +3609,11 @@
 codepage 850 encoding.  You may need to create the @code{cp@var{nnn}}
 coding system with @kbd{M-x codepage-setup}.
 
-  If you set @code{printer-name} to a file name, it's best to use an
-absolute file name.  Emacs changes the working directory according to
-the default directory of the current buffer, so if the file name in
-@code{printer-name} is relative, you will end up with several such
-files, each one in the directory of the buffer from which the printing
-was done.
-
-@findex print-buffer @r{(MS-DOS)}
-@findex print-region @r{(MS-DOS)}
-@vindex lpr-headers-switches @r{(MS-DOS)}
-  The commands @code{print-buffer} and @code{print-region} call the
-@code{pr} program, or use special switches to the @code{lpr} program, to
-produce headers on each printed page.  MS-DOS and MS-Windows don't
-normally have these programs, so by default, the variable
-@code{lpr-headers-switches} is set so that the requests to print page
-headers are silently ignored.  Thus, @code{print-buffer} and
-@code{print-region} produce the same output as @code{lpr-buffer} and
-@code{lpr-region}, respectively.  If you do have a suitable @code{pr}
-program (for example, from GNU Textutils), set
-@code{lpr-headers-switches} to @code{nil}; Emacs will then call
-@code{pr} to produce the page headers, and print the resulting output as
-specified by @code{printer-name}.
-
-@vindex print-region-function @r{(MS-DOS)}
-@cindex lpr usage under MS-DOS
-@vindex lpr-command @r{(MS-DOS)}
-@vindex lpr-switches @r{(MS-DOS)}
-  Finally, if you do have an @code{lpr} work-alike, you can set the
-variable @code{lpr-command} to @code{"lpr"}.  Then Emacs will use
-@code{lpr} for printing, as on other systems.  (If the name of the
-program isn't @code{lpr}, set @code{lpr-command} to specify where to
-find it.)  The variable @code{lpr-switches} has its standard meaning
-when @code{lpr-command} is not @code{""}.  If the variable
-@code{printer-name} has a string value, it is used as the value for the
-@code{-P} option to @code{lpr}, as on Unix.
-
-@findex ps-print-buffer @r{(MS-DOS)}
-@findex ps-spool-buffer @r{(MS-DOS)}
-@vindex ps-printer-name @r{(MS-DOS)}
-@vindex ps-lpr-command @r{(MS-DOS)}
-@vindex ps-lpr-switches @r{(MS-DOS)}
-  A parallel set of variables, @code{ps-lpr-command},
-@code{ps-lpr-switches}, and @code{ps-printer-name} (@pxref{PostScript
-Variables,,,emacs, the Emacs Manual}), defines how PostScript files
-should be printed.  These variables are used in the same way as the
-corresponding variables described above for non-PostScript printing.
-Thus, the value of @code{ps-printer-name} is used as the name of the
-device (or file) to which PostScript output is sent, just as
-@code{printer-name} is used for non-PostScript printing.  (There are
-two distinct sets of variables in case you have two printers attached
-to two different ports, and only one of them is a PostScript printer.)
-
-  The default value of the variable @code{ps-lpr-command} is @code{""},
-which causes PostScript output to be sent to the printer port specified
-by @code{ps-printer-name}, but @code{ps-lpr-command} can also be set to
-the name of a program which will accept PostScript files.  Thus, if you
-have a non-PostScript printer, you can set this variable to the name of
-a PostScript interpreter program (such as Ghostscript).  Any switches
-that need to be passed to the interpreter program are specified using
-@code{ps-lpr-switches}.  (If the value of @code{ps-printer-name} is a
-string, it will be added to the list of switches as the value for the
-@code{-P} option.  This is probably only useful if you are using
-@code{lpr}, so when using an interpreter typically you would set
-@code{ps-printer-name} to something other than a string so it is
-ignored.)
-
-  For example, to use Ghostscript for printing on an Epson printer
-connected to the @samp{LPT2} port, put this in your @file{_emacs} file:
-
-@example
-(setq ps-printer-name t)  ; Ghostscript doesn't understand -P
-(setq ps-lpr-command "c:/gs/gs386")
-(setq ps-lpr-switches '("-q" "-dNOPAUSE"
-			"-sDEVICE=epson"
-			"-r240x72"
-			"-sOutputFile=LPT2"
-			"-Ic:/gs"))
-@end example
-
-@noindent
-(This assumes that Ghostscript is installed in the @file{"c:/gs"}
-directory.)
-
 @vindex dos-printer
 @vindex dos-ps-printer
   For backwards compatibility, the value of @code{dos-printer}
 (@code{dos-ps-printer}), if it has a value, overrides the value of
-@code{printer-name} (@code{ps-printer-name}), on MS-DOS and MS-Windows
-only.
+@code{printer-name} (@code{ps-printer-name}), on MS-DOS.
 
 
 @node MS-DOS and MULE
--- a/man/emacs.texi	Fri Apr 21 05:39:14 2006 +0000
+++ b/man/emacs.texi	Tue May 02 05:51:52 2006 +0000
@@ -89,9 +89,9 @@
 @value{EMACSVER}.
 
 @ifinfo
-If you never before used the Info documentation system, type @kbd{h},
-and Emacs will take you to a programmed instruction sequence for the
-Info commands.
+To learn more about the Info documentation system, type @kbd{h}, and
+Emacs will take you to a programmed instruction sequence for the Info
+commands.
 @end ifinfo
 
 For information on extending Emacs, see @ref{Top, Emacs Lisp,, elisp, The
@@ -197,6 +197,7 @@
 * Sorting::	        Sorting lines, paragraphs or pages within Emacs.
 * Narrowing::	        Restricting display and editing to a portion
 		          of the buffer.
+* Diff Mode::           Editing diff output.
 * Two-Column::	        Splitting apart columns to edit them
 		          in side-by-side windows.
 * Editing Binary Files::Using Hexl mode to edit binary files.
@@ -286,7 +287,7 @@
 * Killing by Lines::	How to kill entire lines of text at one time.
 * Other Kill Commands:: Commands to kill large regions of text and
 			  syntactic units such as words and sentences.
-* Graphical Kill::      The kill ring on graphical terminals:
+* Graphical Kill::      The kill ring on graphical displays:
                           yanking between applications.
 * CUA Bindings::        Using @kbd{C-x}, @kbd{C-c}, @kbd{C-v} for copy
                           and paste, with enhanced rectangle support.
@@ -867,47 +868,47 @@
 @unnumbered Preface
 
   This manual documents the use and simple customization of the Emacs
-editor.  The reader is not expected to be a programmer; simple
-customizations do not require programming skill.  The user who is not
-interested in customizing can ignore the scattered customization hints.
+editor.  Simple Emacs customizations do not require you to be a
+programmer, but if you are not interested in customizing, you can
+ignore the customization hints.
 
   This is primarily a reference manual, but can also be used as a
-primer.  For complete beginners, it is a good idea to start with the
-on-line, learn-by-doing tutorial, before reading the manual.  To run the
-tutorial, start Emacs and type @kbd{C-h t}.  This way you can learn
-Emacs by using Emacs on a specially designed file which describes
-commands, tells you when to try them, and then explains the results you
-see.
+primer.  If you are a complete beginner, we recommend you start with
+the on-line, learn-by-doing tutorial, before reading the manual.  To
+run the tutorial, start Emacs and type @kbd{C-h t}.  The tutorial
+describes commands, tells you when to try them, and explains the
+results.
 
   On first reading, just skim chapters 1 and 2, which describe the
 notational conventions of the manual and the general appearance of the
 Emacs display screen.  Note which questions are answered in these
 chapters, so you can refer back later.  After reading chapter 4, you
-should practice the commands there.  The next few chapters describe
-fundamental techniques and concepts that are used constantly.  You need
-to understand them thoroughly, experimenting with them if necessary.
+should practice the commands shown there.  The next few chapters
+describe fundamental techniques and concepts that are used constantly.
+You need to understand them thoroughly, so experiment with them
+until you are fluent.
 
   Chapters 14 through 19 describe intermediate-level features that are
-useful for all kinds of editing.  Chapter 20 and following chapters
-describe features that you may or may not want to use; read those
-chapters when you need them.
+useful for many kinds of editing.  Chapter 20 and following chapters
+describe optional but useful features; read those chapters when you
+need them.
 
   Read the Trouble chapter if Emacs does not seem to be working
-properly.  It explains how to cope with some common problems
+properly.  It explains how to cope with several common problems
 (@pxref{Lossage}), as well as when and how to report Emacs bugs
 (@pxref{Bugs}).
 
-  To find the documentation on a particular command, look in the index.
-Keys (character commands) and command names have separate indexes.  There
-is also a glossary, with a cross reference for each term.
+  To find the documentation of a particular command, look in the index.
+Keys (character commands) and command names have separate indexes.
+There is also a glossary, with a cross reference for each term.
 
   This manual is available as a printed book and also as an Info file.
-The Info file is for on-line perusal with the Info program, which will
-be the principal way of viewing documentation on-line in the GNU system.
-Both the Info file and the Info program itself are distributed along
-with GNU Emacs.  The Info file and the printed book contain
-substantially the same text and are generated from the same source
-files, which are also distributed along with GNU Emacs.
+The Info file is for on-line perusal with the Info program, which is
+the principal means of accessing on-line documentation in the GNU
+system.  Both the Emacs Info file and an Info reader are included with
+GNU Emacs.  The Info file and the printed book contain substantially
+the same text and are generated from the same source files, which are
+also distributed with GNU Emacs.
 
   GNU Emacs is a member of the Emacs editor family.  There are many
 Emacs editors, all sharing common principles of organization.  For
@@ -1058,59 +1059,51 @@
 @node Intro, Glossary, Distrib, Top
 @unnumbered Introduction
 
-  You are reading about GNU Emacs, the GNU incarnation of the advanced,
-self-documenting, customizable, extensible real-time display editor Emacs.
+  You are reading about GNU Emacs, the GNU incarnation of the
+advanced, self-documenting, customizable, extensible editor Emacs.
 (The `G' in `GNU' is not silent.)
 
-  We say that Emacs is a @dfn{display} editor because normally the text
-being edited is visible on the screen and is updated automatically as you
-type your commands.  @xref{Screen,Display}.
-
-  We call it a @dfn{real-time} editor because the display is updated very
-frequently, usually after each character or pair of characters you
-type.  This minimizes the amount of information you must keep in your
-head as you edit.  @xref{Basic,Real-time,Basic Editing}.
-
-  We call Emacs advanced because it provides facilities that go beyond
-simple insertion and deletion: controlling subprocesses; automatic
-indentation of programs; viewing two or more files at once; editing
-formatted text; and dealing in terms of characters, words, lines,
-sentences, paragraphs, and pages, as well as expressions and comments in
-several different programming languages.
+  We call Emacs advanced because it provides much more than simple
+insertion and deletion.  It can control subprocesses, indent programs
+automatically, show two or more files at once, and edit formatted
+text.  Emacs editing commands operate in terms of characters, words,
+lines, sentences, paragraphs, and pages, as well as expressions and
+comments in various programming languages.
 
   @dfn{Self-documenting} means that at any time you can type a special
 character, @kbd{Control-h}, to find out what your options are.  You can
 also use it to find out what any command does, or to find all the commands
 that pertain to a topic.  @xref{Help}.
 
-  @dfn{Customizable} means that you can change the definitions of Emacs
-commands in little ways.  For example, if you use a programming language in
-which comments start with @samp{<**} and end with @samp{**>}, you can tell
-the Emacs comment manipulation commands to use those strings
-(@pxref{Comments}).  Another sort of customization is rearrangement of the
-command set.  For example, if you prefer the four basic cursor motion
-commands (up, down, left and right) on keys in a diamond pattern on the
-keyboard, you can rebind the keys that way.  @xref{Customization}.
+  @dfn{Customizable} means that you can alter Emacs commands' behavior
+in simple ways.  For example, if you use a programming language in
+which comments start with @samp{<**} and end with @samp{**>}, you can
+tell the Emacs comment manipulation commands to use those strings
+(@pxref{Comments}).  Another sort of customization is rearrangement of
+the command set.  For example, you can rebind the basic cursor motion
+commands (up, down, left and right) to any keys on the keyboard that
+you find comfortable.  @xref{Customization}.
 
-  @dfn{Extensible} means that you can go beyond simple customization and
-write entirely new commands, programs in the Lisp language to be run by
-Emacs's own Lisp interpreter.  Emacs is an ``on-line extensible''
-system, which means that it is divided into many functions that call
-each other, any of which can be redefined in the middle of an editing
-session.  Almost any part of Emacs can be replaced without making a
-separate copy of all of Emacs.  Most of the editing commands of Emacs
-are written in Lisp; the few exceptions could have been written
-in Lisp but are written in C for efficiency.  Although only a programmer
-can write an extension, anybody can use it afterward.  @xref{Top,
-Emacs Lisp Intro, Preface, eintr, An Introduction to Programming in
-Emacs Lisp}, if you want to learn Emacs Lisp programming.
+  @dfn{Extensible} means that you can go beyond simple customization
+and write entirely new commands---programs in the Lisp language to be
+run by Emacs's own Lisp interpreter.  Emacs is an ``on-line
+extensible'' system, which means that it is divided into many
+functions that call each other, any of which can be redefined in the
+middle of an editing session.  Almost any part of Emacs can be
+replaced without making a separate copy of all of Emacs.  Most of the
+editing commands of Emacs are written in Lisp; the few exceptions
+could have been written in Lisp but use C instead for efficiency.
+Writing an extension is programming, but non-programmers can use it
+afterwards.  @xref{Top, Emacs Lisp Intro, Preface, eintr, An
+Introduction to Programming in Emacs Lisp}, if you want to learn Emacs
+Lisp programming.
 
    When running on a graphical display, Emacs provides its own menus
-and convenient handling of mouse buttons.  But Emacs provides many of
-the benefits of a graphical display even on a text-only terminal.  For
-instance, it can highlight parts of a file, display and edit several
-files at once, move text between files, and edit files while running
-shell commands.
+and convenient handling of mouse buttons.  In addition, Emacs provides
+many of the benefits of a graphical display even on a text-only
+terminal.  For instance, it can highlight parts of a file, display and
+edit several files at once, move text between files, and edit files
+while running shell commands.
 
 @include screen.texi
 @include commands.texi
@@ -1544,7 +1537,12 @@
 
 @include doclicense.texi
 @include cmdargs.texi
+@iftex
+@include xresmini.texi
+@end iftex
+@ifnottex
 @include xresources.texi
+@end ifnottex
 
 @include anti.texi
 @include macos.texi
--- a/man/macos.texi	Fri Apr 21 05:39:14 2006 +0000
+++ b/man/macos.texi	Tue May 02 05:51:52 2006 +0000
@@ -104,13 +104,6 @@
 @code{mac-roman}, @code{mac-centraleurroman}, and @code{mac-cyrillic}
 are used to represent these Mac encodings.
 
-  The fontset @code{fontset-standard} is created automatically when
-Emacs is run on Mac, and used by default.  It displays as many kinds
-of characters as possible using 12-point Monaco as a base font.  If
-you see some character as a hollow box with this fontset, then it's
-almost impossible to display it only by customizing font settings
-(@pxref{Mac Font Specs}).
-
   You can use input methods provided either by LEIM (@pxref{Input
 Methods}) or Mac OS to enter international characters.  To use the
 former, see the International Character Set Support section of the
@@ -195,7 +188,7 @@
   Command line arguments are specified like
 
 @example
-/Applications/Emacs.app/Contents/MacOS/Emacs -geometry 80x25 &
+/Applications/Emacs.app/Contents/MacOS/Emacs -g 80x25 &
 @end example
 
 @noindent
@@ -295,7 +288,8 @@
 Courier by customizing the default face attributes for all frames:
 
 @lisp
-(set-face-attribute 'default nil :family "courier" :height 140)
+(set-face-attribute 'default nil
+                    :family "courier" :height 140)
 @end lisp
 
 @noindent
@@ -313,21 +307,30 @@
 @noindent
 @xref{Font X}.  Wildcards are supported as they are on X.
 
-  Native Apple fonts in Mac Roman encoding has maker name @code{apple}
-and charset @code{mac-roman}.  For example 12-point Monaco can be
-specified by the name @samp{-apple-monaco-*-12-*-mac-roman}.  When
-using a particular size of scalable fonts, it must be specified in a
-format containing 14 @samp{-}s like
-@samp{-apple-monaco-medium-r-normal--13-*-*-*-*-*-mac-roman}.
+  Emacs on Mac OS Classic uses QuickDraw Text routines for drawing texts
+by default.  Emacs on Mac OS X uses @acronym{ATSUI, Apple Type Services
+for Unicode Imaging} as well as QuickDraw Text, and most of the
+characters other than Chinese, Japanese, and Korean ones are drawn using
+the former by default.
 
-  You can specify a @code{mac-roman} font for @acronym{ASCII}
-characters like
+  @acronym{ATSUI}-compatible fonts have maker name @code{apple} and
+charset @code{iso10646-1}.  For example 12-point Monaco can be specified
+by the name
+@samp{-apple-monaco-medium-r-normal--12-*-*-*-*-*-iso10646-1}.  Note
+that it must be specified in a format containing 14 @samp{-}s (i.e., not
+by @samp{-apple-monaco-medium-r-normal-12-*-iso10646-1}) because every
+@acronym{ATSUI}-compatible font is a scalable one.
 
-@lisp
+  QuickDraw Text fonts have maker name @code{apple} and various charset
+names other than @code{iso10646-1}.  Native Apple fonts in Mac Roman
+encoding has charset @code{mac-roman}.  You can specify a
+@code{mac-roman} font for @acronym{ASCII} characters like
+
+@smalllisp
 (add-to-list
  'default-frame-alist
  '(font . "-apple-monaco-medium-r-normal--13-*-*-*-*-*-mac-roman"))
-@end lisp
+@end smalllisp
 
 @noindent
 but that does not extend to ISO-8859-1: specifying a @code{mac-roman}
@@ -341,16 +344,11 @@
 @samp{mac-cyrillic}, @samp{mac-symbol}, and @samp{mac-dingbats},
 respectively.
 
-  Since Emacs as of the current version uses QuickDraw Text routines
-for drawing texts, only characters in the charsets listed above can be
-displayed with the OS-bundled fonts, even if other applications that
-use @acronym{ATSUI} or Cocoa can display variety of characters with
-them.
-
   The use of @code{create-fontset-from-fontset-spec} (@pxref{Defining
-Fontsets}) for defining fontsets often results in wrong ones
-especially when using only OS-bundled fonts.  The recommended way is
-to create a fontset using @code{create-fontset-from-mac-roman-font}:
+Fontsets}) for defining fontsets often results in wrong ones especially
+when using only OS-bundled QuickDraw Text fonts.  The recommended way to
+use them is to create a fontset using
+@code{create-fontset-from-mac-roman-font}:
 
 @lisp
 (create-fontset-from-mac-roman-font
@@ -374,11 +372,13 @@
 the name @samp{-ETL-fixed-*-iso8859-1}.
 
 @vindex mac-allow-anti-aliasing
-  Emacs uses the QuickDraw text rendering by default.  On Mac OS X
-10.2 and later, it can be changed so that it uses the Quartz 2D text
-rendering (aka CG text rendering) by setting
-@code{mac-allow-anti-aliasing} to @code{t}.  However, it is reported
-to sometimes leave some garbages.
+  Mac OS X 10.2 or later can use two types of text renderings: Quartz 2D
+(aka Core Graphics) and QuickDraw.  By default, Emacs uses the former on
+such versions.  It can be changed by setting
+@code{mac-allow-anti-aliasing} to @code{t} (Quartz 2D) or @code{nil}
+(QuickDraw).  Both @acronym{ATSUI} and QuickDraw Text drawings are
+affected by the value of this variable.
+
 
 @node Mac Functions
 @section Mac-Specific Lisp Functions
--- a/man/mh-e.texi	Fri Apr 21 05:39:14 2006 +0000
+++ b/man/mh-e.texi	Tue May 02 05:51:52 2006 +0000
@@ -8,11 +8,11 @@
 @c %**end of header
 
 @c Version of the software and manual.
-@set VERSION 7.93
+@set VERSION 7.94
 @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 , 7th Edition
-@set UPDATED 2006-04-17
+@set EDITION , 2nd Edition
+@set UPDATED 2006-04-24
 @set UPDATE-MONTH April, 2006
 
 @c Other variables.
@@ -245,6 +245,8 @@
 the individual MH commands. When the name is not obvious, I'll guide
 you to a relevant MH manual page that describes the action more fully.
 
+@cindex @cite{MH & nmh: Email for Users & Programmers}
+@cindex MH book
 @cindex info
 @kindex C-h i
 
@@ -536,12 +538,49 @@
 installing MH-E.
 
 If the @code{mh-version} command displays @samp{No MH variant
-detected}, then you need to install MH or tell MH-E where to find
-MH@footnote{In very old versions of MH-E, you may get the error
+detected}@footnote{In very old versions of MH-E, you may get the error
 message, @samp{Cannot find the commands `inc' and `mhl' and the file
 `components'} if MH-E can't find MH. In this case, you need to update
 MH-E, and you may need to install MH too. However, newer versions of
-MH-E are better at finding MH if it is on your system.}.
+MH-E are better at finding MH if it is on your system.}, then you need
+to install MH or tell MH-E where to find MH.
+
+@cindex Debian
+@cindex nmh
+@cindex GNU mailutils
+
+If you don't have MH on your system already, you must install a
+variant of MH. The Debian mh-e package does this for you automatically
+(@pxref{Getting MH-E}). Most people use
+@uref{http://www.nongnu.org/nmh/, nmh}, but you may be interested in
+trying out @uref{http://www.gnu.org/software/mailutils/, GNU
+mailutils}, which supports IMAP. Your GNU/Linux distribution probably
+has packages for both of these.
+
+@cindex @command{install-mh}
+@cindex MH commands, @command{install-mh}
+@cindex MH book
+
+If you've never run MH before, you need to run @command{install-mh}
+from the shell before you continue. This sets up your personal MH
+environment@footnote{See the section
+@uref{@value{MH-BOOK-HOME}/../overall/setup.htm, Setting Up MH} in the
+MH book.}. If you don't, you'll be greeted with the error message:
+@samp{Install MH and run install-mh before running MH-E}. This is all
+you need to know about MH to use MH-E, but the more you know about MH,
+the more you can leverage its power. See the
+@uref{@value{MH-BOOK-HOME}, MH book} to learn more about MH.
+
+@cindex @samp{Path:} MH profile component
+@cindex MH profile
+@cindex MH profile component
+@cindex MH profile component, @samp{Path:}
+
+Your MH environment includes your @dfn{MH profile} which is found in
+the file @file{~/.mh_profile}. This file contains a number of @dfn{MH
+profile components}. For example, the @samp{Path:} MH profile
+component contains the path to your mail directory, which is
+@file{~/Mail} by default.
 
 @cindex @command{mhparam}
 @cindex MH commands, @command{mhparam}
@@ -551,8 +590,9 @@
 @vindex mh-variant
 @vindex mh-variant-in-use
 
-The option @code{mh-variant} specifies the variant used by MH-E
-(@pxref{Options}). The default setting of this option is
+There are several options MH-E uses to interact with your MH
+installation. The option @code{mh-variant} specifies the variant used
+by MH-E (@pxref{Options}). The default setting of this option is
 @samp{Auto-detect} which means that MH-E will automatically choose the
 first of nmh, MH, or GNU mailutils that it finds in the directories
 listed in @code{mh-path} (which you can customize),
@@ -585,27 +625,6 @@
 @end quotation
 @sp 1
 
-@cindex @command{install-mh}
-@cindex MH commands, @command{install-mh}
-
-If you've never run MH before, you need to run @command{install-mh}
-from the shell before you continue. This sets up your personal MH
-environment@footnote{See the section
-@uref{@value{MH-BOOK-HOME}/../overall/setup.htm, Setting Up MH} in the
-MH book.}. If you don't, you'll be greeted with the error message:
-@samp{Install MH and run install-mh before running MH-E}.
-
-@cindex @samp{Path:} MH profile component
-@cindex MH profile
-@cindex MH profile component
-@cindex MH profile component, @samp{Path:}
-
-Your MH environment includes your @dfn{MH profile} which is found in
-the file @file{~/.mh_profile}. This file contains a number of @dfn{MH
-profile components}. For example, the @samp{Path:} MH profile
-component contains the path to your mail directory, which is
-@file{~/Mail} by default.
-
 @cindex MH profile component, @samp{Draft-Folder:}
 @cindex MH profile component, @samp{Path:}
 @cindex MH profile component, @samp{Previous-Sequence:}
@@ -8609,6 +8628,12 @@
 MH-E has to offer (although we have no doubt that you will be
 extremely interested in all new releases).
 
+@cindex Debian
+
+If you use Debian, you can install the Debian
+@uref{http://packages.debian.org/unstable/mail/mh-e, mh-e package}
+instead.
+
 @cindex files, @samp{MH-E-NEWS}
 @cindex files, @samp{README}
 @cindex news
--- a/man/misc.texi	Fri Apr 21 05:39:14 2006 +0000
+++ b/man/misc.texi	Tue May 02 05:51:52 2006 +0000
@@ -1761,7 +1761,7 @@
   Many of the sort commands ignore case differences when comparing, if
 @code{sort-fold-case} is non-@code{nil}.
 
-@node Narrowing, Two-Column, Sorting, Top
+@node Narrowing, Diff Mode, Sorting, Top
 @section Narrowing
 @cindex widening
 @cindex restriction
@@ -1827,7 +1827,86 @@
 if you enable the command, confirmation will no longer be required for
 it.  @xref{Disabling}.
 
-@node Two-Column, Editing Binary Files, Narrowing, Top
+@node Diff Mode, Two-Column, Narrowing, Top
+@section Diff Mode
+@cindex Diff mode
+
+  Diff mode is useful for editing patches and comparisons produced by
+the @command{diff} program.  You can select Diff mode by typing
+@kbd{M-x diff-mode}; Emacs commands that compare files automatically
+select Diff mode.  @xref{Top,, Diff, diff, Comparing and Merging Files},
+for more information about @command{diff} output formats.
+
+  One general feature of Diff mode is that manual edits to the patch
+automatically correct line numbers, including those in the hunk
+header, so that you can actually apply the edited patch.  Diff mode
+also provides the following commands to navigate, manipulate and apply
+parts of patches:
+
+@table @kbd
+@item M-n
+Move to the next hunk-start (@code{diff-hunk-next}).
+
+@item M-p
+Move to the previous hunk-start (@code{diff-hunk-prev}).
+
+@item M-@}
+Move to the next file-start, in a multi-file patch
+(@code{diff-file-next}).
+
+@item M-@{
+Move to the previous file-start, in a multi-file patch
+(@code{diff-file-prev}).
+
+@item M-k
+Kill the hunk at point (@code{diff-hunk-kill}).
+
+@item M-K
+In a multi-file patch, kill the current file part.
+(@code{diff-file-kill}).
+
+@item C-c C-a
+Apply this hunk to its target file (@code{diff-apply-hunk}).  With a
+prefix argument of @kbd{C-u}, revert this hunk.
+
+@item C-c C-c
+Go to the source corresponding to this hunk (@code{diff-goto-source}).
+
+@item C-c C-e
+Start an Ediff session with the patch (@code{diff-ediff-patch}).
+@xref{Top, Ediff, Ediff, ediff, The Ediff Manual}.
+
+@item C-c C-n
+Restrict the view to the current hunk (@code{diff-restrict-view}).
+@xref{Narrowing}.  With a prefix argument of @kbd{C-u}, restrict the
+view to the current patch of a multiple file patch.  To widen again,
+use @kbd{C-x n w}.
+
+@item C-c C-r
+Reverse the direction of comparison for the entire buffer
+(@code{diff-reverse-direction}).
+
+@item C-c C-s
+Split the hunk at point (@code{diff-split-hunk}).  This is for
+manually editing patches, and only works with the unified diff format.
+
+@item C-c C-u
+Convert the entire buffer to unified format
+(@code{diff-context->unified}).  With a prefix argument, convert
+unified format to context format.  In Transient Mark mode, when the
+mark is active, this command operates only on the region.
+
+@item C-c C-w
+Refine the current hunk so that it disregards changes in whitespace
+(@code{diff-refine-hunk}).
+@end table
+
+  @kbd{C-x 4 a} in Diff mode operates on behalf of the target file,
+but gets the function name from the patch itself.  @xref{Change Log}.
+This is useful for making log entries for functions that are deleted
+by the patch.
+
+@node Two-Column, Editing Binary Files, Diff Mode, Top
 @section Two-Column Editing
 @cindex two-column editing
 @cindex splitting columns
--- a/man/msdog.texi	Fri Apr 21 05:39:14 2006 +0000
+++ b/man/msdog.texi	Tue May 02 05:51:52 2006 +0000
@@ -5,22 +5,26 @@
 @node Emacs and Microsoft Windows, Manifesto, Mac OS, Top
 @appendix Emacs and Microsoft Windows
 @cindex Microsoft Windows
+@cindex MS-Windows, Emacs peculiarities
 
   This section describes peculiarities of using Emacs on Microsoft
-Windows.  Information about Emacs and Microsoft's older MS-DOS
-``operating system'' (also known as ``MS-DOG'') is now in a separate
-manual (@inforef{MS-DOG,, emacs-xtra}).
+Windows.  Some of these peculiarities are also relevant to Microsoft's
+older MS-DOS ``operating system'' (also known as ``MS-DOG'').
+However, Emacs features that are relevant @emph{only} to MS-DOS are
+described in a separate manual (@inforef{MS-DOG,, emacs-xtra}).
 
-  Iif you want to use Emacs on Windows, you would normally build Emacs
-specifically for Windows.  If you do that, the behavior is reasonably
-similar to what is documented in the rest of the manual, including
-support for long file names, multiple frames, scroll bars, mouse
-menus, and subprocesses.  However, a few special considerations apply,
-and they are described here.
+  The behavior of Emacs on MS-Windows is reasonably similar to what is
+documented in the rest of the manual, including support for long file
+names, multiple frames, scroll bars, mouse menus, and subprocesses.
+However, a few special considerations apply, and they are described
+here.
 
 @menu
 * Text and Binary::            Text files use CRLF to terminate lines.
+* Windows Files::              File-name conventions on Windows.
+* Windows HOME::               Where Emacs looks for your @file{.emacs}.
 * Windows Processes::          Running subprocesses on Windows.
+* Windows Printing::           How to specify the printer on MS-Windows.
 * Windows System Menu::        Controlling what the ALT key does.
 @end menu
 
@@ -29,11 +33,11 @@
 @cindex text and binary files on MS-DOS/MS-Windows
 
   GNU Emacs uses newline characters to separate text lines.  This is the
-convention used on GNU and Unix.
+convention used on GNU, Unix, and other Posix-compliant systems.
 
 @cindex end-of-line conversion on MS-DOS/MS-Windows
-  MS-DOS and MS-Windows normally use carriage-return linefeed, a
-two-character sequence, to separate text lines.  (Linefeed is the same
+  By contrast, MS-DOS and MS-Windows normally use carriage-return linefeed,
+a two-character sequence, to separate text lines.  (Linefeed is the same
 character as newline.)  Therefore, convenient editing of typical files
 with Emacs requires conversion of these end-of-line (EOL) sequences.
 And that is what Emacs normally does: it converts carriage-return
@@ -57,11 +61,11 @@
 
   The mode line indicates whether end-of-line translation was used for
 the current buffer.  If MS-DOS end-of-line translation is in use for the
-buffer, a backslash @samp{\} is displayed after the coding system
-mnemonic near the beginning of the mode line (@pxref{Mode Line}).  If no
-EOL translation was performed, the string @samp{(Unix)} is displayed
-instead of the backslash, to alert you that the file's EOL format is not
-the usual carriage-return linefeed.
+buffer, the MS-Windows build of Emacs displays a backslash @samp{\} after
+the coding system mnemonic near the beginning of the mode line
+(@pxref{Mode Line}).  If no EOL translation was performed, the string
+@samp{(Unix)} is displayed instead of the backslash, to alert you that the
+file's EOL format is not the usual carriage-return linefeed.
 
 @cindex DOS-to-Unix conversion of files
   To visit a file and specify whether it uses DOS-style or Unix-style
@@ -78,14 +82,14 @@
 
 @cindex untranslated file system
 @findex add-untranslated-filesystem
-  When you use NFS or Samba to access file systems that reside on
-computers using GNU or Unix systems, Emacs should not perform
-end-of-line translation on any files in these file systems---not even
-when you create a new file.  To request this, designate these file
-systems as @dfn{untranslated} file systems by calling the function
-@code{add-untranslated-filesystem}.  It takes one argument: the file
-system name, including a drive letter and optionally a directory.  For
-example,
+  When you use NFS, Samba, or some other similar method to access file
+systems that reside on computers using GNU or Unix systems, Emacs
+should not perform end-of-line translation on any files in these file
+systems---not even when you create a new file.  To request this,
+designate these file systems as @dfn{untranslated} file systems by
+calling the function @code{add-untranslated-filesystem}.  It takes one
+argument: the file system name, including a drive letter and
+optionally a directory.  For example,
 
 @example
 (add-untranslated-filesystem "Z:")
@@ -103,7 +107,7 @@
 system.
 
   Most often you would use @code{add-untranslated-filesystem} in your
-@file{_emacs} file, or in @file{site-start.el} so that all the users at
+@file{.emacs} file, or in @file{site-start.el} so that all the users at
 your site get the benefit of it.
 
 @findex remove-untranslated-filesystem
@@ -120,9 +124,9 @@
 @vindex file-name-buffer-file-type-alist
 @cindex binary files, on MS-DOS/MS-Windows
   Some kinds of files should not be converted at all, because their
-contents are not really text.  Therefore, Emacs on MS-DOS distinguishes
+contents are not really text.  Therefore, Emacs on MS-Windows distinguishes
 certain files as @dfn{binary files}.  (This distinction is not part of
-MS-DOS; it is made by Emacs only.)  Binary files include executable
+MS-Windows; it is made by Emacs only.)  Binary files include executable
 programs, compressed archives, etc.  Emacs uses the file name to decide
 whether to treat a file as binary: the variable
 @code{file-name-buffer-file-type-alist} defines the file-name patterns
@@ -132,29 +136,88 @@
 @code{no-conversion} coding system (@pxref{Coding Systems}) which turns
 off @emph{all} coding-system conversions, not only the EOL conversion.
 @code{file-name-buffer-file-type-alist} also includes file-name patterns
-for files which are known to be DOS-style text files with
+for files which are known to be Windows-style text files with
 carriage-return linefeed EOL format, such as @file{CONFIG.SYS}; Emacs
-always writes those files with DOS-style EOLs.
+always writes those files with Windows-style EOLs.
 
   If a file which belongs to an untranslated file system matches one of
 the file-name patterns in @code{file-name-buffer-file-type-alist}, the
 EOL conversion is determined by @code{file-name-buffer-file-type-alist}.
 
+@node Windows Files
+@section File Names on MS-Windows
+@cindex file names on MS-Windows
+
+  MS-Windows and MS-DOS normally use a backslash, @samp{\}, to
+separate name units within a file name, instead of the slash used on
+other systems.  Emacs on MS-DOS/MS-Windows permits use of either slash or
+backslash, and also knows about drive letters in file names.
+
+@cindex file-name completion, on MS-Windows
+  On MS-DOS/MS-Windows, file names are case-insensitive, so Emacs by
+default ignores letter-case in file names during completion.
+
+@node Windows HOME
+@section HOME Directory on MS-Windows
+@cindex @code{HOME} directory on MS-Windows
+
+  The MS-Windows equivalent of the @code{HOME} directory is the
+@dfn{user-specific application data directory}.  The actual location
+depends on your Windows version and system configuration; typical values
+are @file{C:\Documents and Settings\@var{username}\Application Data} on
+Windows 2K/XP and later, and either @file{C:\WINDOWS\Application Data}
+or @file{C:\WINDOWS\Profiles\@var{username}\Application Data} on the
+older Windows 9X/ME systems.
+
+@cindex init file @file{.emacs} on MS-Windows
+  The home directory is where your init file @file{.emacs} is stored.
+When Emacs starts, it first checks whether the environment variable
+@env{HOME} is set.  If it is, it looks for the init file in the
+directory pointed by @env{HOME}.  If @env{HOME} is not defined, Emacs
+checks for an existing @file{.emacs} file in @file{C:\}, the root
+directory of drive @file{C:}@footnote{
+The check in @file{C:\} is in preference to the application data
+directory for compatibility with older versions of Emacs, which didn't
+check the application data directory.
+}.  If there's no such file in @file{C:\}, Emacs next uses the Windows
+system calls to find out the exact location of your application data
+directory.  If that fails as well, Emacs falls back to @file{C:\}.
+
+  Whatever the final place is, Emacs sets the value of the @env{HOME}
+environment variable to point to it, and it will use that location for
+other files and directories it normally creates in the user's home
+directory.
+
+  You can always find out where Emacs thinks is your home directory's
+location by typing @kbd{C-x d ~/ @key{RET}}.  This should present the
+list of files in the home directory, and show its full name on the
+first line.  Likewise, to visit your init file, type @kbd{C-x C-f
+~/.emacs @key{RET}}.
+
+@cindex @file{_emacs} init file, MS-Windows
+  Because MS-DOS does not allow file names with leading dots, and
+because older Windows systems made it hard to create files with such
+names, the Windows port of Emacs supports an alternative name
+@file{_emacs} as a fallback, if such a file exists in the home
+directory, whereas @file{.emacs} does not.
+
 @node Windows Processes
-@section Subprocesses on Windows 9X/ME and Windows NT/2K
+@section Subprocesses on Windows 9X/ME and Windows NT/2K/XP
+@cindex subprocesses on MS-Windows
 
+@cindex DOS applications, running from Emacs
   Emacs compiled as a native Windows application (as opposed to the DOS
 version) includes full support for asynchronous subprocesses.
 In the Windows version, synchronous and asynchronous subprocesses work
 fine on both
-Windows 9X and Windows NT/2K as long as you run only 32-bit Windows
+Windows 9X/ME and Windows NT/2K/XP as long as you run only 32-bit Windows
 applications.  However, when you run a DOS application in a subprocess,
 you may encounter problems or be unable to run the application at all;
 and if you run two DOS applications at the same time in two
 subprocesses, you may have to reboot your system.
 
 Since the standard command interpreter (and most command line utilities)
-on Windows 95 are DOS applications, these problems are significant when
+on Windows 9X are DOS applications, these problems are significant when
 using that system.  But there's nothing we can do about them; only
 Microsoft can fix them.
 
@@ -174,13 +237,14 @@
 subprocesses, the second one that is started will be suspended until the
 first one finishes, even if either or both of them are asynchronous.
 
+@cindex kill DOS application
 If you can go to the first subprocess, and tell it to exit, the second
 subprocess should continue normally.  However, if the second subprocess
 is synchronous, Emacs itself will be hung until the first subprocess
 finishes.  If it will not finish without user input, then you have no
 choice but to reboot if you are running on Windows 9X.  If you are
-running on Windows NT/2K, you can use a process viewer application to kill
-the appropriate instance of ntvdm instead (this will terminate both DOS
+running on Windows NT/2K/XP, you can use a process viewer application to kill
+the appropriate instance of NTVDM instead (this will terminate both DOS
 subprocesses).
 
 If you have to reboot Windows 9X in this situation, do not use the
@@ -189,16 +253,156 @@
 @code{Shutdown}.  That usually works, although it may take a few minutes
 to do its job.
 
+@node Windows Printing
+@section Printing and MS-Windows
+
+  Printing commands, such as @code{lpr-buffer} (@pxref{Printing}) and
+@code{ps-print-buffer} (@pxref{PostScript}) work in MS-DOS and
+MS-Windows by sending the output to one of the printer ports, if a
+Posix-style @code{lpr} program is unavailable.  The same Emacs
+variables control printing on all systems, but in some cases they have
+different default values on MS-DOS and MS-Windows.
+
+  Emacs on Windows automatically determines your default printer and
+sets the variable @var{printer-name} to that printer's name.  But in
+some rare cases this can fail, or you may wish to use a different
+printer from within Emacs.  The rest of this section explains how to
+tell Emacs which printer to use.
+
+@vindex printer-name@r{, (MS-DOS/MW-Windows)}
+  If you want to use your local printer, then set the Lisp variable
+@code{lpr-command} to @code{""} (its default value on Windows) and
+@code{printer-name} to the name of the printer port---for example,
+@code{"PRN"}, the usual local printer port or @code{"LPT2"}, or
+@code{"COM1"} for a serial printer.  You can also set
+@code{printer-name} to a file name, in which case ``printed'' output
+is actually appended to that file.  If you set @code{printer-name} to
+@code{"NUL"}, printed output is silently discarded (sent to the system
+null device).
+
+  You can also use a printer shared by another machine by setting
+@code{printer-name} to the UNC share name for that printer---for
+example, @code{"//joes_pc/hp4si"}.  (It doesn't matter whether you use
+forward slashes or backslashes here.)  To find out the names of shared
+printers, run the command @samp{net view} from the command prompt to
+obtain a list of servers, and @samp{net view @var{server-name}} to see
+the names of printers (and directories) shared by that server.
+Alternatively, click the @samp{Network Neighborhood} icon on your
+desktop, and look for machines which share their printers via the
+network.
+
+@cindex @samp{net use}, and printing on MS-Windows
+@cindex networked printers (MS-Windows)
+  If the printer doesn't appear in the output of @samp{net view}, or
+if setting @code{printer-name} to the UNC share name doesn't produce a
+hardcopy on that printer, you can use the @samp{net use} command to
+connect a local print port such as @code{"LPT2"} to the networked
+printer.  For example, typing @kbd{net use LPT2: \\joes_pc\hp4si}@footnote{
+Note that the @samp{net use} command requires the UNC share name to be
+typed with the Windows-style backslashes, while the value of
+@code{printer-name} can be set with either forward- or backslashes.}
+causes Windows to @dfn{capture} the @code{LPT2} port and redirect the
+printed material to the printer connected to the machine @code{joes_pc}.
+After this command, setting @code{printer-name} to @code{"LPT2"}
+should produce the hardcopy on the networked printer.
+
+  With some varieties of Windows network software, you can instruct
+Windows to capture a specific printer port such as @code{"LPT2"}, and
+redirect it to a networked printer via the @w{@code{Control
+Panel->Printers}} applet instead of @samp{net use}.
+
+  If you set @code{printer-name} to a file name, it's best to use an
+absolute file name.  Emacs changes the working directory according to
+the default directory of the current buffer, so if the file name in
+@code{printer-name} is relative, you will end up with several such
+files, each one in the directory of the buffer from which the printing
+was done.
+
+@findex print-buffer @r{(MS-DOS)}
+@findex print-region @r{(MS-DOS)}
+@vindex lpr-headers-switches @r{(MS-DOS)}
+  The commands @code{print-buffer} and @code{print-region} call the
+@code{pr} program, or use special switches to the @code{lpr} program, to
+produce headers on each printed page.  MS-DOS and MS-Windows don't
+normally have these programs, so by default, the variable
+@code{lpr-headers-switches} is set so that the requests to print page
+headers are silently ignored.  Thus, @code{print-buffer} and
+@code{print-region} produce the same output as @code{lpr-buffer} and
+@code{lpr-region}, respectively.  If you do have a suitable @code{pr}
+program (for example, from GNU Coreutils), set
+@code{lpr-headers-switches} to @code{nil}; Emacs will then call
+@code{pr} to produce the page headers, and print the resulting output as
+specified by @code{printer-name}.
+
+@vindex print-region-function @r{(MS-DOS)}
+@cindex lpr usage under MS-DOS
+@vindex lpr-command @r{(MS-DOS)}
+@vindex lpr-switches @r{(MS-DOS)}
+  Finally, if you do have an @code{lpr} work-alike, you can set the
+variable @code{lpr-command} to @code{"lpr"}.  Then Emacs will use
+@code{lpr} for printing, as on other systems.  (If the name of the
+program isn't @code{lpr}, set @code{lpr-command} to specify where to
+find it.)  The variable @code{lpr-switches} has its standard meaning
+when @code{lpr-command} is not @code{""}.  If the variable
+@code{printer-name} has a string value, it is used as the value for the
+@code{-P} option to @code{lpr}, as on Unix.
+
+@findex ps-print-buffer @r{(MS-DOS)}
+@findex ps-spool-buffer @r{(MS-DOS)}
+@vindex ps-printer-name @r{(MS-DOS)}
+@vindex ps-lpr-command @r{(MS-DOS)}
+@vindex ps-lpr-switches @r{(MS-DOS)}
+  A parallel set of variables, @code{ps-lpr-command},
+@code{ps-lpr-switches}, and @code{ps-printer-name} (@pxref{PostScript
+Variables}), defines how PostScript files should be printed.  These
+variables are used in the same way as the corresponding variables
+described above for non-PostScript printing.  Thus, the value of
+@code{ps-printer-name} is used as the name of the device (or file) to
+which PostScript output is sent, just as @code{printer-name} is used
+for non-PostScript printing.  (There are two distinct sets of
+variables in case you have two printers attached to two different
+ports, and only one of them is a PostScript printer.)
+
+  The default value of the variable @code{ps-lpr-command} is @code{""},
+which causes PostScript output to be sent to the printer port specified
+by @code{ps-printer-name}, but @code{ps-lpr-command} can also be set to
+the name of a program which will accept PostScript files.  Thus, if you
+have a non-PostScript printer, you can set this variable to the name of
+a PostScript interpreter program (such as Ghostscript).  Any switches
+that need to be passed to the interpreter program are specified using
+@code{ps-lpr-switches}.  (If the value of @code{ps-printer-name} is a
+string, it will be added to the list of switches as the value for the
+@code{-P} option.  This is probably only useful if you are using
+@code{lpr}, so when using an interpreter typically you would set
+@code{ps-printer-name} to something other than a string so it is
+ignored.)
+
+  For example, to use Ghostscript for printing on the system's default
+printer, put this in your @file{.emacs} file:
+
+@example
+(setq ps-printer-name t)
+(setq ps-lpr-command "D:/gs6.01/bin/gswin32c.exe")
+(setq ps-lpr-switches '("-q" "-dNOPAUSE" "-dBATCH"
+			"-sDEVICE=mswinpr2"
+			"-sPAPERSIZE=a4"))
+@end example
+
+@noindent
+(This assumes that Ghostscript is installed in the
+@file{D:/gs6.01} directory.)
+
 @node Windows System Menu
 @section Using the System Menu on Windows
+@cindex @code{Alt} key invokes menu (Windows)
 
 Emacs compiled as a native Windows application normally turns off the
-Windows feature that tapping the @key{ALT}
-key invokes the Windows menu.  The reason is that the @key{ALT} also
-serves as @key{META} in Emacs.  When using Emacs, users often press the
-@key{META} key temporarily and then change their minds; if this has the
-effect of bringing up the Windows menu, it alters the meaning of
-subsequent commands.  Many users find this frustrating.
+Windows feature that tapping the @key{ALT} key invokes the Windows
+menu.  The reason is that the @key{ALT} serves as @key{META} in Emacs.
+When using Emacs, users often press the @key{META} key temporarily and
+then change their minds; if this has the effect of bringing up the
+Windows menu, it alters the meaning of subsequent commands.  Many
+users find this frustrating.
 
 @vindex w32-pass-alt-to-system
 You can re-enable Windows' default handling of tapping the @key{ALT} key
--- a/man/org.texi	Fri Apr 21 05:39:14 2006 +0000
+++ b/man/org.texi	Tue May 02 05:51:52 2006 +0000
@@ -4,7 +4,7 @@
 @setfilename ../info/org
 @settitle Org Mode Manual
 
-@set VERSION 4.25
+@set VERSION 4.26
 @set DATE April 2006
 
 @dircategory Emacs
@@ -130,7 +130,7 @@
 * Link format::                 How links in Org-mode are formatted
 * Internal links::              Links to other places in the current file
 * External links::              URL-like links to the world
-* Managing links::              Creating, inserting and following
+* Handling links::              Creating, inserting and following
 * Search Options::              Linking to a specific location
 * Remember::                    Org-trees store quick notes
 
@@ -242,10 +242,10 @@
 iCalendar file.
 
 Org-mode keeps simple things simple.  When first fired up, it should
-feel like a simple but easy to use outliner.  Complexity is not
-imposed, but a large amount of functionality is available when you
-need it.  Org-mode can be used on different levels and in different
-ways, for example:
+feel like a simple, easy to use outliner.  Complexity is not imposed,
+but a large amount of functionality is available when you need it.
+Org-mode can be used on different levels and in different ways, for
+example:
 
 @example
 @r{@bullet{} as an outline extension with visibility cycling and structure editing}
@@ -642,7 +642,7 @@
 To print a sparse tree, you can use the Emacs command
 @code{ps-print-buffer-with-faces} which does not print invisible parts
 of the document @footnote{This does not work under XEmacs, because
-XEmacs uses selective display for outlining, not text properties}.
+XEmacs uses selective display for outlining, not text properties.}.
 Or you can use the command @kbd{C-c C-x v} to copy the visible part of
 the document to another file (extension @file{.txt}) which can then be
 printed in any desired way.
@@ -678,6 +678,7 @@
 less.  For example:
 
 @example
+@group
 ** Lord of the Rings
 My favorite scenes are (in this order)
 1. Eowyns fight with the witch king
@@ -687,6 +688,8 @@
 3. Peter Jackson being shot by Legolas
     - on DVD only
    He makes a really funny face when it happens.
+But in the end, not individual scenes matter but the film as a whole.
+@end group
 @end example
 
 Org-mode supports these lists by tuning filling and wrapping commands
@@ -998,9 +1001,10 @@
 Sometimes a single field or a few fields need to carry more text,
 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
-will then set the width of this column to no more than this value.
+the column may contain just the string @samp{<N>} where @samp{N} is an
+integer specifying the width of the column in characters.  The next
+re-align will then set the width of this column to no more than this
+value.
 
 @example
 |---+------------------------------|               |---+--------|
@@ -1372,7 +1376,7 @@
 * Link format::                 How links in Org-mode are formatted
 * Internal links::              Links to other places in the current file
 * External links::              URL-like links to the world
-* Managing links::              Creating, inserting and following
+* Handling links::              Creating, inserting and following
 * Search Options::              Linking to a specific location
 * Remember::                    Org-trees store quick notes
 @end menu
@@ -1413,29 +1417,28 @@
 @cindex links, internal
 @cindex CamelCase links
 
-If the link text does not look like a URL, links are considered to be
-internal in the current file.  Links such as @samp{[[My Target]]} or
-@samp{[[My Target][Find my target]]} lead to a text search in the
-current file.  The link can be followed with @kbd{C-c C-o} when the
-cursor is on the link, or with a mouse click (@pxref{Managing links}).
-The preferred match for such a link is a dedicated target: The same
-string in double angular brackets.  Targets may be located anywhere,
-often it is convenient to put them into a comment line, for example
+If the link does not look like a URL, it is considered to be internal in
+the current file.  Links such as @samp{[[My Target]]} or @samp{[[My
+Target][Find my target]]} lead to a text search in the current file.
+The link can be followed with @kbd{C-c C-o} when the cursor is on the
+link, or with a mouse click (@pxref{Handling links}).  The preferred
+match for such a link is a dedicated target: The same string in double
+angular brackets.  Targets may be located anywhere, often it is
+convenient to put them into a comment line, for example
 
 @example
 # <<My Target>>
 @end example
 
 @noindent In HTML export (@pxref{HTML export}), such targets will become
-named anchors for direct access through http links.
+named anchors for direct access through @samp{http} links.
 
 If no dedicated target exists, Org-mode will search for the words in the
-link, often removing the need for a dedicated target.  In the above
-example the search would be for @samp{my target}.  Links starting with a
-star like @samp{*My Target} restrict the search to headlines.  When
-searching, Org-mode will first try an exact match, but then move on to
-more and more lenient searches.  For example, the link @samp{[[*My
-Targets]]} will find any of the following:
+link.  In the above example the search would be for @samp{my target}.
+Links starting with a star like @samp{*My Target} restrict the search to
+headlines.  When searching, Org-mode will first try an exact match, but
+then move on to more and more lenient searches.  For example, the link
+@samp{[[*My Targets]]} will find any of the following:
 
 @example
 ** My targets
@@ -1446,7 +1449,7 @@
 To insert a link targeting a headline, in-buffer completion can be used.
 Just type a star followed by a few optional letters into the buffer and
 press @kbd{M-@key{TAB}}.  All headlines in the current buffer will be
-offered as completions.  @xref{Managing links}, for more commands
+offered as completions.  @xref{Handling links}, for more commands
 creating links.
 
 Following a link pushes a mark onto Org-mode's own mark ring.  You can
@@ -1484,7 +1487,7 @@
 text search such that @samp{CamelCaseLink} is equivalent to
 @samp{[[camel case link]]}.
 
-@node External links, Managing links, Internal links, Hyperlinks
+@node External links, Handling links, Internal links, Hyperlinks
 @section External links
 @cindex links, external
 @cindex external links
@@ -1540,8 +1543,8 @@
 @samp{bbdb:Richard Stallman}) or to remove ambiguities about the end of
 the link, enclose them in angular brackets.
 
-@node Managing links, Search Options, External links, Hyperlinks
-@section Managing links
+@node Handling links, Search Options, External links, Hyperlinks
+@section Handling links
 
 Org-mode provides methods to create a link in the correct syntax, to
 insert it into an org-mode file, and to follow the link.
@@ -1552,15 +1555,17 @@
 @item C-c l
 Store a link to the current location.  This is a @emph{global} command
 which can be used in any buffer to create a link.  The link will be
-stored for later insertion into an Org-mode buffer (see below).  For VM,
-RMAIL, WANDERLUST, MH-E, GNUS and BBDB buffers, the link will point to
-the current article/entry.  For W3 and W3M buffers, the link goes to the
-current URL.  For Org-mode files, the current headline is targeted.  For
-any other files, the link will point to the file, with a search string
-(@pxref{Search Options}) pointing to the contents of the current line.
-If there is an active region, the selected words will form the basis of
-the search string.  The key binding @kbd{C-c l} is only a suggestion -
-see @ref{Installation and activation}.
+stored for later insertion into an Org-mode buffer (see below).  For
+Org-mode files, if there is a @samp{<<target>>} at the cursor, the link
+points to the target.  Otherwise it points to the current headline.  For
+VM, RMAIL, WANDERLUST, MH-E, GNUS and BBDB buffers, the link will
+indicate to the current article/entry.  For W3 and W3M buffers, the link
+goes to the current URL.  For any other files, the link will point to
+the file, with a search string (@pxref{Search Options}) pointing to the
+contents of the current line.  If there is an active region, the
+selected words will form the basis of the search string.  The key
+binding @kbd{C-c l} is only a suggestion - see @ref{Installation and
+activation}.
 
 @kindex C-c C-l
 @cindex link completion
@@ -1571,12 +1576,12 @@
 You can just type a link, using text for an internal link, or one of the
 link type prefixes mentioned in the examples above.  Through completion,
 all links stored during the current session can be accessed.  The link
-will be formatted as given in the variable @code{org-link-format} and
-inserted into the buffer, along with a descriptive text.  Note that you
-don't have to use this command to insert a link.  Links in Org-mode are
-plain text, and you can type or paste them straight into the buffer.
-By using this command, the links are automatically enclosed in double
-brackets, and you will be asked for the optional descriptive text.
+will be inserted into the buffer, along with a descriptive text.  Note
+that you don't have to use this command to insert a link.  Links in
+Org-mode are plain text, and you can type or paste them straight into
+the buffer.  By using this command, the links are automatically enclosed
+in double brackets, and you will be asked for the optional descriptive
+text.
 
 @kindex C-u C-c C-l
 @cindex file name completion
@@ -1638,7 +1643,7 @@
 @end table
 
 
-@node Search Options, Remember, Managing links, Hyperlinks
+@node Search Options, Remember, Handling links, Hyperlinks
 @section Search options in file links
 @cindex search option in file links
 @cindex file links, searching
@@ -1843,9 +1848,9 @@
 @code{agenda-mode}, so there are commands to examine and manipulate
 the TODO entries directly from that buffer (@pxref{Agenda commands}).
 @xref{Global TODO list}, for more information.
-@item @code{org-agenda-include-all-todo}
-If you would like to have all your TODO items listed as part of your
-agenda, customize the variable @code{org-agenda-include-all-todo}.
+@c @item @code{org-agenda-include-all-todo}
+@c If you would like to have all your TODO items listed as part of your
+@c agenda, customize the variable @code{org-agenda-include-all-todo}.
 @end table
 
 @node Progress logging, TODO extensions, TODO basics, TODO items
@@ -2086,7 +2091,7 @@
 automatically be forwarded until completed.
 
 @example
-*** TODO Call Trillian to ask her out for a date on New Years Eve.
+*** TODO Call Trillian for a date on New Years Eve.
     SCHEDULED: <2004-12-25 Sat>
 @end example
 
@@ -3352,7 +3357,7 @@
 @code{nil}. 
 @example
 align      @r{align all tables}
-noalign    @r{don't align table on startup}
+noalign    @r{don't align tables 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
@@ -3375,7 +3380,7 @@
 @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
+These lines provide setting for exporting files.  For more details see
 @ref{Export options}.
 @end table
 
@@ -3563,10 +3568,24 @@
 @cindex FAQ
 
 @enumerate
+
+@cindex allout.el, conflict with
+@cindex @code{keymapp nil} error
+@item @b{When I try to use Org-mode, I always get
+@code{(wrong-type-argument keymapp nil)}}.@*
+This is a conflict with an outdated version of the @file{allout.el}
+package which pretends to be also the standard outline-mode but is not.
+This happens with older versions of @file{allout.el}, for example the
+one distributed with Emacs 21.  Upgrade to Emacs 22 and this problem
+will disappear.  If for some reason you cannot do this, make sure that
+org.el is loaded @emph{before} @file{allout.el}, for example by putting
+@code{(require 'org)} early enough into your @file{.emacs} file.
+
 @item @b{Org-mode seems to be a useful default mode for the various
 @file{README} files I have scattered through my directories.  How do I
-turn it on for all @file{README} files?}@*
-@c
+turn it on for all @file{README} files?}
+@c @*
+
 @example
 (add-to-list 'auto-mode-alist '("README$" . org-mode))
 @end example
@@ -3584,7 +3603,7 @@
 description part.  How can I convert my old links to this new format?}@*
 @c
 Execute once in each Org-mode file: @kbd{M-x org-upgrade-old-links}.
-The replaces angular brackets with the link format.
+This replaces angular brackets with the new link format.
 
 @item @b{I don't care if you find the new bracket links great, I am
 attached to the old style using angular brackets and no hiding of the
@@ -3890,6 +3909,9 @@
 @item
 Kevin Rogers contributed code to access VM files on remote hosts.
 @item
+Frank Ruell solved the mystery of the @code{keymapp nil} bug, a conflict
+with @file{allout.el}.
+@item
 Philip Rooke created the Org-mode reference card and provided lots of feedback.
 @item
 Christian Schlauer proposed angular brackets around links, among other
--- a/man/pgg.texi	Fri Apr 21 05:39:14 2006 +0000
+++ b/man/pgg.texi	Tue May 02 05:51:52 2006 +0000
@@ -234,6 +234,14 @@
 Elapsed time for expiration in seconds.
 @end defvar
 
+@defvar pgg-gpg-use-agent
+When using GnuPG (gpg) as PGP scheme you can use @code{gpg-agent} for
+caching@footnote{Actually @code{gpg-agent} does not cache passphrases
+but private keys.  On the other hand, from a users point of view this
+technical difference isn't visible.}.  If non-@code{nil} try to use a
+running @code{gpg-agent}.  It defaults to @code{nil}.
+@end defvar
+
 @node Default user identity
 @section Default user identity
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/man/xresmini.texi	Tue May 02 05:51:52 2006 +0000
@@ -0,0 +1,303 @@
+@c This is part of the Emacs manual.
+@c Copyright (C) 1987, 1993, 1994, 1995, 1997, 2001, 2002, 2003,
+@c   2004, 2005, 2006 Free Software Foundation, Inc.
+@c See file emacs.texi for copying conditions.
+@node X Resources, Antinews, Emacs Invocation, Top
+@appendix X Options and Resources
+
+  You can customize some X-related aspects of Emacs behavior using X
+resources, as is usual for programs that use X.  On MS-Windows, you
+can customize some of the same aspects using the system registry.
+@xref{MS-Windows Registry}.  Likewise, Emacs on MacOS Carbon emulates X
+resources using the Preferences system.  @xref{Mac Environment Variables}.
+
+  When Emacs is built using an ``X toolkit'', such as Lucid or
+LessTif, you need to use X resources to customize the appearance of
+the widgets, including the menu-bar, scroll-bar, and dialog boxes.
+This is because the libraries that implement these don't provide for
+customization through Emacs.  GTK+ widgets use a separate system of
+``GTK resources''.  In this chapter we describe the most commonly used
+resource specifications.  For full documentation, see the online
+manual.
+
+@c Add xref for LessTif/Motif menu resources.
+
+@menu
+* Resources::           Using X resources with Emacs (in general).
+* Table of Resources::  Table of specific X resources that affect Emacs.
+* Face Resources::      X resources for customizing faces.
+* Lucid Resources::     X resources for Lucid menus.
+* GTK resources::       Resources for GTK widgets.
+@end menu
+
+@node Resources
+@appendixsec X Resources
+@cindex resources
+@cindex X resources
+@cindex @file{~/.Xdefaults} file
+@cindex @file{~/.Xresources} file
+
+  Programs running under the X Window System organize their user
+options under a hierarchy of classes and resources.  You can specify
+default values for these options in your X resources file, usually
+named @file{~/.Xdefaults} or @file{~/.Xresources}.
+If changes in @file{~/.Xdefaults} do not
+take effect, it is because your X server stores its own list of
+resources; to update them, use the shell command @command{xrdb}---for
+instance, @samp{xrdb ~/.Xdefaults}.
+
+  Each line in the file specifies a value for one option or for a
+collection of related options, for one program or for several programs
+(optionally even for all programs).
+
+@cindex Registry (MS-Windows)
+  MS-Windows systems don't support @file{~/.Xdefaults} files, but
+Emacs compiled for Windows looks for X resources in the Windows
+Registry, under the key @samp{HKEY_CURRENT_USER\SOFTWARE\GNU\Emacs}
+and then under the key @samp{HKEY_LOCAL_MACHINE\SOFTWARE\GNU\Emacs}.
+The menu and scrollbars are native widgets on MS-Windows, so they are
+only customizable via the system-wide settings in the Display Control
+Panel.  You can also set resources using the @samp{-xrm} command line
+option (see below.)
+
+  Applications such as Emacs look for resources with specific names
+and their particular meanings.  Case distinctions are significant in
+these names.  Each resource specification in @file{~/.Xdefaults}
+states the name of the program and the name of the resource.  For
+Emacs, the program name is @samp{Emacs}.  It looks like this:
+
+@example
+Emacs.borderWidth: 2
+@end example
+
+  The order in which the lines appear in the file does not matter.
+Also, command-line options always override the X resources file.
+
+  You can experiment with the effect of different resource settings
+with the @code{editres} program.  Select @samp{Get Tree} from the
+@samp{Commands} menu, then click on an Emacs frame.  This will display
+a tree showing the structure of X toolkit widgets used in an Emacs
+frame.  Select one of them, such as @samp{menubar}, then select
+@samp{Show Resource Box} from the @samp{Commands} menu.  This displays
+a list of all the meaningful X resources for that widget, and allows
+you to edit them.  Changes take effect when you click on the
+@samp{Apply} button.  (See the @code{editres} man page for more
+details.)
+
+@node Table of Resources
+@appendixsec Table of X Resources for Emacs
+
+  This table lists the resource names that designate options for
+Emacs, not counting those for the appearance of the menu bar, each
+with the class that it belongs to:
+
+@table @asis
+@item @code{background} (class @code{Background})
+Background color name.
+
+@item @code{borderColor} (class @code{BorderColor})
+Color name for the external border.
+
+@item @code{cursorColor} (class @code{Foreground})
+Color name for text cursor (point).
+
+@item @code{font} (class @code{Font})
+Font name (or fontset name, @pxref{Fontsets}) for @code{default} font.
+
+@item @code{foreground} (class @code{Foreground})
+Color name for text.
+
+@item @code{geometry} (class @code{Geometry})
+Window size and position.  Be careful not to specify this resource as
+@samp{emacs*geometry}, because that may affect individual menus as well
+as the Emacs frame itself.
+
+If this resource specifies a position, that position applies only to the
+initial Emacs frame (or, in the case of a resource for a specific frame
+name, only that frame).  However, the size, if specified here, applies to
+all frames.
+
+@item @code{iconName} (class @code{Title})
+Name to display in the icon.
+
+@item @code{internalBorder} (class @code{BorderWidth})
+Width in pixels of the internal border.
+
+@item @code{lineSpacing} (class @code{LineSpacing})
+@cindex line spacing
+@cindex leading
+Additional space (@dfn{leading}) between lines, in pixels.
+
+@item @code{menuBar} (class @code{MenuBar})
+@cindex menu bar
+Give frames menu bars if @samp{on}; don't have menu bars if
+@samp{off}.  @xref{Lucid Resources}, and @ref{LessTif Resources}, for
+how to control the appearance of the menu bar if you have one.
+
+@item @code{pointerColor} (class @code{Foreground})
+Color of the mouse cursor.
+
+@item @code{screenGamma} (class @code{ScreenGamma})
+@cindex gamma correction
+Gamma correction for colors, equivalent to the frame parameter
+@code{screen-gamma}.
+
+@item @code{title} (class @code{Title})
+Name to display in the title bar of the initial Emacs frame.
+
+@item @code{toolBar} (class @code{ToolBar})
+@cindex tool bar
+Number of lines to reserve for the tool bar.  A zero value suppresses
+the tool bar.  If the value is non-zero and
+@code{auto-resize-tool-bars} is non-@code{nil}, the tool bar's size
+will be changed automatically so that all tool bar items are visible.
+
+@item @code{useXIM} (class @code{UseXIM})
+@cindex XIM
+@cindex X input methods
+@cindex input methods, X
+Turn off use of X input methods (XIM) if @samp{false} or @samp{off}.
+This is only relevant if your Emacs is actually built with XIM
+support.  It is potentially useful to turn off XIM for efficiency,
+especially slow X client/server links.
+
+@item @code{verticalScrollBars} (class @code{ScrollBars})
+Give frames scroll bars if @samp{on}; don't have scroll bars if
+@samp{off}.
+@end table
+
+@node Face Resources
+@appendixsec X Resources for Faces
+
+  You can use resources to customize the appearance of particular
+faces (@pxref{Faces}):
+
+@table @code
+@item @var{face}.attributeForeground
+Foreground color for face @var{face}.
+@item @var{face}.attributeBackground
+Background color for face @var{face}.
+@item @var{face}.attributeUnderline
+Underline flag for face @var{face}.  Use @samp{on} or @samp{true} for
+yes.
+@item @var{face}.attributeStrikeThrough
+@itemx @var{face}.attributeOverline
+@itemx @var{face}.attributeBox
+@itemx @var{face}.attributeInverse
+Likewise, for other boolean font attributes.
+@item @var{face}.attributeStipple
+The name of a pixmap data file to use for the stipple pattern, or
+@code{false} to not use stipple for the face @var{face}.
+@item @var{face}.attributeBackgroundPixmap
+The background pixmap for the face @var{face}.  Should be a name of a
+pixmap file or @code{false}.
+@item @var{face}.attributeFont
+Font name (full XFD name or valid X abbreviation) for face @var{face}.
+Instead of this, you can specify the font through separate attributes.
+@end table
+
+  Instead of using @code{attributeFont} to specify a font name, you can
+select a font through these separate attributes:
+
+@table @code
+@item @var{face}.attributeFamily
+Font family for face @var{face}.
+@item @var{face}.attributeHeight
+Height of the font to use for face @var{face}: either an integer
+specifying the height in units of 1/10@dmn{pt}, or a floating point
+number that specifies a scale factor to scale the underlying face's
+default font, or a function to be called with the default height which
+will return a new height.
+@item @var{face}.attributeWidth
+@itemx @var{face}.attributeWeight
+@itemx @var{face}.attributeSlant
+Each of these resources corresponds to a like-named font attribute,
+and you write the resource value the same as the symbol you would use
+for the font attribute value.
+@item @var{face}.attributeBold
+Bold flag for face @var{face}---instead of @code{attributeWeight}.  Use @samp{on} or @samp{true} for
+yes.
+@item @var{face}.attributeItalic
+Italic flag for face @var{face}---instead of @code{attributeSlant}.
+@end table
+
+@node Lucid Resources
+@appendixsec Lucid Menu X Resources
+@cindex Menu X Resources (Lucid widgets)
+@cindex Lucid Widget X Resources
+
+  If the Emacs installed at your site was built to use the X toolkit
+with the Lucid menu widgets, then the menu bar is a separate widget
+and has its own resources.  The resource specifications start with
+@samp{Emacs.pane.menubar}---for instance, to specify the font
+@samp{8x16} for the menu-bar items, write this:
+
+@example
+Emacs.pane.menubar.font:  8x16
+@end example
+
+@noindent
+Resources for @emph{non-menubar} toolkit pop-up menus have
+@samp{menu*} instead of @samp{pane.menubar}.  For example, to specify
+the font @samp{8x16} for the pop-up menu items, write this:
+
+@example
+Emacs.menu*.font:	8x16
+@end example
+
+@noindent
+For dialog boxes, use @samp{dialog*}:
+
+@example
+Emacs.dialog*.font:	8x16
+@end example
+
+@noindent
+The Lucid menus can display multilingual text in your locale.  For
+more information about fontsets see the man page for
+@code{XCreateFontSet}.  To enable multilingual menu text you specify a
+@code{fontSet} resource instead of the font resource.  If both
+@code{font} and @code{fontSet} resources are specified, the
+@code{fontSet} resource is used.
+
+  Thus, to specify @samp{-*-helvetica-medium-r-*--*-120-*-*-*-*-*-*,*}
+for both the popup and menu bar menus, write this:
+
+@example
+Emacs*menu*fontSet:  -*-helvetica-medium-r-*--*-120-*-*-*-*-*-*,*
+@end example
+
+@noindent
+The @samp{*menu*} as a wildcard matches @samp{pane.menubar} and
+@samp{menu@dots{}}.
+
+  Experience shows that on some systems you may need to add
+@samp{shell.}@: before the @samp{pane.menubar} or @samp{menu*}.  On
+some other systems, you must not add @samp{shell.}.  The generic wildcard
+approach should work on both kinds of systems.
+
+  Here is a list of the specific resources for menu bars and pop-up menus:
+
+@table @code
+@item font
+Font for menu item text.
+@item fontSet
+Fontset for menu item text.
+@item foreground
+Color of the foreground.
+@item background
+Color of the background.
+@item buttonForeground
+In the menu bar, the color of the foreground for a selected item.
+@item margin
+The margin of the menu bar, in characters.  Default is 1.
+@end table
+
+@node GTK resources
+@appendixsec GTK resources
+
+@c  Waiting for contents
+
+@ignore
+   arch-tag: e1856f29-2482-42c0-a990-233cdccd1f21
+@end ignore
--- a/man/xresources.texi	Fri Apr 21 05:39:14 2006 +0000
+++ b/man/xresources.texi	Tue May 02 05:51:52 2006 +0000
@@ -301,12 +301,10 @@
 @node Face Resources
 @appendixsec X Resources for Faces
 
-  You can also use resources to customize the appearance of particular
+  You can use resources to customize the appearance of particular
 faces (@pxref{Faces}):
 
 @table @code
-@item @var{face}.attributeFont
-Font for face @var{face}.
 @item @var{face}.attributeForeground
 Foreground color for face @var{face}.
 @item @var{face}.attributeBackground
@@ -314,49 +312,45 @@
 @item @var{face}.attributeUnderline
 Underline flag for face @var{face}.  Use @samp{on} or @samp{true} for
 yes.
+@item @var{face}.attributeStrikeThrough
+@itemx @var{face}.attributeOverline
+@itemx @var{face}.attributeBox
+@itemx @var{face}.attributeInverse
+Likewise, for other boolean font attributes.
+@item @var{face}.attributeStipple
+The name of a pixmap data file to use for the stipple pattern, or
+@code{false} to not use stipple for the face @var{face}.
+@item @var{face}.attributeBackgroundPixmap
+The background pixmap for the face @var{face}.  Should be a name of a
+pixmap file or @code{false}.
+@item @var{face}.attributeFont
+Font name (full XFD name or valid X abbreviation) for face @var{face}.
+Instead of this, you can specify the font through separate attributes.
+@end table
+
+  Instead of using @code{attributeFont} to specify a font name, you can
+select a font through these separate attributes:
+
+@table @code
 @item @var{face}.attributeFamily
 Font family for face @var{face}.
-@item @var{face}.attributeWidth
-Relative proportional width of the font to use for face @var{face}.
-It should be one of @code{ultra-condensed}, @code{extra-condensed},
-@code{condensed}, @code{semi-condensed}, @code{normal},
-@code{semi-expanded}, @code{expanded}, @code{extra-expanded}, or
-@code{ultra-expanded}.
 @item @var{face}.attributeHeight
 Height of the font to use for face @var{face}: either an integer
 specifying the height in units of 1/10@dmn{pt}, or a floating point
 number that specifies a scale factor to scale the underlying face's
 default font, or a function to be called with the default height which
 will return a new height.
-@item @var{face}.attributeWeight
-A weight to use for the face @var{face}.  It must be one of
-@code{ultra-bold}, @code{extra-bold}, @code{bold},
-@code{semi-bold}, @code{normal}, @code{semi-light}, @code{light},
-@code{extra-light}, @code{ultra-light}.
-@item @var{face}.attributeSlant
-The slant to use for the font of face @var{face}.  It must be one of
-@code{italic}, @code{oblique}, @code{normal},
-@code{reverse-italic}, or @code{reverse-oblique}.
-@item @var{face}.attributeStrikeThrough
-Whether the face @var{face} should be drawn with a line striking
-through the characters.
-@item @var{face}.attributeOverline
-Whether the characters in the face @var{face} should be overlined.
-@item @var{face}.attributeBox
-Whether to draw a box around the characters in face @var{face}.
-@item @var{face}.attributeInverse
-Whether to display the characters in face @var{face} in inverse
-video.
-@item @var{face}.attributeStipple
-The name of a pixmap data file to use for the stipple pattern, or
-@code{false} to not use stipple for the face @var{face}.
-@item @var{face}.attributeBackgroundPixmap
-The background pixmap for the face @var{face}.  Should be a name of a
-pixmap file or @code{false}.
+@item @var{face}.attributeWidth
+@itemx @var{face}.attributeWeight
+@itemx @var{face}.attributeSlant
+Each of these resources corresponds to a like-named font attribute,
+and you write the resource value the same as the symbol you would use
+for the font attribute value.
 @item @var{face}.attributeBold
-Whether to draw the characters in the face @var{face} as bold.
+Bold flag for face @var{face}---instead of @code{attributeWeight}.  Use @samp{on} or @samp{true} for
+yes.
 @item @var{face}.attributeItalic
-Whether to draw the characters in the face @var{face} as italic.
+Italic flag for face @var{face}---instead of @code{attributeSlant}.
 @end table
 
 @node Lucid Resources
--- a/src/.gdbinit	Fri Apr 21 05:39:14 2006 +0000
+++ b/src/.gdbinit	Tue May 02 05:51:52 2006 +0000
@@ -88,15 +88,13 @@
 # Print out s-expressions from tool bar
 define pp1
   set $tmp = $arg0
-  echo $arg0
-  printf " = "
   set $output_debug = print_output_debug_flag
   set print_output_debug_flag = 0
   set safe_debug_print ($tmp)
   set print_output_debug_flag = $output_debug
 end
 document pp1
-Print the argument as an emacs s-expression
+Print the argument as an emacs s-expression.
 Works only when an inferior emacs is executing.
 For use on tool bar when debugging in Emacs
 where the variable name would not otherwise
@@ -119,8 +117,6 @@
 # Print value of lisp variable
 define pv1
   set $tmp = "$arg0"
-  echo $arg0
-  printf " = "
   set $output_debug = print_output_debug_flag
   set print_output_debug_flag = 0
   set safe_debug_print (find_symbol_value (intern ($tmp)))
@@ -129,9 +125,8 @@
 document pv1
 Print the value of the lisp variable given as argument.
 Works only when an inferior emacs is executing.
-For use on tool bar when debugging in Emacs
-where the variable name would not otherwise
-be recorded in the GUD buffer.
+For use when debugging in Emacs where the variable
+name would not otherwise be recorded in the GUD buffer.
 end
 
 # Print out current buffer point and boundaries
--- a/src/ChangeLog	Fri Apr 21 05:39:14 2006 +0000
+++ b/src/ChangeLog	Tue May 02 05:51:52 2006 +0000
@@ -1,11 +1,172 @@
+2006-05-02  Andreas Schwab  <schwab@suse.de>
+
+	* xmenu.c (restore_menu_items): Return a value.
+
+2006-05-01  Martin Rudalics  <rudalics@gmx.at>
+
+	* syntax.c (Fforward_comment): Detect generic comment at beginning of
+	buffer when moving backwards.
+
+2006-05-01  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+	* dispnew.c (update_window): Don't set changed_p when mode/header
+	line is updated.
+
+	* xdisp.c (prepare_menu_bars) [MAC_OS]: Call mac_update_title_bar.
+	(get_glyph_face_and_encoding, get_char_face_and_encoding):
+	Don't distinguish known faces from others.
+
+	* mac.c (mac_coerce_file_name_ptr): Try typeFSRef if coercion
+	through typeFileURL failed.
+
+	* macfns.c (mac_update_title_bar): New function.
+	[TARGET_API_MAC_CARBON] (mac_update_proxy_icon): New function.
+	(show_hourglass, hide_hourglass) [USE_CG_DRAWING]:
+	Call mac_prepare_for_quickdraw.
+
+	* macgui.h (USE_ATSUI): Set default to 1 if MAC_OSX is defined.
+	(USE_CG_DRAWING): Don't define if compiled on Mac OS X 10.1.
+	(enum pcm_status): New enum.
+	(XCHARSTRUCTROW_CHAR_VALID_P, XCHARSTRUCTROW_SET_CHAR_VALID)
+	(XCharStructRow): Remove.  Now validity is represented by
+	non-negativeness of sum of ascent and descent.
+	(struct MacFontStruct): Change type of member `rows'.
+	(struct _XGC) [USE_CG_DRAWING]: Add member `clip_rects'.
+
+	* macterm.c (mac_draw_line, mac_draw_line_to_pixmap):
+	Adjust endpoints of strictly horizontal/vertical lines.
+	(mac_set_clip_rectangles) [USE_CG_DRAWING]: Set clip_rects.
+	(pcm_init, pcm_get_status): New functions.
+	(x_per_char_metric, XLoadQueryFont): Use them instead of
+	XCharStructRow and related macros.
+	(x_draw_relief_rect): Don't adjust arguments of mac_draw_line.
+	(x_free_frame_resources) [TARGET_API_MAC_CARBON]: Free FRAME_FILE_NAME.
+	(XTread_socket) [TARGET_API_MAC_CARBON]: Handle proxy icon drag
+	and window path pop-up menu on title bar.
+	(mac_use_core_graphics) [USE_CG_DRAWING]: Set default to 1.
+
+	* macterm.h (mac_update_title_bar): Add extern.
+	(struct mac_output) [TARGET_API_MAC_CARBON]: New member `file_name'.
+	(FRAME_FILE_NAME): New macro.
+
+	* unexmacosx.c (unexec): Error if trying unexec from dumped executable.
+
+2006-04-30  Richard Stallman  <rms@gnu.org>
+
+	* keymap.c (Fdefine_key): Improve error message
+	when KEY begins with a non-prefix key.
+
+2006-04-30  Martin Rudalics  <rudalics@gmx.at>
+
+	* syntax.c (Fforward_comment): Don't forget to break out of the loop
+	when we skipped backward over a generic comment.
+
+2006-04-27  Nick Roberts  <nickrob@snap.net.nz>
+
+	* .gdbinit (pp1, pv1): Only print value as expression is now
+	printed out by gud-print.
+	(pv1): Correct doc string.
+
+2006-04-26  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* keymap.c (store_in_keymap): Change `def' arg to not be `register'.
+	Seems to trigger a bug in gcc-amd64 4.0.2 20051125 (Red Hat 4.0.2-8):
+	keymap.c:895: error: address of register variable `def' requested.
+
+2006-04-26  Jason Rumney  <jasonr@gnu.org>
+
+	* w32term.c (construct_mouse_wheel): Handle negative coordinates.
+
+	* w32fns.c (w32_wnd_proc) <WM_LBUTTONDOWN, WM_RBUTTONDOWN>:
+	<WM_LBUTTONUP, WM_RBUTTONUP>: Call signal_user_input in the cases
+	where we preempt mouse_button_timer.
+
+2006-04-25  Miles Bader  <miles@gnu.org>
+
+	* editfns.c (Ffield_beginning, find_field): Undo change of 2006-04-23.
+
+2006-04-24  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* process.h: Include headers for pid_t.
+
+2006-04-24  Kim F. Storm  <storm@cua.dk>
+
+	* xdisp.c (fill_stretch_glyph_string): Set s->nchars = 1 for code which
+	does last_glyph=s->first_glyph+s->nchars-1, e.g. if stretch has relief.
+	(produce_stretch_glyph): Assume that face box height and width is
+	already	included in stretch glyph size so caller doesn't have to
+	consider the extra space otherwise added (fixes problem in ses.el).
+
+	* frame.c (x_set_font): Clear f->n_tool_bar_rows and current frame
+	matrices to force recalculation of tool-bar height after font change.
+
+	* xdisp.c (tool_bar_lines_needed): New local `temp_row' for clarity.
+	Clear it when done, so we don't accidentally draw a second copy of
+	the tool-bar after resetting f->n_tool_bar_rows.
+	(redisplay_tool_bar): Update tool-bar-lines frame parameter whenever
+	we recalculate f->n_tool_bar_rows.
+
+2006-04-23  Lars Hansen  <larsh@soem.dk>
+
+	* editfns.c (find_field): Fix comment.
+	(Ffield_beginning): Fix bug when POS is at field beginning.
+
+2006-04-22  Eli Zaretskii  <eliz@gnu.org>
+
+	* puresize.h (BASE_PURESIZE): Increase to 1205000.
+
+2006-04-21  Kim F. Storm  <storm@cua.dk>
+
+	* xdisp.c (redisplay_window): Fix last change.  Don't recenter if
+	window start is at BEGV.
+
+	* dispextern.h (struct image): New member `corners'.
+	(TOP_CORNER, LEFT_CORNER, BOT_CORNER, RIGHT_CORNER): New macros.
+
+	* image.c (four_corners_best): New arg CORNERS specifies what pixels
+	to look at in case image has margin.
+	(x_create_bitmap_mask): Pass NULL for CORNERS to four_corners_best.
+	(image_background, image_background_transparent)
+	(x_build_heuristic_mask): Pass img->corners to four_corners_best.
+	(gif_load): Set img->corners according to image's margin spec.
+	Use img->corners values directly where applicable.
+	Save image extension data in img->data.lisp_val.
+	(gif_clear_image): New function to free img->data.lisp_val.
+	(gif_type): Use it instead of generic x_clear_image.
+	(Fimage_extension_data): New defun.
+	(syms_of_image): Defsubr it.
+
+2006-04-21  John Sullivan  <john@wjsullivan.net>  (tiny change)
+
+	* window.c (Fdisplay_buffer): Doc fix.
+
+2006-04-21  Eli Zaretskii  <eliz@gnu.org>
+
+	* s/ms-w32.h (SYSTEM_PURESIZE_EXTRA): Increase to 25000.
+
+2006-04-21  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+	* image.c [MAC_OS] (xpm_load_image): Fill in background field
+	while we have ximg handy.
+
+	* macmenu.c (restore_menu_items, save_menu_items): New functions
+	from xmenu.c.
+	(set_frame_menubar, digest_single_submenu): Apply 2006-04-18
+	changes for xmenu.c.
+
+	* macterm.c (x_per_char_metric): Return NULL if glyph width is 0.
+	(add_mac_font_name): New function.
+	(init_font_name_table): Use it.  Adopt the first found font from
+	those having the same family name.
+
 2006-04-21  Nick Roberts  <nickrob@snap.net.nz>
 
 	* xdisp.c (note_mouse_highlight): Use build_string.
 
 2006-04-20  Lars Hansen  <larsh@soem.dk>
 
-	* textprop.c (Fremove_list_of_text_properties): Ensure
-	modify_region is called only when buffer is modified and that
+	* textprop.c (Fremove_list_of_text_properties):
+	Ensure modify_region is called only when buffer is modified and that
 	signal_after_change is allways called in that case.
 
 	* print.c (PRINTFINISH): Call signal_after_change.
@@ -23,8 +184,8 @@
 
 	* 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.
+	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.
 
@@ -51,8 +212,8 @@
 
 	* 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.
+	(XLoadQueryFont, mac_store_apple_event): Don't check return value
+	of xmalloc.
 
 2006-04-17  Kim F. Storm  <storm@cua.dk>
 
@@ -96,8 +257,7 @@
 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.
+	(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.
 
@@ -197,8 +357,8 @@
 	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'.
+	* 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)
 
@@ -907,11 +1067,6 @@
 	(mac_set_clip_rectangles): When resetting clip region, make it
 	empty instead of disposing of it.
 
-2006-02-20  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-	* keymap.c (store_in_keymap): Change `def' arg to not be `register'.
-	Seems to trigger a bug in gcc-amd64 4.0.2 20051125 (Red Hat 4.0.2-8).
-
 2006-02-20  Kim F. Storm  <storm@cua.dk>
 
 	* Makefile.in: Add fringe.elc to WINDOW_SUPPORT.
@@ -1586,7 +1741,7 @@
 
 	* image.c [MAC_OS] (find_image_fsspec): Likewise.
 
-2005-12-23  Martin Rudalics  <rudalics@gmx.at>  (tiny change)
+2005-12-23  Martin Rudalics  <rudalics@gmx.at>
 
 	* insdel.c (insert, insert_and_inherit, insert_before_markers)
 	(insert_before_markers_and_inherit): Make sure FROM is correct
--- a/src/dispextern.h	Fri Apr 21 05:39:14 2006 +0000
+++ b/src/dispextern.h	Tue May 02 05:51:52 2006 +0000
@@ -2417,6 +2417,15 @@
 #define DEFAULT_IMAGE_WIDTH 30
 #define DEFAULT_IMAGE_HEIGHT 30
 
+  /* Top/left and bottom/right corner pixel of actual image data.
+     Used by four_corners_best to consider the real image data,
+     rather than looking at the optional image margin.  */
+  int corners[4];
+#define TOP_CORNER 0
+#define LEFT_CORNER 1
+#define BOT_CORNER 2
+#define RIGHT_CORNER 3
+
   /* Percent of image height used as ascent.  A value of
      CENTERED_IMAGE_ASCENT means draw the image centered on the
      line.  */
--- a/src/dispnew.c	Fri Apr 21 05:39:14 2006 +0000
+++ b/src/dispnew.c	Tue May 02 05:51:52 2006 +0000
@@ -4142,7 +4142,6 @@
 	  update_window_line (w, MATRIX_ROW_VPOS (mode_line_row,
 						  desired_matrix),
 			      &mouse_face_overwritten_p);
-	  changed_p = 1;
 	}
 
       /* Find first enabled row.  Optimizations in redisplay_internal
@@ -4212,7 +4211,6 @@
 	{
 	  header_line_row->y = 0;
 	  update_window_line (w, 0, &mouse_face_overwritten_p);
-	  changed_p = 1;
 	}
 
       /* Fix the appearance of overlapping/overlapped rows.  */
--- a/src/editfns.c	Fri Apr 21 05:39:14 2006 +0000
+++ b/src/editfns.c	Tue May 02 05:51:52 2006 +0000
@@ -489,7 +489,7 @@
 }
 
 /* Find the field surrounding POS in *BEG and *END.  If POS is nil,
-   the value of point is used instead.  If BEG or END null,
+   the value of point is used instead.  If BEG or END is null,
    means don't store the beginning or end of the field.
 
    BEG_LIMIT and END_LIMIT serve to limit the ranged of the returned
--- a/src/frame.c	Fri Apr 21 05:39:14 2006 +0000
+++ b/src/frame.c	Tue May 02 05:51:52 2006 +0000
@@ -1,5 +1,5 @@
 /* Generic frame functions.
-   Copyright (C) 1993, 1994, 1995, 1997, 1999, 2000, 2001, 2002, 2003,
+   Copyright (C) 1993, 1994, 1995, 1997, 1999, 2000, 2001, 2002, 2003, 2006,
                  2004, 2005, 2006 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
@@ -3093,9 +3093,15 @@
 	    return;
 	}
       store_frame_param (f, Qfont, result);
+
       if (!NILP (Fequal (result, oldval)))
         return;
 
+      /* Recalculate toolbar height.  */
+      f->n_tool_bar_rows = 0;
+      /* Ensure we redraw it.  */
+      clear_current_matrices (f);
+
       recompute_basic_faces (f);
     }
   else
--- a/src/image.c	Fri Apr 21 05:39:14 2006 +0000
+++ b/src/image.c	Tue May 02 05:51:52 2006 +0000
@@ -603,7 +603,9 @@
 /* Useful functions defined in the section
    `Image type independent image structures' below. */
 
-static unsigned long four_corners_best P_ ((XImagePtr ximg, unsigned long width,
+static unsigned long four_corners_best P_ ((XImagePtr ximg,
+					    int *corners,
+					    unsigned long width,
 					    unsigned long height));
 
 static int x_create_x_image_and_pixmap P_ ((struct frame *f, int width, int height,
@@ -657,7 +659,7 @@
       return -1;
     }
 
-  bg = four_corners_best (ximg, width, height);
+  bg = four_corners_best (ximg, NULL, width, height);
 
   for (y = 0; y < ximg->height; ++y)
     {
@@ -732,7 +734,7 @@
 /* Keywords.  */
 
 extern Lisp_Object QCwidth, QCheight, QCforeground, QCbackground, QCfile;
-extern Lisp_Object QCdata, QCtype;
+extern Lisp_Object QCdata, QCtype, Qcount;
 extern Lisp_Object Qcenter;
 Lisp_Object QCascent, QCmargin, QCrelief;
 Lisp_Object QCconversion, QCcolor_symbols, QCheuristic_mask;
@@ -1141,6 +1143,27 @@
   return mask;
 }
 
+DEFUN ("image-extension-data", Fimage_extension_data, Simage_extension_data, 1, 2, 0,
+       doc: /* Return extension data for image SPEC.
+FRAME is the frame on which the image will be displayed.  FRAME nil
+or omitted means use the selected frame.  */)
+     (spec, frame)
+     Lisp_Object spec, frame;
+{
+  Lisp_Object ext;
+
+  ext = Qnil;
+  if (valid_image_p (spec))
+    {
+      struct frame *f = check_x_frame (frame);
+      int id = lookup_image (f, spec);
+      struct image *img = IMAGE_FROM_ID (f, id);
+      ext = img->data.lisp_val;
+    }
+
+  return ext;
+}
+
 
 /***********************************************************************
 		 Image type independent image structures
@@ -1171,6 +1194,7 @@
   img->data.lisp_val = Qnil;
   img->ascent = DEFAULT_IMAGE_ASCENT;
   img->hash = hash;
+  img->corners[BOT_CORNER] = -1;  /* Full image */
   return img;
 }
 
@@ -1322,30 +1346,41 @@
    On W32, XIMG is assumed to a device context with the bitmap selected.  */
 
 static RGB_PIXEL_COLOR
-four_corners_best (ximg, width, height)
+four_corners_best (ximg, corners, width, height)
      XImagePtr_or_DC ximg;
+     int *corners;
      unsigned long width, height;
 {
-  RGB_PIXEL_COLOR corners[4], best;
+  RGB_PIXEL_COLOR corner_pixels[4], best;
   int i, best_count;
 
-  /* Get the colors at the corners of ximg.  */
-  corners[0] = GET_PIXEL (ximg, 0, 0);
-  corners[1] = GET_PIXEL (ximg, width - 1, 0);
-  corners[2] = GET_PIXEL (ximg, width - 1, height - 1);
-  corners[3] = GET_PIXEL (ximg, 0, height - 1);
-
+  if (corners && corners[BOT_CORNER] >= 0)
+    {
+      /* Get the colors at the corner_pixels of ximg.  */
+      corner_pixels[0] = GET_PIXEL (ximg, corners[LEFT_CORNER], corners[TOP_CORNER]);
+      corner_pixels[1] = GET_PIXEL (ximg, corners[RIGHT_CORNER] - 1, corners[TOP_CORNER]);
+      corner_pixels[2] = GET_PIXEL (ximg, corners[RIGHT_CORNER] - 1, corners[BOT_CORNER] - 1);
+      corner_pixels[3] = GET_PIXEL (ximg, corners[LEFT_CORNER], corners[BOT_CORNER] - 1);
+    }
+  else
+    {
+      /* Get the colors at the corner_pixels of ximg.  */
+      corner_pixels[0] = GET_PIXEL (ximg, 0, 0);
+      corner_pixels[1] = GET_PIXEL (ximg, width - 1, 0);
+      corner_pixels[2] = GET_PIXEL (ximg, width - 1, height - 1);
+      corner_pixels[3] = GET_PIXEL (ximg, 0, height - 1);
+    }
   /* Choose the most frequently found color as background.  */
   for (i = best_count = 0; i < 4; ++i)
     {
       int j, n;
 
       for (j = n = 0; j < 4; ++j)
-	if (corners[i] == corners[j])
+	if (corner_pixels[i] == corner_pixels[j])
 	  ++n;
 
       if (n > best_count)
-	best = corners[i], best_count = n;
+	best = corner_pixels[i], best_count = n;
     }
 
   return best;
@@ -1404,7 +1439,7 @@
 #endif /* !HAVE_NTGUI */
 	}
 
-      img->background = four_corners_best (ximg, img->width, img->height);
+      img->background = four_corners_best (ximg, img->corners, img->width, img->height);
 
       if (free_ximg)
 	Destroy_Image (ximg, prev);
@@ -1449,7 +1484,7 @@
 	    }
 
 	  img->background_transparent
-	    = (four_corners_best (mask, img->width, img->height) == PIX_MASK_RETAIN);
+	    = (four_corners_best (mask, img->corners, img->width, img->height) == PIX_MASK_RETAIN);
 
 	  if (free_mask)
 	    Destroy_Image (mask, prev);
@@ -4460,6 +4495,10 @@
   img->width = width;
   img->height = height;
 
+  /* Maybe fill in the background field while we have ximg handy. */
+  if (NILP (image_spec_value (img->spec, QCbackground, NULL)))
+    IMAGE_BACKGROUND (img, f, ximg);
+
   x_put_x_image (f, ximg, img->pixmap, width, height);
   x_destroy_x_image (ximg);
   if (have_mask)
@@ -5354,7 +5393,7 @@
     }
 
   if (use_img_background)
-    bg = four_corners_best (ximg, img->width, img->height);
+    bg = four_corners_best (ximg, img->corners, img->width, img->height);
 
   /* Set all bits in mask_img to 1 whose color in ximg is different
      from the background color bg.  */
@@ -7447,6 +7486,7 @@
 
 static int gif_image_p P_ ((Lisp_Object object));
 static int gif_load P_ ((struct frame *f, struct image *img));
+static void gif_clear_image P_ ((struct frame *f, struct image *img));
 
 /* The symbol `gif' identifying images of this type.  */
 
@@ -7495,10 +7535,22 @@
   &Qgif,
   gif_image_p,
   gif_load,
-  x_clear_image,
+  gif_clear_image,
   NULL
 };
 
+/* Free X resources of GIF image IMG which is used on frame F.  */
+
+static void
+gif_clear_image (f, img)
+     struct frame *f;
+     struct image *img;
+{
+  /* IMG->data.ptr_val may contain extension data.  */
+  img->data.lisp_val = Qnil;
+  x_clear_image (f, img);
+}
+
 /* Return non-zero if OBJECT is a valid GIF image specification.  */
 
 static int
@@ -7619,7 +7671,7 @@
   GifFileType *gif;
   struct gcpro gcpro1;
   Lisp_Object image;
-  int ino, image_left, image_top, image_width, image_height;
+  int ino, image_height, image_width;
   gif_memory_source memsrc;
   unsigned char *raster;
 
@@ -7696,17 +7748,19 @@
       return 0;
     }
 
-  image_top = gif->SavedImages[ino].ImageDesc.Top;
-  image_left = gif->SavedImages[ino].ImageDesc.Left;
+  img->corners[TOP_CORNER] = gif->SavedImages[ino].ImageDesc.Top;
+  img->corners[LEFT_CORNER] = gif->SavedImages[ino].ImageDesc.Left;
+  image_height = gif->SavedImages[ino].ImageDesc.Height;
+  img->corners[BOT_CORNER] = img->corners[TOP_CORNER] + image_height;
   image_width = gif->SavedImages[ino].ImageDesc.Width;
-  image_height = gif->SavedImages[ino].ImageDesc.Height;
+  img->corners[RIGHT_CORNER] = img->corners[LEFT_CORNER] + image_width;
 
   width = img->width = max (gif->SWidth,
 			    max (gif->Image.Left + gif->Image.Width,
-				 image_left + image_width));
+				 img->corners[RIGHT_CORNER]));
   height = img->height = max (gif->SHeight,
 			      max (gif->Image.Top + gif->Image.Height,
-				   image_top + image_height));
+				   img->corners[BOT_CORNER]));
 
   if (!check_image_size (f, width, height))
     {
@@ -7749,19 +7803,19 @@
      requires more than can be done here (see the gif89 spec,
      disposal methods).  Let's simply assume that the part
      not covered by a sub-image is in the frame's background color.  */
-  for (y = 0; y < image_top; ++y)
+  for (y = 0; y < img->corners[TOP_CORNER]; ++y)
     for (x = 0; x < width; ++x)
       XPutPixel (ximg, x, y, FRAME_BACKGROUND_PIXEL (f));
 
-  for (y = image_top + image_height; y < height; ++y)
+  for (y = img->corners[BOT_CORNER]; y < height; ++y)
     for (x = 0; x < width; ++x)
       XPutPixel (ximg, x, y, FRAME_BACKGROUND_PIXEL (f));
 
-  for (y = image_top; y < image_top + image_height; ++y)
-    {
-      for (x = 0; x < image_left; ++x)
+  for (y = img->corners[TOP_CORNER]; y < img->corners[BOT_CORNER]; ++y)
+    {
+      for (x = 0; x < img->corners[LEFT_CORNER]; ++x)
 	XPutPixel (ximg, x, y, FRAME_BACKGROUND_PIXEL (f));
-      for (x = image_left + image_width; x < width; ++x)
+      for (x = img->corners[RIGHT_CORNER]; x < width; ++x)
 	XPutPixel (ximg, x, y, FRAME_BACKGROUND_PIXEL (f));
     }
 
@@ -7791,8 +7845,8 @@
 	  for (x = 0; x < image_width; x++)
 	    {
 	      int i = raster[(y * image_width) + x];
-	      XPutPixel (ximg, x + image_left, row + image_top,
-			 pixel_colors[i]);
+	      XPutPixel (ximg, x + img->corners[LEFT_CORNER],
+			 row + img->corners[TOP_CORNER], pixel_colors[i]);
 	    }
 
 	  row += interlace_increment[pass];
@@ -7804,10 +7858,29 @@
 	for (x = 0; x < image_width; ++x)
 	  {
 	    int i = raster[y * image_width + x];
-	    XPutPixel (ximg, x + image_left, y + image_top, pixel_colors[i]);
+	    XPutPixel (ximg, x + img->corners[LEFT_CORNER],
+		       y + img->corners[TOP_CORNER], pixel_colors[i]);
 	  }
     }
 
+  /* Save GIF image extension data for `image-extension-data'.
+     Format is (count IMAGES FUNCTION "BYTES" ...).  */
+  img->data.lisp_val = Qnil;
+  if (gif->SavedImages[ino].ExtensionBlockCount > 0)
+    {
+      ExtensionBlock *ext = gif->SavedImages[ino].ExtensionBlocks;
+      for (i = 0; i < gif->SavedImages[ino].ExtensionBlockCount; i++, ext++)
+	/* Append (... FUNCTION "BYTES") */
+	img->data.lisp_val = Fcons (make_unibyte_string (ext->Bytes, ext->ByteCount),
+				    Fcons (make_number (ext->Function),
+					   img->data.lisp_val));
+      img->data.lisp_val = Fnreverse (img->data.lisp_val);
+    }
+  if (gif->ImageCount > 1)
+    img->data.lisp_val = Fcons (Qcount,
+				Fcons (make_number (gif->ImageCount),
+				       img->data.lisp_val));
+
   fn_DGifCloseFile (gif);
 
   /* Maybe fill in the background field while we have ximg handy. */
@@ -8553,6 +8626,7 @@
   defsubr (&Sclear_image_cache);
   defsubr (&Simage_size);
   defsubr (&Simage_mask_p);
+  defsubr (&Simage_extension_data);
 
 #if GLYPH_DEBUG
   defsubr (&Simagep);
--- a/src/keymap.c	Fri Apr 21 05:39:14 2006 +0000
+++ b/src/keymap.c	Tue May 02 05:51:52 2006 +0000
@@ -841,7 +841,7 @@
 store_in_keymap (keymap, idx, def)
      Lisp_Object keymap;
      register Lisp_Object idx;
-     register Lisp_Object def;
+     Lisp_Object def;
 {
   /* Flush any reverse-map cache.  */
   where_is_cache = Qnil;
@@ -1226,8 +1226,11 @@
       if (!CONSP (keymap))
 	/* We must use Fkey_description rather than just passing key to
 	   error; key might be a vector, not a string.  */
-	error ("Key sequence %s uses invalid prefix characters",
-	       SDATA (Fkey_description (key, Qnil)));
+	error ("Key sequence %s starts with non-prefix key %s",
+	       SDATA (Fkey_description (key, Qnil)),
+	       SDATA (Fkey_description (Fsubstring (key, make_number (0),
+						    make_number (idx)),
+					Qnil)));
     }
 }
 
--- a/src/mac.c	Fri Apr 21 05:39:14 2006 +0000
+++ b/src/mac.c	Tue May 02 05:51:52 2006 +0000
@@ -448,6 +448,22 @@
 	}
       else
 	err = memFullErr;
+
+      if (err != noErr)
+	{
+	  /* Just to be paranoid ...  */
+	  FSRef fref;
+	  char *buf;
+
+	  buf = xmalloc (data_size + 1);
+	  memcpy (buf, data_ptr, data_size);
+	  buf[data_size] = '\0';
+	  err = FSPathMakeRef (buf, &fref, NULL);
+	  xfree (buf);
+	  if (err == noErr)
+	    err = AECoercePtr (typeFSRef, &fref, sizeof (FSRef),
+			       to_type, result);
+	}
 #else
       FSSpec fs;
       char *buf;
@@ -510,6 +526,34 @@
 			      CFDataGetLength (data), result);
 	  CFRelease (data);
 	}
+
+      if (err != noErr)
+	{
+	  /* Coercion from typeAlias to typeFileURL fails on Mac OS X
+	     10.2.  In such cases, try typeFSRef as a target type.  */
+	  char file_name[MAXPATHLEN];
+
+	  if (type_code == typeFSRef && data_size == sizeof (FSRef))
+	    err = FSRefMakePath (data_ptr, file_name, sizeof (file_name));
+	  else
+	    {
+	      AEDesc desc;
+	      FSRef fref;
+
+	      err = AECoercePtr (type_code, data_ptr, data_size,
+				 typeFSRef, &desc);
+	      if (err == noErr)
+		{
+		  err = AEGetDescData (&desc, &fref, sizeof (FSRef));
+		  AEDisposeDesc (&desc);
+		}
+	      if (err == noErr)
+		err = FSRefMakePath (&fref, file_name, sizeof (file_name));
+	    }
+	  if (err == noErr)
+	    err = AECreateDesc (TYPE_FILE_NAME, file_name,
+				strlen (file_name), result);
+	}
 #else
       char file_name[MAXPATHLEN];
 
@@ -529,11 +573,11 @@
 #else
 	      fs = *(FSSpec *)(*(desc.dataHandle));
 #endif
-	      if (err == noErr)
-		err = fsspec_to_posix_pathname (&fs, file_name,
-						sizeof (file_name) - 1);
 	      AEDisposeDesc (&desc);
 	    }
+	  if (err == noErr)
+	    err = fsspec_to_posix_pathname (&fs, file_name,
+					    sizeof (file_name) - 1);
 	}
       if (err == noErr)
 	err = AECreateDesc (TYPE_FILE_NAME, file_name,
--- a/src/macfns.c	Fri Apr 21 05:39:14 2006 +0000
+++ b/src/macfns.c	Tue May 02 05:51:52 2006 +0000
@@ -1919,6 +1919,100 @@
   x_set_scroll_bar_width (f, arg, oldval);
 }
 
+#if TARGET_API_MAC_CARBON
+static void
+mac_update_proxy_icon (f)
+     struct frame *f;
+{
+  Lisp_Object file_name =
+    XBUFFER (XWINDOW (FRAME_SELECTED_WINDOW (f))->buffer)->filename;
+  Window w = FRAME_MAC_WINDOW (f);
+
+  if (FRAME_FILE_NAME (f) == NULL && !STRINGP (file_name))
+    return;
+  if (FRAME_FILE_NAME (f) && STRINGP (file_name)
+      && strcmp (FRAME_FILE_NAME (f), SDATA (file_name)) == 0)
+    return;
+
+  if (FRAME_FILE_NAME (f))
+    {
+      xfree (FRAME_FILE_NAME (f));
+      FRAME_FILE_NAME (f) = NULL;
+    }
+
+  BLOCK_INPUT;
+
+  if (STRINGP (file_name))
+    {
+      OSStatus err;
+      AEDesc desc;
+      Lisp_Object encoded_file_name = ENCODE_FILE (file_name);
+
+#ifdef MAC_OS8
+      SetPortWindowPort (w);
+#endif
+      err = AECoercePtr (TYPE_FILE_NAME, SDATA (encoded_file_name),
+			 SBYTES (encoded_file_name), typeAlias, &desc);
+      if (err == noErr)
+	{
+	  Size size = AEGetDescDataSize (&desc);
+	  AliasHandle alias = (AliasHandle) NewHandle (size);
+
+	  if (alias == NULL)
+	    err = memFullErr;
+	  else
+	    {
+	      HLock ((Handle) alias);
+	      err = AEGetDescData (&desc, *alias, size);
+	      HUnlock ((Handle) alias);
+	      if (err == noErr)
+		err = SetWindowProxyAlias (w, alias);
+	      DisposeHandle ((Handle) alias);
+	    }
+	  AEDisposeDesc (&desc);
+	}
+      if (err == noErr)
+	{
+	  FRAME_FILE_NAME (f) = xmalloc (SBYTES (file_name) + 1);
+	  strcpy (FRAME_FILE_NAME (f), SDATA (file_name));
+	}
+    }
+
+  if (FRAME_FILE_NAME (f) == NULL)
+    RemoveWindowProxy (w);
+
+  UNBLOCK_INPUT;
+}
+#endif
+
+void
+mac_update_title_bar (f, save_match_data)
+     struct frame *f;
+     int save_match_data;
+{
+#if TARGET_API_MAC_CARBON
+  struct window *w;
+  int modified_p;
+
+  if (!FRAME_MAC_P (f))
+    return;
+
+  w = XWINDOW (FRAME_SELECTED_WINDOW (f));
+  modified_p = (BUF_SAVE_MODIFF (XBUFFER (w->buffer))
+		< BUF_MODIFF (XBUFFER (w->buffer)));
+  if (windows_or_buffers_changed
+      /* Minibuffer modification status shown in the close button is
+	 confusing.  */
+      || (!MINI_WINDOW_P (w)
+	  && (modified_p != !NILP (w->last_had_star))))
+    SetWindowModified (FRAME_MAC_WINDOW (f),
+		       !MINI_WINDOW_P (w) && modified_p);
+
+  if (windows_or_buffers_changed)
+    mac_update_proxy_icon (f);
+#endif
+}
+
 
 /* Subroutines of creating a frame.  */
 
@@ -3470,6 +3564,9 @@
 	  if (FRAME_LIVE_P (f) && FRAME_MAC_P (f)
 	      && FRAME_MAC_WINDOW (f) != tip_window)
 	    {
+#if USE_CG_DRAWING
+	      mac_prepare_for_quickdraw (f);
+#endif
 	      if (!f->output_data.mac->hourglass_control)
 		{
 		  Window w = FRAME_MAC_WINDOW (f);
@@ -3514,7 +3611,12 @@
 	  if (FRAME_MAC_P (f)
 	      /* Watch out for newly created frames.  */
 	      && f->output_data.mac->hourglass_control)
-	    HideControl (f->output_data.mac->hourglass_control);
+	    {
+#if USE_CG_DRAWING
+	      mac_prepare_for_quickdraw (f);
+#endif
+	      HideControl (f->output_data.mac->hourglass_control);
+	    }
 	}
 
       hourglass_shown_p = 0;
--- a/src/macgui.h	Fri Apr 21 05:39:14 2006 +0000
+++ b/src/macgui.h	Tue May 02 05:51:52 2006 +0000
@@ -79,14 +79,26 @@
 #include <Gestalt.h>
 #endif /* not HAVE_CARBON */
 
+/* Whether to use ATSUI (Apple Type Services for Unicode Imaging) for
+   text drawing.  */
+#ifndef USE_ATSUI
+#ifdef MAC_OSX
+#define USE_ATSUI 1
+#endif
+#endif
+
+/* Whether to use low-level Quartz 2D (aka Core Graphics) text drawing
+   in preference to ATSUI for ASCII and Latin-1 characters.  */
 #ifndef USE_CG_TEXT_DRAWING
 #if USE_ATSUI && MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
 #define USE_CG_TEXT_DRAWING 1
 #endif
 #endif
 
+/* Whether to use Quartz 2D routines for drawing operations other than
+   texts.  */
 #ifndef USE_CG_DRAWING
-#if USE_ATSUI && defined (MAC_OSX)
+#if USE_ATSUI && MAC_OS_X_VERSION_MAX_ALLOWED >= 1020
 #define USE_CG_DRAWING 1
 #endif
 #endif
@@ -105,6 +117,8 @@
 
 
 /* Emulate XCharStruct.  */
+/* If the sum of ascent and descent is negative, that means some
+   special status specified by enum pcm_status.  */
 typedef struct _XCharStruct
 {
   short	lbearing;		/* origin to left edge of raster */
@@ -117,6 +131,12 @@
 #endif
 } XCharStruct;
 
+enum pcm_status
+  {
+    PCM_VALID = 0,		/* pcm data is valid */
+    PCM_INVALID = -1,		/* pcm data is invalid */
+  };
+
 #define STORE_XCHARSTRUCT(xcs, w, bds)			\
   ((xcs).width = (w),					\
    (xcs).lbearing = (bds).left,				\
@@ -124,18 +144,6 @@
    (xcs).ascent = -(bds).top,				\
    (xcs).descent = (bds).bottom)
 
-typedef struct
-{
-  char valid_bits[0x100 / 8];
-  XCharStruct per_char[0x100];
-} XCharStructRow;
-
-#define XCHARSTRUCTROW_CHAR_VALID_P(row, byte2) \
-  ((row)->valid_bits[(byte2) / 8] & (1 << (byte2) % 8))
-
-#define XCHARSTRUCTROW_SET_CHAR_VALID(row, byte2) \
-  ((row)->valid_bits[(byte2) / 8] |= (1 << (byte2) % 8))
-
 struct MacFontStruct {
   char *full_name;
 
@@ -175,7 +183,7 @@
   XCharStruct max_bounds;  /* maximum bounds over all existing char */
   union {
     XCharStruct *per_char; /* first_char to last_char information */
-    XCharStructRow **rows; /* first row to last row information */
+    XCharStruct **rows;    /* first row to last row information */
   } bounds;
   int ascent;              /* logical extent above baseline for spacing */
   int descent;             /* logical decent below baseline for spacing */
@@ -229,7 +237,7 @@
   /* QuickDraw clipping region.  Ignored if n_clip_rects == 0.  */
   RgnHandle clip_region;
 
-#if defined (MAC_OSX) && USE_ATSUI
+#if defined (MAC_OSX) && (USE_ATSUI || USE_CG_DRAWING)
   /* Clipping rectangles used in Quartz 2D drawing.  The y-coordinate
      is in QuickDraw's.  */
   CGRect clip_rects[MAX_CLIP_RECTS];
--- a/src/macmenu.c	Fri Apr 21 05:39:14 2006 +0000
+++ b/src/macmenu.c	Tue May 02 05:51:52 2006 +0000
@@ -303,6 +303,37 @@
     }
 }
 
+/* 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_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 (menu_items,
+			     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 = Qnil;
+}
+
 /* Make the menu_items vector twice as large.  */
 
 static void
@@ -313,6 +344,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));
@@ -1185,6 +1217,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 *));
@@ -1231,6 +1264,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];
 
@@ -1278,6 +1313,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);
@@ -1529,6 +1568,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 *));
@@ -1588,23 +1629,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;
@@ -1619,9 +1670,6 @@
 	  wv = wv->next;
 	}
 
-      f->menu_bar_vector = menu_items;
-      f->menu_bar_items_used = menu_items_used;
-      discard_menu_items ();
     }
   else
     {
--- a/src/macterm.c	Fri Apr 21 05:39:14 2006 +0000
+++ b/src/macterm.c	Tue May 02 05:51:52 2006 +0000
@@ -391,16 +391,37 @@
 {
 #if USE_CG_DRAWING
   CGContextRef context;
+  float gx1 = x1, gy1 = y1, gx2 = x2, gy2 = y2;
+
+  if (y1 != y2)
+    gx1 += 0.5f, gx2 += 0.5f;
+  if (x1 != x2)
+    gy1 += 0.5f, gy2 += 0.5f;
 
   context = mac_begin_cg_clip (f, gc);
   CG_SET_STROKE_COLOR (context, gc->xgcv.foreground);
   CGContextBeginPath (context);
-  CGContextMoveToPoint (context, x1 + 0.5f, y1 + 0.5f);
-  CGContextAddLineToPoint (context, x2 + 0.5f, y2 + 0.5f);
+  CGContextMoveToPoint (context, gx1, gy1);
+  CGContextAddLineToPoint (context, gx2, gy2);
   CGContextClosePath (context);
   CGContextStrokePath (context);
   mac_end_cg_clip (f);
 #else
+  if (x1 == x2)
+    {
+      if (y1 > y2)
+	y1--;
+      else if (y2 > y1)
+	y2--;
+    }
+  else if (y1 == y2)
+    {
+      if (x1 > x2)
+	x1--;
+      else
+	x2--;
+    }
+
   SetPortWindowPort (FRAME_MAC_WINDOW (f));
 
   RGBForeColor (GC_FORE_COLOR (gc));
@@ -422,6 +443,21 @@
   CGrafPtr old_port;
   GDHandle old_gdh;
 
+  if (x1 == x2)
+    {
+      if (y1 > y2)
+	y1--;
+      else if (y2 > y1)
+	y2--;
+    }
+  else if (y1 == y2)
+    {
+      if (x1 > x2)
+	x1--;
+      else
+	x2--;
+    }
+
   GetGWorld (&old_port, &old_gdh);
   SetGWorld (p, NULL);
 
@@ -1627,7 +1663,7 @@
 	  DisposeRgn (region);
 	}
     }
-#if defined (MAC_OSX) && USE_ATSUI
+#if defined (MAC_OSX) && (USE_ATSUI || USE_CG_DRAWING)
   for (i = 0; i < n; i++)
     {
       Rect *rect = rectangles + i;
@@ -2139,6 +2175,29 @@
 				struct charset *, int *));
 
 
+static void
+pcm_init (pcm, count)
+     XCharStruct *pcm;
+     int count;
+{
+  bzero (pcm, sizeof (XCharStruct) * count);
+  while (--count >= 0)
+    {
+      pcm->descent = PCM_INVALID;
+      pcm++;
+    }
+}
+
+static enum pcm_status
+pcm_get_status (pcm)
+     XCharStruct *pcm;
+{
+  int height = pcm->ascent + pcm->descent;
+
+  /* Negative height means some special status.  */
+  return height >= 0 ? PCM_VALID : height;
+}
+
 /* Get metrics of character CHAR2B in FONT.  Value is null if CHAR2B
    is not contained in the font.  */
 
@@ -2155,22 +2214,21 @@
 #if USE_ATSUI
   if (font->mac_style)
     {
-      XCharStructRow **row = font->bounds.rows + char2b->byte1;
+      XCharStruct **row = font->bounds.rows + char2b->byte1;
 
       if (*row == NULL)
 	{
-	  *row = xmalloc (sizeof (XCharStructRow));
-	  bzero (*row, sizeof (XCharStructRow));
+	  *row = xmalloc (sizeof (XCharStruct) * 0x100);
+	  pcm_init (*row, 0x100);
 	}
-      pcm = (*row)->per_char + char2b->byte2;
-      if (!XCHARSTRUCTROW_CHAR_VALID_P (*row, char2b->byte2))
+      pcm = *row + char2b->byte2;
+      if (pcm_get_status (pcm) != PCM_VALID)
 	{
 	  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
@@ -2233,7 +2291,11 @@
 #endif
 
   return ((pcm == NULL
-	   || (pcm->width == 0 && (pcm->rbearing - pcm->lbearing) == 0))
+	   || (pcm->width == 0
+#if 0 /* Show hollow boxes for zero-width glyphs such as combining diacritics.  */
+	       && (pcm->rbearing - pcm->lbearing) == 0
+#endif
+	       ))
 	  ? NULL : pcm);
 }
 
@@ -3120,13 +3182,13 @@
     for (i = 0; i < width; ++i)
       mac_draw_line (f, gc,
 		     left_x + i * left_p, top_y + i,
-		     right_x - i * right_p, top_y + i);
+		     right_x + 1 - i * right_p, top_y + i);
 
   /* Left.  */
   if (left_p)
     for (i = 0; i < width; ++i)
       mac_draw_line (f, gc,
-		     left_x + i, top_y + i, left_x + i, bottom_y - i);
+		     left_x + i, top_y + i, left_x + i, bottom_y - i + 1);
 
   mac_reset_clip_rectangles (dpy, gc);
   if (raised_p)
@@ -3140,13 +3202,13 @@
     for (i = 0; i < width; ++i)
       mac_draw_line (f, gc,
 		     left_x + i * left_p, bottom_y - i,
-		     right_x - i * right_p, bottom_y - i);
+		     right_x + 1 - i * right_p, bottom_y - i);
 
   /* Right.  */
   if (right_p)
     for (i = 0; i < width; ++i)
       mac_draw_line (f, gc,
-		     right_x - i, top_y + i + 1, right_x - i, bottom_y - i - 1);
+		     right_x - i, top_y + i + 1, right_x - i, bottom_y - i);
 
   mac_reset_clip_rectangles (dpy, gc);
 }
@@ -6315,6 +6377,11 @@
   if (FRAME_SIZE_HINTS (f))
     xfree (FRAME_SIZE_HINTS (f));
 
+#if TARGET_API_MAC_CARBON
+  if (FRAME_FILE_NAME (f))
+    xfree (FRAME_FILE_NAME (f));
+#endif
+
   xfree (f->output_data.mac);
   f->output_data.mac = NULL;
 
@@ -7061,6 +7128,25 @@
   font_name_table[font_name_count++] = font_name;
 }
 
+static void
+add_mac_font_name (name, size, style, charset)
+     char *name;
+     int size;
+     Style style;
+     char *charset;
+{
+  if (size > 0)
+    add_font_name_table_entry (mac_to_x_fontname (name, size, style, charset));
+  else
+    {
+      add_font_name_table_entry (mac_to_x_fontname (name, 0, style, charset));
+      add_font_name_table_entry (mac_to_x_fontname (name, 0, italic, charset));
+      add_font_name_table_entry (mac_to_x_fontname (name, 0, bold, charset));
+      add_font_name_table_entry (mac_to_x_fontname (name, 0, italic | bold,
+						    charset));
+    }
+}
+
 /* Sets up the table font_name_table to contain the list of all fonts
    in the system the first time the table is used so that the Resource
    Manager need not be accessed every time this information is
@@ -7086,16 +7172,21 @@
 			   text_encoding_info_alist)))
     {
       OSErr err;
+      struct Lisp_Hash_Table *h;
+      unsigned hash_code;
       ItemCount nfonts, i;
       ATSUFontID *font_ids = NULL;
-      Ptr name, prev_name = NULL;
+      Ptr name;
       ByteCount name_len;
+      Lisp_Object family;
 
       atsu_font_id_hash =
 	make_hash_table (Qequal, make_number (DEFAULT_HASH_SIZE),
 			 make_float (DEFAULT_REHASH_SIZE),
 			 make_float (DEFAULT_REHASH_THRESHOLD),
 			 Qnil, Qnil, Qnil);;
+      h = XHASH_TABLE (atsu_font_id_hash);
+
       err = ATSUFontCount (&nfonts);
       if (err == noErr)
 	{
@@ -7117,32 +7208,19 @@
 				    kFontNoLanguage, name_len, name,
 				    NULL, NULL);
 	    if (err == noErr)
-	      decode_mac_font_name (name, name_len + 1, Qnil);
-	    if (err == noErr
-		&& *name != '.'
-		&& (prev_name == NULL
-		    || strcmp (name, prev_name) != 0))
 	      {
-		static char *cs = "iso10646-1";
-
-		add_font_name_table_entry (mac_to_x_fontname (name, 0,
-							      normal, cs));
-		add_font_name_table_entry (mac_to_x_fontname (name, 0,
-							      italic, cs));
-		add_font_name_table_entry (mac_to_x_fontname (name, 0,
-							      bold, cs));
-		add_font_name_table_entry (mac_to_x_fontname (name, 0,
-							      italic | bold, cs));
-		Fputhash (make_unibyte_string (name, name_len),
-			  long_to_cons (font_ids[i]), atsu_font_id_hash);
-		xfree (prev_name);
-		prev_name = name;
+		decode_mac_font_name (name, name_len + 1, Qnil);
+		family = make_unibyte_string (name, name_len);
+		if (*name != '.'
+		    && hash_lookup (h, family, &hash_code) < 0)
+		  {
+		    add_mac_font_name (name, 0, normal, "iso10646-1");
+		    hash_put (h, family, long_to_cons (font_ids[i]),
+			      hash_code);
+		  }
 	      }
-	    else
-	      xfree (name);
+	    xfree (name);
 	  }
-      if (prev_name)
-	xfree (prev_name);
       if (font_ids)
 	xfree (font_ids);
     }
@@ -7170,16 +7248,16 @@
       FMFontSize size;
       TextEncoding encoding;
       TextEncodingBase sc;
-      Lisp_Object text_encoding_info;
+      Lisp_Object text_encoding_info, family;
 
       if (FMGetFontFamilyName (ff, name) != noErr)
-	break;
+	continue;
       p2cstr (name);
       if (*name == '.')
 	continue;
 
       if (FMGetFontFamilyTextEncoding (ff, &encoding) != noErr)
-	break;
+	continue;
       sc = GetTextEncodingBase (encoding);
       text_encoding_info = assq_no_quit (make_number (sc),
 					 text_encoding_info_alist);
@@ -7188,13 +7266,15 @@
 					   text_encoding_info_alist);
       decode_mac_font_name (name, sizeof (name),
 			    XCAR (XCDR (text_encoding_info)));
-      fm_font_family_alist = Fcons (Fcons (build_string (name),
-					   make_number (ff)),
+      family = build_string (name);
+      if (!NILP (Fassoc (family, fm_font_family_alist)))
+	continue;
+      fm_font_family_alist = Fcons (Fcons (family, make_number (ff)),
 				    fm_font_family_alist);
 
       /* Point the instance iterator at the current font family.  */
       if (FMResetFontFamilyInstanceIterator (ff, &ffii) != noErr)
-	break;
+	continue;
 
       while (FMGetNextFontFamilyInstance (&ffii, &font, &style, &size)
 	     == noErr)
@@ -7203,27 +7283,7 @@
 
 	  if (size > 0 || style == normal)
 	    for (; !NILP (rest); rest = XCDR (rest))
-	      {
-		char *cs = SDATA (XCAR (rest));
-
-		if (size == 0)
-		  {
-		    add_font_name_table_entry (mac_to_x_fontname (name, size,
-								  style, cs));
-		    add_font_name_table_entry (mac_to_x_fontname (name, size,
-								  italic, cs));
-		    add_font_name_table_entry (mac_to_x_fontname (name, size,
-								  bold, cs));
-		    add_font_name_table_entry (mac_to_x_fontname (name, size,
-								  italic | bold,
-								  cs));
-		  }
-		else
-		  {
-		    add_font_name_table_entry (mac_to_x_fontname (name, size,
-								  style, cs));
-		  }
-	      }
+	      add_mac_font_name (name, size, style, SDATA (XCAR (rest)));
 	}
     }
 
@@ -7243,7 +7303,7 @@
   Str255 name;
   struct FontAssoc *fat;
   struct AsscEntry *assc_entry;
-  Lisp_Object text_encoding_info_alist, text_encoding_info;
+  Lisp_Object text_encoding_info_alist, text_encoding_info, family;
   struct gcpro gcpro1;
 
   GetPort (&port);  /* save the current font number used */
@@ -7262,7 +7322,7 @@
       GetResInfo (font_handle, &id, &type, name);
       GetFNum (name, &fontnum);
       p2cstr (name);
-      if (fontnum == 0)
+      if (fontnum == 0 || *name == '.')
 	continue;
 
       TextFont (fontnum);
@@ -7274,8 +7334,10 @@
 					   text_encoding_info_alist);
       decode_mac_font_name (name, sizeof (name),
 			    XCAR (XCDR (text_encoding_info)));
-      fm_font_family_alist = Fcons (Fcons (build_string (name),
-					   make_number (fontnum)),
+      family = build_string (name);
+      if (!NILP (Fassoc (family, fm_font_family_alist)))
+	continue;
+      fm_font_family_alist = Fcons (Fcons (family, make_number (fontnum)),
 				    fm_font_family_alist);
       do
 	{
@@ -7296,14 +7358,9 @@
 		  Lisp_Object rest = XCDR (XCDR (text_encoding_info));
 
 		  for (; !NILP (rest); rest = XCDR (rest))
-		    {
-		      char *cs = SDATA (XCAR (rest));
-
-		      add_font_name_table_entry (mac_to_x_fontname (name,
-								    assc_entry->fontSize,
-								    assc_entry->fontStyle,
-								    cs));
-		    }
+		    add_mac_font_name (name, assc_entry->fontSize,
+				       assc_entry->fontStyle,
+				       SDATA (XCAR (rest)));
 		}
 	    }
 
@@ -7771,10 +7828,10 @@
       font->min_char_or_byte2 = 0;
       font->max_char_or_byte2 = 0xff;
 
-      font->bounds.rows = xmalloc (sizeof (XCharStructRow *) * 0x100);
-      bzero (font->bounds.rows, sizeof (XCharStructRow *) * 0x100);
-      font->bounds.rows[0] = xmalloc (sizeof (XCharStructRow));
-      bzero (font->bounds.rows[0], sizeof (XCharStructRow));
+      font->bounds.rows = xmalloc (sizeof (XCharStruct *) * 0x100);
+      bzero (font->bounds.rows, sizeof (XCharStruct *) * 0x100);
+      font->bounds.rows[0] = xmalloc (sizeof (XCharStruct) * 0x100);
+      pcm_init (font->bounds.rows[0], 0x100);
 
 #if USE_CG_TEXT_DRAWING
       {
@@ -7800,7 +7857,7 @@
 	  bzero (font->cg_glyphs, sizeof (CGGlyph) * 0x100);
 	}
 #endif
-      space_bounds = font->bounds.rows[0]->per_char + 0x20;
+      space_bounds = font->bounds.rows[0] + 0x20;
       err = mac_query_char_extents (font->mac_style, 0x20,
 				    &font->ascent, &font->descent,
 				    space_bounds,
@@ -7816,9 +7873,8 @@
 	  mac_unload_font (&one_mac_display_info, font);
 	  return NULL;
 	}
-      XCHARSTRUCTROW_SET_CHAR_VALID (font->bounds.rows[0], 0x20);
-
-      pcm = font->bounds.rows[0]->per_char;
+
+      pcm = font->bounds.rows[0];
       for (c = 0x21; c <= 0xff; c++)
 	{
 	  if (c == 0xad)
@@ -7838,7 +7894,6 @@
 				    NULL
 #endif
 				  );
-	  XCHARSTRUCTROW_SET_CHAR_VALID (font->bounds.rows[0], c);
 
 #if USE_CG_TEXT_DRAWING
 	  if (font->cg_glyphs && font->cg_glyphs[c] == 0)
@@ -10024,8 +10079,20 @@
 		  }
 		break;
 
+#if TARGET_API_MAC_CARBON
+	      case inProxyIcon:
+		if (TrackWindowProxyDrag (window_ptr, er.where)
+		    != errUserWantsToDragWindow)
+		  break;
+		/* fall through */
+#endif
 	      case inDrag:
 #if TARGET_API_MAC_CARBON
+		if (IsWindowPathSelectClick (window_ptr, &er))
+		  {
+		    WindowPathSelect (window_ptr, NULL, NULL);
+		    break;
+		  }
 		DragWindow (window_ptr, er.where, NULL);
 #else /* not TARGET_API_MAC_CARBON */
 		DragWindow (window_ptr, er.where, &qd.screenBits.bounds);
@@ -11076,7 +11143,11 @@
    doc: /* *If non-nil, allow anti-aliasing.
 The text will be rendered using Core Graphics text rendering which
 may anti-alias the text.  */);
+#if USE_CG_DRAWING
+  mac_use_core_graphics = 1;
+#else
   mac_use_core_graphics = 0;
+#endif
 
   /* Register an entry for `mac-roman' so that it can be used when
      creating the terminal frame on Mac OS 9 before loading
--- a/src/macterm.h	Fri Apr 21 05:39:14 2006 +0000
+++ b/src/macterm.h	Tue May 02 05:51:52 2006 +0000
@@ -335,6 +335,11 @@
   /* Hints for the size and the position of a window.  */
   XSizeHints *size_hints;
 
+#if TARGET_API_MAC_CARBON
+  /* File name for the proxy icon of this frame.  Might be NULL.  */
+  char *file_name;
+#endif
+
 #if USE_CG_DRAWING
   /* Quartz 2D graphics context.  */
   CGContextRef cg_context;
@@ -360,6 +365,8 @@
 
 #define FRAME_SIZE_HINTS(f) ((f)->output_data.mac->size_hints)
 
+#define FRAME_FILE_NAME(f) ((f)->output_data.mac->file_name)
+
 /* This gives the mac_display_info structure for the display F is on.  */
 #define FRAME_MAC_DISPLAY_INFO(f) (&one_mac_display_info)
 #define FRAME_X_DISPLAY_INFO(f) (&one_mac_display_info)
@@ -606,6 +613,7 @@
 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));
+extern void mac_update_title_bar P_ ((struct frame *, int));
 
 /* Defined in macmenu.c */
 
--- a/src/process.h	Fri Apr 21 05:39:14 2006 +0000
+++ b/src/process.h	Tue May 02 05:51:52 2006 +0000
@@ -19,6 +19,12 @@
 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 Boston, MA 02110-1301, USA.  */
 
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
 
 /* This structure records information about a subprocess
    or network connection.
--- a/src/puresize.h	Fri Apr 21 05:39:14 2006 +0000
+++ b/src/puresize.h	Tue May 02 05:51:52 2006 +0000
@@ -43,7 +43,7 @@
 #endif
 
 #ifndef BASE_PURESIZE
-#define BASE_PURESIZE (1200000 + SYSTEM_PURESIZE_EXTRA + SITELOAD_PURESIZE_EXTRA)
+#define BASE_PURESIZE (1205000 + SYSTEM_PURESIZE_EXTRA + SITELOAD_PURESIZE_EXTRA)
 #endif
 
 /* Increase BASE_PURESIZE by a ratio depending on the machine's word size.  */
--- a/src/s/ms-w32.h	Fri Apr 21 05:39:14 2006 +0000
+++ b/src/s/ms-w32.h	Tue May 02 05:51:52 2006 +0000
@@ -466,9 +466,9 @@
 #include <string.h>
 
 /* 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
+   The number below comes from 23923 bytes worth (as of 2006-04)
+   of w32-specific files loaded by loadup.el, plus 1K spare.  */
+#define SYSTEM_PURESIZE_EXTRA 25000
 
 /* For unexec to work on Alpha systems, we need to put Emacs'
    initialized data into a separate section from the CRT initialized
--- a/src/syntax.c	Fri Apr 21 05:39:14 2006 +0000
+++ b/src/syntax.c	Tue May 02 05:51:52 2006 +0000
@@ -2344,8 +2344,6 @@
 	      while (1)
 		{
 		  DEC_BOTH (from, from_byte);
-		  if (from == stop)
-		    break;
 		  UPDATE_SYNTAX_TABLE_BACKWARD (from);
 		  c = FETCH_CHAR_AS_MULTIBYTE (from_byte);
 		  if (SYNTAX (c) == Scomment_fence
@@ -2354,6 +2352,8 @@
 		      found = 1;
 		      break;
 		    }
+		  else if (from == stop)
+		    break;
 		}
 	      if (found == 0)
 		{
@@ -2361,6 +2361,9 @@
 		  from_byte = ini_byte;
 		  goto leave;
 		}
+ 	      else
+		/* We have skipped one comment.  */
+		break;
 	    }
 	  else if (code == Sendcomment)
 	    {
--- a/src/unexmacosx.c	Fri Apr 21 05:39:14 2006 +0000
+++ b/src/unexmacosx.c	Tue May 02 05:51:52 2006 +0000
@@ -1021,6 +1021,9 @@
 unexec (char *outfile, char *infile, void *start_data, void *start_bss,
         void *entry_address)
 {
+  if (in_dumped_exec)
+    unexec_error ("Unexec from a dumped executable is not supported.");
+
   infd = open (infile, O_RDONLY, 0);
   if (infd < 0)
     {
--- a/src/w32fns.c	Fri Apr 21 05:39:14 2006 +0000
+++ b/src/w32fns.c	Tue May 02 05:51:52 2006 +0000
@@ -3191,6 +3191,7 @@
 	      }
 	    wmsg.dwModifiers = w32_get_modifiers ();
 	    my_post_msg (&wmsg, hwnd, msg, wParam, lParam);
+	    signal_user_input ();
 
 	    /* Clear message buffer. */
 	    saved_mouse_button_msg.msg.hwnd = 0;
@@ -3248,6 +3249,7 @@
 	  }
 	wmsg.dwModifiers = w32_get_modifiers ();
 	my_post_msg (&wmsg, hwnd, msg, wParam, lParam);
+	signal_user_input ();
 
 	/* Always clear message buffer and cancel timer. */
 	saved_mouse_button_msg.msg.hwnd = 0;
--- a/src/w32term.c	Fri Apr 21 05:39:14 2006 +0000
+++ b/src/w32term.c	Tue May 02 05:51:52 2006 +0000
@@ -3282,8 +3282,10 @@
   result->modifiers = (msg->dwModifiers
                        | ((delta < 0 ) ? down_modifier : up_modifier));
 
-  p.x = LOWORD (msg->msg.lParam);
-  p.y = HIWORD (msg->msg.lParam);
+  /* With multiple monitors, we can legitimately get negative
+     coordinates, so cast to short to interpret them correctly.  */
+  p.x = (short) LOWORD (msg->msg.lParam);
+  p.y = (short) HIWORD (msg->msg.lParam);
   ScreenToClient (msg->msg.hwnd, &p);
   XSETINT (result->x, p.x);
   XSETINT (result->y, p.y);
--- a/src/window.c	Fri Apr 21 05:39:14 2006 +0000
+++ b/src/window.c	Tue May 02 05:51:52 2006 +0000
@@ -3437,7 +3437,7 @@
 The variables `special-display-buffer-names',
 `special-display-regexps', `same-window-buffer-names', and
 `same-window-regexps' customize how certain buffer names are handled.
-The latter two take effect only if NOT-THIS-WINDOW is t.
+The latter two take effect only if NOT-THIS-WINDOW is nil.
 
 If optional argument FRAME is `visible', search all visible frames.
 If FRAME is 0, search all visible and iconified frames.
--- a/src/xdisp.c	Fri Apr 21 05:39:14 2006 +0000
+++ b/src/xdisp.c	Tue May 02 05:51:52 2006 +0000
@@ -9060,6 +9060,9 @@
 	  update_menu_bar (f, 0);
 #ifdef HAVE_WINDOW_SYSTEM
 	  update_tool_bar (f, 0);
+#ifdef MAC_OS
+	  mac_update_title_bar (f, 0);
+#endif
 #endif
 	  UNGCPRO;
 	}
@@ -9072,6 +9075,9 @@
       update_menu_bar (sf, 1);
 #ifdef HAVE_WINDOW_SYSTEM
       update_tool_bar (sf, 1);
+#ifdef MAC_OS
+      mac_update_title_bar (sf, 1);
+#endif
 #endif
     }
 
@@ -9668,20 +9674,22 @@
 {
   struct window *w = XWINDOW (f->tool_bar_window);
   struct it it;
+  struct glyph_row *temp_row = w->desired_matrix->rows;
 
   /* Initialize an iterator for iteration over
      F->desired_tool_bar_string in the tool-bar window of frame F.  */
-  init_iterator (&it, w, -1, -1, w->desired_matrix->rows, TOOL_BAR_FACE_ID);
+  init_iterator (&it, w, -1, -1, temp_row, TOOL_BAR_FACE_ID);
   it.first_visible_x = 0;
   it.last_visible_x = FRAME_TOTAL_COLS (f) * FRAME_COLUMN_WIDTH (f);
   reseat_to_string (&it, NULL, f->desired_tool_bar_string, 0, 0, 0, -1);
 
   while (!ITERATOR_AT_END_P (&it))
     {
-      it.glyph_row = w->desired_matrix->rows;
-      clear_glyph_row (it.glyph_row);
+      clear_glyph_row (temp_row);
+      it.glyph_row = temp_row;
       display_tool_bar_line (&it, -1);
     }
+  clear_glyph_row (temp_row);
 
   /* f->n_tool_bar_rows == 0 means "unknown"; -1 means no tool-bar.  */
   if (n_rows)
@@ -9761,7 +9769,29 @@
   reseat_to_string (&it, NULL, f->desired_tool_bar_string, 0, 0, 0, -1);
 
   if (f->n_tool_bar_rows == 0)
-    (void)tool_bar_lines_needed (f, &f->n_tool_bar_rows);
+    {
+      int nlines;
+
+      if ((nlines = tool_bar_lines_needed (f, &f->n_tool_bar_rows),
+	   nlines != WINDOW_TOTAL_LINES (w)))
+	{
+	  extern Lisp_Object Qtool_bar_lines;
+	  Lisp_Object frame;
+	  int old_height = WINDOW_TOTAL_LINES (w);
+
+	  XSETFRAME (frame, f);
+	  clear_glyph_matrix (w->desired_matrix);
+	  Fmodify_frame_parameters (frame,
+				    Fcons (Fcons (Qtool_bar_lines,
+						  make_number (nlines)),
+					   Qnil));
+	  if (WINDOW_TOTAL_LINES (w) != old_height)
+	    {
+	      fonts_changed_p = 1;
+	      return 1;
+	    }
+	}
+    }
 
   /* Display as many lines as needed to display all tool-bar items.  */
 
@@ -12957,7 +12987,8 @@
       /* If first window line is a continuation line, and window start
 	 is inside the modified region, but the first change is before
 	 current window start, we must select a new window start.*/
-      if (NILP (w->start_at_line_beg))
+      if (NILP (w->start_at_line_beg)
+	  && CHARPOS (startp) > BEGV)
 	{
 	  /* Make sure beg_unchanged and end_unchanged are up to date.
 	     Do it only if buffer has really changed.  This may or may
@@ -18593,8 +18624,7 @@
 	 sure to use a face suitable for unibyte.  */
       STORE_XCHAR2B (char2b, 0, glyph->u.ch);
     }
-  else if (glyph->u.ch < 128
-	   && glyph->face_id < BASIC_FACE_ID_SENTINEL)
+  else if (glyph->u.ch < 128)
     {
       /* Case of ASCII in a face known to fit ASCII.  */
       STORE_XCHAR2B (char2b, 0, glyph->u.ch);
@@ -18814,6 +18844,7 @@
   s->font = s->face->font;
   s->font_info = FONT_INFO_FROM_ID (s->f, s->face->font_info_id);
   s->width = glyph->pixel_width;
+  s->nchars = 1;
   voffset = glyph->voffset;
 
   for (++glyph;
@@ -19011,7 +19042,7 @@
       face_id = FACE_FOR_CHAR (f, face, c, -1, Qnil);
       face = FACE_FROM_ID (f, face_id);
     }
-  else if (c < 128 && face_id < BASIC_FACE_ID_SENTINEL)
+  else if (c < 128)
     {
       /* Case of ASCII in a face known to fit ASCII.  */
       STORE_XCHAR2B (char2b, 0, c);
@@ -19968,20 +19999,6 @@
   it->descent = it->phys_descent = height - it->ascent;
   it->nglyphs = width > 0 && height > 0 ? 1 : 0;
 
-  if (width > 0 && height > 0 && face->box != FACE_NO_BOX)
-    {
-      if (face->box_line_width > 0)
-	{
-	  it->ascent += face->box_line_width;
-	  it->descent += face->box_line_width;
-	}
-
-      if (it->start_of_box_run_p)
-	it->pixel_width += abs (face->box_line_width);
-      if (it->end_of_box_run_p)
-	it->pixel_width += abs (face->box_line_width);
-    }
-
   take_vertical_position_into_account (it);
 }
 
--- a/src/xmenu.c	Fri Apr 21 05:39:14 2006 +0000
+++ b/src/xmenu.c	Tue May 02 05:51:52 2006 +0000
@@ -327,6 +327,7 @@
   menu_items_n_panes = XINT (XCAR (saved));
   saved = XCDR (saved);  
   menu_items_submenu_depth = XINT (XCAR (saved));
+  return Qnil;
 }
 
 /* Push the whole state of menu_items processing onto the specpdl.