changeset 83514:d9f8d2a65d18

Merged from emacs@sv.gnu.org Patches applied: * emacs@sv.gnu.org/emacs--devo--0--patch-252 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-253 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-254 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-255 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-256 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-257 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-258 Clean up lisp/gnus/ChangeLog a bit * emacs@sv.gnu.org/emacs--devo--0--patch-259 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-260 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-261 lisp/replace.el (occur-engine): Bind `inhibit-field-text-motion' to t * emacs@sv.gnu.org/emacs--devo--0--patch-262 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-96 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-97 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-98 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-554
author Karoly Lorentey <lorentey@elte.hu>
date Wed, 03 May 2006 11:56:53 +0000
parents 966a40e7fb54 (current diff) 8e55901472d6 (diff)
children f7a396df2380
files lisp/ChangeLog lisp/allout.el lisp/bindings.el lisp/files.el lisp/help-fns.el lisp/mh-e/ChangeLog lisp/mh-e/mh-e.el lisp/progmodes/gdb-ui.el lisp/simple.el lisp/smerge-mode.el lisp/startup.el lisp/subr.el lisp/term/mac-win.el lisp/tool-bar.el lispref/ChangeLog man/ChangeLog man/emacs.texi src/dispnew.c src/keymap.c src/macfns.c src/macterm.c src/macterm.h src/xdisp.c src/xmenu.c
diffstat 73 files changed, 1734 insertions(+), 793 deletions(-) [+]
line wrap: on
line diff
--- a/etc/ChangeLog	Fri Apr 28 14:48:18 2006 +0000
+++ b/etc/ChangeLog	Wed May 03 11:56:53 2006 +0000
@@ -1,3 +1,9 @@
+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.
--- a/etc/MH-E-NEWS	Fri Apr 28 14:48:18 2006 +0000
+++ b/etc/MH-E-NEWS	Wed May 03 11:56:53 2006 +0000
@@ -6,6 +6,19 @@
 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,
--- a/etc/NEWS	Fri Apr 28 14:48:18 2006 +0000
+++ b/etc/NEWS	Wed May 03 11:56:53 2006 +0000
@@ -1404,20 +1404,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*
@@ -1952,6 +1967,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.
@@ -3025,7 +3055,7 @@
 ---
 ** MH-E changes.
 
-Upgraded to MH-E version 7.94. 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:
@@ -3630,9 +3660,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:
 
@@ -5877,6 +5908,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/lib-src/ChangeLog	Fri Apr 28 14:48:18 2006 +0000
+++ b/lib-src/ChangeLog	Wed May 03 11:56:53 2006 +0000
@@ -1,3 +1,23 @@
+2006-05-02  Francesco Potort,Al(B  <pot@gnu.org>
+
+	* etags.c (Perl_functions): Free space allocated for var package.
+	(Erlang_functions): Possibly free space allocated for var last.
+	(Prolog_functions): Possibly free space allocated for var last.
+
+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 28 14:48:18 2006 +0000
+++ b/lib-src/etags.c	Wed May 03 11:56:53 2006 +0000
@@ -41,7 +41,7 @@
  * configuration file containing regexp definitions for etags.
  */
 
-char pot_etags_version[] = "@(#) pot revision number is 17.15";
+char pot_etags_version[] = "@(#) pot revision number is 17.17";
 
 #define	TRUE	1
 #define	FALSE	0
@@ -4543,6 +4543,7 @@
 		    lb.buffer, cp - lb.buffer + 1, lineno, linecharno);
 	}
     }
+  free (package);
 }
 
 
@@ -5441,6 +5442,8 @@
 	  last[len] = '\0';
 	}
     }
+  if (last != NULL)
+    free (last);
 }
 
 
@@ -5597,7 +5600,11 @@
       else if (cp[0] == '-') 	/* attribute, e.g. "-define" */
 	{
 	  erlang_attribute (cp);
-	  last = NULL;
+	  if (last != NULL)
+	    {
+	      free (last);
+	      last = NULL;
+	    }
 	}
       else if ((len = erlang_func (cp, last)) > 0)
 	{
@@ -5614,6 +5621,8 @@
 	  last[len] = '\0';
 	}
     }
+  if (last != NULL)
+    free (last);
 }
 
 
@@ -6887,7 +6896,6 @@
 
 /*
  * Local Variables:
- * c-indentation-style: gnu
  * indent-tabs-mode: t
  * tab-width: 8
  * fill-column: 79
--- a/lib-src/fakemail.c	Fri Apr 28 14:48:18 2006 +0000
+++ b/lib-src/fakemail.c	Wed May 03 11:56:53 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 28 14:48:18 2006 +0000
+++ b/lib-src/movemail.c	Wed May 03 11:56:53 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 28 14:48:18 2006 +0000
+++ b/lib-src/sorted-doc.c	Wed May 03 11:56:53 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 28 14:48:18 2006 +0000
+++ b/lib-src/yow.c	Wed May 03 11:56:53 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 28 14:48:18 2006 +0000
+++ b/lisp/ChangeLog	Wed May 03 11:56:53 2006 +0000
@@ -1,3 +1,170 @@
+2006-05-03  Nick Roberts  <nickrob@snap.net.nz>
+
+	* progmodes/gdb-ui.el (gud-watch): Let user select an expression.
+	(menu): Fix typo.
+
+2006-05-02  Miles Bader  <miles@gnu.org>
+
+	* replace.el (occur-engine): Bind `inhibit-field-text-motion' to t.
+
+2006-05-02  Jay Belanger  <belanger@truman.edu>
+
+	* calc/calc-embed.el: (calc-override-minor-modes-map)
+	(calc-override-minor-modes): New variables.
+	(calc-do-embedded): Make sure that Calc keystrokes aren't
+	overwritten by minor modes.
+
+2006-05-02  Chong Yidong  <cyd@mit.edu>
+
+	* msb.el (msb): If EVENT is a down event, read and discard the up
+	event.
+
+2006-05-02  Reiner Steib  <Reiner.Steib@gmx.de>
+
+	* startup.el (command-line-1): Refer to Lisp manual when
+	pure-space-overflow occurs.
+
+	* files.el (byte-compile-dynamic)
+	(byte-compile-dynamic-docstrings, byte-compile-warnings)
+	(find-file-visit-truename, indent-tabs-mode, left-margin)
+	(no-byte-compile no-update-autoloads, truncate-lines)
+	(version-control): Don't use `t' for safe-local-variable
+	declarations.
+
+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
+	and symbol-value.
+
+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't 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 UI 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
@@ -2598,7 +2765,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 `%%'
@@ -3746,7 +3913,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.
@@ -4836,7 +5003,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.
 
@@ -6819,7 +6986,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
@@ -7373,7 +7540,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.
 
@@ -7646,7 +7813,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 %{...%}.
 
@@ -14577,7 +14744,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/abbrev.el	Fri Apr 28 14:48:18 2006 +0000
+++ b/lisp/abbrev.el	Wed May 03 11:56:53 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 'symbolp)
+;;;###autoload(put 'abbrev-mode 'safe-local-variable 'booleanp)
 
 
 (defvar edit-abbrevs-map
--- a/lisp/allout.el	Fri Apr 28 14:48:18 2006 +0000
+++ b/lisp/allout.el	Wed May 03 11:56:53 2006 +0000
@@ -301,7 +301,7 @@
 Set to the symbol for either of `allout-mode-leaders' or
 `comment-start' to use only one of them, respectively.
 
-Value nil means to always use the default \(`.').t
+Value nil means to always use the default \(`.').
 
 comment-start strings that do not end in spaces are tripled, and an
 `_' underscore is tacked on the end, to distinguish them from regular
--- a/lisp/bindings.el	Fri Apr 28 14:48:18 2006 +0000
+++ b/lisp/bindings.el	Wed May 03 11:56:53 2006 +0000
@@ -319,13 +319,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 28 14:48:18 2006 +0000
+++ b/lisp/calc/calc-embed.el	Wed May 03 11:56:53 2006 +0000
@@ -206,6 +206,18 @@
 (defvar calc-embedded-firsttime-buf)
 (defvar calc-embedded-firsttime-formula)
 
+;; The following is to take care of any minor modes which override
+;; a Calc command.
+(defvar calc-override-minor-modes-map 
+  (make-sparse-keymap)
+  "A list of keybindings that might be overwritten by minor modes.")
+
+;; Add any keys that might be overwritten here.
+(define-key calc-override-minor-modes-map "`" 'calc-edit)
+
+(defvar calc-override-minor-modes 
+  (cons t calc-override-minor-modes-map))
+
 (defun calc-do-embedded (calc-embed-arg end obeg oend)
   (if calc-embedded-info
 
@@ -237,6 +249,8 @@
 		     truncate-lines (nth 2 mode)
 		     buffer-read-only nil)
 	       (use-local-map (nth 1 mode))
+               (setq minor-mode-overriding-map-alist
+                     (remq calc-override-minor-modes minor-mode-overriding-map-alist))
 	       (set-buffer-modified-p (buffer-modified-p))
                (calc-embedded-restore-original-modes)
 	       (or calc-embedded-quiet
@@ -297,6 +311,9 @@
 	    buffer-read-only t)
       (set-buffer-modified-p (buffer-modified-p))
       (use-local-map calc-mode-map)
+      (setq minor-mode-overriding-map-alist
+            (cons calc-override-minor-modes
+                  minor-mode-overriding-map-alist))
       (setq calc-no-refresh-evaltos nil)
       (and chg calc-any-evaltos (calc-wrapper (calc-refresh-evaltos)))
       (let (str)
--- a/lisp/calendar/cal-tex.el	Fri Apr 28 14:48:18 2006 +0000
+++ b/lisp/calendar/cal-tex.el	Wed May 03 11:56:53 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/cvs-status.el	Fri Apr 28 14:48:18 2006 +0000
+++ b/lisp/cvs-status.el	Wed May 03 11:56:53 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 28 14:48:18 2006 +0000
+++ b/lisp/diff-mode.el	Wed May 03 11:56:53 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 28 14:48:18 2006 +0000
+++ b/lisp/emacs-lisp/warnings.el	Wed May 03 11:56:53 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/files.el	Fri Apr 28 14:48:18 2006 +0000
+++ b/lisp/files.el	Wed May 03 11:56:53 2006 +0000
@@ -2354,27 +2354,27 @@
   (eval
    `(mapc (lambda (pair)
 	    (put (car pair) 'safe-local-variable (cdr pair)))
-	  '((byte-compile-dynamic . t)
-	    (byte-compile-dynamic-docstrings . t)
-	    (byte-compile-warnings . t)
+	  '((byte-compile-dynamic . booleanp)
+	    (byte-compile-dynamic-docstrings . booleanp)
+	    (byte-compile-warnings . booleanp)
 	    (c-basic-offset     .  integerp)
 	    (c-file-style       .  stringp)
 	    (c-indent-level     .  integerp)
 	    (comment-column     .  integerp)
 	    (compile-command    .  string-or-null-p)
-	    (find-file-visit-truename . t)
+	    (find-file-visit-truename . booleanp)
 	    (fill-column        .  integerp)
 	    (fill-prefix        .  string-or-null-p)
-	    (indent-tabs-mode   .  t)
+	    (indent-tabs-mode   .  booleanp) ;; C source code
 	    (kept-old-versions  .  integerp)
 	    (kept-new-versions  .  integerp)
-	    (left-margin        .  t)
-	    (no-byte-compile    .  t)
-	    (no-update-autoloads . t)
+	    (left-margin        .  integerp)
+	    (no-byte-compile    .  booleanp)
+	    (no-update-autoloads . booleanp)
 	    (outline-regexp     .  string-or-null-p)
 	    (tab-width          .  integerp) ;; C source code
-	    (truncate-lines     .  t) ;; C source code
-	    (version-control    .  t)))))
+	    (truncate-lines     .  booleanp) ;; C source code
+	    (version-control    .  symbolp)))))
 
 (put 'c-set-style 'safe-local-eval-function t)
 
@@ -2653,15 +2653,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/gnus/ChangeLog	Fri Apr 28 14:48:18 2006 +0000
+++ b/lisp/gnus/ChangeLog	Wed May 03 11:56:53 2006 +0000
@@ -1,3 +1,17 @@
+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)
@@ -21,6 +35,18 @@
 	(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
@@ -458,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/mm-uu.el	Fri Apr 28 14:48:18 2006 +0000
+++ b/lisp/gnus/mm-uu.el	Wed May 03 11:56:53 2006 +0000
@@ -436,11 +436,18 @@
 			"OK")))
 	  (progn
 	    ;; Decode charset.
-	    (when (and (or charset
-			   (setq charset gnus-newsgroup-charset))
-		       (setq charset (mm-charset-to-coding-system charset))
-		       (not (eq charset 'ascii)))
-	      (mm-decode-coding-region (point-min) (point-max) 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")))))))
 
--- a/lisp/gnus/mml1991.el	Fri Apr 28 14:48:18 2006 +0000
+++ b/lisp/gnus/mml1991.el	Wed May 03 11:56:53 2006 +0000
@@ -229,8 +229,6 @@
   (defvar pgg-output-buffer))
 
 (defun mml1991-pgg-sign (cont)
-  ;; Make sure to load pgg.el before binding pgg-* variables.
-  (require 'pgg)
   (let ((pgg-text-mode t)
 	(pgg-default-user-id (or (message-options-get 'mml-sender)
 				 pgg-default-user-id))
@@ -275,19 +273,16 @@
       (delete-region (point-min) (point))
       (when cte
 	(mm-decode-content-transfer-encoding (intern (downcase cte))))))
-  (unless (progn
-	    ;; Make sure to load pgg.el before binding `pgg-text-mode'.
-	    (require 'pgg)
-	    (let ((pgg-text-mode t))
-	      (pgg-encrypt-region
-	       (point-min) (point-max)
-	       (split-string
-		(or
-		 (message-options-get 'message-recipients)
-		 (message-options-set 'message-recipients
-				      (read-string "Recipients: ")))
-		"[ \f\t\n\r\v,]+")
-	       sign)))
+  (unless (let ((pgg-text-mode t))
+	    (pgg-encrypt-region
+	     (point-min) (point-max)
+	     (split-string
+	      (or
+	       (message-options-get 'message-recipients)
+	       (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))
--- a/lisp/gnus/mml2015.el	Fri Apr 28 14:48:18 2006 +0000
+++ b/lisp/gnus/mml2015.el	Wed May 03 11:56:53 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/help-fns.el	Fri Apr 28 14:48:18 2006 +0000
+++ b/lisp/help-fns.el	Wed May 03 11:56:53 2006 +0000
@@ -638,6 +638,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)
@@ -649,6 +650,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 28 14:48:18 2006 +0000
+++ b/lisp/help-mode.el	Wed May 03 11:56:53 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/log-edit.el	Fri Apr 28 14:48:18 2006 +0000
+++ b/lisp/log-edit.el	Wed May 03 11:56:53 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 28 14:48:18 2006 +0000
+++ b/lisp/log-view.el	Wed May 03 11:56:53 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 28 14:48:18 2006 +0000
+++ b/lisp/mh-e/ChangeLog	Wed May 03 11:56:53 2006 +0000
@@ -1,3 +1,9 @@
+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
--- a/lisp/mh-e/mh-e.el	Fri Apr 28 14:48:18 2006 +0000
+++ b/lisp/mh-e/mh-e.el	Wed May 03 11:56:53 2006 +0000
@@ -6,7 +6,7 @@
 
 ;; Author: Bill Wohler <wohler@newt.com>
 ;; Maintainer: Bill Wohler <wohler@newt.com>
-;; Version: 7.94+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.94+cvs" "Version number of MH-E.")
+(defconst mh-version "7.95" "Version number of MH-E.")
 
 ;; Variants
 
--- a/lisp/msb.el	Fri Apr 28 14:48:18 2006 +0000
+++ b/lisp/msb.el	Wed May 03 11:56:53 2006 +0000
@@ -473,6 +473,11 @@
 See the function `mouse-select-buffer' and the variable
 `msb-menu-cond' for more information about how the menus are split."
   (interactive "e")
+  ;; If EVENT is a down-event, read and discard the
+  ;; corresponding up-event.
+  (and (eventp event)
+       (memq 'down (event-modifiers event))
+       (read-event))
   (let ((old-window (selected-window))
 	(window (posn-window (event-start event))))
     (unless (framep window) (select-window window))
--- a/lisp/net/tramp.el	Fri Apr 28 14:48:18 2006 +0000
+++ b/lisp/net/tramp.el	Wed May 03 11:56:53 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,42 +4316,39 @@
       (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))))
-
-;; Register in `file-name-handler-alist'.
-;; `tramp-completion-file-name-handler' must not be active when temacs
-;; dumps.  And it makes no sense in batch mode anyway.
+      (tramp-completion-run-real-handler operation args)))))
+
 ;;;###autoload
-(defun tramp-register-file-name-handlers ()
+(defsubst tramp-register-file-name-handlers ()
   "Add tramp file name handlers to `file-name-handler-alist'."
-  (unless noninteractive
-    (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-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)))
-
-;; LAMBDA function used temporarily, because older/other versions of
-;; Tramp don't know of `tramp-register-file-name-handlers'.  Can be
-;; replaced once that DEFUN is established.  Relevant for Emacs 22 only.
-;;;###;autoload(add-hook 'emacs-startup-hook 'tramp-register-file-name-handlers)
+    (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 'emacs-startup-hook
-;;;###autoload '(lambda ()
-;;;###autoload    (condition-case nil
-;;;###autoload        (funcall 'tramp-register-file-name-handlers)
-;;;###autoload      (error nil))))
+;;;###autoload 'after-init-hook
+;;;###autoload '(lambda () (tramp-register-file-name-handlers)))
 (tramp-register-file-name-handlers)
 
 ;;;###autoload
@@ -4374,16 +4362,6 @@
 
 (add-hook 'tramp-unload-hook 'tramp-unload-file-name-handlers)
 
-(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)
-
 
 ;;; Interactions with other packages:
 
@@ -4497,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."
 
@@ -4576,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
@@ -4595,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
@@ -4721,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.
@@ -4755,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.
@@ -4975,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)
--- a/lisp/pcvs-defs.el	Fri Apr 28 14:48:18 2006 +0000
+++ b/lisp/pcvs-defs.el	Wed May 03 11:56:53 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 28 14:48:18 2006 +0000
+++ b/lisp/pcvs-info.el	Wed May 03 11:56:53 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 28 14:48:18 2006 +0000
+++ b/lisp/pcvs-parse.el	Wed May 03 11:56:53 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 28 14:48:18 2006 +0000
+++ b/lisp/pcvs-util.el	Wed May 03 11:56:53 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/gdb-ui.el	Fri Apr 28 14:48:18 2006 +0000
+++ b/lisp/progmodes/gdb-ui.el	Wed May 03 11:56:53 2006 +0000
@@ -690,10 +690,13 @@
 	  (if event (posn-set-point (event-end event)))
 	  (require 'tooltip)
 	  (save-selected-window
-	    (let ((expr (if arg
-			    (completing-read "Name of variable: "
-					     'gud-gdb-complete-command)
-			  (tooltip-identifier-from-point (point)))))
+	    (let ((expr
+		   (if arg
+		       (completing-read "Name of variable: "
+					'gud-gdb-complete-command)
+		     (if (and transient-mark-mode mark-active)
+			 (buffer-substring (region-beginning) (region-end))
+		       (tooltip-identifier-from-point (point))))))
 	      (catch 'already-watched
 		(dolist (var gdb-var-list)
 		  (unless (string-match "\\." (car var))
@@ -2691,7 +2694,7 @@
     '(menu-item "Inferior IO" gdb-frame-separate-io-buffer
 		:enable gdb-use-separate-io-buffer))
   (define-key menu [registers] '("Registers" . gdb-frame-registers-buffer))
-  (define-key menu [disassembly] '("Disassembiy" . gdb-frame-assembler-buffer))
+  (define-key menu [disassembly] '("Disassembly" . gdb-frame-assembler-buffer))
   (define-key menu [breakpoints]
     '("Breakpoints" . gdb-frame-breakpoints-buffer))
   (define-key menu [locals] '("Locals" . gdb-frame-locals-buffer))
--- a/lisp/progmodes/grep.el	Fri Apr 28 14:48:18 2006 +0000
+++ b/lisp/progmodes/grep.el	Wed May 03 11:56:53 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))
+			 (symbol-value (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 28 14:48:18 2006 +0000
+++ b/lisp/progmodes/gud.el	Wed May 03 11:56:53 2006 +0000
@@ -303,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
@@ -446,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
@@ -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
--- a/lisp/replace.el	Fri Apr 28 14:48:18 2006 +0000
+++ b/lisp/replace.el	Wed May 03 11:56:53 2006 +0000
@@ -1098,6 +1098,7 @@
 		(endpt nil)
 		(marker nil)
 		(curstring "")
+		(inhibit-field-text-motion t)
 		(headerpt (with-current-buffer out-buf (point))))
 	    (with-current-buffer buf
 	      (or coding
--- a/lisp/reveal.el	Fri Apr 28 14:48:18 2006 +0000
+++ b/lisp/reveal.el	Wed May 03 11:56:53 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 28 14:48:18 2006 +0000
+++ b/lisp/simple.el	Wed May 03 11:56:53 2006 +0000
@@ -1697,7 +1697,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)
@@ -1705,7 +1705,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 28 14:48:18 2006 +0000
+++ b/lisp/smerge-mode.el	Wed May 03 11:56:53 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 28 14:48:18 2006 +0000
+++ b/lisp/startup.el	Wed May 03 11:56:53 2006 +0000
@@ -1623,7 +1623,7 @@
 	     (not noninteractive))
     (display-warning
      'initialization
-     "Building Emacs overflowed pure space."
+     "Building Emacs overflowed pure space.  See \"(elisp)Building Emacs\" for more information."
      ;; FIXME: Tell the user what kind of problems are possible and how to fix
      ;; the overflow.
      :warning))
--- a/lisp/subr.el	Fri Apr 28 14:48:18 2006 +0000
+++ b/lisp/subr.el	Wed May 03 11:56:53 2006 +0000
@@ -1262,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.
@@ -1927,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 28 14:48:18 2006 +0000
+++ b/lisp/term/mac-win.el	Wed May 03 11:56:53 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"))
@@ -2039,9 +2039,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/fill.el	Fri Apr 28 14:48:18 2006 +0000
+++ b/lisp/textmodes/fill.el	Wed May 03 11:56:53 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 'symbolp)
+;;;###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/paragraphs.el	Fri Apr 28 14:48:18 2006 +0000
+++ b/lisp/textmodes/paragraphs.el	Wed May 03 11:56:53 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 'symbolp)
+;;;###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 'symbolp)
+;;;###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 'symbolp)
+;;;###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 '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 'symbolp)
+;;;###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 28 14:48:18 2006 +0000
+++ b/lisp/textmodes/reftex-vars.el	Wed May 03 11:56:53 2006 +0000
@@ -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 'symbolp)
+;;;###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/tool-bar.el	Fri Apr 28 14:48:18 2006 +0000
+++ b/lisp/tool-bar.el	Wed May 03 11:56:53 2006 +0000
@@ -269,21 +269,26 @@
 
       ;; There's no icon appropriate for News and we need a command rather
       ;; than a lambda for Read Mail.
-      ;;(tool-bar-add-item-from-menu 'compose-mail "mail/compose")
+  ;;(tool-bar-add-item-from-menu 'compose-mail "mail/compose")
+
+  (tool-bar-add-item-from-menu 'print-buffer "print")
 
-      (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)")
 
-      (setq tool-bar-setup t))))
+    (tool-bar-add-item "help" (lambda ()
+				(interactive)
+				(popup-menu menu-bar-help-menu))
+		       'help
+		       :help "Pop up the Help menu"))
+  (setq tool-bar-setup t))))
+
 
 (provide 'tool-bar)
-
 ;;; arch-tag: 15f30f0a-d0d7-4d50-bbb7-f48fd0c8582f
 ;;; tool-bar.el ends here
--- a/lispref/ChangeLog	Fri Apr 28 14:48:18 2006 +0000
+++ b/lispref/ChangeLog	Wed May 03 11:56:53 2006 +0000
@@ -1,3 +1,31 @@
+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.
@@ -64,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>
@@ -98,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>
@@ -570,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 28 14:48:18 2006 +0000
+++ b/lispref/intro.texi	Wed May 03 11:56:53 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 28 14:48:18 2006 +0000
+++ b/lispref/modes.texi	Wed May 03 11:56:53 2006 +0000
@@ -2345,8 +2345,8 @@
 * Syntactic Font Lock::         Fontification based on syntax tables.
 * Setting Syntax Properties::   Defining character syntax based on context
                                   using the Font Lock mechanism.
-* Multi line Font Lock Elements:: How to coerce Font Lock into properly
-                                  highlighting multiline elements.
+* Multiline Font Lock::         How to coerce Font Lock into properly
+                                  highlighting multiline constructs.
 @end menu
 
 @node Font Lock Basics
@@ -2625,7 +2625,7 @@
 
 @strong{Warning:} Do not design an element of @code{font-lock-keywords}
 to match text which spans lines; this does not work reliably.
-For details, see @xref{Multi line Font Lock Elements}.
+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
@@ -2944,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}.
@@ -3015,21 +3015,61 @@
 @code{font-lock-defaults}.
 @end defvar
 
-@node Multi line Font Lock Elements
-@subsection Multi line Font Lock Elements
-@cindex multi line font lock
-
-Normally, Font Lock elements specified via @code{font-lock-keywords}
-should not match across multiple lines.  If they do, Font Lock may
-fail to highlight them properly.  This is fundamentally due to the
-fact that Font Lock does not always look at the whole buffer at
-a time, for obvious performance reasons, and instead only looks
-at a small chunk at a time.  In order for the highlight to be correct,
-a chunk should not straddle an element matched by
-@code{font-lock-keywords}.  The default heuristic used for this is to
-start and end chunks at the beginning resp. end of a line.
-
-To work around this limitations, a few tools are provided.
+@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
@@ -3040,60 +3080,75 @@
 @node Font Lock Multiline
 @subsubsection Font Lock Multiline
 
-In order to make it possible to properly highlight elements that span
-multiple lines, Font Lock obeys a special text property
-@code{font-lock-multiline} which if non-@code{nil} indicates that this
-piece of text is part of a multiline construct.  So when Font Lock is
-asked to highlight a region, it first verifies the two boundaries and
-extends them as needed so they do not fall in the middle of a piece of
-text marked with the @code{font-lock-multiline} property.
-Immediately after that, it also erases all @code{font-lock-multiline}
-properties from the region it is about to highlight, so it is the
-responsability of the highlighting specification (mostly
-@code{font-lock-keywords}) to make sure that this property is re-added
-where needed so as to inform the next round of Font Locking of the
-presence of a multiline construct.
-
-It is important to understand that the @code{font-lock-multiline}
-property should preferably only be used on Font Lock elements of
-moderate size: every time that text is modified within the multiline
-elements (or nearby), the whole multiline element will be completely
-re-highlighted, so if its size is large, the time to font-lock may
-render editing painfully slow.
+  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 automatically add the @code{font-lock-multiline}
-property on the keywords that span several lines.  This is no silver
-bullet however since it slows down Font Lock somewhat, and still does
-not always find all multiline constructs, especially when used with
-Jit Lock, which is enabled by default.
+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.
+  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 @c either of
-the following variables:
+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 is a function that
-determines the region to fontify, which Emacs then calls after each
-buffer change.
+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
-directs the caller to fontify the default region).  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.
+@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.
--- a/lispref/objects.texi	Fri Apr 28 14:48:18 2006 +0000
+++ b/lispref/objects.texi	Wed May 03 11:56:53 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/variables.texi	Fri Apr 28 14:48:18 2006 +0000
+++ b/lispref/variables.texi	Wed May 03 11:56:53 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 28 14:48:18 2006 +0000
+++ b/man/ChangeLog	Wed May 03 11:56:53 2006 +0000
@@ -1,16 +1,46 @@
+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): Added documentation for
-	pgg-gpg-use-agent.
+	* pgg.texi (Caching passphrase): Add pgg-gpg-use-agent.
 
 2006-04-24  Bill Wohler  <wohler@newt.com>
 
-	* mh-e.texi (Getting Started): Made it more explicit that you need
-	to install MH, and also included pointers to current MH implementations.
+	* 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>
 
@@ -24,14 +54,14 @@
 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): Renamed from "Managing links".
+	(Handling links): Rename from "Managing links".
 
 2006-04-21  Eli Zaretskii  <eliz@gnu.org>
 
@@ -57,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.
@@ -74,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>
 
@@ -96,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 28 14:48:18 2006 +0000
+++ b/man/building.texi	Wed May 03 11:56:53 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 28 14:48:18 2006 +0000
+++ b/man/calendar.texi	Wed May 03 11:56:53 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 28 14:48:18 2006 +0000
+++ b/man/custom.texi	Wed May 03 11:56:53 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.texi	Fri Apr 28 14:48:18 2006 +0000
+++ b/man/emacs.texi	Wed May 03 11:56:53 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
--- a/man/macos.texi	Fri Apr 28 14:48:18 2006 +0000
+++ b/man/macos.texi	Wed May 03 11:56:53 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/misc.texi	Fri Apr 28 14:48:18 2006 +0000
+++ b/man/misc.texi	Wed May 03 11:56:53 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/src/ChangeLog	Fri Apr 28 14:48:18 2006 +0000
+++ b/src/ChangeLog	Wed May 03 11:56:53 2006 +0000
@@ -1,3 +1,66 @@
+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
@@ -31,7 +94,7 @@
 	* 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 in stretch glyph size so caller doesn't have to
+	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
@@ -1678,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/dispnew.c	Fri Apr 28 14:48:18 2006 +0000
+++ b/src/dispnew.c	Wed May 03 11:56:53 2006 +0000
@@ -4157,7 +4157,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
@@ -4227,7 +4226,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/keymap.c	Fri Apr 28 14:48:18 2006 +0000
+++ b/src/keymap.c	Wed May 03 11:56:53 2006 +0000
@@ -1186,8 +1186,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 28 14:48:18 2006 +0000
+++ b/src/mac.c	Wed May 03 11:56:53 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 28 14:48:18 2006 +0000
+++ b/src/macfns.c	Wed May 03 11:56:53 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 28 14:48:18 2006 +0000
+++ b/src/macgui.h	Wed May 03 11:56:53 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/macterm.c	Fri Apr 28 14:48:18 2006 +0000
+++ b/src/macterm.c	Wed May 03 11:56:53 2006 +0000
@@ -389,16 +389,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));
@@ -420,6 +441,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);
 
@@ -1625,7 +1661,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;
@@ -2136,6 +2172,29 @@
 static int mac_encode_char P_ ((int, XChar2b *, struct font_info *, 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.  */
 
@@ -2152,22 +2211,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
@@ -3122,13 +3180,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)
@@ -3142,13 +3200,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);
 }
@@ -6300,6 +6358,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;
 
@@ -7746,10 +7809,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
       {
@@ -7775,7 +7838,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,
@@ -7791,9 +7854,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)
@@ -7813,7 +7875,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)
@@ -9997,8 +10058,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);
@@ -11050,7 +11123,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 28 14:48:18 2006 +0000
+++ b/src/macterm.h	Wed May 03 11:56:53 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;
@@ -357,6 +362,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)
@@ -603,6 +610,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/syntax.c	Fri Apr 28 14:48:18 2006 +0000
+++ b/src/syntax.c	Wed May 03 11:56:53 2006 +0000
@@ -2123,8 +2123,6 @@
 	      while (1)
 		{
 		  DEC_BOTH (from, from_byte);
-		  if (from == stop)
-		    break;
 		  UPDATE_SYNTAX_TABLE_BACKWARD (from);
 		  c = FETCH_CHAR (from_byte);
 		  if (SYNTAX (c) == Scomment_fence
@@ -2133,6 +2131,8 @@
 		      found = 1;
 		      break;
 		    }
+		  else if (from == stop)
+		    break;
 		}
 	      if (found == 0)
 		{
@@ -2140,6 +2140,9 @@
 		  from_byte = ini_byte;
 		  goto leave;
 		}
+ 	      else
+		/* We have skipped one comment.  */
+		break;
 	    }
 	  else if (code == Sendcomment)
 	    {
--- a/src/unexmacosx.c	Fri Apr 28 14:48:18 2006 +0000
+++ b/src/unexmacosx.c	Wed May 03 11:56:53 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/xdisp.c	Fri Apr 28 14:48:18 2006 +0000
+++ b/src/xdisp.c	Wed May 03 11:56:53 2006 +0000
@@ -8955,6 +8955,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;
 	}
@@ -8967,6 +8970,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
     }
 
@@ -18534,8 +18540,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);
@@ -18937,7 +18942,7 @@
       face_id = FACE_FOR_CHAR (f, face, c);
       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);
--- a/src/xmenu.c	Fri Apr 28 14:48:18 2006 +0000
+++ b/src/xmenu.c	Wed May 03 11:56:53 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.