changeset 90389:146cd8369025

Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-60 Merge from emacs--devo--0 Patches applied: * emacs--devo--0 (patch 259-273) - Update from CVS - lisp/replace.el (occur-engine): Bind `inhibit-field-text-motion' to t - Merge from gnus--rel--5.10 - Rename "field-at-point" to "field-at-pos" - (comint-insert-input): Remove redundant calls to setq and goto-char * gnus--rel--5.10 (patch 99-100) - Merge from emacs--devo--0 - Update from CVS
author Miles Bader <miles@gnu.org>
date Wed, 10 May 2006 20:42:41 +0000
parents a786f674d33f (current diff) b79a60a5fdeb (diff)
children 9b61abfe926b
files ChangeLog Makefile.in admin/ChangeLog admin/FOR-RELEASE etc/ChangeLog etc/MH-E-NEWS etc/NEWS info/dir lib-src/ChangeLog lib-src/etags.c lisp/ChangeLog lisp/add-log.el lisp/arc-mode.el lisp/autorevert.el lisp/avoid.el lisp/battery.el lisp/calc/calc-embed.el lisp/comint.el lisp/cus-start.el lisp/diff-mode.el lisp/dired-aux.el lisp/ediff.el lisp/emacs-lisp/crm.el lisp/emacs-lisp/easy-mmode.el lisp/emacs-lisp/ewoc.el lisp/emacs-lisp/re-builder.el lisp/emacs-lisp/syntax.el lisp/env.el lisp/files.el lisp/font-lock.el lisp/gnus/ChangeLog lisp/gnus/gnus-art.el lisp/gnus/mm-decode.el lisp/ibuffer.el lisp/isearch.el lisp/kmacro.el lisp/ldefs-boot.el lisp/mh-e/ChangeLog lisp/mh-e/mh-e.el lisp/msb.el lisp/mwheel.el lisp/net/tramp.el lisp/progmodes/gdb-ui.el lisp/progmodes/grep.el lisp/progmodes/gud.el lisp/progmodes/idlw-shell.el lisp/progmodes/idlwave.el lisp/progmodes/perl-mode.el lisp/progmodes/vhdl-mode.el lisp/progmodes/xscheme.el lisp/replace.el lisp/server.el lisp/simple.el lisp/speedbar.el lisp/startup.el lisp/subr.el lisp/term.el lisp/term/mac-win.el lisp/term/xterm.el lisp/textmodes/ispell.el lispref/ChangeLog lispref/commands.texi lispref/compile.texi lispref/files.texi lispref/hooks.texi lispref/internals.texi lispref/keymaps.texi lispref/minibuf.texi lispref/nonascii.texi lispref/numbers.texi lispref/variables.texi lispref/windows.texi man/ChangeLog man/Makefile.in man/abbrevs.texi man/buffers.texi man/building.texi man/calendar.texi man/cmdargs.texi man/commands.texi man/custom.texi man/dired.texi man/display.texi man/emacs.texi man/entering.texi man/faq.texi man/files.texi man/frames.texi man/gnu.texi man/help.texi man/killing.texi man/macos.texi man/maintaining.texi man/makefile.w32-in man/mh-e.texi man/mini.texi man/misc.texi man/msdog.texi man/programs.texi man/screen.texi man/sending.texi man/texinfo.tex man/text.texi man/tramp.texi man/trouble.texi man/xresources.texi src/.gdbinit src/ChangeLog src/callproc.c src/coding.h src/image.c src/keyboard.c src/keymap.c src/mac.c src/macfns.c src/macgui.h src/macmenu.c src/macterm.c src/macterm.h src/minibuf.c src/process.c src/sound.c src/termhooks.h src/xdisp.c src/xfaces.c
diffstat 140 files changed, 9006 insertions(+), 6387 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue May 02 08:50:29 2006 +0000
+++ b/ChangeLog	Wed May 10 20:42:41 2006 +0000
@@ -1,3 +1,9 @@
+2006-05-06  Eli Zaretskii  <eliz@gnu.org>
+
+	* Makefile.in (INFO_FILES): Remove emacs-xtra.
+
+	* info/dir: Remove the Emacs-Xtra entry.
+
 2006-04-20 Ramprasad B <ramprasad_i82@yahoo.com>
 
 	* Copyright (sources/emacs): updated copyright year(s)
--- a/Makefile.in	Tue May 02 08:50:29 2006 +0000
+++ b/Makefile.in	Wed May 10 20:42:41 2006 +0000
@@ -135,7 +135,7 @@
 # system, it is inappropriate to imply that it is part of Emacs.
 infodir=@infodir@
 INFO_FILES=ada-mode autotype calc ccmode cl dired-x ebrowse ediff efaq \
-           elisp eintr emacs emacs-mime emacs-xtra eshell eudc flymake \
+           elisp eintr emacs emacs-mime eshell eudc flymake \
            forms gnus idlwave info message mh-e newsticker org pcl-cvs \
            pgg reftex sc ses sieve speedbar tramp vip viper widget     \
            woman smtpmail url rcirc erc
--- a/admin/ChangeLog	Tue May 02 08:50:29 2006 +0000
+++ b/admin/ChangeLog	Wed May 10 20:42:41 2006 +0000
@@ -1,3 +1,8 @@
+2006-05-06  Bill Wohler  <wohler@newt.com>
+
+	* FOR-RELEASE: MH-E 8.0 has been released, so removed reminder
+	about it.
+
 2006-04-17 Ramprasad B <ramprasad_i82@yahoo.com>
 
 	* ./* (Copyright): Updated Copyright year(s)
--- a/admin/FOR-RELEASE	Tue May 02 08:50:29 2006 +0000
+++ b/admin/FOR-RELEASE	Wed May 10 20:42:41 2006 +0000
@@ -23,23 +23,19 @@
 
 ** Ask maintainers of refcard translations to update them.
 
-** Check what should be deleted or updated in MORE.STUFF.
-
 ** Send an email to the various distributions, including the GNOME
 and KDE projects, to use the new Emacs icons in etc/images/icons.
 
-** Ensure MH-E 8.0 has been released.
-Assigned to Bill Wohler <wohler@newt.com>.
-
 * BUGS
 
-** Stefan Monnier's March 20 bug report about 3d boxes in header line.
+** JD Smith's 17 Apr 2006 bug report that CVS operations
+get mysterious unreproducible failures.
+
+** David Hansen's bug report on 16 Apr 2006 about point-entered and
+point-left text properties.
 
 ** Is there a basic problem with cl-byte-compile-compiler-macro?
 
-** Recalculate the tool bar height after changing the default font.
-(Bug report by Yamamoto Mistuharu, 31 Mar 2006)
-
 ** Markus Gritsch's report about Emacs looping on Windoze with the following
 .emacs file, and then reduce Emacs frame width to "something quite narrow":
 	(setq-default truncate-lines t)
@@ -71,97 +67,6 @@
 
 ** Check man/info.texi.
 
-** Add missing years in copyright notices of all files.
-
-Please record your name here and say which part of the distribution
-you're going to handle.
-
-DIRECTORY		STATUS		IN CHARGE
----------		------		---------
-etc (and subdirs)	done		Thien-Thi Nguyen (ttn(@gnu.org))
-leim			done		Kenichi Handa
-lib-src			done		ttn
-lisp			done		ttn
-lisp/calc		done		Jay Belanger
-lisp/calendar		done		Glenn Morris
-lisp/emacs-lisp		done		ttn
-lisp/emulation		done		ttn
-lisp/eshell		done		ttn
-lisp/gnus		done		Romain Francoise
-lisp/international	done		Kenichi Handa
-lisp/language		done		Kenichi Handa
-lisp/mail		done		ttn
-lisp/mh-e		done		Bill Wohler
-lisp/net		done		ttn
-lisp/obsolete		done		ttn
-lisp/play		done		Romain Francoise
-lisp/progmodes		done		Nick Roberts
-lisp/term		done		ttn
-lisp/textmodes		done		ttn
-lisp/url		done		ttn
-lispintro		done		ttn
-lispref			done		ttn
-lwlib			done		ttn
-m4			done		ttn
-mac (and subdirs)	done		ttn
-man			done		ttn
-msdos			done		ttn
-nt (and subdirs)	done		ttn
-oldXMenu		done		ttn
-src (and subdirs)	done		ttn
-vms			done		ttn
-
-** Check the Emacs manual.
-
-Each manual section should be checked for factual correctness
-regarding recent changes by at least two people.  After each file
-name, on the same line or the following line, come the names of the
-people who have checked it.
-
-SECTION             READERS
------------------------------
-man/abbrevs.texi    Chong Yidong    Joakim Verona
-man/anti.texi       Chong Yidong
-man/basic.texi      "Luc Teirlinck"  Chong Yidong
-man/buffers.texi    "Luc Teirlinck"  Chong Yidong
-man/building.texi   "Ted Zlatanov" <tzz@lifelogs.com>
-man/calendar.texi   joakim@verona.se  Chong Yidong
-man/cmdargs.texi    Chong Yidong     "Luc Teirlinck"
-man/commands.texi   "Luc Teirlinck"  Chong Yidong
-man/custom.texi     Chong Yidong     "Luc Teirlinck"
-man/dired.texi      Chong Yidong     joakim@verona.se
-man/display.texi    "Luc Teirlinck"  Chong Yidong
-man/emacs.texi      "Luc Teirlinck"  Lute Kamstra
-man/entering.texi   "Luc Teirlinck"  Chong Yidong
-man/files.texi      "Luc Teirlinck"  Chong Yidong
-man/fixit.texi      "Luc Teirlinck"  Chong Yidong
-man/frames.texi     "Luc Teirlinck"  Chong Yidong
-man/glossary.texi   Chong Yidong
-man/help.texi       "Luc Teirlinck"  Chong Yidong
-man/indent.texi     "Luc Teirlinck"  Chong Yidong
-man/killing.texi    "Luc Teirlinck"  Chong Yidong
-man/kmacro.texi     "Luc Teirlinck"  Chong Yidong
-man/macos.texi      Chong Yidong
-man/maintaining.texi Chong Yidong
-man/major.texi      "Luc Teirlinck"  Chong Yidong
-man/mark.texi       "Luc Teirlinck"  Chong Yidong
-man/mini.texi       "Luc Teirlinck"  Chong Yidong
-man/misc.texi       Chong Yidong
-man/msdog.texi      Chong Yidong
-man/mule.texi       "Luc Teirlinck"  Kenichi Handa
-man/m-x.texi        "Luc Teirlinck"  Chong Yidong
-man/picture.texi    Joakim Verona <joakim@verona.se>   Chong Yidong
-man/programs.texi   "Stephen Eglen"  Chong Yidong
-man/regs.texi       "Luc Teirlinck"   Chong Yidong
-man/rmail.texi      Chong Yidong      "Luc Teirlinck"
-man/screen.texi     "Luc Teirlinck"   Chong Yidong
-man/search.texi     "Luc Teirlinck"   Chong Yidong
-man/sending.texi    Chong Yidong      "Luc Teirlinck"
-man/text.texi       "Luc Teirlinck"   Chong Yidong
-man/trouble.texi    Chong Yidong
-man/windows.texi    "Luc Teirlinck"   Chong Yidong
-man/xresources.texi
-
 ** Check the Emacs Lisp manual.
 
 Each manual section should be checked for factual correctness
--- a/etc/ChangeLog	Tue May 02 08:50:29 2006 +0000
+++ b/etc/ChangeLog	Wed May 10 20:42:41 2006 +0000
@@ -1,3 +1,9 @@
+2006-05-06  Bill Wohler  <wohler@newt.com>
+
+	Release MH-E version 8.0.
+
+	* NEWS, MH-E-NEWS: Update for MH-E release 8.0.
+
 2006-04-28  Bill Wohler  <wohler@newt.com>
 
 	Release MH-E version 7.95.
--- a/etc/MH-E-NEWS	Tue May 02 08:50:29 2006 +0000
+++ b/etc/MH-E-NEWS	Wed May 10 20:42:41 2006 +0000
@@ -6,734 +6,43 @@
 are permitted in any medium without royalty provided the copyright
 notice and this notice are preserved.
 
-* Changes in MH-E 7.95
-
-Version 7.95, the second 8.0 release candidate, fixes a single bug.
-It would be good to check this version ASAP since the Emacs pretest is
-coming in days: if no showstopper problems are found in this version
-it will be promoted to 8.0 before the pretest. Thanks for your help!
-
-** Bug Fixes in MH-E 7.95
-
-*** Folder Completion Fails in fcc: Field
-
-This has been fixed (closes SF #1476270).
-
-* Changes in MH-E 7.94
-
-Version 7.94, the first 8.0 release candidate, fixes a bunch of bugs,
-incorporates new features introduced in Emacs 22.1, improves folder
-completion, and spruces up the tool bar.
-
-** New Features in MH-E 7.94
-
-*** Add :package-version Keyword to Options
-
-This `defcustom', `defgroup', and `defface' keyword was introduced in
-Emacs 22.1. MH-E has been extended to take advantage of it. With this
-keyword, you can now use `M-x customize-changed-options' to see what
-options in MH-E have changed between versions of Emacs. In a future
-version of Emacs, you'll be able to see changes between MH-E versions
-as well (closes SF #1452724).
-
-** Bug Fixes in MH-E 7.94
-
-*** mhparam -components Fails on mailutils
-
-This error prevented MH-E from loading when using GNU mailutils. GNU
-mailutils drops the `s' in this argument, so we did too since
--component still works in nmh and MH (closes SF #1446985).
-
-*** "/ s" Still Has Problems With []'d Mail
-
-On XEmacs, subjects that had special characters would prevent `/ s'
-from narrowing to the given subject. These characters are now quoted
-correctly in XEmacs (closes SF #1447598).
-
-*** Incorrect Example in mh-folder-list Docstring
-
-This has been fixed (closes SF #1448498).
-
-*** Variable mh-send-args Is a String, Not a List
-
-This was causing errors when sending under GNU mailutils. The internal
-variable `mh-send-args' is now a list which fixes the problem (closes
-SF #1448604).
-
-*** Update Icons
-
-Most of the tool bar icons have been replaced by GTK or GNOME 2 icons
-(closes SF #1452715).
-
-*** Can't customize tool bar for current session
-
-If you customized `mh-tool-bar-folder-buttons' or
-`mh-tool-bar-letter-buttons', and clicked Set for Current Session, the
-tool bar was not updated. This has been fixed (closes SF #1452718).
-
-*** Strip Build Number From emacs-version in X-Mailer
-
-This has been done (closes SF #1466481).
-
-*** mh-folder-completion-function Problems
-
-One could not longer browse folders outside of the standard MH Mail
-directory. This has been fixed. As a beneficial side-effect, you can
-once again use SPC to complete folders (closes SF #1470518).
-
-*** Rename Function and Variable Definers
-
-If you had ever shown help for an MH-E symbol that was both a function
-or variable, you might have found that the hyperlink to the file
-brought you to the wrong definition. This has been fixed by renaming
-the macros `mh-defgroup', `mh-defcustom', `mh-defface',
-`mh-defun-compat', and `mh-defmacro-compat' to `defgroup-mh',
-`defcustom-mh', `defface-mh', `defun-mh', `defmacro-mh' respectively
-(closes SF #1472029).
-
-*** mh-insert-letter Uses Wrong Default
-
-If you had used `C-c TAB' (`mh-insert-letter') to insert a letter into
-your draft, specified a different folder, and chose the default
-message number, you got the wrong message. This has been fixed (closes
-SF #1473729).
-
-*** "echo -e" in Makefile Causes Solaris 10 Problem
-
-This construct has been replaced with printf, which is reputed to be
-more portable (closes SF #1467222, #1473908).
-
-* Changes in MH-E 7.93
-
-Version 7.93, the fourth 8.0 beta release, fixes a handful of bugs in
-searching and limiting exposed during continued beta testing.
-
-** Variables Deleted in MH-E 7.93
-
-*** mh-show-use-goto-addr-flag
-
-This flag was redundant and inconsistent with
-`goto-address-highlight-p' at the same time, so we removed it. Please
-customize `goto-address-highlight-p' if you wish to turn off email
-address and URL highlighting.
-
-** Bug Fixes in MH-E 7.93
-
-*** `/ s' Can Miss the Original Mail
-
-The command `/ s' failed to include the message with the "Re:" in the
-Subject. This has been fixed (closes SF #1438369).
-
-*** XEmacs -nw Fails with number-char-or-marker-p Error
-
-Hopefully, this is the last we'll hear of problems associated with
-XEmacs' incompatible `device-color-cells' function (closes SF
-#1436924).
-
-*** Pick-based Searches Fail
-
-The command `C-c C-p' failed to find any matches. This has been fixed
-(closes SF #1435381).
-
-*** Can't Narrow to Subject with Regexp Chars
-
-The command `/ s' could not limit subjects that had special pick
-characters (such as [, *, $, .). This has been fixed (closes SF
-#1432548).
-
-
-
-* Changes in MH-E 7.92
-
-Version 7.92, the third 8.0 beta release, removes the "sed -i" in the
-Makefile (SF #1432060), tunes the setting of `mh-image-load-path',
-works around systems that do not have face inheritance, fixes several
-issues with searching on XEmacs, and creates the correct MIME type
-when including OpenOffice documents.
-
-* Changes in MH-E 7.91
-
-Version 7.91 is the second 8.0 beta release and fixes several bugs
-that were uncovered in wider testing.
-
-* Changes in MH-E 7.90
-
-Version 7.90 is the first 8.0 beta release and is a release that has
-finally broken away from some unfortunate legacy decisions in favor of
-something that will be easier to use and support. Many bugs were fixed
-and many features were added, including making the pick search
-equivalent to the other types of searches.
-
-The rewrite of the manual accelerated dramatically in recent months
-and drove the changes in this release. In order to make the
-manual--and hence the software--better, clearer, more consistent, more
-predictable, and easier to understand, many variables and functions
-were renamed. The changes to the user-visible variables are listed
-here. It is our hope that you, dear MH-E user, will embrace the
-changes for the better and forgive us from making so many incompatible
-changes.
-
-If you use undocumented functionality, be sure to read the ChangeLog
-for changes that might affect you.
-
-** New Features in MH-E 7.90
-
-*** Entry Points Have Moved
-
-Emacs 21 users must now add `(require 'mh-autoloads)' because the
-entry points (such as `mh-rmail' and `mh-smail') have moved to
-different files which have made the autoloads that come with Emacs
-inaccurate. This change was necessary because the code was reorganized
-to remove circular dependencies, to make the code more stable and
-maintainable, and to reduce the time to load MH-E.
-
-*** MH-E No Longer Calls install-mh
-
-The new variant detection code makes use of `mhparam' which assumes
-that your MH environment has already been set up. The code to call
-`install-mh', which could no longer be run anyway, was removed.
-
-*** Use run-hook-with-args
-
-We use normal hooks whenever possible and do not use
-`run-hook-with-args' (with one documented exception) (closes SF
-#643702).
-
-*** Merge mh-index.el and mh-pick.el
-
-We merged `mh-index.el' and `mh-pick.el' into a new file
-`mh-search.el'. As part of this process, the old `F s' behavior of
-adding messages to the search sequence has been removed. The `F i'
-keybinding was then renamed to `F s' (`mh-search'). The mode of the
-search-pattern buffer was renamed from MH-Pick to MH-Search. Within
-the MH-Search buffer, the command `C-c C-p' (`mh-pick-do-search') now
-runs pick on the given folder recursively and displays the results in
-a search folder like the other search methods (closes SF #829207).
-
-*** Improve Security of mh-fetch-x-image-url
-
-The default has been changed to "Never Fetch." Those of you who like
-the value of "Ask Before Fetching" will have to customize this option
-(closes SF #831278).
-
-*** Remove Emacs 20 Support
-
-As it turns out, we had already added some code that didn't work on
-Emacs 20. However, now we've formalized it and removed code that was
-present solely for Emacs 20 support (closes SF #1359240).
-
-*** Derive mh-letter-mode from mail-mode
-
-MH-Letter mode is now derived from `mail-mode'. We were able to delete
-a lot of code. In return, there are a few `mail-mode' commands that
-are available that may or may not be useful and the `mail-mode-hook'
-is run (closes SF #1385571).
-
-*** Add Choices to mh-to-field-choices
-
-In MH-Letter mode, you can use the "C-c C-f (mh-to-field)" prefix to
-go to and insert fields. The fields "Reply-To:", "Mail-Reply-To:",
-"Mail-Followup-To:" can now be created via the "C-r", "C-a" (for
-author), and "C-l" keys respectively. The key for the "From:" field
-has been renamed from "C-r" to "C-m" for consistency with `mail-mode'
-(closes SF #1400139).
-
-*** MH-Folder Keymap Changes
-
-The function `mh-ps-print-toggle-mime' was never implemented and the
-functionality in `mh-ps-print-msg-show' was better afforded by
-`mh-ps-print-msg' and `mh-ps-print-msg-file'.
-
-Key          7.4.85                        7.4.90
-
-F i          mh-index-search               -
-F s          mh-search-folder              mh-search
-P A          mh-ps-print-toggle-mime       -
-P M          mh-ps-print-toggle-mime       -
-P s          mh-ps-print-msg-show          -
-
-*** MH-Letter Keymap Changes
-
-The change where `mh-letter-mode' derives from `mail-mode' adds a few
-keybindings. Some are interesting; experiment! Most of the changes
-have to do with the renaming of the functions with "mhn" in them to
-"mh" because nmh doesn't use `mhn'. The names were also made
-consistent with the the family of "mml" functions.
-
-Key          7.4.85                        7.4.90
-
-C-c C-e      mh-edit-mhn                   mh-mh-to-mime
-C-c C-f C-a  -                             mh-to-field
-C-c C-f C-l  -                             mh-to-field
-C-c C-f RET  -                             mh-to-field
-C-c C-f a    -                             mh-to-field
-C-c C-f l    -                             mh-to-field
-C-c C-f m    -                             mh-to-field
-C-c RET C-g  mh-mhn-compose-anon-ftp       mh-mh-compose-anon-ftp
-C-c RET C-t  mh-mhn-compose-external-compressed-tar
-                                           mh-mh-compose-external-compressed-tar
-C-c RET C-u  mh-revert-mhn-edit            mh-mh-to-mime-undo
-C-c RET C-x  mh-mhn-compose-external-type  mh-mh-compose-external-type
-C-c RET g    mh-mhn-compose-anon-ftp       mh-mh-compose-anon-ftp
-C-c RET t    mh-mhn-compose-external-compressed-tar
-                                           mh-mh-compose-external-compressed-tar
-C-c RET u    mh-revert-mhn-edit            mh-mh-to-mime-undo
-C-c RET x    mh-mhn-compose-external-type  mh-mh-compose-external-type
-
-*** MH-Search Keymap Changes
-
-These are the changes associated with the new search mode. The command
-`C-c C-c' (`mh-index-do-search') now performs the standard indexed
-search, while `C-c C-p' (`mh-pick-do-search') runs pick as before,
-only better!
-
-Key          7.4.85                        7.4.90
-
-C-c C-c      mh-do-search                  mh-index-do-search
-C-c TAB      mh-index-do-search            -
-
-** New Variables in MH-E 7.90
-
-*** mh-after-commands-processed-hook
-
-Hook run by `x' (`mh-execute-commands') after performing outstanding
-refile and delete requests.
-
-*** mh-before-commands-processed-hook
-
-Renamed from `mh-folder-updated-hook'. It wasn't clear whether
-`mh-folder-updated-hook' was run before or after the commands were
-executed. We now provide both with clear names.
-
-*** mh-highlight-citation-style
-
-Renamed from `mh-highlight-citation-p' since it wasn't a boolean. The
-new name is also more descriptive.
-
-*** mh-insert-signature-hook
-
-Renamed from `mh-letter-insert-signature-hook' since most of the other
-hooks do not carry the mode in the prefix and because the new name is
-equally clear.
-
-*** mh-kill-folder-suppress-prompt-hooks
-
-Renamed from `mh-kill-folder-suppress-prompt-hook'. By convention,
-abnormal hooks, which this is, either have a -function or -hooks
-suffix.
-
-*** mh-mhl-format-file
-
-Renamed from `mhl-formfile' to put it in the MH-E namespace and to be
-consistent with other similar options.
-
-*** mh-mh-to-mime-hook
-
-Renamed from `mh-edit-mhn-hook'. We have a family of `mh-mml-to-mime'
-functions and variables; the older mhn functions and variables were
-renamed to have a consistent `mh-mh-to-mime' prefix.
-
-*** mh-new-messages-folders
-
-Renamed from `mh-index-new-messages-folders' for clarity.
-
-*** mh-path
-
-Additional list of directories to search for MH.
-
-*** mh-redist-full-contents-flag
-
-On means the `dist' command needs entire letter for redistribution.
-This was previously a variable. It's now an option.
-
-*** mh-search-mode-hook
-
-Renamed from `mh-pick-mode-hook' as part of the
-`mh-index.el'/`mh-pick.el' merge into `mh-search.el'.
-
-*** mh-search-program
-
-Renamed from `mh-index-program' as part of the
-`mh-index.el'/`mh-pick.el' merge into `mh-search.el'.
-
-*** mh-sortm-args
-
-Additional arguments for `sortm'. This was previously an internal
-variable. It's now an user-customizable option.
-
-*** mh-speed-update-interval
-
-Renamed from `mh-speed-flists-interval' for clarity.
-
-*** mh-ticked-messages-folders
-
-Renamed from `mh-index-ticked-messages-folders' for clarity.
-
-*** mh-xemacs-tool-bar-position
-
-Renamed from `mh-xemacs-toolbar-position' per GNU Emacs naming conventions.
-
-*** mh-xemacs-use-tool-bar-flag
-
-Renamed from `mh-xemacs-use-toolbar-flag' per GNU Emacs naming conventions.
-
-*** mh-yank-behavior
-
-Renamed from `mh-yank-from-start-of-msg' for clarity.
-
-** Variables Deleted in MH-E 7.90
-
-*** mail-citation-hook
-
-This is already defined in `sendmail.el'.
-
-*** mh-edit-mhn-hook
-
-Renamed to `mh-mh-to-mime-hook'.
-
-*** mh-folder-updated-hook
-
-Renamed to `mh-before-commands-processed-hook'.
-
-*** mh-highlight-citation-p
-
-Renamed to `mh-highlight-citation-style'.
-
-*** mh-index-new-messages-folders
-
-Renamed to `mh-new-messages-folders'.
-
-*** mh-index-program
-
-Renamed to `mh-search-program'.
-
-*** mh-index-ticked-messages-folders
-
-Renamed to `mh-ticked-messages-folders'.
-
-*** mh-kill-folder-suppress-prompt-hook
-
-Renamed to `mh-kill-folder-suppress-prompt-hooks'.
-
-*** mh-letter-insert-signature-hook
-
-Renamed to `mh-insert-signature-hook'.
-
-*** mhl-formfile
-
-Renamed to `mh-mhl-format-file'.
-
-*** mh-pick-mode-hook
-
-Renamed to `mh-search-mode-hook'.
-
-*** mh-speed-flists-interval
-
-Renamed to `mh-speed-update-interval'.
-
-*** mh-speed-run-flists-flag
-
-Deleted since setting `mh-speed-flists-interval' to 0 accomplishes the
-same thing.
-
-*** mh-xemacs-toolbar-position
-
-Renamed to `mh-xemacs-tool-bar-position'.
-
-*** mh-xemacs-use-toolbar-flag
-
-Renamed to `mh-xemacs-use-tool-bar-flag'.
-
-*** mh-yank-from-start-of-msg
-
-Renamed to `mh-yank-behavior'.
-
-** Bug Fixes in MH-E 7.90
-
-*** Error Message When Trying to Send Using MH-E
-
-This behavior is no longer observed (closes SF #1002103).
-
-*** "Args out of range" Error in Displaying Message
-
-This behavior is no longer observed (closes SF #1227504).
-
-*** Front-and-back Truncation in mailto: Rendering
-
-This behavior is no longer observed (closes SF #1227510).
-
-*** Completions Offered by mh-refile-message Are Not Sorted
-
-This behavior is no longer observed (closes SF #698734).
-
-*** Add Message-ID to Outgoing Messages
-
-If you replied to a message in your `+outbox', an `In-Reply-To:'
-header field was created that broke threading at the recipient's end.
-We now add a `Message-ID:' to outgoing messages which fixes this
-(closes SF #725425).
-
-*** Speedbar Creating New Folders Instead of Visiting Existing 
-
-This was actually fixed in 7.4.3 (closes SF #792300).
-
-*** Args Out of Range
-
-This compilation error was actually fixed in 7.4.3 (closes SF
-#806577).
-
-*** Initialization Fails If ~/Mail Exists
-
-MH-E no longer calls `install-mh' so this issue has gone away (closes
-SF #835192).
-
-*** RETURN Causes Infinite Loop in mh-letter
-
-This behavior is no longer observed (closes SF #887346).
-
-*** Missing Headers When Replying to All
-
-User needed to edit `replgroupcomps' (closes SF #918194).
-
-*** mh-find-path Doesn't Use mhparam
-
-MH-E no longer peeks into the MH profile `~/.mh_profile' directly. It
-uses `mhparam' instead (closes SF #1016027).
-
-*** mh-index-previous-folder Does Not Work Correctly
-
-If your cursor was on an item below a folder heading and you used
-`M-TAB' (`mh-index-previous-folder'), you would move to the previous
-folder heading. This has been fixed (closes SF #1126188).
-
-*** XEmacs Compile Fails
-
-Compiling produced a "Symbol's value as variable is void: require"
-error on all files. This has been fixed. As a bonus, warnings have
-been reduced from hundreds to just a few (closes SF #1127595).
-
-*** buffer-offer-save Permanent Local
-
-There was a movement to make `buffer-offer-save' a permanent local
-which would have meant that we could not set it in `mh-letter-mode'.
-However, this movement was fraught with issues and was postponed
-(closes SF #1184756).
-
-*** Better Handling of Empty cur Sequence
-
-If you refiled a message into a folder and then used `F r'
-(`mh-rescan-folder') in that folder, your cursor would be taken to the
-first message. The cursor now stays where it was (closes SF #1207247).
-
-*** Name of the Draft File in mh-comp.el
-
-MH is documented to use the draft file. If you use a draft file for
-something else (like Sylpheed), then use draft folders (closes SF
-#1231483).
-
-*** Use Standard Default Notation in Prompts
-
-Emacs changed their defaults in prompts from "Prompt: [value]" to
-"Prompt (default value): ". All MH-E prompts have been updated to
-comply with the new standard (closes SF #1275933).
-
-*** Msg Display Broken After Displaying Msg with Inline Image
-
-Messages with inline images no longer trim certain message header
-fields (closes SF #1306141).
-
-*** mh-visit-folder Munges font-lock-keywords
-
-MH-E broke highlighting in Gnus buffers. This was actually a problem
-in CVS Emacs 22 and has been fixed there (closes SF #1393879).
-
-*** Illegal Filename Chars for W32 Filesystems
-
-Windows users who view `X-Image-URL:' images could not cache the
-images since the cached image file names had illegal characters. This
-has been fixed (closes SF #1396499).
-
-*** mh-send Doesn't Handle mml Insertions Via mail-user-agent
-
-Can now forward messages in Gnus if MH-E is your `mail-user-agent'
-(closes SF #1399307).
-
-
-
-* Changes in MH-E 7.85
-
-Version 7.85 heralds a migration of the CVS repository from
-SourceForge to Savannah only for those files that were already part of
-Emacs. As a result, two incompatibilities were introduced with this
-release: the location of MH-E in the load-path has changed, and
-mh-e-autoloads.el was renamed to mh-autoloads.el. While this migration
-will benefit maintainers, it will also benefit users: CVS Emacs users
-will not have to check out MH-E separately and welcome faster MH-E
-updates, and CVS MH-E users will welcome faster MH-E updates from
-Emacs developers. Read section CVS MH-E INSTALL in the README for
-details.
-
-MH-E now works on a Mac. See section INSTALL in the README for details.
-
-** Bug Fixes in MH-E 7.85
-
-*** Prompts Now Follow Current Conventions 
-
-Instead of "Prompt: [<default>] ", the prompts now look like "Prompt
-(default: <default>): ".
-
-*** Face Variable Names Now Follow Current Conventions
-
-The -face suffix has been dropped from all face names. 
-
-*** Default Identity Prevents Insertion of Auto Fields
-
-Auto insertion of an identity now occurs even when the default
-identity is used (closes SF #1204506).
-
-*** mh-compose-forward and Default Message Number
-
-mh-compose-forward will now default to the sent message in the sent
-folder and the `cur' message in other folders. It also takes ranges of
-messages and can include multiple messages at a time (closes SF
-#1205890).
-
-*** mh-customize Uses Group mh, Not mh-e
-
-The `mh' customization group alias has been deleted to avoid some
-problems that were found (closes SF #1213716).
-
-*** font-lock Error in mh-letter-mode
-
-An error in MH-E was introduced as a result of a change in CVS Emacs.
-This has been fixed (closes SF #1241017).
-
-
-
-* Changes in MH-E 7.84
-
-Version 7.84 contains no user-visible changes. This version
-incorporates changes made in CVS Emacs such as the removal of some
-deprecated software.
-
-* Changes in MH-E 7.83
-
-Version 7.83 fixes a handful of bugs, adds colors to buttons for
-signed or encrypted messages, and contains some documentation changes
-related to the upcoming release of the manual. Some options were moved
-to other customization groups as a result.
+* Changes in MH-E 8.0
+
+Version 8.0 supports GNU mailutils, S/MIME, picons, which-func-mode,
+sports an improved interface for hiding header fields, improves upon
+the MH variant detection, improves folder completion, makes the pick
+search equivalent to the other types of searches, spruces up the tool
+bar, creates the correct MIME type when including OpenOffice
+documents, works on a Mac, adds colors to buttons for signed or
+encrypted messages, incorporates new features introduced in
+Emacs 22.1, fixes a bunch of bugs, and best of all, comes with an
+updated manual!
+
+Internally, MH-E now sports a new software organization which will
+help future maintainability. As a side-effect, the number of XEmacs
+compilation warnings has plummeted from hundreds to just three. CVS
+users will notice that MH-E has been migrated from the CVS repository
+from SourceForge to Savannah (but only for those files that were
+already part of Emacs). As a result, the location of MH-E in the
+load-path has changed, and mh-e-autoloads.el was renamed to
+mh-autoloads.el. See section INSTALL in the README for details. While
+this migration will benefit maintainers, it will also benefit users:
+CVS Emacs users will not have to check out MH-E separately and welcome
+faster MH-E updates, and CVS MH-E users will welcome faster MH-E
+updates from Emacs developers. Read section CVS MH-E INSTALL in the
+README for details.
 
 While not related to this release, the MH-E mailing lists are now
 gatewayed at gmane.org (closes SF #979308).
 
-** New Variables in MH-E 7.83
-
-*** mh-show-pgg-bad-face
-
-Face used to highlight a bad PGG signature.
-
-*** mh-show-pgg-good-face
-
-Face used to highlight a good PGG signature.
-
-*** mh-show-pgg-unknown-face
-
-Face used to highlight a PGG signature whose status is unknown. This
-face is also used for a signature when the signer is untrusted.
-
-** Bug Fixes in MH-E 7.83
-
-*** Whitespace in pick Expressions
-
-The "C-u / s RET" command now works. In addition, you can now add
-whitespace to any of the limiting (/) commands (closes SF #1122655).
-
-*** auto-mode-alist Updated
-
-MH-E originally updated auto-mode-alist to set the major mode of
-drafts. Now that we explicitly set the mode, there is no reason to do
-this, and this behavior caused problems for people who didn't use MH-E
-who were editing files that looked like MH message files (closes SF
-#1032353).
-
-*** mh-show-unquote-From Fails (read-only buffer)
-
-MH-E quotes the "From " header field that is inserted by MTAs.
-However, it was trying to do this in a read-only buffer. This has been
-fixed (closes SF #1089870).
-
-*** rmmproc Refile Complains No Such Message
-
-MH-E would get confused about which folder to delete messages from if
-you were refiling and deleting messages at the same time. This has
-been fixed (closes SF #1023959).
-
-*** ! Doesn't Do Regions
-
-Now it does (closes SF #1046330).
-
-*** Swish Fixes
-
-Items in swish indexes that aren't mail messages are now handled more
-gracefully.
-
-*** Spamassassin Fixes
-
-If you use spamassassin, there was an error when you tried to junk
-mail if the option mh-junk-background was set. This has been fixed.
-
-*** Mairix Support
-
-Indexing now compatible with Mairix version 0.12 and later.
+If you want to see the release notes for the alpha and beta releases
+leading up this release, please see:
+
+  http://cvs.savannah.gnu.org/viewcvs/emacs/etc/MH-E-NEWS?rev=1.25&root=emacs&view=markup
 
 
 
-* Changes in MH-E 7.82
-
-Version 7.82 continues to address the saga surrounding the use of CL
-macros in CVS Emacs and fixes the auto-detection of vanilla MH (closes
-SF #1014781).
-
-* Changes in MH-E 7.81
-
-Version 7.81 fixes a `wrong-type-argument' argument error that
-sometimes occurred when processing the Message-ID, adds the ";
-(mh-toggle-mh-decode-mime-flag)" command, and uses ":default" instead
-of "default" in `mh-identity-handlers' to avoid problems with
-"Default:" as a user defined field. If you have modified
-`mh-identity-handlers' in your .emacs, you'll need to rename "default"
-to ":default". This release also corrects the release numbering; the
-previous version number was intended to be 7.80.
-
-
-
-* Changes in MH-E 7.4.80
-
-Version 7.4.80 now supports GNU mailutils, S/MIME, picons,
-which-func-mode, has an improved interface for hiding header fields,
-improves upon the MH variant detection, and contains many bug fixes.
-Those of you familiar with the GNU version numbering schemes will
-recognize this as an alpha release. This does not reflect on the
-quality of this release which is as high as it has always been.
-Although we are not ready to release 8.0, we want you to have access
-to the work that has been hiding in CVS. At the same time we want to
-make it clear that there are incompatible changes with previous
-versions.
-
-We are planning to release the long-awaited manual update synchronized
-with version 8.0. We are using documentation from the manual in the
-docstrings which is hoped to make "C-h f (describe-function)" really
-useful and create a seamless experience when switching back and forth
-between the manual and the docstrings. This has been done in about
-half of the variables and functions in this version.
-
-The writing of the manual has revealed a few inconsistencies in the
-software whose fixes have resulted in incompatible changes, and there
-may well be more. So, unlike version 7 which was chock full of new
-features, version 8's strengths will include complete documentation
-and higher quality.
-
-** New Features in MH-E 7.4.80
+** New Features in MH-E 8.0
 
 *** GNU mailutils Support
 
@@ -749,16 +58,149 @@
 of a message, MH-E can now display images from a picon directory. The
 directory search path is found in the `mh-picon-directory-list'
 variable. More documentation is found in the "facedb" sections in the
-xfaces man page. [NOTE: need to make mh-picon-directory-list an option
-and add xfaces facedb documentation to it.]
-
-*** X-Image-URL Updates
+xfaces man page.
+
+*** Catchup Command
+
+There is a new `F c' (`mh-catchup') command that marks all unread
+messages in the current folder as read.
+
+*** Use which-func-mode to Display Folder in Index Mode
+
+Turning on `which-func-mode' displays the folder name of the message
+under the cursor in index folders (closes SF #855520).
+
+*** Quick Key Help
+
+The `?' (`mh-help') function now displays the help in its own buffer
+called *MH-E Help* (closes SF #493740 and SF #656631).
+
+*** Search Unification
+
+The old `F s' behavior of adding messages to the search sequence has
+been removed. The `F i' keybinding was deprecated and the new `F s'
+(`mh-search') command is used to initiate either indexed or pick
+searches. Within the MH-Search buffer (renamed from MH-Pick), the
+command `C-c C-p' (`mh-pick-do-search') now runs pick on the given
+folder recursively and displays the results in a search folder like
+the other search methods (closes SF #829207).
+
+*** Entry Points Have Moved
+
+Emacs 21 users must now add `(require 'mh-autoloads)' because the
+entry points (such as `mh-rmail' and `mh-smail') have moved to
+different files which have made the autoloads that come with Emacs
+inaccurate. This change was necessary because the code was reorganized
+to remove circular dependencies, to make the code more stable and
+maintainable, and to reduce the time to load MH-E.
+
+*** MH-Folder Keymap Changes
+
+There is now a keymap for the printing functions whose prefix is `P'.
+The command `l' (`mh-print-msg') has been replaced with `P l' although
+we suggest you use the new `P p' instead.
+
+Key          7.4.4                         8.0
+
+;            -                             mh-toggle-mh-decode-mime-flag
+l            mh-print-msg                  -
+/ f          mh-narrow-to-from             -
+/ r          mh-narrow-to-range            -
+/ g          -                             mh-narrow-to-range
+/ m          -                             mh-narrow-to-from
+F c          -                             mh-catchup
+F i          mh-index-search               -
+F s          mh-search-folder              mh-search
+K e          -                             mh-display-with-external-viewer
+K t          -                             mh-toggle-mime-buttons
+P ?          -                             mh-prefix-help
+P C          -                             mh-ps-print-toggle-color
+P F          -                             mh-ps-print-toggle-faces
+P f          -                             mh-ps-print-msg-file
+P l          -                             mh-print-msg
+P p          -                             mh-ps-print-msg
+
+*** MH-Letter Keymap Changes
+
+The change where `mh-letter-mode' derives from `mail-mode' adds a few
+keybindings. Some are interesting: experiment! Only the keybinding
+changes for MH-E functions are listed here.
+
+Most of the changes have to do with the renaming of the functions with
+"mhn" in them to "mh" because nmh doesn't use `mhn'. The names were
+also made consistent with the the family of "mml" functions.
+
+The type of signing or encryption has been generalized so the method
+is now an option rather than a part of the function's name. The option
+is `mh-mml-method-default' and choices include PGP (MIME), PGP,
+S/MIME, or none.
+
+Key          7.4.4                         8.0
+
+C-c C-e      mh-edit-mhn                   mh-mh-to-mime
+C-c RET C-e  mh-mml-secure-message-encrypt-pgpmime
+                                           mh-mml-secure-message-encrypt
+C-c RET C-g  -                             mh-mh-compose-anon-ftp
+C-c RET C-n  -                             mh-mml-unsecure-message
+C-c RET C-s  mh-mml-secure-message-sign-pgpmime
+                                           mh-mml-secure-message-sign
+C-c RET C-t  -                             mh-mh-compose-external-compressed-tar
+C-c RET C-u  mh-revert-mhn-edit            mh-mh-to-mime-undo
+C-c RET C-x  -                             mh-mh-compose-external-type
+C-c RET e    mh-mml-secure-message-encrypt-pgpmime
+                                           Prefix Command
+C-c RET e e  -                             mh-mml-secure-message-encrypt
+C-c RET e s  -                             mh-mml-secure-message-signencrypt
+C-c RET g    -                             mh-mh-compose-anon-ftp
+C-c RET n    -                             mh-mml-unsecure-message
+C-c RET s    -                             Prefix Command
+C-c RET s e  -                             mh-mml-secure-message-signencrypt
+C-c RET s s  -                             mh-mml-secure-message-sign
+C-c RET t    -                             mh-mh-compose-external-compressed-tar
+C-c RET u    mh-revert-mhn-edit            mh-mh-to-mime-undo
+C-c RET x    -                             mh-mh-compose-external-type
+
+C-c C-f C-a  -                             mh-to-field
+C-c C-f C-l  -                             mh-to-field
+C-c C-f RET  -                             mh-to-field
+C-c C-f a    -                             mh-to-field
+C-c C-f l    -                             mh-to-field
+C-c C-f m    -                             mh-to-field
+
+*** MH-Search Keymap Changes
+
+These are the changes associated with the new search mode. The command
+`C-c C-c' (`mh-index-do-search') now performs the standard indexed
+search, while `C-c C-p' (`mh-pick-do-search') runs pick as before,
+only better!
+
+The `mh-to-field' keybindings were adjusted to be consistent with
+those in the MH-Letter mode.
+
+Key          7.4.4                         8.0
+
+C-c C-c      mh-do-search                  mh-index-do-search
+C-c C-f C-d  mh-to-field                   -
+C-c C-f C-f  mh-to-field                   -
+C-c C-f C-r  mh-to-field                   -
+C-c C-f RET  -                             mh-to-field
+C-c C-f d    mh-to-field                   -
+C-c C-f f    mh-to-field                   -
+C-c C-f m    -                             mh-to-field
+C-c C-f r    mh-to-field                   -
+C-c TAB      mh-index-do-search            -
+
+*** Updates to X-Image-URL
 
 Now support the use of `curl' and `fetch' as alternatives to `wget' to
 obtain the image. The display of images are controlled with the
 `mh-show-use-xface-flag' option while the `mh-fetch-x-image-url'
 option controls how the images are fetched.
 
+The default of `mh-fetch-x-image-url' has been changed to "Never
+Fetch." Those of you who like the value of "Ask Before Fetching" will
+have to customize this option (closes SF #831278).
+
 WARNING: There are security concerns with this feature. Please read
 the documentation for these options carefully before changing the
 default.
@@ -791,115 +233,85 @@
 If you point your signature at a vCard file with a vcf suffix, then it
 will be incorporated as a vCard body part (closes SF #802723).
 
-*** Catchup Command
-
-There is a new "F c (mh-catchup)" command that marks all unread
-messages in the current folder as read.
+*** Updates to Speedbar
+
+The speedbar now renders the folders with unseen messages in boldface
+which makes them easier to identify (closes SF #623369).
+
+*** Updates to mh-msg-is-in-seq
+
+Can now specify an alternate message number to `S s'
+(`mh-msg-is-in-seq') with a prefix argument.
+
+*** Updates to mh-to-field-choices
+
+In MH-Letter mode, you can use the `C-c C-f' (`mh-to-field') prefix to
+go to and insert fields. The fields `Reply-To:', `Mail-Reply-To:',
+`Mail-Followup-To:' can now be created via the `C-r', `C-a' (for
+author), and `C-l' keys respectively. The key for the `From:' field
+has been renamed from `C-r' to `C-m' for consistency with `mail-mode'
+(closes SF #1400139).
 
 *** Change Content-Type Renderer on the Fly in MH-Show Buffer
 
-This has been implemented by adding the key binding "K e
-(mh-display-with-external-viewer)". For inline text/html parts,
-buttons aren't displayed by default. In that case use "K t
-(mh-toggle-mime-buttons)" to display the button before viewing it with
-an external browser (closes SF #839318).
-
-*** Use which-func-mode to Display Folder in Index Mode
-
-Turning on `which-func-mode' displays the folder name of the message
-under the cursor in index folders (closes SF #855520).
+This has been implemented by adding the key binding `K e'
+(`mh-display-with-external-viewer'). For inline text/html parts,
+buttons aren't displayed by default. In that case use `K t'
+(`mh-toggle-mime-buttons') to display the button before viewing it
+with an external browser (closes SF #839318).
+
+*** MH-E No Longer Calls install-mh
+
+The new variant detection code makes use of `mhparam' which assumes
+that your MH environment has already been set up. The code to call
+`install-mh', which could no longer be run anyway, was removed.
+
+*** Add :package-version Keyword to Options
+
+This `defcustom', `defgroup', and `defface' keyword was introduced in
+Emacs 22.1. MH-E has been extended to take advantage of it. With this
+keyword, you can now use `M-x customize-changed-options' to see what
+options in MH-E have changed between versions of Emacs. In a future
+version of Emacs, you'll be able to see changes between MH-E versions
+as well (closes SF #1452724).
 
 *** Render Signature and vCard in Italics
 
 This has been implemented.  Use `mh-show-signature-face' to customize
 the face used (closes SF #802722).
 
-*** New Print Map
-
-There is now a keymap for the printing functions whose prefix is "P".
-The command "l (mh-print-msg)" has been replaced with "P l". Other new
-functions in this keymap include:
-
-    P A         mh-ps-print-toggle-mime
-    P C         mh-ps-print-toggle-color
-    P F         mh-ps-print-toggle-faces
-    P M         mh-ps-print-toggle-mime
-    P f         mh-ps-print-msg-file
-    P l         mh-print-msg
-    P p         mh-ps-print-msg
-    P s         mh-ps-print-msg-show
-
-*** Draft Buffer Keymap Changes
-
-The keymap in the draft buffer has been modified slightly. The old
-anonymous ftp and tar composition commands have been reinstated and
-letter signing and encrypting keymaps have been added.
-
-The type of signing or encryption has been generalized so the method
-is now an option rather than a part of the function's name. The option
-is `mh-mml-method-default' and choices include PGP (MIME), PGP,
-S/MIME, or none.
-
-Key		7.4.4			7.4.80
-
-C-c RET C-e	mh-mml-secure-message-encrypt-pgpmime
-					mh-mml-secure-message-encrypt
-C-c RET C-s	mh-mml-secure-message-sign-pgpmime
-					-
-C-c RET C-g	-			mh-mhn-compose-anon-ftp
-C-c RET C-n	-			mh-mml-unsecure-message
-C-c RET C-s	-			mh-mml-secure-message-sign
-C-c RET C-t	-			mh-mhn-compose-external-compressed-tar
-C-c RET C-s	mh-mml-secure-message-sign-pgpmime
-					mh-mml-secure-message-sign
-C-c RET C-x	-			mh-mhn-compose-external-type
-C-c RET e	mh-mml-secure-message-encrypt-pgpmime
-					Prefix Command
-C-c RET e e	-			mh-mml-secure-message-encrypt
-C-c RET e s	-			mh-mml-secure-message-signencrypt
-C-c RET g	-			mh-mhn-compose-anon-ftp
-C-c RET n	-			mh-mml-unsecure-message
-C-c RET s	mh-mml-secure-message-sign-pgpmime
-					Prefix Command
-C-c RET s e	-			mh-mml-secure-message-signencrypt
-C-c RET s s	-			mh-mml-secure-message-sign
-C-c RET t	-			mh-mhn-compose-external-compressed-tar
-C-c RET x	-			mh-mhn-compose-external-type
-
-*** Speedbar: Highlight Folders With Unseen
-
-The speedbar now renders the folders with unseen messages in boldface
-which makes them easier to identify (closes SF #623369).
-
-*** Quick Key Help
-
-The "? (mh-help)" function now displays the help in its own buffer
-called *MH-E Help* (closes SF #493740 and SF #656631).
-
-*** New Startup File mh-e-autoloads.el
-
-If you are installing MH-E yourself, then you can replace any
-autoloads you may have with "(require 'mh-e-autoloads.el)". See the
-README for details.
+*** Derive mh-letter-mode from mail-mode
+
+MH-Letter mode is now derived from `mail-mode'. We were able to delete
+a lot of code. In return, there are a few `mail-mode' commands that
+are available that may or may not be useful and the `mail-mode-hook'
+is run (closes SF #1385571).
+
+*** Remove Emacs 20 Support
+
+As it turns out, we had already added some code that didn't work on
+Emacs 20. However, now we've formalized it and removed code that was
+present solely for Emacs 20 support (closes SF #1359240).
 
 *** Glimpse Support Removed
 
 Since glimpse isn't free, we cannot mention it. Glimpse has been
 removed from the option `mh-indexer-choices' (closes SF #831276).
 
-*** mh-msg-is-in-seq Update
-
-Can now specify an alternate message number to "S s
-(mh-msg-is-in-seq)" with a prefix argument.
-
-** New Variables in MH-E 7.4.80
-
-Variables that have been added to MH-E that have not been discussed
-elsewhere are listed here.
-
-*** mail-citation-hook
-
-Hook for modifying a citation just inserted in the mail buffer.
+*** Use run-hook-with-args
+
+We use normal hooks whenever possible and do not use
+`run-hook-with-args' (with one documented exception) (closes SF
+#643702).
+
+
+
+** New Variables in MH-E 8.0
+
+*** mh-after-commands-processed-hook
+
+Hook run by `x' (`mh-execute-commands') after performing outstanding
+refile and delete requests.
 
 *** mh-alias-reloaded-hook
 
@@ -907,16 +319,42 @@
 
 *** mh-auto-fields-prompt-flag
 
-Non-nil means to prompt before sending if fields in
-`mh-auto-fields-list' are inserted.
+On means to prompt before sending if fields in `mh-auto-fields-list'
+are inserted.
+
+*** mh-before-commands-processed-hook
+
+Renamed from `mh-folder-updated-hook'. It wasn't clear whether
+`mh-folder-updated-hook' was run before or after the commands were
+executed. We now provide both with clear names.
+
+*** mh-compose-forward-as-mime-flag
+
+On means that messages are forwarded as attachments (closes SF
+#827203).
 
 *** mh-default-folder-for-message-function
 
-Function to select a default folder for refiling or `Fcc'.
+Function to select a default folder for refiling or `Fcc:'.
 
 *** mh-forward-hook
 
-Invoked on the forwarded letter by "f (mh-forward)".
+Invoked on the forwarded letter by `f' (`mh-forward').
+
+*** mh-highlight-citation-style
+
+Renamed from `mh-highlight-citation-p' since it wasn't a boolean. The
+new name is also more descriptive.
+
+*** mh-identity-handlers
+
+Handler functions for fields in `mh-identity-list'.
+
+*** mh-insert-signature-hook
+
+Renamed from `mh-letter-insert-signature-hook' since most of the other
+hooks do not carry the mode in the prefix and because the new name is
+equally clear.
 
 *** mh-invisible-header-fields-default
 
@@ -936,14 +374,76 @@
 the foreground, but this option can be used to put them back in the
 background.
 
+*** mh-junk-disposition
+
+Renamed from `mh-junk-mail-folder' since this variable can accept
+values other than folder names.
+
+*** mh-kill-folder-suppress-prompt-hooks
+
+Renamed from `mh-kill-folder-suppress-prompt-hook'. By convention,
+abnormal hooks, which this is, either have a -function or -hooks
+suffix.
+
+*** mh-mhl-format-file
+
+Renamed from `mhl-formfile' to put it in the MH-E namespace and to be
+consistent with other similar options.
+
+*** mh-mh-to-mime-hook
+
+Renamed from `mh-edit-mhn-hook'. We have a family of `mh-mml-to-mime'
+functions and variables; the older mhn functions and variables were
+renamed to have a consistent `mh-mh-to-mime' prefix.
+
+*** mh-mml-method-default
+
+Default method to use in security tags.
+
+*** mh-new-messages-folders
+
+Renamed from `mh-index-new-messages-folders' for clarity.
+
+*** mh-path
+
+Additional list of directories to search for MH.
+
+*** mh-redist-full-contents-flag
+
+On means the `dist' command needs entire letter for redistribution.
+This was previously a variable. It's now an option.
+
+*** mh-search-mode-hook
+
+Renamed from `mh-pick-mode-hook' as part of the
+`mh-index.el'/`mh-pick.el' merge into `mh-search.el'.
+
+*** mh-search-program
+
+Renamed from `mh-index-program' as part of the
+`mh-index.el'/`mh-pick.el' merge into `mh-search.el'.
+
 *** mh-signature-separator-flag
 
-Non-nil means a signature separator should be inserted. It is not
+On means a signature separator should be inserted. It is not
 recommended that you change this option since various mail user
 agents, including MH-E, use the separator to present the signature
 differently, and to suppress the signature when replying or yanking a
 letter into a draft.
 
+*** mh-sortm-args
+
+Additional arguments for `sortm'. This was previously an internal
+variable. It's now an user-customizable option.
+
+*** mh-speed-update-interval
+
+Renamed from `mh-speed-flists-interval' for clarity.
+
+*** mh-ticked-messages-folders
+
+Renamed from `mh-index-ticked-messages-folders' for clarity.
+
 *** mh-variant
 
 Specifies the variant used by MH-E. The default setting of this option
@@ -963,23 +463,356 @@
 rewritten and it is very likely that you no longer to set them and
 their setting may confuse other MH-E settings.
 
-** Variables Deleted in MH-E 7.4.80
-
-Variables that have been removed from MH-E that have not been
-discussed elsewhere are listed here.
+*** mh-xemacs-tool-bar-position
+
+Renamed from `mh-xemacs-toolbar-position' per GNU Emacs naming conventions.
+
+*** mh-xemacs-use-tool-bar-flag
+
+Renamed from `mh-xemacs-use-toolbar-flag' per GNU Emacs naming conventions.
+
+*** mh-yank-behavior
+
+Renamed from `mh-yank-from-start-of-msg' for clarity.
+
+
+
+** Variables Deleted in MH-E 8.0
 
 *** mh-alias-system-aliases
 
 System definitions should not be a user option.
 
+*** mh-edit-mhn-hook
+
+Renamed to `mh-mh-to-mime-hook'.
+
+*** mh-folder-updated-hook
+
+Renamed to `mh-before-commands-processed-hook'.
+
+*** mh-highlight-citation-p
+
+Renamed to `mh-highlight-citation-style'.
+
+*** mh-index-new-messages-folders
+
+Renamed to `mh-new-messages-folders'.
+
+*** mh-index-program
+
+Renamed to `mh-search-program'.
+
+*** mh-index-ticked-messages-folders
+
+Renamed to `mh-ticked-messages-folders'.
+
 *** mh-junk-mail-folder
 
 Since this variable can accept values other than folder names, it was
 renamed to `mh-junk-disposition' to more accurately reflect the content.
 
-** Bug Fixes in MH-E 7.4.80
-
-Many bugs were fixed in this version that aren't listed below.
+*** mh-kill-folder-suppress-prompt-hook
+
+Renamed to `mh-kill-folder-suppress-prompt-hooks'.
+
+*** mh-letter-insert-signature-hook
+
+Renamed to `mh-insert-signature-hook'.
+
+*** mh-pick-mode-hook
+
+Renamed to `mh-search-mode-hook'.
+
+*** mh-show-use-goto-addr-flag
+
+This flag was redundant with and inconsistent with
+`goto-address-highlight-p' at the same time, so we removed it. Please
+customize `goto-address-highlight-p' if you wish to turn off email
+address and URL highlighting.
+
+*** mh-speed-flists-interval
+
+Renamed to `mh-speed-update-interval'.
+
+*** mh-speed-run-flists-flag
+
+Deleted since setting `mh-speed-flists-interval' to 0 accomplishes the
+same thing.
+
+*** mh-visible-header-fields
+
+Deleted since it would hide new header fields you might want to see.
+
+*** mh-xemacs-toolbar-position
+
+Renamed to `mh-xemacs-tool-bar-position'.
+
+*** mh-xemacs-use-toolbar-flag
+
+Renamed to `mh-xemacs-use-tool-bar-flag'.
+
+*** mh-yank-from-start-of-msg
+
+Renamed to `mh-yank-behavior'.
+
+*** mhl-formfile
+
+Renamed to `mh-mhl-format-file'.
+
+
+
+** New Faces in MH-E 8.0
+
+*** mh-folder-address
+
+Renamed from `mh-folder-address-face' per new Emacs conventions.
+
+*** mh-folder-body
+
+Renamed from `mh-folder-body-face' per new Emacs conventions.
+
+*** mh-folder-cur-msg-number
+
+Renamed from `mh-folder-cur-msg-number-face' per new Emacs conventions.
+
+*** mh-folder-date
+
+Renamed from `mh-folder-date-face' per new Emacs conventions.
+
+*** mh-folder-deleted
+
+Renamed from `mh-folder-deleted-face' per new Emacs conventions.
+
+*** mh-folder-followup
+
+Renamed from `mh-folder-followup-face' per new Emacs conventions.
+
+*** mh-folder-msg-number
+
+Renamed from `mh-folder-msg-number-face' per new Emacs conventions.
+
+*** mh-folder-refiled
+
+Renamed from `mh-folder-refiled-face' per new Emacs conventions.
+
+*** mh-folder-sent-to-me-hint
+
+Fontification hint face in messages sent directly to us.
+
+*** mh-folder-sent-to-me-sender
+
+Sender face in messages sent directly to us.
+
+*** mh-folder-subject
+
+Renamed from `mh-folder-subject-face' per new Emacs conventions.
+
+*** mh-folder-tick
+
+Renamed from `mh-folder-tick-face' per new Emacs conventions.
+
+*** mh-folder-to
+
+Renamed from `mh-folder-to-face' per new Emacs conventions.
+
+*** mh-letter-header-field
+
+Renamed from `mh-letter-header-field-face' per new Emacs conventions.
+
+*** mh-search-folder
+
+Renamed from `mh-index-folder-face'.
+
+*** mh-show-cc
+
+Renamed from `mh-show-cc-face' per new Emacs conventions.
+
+*** mh-show-date
+
+Renamed from `mh-show--face' per new Emacs conventions.
+
+*** mh-show-from
+
+Renamed from `mh-show-from-face' per new Emacs conventions.
+
+*** mh-show-header
+
+Renamed from `mh-show-header-face' per new Emacs conventions.
+
+*** mh-show-pgg-bad
+
+Face used to highlight a bad PGG signature.
+
+*** mh-show-pgg-good
+
+Face used to highlight a good PGG signature.
+
+*** mh-show-pgg-unknown
+
+Face used to highlight a PGG signature whose status is unknown. This
+face is also used for a signature when the signer is untrusted.
+
+*** mh-show-signature
+
+Face used to highlight the signature.
+
+*** mh-show-subject
+
+Renamed from `mh-show-subject-face' per new Emacs conventions.
+
+*** mh-show-to
+
+Renamed from `mh-show-to-face' per new Emacs conventions.
+
+*** mh-show-xface
+
+Renamed from `mh-show-xface-face' per new Emacs conventions.
+
+*** mh-speedbar-folder
+
+Renamed from `mh-speedbar-folder-face' per new Emacs conventions.
+
+*** mh-speedbar-folder-with-unseen-messages
+
+Renamed from `mh-speedbar-folder-with-unseen-messages-face' per new
+Emacs conventions.
+
+*** mh-speedbar-selected-folder
+
+Renamed from `mh-speedbar-selected-folder-face' per new Emacs conventions.
+
+*** mh-speedbar-selected-folder-with-unseen-messages
+
+Renamed from `mh-speedbar-selected-folder-with-unseen-messages-face'
+per new Emacs conventions. 
+
+
+
+** Faces Deleted in MH-E 8.0
+
+*** mh-folder-address-face
+
+Renamed to `mh-folder-address' per new Emacs conventions.
+
+*** mh-folder-body-face
+
+Renamed to `mh-folder-body' per new Emacs conventions.
+
+*** mh-folder-cur-msg-face
+
+Deleted. Not used.
+
+*** mh-folder-cur-msg-number-face
+
+Renamed to `mh-folder-cur-msg-number' per new Emacs conventions.
+
+*** mh-folder-date-face
+
+Renamed to `mh-folder-date' per new Emacs conventions.
+
+*** mh-folder-deleted-face
+
+Renamed to `mh-folder-deleted' per new Emacs conventions.
+
+*** mh-folder-followup-face
+
+Renamed to `mh-folder-followup' per new Emacs conventions.
+
+*** mh-folder-msg-number-face
+
+Renamed to `mh-folder-msg-number' per new Emacs conventions.
+
+*** mh-folder-refiled-face
+
+Renamed to `mh-folder-refiled' per new Emacs conventions.
+
+*** mh-folder-subject-face
+
+Renamed to `mh-folder-subject' per new Emacs conventions.
+
+*** mh-folder-tick-face
+
+Renamed to `mh-folder-tick' per new Emacs conventions.
+
+*** mh-folder-to-face
+
+Renamed to `mh-folder-to' per new Emacs conventions.
+
+*** mh-index-folder-face
+
+Renamed to `mh-search-folder'.
+
+*** mh-letter-header-field-face
+
+Renamed to `mh-letter-header-field' per new Emacs conventions.
+
+*** mh-show-cc-face
+
+Renamed to `mh-show-cc' per new Emacs conventions.
+
+*** mh-show-date-face
+
+Renamed to `mh-show-date' per new Emacs conventions.
+
+*** mh-show-from-face
+
+Renamed to `mh-show-from' per new Emacs conventions.
+
+*** mh-show-header-face
+
+Renamed to `mh-show-header' per new Emacs conventions.
+
+*** mh-show-subject-face
+
+Renamed to `mh-show-subject' per new Emacs conventions.
+
+*** mh-show-to-face
+
+Renamed to `mh-show-to' per new Emacs conventions.
+
+*** mh-show-xface-face
+
+Renamed to `mh-show-xface' per new Emacs conventions.
+
+*** mh-speedbar-folder-face
+
+Renamed to `mh-speedbar-folder' per new Emacs conventions.
+
+*** mh-speedbar-folder-with-unseen-messages-face
+
+Renamed to `mh-speedbar-folder-with-unseen-messages' per new Emacs conventions.
+
+*** mh-speedbar-selected-folder-face
+
+Renamed to `mh-speedbar-selected-folder' per new Emacs conventions.
+
+*** mh-speedbar-selected-folder-with-unseen-messages-face
+
+Renamed to `mh-speedbar-selected-folder-with-unseen-messages' per new
+Emacs conventions.
+
+
+
+** Bug Fixes in MH-E 8.0
+
+*** Face Variable Names Now Follow Current Conventions
+
+The -face suffix has been dropped from all face names. 
+
+*** Swish Fixes
+
+Items in swish indexes that aren't mail messages are now handled more
+gracefully.
+
+*** Spamassassin Fixes
+
+If you use spamassassin, there was an error when you tried to junk
+mail if the option `mh-junk-background' was set. This has been fixed.
+
+*** Mairix Support
+
+Indexing now compatible with Mairix version 0.12 and later.
 
 *** mh-extract-rejected-mail Can't Do MIME (and Other Formats)
 
@@ -992,10 +825,23 @@
 our list is too broad, please let us know which version of XEmacs you
 are using (closes SF #644321).
 
+*** Completions Offered by mh-refile-message Are Not Sorted
+
+This behavior is no longer observed (closes SF #698734).
+
+*** Add Message-ID to Outgoing Messages
+
+If you replied to a message in your `+outbox', an `In-Reply-To:'
+header field was created that broke threading at the recipient's end.
+We now add a `Message-ID:' to outgoing messages which fixes this
+(closes SF #725425).
+
 *** Inconsistent Prompts
 
-Prompt formats are now consistent throughout the application (closes
-SF #730470).
+Emacs changed their defaults in prompts from "Prompt: [value]" to
+"Prompt (default value): ". All MH-E prompts have been updated to
+comply with the new standard and are therefore now consistent
+throughout the application (closes SF #730470, SF #1275933).
 
 *** Empty Shell Comments Confuse mh-mhn-directive-present-p
 
@@ -1034,16 +880,10 @@
 has been fixed so that the user name that is flashed is the same as
 the name that is sent (closes SF #772595).
 
-*** Args out of range
-
-In rare and non-reproducible circumstances, compilation sometimes
-threw an "Args out of range" error. Nonetheless, this has been fixed
-(closes SF #806577).
-
-*** mh-forward hard-codes '-mime' Switch on nmh
-
-Added new option `mh-compose-forward-as-mime-flag' that controls whether
-messages are forwarded as MIME attachments (closes SF #827203).
+*** Initialization Fails If ~/Mail Exists
+
+MH-E no longer calls `install-mh' so this issue has gone away (closes
+SF #835192).
 
 *** Not Re-prompted to Sign After Pass Phrase Typo
 
@@ -1059,17 +899,187 @@
 be fontified with a gray background. This has been fixed (closes SF
 #855479).
 
+*** RETURN Causes Infinite Loop in mh-letter
+
+This behavior is no longer observed (closes SF #887346).
+
 *** mh-refile-msg Fails to Suggest Folder for Empty Message
 
 If you received a message with an empty body from someone who is
-listed in your aliases file, "o (mh-refile-msg)" failed to suggest the
-correct folder. This has been fixed (closes SF #917096).
+listed in your aliases file, `o' (`mh-refile-msg') failed to suggest
+the correct folder. This has been fixed (closes SF #917096).
+
+*** Missing Headers When Replying to All
+
+User needed to edit `replgroupcomps' (closes SF #918194).
 
 *** Error Visiting Folder With no Unseen Messages
 
 If you visited a folder without unseen messages and the option "flist:
--noshowzero" is present in your ~/.mh_profile, you'd get an error. This
-has been fixed (closes SF #933954).
+-noshowzero" is present in your `~/.mh_profile', you'd get an error.
+This has been fixed (closes SF #933954).
+
+*** Error Message When Trying to Send Using MH-E
+
+This behavior is no longer observed (closes SF #1002103).
+
+*** mh-find-path Doesn't Use mhparam
+
+MH-E no longer peeks into the MH profile `~/.mh_profile' directly. It
+uses `mhparam' instead (closes SF #1016027).
+
+*** rmmproc Refile Complains No Such Message
+
+MH-E would get confused about which folder to delete messages from if
+you were refiling and deleting messages at the same time. This has
+been fixed (closes SF #1023959).
+
+*** auto-mode-alist Updated
+
+MH-E originally updated auto-mode-alist to set the major mode of
+drafts. Now that we explicitly set the mode, there is no reason to do
+this, and this behavior caused problems for people who didn't use MH-E
+who were editing files that looked like MH message files (closes SF
+#1032353).
+
+*** ! Doesn't Do Regions
+
+Now it does (closes SF #1046330).
+
+*** mh-show-unquote-From Fails (read-only buffer)
+
+MH-E quotes the `From ' header field that is inserted by MTAs.
+However, it was trying to do this in a read-only buffer. This has been
+fixed (closes SF #1089870).
+
+*** Whitespace in pick Expressions
+
+The `C-u / s RET' command now works. In addition, you can now add
+whitespace to any of the limiting (/) commands (closes SF #1122655).
+
+*** mh-index-previous-folder Does Not Work Correctly
+
+If your cursor was on an item below a folder heading and you used
+`M-TAB' (`mh-index-previous-folder'), you would move to the previous
+folder heading. This has been fixed (closes SF #1126188).
+
+*** Default Identity Prevents Insertion of Auto Fields
+
+Auto insertion of an identity now occurs even when the default
+identity is used (closes SF #1204506).
+
+*** mh-compose-forward and Default Message Number
+
+`mh-compose-forward' will now default to the sent message in the sent
+folder and the `cur' message in other folders. It also takes ranges of
+messages and can include multiple messages at a time (closes SF
+#1205890).
+
+*** Better Handling of Empty cur Sequence
+
+If you refiled a message into a folder and then used `F r'
+(`mh-rescan-folder') in that folder, your cursor would be taken to the
+first message. The cursor now stays where it was (closes SF #1207247).
+
+*** mh-customize Uses Group mh, Not mh-e
+
+The `mh' customization group alias has been deleted to avoid some
+problems that were found (closes SF #1213716).
+
+*** "Args out of range" Error in Displaying Message
+
+This behavior is no longer observed (closes SF #1227504).
+
+*** Front-and-back Truncation in mailto: Rendering
+
+This behavior is no longer observed (closes SF #1227510).
+
+*** Name of the Draft File in mh-comp.el
+
+MH is documented to use the draft file. If you use a draft file for
+something else (like Sylpheed), then use draft folders (closes SF
+#1231483).
+
+*** font-lock Error in mh-letter-mode
+
+An error in MH-E was introduced as a result of a change in CVS Emacs.
+This has been fixed (closes SF #1241017).
+
+*** Msg Display Broken After Displaying Msg with Inline Image
+
+Messages with inline images no longer trim certain message header
+fields (closes SF #1306141).
+
+*** mh-visit-folder Munges font-lock-keywords
+
+MH-E broke highlighting in Gnus buffers. This was actually a problem
+in CVS Emacs 22 and has been fixed there (closes SF #1393879).
+
+*** Illegal Filename Chars for W32 Filesystems
+
+Windows users who view `X-Image-URL:' images could not cache the
+images since the cached image file names had illegal characters. This
+has been fixed (closes SF #1396499).
+
+*** mh-send Doesn't Handle mml Insertions Via mail-user-agent
+
+Can now forward messages in Gnus if MH-E is your `mail-user-agent'
+(closes SF #1399307).
+
+*** Can't Narrow to Subject with Regexp Chars
+
+The command `/ s' could not limit subjects that had special pick
+characters (such as [, *, $, .). This has been fixed (closes SF
+#1432548).
+
+*** `/ s' Can Miss the Original Mail
+
+The command `/ s' failed to include the message with the "Re:" in the
+Subject. This has been fixed (closes SF #1438369).
+
+*** mhparam -components Fails on mailutils
+
+This error prevented MH-E from loading when using GNU mailutils. GNU
+mailutils drops the `s' in this argument, so we did too since
+-component still works in nmh and MH (closes SF #1446985).
+
+*** `/ s' Still Has Problems With []'d Mail
+
+On XEmacs, subjects that had special characters would prevent `/ s'
+from narrowing to the given subject. These characters are now quoted
+correctly in XEmacs (closes SF #1447598).
+
+*** Variable mh-send-args Is a String, Not a List
+
+This was causing errors when sending under GNU mailutils. The internal
+variable `mh-send-args' is now a list which fixes the problem (closes
+SF #1448604).
+
+*** Update Icons
+
+Most of the tool bar icons have been replaced by GTK or GNOME 2 icons
+(closes SF #1452715).
+
+*** Strip Build Number From emacs-version in X-Mailer
+
+This has been done (closes SF #1466481).
+
+*** Rename Function and Variable Definers
+
+If you had ever shown help for an MH-E symbol that was both a function
+or variable, you might have found that the hyperlink to the file
+brought you to the wrong definition. This has been fixed by renaming
+the macros `mh-defgroup', `mh-defcustom', `mh-defface',
+`mh-defun-compat', and `mh-defmacro-compat' to `defgroup-mh',
+`defcustom-mh', `defface-mh', `defun-mh', `defmacro-mh' respectively
+(closes SF #1472029).
+
+*** mh-insert-letter Uses Wrong Default
+
+If you had used `C-c TAB' (`mh-insert-letter') to insert a letter into
+your draft, specified a different folder, and chose the default
+message number, you got the wrong message. This has been fixed (closes
+SF #1473729).
 
 
 
--- a/etc/NEWS	Tue May 02 08:50:29 2006 +0000
+++ b/etc/NEWS	Wed May 10 20:42:41 2006 +0000
@@ -646,6 +646,57 @@
 *** The current match in query-replace is highlighted in new face
 `query-replace' which by default inherits from isearch face.
 
+** Local variables lists:
+
++++
+*** In processing a local variables list, Emacs strips the prefix and
+suffix from every line before processing all the lines.
+
++++
+*** Text properties in local variables.
+
+A file local variables list cannot specify a string with text
+properties--any specified text properties are discarded.
+
++++
+*** If the local variables list contains any variable-value pairs that
+are not known to be safe, Emacs shows a prompt asking whether to apply
+the local variables list as a whole.  In earlier versions, a prompt
+was only issued for variables explicitly marked as risky (for the
+definition of risky variables, see `risky-local-variable-p').
+
+At the prompt, you can choose to save the contents of this local
+variables list to `safe-local-variable-values'.  This new customizable
+option is a list of variable-value pairs that are known to be safe.
+Variables can also be marked as safe with the existing
+`safe-local-variable' property (see `safe-local-variable-p').
+However, risky variables will not be added to
+`safe-local-variable-values' in this way.
+
++++
+*** The variable `enable-local-variables' controls how local variable
+lists are handled.  t, the default, specifies the standard querying
+behavior.  :safe means use only safe values, and ignore the rest.
+nil means ignore them all.  Anything else means always query.
+
++++
+*** The variable `safe-local-eval-forms' specifies a list of forms that
+are ok to evaluate when they appear in an `eval' local variables
+specification.  Normally Emacs asks for confirmation before evaluating
+such a form, but if the form appears in this list, no confirmation is
+needed.
+
++++
+*** If a function has a non-nil `safe-local-eval-function' property,
+that means it is ok to evaluate some calls to that function when it
+appears in an `eval' local variables specification.  If the property
+is t, then any form calling that function with constant arguments is
+ok.  If the property is a function or list of functions, they are called
+with the form as argument, and if any returns t, the form is ok to call.
+
+If the form is not "ok to call", that means Emacs asks for
+confirmation as before.
+
 ** File operation changes:
 
 +++
@@ -655,25 +706,6 @@
 is only rarely needed.
 
 +++
-*** In processing a local variables list, Emacs strips the prefix and
-suffix from every line before processing all the lines.
-
-+++
-*** If the local variables list contains any variable-value pairs that
-are not known to be safe, Emacs shows a prompt asking whether to apply
-the local variables list as a whole.  In earlier versions, a prompt
-was only issued for variables explicitly marked as risky (for the
-definition of risky variables, see `risky-local-variable-p').
-
-At the prompt, the user can choose to save the contents of this local
-variables list to `safe-local-variable-values'.  This new customizable
-option is a list of variable-value pairs that are known to be safe.
-Variables can also be marked as safe with the existing
-`safe-local-variable' property (see `safe-local-variable-p').
-However, risky variables will not be added to
-`safe-local-variable-values' in this way.
-
-+++
 *** find-file-read-only visits multiple files in read-only mode,
 when the file name contains wildcard characters.
 
@@ -3130,7 +3162,7 @@
 ---
 ** MH-E changes.
 
-Upgraded to MH-E version 7.95. There have been major changes since
+Upgraded to MH-E version 8.0.  There have been major changes since
 version 5.0.2; see MH-E-NEWS for details.
 
 ** Calendar changes:
@@ -3633,6 +3665,15 @@
 first one.
 
 +++
+*** New function `add-to-history' adds an element to a history list.
+
+Lisp packages should use this function to add elements to their
+history lists.
+
+If `history-delete-duplicates' is non-nil, it removes duplicates of
+the new element from the history list it updates.
+
++++
 *** New function `rassq-delete-all'.
 
 (rassq-delete-all VALUE ALIST) deletes, from ALIST, each element whose
@@ -4069,38 +4110,6 @@
 prompt provided in PROMPT is edited to show the default value provided
 in DEF before the terminal colon and space.
 
-** Local variables lists:
-
-+++
-*** Text properties in local variables.
-
-A file local variables list cannot specify a string with text
-properties--any specified text properties are discarded.
-
-+++
-*** The variable `enable-local-variables' controls how local variable
-lists are handled.  t, the default, specifies the standard querying
-behavior.  :safe means use only safe values, and ignore the rest.
-nil means ignore them all.  Anything else means always query.
-
-+++
-*** The variable `safe-local-eval-forms' specifies a list of forms that
-are ok to evaluate when they appear in an `eval' local variables
-specification.  Normally Emacs asks for confirmation before evaluating
-such a form, but if the form appears in this list, no confirmation is
-needed.
-
----
-*** If a function has a non-nil `safe-local-eval-function' property,
-that means it is ok to evaluate some calls to that function when it
-appears in an `eval' local variables specification.  If the property
-is t, then any form calling that function with constant arguments is
-ok.  If the property is a function or list of functions, they are called
-with the form as argument, and if any returns t, the form is ok to call.
-
-If the form is not "ok to call", that means Emacs asks for
-confirmation as before.
-
 ** Searching and matching changes:
 
 +++
--- a/info/dir	Tue May 02 08:50:29 2006 +0000
+++ b/info/dir	Wed May 10 20:42:41 2006 +0000
@@ -32,7 +32,6 @@
 * CL: (cl).             Partial Common Lisp support for Emacs Lisp.
 * Dired-X: (dired-x).   Dired Extra Features.
 * Ediff: (ediff).       A visual interface for comparing and merging programs.
-* Emacs-Xtra: (emacs-xtra).    Specialized Emacs features.
 * Org Mode: (org).      Outline-based notes management and organizer.
 * PCL-CVS: (pcl-cvs).   Emacs front-end to CVS.
 * Speedbar: (speedbar). File/Tag summarizing utility.
--- a/lib-src/ChangeLog	Tue May 02 08:50:29 2006 +0000
+++ b/lib-src/ChangeLog	Wed May 10 20:42:41 2006 +0000
@@ -1,3 +1,9 @@
+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.
--- a/lib-src/etags.c	Tue May 02 08:50:29 2006 +0000
+++ b/lib-src/etags.c	Wed May 10 20:42:41 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);
 }
 
 
--- a/lisp/ChangeLog	Tue May 02 08:50:29 2006 +0000
+++ b/lisp/ChangeLog	Wed May 10 20:42:41 2006 +0000
@@ -1,3 +1,339 @@
+2006-05-10  J.D. Smith  <jdsmith@as.arizona.edu>
+
+	* progmodes/idlw-shell.el (idlwave-shell-move-or-history):
+	Remove spurious move to point-max (new comint behavior fixes).
+
+	* progmodes/idlwave.el (idlwave-push-mark): Removed obsolete
+	compatibility function (Emacs 18/19).
+	(idlwave-is-continuation-line): Always return point at start of
+	previous non-blank continuation line.  
+	`keyword-parameters': Fix continued comment font-lock matcher.
+	(idlwave-font-lock-fontify-region): Written, use as
+	font-lock-fontify-region-function, to fix continued keyword
+	fontification issues.
+
+2006-05-10  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+	* term/mac-win.el (mac-font-panel-mode): Doc fix.
+	(mac-service-selection, mac-service-open-file)
+	(mac-service-open-selection, mac-service-mail-selection)
+	(mac-service-mail-to, mac-service-insert-text): Rename from
+	mac-services-*.  All uses changed.
+	(mac-apple-event-map): Rename event symbol `services' to `service'.
+
+2006-05-10  Thien-Thi Nguyen  <ttn@gnu.org>
+
+	* emacs-lisp/ewoc.el (ewoc--dll-create, ewoc--node-delete)
+	(ewoc--node-enter-first, ewoc--node-enter-last)
+	(ewoc--delete-node-internal): Merge funcs into unique callers.
+
+2006-05-09  Chong Yidong  <cyd@stupidchicken.com>
+
+	* emacs-lisp/crm.el (completing-read-multiple): Properly handle
+	return value of read-from-minibuffer for empty input.
+
+2006-05-09  Miles Bader  <miles@gnu.org>
+
+	* comint.el (comint-insert-input): Remove redundant calls to setq
+	and goto-char.
+
+2006-05-10  Nick Roberts  <nickrob@snap.net.nz>
+
+	* comint.el (comint-insert-input): Make it work when
+	comint-use-prompt-regexp is t.
+
+2006-05-10  Miles Bader  <miles@gnu.org>
+
+	* subr.el (field-at-pos): New function.
+
+	* comint.el (comint-insert-input): Use it.
+
+2006-05-09  Juri Linkov  <juri@jurta.org>
+
+	* battery.el (battery-linux-proc-acpi): Also try
+	`/proc/acpi/thermal_zone/THR2/temperature'.
+
+	* files.el <safe-local-variable>: Remove `eval' and `let' binding
+	for now unused lambda `string-or-null'.
+
+	* add-log.el (change-log-default-name): Put `string-or-null-p'
+	instead of lambda on `safe-local-variable' property.
+
+	* diff-mode.el (diff-context->unified): Use `region-beginning' and
+	`region-end' instead of `mark' and `point'.
+	(diff-unified->context, diff-reverse-direction, diff-fixup-modifs):
+	Operate on region in Transient Mark mode when the mark is active.
+	Use `region-beginning' and `region-end' instead of `mark' and
+	`point'.
+	(diff-hunk-text, diff-goto-source): Doc fix.
+
+	* startup.el (fancy-splash-screens, normal-splash-screen): Use
+	face `mode-line-buffer-id' for mode-line buffer face instead of
+	hard-coded `(:weight bold)'.
+
+	* arc-mode.el (archive-set-buffer-as-visiting-file): Bind
+	buffer-undo-list to t (undo-ask is reproducible by visiting
+	nested archives).
+
+2006-05-09  Kim F. Storm  <storm@cua.dk>
+
+	* progmodes/grep.el (rgrep): Set default directory of *grep*
+	buffer if we start M-x rgrep in the *grep* buffer and choose
+	a different base directory.
+
+2006-05-09  Michael Albinus  <michael.albinus@gmx.de>
+
+	* net/tramp.el (tramp-register-file-name-handlers): Enable Tramp
+	completion also when ido is loaded.
+
+2006-05-09  Masatake YAMATO  <jet@gyve.org>
+
+	* font-lock.el (cpp-font-lock-keywords-source-directives): Addded
+	"warning" and "import".
+	(cpp-font-lock-keywords): Added "warning".
+
+2006-05-08  Dan Nicolaescu  <dann@ics.uci.edu>
+
+	* term/xterm.el (terminal-init-xterm): Add more key bindings.
+
+2006-05-08  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* mwheel.el (mwheel-scroll): Make sure that when scrolling multiple
+	pages at a time, if we signal the end, we should indeed reach that end.
+
+2006-05-08  David Reitter  <david.reitter@gmail.com>
+
+	* emacs-lisp/easy-mmode.el (define-minor-mode): Only preserve messages
+	output during execution of the body.
+
+2006-05-08  Kim F. Storm  <storm@cua.dk>
+
+	* progmodes/grep.el (lgrep, rgrep): Doc fixes.
+
+2006-05-08  Thien-Thi Nguyen  <ttn@gnu.org>
+
+	* emacs-lisp/ewoc.el (ewoc--set-buffer-bind-dll-let*):
+	Use with-current-buffer.
+
+2006-05-07  Kim F. Storm  <storm@cua.dk>
+
+	* subr.el (add-to-history): Remove keep-dups arg.
+
+	* kmacro.el (kmacro-push-ring): Let-bind history-delete-duplicates
+	to nil around call to add-to-history.
+
+2006-05-07  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* emacs-lisp/syntax.el (syntax-ppss): Flush the cache before rather
+	than after a buffer modification.
+
+2006-05-08  Nick Roberts  <nickrob@snap.net.nz>
+
+	* progmodes/gdb-ui.el (gdb-var-create-handler): Move speedbar
+	call to...
+	(gud-watch): ...here so speedbar is raised for already watched
+	expressions.
+	(gdb-speedbar-refresh): Delete function.
+	(gdb-speedbar-update, gdb-speedbar-timer-fn): New functions.
+	Use speedbar-timer-fn instead of speedbar-refresh (reverting
+	earlier change).
+	(gdb-var-evaluate-expression-handler)
+	(gdb-var-list-children-handler-1, gdb-var-update-handler-1): Use it.
+
+	* speedbar.el (speedbar-timer-fn): Remove save-window-excursion.
+	Update localized contents for all buffers except ignored modes.
+
+2006-05-07  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+	* term/mac-win.el (mac-utxt-to-string): Use `eq' instead of `='.
+	(mac-atsu-font-table, mac-font-panel-mode): Add defvars.
+	(mac-bytes-to-digits, mac-handle-toolbar-switch-mode)
+	(mac-handle-font-panel-closed, mac-handle-font-selection):
+	New functions.
+	(mac-font-panel-mode): New minor mode.
+	(mac-apple-event-map): Add bindings for toolbar toggle button and
+	font panel.
+	(menu-bar-showhide-menu): Add mac-font-panel-mode.
+
+2006-05-07  John Paul Wallington  <jpw@pobox.com>
+
+	* ibuffer.el (ibuffer-compressed-file-name-regexp):
+	Avoid `regexp-opt'; simplify regexp for readability.
+
+2006-05-06  Eli Zaretskii  <eliz@gnu.org>
+
+	* ldefs-boot.el (dired-do-redisplay, dired-maybe-insert-subdir):
+	* files.el (buffer-stale-function):
+	* dired-aux.el (dired-do-redisplay, dired-maybe-insert-subdir):
+	* autorevert.el (global-auto-revert-non-file-buffers): Point Info
+	links to the main manual, not to emacs-xtra.
+
+2006-05-06  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+	* term/mac-win.el: (mac-utxt-to-string): Don't make adjustment for
+	MacJapanese if text is ASCII-only.
+
+2006-05-06  Nick Roberts  <nickrob@snap.net.nz>
+
+	* progmodes/gdb-ui.el (gdb-goto-breakpoint): Use or instead of
+	unless so nil isn't returned.
+	(gdb-setup-windows, gdb-restore-windows): Reset gdb-source-window.
+
+2006-05-06  Kim F. Storm  <storm@cua.dk>
+
+	* subr.el (add-to-history): New function.
+
+	* ediff.el (ediff-files, ediff-files3, ediff-merge-files)
+	(ediff-merge-files-with-ancestor):
+	* env.el (setenv):
+	* isearch.el (isearch-update-ring):
+	* server.el (server-visit-files):
+	* progmodes/grep.el (lgrep, rgrep):
+	* progmodes/vhdl-mode.el (vhdl-generate-makefile-1):
+	* progmodes/xscheme.el (xscheme-insert-expression):
+	Use add-to-history.
+
+	* kmacro.el (kmacro-push-ring): Use add-to-history.
+	(kmacro-ring-length): Remove unused defun.
+	(kmacro-start-macro): Use kmacro-push-ring.
+
+2006-05-06  Thien-Thi Nguyen  <ttn@gnu.org>
+
+	* emacs-lisp/ewoc.el (ewoc-create, ewoc-set-hf): Use `insert'
+	directly instead of a lambda expression that calls it.
+
+2006-05-06  Kim F. Storm  <storm@cua.dk>
+
+	* avoid.el (mouse-avoidance-point-position): Use posn-at-point
+	instead of compute-motion.
+
+2006-05-05  Dan Nicolaescu  <dann@ics.uci.edu>
+
+	* ibuffer.el (ibuffer-compressed-file-name-regexp): Undo previous
+	change.
+
+2006-05-05  Reiner Steib  <Reiner.Steib@gmx.de>
+
+	* startup.el (command-line-1): Refer to "Pure Storage" on
+	pure-space-overflow.
+
+2006-05-05  Martin Rudalics  <rudalics@gmx.at>
+
+	* emacs-lisp/re-builder.el (reb-update-overlays): Cycle through
+	provided faces once they all have been used up.
+
+2006-05-05  Eli Zaretskii  <eliz@gnu.org>
+
+	* startup.el (normal-splash-screen, fancy-splash-screens-1): Add a
+	reference to the Lisp manual to the warning about pure space
+	overflow.
+
+2006-05-05  Micha,Ak(Bl Cadilhac  <michael.cadilhac@lrde.org>
+
+	* textmodes/ispell.el (ispell-buffer-local-dict): Add a `no-reload'
+	argument to avoid the call to `ispell-internal-change-dictionary'
+	when not needed.
+	(ispell-change-dictionary): Use this argument and call
+	`ispell-internal-change-dictionary' after the possible change
+	to `ispell-local-dictionary'.
+	(ispell-internal-change-dictionary): Check for a change in
+	personal dictionary use too.
+	Cosmetic changes from Agustin Martin
+	<agustin.martin@hispalinux.es>.
+
+2006-05-05  Eli Zaretskii  <eliz@gnu.org>
+
+	* startup.el (command-line): On MS-Windows, probe "~", not
+	"~USER", for warning about non-existent home directory
+
+	* arc-mode.el (archive-l-e): New optional argument `float' means
+	generate a float value.
+	(archive-arc-summarize, archive-lzh-summarize)
+	(archive-zip-summarize, archive-zoo-summarize): Invoke archive-l-e
+	with 3rd argument non-nil when file's size is being computed.
+	Format the file sizes with %8.0f instead of %8d.
+
+2006-05-05  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+	* cus-start.el (all): Add mac-dnd-known-types.
+
+	* term/mac-win.el: (mac-utxt-to-string, mac-string-to-utxt)
+	(mac-TEXT-to-string, mac-string-to-TEXT, mac-furl-to-string)
+	(mac-TIFF-to-string): New functions.
+	(x-get-selection, x-selection-value)
+	(mac-select-convert-to-string): Use them.
+	(mac-text-encoding-mac-japanese-basic-variant):	New constant.
+	(mac-dnd-types-alist): New customization variable.
+	(mac-dnd-handle-furl, mac-dnd-handle-hfs, mac-dnd-insert-utxt)
+	(mac-dnd-insert-TEXT, mac-dnd-insert-TIFF, mac-dnd-drop-data)
+	(mac-dnd-handle-drag-n-drop-event): New functions.
+	(mac-drag-n-drop): Remove function.
+	(global-map): Bind drag-n-drop and M-drag-n-drop to
+	mac-dnd-handle-drag-n-drop-event.
+
+2006-05-04  Karl Chen  <quarl@NOSPAM.quarl.org>
+
+	* progmodes/perl-mode.el (perl-beginning-of-function):
+	Skip anonymous subs.
+
+2006-05-04  Dan Nicolaescu  <dann@ics.uci.edu>
+
+	* ibuffer.el (ibuffer-compressed-file-name-regexp): Avoid loading
+	regexp-opt at run time.
+
+	* term.el (term-handle-ansi-escape): Fix off by one error.
+
+2006-05-04  Nick Roberts  <nickrob@snap.net.nz>
+
+	* progmodes/gdb-ui.el (gdb-force-update): Delete variable...
+	(gdb-init-1, gdb-post-prompt): ...and references to it.
+	(gdb-frame-handler): Strip directory name from filename if present.
+
+	* progmodes/gud.el (gdb-force-update): Delete defvar
+	(gud-speedbar-buttons): ...and references to it.  Use window-start
+	to try to keep positon in watch expression.
+
+2006-05-03  Richard Stallman  <rms@gnu.org>
+
+	* simple.el (next-history-element, previous-history-element): Doc fix.
+
+	* isearch.el (isearch-update-ring): Doc fix.
+
+2006-05-03  Dan Nicolaescu  <dann@ics.uci.edu>
+
+	* isearch.el (isearch-update-ring): Take history-delete-duplicates
+	into consideration. Replace one arm ifs with whens.
+
+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,
@@ -26,35 +362,35 @@
 	(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-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-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.
+	* 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.
+	* term/mac-win.el (mac-ae-open-documents, mac-drag-n-drop):
+	Use select-frame-set-input-focus instead of raise-frame.
 	(global-map): Bind M-drag-n-drop to mac-drag-n-drop.
 
 2006-05-01  Nick Roberts  <nickrob@snap.net.nz>
 
 	* progmodes/gud.el (gud-def): Add %c case.
-	(gud-speedbar-buttons): Don'bind case-fold-search unnecessarily.
+	(gud-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>
@@ -121,7 +457,7 @@
 	(grep-read-regexp, grep-read-files): New helper functions.
 	(rgrep): Rename from grep-tree.  Rework to use proper histories.
 	Adapt to changes in defcustoms and functions above.
-	(lgrep): New command, as grep, but using same interactive api as rgrep.
+	(lgrep): New command, as grep, but using same interactive UI as rgrep.
 
 2006-04-28  Michael Albinus  <michael.albinus@gmx.de>
 
--- a/lisp/add-log.el	Tue May 02 08:50:29 2006 +0000
+++ b/lisp/add-log.el	Wed May 10 20:42:41 2006 +0000
@@ -45,8 +45,7 @@
   :type '(choice (const :tag "default" nil)
 		 string)
   :group 'change-log)
-(put 'change-log-default-name 'safe-local-variable
-     (lambda (a) (or (stringp a) (null a))))
+(put 'change-log-default-name 'safe-local-variable 'string-or-null-p)
 
 (defcustom change-log-mode-hook nil
   "Normal hook run by `change-log-mode'."
--- a/lisp/arc-mode.el	Tue May 02 08:50:29 2006 +0000
+++ b/lisp/arc-mode.el	Wed May 10 20:42:41 2006 +0000
@@ -480,10 +480,12 @@
 (defsubst archive-name (suffix)
   (intern (concat "archive-" (symbol-name archive-subtype) "-" suffix)))
 
-(defun archive-l-e (str &optional len)
+(defun archive-l-e (str &optional len float)
   "Convert little endian string/vector STR to integer.
 Alternatively, STR may be a buffer position in the current buffer
-in which case a second argument, length LEN, should be supplied."
+in which case a second argument, length LEN, should be supplied.
+FLOAT, if non-nil, means generate and return a float instead of an integer
+\(use this for numbers that can overflow the Emacs integer)."
   (if (stringp str)
       (setq len (length str))
     (setq str (buffer-substring str (+ str len))))
@@ -492,7 +494,8 @@
         (i 0))
     (while (< i len)
       (setq i (1+ i)
-            result (+ (ash result 8) (aref str (- len i)))))
+            result (+ (if float (* result 256.0) (ash result 8))
+		      (aref str (- len i)))))
     result))
 
 (defun archive-int-to-mode (mode)
@@ -882,7 +885,8 @@
   "Set the current buffer as if it were visiting FILENAME."
   (save-excursion
     (goto-char (point-min))
-    (let ((coding
+    (let ((buffer-undo-list t)
+	  (coding
 	   (or coding-system-for-read
 	       (and set-auto-coding-function
 		    (save-excursion
@@ -1355,13 +1359,14 @@
 	     (fnlen   (or (string-match "\0" namefld) 13))
 	     (efnname (decode-coding-string (substring namefld 0 fnlen)
 					    archive-file-name-coding-system))
-             (csize   (archive-l-e (+ p 15) 4))
+	     ;; Convert to float to avoid overflow for very large files.
+             (csize   (archive-l-e (+ p 15) 4 'float))
              (moddate (archive-l-e (+ p 19) 2))
              (modtime (archive-l-e (+ p 21) 2))
-             (ucsize  (archive-l-e (+ p 25) 4))
+             (ucsize  (archive-l-e (+ p 25) 4 'float))
 	     (fiddle  (string= efnname (upcase efnname)))
              (ifnname (if fiddle (downcase efnname) efnname))
-             (text    (format "  %8d  %-11s  %-8s  %s"
+             (text    (format "  %8.0f  %-11s  %-8s  %s"
                               ucsize
                               (archive-dosdate moddate)
                               (archive-dostime modtime)
@@ -1383,7 +1388,7 @@
 	      dash)
       (archive-summarize-files (nreverse visual))
       (insert dash
-	      (format "  %8d                         %d file%s"
+	      (format "  %8.0f                         %d file%s"
 		      totalsize
 		      (length files)
 		      (if (= 1 (length files)) "" "s"))
@@ -1416,9 +1421,10 @@
     (while (progn (goto-char p)		;beginning of a base header.
 		  (looking-at "\\(.\\|\n\\)\\(.\\|\n\\)-l[hz][0-9ds]-"))
       (let* ((hsize   (byte-after p))	;size of the base header (level 0 and 1)
-	     (csize   (archive-l-e (+ p 7) 4)) ;size of a compressed file to follow (level 0 and 2),
+	     ;; Convert to float to avoid overflow for very large files.
+	     (csize   (archive-l-e (+ p 7) 4 'float)) ;size of a compressed file to follow (level 0 and 2),
 					;size of extended headers + the compressed file to follow (level 1).
-             (ucsize  (archive-l-e (+ p 11) 4))	;size of an uncompressed file.
+             (ucsize  (archive-l-e (+ p 11) 4 'float))	;size of an uncompressed file.
 	     (time1   (archive-l-e (+ p 15) 2))	;date/time (MSDOS format in level 0, 1 headers
 	     (time2   (archive-l-e (+ p 17) 2))	;and UNIX format in level 2 header.)
 	     (hdrlvl  (byte-after (+ p 20))) ;header level
@@ -1493,12 +1499,12 @@
 			  (archive-unixtime time1 time2)
 			(archive-dostime time1)))
 	(setq text    (if archive-alternate-display
-			  (format "  %8d  %5S  %5S  %s"
+			  (format "  %8.0f  %5S  %5S  %s"
 				  ucsize
 				  (or uid "?")
 				  (or gid "?")
 				  ifnname)
-			(format "  %10s  %8d  %-11s  %-8s  %s"
+			(format "  %10s  %8.0f  %-11s  %-8s  %s"
 				modestr
 				ucsize
 				moddate
@@ -1527,8 +1533,8 @@
 		       "M   Length    Uid    Gid  File\n"
 		    "M   Filemode    Length  Date         Time      File\n"))
 	  (sumline (if archive-alternate-display
-		       "  %8d                %d file%s"
-		     "              %8d                         %d file%s")))
+		       "  %8.0f                %d file%s"
+		     "              %8.0f                         %d file%s")))
       (insert header dash)
       (archive-summarize-files (nreverse visual))
       (insert dash
@@ -1622,7 +1628,8 @@
 	     ;; (method  (archive-l-e (+ p 10) 2))
              (modtime (archive-l-e (+ p 12) 2))
              (moddate (archive-l-e (+ p 14) 2))
-             (ucsize  (archive-l-e (+ p 24) 4))
+	     ;; Convert to float to avoid overflow for very large files.
+             (ucsize  (archive-l-e (+ p 24) 4 'float))
              (fnlen   (archive-l-e (+ p 28) 2))
              (exlen   (archive-l-e (+ p 30) 2))
              (fclen   (archive-l-e (+ p 32) 2))
@@ -1647,7 +1654,7 @@
 			   (string= (upcase efnname) efnname)))
              (ifnname (if fiddle (downcase efnname) efnname))
 	     (width (string-width ifnname))
-             (text    (format "  %10s  %8d  %-11s  %-8s  %s"
+             (text    (format "  %10s  %8.0f  %-11s  %-8s  %s"
 			      modestr
                               ucsize
                               (archive-dosdate moddate)
@@ -1673,7 +1680,7 @@
 	      dash)
       (archive-summarize-files (nreverse visual))
       (insert dash
-	      (format "              %8d                         %d file%s"
+	      (format "              %8.0f                         %d file%s"
 		      totalsize
 		      (length files)
 		      (if (= 1 (length files)) "" "s"))
@@ -1726,7 +1733,8 @@
       (let* ((next    (1+ (archive-l-e (+ p 6) 4)))
              (moddate (archive-l-e (+ p 14) 2))
              (modtime (archive-l-e (+ p 16) 2))
-             (ucsize  (archive-l-e (+ p 20) 4))
+	     ;; Convert to float to avoid overflow for very large files.
+             (ucsize  (archive-l-e (+ p 20) 4 'float))
 	     (namefld (buffer-substring (+ p 38) (+ p 38 13)))
 	     (dirtype (byte-after (+ p 4)))
 	     (lfnlen  (if (= dirtype 2) (byte-after (+ p 56)) 0))
@@ -1749,7 +1757,7 @@
 	     (fiddle  (and (= lfnlen 0) (string= efnname (upcase efnname))))
              (ifnname (if fiddle (downcase efnname) efnname))
 	     (width (string-width ifnname))
-             (text    (format "  %8d  %-11s  %-8s  %s"
+             (text    (format "  %8.0f  %-11s  %-8s  %s"
                               ucsize
                               (archive-dosdate moddate)
                               (archive-dostime modtime)
@@ -1771,7 +1779,7 @@
 	      dash)
       (archive-summarize-files (nreverse visual))
       (insert dash
-	      (format "  %8d                         %d file%s"
+	      (format "  %8.0f                         %d file%s"
 		      totalsize
 		      (length files)
 		      (if (= 1 (length files)) "" "s"))
--- a/lisp/autorevert.el	Tue May 02 08:50:29 2006 +0000
+++ b/lisp/autorevert.el	Wed May 10 20:42:41 2006 +0000
@@ -215,10 +215,10 @@
 of files.  You may still sometimes want to revert them manually.
 
 Use this option with care since it could lead to excessive auto-reverts.
-For more information, see Info node `(emacs-xtra)Autorevert'."
+For more information, see Info node `(emacs)Autorevert'."
   :group 'auto-revert
   :type 'boolean
-  :link '(info-link "(emacs-xtra)Autorevert"))
+  :link '(info-link "(emacs)Autorevert"))
 
 (defcustom global-auto-revert-ignore-modes ()
   "List of major modes Global Auto-Revert Mode should not check."
--- a/lisp/avoid.el	Tue May 02 08:50:29 2006 +0000
+++ b/lisp/avoid.el	Wed May 10 20:42:41 2006 +0000
@@ -139,23 +139,13 @@
 (defun mouse-avoidance-point-position ()
   "Return the position of point as (FRAME X . Y).
 Analogous to `mouse-position'."
-  (let* ((w (selected-window))
-	 (edges (window-inside-edges w))
-	 (list
-	  (compute-motion (max (window-start w) (point-min))   ; start pos
-			  ;; window-start can be < point-min if the
-			  ;; latter has changed since the last redisplay
-			  '(0 . 0)	                       ; start XY
-			  (point)	                       ; stop pos
-			  nil				       ; stop XY: none
-			  nil				       ; width
-			  (cons (window-hscroll w) 0)          ; 0 may not be right?
-			  (selected-window))))
-    ;; compute-motion returns (pos HPOS VPOS prevhpos contin)
-    ;; we want:               (frame hpos . vpos)
+  (let ((edges (window-inside-edges))
+	(x-y (posn-x-y (posn-at-point))))
     (cons (selected-frame)
-	  (cons (+ (car edges)       (car (cdr list)))
-		(+ (car (cdr edges)) (car (cdr (cdr list))))))))
+	  (cons (+ (car edges)
+		   (/ (car x-y) (frame-char-width)))
+		(+ (car (cdr edges))
+		   (/ (cdr x-y) (frame-char-height)))))))
 
 ;(defun mouse-avoidance-point-position-test ()
 ;  (interactive)
--- a/lisp/battery.el	Tue May 02 08:50:29 2006 +0000
+++ b/lisp/battery.el	Wed May 10 20:42:41 2006 +0000
@@ -386,6 +386,14 @@
 			   (when (re-search-forward
 				  "temperature: +\\([0-9]+\\) C$" nil t)
 			     (match-string 1))))
+		       (when (file-exists-p
+			      "/proc/acpi/thermal_zone/THR2/temperature")
+			 (with-temp-buffer
+			   (insert-file-contents
+			    "/proc/acpi/thermal_zone/THR2/temperature")
+			   (when (re-search-forward
+				  "temperature: +\\([0-9]+\\) C$" nil t)
+			     (match-string 1))))
 		       "N/A"))
 	  (cons ?r (or (and rate (concat (number-to-string rate) " "
 					 rate-type)) "N/A"))
--- a/lisp/calc/calc-embed.el	Tue May 02 08:50:29 2006 +0000
+++ b/lisp/calc/calc-embed.el	Wed May 10 20:42:41 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/comint.el	Tue May 02 08:50:29 2006 +0000
+++ b/lisp/comint.el	Wed May 10 20:42:41 2006 +0000
@@ -802,27 +802,31 @@
   ;; This doesn't use "e" because it is supposed to work
   ;; for events without parameters.
   (interactive (list last-input-event))
-  (let ((pos (point)))
-    (if event (posn-set-point (event-end event)))
-    (if (not (eq (get-char-property (point) 'field) 'input))
-	;; No input at POS, fall back to the global definition.
-	(let* ((keys (this-command-keys))
-	       (last-key (and (vectorp keys) (aref keys (1- (length keys)))))
-	       (fun (and last-key (lookup-key global-map (vector last-key)))))
-	  (goto-char pos)
-	  (and fun (call-interactively fun)))
-      (setq pos (point))
-      ;; There's previous input at POS, insert it at the end of the buffer.
-      (goto-char (point-max))
-      ;; First delete any old unsent input at the end
-      (delete-region
-       (or (marker-position comint-accum-marker)
-	   (process-mark (get-buffer-process (current-buffer))))
-       (point))
-      ;; Insert the input at point
-      (insert (buffer-substring-no-properties
-	       (previous-single-char-property-change (1+ pos) 'field)
-	       (next-single-char-property-change pos 'field))))))
+  (when event
+    (posn-set-point (event-end event)))
+  (if comint-use-prompt-regexp
+      (let ((input (funcall comint-get-old-input))
+	    (process (get-buffer-process (current-buffer))))
+	(if (not process)
+	    (error "Current buffer has no process")
+	  (goto-char (process-mark process))
+	  (insert input)))
+    (let ((pos (point)))
+      (if (not (eq (field-at-pos pos) 'input))
+	  ;; No input at POS, fall back to the global definition.
+	  (let* ((keys (this-command-keys))
+		 (last-key (and (vectorp keys) (aref keys (1- (length keys)))))
+		 (fun (and last-key (lookup-key global-map (vector last-key)))))
+	    (and fun (call-interactively fun)))
+	;; There's previous input at POS, insert it at the end of the buffer.
+	(goto-char (point-max))
+	;; First delete any old unsent input at the end
+	(delete-region
+	 (or (marker-position comint-accum-marker)
+	     (process-mark (get-buffer-process (current-buffer))))
+	 (point))
+	;; Insert the input at point
+	(insert (field-string-no-properties pos))))))
 
 
 ;; Input history processing in a buffer
--- a/lisp/cus-start.el	Tue May 02 08:50:29 2006 +0000
+++ b/lisp/cus-start.el	Wed May 10 20:42:41 2006 +0000
@@ -196,6 +196,8 @@
 	     (suggest-key-bindings keyboard (choice (const :tag "off" nil)
 						    (integer :tag "time" 2)
 						    (other :tag "on")))
+	     ;; macselect.c
+	     (mac-dnd-known-types mac (repeat string) "22.1")
 	     ;; macterm.c
 	     (mac-control-modifier mac (choice (const :tag "No modifier" nil)
 					       (const control) (const meta)
--- a/lisp/diff-mode.el	Tue May 02 08:50:29 2006 +0000
+++ b/lisp/diff-mode.el	Wed May 10 20:42:41 2006 +0000
@@ -633,8 +633,8 @@
   "Convert unified diffs to context 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))
+  (interactive (if (or current-prefix-arg (and transient-mark-mode mark-active))
+		   (list (region-beginning) (region-end))
 		 (list (point-min) (point-max))))
   (unless (markerp end) (setq end (copy-marker end)))
   (let (;;(diff-inhibit-after-change t)
@@ -722,7 +722,7 @@
 \(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 (region-beginning) (region-end) current-prefix-arg)
 		 (list (point-min) (point-max) current-prefix-arg)))
   (if to-context
       (diff-unified->context start end)
@@ -795,8 +795,8 @@
   "Reverse the direction of the 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))
+  (interactive (if (or current-prefix-arg (and transient-mark-mode mark-active))
+		   (list (region-beginning) (region-end))
 		 (list (point-min) (point-max))))
   (unless (markerp end) (setq end (copy-marker end)))
   (let (;;(diff-inhibit-after-change t)
@@ -857,8 +857,8 @@
   "Fixup the hunk headers (in case the buffer was modified).
 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))
+  (interactive (if (or current-prefix-arg (and transient-mark-mode mark-active))
+		   (list (region-beginning) (region-end))
 		 (list (point-min) (point-max))))
   (let ((inhibit-read-only t))
     (save-excursion
@@ -1069,7 +1069,7 @@
 
 (defun diff-hunk-text (hunk destp char-offset)
   "Return the literal source text from HUNK as (TEXT . OFFSET).
-if DESTP is nil TEXT is the source, otherwise the destination text.
+If DESTP is nil, TEXT is the source, otherwise the destination text.
 CHAR-OFFSET is a char-offset in HUNK, and OFFSET is the corresponding
 char-offset in TEXT."
   (with-temp-buffer
@@ -1302,7 +1302,7 @@
 `diff-jump-to-old-file' (or its opposite if the OTHER-FILE prefix arg
 is given) determines whether to jump to the old or the new file.
 If the prefix arg is bigger than 8 (for example with \\[universal-argument] \\[universal-argument])
-  then `diff-jump-to-old-file' is also set, for the next invocations."
+then `diff-jump-to-old-file' is also set, for the next invocations."
   (interactive (list current-prefix-arg last-input-event))
   ;; When pointing at a removal line, we probably want to jump to
   ;; the old location, and else to the new (i.e. as if reverting).
--- a/lisp/dired-aux.el	Tue May 02 08:50:29 2006 +0000
+++ b/lisp/dired-aux.el	Wed May 10 20:42:41 2006 +0000
@@ -918,7 +918,7 @@
 may have to reset some subdirectory switches after a `dired-undo'.
 You can reset all subdirectory switches to the default using
 \\<dired-mode-map>\\[dired-reset-subdir-switches].
-See Info node `(emacs-xtra)Subdir switches' for more details."
+See Info node `(emacs)Subdir switches' for more details."
   ;; Moves point if the next ARG files are redisplayed.
   (interactive "P\np")
   (if (and test-for-subdir (dired-get-subdir))
@@ -1761,7 +1761,7 @@
 may have to reset some subdirectory switches after a `dired-undo'.
 You can reset all subdirectory switches to the default using
 \\<dired-mode-map>\\[dired-reset-subdir-switches].
-See Info node `(emacs-xtra)Subdir switches' for more details."
+See Info node `(emacs)Subdir switches' for more details."
   (interactive
    (list (dired-get-filename)
 	 (if current-prefix-arg
--- a/lisp/ediff.el	Tue May 02 08:50:29 2006 +0000
+++ b/lisp/ediff.el	Wed May 10 20:42:41 2006 +0000
@@ -210,12 +210,11 @@
 					   ediff-last-dir-B
 					 (file-name-directory f)))
 				 (progn
-				   (setq file-name-history
-					 (cons (ediff-abbreviate-file-name
-						(expand-file-name
-						 (file-name-nondirectory f)
-						 dir-B))
-					       file-name-history))
+				   (add-to-history 'file-name-history
+						   (ediff-abbreviate-file-name
+						    (expand-file-name
+						     (file-name-nondirectory f)
+						     dir-B)))
 				   (ediff-get-default-file-name f 1)))
 	   )))
   (ediff-files-internal file-A
@@ -246,25 +245,22 @@
 						    ediff-last-dir-B
 						  (file-name-directory f)))
 					  (progn
-					    (setq file-name-history
-						  (cons
-						   (ediff-abbreviate-file-name
-						    (expand-file-name
-						     (file-name-nondirectory f)
-						     dir-B))
-						   file-name-history))
+					    (add-to-history 'file-name-history
+							    (ediff-abbreviate-file-name
+							     (expand-file-name
+							      (file-name-nondirectory f)
+							      dir-B)))
 					    (ediff-get-default-file-name f 1))))
 	   (ediff-read-file-name "File C to compare"
 				 (setq dir-C (if ediff-use-last-dir
 						 ediff-last-dir-C
 					       (file-name-directory ff)))
 				 (progn
-				   (setq file-name-history
-					 (cons (ediff-abbreviate-file-name
-						(expand-file-name
-						 (file-name-nondirectory ff)
-						 dir-C))
-					       file-name-history))
+				   (add-to-history 'file-name-history
+						   (ediff-abbreviate-file-name
+						    (expand-file-name
+						     (file-name-nondirectory ff)
+						     dir-C)))
 				   (ediff-get-default-file-name ff 2)))
 	   )))
   (ediff-files-internal file-A
@@ -1109,12 +1105,11 @@
 					   ediff-last-dir-B
 					 (file-name-directory f)))
 				 (progn
-				   (setq file-name-history
-					 (cons (ediff-abbreviate-file-name
-						(expand-file-name
-						 (file-name-nondirectory f)
-						 dir-B))
-					       file-name-history))
+				   (add-to-history 'file-name-history
+						   (ediff-abbreviate-file-name
+						    (expand-file-name
+						     (file-name-nondirectory f)
+						     dir-B)))
 				   (ediff-get-default-file-name f 1)))
 	   )))
   (setq startup-hooks (cons 'ediff-merge-on-startup startup-hooks))
@@ -1153,13 +1148,11 @@
 						    ediff-last-dir-B
 						  (file-name-directory f)))
 					  (progn
-					    (setq file-name-history
-						  (cons
-						   (ediff-abbreviate-file-name
-						    (expand-file-name
-						     (file-name-nondirectory f)
-						     dir-B))
-						   file-name-history))
+					    (add-to-history 'file-name-history
+							    (ediff-abbreviate-file-name
+							     (expand-file-name
+							      (file-name-nondirectory f)
+							      dir-B)))
 					    (ediff-get-default-file-name f 1))))
 	   (ediff-read-file-name "Ancestor file"
 				 (setq dir-ancestor
@@ -1167,12 +1160,11 @@
 					   ediff-last-dir-ancestor
 					 (file-name-directory ff)))
 				 (progn
-				   (setq file-name-history
-					 (cons (ediff-abbreviate-file-name
-						(expand-file-name
-						 (file-name-nondirectory ff)
-						 dir-ancestor))
-					       file-name-history))
+				   (add-to-history 'file-name-history
+						   (ediff-abbreviate-file-name
+						    (expand-file-name
+						     (file-name-nondirectory ff)
+						     dir-ancestor)))
 				   (ediff-get-default-file-name ff 2)))
 	   )))
   (setq startup-hooks (cons 'ediff-merge-on-startup startup-hooks))
--- a/lisp/emacs-lisp/crm.el	Tue May 02 08:50:29 2006 +0000
+++ b/lisp/emacs-lisp/crm.el	Wed May 10 20:42:41 2006 +0000
@@ -592,25 +592,28 @@
 See the documentation for `completing-read' for details on the arguments:
 PROMPT, TABLE, PREDICATE, REQUIRE-MATCH, INITIAL-INPUT, HIST, DEF, and
 INHERIT-INPUT-METHOD."
-  (let ((minibuffer-completion-table (function crm-collection-fn))
-	(minibuffer-completion-predicate predicate)
-	;; see completing_read in src/minibuf.c
-	(minibuffer-completion-confirm
-	 (unless (eq require-match t) require-match))
-	(crm-completion-table table)
-	crm-last-exact-completion
-	crm-current-element
-	crm-left-of-element
-	crm-right-of-element
-	crm-beginning-of-element
-	crm-end-of-element
-	(map (if require-match
-		 crm-local-must-match-map
-	       crm-local-completion-map)))
-    (split-string (read-from-minibuffer
-		   prompt initial-input map
-		   nil hist def inherit-input-method)
-		  crm-separator)))
+  (let* ((minibuffer-completion-table (function crm-collection-fn))
+	 (minibuffer-completion-predicate predicate)
+	 ;; see completing_read in src/minibuf.c
+	 (minibuffer-completion-confirm
+	  (unless (eq require-match t) require-match))
+	 (crm-completion-table table)
+	 crm-last-exact-completion
+	 crm-current-element
+	 crm-left-of-element
+	 crm-right-of-element
+	 crm-beginning-of-element
+	 crm-end-of-element
+	 (map (if require-match
+		  crm-local-must-match-map
+		crm-local-completion-map))
+	 ;; If the user enters empty input, read-from-minibuffer returns
+	 ;; the empty string, not DEF.
+	 (input (read-from-minibuffer
+		 prompt initial-input map
+		 nil hist def inherit-input-method)))
+    (and def (string-equal input "") (setq input def))
+    (split-string input crm-separator)))
 
 ;; testing and debugging
 ;; (defun crm-init-test-environ ()
--- a/lisp/emacs-lisp/easy-mmode.el	Tue May 02 08:50:29 2006 +0000
+++ b/lisp/emacs-lisp/easy-mmode.el	Wed May 10 20:42:41 2006 +0000
@@ -139,7 +139,8 @@
     (setq body (list* lighter keymap body) lighter nil keymap nil))
    ((keywordp keymap) (push keymap body) (setq keymap nil)))
 
-  (let* ((mode-name (symbol-name mode))
+  (let* ((last-message (current-message))
+	 (mode-name (symbol-name mode))
 	 (pretty-name (easy-mmode-pretty-mode-name mode lighter))
 	 (globalp nil)
 	 (set nil)
@@ -236,7 +237,10 @@
 	 (if (called-interactively-p)
 	     (progn
 	       ,(if globalp `(customize-mark-as-set ',mode))
-	       (unless (current-message)
+	       ;; Avoid overwriting a message shown by the body,
+               ;; but do overwrite previous messages.
+	       (unless  ,(and (current-message)
+                              (not (equal last-message (current-message))))
 		 (message ,(format "%s %%sabled" pretty-name)
 			  (if ,mode "en" "dis")))))
 	 (force-mode-line-update)
--- a/lisp/emacs-lisp/ewoc.el	Tue May 02 08:50:29 2006 +0000
+++ b/lisp/emacs-lisp/ewoc.el	Wed May 10 20:42:41 2006 +0000
@@ -144,13 +144,6 @@
 
 \(fn NODE CHILD)")
 
-(defun ewoc--dll-create ()
-  "Create an empty doubly linked list."
-  (let ((dummy-node (ewoc--node-create 'DL-LIST 'DL-LIST)))
-    (setf (ewoc--node-right dummy-node) dummy-node)
-    (setf (ewoc--node-left dummy-node) dummy-node)
-    dummy-node))
-
 (defun ewoc--node-enter-before (node elemnode)
   "Insert ELEMNODE before NODE in a DLL."
   (assert (and (null (ewoc--node-left elemnode)) (null (ewoc--node-right elemnode))))
@@ -159,14 +152,6 @@
   (setf (ewoc--node-right (ewoc--node-left node)) elemnode)
   (setf (ewoc--node-left node) elemnode))
 
-(defun ewoc--node-enter-first (dll node)
-  "Add a free floating NODE first in DLL."
-  (ewoc--node-enter-before (ewoc--node-right dll) node))
-
-(defun ewoc--node-enter-last (dll node)
-  "Add a free floating NODE last in DLL."
-  (ewoc--node-enter-before dll node))
-
 (defun ewoc--node-next (dll node)
   "Return the node after NODE, or nil if NODE is the last node."
   (unless (eq (ewoc--node-right node) dll) (ewoc--node-right node)))
@@ -175,16 +160,6 @@
   "Return the node before NODE, or nil if NODE is the first node."
   (unless (eq (ewoc--node-left node) dll) (ewoc--node-left node)))
 
-(defun ewoc--node-delete (node)
-  "Unbind NODE from its doubly linked list and return it."
-  ;; This is a no-op when applied to the dummy node. This will return
-  ;; nil if applied to the dummy node since it always contains nil.
-  (setf (ewoc--node-right (ewoc--node-left node)) (ewoc--node-right node))
-  (setf (ewoc--node-left (ewoc--node-right node)) (ewoc--node-left node))
-  (setf (ewoc--node-left node) nil)
-  (setf (ewoc--node-right node) nil)
-  node)
-
 (defun ewoc--node-nth (dll n)
   "Return the Nth node from the doubly linked list DLL.
 N counts from zero. If DLL is not that long, nil is returned.
@@ -221,16 +196,12 @@
 dll will be bound when VARLIST is initialized, but the current
 buffer will *not* have been changed.
 Return value of last form in FORMS."
-  (let ((old-buffer (make-symbol "old-buffer"))
-	(hnd (make-symbol "ewoc")))
-    `(let* ((,old-buffer (current-buffer))
-            (,hnd ,ewoc)
+  (let ((hnd (make-symbol "ewoc")))
+    `(let* ((,hnd ,ewoc)
             (dll (ewoc--dll ,hnd))
             ,@varlist)
-      (set-buffer (ewoc--buffer ,hnd))
-      (unwind-protect
-           (progn ,@forms)
-        (set-buffer ,old-buffer)))))
+       (with-current-buffer (ewoc--buffer ,hnd)
+         ,@forms))))
 
 (defmacro ewoc--set-buffer-bind-dll (ewoc &rest forms)
   `(ewoc--set-buffer-bind-dll-let* ,ewoc nil ,@forms))
@@ -261,26 +232,6 @@
       (funcall pretty-printer data)
       (ewoc--node-create (copy-marker pos) data))))
 
-
-(defun ewoc--delete-node-internal (ewoc node)
-  "Delete a data string from EWOC.
-Can not be used on the footer.  Return the wrapper that is deleted.
-The start-marker in the wrapper is set to nil, so that it doesn't
-consume any more resources."
-  (let ((dll (ewoc--dll ewoc))
-	(inhibit-read-only t))
-    ;; If we are about to delete the node pointed at by last-node,
-    ;; set last-node to nil.
-    (if (eq (ewoc--last-node ewoc) node)
-	(setf (ewoc--last-node ewoc) nil))
-
-    (delete-region (ewoc--node-start-marker node)
-		   (ewoc--node-start-marker (ewoc--node-next dll node)))
-    (set-marker (ewoc--node-start-marker node) nil)
-    ;; Delete the node, and return the wrapper.
-    (ewoc--node-delete node)))
-
-
 (defun ewoc--refresh-node (pp node)
   "Redisplay the element represented by NODE using the pretty-printer PP."
   (let ((inhibit-read-only t))
@@ -313,19 +264,23 @@
 present at the top of the ewoc.  HEADER should end with a
 newline.  Optional third argument FOOTER is similar, and will
 be inserted at the bottom of the ewoc."
-  (let ((new-ewoc
-	 (ewoc--create (current-buffer)
-		       pretty-printer nil nil (ewoc--dll-create)))
-	(pos (point)))
+  (let* ((dummy-node (ewoc--node-create 'DL-LIST 'DL-LIST))
+         (dll (progn (setf (ewoc--node-right dummy-node) dummy-node)
+                     (setf (ewoc--node-left dummy-node) dummy-node)
+                     dummy-node))
+         (new-ewoc
+          (ewoc--create (current-buffer)
+                        pretty-printer nil nil dll))
+         (pos (point)))
     (ewoc--set-buffer-bind-dll new-ewoc
       ;; Set default values
       (unless header (setq header ""))
       (unless footer (setq footer ""))
       (setf (ewoc--node-start-marker dll) (copy-marker pos))
-      (let ((foot (ewoc--create-node footer (lambda (x) (insert footer)) pos))
-	    (head (ewoc--create-node header (lambda (x) (insert header)) pos)))
-	(ewoc--node-enter-first dll head)
-	(ewoc--node-enter-last  dll foot)
+      (let ((foot (ewoc--create-node footer 'insert pos))
+	    (head (ewoc--create-node header 'insert pos)))
+	(ewoc--node-enter-before (ewoc--node-right dll) head)
+	(ewoc--node-enter-before                   dll  foot)
 	(setf (ewoc--header new-ewoc) head)
 	(setf (ewoc--footer new-ewoc) foot)))
     ;; Return the ewoc
@@ -421,11 +376,27 @@
   (ewoc--set-buffer-bind-dll-let* ewoc
       ((node (ewoc--node-nth dll 1))
        (footer (ewoc--footer ewoc))
-       (next nil))
+       (next nil)
+       (L nil) (R nil)
+       (inhibit-read-only t))
     (while (not (eq node footer))
       (setq next (ewoc--node-next dll node))
       (unless (apply predicate (ewoc--node-data node) args)
-	(ewoc--delete-node-internal ewoc node))
+        ;; If we are about to delete the node pointed at by last-node,
+        ;; set last-node to nil.
+        (if (eq (ewoc--last-node ewoc) node)
+            (setf (ewoc--last-node ewoc) nil))
+        (delete-region (ewoc--node-start-marker node)
+                       (ewoc--node-start-marker (ewoc--node-next dll node)))
+        (set-marker (ewoc--node-start-marker node) nil)
+        (setf L (ewoc--node-left  node)
+              R (ewoc--node-right node)
+              ;; Link neighbors to each other.
+              (ewoc--node-right L) R
+              (ewoc--node-left  R) L
+              ;; Forget neighbors.
+              (ewoc--node-left  node) nil
+              (ewoc--node-right node) nil))
       (setq node next))))
 
 (defun ewoc-locate (ewoc &optional pos guess)
@@ -601,8 +572,8 @@
   "Set the HEADER and FOOTER of EWOC."
   (setf (ewoc--node-data (ewoc--header ewoc)) header)
   (setf (ewoc--node-data (ewoc--footer ewoc)) footer)
-  (ewoc--refresh-node (lambda (x) (insert header)) (ewoc--header ewoc))
-  (ewoc--refresh-node (lambda (x) (insert footer)) (ewoc--footer ewoc)))
+  (ewoc--refresh-node 'insert (ewoc--header ewoc))
+  (ewoc--refresh-node 'insert (ewoc--footer ewoc)))
 
 
 (provide 'ewoc)
--- a/lisp/emacs-lisp/re-builder.el	Tue May 02 08:50:29 2006 +0000
+++ b/lisp/emacs-lisp/re-builder.el	Wed May 10 20:42:41 2006 +0000
@@ -112,7 +112,7 @@
 (if (not (fboundp 'make-overlay))
     (require 'overlay))
 
-;; User costomizable variables
+;; User customizable variables
 (defgroup re-builder nil
   "Options for the RE Builder."
   :group 'lisp
@@ -627,11 +627,9 @@
 	    beg (match-end 0)))
     i))
 
-
 (defun reb-update-overlays (&optional subexp)
   "Switch to `reb-target-buffer' and mark all matches of `reb-regexp'.
 If SUBEXP is non-nil mark only the corresponding sub-expressions."
-
   (let* ((re (reb-target-binding reb-regexp))
 	 (subexps (reb-count-subexps re))
 	 (matches 0)
@@ -645,24 +643,35 @@
 		  (or (not reb-auto-match-limit)
 		      (< matches reb-auto-match-limit)))
 	(if (= 0 (length (match-string 0)))
-	  (error "Empty regular expression!"))
-	(let ((i 0))
+	    (error "Empty regular expression!"))
+	(let ((i 0)
+	      suffix max-suffix)
 	  (setq matches (1+ matches))
 	  (while (<= i subexps)
 	    (if (and (or (not subexp) (= subexp i))
 		     (match-beginning i))
 		(let ((overlay (make-overlay (match-beginning i)
 					     (match-end i)))
-		      (face-name (format "reb-match-%d" i)))
-		  (if (not firstmatch)
-		      (setq firstmatch (match-data)))
+		      ;; When we have exceeded the number of provided faces,
+		      ;; cycle thru them where `max-suffix' denotes the maximum
+		      ;; suffix for `reb-match-*' that has been defined and
+		      ;; `suffix' the suffix calculated for the current match.
+		      (face
+		       (cond
+			(max-suffix
+			 (if (= suffix max-suffix)
+			     (setq suffix 1)
+			   (setq suffix (1+ suffix)))
+			 (intern-soft (format "reb-match-%d" suffix)))
+			((intern-soft (format "reb-match-%d" i)))
+			((setq max-suffix (1- i))
+			 (setq suffix 1)
+			 ;; `reb-match-1' must exist.
+			 'reb-match-1))))
+		  (unless firstmatch (setq firstmatch (match-data)))
 		  (setq reb-overlays (cons overlay reb-overlays)
 			submatches (1+ submatches))
-		  (overlay-put
-		   overlay 'face
-		   (or (intern-soft face-name)
-		       (error "Too many subexpressions - face `%s' not defined"
-			      face-name )))
+		  (overlay-put overlay 'face face)
 		  (overlay-put overlay 'priority i)))
 	    (setq i (1+ i))))))
     (let ((count (if subexp submatches matches)))
--- a/lisp/emacs-lisp/syntax.el	Tue May 02 08:50:29 2006 +0000
+++ b/lisp/emacs-lisp/syntax.el	Wed May 10 20:42:41 2006 +0000
@@ -27,9 +27,9 @@
 
 ;; The main exported function is `syntax-ppss'.  You might also need
 ;; to call `syntax-ppss-flush-cache' or to add it to
-;; after-change-functions'(although this is automatically done by
+;; before-change-functions'(although this is automatically done by
 ;; syntax-ppss when needed, but that might fail if syntax-ppss is
-;; called in a context where after-change-functions is temporarily
+;; called in a context where before-change-functions is temporarily
 ;; let-bound to nil).
 
 ;;; Todo:
@@ -94,10 +94,9 @@
 	(setq syntax-ppss-last nil)
       (setcar syntax-ppss-last nil)))
   ;; Unregister if there's no cache left.  Sadly this doesn't work
-  ;; because `after-change-functions' is temporarily bound to nil here.
+  ;; because `before-change-functions' is temporarily bound to nil here.
   ;; (unless syntax-ppss-cache
-  ;;   (remove-hook 'after-change-functions
-  ;; 		 'syntax-ppss-after-change-function t))
+  ;;   (remove-hook 'before-change-functions 'syntax-ppss-flush-cache t))
   )
 
 (defvar syntax-ppss-stats
@@ -148,7 +147,7 @@
 		 ;; too far from `pos', we could try to use other positions
 		 ;; in (nth 9 old-ppss), but that doesn't seem to happen in
 		 ;; practice and it would complicate this code (and the
-		 ;; after-change-function code even more).  But maybe it
+		 ;; before-change-function code even more).  But maybe it
 		 ;; would be useful in "degenerate" cases such as when the
 		 ;; whole file is wrapped in a set of parenthesis.
 		 (setq pt-min (or (car (nth 9 old-ppss))
@@ -176,10 +175,10 @@
 		(setq cache (cdr cache)))
 	      (if cache (setq pt-min (caar cache) ppss (cdar cache)))
 
-	      ;; Setup the after-change function if necessary.
+	      ;; Setup the before-change function if necessary.
 	      (unless (or syntax-ppss-cache syntax-ppss-last)
-		(add-hook 'after-change-functions
-			  'syntax-ppss-flush-cache nil t))
+		(add-hook 'before-change-functions
+			  'syntax-ppss-flush-cache t t))
 
 	      ;; Use the best of OLD-POS and CACHE.
 	      (if (or (not old-pos) (< old-pos pt-min))
--- a/lisp/env.el	Tue May 02 08:50:29 2006 +0000
+++ b/lisp/env.el	Wed May 10 20:42:41 2006 +0000
@@ -117,7 +117,7 @@
      (let* ((var (read-envvar-name "Set environment variable: " nil))
 	    (value (getenv var)))
        (when value
-	 (push value setenv-history))
+	 (add-to-history 'setenv-history value))
        ;; Here finally we specify the args to give call setenv with.
        (list var
 	     (read-from-minibuffer (format "Set %s to value: " var)
--- a/lisp/files.el	Tue May 02 08:50:29 2006 +0000
+++ b/lisp/files.el	Wed May 10 20:42:41 2006 +0000
@@ -2349,31 +2349,29 @@
 ;; For variables defined in the C source code the declaration should go here:
 
 ;; FIXME: Some variables should be moved according to the rules above.
-(let ((string-or-null (lambda (a) (or (stringp a) (null a)))))
-  (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)
-	    (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)
-	    (fill-column        .  integerp)
-	    (fill-prefix        .  string-or-null-p)
-	    (indent-tabs-mode   .  t)
-	    (kept-old-versions  .  integerp)
-	    (kept-new-versions  .  integerp)
-	    (left-margin        .  t)
-	    (no-byte-compile    .  t)
-	    (no-update-autoloads . t)
-	    (outline-regexp     .  string-or-null-p)
-	    (tab-width          .  integerp) ;; C source code
-	    (truncate-lines     .  t) ;; C source code
-	    (version-control    .  t)))))
+(mapc (lambda (pair)
+	(put (car pair) 'safe-local-variable (cdr pair)))
+      '((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        . booleanp)
+	(fill-column                     . integerp)
+	(fill-prefix                     . string-or-null-p)
+	(indent-tabs-mode                . booleanp) ;; C source code
+	(kept-old-versions               . integerp)
+	(kept-new-versions               . integerp)
+	(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                  . booleanp) ;; C source code
+	(version-control                 . symbolp)))
 
 (put 'c-set-style 'safe-local-eval-function t)
 
@@ -3931,7 +3929,7 @@
 time consuming operations.
 
 For more information on how this variable is used by Auto Revert mode,
-see Info node `(emacs-xtra)Supporting additional buffers'.")
+see Info node `(emacs)Supporting additional buffers'.")
 
 (defvar before-revert-hook nil
   "Normal hook for `revert-buffer' to run before reverting.
--- a/lisp/font-lock.el	Tue May 02 08:50:29 2006 +0000
+++ b/lisp/font-lock.el	Wed May 10 20:42:41 2006 +0000
@@ -1975,17 +1975,17 @@
 ;;
 ;;	    (regexp-opt
 ;;	     '("define"  "elif" "else" "endif" "error" "file" "if" "ifdef"
-;;	       "ifndef" "include" "line" "pragma" "undef"))
+;;	       "ifndef" "import" "include" "line" "pragma" "undef" "warning"))
 ;;
 (defconst cpp-font-lock-keywords-source-directives
-  "define\\|e\\(?:l\\(?:if\\|se\\)\\|ndif\\|rror\\)\\|file\\|i\\(?:f\\(?:n?def\\)?\\|nclude\\)\\|line\\|pragma\\|undef"
+  "define\\|e\\(?:l\\(?:if\\|se\\)\\|ndif\\|rror\\)\\|file\\|i\\(?:f\\(?:n?def\\)?\\|mport\\|nclude\\)\\|line\\|pragma\\|undef\\|warning"
   "Regular expressoin used in `cpp-font-lock-keywords'.")
 
 ;; `cpp-font-lock-keywords-source-depth' is calculated from:
 ;;
 ;;          (regexp-opt-depth (regexp-opt
 ;;		       '("define"  "elif" "else" "endif" "error" "file" "if" "ifdef"
-;;			 "ifndef" "include" "line" "pragma" "undef")))
+;;			 "ifndef" "import" "include" "line" "pragma" "undef" "warning")))
 ;;
 (defconst cpp-font-lock-keywords-source-depth 0
   "An integer representing regular expression depth of `cpp-font-lock-keywords-source-directives'.
@@ -1997,7 +1997,7 @@
     (list
      ;;
      ;; Fontify error directives.
-     '("^#[ \t]*error[ \t]+\\(.+\\)" 1 font-lock-warning-face prepend)
+     '("^#[ \t]*\\(?:error\\|warning\\)[ \t]+\\(.+\\)" 1 font-lock-warning-face prepend)
      ;;
      ;; Fontify filenames in #include <...> preprocessor directives as strings.
      '("^#[ \t]*\\(?:import\\|include\\)[ \t]*\\(<[^>\"\n]*>?\\)"
--- a/lisp/gnus/ChangeLog	Tue May 02 08:50:29 2006 +0000
+++ b/lisp/gnus/ChangeLog	Wed May 10 20:42:41 2006 +0000
@@ -1,3 +1,24 @@
+2006-05-04  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* mm-decode.el (mm-dissect-buffer): Remove spurious double assignment.
+	(mm-copy-to-buffer): Use with-current-buffer.
+	(mm-display-part): Simplify.
+	(mm-inlinable-p): Add optional arg `type'.
+
+	* gnus-art.el (gnus-mime-view-part-as-type): Add optional PRED
+	argument.
+	(gnus-mime-view-part-externally, gnus-mime-view-part-internally):
+	Try harder to show the attachment internally or externally using
+	gnus-mime-view-part-as-type.
+
+2006-05-04  Reiner Steib  <Reiner.Steib@gmx.de>
+
+	* gnus-art.el (gnus-mime-view-part-as-type-internal): Try to fetch
+	`filename' from Content-Disposition if Content-Type doesn't
+	provide `name'.
+	(gnus-mime-view-part-as-type): Set default instead of
+	initial-input.
+
 2006-04-28  Katsumi Yamaoka  <yamaoka@jpl.org>
 
 	* mm-uu.el (mm-uu-pgp-encrypted-extract-1): Assume buffer is made
--- a/lisp/gnus/gnus-art.el	Tue May 02 08:50:29 2006 +0000
+++ b/lisp/gnus/gnus-art.el	Wed May 10 20:42:41 2006 +0000
@@ -4317,21 +4317,29 @@
 
 (defun gnus-mime-view-part-as-type-internal ()
   (gnus-article-check-buffer)
-  (let* ((name (mail-content-type-get
-		(mm-handle-type (get-text-property (point) 'gnus-data))
-		'name))
+  (let* ((handle (get-text-property (point) 'gnus-data))
+	 (name (or
+		;; Content-Type: foo/bar; name=...
+		(mail-content-type-get (mm-handle-type handle) 'name)
+		;; Content-Disposition: attachment; filename=...
+		(cdr (assq 'filename (cdr (mm-handle-disposition handle))))))
 	 (def-type (and name (mm-default-file-encoding name))))
     (and def-type (cons def-type 0))))
 
-(defun gnus-mime-view-part-as-type (&optional mime-type)
-  "Choose a MIME media type, and view the part as such."
+(defun gnus-mime-view-part-as-type (&optional mime-type pred)
+  "Choose a MIME media type, and view the part as such.
+If non-nil, PRED is a predicate to use during completion to limit the
+available media-types."
   (interactive)
   (unless mime-type
-    (setq mime-type (completing-read
-		     "View as MIME type: "
-		     (mapcar #'list (mailcap-mime-types))
-		     nil nil
-		     (gnus-mime-view-part-as-type-internal))))
+    (setq mime-type
+	  (let ((default (gnus-mime-view-part-as-type-internal)))
+	    (completing-read
+	     (format "View as MIME type (default %s): "
+		     (car default))
+	     (mapcar #'list (mailcap-mime-types))
+	     pred nil nil nil
+	     (car default)))))
   (gnus-article-check-buffer)
   (let ((handle (get-text-property (point) 'gnus-data)))
     (when handle
@@ -4511,12 +4519,18 @@
 	 (mm-inlined-types nil)
 	 (mail-parse-charset gnus-newsgroup-charset)
 	 (mail-parse-ignored-charsets
-	  (save-excursion (set-buffer gnus-summary-buffer)
-			  gnus-newsgroup-ignored-charsets)))
-    (when handle
-      (if (mm-handle-undisplayer handle)
-	  (mm-remove-part handle)
-	(mm-display-part handle)))))
+          (with-current-buffer gnus-summary-buffer
+            gnus-newsgroup-ignored-charsets))
+         (type (mm-handle-media-type handle))
+         (method (mailcap-mime-info type))
+         (mm-enable-external t))
+    (if (not (stringp method))
+	(gnus-mime-view-part-as-type
+	 nil (lambda (type) (stringp (mailcap-mime-info type))))
+      (when handle
+	(if (mm-handle-undisplayer handle)
+	    (mm-remove-part handle)
+	  (mm-display-part handle))))))
 
 (defun gnus-mime-view-part-internally (&optional handle)
   "View the MIME part under point with an internal viewer.
@@ -4528,13 +4542,16 @@
 	 (mm-inline-large-images t)
 	 (mail-parse-charset gnus-newsgroup-charset)
 	 (mail-parse-ignored-charsets
-	  (save-excursion (set-buffer gnus-summary-buffer)
-			  gnus-newsgroup-ignored-charsets))
+	  (with-current-buffer gnus-summary-buffer
+	    gnus-newsgroup-ignored-charsets))
 	 (inhibit-read-only t))
-    (when handle
-      (if (mm-handle-undisplayer handle)
-	  (mm-remove-part handle)
-	(mm-display-part handle)))))
+    (if (not (mm-inlinable-p handle))
+        (gnus-mime-view-part-as-type
+         nil (lambda (type) (mm-inlinable-p handle type)))
+      (when handle
+	(if (mm-handle-undisplayer handle)
+	    (mm-remove-part handle)
+	  (mm-display-part handle))))))
 
 (defun gnus-mime-action-on-part (&optional action)
   "Do something with the MIME attachment at \(point\)."
--- a/lisp/gnus/mm-decode.el	Tue May 02 08:50:29 2006 +0000
+++ b/lisp/gnus/mm-decode.el	Wed May 10 20:42:41 2006 +0000
@@ -562,7 +562,7 @@
 	   description)
 	(setq type (split-string (car ctl) "/"))
 	(setq subtype (cadr type)
-	      type (pop type))
+	      type (car type))
 	(setq
 	 result
 	 (cond
@@ -641,16 +641,15 @@
 
 (defun mm-copy-to-buffer ()
   "Copy the contents of the current buffer to a fresh buffer."
-  (save-excursion
     (let ((obuf (current-buffer))
 	  beg)
       (goto-char (point-min))
       (search-forward-regexp "^\n" nil t)
       (setq beg (point))
-      (set-buffer
+    (with-current-buffer
        ;; Preserve the data's unibyteness (for url-insert-file-contents).
        (let ((default-enable-multibyte-characters (mm-multibyte-p)))
-	 (generate-new-buffer " *mm*")))
+          (generate-new-buffer " *mm*"))
       (insert-buffer-substring obuf beg)
       (current-buffer))))
 
@@ -701,7 +700,8 @@
 		  (forward-line 1)
 		  (mm-insert-inline handle (mm-get-part handle))
 		  'inline)
-	      (if (and method ;; If nil, we always use "save".
+	      (setq external
+                    (and method ;; If nil, we always use "save".
 		       (stringp method) ;; 'mailcap-save-binary-file
 		       (or (eq mm-enable-external t)
 			   (and (eq mm-enable-external 'ask)
@@ -714,9 +714,7 @@
 				      (concat
 				       " \"" (format method filename) "\"")
 				    "")
-				  "? ")))))
-		  (setq external t)
-		(setq external nil))
+                                    "? "))))))
 	      (if external
 		  (mm-display-external
 		   handle (or method 'mailcap-save-binary-file))
@@ -1019,10 +1017,12 @@
 	      methods nil)))
     result))
 
-(defun mm-inlinable-p (handle)
-  "Say whether HANDLE can be displayed inline."
+(defun mm-inlinable-p (handle &optional type)
+  "Say whether HANDLE can be displayed inline.
+TYPE is the mime-type of the object; it defaults to the one given
+in HANDLE."
+  (unless type (setq type (mm-handle-media-type handle)))
   (let ((alist mm-inline-media-tests)
-	(type (mm-handle-media-type handle))
 	test)
     (while alist
       (when (string-match (caar alist) type)
--- a/lisp/ibuffer.el	Tue May 02 08:50:29 2006 +0000
+++ b/lisp/ibuffer.el	Wed May 10 20:42:41 2006 +0000
@@ -325,9 +325,7 @@
   :group 'ibuffer)
 
 (defcustom ibuffer-compressed-file-name-regexp
-  (concat "\\.\\("
-	(regexp-opt '("arj" "bgz" "bz2" "gz" "lzh" "taz" "tgz" "zip" "z"))
-	"\\)$")
+  "\\.\\(arj\\|bgz\\|bz2\\|gz\\|lzh\\|taz\\|tgz\\|zip\\|z\\)$"
   "Regexp to match compressed file names."
   :type 'regexp
   :group 'ibuffer)
--- a/lisp/isearch.el	Tue May 02 08:50:29 2006 +0000
+++ b/lisp/isearch.el	Wed May 10 20:42:41 2006 +0000
@@ -826,21 +826,11 @@
 
 (defun isearch-update-ring (string &optional regexp)
   "Add STRING to the beginning of the search ring.
-REGEXP says which ring to use."
-  (if regexp
-      (if (or (null regexp-search-ring)
-	      (not (string= string (car regexp-search-ring))))
-	  (progn
-	    (push string regexp-search-ring)
-	    (if (> (length regexp-search-ring) regexp-search-ring-max)
-		(setcdr (nthcdr (1- search-ring-max) regexp-search-ring)
-			nil))))
-    (if (or (null search-ring)
-	    (not (string= string (car search-ring))))
-	(progn
-	  (push string search-ring)
-	  (if (> (length search-ring) search-ring-max)
-	      (setcdr (nthcdr (1- search-ring-max) search-ring) nil))))))
+REGEXP if non-nil says use the regexp search ring."
+  (add-to-history
+   (if regexp 'regexp-search-ring 'search-ring)
+   string
+   (if regexp regexp-search-ring-max search-ring-max)))
 
 ;; Switching buffers should first terminate isearch-mode.
 ;; ;; For Emacs 19, the frame switch event is handled.
--- a/lisp/kmacro.el	Tue May 02 08:50:29 2006 +0000
+++ b/lisp/kmacro.el	Wed May 10 20:42:41 2006 +0000
@@ -349,10 +349,8 @@
 (defun kmacro-push-ring (&optional elt)
   "Push ELT or current macro onto `kmacro-ring'."
   (when (setq elt (or elt (kmacro-ring-head)))
-    (let ((len (length kmacro-ring)))
-      (setq kmacro-ring (cons elt kmacro-ring))
-      (if (>= len kmacro-ring-max)
-	  (setcdr (nthcdr len kmacro-ring) nil)))))
+    (let ((history-delete-duplicates nil))
+      (add-to-history 'kmacro-ring elt kmacro-ring-max))))
 
 
 (defun kmacro-split-ring-element (elt)
@@ -377,11 +375,6 @@
     (kmacro-pop-ring1 raw)))
 
 
-(defun kmacro-ring-length ()
-  "Return length of macro ring, including pseudo head."
-  (+ (if last-kbd-macro 1 0) (length kmacro-ring)))
-
-
 (defun kmacro-ring-empty-p (&optional none)
   "Tell user and return t if `last-kbd-macro' is nil or `kmacro-ring' is empty.
 Check only `last-kbd-macro' if optional arg NONE is non-nil."
@@ -577,13 +570,8 @@
     (let ((append (and arg (listp arg))))
       (unless append
 	(if last-kbd-macro
-	    (let ((len (length kmacro-ring)))
-	      (setq kmacro-ring
-		    (cons
-		     (list last-kbd-macro kmacro-counter kmacro-counter-format-start)
-		     kmacro-ring))
-	      (if (>= len kmacro-ring-max)
-		  (setcdr (nthcdr len kmacro-ring) nil))))
+	    (kmacro-push-ring
+	     (list last-kbd-macro kmacro-counter kmacro-counter-format-start)))
 	(setq kmacro-counter (or (if arg (prefix-numeric-value arg))
 				 kmacro-initial-counter-value
 				 0)
--- a/lisp/ldefs-boot.el	Tue May 02 08:50:29 2006 +0000
+++ b/lisp/ldefs-boot.el	Wed May 10 20:42:41 2006 +0000
@@ -6978,7 +6978,7 @@
 may have to reset some subdirectory switches after a `dired-undo'.
 You can reset all subdirectory switches to the default using
 \\<dired-mode-map>\\[dired-reset-subdir-switches].
-See Info node `(emacs-xtra)Subdir switches' for more details.
+See Info node `(emacs)Subdir switches' for more details.
 
 \(fn &optional ARG TEST-FOR-SUBDIR)" t nil)
 
@@ -7116,7 +7116,7 @@
 may have to reset some subdirectory switches after a `dired-undo'.
 You can reset all subdirectory switches to the default using
 \\<dired-mode-map>\\[dired-reset-subdir-switches].
-See Info node `(emacs-xtra)Subdir switches' for more details.
+See Info node `(emacs)Subdir switches' for more details.
 
 \(fn DIRNAME &optional SWITCHES NO-ERROR-IF-NOT-DIR-P)" t nil)
 
--- a/lisp/mh-e/ChangeLog	Tue May 02 08:50:29 2006 +0000
+++ b/lisp/mh-e/ChangeLog	Wed May 10 20:42:41 2006 +0000
@@ -1,3 +1,13 @@
+2006-05-06  Bill Wohler  <wohler@newt.com>
+
+	Release MH-E version 8.0.
+
+	* mh-e.el (Version, mh-version): Update for release 8.0.
+
+2006-05-05  Bill Wohler  <wohler@newt.com>
+
+	* mh-e.el: Update commentary.
+
 2006-04-28  Bill Wohler  <wohler@newt.com>
 
 	Release MH-E version 7.95.
--- a/lisp/mh-e/mh-e.el	Tue May 02 08:50:29 2006 +0000
+++ b/lisp/mh-e/mh-e.el	Wed May 10 20:42:41 2006 +0000
@@ -6,7 +6,7 @@
 
 ;; Author: Bill Wohler <wohler@newt.com>
 ;; Maintainer: Bill Wohler <wohler@newt.com>
-;; Version: 7.95
+;; Version: 8.0
 ;; Keywords: mail
 
 ;; This file is part of GNU Emacs.
@@ -28,6 +28,20 @@
 
 ;;; Commentary:
 
+;; MH-E is an Emacs interface to the MH mail system.
+
+;; MH-E is supported by GNU Emacs 21 and 22, as well as XEmacs 21
+;; (except for versions 21.5.9-21.5.16). It is compatible with MH
+;; versions 6.8.4 and higher, all versions of nmh, and GNU mailutils
+;; 0.4 and higher.
+
+;; MH (Message Handler) is a powerful mail reader. See
+;; http://rand-mh.sourceforge.net/.
+
+;; N.B. MH must have been compiled with the MHE compiler flag or several
+;; features necessary for MH-E will be missing from MH commands, specifically
+;; the -build switch to repl and forw.
+
 ;; How to use:
 ;;   M-x mh-rmail to read mail.  Type C-h m there for a list of commands.
 ;;   C-u M-x mh-rmail to visit any folder.
@@ -44,23 +58,6 @@
 ;; If you want to customize MH-E before explicitly loading it, add this:
 ;;   (require 'mh-cus-load)
 
-;; MH (Message Handler) is a powerful mail reader.
-
-;; The MH newsgroup is comp.mail.mh; the mailing list is mh-users@ics.uci.edu
-;; (send to mh-users-request to be added). See the monthly Frequently Asked
-;; Questions posting there for information on getting MH and MH-E:
-;;   http://www.faqs.org/faqs/mail/mh-faq/part1/preamble.html
-
-;; N.B. MH must have been compiled with the MHE compiler flag or several
-;; features necessary for MH-E will be missing from MH commands, specifically
-;; the -build switch to repl and forw.
-
-;; MH-E is an Emacs interface to the MH mail system.
-
-;; MH-E is supported in GNU Emacs 21 and 22 as well as XEmacs 21
-;; (except for versions 21.5.9-21.5.16), with MH 6.8.4 on, nmh 1.0.4
-;; on, and GNU mailutils 0.4 on.
-
 ;; Mailing Lists:
 ;;   mh-e-users@lists.sourceforge.net
 ;;   mh-e-announce@lists.sourceforge.net
@@ -136,7 +133,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.95" "Version number of MH-E.")
+(defconst mh-version "8.0" "Version number of MH-E.")
 
 ;; Variants
 
--- a/lisp/msb.el	Tue May 02 08:50:29 2006 +0000
+++ b/lisp/msb.el	Wed May 10 20:42:41 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/mwheel.el	Tue May 02 08:50:29 2006 +0000
+++ b/lisp/mwheel.el	Wed May 10 20:42:41 2006 +0000
@@ -204,8 +204,25 @@
       (setq amt (* amt (event-click-count event))))
     (unwind-protect
 	(let ((button (mwheel-event-button event)))
-	  (cond ((eq button mouse-wheel-down-event) (scroll-down amt))
-		((eq button mouse-wheel-up-event) (scroll-up amt))
+	  (cond ((eq button mouse-wheel-down-event)
+                 (condition-case nil (scroll-down amt)
+                   ;; Make sure we do indeed scroll to the beginning of
+                   ;; the buffer.
+                   (beginning-of-buffer
+                    (unwind-protect
+                        (scroll-down)
+                      ;; If the first scroll succeeded, then some scrolling
+                      ;; is possible: keep scrolling til the beginning but
+                      ;; do not signal an error.  For some reason, we have
+                      ;; to do it even if the first scroll signalled an
+                      ;; error, because otherwise the window is recentered
+                      ;; for a reason that escapes me.  This problem seems
+                      ;; to only affect scroll-down.  --Stef
+                      (set-window-start (selected-window) (point-min))))))
+		((eq button mouse-wheel-up-event)
+                 (condition-case nil (scroll-up amt)
+                   ;; Make sure we do indeed scroll to the end of the buffer.
+                   (end-of-buffer (while t (scroll-up)))))
 		(t (error "Bad binding in mwheel-scroll"))))
       (if curwin (select-window curwin))))
   (when (and mouse-wheel-click-event mouse-wheel-inhibit-click-time)
--- a/lisp/net/tramp.el	Tue May 02 08:50:29 2006 +0000
+++ b/lisp/net/tramp.el	Wed May 10 20:42:41 2006 +0000
@@ -4331,7 +4331,7 @@
   "Add tramp file name handlers to `file-name-handler-alist'."
   (add-to-list 'file-name-handler-alist
 	       (cons tramp-file-name-regexp 'tramp-file-name-handler))
-  (when partial-completion-mode
+  (when (or partial-completion-mode (featurep 'ido))
     (add-to-list 'file-name-handler-alist
 		 (cons tramp-completion-file-name-regexp
 		       'tramp-completion-file-name-handler))
--- a/lisp/progmodes/gdb-ui.el	Tue May 02 08:50:29 2006 +0000
+++ b/lisp/progmodes/gdb-ui.el	Wed May 10 20:42:41 2006 +0000
@@ -114,8 +114,6 @@
 Each element has the form (VARNUM EXPRESSION NUMCHILD TYPE VALUE STATUS FP)
 where STATUS is nil (unchanged), `changed' or `out-of-scope', FP the frame
 address for root variables.")
-(defvar gdb-force-update t
- "Non-nil means that view of watch expressions will be updated in the speedbar.")
 (defvar gdb-main-file nil "Source file from which program execution begins.")
 (defvar gdb-overlay-arrow-position nil)
 (defvar gdb-server-prefix nil)
@@ -527,7 +525,6 @@
 	gdb-current-language nil
 	gdb-frame-number nil
 	gdb-var-list nil
-	gdb-force-update t
 	gdb-main-file nil
 	gdb-first-post-prompt t
 	gdb-prompting nil
@@ -690,10 +687,14 @@
 	  (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))))))
+	      (speedbar 1)
 	      (catch 'already-watched
 		(dolist (var gdb-var-list)
 		  (unless (string-match "\\." (car var))
@@ -725,7 +726,6 @@
 		  (match-string 3)
 		  nil nil gdb-frame-address)))
 	(push var gdb-var-list)
-	(speedbar 1)
 	(unless (string-equal
 		 speedbar-initial-expansion-list-name "GUD")
 	  (speedbar-change-initial-expansion-list "GUD"))
@@ -741,13 +741,26 @@
 	(message-box "Watching expressions requires gdb 6.0 onwards")
       (message-box "No symbol \"%s\" in current context." expr))))
 
+(defun gdb-speedbar-update ()
+  (when (and (boundp 'speedbar-frame) (frame-live-p speedbar-frame))
+    ;; Dummy command to update speedbar even when idle.
+    (gdb-enqueue-input (list "server pwd\n" 'gdb-speedbar-timer-fn))
+    ;; Keep gdb-pending-triggers non-nil till end.
+    (push 'gdb-speedbar-timer gdb-pending-triggers)))
+
+(defun gdb-speedbar-timer-fn ()
+  (setq gdb-pending-triggers
+	(delq 'gdb-speedbar-timer gdb-pending-triggers))
+  (speedbar-timer-fn))
+
 (defun gdb-var-evaluate-expression-handler (varnum changed)
   (goto-char (point-min))
   (re-search-forward ".*value=\\(\".*\"\\)" nil t)
   (let ((var (assoc varnum gdb-var-list)))
     (when var
       (if changed (setcar (nthcdr 5 var) 'changed))
-      (setcar (nthcdr 4 var) (read (match-string 1))))))
+      (setcar (nthcdr 4 var) (read (match-string 1)))))
+  (gdb-speedbar-update))
 
 (defun gdb-var-list-children (varnum)
   (gdb-enqueue-input
@@ -811,21 +824,7 @@
 		  varnum "\"\n")
 	  `(lambda () (gdb-var-evaluate-expression-handler ,varnum t)))))))
   (setq gdb-pending-triggers
-	(delq 'gdb-var-update gdb-pending-triggers))
-  (when (and (boundp 'speedbar-frame) (frame-live-p speedbar-frame))
-    ;; Dummy command to update speedbar at right time.
-    (gdb-enqueue-input (list "server pwd\n" 'gdb-speedbar-refresh))
-    ;; Keep gdb-pending-triggers non-nil till end.
-    (push 'gdb-speedbar-refresh gdb-pending-triggers)))
-
-(defun gdb-speedbar-refresh ()
-  (setq gdb-pending-triggers
-	(delq 'gdb-speedbar-refresh gdb-pending-triggers))
-  (with-current-buffer gud-comint-buffer
-    (let ((speedbar-verbosity-level 0)
-	  (speedbar-shown-directories nil))
-      (save-excursion
-	(speedbar-refresh)))))
+	(delq 'gdb-var-update gdb-pending-triggers)))
 
 (defun gdb-var-delete ()
   "Delete watch expression at point from the speedbar."
@@ -1378,7 +1377,6 @@
       ;; FIXME: with GDB-6 on Darwin, this might very well work.
       ;; Only needed/used with speedbar/watch expressions.
       (when (and (boundp 'speedbar-frame) (frame-live-p speedbar-frame))
-	(setq gdb-force-update t)
 	(if (string-equal gdb-version "pre-6.4")
 	    (gdb-var-update)
 	  (gdb-var-update-1)))))
@@ -1913,7 +1911,7 @@
 	    (let* ((buffer (find-file-noselect
 			 (if (file-exists-p file) file
 			   (cdr (assoc bptno gdb-location-alist)))))
-		   (window (unless (gdb-display-source-buffer buffer)
+		   (window (or (gdb-display-source-buffer buffer)
 			       (display-buffer buffer))))
 	      (setq gdb-source-window window)
 	      (with-current-buffer buffer
@@ -2691,7 +2689,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))
@@ -2755,6 +2753,7 @@
 	   ;; Put buffer list in window if we
 	   ;; can't find a source file.
 	   (list-buffers-noselect))))
+  (setq gdb-source-window (selected-window))
   (when gdb-use-separate-io-buffer
     (split-window-horizontally)
     (other-window 1)
@@ -2782,6 +2781,7 @@
        (if gud-last-last-frame
 	   (gud-find-file (car gud-last-last-frame))
 	 (gud-find-file gdb-main-file)))
+      (setq gdb-source-window (selected-window))
       (other-window 1))))
 
 (defun gdb-reset ()
@@ -2803,8 +2803,6 @@
   (setq overlay-arrow-variable-list
 	(delq 'gdb-overlay-arrow-position overlay-arrow-variable-list))
   (setq fringe-indicator-alist '((overlay-arrow . right-triangle)))
-  (if (and (boundp 'speedbar-frame) (frame-live-p speedbar-frame))
-      (speedbar-refresh))
   (setq gud-running nil)
   (setq gdb-active-process nil)
   (setq gdb-var-list nil)
@@ -3163,7 +3161,9 @@
     (if (and (match-string 3) gud-overlay-arrow-position)
       (let ((buffer (marker-buffer gud-overlay-arrow-position))
 	    (position (marker-position gud-overlay-arrow-position)))
-	(when (and buffer (string-equal (buffer-name buffer) (match-string 3)))
+	(when (and buffer
+		   (string-equal (buffer-name buffer)
+				 (file-name-nondirectory (match-string 3))))
 	  (with-current-buffer buffer
 	    (setq fringe-indicator-alist
 		  (if (string-equal gdb-frame-number "0")
@@ -3230,7 +3230,8 @@
 		      (throw 'child-already-watched nil))
 		  (push varchild var-list))))
 	  (push var var-list)))
-      (setq gdb-var-list (nreverse var-list)))))
+      (setq gdb-var-list (nreverse var-list))))
+  (gdb-speedbar-update))
 
 ; Uses "-var-update --all-values".  Needs GDB 6.4 onwards.
 (defun gdb-var-update-1 ()
@@ -3263,11 +3264,7 @@
 		  (read (match-string 2)))))))
   (setq gdb-pending-triggers
    (delq 'gdb-var-update gdb-pending-triggers))
-  (when (and (boundp 'speedbar-frame) (frame-live-p speedbar-frame))
-    ;; dummy command to update speedbar at right time
-    (gdb-enqueue-input (list "server pwd\n" 'gdb-speedbar-refresh))
-    ;; keep gdb-pending-triggers non-nil till end
-    (push 'gdb-speedbar-refresh gdb-pending-triggers)))
+  (gdb-speedbar-update))
 
 ;; Registers buffer.
 ;;
--- a/lisp/progmodes/grep.el	Tue May 02 08:50:29 2006 +0000
+++ b/lisp/progmodes/grep.el	Wed May 10 20:42:41 2006 +0000
@@ -584,7 +584,7 @@
 	  (setq command
 		(replace-match
 		 (or (if (symbolp (cdr kw))
-			 (eval (cdr kw))
+			 (symbol-value (cdr kw))
 		       (save-match-data (eval (cdr kw))))
 		     "")
 		 t t command))))))
@@ -639,9 +639,9 @@
 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 shell command.
+With \\[universal-argument] prefix, you can edit the constructed shell command line
+before it is executed.
+With two \\[universal-argument] prefixes, directly edit and run `grep-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]
@@ -676,7 +676,7 @@
 	      (setq command
 		    (read-from-minibuffer "Confirm: "
 					  command nil nil 'grep-history))
-	    (push command grep-history))))
+	    (add-to-history 'grep-history command))))
       (when command
 	;; Setting process-setup-function makes exit-message-function work
 	;; even when async processes aren't supported.
@@ -687,14 +687,14 @@
 
 ;;;###autoload
 (defun rgrep (regexp &optional files dir)
-  "Recusively grep for REGEXP in FILES in directory tree rooted at DIR.
+  "Recursively 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.
+With \\[universal-argument] prefix, you can edit the constructed shell command line
+before it is executed.
+With two \\[universal-argument] prefixes, directly edit and run `grep-find-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]
@@ -721,16 +721,16 @@
     (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
+      (setq dir (file-name-as-directory (expand-file-name dir)))
+      (let ((command (grep-expand-template
+		      grep-find-template
+		      regexp
+		      (concat "\\( -name "
+			      (mapconcat #'shell-quote-argument
+					 (split-string files)
+					 " -o -name ")
+			      " \\)")
+		       dir
 		       (and grep-find-ignored-directories
 			    (concat "\\( -path '*/"
 				    (mapconcat #'identity
@@ -742,8 +742,12 @@
 	      (setq command
 		    (read-from-minibuffer "Confirm: "
 					  command nil nil 'grep-find-history))
-	    (push command grep-find-history))
-	  (compilation-start command 'grep-mode))))))
+	    (add-to-history 'grep-find-history command))
+	  (let ((default-directory dir))
+	    (compilation-start command 'grep-mode))
+	  ;; Set default-directory if we started rgrep in the *grep* buffer.
+	  (if (eq next-error-last-buffer (current-buffer))
+	      (setq default-directory dir)))))))
 
 
 (provide 'grep)
--- a/lisp/progmodes/gud.el	Tue May 02 08:50:29 2006 +0000
+++ b/lisp/progmodes/gud.el	Wed May 10 20:42:41 2006 +0000
@@ -49,7 +49,6 @@
 (defvar gdb-macro-info)
 (defvar gdb-server-prefix)
 (defvar gdb-show-changed-values)
-(defvar gdb-force-update)
 (defvar gdb-var-list)
 (defvar gdb-speedbar-auto-raise)
 (defvar tool-bar-map)
@@ -442,37 +441,55 @@
 	     (buffer-name gud-comint-buffer))
     (let* ((minor-mode (with-current-buffer buffer gud-minor-mode))
 	  (window (get-buffer-window (current-buffer) 0))
+	  (start (window-start window))
 	  (p (window-point window)))
       (cond
        ((memq minor-mode '(gdbmi gdba))
-	(when (or gdb-force-update
-		  (not (save-excursion
-			 (goto-char (point-min))
-			 (looking-at "Watch Expressions:"))))
-	  (erase-buffer)
-	  (insert "Watch Expressions:\n")
-	  (if gdb-speedbar-auto-raise
-	      (raise-frame speedbar-frame))
-	  (let ((var-list gdb-var-list) parent)
-	    (while var-list
-	      (let* (char (depth 0) (start 0) (var (car var-list))
-			  (varnum (car var)) (expr (nth 1 var))
-			  (type (nth 3 var)) (value (nth 4 var))
-			  (status (nth 5 var)))
-		(put-text-property
-		 0 (length expr) 'face font-lock-variable-name-face expr)
-		(put-text-property
-		 0 (length type) 'face font-lock-type-face type)
-		(while (string-match "\\." varnum start)
-		  (setq depth (1+ depth)
-			start (1+ (match-beginning 0))))
-		(if (eq depth 0) (setq parent nil))
-		(if (or (equal (nth 2 var) "0")
-			(and (equal (nth 2 var) "1")
-			     (string-match "char \\*$" type)))
+	(erase-buffer)
+	(insert "Watch Expressions:\n")
+	(if gdb-speedbar-auto-raise
+	    (raise-frame speedbar-frame))
+	(let ((var-list gdb-var-list) parent)
+	  (while var-list
+	    (let* (char (depth 0) (start 0) (var (car var-list))
+			(varnum (car var)) (expr (nth 1 var))
+			(type (nth 3 var)) (value (nth 4 var))
+			(status (nth 5 var)))
+	      (put-text-property
+	       0 (length expr) 'face font-lock-variable-name-face expr)
+	      (put-text-property
+	       0 (length type) 'face font-lock-type-face type)
+	      (while (string-match "\\." varnum start)
+		(setq depth (1+ depth)
+		      start (1+ (match-beginning 0))))
+	      (if (eq depth 0) (setq parent nil))
+	      (if (or (equal (nth 2 var) "0")
+		      (and (equal (nth 2 var) "1")
+			   (string-match "char \\*$" type)))
+		  (speedbar-make-tag-line
+		   'bracket ?? nil nil
+		   (concat expr "\t" value)
+		   (if (or parent (eq status 'out-of-scope))
+		       nil 'gdb-edit-value)
+		   nil
+		   (if gdb-show-changed-values
+		       (or parent (case status
+				    (changed 'font-lock-warning-face)
+				    (out-of-scope 'shadow)
+				    (t t)))
+		     t)
+		   depth)
+		(if (eq status 'out-of-scope) (setq parent 'shadow))
+		(if (and (nth 1 var-list)
+			 (string-match (concat varnum "\\.")
+				       (car (nth 1 var-list))))
+		    (setq char ?-)
+		  (setq char ?+))
+		(if (string-match "\\*$" type)
 		    (speedbar-make-tag-line
-		     'bracket ?? nil nil
-		     (concat expr "\t" value)
+		     'bracket char
+		     'gdb-speedbar-expand-node varnum
+		     (concat expr "\t" type "\t" value)
 		     (if (or parent (eq status 'out-of-scope))
 			 nil 'gdb-edit-value)
 		     nil
@@ -483,37 +500,15 @@
 				      (t t)))
 		       t)
 		     depth)
-		  (if (eq status 'out-of-scope) (setq parent 'shadow))
-		  (if (and (nth 1 var-list)
-			   (string-match (concat varnum "\\.")
-					 (car (nth 1 var-list))))
-		      (setq char ?-)
-		    (setq char ?+))
-		  (if (string-match "\\*$" type)
-		      (speedbar-make-tag-line
-		       'bracket char
-		       'gdb-speedbar-expand-node varnum
-		       (concat expr "\t" type "\t" value)
-		       (if (or parent (eq status 'out-of-scope))
-			 nil 'gdb-edit-value)
-		       nil
-		       (if gdb-show-changed-values
-			   (or parent (case status
-					    (changed 'font-lock-warning-face)
-					    (out-of-scope 'shadow)
-					    (t t)))
-			 t)
-		       depth)
-		    (speedbar-make-tag-line
-		     'bracket char
-		     'gdb-speedbar-expand-node varnum
-		     (concat expr "\t" type)
-		     nil nil
-		     (if (and (or parent status) gdb-show-changed-values)
-			 'shadow t)
-		     depth))))
-	      (setq var-list (cdr var-list))))
-	  (setq gdb-force-update nil)))
+		  (speedbar-make-tag-line
+		   'bracket char
+		   'gdb-speedbar-expand-node varnum
+		   (concat expr "\t" type)
+		   nil nil
+		   (if (and (or parent status) gdb-show-changed-values)
+		       'shadow t)
+		   depth))))
+	    (setq var-list (cdr var-list)))))
        (t (unless (and (save-excursion
 			 (goto-char (point-min))
 			 (looking-at "Current Stack:"))
@@ -544,6 +539,7 @@
 		       (t (error "Should never be here")))
 		 frame t))))
 	    (setq gud-last-speedbar-stackframe gud-last-last-frame))))
+      (set-window-start window start)
       (set-window-point window p))))
 
 
--- a/lisp/progmodes/idlw-shell.el	Tue May 02 08:50:29 2006 +0000
+++ b/lisp/progmodes/idlw-shell.el	Wed May 10 20:42:41 2006 +0000
@@ -1471,11 +1471,7 @@
     (if (eq t idlwave-shell-arrows-do-history) (goto-char proc-pos))
     (if (and idlwave-shell-arrows-do-history
 	     (>= (1+ (save-excursion (end-of-line) (point))) proc-pos))
-	(progn
-	  ;;(goto-char proc-pos)
-	  (goto-char (point-max))
-	  ;;(and (not (eolp)) (kill-line nil))
-	  (comint-previous-input arg))
+	(comint-previous-input arg)
       (previous-line arg))))
 
 (defun idlwave-shell-up-or-history (&optional arg)
--- a/lisp/progmodes/idlwave.el	Tue May 02 08:50:29 2006 +0000
+++ b/lisp/progmodes/idlwave.el	Wed May 10 20:42:41 2006 +0000
@@ -1208,8 +1208,8 @@
        ;; Treats continuation lines, works only during whole buffer
        ;; fontification.  Slow, use it only in fancy fontification.
        (keyword-parameters
-	'("\\(,\\|[a-zA-Z0-9_](\\)[ \t]*\\(\\$[ \t]*\\(;.*\\)?\\(\n[ \t]*;.*\\)*\n[ \t]*\\)?\\(/[a-zA-Z_]\\sw*\\|[a-zA-Z_]\\sw*[ \t]*=\\)"
-	  (5 font-lock-reference-face)))
+	'("\\(,\\|[a-zA-Z0-9_](\\)[ \t]*\\(\\$[ \t]*\\(;.*\\)?\n\\([ \t]*\\(;.*\\)?\n\\)*[ \t]*\\)?\\(/[a-zA-Z_]\\sw*\\|[a-zA-Z_]\\sw*[ \t]*=\\)"
+	  (6 font-lock-reference-face)))
 
        ;; System variables start with a bang.
        (system-variables
@@ -1915,6 +1915,7 @@
   
   (set (make-local-variable 'comment-start-skip) ";+[ \t]*")
   (set (make-local-variable 'comment-start) ";")
+  (set (make-local-variable 'comment-add) 1) ; ";;" for new and regions
   (set (make-local-variable 'require-final-newline) t)
   (set (make-local-variable 'abbrev-all-caps) t)
   (set (make-local-variable 'indent-tabs-mode) nil)
@@ -1947,6 +1948,10 @@
   ;; Following line is for Emacs - XEmacs uses the corresponding property
   ;; on the `idlwave-mode' symbol.
   (set (make-local-variable 'font-lock-defaults) idlwave-font-lock-defaults)
+  (set (make-local-variable 'font-lock-mark-block-function)
+       'idlwave-mark-subprogram)
+  (set (make-local-variable 'font-lock-fontify-region-function)
+       'idlwave-font-lock-fontify-region)
 
   ;; Imenu setup
   (set (make-local-variable 'imenu-create-index-function)
@@ -1956,6 +1961,15 @@
   (set (make-local-variable 'imenu-prev-index-position-function)
        'idlwave-prev-index-position)
 
+  ;; HideShow setup
+  (add-to-list 'hs-special-modes-alist
+	       (list 'idlwave-mode
+		     idlwave-begin-block-reg
+		     idlwave-end-block-reg
+		     ";"
+		     'idlwave-forward-block nil))
+  
+
   ;; Make a local post-command-hook and add our hook to it
   ;; NB: `make-local-hook' needed for older/alternative Emacs compatibility
   ;; (make-local-hook 'post-command-hook)
@@ -2000,16 +2014,22 @@
     (idlwave-read-paths)  ; we may need these early
     (setq idlwave-setup-done t)))
 
+(defun idlwave-font-lock-fontify-region (beg end &optional verbose)
+  "Fontify continuation lines correctly."
+  (let (pos)
+    (save-excursion
+      (goto-char beg)
+      (forward-line -1)
+      (when (setq pos (idlwave-is-continuation-line))
+	(goto-char pos)
+	(idlwave-beginning-of-statement)
+	(setq beg (point)))))
+  (font-lock-default-fontify-region beg end verbose))
+
 ;;
 ;; Code Formatting ----------------------------------------------------
 ;; 
 
-(defun idlwave-push-mark (&rest rest)
-  "Push mark for compatibility with Emacs 18/19."
-  (if (fboundp 'iconify-frame)
-      (apply 'push-mark rest)
-    (push-mark)))
-
 (defun idlwave-hard-tab ()
   "Inserts TAB in buffer in current position."
   (interactive)
@@ -2403,7 +2423,7 @@
   (idlwave-end-of-statement)
   (let ((end (point)))
     (idlwave-beginning-of-statement)
-    (idlwave-push-mark end nil t)))
+    (push-mark end nil t)))
 
 (defun idlwave-mark-block ()
   "Mark containing block."
@@ -2414,7 +2434,7 @@
   (let ((end (point)))
     (idlwave-backward-block)
     (idlwave-beginning-of-statement)
-    (idlwave-push-mark end nil t)))
+    (push-mark end nil t)))
 
 
 (defun idlwave-mark-subprogram ()
@@ -2425,7 +2445,7 @@
   (idlwave-beginning-of-subprogram)
   (let ((beg (point)))
     (idlwave-forward-block)
-    (idlwave-push-mark beg nil t))
+    (push-mark beg nil t))
   (exchange-point-and-mark))
 
 (defun idlwave-backward-up-block (&optional arg)
@@ -2446,11 +2466,12 @@
   (idlwave-block-jump-out 1 'nomark)
   (backward-word 1))
 
-(defun idlwave-forward-block ()
+(defun idlwave-forward-block (&optional arg)
   "Move across next nested block."
   (interactive)
-  (if (idlwave-down-block 1)
-      (idlwave-block-jump-out 1 'nomark)))
+  (let ((arg (or arg 1)))
+    (if (idlwave-down-block arg)
+	(idlwave-block-jump-out arg 'nomark))))
 
 (defun idlwave-backward-block ()
   "Move backward across previous nested block."
@@ -2496,12 +2517,11 @@
 	  (if (re-search-forward idlwave-doclib-end nil t)
 	      (progn
 		(forward-line 1)
-		(idlwave-push-mark beg nil t)
+		(push-mark beg nil t)
 		(message "Could not find end of doc library header.")))
 	  (message "Could not find doc library header start.")
 	  (goto-char here)))))
 
-
 (defun idlwave-current-routine ()
   "Return (NAME TYPE CLASS) of current routine."
   (idlwave-routines)
@@ -3194,13 +3214,14 @@
   "Tests if current line is continuation line.
 Blank or comment-only lines following regular continuation lines (with
 `$') count as continuations too."
-  (save-excursion
-    (or 
-     (idlwave-look-at "\\<\\$")
-     (catch 'loop
-       (while (and (looking-at "^[ \t]*\\(;.*\\)?$") 
-		   (eq (forward-line -1) 0))
-	 (if (idlwave-look-at "\\<\\$") (throw 'loop t)))))))
+  (let (p)
+    (save-excursion
+      (or 
+       (idlwave-look-at "\\<\\$")
+       (catch 'loop
+	 (while (and (looking-at "^[ \t]*\\(;.*\\)?$") 
+		     (eq (forward-line -1) 0))
+	   (if (setq p (idlwave-look-at "\\<\\$")) (throw 'loop p))))))))
 
 (defun idlwave-is-comment-line ()
   "Tests if the current line is a comment line."
--- a/lisp/progmodes/perl-mode.el	Tue May 02 08:50:29 2006 +0000
+++ b/lisp/progmodes/perl-mode.el	Wed May 10 20:42:41 2006 +0000
@@ -923,8 +923,9 @@
   (or arg (setq arg 1))
   (if (< arg 0) (forward-char 1))
   (and (/= arg 0)
-       (re-search-backward "^\\s(\\|^\\s-*sub\\b[^{]+{\\|^\\s-*format\\b[^=]*=\\|^\\."
-			   nil 'move arg)
+       (re-search-backward
+        "^\\s(\\|^\\s-*sub\\b[ \t\n]*\\_<[^{]+{\\|^\\s-*format\\b[^=]*=\\|^\\."
+        nil 'move arg)
        (goto-char (1- (match-end 0))))
   (point))
 
--- a/lisp/progmodes/vhdl-mode.el	Tue May 02 08:50:29 2006 +0000
+++ b/lisp/progmodes/vhdl-mode.el	Wed May 10 20:42:41 2006 +0000
@@ -16723,8 +16723,7 @@
 	  (progn (save-buffer)
 		 (kill-buffer (current-buffer))
 		 (set-buffer orig-buffer)
-		 (setq file-name-history
-		       (cons makefile-path-name file-name-history)))
+		 (add-to-history 'file-name-history makefile-path-name))
 	(vhdl-warning-when-idle
 	 (format "File not writable: \"%s\""
 		 (abbreviate-file-name makefile-path-name)))
--- a/lisp/progmodes/xscheme.el	Tue May 02 08:50:29 2006 +0000
+++ b/lisp/progmodes/xscheme.el	Wed May 10 20:42:41 2006 +0000
@@ -580,12 +580,9 @@
 ;;;; Scheme expressions ring
 
 (defun xscheme-insert-expression (string)
-  (setq xscheme-expressions-ring (cons string xscheme-expressions-ring))
-  (if (> (length xscheme-expressions-ring) xscheme-expressions-ring-max)
-      (setcdr (nthcdr (1- xscheme-expressions-ring-max)
-		      xscheme-expressions-ring)
-	      nil))
-  (setq xscheme-expressions-ring-yank-pointer xscheme-expressions-ring))
+  (setq xscheme-expressions-ring-yank-pointer
+	(add-to-history 'xscheme-expressions-ring string
+			xscheme-expressions-ring-max)))
 
 (defun xscheme-rotate-yank-pointer (arg)
   "Rotate the yanking point in the kill ring."
--- a/lisp/replace.el	Tue May 02 08:50:29 2006 +0000
+++ b/lisp/replace.el	Wed May 10 20:42:41 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/server.el	Tue May 02 08:50:29 2006 +0000
+++ b/lisp/server.el	Wed May 10 20:42:41 2006 +0000
@@ -411,7 +411,7 @@
 	;; deleted file, offer to write it.
 	(let* ((filen (car file))
 	       (obuf (get-file-buffer filen)))
-	  (push filen file-name-history)
+	  (add-to-history 'file-name-history filen)
 	  (if (and obuf (set-buffer obuf))
 	      (progn
 		(cond ((file-exists-p filen)
--- a/lisp/simple.el	Tue May 02 08:50:29 2006 +0000
+++ b/lisp/simple.el	Wed May 10 20:42:41 2006 +0000
@@ -1156,7 +1156,7 @@
 \(That convention is designed to do the right thing for
 recursive uses of the minibuffer.)")
 (setq minibuffer-history-variable 'minibuffer-history)
-(setq minibuffer-history-position nil)
+(setq minibuffer-history-position nil)  ;; Defvar is in C code.
 (defvar minibuffer-history-search-history nil)
 
 (defvar minibuffer-text-before-history nil
@@ -1281,7 +1281,8 @@
 (defvar minibuffer-temporary-goal-position nil)
 
 (defun next-history-element (n)
-  "Insert the next element of the minibuffer history into the minibuffer."
+  "Puts next element of the minibuffer history in the minibuffer.
+With argument N, it uses the Nth following element."
   (interactive "p")
   (or (zerop n)
       (let ((narg (- minibuffer-history-position n))
@@ -1324,7 +1325,8 @@
 	(goto-char (or minibuffer-temporary-goal-position (point-max))))))
 
 (defun previous-history-element (n)
-  "Inserts the previous element of the minibuffer history into the minibuffer."
+  "Puts previous element of the minibuffer history in the minibuffer.
+With argument N, it uses the Nth previous element."
   (interactive "p")
   (next-history-element (- n)))
 
--- a/lisp/speedbar.el	Tue May 02 08:50:29 2006 +0000
+++ b/lisp/speedbar.el	Wed May 10 20:42:41 2006 +0000
@@ -2529,8 +2529,7 @@
 				  default-directory)
 		(speedbar-message nil))))
       ;; Else, we can do a short cut.  No text cache.
-      (let ((cbd (expand-file-name default-directory))
-	    )
+      (let ((cbd (expand-file-name default-directory)))
 	(set-buffer speedbar-buffer)
 	(speedbar-with-writable
 	  (let* ((window (get-buffer-window speedbar-buffer 0))
@@ -2542,8 +2541,7 @@
 	      (funcall func cbd 0))
 	    (speedbar-reconfigure-keymaps)
 	    (set-window-point window p)
-	    (set-window-start window start)))
-	))))
+	    (set-window-start window start)))))))
 
 (defun speedbar-update-directory-contents ()
   "Update the contents of the speedbar buffer based on the current directory."
@@ -2677,7 +2675,6 @@
 	       (frame-visible-p (speedbar-current-frame))
 	       (not (eq (frame-visible-p (speedbar-current-frame)) 'icon)))
 	  (let ((af (selected-frame)))
-	    (save-window-excursion
 	      (dframe-select-attached-frame speedbar-frame)
 	      ;; make sure we at least choose a window to
 	      ;; get a good directory from
@@ -2704,14 +2701,8 @@
 			     "Updating speedbar to special mode: %s...done"
 			     major-mode)
 			    (speedbar-message nil))))
-		  ;; Update all the contents if directories change!
-		  (if (or (member major-mode speedbar-ignored-modes)
-			  (eq af (speedbar-current-frame))
-			  (not (buffer-file-name)))
-		      nil
-		    (speedbar-update-localized-contents)
-		    ))
-		(select-frame af)))
+		    (speedbar-update-localized-contents))
+		(select-frame af))
 	    ;; Now run stealthy updates of time-consuming items
 	    (speedbar-stealthy-updates)))))
   (run-hooks 'speedbar-timer-hook))
--- a/lisp/startup.el	Tue May 02 08:50:29 2006 +0000
+++ b/lisp/startup.el	Wed May 10 20:42:41 2006 +0000
@@ -821,7 +821,16 @@
 			   (format "Invalid user name %s"
 				   init-file-user)
 			   :error)
-	(if (file-directory-p (expand-file-name (concat "~" init-file-user)))
+	(if (file-directory-p (expand-file-name
+			       ;; We don't support ~USER on MS-Windows except
+			       ;; for the current user, and always load .emacs
+			       ;; from the current user's home directory (see
+			       ;; below).  So always check "~", even if invoked
+			       ;; with "-u USER", or if $USER or $LOGNAME are
+			       ;; set to something different.
+			       (if (eq system-type 'windows-nt)
+				   "~"
+				 (concat "~" init-file-user))))
 	    nil
 	  (display-warning 'initialization
 			   (format "User %s has no home directory"
@@ -1302,7 +1311,9 @@
     (set-buffer buffer)
     (erase-buffer)
     (if pure-space-overflow
-	(insert "Warning Warning  Pure space overflow   Warning Warning\n"))
+	(insert "\
+Warning Warning!!!  Pure space overflow    !!!Warning Warning
+\(See the node Pure Storage in the Lisp manual for details.)\n"))
     (fancy-splash-head)
     (apply #'fancy-splash-insert text)
     (fancy-splash-tail)
@@ -1359,7 +1370,7 @@
 		    emulation-mode-map-alists nil
 		    buffer-undo-list t
 		    mode-line-format (propertize "---- %b %-"
-						 'face '(:weight bold))
+						 'face 'mode-line-buffer-id)
 		    fancy-splash-stop-time (+ (float-time)
 					      fancy-splash-max-time)
 		    timer (run-with-timer 0 fancy-splash-delay
@@ -1408,10 +1419,12 @@
 	(with-current-buffer (get-buffer-create "GNU Emacs")
 	  (set (make-local-variable 'tab-width) 8)
           (set (make-local-variable 'mode-line-format)
-               (propertize "---- %b %-" 'face '(:weight bold)))
+               (propertize "---- %b %-" 'face 'mode-line-buffer-id))
 
           (if pure-space-overflow
-              (insert "Warning Warning  Pure space overflow   Warning Warning\n"))
+              (insert "\
+Warning Warning!!!  Pure space overflow    !!!Warning Warning
+\(See the node Pure Storage in the Lisp manual for details.)\n"))
 
           ;; The convention for this piece of code is that
           ;; each piece of output starts with one or two newlines
@@ -1624,9 +1637,7 @@
 	     (not noninteractive))
     (display-warning
      'initialization
-     "Building Emacs overflowed pure space."
-     ;; FIXME: Tell the user what kind of problems are possible and how to fix
-     ;; the overflow.
+     "Building Emacs overflowed pure space.  (See the node Pure Storage in the Lisp manual for details.)"
      :warning))
 
   (when command-line-args-left
--- a/lisp/subr.el	Tue May 02 08:50:29 2006 +0000
+++ b/lisp/subr.el	Wed May 10 20:42:41 2006 +0000
@@ -1122,6 +1122,31 @@
 			    (if (and oa ob)
 				(< oa ob)
 			      oa)))))))
+
+(defun add-to-history (history-var newelt &optional maxelt)
+  "Add NEWELT to the history list stored in the variable HISTORY-VAR.
+Return the new history list.
+If MAXELT is non-nil, it specifies the maximum length of the history.
+Otherwise, the maximum history length is the value of the `history-length'
+property on symbol HISTORY-VAR, if set, or the value of the `history-length'
+variable.
+Remove duplicates of NEWELT unless `history-delete-duplicates' is nil."
+  (unless maxelt
+    (setq maxelt (or (get history-var 'history-length)
+		     history-length)))
+  (let ((history (symbol-value history-var))
+	tail)
+    (if history-delete-duplicates
+	(setq history (delete newelt history)))
+    (setq history (cons newelt history))
+    (when (integerp maxelt)
+      (if (= 0 maxelt)
+	  (setq history nil)
+	(setq tail (nthcdr (1- maxelt) history))
+	(when (consp tail)
+	  (setcdr tail nil))))
+    (set history-var history)))
+
 
 ;;;; Mode hooks.
 
@@ -1931,6 +1956,13 @@
   "Return non-nil if OBJECT is one of the two canonical boolean values: t or nil."
   (memq object '(nil t)))
 
+(defun field-at-pos (pos)
+  "Return the field at position POS, taking stickiness etc into account"
+  (let ((raw-field (get-char-property (field-beginning pos) 'field)))
+    (if (eq raw-field 'boundary)
+	(get-char-property (1- (field-end pos)) 'field)
+      raw-field)))
+
 
 ;;;; Support for yanking and text properties.
 
--- a/lisp/term.el	Tue May 02 08:50:29 2006 +0000
+++ b/lisp/term.el	Wed May 10 20:42:41 2006 +0000
@@ -3318,7 +3318,7 @@
    ((eq char ?r)
     (term-set-scroll-region
      (1- term-terminal-previous-parameter)
-     term-terminal-parameter))
+     (1- term-terminal-parameter)))
    (t)))
 
 (defun term-set-scroll-region (top bottom)
--- a/lisp/term/mac-win.el	Tue May 02 08:50:29 2006 +0000
+++ b/lisp/term/mac-win.el	Wed May 10 20:42:41 2006 +0000
@@ -79,9 +79,11 @@
 (eval-when-compile (require 'url))
 
 (defvar mac-charset-info-alist)
-(defvar mac-services-selection)
+(defvar mac-service-selection)
 (defvar mac-system-script-code)
 (defvar mac-apple-event-map)
+(defvar mac-atsu-font-table)
+(defvar mac-font-panel-mode)
 (defvar x-invocation-args)
 
 (defvar x-command-line-resources nil)
@@ -1128,6 +1130,17 @@
 (mac-add-charset-info "mac-dingbats" 34)
 (mac-add-charset-info "iso10646-1" 126) ; for ATSUI
 
+(defconst mac-system-coding-system
+  (let ((base (or (cdr (assq mac-system-script-code
+			     mac-script-code-coding-systems))
+		  'mac-roman)))
+    (if (eq system-type 'darwin)
+	base
+      (coding-system-change-eol-conversion base 'mac)))
+  "Coding system derived from the system script code.")
+
+(set-selection-coding-system mac-system-coding-system)
+
 
 ;;;; Keyboard layout/language change events
 (defun mac-handle-language-change (event)
@@ -1141,6 +1154,91 @@
 	(define-key key-translation-map [?\x80] "\\"))))
 
 (define-key special-event-map [language-change] 'mac-handle-language-change)
+
+
+;;;; Conversion between common flavors and Lisp string.
+
+(defconst mac-text-encoding-mac-japanese-basic-variant #x20001
+  "MacJapanese text encoding without Apple double-byte extensions.")
+
+(defun mac-utxt-to-string (data &optional coding-system)
+  (or coding-system (setq coding-system mac-system-coding-system))
+  (let* ((encoding
+	  (and (eq system-type 'darwin)
+	       (eq (coding-system-base coding-system) 'japanese-shift-jis)
+	       mac-text-encoding-mac-japanese-basic-variant))
+	 (str (and (fboundp 'mac-code-convert-string)
+		   (mac-code-convert-string data nil
+					    (or encoding coding-system)))))
+    (when str
+      (setq str (decode-coding-string str coding-system))
+      (if (eq encoding mac-text-encoding-mac-japanese-basic-variant)
+	  ;; Does it contain Apple one-byte extensions other than
+	  ;; reverse solidus?
+	  (if (string-match "[\xa0\xfd-\xff]" str)
+	      (setq str nil)
+	    ;; ASCII-only?
+	    (unless (string-match "\\`[[:ascii:]]*\\'" str)
+	      (subst-char-in-string ?\x5c ?\(J\(B str t)
+	      (subst-char-in-string ?\x80 ?\\ str t)))))
+    (or str
+	(decode-coding-string data
+			      (if (eq (byteorder) ?B) 'utf-16be 'utf-16le)))))
+
+(defun mac-string-to-utxt (string &optional coding-system)
+  (or coding-system (setq coding-system mac-system-coding-system))
+  (let (data encoding)
+    (when (and (fboundp 'mac-code-convert-string)
+	       (memq (coding-system-base coding-system)
+		     (find-coding-systems-string string)))
+      (setq coding-system
+	    (coding-system-change-eol-conversion coding-system 'mac))
+      (when (and (eq system-type 'darwin)
+		 (eq coding-system 'japanese-shift-jis-mac))
+	(setq encoding mac-text-encoding-mac-japanese-basic-variant)
+	(setq string (subst-char-in-string ?\\ ?\x80 string))
+	(subst-char-in-string ?\(J\(B ?\x5c string t))
+      (setq data (mac-code-convert-string
+		  (encode-coding-string string coding-system)
+		  (or encoding coding-system) nil)))
+    (or data (encode-coding-string string (if (eq (byteorder) ?B)
+					      'utf-16be-mac
+					    'utf-16le-mac)))))
+
+(defun mac-TEXT-to-string (data &optional coding-system)
+  (or coding-system (setq coding-system mac-system-coding-system))
+  (prog1 (setq data (decode-coding-string data coding-system))
+    (when (eq (coding-system-base coding-system) 'japanese-shift-jis)
+      ;; (subst-char-in-string ?\x5c ?\(J\(B data t)
+      (subst-char-in-string ?\x80 ?\\ data t))))
+
+(defun mac-string-to-TEXT (string &optional coding-system)
+  (or coding-system (setq coding-system mac-system-coding-system))
+  (let ((encodables (find-coding-systems-string string))
+	(rest mac-script-code-coding-systems))
+    (unless (memq (coding-system-base coding-system) encodables)
+      (while (and rest (not (memq (cdar rest) encodables)))
+	(setq rest (cdr rest)))
+      (if rest
+	  (setq coding-system (cdar rest)))))
+  (setq coding-system
+	(coding-system-change-eol-conversion coding-system 'mac))
+  (when (eq coding-system 'japanese-shift-jis-mac)
+    ;; (setq string (subst-char-in-string ?\\ ?\x80 string))
+    (setq string (subst-char-in-string ?\(J\(B ?\x5c string)))
+  (encode-coding-string string coding-system))
+
+(defun mac-furl-to-string (data)
+  ;; Remove a trailing nul character.
+  (let ((len (length data)))
+    (if (and (> len 0) (= (aref data (1- len)) ?\0))
+	(substring data 0 (1- len))
+      data)))
+
+(defun mac-TIFF-to-string (data &optional text)
+  (prog1 (or text (setq text (copy-sequence " ")))
+    (put-text-property 0 (length text) 'display (create-image data 'tiff t)
+		       text)))
 
 ;;;; Selections
 
@@ -1190,22 +1288,11 @@
     (when (and (stringp data)
 	       (setq data-type (get-text-property 0 'foreign-selection data)))
       (cond ((eq data-type 'public.utf16-plain-text)
-	     (let ((encoded (and (fboundp 'mac-code-convert-string)
-				 (mac-code-convert-string data nil coding))))
-	       (if encoded
-		   (setq data (decode-coding-string encoded coding))
-		 (setq data
-		       (decode-coding-string data
-					     (if (eq (byteorder) ?B)
-						 'utf-16be 'utf-16le))))))
+	     (setq data (mac-utxt-to-string data coding)))
 	    ((eq data-type 'com.apple.traditional-mac-plain-text)
-	     (setq data (decode-coding-string data coding)))
+	     (setq data (mac-TEXT-to-string data coding)))
 	    ((eq data-type 'public.file-url)
-	     (setq data (decode-coding-string data 'utf-8))
-	     ;; Remove a trailing nul character.
-	     (let ((len (length data)))
-	       (if (and (> len 0) (= (aref data (1- len)) ?\0))
-		   (setq data (substring data 0 (1- len)))))))
+	     (setq data (mac-furl-to-string data))))
       (put-text-property 0 (length data) 'foreign-selection data-type data))
     data))
 
@@ -1227,9 +1314,7 @@
     (when tiff-image
       (remove-text-properties 0 (length tiff-image)
 			      '(foreign-selection nil) tiff-image)
-      (setq tiff-image (create-image tiff-image 'tiff t))
-      (or text (setq text " "))
-      (put-text-property 0 (length text) 'display tiff-image text))
+      (setq text (mac-TIFF-to-string tiff-image text)))
     text))
 
 ;;; Return the value of the current selection.
@@ -1300,11 +1385,7 @@
 
 (defun mac-select-convert-to-string (selection type value)
   (let ((str (cdr (xselect-convert-to-string selection nil value)))
-	coding)
-    (setq coding (or next-selection-coding-system selection-coding-system))
-    (if coding
-	(setq coding (coding-system-base coding))
-      (setq coding 'raw-text))
+	(coding (or next-selection-coding-system selection-coding-system)))
     (when str
       ;; If TYPE is nil, this is a local request, thus return STR as
       ;; is.  Otherwise, encode STR.
@@ -1314,28 +1395,9 @@
 	  (remove-text-properties 0 (length str) '(composition nil) str)
 	  (cond
 	   ((eq type 'public.utf16-plain-text)
-	    (let (s)
-	      (when (and (fboundp 'mac-code-convert-string)
-			 (memq coding (find-coding-systems-string str)))
-		(setq coding (coding-system-change-eol-conversion coding 'mac))
-		(setq s (mac-code-convert-string
-			 (encode-coding-string str coding)
-			 coding nil)))
-	      (setq str (or s
-			    (encode-coding-string str
-						  (if (eq (byteorder) ?B)
-						      'utf-16be-mac
-						    'utf-16le-mac))))))
+	    (setq str (mac-string-to-utxt str coding)))
 	   ((eq type 'com.apple.traditional-mac-plain-text)
-	    (let ((encodables (find-coding-systems-string str))
-		  (rest mac-script-code-coding-systems))
-	      (unless (memq coding encodables)
-		(while (and rest (not (memq (cdar rest) encodables)))
-		  (setq rest (cdr rest)))
-		(if rest
-		    (setq coding (cdar rest)))))
-	    (setq coding (coding-system-change-eol-conversion coding 'mac))
-	    (setq str (encode-coding-string str coding)))
+	    (setq str (mac-string-to-TEXT str coding)))
 	   (t
 	    (error "Unknown selection type: %S" type))
 	   )))
@@ -1433,6 +1495,17 @@
 	(ash (lsh result extended-sign-len) (- extended-sign-len))
       result)))
 
+(defun mac-bytes-to-digits (bytes &optional from to)
+  (or from (setq from 0))
+  (or to (setq to (length bytes)))
+  (let ((len (- to from))
+	(val 0.0))
+    (dotimes (i len)
+      (setq val (+ (* val 256.0)
+		   (aref bytes (+ from (if (eq (byteorder) ?B) i
+					 (- len i 1)))))))
+    (format "%.0f" val)))
+
 (defun mac-ae-selection-range (ae)
 ;; #pragma options align=mac68k
 ;; typedef struct SelectionRange {
@@ -1518,37 +1591,109 @@
 
 (define-key mac-apple-event-map [hicommand about] 'display-splash-screen)
 
-(defun mac-services-open-file ()
+;;; Converted Carbon Events
+(defun mac-handle-toolbar-switch-mode (event)
+  "Toggle visibility of tool-bars in response to EVENT.
+With no keyboard modifiers, it toggles the visibility of the
+frame where the tool-bar toggle button was pressed.  With some
+modifiers, it changes global tool-bar visibility setting."
+  (interactive "e")
+  (let* ((ae (mac-event-ae event))
+	 (modifiers (cdr (mac-ae-parameter ae "kmod"))))
+    (if (and modifiers (not (string= modifiers "\000\000\000\000")))
+	;; Globally toggle tool-bar-mode if some modifier key is pressed.
+	(tool-bar-mode)
+      (let ((window-id (mac-bytes-to-digits (cdr (mac-ae-parameter ae))))
+	    (rest (frame-list))
+	    frame)
+	(while (and (null frame) rest)
+	  (if (string= (frame-parameter (car rest) 'window-id) window-id)
+	      (setq frame (car rest)))
+	  (setq rest (cdr rest)))
+	(set-frame-parameter frame 'tool-bar-lines
+			     (if (= (frame-parameter frame 'tool-bar-lines) 0)
+				 1 0))))))
+
+;; kEventClassWindow/kEventWindowToolbarSwitchMode
+(define-key mac-apple-event-map [window toolbar-switch-mode]
+  'mac-handle-toolbar-switch-mode)
+
+;;; Font panel
+(when (fboundp 'mac-set-font-panel-visibility)
+
+(define-minor-mode mac-font-panel-mode
+  "Toggle use of the font panel.
+With numeric ARG, display the font panel if and only if ARG is positive."
+  :init-value nil
+  :global t
+  :group 'mac
+  (mac-set-font-panel-visibility mac-font-panel-mode))
+
+(defun mac-handle-font-panel-closed (event)
+  "Update internal status in response to font panel closed EVENT."
+  (interactive "e")
+  ;; Synchronize with the minor mode variable.
+  (mac-font-panel-mode 0))
+
+(defun mac-handle-font-selection (event)
+  "Change default face attributes according to font selection EVENT."
+  (interactive "e")
+  (let* ((ae (mac-event-ae event))
+	 (fm-font-size (cdr (mac-ae-parameter ae "fmsz")))
+	 (atsu-font-id (cdr (mac-ae-parameter ae "auid")))
+	 (attribute-values (gethash atsu-font-id mac-atsu-font-table)))
+    (if fm-font-size
+	(setq attribute-values
+	      `(:height ,(* 10 (mac-bytes-to-integer fm-font-size))
+			,@attribute-values)))
+    (apply 'set-face-attribute 'default (selected-frame) attribute-values)))
+
+;; kEventClassFont/kEventFontPanelClosed
+(define-key mac-apple-event-map [font panel-closed]
+  'mac-handle-font-panel-closed)
+;; kEventClassFont/kEventFontSelection
+(define-key mac-apple-event-map [font selection] 'mac-handle-font-selection)
+
+(define-key-after menu-bar-showhide-menu [mac-font-panel-mode]
+  (menu-bar-make-mm-toggle mac-font-panel-mode
+			   "Font Panel"
+			   "Show the font panel as a floating dialog")
+  'showhide-speedbar)
+
+) ;; (fboundp 'mac-set-font-panel-visibility)
+
+;;; Services
+(defun mac-service-open-file ()
   "Open the file specified by the selection value for Services."
   (interactive)
-  (find-file-existing (x-selection-value mac-services-selection)))
+  (find-file-existing (x-selection-value mac-service-selection)))
 
-(defun mac-services-open-selection ()
+(defun mac-service-open-selection ()
   "Create a new buffer containing the selection value for Services."
   (interactive)
   (switch-to-buffer (generate-new-buffer "*untitled*"))
-  (insert (x-selection-value mac-services-selection))
+  (insert (x-selection-value mac-service-selection))
   (sit-for 0)
   (save-buffer) ; It pops up the save dialog.
   )
 
-(defun mac-services-mail-selection ()
+(defun mac-service-mail-selection ()
   "Prepare a mail buffer containing the selection value for Services."
   (interactive)
   (compose-mail)
   (rfc822-goto-eoh)
   (forward-line 1)
-  (insert (x-selection-value mac-services-selection) "\n"))
+  (insert (x-selection-value mac-service-selection) "\n"))
 
-(defun mac-services-mail-to ()
+(defun mac-service-mail-to ()
   "Prepare a mail buffer to be sent to the selection value for Services."
   (interactive)
-  (compose-mail (x-selection-value mac-services-selection)))
+  (compose-mail (x-selection-value mac-service-selection)))
 
-(defun mac-services-insert-text ()
+(defun mac-service-insert-text ()
   "Insert the selection value for Services."
   (interactive)
-  (let ((text (x-selection-value mac-services-selection)))
+  (let ((text (x-selection-value mac-service-selection)))
     (if (not buffer-read-only)
 	(insert text)
       (kill-new text)
@@ -1556,15 +1701,17 @@
        (substitute-command-keys
 	"The text from the Services menu can be accessed with \\[yank]")))))
 
-(define-key mac-apple-event-map [services paste] 'mac-services-insert-text)
-(define-key mac-apple-event-map [services perform open-file]
-  'mac-services-open-file)
-(define-key mac-apple-event-map [services perform open-selection]
-  'mac-services-open-selection)
-(define-key mac-apple-event-map [services perform mail-selection]
-  'mac-services-mail-selection)
-(define-key mac-apple-event-map [services perform mail-to]
-  'mac-services-mail-to)
+;; kEventClassService/kEventServicePaste
+(define-key mac-apple-event-map [service paste] 'mac-service-insert-text)
+;; kEventClassService/kEventServicePerform
+(define-key mac-apple-event-map [service perform open-file]
+  'mac-service-open-file)
+(define-key mac-apple-event-map [service perform open-selection]
+  'mac-service-open-selection)
+(define-key mac-apple-event-map [service perform mail-selection]
+  'mac-service-mail-selection)
+(define-key mac-apple-event-map [service perform mail-to]
+  'mac-service-mail-to)
 
 (defun mac-dispatch-apple-event (event)
   "Dispatch EVENT according to the keymap `mac-apple-event-map'."
@@ -1589,6 +1736,83 @@
 ;; processed when the initial frame has been created: this is where
 ;; the files should be opened.
 (add-hook 'after-init-hook 'mac-process-deferred-apple-events)
+
+
+;;;; Drag and drop
+
+(defcustom mac-dnd-types-alist
+  '(("furl" . mac-dnd-handle-furl)
+    ("hfs " . mac-dnd-handle-hfs)
+    ("utxt" . mac-dnd-insert-utxt)
+    ("TEXT" . mac-dnd-insert-TEXT)
+    ("TIFF" . mac-dnd-insert-TIFF))
+  "Which function to call to handle a drop of that type.
+The function takes three arguments, WINDOW, ACTION and DATA.
+WINDOW is where the drop occured, ACTION is always `private' on
+Mac.  DATA is the drop data.  Unlike the x-dnd counterpart, the
+return value of the function is not significant.
+
+See also `mac-dnd-known-types'."
+  :version "22.1"
+  :type 'alist
+  :group 'mac)
+
+(defun mac-dnd-handle-furl (window action data)
+  (dnd-handle-one-url window action (mac-furl-to-string data)))
+
+(defun mac-dnd-handle-hfs (window action data)
+;; struct HFSFlavor {
+;;   OSType fileType;
+;;   OSType fileCreator;
+;;   UInt16 fdFlags;
+;;   FSSpec fileSpec;
+;; };
+  (let* ((file-name (mac-coerce-ae-data "fss " (substring data 10)
+					'undecoded-file-name))
+	 (url (concat "file://"
+		      (mapconcat 'url-hexify-string
+				 (split-string file-name "/") "/"))))
+    (dnd-handle-one-url window action url)))
+
+(defun mac-dnd-insert-utxt (window action data)
+  (dnd-insert-text window action (mac-utxt-to-string data)))
+
+(defun mac-dnd-insert-TEXT (window action data)
+  (dnd-insert-text window action (mac-TEXT-to-string data)))
+
+(defun mac-dnd-insert-TIFF (window action data)
+  (dnd-insert-text window action (mac-TIFF-to-string data)))
+
+(defun mac-dnd-drop-data (event frame window data type)
+  (let* ((type-info (assoc type mac-dnd-types-alist))
+	 (handler (cdr type-info))
+	 (action 'private)
+	 (w (posn-window (event-start event))))
+    (when handler
+      (if (and (windowp w) (window-live-p w)
+	       (not (window-minibuffer-p w))
+	       (not (window-dedicated-p w)))
+	  ;; If dropping in an ordinary window which we could use,
+	  ;; let dnd-open-file-other-window specify what to do.
+	  (progn
+	    (goto-char (posn-point (event-start event)))
+	    (funcall handler window action data))
+	;; If we can't display the file here,
+	;; make a new window for it.
+	(let ((dnd-open-file-other-window t))
+	  (select-frame frame)
+	  (funcall handler window action data))))))
+
+(defun mac-dnd-handle-drag-n-drop-event (event)
+  "Receive drag and drop events."
+  (interactive "e")
+  (let ((window (posn-window (event-start event))))
+    (when (windowp window) (select-window window))
+    (dolist (item (mac-ae-list (mac-event-ae event)))
+      (if (not (equal (car item) "null"))
+	  (mac-dnd-drop-data event (selected-frame) window
+			     (cdr item) (car item)))))
+  (select-frame-set-input-focus (selected-frame)))
 
 ;;; Do the actual Windows setup here; the above code just defines
 ;;; functions and variables that we use now.
@@ -1884,37 +2108,11 @@
 ;; Enable CLIPBOARD copy/paste through menu bar commands.
 (menu-bar-enable-clipboard)
 
-(defconst mac-system-coding-system
-  (let ((base (or (cdr (assq mac-system-script-code
-			     mac-script-code-coding-systems))
-		  'mac-roman)))
-    (if (eq system-type 'darwin)
-	base
-      (coding-system-change-eol-conversion base 'mac)))
-  "Coding system derived from the system script code.")
-
-(set-selection-coding-system mac-system-coding-system)
+;; Initiate drag and drop
 
-(defun mac-drag-n-drop (event)
-  "Edit the files listed in the drag-n-drop EVENT.
-Switch to a buffer editing the last file dropped."
-  (interactive "e")
-  ;; Make sure the drop target has positive co-ords
-  ;; before setting the selected frame - otherwise it
-  ;; won't work.  <skx@tardis.ed.ac.uk>
-  (let* ((window (posn-window (event-start event)))
-	 (coords (posn-x-y (event-start event)))
-	 (x (car coords))
-	 (y (cdr coords)))
-    (if (and (> x 0) (> y 0))
-	(set-frame-selected-window nil window))
-    (dolist (file-name (nth 2 event))
-      (dnd-handle-one-url window 'private
-			  (concat "file:" file-name))))
-  (select-frame-set-input-focus (selected-frame)))
+(global-set-key [drag-n-drop] 'mac-dnd-handle-drag-n-drop-event)
+(global-set-key [M-drag-n-drop] 'mac-dnd-handle-drag-n-drop-event)
 
-(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
 
@@ -1979,6 +2177,7 @@
     (scroll-up 1)))
 
 )
+
 
 ;;;; Others
 
--- a/lisp/term/xterm.el	Tue May 02 08:50:29 2006 +0000
+++ b/lisp/term/xterm.el	Wed May 10 20:42:41 2006 +0000
@@ -227,6 +227,14 @@
 
       (define-key map "\e[4~" [select])
       (define-key map "\e[29~" [print])
+      
+      ;; These keys will be available xterm starting probably from
+      ;; version 214.
+      (define-key map "\e[27;5;8~"  [(control ?\t)])
+      (define-key map "\e[27;5;44~" [(control ?\,)])
+      (define-key map "\e[27;5;46~" [(control ?\.)])
+      (define-key map "\e[27;5;47~" [(control ?\/)])
+      (define-key map "\e[27;5;92~" [(control ?\\)])
 
       ;; Other versions of xterm might emit these.
       (define-key map "\e[A" [up])
--- a/lisp/textmodes/ispell.el	Tue May 02 08:50:29 2006 +0000
+++ b/lisp/textmodes/ispell.el	Wed May 10 20:42:41 2006 +0000
@@ -2577,15 +2577,18 @@
 	       (mapcar 'list (ispell-valid-dictionary-list)))
 	  nil t)
 	 current-prefix-arg))
-  (unless arg (ispell-buffer-local-dict))
+  (unless arg (ispell-buffer-local-dict 'no-reload))
   (if (equal dict "default") (setq dict nil))
   ;; This relies on completing-read's bug of returning "" for no match
   (cond ((equal dict "")
+	 (ispell-internal-change-dictionary)
 	 (message "Using %s dictionary"
 		  (or ispell-local-dictionary ispell-dictionary "default")))
 	((equal dict (or ispell-local-dictionary
 			 ispell-dictionary "default"))
-	 ;; Specified dictionary is the default already.  No-op
+	 ;; Specified dictionary is the default already. Could reload
+	 ;; the dictionaries if needed.
+	 (ispell-internal-change-dictionary)
 	 (and (interactive-p)
 	      (message "No change, using %s dictionary" dict)))
 	(t				; reset dictionary!
@@ -2604,13 +2607,16 @@
 		  dict))))
 
 (defun ispell-internal-change-dictionary ()
-  "Update the dictionary actually used by Ispell.
+  "Update the dictionary and the personal dictionary used by Ispell.
 This may kill the Ispell process; if so,
 a new one will be started when needed."
-  (let ((dict (or ispell-local-dictionary ispell-dictionary)))
-    (unless (equal ispell-current-dictionary dict)
+  (let ((dict (or ispell-local-dictionary ispell-dictionary))
+	(pdict (or ispell-local-pdict ispell-personal-dictionary)))
+    (unless (and (equal ispell-current-dictionary dict)
+		 (equal ispell-current-personal-dictionary pdict))
       (ispell-kill-ispell t)
-      (setq ispell-current-dictionary dict))))
+      (setq ispell-current-dictionary dict
+	    ispell-current-personal-dictionary pdict))))
 
 ;;; Spelling of comments are checked when ispell-check-comments is non-nil.
 
@@ -3637,8 +3643,9 @@
 
 ;;; Can kill the current ispell process
 
-(defun ispell-buffer-local-dict ()
+(defun ispell-buffer-local-dict (&optional no-reload)
   "Initializes local dictionary and local personal dictionary.
+If optional NO-RELOAD is non-nil, do not make any dictionary reloading.
 When a dictionary is defined in the buffer (see variable
 `ispell-dictionary-keyword'), it will override the local setting
 from \\[ispell-change-dictionary].
@@ -3665,12 +3672,9 @@
 	    (if (re-search-forward " *\\([^ \"]+\\)" end t)
 		(setq ispell-local-pdict
 		      (match-string-no-properties 1)))))))
-  ;; Reload if new personal dictionary defined.
-  (if (not (equal ispell-current-personal-dictionary
-		  (or ispell-local-pdict ispell-personal-dictionary)))
-      (ispell-kill-ispell t))
-  ;; Reload if new dictionary defined.
-  (ispell-internal-change-dictionary))
+  (unless no-reload
+    ;; Reload if new dictionary (maybe the personal one) defined.
+    (ispell-internal-change-dictionary)))
 
 
 (defun ispell-buffer-local-words ()
--- a/lisp/url/ChangeLog	Tue May 02 08:50:29 2006 +0000
+++ b/lisp/url/ChangeLog	Wed May 10 20:42:41 2006 +0000
@@ -1,3 +1,8 @@
+2006-05-05  Andreas Seltenreich  <seltenreich@gmx.de>  (tiny change)
+
+	* url-http.el (url-http-parse-headers): Don't reuse connection if
+	"Connection: close" header was seen.
+
 2006-04-26  Stefan Monnier  <monnier@iro.umontreal.ca>
 
 	* url-gw.el (url-open-stream): Don't hide errors.
--- a/lisp/url/url-http.el	Tue May 02 08:50:29 2006 +0000
+++ b/lisp/url/url-http.el	Wed May 10 20:42:41 2006 +0000
@@ -386,6 +386,10 @@
   (url-http-parse-response)
   (mail-narrow-to-head)
   ;;(narrow-to-region (point-min) url-http-end-of-headers)
+  (let ((connection (mail-fetch-field "Connection")))
+    (if (and connection
+	     (string= (downcase connection) "close"))
+	(delete-process url-http-process)))
   (let ((class nil)
 	(success nil))
     (setq class (/ url-http-response-status 100))
--- a/lispref/ChangeLog	Tue May 02 08:50:29 2006 +0000
+++ b/lispref/ChangeLog	Wed May 10 20:42:41 2006 +0000
@@ -1,3 +1,48 @@
+2006-05-10  Reiner Steib  <Reiner.Steib@gmx.de>
+
+	* variables.texi (File Local Variables): Recommend to quote lambda
+	expressions in safe-local-variable property.
+
+2006-05-09  Richard Stallman  <rms@gnu.org>
+
+	* variables.texi (File Local Variables): Document
+	safe-local-eval-forms and safe-local-eval-function.
+
+2006-05-07  Kim F. Storm  <storm@cua.dk>
+
+	* minibuf.texi (Minibuffer History): Remove keep-dups arg
+	from add-to-history.
+
+2006-05-07  Romain Francoise  <romain@orebokech.com>
+
+	* commands.texi (Event Input Misc):
+	* compile.texi (Eval During Compile):
+	* internals.texi (Buffer Internals):
+	* minibuf.texi (Initial Input):
+	* nonascii.texi (Scanning Charsets):
+	* numbers.texi (Comparison of Numbers):
+	* windows.texi (Textual Scrolling, Vertical Scrolling):
+	Fix various typos.
+
+2006-05-06  Eli Zaretskii  <eliz@gnu.org>
+
+	* hooks.texi (Standard Hooks): Replace inforef to emacs-xtra by
+	conditional xref's to either emacs or emacs-xtra, depending on
+	@iftex/@ifnottex.
+
+	* minibuf.texi (Minibuffer History): Document add-to-history.
+
+2006-05-05  Eli Zaretskii  <eliz@gnu.org>
+
+	* internals.texi (Pure Storage): Mention the pure overflow message
+	at startup.
+
+2006-05-05  Johan Bockg,Ae(Brd  <bojohan@dd.chalmers.se>
+
+	* keymaps.texi (Active Keymaps): Fix pseudo-Lisp syntax.
+	(Searching Keymaps): Fix pseudo-Lisp description of keymap
+	search.
+
 2006-05-01  Richard Stallman  <rms@gnu.org>
 
 	* intro.texi (nil and t): Clarify.
--- a/lispref/commands.texi	Tue May 02 08:50:29 2006 +0000
+++ b/lispref/commands.texi	Wed May 10 20:42:41 2006 +0000
@@ -2451,7 +2451,7 @@
 arrival of input during those parts won't cause an abort until
 the end of that part.
 
-If you want to be able to distingish all possible values computed
+If you want to be able to distinguish all possible values computed
 by @var{body} from both kinds of abort conditions, write the code
 like this:
 
--- a/lispref/compile.texi	Tue May 02 08:50:29 2006 +0000
+++ b/lispref/compile.texi	Wed May 10 20:42:41 2006 +0000
@@ -412,7 +412,7 @@
 compiling and executing.
 
 @code{autoload} is also effectively @code{eval-and-compile} too.  It's
-recognised when compiling, so uses of such a function don't produce
+recognized when compiling, so uses of such a function don't produce
 ``not known to be defined'' warnings.
 
 Most uses of @code{eval-and-compile} are fairly sophisticated.
@@ -456,7 +456,7 @@
 The same sort of thing goes for macros or @code{defalias}es defined
 locally and only for use within the file.  They can be defined while
 compiling, but then not needed when executing.  This is good for code
-that's only a fallback for compability with other versions of Emacs.
+that's only a fallback for compatibility with other versions of Emacs.
 For example.
 
 @lisp
--- a/lispref/files.texi	Tue May 02 08:50:29 2006 +0000
+++ b/lispref/files.texi	Wed May 10 20:42:41 2006 +0000
@@ -1602,7 +1602,7 @@
 @var{filename} does not include a directory part.
 
 On GNU and Unix systems, a string returned by this function always
-ends in a slash.  On MSDOS it can also end in a colon.  On VMS, it
+ends in a slash.  On MS-DOS it can also end in a colon.  On VMS, it
 returns a string ending in one of the three characters @samp{:},
 @samp{]}, or @samp{>}.
 
@@ -1809,7 +1809,7 @@
 same as the usual Unix terminology.)  These two different names for
 the same entity are related by a syntactic transformation.  On GNU and
 Unix systems, this is simple: a directory name ends in a slash,
-whereas the directory's name as a file lacks that slash.  On MSDOS and
+whereas the directory's name as a file lacks that slash.  On MS-DOS and
 VMS, the relationship is more complicated.
 
   The difference between a directory name and its name as a file is
--- a/lispref/hooks.texi	Tue May 02 08:50:29 2006 +0000
+++ b/lispref/hooks.texi	Wed May 10 20:42:41 2006 +0000
@@ -87,7 +87,13 @@
 @xref{Lazy Properties}.
 
 @item calendar-load-hook
-@inforef{Calendar Customizing,, emacs-xtra}.
+@iftex
+@xref{Calendar Customizing,,, emacs-xtra}.
+@end iftex
+@ifnottex
+@xref{Calendar Customizing,,, emacs}.
+@end ifnottex
+
 
 @item change-major-mode-hook
 @xref{Creating Buffer-Local}.
@@ -124,7 +130,12 @@
 Emacs Sessions,, Saving Emacs Sessions, emacs, the GNU Emacs Manual}.
 
 @item diary-display-hook
-@inforef{Fancy Diary Display,, emacs-xtra}.
+@iftex
+@xref{Fancy Diary Display,,, emacs-xtra}.
+@end iftex
+@ifnottex
+@xref{Fancy Diary Display,,, emacs}.
+@end ifnottex
 
 @item diary-hook
 List of functions called after the display of the diary.  Can be used
@@ -170,7 +181,12 @@
 @xref{Other Font Lock Variables}.
 
 @item initial-calendar-window-hook
-@inforef{Calendar Customizing,, emacs-xtra}.
+@iftex
+@xref{Calendar Customizing,,, emacs-xtra}.
+@end iftex
+@ifnottex
+@xref{Calendar Customizing,,, emacs}.
+@end ifnottex
 
 @item kbd-macro-termination-hook
 @xref{Keyboard Macros}.
@@ -190,14 +206,24 @@
 @item lisp-indent-function
 
 @item list-diary-entries-hook
-@inforef{Fancy Diary Display,, emacs-xtra}.
+@iftex
+@xref{Fancy Diary Display,,, emacs-xtra}.
+@end iftex
+@ifnottex
+@xref{Fancy Diary Display,,, emacs}.
+@end ifnottex
 
 @item mail-setup-hook
 @xref{Mail Mode Misc,, Mail Mode Miscellany, emacs, the GNU Emacs
 Manual}.
 
 @item mark-diary-entries-hook
-@inforef{Fancy Diary Display,, emacs-xtra}.
+@iftex
+@xref{Fancy Diary Display,,, emacs-xtra}.
+@end iftex
+@ifnottex
+@xref{Fancy Diary Display,,, emacs}.
+@end ifnottex
 
 @item menu-bar-update-hook
 @xref{Menu Bar}.
@@ -212,10 +238,20 @@
 @xref{Mouse Position}.
 
 @item nongregorian-diary-listing-hook
-@inforef{Hebrew/Islamic Entries,, emacs-xtra}.
+@iftex
+@xref{Hebrew/Islamic Entries,,, emacs-xtra}.
+@end iftex
+@ifnottex
+@xref{Hebrew/Islamic Entries,,, emacs}.
+@end ifnottex
 
 @item nongregorian-diary-marking-hook
-@inforef{Hebrew/Islamic Entries,, emacs-xtra}.
+@iftex
+@xref{Hebrew/Islamic Entries,,, emacs-xtra}.
+@end iftex
+@ifnottex
+@xref{Hebrew/Islamic Entries,,, emacs}.
+@end ifnottex
 
 @item occur-hook
 
@@ -229,7 +265,12 @@
 @xref{Command Overview}.
 
 @item print-diary-entries-hook
-@inforef{Diary Customizing,, emacs-xtra}.
+@iftex
+@xref{Diary Customizing,,, emacs-xtra}.
+@end iftex
+@ifnottex
+@xref{Diary Customizing,,, emacs}.
+@end ifnottex
 
 @item redisplay-end-trigger-functions
 @xref{Window Hooks}.
@@ -255,10 +296,20 @@
 @xref{Terminal-Specific}.
 
 @item today-visible-calendar-hook
-@inforef{Calendar Customizing,, emacs-xtra}.
+@iftex
+@xref{Calendar Customizing,,, emacs-xtra}.
+@end iftex
+@ifnottex
+@xref{Calendar Customizing,,, emacs}.
+@end ifnottex
 
 @item today-invisible-calendar-hook
-@inforef{Calendar Customizing,, emacs-xtra}.
+@iftex
+@xref{Calendar Customizing,,, emacs-xtra}.
+@end iftex
+@ifnottex
+@xref{Calendar Customizing,,, emacs}.
+@end ifnottex
 
 @item window-configuration-change-hook
 @xref{Window Hooks}.
--- a/lispref/internals.texi	Tue May 02 08:50:29 2006 +0000
+++ b/lispref/internals.texi	Wed May 10 20:42:41 2006 +0000
@@ -155,11 +155,15 @@
 marked as read-only (on operating systems that permit this), so that
 the memory space can be shared by all the Emacs jobs running on the
 machine at once.  Pure storage is not expandable; a fixed amount is
-allocated when Emacs is compiled, and if that is not sufficient for the
-preloaded libraries, @file{temacs} crashes.  If that happens, you must
-increase the compilation parameter @code{PURESIZE} in the file
-@file{src/puresize.h}.  This normally won't happen unless you try to
-preload additional libraries or add features to the standard ones.
+allocated when Emacs is compiled, and if that is not sufficient for
+the preloaded libraries, @file{temacs} allocates dynamic memory for
+the part that didn't fit.  If that happens, you should increase the
+compilation parameter @code{PURESIZE} in the file
+@file{src/puresize.h} and rebuild Emacs, even though the resulting
+image will work.  Such an overflow normally won't happen unless you
+try to preload additional libraries or add features to the standard
+ones.  Emacs will display a warning about the overflow when it
+starts.
 
 @defun purecopy object
 This function makes a copy in pure storage of @var{object}, and returns
@@ -1015,7 +1019,7 @@
 is @code{nil}, no mode line will be displayed.
 
 @item header_line_format
-This field is analoguous to @code{mode_line_format} for the mode
+This field is analogous to @code{mode_line_format} for the mode
 line displayed at the top of windows.
 
 @item keymap
--- a/lispref/keymaps.texi	Tue May 02 08:50:29 2006 +0000
+++ b/lispref/keymaps.texi	Wed May 10 20:42:41 2006 +0000
@@ -561,7 +561,7 @@
             (@var{find-in-any} emulation-mode-map-alists)
             (@var{find-in-any} minor-mode-overriding-map-alist)
             (@var{find-in-any} minor-mode-map-alist)
-            (if (get-text-property (point) 'local-map))
+            (if (get-text-property (point) 'local-map)
                 (@var{find-in} (get-text-property (point) 'local-map))
               (@var{find-in} (current-local-map))))))
     (@var{find-in} (current-global-map)))
@@ -670,14 +670,15 @@
             (@var{find-in-any} emulation-mode-map-alists)
             (@var{find-in-any} minor-mode-overriding-map-alist)
             (@var{find-in-any} minor-mode-map-alist)
-            (@var{find-in} (get-text-property (point) 'local-map))
-            (@var{find-in} (current-local-map)))))
+            (if (get-text-property (point) 'local-map)
+                (@var{find-in} (get-text-property (point) 'local-map))
+              (@var{find-in} (current-local-map))))))
     (@var{find-in} (current-global-map)))
 @end lisp
 
 @noindent
 The @var{find-in} and @var{find-in-any} are pseudo functions that
-searches in one keymap respectively an alist of keymaps.
+search in one keymap and in an alist of keymaps, respectively.
 
 @enumerate
 @item
--- a/lispref/minibuf.texi	Tue May 02 08:50:29 2006 +0000
+++ b/lispref/minibuf.texi	Wed May 10 20:42:41 2006 +0000
@@ -449,11 +449,26 @@
 history list symbol.  The variable @code{history-delete-duplicates}
 specifies whether to delete duplicates in history.
 
+@defun add-to-history history-var newelt &optional maxelt
+This function adds a new element @var{newelt} to the history list
+stored in the variable @var{history-var}, and returns the updated
+history list.  By default, the list length is limited by the value
+specified by @code{history-length} (described below), but the optional
+argument @var{maxelt} overrides that.  The possible values of
+@var{maxelt} have the same meaning as the values of
+@code{history-length}.
+
+Duplicate members are removed from the history list, unless
+@code{history-delete-duplicates} is @code{nil}.
+@end defun
+
 @defvar history-length
 The value of this variable specifies the maximum length for all
 history lists that don't specify their own maximum lengths.  If the
 value is @code{t}, that means there no maximum (don't delete old
-elements).
+elements).  The value of @code{history-length} property of the history
+list variable's symbol, if set, overrides this variable for that
+particular history list.
 @end defvar
 
 @defvar history-delete-duplicates
@@ -501,7 +516,7 @@
 
 Several of the functions for minibuffer input have an argument called
 @var{initial} or @var{initial-contents}.  This is a mostly-deprecated
-feature for specifiying that the minibuffer should start out with
+feature for specifying that the minibuffer should start out with
 certain text, instead of empty as usual.
 
 If @var{initial} is a string, the minibuffer starts out containing the
--- a/lispref/nonascii.texi	Tue May 02 08:50:29 2006 +0000
+++ b/lispref/nonascii.texi	Wed May 10 20:42:41 2006 +0000
@@ -484,7 +484,7 @@
 @defun charset-after &optional pos
 This function return the charset of a character in the current buffer
 at position @var{pos}.  If @var{pos} is omitted or @code{nil}, it
-defauls to the current value of point.  If @var{pos} is out of range,
+defaults to the current value of point.  If @var{pos} is out of range,
 the value is @code{nil}.
 @end defun
 
--- a/lispref/numbers.texi	Tue May 02 08:50:29 2006 +0000
+++ b/lispref/numbers.texi	Wed May 10 20:42:41 2006 +0000
@@ -322,7 +322,7 @@
 
 @defun eql value1 value2
 This function acts like @code{eq} except when both arguments are
-numbers.  It compares numbers by type and numberic value, so that
+numbers.  It compares numbers by type and numeric value, so that
 @code{(eql 1.0 1)} returns @code{nil}, but @code{(eql 1.0 1.0)} and
 @code{(eql 1 1)} both return @code{t}.
 @end defun
--- a/lispref/variables.texi	Tue May 02 08:50:29 2006 +0000
+++ b/lispref/variables.texi	Wed May 10 20:42:41 2006 +0000
@@ -1784,7 +1784,8 @@
 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.
+use @code{booleanp} as the property value.  Lambda expressions should
+be quoted so that @code{describe-variable} can display the predicate.
 
 @defopt safe-local-variable-values
 This variable provides another way to mark some variable values as
@@ -1844,6 +1845,19 @@
 the user what to do for each file.  The default value is @code{maybe}.
 @end defopt
 
+@defopt safe-local-eval-forms
+This variable holds a list of expressions that are safe to
+evaluate when found in the @samp{Eval:} ``variable'' in a file
+local variables list.
+@end defopt
+
+  If the expression is a function call and the function has a
+@code{safe-local-eval-function} property, the property value
+determines whether the expression is safe to evaluate.  The property
+value can be a predicate to call to test the expression, a list of
+such predicates (it's safe if any predicate succeeds), or @code{t}
+(always safe provided the arguments are constant).
+
   Text properties are also potential loopholes, since their values
 could include functions to call.  So Emacs discards all text
 properties from string values specified for file local variables.
--- a/lispref/windows.texi	Tue May 02 08:50:29 2006 +0000
+++ b/lispref/windows.texi	Wed May 10 20:42:41 2006 +0000
@@ -1419,7 +1419,7 @@
 window.  @xref{Current Buffer}.
 
   If the window contains a row which is taller than the height of the
-window (for example in the presense of a large image), the scroll
+window (for example in the presence of a large image), the scroll
 functions will adjust the window vscroll to scroll the partially
 visible row.  To disable this feature, Lisp code may bind the variable
 `auto-window-vscroll' to @code{nil} (@pxref{Vertical Scrolling}).
@@ -1656,7 +1656,7 @@
 If this variable is non-@code{nil}, the line-move, scroll-up, and
 scroll-down functions will automatically modify the window vscroll to
 scroll through display rows that are taller that the height of the
-window, for example in the presense of large images.
+window, for example in the presence of large images.
 @end defvar
 
 @node Horizontal Scrolling
--- a/man/ChangeLog	Tue May 02 08:50:29 2006 +0000
+++ b/man/ChangeLog	Wed May 10 20:42:41 2006 +0000
@@ -1,3 +1,233 @@
+2006-05-09  Michael Albinus  <michael.albinus@gmx.de>
+
+	* tramp.texi (Filename completion): Improve wording.
+
+2006-05-07  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>
+
+	* xresmini.texi (GTK resources): Inserted GTK description.
+
+	* xresources.texi (GTK resources): metafont should be menufont.
+
+2006-05-07  Romain Francoise  <romain@orebokech.com>
+
+	* faq.texi (Using regular expressions): Fix typo.
+	(Packages that do not come with Emacs): Fix capitalization.
+	(Replacing text across multiple files): Expand node to explain how
+	to use `dired-do-query-replace-regexp' in more detail, based on
+	suggestion by Eric Hanchrow <offby1@blarg.net>.
+
+2006-05-06  Michael Albinus  <michael.albinus@gmx.de>
+
+	* mini.texi (Completion Options):
+	* tramp.texi (Filename completion): Completion of remote files'
+	method, user name and host name is active only in partial
+	completion mode.
+
+2006-05-06  Bill Wohler  <wohler@newt.com>
+
+	Release MH-E manual version 8.0.
+
+	* mh-e.texi (VERSION, EDITION, UPDATED, UPDATE-MONTH): Update for
+	release 8.0.
+
+2006-05-06  Bill Wohler  <wohler@newt.com>
+
+	* mh-e.texi (MH-BOOK-HOME): Change from
+	http://www.ics.uci.edu/~mh/book/mh to
+	http://rand-mh.sourceforge.net/book/mh.
+	Replace .htm suffix with .html for MH book files.
+	(Using This Manual): Update key binding for getting relevant
+	chapter in Info from command key.
+	(Ranges): Fix itemx.
+
+2006-05-06  Eli Zaretskii  <eliz@gnu.org>
+
+	* makefile.w32-in (emacs.dvi):
+	* Makefile.in (emacs.dvi): Add xresmini.texi
+
+	* xresmini.texi (Table of Resources): Remove xref to non-existent
+	node "LessTif Resources".
+
+	* msdog.texi (Microsoft Windows):
+	* calendar.texi (Calendar/Diary, Displaying the Diary)
+	(Special Diary Entries, Importing Diary, Holidays):
+	* programs.texi (Program Modes):
+	* text.texi (Text):
+	* buffers.texi (Several Buffers):
+	* files.texi (Comparing Files): Fix cross-references to emacs-xtra.
+
+2006-05-06  Eli Zaretskii  <eliz@gnu.org>
+
+	The following changes merge the emacs-xtra manual into the main
+	manual, but only for on-line version of the manual.
+
+	* vc2-xtra.texi (Version Backups, Local Version Control)
+	(Making Snapshots, Change Logs and VC, Version Headers)
+	(Customizing VC, CVS Options) [ifnottex]: Conditional xref's for
+	on-line manual.
+
+	* vc1-xtra.texi (VC Dired Mode) [ifnottex]: Conditional xref's
+	for on-line manual.
+
+	* msdog-xtra.texi (MS-DOS, MS-DOS Keyboard, MS-DOS Mouse)
+	(MS-DOS Display, MS-DOS File Names, MS-DOS Printing)
+	(MS-DOS and MULE, MS-DOS Processes) [ifnottex]: Conditional xref's
+	for on-line manual.
+
+	* fortran-xtra.texi (Fortran, Fortran Autofill)
+	(Fortran Autofill, Fortran Abbrev) [ifnottex]: Conditional xref's
+	for on-line manual.
+
+	* picture-xtra.texi (Basic Picture, Rectangles in Picture) [ifnottex]:
+	Conditional xref's for on-line manual.
+
+	* emerge-xtra.texi (Emerge, Overview of Emerge)
+	(Fine Points of Emerge) [ifnottex]: Conditional xref's for on-line
+	manual.
+
+	* Makefile.in (INFO_TARGETS): Remove ../info/emacs-xtra.
+	(EMACS_XTRA): New variable, lists the new *-xtra.texi files.
+	(EMACSSOURCES): Use EMACS_XTRA.
+	(../info/emacs-xtra): Remove.
+	(emacs-xtra.dvi): Add EMACS_XTRA to prerequisites.
+
+	* makefile.w32-in (INFO_TARGETS): Remove $(infodir)/emacs-xtra.
+	(EMACS_XTRA): New variable, lists the new *-xtra.texi files.
+	(EMACSSOURCES): Use EMACS_XTRA.
+	($(infodir)/emacs-xtra): Remove.
+	(emacs-xtra.dvi): Add EMACS_XTRA to prerequisites.
+
+	* trouble.texi (Quitting):
+	* text.texi (Text):
+	* programs.texi (Program Modes):
+	* msdog.texi (Microsoft Windows):
+	* frames.texi (Frames):
+	* files.texi (Backup, Version Control, VC Concepts)
+	(Types of Log File, Advanced C-x v v, Log Buffer, Old Versions)
+	(Registering, VC Status, VC Undo, Multi-User Branching)
+	(Comparing Files):
+	* calendar.texi (Calendar/Diary, Holidays, Displaying the Diary)
+	(Displaying the Diary, Special Diary Entries, Importing Diary):
+	* buffers.texi (Several Buffers): Replace inforef to emacs-xtra by
+	conditional xref's, depending on @iftex/@ifnottex.
+
+	* msdog.texi (Microsoft Windows) [ifnottex]: Add menu entry for
+	"MS-DOS".  @include msdog-xtra.texi.
+
+	* programs.texi (Programs) [ifnottex]: Add menu entry for "Fortran".
+	<Top Level> [ifnottex]: @include fortran-xtra.texi.
+
+	* files.texi (Secondary VC Commands) [ifnottex]: Add menu entries
+	for vc-xtra.texi subsections.
+	(VC Undo) [ifnottex]: @include vc1-xtra.texi and @lowersections it.
+	(Multi-User Branching) [ifnottex]: @include vc2-xtra.texi.
+
+	* sending.texi (Sending Mail): A @node line without explicit Prev,
+	Next, and Up links.
+
+	* abbrevs.texi (Abbrevs): A @node line without explicit Prev,
+	Next, and Up links.
+
+	* emacs.texi (Top) [ifnottex]: Add menu entries for "Picture Mode"
+	and its sections.  @include picture-xtra.texi
+
+	* maintaining.texi (Maintaining) [ifnottex]: Add menu entry for
+	"Emerge".
+	(List Tags) [ifnottex]: @include emerge-xtra.texi.
+
+	* cal-xtra.texi (Daylight Savings): Remove this node: it is an
+	exact duplicate of its name-sake in calendar.texi.
+
+	* calendar.texi (Calendar/Diary) [ifnottex]: Add menu item for
+	"Advanced Calendar/Diary Usage".
+	(Time Intervals) [ifnottex]: @include cal-xtra.texi.
+
+	* dired.texi (Subdirectories in Dired) [ifnottex]: @include
+	dired-xtra.texi.
+	(Dired) [ifnottex]: Add menu entry for "Subdir Switches".
+
+	* files.texi (Reverting) [ifnottex]: @include arevert-xtra.texi.
+	(Files) [ifnottex]: Add menu entry for Autorevert.
+
+	* emacs-xtra.texi (Introduction): Reword to make consistent with
+	printed version only.
+	<Top level>: Remove the body of all chapters and move them to the
+	new *-xtra.texi files.  Use @raisesections and @lowersections to
+	convert sections to chapters etc.
+
+	* msdog-xtra.texi:
+	* fortran-xtra.texi:
+	* vc-xtra.texi:
+	* vc1-xtra.texi:
+	* vc2-xtra.texi:
+	* emerge-xtra.texi:
+	* cal-xtra.texi:
+	* dired-xtra.texi:
+	* arevert-xtra.texi: New files, with text from respective chapters
+	of emacs-xtra.texi.  Convert each @chapter into @section, @section
+	into @subsection, etc.
+
+	* emacs-xtra.texi (MS-DOS): Renamed from "MS-DOG".  All references
+	updated.
+
+	* msdog.texi (Microsoft Windows): Rename from "Emacs and Microsoft
+	Windows".  All references updated.
+
+2006-05-06  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+	* macos.texi (Mac Input): Mention input from Character Palette.
+	(Mac Font Specs): Fix typo.
+
+2006-05-05  Richard Stallman  <rms@gnu.org>
+
+	* files.texi (Diff Mode): Minor cleanup.
+
+2006-05-05  Karl Berry  <karl@gnu.org>
+
+	* texinfo.tex (\definetextfonsizexi, \definetextfonsizex): new cmds.
+	(\fonttextsize): new user-level command to change text font size.
+	* emacs.texi: call  @fonttextsize 10, inside @tex to avoid
+	errors from the current release of makeinfo (4.8).
+	* help.texi (Library Keywords): change widest word in multitable
+	template from `emulations' to `convenience'.  (Not sure if this is
+	related to the font change.)
+
+2006-05-05  Eli Zaretskii  <eliz@gnu.org>
+
+	* files.texi (File Names): Add a footnote about limited support of
+	~USER on MS-Windows.
+
+	* cmdargs.texi (Initial Options): Add a footnote about limited
+	support of ~USER on MS-Windows.
+
+2006-05-03  Richard Stallman  <rms@gnu.org>
+
+	* files.texi (Diff Mode): Node moved here.
+	(Comparing Files): Delete what duplicates new node.
+	(Files): Put Diff Mode in menu.
+
+	* misc.texi (Diff Mode): Moved to files.texi.
+
+	* emacs.texi (Top): Update menu for Diff Mode.
+
+	* trouble.texi (Emergency Escape): Simplify.
+
+	* emacs.texi (Top): Minor clarification.
+
+2006-05-03  Teodor Zlatanov  <tzz@lifelogs.com>
+
+	* commands.texi, entering.texi, screen.texi: Many simplifications.
+
+2006-05-03  Richard Stallman  <rms@gnu.org>
+
+	* commands.texi (Text Characters): Delete paragraph about unibyte
+	non-ASCII printing chars.
+
+	* killing.texi (Killing): Say "graphical displays".
+	* display.texi: Say "graphical displays".
+
+	* cmdargs.texi (Misc X): Say "graphical displays".
+
 2006-05-01  Richard Stallman  <rms@gnu.org>
 
 	* emacs.texi (Top): Add Diff Mode to menu.
@@ -33,7 +263,7 @@
 
 	* pgg.texi (Caching passphrase): Fix markup and typos.  Simplify.
 
-2006-04-26  Sascha Wilde  <wilde@sha-bang.de>
+2006-04-26  Sascha Wilde  <wilde@sha-bang.de>  (tiny change)
 
 	* pgg.texi (Caching passphrase): Add pgg-gpg-use-agent.
 
--- a/man/Makefile.in	Tue May 02 08:50:29 2006 +0000
+++ b/man/Makefile.in	Wed May 10 20:42:41 2006 +0000
@@ -33,7 +33,7 @@
 # The makeinfo program is part of the Texinfo distribution.
 # Use --force so that it generates output even if there are errors.
 MAKEINFO = makeinfo --force
-INFO_TARGETS = ../info/emacs ../info/emacs-xtra ../info/ccmode ../info/cl \
+INFO_TARGETS = ../info/emacs ../info/ccmode ../info/cl \
 	        ../info/dired-x ../info/ediff ../info/forms ../info/gnus \
 		../info/message ../info/sieve ../info/pgg ../info/emacs-mime \
 		../info/info ../info/mh-e ../info/reftex \
@@ -61,6 +61,18 @@
 TEXI2DVI = texi2dvi
 ENVADD = TEXINPUTS="$(srcdir):$(TEXINPUTS)" MAKEINFO="$(MAKEINFO) -I$(srcdir)"
 
+EMACS_XTRA=\
+	$(srcdir)/arevert-xtra.texi \
+	$(srcdir)/cal-xtra.texi \
+	$(srcdir)/dired-xtra.texi \
+	$(srcdir)/picture-xtra.texi \
+	$(srcdir)/emerge-xtra.texi \
+	$(srcdir)/vc-xtra.texi \
+	$(srcdir)/vc1-xtra.texi \
+	$(srcdir)/vc2-xtra.texi \
+	$(srcdir)/fortran-xtra.texi \
+	$(srcdir)/msdog-xtra.texi
+
 EMACSSOURCES= \
 	${srcdir}/emacs.texi \
 	${srcdir}/doclicense.texi \
@@ -104,7 +116,8 @@
 	${srcdir}/gnu.texi \
 	${srcdir}/glossary.texi \
 	${srcdir}/ack.texi \
-	${srcdir}/kmacro.texi
+	${srcdir}/kmacro.texi \
+	$(EMACS_XTRA)
 
 info: $(top_srcdir)/info $(INFO_TARGETS)
 
@@ -131,7 +144,7 @@
 ../info/emacs: ${EMACSSOURCES}
 	cd $(srcdir); $(MAKEINFO) emacs.texi
 
-emacs.dvi: ${EMACSSOURCES}
+emacs.dvi: ${EMACSSOURCES} $(srcdir)/xresmini.texi
 	$(ENVADD) $(TEXI2DVI) ${srcdir}/emacs.texi
 
 # This target is here so you could easily get the list of the *.texi
@@ -176,9 +189,7 @@
 ediff.dvi: ediff.texi
 	$(ENVADD) $(TEXI2DVI) ${srcdir}/ediff.texi
 
-../info/emacs-xtra: emacs-xtra.texi
-	cd $(srcdir); $(MAKEINFO) emacs-xtra.texi
-emacs-xtra.dvi: emacs-xtra.texi
+emacs-xtra.dvi: emacs-xtra.texi $(EMACS_XTRA)
 	$(ENVADD) $(TEXI2DVI) ${srcdir}/emacs-xtra.texi
 
 ../info/forms: forms.texi
--- a/man/abbrevs.texi	Tue May 02 08:50:29 2006 +0000
+++ b/man/abbrevs.texi	Wed May 10 20:42:41 2006 +0000
@@ -2,7 +2,7 @@
 @c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2002, 2003,
 @c   2004, 2005, 2006 Free Software Foundation, Inc.
 @c See file emacs.texi for copying conditions.
-@node Abbrevs, Sending Mail, Maintaining, Top
+@node Abbrevs
 @chapter Abbrevs
 @cindex abbrevs
 @cindex expansion (of abbrevs)
@@ -63,7 +63,7 @@
 mode-specific definitions for different major modes.  A mode-specific
 definition for the current major mode overrides a global definition.
 
-  Yu can define abbrevs interactively during the editing session.  You
+  You can define abbrevs interactively during the editing session.  You
 can also save lists of abbrev definitions in files for use in later
 sessions.  Some users keep extensive lists of abbrevs that they load
 in every session.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/man/arevert-xtra.texi	Wed May 10 20:42:41 2006 +0000
@@ -0,0 +1,191 @@
+@c This is part of the Emacs manual.
+@c Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
+@c See file emacs.texi for copying conditions.
+@c
+@c This file is included either in emacs-xtra.texi (when producing the
+@c printed version) or in the main Emacs manual (for the on-line version).
+@node Autorevert
+@section Auto Reverting non-file Buffers
+
+Normally Global Auto Revert Mode only reverts file buffers.  There are
+two ways to auto-revert certain non-file buffers: enabling Auto Revert
+Mode in those buffers (using @kbd{M-x auto-revert-mode}) and setting
+@code{global-auto-revert-non-file-buffers} to @code{t}.  The latter
+enables Auto Reverting for all types of buffers for which it is
+implemented, that is, for the types of buffers listed in the menu
+below.
+
+Like file buffers, non-file buffers should normally not revert while
+you are working on them, or while they contain information that might
+get lost after reverting.  Therefore, they do not revert if they are
+``modified''.  This can get tricky, because deciding when a non-file
+buffer should be marked modified is usually more difficult than for
+file buffers.
+
+Another tricky detail is that, for efficiency reasons, Auto Revert
+often does not try to detect all possible changes in the buffer, only
+changes that are ``major'' or easy to detect.  Hence, enabling
+auto-reverting for a non-file buffer does not always guarantee that
+all information in the buffer is up to date and does not necessarily
+make manual reverts useless.
+
+At the other extreme, certain buffers automatically auto-revert every
+@code{auto-revert-interval} seconds.  (This currently only applies to
+the Buffer Menu.)  In this case, Auto Revert does not print any
+messages while reverting, even when @code{auto-revert-verbose} is
+non-@code{nil}.
+
+The details depend on the particular types of buffers and are
+explained in the corresponding sections.
+
+@menu
+* Auto Reverting the Buffer Menu::
+* Auto Reverting Dired::
+* Supporting additional buffers::
+@end menu
+
+@node Auto Reverting the Buffer Menu
+@subsection Auto Reverting the Buffer Menu
+
+If auto-reverting of non-file buffers is enabled, the Buffer Menu
+automatically reverts every @code{auto-revert-interval} seconds,
+whether there is a need for it or not.  (It would probably take longer
+to check whether there is a need than to actually revert.)
+
+If the Buffer Menu inappropriately gets marked modified, just revert
+it manually using @kbd{g} and auto-reverting will resume.  However, if
+you marked certain buffers to get deleted or to be displayed, you have
+to be careful, because reverting erases all marks.  The fact that
+adding marks sets the buffer's modified flag prevents Auto Revert from
+automatically erasing the marks.
+
+@node Auto Reverting Dired
+@subsection Auto Reverting Dired buffers
+
+Auto-reverting Dired buffers currently works on GNU or Unix style
+operating systems.  It may not work satisfactorily on some other
+systems.
+
+Dired buffers only auto-revert when the file list of the buffer's main
+directory changes.  They do not auto-revert when information about a
+particular file changes or when inserted subdirectories change.  To be
+sure that @emph{all} listed information is up to date, you have to
+manually revert using @kbd{g}, @emph{even} if auto-reverting is
+enabled in the Dired buffer.  Sometimes, you might get the impression
+that modifying or saving files listed in the main directory actually
+does cause auto-reverting.  This is because making changes to a file,
+or saving it, very often causes changes in the directory itself, for
+instance, through backup files or auto-save files.  However, this is
+not guaranteed.
+
+If the Dired buffer is marked modified and there are no changes you
+want to protect, then most of the time you can make auto-reverting
+resume by manually reverting the buffer using @kbd{g}.  There is one
+exception.  If you flag or mark files, you can safely revert the
+buffer.  This will not erase the flags or marks (unless the marked
+file has been deleted, of course).  However, the buffer will stay
+modified, even after reverting, and auto-reverting will not resume.
+This is because, if you flag or mark files, you may be working on the
+buffer and you might not want the buffer to change without warning.
+If you want auto-reverting to resume in the presence of marks and
+flags, mark the buffer non-modified using @kbd{M-~}.  However, adding,
+deleting or changing marks or flags will mark it modified again.
+
+Remote Dired buffers are not auto-reverted.  Neither are Dired buffers
+for which you used shell wildcards or file arguments to list only some
+of the files.  @samp{*Find*} and @samp{*Locate*} buffers do not
+auto-revert either.
+
+@node Supporting additional buffers
+@subsection Adding Support for Auto-Reverting additional Buffers.
+
+This section is intended for Elisp programmers who would like to add
+support for auto-reverting new types of buffers.
+
+To support auto-reverting the buffer must first of all have a
+@code{revert-buffer-function}.  @xref{Definition of
+revert-buffer-function,, Reverting, elisp, the Emacs Lisp Reference Manual}.
+
+In addition, it @emph{must} have a @code{buffer-stale-function}.
+
+@defvar buffer-stale-function
+The value of this variable is a function to check whether a non-file
+buffer needs reverting.  This should be a function with one optional
+argument @var{noconfirm}.  The function should return non-@code{nil}
+if the buffer should be reverted.  The buffer is current when this
+function is called.
+
+While this function is mainly intended for use in auto-reverting, it
+could be used for other purposes as well.  For instance, if
+auto-reverting is not enabled, it could be used to warn the user that
+the buffer needs reverting.  The idea behind the @var{noconfirm}
+argument is that it should be @code{t} if the buffer is going to be
+reverted without asking the user and @code{nil} if the function is
+just going to be used to warn the user that the buffer is out of date.
+In particular, for use in auto-reverting, @var{noconfirm} is @code{t}.
+If the function is only going to be used for auto-reverting, you can
+ignore the @var{noconfirm} argument.
+
+If you just want to automatically auto-revert every
+@code{auto-revert-interval} seconds, use:
+
+@example
+(set (make-local-variable 'buffer-stale-function)
+     #'(lambda (&optional noconfirm) 'fast))
+@end example
+
+@noindent
+in the buffer's mode function.
+
+The special return value @samp{fast} tells the caller that the need
+for reverting was not checked, but that reverting the buffer is fast.
+It also tells Auto Revert not to print any revert messages, even if
+@code{auto-revert-verbose} is non-@code{nil}.  This is important, as
+getting revert messages every @code{auto-revert-interval} seconds can
+be very annoying.  The information provided by this return value could
+also be useful if the function is consulted for purposes other than
+auto-reverting.
+@end defvar
+
+Once the buffer has a @code{revert-buffer-function} and a
+@code{buffer-stale-function}, several problems usually remain.
+
+The buffer will only auto-revert if it is marked unmodified.  Hence,
+you will have to make sure that various functions mark the buffer
+modified if and only if either the buffer contains information that
+might be lost by reverting or there is reason to believe that the user
+might be inconvenienced by auto-reverting, because he is actively
+working on the buffer.  The user can always override this by manually
+adjusting the modified status of the buffer.  To support this, calling
+the @code{revert-buffer-function} on a buffer that is marked
+unmodified should always keep the buffer marked unmodified.
+
+It is important to assure that point does not continuously jump around
+as a consequence of auto-reverting.  Of course, moving point might be
+inevitable if the buffer radically changes.
+
+You should make sure that the @code{revert-buffer-function} does not
+print messages that unnecessarily duplicate Auto Revert's own messages
+if @code{auto-revert-verbose} is @code{t} and effectively override a
+@code{nil} value for @code{auto-revert-verbose}.  Hence, adapting a
+mode for auto-reverting often involves getting rid of such messages.
+This is especially important for buffers that automatically
+auto-revert every @code{auto-revert-interval} seconds.
+
+Also, you may want to update the documentation string of
+@code{global-auto-revert-non-file-buffers}.
+
+@ifinfo
+Finally, you should add a node to this chapter's menu.  This node
+@end ifinfo
+@ifnotinfo
+Finally, you should add a section to this chapter.  This section
+@end ifnotinfo
+should at the very least make clear whether enabling auto-reverting
+for the buffer reliably assures that all information in the buffer is
+completely up to date (or will be after @code{auto-revert-interval}
+seconds).
+
+@ignore
+   arch-tag: 2983e613-a272-45f6-9593-3010ad7f865e
+@end ignore
--- a/man/buffers.texi	Tue May 02 08:50:29 2006 +0000
+++ b/man/buffers.texi	Wed May 10 20:42:41 2006 +0000
@@ -480,7 +480,13 @@
 mode in this buffer, as long as it is not marked modified.  Global
 Auto Revert mode applies to the @samp{*Buffer List*} buffer only if
 @code{global-auto-revert-non-file-buffers} is non-@code{nil}.
-@inforef{Autorevert,, emacs-xtra}, for details.
+@iftex
+@xref{Autorevert,,, emacs-xtra, Specialized Emacs Features}, for details.
+@end iftex
+@ifnottex
+@xref{Autorevert, global-auto-revert-non-file-buffers}, for details.
+@end ifnottex
+
 
   The command @code{buffer-menu-other-window} works the same as
 @code{buffer-menu}, except that it displays the buffers list in
--- a/man/building.texi	Tue May 02 08:50:29 2006 +0000
+++ b/man/building.texi	Wed May 10 20:42:41 2006 +0000
@@ -381,7 +381,7 @@
 (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
+(rgrep only).  Case sensitivity of the search is controlled by the
 current value of @code{case-fold-search}.
 
 These commands build the shell commands based on the variables
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/man/cal-xtra.texi	Wed May 10 20:42:41 2006 +0000
@@ -0,0 +1,838 @@
+@c This is part of the Emacs manual.
+@c Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
+@c See file emacs.texi for copying conditions.
+@c
+@c This file is included either in emacs-xtra.texi (when producing the
+@c printed version) or in the main Emacs manual (for the on-line version).
+
+@c Moved here from the Emacs Lisp Reference Manual, 2005-03-26.
+@node Advanced Calendar/Diary Usage
+@section Customizing the Calendar and Diary
+
+  There are many customizations that you can use to make the calendar and
+diary suit your personal tastes.
+
+@menu
+* Calendar Customizing::   Defaults you can set.
+* Holiday Customizing::    Defining your own holidays.
+* Date Display Format::    Changing the format.
+* Time Display Format::    Changing the format.
+* Diary Customizing::      Defaults you can set.
+* Hebrew/Islamic Entries:: How to obtain them.
+* Fancy Diary Display::    Enhancing the diary display, sorting entries,
+                             using included diary files.
+* Sexp Diary Entries::     Fancy things you can do.
+@end menu
+
+@node Calendar Customizing
+@subsection Customizing the Calendar
+@vindex calendar-holiday-marker
+@vindex diary-entry-marker
+  The variable @code{calendar-holiday-marker} specifies how to mark a
+date as being a holiday.  Its value may be a single-character string
+to insert next to the date, or a face name to use for displaying the
+date.  Likewise, the variable @code{diary-entry-marker} specifies how
+to mark a date that has diary entries.  The calendar creates faces
+named @code{holiday-face} and @code{diary-face} for these purposes;
+those symbols are the default values of these variables.
+
+@vindex calendar-load-hook
+  The variable @code{calendar-load-hook} is a normal hook run when the
+calendar package is first loaded (before actually starting to display
+the calendar).
+
+@vindex initial-calendar-window-hook
+  Starting the calendar runs the normal hook
+@code{initial-calendar-window-hook}.  Recomputation of the calendar
+display does not run this hook.  But if you leave the calendar with the
+@kbd{q} command and reenter it, the hook runs again.@refill
+
+@vindex today-visible-calendar-hook
+  The variable @code{today-visible-calendar-hook} is a normal hook run
+after the calendar buffer has been prepared with the calendar when the
+current date is visible in the window.  One use of this hook is to
+replace today's date with asterisks; to do that, use the hook function
+@code{calendar-star-date}.
+
+@findex calendar-star-date
+@example
+(add-hook 'today-visible-calendar-hook 'calendar-star-date)
+@end example
+
+@noindent
+Another standard hook function marks the current date, either by
+changing its face or by adding an asterisk.  Here's how to use it:
+
+@findex calendar-mark-today
+@example
+(add-hook 'today-visible-calendar-hook 'calendar-mark-today)
+@end example
+
+@noindent
+@vindex calendar-today-marker
+The variable @code{calendar-today-marker} specifies how to mark
+today's date.  Its value should be a single-character string to insert
+next to the date or a face name to use for displaying the date.  A
+face named @code{calendar-today-face} is provided for this purpose;
+that symbol is the default for this variable.
+
+@vindex today-invisible-calendar-hook
+@noindent
+  A similar normal hook, @code{today-invisible-calendar-hook} is run if
+the current date is @emph{not} visible in the window.
+
+@vindex calendar-move-hook
+  Each of the calendar cursor motion commands runs the hook
+@code{calendar-move-hook} after it moves the cursor.
+
+@node Holiday Customizing
+@subsection Customizing the Holidays
+
+@vindex calendar-holidays
+@vindex christian-holidays
+@vindex hebrew-holidays
+@vindex islamic-holidays
+  Emacs knows about holidays defined by entries on one of several lists.
+You can customize these lists of holidays to your own needs, adding or
+deleting holidays.  The lists of holidays that Emacs uses are for
+general holidays (@code{general-holidays}), local holidays
+(@code{local-holidays}), Christian holidays (@code{christian-holidays}),
+Hebrew (Jewish) holidays (@code{hebrew-holidays}), Islamic (Muslim)
+holidays (@code{islamic-holidays}), and other holidays
+(@code{other-holidays}).
+
+@vindex general-holidays
+  The general holidays are, by default, holidays common throughout the
+United States.  To eliminate these holidays, set @code{general-holidays}
+to @code{nil}.
+
+@vindex local-holidays
+  There are no default local holidays (but sites may supply some).  You
+can set the variable @code{local-holidays} to any list of holidays, as
+described below.
+
+@vindex all-christian-calendar-holidays
+@vindex all-hebrew-calendar-holidays
+@vindex all-islamic-calendar-holidays
+  By default, Emacs does not include all the holidays of the religions
+that it knows, only those commonly found in secular calendars.  For a
+more extensive collection of religious holidays, you can set any (or
+all) of the variables @code{all-christian-calendar-holidays},
+@code{all-hebrew-calendar-holidays}, or
+@code{all-islamic-calendar-holidays} to @code{t}.  If you want to
+eliminate the religious holidays, set any or all of the corresponding
+variables @code{christian-holidays}, @code{hebrew-holidays}, and
+@code{islamic-holidays} to @code{nil}.@refill
+
+@vindex other-holidays
+  You can set the variable @code{other-holidays} to any list of
+holidays.  This list, normally empty, is intended for individual use.
+
+@cindex holiday forms
+  Each of the lists (@code{general-holidays}, @code{local-holidays},
+@code{christian-holidays}, @code{hebrew-holidays},
+@code{islamic-holidays}, and @code{other-holidays}) is a list of
+@dfn{holiday forms}, each holiday form describing a holiday (or
+sometimes a list of holidays).
+
+  Here is a table of the possible kinds of holiday form.  Day numbers
+and month numbers count starting from 1, but ``dayname'' numbers
+count Sunday as 0.  The element @var{string} is always the
+name of the holiday, as a string.
+
+@table @code
+@item (holiday-fixed @var{month} @var{day} @var{string})
+A fixed date on the Gregorian calendar.
+
+@item (holiday-float @var{month} @var{dayname} @var{k} @var{string})
+The @var{k}th @var{dayname} in @var{month} on the Gregorian calendar
+(@var{dayname}=0 for Sunday, and so on); negative @var{k} means count back
+from the end of the month.
+
+@item (holiday-hebrew @var{month} @var{day} @var{string})
+A fixed date on the Hebrew calendar.
+
+@item (holiday-islamic @var{month} @var{day} @var{string})
+A fixed date on the Islamic calendar.
+
+@item (holiday-julian @var{month} @var{day} @var{string})
+A fixed date on the Julian calendar.
+
+@item (holiday-sexp @var{sexp} @var{string})
+A date calculated by the Lisp expression @var{sexp}.  The expression
+should use the variable @code{year} to compute and return the date of a
+holiday, or @code{nil} if the holiday doesn't happen this year.  The
+value of @var{sexp} must represent the date as a list of the form
+@code{(@var{month} @var{day} @var{year})}.
+
+@item (if @var{condition} @var{holiday-form})
+A holiday that happens only if @var{condition} is true.
+
+@item (@var{function} @r{[}@var{args}@r{]})
+A list of dates calculated by the function @var{function}, called with
+arguments @var{args}.
+@end table
+
+  For example, suppose you want to add Bastille Day, celebrated in
+France on July 14.  You can do this as follows:
+
+@smallexample
+(setq other-holidays '((holiday-fixed 7 14 "Bastille Day")))
+@end smallexample
+
+@noindent
+The holiday form @code{(holiday-fixed 7 14 "Bastille Day")} specifies the
+fourteenth day of the seventh month (July).
+
+  Many holidays occur on a specific day of the week, at a specific time
+of month.  Here is a holiday form describing Hurricane Supplication Day,
+celebrated in the Virgin Islands on the fourth Monday in August:
+
+@smallexample
+(holiday-float 8 1 4 "Hurricane Supplication Day")
+@end smallexample
+
+@noindent
+Here the 8 specifies August, the 1 specifies Monday (Sunday is 0,
+Tuesday is 2, and so on), and the 4 specifies the fourth occurrence in
+the month (1 specifies the first occurrence, 2 the second occurrence,
+@minus{}1 the last occurrence, @minus{}2 the second-to-last occurrence, and
+so on).
+
+  You can specify holidays that occur on fixed days of the Hebrew,
+Islamic, and Julian calendars too.  For example,
+
+@smallexample
+(setq other-holidays
+      '((holiday-hebrew 10 2 "Last day of Hanukkah")
+        (holiday-islamic 3 12 "Mohammed's Birthday")
+        (holiday-julian 4 2 "Jefferson's Birthday")))
+@end smallexample
+
+@noindent
+adds the last day of Hanukkah (since the Hebrew months are numbered with
+1 starting from Nisan), the Islamic feast celebrating Mohammed's
+birthday (since the Islamic months are numbered from 1 starting with
+Muharram), and Thomas Jefferson's birthday, which is 2 April 1743 on the
+Julian calendar.
+
+  To include a holiday conditionally, use either Emacs Lisp's @code{if} or the
+@code{holiday-sexp} form.  For example, American presidential elections
+occur on the first Tuesday after the first Monday in November of years
+divisible by 4:
+
+@smallexample
+(holiday-sexp '(if (= 0 (% year 4))
+                   (calendar-gregorian-from-absolute
+                    (1+ (calendar-dayname-on-or-before
+                          1 (+ 6 (calendar-absolute-from-gregorian
+                                  (list 11 1 year)))))))
+              "US Presidential Election")
+@end smallexample
+
+@noindent
+or
+
+@smallexample
+(if (= 0 (% displayed-year 4))
+    (fixed 11
+           (extract-calendar-day
+             (calendar-gregorian-from-absolute
+               (1+ (calendar-dayname-on-or-before
+                     1 (+ 6 (calendar-absolute-from-gregorian
+                              (list 11 1 displayed-year)))))))
+           "US Presidential Election"))
+@end smallexample
+
+  Some holidays just don't fit into any of these forms because special
+calculations are involved in their determination.  In such cases you
+must write a Lisp function to do the calculation.  To include eclipses,
+for example, add @code{(eclipses)} to @code{other-holidays}
+and write an Emacs Lisp function @code{eclipses} that returns a
+(possibly empty) list of the relevant Gregorian dates among the range
+visible in the calendar window, with descriptive strings, like this:
+
+@smallexample
+(((6 27 1991) "Lunar Eclipse") ((7 11 1991) "Solar Eclipse") ... )
+@end smallexample
+
+@node Date Display Format
+@subsection Date Display Format
+@vindex calendar-date-display-form
+
+  You can customize the manner of displaying dates in the diary, in mode
+lines, and in messages by setting @code{calendar-date-display-form}.
+This variable holds a list of expressions that can involve the variables
+@code{month}, @code{day}, and @code{year}, which are all numbers in
+string form, and @code{monthname} and @code{dayname}, which are both
+alphabetic strings.  In the American style, the default value of this
+list is as follows:
+
+@smallexample
+((if dayname (concat dayname ", ")) monthname " " day ", " year)
+@end smallexample
+
+@noindent
+while in the European style this value is the default:
+
+@smallexample
+((if dayname (concat dayname ", ")) day " " monthname " " year)
+@end smallexample
+
+@noindent
+The ISO standard date representation is this:
+
+@smallexample
+(year "-" month "-" day)
+@end smallexample
+
+@noindent
+This specifies a typical American format:
+
+@smallexample
+(month "/" day "/" (substring year -2))
+@end smallexample
+
+@node Time Display Format
+@subsection Time Display Format
+@vindex calendar-time-display-form
+
+  The calendar and diary by default display times of day in the
+conventional American style with the hours from 1 through 12, minutes,
+and either @samp{am} or @samp{pm}.  If you prefer the European style,
+also known in the US as military, in which the hours go from 00 to 23,
+you can alter the variable @code{calendar-time-display-form}.  This
+variable is a list of expressions that can involve the variables
+@code{12-hours}, @code{24-hours}, and @code{minutes}, which are all
+numbers in string form, and @code{am-pm} and @code{time-zone}, which are
+both alphabetic strings.  The default value of
+@code{calendar-time-display-form} is as follows:
+
+@smallexample
+(12-hours ":" minutes am-pm
+          (if time-zone " (") time-zone (if time-zone ")"))
+@end smallexample
+
+@noindent
+Here is a value that provides European style times:
+
+@smallexample
+(24-hours ":" minutes
+          (if time-zone " (") time-zone (if time-zone ")"))
+@end smallexample
+
+@node Diary Customizing
+@subsection Customizing the Diary
+
+@vindex holidays-in-diary-buffer
+  Ordinarily, the mode line of the diary buffer window indicates any
+holidays that fall on the date of the diary entries.  The process of
+checking for holidays can take several seconds, so including holiday
+information delays the display of the diary buffer noticeably.  If you'd
+prefer to have a faster display of the diary buffer but without the
+holiday information, set the variable @code{holidays-in-diary-buffer} to
+@code{nil}.@refill
+
+@vindex number-of-diary-entries
+  The variable @code{number-of-diary-entries} controls the number of
+days of diary entries to be displayed at one time.  It affects the
+initial display when @code{view-diary-entries-initially} is @code{t}, as
+well as the command @kbd{M-x diary}.  For example, the default value is
+1, which says to display only the current day's diary entries.  If the
+value is 2, both the current day's and the next day's entries are
+displayed.  The value can also be a vector of seven elements: for
+example, if the value is @code{[0 2 2 2 2 4 1]} then no diary entries
+appear on Sunday, the current date's and the next day's diary entries
+appear Monday through Thursday, Friday through Monday's entries appear
+on Friday, while on Saturday only that day's entries appear.
+
+@vindex print-diary-entries-hook
+@findex print-diary-entries
+  The variable @code{print-diary-entries-hook} is a normal hook run
+after preparation of a temporary buffer containing just the diary
+entries currently visible in the diary buffer.  (The other, irrelevant
+diary entries are really absent from the temporary buffer; in the diary
+buffer, they are merely hidden.)  The default value of this hook does
+the printing with the command @code{lpr-buffer}.  If you want to use a
+different command to do the printing, just change the value of this
+hook.  Other uses might include, for example, rearranging the lines into
+order by day and time.
+
+@vindex diary-date-forms
+  You can customize the form of dates in your diary file, if neither the
+standard American nor European styles suits your needs, by setting the
+variable @code{diary-date-forms}.  This variable is a list of patterns
+for recognizing a date.  Each date pattern is a list whose elements may
+be regular expressions (@pxref{Regular Expressions,,, elisp, the Emacs
+Lisp Reference Manual}) or the symbols @code{month}, @code{day},
+@code{year}, @code{monthname}, and @code{dayname}.  All these elements
+serve as patterns that match certain kinds of text in the diary file.
+In order for the date pattern, as a whole, to match, all of its elements
+must match consecutively.
+
+  A regular expression in a date pattern matches in its usual fashion,
+using the standard syntax table altered so that @samp{*} is a word
+constituent.
+
+  The symbols @code{month}, @code{day}, @code{year}, @code{monthname},
+and @code{dayname} match the month number, day number, year number,
+month name, and day name of the date being considered.  The symbols that
+match numbers allow leading zeros; those that match names allow
+three-letter abbreviations and capitalization.  All the symbols can
+match @samp{*}; since @samp{*} in a diary entry means ``any day'', ``any
+month'', and so on, it should match regardless of the date being
+considered.
+
+  The default value of @code{diary-date-forms} in the American style is
+this:
+
+@example
+((month "/" day "[^/0-9]")
+ (month "/" day "/" year "[^0-9]")
+ (monthname " *" day "[^,0-9]")
+ (monthname " *" day ", *" year "[^0-9]")
+ (dayname "\\W"))
+@end example
+
+  The date patterns in the list must be @emph{mutually exclusive} and
+must not match any portion of the diary entry itself, just the date and
+one character of whitespace.  If, to be mutually exclusive, the pattern
+must match a portion of the diary entry text---beyond the whitespace
+that ends the date---then the first element of the date pattern
+@emph{must} be @code{backup}.  This causes the date recognizer to back
+up to the beginning of the current word of the diary entry, after
+finishing the match.  Even if you use @code{backup}, the date pattern
+must absolutely not match more than a portion of the first word of the
+diary entry.  The default value of @code{diary-date-forms} in the
+European style is this list:
+
+@example
+((day "/" month "[^/0-9]")
+ (day "/" month "/" year "[^0-9]")
+ (backup day " *" monthname "\\W+\\<[^*0-9]")
+ (day " *" monthname " *" year "[^0-9]")
+ (dayname "\\W"))
+@end example
+
+@noindent
+Notice the use of @code{backup} in the third pattern, because it needs
+to match part of a word beyond the date itself to distinguish it from
+the fourth pattern.
+
+@node Hebrew/Islamic Entries
+@subsection Hebrew- and Islamic-Date Diary Entries
+
+  Your diary file can have entries based on Hebrew or Islamic dates, as
+well as entries based on the world-standard Gregorian calendar.
+However, because recognition of such entries is time-consuming and most
+people don't use them, you must explicitly enable their use.  If you
+want the diary to recognize Hebrew-date diary entries, for example,
+you must do this:
+
+@vindex nongregorian-diary-listing-hook
+@vindex nongregorian-diary-marking-hook
+@findex list-hebrew-diary-entries
+@findex mark-hebrew-diary-entries
+@smallexample
+(add-hook 'nongregorian-diary-listing-hook 'list-hebrew-diary-entries)
+(add-hook 'nongregorian-diary-marking-hook 'mark-hebrew-diary-entries)
+@end smallexample
+
+@noindent
+If you want Islamic-date entries, do this:
+
+@findex list-islamic-diary-entries
+@findex mark-islamic-diary-entries
+@smallexample
+(add-hook 'nongregorian-diary-listing-hook 'list-islamic-diary-entries)
+(add-hook 'nongregorian-diary-marking-hook 'mark-islamic-diary-entries)
+@end smallexample
+
+  Hebrew- and Islamic-date diary entries have the same formats as
+Gregorian-date diary entries, except that @samp{H} precedes a Hebrew
+date and @samp{I} precedes an Islamic date.  Moreover, because the
+Hebrew and Islamic month names are not uniquely specified by the first
+three letters, you may not abbreviate them.  For example, a diary entry
+for the Hebrew date Heshvan 25 could look like this:
+
+@smallexample
+HHeshvan 25 Happy Hebrew birthday!
+@end smallexample
+
+@noindent
+and would appear in the diary for any date that corresponds to Heshvan 25
+on the Hebrew calendar.  And here is an Islamic-date diary entry that matches
+Dhu al-Qada 25:
+
+@smallexample
+IDhu al-Qada 25 Happy Islamic birthday!
+@end smallexample
+
+  As with Gregorian-date diary entries, Hebrew- and Islamic-date entries
+are nonmarking if they are preceded with an ampersand (@samp{&}).
+
+  Here is a table of commands used in the calendar to create diary entries
+that match the selected date and other dates that are similar in the Hebrew
+or Islamic calendar:
+
+@table @kbd
+@item i h d
+Add a diary entry for the Hebrew date corresponding to the selected date
+(@code{insert-hebrew-diary-entry}).
+@item i h m
+Add a diary entry for the day of the Hebrew month corresponding to the
+selected date (@code{insert-monthly-hebrew-diary-entry}).  This diary
+entry matches any date that has the same Hebrew day-within-month as the
+selected date.
+@item i h y
+Add a diary entry for the day of the Hebrew year corresponding to the
+selected date (@code{insert-yearly-hebrew-diary-entry}).  This diary
+entry matches any date which has the same Hebrew month and day-within-month
+as the selected date.
+@item i i d
+Add a diary entry for the Islamic date corresponding to the selected date
+(@code{insert-islamic-diary-entry}).
+@item i i m
+Add a diary entry for the day of the Islamic month corresponding to the
+selected date (@code{insert-monthly-islamic-diary-entry}).
+@item i i y
+Add a diary entry for the day of the Islamic year corresponding to the
+selected date (@code{insert-yearly-islamic-diary-entry}).
+@end table
+
+@findex insert-hebrew-diary-entry
+@findex insert-monthly-hebrew-diary-entry
+@findex insert-yearly-hebrew-diary-entry
+@findex insert-islamic-diary-entry
+@findex insert-monthly-islamic-diary-entry
+@findex insert-yearly-islamic-diary-entry
+  These commands work much like the corresponding commands for ordinary
+diary entries: they apply to the date that point is on in the calendar
+window, and what they do is insert just the date portion of a diary entry
+at the end of your diary file.  You must then insert the rest of the
+diary entry.
+
+@node Fancy Diary Display
+@subsection Fancy Diary Display
+@vindex diary-display-hook
+@findex simple-diary-display
+
+  Diary display works by preparing the diary buffer and then running the
+hook @code{diary-display-hook}.  The default value of this hook
+(@code{simple-diary-display}) hides the irrelevant diary entries and
+then displays the buffer.  However, if you specify the hook as follows,
+
+@cindex diary buffer
+@findex fancy-diary-display
+@example
+(add-hook 'diary-display-hook 'fancy-diary-display)
+@end example
+
+@noindent
+this enables fancy diary display.  It displays diary entries and
+holidays by copying them into a special buffer that exists only for the
+sake of display.  Copying to a separate buffer provides an opportunity
+to change the displayed text to make it prettier---for example, to sort
+the entries by the dates they apply to.
+
+  As with simple diary display, you can print a hard copy of the buffer
+with @code{print-diary-entries}.  To print a hard copy of a day-by-day
+diary for a week, position point on Sunday of that week, type
+@kbd{7 d}, and then do @kbd{M-x print-diary-entries}.  As usual, the
+inclusion of the holidays slows down the display slightly; you can speed
+things up by setting the variable @code{holidays-in-diary-buffer} to
+@code{nil}.
+
+@vindex diary-list-include-blanks
+  Ordinarily, the fancy diary buffer does not show days for which there are
+no diary entries, even if that day is a holiday.  If you want such days to be
+shown in the fancy diary buffer, set the variable
+@code{diary-list-include-blanks} to @code{t}.@refill
+
+@cindex sorting diary entries
+  If you use the fancy diary display, you can use the normal hook
+@code{list-diary-entries-hook} to sort each day's diary entries by their
+time of day.  Here's how:
+
+@findex sort-diary-entries
+@example
+(add-hook 'list-diary-entries-hook 'sort-diary-entries t)
+@end example
+
+@noindent
+For each day, this sorts diary entries that begin with a recognizable
+time of day according to their times.  Diary entries without times come
+first within each day.
+
+  Fancy diary display also has the ability to process included diary
+files.  This permits a group of people to share a diary file for events
+that apply to all of them.  Lines in the diary file of this form:
+
+@smallexample
+#include "@var{filename}"
+@end smallexample
+
+@noindent
+includes the diary entries from the file @var{filename} in the fancy
+diary buffer.  The include mechanism is recursive, so that included files
+can include other files, and so on; you must be careful not to have a
+cycle of inclusions, of course.  Here is how to enable the include
+facility:
+
+@vindex list-diary-entries-hook
+@vindex mark-diary-entries-hook
+@findex include-other-diary-files
+@findex mark-included-diary-files
+@smallexample
+(add-hook 'list-diary-entries-hook 'include-other-diary-files)
+(add-hook 'mark-diary-entries-hook 'mark-included-diary-files)
+@end smallexample
+
+The include mechanism works only with the fancy diary display, because
+ordinary diary display shows the entries directly from your diary file.
+
+@node Sexp Diary Entries
+@subsection Sexp Entries and the Fancy Diary Display
+@cindex sexp diary entries
+
+  Sexp diary entries allow you to do more than just have complicated
+conditions under which a diary entry applies.  If you use the fancy
+diary display, sexp entries can generate the text of the entry depending
+on the date itself.  For example, an anniversary diary entry can insert
+the number of years since the anniversary date into the text of the
+diary entry.  Thus the @samp{%d} in this dairy entry:
+
+@findex diary-anniversary
+@smallexample
+%%(diary-anniversary 10 31 1948) Arthur's birthday (%d years old)
+@end smallexample
+
+@noindent
+gets replaced by the age, so on October 31, 1990 the entry appears in
+the fancy diary buffer like this:
+
+@smallexample
+Arthur's birthday (42 years old)
+@end smallexample
+
+@noindent
+If the diary file instead contains this entry:
+
+@smallexample
+%%(diary-anniversary 10 31 1948) Arthur's %d%s birthday
+@end smallexample
+
+@noindent
+the entry in the fancy diary buffer for October 31, 1990 appears like this:
+
+@smallexample
+Arthur's 42nd birthday
+@end smallexample
+
+  Similarly, cyclic diary entries can interpolate the number of repetitions
+that have occurred:
+
+@findex diary-cyclic
+@smallexample
+%%(diary-cyclic 50 1 1 1990) Renew medication (%d%s time)
+@end smallexample
+
+@noindent
+looks like this:
+
+@smallexample
+Renew medication (5th time)
+@end smallexample
+
+@noindent
+in the fancy diary display on September 8, 1990.
+
+  There is an early reminder diary sexp that includes its entry in the
+diary not only on the date of occurrence, but also on earlier dates.
+For example, if you want a reminder a week before your anniversary, you
+can use
+
+@findex diary-remind
+@smallexample
+%%(diary-remind '(diary-anniversary 12 22 1968) 7) Ed's anniversary
+@end smallexample
+
+@noindent
+and the fancy diary will show
+@smallexample
+Ed's anniversary
+@end smallexample
+@noindent
+both on December 15 and on December 22.
+
+@findex diary-date
+  The function @code{diary-date} applies to dates described by a month,
+day, year combination, each of which can be an integer, a list of
+integers, or @code{t}. The value @code{t} means all values.  For
+example,
+
+@smallexample
+%%(diary-date '(10 11 12) 22 t) Rake leaves
+@end smallexample
+
+@noindent
+causes the fancy diary to show
+
+@smallexample
+Rake leaves
+@end smallexample
+
+@noindent
+on October 22, November 22, and December 22 of every year.
+
+@findex diary-float
+  The function @code{diary-float} allows you to describe diary entries
+that apply to dates like the third Friday of November, or the last
+Tuesday in April.  The parameters are the @var{month}, @var{dayname},
+and an index @var{n}. The entry appears on the @var{n}th @var{dayname}
+of @var{month}, where @var{dayname}=0 means Sunday, 1 means Monday, and
+so on.  If @var{n} is negative it counts backward from the end of
+@var{month}.  The value of @var{month} can be a list of months, a single
+month, or @code{t} to specify all months.  You can also use an optional
+parameter @var{day} to specify the @var{n}th @var{dayname} of
+@var{month} on or after/before @var{day}; the value of @var{day} defaults
+to 1 if @var{n} is positive and to the last day of @var{month} if
+@var{n} is negative.  For example,
+
+@smallexample
+%%(diary-float t 1 -1) Pay rent
+@end smallexample
+
+@noindent
+causes the fancy diary to show
+
+@smallexample
+Pay rent
+@end smallexample
+
+@noindent
+on the last Monday of every month.
+
+  The generality of sexp diary entries lets you specify any diary
+entry that you can describe algorithmically.  A sexp diary entry
+contains an expression that computes whether the entry applies to any
+given date.  If its value is non-@code{nil}, the entry applies to that
+date; otherwise, it does not.  The expression can use the variable
+@code{date} to find the date being considered; its value is a list
+(@var{month} @var{day} @var{year}) that refers to the Gregorian
+calendar.
+
+  The sexp diary entry applies to a date when the expression's value
+is non-@code{nil}, but some values have more specific meanings.  If
+the value is a string, that string is a description of the event which
+occurs on that date.  The value can also have the form
+@code{(@var{mark} . @var{string})}; then @var{mark} specifies how to
+mark the date in the calendar, and @var{string} is the description of
+the event.  If @var{mark} is a single-character string, that character
+appears next to the date in the calendar.  If @var{mark} is a face
+name, the date is displayed in that face.  If @var{mark} is
+@code{nil}, that specifies no particular highlighting for the date.
+
+  Suppose you get paid on the 21st of the month if it is a weekday, and
+on the Friday before if the 21st is on a weekend.  Here is how to write
+a sexp diary entry that matches those dates:
+
+@smallexample
+&%%(let ((dayname (calendar-day-of-week date))
+         (day (car (cdr date))))
+      (or (and (= day 21) (memq dayname '(1 2 3 4 5)))
+          (and (memq day '(19 20)) (= dayname 5)))
+         ) Pay check deposited
+@end smallexample
+
+  The following sexp diary entries take advantage of the ability (in the fancy
+diary display) to concoct diary entries whose text varies based on the date:
+
+@findex diary-sunrise-sunset
+@findex diary-phases-of-moon
+@findex diary-day-of-year
+@findex diary-iso-date
+@findex diary-julian-date
+@findex diary-astro-day-number
+@findex diary-hebrew-date
+@findex diary-islamic-date
+@findex diary-french-date
+@findex diary-mayan-date
+@table @code
+@item %%(diary-sunrise-sunset)
+Make a diary entry for the local times of today's sunrise and sunset.
+@item %%(diary-phases-of-moon)
+Make a diary entry for the phases (quarters) of the moon.
+@item %%(diary-day-of-year)
+Make a diary entry with today's day number in the current year and the number
+of days remaining in the current year.
+@item %%(diary-iso-date)
+Make a diary entry with today's equivalent ISO commercial date.
+@item %%(diary-julian-date)
+Make a diary entry with today's equivalent date on the Julian calendar.
+@item %%(diary-astro-day-number)
+Make a diary entry with today's equivalent astronomical (Julian) day number.
+@item %%(diary-hebrew-date)
+Make a diary entry with today's equivalent date on the Hebrew calendar.
+@item %%(diary-islamic-date)
+Make a diary entry with today's equivalent date on the Islamic calendar.
+@item %%(diary-french-date)
+Make a diary entry with today's equivalent date on the French Revolutionary
+calendar.
+@item %%(diary-mayan-date)
+Make a diary entry with today's equivalent date on the Mayan calendar.
+@end table
+
+@noindent
+Thus including the diary entry
+
+@example
+&%%(diary-hebrew-date)
+@end example
+
+@noindent
+causes every day's diary display to contain the equivalent date on the
+Hebrew calendar, if you are using the fancy diary display.  (With simple
+diary display, the line @samp{&%%(diary-hebrew-date)} appears in the
+diary for any date, but does nothing particularly useful.)
+
+  These functions can be used to construct sexp diary entries based on
+the Hebrew calendar in certain standard ways:
+
+@cindex rosh hodesh
+@findex diary-rosh-hodesh
+@cindex parasha, weekly
+@findex diary-parasha
+@cindex candle lighting times
+@findex diary-sabbath-candles
+@cindex omer count
+@findex diary-omer
+@cindex yahrzeits
+@findex diary-yahrzeit
+@table @code
+@item %%(diary-rosh-hodesh)
+Make a diary entry that tells the occurrence and ritual announcement of each
+new Hebrew month.
+@item %%(diary-parasha)
+Make a Saturday diary entry that tells the weekly synagogue scripture reading.
+@item %%(diary-sabbath-candles)
+Make a Friday diary entry that tells the @emph{local time} of Sabbath
+candle lighting.
+@item %%(diary-omer)
+Make a diary entry that gives the omer count, when appropriate.
+@item %%(diary-yahrzeit @var{month} @var{day} @var{year}) @var{name}
+Make a diary entry marking the anniversary of a date of death.  The date
+is the @emph{Gregorian} (civil) date of death.  The diary entry appears
+on the proper Hebrew calendar anniversary and on the day before.  (In
+the European style, the order of the parameters is changed to @var{day},
+@var{month}, @var{year}.)
+@end table
+
+  All the functions documented above take an optional argument
+@var{mark} which specifies how to mark the date in the calendar display.
+If one of these functions decides that it applies to a certain date,
+it returns a value that contains @var{mark}.
+
+@ignore
+   arch-tag: 52cb299f-fd1f-4616-bfe6-91b988669431
+@end ignore
--- a/man/calendar.texi	Tue May 02 08:50:29 2006 +0000
+++ b/man/calendar.texi	Wed May 10 20:42:41 2006 +0000
@@ -24,9 +24,11 @@
 calendar features that are independent of any particular date.  To exit
 the calendar, type @kbd{q}.
 
+@iftex
   This chapter describes the basic calendar features.
-@inforef{Advanced Calendar/Diary Usage,, emacs-xtra}, for information
-about more specialized features.
+@xref{Advanced Calendar/Diary Usage,,, emacs-xtra, Specialized Emacs
+Features}, for information about more specialized features.
+@end iftex
 
 @menu
 * Calendar Motion::     Moving through the calendar; selecting a date.
@@ -43,6 +45,9 @@
 * Importing Diary::     Converting diary events to/from other formats.
 * Daylight Savings::    How to specify when daylight savings time is active.
 * Time Intervals::      Keeping track of time intervals.
+@ifnottex
+* Advanced Calendar/Diary Usage:: Advanced Calendar/Diary customization.
+@end ifnottex
 @end menu
 
 @node Calendar Motion
@@ -444,14 +449,20 @@
   To view the distribution of holidays for all the dates shown in the
 calendar, use the @kbd{x} command.  This displays the dates that are
 holidays in a different face (or places a @samp{*} after these dates, if
-display with multiple faces is not available).  @inforef{Calendar
-Customizing, calendar-holiday-marker, emacs-xtra}.  The command applies
-both to the currently visible months and to other months that
-subsequently become visible by scrolling.  To turn marking off and erase
-the current marks, type @kbd{u}, which also erases any diary marks
-(@pxref{Diary}).  If the variable @code{mark-holidays-in-calendar} is
-non-@code{nil}, creating or updating the calendar marks holidays
-automatically.
+display with multiple faces is not available).
+@iftex
+@xref{Calendar Customizing, calendar-holiday-marker,, emacs-xtra,
+Specialized Emacs Features}.
+@end iftex
+@ifnottex
+@xref{Calendar Customizing, calendar-holiday-marker}.
+@end ifnottex
+  The command applies both to the currently visible months and to
+other months that subsequently become visible by scrolling.  To turn
+marking off and erase the current marks, type @kbd{u}, which also
+erases any diary marks (@pxref{Diary}).  If the variable
+@code{mark-holidays-in-calendar} is non-@code{nil}, creating or
+updating the calendar marks holidays automatically.
 
 @kindex a @r{(Calendar mode)}
 @findex list-calendar-holidays
@@ -1029,14 +1040,20 @@
   To get a broader view of which days are mentioned in the diary, use
 the @kbd{m} command.  This displays the dates that have diary entries in
 a different face (or places a @samp{+} after these dates, if display
-with multiple faces is not available).  @inforef{Calendar Customizing,
-diary-entry-marker, emacs-xtra}.  The command applies both to the
-currently visible months and to other months that subsequently become
-visible by scrolling.  To turn marking off and erase the current marks,
-type @kbd{u}, which also turns off holiday marks (@pxref{Holidays}).
-If the variable @code{mark-diary-entries-in-calendar} is
-non-@code{nil}, creating or updating the calendar marks diary dates
-automatically.
+with multiple faces is not available).
+@iftex
+@xref{Calendar Customizing, diary-entry-marker,, emacs-xtra,
+Specialized Emacs Features}.
+@end iftex
+@ifnottex
+@xref{Calendar Customizing, diary-entry-marker}.
+@end ifnottex
+  The command applies both to the currently visible months and to
+other months that subsequently become visible by scrolling.  To turn
+marking off and erase the current marks, type @kbd{u}, which also
+turns off holiday marks (@pxref{Holidays}).  If the variable
+@code{mark-diary-entries-in-calendar} is non-@code{nil}, creating or
+updating the calendar marks diary dates automatically.
 
 @kindex s @r{(Calendar mode)}
 @findex show-all-diary-entries
@@ -1055,7 +1072,13 @@
   The command @kbd{M-x diary} displays the diary entries for the current
 date, independently of the calendar display, and optionally for the next
 few days as well; the variable @code{number-of-diary-entries} specifies
-how many days to include.  @inforef{Diary Customizing,, emacs-xtra}.
+how many days to include.
+@iftex
+@xref{Diary Customizing,,, emacs-xtra, Specialized Emacs Features}.
+@end iftex
+@ifnottex
+@xref{Diary Customizing, number-of-diary-entries}.
+@end ifnottex
 
   If you put @code{(diary)} in your @file{.emacs} file, this
 automatically displays a window with the day's diary entries, when you
@@ -1360,7 +1383,12 @@
 specifying the name of a face or a single-character string to use when
 marking the entry in the calendar.  Most generally, sexp diary entries
 can perform arbitrary computations to determine when they apply.
-@inforef{Sexp Diary Entries,, emacs-xtra}.
+@iftex
+@xref{Sexp Diary Entries,,, emacs-xtra, Specialized Emacs Features}.
+@end iftex
+@ifnottex
+@inforef{Sexp Diary Entries}.
+@end ifnottex
 
 @node Appointments
 @section Appointments
@@ -1479,8 +1507,14 @@
 
 @noindent
 You can use an @code{#include} directive to add the import file contents
-to the main diary file, if these are different files.  @inforef{Fancy Diary
-Display,, emacs-xtra}.
+to the main diary file, if these are different files.
+@iftex
+@xref{Fancy Diary Display,,, emacs-xtra, Specialized Emacs Features}.
+@end iftex
+@ifnottex
+@xref{Fancy Diary Display}.
+@end ifnottex
+
 
 @findex icalendar-export-file, icalendar-export-region
   Use @code{icalendar-export-file} to interactively export an entire
@@ -1608,6 +1642,10 @@
 should run the command @kbd{M-x timeclock-reread-log} to update the
 data in Emacs from the file.
 
+@ifnottex
+@include cal-xtra.texi
+@end ifnottex
+
 @ignore
    arch-tag: 4531ef09-9df3-449d-9c52-2b5a4a337f92
 @end ignore
--- a/man/cmdargs.texi	Tue May 02 08:50:29 2006 +0000
+++ b/man/cmdargs.texi	Wed May 10 20:42:41 2006 +0000
@@ -293,7 +293,8 @@
 @opindex --user
 @cindex load init file of another user
 Load @var{user}'s Emacs init file @file{~@var{user}/.emacs} instead of
-your own.
+your own@footnote{
+This option has no effect on MS-Windows.}.
 
 @item --debug-init
 @opindex --debug-init
@@ -1227,7 +1228,7 @@
 @itemx --no-blinking-cursor
 @opindex --no-blinking-cursor
 @cindex blinking cursor disable, command-line argument
-Disable the blinking cursor on graphical terminals.
+Disable the blinking cursor on graphical displays.
 
 @item -D
 @opindex -D
--- a/man/commands.texi	Tue May 02 08:50:29 2006 +0000
+++ b/man/commands.texi	Wed May 10 20:42:41 2006 +0000
@@ -6,9 +6,9 @@
 @chapter Characters, Keys and Commands
 
   This chapter explains the character sets used by Emacs for input
-commands and for the contents of files, and also explains the concepts
-of @dfn{keys} and @dfn{commands}, which are fundamental for understanding
-how Emacs interprets your keyboard and mouse input.
+commands and for the contents of files, and the fundamental concepts of
+@dfn{keys} and @dfn{commands}, whereby Emacs interprets your keyboard
+and mouse input.
 @end iftex
 
 @ifnottex
@@ -35,11 +35,11 @@
 for short).  @kbd{C-a} gets its name from the fact that you type it by
 holding down the @key{CTRL} key while pressing @kbd{a}.
 
-  Some @acronym{ASCII} control characters have special names, and most terminals
-have special keys you can type them with: for example, @key{RET},
-@key{TAB}, @key{DEL} and @key{ESC}.  The space character is usually
-referred to below as @key{SPC}, even though strictly speaking it is a
-graphic character whose graphic happens to be blank.
+  Some @acronym{ASCII} control characters have special names, and most
+terminals have special keys you can type them with: for example,
+@key{RET}, @key{TAB}, @key{DEL} and @key{ESC}.  The space character is
+usually known as @key{SPC}, even though strictly speaking it is a
+graphic character that is blank.
 
   Emacs extends the @acronym{ASCII} character set with thousands more printing
 characters (@pxref{International}), additional control characters, and a
@@ -51,11 +51,11 @@
 @kbd{C-a} and @kbd{C-A} are the same character, and Emacs cannot
 distinguish them.
 
-  But the Emacs character set has room for control variants of all
-printing characters, and for distinguishing between @kbd{C-a} and
-@kbd{C-A}.  Graphical terminals make it possible to enter all these
-characters.  For example, @kbd{C--} (that's Control-Minus) and
-@kbd{C-5} are meaningful Emacs commands on a graphical terminal.
+  The Emacs character set has room for control variants of all
+printing characters, and distinguishes @kbd{C-A} from @kbd{C-a}.
+Graphical terminals make it possible to enter all these characters.
+For example, @kbd{C--} (that's Control-Minus) and @kbd{C-5} are
+meaningful Emacs commands on a graphical terminal.
 
   Another Emacs character-set extension is additional modifier bits.
 Only one modifier bit is commonly used; it is called Meta.  Every
@@ -106,10 +106,10 @@
 because the first one goes to work on the @kbd{C-x}.)
 
   Keyboard input includes keyboard keys that are not characters at
-all: for example function keys and arrow keys.  Mouse buttons are also
-outside the gamut of characters.  However, you can modify these events
-with the modifier keys @key{CTRL}, @key{META}, @key{SUPER},
-@key{HYPER} and @key{ALT}, just as you can modify keyboard characters.
+all, such as function keys and arrow keys.  Mouse buttons are also not
+characters.  However, you can modify these events with the modifier
+keys @key{CTRL}, @key{META}, @key{SUPER}, @key{HYPER} and @key{ALT},
+just like keyboard characters.
 
 @cindex input event
   Input characters and non-character inputs are collectively called
@@ -121,7 +121,7 @@
   @acronym{ASCII} terminals cannot really send anything to the computer except
 @acronym{ASCII} characters.  These terminals use a sequence of characters to
 represent each function key.  But that is invisible to the Emacs user,
-because the keyboard input routines recognize these special sequences
+because the keyboard input routines catch these special sequences
 and convert them to function key events before any other part of Emacs
 gets to see them.
 
@@ -131,9 +131,9 @@
 @cindex key sequence
 @cindex key
   A @dfn{key sequence} (@dfn{key}, for short) is a sequence of input
-events that are meaningful as a unit---as ``a single command.''  Some
-Emacs command sequences are just one character or one event; for
-example, just @kbd{C-f} is enough to move forward one character in the
+events that is meaningful as a unit---a ``single command.''  Some
+Emacs command sequences are invoked by just one character or one
+event; for example, just @kbd{C-f} moves forward one character in the
 buffer.  But Emacs also has commands that take two or more events to
 invoke.
 
@@ -158,33 +158,33 @@
 sequences.  There's no limit to the length of a key sequence, but in
 practice people rarely use sequences longer than four events.
 
-  By contrast, you can't add more events onto a complete key.  For
-example, the two-event sequence @kbd{C-f C-k} is not a key, because
-the @kbd{C-f} is a complete key in itself.  It's impossible to give
-@kbd{C-f C-k} an independent meaning as a command.  @kbd{C-f C-k} is two
-key sequences, not one.@refill
+  You can't add input events onto a complete key.  For example, the
+two-event sequence @kbd{C-f C-k} is not a key, because the @kbd{C-f}
+is a complete key in itself.  It's impossible to give @kbd{C-f C-k} an
+independent meaning as a command.  @kbd{C-f C-k} is two key sequences,
+not one.@refill
 
   All told, the prefix keys in Emacs are @kbd{C-c}, @kbd{C-h},
 @kbd{C-x}, @kbd{C-x @key{RET}}, @kbd{C-x @@}, @kbd{C-x a}, @kbd{C-x
 n}, @w{@kbd{C-x r}}, @kbd{C-x v}, @kbd{C-x 4}, @kbd{C-x 5}, @kbd{C-x
 6}, @key{ESC}, @kbd{M-g}, and @kbd{M-o}.  (@key{F1} and @key{F2} are
-aliases for @kbd{C-h} and @kbd{C-x 6}.)  But this list is not cast in
-concrete; it is just a matter of Emacs's standard key bindings.  If
-you customize Emacs, you can make new prefix keys, or eliminate some
-of the standard ones.  @xref{Key Bindings}.
+aliases for @kbd{C-h} and @kbd{C-x 6}.)  This list is not cast in stone;
+it describes the standard key bindings.  If you customize Emacs, you can make
+new prefix keys, or eliminate some of the standard ones (not
+recommended for most users).  @xref{Key Bindings}.
 
-  If you do make or eliminate prefix keys, that changes the set of
+  If you make or eliminate prefix keys, that changes the set of
 possible key sequences.  For example, if you redefine @kbd{C-f} as a
-prefix, @kbd{C-f C-k} automatically becomes a key (complete, unless you
-define that too as a prefix).  Conversely, if you remove the prefix
-definition of @kbd{C-x 4}, then @kbd{C-x 4 f} (or @kbd{C-x 4
-@var{anything}}) is no longer a key.
+prefix, @kbd{C-f C-k} automatically becomes a key (complete, unless
+you define that too as a prefix).  Conversely, if you remove the
+prefix definition of @kbd{C-x 4}, then @kbd{C-x 4 f} and @kbd{C-x 4
+@var{anything}} are no longer keys.
 
   Typing the help character (@kbd{C-h} or @key{F1}) after a prefix key
 displays a list of the commands starting with that prefix.  There are
-a few prefix keys for which @kbd{C-h} does not work---for historical
+a few prefix keys after which @kbd{C-h} does not work---for historical
 reasons, they define other meanings for @kbd{C-h} which are painful to
-change.  But @key{F1} should work for all prefix keys.
+change.  @key{F1} works after all prefix keys.
 
 @node Commands, Text Characters, Keys, Top
 @section Keys and Commands
@@ -197,61 +197,65 @@
 Emacs assigns meanings to named @dfn{commands}, and then gives keys
 their meanings by @dfn{binding} them to commands.
 
-  Every command has a name chosen by a programmer.  The name is usually
-made of a few English words separated by dashes; for example,
+  Every command has a name chosen by a programmer.  The name is
+usually made of a few English words separated by dashes; for example,
 @code{next-line} or @code{forward-word}.  A command also has a
-@dfn{function definition} which is a Lisp program; this is what makes
-the command do what it does.  In Emacs Lisp, a command is actually a
-special kind of Lisp function; one which specifies how to read arguments
-for it and call it interactively.  For more information on commands and
-functions, see @ref{What Is a Function,, What Is a Function, elisp, The
-Emacs Lisp Reference Manual}.  (The definition we use in this manual is
-simplified slightly.)
+@dfn{function definition} which is a Lisp program; this is how the
+command does its work.  In Emacs Lisp, a command is a Lisp function with
+special options to read arguments and for interactive use.  For more
+information on commands and functions, see @ref{What Is a Function,,
+What Is a Function, elisp, The Emacs Lisp Reference Manual}.  (The
+definition here is simplified slightly.)
 
-  The bindings between keys and commands are recorded in various tables
-called @dfn{keymaps}.  @xref{Keymaps}.
+  The bindings between keys and commands are recorded in tables called
+@dfn{keymaps}.  @xref{Keymaps}.
 
   When we say that ``@kbd{C-n} moves down vertically one line'' we are
-glossing over a distinction that is irrelevant in ordinary use but is vital
-in understanding how to customize Emacs.  It is the command
-@code{next-line} that is programmed to move down vertically.  @kbd{C-n} has
-this effect @emph{because} it is bound to that command.  If you rebind
-@kbd{C-n} to the command @code{forward-word} then @kbd{C-n} will move
-forward by words instead.  Rebinding keys is a common method of
-customization.@refill
+glossing over a subtle distinction that is irrelevant in ordinary use,
+but vital for Emacs customization.  The command @code{next-line} does
+a vertical move downward.  @kbd{C-n} has this effect @emph{because} it
+is bound to @code{next-line}.  If you rebind @kbd{C-n} to the command
+@code{forward-word}, @kbd{C-n} will move forward one word instead.
+Rebinding keys is an important method of customization.
 
   In the rest of this manual, we usually ignore this distinction to
 keep things simple.  We will often speak of keys like @kbd{C-n} as
-commands, even though strictly speaking a key is bound to some
-command.  To give the information needed for customization, we state
-the name of the command which really does the work in parentheses
-after mentioning the key that runs it.  For example, we will say that
-``The command @kbd{C-n} (@code{next-line}) moves point vertically
-down,'' meaning that @code{next-line} is a command that moves
-vertically down, and @kbd{C-n} is a key that is normally bound to it.
+commands, even though strictly speaking the key is bound to a command.
+Usually we state the name of the command which really does the work in
+parentheses after mentioning the key that runs it.  For example, we
+will say that ``The command @kbd{C-n} (@code{next-line}) moves point
+vertically down,'' meaning that the command @code{next-line} moves
+vertically down, and the key @kbd{C-n} is normally bound to it.
 
-  While we are on the subject of information for customization only,
-it's a good time to tell you about @dfn{variables}.  Often the
-description of a command will say, ``To change this, set the variable
-@code{mumble-foo}.''  A variable is a name used to remember a value.
-Most of the variables documented in this manual exist just to facilitate
-customization: some command or other part of Emacs examines the variable
-and behaves differently according to the value that you set.  Until you
-are interested in customizing, you can ignore the information about
-variables.  When you are ready to be interested, read the basic
-information on variables, and then the information on individual
-variables will make sense.  @xref{Variables}.
+  Since we are discussing customization, we should tell you about
+@dfn{variables}.  Often the description of a command will say, ``To
+change this, set the variable @code{mumble-foo}.''  A variable is a
+name used to store a value.  Most of the variables documented in this
+manual are meant for customization: some command or other part of
+Emacs examines the variable and behaves differently according to the
+value that you set.  You can ignore the information about variables
+until you are interested in customizing them.  Then read the basic
+information on variables (@pxref{Variables}) and the information about
+specific variables will make sense.
 
 @node Text Characters, Entering Emacs, Commands, Top
 @section Character Set for Text
 @cindex characters (in text)
 
-  Text in Emacs buffers is a sequence of 8-bit bytes.  Each byte can
-hold a single @acronym{ASCII} character.  Both @acronym{ASCII} control characters (octal
-codes 000 through 037, and 0177) and @acronym{ASCII} printing characters (codes
-040 through 0176) are allowed; however, non-@acronym{ASCII} control characters
-cannot appear in a buffer.  The other modifier flags used in keyboard
-input, such as Meta, are not allowed in buffers either.
+  Text in Emacs buffers is a sequence of characters.  In the simplest
+case, these are @acronym{ASCII} characters, each stored in one 8-bit
+byte.  Both @acronym{ASCII} control characters (octal codes 000
+through 037, and 0177) and @acronym{ASCII} printing characters (codes
+040 through 0176) are allowed.  The other modifier flags used in
+keyboard input, such as Meta, are not allowed in buffers.
+
+  Non-@acronym{ASCII} printing characters can also appear in buffers,
+when multibyte characters are enabled.  They have character codes
+starting at 256, octal 0400, and each one is represented as a sequence
+of two or more bytes.  @xref{International}.  Single-byte characters
+with codes 128 through 255 can also appear in multibyte buffers.
+However, non-@acronym{ASCII} control characters cannot appear in a
+buffer.
 
   Some @acronym{ASCII} control characters serve special purposes in text, and have
 special names.  For example, the newline character (octal code 012) is
@@ -259,16 +263,9 @@
 is used for indenting to the next tab stop column (normally every 8
 columns).  @xref{Text Display}.
 
-  Non-@acronym{ASCII} printing characters can also appear in buffers.  When
-multibyte characters are enabled, you can use any of the non-@acronym{ASCII}
-printing characters that Emacs supports.  They have character codes
-starting at 256, octal 0400, and each one is represented as a sequence
-of two or more bytes.  @xref{International}.  Single-byte characters
-with codes 128 through 255 can also appear in multibyte buffers.
-
   If you disable multibyte characters, then you can use only one
-alphabet of non-@acronym{ASCII} characters, but they all fit in one byte.  They
-use codes 0200 through 0377.  @xref{Unibyte Mode}.
+alphabet of non-@acronym{ASCII} characters, which all fit in one byte.
+They use octal codes 0200 through 0377.  @xref{Unibyte Mode}.
 
 @ifnottex
 @lowersections
--- a/man/custom.texi	Tue May 02 08:50:29 2006 +0000
+++ b/man/custom.texi	Wed May 10 20:42:41 2006 +0000
@@ -1977,11 +1977,12 @@
 @subsection Disabling Commands
 @cindex disabled command
 
-  Disabling a command menas it requires confirmation before it can be
-executed.  The purpose of disabling a command is to prevent users from
-executing it by accident and being confused.
-
-  An attempt to invoke a disabled command interactively in Emacs
+  Disabling a command means that invoking it interactively asks for
+confirmation from the user.  The purpose of disabling a command is to
+prevent users from executing it by accident; we do this for commands
+that might be confusing to the uninitiated.
+
+  Attempting to invoke a disabled command interactively in Emacs
 displays a window containing the command's name, its documentation,
 and some instructions on what to do immediately; then Emacs asks for
 input saying whether to execute the command as requested, enable it
@@ -2021,8 +2022,8 @@
 
   Whether a command is disabled is independent of what key is used to
 invoke it; disabling also applies if the command is invoked using
-@kbd{M-x}.  Disabling a command has no effect on calling it as a
-function from Lisp programs.
+@kbd{M-x}.  However, disabling a command has no effect on calling it
+as a function from Lisp programs.
 
 @node Syntax
 @section The Syntax Table
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/man/dired-xtra.texi	Wed May 10 20:42:41 2006 +0000
@@ -0,0 +1,49 @@
+@c This is part of the Emacs manual.
+@c Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
+@c See file emacs.texi for copying conditions.
+@c
+@c This file is included either in emacs-xtra.texi (when producing the
+@c printed version) or in the main Emacs manual (for the on-line version).
+@node Subdir Switches
+@section Subdirectory Switches in Dired
+
+You can insert subdirectories with specified @code{ls} switches in
+Dired buffers, using @kbd{C-u i}.  You can change the @code{ls}
+switches of an already inserted subdirectory using @kbd{C-u l}.
+
+In Emacs versions 22.1 and later, Dired remembers the switches, so
+that reverting the buffer will not change them back to the main
+directory's switches.  Deleting a subdirectory forgets about its
+switches.
+
+Using @code{dired-undo} (usually bound to @kbd{C-_} and @kbd{C-x u})
+to reinsert or delete subdirectories, that were inserted with explicit
+switches, can bypass Dired's machinery for remembering (or forgetting)
+switches.  Deleting a subdirectory using @code{dired-undo} does not
+forget its switches.  When later reinserted using @kbd{i}, it will be
+reinserted using its old switches.  Using @code{dired-undo} to
+reinsert a subdirectory that was deleted using the regular
+Dired commands (not @code{dired-undo}) will originally insert it with
+its old switches.  However, reverting the buffer will relist it using
+the buffer's default switches.  If any of this yields problems, you
+can easily correct the situation using @kbd{C-u i} or @kbd{C-u l}.
+
+Dired does not remember the @code{R} switch.  Inserting a subdirectory
+with switches that include the @code{R} switch is equivalent with
+inserting each of its subdirectories using all remaining switches.
+For instance, updating or killing a subdirectory that was inserted
+with the @code{R} switch will not update or kill its subdirectories.
+
+The buffer's default switches do not affect subdirectories that were
+inserted using explicitly specified switches.  In particular,
+commands such as @kbd{s}, that change the buffer's switches do not
+affect such subdirectories.  (They do affect subdirectories without
+explicitly assigned switches, however.)
+
+You can make Dired forget about all subdirectory switches and relist
+all subdirectories with the buffer's default switches using
+@kbd{M-x dired-reset-subdir-switches}.  This also reverts the Dired buffer.
+
+@ignore
+   arch-tag: e3865701-9179-4ffb-bc34-d321111c688d
+@end ignore
--- a/man/dired.texi	Tue May 02 08:50:29 2006 +0000
+++ b/man/dired.texi	Wed May 10 20:42:41 2006 +0000
@@ -36,6 +36,9 @@
 * Transforming File Names::   Using patterns to rename multiple files.
 * Comparison in Dired::	      Running `diff' by way of Dired.
 * Subdirectories in Dired::   Adding subdirectories to the Dired buffer.
+@ifnottex
+* Subdir Switches::           Subdirectory switches in Dired.
+@end ifnottex
 * Subdirectory Motion::	      Moving across subdirectories, and up and down.
 * Hiding Subdirectories::     Making subdirectories visible or invisible.
 * Updating: Dired Updating.   Discarding lines for files of no interest.
@@ -906,6 +909,10 @@
 subdirectory's contents.  Use @kbd{C-u k} on the subdirectory header
 line to delete the subdirectory.  @xref{Dired Updating}.
 
+@ifnottex
+@include dired-xtra.texi
+@end ifnottex
+
 @node Subdirectory Motion
 @section Moving Over Subdirectories
 
@@ -1198,7 +1205,7 @@
 more stringent comparisons by entering a Lisp expression, which can
 refer to the variables @code{size1} and @code{size2}, the respective
 file sizes; @code{mtime1} and @code{mtime2}, the last modification
-times in seconds, as floating point numers; and @code{fa1} and
+times in seconds, as floating point numbers; and @code{fa1} and
 @code{fa2}, the respective file attribute lists (as returned by the
 function @code{file-attributes}).  This expression is evaluated for
 each pair of like-named files, and if the expression's value is
--- a/man/display.texi	Tue May 02 08:50:29 2006 +0000
+++ b/man/display.texi	Wed May 10 20:42:41 2006 +0000
@@ -1026,7 +1026,7 @@
 @cindex cursor, blinking
   You can customize the cursor's color, and whether it blinks, using
 the @code{cursor} Custom group (@pxref{Easy Customization}).  On
-graphical terminals, the command @kbd{M-x blink-cursor-mode} enables
+a graphical display, the command @kbd{M-x blink-cursor-mode} enables
 or disables the blinking of the cursor.  (On text terminals, the
 terminal itself blinks the cursor, and Emacs has no control over it.)
 You can control how the cursor appears when it blinks off by setting
@@ -1050,7 +1050,7 @@
 
 @vindex x-stretch-cursor
 @cindex wide block cursor
-  On graphical terminals, Emacs can optionally draw the block cursor
+  On graphical displays, Emacs can optionally draw the block cursor
 as wide as the character under the cursor---for example, if the cursor
 is on a tab character, it would cover the full width occupied by that
 tab character.  To enable this feature, set the variable
@@ -1127,7 +1127,7 @@
 
 @vindex indicate-buffer-boundaries
   On a graphical display, Emacs can indicate the buffer boundaries in
-the fringes.  It inddicates the first line and the last line with
+the fringes.  It indicates the first line and the last line with
 angle images in the fringes.  This can be combined with up and down
 arrow images which say whether it is possible to scroll the window up
 and down.
--- a/man/emacs-xtra.texi	Tue May 02 08:50:29 2006 +0000
+++ b/man/emacs-xtra.texi	Wed May 10 20:42:41 2006 +0000
@@ -55,18 +55,19 @@
 @end ifnottex
 
 @menu
-* Introduction::                  What documentation belongs here?
-* Autorevert::                    Auto Reverting non-file buffers.
-* Subdir Switches::               Subdirectory switches in Dired.
+* Introduction::        What documentation belongs here?
+@iftex
+* Picture Mode::        Editing pictures made up of characters using 
+                         the quarter-plane screen model.
+
+* Autorevert::          Auto Reverting non-file buffers.
+* Subdir Switches::     Subdirectory switches in Dired.
 * Advanced Calendar/Diary Usage:: Advanced Calendar/Diary customization.
-* Emerge::                        A convenient way of merging two versions
-                                    of a program.
-* Picture Mode::                  Editing pictures made up of characters
-                                    using the quarter-plane screen model.
-
-* Advanced VC Usage::             Advanced VC (version control) features.
-* Fortran::                       Fortran mode and its special features.
-* MS-DOG::                        
+* Emerge::              A convenient way of merging two versions of a program.
+* Advanced VC Usage::   Advanced VC (version control) features.
+* Fortran::             Fortran mode and its special features.
+* MS-DOS::              Using Emacs on MS-DOS (otherwise known as @dfn{MS-DOG}).
+@end iftex
 * Index::
 @end menu
 
@@ -74,3772 +75,44 @@
 @unnumbered Introduction
 
 This manual contains detailed information about various features that
-are too specialized to be included in the Emacs manual.  It is
+are too specialized to be included in the printed Emacs manual.  It is
 intended to be readable by anyone having a basic knowledge of Emacs.
 However, certain sections may be intended for a more specialized
 audience, such as Elisp authors.  This should be clearly pointed out
 at the beginning of these sections.
 
-This manual is intended as a complement, rather than an alternative,
-to other ways to gain a more detailed knowledge of Emacs than the
-Emacs manual can provide, such as browsing packages using @kbd{C-h p},
-accessing mode documentation using @kbd{C-h m} and browsing user
-options using Custom.  Also, certain packages, or collections of
-related features, have their own manuals.  The present manual is
-mainly intended to be a collection of smaller specialized features,
-too small to get their own manual.
+Certain packages, or collections of related features, have their own
+manuals, separate from the main Emacs User's manual.  This manual is
+intended as a complement, rather than an alternative, to reading those
+additional manuals; in a nutshell, it is a collection of smaller
+specialized features, too small or too obscure to justify their own
+manual.
 
 Sections intended specifically for Elisp programmers can follow the
 style of the Elisp manual.  Other sections should follow the style of
 the Emacs manual.
 
-@node Autorevert
-@chapter Auto Reverting non-file Buffers
-
-Normally Global Auto Revert Mode only reverts file buffers.  There are
-two ways to auto-revert certain non-file buffers: enabling Auto Revert
-Mode in those buffers (using @kbd{M-x auto-revert-mode}) and setting
-@code{global-auto-revert-non-file-buffers} to @code{t}.  The latter
-enables Auto Reverting for all types of buffers for which it is
-implemented, that is, for the types of buffers listed in the menu
-below.
-
-Like file buffers, non-file buffers should normally not revert while
-you are working on them, or while they contain information that might
-get lost after reverting.  Therefore, they do not revert if they are
-``modified''.  This can get tricky, because deciding when a non-file
-buffer should be marked modified is usually more difficult than for
-file buffers.
-
-Another tricky detail is that, for efficiency reasons, Auto Revert
-often does not try to detect all possible changes in the buffer, only
-changes that are ``major'' or easy to detect.  Hence, enabling
-auto-reverting for a non-file buffer does not always guarantee that
-all information in the buffer is up to date and does not necessarily
-make manual reverts useless.
-
-At the other extreme, certain buffers automatically auto-revert every
-@code{auto-revert-interval} seconds.  (This currently only applies to
-the Buffer Menu.)  In this case, Auto Revert does not print any
-messages while reverting, even when @code{auto-revert-verbose} is
-non-@code{nil}.
-
-The details depend on the particular types of buffers and are
-explained in the corresponding sections.
-
-@menu
-* Auto Reverting the Buffer Menu::
-* Auto Reverting Dired::
-* Supporting additional buffers::
-@end menu
-
-@node Auto Reverting the Buffer Menu
-@section Auto Reverting the Buffer Menu
-
-If auto-reverting of non-file buffers is enabled, the Buffer Menu
-automatically reverts every @code{auto-revert-interval} seconds,
-whether there is a need for it or not.  (It would probably take longer
-to check whether there is a need than to actually revert.)
-
-If the Buffer Menu inappropriately gets marked modified, just revert
-it manually using @kbd{g} and auto-reverting will resume.  However, if
-you marked certain buffers to get deleted or to be displayed, you have
-to be careful, because reverting erases all marks.  The fact that
-adding marks sets the buffer's modified flag prevents Auto Revert from
-automatically erasing the marks.
-
-@node Auto Reverting Dired
-@section Auto Reverting Dired buffers
-
-Auto-reverting Dired buffers currently works on GNU or Unix style
-operating systems.  It may not work satisfactorily on some other
-systems.
-
-Dired buffers only auto-revert when the file list of the buffer's main
-directory changes.  They do not auto-revert when information about a
-particular file changes or when inserted subdirectories change.  To be
-sure that @emph{all} listed information is up to date, you have to
-manually revert using @kbd{g}, @emph{even} if auto-reverting is
-enabled in the Dired buffer.  Sometimes, you might get the impression
-that modifying or saving files listed in the main directory actually
-does cause auto-reverting.  This is because making changes to a file,
-or saving it, very often causes changes in the directory itself, for
-instance, through backup files or auto-save files.  However, this is
-not guaranteed.
-
-If the Dired buffer is marked modified and there are no changes you
-want to protect, then most of the time you can make auto-reverting
-resume by manually reverting the buffer using @kbd{g}.  There is one
-exception.  If you flag or mark files, you can safely revert the
-buffer.  This will not erase the flags or marks (unless the marked
-file has been deleted, of course).  However, the buffer will stay
-modified, even after reverting, and auto-reverting will not resume.
-This is because, if you flag or mark files, you may be working on the
-buffer and you might not want the buffer to change without warning.
-If you want auto-reverting to resume in the presence of marks and
-flags, mark the buffer non-modified using @kbd{M-~}.  However, adding,
-deleting or changing marks or flags will mark it modified again.
-
-Remote Dired buffers are not auto-reverted.  Neither are Dired buffers
-for which you used shell wildcards or file arguments to list only some
-of the files.  @samp{*Find*} and @samp{*Locate*} buffers do not
-auto-revert either.
-
-@node Supporting additional buffers
-@section Adding Support for Auto-Reverting additional Buffers.
-
-This section is intended for Elisp programmers who would like to add
-support for auto-reverting new types of buffers.
-
-To support auto-reverting the buffer must first of all have a
-@code{revert-buffer-function}.  @xref{Definition of
-revert-buffer-function,, Reverting, elisp, the Emacs Lisp Reference Manual}.
-
-In addition, it @emph{must} have a @code{buffer-stale-function}.
-
-@defvar buffer-stale-function
-The value of this variable is a function to check whether a non-file
-buffer needs reverting.  This should be a function with one optional
-argument @var{noconfirm}.  The function should return non-@code{nil}
-if the buffer should be reverted.  The buffer is current when this
-function is called.
-
-While this function is mainly intended for use in auto-reverting, it
-could be used for other purposes as well.  For instance, if
-auto-reverting is not enabled, it could be used to warn the user that
-the buffer needs reverting.  The idea behind the @var{noconfirm}
-argument is that it should be @code{t} if the buffer is going to be
-reverted without asking the user and @code{nil} if the function is
-just going to be used to warn the user that the buffer is out of date.
-In particular, for use in auto-reverting, @var{noconfirm} is @code{t}.
-If the function is only going to be used for auto-reverting, you can
-ignore the @var{noconfirm} argument.
-
-If you just want to automatically auto-revert every
-@code{auto-revert-interval} seconds, use:
-
-@example
-(set (make-local-variable 'buffer-stale-function)
-     #'(lambda (&optional noconfirm) 'fast))
-@end example
-
-@noindent
-in the buffer's mode function.
-
-The special return value @samp{fast} tells the caller that the need
-for reverting was not checked, but that reverting the buffer is fast.
-It also tells Auto Revert not to print any revert messages, even if
-@code{auto-revert-verbose} is non-@code{nil}.  This is important, as
-getting revert messages every @code{auto-revert-interval} seconds can
-be very annoying.  The information provided by this return value could
-also be useful if the function is consulted for purposes other than
-auto-reverting.
-@end defvar
-
-Once the buffer has a @code{revert-buffer-function} and a
-@code{buffer-stale-function}, several problems usually remain.
-
-The buffer will only auto-revert if it is marked unmodified.  Hence,
-you will have to make sure that various functions mark the buffer
-modified if and only if either the buffer contains information that
-might be lost by reverting or there is reason to believe that the user
-might be inconvenienced by auto-reverting, because he is actively
-working on the buffer.  The user can always override this by manually
-adjusting the modified status of the buffer.  To support this, calling
-the @code{revert-buffer-function} on a buffer that is marked
-unmodified should always keep the buffer marked unmodified.
-
-It is important to assure that point does not continuously jump around
-as a consequence of auto-reverting.  Of course, moving point might be
-inevitable if the buffer radically changes.
-
-You should make sure that the @code{revert-buffer-function} does not
-print messages that unnecessarily duplicate Auto Revert's own messages
-if @code{auto-revert-verbose} is @code{t} and effectively override a
-@code{nil} value for @code{auto-revert-verbose}.  Hence, adapting a
-mode for auto-reverting often involves getting rid of such messages.
-This is especially important for buffers that automatically
-auto-revert every @code{auto-revert-interval} seconds.
-
-Also, you may want to update the documentation string of
-@code{global-auto-revert-non-file-buffers}.
-
-@ifinfo
-Finally, you should add a node to this chapter's menu.  This node
-@end ifinfo
-@ifnotinfo
-Finally, you should add a section to this chapter.  This section
-@end ifnotinfo
-should at the very least make clear whether enabling auto-reverting
-for the buffer reliably assures that all information in the buffer is
-completely up to date (or will be after @code{auto-revert-interval}
-seconds).
-
-@node Subdir Switches
-@chapter Subdirectory Switches in Dired
-
-You can insert subdirectories with specified @code{ls} switches in
-Dired buffers, using @kbd{C-u i}.  You can change the @code{ls}
-switches of an already inserted subdirectory using @kbd{C-u l}.
-
-In Emacs versions 22.1 and later, Dired remembers the switches, so
-that reverting the buffer will not change them back to the main
-directory's switches.  Deleting a subdirectory forgets about its
-switches.
-
-Using @code{dired-undo} (usually bound to @kbd{C-_} and @kbd{C-x u})
-to reinsert or delete subdirectories, that were inserted with explicit
-switches, can bypass Dired's machinery for remembering (or forgetting)
-switches.  Deleting a subdirectory using @code{dired-undo} does not
-forget its switches.  When later reinserted using @kbd{i}, it will be
-reinserted using its old switches.  Using @code{dired-undo} to
-reinsert a subdirectory that was deleted using the regular
-Dired commands (not @code{dired-undo}) will originally insert it with
-its old switches.  However, reverting the buffer will relist it using
-the buffer's default switches.  If any of this yields problems, you
-can easily correct the situation using @kbd{C-u i} or @kbd{C-u l}.
-
-Dired does not remember the @code{R} switch.  Inserting a subdirectory
-with switches that include the @code{R} switch is equivalent with
-inserting each of its subdirectories using all remaining switches.
-For instance, updating or killing a subdirectory that was inserted
-with the @code{R} switch will not update or kill its subdirectories.
-
-The buffer's default switches do not affect subdirectories that were
-inserted using explicitly specified switches.  In particular,
-commands such as @kbd{s}, that change the buffer's switches do not
-affect such subdirectories.  (They do affect subdirectories without
-explicitly assigned switches, however.)
-
-You can make Dired forget about all subdirectory switches and relist
-all subdirectories with the buffer's default switches using
-@kbd{M-x dired-reset-subdir-switches}.  This also reverts the Dired buffer.
-
-
-@c Moved here from the Emacs Lisp Reference Manual, 2005-03-26.
-@node Advanced Calendar/Diary Usage
-@chapter Customizing the Calendar and Diary
-
-  There are many customizations that you can use to make the calendar and
-diary suit your personal tastes.
-
-@menu
-* Calendar Customizing::   Defaults you can set.
-* Holiday Customizing::    Defining your own holidays.
-* Date Display Format::    Changing the format.
-* Time Display Format::    Changing the format.
-* Daylight Savings::       Changing the default.
-* Diary Customizing::      Defaults you can set.
-* Hebrew/Islamic Entries:: How to obtain them.
-* Fancy Diary Display::    Enhancing the diary display, sorting entries,
-                             using included diary files.
-* Sexp Diary Entries::     Fancy things you can do.
-@end menu
-
-@node Calendar Customizing
-@section Customizing the Calendar
-@vindex calendar-holiday-marker
-@vindex diary-entry-marker
-  The variable @code{calendar-holiday-marker} specifies how to mark a
-date as being a holiday.  Its value may be a single-character string
-to insert next to the date, or a face name to use for displaying the
-date.  Likewise, the variable @code{diary-entry-marker} specifies how
-to mark a date that has diary entries.  The calendar creates faces
-named @code{holiday-face} and @code{diary-face} for these purposes;
-those symbols are the default values of these variables.
-
-@vindex calendar-load-hook
-  The variable @code{calendar-load-hook} is a normal hook run when the
-calendar package is first loaded (before actually starting to display
-the calendar).
-
-@vindex initial-calendar-window-hook
-  Starting the calendar runs the normal hook
-@code{initial-calendar-window-hook}.  Recomputation of the calendar
-display does not run this hook.  But if you leave the calendar with the
-@kbd{q} command and reenter it, the hook runs again.@refill
-
-@vindex today-visible-calendar-hook
-  The variable @code{today-visible-calendar-hook} is a normal hook run
-after the calendar buffer has been prepared with the calendar when the
-current date is visible in the window.  One use of this hook is to
-replace today's date with asterisks; to do that, use the hook function
-@code{calendar-star-date}.
-
-@findex calendar-star-date
-@example
-(add-hook 'today-visible-calendar-hook 'calendar-star-date)
-@end example
-
-@noindent
-Another standard hook function marks the current date, either by
-changing its face or by adding an asterisk.  Here's how to use it:
-
-@findex calendar-mark-today
-@example
-(add-hook 'today-visible-calendar-hook 'calendar-mark-today)
-@end example
-
-@noindent
-@vindex calendar-today-marker
-The variable @code{calendar-today-marker} specifies how to mark
-today's date.  Its value should be a single-character string to insert
-next to the date or a face name to use for displaying the date.  A
-face named @code{calendar-today-face} is provided for this purpose;
-that symbol is the default for this variable.
-
-@vindex today-invisible-calendar-hook
-@noindent
-  A similar normal hook, @code{today-invisible-calendar-hook} is run if
-the current date is @emph{not} visible in the window.
-
-@vindex calendar-move-hook
-  Each of the calendar cursor motion commands runs the hook
-@code{calendar-move-hook} after it moves the cursor.
-
-@node Holiday Customizing
-@section Customizing the Holidays
-
-@vindex calendar-holidays
-@vindex christian-holidays
-@vindex hebrew-holidays
-@vindex islamic-holidays
-  Emacs knows about holidays defined by entries on one of several lists.
-You can customize these lists of holidays to your own needs, adding or
-deleting holidays.  The lists of holidays that Emacs uses are for
-general holidays (@code{general-holidays}), local holidays
-(@code{local-holidays}), Christian holidays (@code{christian-holidays}),
-Hebrew (Jewish) holidays (@code{hebrew-holidays}), Islamic (Muslim)
-holidays (@code{islamic-holidays}), and other holidays
-(@code{other-holidays}).
-
-@vindex general-holidays
-  The general holidays are, by default, holidays common throughout the
-United States.  To eliminate these holidays, set @code{general-holidays}
-to @code{nil}.
-
-@vindex local-holidays
-  There are no default local holidays (but sites may supply some).  You
-can set the variable @code{local-holidays} to any list of holidays, as
-described below.
-
-@vindex all-christian-calendar-holidays
-@vindex all-hebrew-calendar-holidays
-@vindex all-islamic-calendar-holidays
-  By default, Emacs does not include all the holidays of the religions
-that it knows, only those commonly found in secular calendars.  For a
-more extensive collection of religious holidays, you can set any (or
-all) of the variables @code{all-christian-calendar-holidays},
-@code{all-hebrew-calendar-holidays}, or
-@code{all-islamic-calendar-holidays} to @code{t}.  If you want to
-eliminate the religious holidays, set any or all of the corresponding
-variables @code{christian-holidays}, @code{hebrew-holidays}, and
-@code{islamic-holidays} to @code{nil}.@refill
-
-@vindex other-holidays
-  You can set the variable @code{other-holidays} to any list of
-holidays.  This list, normally empty, is intended for individual use.
-
-@cindex holiday forms
-  Each of the lists (@code{general-holidays}, @code{local-holidays},
-@code{christian-holidays}, @code{hebrew-holidays},
-@code{islamic-holidays}, and @code{other-holidays}) is a list of
-@dfn{holiday forms}, each holiday form describing a holiday (or
-sometimes a list of holidays).
-
-  Here is a table of the possible kinds of holiday form.  Day numbers
-and month numbers count starting from 1, but ``dayname'' numbers
-count Sunday as 0.  The element @var{string} is always the
-name of the holiday, as a string.
-
-@table @code
-@item (holiday-fixed @var{month} @var{day} @var{string})
-A fixed date on the Gregorian calendar.
-
-@item (holiday-float @var{month} @var{dayname} @var{k} @var{string})
-The @var{k}th @var{dayname} in @var{month} on the Gregorian calendar
-(@var{dayname}=0 for Sunday, and so on); negative @var{k} means count back
-from the end of the month.
-
-@item (holiday-hebrew @var{month} @var{day} @var{string})
-A fixed date on the Hebrew calendar.
-
-@item (holiday-islamic @var{month} @var{day} @var{string})
-A fixed date on the Islamic calendar.
-
-@item (holiday-julian @var{month} @var{day} @var{string})
-A fixed date on the Julian calendar.
-
-@item (holiday-sexp @var{sexp} @var{string})
-A date calculated by the Lisp expression @var{sexp}.  The expression
-should use the variable @code{year} to compute and return the date of a
-holiday, or @code{nil} if the holiday doesn't happen this year.  The
-value of @var{sexp} must represent the date as a list of the form
-@code{(@var{month} @var{day} @var{year})}.
-
-@item (if @var{condition} @var{holiday-form})
-A holiday that happens only if @var{condition} is true.
-
-@item (@var{function} @r{[}@var{args}@r{]})
-A list of dates calculated by the function @var{function}, called with
-arguments @var{args}.
-@end table
-
-  For example, suppose you want to add Bastille Day, celebrated in
-France on July 14.  You can do this as follows:
-
-@smallexample
-(setq other-holidays '((holiday-fixed 7 14 "Bastille Day")))
-@end smallexample
-
-@noindent
-The holiday form @code{(holiday-fixed 7 14 "Bastille Day")} specifies the
-fourteenth day of the seventh month (July).
-
-  Many holidays occur on a specific day of the week, at a specific time
-of month.  Here is a holiday form describing Hurricane Supplication Day,
-celebrated in the Virgin Islands on the fourth Monday in August:
-
-@smallexample
-(holiday-float 8 1 4 "Hurricane Supplication Day")
-@end smallexample
-
-@noindent
-Here the 8 specifies August, the 1 specifies Monday (Sunday is 0,
-Tuesday is 2, and so on), and the 4 specifies the fourth occurrence in
-the month (1 specifies the first occurrence, 2 the second occurrence,
-@minus{}1 the last occurrence, @minus{}2 the second-to-last occurrence, and
-so on).
-
-  You can specify holidays that occur on fixed days of the Hebrew,
-Islamic, and Julian calendars too.  For example,
-
-@smallexample
-(setq other-holidays
-      '((holiday-hebrew 10 2 "Last day of Hanukkah")
-        (holiday-islamic 3 12 "Mohammed's Birthday")
-        (holiday-julian 4 2 "Jefferson's Birthday")))
-@end smallexample
-
-@noindent
-adds the last day of Hanukkah (since the Hebrew months are numbered with
-1 starting from Nisan), the Islamic feast celebrating Mohammed's
-birthday (since the Islamic months are numbered from 1 starting with
-Muharram), and Thomas Jefferson's birthday, which is 2 April 1743 on the
-Julian calendar.
-
-  To include a holiday conditionally, use either Emacs Lisp's @code{if} or the
-@code{holiday-sexp} form.  For example, American presidential elections
-occur on the first Tuesday after the first Monday in November of years
-divisible by 4:
-
-@smallexample
-(holiday-sexp '(if (= 0 (% year 4))
-                   (calendar-gregorian-from-absolute
-                    (1+ (calendar-dayname-on-or-before
-                          1 (+ 6 (calendar-absolute-from-gregorian
-                                  (list 11 1 year)))))))
-              "US Presidential Election")
-@end smallexample
-
-@noindent
-or
-
-@smallexample
-(if (= 0 (% displayed-year 4))
-    (fixed 11
-           (extract-calendar-day
-             (calendar-gregorian-from-absolute
-               (1+ (calendar-dayname-on-or-before
-                     1 (+ 6 (calendar-absolute-from-gregorian
-                              (list 11 1 displayed-year)))))))
-           "US Presidential Election"))
-@end smallexample
-
-  Some holidays just don't fit into any of these forms because special
-calculations are involved in their determination.  In such cases you
-must write a Lisp function to do the calculation.  To include eclipses,
-for example, add @code{(eclipses)} to @code{other-holidays}
-and write an Emacs Lisp function @code{eclipses} that returns a
-(possibly empty) list of the relevant Gregorian dates among the range
-visible in the calendar window, with descriptive strings, like this:
-
-@smallexample
-(((6 27 1991) "Lunar Eclipse") ((7 11 1991) "Solar Eclipse") ... )
-@end smallexample
-
-@node Date Display Format
-@section Date Display Format
-@vindex calendar-date-display-form
-
-  You can customize the manner of displaying dates in the diary, in mode
-lines, and in messages by setting @code{calendar-date-display-form}.
-This variable holds a list of expressions that can involve the variables
-@code{month}, @code{day}, and @code{year}, which are all numbers in
-string form, and @code{monthname} and @code{dayname}, which are both
-alphabetic strings.  In the American style, the default value of this
-list is as follows:
-
-@smallexample
-((if dayname (concat dayname ", ")) monthname " " day ", " year)
-@end smallexample
-
-@noindent
-while in the European style this value is the default:
-
-@smallexample
-((if dayname (concat dayname ", ")) day " " monthname " " year)
-@end smallexample
-
-@noindent
-The ISO standard date representation is this:
-
-@smallexample
-(year "-" month "-" day)
-@end smallexample
-
-@noindent
-This specifies a typical American format:
-
-@smallexample
-(month "/" day "/" (substring year -2))
-@end smallexample
-
-@node Time Display Format
-@section Time Display Format
-@vindex calendar-time-display-form
-
-  The calendar and diary by default display times of day in the
-conventional American style with the hours from 1 through 12, minutes,
-and either @samp{am} or @samp{pm}.  If you prefer the European style,
-also known in the US as military, in which the hours go from 00 to 23,
-you can alter the variable @code{calendar-time-display-form}.  This
-variable is a list of expressions that can involve the variables
-@code{12-hours}, @code{24-hours}, and @code{minutes}, which are all
-numbers in string form, and @code{am-pm} and @code{time-zone}, which are
-both alphabetic strings.  The default value of
-@code{calendar-time-display-form} is as follows:
-
-@smallexample
-(12-hours ":" minutes am-pm
-          (if time-zone " (") time-zone (if time-zone ")"))
-@end smallexample
-
-@noindent
-Here is a value that provides European style times:
-
-@smallexample
-(24-hours ":" minutes
-          (if time-zone " (") time-zone (if time-zone ")"))
-@end smallexample
-
-@node Daylight Savings
-@section Daylight Savings Time
-@cindex daylight savings time
-
-  Emacs understands the difference between standard time and daylight
-savings time---the times given for sunrise, sunset, solstices,
-equinoxes, and the phases of the moon take that into account.  The rules
-for daylight savings time vary from place to place and have also varied
-historically from year to year.  To do the job properly, Emacs needs to
-know which rules to use.
-
-  Some operating systems keep track of the rules that apply to the place
-where you are; on these systems, Emacs gets the information it needs
-from the system automatically.  If some or all of this information is
-missing, Emacs fills in the gaps with the rules currently used in
-Cambridge, Massachusetts, which is the center of GNU's world.
-
-
-@vindex calendar-daylight-savings-starts
-@vindex calendar-daylight-savings-ends
-  If the default choice of rules is not appropriate for your location,
-you can tell Emacs the rules to use by setting the variables
-@code{calendar-daylight-savings-starts} and
-@code{calendar-daylight-savings-ends}.  Their values should be Lisp
-expressions that refer to the variable @code{year}, and evaluate to the
-Gregorian date on which daylight savings time starts or (respectively)
-ends, in the form of a list @code{(@var{month} @var{day} @var{year})}.
-The values should be @code{nil} if your area does not use daylight
-savings time.
-
-  Emacs uses these expressions to determine the start and end dates of
-daylight savings time as holidays and for correcting times of day in the
-solar and lunar calculations.
-
-  The values for Cambridge, Massachusetts are as follows:
-
-@example
-@group
-(calendar-nth-named-day 1 0 4 year)
-(calendar-nth-named-day -1 0 10 year)
-@end group
-@end example
-
-@noindent
-i.e., the first 0th day (Sunday) of the fourth month (April) in
-the year specified by @code{year}, and the last Sunday of the tenth month
-(October) of that year.  If daylight savings time were
-changed to start on October 1, you would set
-@code{calendar-daylight-savings-starts} to this:
-
-@example
-(list 10 1 year)
-@end example
-
-  For a more complex example, suppose daylight savings time begins on
-the first of Nisan on the Hebrew calendar.  You should set
-@code{calendar-daylight-savings-starts} to this value:
-
-@example
-(calendar-gregorian-from-absolute
-  (calendar-absolute-from-hebrew
-    (list 1 1 (+ year 3760))))
-@end example
-
-@noindent
-because Nisan is the first month in the Hebrew calendar and the Hebrew
-year differs from the Gregorian year by 3760 at Nisan.
-
-  If there is no daylight savings time at your location, or if you want
-all times in standard time, set @code{calendar-daylight-savings-starts}
-and @code{calendar-daylight-savings-ends} to @code{nil}.
-
-@vindex calendar-daylight-time-offset
-  The variable @code{calendar-daylight-time-offset} specifies the
-difference between daylight savings time and standard time, measured in
-minutes.  The value for Cambridge is 60.
-
-@vindex calendar-daylight-savings-starts-time
-@vindex calendar-daylight-savings-ends-time
-  The variable @code{calendar-daylight-savings-starts-time} and the
-variable @code{calendar-daylight-savings-ends-time} specify the number
-of minutes after midnight local time when the transition to and from
-daylight savings time should occur.  For Cambridge, both variables'
-values are 120.
-
-@node Diary Customizing
-@section Customizing the Diary
-
-@vindex holidays-in-diary-buffer
-  Ordinarily, the mode line of the diary buffer window indicates any
-holidays that fall on the date of the diary entries.  The process of
-checking for holidays can take several seconds, so including holiday
-information delays the display of the diary buffer noticeably.  If you'd
-prefer to have a faster display of the diary buffer but without the
-holiday information, set the variable @code{holidays-in-diary-buffer} to
-@code{nil}.@refill
-
-@vindex number-of-diary-entries
-  The variable @code{number-of-diary-entries} controls the number of
-days of diary entries to be displayed at one time.  It affects the
-initial display when @code{view-diary-entries-initially} is @code{t}, as
-well as the command @kbd{M-x diary}.  For example, the default value is
-1, which says to display only the current day's diary entries.  If the
-value is 2, both the current day's and the next day's entries are
-displayed.  The value can also be a vector of seven elements: for
-example, if the value is @code{[0 2 2 2 2 4 1]} then no diary entries
-appear on Sunday, the current date's and the next day's diary entries
-appear Monday through Thursday, Friday through Monday's entries appear
-on Friday, while on Saturday only that day's entries appear.
-
-@vindex print-diary-entries-hook
-@findex print-diary-entries
-  The variable @code{print-diary-entries-hook} is a normal hook run
-after preparation of a temporary buffer containing just the diary
-entries currently visible in the diary buffer.  (The other, irrelevant
-diary entries are really absent from the temporary buffer; in the diary
-buffer, they are merely hidden.)  The default value of this hook does
-the printing with the command @code{lpr-buffer}.  If you want to use a
-different command to do the printing, just change the value of this
-hook.  Other uses might include, for example, rearranging the lines into
-order by day and time.
-
-@vindex diary-date-forms
-  You can customize the form of dates in your diary file, if neither the
-standard American nor European styles suits your needs, by setting the
-variable @code{diary-date-forms}.  This variable is a list of patterns
-for recognizing a date.  Each date pattern is a list whose elements may
-be regular expressions (@pxref{Regular Expressions,,, elisp, the Emacs
-Lisp Reference Manual}) or the symbols @code{month}, @code{day},
-@code{year}, @code{monthname}, and @code{dayname}.  All these elements
-serve as patterns that match certain kinds of text in the diary file.
-In order for the date pattern, as a whole, to match, all of its elements
-must match consecutively.
-
-  A regular expression in a date pattern matches in its usual fashion,
-using the standard syntax table altered so that @samp{*} is a word
-constituent.
-
-  The symbols @code{month}, @code{day}, @code{year}, @code{monthname},
-and @code{dayname} match the month number, day number, year number,
-month name, and day name of the date being considered.  The symbols that
-match numbers allow leading zeros; those that match names allow
-three-letter abbreviations and capitalization.  All the symbols can
-match @samp{*}; since @samp{*} in a diary entry means ``any day'', ``any
-month'', and so on, it should match regardless of the date being
-considered.
-
-  The default value of @code{diary-date-forms} in the American style is
-this:
-
-@example
-((month "/" day "[^/0-9]")
- (month "/" day "/" year "[^0-9]")
- (monthname " *" day "[^,0-9]")
- (monthname " *" day ", *" year "[^0-9]")
- (dayname "\\W"))
-@end example
-
-  The date patterns in the list must be @emph{mutually exclusive} and
-must not match any portion of the diary entry itself, just the date and
-one character of whitespace.  If, to be mutually exclusive, the pattern
-must match a portion of the diary entry text---beyond the whitespace
-that ends the date---then the first element of the date pattern
-@emph{must} be @code{backup}.  This causes the date recognizer to back
-up to the beginning of the current word of the diary entry, after
-finishing the match.  Even if you use @code{backup}, the date pattern
-must absolutely not match more than a portion of the first word of the
-diary entry.  The default value of @code{diary-date-forms} in the
-European style is this list:
-
-@example
-((day "/" month "[^/0-9]")
- (day "/" month "/" year "[^0-9]")
- (backup day " *" monthname "\\W+\\<[^*0-9]")
- (day " *" monthname " *" year "[^0-9]")
- (dayname "\\W"))
-@end example
-
-@noindent
-Notice the use of @code{backup} in the third pattern, because it needs
-to match part of a word beyond the date itself to distinguish it from
-the fourth pattern.
-
-@node Hebrew/Islamic Entries
-@section Hebrew- and Islamic-Date Diary Entries
-
-  Your diary file can have entries based on Hebrew or Islamic dates, as
-well as entries based on the world-standard Gregorian calendar.
-However, because recognition of such entries is time-consuming and most
-people don't use them, you must explicitly enable their use.  If you
-want the diary to recognize Hebrew-date diary entries, for example,
-you must do this:
-
-@vindex nongregorian-diary-listing-hook
-@vindex nongregorian-diary-marking-hook
-@findex list-hebrew-diary-entries
-@findex mark-hebrew-diary-entries
-@smallexample
-(add-hook 'nongregorian-diary-listing-hook 'list-hebrew-diary-entries)
-(add-hook 'nongregorian-diary-marking-hook 'mark-hebrew-diary-entries)
-@end smallexample
-
-@noindent
-If you want Islamic-date entries, do this:
-
-@findex list-islamic-diary-entries
-@findex mark-islamic-diary-entries
-@smallexample
-(add-hook 'nongregorian-diary-listing-hook 'list-islamic-diary-entries)
-(add-hook 'nongregorian-diary-marking-hook 'mark-islamic-diary-entries)
-@end smallexample
-
-  Hebrew- and Islamic-date diary entries have the same formats as
-Gregorian-date diary entries, except that @samp{H} precedes a Hebrew
-date and @samp{I} precedes an Islamic date.  Moreover, because the
-Hebrew and Islamic month names are not uniquely specified by the first
-three letters, you may not abbreviate them.  For example, a diary entry
-for the Hebrew date Heshvan 25 could look like this:
-
-@smallexample
-HHeshvan 25 Happy Hebrew birthday!
-@end smallexample
-
-@noindent
-and would appear in the diary for any date that corresponds to Heshvan 25
-on the Hebrew calendar.  And here is an Islamic-date diary entry that matches
-Dhu al-Qada 25:
-
-@smallexample
-IDhu al-Qada 25 Happy Islamic birthday!
-@end smallexample
-
-  As with Gregorian-date diary entries, Hebrew- and Islamic-date entries
-are nonmarking if they are preceded with an ampersand (@samp{&}).
-
-  Here is a table of commands used in the calendar to create diary entries
-that match the selected date and other dates that are similar in the Hebrew
-or Islamic calendar:
-
-@table @kbd
-@item i h d
-Add a diary entry for the Hebrew date corresponding to the selected date
-(@code{insert-hebrew-diary-entry}).
-@item i h m
-Add a diary entry for the day of the Hebrew month corresponding to the
-selected date (@code{insert-monthly-hebrew-diary-entry}).  This diary
-entry matches any date that has the same Hebrew day-within-month as the
-selected date.
-@item i h y
-Add a diary entry for the day of the Hebrew year corresponding to the
-selected date (@code{insert-yearly-hebrew-diary-entry}).  This diary
-entry matches any date which has the same Hebrew month and day-within-month
-as the selected date.
-@item i i d
-Add a diary entry for the Islamic date corresponding to the selected date
-(@code{insert-islamic-diary-entry}).
-@item i i m
-Add a diary entry for the day of the Islamic month corresponding to the
-selected date (@code{insert-monthly-islamic-diary-entry}).
-@item i i y
-Add a diary entry for the day of the Islamic year corresponding to the
-selected date (@code{insert-yearly-islamic-diary-entry}).
-@end table
-
-@findex insert-hebrew-diary-entry
-@findex insert-monthly-hebrew-diary-entry
-@findex insert-yearly-hebrew-diary-entry
-@findex insert-islamic-diary-entry
-@findex insert-monthly-islamic-diary-entry
-@findex insert-yearly-islamic-diary-entry
-  These commands work much like the corresponding commands for ordinary
-diary entries: they apply to the date that point is on in the calendar
-window, and what they do is insert just the date portion of a diary entry
-at the end of your diary file.  You must then insert the rest of the
-diary entry.
-
-@node Fancy Diary Display
-@section Fancy Diary Display
-@vindex diary-display-hook
-@findex simple-diary-display
-
-  Diary display works by preparing the diary buffer and then running the
-hook @code{diary-display-hook}.  The default value of this hook
-(@code{simple-diary-display}) hides the irrelevant diary entries and
-then displays the buffer.  However, if you specify the hook as follows,
-
-@cindex diary buffer
-@findex fancy-diary-display
-@example
-(add-hook 'diary-display-hook 'fancy-diary-display)
-@end example
-
-@noindent
-this enables fancy diary display.  It displays diary entries and
-holidays by copying them into a special buffer that exists only for the
-sake of display.  Copying to a separate buffer provides an opportunity
-to change the displayed text to make it prettier---for example, to sort
-the entries by the dates they apply to.
-
-  As with simple diary display, you can print a hard copy of the buffer
-with @code{print-diary-entries}.  To print a hard copy of a day-by-day
-diary for a week, position point on Sunday of that week, type
-@kbd{7 d}, and then do @kbd{M-x print-diary-entries}.  As usual, the
-inclusion of the holidays slows down the display slightly; you can speed
-things up by setting the variable @code{holidays-in-diary-buffer} to
-@code{nil}.
-
-@vindex diary-list-include-blanks
-  Ordinarily, the fancy diary buffer does not show days for which there are
-no diary entries, even if that day is a holiday.  If you want such days to be
-shown in the fancy diary buffer, set the variable
-@code{diary-list-include-blanks} to @code{t}.@refill
-
-@cindex sorting diary entries
-  If you use the fancy diary display, you can use the normal hook
-@code{list-diary-entries-hook} to sort each day's diary entries by their
-time of day.  Here's how:
-
-@findex sort-diary-entries
-@example
-(add-hook 'list-diary-entries-hook 'sort-diary-entries t)
-@end example
-
-@noindent
-For each day, this sorts diary entries that begin with a recognizable
-time of day according to their times.  Diary entries without times come
-first within each day.
-
-  Fancy diary display also has the ability to process included diary
-files.  This permits a group of people to share a diary file for events
-that apply to all of them.  Lines in the diary file of this form:
-
-@smallexample
-#include "@var{filename}"
-@end smallexample
-
-@noindent
-includes the diary entries from the file @var{filename} in the fancy
-diary buffer.  The include mechanism is recursive, so that included files
-can include other files, and so on; you must be careful not to have a
-cycle of inclusions, of course.  Here is how to enable the include
-facility:
-
-@vindex list-diary-entries-hook
-@vindex mark-diary-entries-hook
-@findex include-other-diary-files
-@findex mark-included-diary-files
-@smallexample
-(add-hook 'list-diary-entries-hook 'include-other-diary-files)
-(add-hook 'mark-diary-entries-hook 'mark-included-diary-files)
-@end smallexample
-
-The include mechanism works only with the fancy diary display, because
-ordinary diary display shows the entries directly from your diary file.
-
-@node Sexp Diary Entries
-@section Sexp Entries and the Fancy Diary Display
-@cindex sexp diary entries
-
-  Sexp diary entries allow you to do more than just have complicated
-conditions under which a diary entry applies.  If you use the fancy
-diary display, sexp entries can generate the text of the entry depending
-on the date itself.  For example, an anniversary diary entry can insert
-the number of years since the anniversary date into the text of the
-diary entry.  Thus the @samp{%d} in this dairy entry:
-
-@findex diary-anniversary
-@smallexample
-%%(diary-anniversary 10 31 1948) Arthur's birthday (%d years old)
-@end smallexample
-
-@noindent
-gets replaced by the age, so on October 31, 1990 the entry appears in
-the fancy diary buffer like this:
-
-@smallexample
-Arthur's birthday (42 years old)
-@end smallexample
-
-@noindent
-If the diary file instead contains this entry:
-
-@smallexample
-%%(diary-anniversary 10 31 1948) Arthur's %d%s birthday
-@end smallexample
-
-@noindent
-the entry in the fancy diary buffer for October 31, 1990 appears like this:
-
-@smallexample
-Arthur's 42nd birthday
-@end smallexample
-
-  Similarly, cyclic diary entries can interpolate the number of repetitions
-that have occurred:
+@iftex
+@c ``Picture Mode'' is a chapter, not a section, so it's outside @raisesections.
+@include picture-xtra.texi
 
-@findex diary-cyclic
-@smallexample
-%%(diary-cyclic 50 1 1 1990) Renew medication (%d%s time)
-@end smallexample
-
-@noindent
-looks like this:
-
-@smallexample
-Renew medication (5th time)
-@end smallexample
-
-@noindent
-in the fancy diary display on September 8, 1990.
-
-  There is an early reminder diary sexp that includes its entry in the
-diary not only on the date of occurrence, but also on earlier dates.
-For example, if you want a reminder a week before your anniversary, you
-can use
-
-@findex diary-remind
-@smallexample
-%%(diary-remind '(diary-anniversary 12 22 1968) 7) Ed's anniversary
-@end smallexample
-
-@noindent
-and the fancy diary will show
-@smallexample
-Ed's anniversary
-@end smallexample
-@noindent
-both on December 15 and on December 22.
-
-@findex diary-date
-  The function @code{diary-date} applies to dates described by a month,
-day, year combination, each of which can be an integer, a list of
-integers, or @code{t}. The value @code{t} means all values.  For
-example,
-
-@smallexample
-%%(diary-date '(10 11 12) 22 t) Rake leaves
-@end smallexample
-
-@noindent
-causes the fancy diary to show
-
-@smallexample
-Rake leaves
-@end smallexample
-
-@noindent
-on October 22, November 22, and December 22 of every year.
-
-@findex diary-float
-  The function @code{diary-float} allows you to describe diary entries
-that apply to dates like the third Friday of November, or the last
-Tuesday in April.  The parameters are the @var{month}, @var{dayname},
-and an index @var{n}. The entry appears on the @var{n}th @var{dayname}
-of @var{month}, where @var{dayname}=0 means Sunday, 1 means Monday, and
-so on.  If @var{n} is negative it counts backward from the end of
-@var{month}.  The value of @var{month} can be a list of months, a single
-month, or @code{t} to specify all months.  You can also use an optional
-parameter @var{day} to specify the @var{n}th @var{dayname} of
-@var{month} on or after/before @var{day}; the value of @var{day} defaults
-to 1 if @var{n} is positive and to the last day of @var{month} if
-@var{n} is negative.  For example,
-
-@smallexample
-%%(diary-float t 1 -1) Pay rent
-@end smallexample
-
-@noindent
-causes the fancy diary to show
-
-@smallexample
-Pay rent
-@end smallexample
-
-@noindent
-on the last Monday of every month.
-
-  The generality of sexp diary entries lets you specify any diary
-entry that you can describe algorithmically.  A sexp diary entry
-contains an expression that computes whether the entry applies to any
-given date.  If its value is non-@code{nil}, the entry applies to that
-date; otherwise, it does not.  The expression can use the variable
-@code{date} to find the date being considered; its value is a list
-(@var{month} @var{day} @var{year}) that refers to the Gregorian
-calendar.
-
-  The sexp diary entry applies to a date when the expression's value
-is non-@code{nil}, but some values have more specific meanings.  If
-the value is a string, that string is a description of the event which
-occurs on that date.  The value can also have the form
-@code{(@var{mark} . @var{string})}; then @var{mark} specifies how to
-mark the date in the calendar, and @var{string} is the description of
-the event.  If @var{mark} is a single-character string, that character
-appears next to the date in the calendar.  If @var{mark} is a face
-name, the date is displayed in that face.  If @var{mark} is
-@code{nil}, that specifies no particular highlighting for the date.
-
-  Suppose you get paid on the 21st of the month if it is a weekday, and
-on the Friday before if the 21st is on a weekend.  Here is how to write
-a sexp diary entry that matches those dates:
-
-@smallexample
-&%%(let ((dayname (calendar-day-of-week date))
-         (day (car (cdr date))))
-      (or (and (= day 21) (memq dayname '(1 2 3 4 5)))
-          (and (memq day '(19 20)) (= dayname 5)))
-         ) Pay check deposited
-@end smallexample
-
-  The following sexp diary entries take advantage of the ability (in the fancy
-diary display) to concoct diary entries whose text varies based on the date:
-
-@findex diary-sunrise-sunset
-@findex diary-phases-of-moon
-@findex diary-day-of-year
-@findex diary-iso-date
-@findex diary-julian-date
-@findex diary-astro-day-number
-@findex diary-hebrew-date
-@findex diary-islamic-date
-@findex diary-french-date
-@findex diary-mayan-date
-@table @code
-@item %%(diary-sunrise-sunset)
-Make a diary entry for the local times of today's sunrise and sunset.
-@item %%(diary-phases-of-moon)
-Make a diary entry for the phases (quarters) of the moon.
-@item %%(diary-day-of-year)
-Make a diary entry with today's day number in the current year and the number
-of days remaining in the current year.
-@item %%(diary-iso-date)
-Make a diary entry with today's equivalent ISO commercial date.
-@item %%(diary-julian-date)
-Make a diary entry with today's equivalent date on the Julian calendar.
-@item %%(diary-astro-day-number)
-Make a diary entry with today's equivalent astronomical (Julian) day number.
-@item %%(diary-hebrew-date)
-Make a diary entry with today's equivalent date on the Hebrew calendar.
-@item %%(diary-islamic-date)
-Make a diary entry with today's equivalent date on the Islamic calendar.
-@item %%(diary-french-date)
-Make a diary entry with today's equivalent date on the French Revolutionary
-calendar.
-@item %%(diary-mayan-date)
-Make a diary entry with today's equivalent date on the Mayan calendar.
-@end table
-
-@noindent
-Thus including the diary entry
-
-@example
-&%%(diary-hebrew-date)
-@end example
-
-@noindent
-causes every day's diary display to contain the equivalent date on the
-Hebrew calendar, if you are using the fancy diary display.  (With simple
-diary display, the line @samp{&%%(diary-hebrew-date)} appears in the
-diary for any date, but does nothing particularly useful.)
-
-  These functions can be used to construct sexp diary entries based on
-the Hebrew calendar in certain standard ways:
-
-@cindex rosh hodesh
-@findex diary-rosh-hodesh
-@cindex parasha, weekly
-@findex diary-parasha
-@cindex candle lighting times
-@findex diary-sabbath-candles
-@cindex omer count
-@findex diary-omer
-@cindex yahrzeits
-@findex diary-yahrzeit
-@table @code
-@item %%(diary-rosh-hodesh)
-Make a diary entry that tells the occurrence and ritual announcement of each
-new Hebrew month.
-@item %%(diary-parasha)
-Make a Saturday diary entry that tells the weekly synagogue scripture reading.
-@item %%(diary-sabbath-candles)
-Make a Friday diary entry that tells the @emph{local time} of Sabbath
-candle lighting.
-@item %%(diary-omer)
-Make a diary entry that gives the omer count, when appropriate.
-@item %%(diary-yahrzeit @var{month} @var{day} @var{year}) @var{name}
-Make a diary entry marking the anniversary of a date of death.  The date
-is the @emph{Gregorian} (civil) date of death.  The diary entry appears
-on the proper Hebrew calendar anniversary and on the day before.  (In
-the European style, the order of the parameters is changed to @var{day},
-@var{month}, @var{year}.)
-@end table
-
-  All the functions documented above take an optional argument
-@var{mark} which specifies how to mark the date in the calendar display.
-If one of these functions decides that it applies to a certain date,
-it returns a value that contains @var{mark}.
-
-@node Emerge
-@chapter Merging Files with Emerge
-@cindex Emerge
-@cindex merging files
-
-  It's not unusual for programmers to get their signals crossed and
-modify the same program in two different directions.  To recover from
-this confusion, you need to merge the two versions.  Emerge makes this
-easier.  For other ways to compare files, see @ref{Comparing Files,,,
-emacs, the Emacs Manual} and @ref{Top, Ediff,, ediff, The Ediff
-Manual}.
-
-@menu
-* Overview of Emerge::	How to start Emerge.  Basic concepts.
-* Submodes of Emerge::	Fast mode vs. Edit mode.
-			  Skip Prefers mode and Auto Advance mode.
-* State of Difference::	You do the merge by specifying state A or B
-			  for each difference.
-* Merge Commands::	Commands for selecting a difference,
-			  changing states of differences, etc.
-* Exiting Emerge::	What to do when you've finished the merge.
-* Combining in Emerge::	    How to keep both alternatives for a difference.
-* Fine Points of Emerge::   Misc.
-@end menu
-
-@node Overview of Emerge
-@section Overview of Emerge
-
-  To start Emerge, run one of these four commands:
-
-@table @kbd
-@item M-x emerge-files
-@findex emerge-files
-Merge two specified files.
-
-@item M-x emerge-files-with-ancestor
-@findex emerge-files-with-ancestor
-Merge two specified files, with reference to a common ancestor.
-
-@item M-x emerge-buffers
-@findex emerge-buffers
-Merge two buffers.
-
-@item M-x emerge-buffers-with-ancestor
-@findex emerge-buffers-with-ancestor
-Merge two buffers with reference to a common ancestor in a third
-buffer.
-@end table
-
-@cindex merge buffer (Emerge)
-@cindex A and B buffers (Emerge)
-  The Emerge commands compare two files or buffers, and display the
-comparison in three buffers: one for each input text (the @dfn{A buffer}
-and the @dfn{B buffer}), and one (the @dfn{merge buffer}) where merging
-takes place.  The merge buffer shows the full merged text, not just the
-differences.  Wherever the two input texts differ, you can choose which
-one of them to include in the merge buffer.
-
-  The Emerge commands that take input from existing buffers use only
-the accessible portions of those buffers, if they are narrowed.
-@xref{Narrowing,,, emacs, the Emacs Manual}.
-
-
-  If a common ancestor version is available, from which the two texts to
-be merged were both derived, Emerge can use it to guess which
-alternative is right.  Wherever one current version agrees with the
-ancestor, Emerge presumes that the other current version is a deliberate
-change which should be kept in the merged version.  Use the
-@samp{with-ancestor} commands if you want to specify a common ancestor
-text.  These commands read three file or buffer names---variant A,
-variant B, and the common ancestor.
-
-  After the comparison is done and the buffers are prepared, the
-interactive merging starts.  You control the merging by typing special
-@dfn{merge commands} in the merge buffer (@pxref{Merge Commands}).
-For each run of differences between the input texts, you can choose
-which one of them to keep, or edit them both together.
-
-  The merge buffer uses a special major mode, Emerge mode, with commands
-for making these choices.  But you can also edit the buffer with
-ordinary Emacs commands.
-
-  At any given time, the attention of Emerge is focused on one
-particular difference, called the @dfn{selected} difference.  This
-difference is marked off in the three buffers like this:
-
-@example
-vvvvvvvvvvvvvvvvvvvv
-@var{text that differs}
-^^^^^^^^^^^^^^^^^^^^
-@end example
-
-@noindent
-Emerge numbers all the differences sequentially and the mode
-line always shows the number of the selected difference.
-
-  Normally, the merge buffer starts out with the A version of the text.
-But when the A version of a difference agrees with the common ancestor,
-then the B version is initially preferred for that difference.
-
-  Emerge leaves the merged text in the merge buffer when you exit.  At
-that point, you can save it in a file with @kbd{C-x C-w}.  If you give a
-numeric argument to @code{emerge-files} or
-@code{emerge-files-with-ancestor}, it reads the name of the output file
-using the minibuffer.  (This is the last file name those commands read.)
-Then exiting from Emerge saves the merged text in the output file.
-
-  Normally, Emerge commands save the output buffer in its file when you
-exit.  If you abort Emerge with @kbd{C-]}, the Emerge command does not
-save the output buffer, but you can save it yourself if you wish.
-
-@node Submodes of Emerge
-@section Submodes of Emerge
-
-  You can choose between two modes for giving merge commands: Fast mode
-and Edit mode.  In Fast mode, basic merge commands are single
-characters, but ordinary Emacs commands are disabled.  This is
-convenient if you use only merge commands.  In Edit mode, all merge
-commands start with the prefix key @kbd{C-c C-c}, and the normal Emacs
-commands are also available.  This allows editing the merge buffer, but
-slows down Emerge operations.
-
-  Use @kbd{e} to switch to Edit mode, and @kbd{C-c C-c f} to switch to
-Fast mode.  The mode line indicates Edit and Fast modes with @samp{E}
-and @samp{F}.
-
-  Emerge has two additional submodes that affect how particular merge
-commands work: Auto Advance mode and Skip Prefers mode.
-
-  If Auto Advance mode is in effect, the @kbd{a} and @kbd{b} commands
-advance to the next difference.  This lets you go through the merge
-faster as long as you simply choose one of the alternatives from the
-input.  The mode line indicates Auto Advance mode with @samp{A}.
-
-  If Skip Prefers mode is in effect, the @kbd{n} and @kbd{p} commands
-skip over differences in states prefer-A and prefer-B (@pxref{State of
-Difference}).  Thus you see only differences for which neither version
-is presumed ``correct.''  The mode line indicates Skip Prefers mode with
-@samp{S}.
-
-@findex emerge-auto-advance-mode
-@findex emerge-skip-prefers-mode
-  Use the command @kbd{s a} (@code{emerge-auto-advance-mode}) to set or
-clear Auto Advance mode.  Use @kbd{s s}
-(@code{emerge-skip-prefers-mode}) to set or clear Skip Prefers mode.
-These commands turn on the mode with a positive argument, turns it off
-with a negative or zero argument, and toggle the mode with no argument.
-
-@node State of Difference
-@section State of a Difference
-
-  In the merge buffer, a difference is marked with lines of @samp{v} and
-@samp{^} characters.  Each difference has one of these seven states:
-
-@table @asis
-@item A
-The difference is showing the A version.  The @kbd{a} command always
-produces this state; the mode line indicates it with @samp{A}.
-
-@item B
-The difference is showing the B version.  The @kbd{b} command always
-produces this state; the mode line indicates it with @samp{B}.
-
-@item default-A
-@itemx default-B
-The difference is showing the A or the B state by default, because you
-haven't made a choice.  All differences start in the default-A state
-(and thus the merge buffer is a copy of the A buffer), except those for
-which one alternative is ``preferred'' (see below).
-
-When you select a difference, its state changes from default-A or
-default-B to plain A or B.  Thus, the selected difference never has
-state default-A or default-B, and these states are never displayed in
-the mode line.
-
-The command @kbd{d a} chooses default-A as the default state, and @kbd{d
-b} chooses default-B.  This chosen default applies to all differences
-which you haven't ever selected and for which no alternative is preferred.
-If you are moving through the merge sequentially, the differences you
-haven't selected are those following the selected one.  Thus, while
-moving sequentially, you can effectively make the A version the default
-for some sections of the merge buffer and the B version the default for
-others by using @kbd{d a} and @kbd{d b} between sections.
-
-@item prefer-A
-@itemx prefer-B
-The difference is showing the A or B state because it is
-@dfn{preferred}.  This means that you haven't made an explicit choice,
-but one alternative seems likely to be right because the other
-alternative agrees with the common ancestor.  Thus, where the A buffer
-agrees with the common ancestor, the B version is preferred, because
-chances are it is the one that was actually changed.
-
-These two states are displayed in the mode line as @samp{A*} and @samp{B*}.
-
-@item combined
-The difference is showing a combination of the A and B states, as a
-result of the @kbd{x c} or @kbd{x C} commands.
-
-Once a difference is in this state, the @kbd{a} and @kbd{b} commands
-don't do anything to it unless you give them a numeric argument.
-
-The mode line displays this state as @samp{comb}.
-@end table
-
-@node Merge Commands
-@section Merge Commands
-
-  Here are the Merge commands for Fast mode; in Edit mode, precede them
-with @kbd{C-c C-c}:
-
-@table @kbd
-@item p
-Select the previous difference.
-
-@item n
-Select the next difference.
-
-@item a
-Choose the A version of this difference.
-
-@item b
-Choose the B version of this difference.
-
-@item C-u @var{n} j
-Select difference number @var{n}.
-
-@item .
-Select the difference containing point.  You can use this command in the
-merge buffer or in the A or B buffer.
-
-@item q
-Quit---finish the merge.
-
-@item C-]
-Abort---exit merging and do not save the output.
-
-@item f
-Go into Fast mode.  (In Edit mode, this is actually @kbd{C-c C-c f}.)
-
-@item e
-Go into Edit mode.
-
-@item l
-Recenter (like @kbd{C-l}) all three windows.
-
-@item -
-Specify part of a prefix numeric argument.
-
-@item @var{digit}
-Also specify part of a prefix numeric argument.
-
-@item d a
-Choose the A version as the default from here down in
-the merge buffer.
-
-@item d b
-Choose the B version as the default from here down in
-the merge buffer.
-
-@item c a
-Copy the A version of this difference into the kill ring.
-
-@item c b
-Copy the B version of this difference into the kill ring.
+@raisesections
+@include arevert-xtra.texi
 
-@item i a
-Insert the A version of this difference at point.
-
-@item i b
-Insert the B version of this difference at point.
-
-@item m
-Put point and mark around the difference.
-
-@item ^
-Scroll all three windows down (like @kbd{M-v}).
-
-@item v
-Scroll all three windows up (like @kbd{C-v}).
-
-@item <
-Scroll all three windows left (like @kbd{C-x <}).
-
-@item >
-Scroll all three windows right (like @kbd{C-x >}).
-
-@item |
-Reset horizontal scroll on all three windows.
-
-@item x 1
-Shrink the merge window to one line.  (Use @kbd{C-u l} to restore it
-to full size.)
-
-@item x c
-Combine the two versions of this difference (@pxref{Combining in
-Emerge}).
-
-@item x f
-Show the names of the files/buffers Emerge is operating on, in a Help
-window.  (Use @kbd{C-u l} to restore windows.)
-
-@item x j
-Join this difference with the following one.
-(@kbd{C-u x j} joins this difference with the previous one.)
-
-@item x s
-Split this difference into two differences.  Before you use this
-command, position point in each of the three buffers at the place where
-you want to split the difference.
-
-@item x t
-Trim identical lines off the top and bottom of the difference.
-Such lines occur when the A and B versions are
-identical but differ from the ancestor version.
-@end table
-
-@node Exiting Emerge
-@section Exiting Emerge
-
-  The @kbd{q} command (@code{emerge-quit}) finishes the merge, storing
-the results into the output file if you specified one.  It restores the
-A and B buffers to their proper contents, or kills them if they were
-created by Emerge and you haven't changed them.  It also disables the
-Emerge commands in the merge buffer, since executing them later could
-damage the contents of the various buffers.
-
-  @kbd{C-]} aborts the merge.  This means exiting without writing the
-output file.  If you didn't specify an output file, then there is no
-real difference between aborting and finishing the merge.
-
-  If the Emerge command was called from another Lisp program, then its
-return value is @code{t} for successful completion, or @code{nil} if you
-abort.
-
-@node Combining in Emerge
-@section Combining the Two Versions
-
-  Sometimes you want to keep @emph{both} alternatives for a particular
-difference.  To do this, use @kbd{x c}, which edits the merge buffer
-like this:
-
-@example
-@group
-#ifdef NEW
-@var{version from A buffer}
-#else /* not NEW */
-@var{version from B buffer}
-#endif /* not NEW */
-@end group
-@end example
-
-@noindent
-@vindex emerge-combine-versions-template
-While this example shows C preprocessor conditionals delimiting the two
-alternative versions, you can specify the strings to use by setting
-the variable @code{emerge-combine-versions-template} to a string of your
-choice.  In the string, @samp{%a} says where to put version A, and
-@samp{%b} says where to put version B.  The default setting, which
-produces the results shown above, looks like this:
-
-@example
-@group
-"#ifdef NEW\n%a#else /* not NEW */\n%b#endif /* not NEW */\n"
-@end group
-@end example
-
-@node Fine Points of Emerge
-@section Fine Points of Emerge
-
-  During the merge, you mustn't try to edit the A and B buffers yourself.
-Emerge modifies them temporarily, but ultimately puts them back the way
-they were.
-
-  You can have any number of merges going at once---just don't use any one
-buffer as input to more than one merge at once, since the temporary
-changes made in these buffers would get in each other's way.
-
-  Starting Emerge can take a long time because it needs to compare the
-files fully.  Emacs can't do anything else until @code{diff} finishes.
-Perhaps in the future someone will change Emerge to do the comparison in
-the background when the input files are large---then you could keep on
-doing other things with Emacs until Emerge is ready to accept
-commands.
-
-@vindex emerge-startup-hook
-  After setting up the merge, Emerge runs the hook
-@code{emerge-startup-hook}.  @xref{Hooks,,, emacs, the Emacs Manual}.
-
-@node Picture Mode
-@chapter Editing Pictures
-@cindex pictures
-@cindex making pictures out of text characters
-@findex edit-picture
-
-  To edit a picture made out of text characters (for example, a picture
-of the division of a register into fields, as a comment in a program),
-use the command @kbd{M-x edit-picture} to enter Picture mode.
-
-  In Picture mode, editing is based on the @dfn{quarter-plane} model of
-text, according to which the text characters lie studded on an area that
-stretches infinitely far to the right and downward.  The concept of the end
-of a line does not exist in this model; the most you can say is where the
-last nonblank character on the line is found.
-
-  Of course, Emacs really always considers text as a sequence of
-characters, and lines really do have ends.  But Picture mode replaces
-the most frequently-used commands with variants that simulate the
-quarter-plane model of text.  They do this by inserting spaces or by
-converting tabs to spaces.
-
-  Most of the basic editing commands of Emacs are redefined by Picture mode
-to do essentially the same thing but in a quarter-plane way.  In addition,
-Picture mode defines various keys starting with the @kbd{C-c} prefix to
-run special picture editing commands.
-
-  One of these keys, @kbd{C-c C-c}, is particularly important.  Often a
-picture is part of a larger file that is usually edited in some other
-major mode.  @kbd{M-x edit-picture} records the name of the previous
-major mode so you can use the @kbd{C-c C-c} command
-(@code{picture-mode-exit}) later to go back to that mode.  @kbd{C-c C-c}
-also deletes spaces from the ends of lines, unless given a numeric
-argument.
-
-  The special commands of Picture mode all work in other modes (provided
-the @file{picture} library is loaded), but are not bound to keys except
-in Picture mode.  The descriptions below talk of moving ``one column''
-and so on, but all the picture mode commands handle numeric arguments as
-their normal equivalents do.
-
-@vindex picture-mode-hook
-  Turning on Picture mode runs the hook @code{picture-mode-hook}.
-Additional extensions to Picture mode can be found in
-@file{artist.el}.
-
-@menu
-* Basic Picture::         Basic concepts and simple commands of Picture Mode.
-* Insert in Picture::     Controlling direction of cursor motion
-                            after "self-inserting" characters.
-* Tabs in Picture::       Various features for tab stops and indentation.
-* Rectangles in Picture:: Clearing and superimposing rectangles.
-@end menu
-
-@node Basic Picture
-@section Basic Editing in Picture Mode
-
-@findex picture-forward-column
-@findex picture-backward-column
-@findex picture-move-down
-@findex picture-move-up
-@cindex editing in Picture mode
-
-  Most keys do the same thing in Picture mode that they usually do, but
-do it in a quarter-plane style.  For example, @kbd{C-f} is rebound to
-run @code{picture-forward-column}, a command which moves point one
-column to the right, inserting a space if necessary so that the actual
-end of the line makes no difference.  @kbd{C-b} is rebound to run
-@code{picture-backward-column}, which always moves point left one
-column, converting a tab to multiple spaces if necessary.  @kbd{C-n} and
-@kbd{C-p} are rebound to run @code{picture-move-down} and
-@code{picture-move-up}, which can either insert spaces or convert tabs
-as necessary to make sure that point stays in exactly the same column.
-@kbd{C-e} runs @code{picture-end-of-line}, which moves to after the last
-nonblank character on the line.  There is no need to change @kbd{C-a},
-as the choice of screen model does not affect beginnings of
-lines.
-
-@findex picture-newline
-  Insertion of text is adapted to the quarter-plane screen model
-through the use of Overwrite mode (@pxref{Minor Modes,,, emacs, the
-Emacs Manual}.)  Self-inserting characters replace existing text,
-column by column, rather than pushing existing text to the right.
-@key{RET} runs @code{picture-newline}, which just moves to the
-beginning of the following line so that new text will replace that
-line.
-
-@findex picture-backward-clear-column
-@findex picture-clear-column
-@findex picture-clear-line
-  In Picture mode, the commands that normally delete or kill text,
-instead erase text (replacing it with spaces).  @key{DEL}
-(@code{picture-backward-clear-column}) replaces the preceding
-character with a space rather than removing it; this moves point
-backwards.  @kbd{C-d} (@code{picture-clear-column}) replaces the next
-character or characters with spaces, but does not move point.  (If you
-want to clear characters to spaces and move forward over them, use
-@key{SPC}.)  @kbd{C-k} (@code{picture-clear-line}) really kills the
-contents of lines, but does not delete the newlines from the buffer.
-
-@findex picture-open-line
-  To do actual insertion, you must use special commands.  @kbd{C-o}
-(@code{picture-open-line}) creates a blank line after the current
-line; it never splits a line.  @kbd{C-M-o} (@code{split-line}) makes
-sense in Picture mode, so it is not changed.  @kbd{C-j}
-(@code{picture-duplicate-line}) inserts another line with the same
-contents below the current line.
+@include dired-xtra.texi
 
-@kindex C-c C-d @r{(Picture mode)}
-   To do actual deletion in Picture mode, use @kbd{C-w}, @kbd{C-c C-d}
-(which is defined as @code{delete-char}, as @kbd{C-d} is in other
-modes), or one of the picture rectangle commands (@pxref{Rectangles in
-Picture}).
-
-@node Insert in Picture
-@section Controlling Motion after Insert
-
-@findex picture-movement-up
-@findex picture-movement-down
-@findex picture-movement-left
-@findex picture-movement-right
-@findex picture-movement-nw
-@findex picture-movement-ne
-@findex picture-movement-sw
-@findex picture-movement-se
-@kindex C-c < @r{(Picture mode)}
-@kindex C-c > @r{(Picture mode)}
-@kindex C-c ^ @r{(Picture mode)}
-@kindex C-c . @r{(Picture mode)}
-@kindex C-c ` @r{(Picture mode)}
-@kindex C-c ' @r{(Picture mode)}
-@kindex C-c / @r{(Picture mode)}
-@kindex C-c \ @r{(Picture mode)}
-  Since ``self-inserting'' characters in Picture mode overwrite and move
-point, there is no essential restriction on how point should be moved.
-Normally point moves right, but you can specify any of the eight
-orthogonal or diagonal directions for motion after a ``self-inserting''
-character.  This is useful for drawing lines in the buffer.
-
-@table @kbd
-@item C-c <
-@itemx C-c @key{LEFT}
-Move left after insertion (@code{picture-movement-left}).
-@item C-c >
-@itemx C-c @key{RIGHT}
-Move right after insertion (@code{picture-movement-right}).
-@item C-c ^
-@itemx C-c @key{UP}
-Move up after insertion (@code{picture-movement-up}).
-@item C-c .
-@itemx C-c @key{DOWN}
-Move down after insertion (@code{picture-movement-down}).
-@item C-c `
-@itemx C-c @key{HOME}
-Move up and left (``northwest'') after insertion (@code{picture-movement-nw}).
-@item C-c '
-@itemx C-c @key{PAGEUP}
-Move up and right (``northeast'') after insertion
-(@code{picture-movement-ne}).
-@item C-c /
-@itemx C-c @key{END}
-Move down and left (``southwest'') after insertion
-@*(@code{picture-movement-sw}).
-@item C-c \
-@itemx C-c @key{PAGEDOWN}
-Move down and right (``southeast'') after insertion
-@*(@code{picture-movement-se}).
-@end table
-
-@kindex C-c C-f @r{(Picture mode)}
-@kindex C-c C-b @r{(Picture mode)}
-@findex picture-motion
-@findex picture-motion-reverse
-  Two motion commands move based on the current Picture insertion
-direction.  The command @kbd{C-c C-f} (@code{picture-motion}) moves in the
-same direction as motion after ``insertion'' currently does, while @kbd{C-c
-C-b} (@code{picture-motion-reverse}) moves in the opposite direction.
-
-@node Tabs in Picture
-@section Picture Mode Tabs
-
-@kindex M-TAB @r{(Picture mode)}
-@findex picture-tab-search
-@vindex picture-tab-chars
-  Two kinds of tab-like action are provided in Picture mode.  Use
-@kbd{M-@key{TAB}} (@code{picture-tab-search}) for context-based tabbing.
-With no argument, it moves to a point underneath the next
-``interesting'' character that follows whitespace in the previous
-nonblank line.  ``Next'' here means ``appearing at a horizontal position
-greater than the one point starts out at.''  With an argument, as in
-@kbd{C-u M-@key{TAB}}, this command moves to the next such interesting
-character in the current line.  @kbd{M-@key{TAB}} does not change the
-text; it only moves point.  ``Interesting'' characters are defined by
-the variable @code{picture-tab-chars}, which should define a set of
-characters.  The syntax for this variable is like the syntax used inside
-of @samp{[@dots{}]} in a regular expression---but without the @samp{[}
-and the @samp{]}.  Its default value is @code{"!-~"}.
-
-@findex picture-tab
-  @key{TAB} itself runs @code{picture-tab}, which operates based on the
-current tab stop settings; it is the Picture mode equivalent of
-@code{tab-to-tab-stop}.  Normally it just moves point, but with a numeric
-argument it clears the text that it moves over.
-
-@kindex C-c TAB @r{(Picture mode)}
-@findex picture-set-tab-stops
-  The context-based and tab-stop-based forms of tabbing are brought
-together by the command @kbd{C-c @key{TAB}} (@code{picture-set-tab-stops}).
-This command sets the tab stops to the positions which @kbd{M-@key{TAB}}
-would consider significant in the current line.  The use of this command,
-together with @key{TAB}, can get the effect of context-based tabbing.  But
-@kbd{M-@key{TAB}} is more convenient in the cases where it is sufficient.
-
-  It may be convenient to prevent use of actual tab characters in
-pictures.  For example, this prevents @kbd{C-x @key{TAB}} from messing
-up the picture.  You can do this by setting the variable
-@code{indent-tabs-mode} to @code{nil}.
-
-@node Rectangles in Picture
-@section Picture Mode Rectangle Commands
-@cindex rectangles and Picture mode
-@cindex Picture mode and rectangles
-
-  Picture mode defines commands for working on rectangular pieces of
-the text in ways that fit with the quarter-plane model.  The standard
-rectangle commands may also be useful.  @xref{Rectangles,,, emacs, the
-Emacs Manual}.
-
-@table @kbd
-@item C-c C-k
-Clear out the region-rectangle with spaces
-(@code{picture-clear-rectangle}).  With argument, delete the text.
-@item C-c C-w @var{r}
-Similar, but save rectangle contents in register @var{r} first
-(@code{picture-clear-rectangle-to-register}).
-@item C-c C-y
-Copy last killed rectangle into the buffer by overwriting, with upper
-left corner at point (@code{picture-yank-rectangle}).  With argument,
-insert instead.
-@item C-c C-x @var{r}
-Similar, but use the rectangle in register @var{r}
-(@code{picture-yank-rectangle-from-register}).
-@end table
-
-@kindex C-c C-k @r{(Picture mode)}
-@kindex C-c C-w @r{(Picture mode)}
-@findex picture-clear-rectangle
-@findex picture-clear-rectangle-to-register
-  The picture rectangle commands @kbd{C-c C-k}
-(@code{picture-clear-rectangle}) and @kbd{C-c C-w}
-(@code{picture-clear-rectangle-to-register}) differ from the standard
-rectangle commands in that they normally clear the rectangle instead of
-deleting it; this is analogous with the way @kbd{C-d} is changed in Picture
-mode.
-
-  However, deletion of rectangles can be useful in Picture mode, so
-these commands delete the rectangle if given a numeric argument.
-@kbd{C-c C-k} either with or without a numeric argument saves the
-rectangle for @kbd{C-c C-y}.
-
-@kindex C-c C-y @r{(Picture mode)}
-@kindex C-c C-x @r{(Picture mode)}
-@findex picture-yank-rectangle
-@findex picture-yank-rectangle-from-register
-  The Picture mode commands for yanking rectangles differ from the
-standard ones in that they overwrite instead of inserting.  This is
-the same way that Picture mode insertion of other text differs from
-other modes.  @kbd{C-c C-y} (@code{picture-yank-rectangle}) inserts
-(by overwriting) the rectangle that was most recently killed, while
-@kbd{C-c C-x} (@code{picture-yank-rectangle-from-register}) does
-likewise for the rectangle found in a specified register.
-
-@node Advanced VC Usage
-@chapter Advanced VC Usage
-
-  Commonly used features of Emacs' version control (VC) support are
-described in the main Emacs manual (@pxref{Version Control,,,emacs,
-the Emacs Manual}).  This chapter describes more advanced VC usage.
-
-@menu
-* VC Dired Mode::       Listing files managed by version control.
-* VC Dired Commands::   Commands to use in a VC Dired buffer.
-* Remote Repositories:: Efficient access to remote CVS servers.
-* Snapshots::           Sets of file versions treated as a unit.
-* Miscellaneous VC::    Various other commands and features of VC.
-* Customizing VC::      Variables that change VC's behavior.
-@end menu
-
-@node VC Dired Mode
-@section Dired under VC
-
-@cindex PCL-CVS
-@pindex cvs
-@cindex CVS Dired Mode
-  The VC Dired Mode described here works with all the version control
-systems that VC supports.  Another more powerful facility, designed
-specifically for CVS, is called PCL-CVS.  @xref{Top, , About PCL-CVS,
-pcl-cvs, PCL-CVS --- The Emacs Front-End to CVS}.
-
-@kindex C-x v d
-@findex vc-directory
-  When you are working on a large program, it is often useful to find
-out which files have changed within an entire directory tree, or to view
-the status of all files under version control at once, and to perform
-version control operations on collections of files.  You can use the
-command @kbd{C-x v d} (@code{vc-directory}) to make a directory listing
-that includes only files relevant for version control.
-
-@vindex vc-dired-terse-display
-  @kbd{C-x v d} creates a buffer which uses VC Dired Mode.  This looks
-much like an ordinary Dired buffer (@pxref{Dired,,,emacs, the
-Emacs Manual}); however, normally it shows only the noteworthy files
-(those locked or not up-to-date).  This is called @dfn{terse display}.
-If you set the variable @code{vc-dired-terse-display} to @code{nil},
-then VC Dired shows all relevant files---those managed under version
-control, plus all subdirectories (@dfn{full display}).  The command
-@kbd{v t} in a VC Dired buffer toggles between terse display and full
-display (@pxref{VC Dired Commands}).
-
-@vindex vc-dired-recurse
-  By default, VC Dired produces a recursive listing of noteworthy or
-relevant files at or below the given directory.  You can change this by
-setting the variable @code{vc-dired-recurse} to @code{nil}; then VC
-Dired shows only the files in the given directory.
-
-  The line for an individual file shows the version control state in the
-place of the hard link count, owner, group, and size of the file.  If
-the file is unmodified, in sync with the master file, the version
-control state shown is blank.  Otherwise it consists of text in
-parentheses.  Under RCS and SCCS, the name of the user locking the file
-is shown; under CVS, an abbreviated version of the @samp{cvs status}
-output is used.  Here is an example using RCS:
-
-@smallexample
-@group
-  /home/jim/project:
-
-  -rw-r--r-- (jim)      Apr  2 23:39 file1
-  -r--r--r--            Apr  5 20:21 file2
-@end group
-@end smallexample
-
-@noindent
-The files @samp{file1} and @samp{file2} are under version control,
-@samp{file1} is locked by user jim, and @samp{file2} is unlocked.
-
-  Here is an example using CVS:
+@include cal-xtra.texi
 
-@smallexample
-@group
-  /home/joe/develop:
-
-  -rw-r--r-- (modified) Aug  2  1997 file1.c
-  -rw-r--r--            Apr  4 20:09 file2.c
-  -rw-r--r-- (merge)    Sep 13  1996 file3.c
-@end group
-@end smallexample
-
-  Here @samp{file1.c} is modified with respect to the repository, and
-@samp{file2.c} is not.  @samp{file3.c} is modified, but other changes
-have also been checked in to the repository---you need to merge them
-with the work file before you can check it in.
-
-@vindex vc-stay-local
-@vindex vc-cvs-stay-local
-  In the above, if the repository were on a remote machine, VC would
-only contact it when the variable @code{vc-stay-local} (or
-@code{vc-cvs-stay-local}) is nil (@pxref{CVS Options}).  This is
-because access to the repository may be slow, or you may be working
-offline and not have access to the repository at all.  As a
-consequence, VC would not be able to tell you that @samp{file3.c} is
-in the ``merge'' state; you would learn that only when you try to
-check-in your modified copy of the file, or use a command such as
-@kbd{C-x v m}.
-
-  In practice, this is not a problem because CVS handles this case
-consistently whenever it arises.  In VC, you'll simply get prompted to
-merge the remote changes into your work file first.  The benefits of
-less network communication usually outweigh the disadvantage of not
-seeing remote changes immediately.
-
-@vindex vc-directory-exclusion-list
-  When VC Dired displays subdirectories (in the ``full'' display mode),
-it omits some that should never contain any files under version control.
-By default, this includes Version Control subdirectories such as
-@samp{RCS} and @samp{CVS}; you can customize this by setting the
-variable @code{vc-directory-exclusion-list}.
-
-  You can fine-tune VC Dired's format by typing @kbd{C-u C-x v d}---as in
-ordinary Dired, that allows you to specify additional switches for the
-@samp{ls} command.
-
-@node VC Dired Commands
-@section VC Dired Commands
-
-  All the usual Dired commands work normally in VC Dired mode, except
-for @kbd{v}, which is redefined as the version control prefix.  You can
-invoke VC commands such as @code{vc-diff} and @code{vc-print-log} by
-typing @kbd{v =}, or @kbd{v l}, and so on.  Most of these commands apply
-to the file name on the current line.
-
-  The command @kbd{v v} (@code{vc-next-action}) operates on all the
-marked files, so that you can lock or check in several files at once.
-If it operates on more than one file, it handles each file according to
-its current state; thus, it might lock one file, but check in another
-file.  This could be confusing; it is up to you to avoid confusing
-behavior by marking a set of files that are in a similar state.  If no
-files are marked, @kbd{v v} operates on the file in the current line.
-
-  If any files call for check-in, @kbd{v v} reads a single log entry,
-then uses it for all the files being checked in.  This is convenient for
-registering or checking in several files at once, as part of the same
-change.
-
-@findex vc-dired-toggle-terse-mode
-@findex vc-dired-mark-locked
-  You can toggle between terse display (only locked files, or files not
-up-to-date) and full display at any time by typing @kbd{v t}
-(@code{vc-dired-toggle-terse-mode}).  There is also a special command
-@kbd{* l} (@code{vc-dired-mark-locked}), which marks all files currently
-locked (or, with CVS, all files not up-to-date).  Thus, typing @kbd{* l
-t k} is another way to delete from the buffer all files except those
-currently locked.
-
-@node Remote Repositories
-@section Remote Repositories
-@cindex remote repositories (CVS)
-
-  A common way of using CVS is to set up a central CVS repository on
-some Internet host, then have each developer check out a personal
-working copy of the files on his local machine.  Committing changes to
-the repository, and picking up changes from other users into one's own
-working area, then works by direct interactions with the CVS server.
-
-  One difficulty is that access to the CVS server is often slow, and
-that developers might need to work off-line as well.  VC is designed
-to reduce the amount of network interaction necessary.
-
-@menu
-* Version Backups::        Keeping local copies of repository versions.
-* Local Version Control::  Using another version system for local editing.
-@end menu
-
-@node Version Backups
-@subsection Version Backups
-@cindex version backups
-
-@cindex automatic version backups
-  When VC sees that the CVS repository for a file is on a remote
-machine, it automatically makes local backups of unmodified versions
-of the file---@dfn{automatic version backups}.  This means that you
-can compare the file to the repository version (@kbd{C-x v =}), or
-revert to that version (@kbd{C-x v u}), without any network
-interactions.
-
-  The local copy of the unmodified file is called a @dfn{version
-backup} to indicate that it corresponds exactly to a version that is
-stored in the repository.  Note that version backups are not the same
-as ordinary Emacs backup files (@pxref{Backup,,,emacs, the Emacs
-Manual}).  But they follow a similar naming convention.
-
-  For a file that comes from a remote CVS repository, VC makes a
-version backup whenever you save the first changes to the file, and
-removes it after you have committed your modified version to the
-repository. You can disable the making of automatic version backups by
-setting @code{vc-cvs-stay-local} to @code{nil} (@pxref{CVS Options}).
-
-@cindex manual version backups
-  The name of the automatic version backup for version @var{version}
-of file @var{file} is @code{@var{file}.~@var{version}.~}.  This is
-almost the same as the name used by @kbd{C-x v ~} (@pxref{Old
-Versions,,,emacs, the Emacs Manual}), the only difference being
-the additional dot (@samp{.})  after the version number.  This
-similarity is intentional, because both kinds of files store the same
-kind of information.  The file made by @kbd{C-x v ~} acts as a
-@dfn{manual version backup}.
-
-  All the VC commands that operate on old versions of a file can use
-both kinds of version backups.  For instance, @kbd{C-x v ~} uses
-either an automatic or a manual version backup, if possible, to get
-the contents of the version you request.  Likewise, @kbd{C-x v =} and
-@kbd{C-x v u} use either an automatic or a manual version backup, if
-one of them exists, to get the contents of a version to compare or
-revert to.  If you changed a file outside of Emacs, so that no
-automatic version backup was created for the previous text, you can
-create a manual backup of that version using @kbd{C-x v ~}, and thus
-obtain the benefit of the local copy for Emacs commands.
-
-  The only difference in Emacs's handling of manual and automatic
-version backups, once they exist, is that Emacs deletes automatic
-version backups when you commit to the repository.  By contrast,
-manual version backups remain until you delete them.
-
-@node Local Version Control
-@subsection Local Version Control
-@cindex local version control
-@cindex local back end (version control)
-
-When you make many changes to a file that comes from a remote
-repository, it can be convenient to have version control on your local
-machine as well.  You can then record intermediate versions, revert to
-a previous state, etc., before you actually commit your changes to the
-remote server.
-
-VC lets you do this by putting a file under a second, local version
-control system, so that the file is effectively registered in two
-systems at the same time.  For the description here, we will assume
-that the remote system is CVS, and you use RCS locally, although the
-mechanism works with any combination of version control systems
-(@dfn{back ends}).
-
-To make it work with other back ends, you must make sure that the
-``more local'' back end comes before the ``more remote'' back end in
-the setting of @code{vc-handled-backends} (@pxref{Customizing VC}).  By
-default, this variable is set up so that you can use remote CVS and
-local RCS as described here.
-
-To start using local RCS for a file that comes from a remote CVS
-server, you must @emph{register the file in RCS}, by typing @kbd{C-u
-C-x v v rcs @key{RET}}.  (In other words, use @code{vc-next-action} with a
-prefix argument, and specify RCS as the back end.)
-
-You can do this at any time; it does not matter whether you have
-already modified the file with respect to the version in the CVS
-repository.  If possible, VC tries to make the RCS master start with
-the unmodified repository version, then checks in any local changes
-as a new version.  This works if you have not made any changes yet, or
-if the unmodified repository version exists locally as a version
-backup (@pxref{Version Backups}).  If the unmodified version is not
-available locally, the RCS master starts with the modified version;
-the only drawback to this is that you cannot compare your changes
-locally to what is stored in the repository.
-
-The version number of the RCS master is derived from the current CVS
-version, starting a branch from it.  For example, if the current CVS
-version is 1.23, the local RCS branch will be 1.23.1.  Version 1.23 in
-the RCS master will be identical to version 1.23 under CVS; your first
-changes are checked in as 1.23.1.1.  (If the unmodified file is not
-available locally, VC will check in the modified file twice, both as
-1.23 and 1.23.1.1, to make the revision numbers consistent.)
-
-If you do not use locking under CVS (the default), locking is also
-disabled for RCS, so that editing under RCS works exactly as under
-CVS.
-
-When you are done with local editing, you can commit the final version
-back to the CVS repository by typing @kbd{C-u C-x v v cvs @key{RET}}.
-This initializes the log entry buffer (@pxref{Log Buffer,,,emacs, the
-Emacs Manual}) to contain all the log entries you have recorded in the
-RCS master; you can edit them as you wish, and then commit in CVS by
-typing @kbd{C-c C-c}.  If the commit is successful, VC removes the RCS
-master, so that the file is once again registered under CVS only.
-(The RCS master is not actually deleted, just renamed by appending
-@samp{~} to the name, so that you can refer to it later if you wish.)
-
-While using local RCS, you can pick up recent changes from the CVS
-repository into your local file, or commit some of your changes back
-to CVS, without terminating local RCS version control.  To do this,
-switch to the CVS back end temporarily, with the @kbd{C-x v b} command:
-
-@table @kbd
-@item C-x v b
-Switch to another back end that the current file is registered
-under (@code{vc-switch-backend}).
-
-@item C-u C-x v b @var{backend} @key{RET}
-Switch to @var{backend} for the current file.
-@end table
-
-@kindex C-x v b
-@findex vc-switch-backend
-@kbd{C-x v b} does not change the buffer contents, or any files; it
-only changes VC's perspective on how to handle the file.  Any
-subsequent VC commands for that file will operate on the back end that
-is currently selected.
-
-If the current file is registered in more than one back end, typing
-@kbd{C-x v b} ``cycles'' through all of these back ends.  With a
-prefix argument, it asks for the back end to use in the minibuffer.
-
-Thus, if you are using local RCS, and you want to pick up some recent
-changes in the file from remote CVS, first visit the file, then type
-@kbd{C-x v b} to switch to CVS, and finally use @kbd{C-x v m
-@key{RET}} to merge the news (@pxref{Merging,,,emacs, the Emacs
-Manual}).  You can then switch back to RCS by typing @kbd{C-x v b}
-again, and continue to edit locally.
-
-But if you do this, the revision numbers in the RCS master no longer
-correspond to those of CVS.  Technically, this is not a problem, but
-it can become difficult to keep track of what is in the CVS repository
-and what is not.  So we suggest that you return from time to time to
-CVS-only operation, by committing your local changes back to the
-repository using @kbd{C-u C-x v v cvs @key{RET}}.
-
-@node Snapshots
-@section Snapshots
-@cindex snapshots and version control
-
-  A @dfn{snapshot} is a named set of file versions (one for each
-registered file) that you can treat as a unit.  One important kind of
-snapshot is a @dfn{release}, a (theoretically) stable version of the
-system that is ready for distribution to users.
-
-@menu
-* Making Snapshots::		The snapshot facilities.
-* Snapshot Caveats::		Things to be careful of when using snapshots.
-@end menu
-
-@node Making Snapshots
-@subsection Making and Using Snapshots
-
-  There are two basic commands for snapshots; one makes a
-snapshot with a given name, the other retrieves a named snapshot.
-
-@table @code
-@kindex C-x v s
-@findex vc-create-snapshot
-@item C-x v s @var{name} @key{RET}
-Define the last saved versions of every registered file in or under the
-current directory as a snapshot named @var{name}
-(@code{vc-create-snapshot}).
-
-@kindex C-x v r
-@findex vc-retrieve-snapshot
-@item C-x v r @var{name} @key{RET}
-For all registered files at or below the current directory level, select
-whatever versions correspond to the snapshot @var{name}
-(@code{vc-retrieve-snapshot}).
-
-This command reports an error if any files are locked at or below the
-current directory, without changing anything; this is to avoid
-overwriting work in progress.
-@end table
-
-  A snapshot uses a very small amount of resources---just enough to record
-the list of file names and which version belongs to the snapshot.  Thus,
-you need not hesitate to create snapshots whenever they are useful.
-
-  You can give a snapshot name as an argument to @kbd{C-x v =} or
-@kbd{C-x v ~} (@pxref{Old Versions,,,emacs, the Emacs Manual}).
-Thus, you can use it to compare a snapshot against the current files,
-or two snapshots against each other, or a snapshot against a named
-version.
-
-@node Snapshot Caveats
-@subsection Snapshot Caveats
-
-@cindex named configurations (RCS)
-  VC's snapshot facilities are modeled on RCS's named-configuration
-support.  They use RCS's native facilities for this, so
-snapshots made using RCS through VC are visible even when you bypass VC.
-
-  With CVS, Meta-CVS, and Subversion, VC also uses the native
-mechanism provided by that back end to make snapshots and retrieve them
-(@dfn{tags} for CVS and Meta-CVS, @dfn{copies} for Subversion).
-
-@c worded verbosely to avoid overfull hbox.
-  For SCCS, VC implements snapshots itself.  The files it uses contain
-name/file/version-number triples.  These snapshots are visible only
-through VC.
-
-  There is no support for VC snapshots using GNU Arch yet.
-
-  A snapshot is a set of checked-in versions.  So make sure that all the
-files are checked in and not locked when you make a snapshot.
-
-  File renaming and deletion can create some difficulties with snapshots.
-This is not a VC-specific problem, but a general design issue in version
-control systems that no one has solved very well yet.
-
-  If you rename a registered file, you need to rename its master along
-with it (the command @code{vc-rename-file} does this automatically).  If
-you are using SCCS, you must also update the records of the snapshot, to
-mention the file by its new name (@code{vc-rename-file} does this,
-too).  An old snapshot that refers to a master file that no longer
-exists under the recorded name is invalid; VC can no longer retrieve
-it.  It would be beyond the scope of this manual to explain enough about
-RCS and SCCS to explain how to update the snapshots by hand.
-
-  Using @code{vc-rename-file} makes the snapshot remain valid for
-retrieval, but it does not solve all problems.  For example, some of the
-files in your program probably refer to others by name.  At the very
-least, the makefile probably mentions the file that you renamed.  If you
-retrieve an old snapshot, the renamed file is retrieved under its new
-name, which is not the name that the makefile expects.  So the program
-won't really work as retrieved.
-
-@node Miscellaneous VC
-@section Miscellaneous Commands and Features of VC
-
-  This section explains the less-frequently-used features of VC.
-
-@menu
-* Change Logs and VC::  Generating a change log file from log entries.
-* Renaming and VC::     A command to rename both the source and master
-                          file correctly.
-* Version Headers::     Inserting version control headers into working files.
-@end menu
-
-@node Change Logs and VC
-@subsection Change Logs and VC
-
-  If you use RCS or CVS for a program and also maintain a change log
-file for it (@pxref{Change Log,,,emacs, the Emacs Manual}), you
-can generate change log entries automatically from the version control
-log entries:
-
-@table @kbd
-@item C-x v a
-@kindex C-x v a
-@findex vc-update-change-log
-Visit the current directory's change log file and, for registered files
-in that directory, create new entries for versions checked in since the
-most recent entry in the change log file.
-(@code{vc-update-change-log}).
-
-This command works with RCS or CVS only, not with any of the other
-back ends.
-
-@item C-u C-x v a
-As above, but only find entries for the current buffer's file.
-
-@item M-1 C-x v a
-As above, but find entries for all the currently visited files that are
-maintained with version control.  This works only with RCS, and it puts
-all entries in the log for the default directory, which may not be
-appropriate.
-@end table
-
-  For example, suppose the first line of @file{ChangeLog} is dated
-1999-04-10, and that the only check-in since then was by Nathaniel
-Bowditch to @file{rcs2log} on 1999-05-22 with log text @samp{Ignore log
-messages that start with `#'.}.  Then @kbd{C-x v a} visits
-@file{ChangeLog} and inserts text like this:
-
-@iftex
-@medbreak
-@end iftex
-@smallexample
-@group
-1999-05-22  Nathaniel Bowditch  <nat@@apn.org>
-
-        * rcs2log: Ignore log messages that start with `#'.
-@end group
-@end smallexample
-@iftex
-@medbreak
-@end iftex
-
-@noindent
-You can then edit the new change log entry further as you wish.
-
-  Some of the new change log entries may duplicate what's already in
-ChangeLog.  You will have to remove these duplicates by hand.
-
-  Normally, the log entry for file @file{foo} is displayed as @samp{*
-foo: @var{text of log entry}}.  The @samp{:} after @file{foo} is omitted
-if the text of the log entry starts with @w{@samp{(@var{functionname}):
-}}.  For example, if the log entry for @file{vc.el} is
-@samp{(vc-do-command): Check call-process status.}, then the text in
-@file{ChangeLog} looks like this:
-
-@iftex
-@medbreak
-@end iftex
-@smallexample
-@group
-1999-05-06  Nathaniel Bowditch  <nat@@apn.org>
-
-        * vc.el (vc-do-command): Check call-process status.
-@end group
-@end smallexample
-@iftex
-@medbreak
-@end iftex
-
-  When @kbd{C-x v a} adds several change log entries at once, it groups
-related log entries together if they all are checked in by the same
-author at nearly the same time.  If the log entries for several such
-files all have the same text, it coalesces them into a single entry.
-For example, suppose the most recent check-ins have the following log
-entries:
-
-@flushleft
-@bullet{} For @file{vc.texinfo}: @samp{Fix expansion typos.}
-@bullet{} For @file{vc.el}: @samp{Don't call expand-file-name.}
-@bullet{} For @file{vc-hooks.el}: @samp{Don't call expand-file-name.}
-@end flushleft
-
-@noindent
-They appear like this in @file{ChangeLog}:
-
-@iftex
-@medbreak
-@end iftex
-@smallexample
-@group
-1999-04-01  Nathaniel Bowditch  <nat@@apn.org>
-
-        * vc.texinfo: Fix expansion typos.
-
-        * vc.el, vc-hooks.el: Don't call expand-file-name.
-@end group
-@end smallexample
-@iftex
-@medbreak
-@end iftex
-
-  Normally, @kbd{C-x v a} separates log entries by a blank line, but you
-can mark several related log entries to be clumped together (without an
-intervening blank line) by starting the text of each related log entry
-with a label of the form @w{@samp{@{@var{clumpname}@} }}.  The label
-itself is not copied to @file{ChangeLog}.  For example, suppose the log
-entries are:
+@include emerge-xtra.texi
 
-@flushleft
-@bullet{} For @file{vc.texinfo}: @samp{@{expand@} Fix expansion typos.}
-@bullet{} For @file{vc.el}: @samp{@{expand@} Don't call expand-file-name.}
-@bullet{} For @file{vc-hooks.el}: @samp{@{expand@} Don't call expand-file-name.}
-@end flushleft
-
-@noindent
-Then the text in @file{ChangeLog} looks like this:
-
-@iftex
-@medbreak
-@end iftex
-@smallexample
-@group
-1999-04-01  Nathaniel Bowditch  <nat@@apn.org>
-
-        * vc.texinfo: Fix expansion typos.
-        * vc.el, vc-hooks.el: Don't call expand-file-name.
-@end group
-@end smallexample
-@iftex
-@medbreak
-@end iftex
-
-  A log entry whose text begins with @samp{#} is not copied to
-@file{ChangeLog}.  For example, if you merely fix some misspellings in
-comments, you can log the change with an entry beginning with @samp{#}
-to avoid putting such trivia into @file{ChangeLog}.
-
-@node Renaming and VC
-@subsection Renaming VC Work Files and Master Files
-
-@findex vc-rename-file
-  When you rename a registered file, you must also rename its master
-file correspondingly to get proper results.  Use @code{vc-rename-file}
-to rename the source file as you specify, and rename its master file
-accordingly.  It also updates any snapshots (@pxref{Snapshots}) that
-mention the file, so that they use the new name; despite this, the
-snapshot thus modified may not completely work (@pxref{Snapshot
-Caveats}).
-
-  Some back ends do not provide an explicit rename operation to their
-repositories.  After issuing @code{vc-rename-file}, use @kbd{C-x v v}
-on the original and renamed buffers and provide the necessary edit
-log.
-
-  You cannot use @code{vc-rename-file} on a file that is locked by
-someone else.
-
-@node Version Headers
-@subsection Inserting Version Control Headers
-
-   Sometimes it is convenient to put version identification strings
-directly into working files.  Certain special strings called
-@dfn{version headers} are replaced in each successive version by the
-number of that version, the name of the user who created it, and other
-relevant information.  All of the back ends that VC supports have such
-a mechanism, except GNU Arch.
-
-  VC does not normally use the information contained in these headers.
-The exception is RCS---with RCS, version headers are sometimes more
-reliable than the master file to determine which version of the file
-you are editing.  Note that in a multi-branch environment, version
-headers are necessary to make VC behave correctly (@pxref{Multi-User
-Branching,,,emacs, the Emacs Manual}).
-
-  Searching for RCS version headers is controlled by the variable
-@code{vc-consult-headers}.  If it is non-@code{nil} (the default),
-Emacs searches for headers to determine the version number you are
-editing.  Setting it to @code{nil} disables this feature.
-
-  Note that although CVS uses the same kind of version headers as RCS
-does, VC never searches for these headers if you are using CVS,
-regardless of the above setting.
-
-@kindex C-x v h
-@findex vc-insert-headers
-  You can use the @kbd{C-x v h} command (@code{vc-insert-headers}) to
-insert a suitable header string.
-
-@table @kbd
-@item C-x v h
-Insert headers in a file for use with your version-control system.
-@end table
-
-@vindex vc-@var{backend}-header
-  The default header string is @samp{@w{$}Id$} for RCS and
-@samp{@w{%}W%} for SCCS.  You can specify other headers to insert by
-setting the variables @code{vc-@var{backend}-header} where
-@var{backend} is @code{rcs} or @code{sccs}.
-
-  Instead of a single string, you can specify a list of strings; then
-each string in the list is inserted as a separate header on a line of
-its own.
-
-  It may be necessary to use apparently-superfluous backslashes when
-writing the strings that you put in this variable.  For instance, you
-might write @code{"$Id\$"} rather than @code{"$Id@w{$}"}.  The extra
-backslash prevents the string constant from being interpreted as a
-header, if the Emacs Lisp file containing it is maintained with
-version control.
-
-@vindex vc-comment-alist
-  Each header is inserted surrounded by tabs, inside comment delimiters,
-on a new line at point.  Normally the ordinary comment
-start and comment end strings of the current mode are used, but for
-certain modes, there are special comment delimiters for this purpose;
-the variable @code{vc-comment-alist} specifies them.  Each element of
-this list has the form @code{(@var{mode} @var{starter} @var{ender})}.
-
-@vindex vc-static-header-alist
-  The variable @code{vc-static-header-alist} specifies further strings
-to add based on the name of the buffer.  Its value should be a list of
-elements of the form @code{(@var{regexp} . @var{format})}.  Whenever
-@var{regexp} matches the buffer name, @var{format} is inserted as part
-of the header.  A header line is inserted for each element that matches
-the buffer name, and for each string specified by
-@code{vc-@var{backend}-header}.  The header line is made by processing the
-string from @code{vc-@var{backend}-header} with the format taken from the
-element.  The default value for @code{vc-static-header-alist} is as follows:
-
-@example
-@group
-(("\\.c$" .
-  "\n#ifndef lint\nstatic char vcid[] = \"\%s\";\n\
-#endif /* lint */\n"))
-@end group
-@end example
-
-@noindent
-It specifies insertion of text of this form:
-
-@example
-@group
-
-#ifndef lint
-static char vcid[] = "@var{string}";
-#endif /* lint */
-@end group
-@end example
-
-@noindent
-Note that the text above starts with a blank line.
-
-  If you use more than one version header in a file, put them close
-together in the file.  The mechanism in @code{revert-buffer} that
-preserves markers may not handle markers positioned between two version
-headers.
-
-@node Customizing VC
-@section Customizing VC
-
-@vindex vc-handled-backends
-The variable @code{vc-handled-backends} determines which version
-control systems VC should handle.  The default value is @code{(RCS CVS
-SVN SCCS Arch MCVS)}, so it contains all six version systems that are
-currently supported.  If you want VC to ignore one or more of these
-systems, exclude its name from the list.  To disable VC entirely, set
-this variable to @code{nil}.
-
-The order of systems in the list is significant: when you visit a file
-registered in more than one system (@pxref{Local Version Control}), VC
-uses the system that comes first in @code{vc-handled-backends} by
-default.  The order is also significant when you register a file for
-the first time, @pxref{Registering,,,emacs, the Emacs Manual} for
-details.
-
-@menu
-* General VC Options::  Options that apply to multiple back ends.
-* RCS and SCCS::        Options for RCS and SCCS.
-* CVS Options::         Options for CVS.
-@end menu
-
-@node General VC Options
-@subsection General Options
-
-@vindex vc-make-backup-files
-  Emacs normally does not save backup files for source files that are
-maintained with version control.  If you want to make backup files even
-for files that use version control, set the variable
-@code{vc-make-backup-files} to a non-@code{nil} value.
-
-@vindex vc-keep-workfiles
-  Normally the work file exists all the time, whether it is locked or
-not.  If you set @code{vc-keep-workfiles} to @code{nil}, then checking
-in a new version with @kbd{C-x v v} deletes the work file; but any
-attempt to visit the file with Emacs creates it again.  (With CVS, work
-files are always kept.)
-
-@vindex vc-follow-symlinks
-  Editing a version-controlled file through a symbolic link can be
-dangerous.  It bypasses the version control system---you can edit the
-file without locking it, and fail to check your changes in.  Also,
-your changes might overwrite those of another user.  To protect against
-this, VC checks each symbolic link that you visit, to see if it points
-to a file under version control.
-
-  The variable @code{vc-follow-symlinks} controls what to do when a
-symbolic link points to a version-controlled file.  If it is @code{nil},
-VC only displays a warning message.  If it is @code{t}, VC automatically
-follows the link, and visits the real file instead, telling you about
-this in the echo area.  If the value is @code{ask} (the default), VC
-asks you each time whether to follow the link.
-
-@vindex vc-suppress-confirm
-  If @code{vc-suppress-confirm} is non-@code{nil}, then @kbd{C-x v v}
-and @kbd{C-x v i} can save the current buffer without asking, and
-@kbd{C-x v u} also operates without asking for confirmation.  (This
-variable does not affect @kbd{C-x v c}; that operation is so drastic
-that it should always ask for confirmation.)
-
-@vindex vc-command-messages
-  VC mode does much of its work by running the shell commands for RCS,
-CVS and SCCS.  If @code{vc-command-messages} is non-@code{nil}, VC
-displays messages to indicate which shell commands it runs, and
-additional messages when the commands finish.
-
-@vindex vc-path
-  You can specify additional directories to search for version control
-programs by setting the variable @code{vc-path}.  These directories
-are searched before the usual search path.  It is rarely necessary to
-set this variable, because VC normally finds the proper files
-automatically.
-
-@node RCS and SCCS
-@subsection Options for RCS and SCCS
-
-@cindex non-strict locking (RCS)
-@cindex locking, non-strict (RCS)
-  By default, RCS uses locking to coordinate the activities of several
-users, but there is a mode called @dfn{non-strict locking} in which
-you can check-in changes without locking the file first.  Use
-@samp{rcs -U} to switch to non-strict locking for a particular file,
-see the @code{rcs} manual page for details.
-
-  When deducing the version control state of an RCS file, VC first
-looks for an RCS version header string in the file (@pxref{Version
-Headers}).  If there is no header string, VC normally looks at the
-file permissions of the work file; this is fast.  But there might be
-situations when the file permissions cannot be trusted.  In this case
-the master file has to be consulted, which is rather expensive.  Also
-the master file can only tell you @emph{if} there's any lock on the
-file, but not whether your work file really contains that locked
-version.
-
-@vindex vc-consult-headers
-  You can tell VC not to use version headers to determine the file
-status by setting @code{vc-consult-headers} to @code{nil}.  VC then
-always uses the file permissions (if it is supposed to trust them), or
-else checks the master file.
-
-@vindex vc-mistrust-permissions
-  You can specify the criterion for whether to trust the file
-permissions by setting the variable @code{vc-mistrust-permissions}.
-Its value can be @code{t} (always mistrust the file permissions and
-check the master file), @code{nil} (always trust the file
-permissions), or a function of one argument which makes the decision.
-The argument is the directory name of the @file{RCS} subdirectory.  A
-non-@code{nil} value from the function says to mistrust the file
-permissions.  If you find that the file permissions of work files are
-changed erroneously, set @code{vc-mistrust-permissions} to @code{t}.
-Then VC always checks the master file to determine the file's status.
-
-  VC determines the version control state of files under SCCS much as
-with RCS.  It does not consider SCCS version headers, though.  Thus,
-the variable @code{vc-mistrust-permissions} affects SCCS use, but
-@code{vc-consult-headers} does not.
-
-@node CVS Options
-@subsection Options specific for CVS
-
-@cindex locking (CVS)
-  By default, CVS does not use locking to coordinate the activities of
-several users; anyone can change a work file at any time.  However,
-there are ways to restrict this, resulting in behavior that resembles
-locking.
-
-@cindex CVSREAD environment variable (CVS)
-  For one thing, you can set the @env{CVSREAD} environment variable
-(the value you use makes no difference).  If this variable is defined,
-CVS makes your work files read-only by default.  In Emacs, you must
-type @kbd{C-x v v} to make the file writable, so that editing works
-in fact similar as if locking was used.  Note however, that no actual
-locking is performed, so several users can make their files writable
-at the same time.  When setting @env{CVSREAD} for the first time, make
-sure to check out all your modules anew, so that the file protections
-are set correctly.
-
-@cindex cvs watch feature
-@cindex watching files (CVS)
-  Another way to achieve something similar to locking is to use the
-@dfn{watch} feature of CVS.  If a file is being watched, CVS makes it
-read-only by default, and you must also use @kbd{C-x v v} in Emacs to
-make it writable.  VC calls @code{cvs edit} to make the file writable,
-and CVS takes care to notify other developers of the fact that you
-intend to change the file.  See the CVS documentation for details on
-using the watch feature.
-
-@vindex vc-stay-local
-@vindex vc-cvs-stay-local
-@cindex remote repositories (CVS)
-  When a file's repository is on a remote machine, VC tries to keep
-network interactions to a minimum.  This is controlled by the variable
-@code{vc-cvs-stay-local}.  There is another variable,
-@code{vc-stay-local}, which enables the feature also for other back
-ends that support it, including CVS.  In the following, we will talk
-only about @code{vc-cvs-stay-local}, but everything applies to
-@code{vc-stay-local} as well.
-
-If @code{vc-cvs-stay-local} is @code{t} (the default), then VC uses
-only the entry in the local CVS subdirectory to determine the file's
-state (and possibly information returned by previous CVS commands).
-One consequence of this is that when you have modified a file, and
-somebody else has already checked in other changes to the file, you
-are not notified of it until you actually try to commit.  (But you can
-try to pick up any recent changes from the repository first, using
-@kbd{C-x v m @key{RET}}, @pxref{Merging,,,emacs, the Emacs Manual}).
-
-  When @code{vc-cvs-stay-local} is @code{t}, VC also makes local
-version backups, so that simple diff and revert operations are
-completely local (@pxref{Version Backups}).
-
-  On the other hand, if you set @code{vc-cvs-stay-local} to @code{nil},
-then VC queries the remote repository @emph{before} it decides what to
-do in @code{vc-next-action} (@kbd{C-x v v}), just as it does for local
-repositories.  It also does not make any version backups.
-
-  You can also set @code{vc-cvs-stay-local} to a regular expression
-that is matched against the repository host name; VC then stays local
-only for repositories from hosts that match the pattern.
-
-@vindex vc-cvs-global-switches
-  You can specify additional command line options to pass to all CVS
-operations in the variable @code{vc-cvs-global-switches}.  These
-switches are inserted immediately after the @code{cvs} command, before
-the name of the operation to invoke.
-
-
-@node Fortran
-@chapter Fortran Mode
-@cindex Fortran mode
-@cindex mode, Fortran
-
-  Fortran mode provides special motion commands for Fortran statements
-and subprograms, and indentation commands that understand Fortran
-conventions of nesting, line numbers and continuation statements.
-Fortran mode has support for Auto Fill mode that breaks long lines into
-proper Fortran continuation lines.
-
-  Special commands for comments are provided because Fortran comments
-are unlike those of other languages.  Built-in abbrevs optionally save
-typing when you insert Fortran keywords.
-
-  Use @kbd{M-x fortran-mode} to switch to this major mode.  This
-command runs the hook @code{fortran-mode-hook}.  @xref{Hooks,,, emacs,
-the Emacs Manual}.
-
-@cindex Fortran77 and Fortran90
-@findex f90-mode
-@findex fortran-mode
-  Fortran mode is meant for editing Fortran77 ``fixed format'' (and also
-``tab format'') source code.  For editing the modern Fortran90 or
-Fortran95 ``free format'' source code, use F90 mode (@code{f90-mode}).
-Emacs normally uses Fortran mode for files with extension @samp{.f},
-@samp{.F} or @samp{.for}, and F90 mode for the extension @samp{.f90} and
-@samp{.f95}.  GNU Fortran supports both kinds of format.
-
-@menu
-* Motion: Fortran Motion.	 Moving point by statements or subprograms.
-* Indent: Fortran Indent.	 Indentation commands for Fortran.
-* Comments: Fortran Comments.	 Inserting and aligning comments.
-* Autofill: Fortran Autofill.	 Auto fill support for Fortran.
-* Columns: Fortran Columns.	 Measuring columns for valid Fortran.
-* Abbrev: Fortran Abbrev.	 Built-in abbrevs for Fortran keywords.
-@end menu
-
-@node Fortran Motion
-@section Motion Commands
-
-  In addition to the normal commands for moving by and operating on
-``defuns'' (Fortran subprograms---functions and subroutines, as well as
-modules for F90 mode), Fortran mode provides special commands to move by
-statements and other program units.
-
-@table @kbd
-@kindex C-c C-n @r{(Fortran mode)}
-@findex fortran-next-statement
-@findex f90-next-statement
-@item C-c C-n
-Move to the beginning of the next statement
-(@code{fortran-next-statement}/@code{f90-next-statement}).
-
-@kindex C-c C-p @r{(Fortran mode)}
-@findex fortran-previous-statement
-@findex f90-previous-statement
-@item C-c C-p
-Move to the beginning of the previous statement
-(@code{fortran-previous-statement}/@code{f90-previous-statement}).
-If there is no previous statement (i.e. if called from the first
-statement in the buffer), move to the start of the buffer.
-
-@kindex C-c C-e @r{(F90 mode)}
-@findex f90-next-block
-@item C-c C-e
-Move point forward to the start of the next code block
-(@code{f90-next-block}).  A code block is a subroutine,
-@code{if}--@code{endif} statement, and so forth.  This command exists
-for F90 mode only, not Fortran mode.  With a numeric argument, this
-moves forward that many blocks.
-
-@kindex C-c C-a @r{(F90 mode)}
-@findex f90-previous-block
-@item C-c C-a
-Move point backward to the previous code block
-(@code{f90-previous-block}).  This is like @code{f90-next-block}, but
-moves backwards.
-
-@kindex C-M-n @r{(Fortran mode)}
-@findex fortran-end-of-block
-@findex f90-end-of-block
-@item C-M-n
-Move to the end of the current code block
-(@code{fortran-end-of-block}/@code{f90-end-of-block}).  With a numeric
-agument, move forward that number of blocks.  The mark is set before
-moving point.  The F90 mode version of this command checks for
-consistency of block types and labels (if present), but it does not
-check the outermost block since that may be incomplete.
-
-@kindex C-M-p @r{(Fortran mode)}
-@findex fortran-beginning-of-block
-@findex f90-beginning-of-block
-@item C-M-p
-Move to the start of the current code block
-(@code{fortran-beginning-of-block}/@code{f90-beginning-of-block}). This
-is like @code{fortran-end-of-block}, but moves backwards.
-@end table
-
-@node Fortran Indent
-@section Fortran Indentation
-
-  Special commands and features are needed for indenting Fortran code in
-order to make sure various syntactic entities (line numbers, comment line
-indicators and continuation line flags) appear in the columns that are
-required for standard, fixed (or tab) format Fortran.
-
-@menu
-* Commands: ForIndent Commands.  Commands for indenting and filling Fortran.
-* Contline: ForIndent Cont.      How continuation lines indent.
-* Numbers:  ForIndent Num.       How line numbers auto-indent.
-* Conv:     ForIndent Conv.      Conventions you must obey to avoid trouble.
-* Vars:     ForIndent Vars.      Variables controlling Fortran indent style.
-@end menu
-
-@node ForIndent Commands
-@subsection Fortran Indentation and Filling Commands
-
-@table @kbd
-@item C-M-j
-Break the current line at point and set up a continuation line
-(@code{fortran-split-line}).
-@item M-^
-Join this line to the previous line (@code{fortran-join-line}).
-@item C-M-q
-Indent all the lines of the subprogram point is in
-(@code{fortran-indent-subprogram}).
-@item M-q
-Fill a comment block or statement.
-@end table
+@include vc-xtra.texi
 
-@kindex C-M-q @r{(Fortran mode)}
-@findex fortran-indent-subprogram
-  The key @kbd{C-M-q} runs @code{fortran-indent-subprogram}, a command
-to reindent all the lines of the Fortran subprogram (function or
-subroutine) containing point.
-
-@kindex C-M-j @r{(Fortran mode)}
-@findex fortran-split-line
-  The key @kbd{C-M-j} runs @code{fortran-split-line}, which splits
-a line in the appropriate fashion for Fortran.  In a non-comment line,
-the second half becomes a continuation line and is indented
-accordingly.  In a comment line, both halves become separate comment
-lines.
-
-@kindex M-^ @r{(Fortran mode)}
-@kindex C-c C-d @r{(Fortran mode)}
-@findex fortran-join-line
-  @kbd{M-^} or @kbd{C-c C-d} runs the command @code{fortran-join-line},
-which joins a continuation line back to the previous line, roughly as
-the inverse of @code{fortran-split-line}.  The point must be on a
-continuation line when this command is invoked.
-
-@kindex M-q @r{(Fortran mode)}
-@kbd{M-q} in Fortran mode fills the comment block or statement that
-point is in.  This removes any excess statement continuations.
-
-@node ForIndent Cont
-@subsection Continuation Lines
-@cindex Fortran continuation lines
-
-@vindex fortran-continuation-string
-  Most Fortran77 compilers allow two ways of writing continuation lines.
-If the first non-space character on a line is in column 5, then that
-line is a continuation of the previous line.  We call this @dfn{fixed
-format}.  (In GNU Emacs we always count columns from 0; but note that
-the Fortran standard counts from 1.)  The variable
-@code{fortran-continuation-string} specifies what character to put in
-column 5.  A line that starts with a tab character followed by any digit
-except @samp{0} is also a continuation line.  We call this style of
-continuation @dfn{tab format}.  (Fortran90 introduced ``free format'',
-with another style of continuation lines).
-
-@vindex indent-tabs-mode @r{(Fortran mode)}
-@vindex fortran-analyze-depth
-@vindex fortran-tab-mode-default
-  Fortran mode can use either style of continuation line.  When you
-enter Fortran mode, it tries to deduce the proper continuation style
-automatically from the buffer contents.  It does this by scanning up to
-@code{fortran-analyze-depth} (default 100) lines from the start of the
-buffer.  The first line that begins with either a tab character or six
-spaces determines the choice.  If the scan fails (for example, if the
-buffer is new and therefore empty), the value of
-@code{fortran-tab-mode-default} (@code{nil} for fixed format, and
-non-@code{nil} for tab format) is used.  @samp{/t} in the mode line
-indicates tab format is selected.  Fortran mode sets the value of
-@code{indent-tabs-mode} accordingly.
-
-  If the text on a line starts with the Fortran continuation marker
-@samp{$}, or if it begins with any non-whitespace character in column
-5, Fortran mode treats it as a continuation line.  When you indent a
-continuation line with @key{TAB}, it converts the line to the current
-continuation style.  When you split a Fortran statement with
-@kbd{C-M-j}, the continuation marker on the newline is created according
-to the continuation style.
-
-  The setting of continuation style affects several other aspects of
-editing in Fortran mode.  In fixed format mode, the minimum column
-number for the body of a statement is 6.  Lines inside of Fortran
-blocks that are indented to larger column numbers always use only the
-space character for whitespace.  In tab format mode, the minimum
-column number for the statement body is 8, and the whitespace before
-column 8 must always consist of one tab character.
-
-@node ForIndent Num
-@subsection Line Numbers
-
-  If a number is the first non-whitespace in the line, Fortran
-indentation assumes it is a line number and moves it to columns 0
-through 4.  (Columns always count from 0 in GNU Emacs.)
-
-@vindex fortran-line-number-indent
-  Line numbers of four digits or less are normally indented one space.
-The variable @code{fortran-line-number-indent} controls this; it
-specifies the maximum indentation a line number can have.  The default
-value of the variable is 1.  Fortran mode tries to prevent line number
-digits passing column 4, reducing the indentation below the specified
-maximum if necessary.  If @code{fortran-line-number-indent} has the
-value 5, line numbers are right-justified to end in column 4.
-
-@vindex fortran-electric-line-number
-  Simply inserting a line number is enough to indent it according to
-these rules.  As each digit is inserted, the indentation is recomputed.
-To turn off this feature, set the variable
-@code{fortran-electric-line-number} to @code{nil}.
-
-
-@node ForIndent Conv
-@subsection Syntactic Conventions
-
-  Fortran mode assumes that you follow certain conventions that simplify
-the task of understanding a Fortran program well enough to indent it
-properly:
-
-@itemize @bullet
-@item
-Two nested @samp{do} loops never share a @samp{continue} statement.
-
-@item
-Fortran keywords such as @samp{if}, @samp{else}, @samp{then}, @samp{do}
-and others are written without embedded whitespace or line breaks.
-
-Fortran compilers generally ignore whitespace outside of string
-constants, but Fortran mode does not recognize these keywords if they
-are not contiguous.  Constructs such as @samp{else if} or @samp{end do}
-are acceptable, but the second word should be on the same line as the
-first and not on a continuation line.
-@end itemize
-
-@noindent
-If you fail to follow these conventions, the indentation commands may
-indent some lines unaesthetically.  However, a correct Fortran program
-retains its meaning when reindented even if the conventions are not
-followed.
-
-@node ForIndent Vars
-@subsection Variables for Fortran Indentation
-
-@vindex fortran-do-indent
-@vindex fortran-if-indent
-@vindex fortran-structure-indent
-@vindex fortran-continuation-indent
-@vindex fortran-check-all-num@dots{}
-@vindex fortran-minimum-statement-indent@dots{}
-  Several additional variables control how Fortran indentation works:
-
-@table @code
-@item fortran-do-indent
-Extra indentation within each level of @samp{do} statement (default 3).
-
-@item fortran-if-indent
-Extra indentation within each level of @samp{if}, @samp{select case}, or
-@samp{where} statements (default 3).
-
-@item fortran-structure-indent
-Extra indentation within each level of @samp{structure}, @samp{union},
-@samp{map}, or @samp{interface} statements (default 3).
-
-@item fortran-continuation-indent
-Extra indentation for bodies of continuation lines (default 5).
-
-@item fortran-check-all-num-for-matching-do
-In Fortran77, a numbered @samp{do} statement is ended by any statement
-with a matching line number.  It is common (but not compulsory) to use a
-@samp{continue} statement for this purpose.  If this variable has a
-non-@code{nil} value, indenting any numbered statement must check for a
-@samp{do} that ends there.  If you always end @samp{do} statements with
-a @samp{continue} line (or if you use the more modern @samp{enddo}),
-then you can speed up indentation by setting this variable to
-@code{nil}.  The default is @code{nil}.
-
-@item fortran-blink-matching-if
-If this is @code{t}, indenting an @samp{endif} (or @samp{enddo}
-statement moves the cursor momentarily to the matching @samp{if} (or
-@samp{do}) statement to show where it is.  The default is @code{nil}.
-
-@item fortran-minimum-statement-indent-fixed
-Minimum indentation for Fortran statements when using fixed format
-continuation line style.  Statement bodies are never indented less than
-this much.  The default is 6.
-
-@item fortran-minimum-statement-indent-tab
-Minimum indentation for Fortran statements for tab format continuation line
-style.  Statement bodies are never indented less than this much.  The
-default is 8.
-@end table
-
-The variables controlling the indentation of comments are described in
-the following section.
-
-@node Fortran Comments
-@section Fortran Comments
-
-  The usual Emacs comment commands assume that a comment can follow a
-line of code.  In Fortran77, the standard comment syntax requires an
-entire line to be just a comment.  Therefore, Fortran mode replaces the
-standard Emacs comment commands and defines some new variables.
-
-@vindex fortran-comment-line-start
-  Fortran mode can also handle the Fortran90 comment syntax where comments
-start with @samp{!} and can follow other text.  Because only some Fortran77
-compilers accept this syntax, Fortran mode will not insert such comments
-unless you have said in advance to do so.  To do this, set the variable
-@code{fortran-comment-line-start} to @samp{"!"}.
-
-@table @kbd
-@item M-;
-Align comment or insert new comment (@code{fortran-indent-comment}).
-
-@item C-x ;
-Applies to nonstandard @samp{!} comments only.
-
-@item C-c ;
-Turn all lines of the region into comments, or (with argument) turn them back
-into real code (@code{fortran-comment-region}).
-@end table
-
-@findex fortran-indent-comment
-  @kbd{M-;} in Fortran mode is redefined as the command
-@code{fortran-indent-comment}.  Like the usual @kbd{M-;} command, this
-recognizes any kind of existing comment and aligns its text appropriately;
-if there is no existing comment, a comment is inserted and aligned.  But
-inserting and aligning comments are not the same in Fortran mode as in
-other modes.
-
-  When a new comment must be inserted, if the current line is blank, a
-full-line comment is inserted.  On a non-blank line, a nonstandard @samp{!}
-comment is inserted if you have said you want to use them.  Otherwise a
-full-line comment is inserted on a new line before the current line.
-
-  Nonstandard @samp{!} comments are aligned like comments in other
-languages, but full-line comments are different.  In a standard full-line
-comment, the comment delimiter itself must always appear in column zero.
-What can be aligned is the text within the comment.  You can choose from
-three styles of alignment by setting the variable
-@code{fortran-comment-indent-style} to one of these values:
-
-@vindex fortran-comment-indent-style
-@vindex fortran-comment-line-extra-indent
-@table @code
-@item fixed
-Align the text at a fixed column, which is the sum of
-@code{fortran-comment-line-extra-indent} and the minimum statement
-indentation.  This is the default.
-
-The minimum statement indentation is
-@code{fortran-minimum-statement-indent-fixed} for fixed format
-continuation line style and @code{fortran-minimum-statement-indent-tab}
-for tab format style.
-
-@item relative
-Align the text as if it were a line of code, but with an additional
-@code{fortran-comment-line-extra-indent} columns of indentation.
-
-@item nil
-Don't move text in full-line comments automatically.
-@end table
-
-@vindex fortran-comment-indent-char
-  In addition, you can specify the character to be used to indent within
-full-line comments by setting the variable
-@code{fortran-comment-indent-char} to the single-character string you want
-to use.
-
-@vindex fortran-directive-re
-  Compiler directive lines, or preprocessor lines, have much the same
-appearance as comment lines.  It is important, though, that such lines
-never be indented at all, no matter what the value of
-@code{fortran-comment-indent-style}.  The variable
-@code{fortran-directive-re} is a regular expression that specifies which
-lines are directives.  Matching lines are never indented, and receive
-distinctive font-locking.
-
-  The normal Emacs comment command @kbd{C-x ;} has not been redefined.  If
-you use @samp{!} comments, this command can be used with them.  Otherwise
-it is useless in Fortran mode.
-
-@kindex C-c ; @r{(Fortran mode)}
-@findex fortran-comment-region
-@vindex fortran-comment-region
-  The command @kbd{C-c ;} (@code{fortran-comment-region}) turns all the
-lines of the region into comments by inserting the string @samp{C$$$} at
-the front of each one.  With a numeric argument, it turns the region
-back into live code by deleting @samp{C$$$} from the front of each line
-in it.  The string used for these comments can be controlled by setting
-the variable @code{fortran-comment-region}.  Note that here we have an
-example of a command and a variable with the same name; these two uses
-of the name never conflict because in Lisp and in Emacs it is always
-clear from the context which one is meant.
-
-@node Fortran Autofill
-@section Auto Fill in Fortran Mode
-
-  Fortran mode has specialized support for Auto Fill mode, which is a
-minor mode that automatically splits statements as you insert them
-when they become too wide.  Splitting a statement involves making
-continuation lines using @code{fortran-continuation-string}
-(@pxref{ForIndent Cont}).  This splitting happens when you type
-@key{SPC}, @key{RET}, or @key{TAB}, and also in the Fortran
-indentation commands.  You activate Auto Fill in Fortran mode in the
-normal way.  @xref{Auto Fill,,, emacs, the Emacs Manual}.
-
-@vindex fortran-break-before-delimiters
-   Auto Fill breaks lines at spaces or delimiters when the lines get
-longer than the desired width (the value of @code{fill-column}).  The
-delimiters (besides whitespace) that Auto Fill can break at are
-@samp{+}, @samp{-}, @samp{/}, @samp{*}, @samp{=}, @samp{<}, @samp{>},
-and @samp{,}.  The line break comes after the delimiter if the
-variable @code{fortran-break-before-delimiters} is @code{nil}.
-Otherwise (and by default), the break comes before the delimiter.
-
-  To enable Auto Fill in all Fortran buffers, add
-@code{turn-on-auto-fill} to @code{fortran-mode-hook}.  @xref{Hooks,,,
-emacs, the Emacs Manual}.
-
-@node Fortran Columns
-@section Checking Columns in Fortran
-
-@table @kbd
-@item C-c C-r
-Display a ``column ruler'' momentarily above the current line
-(@code{fortran-column-ruler}).
-@item C-c C-w
-Split the current window horizontally temporarily so that it is 72
-columns wide (@code{fortran-window-create-momentarily}).  This may
-help you avoid making lines longer than the 72-character limit that
-some Fortran compilers impose.
-@item C-u C-c C-w
-Split the current window horizontally so that it is 72 columns wide
-(@code{fortran-window-create}).  You can then continue editing.
-@item M-x fortran-strip-sequence-nos
-Delete all text in column 72 and beyond.
-@end table
-
-@kindex C-c C-r @r{(Fortran mode)}
-@findex fortran-column-ruler
-  The command @kbd{C-c C-r} (@code{fortran-column-ruler}) shows a column
-ruler momentarily above the current line.  The comment ruler is two lines
-of text that show you the locations of columns with special significance in
-Fortran programs.  Square brackets show the limits of the columns for line
-numbers, and curly brackets show the limits of the columns for the
-statement body.  Column numbers appear above them.
-
-  Note that the column numbers count from zero, as always in GNU Emacs.
-As a result, the numbers may be one less than those you are familiar
-with; but the positions they indicate in the line are standard for
-Fortran.
-
-@vindex fortran-column-ruler-fixed
-@vindex fortran-column-ruler-tabs
-  The text used to display the column ruler depends on the value of the
-variable @code{indent-tabs-mode}.  If @code{indent-tabs-mode} is
-@code{nil}, then the value of the variable
-@code{fortran-column-ruler-fixed} is used as the column ruler.
-Otherwise, the value of the variable @code{fortran-column-ruler-tab} is
-displayed.  By changing these variables, you can change the column ruler
-display.
-
-@kindex C-c C-w @r{(Fortran mode)}
-@findex fortran-window-create-momentarily
-  @kbd{C-c C-w} (@code{fortran-window-create-momentarily}) temporarily
-splits the current window horizontally, making a window 72 columns
-wide, so you can see any lines that are too long.  Type a space to
-restore the normal width.
-
-@kindex C-u C-c C-w @r{(Fortran mode)}
-@findex fortran-window-create
-  You can also split the window horizontally and continue editing with
-the split in place.  To do this, use @kbd{C-u C-c C-w} (@code{M-x
-fortran-window-create}).  By editing in this window you can
-immediately see when you make a line too wide to be correct Fortran.
-
-@findex fortran-strip-sequence-nos
-  The command @kbd{M-x fortran-strip-sequence-nos} deletes all text in
-column 72 and beyond, on all lines in the current buffer.  This is the
-easiest way to get rid of old sequence numbers.
-
-@node Fortran Abbrev
-@section Fortran Keyword Abbrevs
-
-  Fortran mode provides many built-in abbrevs for common keywords and
-declarations.  These are the same sort of abbrev that you can define
-yourself.  To use them, you must turn on Abbrev mode.
-@xref{Abbrevs,,, emacs, the Emacs Manual}.
-
-  The built-in abbrevs are unusual in one way: they all start with a
-semicolon.  You cannot normally use semicolon in an abbrev, but Fortran
-mode makes this possible by changing the syntax of semicolon to ``word
-constituent.''
-
-  For example, one built-in Fortran abbrev is @samp{;c} for
-@samp{continue}.  If you insert @samp{;c} and then insert a punctuation
-character such as a space or a newline, the @samp{;c} expands automatically
-to @samp{continue}, provided Abbrev mode is enabled.@refill
-
-  Type @samp{;?} or @samp{;C-h} to display a list of all the built-in
-Fortran abbrevs and what they stand for.
-
-
-@node MS-DOG
-@chapter Emacs and MS-DOS
-@cindex MS-DOG
-@cindex MS-DOS peculiarities
-
-  This section briefly describes the peculiarities of using Emacs on
-the MS-DOS ``operating system'' (also known as ``MS-DOG'').
-Information about Emacs and Microsoft's current operating system
-Windows (also known as ``Losedows) is in the main Emacs manual
-(@pxref{Emacs and Microsoft Systems,,, emacs, the Emacs Manual}).
-
-  If you build Emacs for MS-DOS, the binary will also run on Windows
-3.X, Windows NT, Windows 9X/ME, Windows 2000, or OS/2 as a DOS
-application; all of this chapter applies for all of those systems, if
-you use an Emacs that was built for MS-DOS.
-
-  @xref{Text and Binary,,,emacs, the Emacs Manual}, for information
-about Emacs' special handling of text files under MS-DOS (and
-Windows).
-
-@menu
-* Keyboard: MS-DOS Keyboard.   Keyboard conventions on MS-DOS.
-* Mouse: MS-DOS Mouse.         Mouse conventions on MS-DOS.
-* Display: MS-DOS Display.     Fonts, frames and display size on MS-DOS.
-* Files: MS-DOS File Names.    File name conventions on MS-DOS.
-* Printing: MS-DOS Printing.   Printing specifics on MS-DOS.
-* I18N: MS-DOS and MULE.       Support for internationalization on MS-DOS.
-* Processes: MS-DOS Processes. Running subprocesses on MS-DOS.
-@end menu
-
-@node MS-DOS Keyboard
-@section Keyboard Usage on MS-DOS
-
-@kindex DEL @r{(MS-DOS)}
-@kindex BS @r{(MS-DOS)}
-  The key that is called @key{DEL} in Emacs (because that's how it is
-designated on most workstations) is known as @key{BS} (backspace) on a
-PC.  That is why the PC-specific terminal initialization remaps the
-@key{BS} key to act as @key{DEL}; the @key{DELETE} key is remapped to act
-as @kbd{C-d} for the same reasons.
-
-@kindex C-g @r{(MS-DOS)}
-@kindex C-BREAK @r{(MS-DOS)}
-@cindex quitting on MS-DOS
-  Emacs built for MS-DOS recognizes @kbd{C-@key{BREAK}} as a quit
-character, just like @kbd{C-g}.  This is because Emacs cannot detect
-that you have typed @kbd{C-g} until it is ready for more input.  As a
-consequence, you cannot use @kbd{C-g} to stop a running command
-(@pxref{Quitting,,,emacs, the Emacs Manual}).  By contrast,
-@kbd{C-@key{BREAK}} @emph{is} detected as soon as you type it (as
-@kbd{C-g} is on other systems), so it can be used to stop a running
-command and for emergency escape (@pxref{Emergency Escape,,,emacs, the
-Emacs Manual}).
-
-@cindex Meta (under MS-DOS)
-@cindex Hyper (under MS-DOS)
-@cindex Super (under MS-DOS)
-@vindex dos-super-key
-@vindex dos-hyper-key
-  The PC keyboard maps use the left @key{ALT} key as the @key{META} key.
-You have two choices for emulating the @key{SUPER} and @key{HYPER} keys:
-choose either the right @key{CTRL} key or the right @key{ALT} key by
-setting the variables @code{dos-hyper-key} and @code{dos-super-key} to 1
-or 2 respectively.  If neither @code{dos-super-key} nor
-@code{dos-hyper-key} is 1, then by default the right @key{ALT} key is
-also mapped to the @key{META} key.  However, if the MS-DOS international
-keyboard support program @file{KEYB.COM} is installed, Emacs will
-@emph{not} map the right @key{ALT} to @key{META}, since it is used for
-accessing characters like @kbd{~} and @kbd{@@} on non-US keyboard
-layouts; in this case, you may only use the left @key{ALT} as @key{META}
-key.
-
-@kindex C-j @r{(MS-DOS)}
-@vindex dos-keypad-mode
-  The variable @code{dos-keypad-mode} is a flag variable that controls
-what key codes are returned by keys in the numeric keypad.  You can also
-define the keypad @key{ENTER} key to act like @kbd{C-j}, by putting the
-following line into your @file{_emacs} file:
+@include fortran-xtra.texi
 
-@smallexample
-;; @r{Make the @key{ENTER} key from the numeric keypad act as @kbd{C-j}.}
-(define-key function-key-map [kp-enter] [?\C-j])
-@end smallexample
-
-@node MS-DOS Mouse
-@section Mouse Usage on MS-DOS
-
-@cindex mouse support under MS-DOS
-  Emacs on MS-DOS supports a mouse (on the default terminal only).
-The mouse commands work as documented, including those that use menus
-and the menu bar (@pxref{Menu Bar,,,emacs, the Emacs Manual}).  Scroll
-bars don't work in MS-DOS Emacs.  PC mice usually have only two
-buttons; these act as @kbd{Mouse-1} and @kbd{Mouse-2}, but if you
-press both of them together, that has the effect of @kbd{Mouse-3}.  If
-the mouse does have 3 buttons, Emacs detects that at startup, and all
-the 3 buttons function normally, as on X.
-
-  Help strings for menu-bar and pop-up menus are displayed in the echo
-area when the mouse pointer moves across the menu items.  Highlighting
-of mouse-sensitive text (@pxref{Mouse References,,,emacs, the Emacs
-Manual}) is also supported.
-
-@cindex mouse, set number of buttons
-@findex msdos-set-mouse-buttons
-  Some versions of mouse drivers don't report the number of mouse
-buttons correctly.  For example, mice with a wheel report that they
-have 3 buttons, but only 2 of them are passed to Emacs; the clicks on
-the wheel, which serves as the middle button, are not passed.  In
-these cases, you can use the @kbd{M-x msdos-set-mouse-buttons} command
-to tell Emacs how many mouse buttons to expect.  You could make such a
-setting permanent by adding this fragment to your @file{_emacs} init
-file:
-
-@example
-;; @r{Treat the mouse like a 2-button mouse.}
-(msdos-set-mouse-buttons 2)
-@end example
-
-@cindex Windows clipboard support
-  Emacs built for MS-DOS supports clipboard operations when it runs on
-Windows.  Commands that put text on the kill ring, or yank text from
-the ring, check the Windows clipboard first, just as Emacs does on the
-X Window System (@pxref{Mouse Commands,,,emacs, the Emacs Manual}).
-Only the primary selection and the cut buffer are supported by MS-DOS
-Emacs on Windows; the secondary selection always appears as empty.
-
-  Due to the way clipboard access is implemented by Windows, the
-length of text you can put into the clipboard is limited by the amount
-of free DOS memory that is available to Emacs.  Usually, up to 620KB of
-text can be put into the clipboard, but this limit depends on the system
-configuration and is lower if you run Emacs as a subprocess of
-another program.  If the killed text does not fit, Emacs outputs a
-message saying so, and does not put the text into the clipboard.
-
-  Null characters also cannot be put into the Windows clipboard.  If the
-killed text includes null characters, Emacs does not put such text into
-the clipboard, and displays in the echo area a message to that effect.
-
-@vindex dos-display-scancodes
-  The variable @code{dos-display-scancodes}, when non-@code{nil},
-directs Emacs to display the @acronym{ASCII} value and the keyboard scan code of
-each keystroke; this feature serves as a complement to the
-@code{view-lossage} command, for debugging.
-
-@node MS-DOS Display
-@section Display on MS-DOS
-@cindex faces under MS-DOS
-@cindex fonts, emulating under MS-DOS
-
-  Display on MS-DOS cannot use font variants, like bold or italic, but
-it does support multiple faces, each of which can specify a foreground
-and a background color.  Therefore, you can get the full functionality
-of Emacs packages that use fonts (such as @code{font-lock}, Enriched
-Text mode, and others) by defining the relevant faces to use different
-colors.  Use the @code{list-colors-display} command (@pxref{Frame
-Parameters,,,emacs, the Emacs Manual}) and the
-@code{list-faces-display} command (@pxref{Faces,,,emacs, the Emacs
-Manual}) to see what colors and faces are available and what they look
-like.
-
-  @xref{MS-DOS and MULE}, later in this chapter, for information on
-how Emacs displays glyphs and characters that aren't supported by the
-native font built into the DOS display.
-
-@cindex cursor shape on MS-DOS
-  When Emacs starts, it changes the cursor shape to a solid box.  This
-is for compatibility with other systems, where the box cursor is the
-default in Emacs.  This default shape can be changed to a bar by
-specifying the @code{cursor-type} parameter in the variable
-@code{default-frame-alist} (@pxref{Creating Frames,,,emacs, the Emacs
-Manual}).  The MS-DOS terminal doesn't support a vertical-bar cursor,
-so the bar cursor is horizontal, and the @code{@var{width}} parameter,
-if specified by the frame parameters, actually determines its height.
-For this reason, the @code{bar} and @code{hbar} cursor types produce
-the same effect on MS-DOS.  As an extension, the bar cursor
-specification can include the starting scan line of the cursor as well
-as its width, like this:
-
-@example
- '(cursor-type bar @var{width} . @var{start})
-@end example
-
-@noindent
-In addition, if the @var{width} parameter is negative, the cursor bar
-begins at the top of the character cell.
-
-@cindex frames on MS-DOS
-  The MS-DOS terminal can only display a single frame at a time.  The
-Emacs frame facilities work on MS-DOS much as they do on text-only
-terminals (@pxref{Frames,,,emacs, the Emacs Manual}).  When you run
-Emacs from a DOS window on MS-Windows, you can make the visible frame
-smaller than the full screen, but Emacs still cannot display more than
-a single frame at a time.
-
-@cindex frame size under MS-DOS
-@findex mode4350
-@findex mode25
-  The @code{mode4350} command switches the display to 43 or 50
-lines, depending on your hardware; the @code{mode25} command switches
-to the default 80x25 screen size.
-
-  By default, Emacs only knows how to set screen sizes of 80 columns by
-25, 28, 35, 40, 43 or 50 rows.  However, if your video adapter has
-special video modes that will switch the display to other sizes, you can
-have Emacs support those too.  When you ask Emacs to switch the frame to
-@var{n} rows by @var{m} columns dimensions, it checks if there is a
-variable called @code{screen-dimensions-@var{n}x@var{m}}, and if so,
-uses its value (which must be an integer) as the video mode to switch
-to.  (Emacs switches to that video mode by calling the BIOS @code{Set
-Video Mode} function with the value of
-@code{screen-dimensions-@var{n}x@var{m}} in the @code{AL} register.)
-For example, suppose your adapter will switch to 66x80 dimensions when
-put into video mode 85.  Then you can make Emacs support this screen
-size by putting the following into your @file{_emacs} file:
-
-@example
-(setq screen-dimensions-66x80 85)
-@end example
-
-  Since Emacs on MS-DOS can only set the frame size to specific
-supported dimensions, it cannot honor every possible frame resizing
-request.  When an unsupported size is requested, Emacs chooses the next
-larger supported size beyond the specified size.  For example, if you
-ask for 36x80 frame, you will get 40x80 instead.
-
-  The variables @code{screen-dimensions-@var{n}x@var{m}} are used only
-when they exactly match the specified size; the search for the next
-larger supported size ignores them.  In the above example, even if your
-VGA supports 38x80 dimensions and you define a variable
-@code{screen-dimensions-38x80} with a suitable value, you will still get
-40x80 screen when you ask for a 36x80 frame.  If you want to get the
-38x80 size in this case, you can do it by setting the variable named
-@code{screen-dimensions-36x80} with the same video mode value as
-@code{screen-dimensions-38x80}.
-
-  Changing frame dimensions on MS-DOS has the effect of changing all the
-other frames to the new dimensions.
-
-@node MS-DOS File Names
-@section File Names on MS-DOS
-@cindex file names under MS-DOS
-@cindex init file, default name under MS-DOS
-
-  On MS-DOS, file names are case-insensitive and limited to eight
-characters, plus optionally a period and three more characters.  Emacs
-knows enough about these limitations to handle file names that were
-meant for other operating systems.  For instance, leading dots
-@samp{.}  in file names are invalid in MS-DOS, so Emacs transparently
-converts them to underscores @samp{_}; thus your default init file
-(@pxref{Init File,,,emacs, the Emacs Manual}) is called @file{_emacs}
-on MS-DOS.  Excess characters before or after the period are generally
-ignored by MS-DOS itself; thus, if you visit the file
-@file{LongFileName.EvenLongerExtension}, you will silently get
-@file{longfile.eve}, but Emacs will still display the long file name
-on the mode line.  Other than that, it's up to you to specify file
-names which are valid under MS-DOS; the transparent conversion as
-described above only works on file names built into Emacs.
-
-@cindex backup file names on MS-DOS
-  The above restrictions on the file names on MS-DOS make it almost
-impossible to construct the name of a backup file (@pxref{Backup
-Names,,,emacs, the Emacs Manual}) without losing some of the original
-file name characters.  For example, the name of a backup file for
-@file{docs.txt} is @file{docs.tx~} even if single backup is used.
-
-@cindex file names under Windows 95/NT
-@cindex long file names in DOS box under Windows 95/NT
-  If you run Emacs as a DOS application under Windows 9X, Windows ME, or
-Windows 2000, you can turn on support for long file names.  If you do
-that, Emacs doesn't truncate file names or convert them to lower case;
-instead, it uses the file names that you specify, verbatim.  To enable
-long file name support, set the environment variable @env{LFN} to
-@samp{y} before starting Emacs.  Unfortunately, Windows NT doesn't allow
-DOS programs to access long file names, so Emacs built for MS-DOS will
-only see their short 8+3 aliases.
-
-@cindex @env{HOME} directory under MS-DOS
-  MS-DOS has no notion of home directory, so Emacs on MS-DOS pretends
-that the directory where it is installed is the value of the @env{HOME}
-environment variable.  That is, if your Emacs binary,
-@file{emacs.exe}, is in the directory @file{c:/utils/emacs/bin}, then
-Emacs acts as if @env{HOME} were set to @samp{c:/utils/emacs}.  In
-particular, that is where Emacs looks for the init file @file{_emacs}.
-With this in mind, you can use @samp{~} in file names as an alias for
-the home directory, as you would on GNU or Unix.  You can also set
-@env{HOME} variable in the environment before starting Emacs; its
-value will then override the above default behavior.
-
-  Emacs on MS-DOS handles the directory name @file{/dev} specially,
-because of a feature in the emulator libraries of DJGPP that pretends
-I/O devices have names in that directory.  We recommend that you avoid
-using an actual directory named @file{/dev} on any disk.
-
-@node MS-DOS Printing
-@section Printing and MS-DOS
-
-  Printing commands, such as @code{lpr-buffer}
-(@pxref{Printing,,,emacs, the Emacs Manual}) and
-@code{ps-print-buffer} (@pxref{PostScript,,,emacs, the Emacs Manual})
-can work on MS-DOS by sending the output to one of the printer ports,
-if a Posix-style @code{lpr} program is unavailable.  The same Emacs
-variables control printing on all systems, but in some cases they have
-different default values on MS-DOS.
-
-@xref{MS-Windows Printing,,,emacs, the Emacs Manual}, for details.
+@include msdog-xtra.texi
 
-  Some printers expect DOS codepage encoding of non-@acronym{ASCII} text, even
-though they are connected to a Windows machine which uses a different
-encoding for the same locale.  For example, in the Latin-1 locale, DOS
-uses codepage 850 whereas Windows uses codepage 1252.  @xref{MS-DOS and
-MULE}.  When you print to such printers from Windows, you can use the
-@kbd{C-x RET c} (@code{universal-coding-system-argument}) command before
-@kbd{M-x lpr-buffer}; Emacs will then convert the text to the DOS
-codepage that you specify.  For example, @kbd{C-x RET c cp850-dos RET
-M-x lpr-region RET} will print the region while converting it to the
-codepage 850 encoding.  You may need to create the @code{cp@var{nnn}}
-coding system with @kbd{M-x codepage-setup}.
-
-@vindex dos-printer
-@vindex dos-ps-printer
-  For backwards compatibility, the value of @code{dos-printer}
-(@code{dos-ps-printer}), if it has a value, overrides the value of
-@code{printer-name} (@code{ps-printer-name}), on MS-DOS.
-
-
-@node MS-DOS and MULE
-@section International Support on MS-DOS
-@cindex international support @r{(MS-DOS)}
-
-  Emacs on MS-DOS supports the same international character sets as it
-does on GNU, Unix and other platforms (@pxref{International,,,emacs,
-the Emacs Manual}), including coding systems for converting between
-the different character sets.  However, due to incompatibilities
-between MS-DOS/MS-Windows and other systems, there are several
-DOS-specific aspects of this support that you should be aware of.
-This section describes these aspects.
-
-  The description below is largely specific to the MS-DOS port of
-Emacs, especially where it talks about practical implications for
-Emacs users.  For other operating systems, see the @file{code-pages.el}
-package, which implements support for MS-DOS- and MS-Windows-specific
-encodings for all platforms other than MS-DOS.
-
-@table @kbd
-@item M-x dos-codepage-setup
-Set up Emacs display and coding systems as appropriate for the current
-DOS codepage.
-
-@item M-x codepage-setup
-Create a coding system for a certain DOS codepage.
-@end table
-
-@cindex codepage, MS-DOS
-@cindex DOS codepages
-  MS-DOS is designed to support one character set of 256 characters at
-any given time, but gives you a variety of character sets to choose
-from.  The alternative character sets are known as @dfn{DOS codepages}.
-Each codepage includes all 128 @acronym{ASCII} characters, but the other 128
-characters (codes 128 through 255) vary from one codepage to another.
-Each DOS codepage is identified by a 3-digit number, such as 850, 862,
-etc.
-
-  In contrast to X, which lets you use several fonts at the same time,
-MS-DOS normally doesn't allow use of several codepages in a single
-session.  MS-DOS was designed to load a single codepage at system
-startup, and require you to reboot in order to change
-it@footnote{Normally, one particular codepage is burnt into the
-display memory, while other codepages can be installed by modifying
-system configuration files, such as @file{CONFIG.SYS}, and rebooting.
-While there is third-party software that allows changing the codepage
-without rebooting, we describe here how a stock MS-DOS system
-behaves.}.  Much the same limitation applies when you run DOS
-executables on other systems such as MS-Windows.
-
-@cindex unibyte operation @r{(MS-DOS)}
-  If you invoke Emacs on MS-DOS with the @samp{--unibyte} option
-(@pxref{Initial Options,,,emacs, the Emacs Manual}), Emacs does not
-perform any conversion of non-@acronym{ASCII} characters.  Instead, it
-reads and writes any non-@acronym{ASCII} characters verbatim, and
-sends their 8-bit codes to the display verbatim.  Thus, unibyte Emacs
-on MS-DOS supports the current codepage, whatever it may be, but
-cannot even represent any other characters.
-
-@vindex dos-codepage
-  For multibyte operation on MS-DOS, Emacs needs to know which
-characters the chosen DOS codepage can display.  So it queries the
-system shortly after startup to get the chosen codepage number, and
-stores the number in the variable @code{dos-codepage}.  Some systems
-return the default value 437 for the current codepage, even though the
-actual codepage is different.  (This typically happens when you use the
-codepage built into the display hardware.)  You can specify a different
-codepage for Emacs to use by setting the variable @code{dos-codepage} in
-your init file.
-
-@cindex language environment, automatic selection on @r{MS-DOS}
-  Multibyte Emacs supports only certain DOS codepages: those which can
-display Far-Eastern scripts, like the Japanese codepage 932, and those
-that encode a single ISO 8859 character set.
-
-  The Far-Eastern codepages can directly display one of the MULE
-character sets for these countries, so Emacs simply sets up to use the
-appropriate terminal coding system that is supported by the codepage.
-The special features described in the rest of this section mostly
-pertain to codepages that encode ISO 8859 character sets.
-
-  For the codepages which correspond to one of the ISO character sets,
-Emacs knows the character set name based on the codepage number.  Emacs
-automatically creates a coding system to support reading and writing
-files that use the current codepage, and uses this coding system by
-default.  The name of this coding system is @code{cp@var{nnn}}, where
-@var{nnn} is the codepage number.@footnote{The standard Emacs coding
-systems for ISO 8859 are not quite right for the purpose, because
-typically the DOS codepage does not match the standard ISO character
-codes.  For example, the letter @samp{@,{c}} (@samp{c} with cedilla) has
-code 231 in the standard Latin-1 character set, but the corresponding
-DOS codepage 850 uses code 135 for this glyph.}
-
-@cindex mode line @r{(MS-DOS)}
-  All the @code{cp@var{nnn}} coding systems use the letter @samp{D}
-(for ``DOS'') as their mode-line mnemonic.  Since both the terminal
-coding system and the default coding system for file I/O are set to
-the proper @code{cp@var{nnn}} coding system at startup, it is normal
-for the mode line on MS-DOS to begin with @samp{-DD\-}.  @xref{Mode
-Line,,,emacs, the Emacs Manual}.  Far-Eastern DOS terminals do not use
-the @code{cp@var{nnn}} coding systems, and thus their initial mode
-line looks like the Emacs default.
-
-  Since the codepage number also indicates which script you are using,
-Emacs automatically runs @code{set-language-environment} to select the
-language environment for that script (@pxref{Language
-Environments,,,emacs, the Emacs Manual}).
-
-  If a buffer contains a character belonging to some other ISO 8859
-character set, not the one that the chosen DOS codepage supports, Emacs
-displays it using a sequence of @acronym{ASCII} characters.  For example, if the
-current codepage doesn't have a glyph for the letter @samp{@`o} (small
-@samp{o} with a grave accent), it is displayed as @samp{@{`o@}}, where
-the braces serve as a visual indication that this is a single character.
-(This may look awkward for some non-Latin characters, such as those from
-Greek or Hebrew alphabets, but it is still readable by a person who
-knows the language.)  Even though the character may occupy several
-columns on the screen, it is really still just a single character, and
-all Emacs commands treat it as one.
-
-@cindex IBM graphics characters (MS-DOS)
-@cindex box-drawing characters (MS-DOS)
-@cindex line-drawing characters (MS-DOS)
-  Not all characters in DOS codepages correspond to ISO 8859
-characters---some are used for other purposes, such as box-drawing
-characters and other graphics.  Emacs maps these characters to two
-special character sets called @code{eight-bit-control} and
-@code{eight-bit-graphic}, and displays them as their IBM glyphs.
-However, you should be aware that other systems might display these
-characters differently, so you should avoid them in text that might be
-copied to a different operating system, or even to another DOS machine
-that uses a different codepage.
-
-@vindex dos-unsupported-character-glyph
-  Emacs supports many other characters sets aside from ISO 8859, but it
-cannot display them on MS-DOS.  So if one of these multibyte characters
-appears in a buffer, Emacs on MS-DOS displays them as specified by the
-@code{dos-unsupported-character-glyph} variable; by default, this glyph
-is an empty triangle.  Use the @kbd{C-u C-x =} command to display the
-actual code and character set of such characters.  @xref{Position
-Info,,,emacs, the Emacs Manual}.
-
-@findex codepage-setup
-  By default, Emacs defines a coding system to support the current
-codepage.  To define a coding system for some other codepage (e.g., to
-visit a file written on a DOS machine in another country), use the
-@kbd{M-x codepage-setup} command.  It prompts for the 3-digit code of
-the codepage, with completion, then creates the coding system for the
-specified codepage.  You can then use the new coding system to read and
-write files, but you must specify it explicitly for the file command
-when you want to use it (@pxref{Text Coding,,,emacs, the Emacs Manual}).
-
-  These coding systems are also useful for visiting a file encoded using
-a DOS codepage, using Emacs running on some other operating system.
-
-@cindex MS-Windows codepages
-  MS-Windows provides its own codepages, which are different from the
-DOS codepages for the same locale.  For example, DOS codepage 850
-supports the same character set as Windows codepage 1252; DOS codepage
-855 supports the same character set as Windows codepage 1251, etc.
-The MS-Windows version of Emacs uses the current codepage for display
-when invoked with the @samp{-nw} option.  Support for codepages in the
-Windows port of Emacs is part of the @file{code-pages.el} package.
-
-@node MS-DOS Processes
-@section Subprocesses on MS-DOS
-
-@cindex compilation under MS-DOS
-@cindex inferior processes under MS-DOS
-@findex compile @r{(MS-DOS)}
-@findex grep @r{(MS-DOS)}
-  Because MS-DOS is a single-process ``operating system,''
-asynchronous subprocesses are not available.  In particular, Shell
-mode and its variants do not work.  Most Emacs features that use
-asynchronous subprocesses also don't work on MS-DOS, including
-Shell mode and GUD.  When in doubt, try and see; commands that
-don't work output an error message saying that asynchronous processes
-aren't supported.
-
-  Compilation under Emacs with @kbd{M-x compile}, searching files with
-@kbd{M-x grep} and displaying differences between files with @kbd{M-x
-diff} do work, by running the inferior processes synchronously.  This
-means you cannot do any more editing until the inferior process
-finishes.
-
-  Spell checking also works, by means of special support for synchronous
-invocation of the @code{ispell} program.  This is slower than the
-asynchronous invocation on other platforms
-
-  Instead of the Shell mode, which doesn't work on MS-DOS, you can use
-the @kbd{M-x eshell} command.  This invokes the Eshell package that
-implements a Posix-like shell entirely in Emacs Lisp.
-
-  By contrast, Emacs compiled as a native Windows application
-@strong{does} support asynchronous subprocesses.  @xref{Windows
-Processes,,,emacs, the Emacs Manual}.
-
-@cindex printing under MS-DOS
-  Printing commands, such as @code{lpr-buffer}
-(@pxref{Printing,,,emacs, the Emacs Manual}) and
-@code{ps-print-buffer} (@pxref{PostScript,,,emacs, the Emacs Manual}),
-work in MS-DOS by sending the output to one of the printer ports.
-@xref{MS-DOS Printing,,,emacs, the Emacs Manual}.
-
-  When you run a subprocess synchronously on MS-DOS, make sure the
-program terminates and does not try to read keyboard input.  If the
-program does not terminate on its own, you will be unable to terminate
-it, because MS-DOS provides no general way to terminate a process.
-Pressing @kbd{C-c} or @kbd{C-@key{BREAK}} might sometimes help in these
-cases.
-
-  Accessing files on other machines is not supported on MS-DOS.  Other
-network-oriented commands such as sending mail, Web browsing, remote
-login, etc., don't work either, unless network access is built into
-MS-DOS with some network redirector.
-
-@cindex directory listing on MS-DOS
-@vindex dired-listing-switches @r{(MS-DOS)}
-  Dired on MS-DOS uses the @code{ls-lisp} package where other
-platforms use the system @code{ls} command.  Therefore, Dired on
-MS-DOS supports only some of the possible options you can mention in
-the @code{dired-listing-switches} variable.  The options that work are
-@samp{-A}, @samp{-a}, @samp{-c}, @samp{-i}, @samp{-r}, @samp{-S},
-@samp{-s}, @samp{-t}, and @samp{-u}.
-
+@lowersections
+@end iftex
 
 @node Index
 @unnumbered Index
--- a/man/emacs.texi	Tue May 02 08:50:29 2006 +0000
+++ b/man/emacs.texi	Wed May 10 20:42:41 2006 +0000
@@ -42,7 +42,13 @@
 
 @smallbook
 
-@setchapternewpage odd
+@c per rms and peterb, use 10pt fonts for the main text, mostly to
+@c save on paper cost.  Also do not declare @setchapternewpage odd.
+@c Do this inside @tex for now, so current makeinfo does not complain.
+@tex
+@fonttextsize 10
+@end tex
+
 @defcodeindex op
 @synindex pg cp
 
@@ -127,7 +133,7 @@
 * Glossary::	        The glossary.
 * Antinews::	        Information about Emacs version 21.
 * Mac OS::              Using Emacs in the Mac.
-* Emacs and Microsoft Windows::  Using Emacs on Microsoft Windows.
+* Microsoft Windows::   Using Emacs on Microsoft Windows and MS-DOS.
 * Manifesto::	        What's GNU?  Gnu's Not Unix!
 * Acknowledgments::     Major contributors to GNU Emacs.
 
@@ -186,6 +192,10 @@
 * Maintaining::         Features for maintaining large programs.
 * Abbrevs::	        How to define text abbreviations to reduce
 			  the number of characters you must type.
+@ifnottex
+* Picture Mode::        Editing pictures made up of characters using
+                          the quarter-plane screen model.
+@end ifnottex
 * Sending Mail::        Sending mail in Emacs.
 * Rmail::	        Reading mail in Emacs.
 * Dired::	        You can ``edit'' a directory to manage files in it.
@@ -197,7 +207,6 @@
 * 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.
@@ -373,6 +382,7 @@
 * Version Control::     Version control systems (RCS, CVS and SCCS).
 * Directories::         Creating, deleting, and listing file directories.
 * Comparing Files::     Finding where two files differ.
+* Diff Mode::           Editing diff output.
 * Misc File Ops::       Other things you can do on files.
 * Compressed Files::    Accessing compressed files.
 * File Archives::       Operating on tar, zip, jar etc. archive files.
@@ -626,6 +636,16 @@
 * Dynamic Abbrevs::     Abbreviations for words already in the buffer.
 * Dabbrev Customization:: What is a word, for dynamic abbrevs.  Case handling.
 
+@ifnottex
+Editing Pictures
+
+* Basic Picture::         Basic concepts and simple commands of Picture Mode.
+* Insert in Picture::     Controlling direction of cursor motion
+                            after "self-inserting" characters.
+* Tabs in Picture::       Various features for tab stops and indentation.
+* Rectangles in Picture:: Clearing and superimposing rectangles.
+@end ifnottex
+
 Sending Mail
 
 * Mail Format:: 	Format of the mail being composed.
@@ -873,7 +893,7 @@
 ignore the customization hints.
 
   This is primarily a reference manual, but can also be used as a
-primer.  If you are a complete beginner, we recommend you start with
+primer.  If you are new to Emacs, 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
@@ -921,8 +941,8 @@
 installed on GNU and Unix systems.  GNU Emacs can also be used on VMS,
 MS-DOS (also called MS-DOG), Microsoft Windows, and Macintosh systems.
 Those systems use different file name syntax; in addition, VMS and
-MS-DOS do not support all GNU Emacs features.  @xref{Emacs and
-Microsoft Windows}, for information about using Emacs on Windows.
+MS-DOS do not support all GNU Emacs features.  @xref{Microsoft
+Windows}, for information about using Emacs on Windows.
 @xref{Mac OS}, for information about using Emacs on Macintosh.  We
 don't try to describe VMS usage in this manual.
 @end iftex
@@ -1131,6 +1151,9 @@
 @include building.texi
 @include maintaining.texi
 @include abbrevs.texi
+@ifnottex
+@include picture-xtra.texi
+@end ifnottex
 @include sending.texi
 @include rmail.texi
 @include dired.texi
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/man/emerge-xtra.texi	Wed May 10 20:42:41 2006 +0000
@@ -0,0 +1,414 @@
+@c This is part of the Emacs manual.
+@c Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
+@c See file emacs.texi for copying conditions.
+@c
+@c This file is included either in emacs-xtra.texi (when producing the
+@c printed version) or in the main Emacs manual (for the on-line version).
+@node Emerge
+@section Merging Files with Emerge
+@cindex Emerge
+@cindex merging files
+
+  It's not unusual for programmers to get their signals crossed and
+modify the same program in two different directions.  To recover from
+this confusion, you need to merge the two versions.  Emerge makes this
+easier.  For other ways to compare files, see
+@iftex
+@ref{Comparing Files,,, emacs, the Emacs Manual},
+@end iftex
+@ifnottex
+@ref{Comparing Files},
+@end ifnottex
+and @ref{Top, Ediff,, ediff, The Ediff Manual}.
+
+@menu
+* Overview of Emerge::	How to start Emerge.  Basic concepts.
+* Submodes of Emerge::	Fast mode vs. Edit mode.
+			  Skip Prefers mode and Auto Advance mode.
+* State of Difference::	You do the merge by specifying state A or B
+			  for each difference.
+* Merge Commands::	Commands for selecting a difference,
+			  changing states of differences, etc.
+* Exiting Emerge::	What to do when you've finished the merge.
+* Combining in Emerge::	    How to keep both alternatives for a difference.
+* Fine Points of Emerge::   Misc.
+@end menu
+
+@node Overview of Emerge
+@subsection Overview of Emerge
+
+  To start Emerge, run one of these four commands:
+
+@table @kbd
+@item M-x emerge-files
+@findex emerge-files
+Merge two specified files.
+
+@item M-x emerge-files-with-ancestor
+@findex emerge-files-with-ancestor
+Merge two specified files, with reference to a common ancestor.
+
+@item M-x emerge-buffers
+@findex emerge-buffers
+Merge two buffers.
+
+@item M-x emerge-buffers-with-ancestor
+@findex emerge-buffers-with-ancestor
+Merge two buffers with reference to a common ancestor in a third
+buffer.
+@end table
+
+@cindex merge buffer (Emerge)
+@cindex A and B buffers (Emerge)
+  The Emerge commands compare two files or buffers, and display the
+comparison in three buffers: one for each input text (the @dfn{A buffer}
+and the @dfn{B buffer}), and one (the @dfn{merge buffer}) where merging
+takes place.  The merge buffer shows the full merged text, not just the
+differences.  Wherever the two input texts differ, you can choose which
+one of them to include in the merge buffer.
+
+  The Emerge commands that take input from existing buffers use only
+the accessible portions of those buffers, if they are narrowed.
+@iftex
+@xref{Narrowing,,, emacs, the Emacs Manual}.
+@end iftex
+@ifnottex
+@xref{Narrowing}.
+@end ifnottex
+
+
+  If a common ancestor version is available, from which the two texts to
+be merged were both derived, Emerge can use it to guess which
+alternative is right.  Wherever one current version agrees with the
+ancestor, Emerge presumes that the other current version is a deliberate
+change which should be kept in the merged version.  Use the
+@samp{with-ancestor} commands if you want to specify a common ancestor
+text.  These commands read three file or buffer names---variant A,
+variant B, and the common ancestor.
+
+  After the comparison is done and the buffers are prepared, the
+interactive merging starts.  You control the merging by typing special
+@dfn{merge commands} in the merge buffer (@pxref{Merge Commands}).
+For each run of differences between the input texts, you can choose
+which one of them to keep, or edit them both together.
+
+  The merge buffer uses a special major mode, Emerge mode, with commands
+for making these choices.  But you can also edit the buffer with
+ordinary Emacs commands.
+
+  At any given time, the attention of Emerge is focused on one
+particular difference, called the @dfn{selected} difference.  This
+difference is marked off in the three buffers like this:
+
+@example
+vvvvvvvvvvvvvvvvvvvv
+@var{text that differs}
+^^^^^^^^^^^^^^^^^^^^
+@end example
+
+@noindent
+Emerge numbers all the differences sequentially and the mode
+line always shows the number of the selected difference.
+
+  Normally, the merge buffer starts out with the A version of the text.
+But when the A version of a difference agrees with the common ancestor,
+then the B version is initially preferred for that difference.
+
+  Emerge leaves the merged text in the merge buffer when you exit.  At
+that point, you can save it in a file with @kbd{C-x C-w}.  If you give a
+numeric argument to @code{emerge-files} or
+@code{emerge-files-with-ancestor}, it reads the name of the output file
+using the minibuffer.  (This is the last file name those commands read.)
+Then exiting from Emerge saves the merged text in the output file.
+
+  Normally, Emerge commands save the output buffer in its file when you
+exit.  If you abort Emerge with @kbd{C-]}, the Emerge command does not
+save the output buffer, but you can save it yourself if you wish.
+
+@node Submodes of Emerge
+@subsection Submodes of Emerge
+
+  You can choose between two modes for giving merge commands: Fast mode
+and Edit mode.  In Fast mode, basic merge commands are single
+characters, but ordinary Emacs commands are disabled.  This is
+convenient if you use only merge commands.  In Edit mode, all merge
+commands start with the prefix key @kbd{C-c C-c}, and the normal Emacs
+commands are also available.  This allows editing the merge buffer, but
+slows down Emerge operations.
+
+  Use @kbd{e} to switch to Edit mode, and @kbd{C-c C-c f} to switch to
+Fast mode.  The mode line indicates Edit and Fast modes with @samp{E}
+and @samp{F}.
+
+  Emerge has two additional submodes that affect how particular merge
+commands work: Auto Advance mode and Skip Prefers mode.
+
+  If Auto Advance mode is in effect, the @kbd{a} and @kbd{b} commands
+advance to the next difference.  This lets you go through the merge
+faster as long as you simply choose one of the alternatives from the
+input.  The mode line indicates Auto Advance mode with @samp{A}.
+
+  If Skip Prefers mode is in effect, the @kbd{n} and @kbd{p} commands
+skip over differences in states prefer-A and prefer-B (@pxref{State of
+Difference}).  Thus you see only differences for which neither version
+is presumed ``correct.''  The mode line indicates Skip Prefers mode with
+@samp{S}.
+
+@findex emerge-auto-advance-mode
+@findex emerge-skip-prefers-mode
+  Use the command @kbd{s a} (@code{emerge-auto-advance-mode}) to set or
+clear Auto Advance mode.  Use @kbd{s s}
+(@code{emerge-skip-prefers-mode}) to set or clear Skip Prefers mode.
+These commands turn on the mode with a positive argument, turns it off
+with a negative or zero argument, and toggle the mode with no argument.
+
+@node State of Difference
+@subsection State of a Difference
+
+  In the merge buffer, a difference is marked with lines of @samp{v} and
+@samp{^} characters.  Each difference has one of these seven states:
+
+@table @asis
+@item A
+The difference is showing the A version.  The @kbd{a} command always
+produces this state; the mode line indicates it with @samp{A}.
+
+@item B
+The difference is showing the B version.  The @kbd{b} command always
+produces this state; the mode line indicates it with @samp{B}.
+
+@item default-A
+@itemx default-B
+The difference is showing the A or the B state by default, because you
+haven't made a choice.  All differences start in the default-A state
+(and thus the merge buffer is a copy of the A buffer), except those for
+which one alternative is ``preferred'' (see below).
+
+When you select a difference, its state changes from default-A or
+default-B to plain A or B.  Thus, the selected difference never has
+state default-A or default-B, and these states are never displayed in
+the mode line.
+
+The command @kbd{d a} chooses default-A as the default state, and @kbd{d
+b} chooses default-B.  This chosen default applies to all differences
+which you haven't ever selected and for which no alternative is preferred.
+If you are moving through the merge sequentially, the differences you
+haven't selected are those following the selected one.  Thus, while
+moving sequentially, you can effectively make the A version the default
+for some sections of the merge buffer and the B version the default for
+others by using @kbd{d a} and @kbd{d b} between sections.
+
+@item prefer-A
+@itemx prefer-B
+The difference is showing the A or B state because it is
+@dfn{preferred}.  This means that you haven't made an explicit choice,
+but one alternative seems likely to be right because the other
+alternative agrees with the common ancestor.  Thus, where the A buffer
+agrees with the common ancestor, the B version is preferred, because
+chances are it is the one that was actually changed.
+
+These two states are displayed in the mode line as @samp{A*} and @samp{B*}.
+
+@item combined
+The difference is showing a combination of the A and B states, as a
+result of the @kbd{x c} or @kbd{x C} commands.
+
+Once a difference is in this state, the @kbd{a} and @kbd{b} commands
+don't do anything to it unless you give them a numeric argument.
+
+The mode line displays this state as @samp{comb}.
+@end table
+
+@node Merge Commands
+@subsection Merge Commands
+
+  Here are the Merge commands for Fast mode; in Edit mode, precede them
+with @kbd{C-c C-c}:
+
+@table @kbd
+@item p
+Select the previous difference.
+
+@item n
+Select the next difference.
+
+@item a
+Choose the A version of this difference.
+
+@item b
+Choose the B version of this difference.
+
+@item C-u @var{n} j
+Select difference number @var{n}.
+
+@item .
+Select the difference containing point.  You can use this command in the
+merge buffer or in the A or B buffer.
+
+@item q
+Quit---finish the merge.
+
+@item C-]
+Abort---exit merging and do not save the output.
+
+@item f
+Go into Fast mode.  (In Edit mode, this is actually @kbd{C-c C-c f}.)
+
+@item e
+Go into Edit mode.
+
+@item l
+Recenter (like @kbd{C-l}) all three windows.
+
+@item -
+Specify part of a prefix numeric argument.
+
+@item @var{digit}
+Also specify part of a prefix numeric argument.
+
+@item d a
+Choose the A version as the default from here down in
+the merge buffer.
+
+@item d b
+Choose the B version as the default from here down in
+the merge buffer.
+
+@item c a
+Copy the A version of this difference into the kill ring.
+
+@item c b
+Copy the B version of this difference into the kill ring.
+
+@item i a
+Insert the A version of this difference at point.
+
+@item i b
+Insert the B version of this difference at point.
+
+@item m
+Put point and mark around the difference.
+
+@item ^
+Scroll all three windows down (like @kbd{M-v}).
+
+@item v
+Scroll all three windows up (like @kbd{C-v}).
+
+@item <
+Scroll all three windows left (like @kbd{C-x <}).
+
+@item >
+Scroll all three windows right (like @kbd{C-x >}).
+
+@item |
+Reset horizontal scroll on all three windows.
+
+@item x 1
+Shrink the merge window to one line.  (Use @kbd{C-u l} to restore it
+to full size.)
+
+@item x c
+Combine the two versions of this difference (@pxref{Combining in
+Emerge}).
+
+@item x f
+Show the names of the files/buffers Emerge is operating on, in a Help
+window.  (Use @kbd{C-u l} to restore windows.)
+
+@item x j
+Join this difference with the following one.
+(@kbd{C-u x j} joins this difference with the previous one.)
+
+@item x s
+Split this difference into two differences.  Before you use this
+command, position point in each of the three buffers at the place where
+you want to split the difference.
+
+@item x t
+Trim identical lines off the top and bottom of the difference.
+Such lines occur when the A and B versions are
+identical but differ from the ancestor version.
+@end table
+
+@node Exiting Emerge
+@subsection Exiting Emerge
+
+  The @kbd{q} command (@code{emerge-quit}) finishes the merge, storing
+the results into the output file if you specified one.  It restores the
+A and B buffers to their proper contents, or kills them if they were
+created by Emerge and you haven't changed them.  It also disables the
+Emerge commands in the merge buffer, since executing them later could
+damage the contents of the various buffers.
+
+  @kbd{C-]} aborts the merge.  This means exiting without writing the
+output file.  If you didn't specify an output file, then there is no
+real difference between aborting and finishing the merge.
+
+  If the Emerge command was called from another Lisp program, then its
+return value is @code{t} for successful completion, or @code{nil} if you
+abort.
+
+@node Combining in Emerge
+@subsection Combining the Two Versions
+
+  Sometimes you want to keep @emph{both} alternatives for a particular
+difference.  To do this, use @kbd{x c}, which edits the merge buffer
+like this:
+
+@example
+@group
+#ifdef NEW
+@var{version from A buffer}
+#else /* not NEW */
+@var{version from B buffer}
+#endif /* not NEW */
+@end group
+@end example
+
+@noindent
+@vindex emerge-combine-versions-template
+While this example shows C preprocessor conditionals delimiting the two
+alternative versions, you can specify the strings to use by setting
+the variable @code{emerge-combine-versions-template} to a string of your
+choice.  In the string, @samp{%a} says where to put version A, and
+@samp{%b} says where to put version B.  The default setting, which
+produces the results shown above, looks like this:
+
+@example
+@group
+"#ifdef NEW\n%a#else /* not NEW */\n%b#endif /* not NEW */\n"
+@end group
+@end example
+
+@node Fine Points of Emerge
+@subsection Fine Points of Emerge
+
+  During the merge, you mustn't try to edit the A and B buffers yourself.
+Emerge modifies them temporarily, but ultimately puts them back the way
+they were.
+
+  You can have any number of merges going at once---just don't use any one
+buffer as input to more than one merge at once, since the temporary
+changes made in these buffers would get in each other's way.
+
+  Starting Emerge can take a long time because it needs to compare the
+files fully.  Emacs can't do anything else until @code{diff} finishes.
+Perhaps in the future someone will change Emerge to do the comparison in
+the background when the input files are large---then you could keep on
+doing other things with Emacs until Emerge is ready to accept
+commands.
+
+@vindex emerge-startup-hook
+  After setting up the merge, Emerge runs the hook
+@code{emerge-startup-hook}.
+@iftex
+@xref{Hooks,,, emacs, the Emacs Manual}.
+@end iftex
+@ifnottex
+@xref{Hooks}.
+@end ifnottex
+
+@ignore
+   arch-tag: cda63f09-9c5f-4ea1-adb9-4a820fdfb24e
+@end ignore
--- a/man/entering.texi	Tue May 02 08:50:29 2006 +0000
+++ b/man/entering.texi	Wed May 10 20:42:41 2006 +0000
@@ -8,58 +8,54 @@
 @cindex starting Emacs
 
   The usual way to invoke Emacs is with the shell command
-@command{emacs}.  Emacs clears the screen and then displays an initial
-help message and copyright notice.  Some operating systems discard all
-type-ahead when Emacs starts up; they give Emacs no way to prevent
-this.  If you ever use those systems, learn the habit of waiting for
-Emacs to clear the screen before typing your first editing command.
+@command{emacs}.  Emacs clears the screen, then displays an initial
+help message and copyright notice.  Some operating systems discard
+your type-ahead when Emacs starts up; they give Emacs no way to
+prevent this.  On those systems, wait for Emacs to clear the screen
+before you start typing.
 
-  If you run Emacs from a shell window under the X Window System, run it
-in the background with @command{emacs&}.  This way, Emacs does not tie up
-the shell window, so you can use that to run other shell commands while
-Emacs operates its own X windows.  You can begin typing Emacs commands
-as soon as you direct your keyboard input to the Emacs frame.
+  From a shell window under the X Window System, run Emacs in the
+background with @command{emacs&}.  This way, Emacs won't tie up the
+shell window, so you can use it to run other shell commands while
+Emacs is running.  You can type Emacs commands as soon as you direct
+your keyboard input to an Emacs frame.
 
 @vindex initial-major-mode
   When Emacs starts up, it creates a buffer named @samp{*scratch*}.
 That's the buffer you start out in.  The @samp{*scratch*} buffer uses
 Lisp Interaction mode; you can use it to type Lisp expressions and
-evaluate them, or you can ignore that capability and just write notes
-in it.  (You can specify a different major mode for this buffer by
+evaluate them.  You can also ignore that capability and just write notes
+there.  You can specify a different major mode for this buffer by
 setting the variable @code{initial-major-mode} in your init file.
-@xref{Init File}.)
+@xref{Init File}.
 
   It is possible to specify files to be visited, Lisp files to be
-loaded, and functions to be called, by giving Emacs arguments in the
-shell command line.  @xref{Emacs Invocation}.  But we don't recommend
-doing this.  The feature exists mainly for compatibility with other
-editors.
+loaded, and functions to be called through Emacs command-line
+arguments.  @xref{Emacs Invocation}.  The feature exists mainly for
+compatibility with other editors, and for scripts.
 
-  Many other editors are designed to be started afresh each time you
-want to edit.  You edit one file and then exit the editor.  The next
-time you want to edit either another file or the same one, you must run
-the editor again.  With these editors, it makes sense to use a
-command-line argument to say which file to edit.
+  Many editors are designed to edit one file.  When done with that
+file, you exit the editor.  The next time you want to edit a file, you
+must start the editor again.  Working this way, it is convenient to
+use a command-line argument to say which file to edit.
 
-  But starting a new Emacs each time you want to edit a different file
-does not make sense.  This would fail to take advantage of Emacs's
-ability to visit more than one file in a single editing session, and
-it would lose the other accumulated context, such as the kill ring,
-registers, undo history, and mark ring, that are useful for operating
-on multiple files or even one.
+  It's not smart to start Emacs afresh for every file you edit.  Emacs
+can visit more than one file in a single editing session, and upon
+exit Emacs loses valuable accumulated context, such as the kill ring,
+registers, undo history, and mark ring.  These features are useful for
+operating on multiple files, or even one.  If you kill Emacs after
+each file, you don't take advantage of them.
 
   The recommended way to use GNU Emacs is to start it only once, just
 after you log in, and do all your editing in the same Emacs session.
-Each time you want to edit a different file, you visit it with the
-existing Emacs, which eventually comes to have many files in it ready
-for editing.  Usually you do not kill the Emacs until you are about to
-log out.  @xref{Files}, for more information on visiting more than one
-file.
+Each time you edit a file, you visit it with the existing Emacs, which
+eventually has many files in it ready for editing.  Usually you do not
+kill Emacs until you are about to log out.  @xref{Files}, for more
+information on visiting more than one file.
 
-  If you want to edit a file from another program and already have
-Emacs running, you can use the @command{emacsclient} program to open a
-file in the already running Emacs.  @xref{Emacs Server}, for more
-information on editing files with Emacs from other programs.
+  To edit a file from another program while Emacs is running, you can
+use the @command{emacsclient} helper program to open a file in the
+already running Emacs.  @xref{Emacs Server}.
 
 @ifnottex
 @raisesections
@@ -73,9 +69,9 @@
 @cindex leaving Emacs
 @cindex quitting Emacs
 
-  There are two commands for exiting Emacs because there are three
-kinds of exiting: @dfn{suspending} Emacs, @dfn{Iconifying} Emacs, and
-@dfn{killing} Emacs.
+  There are two commands for exiting Emacs, and three kinds of exiting:
+@dfn{suspending} Emacs, @dfn{Iconifying} Emacs, and @dfn{killing}
+Emacs.
 
   @dfn{Suspending} means stopping Emacs temporarily and returning
 control to its parent process (usually a shell), allowing you to resume
@@ -110,11 +106,11 @@
 Emacs.  You can resume Emacs with the shell command @command{%emacs}
 in most common shells.  On systems that don't support suspending
 programs, @kbd{C-z} starts an inferior shell that communicates
-directly with the terminal, and Emacs waits until you exit the subshell.
-(The way to do that is probably with @kbd{C-d} or @command{exit}, but
-it depends on which shell you use.)  The only way on these systems to
-get back to the shell from which Emacs was run (to log out, for
-example) is to kill Emacs.
+directly with the terminal, and Emacs waits until you exit the
+subshell.  (The way to do that is probably with @kbd{C-d} or
+@command{exit}, but it depends on which shell you use.)  On these
+systems, you can only get back to the shell from which Emacs was run
+(to log out, for example) when you kill Emacs.
 
   Suspending can fail if you run Emacs under a shell that doesn't
 support suspending programs, even if the system itself does support
@@ -133,13 +129,13 @@
 @kindex C-x C-c
 @findex save-buffers-kill-emacs
   To exit and kill Emacs, type @kbd{C-x C-c}
-(@code{save-buffers-kill-emacs}).  A two-character key is used for
-this to make it harder to type by accident.  This command first offers
-to save any modified file-visiting buffers.  If you do not save them
-all, it asks for reconfirmation with @kbd{yes} before killing Emacs,
-since any changes not saved will be lost forever.  Also, if any
-subprocesses are still running, @kbd{C-x C-c} asks for confirmation
-about them, since killing Emacs will also kill the subprocesses.
+(@code{save-buffers-kill-emacs}).  A two-character key is used to make
+it harder to type by accident.  This command first offers to save any
+modified file-visiting buffers.  If you do not save them all, it asks
+for confirmation with @kbd{yes} before killing Emacs, since any
+changes not saved now will be lost forever.  Also, if any subprocesses are
+still running, @kbd{C-x C-c} asks for confirmation about them, since
+killing Emacs will also kill the subprocesses.
 
 @vindex confirm-kill-emacs
   If the value of the variable @code{confirm-kill-emacs} is
@@ -150,11 +146,10 @@
 function @code{yes-or-no-p}.  The default value of
 @code{confirm-kill-emacs} is @code{nil}.
 
-  There is no way to resume an Emacs session once you have killed it.
-You can, however, arrange for Emacs to record certain session
-information when you kill it, such as which files are visited, so that
-the next time you start Emacs it will try to visit the same files and
-so on.  @xref{Saving Emacs Sessions}.
+  You can't resume an Emacs session after killing it.  Emacs can,
+however, record certain session information when you kill it, such as
+which files you visited, so the next time you start Emacs it will try
+to visit the same files.  @xref{Saving Emacs Sessions}.
 
   The operating system usually listens for certain special characters
 whose meaning is to kill or suspend the program you are running.
--- a/man/faq.texi	Tue May 02 08:50:29 2006 +0000
+++ b/man/faq.texi	Wed May 10 20:42:41 2006 +0000
@@ -2229,7 +2229,7 @@
 @cindex Regexps
 @cindex Regular expressions
 @cindex Differences between Unix and Emacs regexps
-@cindex Unix regeps, differences from Emacs
+@cindex Unix regexps, differences from Emacs
 @cindex Text strings, putting regexps in
 
 @inforef{Regexp Backslash, Regexp Backslash, emacs}.
@@ -2261,15 +2261,35 @@
 @cindex Replacing strings across files
 @cindex Multiple files, replacing across
 @cindex Files, replacing strings across multiple
-
-The ``tags'' feature of Emacs includes the command
-@code{tags-query-replace} which performs a query-replace across all the
-files mentioned in the @file{TAGS} file.  @inforef{Tags Search, Tags Search,
-emacs}.
-
-As of Emacs 19.29, Dired mode (@kbd{M-x dired @key{RET}}, or @kbd{C-x d})
-supports the command @code{dired-do-query-replace} (@kbd{Q}), which allows
-users to replace regular expressions in multiple files.
+@cindex Recursive search/replace operations
+
+As of Emacs 19.29, Dired mode (@kbd{M-x dired @key{RET}}, or @kbd{C-x
+d}) supports the command @code{dired-do-query-replace} (@kbd{Q}), which
+allows users to replace regular expressions in multiple files.
+
+You can use this command to perform search/replace operations on
+multiple files by following the following steps:
+
+@itemize @bullet
+@item
+Assemble a list of files you want to operate on with either
+@code{find-dired}, @code{find-name-dired} or @code{find-grep-dired}.
+
+@item
+Mark all files in the resulting Dired buffer using @kbd{t}.
+
+@item
+Use @kbd{Q} to start a @code{query-replace-regexp} session on the marked
+files.
+
+@item
+To accept all replacements in each file, hit @kbd{!}.
+@end itemize
+
+Another way to do the same thing is to use the ``tags'' feature of
+Emacs: it includes the command @code{tags-query-replace} which performs
+a query-replace across all the files mentioned in the @file{TAGS} file.
+@inforef{Tags Search, Tags Search, emacs}.
 
 @node Documentation for etags, Disabling backups, Replacing text across multiple files, Common requests
 @section Where is the documentation for @code{etags}?
@@ -3474,7 +3494,7 @@
 @uref{http://www.anc.ed.ac.uk/~stephen/emacs/ell.html, The Emacs Lisp
 List (ELL)}, maintained by @email{stephen@@anc.ed.ac.uk, Stephen Eglen},
 aims to provide one compact list with links to all of the current Emacs
-Lisp files on the internet.  The ELL can be browsed over the web, or
+Lisp files on the Internet.  The ELL can be browsed over the web, or
 from Emacs with @uref{http://www.anc.ed.ac.uk/~stephen/emacs/ell.el,
 the @file{ell} package}.
 
--- a/man/files.texi	Tue May 02 08:50:29 2006 +0000
+++ b/man/files.texi	Wed May 10 20:42:41 2006 +0000
@@ -25,11 +25,15 @@
 * Visiting::            Visiting a file prepares Emacs to edit the file.
 * Saving::              Saving makes your changes permanent.
 * Reverting::           Reverting cancels all the changes not saved.
+@ifnottex
+* Autorevert::          Auto Reverting non-file buffers.
+@end ifnottex
 * Auto Save::           Auto Save periodically protects against loss of data.
 * File Aliases::        Handling multiple names for one file.
 * Version Control::     Version control systems (RCS, CVS and SCCS).
 * Directories::         Creating, deleting, and listing file directories.
 * Comparing Files::     Finding where two files differ.
+* Diff Mode::           Mode for editing file differences.
 * Misc File Ops::       Other things you can do on files.
 * Compressed Files::    Accessing compressed files.
 * File Archives::       Operating on tar, zip, jar etc. archive files.
@@ -106,10 +110,13 @@
 @cindex home directory shorthand
   You can use @file{~/} in a file name to mean your home directory,
 or @file{~@var{user-id}/} to mean the home directory of a user whose
-login name is @code{user-id}.  (On DOS and Windows systems, where a user
-doesn't have a home directory, Emacs substitutes @file{~/} with the
-value of the environment variable @code{HOME}; see @ref{General
-Variables}.)
+login name is @code{user-id}@footnote{
+On MS-Windows and MS-DOS systems, where a user doesn't have a home
+directory, Emacs substitutes @file{~/} with the value of the
+environment variable @code{HOME}; see @ref{General Variables}.  The
+@file{~@var{user-id}/} construct is supported on those systems only
+for the current user, i.e., only if @var{user-id} is the current
+user's login name.}.
 
 @cindex environment variables in file names
 @cindex expansion of environment variables
@@ -517,8 +524,14 @@
 Control}), the variable @code{vc-make-backup-files} determines whether
 to make backup files.  By default it is @code{nil}, since backup files
 are redundant when you store all the previous versions in a version
-control system.  @xref{General VC Options,,,emacs-xtra, Specialized
-Emacs Features}.
+control system.
+@iftex
+@xref{General VC Options,,,emacs-xtra, Specialized Emacs Features}.
+@end iftex
+@ifnottex
+@xref{General VC Options}.
+@end ifnottex
+
 
   At your option, Emacs can keep either a single backup for each file,
 or make a series of numbered backup files for each file that you edit.
@@ -972,6 +985,10 @@
   @xref{VC Mode Line}, for Auto Revert peculiarities in buffers that
 visit files under version control.
 
+@ifnottex
+@include arevert-xtra.texi
+@end ifnottex
+
 @node Auto Save
 @section Auto-Saving: Protection Against Disasters
 @cindex Auto Save mode
@@ -1201,7 +1218,13 @@
 
   VC is enabled by default in Emacs.  To disable it, set the
 customizable variable @code{vc-handled-backends} to @code{nil}
+@iftex
 (@pxref{Customizing VC,,,emacs-xtra, Specialized Emacs Features}).
+@end iftex
+@ifnottex
+(@pxref{Customizing VC}).
+@end ifnottex
+
 
 @menu
 * Introduction to VC::  How version control works in general.
@@ -1210,6 +1233,12 @@
 * Old Versions::        Examining and comparing old versions.
 * Secondary VC Commands::    The commands used a little less frequently.
 * Branches::            Multiple lines of development.
+@ifnottex
+* Remote Repositories:: Efficient access to remote CVS servers.
+* Snapshots::           Sets of file versions treated as a unit.
+* Miscellaneous VC::    Various other commands and features of VC.
+* Customizing VC::      Variables that change VC's behavior.
+@end ifnottex
 @end menu
 
 @node Introduction to VC
@@ -1347,7 +1376,13 @@
   CVS normally allows each user to modify his own copy of the work file
 at any time, but requires merging with changes from other users at
 check-in time.  However, CVS can also be set up to require locking.
+@iftex
 (@pxref{CVS Options,,,emacs-xtra, Specialized Emacs Features}).
+@end iftex
+@ifnottex
+(@pxref{CVS Options}).
+@end ifnottex
+
 
 @node Types of Log File
 @subsubsection Types of Log File
@@ -1379,8 +1414,14 @@
 the entry in @file{ChangeLog}, then copy it to the log buffer when you
 check in the change.  Or you can write the entry in the log buffer
 while checking in the change, and later use the @kbd{C-x v a} command
-to copy it to @file{ChangeLog} (@pxref{Change Logs and
-VC,,,emacs-xtra, Specialized Emacs Features}).
+to copy it to @file{ChangeLog}
+@iftex
+(@pxref{Change Logs and VC,,,emacs-xtra, Specialized Emacs Features}).
+@end iftex
+@ifnottex
+(@pxref{Change Logs and VC}).
+@end ifnottex
+
 
 @node VC Mode Line
 @subsection Version Control and the Mode Line
@@ -1544,8 +1585,15 @@
 @cindex specific version control system
 Instead of the version number, you can also specify the name of a
 version control system.  This is useful when one file is being managed
-with two version control systems at the same time (@pxref{Local
-Version Control,,,emacs-xtra, Specialized Emacs Features}).
+with two version control systems at the same time
+@iftex
+(@pxref{Local Version Control,,,emacs-xtra, Specialized Emacs
+Features}).
+@end iftex
+@ifnottex
+(@pxref{Local Version Control}).
+@end ifnottex
+
 @end itemize
 
 @node Log Buffer
@@ -1567,16 +1615,27 @@
 entries for the file(s) concerned in the top entry in the ChangeLog
 and uses those paragraphs as the log text.  This text is only inserted
 if the top entry was made under your user name on the current date.
+@iftex
 @xref{Change Logs and VC,,,emacs-xtra, Specialized Emacs Features},
+@end iftex
+@ifnottex
+@xref{Change Logs and VC},
+@end ifnottex
 for the opposite way of working---generating ChangeLog entries from
 the revision control log.
 
   In the @samp{*VC-Log*} buffer, @kbd{C-c C-f} (@kbd{M-x
 log-edit-show-files}) shows the list of files to be committed in case
 you need to check that.  (This can be a list of more than one file if
-you use VC Dired mode or PCL-CVS.  @xref{VC Dired Mode,,,emacs-xtra,
-Specialized Emacs Features}, and @ref{Top, , About PCL-CVS, pcl-cvs,
-PCL-CVS --- The Emacs Front-End to CVS}.)
+you use VC Dired mode or PCL-CVS.
+@iftex
+@xref{VC Dired Mode,,,emacs-xtra, Specialized Emacs Features},
+@end iftex
+@ifnottex
+@xref{VC Dired Mode},
+@end ifnottex
+and @ref{Top, , About PCL-CVS, pcl-cvs, PCL-CVS --- The Emacs
+Front-End to CVS}.)
 
   When you have finished editing the log message, type @kbd{C-c C-c} to
 exit the buffer and commit the change.
@@ -1644,7 +1703,13 @@
   You can specify a checked-in version by its number; an empty input
 specifies the current contents of the work file (which may be different
 from all the checked-in versions).  You can also specify a snapshot name
-(@pxref{Snapshots,,,emacs-xtra, Specialized Emacs Features}) instead of one or both version numbers.
+@iftex
+(@pxref{Snapshots,,,emacs-xtra, Specialized Emacs Features})
+@end iftex
+@ifnottex
+(@pxref{Snapshots})
+@end ifnottex
+instead of one or both version numbers.
 
   If you supply a directory name instead of the name of a registered
 file, this command compares the two specified versions of all registered
@@ -1733,6 +1798,10 @@
 * Registering::         Putting a file under version control.
 * VC Status::           Viewing the VC status of files.
 * VC Undo::             Canceling changes before or after check-in.
+@ifnottex
+* VC Dired Mode::       Listing files managed by version control.
+* VC Dired Commands::   Commands to use in a VC Dired buffer.
+@end ifnottex
 @end menu
 
 @node Registering
@@ -1753,8 +1822,13 @@
 registered in a version control system, Emacs uses that system.  If
 there is more than one system in use for a directory, Emacs uses the
 one that appears first in @code{vc-handled-backends}
-(@pxref{Customizing VC,,,emacs-xtra, Specialized Emacs Features}).  On
-the other hand, if there are no files already registered, Emacs uses
+@iftex
+(@pxref{Customizing VC,,,emacs-xtra, Specialized Emacs Features}).
+@end iftex
+@ifnottex
+(@pxref{Customizing VC}).
+@end ifnottex
+On the other hand, if there are no files already registered, Emacs uses
 the first system from @code{vc-handled-backends} that could register
 the file (for example, you cannot register a file under CVS if its
 directory is not already part of a CVS tree); with the default value
@@ -1814,16 +1888,27 @@
 
 @item P
 Move to the log of the previous file, when the logs of multiple files
-are in the log buffer (@pxref{VC Dired Mode,,,emacs-xtra, Specialized
-Emacs Features}).  Otherwise, just move to the beginning of the log.  A
-numeric prefix argument is a repeat count, so @kbd{C-u 10 P} would
-move backward 10 files.
+are in the log buffer
+@iftex
+(@pxref{VC Dired Mode,,,emacs-xtra, Specialized Emacs Features}).
+@end iftex
+@ifnottex
+(@pxref{VC Dired Mode}).
+@end ifnottex
+Otherwise, just move to the beginning of the log.  A numeric prefix
+argument is a repeat count, so @kbd{C-u 10 P} would move backward 10
+files.
 
 @item N
 Move to the log of the next file, when the logs of multiple files are
-in the log buffer (@pxref{VC Dired Mode,,,emacs-xtra, Specialized
-Emacs Features}).  It also takes a numeric prefix argument as a repeat
-count.
+in the log buffer
+@iftex
+(@pxref{VC Dired Mode,,,emacs-xtra, Specialized Emacs Features}).
+@end iftex
+@ifnottex
+(@pxref{VC Dired Mode}).
+@end ifnottex
+It also takes a numeric prefix argument as a repeat count.
 
 @item f
 Visit the revision indicated at the current line, like typing @kbd{C-x
@@ -1877,11 +1962,16 @@
 erroneous check-in, fix the error, and check the file in again.
 
   When @kbd{C-x v c} does not revert the buffer, it unexpands all
-version control headers in the buffer instead (@pxref{Version
-Headers,,,emacs-xtra, Specialized Emacs Features}).  This is because
-the buffer no longer corresponds to any existing version.  If you
-check it in again, the check-in process will expand the headers
-properly for the new version number.
+version control headers in the buffer instead
+@iftex
+(@pxref{Version Headers,,,emacs-xtra, Specialized Emacs Features}).
+@end iftex
+@ifnottex
+(@pxref{Version Headers}).
+@end ifnottex
+This is because the buffer no longer corresponds to any existing
+version.  If you check it in again, the check-in process will expand
+the headers properly for the new version number.
 
   However, it is impossible to unexpand the RCS @samp{@w{$}Log$} header
 automatically.  If you use that header feature, you have to unexpand it
@@ -1893,6 +1983,13 @@
 under CVS, because canceling versions is very dangerous and discouraged
 with CVS.
 
+@ifnottex
+@c vc1-xtra.texi needs extra level of lowering.
+@lowersections
+@include vc1-xtra.texi
+@raisesections
+@end ifnottex
+
 @node Branches
 @subsection Multiple Branches of a File
 @cindex branch (version control)
@@ -2071,10 +2168,15 @@
 records.
 
   This technique works reliably and automatically, provided that the
-source files contain RCS version headers (@pxref{Version
-Headers,,,emacs-xtra, Specialized Emacs Features}).  The headers enable
-Emacs to be sure, at all times, which version number is present in the
-work file.
+source files contain RCS version headers
+@iftex
+(@pxref{Version Headers,,,emacs-xtra, Specialized Emacs Features}).
+@end iftex
+@ifnottex
+(@pxref{Version Headers}).
+@end ifnottex
+The headers enable Emacs to be sure, at all times, which version
+number is present in the work file.
 
   If the files do not have version headers, you must instead tell Emacs
 explicitly in each session which branch you are working on.  To do this,
@@ -2082,6 +2184,10 @@
 branch number.  This ensures that Emacs knows which branch it is using
 during this particular editing session.
 
+@ifnottex
+@include vc2-xtra.texi
+@end ifnottex
+
 @node Directories
 @section File Directories
 
@@ -2159,6 +2265,8 @@
 running the @code{diff} program, using options taken from the variable
 @code{diff-switches}.  The value of @code{diff-switches} should be a
 string; the default is @code{"-c"} to specify a context diff.
+@xref{Top,, Diff, diff, Comparing and Merging Files}, for more
+information about @command{diff} output formats.
 
 @findex diff-backup
   The command @kbd{M-x diff-backup} compares a specified file with its most
@@ -2166,20 +2274,6 @@
 @code{diff-backup} compares it with the source file that it is a backup
 of.
 
-@findex diff-goto-source
-@findex diff-mode
-@cindex Diff mode
-  The @samp{*diff*} buffer uses Diff mode, which enables you to use
-@kbd{C-x `} to visit successive changed locations in the two source
-files, as in Compilation mode (@pxref{Compilation Mode}.)  You can
-also move to a particular hunk of changes and type @kbd{C-c C-c}
-(@code{diff-goto-source}) to visit the corresponding source location.
-
-@cindex patches
-  Differences between versions of files are often distributed as
-patches, which are the output from the @command{diff} program.  You
-can use Diff mode to operate on a patch by typing @kbd{M-x diff-mode}.
-
 @findex compare-windows
   The command @kbd{M-x compare-windows} compares the text in the
 current window with that in the next window.  (For more information
@@ -2216,8 +2310,94 @@
 mode provides commands to resolve conflicts by selecting specific
 changes.
 
-  @inforef{Emerge,, emacs-xtra} for the Emerge facility, which
-provides a powerful interface for merging files.
+@iftex
+@xref{Emerge,,, emacs-xtra, Specialized Emacs Features},
+@end iftex
+@ifnottex
+@xref{Emerge},
+@end ifnottex
+for the Emerge facility, which provides a powerful interface for
+merging files.
+
+@node Diff Mode
+@section Diff Mode
+@cindex Diff mode
+@findex diff-mode
+@cindex patches, editing
+
+  Diff mode is used for the output of @kbd{M-x diff}; it is also
+useful for editing patches and comparisons produced by the
+@command{diff} program.  To select Diff mode manually, type @kbd{M-x
+diff-mode}.
+
+  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 Misc File Ops
 @section Miscellaneous File Operations
@@ -2328,7 +2508,7 @@
 @findex auto-compression-mode
 @vindex auto-compression-mode
   To disable this feature, type the command @kbd{M-x
-auto-compression-mode}.  You can disenable it permanently by
+auto-compression-mode}.  You can disable it permanently by
 customizing the variable @code{auto-compression-mode}.
 
 @node File Archives
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/man/fortran-xtra.texi	Wed May 10 20:42:41 2006 +0000
@@ -0,0 +1,548 @@
+@c This is part of the Emacs manual.
+@c Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
+@c See file emacs.texi for copying conditions.
+@c
+@c This file is included either in emacs-xtra.texi (when producing the
+@c printed version) or in the main Emacs manual (for the on-line version).
+@node Fortran
+@section Fortran Mode
+@cindex Fortran mode
+@cindex mode, Fortran
+
+  Fortran mode provides special motion commands for Fortran statements
+and subprograms, and indentation commands that understand Fortran
+conventions of nesting, line numbers and continuation statements.
+Fortran mode has support for Auto Fill mode that breaks long lines into
+proper Fortran continuation lines.
+
+  Special commands for comments are provided because Fortran comments
+are unlike those of other languages.  Built-in abbrevs optionally save
+typing when you insert Fortran keywords.
+
+  Use @kbd{M-x fortran-mode} to switch to this major mode.  This
+command runs the hook @code{fortran-mode-hook}.
+@iftex
+@xref{Hooks,,, emacs, the Emacs Manual}.
+@end iftex
+@ifnottex
+@xref{Hooks}.
+@end ifnottex
+
+@cindex Fortran77 and Fortran90
+@findex f90-mode
+@findex fortran-mode
+  Fortran mode is meant for editing Fortran77 ``fixed format'' (and also
+``tab format'') source code.  For editing the modern Fortran90 or
+Fortran95 ``free format'' source code, use F90 mode (@code{f90-mode}).
+Emacs normally uses Fortran mode for files with extension @samp{.f},
+@samp{.F} or @samp{.for}, and F90 mode for the extension @samp{.f90} and
+@samp{.f95}.  GNU Fortran supports both kinds of format.
+
+@menu
+* Motion: Fortran Motion.	 Moving point by statements or subprograms.
+* Indent: Fortran Indent.	 Indentation commands for Fortran.
+* Comments: Fortran Comments.	 Inserting and aligning comments.
+* Autofill: Fortran Autofill.	 Auto fill support for Fortran.
+* Columns: Fortran Columns.	 Measuring columns for valid Fortran.
+* Abbrev: Fortran Abbrev.	 Built-in abbrevs for Fortran keywords.
+@end menu
+
+@node Fortran Motion
+@subsection Motion Commands
+
+  In addition to the normal commands for moving by and operating on
+``defuns'' (Fortran subprograms---functions and subroutines, as well as
+modules for F90 mode), Fortran mode provides special commands to move by
+statements and other program units.
+
+@table @kbd
+@kindex C-c C-n @r{(Fortran mode)}
+@findex fortran-next-statement
+@findex f90-next-statement
+@item C-c C-n
+Move to the beginning of the next statement
+(@code{fortran-next-statement}/@code{f90-next-statement}).
+
+@kindex C-c C-p @r{(Fortran mode)}
+@findex fortran-previous-statement
+@findex f90-previous-statement
+@item C-c C-p
+Move to the beginning of the previous statement
+(@code{fortran-previous-statement}/@code{f90-previous-statement}).
+If there is no previous statement (i.e. if called from the first
+statement in the buffer), move to the start of the buffer.
+
+@kindex C-c C-e @r{(F90 mode)}
+@findex f90-next-block
+@item C-c C-e
+Move point forward to the start of the next code block
+(@code{f90-next-block}).  A code block is a subroutine,
+@code{if}--@code{endif} statement, and so forth.  This command exists
+for F90 mode only, not Fortran mode.  With a numeric argument, this
+moves forward that many blocks.
+
+@kindex C-c C-a @r{(F90 mode)}
+@findex f90-previous-block
+@item C-c C-a
+Move point backward to the previous code block
+(@code{f90-previous-block}).  This is like @code{f90-next-block}, but
+moves backwards.
+
+@kindex C-M-n @r{(Fortran mode)}
+@findex fortran-end-of-block
+@findex f90-end-of-block
+@item C-M-n
+Move to the end of the current code block
+(@code{fortran-end-of-block}/@code{f90-end-of-block}).  With a numeric
+argument, move forward that number of blocks.  The mark is set before
+moving point.  The F90 mode version of this command checks for
+consistency of block types and labels (if present), but it does not
+check the outermost block since that may be incomplete.
+
+@kindex C-M-p @r{(Fortran mode)}
+@findex fortran-beginning-of-block
+@findex f90-beginning-of-block
+@item C-M-p
+Move to the start of the current code block
+(@code{fortran-beginning-of-block}/@code{f90-beginning-of-block}). This
+is like @code{fortran-end-of-block}, but moves backwards.
+@end table
+
+@node Fortran Indent
+@subsection Fortran Indentation
+
+  Special commands and features are needed for indenting Fortran code in
+order to make sure various syntactic entities (line numbers, comment line
+indicators and continuation line flags) appear in the columns that are
+required for standard, fixed (or tab) format Fortran.
+
+@menu
+* Commands: ForIndent Commands.  Commands for indenting and filling Fortran.
+* Contline: ForIndent Cont.      How continuation lines indent.
+* Numbers:  ForIndent Num.       How line numbers auto-indent.
+* Conv:     ForIndent Conv.      Conventions you must obey to avoid trouble.
+* Vars:     ForIndent Vars.      Variables controlling Fortran indent style.
+@end menu
+
+@node ForIndent Commands
+@subsubsection Fortran Indentation and Filling Commands
+
+@table @kbd
+@item C-M-j
+Break the current line at point and set up a continuation line
+(@code{fortran-split-line}).
+@item M-^
+Join this line to the previous line (@code{fortran-join-line}).
+@item C-M-q
+Indent all the lines of the subprogram point is in
+(@code{fortran-indent-subprogram}).
+@item M-q
+Fill a comment block or statement.
+@end table
+
+@kindex C-M-q @r{(Fortran mode)}
+@findex fortran-indent-subprogram
+  The key @kbd{C-M-q} runs @code{fortran-indent-subprogram}, a command
+to reindent all the lines of the Fortran subprogram (function or
+subroutine) containing point.
+
+@kindex C-M-j @r{(Fortran mode)}
+@findex fortran-split-line
+  The key @kbd{C-M-j} runs @code{fortran-split-line}, which splits
+a line in the appropriate fashion for Fortran.  In a non-comment line,
+the second half becomes a continuation line and is indented
+accordingly.  In a comment line, both halves become separate comment
+lines.
+
+@kindex M-^ @r{(Fortran mode)}
+@kindex C-c C-d @r{(Fortran mode)}
+@findex fortran-join-line
+  @kbd{M-^} or @kbd{C-c C-d} runs the command @code{fortran-join-line},
+which joins a continuation line back to the previous line, roughly as
+the inverse of @code{fortran-split-line}.  The point must be on a
+continuation line when this command is invoked.
+
+@kindex M-q @r{(Fortran mode)}
+@kbd{M-q} in Fortran mode fills the comment block or statement that
+point is in.  This removes any excess statement continuations.
+
+@node ForIndent Cont
+@subsubsection Continuation Lines
+@cindex Fortran continuation lines
+
+@vindex fortran-continuation-string
+  Most Fortran77 compilers allow two ways of writing continuation lines.
+If the first non-space character on a line is in column 5, then that
+line is a continuation of the previous line.  We call this @dfn{fixed
+format}.  (In GNU Emacs we always count columns from 0; but note that
+the Fortran standard counts from 1.)  The variable
+@code{fortran-continuation-string} specifies what character to put in
+column 5.  A line that starts with a tab character followed by any digit
+except @samp{0} is also a continuation line.  We call this style of
+continuation @dfn{tab format}.  (Fortran90 introduced ``free format'',
+with another style of continuation lines).
+
+@vindex indent-tabs-mode @r{(Fortran mode)}
+@vindex fortran-analyze-depth
+@vindex fortran-tab-mode-default
+  Fortran mode can use either style of continuation line.  When you
+enter Fortran mode, it tries to deduce the proper continuation style
+automatically from the buffer contents.  It does this by scanning up to
+@code{fortran-analyze-depth} (default 100) lines from the start of the
+buffer.  The first line that begins with either a tab character or six
+spaces determines the choice.  If the scan fails (for example, if the
+buffer is new and therefore empty), the value of
+@code{fortran-tab-mode-default} (@code{nil} for fixed format, and
+non-@code{nil} for tab format) is used.  @samp{/t} in the mode line
+indicates tab format is selected.  Fortran mode sets the value of
+@code{indent-tabs-mode} accordingly.
+
+  If the text on a line starts with the Fortran continuation marker
+@samp{$}, or if it begins with any non-whitespace character in column
+5, Fortran mode treats it as a continuation line.  When you indent a
+continuation line with @key{TAB}, it converts the line to the current
+continuation style.  When you split a Fortran statement with
+@kbd{C-M-j}, the continuation marker on the newline is created according
+to the continuation style.
+
+  The setting of continuation style affects several other aspects of
+editing in Fortran mode.  In fixed format mode, the minimum column
+number for the body of a statement is 6.  Lines inside of Fortran
+blocks that are indented to larger column numbers always use only the
+space character for whitespace.  In tab format mode, the minimum
+column number for the statement body is 8, and the whitespace before
+column 8 must always consist of one tab character.
+
+@node ForIndent Num
+@subsubsection Line Numbers
+
+  If a number is the first non-whitespace in the line, Fortran
+indentation assumes it is a line number and moves it to columns 0
+through 4.  (Columns always count from 0 in GNU Emacs.)
+
+@vindex fortran-line-number-indent
+  Line numbers of four digits or less are normally indented one space.
+The variable @code{fortran-line-number-indent} controls this; it
+specifies the maximum indentation a line number can have.  The default
+value of the variable is 1.  Fortran mode tries to prevent line number
+digits passing column 4, reducing the indentation below the specified
+maximum if necessary.  If @code{fortran-line-number-indent} has the
+value 5, line numbers are right-justified to end in column 4.
+
+@vindex fortran-electric-line-number
+  Simply inserting a line number is enough to indent it according to
+these rules.  As each digit is inserted, the indentation is recomputed.
+To turn off this feature, set the variable
+@code{fortran-electric-line-number} to @code{nil}.
+
+
+@node ForIndent Conv
+@subsubsection Syntactic Conventions
+
+  Fortran mode assumes that you follow certain conventions that simplify
+the task of understanding a Fortran program well enough to indent it
+properly:
+
+@itemize @bullet
+@item
+Two nested @samp{do} loops never share a @samp{continue} statement.
+
+@item
+Fortran keywords such as @samp{if}, @samp{else}, @samp{then}, @samp{do}
+and others are written without embedded whitespace or line breaks.
+
+Fortran compilers generally ignore whitespace outside of string
+constants, but Fortran mode does not recognize these keywords if they
+are not contiguous.  Constructs such as @samp{else if} or @samp{end do}
+are acceptable, but the second word should be on the same line as the
+first and not on a continuation line.
+@end itemize
+
+@noindent
+If you fail to follow these conventions, the indentation commands may
+indent some lines unaesthetically.  However, a correct Fortran program
+retains its meaning when reindented even if the conventions are not
+followed.
+
+@node ForIndent Vars
+@subsubsection Variables for Fortran Indentation
+
+@vindex fortran-do-indent
+@vindex fortran-if-indent
+@vindex fortran-structure-indent
+@vindex fortran-continuation-indent
+@vindex fortran-check-all-num@dots{}
+@vindex fortran-minimum-statement-indent@dots{}
+  Several additional variables control how Fortran indentation works:
+
+@table @code
+@item fortran-do-indent
+Extra indentation within each level of @samp{do} statement (default 3).
+
+@item fortran-if-indent
+Extra indentation within each level of @samp{if}, @samp{select case}, or
+@samp{where} statements (default 3).
+
+@item fortran-structure-indent
+Extra indentation within each level of @samp{structure}, @samp{union},
+@samp{map}, or @samp{interface} statements (default 3).
+
+@item fortran-continuation-indent
+Extra indentation for bodies of continuation lines (default 5).
+
+@item fortran-check-all-num-for-matching-do
+In Fortran77, a numbered @samp{do} statement is ended by any statement
+with a matching line number.  It is common (but not compulsory) to use a
+@samp{continue} statement for this purpose.  If this variable has a
+non-@code{nil} value, indenting any numbered statement must check for a
+@samp{do} that ends there.  If you always end @samp{do} statements with
+a @samp{continue} line (or if you use the more modern @samp{enddo}),
+then you can speed up indentation by setting this variable to
+@code{nil}.  The default is @code{nil}.
+
+@item fortran-blink-matching-if
+If this is @code{t}, indenting an @samp{endif} (or @samp{enddo}
+statement moves the cursor momentarily to the matching @samp{if} (or
+@samp{do}) statement to show where it is.  The default is @code{nil}.
+
+@item fortran-minimum-statement-indent-fixed
+Minimum indentation for Fortran statements when using fixed format
+continuation line style.  Statement bodies are never indented less than
+this much.  The default is 6.
+
+@item fortran-minimum-statement-indent-tab
+Minimum indentation for Fortran statements for tab format continuation line
+style.  Statement bodies are never indented less than this much.  The
+default is 8.
+@end table
+
+The variables controlling the indentation of comments are described in
+the following section.
+
+@node Fortran Comments
+@subsection Fortran Comments
+
+  The usual Emacs comment commands assume that a comment can follow a
+line of code.  In Fortran77, the standard comment syntax requires an
+entire line to be just a comment.  Therefore, Fortran mode replaces the
+standard Emacs comment commands and defines some new variables.
+
+@vindex fortran-comment-line-start
+  Fortran mode can also handle the Fortran90 comment syntax where comments
+start with @samp{!} and can follow other text.  Because only some Fortran77
+compilers accept this syntax, Fortran mode will not insert such comments
+unless you have said in advance to do so.  To do this, set the variable
+@code{fortran-comment-line-start} to @samp{"!"}.
+
+@table @kbd
+@item M-;
+Align comment or insert new comment (@code{fortran-indent-comment}).
+
+@item C-x ;
+Applies to nonstandard @samp{!} comments only.
+
+@item C-c ;
+Turn all lines of the region into comments, or (with argument) turn them back
+into real code (@code{fortran-comment-region}).
+@end table
+
+@findex fortran-indent-comment
+  @kbd{M-;} in Fortran mode is redefined as the command
+@code{fortran-indent-comment}.  Like the usual @kbd{M-;} command, this
+recognizes any kind of existing comment and aligns its text appropriately;
+if there is no existing comment, a comment is inserted and aligned.  But
+inserting and aligning comments are not the same in Fortran mode as in
+other modes.
+
+  When a new comment must be inserted, if the current line is blank, a
+full-line comment is inserted.  On a non-blank line, a nonstandard @samp{!}
+comment is inserted if you have said you want to use them.  Otherwise a
+full-line comment is inserted on a new line before the current line.
+
+  Nonstandard @samp{!} comments are aligned like comments in other
+languages, but full-line comments are different.  In a standard full-line
+comment, the comment delimiter itself must always appear in column zero.
+What can be aligned is the text within the comment.  You can choose from
+three styles of alignment by setting the variable
+@code{fortran-comment-indent-style} to one of these values:
+
+@vindex fortran-comment-indent-style
+@vindex fortran-comment-line-extra-indent
+@table @code
+@item fixed
+Align the text at a fixed column, which is the sum of
+@code{fortran-comment-line-extra-indent} and the minimum statement
+indentation.  This is the default.
+
+The minimum statement indentation is
+@code{fortran-minimum-statement-indent-fixed} for fixed format
+continuation line style and @code{fortran-minimum-statement-indent-tab}
+for tab format style.
+
+@item relative
+Align the text as if it were a line of code, but with an additional
+@code{fortran-comment-line-extra-indent} columns of indentation.
+
+@item nil
+Don't move text in full-line comments automatically.
+@end table
+
+@vindex fortran-comment-indent-char
+  In addition, you can specify the character to be used to indent within
+full-line comments by setting the variable
+@code{fortran-comment-indent-char} to the single-character string you want
+to use.
+
+@vindex fortran-directive-re
+  Compiler directive lines, or preprocessor lines, have much the same
+appearance as comment lines.  It is important, though, that such lines
+never be indented at all, no matter what the value of
+@code{fortran-comment-indent-style}.  The variable
+@code{fortran-directive-re} is a regular expression that specifies which
+lines are directives.  Matching lines are never indented, and receive
+distinctive font-locking.
+
+  The normal Emacs comment command @kbd{C-x ;} has not been redefined.  If
+you use @samp{!} comments, this command can be used with them.  Otherwise
+it is useless in Fortran mode.
+
+@kindex C-c ; @r{(Fortran mode)}
+@findex fortran-comment-region
+@vindex fortran-comment-region
+  The command @kbd{C-c ;} (@code{fortran-comment-region}) turns all the
+lines of the region into comments by inserting the string @samp{C$$$} at
+the front of each one.  With a numeric argument, it turns the region
+back into live code by deleting @samp{C$$$} from the front of each line
+in it.  The string used for these comments can be controlled by setting
+the variable @code{fortran-comment-region}.  Note that here we have an
+example of a command and a variable with the same name; these two uses
+of the name never conflict because in Lisp and in Emacs it is always
+clear from the context which one is meant.
+
+@node Fortran Autofill
+@subsection Auto Fill in Fortran Mode
+
+  Fortran mode has specialized support for Auto Fill mode, which is a
+minor mode that automatically splits statements as you insert them
+when they become too wide.  Splitting a statement involves making
+continuation lines using @code{fortran-continuation-string}
+(@pxref{ForIndent Cont}).  This splitting happens when you type
+@key{SPC}, @key{RET}, or @key{TAB}, and also in the Fortran
+indentation commands.  You activate Auto Fill in Fortran mode in the
+normal way.
+@iftex
+@xref{Auto Fill,,, emacs, the Emacs Manual}.
+@end iftex
+@ifnottex
+@xref{Auto Fill}.
+@end ifnottex
+
+@vindex fortran-break-before-delimiters
+   Auto Fill breaks lines at spaces or delimiters when the lines get
+longer than the desired width (the value of @code{fill-column}).  The
+delimiters (besides whitespace) that Auto Fill can break at are
+@samp{+}, @samp{-}, @samp{/}, @samp{*}, @samp{=}, @samp{<}, @samp{>},
+and @samp{,}.  The line break comes after the delimiter if the
+variable @code{fortran-break-before-delimiters} is @code{nil}.
+Otherwise (and by default), the break comes before the delimiter.
+
+  To enable Auto Fill in all Fortran buffers, add
+@code{turn-on-auto-fill} to @code{fortran-mode-hook}.
+@iftex
+@xref{Hooks,,, emacs, the Emacs Manual}.
+@end iftex
+@ifnottex
+@xref{Hooks}.
+@end ifnottex
+
+@node Fortran Columns
+@subsection Checking Columns in Fortran
+
+@table @kbd
+@item C-c C-r
+Display a ``column ruler'' momentarily above the current line
+(@code{fortran-column-ruler}).
+@item C-c C-w
+Split the current window horizontally temporarily so that it is 72
+columns wide (@code{fortran-window-create-momentarily}).  This may
+help you avoid making lines longer than the 72-character limit that
+some Fortran compilers impose.
+@item C-u C-c C-w
+Split the current window horizontally so that it is 72 columns wide
+(@code{fortran-window-create}).  You can then continue editing.
+@item M-x fortran-strip-sequence-nos
+Delete all text in column 72 and beyond.
+@end table
+
+@kindex C-c C-r @r{(Fortran mode)}
+@findex fortran-column-ruler
+  The command @kbd{C-c C-r} (@code{fortran-column-ruler}) shows a column
+ruler momentarily above the current line.  The comment ruler is two lines
+of text that show you the locations of columns with special significance in
+Fortran programs.  Square brackets show the limits of the columns for line
+numbers, and curly brackets show the limits of the columns for the
+statement body.  Column numbers appear above them.
+
+  Note that the column numbers count from zero, as always in GNU Emacs.
+As a result, the numbers may be one less than those you are familiar
+with; but the positions they indicate in the line are standard for
+Fortran.
+
+@vindex fortran-column-ruler-fixed
+@vindex fortran-column-ruler-tabs
+  The text used to display the column ruler depends on the value of the
+variable @code{indent-tabs-mode}.  If @code{indent-tabs-mode} is
+@code{nil}, then the value of the variable
+@code{fortran-column-ruler-fixed} is used as the column ruler.
+Otherwise, the value of the variable @code{fortran-column-ruler-tab} is
+displayed.  By changing these variables, you can change the column ruler
+display.
+
+@kindex C-c C-w @r{(Fortran mode)}
+@findex fortran-window-create-momentarily
+  @kbd{C-c C-w} (@code{fortran-window-create-momentarily}) temporarily
+splits the current window horizontally, making a window 72 columns
+wide, so you can see any lines that are too long.  Type a space to
+restore the normal width.
+
+@kindex C-u C-c C-w @r{(Fortran mode)}
+@findex fortran-window-create
+  You can also split the window horizontally and continue editing with
+the split in place.  To do this, use @kbd{C-u C-c C-w} (@code{M-x
+fortran-window-create}).  By editing in this window you can
+immediately see when you make a line too wide to be correct Fortran.
+
+@findex fortran-strip-sequence-nos
+  The command @kbd{M-x fortran-strip-sequence-nos} deletes all text in
+column 72 and beyond, on all lines in the current buffer.  This is the
+easiest way to get rid of old sequence numbers.
+
+@node Fortran Abbrev
+@subsection Fortran Keyword Abbrevs
+
+  Fortran mode provides many built-in abbrevs for common keywords and
+declarations.  These are the same sort of abbrev that you can define
+yourself.  To use them, you must turn on Abbrev mode.
+@iftex
+@xref{Abbrevs,,, emacs, the Emacs Manual}.
+@end iftex
+@ifnottex
+@xref{Abbrevs}.
+@end ifnottex
+
+  The built-in abbrevs are unusual in one way: they all start with a
+semicolon.  You cannot normally use semicolon in an abbrev, but Fortran
+mode makes this possible by changing the syntax of semicolon to ``word
+constituent.''
+
+  For example, one built-in Fortran abbrev is @samp{;c} for
+@samp{continue}.  If you insert @samp{;c} and then insert a punctuation
+character such as a space or a newline, the @samp{;c} expands automatically
+to @samp{continue}, provided Abbrev mode is enabled.@refill
+
+  Type @samp{;?} or @samp{;C-h} to display a list of all the built-in
+Fortran abbrevs and what they stand for.
+
+@ignore
+   arch-tag: 23ed7c36-1517-4646-9235-2d5ade5f06f6
+@end ignore
--- a/man/frames.texi	Tue May 02 08:50:29 2006 +0000
+++ b/man/frames.texi	Wed May 10 20:42:41 2006 +0000
@@ -27,7 +27,13 @@
 
   Emacs compiled for MS-DOS emulates some windowing functionality,
 so that you can use many of the features described in this chapter.
+@iftex
 @xref{MS-DOS Mouse,,,emacs-xtra,Specialized Emacs Features}.
+@end iftex
+@ifnottex
+@xref{MS-DOS Mouse}.
+@end ifnottex
+
 
 @menu
 * Mouse Commands::      Moving, cutting, and pasting, with the mouse.
@@ -512,7 +518,7 @@
 Iconify the selected Emacs frame (@code{iconify-or-deiconify-frame}).
 The normal meaning of @kbd{C-z}, to suspend Emacs, is not useful under
 a graphical display that allows multiple applications to operate
-simultaneously in their own windies, so Emacs gives @kbd{C-z} a
+simultaneously in their own windows, so Emacs gives @kbd{C-z} a
 different binding in that case.
 
 If you type this command on an Emacs frame's icon, it deiconifies the frame.
--- a/man/gnu.texi	Tue May 02 08:50:29 2006 +0000
+++ b/man/gnu.texi	Wed May 10 20:42:41 2006 +0000
@@ -2,7 +2,7 @@
 @c Copyright (C) 1985, 1986, 1987, 1993, 1995, 2002, 2003, 2004,
 @c   2005, 2006 Free Software Foundation, Inc.
 @ifclear justgnu
-@node Manifesto,, Emacs and Microsoft Windows, Top
+@node Manifesto,, Microsoft Windows, Top
 @unnumbered The GNU Manifesto
 @end ifclear
 @ifset justgnu
--- a/man/help.texi	Tue May 02 08:50:29 2006 +0000
+++ b/man/help.texi	Wed May 10 20:42:41 2006 +0000
@@ -401,7 +401,7 @@
 libraries by topic keywords.  Here is a partial list of keywords you can
 use:
 
-@multitable {emulations} {aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}
+@multitable {convenience} {aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}
 @item abbrev@tab abbreviation handling, typing shortcuts, macros.
 @item bib@tab code related to the @code{bib} bibliography processor.
 @item c@tab support for the C language and related languages.
--- a/man/killing.texi	Tue May 02 08:50:29 2006 +0000
+++ b/man/killing.texi	Wed May 10 20:42:41 2006 +0000
@@ -62,7 +62,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.
 @end menu
 
--- a/man/macos.texi	Tue May 02 08:50:29 2006 +0000
+++ b/man/macos.texi	Wed May 10 20:42:41 2006 +0000
@@ -2,7 +2,7 @@
 @c Copyright (C) 2000, 2001, 2002, 2003, 2004,
 @c   2005, 2006 Free Software Foundation, Inc.
 @c See file emacs.texi for copying conditions.
-@node Mac OS, Emacs and Microsoft Windows, Antinews, Top
+@node Mac OS, Microsoft Windows, Antinews, Top
 @appendix Emacs and Mac OS
 @cindex Mac OS
 @cindex Macintosh
@@ -67,7 +67,8 @@
 supports international and alternative keyboard layouts (e.g., Dvorak)
 if its script is either Roman, Japanese, Traditional Chinese, Korean,
 Cyrillic, Simplified Chinese, or Central European.  Keyboard layouts
-based on Unicode may not work properly.  Selecting one of the layouts
+based on Unicode may not work properly.  (Try drag-and-drop if input
+from the Character Palette does not work.)  Selecting one of the layouts
 from the keyboard layout pull-down menu will affect how the keys typed
 on the keyboard are interpreted.
 
@@ -318,7 +319,7 @@
 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
+by @samp{-apple-monaco-medium-r-normal--12-*-iso10646-1}) because every
 @acronym{ATSUI}-compatible font is a scalable one.
 
   QuickDraw Text fonts have maker name @code{apple} and various charset
--- a/man/maintaining.texi	Tue May 02 08:50:29 2006 +0000
+++ b/man/maintaining.texi	Wed May 10 20:42:41 2006 +0000
@@ -14,6 +14,9 @@
 * Format of ChangeLog:: What the change log file looks like.
 * Tags::	        Go direct to any function in your program in one
 			  command.  Tags remembers which file it is in.
+@ifnottex
+* Emerge::              A convenient way of merging two versions of a program.
+@end ifnottex
 @end menu
 
 @node Change Log
@@ -845,6 +848,10 @@
   You can also use the collection of tag names to complete a symbol
 name in the buffer.  @xref{Symbol Completion}.
 
+@ifnottex
+@include emerge-xtra.texi
+@end ifnottex
+
 @ignore
    arch-tag: b9d83dfb-82ea-4ff6-bab5-05a3617091fb
 @end ignore
--- a/man/makefile.w32-in	Tue May 02 08:50:29 2006 +0000
+++ b/man/makefile.w32-in	Wed May 10 20:42:41 2006 +0000
@@ -30,7 +30,7 @@
 # The makeinfo program is part of the Texinfo distribution.
 MAKEINFO = makeinfo --force
 MULTI_INSTALL_INFO = $(srcdir)\..\nt\multi-install-info.bat
-INFO_TARGETS = $(infodir)/emacs $(infodir)/emacs-xtra $(infodir)/ccmode \
+INFO_TARGETS = $(infodir)/emacs $(infodir)/ccmode \
 		$(infodir)/cl $(infodir)/dired-x $(infodir)/ediff \
 		$(infodir)/forms $(infodir)/gnus $(infodir)/message \
 		$(infodir)/sieve $(infodir)/pgg $(infodir)/emacs-mime \
@@ -62,6 +62,18 @@
 ENVADD = $(srcdir)\..\nt\envadd.bat "TEXINPUTS=$(srcdir);$(TEXINPUTS)" \
 	 "MAKEINFO=$(MAKEINFO) -I$(srcdir)" /C
 
+EMACS_XTRA=\
+	$(srcdir)/arevert-xtra.texi \
+	$(srcdir)/cal-xtra.texi \
+	$(srcdir)/dired-xtra.texi \
+	$(srcdir)/picture-xtra.texi \
+	$(srcdir)/emerge-xtra.texi \
+	$(srcdir)/vc-xtra.texi \
+	$(srcdir)/vc1-xtra.texi \
+	$(srcdir)/vc2-xtra.texi \
+	$(srcdir)/fortran-xtra.texi \
+	$(srcdir)/msdog-xtra.texi
+
 EMACSSOURCES= \
 	$(srcdir)/emacs.texi \
 	$(srcdir)/doclicense.texi \
@@ -105,7 +117,8 @@
 	$(srcdir)/gnu.texi \
 	$(srcdir)/glossary.texi \
 	$(srcdir)/ack.texi \
-	$(srcdir)/kmacro.texi
+	$(srcdir)/kmacro.texi \
+	$(EMACS_XTRA)
 
 info: $(INFO_TARGETS)
 
@@ -134,7 +147,7 @@
 $(infodir)/emacs: $(EMACSSOURCES)
 	$(MAKEINFO) emacs.texi
 
-emacs.dvi: $(EMACSSOURCES)
+emacs.dvi: $(EMACSSOURCES) $(srcdir)/xresmini.texi
 	$(ENVADD) $(TEXI2DVI) $(srcdir)/emacs.texi
 
 # This target is here so you could easily get the list of the *.texi
@@ -309,10 +322,7 @@
 smtpmail.dvi: smtpmail.texi
 	$(ENVADD) $(TEXI2DVI) $(srcdir)/smtpmail.texi
 
-$(infodir)/emacs-xtra: emacs-xtra.texi
-	$(MAKEINFO) emacs-xtra.texi
-
-emacs-xtra.dvi: emacs-xtra.texi
+emacs-xtra.dvi: emacs-xtra.texi $(EMACS_XTRA)
 	$(ENVADD) $(TEXI2DVI) $(srcdir)/emacs-xtra.texi
 
 $(infodir)/org: org.texi
--- a/man/mh-e.texi	Tue May 02 08:50:29 2006 +0000
+++ b/man/mh-e.texi	Wed May 10 20:42:41 2006 +0000
@@ -8,15 +8,15 @@
 @c %**end of header
 
 @c Version of the software and manual.
-@set VERSION 7.94
+@set VERSION 8.0
 @c Edition of the manual. It is either empty for the first edition or
 @c has the form ", nth Edition" (without the quotes).
-@set EDITION , 2nd Edition
-@set UPDATED 2006-04-24
-@set UPDATE-MONTH April, 2006
+@set EDITION 
+@set UPDATED 2006-05-06
+@set UPDATE-MONTH May, 2006
 
 @c Other variables.
-@set MH-BOOK-HOME http://www.ics.uci.edu/~mh/book/mh
+@set MH-BOOK-HOME http://rand-mh.sourceforge.net/book/mh
 @set MH-E-HOME http://mh-e.sourceforge.net/
 
 @c Copyright
@@ -564,12 +564,12 @@
 If you've never run MH before, you need to run @command{install-mh}
 from the shell before you continue. This sets up your personal MH
 environment@footnote{See the section
-@uref{@value{MH-BOOK-HOME}/../overall/setup.htm, Setting Up MH} in the
+@uref{@value{MH-BOOK-HOME}/../overall/setup.html, Setting Up MH} in the
 MH book.}. If you don't, you'll be greeted with the error message:
 @samp{Install MH and run install-mh before running MH-E}. This is all
 you need to know about MH to use MH-E, but the more you know about MH,
 the more you can leverage its power. See the
-@uref{@value{MH-BOOK-HOME}, MH book} to learn more about MH.
+@uref{@value{MH-BOOK-HOME}/../, MH book} to learn more about MH.
 
 @cindex @samp{Path:} MH profile component
 @cindex MH profile
@@ -763,10 +763,10 @@
 To read the mail you've just sent yourself, enter @kbd{M-x mh-rmail}.
 This incorporates the new mail and puts the output from
 @command{inc}@footnote{See the section
-@uref{@value{MH-BOOK-HOME}/reapre.htm, Reading Mail: inc show next
+@uref{@value{MH-BOOK-HOME}/reapre.html, Reading Mail: inc show next
 prev} in the MH book.} (called @dfn{scan lines} after the MH program
 @command{scan}@footnote{See the section
-@uref{@value{MH-BOOK-HOME}/faswsprs.htm, Find and Specify with scan
+@uref{@value{MH-BOOK-HOME}/faswsprs.html, Find and Specify with scan
 pick Ranges Sequences} in the MH book.} which prints a one-line
 summary of each message) into a buffer called @samp{+inbox} whose
 major mode is MH-Folder.
@@ -1088,7 +1088,7 @@
 running @kbd{C-h C-h}. This brings up a list of available help topics,
 one of which displays the documentation for a given key (like @kbd{C-h
 k C-n}). Another useful help feature is to view the manual section
-that describes a given key (such as @kbd{C-h C-k i}). In addition,
+that describes a given key (such as @kbd{C-h K i}). In addition,
 review @ref{Conventions}, if any of the GNU Emacs conventions are
 strange to you.
 
@@ -1158,7 +1158,7 @@
 please do not prefix your symbols (variables and functions) with
 @samp{mh-}. This prefix is reserved for the MH-E package. To avoid
 conflicts with existing MH-E symbols, use a prefix like @samp{my-} or
-your initials.
+your initials. (Unless, of course, your initials happen to be @emph{mh}!)
 
 @menu
 * Options::                     
@@ -1252,7 +1252,7 @@
 range must be nonempty.
 @c -------------------------
 @item <num>:N
-@item <num>:+N
+@itemx <num>:+N
 @itemx <num>:-N
 Up to N messages beginning with (or ending with) message num. Num may
 be any of the predefined symbols: first, prev, cur, next or last.
@@ -1459,8 +1459,8 @@
 @code{mh-progs} directory (@pxref{Getting Started}). You may also link
 a file to @command{inc} that uses a different format (see
 @samp{mh-profile}(5), and sections
-@uref{@value{MH-BOOK-HOME}/reapre.htm, Reading Mail: inc show next
-prev} and @uref{@value{MH-BOOK-HOME}/mhstr.htm, MH Format Strings} in
+@uref{@value{MH-BOOK-HOME}/reapre.html, Reading Mail: inc show next
+prev} and @uref{@value{MH-BOOK-HOME}/mhstr.html, MH Format Strings} in
 the MH book). You'll then need to modify several variables
 appropriately (@pxref{Scan Line Formats}).
 
@@ -2169,7 +2169,7 @@
 @command{mhl} from the shell. If you have a format file that you want
 MH-E to use, you can set this option to @samp{Specify an mhl Format
 File} and enter the name of your format file (@command{mhl}(1) or
-section @uref{@value{MH-BOOK-HOME}/shomes.htm#Usisho, Using mhl} in
+section @uref{@value{MH-BOOK-HOME}/shomes.html#Usisho, Using mhl} in
 the MH book tells you how to write one). Your format file should
 specify a non-zero value for @samp{overflowoffset} to allow MH-E to
 parse the header. Note that @command{mhl} is always used for printing
@@ -2291,9 +2291,9 @@
 Mail Extensions) messages which are simply messages with additional
 @dfn{body parts} or @dfn{attachments}. You can use the MH commands
 @command{show}@footnote{See the section
-@uref{@value{MH-BOOK-HOME}/reapre.htm, Reading Mail: inc show next
+@uref{@value{MH-BOOK-HOME}/reapre.html, Reading Mail: inc show next
 prev} in the MH book.} or @command{mhshow}@footnote{See the section
-@uref{@value{MH-BOOK-HOME}/usimim.htm#ReMIMa, Reading MIME Mail} in
+@uref{@value{MH-BOOK-HOME}/usimim.html#ReMIMa, Reading MIME Mail} in
 the MH book.} from the shell to read @sc{mime} messages@footnote{You
 can call them directly from Emacs if you're running the X Window
 System: type @kbd{M-! xterm -e mhshow @var{message-number}}. You can
@@ -2656,7 +2656,7 @@
 
 Another handy command is @kbd{D b} (@code{mh-burst-digest}). This
 command uses the MH command @command{burst}@footnote{See the section
-@uref{@value{MH-BOOK-HOME}/burdig.htm, Bursting Messages} in the MH
+@uref{@value{MH-BOOK-HOME}/burdig.html, Bursting Messages} in the MH
 book.} to break out each message in the digest into its own message.
 Using this command, you can quickly delete unwanted messages, like
 this: Once the digest is split up, toggle out of MH-Folder Show mode
@@ -2867,7 +2867,7 @@
 @kbd{P l} (@code{mh-print-msg}) (the @i{l} is for @i{l}ine printer or
 @i{l}pr). You can print all the messages in a range. The message is
 formatted with @command{mhl}@footnote{See the section
-@uref{@value{MH-BOOK-HOME}/shomes.htm#Usisho, Using mhl} in the MH
+@uref{@value{MH-BOOK-HOME}/shomes.html#Usisho, Using mhl} in the MH
 book.} and printed with the @command{lpr} command.
 
 @kindex P f
@@ -3471,8 +3471,8 @@
 
 MH-E has analogies for each of the MH @command{folder} and
 @command{refile} commands@footnote{See the sections
-@uref{@value{MH-BOOK-HOME}/fol.htm#Youfol, Your Current Folder:
-folder} and @uref{@value{MH-BOOK-HOME}/fol.htm#Movref, Moving and
+@uref{@value{MH-BOOK-HOME}/fol.html#Youfol, Your Current Folder:
+folder} and @uref{@value{MH-BOOK-HOME}/fol.html#Movref, Moving and
 Linking Messages: refile} in the MH book.}. To refile a message in
 another folder, use the command @kbd{o} (@code{mh-refile-msg})
 (mnemonic: ``output''). You are prompted for the folder name
@@ -3720,7 +3720,7 @@
 
 The option @code{mh-sortm-args} holds extra arguments to pass on to
 the command @command{sortm}@footnote{See the section
-@uref{@value{MH-BOOK-HOME}/sorsor.htm, Sorting Messages: sortm} in the
+@uref{@value{MH-BOOK-HOME}/sorsor.html, Sorting Messages: sortm} in the
 MH book.} when a prefix argument is used with @kbd{F S}. Normally
 default arguments to @command{sortm} are specified in the MH profile.
 This option may be used to provide an alternate view. For example,
@@ -4103,7 +4103,7 @@
 @vindex mh-reply-default-reply-to
 
 Depending on your answer, @command{repl}@footnote{See the section
-@uref{@value{MH-BOOK-HOME}/reprep.htm, Replying to Messages: repl} in
+@uref{@value{MH-BOOK-HOME}/reprep.html, Replying to Messages: repl} in
 the MH book.} is given a different argument to form your reply.
 Specifically, a choice of @kbd{from} or none at all runs @samp{repl
 -nocc all}, and a choice of @kbd{to} runs @samp{repl -cc to}. Finally,
@@ -4133,7 +4133,7 @@
 are replying to is inserted in your reply after having first been run
 through @command{mhl} with the format file @file{mhl.reply}. See
 @command{mhl}(1) or the section
-@uref{@value{MH-BOOK-HOME}/shomes.htm#Usisho, Using mhl} in the MH
+@uref{@value{MH-BOOK-HOME}/shomes.html#Usisho, Using mhl} in the MH
 book to see how you can modify the default @file{mhl.reply} file.
 
 @vindex mh-yank-behavior
@@ -4169,7 +4169,7 @@
 are prompted for the @samp{To:} and @samp{cc:} recipients. You are
 given a draft to edit that looks like it would if you had run the MH
 command @command{forw}@footnote{See the section
-@uref{@value{MH-BOOK-HOME}/forfor.htm, Forwarding Messages: forw} in
+@uref{@value{MH-BOOK-HOME}/forfor.html, Forwarding Messages: forw} in
 the MH book.}. You can then add some text (@pxref{Editing Drafts}).
 You can forward several messages by using a range (@pxref{Ranges}).
 All of the messages in the range are inserted into your draft. The
@@ -4243,10 +4243,10 @@
 
 The option @code{mh-redist-full-contents-flag} must be turned on if
 @command{dist}@footnote{See the section
-@uref{@value{MH-BOOK-HOME}/disdis.htm, Distributing Messages with
+@uref{@value{MH-BOOK-HOME}/disdis.html, Distributing Messages with
 dist} in the MH book.} requires the whole letter for redistribution,
 which is the case if @command{send}@footnote{See the section
-@uref{@value{MH-BOOK-HOME}/sensen.htm, Sending Some Mail: comp send}
+@uref{@value{MH-BOOK-HOME}/sensen.html, Sending Some Mail: comp send}
 in the MH book.} is compiled with the @sc{berk} option (which many
 people abhor). If you find that MH will not allow you to redistribute
 a message that has been redistributed before, turn off this option.
@@ -5143,7 +5143,7 @@
 to insert the directives so you don't need to remember the syntax of
 them. Remember: you can always add MH-style directives by
 hand@footnote{See the section
-@uref{@value{MH-BOOK-HOME}/usimim.htm#SeMIMa, Sending MIME Mail} in
+@uref{@value{MH-BOOK-HOME}/usimim.html#SeMIMa, Sending MIME Mail} in
 the MH book.}.
 
 @cindex MIME Meta Language (MML)
@@ -5432,7 +5432,7 @@
 (@code{mh-mh-to-mime}) instead of @kbd{C-c C-m C-m}. This runs the
 command @command{mhbuild} (@command{mhn}) on the message which expands
 the tags@footnote{See the section
-@uref{@value{MH-BOOK-HOME}/usimim.htm#SeMIMa, Sending MIME Mail} in
+@uref{@value{MH-BOOK-HOME}/usimim.html#SeMIMa, Sending MIME Mail} in
 the MH book.}. This action can be undone by running @kbd{C-c C-m C-u}
 (@code{mh-mh-to-mime-undo}), which works by reverting to a backup
 file. You are prompted to confirm this action, but you can avoid the
@@ -5565,7 +5565,7 @@
 you can check the actual address(es) in the alias. A new buffer named
 @samp{*MH-E Recipients*} is created with the output of @command{whom}
 (@pxref{Miscellaneous})@footnote{See the section
-@uref{@value{MH-BOOK-HOME}/senove.htm#WhaPro, What now? -- and the
+@uref{@value{MH-BOOK-HOME}/senove.html#WhaPro, What now? -- and the
 whatnow Program} in the MH book.}.
 
 @node Sending Message, Killing Draft, Checking Recipients, Editing Drafts
@@ -5599,7 +5599,7 @@
 @vindex mh-send-prog
 
 In case the MH @command{send} program@footnote{See the section
-@uref{@value{MH-BOOK-HOME}/sensen.htm, Sending Some Mail: comp send}
+@uref{@value{MH-BOOK-HOME}/sensen.html, Sending Some Mail: comp send}
 in the MH book.} is installed under a different name, use
 @code{mh-send-prog} to tell MH-E the name.
 
@@ -5780,7 +5780,7 @@
 
 MH-E loads aliases for completion and folder name hints from various
 places. It uses the MH command @command{ali}@footnote{See the section
-@uref{@value{MH-BOOK-HOME}/mh.htm, MH Aliases} in the MH book.} to
+@uref{@value{MH-BOOK-HOME}/mh.html, MH Aliases} in the MH book.} to
 read aliases from the files listed in the profile component
 @samp{Aliasfile:} as well as system-wide aliases (for example,
 @file{/etc/nmh/MailAliases}).
@@ -6253,7 +6253,7 @@
 @cindex customization group, @samp{mh-speedbar}
 
 The MH-E speedbar uses the MH command @command{flists}@footnote{See
-the section @uref{@value{MH-BOOK-HOME}/morseq.htm#flist, Searching for
+the section @uref{@value{MH-BOOK-HOME}/morseq.html#flist, Searching for
 Sequences with flist} in the MH book.} to generate the list of
 folders. The @samp{mh-speedbar} customization group contains the
 following option which controls how often the speedbar calls
@@ -6951,7 +6951,7 @@
 This search method does not require any setup.
 
 Read @command{pick}(1) or the section
-@uref{@value{MH-BOOK-HOME}/finpic.htm, Finding Messages with pick} in
+@uref{@value{MH-BOOK-HOME}/finpic.html, Finding Messages with pick} in
 the MH book to find out more about how to enter the criteria.
 
 @subsection grep
@@ -7180,7 +7180,7 @@
 message. However, you can give any of these a prefix argument to edit
 the @command{pick} expression used to narrow the view@footnote{See
 @command{pick}(1) or the section
-@uref{@value{MH-BOOK-HOME}/finpic.htm, Finding Messages with pick} in
+@uref{@value{MH-BOOK-HOME}/finpic.html, Finding Messages with pick} in
 the MH book.}.
 
 @cindex @samp{tick} sequence
@@ -7212,7 +7212,7 @@
 
 For the whole scoop on MH sequences, refer to
 @samp{mh-sequence}(5)@footnote{See the section
-@uref{@value{MH-BOOK-HOME}/morseq.htm, More About Sequences} in the MH
+@uref{@value{MH-BOOK-HOME}/morseq.html, More About Sequences} in the MH
 book.}. As you've read, several of the MH-E commands can operate on a
 sequence, which is a shorthand for a range or group of messages. For
 example, you might want to forward several messages to a friend or
@@ -7452,7 +7452,7 @@
 
 With the exceptions of @kbd{S n} and @kbd{S w}, the underlying MH
 command dealing with sequences is @command{mark}@footnote{See the
-section @uref{@value{MH-BOOK-HOME}/mmbwm.htm, Make Message Bookmarks
+section @uref{@value{MH-BOOK-HOME}/mmbwm.html, Make Message Bookmarks
 with mark} in the MH book.}.
 
 @node Junk, Miscellaneous, Sequences, Top
@@ -8050,7 +8050,7 @@
 be in the @code{mh-progs} directory (@pxref{Getting Started}). You may
 link another program to @command{scan} (see @samp{mh-profile}(5)) to
 produce a different type of listing@footnote{See the section
-@uref{@value{MH-BOOK-HOME}/faswsprs.htm, Find and Specify with scan
+@uref{@value{MH-BOOK-HOME}/faswsprs.html, Find and Specify with scan
 pick Ranges Sequences} in the MH book.}.
 
 @cindex regular expressions, scan line formats
@@ -8087,7 +8087,7 @@
 This regular expression describes a valid scan line. This is used to
 eliminate error messages that are occasionally produced by
 @command{inc}@footnote{See the section
-@uref{@value{MH-BOOK-HOME}/reapre.htm, Reading Mail: inc show next
+@uref{@value{MH-BOOK-HOME}/reapre.html, Reading Mail: inc show next
 prev} in the MH book.} or @command{scan} (default: @code{"^ *[0-9]"}).
 @end vtable
 
--- a/man/mini.texi	Tue May 02 08:50:29 2006 +0000
+++ b/man/mini.texi	Wed May 10 20:42:41 2006 +0000
@@ -415,6 +415,9 @@
 indicate the places for completion; thus, @file{/u*/b*/f*} might
 complete to @file{/usr/bin/foo}.
 
+  For remote files, partial completion enables completion of methods,
+user names and host names.  @xref{Remote Files}.
+
   To enable this mode, use the command @kbd{M-x
 partial-completion-mode}, or customize the variable
 @code{partial-completion-mode}.  This binds the partial completion
--- a/man/misc.texi	Tue May 02 08:50:29 2006 +0000
+++ b/man/misc.texi	Wed May 10 20:42:41 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, Diff Mode, Sorting, Top
+@node Narrowing, Two-Column, Sorting, Top
 @section Narrowing
 @cindex widening
 @cindex restriction
@@ -1827,86 +1827,7 @@
 if you enable the command, confirmation will no longer be required for
 it.  @xref{Disabling}.
 
-@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
+@node Two-Column, Editing Binary Files, Narrowing, Top
 @section Two-Column Editing
 @cindex two-column editing
 @cindex splitting columns
@@ -2462,7 +2383,7 @@
 (@code{tumme-display-thumbnail-original-image}) to display a sized
 version of it in another window.  This sizes the image to fit the
 window.  Use the arrow keys to move around in the buffer.  For easy
-browing, type @kbd{SPC} (@code{tumme-display-next-thumbnail-original})
+browsing, type @kbd{SPC} (@code{tumme-display-next-thumbnail-original})
 to advance and display the next image.  Typing @kbd{DEL}
 (@code{tumme-display-previous-thumbnail-original}) backs up to the
 previous thumbnail and displays that instead.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/man/msdog-xtra.texi	Wed May 10 20:42:41 2006 +0000
@@ -0,0 +1,687 @@
+@c This is part of the Emacs manual.
+@c Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
+@c See file emacs.texi for copying conditions.
+@c
+@c This file is included either in emacs-xtra.texi (when producing the
+@c printed version) or in the main Emacs manual (for the on-line version).
+@node MS-DOS
+@section Emacs and MS-DOS
+@cindex MS-DOG
+@cindex MS-DOS peculiarities
+
+  This section briefly describes the peculiarities of using Emacs on
+the MS-DOS ``operating system'' (also known as ``MS-DOG'').
+@iftex
+Information about Emacs and Microsoft's current operating system
+Windows (also known as ``Losedows) is in the main Emacs manual
+(@pxref{Microsoft Systems,,, emacs, the Emacs Manual}).
+@end iftex
+@ifnottex
+Information about peculiarities common to MS-DOS and Microsoft's
+current operating systems Windows (also known as ``Losedows) is in
+@ref{Microsoft Windows}.
+@end ifnottex
+
+  If you build Emacs for MS-DOS, the binary will also run on Windows
+3.X, Windows NT, Windows 9X/ME, Windows 2000/XP, or OS/2 as a DOS
+application; all of this chapter applies for all of those systems, if
+you use an Emacs that was built for MS-DOS.
+
+@iftex
+  @xref{Text and Binary,,,emacs, the Emacs Manual}, for information
+@end iftex
+@ifnottex
+  @xref{Text and Binary}, for information
+@end ifnottex
+about Emacs' special handling of text files under MS-DOS (and Windows).
+
+@menu
+* Keyboard: MS-DOS Keyboard.   Keyboard conventions on MS-DOS.
+* Mouse: MS-DOS Mouse.         Mouse conventions on MS-DOS.
+* Display: MS-DOS Display.     Fonts, frames and display size on MS-DOS.
+* Files: MS-DOS File Names.    File name conventions on MS-DOS.
+* Printing: MS-DOS Printing.   Printing specifics on MS-DOS.
+* I18N: MS-DOS and MULE.       Support for internationalization on MS-DOS.
+* Processes: MS-DOS Processes. Running subprocesses on MS-DOS.
+@end menu
+
+@node MS-DOS Keyboard
+@subsection Keyboard Usage on MS-DOS
+
+@kindex DEL @r{(MS-DOS)}
+@kindex BS @r{(MS-DOS)}
+  The key that is called @key{DEL} in Emacs (because that's how it is
+designated on most workstations) is known as @key{BS} (backspace) on a
+PC.  That is why the PC-specific terminal initialization remaps the
+@key{BS} key to act as @key{DEL}; the @key{DELETE} key is remapped to act
+as @kbd{C-d} for the same reasons.
+
+@kindex C-g @r{(MS-DOS)}
+@kindex C-BREAK @r{(MS-DOS)}
+@cindex quitting on MS-DOS
+  Emacs built for MS-DOS recognizes @kbd{C-@key{BREAK}} as a quit
+character, just like @kbd{C-g}.  This is because Emacs cannot detect
+that you have typed @kbd{C-g} until it is ready for more input.  As a
+consequence, you cannot use @kbd{C-g} to stop a running command
+@iftex
+(@pxref{Quitting,,,emacs, the Emacs Manual}).
+@end iftex
+@ifnottex
+(@pxref{Quitting}).
+@end ifnottex
+By contrast, @kbd{C-@key{BREAK}} @emph{is} detected as soon as you
+type it (as @kbd{C-g} is on other systems), so it can be used to stop
+a running command and for emergency escape
+@iftex
+(@pxref{Emergency Escape,,,emacs, the Emacs Manual}).
+@end iftex
+@ifnottex
+(@pxref{Emergency Escape}).
+@end ifnottex
+
+@cindex Meta (under MS-DOS)
+@cindex Hyper (under MS-DOS)
+@cindex Super (under MS-DOS)
+@vindex dos-super-key
+@vindex dos-hyper-key
+  The PC keyboard maps use the left @key{ALT} key as the @key{META} key.
+You have two choices for emulating the @key{SUPER} and @key{HYPER} keys:
+choose either the right @key{CTRL} key or the right @key{ALT} key by
+setting the variables @code{dos-hyper-key} and @code{dos-super-key} to 1
+or 2 respectively.  If neither @code{dos-super-key} nor
+@code{dos-hyper-key} is 1, then by default the right @key{ALT} key is
+also mapped to the @key{META} key.  However, if the MS-DOS international
+keyboard support program @file{KEYB.COM} is installed, Emacs will
+@emph{not} map the right @key{ALT} to @key{META}, since it is used for
+accessing characters like @kbd{~} and @kbd{@@} on non-US keyboard
+layouts; in this case, you may only use the left @key{ALT} as @key{META}
+key.
+
+@kindex C-j @r{(MS-DOS)}
+@vindex dos-keypad-mode
+  The variable @code{dos-keypad-mode} is a flag variable that controls
+what key codes are returned by keys in the numeric keypad.  You can also
+define the keypad @key{ENTER} key to act like @kbd{C-j}, by putting the
+following line into your @file{_emacs} file:
+
+@smallexample
+;; @r{Make the @key{ENTER} key from the numeric keypad act as @kbd{C-j}.}
+(define-key function-key-map [kp-enter] [?\C-j])
+@end smallexample
+
+@node MS-DOS Mouse
+@subsection Mouse Usage on MS-DOS
+
+@cindex mouse support under MS-DOS
+  Emacs on MS-DOS supports a mouse (on the default terminal only).
+The mouse commands work as documented, including those that use menus
+and the menu bar
+@iftex
+(@pxref{Menu Bar,,,emacs, the Emacs Manual}).
+@end iftex
+@ifnottex
+(@pxref{Menu Bar}).
+@end ifnottex
+ Scroll bars don't work in MS-DOS Emacs.  PC mice usually have only
+two buttons; these act as @kbd{Mouse-1} and @kbd{Mouse-2}, but if you
+press both of them together, that has the effect of @kbd{Mouse-3}.  If
+the mouse does have 3 buttons, Emacs detects that at startup, and all
+the 3 buttons function normally, as on X.
+
+  Help strings for menu-bar and pop-up menus are displayed in the echo
+area when the mouse pointer moves across the menu items.  Highlighting
+of mouse-sensitive text
+@iftex
+(@pxref{Mouse References,,,emacs, the Emacs Manual})
+@end iftex
+@ifnottex
+(@pxref{Mouse References})
+@end ifnottex
+is also supported.
+
+@cindex mouse, set number of buttons
+@findex msdos-set-mouse-buttons
+  Some versions of mouse drivers don't report the number of mouse
+buttons correctly.  For example, mice with a wheel report that they
+have 3 buttons, but only 2 of them are passed to Emacs; the clicks on
+the wheel, which serves as the middle button, are not passed.  In
+these cases, you can use the @kbd{M-x msdos-set-mouse-buttons} command
+to tell Emacs how many mouse buttons to expect.  You could make such a
+setting permanent by adding this fragment to your @file{_emacs} init
+file:
+
+@example
+;; @r{Treat the mouse like a 2-button mouse.}
+(msdos-set-mouse-buttons 2)
+@end example
+
+@cindex Windows clipboard support
+  Emacs built for MS-DOS supports clipboard operations when it runs on
+Windows.  Commands that put text on the kill ring, or yank text from
+the ring, check the Windows clipboard first, just as Emacs does on the
+X Window System
+@iftex
+(@pxref{Mouse Commands,,,emacs, the Emacs Manual}).
+@end iftex
+@ifnottex
+(@pxref{Mouse Commands}).
+@end ifnottex
+Only the primary selection and the cut buffer are supported by MS-DOS
+Emacs on Windows; the secondary selection always appears as empty.
+
+  Due to the way clipboard access is implemented by Windows, the
+length of text you can put into the clipboard is limited by the amount
+of free DOS memory that is available to Emacs.  Usually, up to 620KB of
+text can be put into the clipboard, but this limit depends on the system
+configuration and is lower if you run Emacs as a subprocess of
+another program.  If the killed text does not fit, Emacs outputs a
+message saying so, and does not put the text into the clipboard.
+
+  Null characters also cannot be put into the Windows clipboard.  If the
+killed text includes null characters, Emacs does not put such text into
+the clipboard, and displays in the echo area a message to that effect.
+
+@vindex dos-display-scancodes
+  The variable @code{dos-display-scancodes}, when non-@code{nil},
+directs Emacs to display the @acronym{ASCII} value and the keyboard scan code of
+each keystroke; this feature serves as a complement to the
+@code{view-lossage} command, for debugging.
+
+@node MS-DOS Display
+@subsection Display on MS-DOS
+@cindex faces under MS-DOS
+@cindex fonts, emulating under MS-DOS
+
+  Display on MS-DOS cannot use font variants, like bold or italic, but
+it does support multiple faces, each of which can specify a foreground
+and a background color.  Therefore, you can get the full functionality
+of Emacs packages that use fonts (such as @code{font-lock}, Enriched
+Text mode, and others) by defining the relevant faces to use different
+colors.  Use the @code{list-colors-display} command
+@iftex
+(@pxref{Frame Parameters,,,emacs, the Emacs Manual})
+@end iftex
+@ifnottex
+(@pxref{Frame Parameters})
+@end ifnottex
+and the @code{list-faces-display} command
+@iftex
+(@pxref{Faces,,,emacs, the Emacs Manual})
+@end iftex
+@ifnottex
+(@pxref{Faces})
+@end ifnottex
+to see what colors and faces are available and what they look like.
+
+  @xref{MS-DOS and MULE}, later in this chapter, for information on
+how Emacs displays glyphs and characters that aren't supported by the
+native font built into the DOS display.
+
+@cindex cursor shape on MS-DOS
+  When Emacs starts, it changes the cursor shape to a solid box.  This
+is for compatibility with other systems, where the box cursor is the
+default in Emacs.  This default shape can be changed to a bar by
+specifying the @code{cursor-type} parameter in the variable
+@code{default-frame-alist}
+@iftex
+(@pxref{Creating Frames,,,emacs, the Emacs Manual}).
+@end iftex
+@ifnottex
+(@pxref{Creating Frames}).
+@end ifnottex
+The MS-DOS terminal doesn't support a vertical-bar cursor,
+so the bar cursor is horizontal, and the @code{@var{width}} parameter,
+if specified by the frame parameters, actually determines its height.
+For this reason, the @code{bar} and @code{hbar} cursor types produce
+the same effect on MS-DOS.  As an extension, the bar cursor
+specification can include the starting scan line of the cursor as well
+as its width, like this:
+
+@example
+ '(cursor-type bar @var{width} . @var{start})
+@end example
+
+@noindent
+In addition, if the @var{width} parameter is negative, the cursor bar
+begins at the top of the character cell.
+
+@cindex frames on MS-DOS
+  The MS-DOS terminal can only display a single frame at a time.  The
+Emacs frame facilities work on MS-DOS much as they do on text-only
+terminals
+@iftex
+(@pxref{Frames,,,emacs, the Emacs Manual}).
+@end iftex
+@ifnottex
+(@pxref{Frames}).
+@end ifnottex
+When you run Emacs from a DOS window on MS-Windows, you can make the
+visible frame smaller than the full screen, but Emacs still cannot
+display more than a single frame at a time.
+
+@cindex frame size under MS-DOS
+@findex mode4350
+@findex mode25
+  The @code{mode4350} command switches the display to 43 or 50
+lines, depending on your hardware; the @code{mode25} command switches
+to the default 80x25 screen size.
+
+  By default, Emacs only knows how to set screen sizes of 80 columns by
+25, 28, 35, 40, 43 or 50 rows.  However, if your video adapter has
+special video modes that will switch the display to other sizes, you can
+have Emacs support those too.  When you ask Emacs to switch the frame to
+@var{n} rows by @var{m} columns dimensions, it checks if there is a
+variable called @code{screen-dimensions-@var{n}x@var{m}}, and if so,
+uses its value (which must be an integer) as the video mode to switch
+to.  (Emacs switches to that video mode by calling the BIOS @code{Set
+Video Mode} function with the value of
+@code{screen-dimensions-@var{n}x@var{m}} in the @code{AL} register.)
+For example, suppose your adapter will switch to 66x80 dimensions when
+put into video mode 85.  Then you can make Emacs support this screen
+size by putting the following into your @file{_emacs} file:
+
+@example
+(setq screen-dimensions-66x80 85)
+@end example
+
+  Since Emacs on MS-DOS can only set the frame size to specific
+supported dimensions, it cannot honor every possible frame resizing
+request.  When an unsupported size is requested, Emacs chooses the next
+larger supported size beyond the specified size.  For example, if you
+ask for 36x80 frame, you will get 40x80 instead.
+
+  The variables @code{screen-dimensions-@var{n}x@var{m}} are used only
+when they exactly match the specified size; the search for the next
+larger supported size ignores them.  In the above example, even if your
+VGA supports 38x80 dimensions and you define a variable
+@code{screen-dimensions-38x80} with a suitable value, you will still get
+40x80 screen when you ask for a 36x80 frame.  If you want to get the
+38x80 size in this case, you can do it by setting the variable named
+@code{screen-dimensions-36x80} with the same video mode value as
+@code{screen-dimensions-38x80}.
+
+  Changing frame dimensions on MS-DOS has the effect of changing all the
+other frames to the new dimensions.
+
+@node MS-DOS File Names
+@subsection File Names on MS-DOS
+@cindex file names under MS-DOS
+@cindex init file, default name under MS-DOS
+
+  On MS-DOS, file names are case-insensitive and limited to eight
+characters, plus optionally a period and three more characters.  Emacs
+knows enough about these limitations to handle file names that were
+meant for other operating systems.  For instance, leading dots
+@samp{.}  in file names are invalid in MS-DOS, so Emacs transparently
+converts them to underscores @samp{_}; thus your default init file
+@iftex
+(@pxref{Init File,,,emacs, the Emacs Manual})
+@end iftex
+@ifnottex
+(@pxref{Init File})
+@end ifnottex
+is called @file{_emacs} on MS-DOS.  Excess characters before or after
+the period are generally ignored by MS-DOS itself; thus, if you visit
+the file @file{LongFileName.EvenLongerExtension}, you will silently
+get @file{longfile.eve}, but Emacs will still display the long file
+name on the mode line.  Other than that, it's up to you to specify
+file names which are valid under MS-DOS; the transparent conversion as
+described above only works on file names built into Emacs.
+
+@cindex backup file names on MS-DOS
+  The above restrictions on the file names on MS-DOS make it almost
+impossible to construct the name of a backup file
+@iftex
+(@pxref{Backup Names,,,emacs, the Emacs Manual})
+@end iftex
+@ifnottex
+(@pxref{Backup Names})
+@end ifnottex
+without losing some of the original file name characters.  For
+example, the name of a backup file for @file{docs.txt} is
+@file{docs.tx~} even if single backup is used.
+
+@cindex file names under Windows 95/NT
+@cindex long file names in DOS box under Windows 95/NT
+  If you run Emacs as a DOS application under Windows 9X, Windows ME, or
+Windows 2000/XP, you can turn on support for long file names.  If you do
+that, Emacs doesn't truncate file names or convert them to lower case;
+instead, it uses the file names that you specify, verbatim.  To enable
+long file name support, set the environment variable @env{LFN} to
+@samp{y} before starting Emacs.  Unfortunately, Windows NT doesn't allow
+DOS programs to access long file names, so Emacs built for MS-DOS will
+only see their short 8+3 aliases.
+
+@cindex @env{HOME} directory under MS-DOS
+  MS-DOS has no notion of home directory, so Emacs on MS-DOS pretends
+that the directory where it is installed is the value of the @env{HOME}
+environment variable.  That is, if your Emacs binary,
+@file{emacs.exe}, is in the directory @file{c:/utils/emacs/bin}, then
+Emacs acts as if @env{HOME} were set to @samp{c:/utils/emacs}.  In
+particular, that is where Emacs looks for the init file @file{_emacs}.
+With this in mind, you can use @samp{~} in file names as an alias for
+the home directory, as you would on GNU or Unix.  You can also set
+@env{HOME} variable in the environment before starting Emacs; its
+value will then override the above default behavior.
+
+  Emacs on MS-DOS handles the directory name @file{/dev} specially,
+because of a feature in the emulator libraries of DJGPP that pretends
+I/O devices have names in that directory.  We recommend that you avoid
+using an actual directory named @file{/dev} on any disk.
+
+@node MS-DOS Printing
+@subsection Printing and MS-DOS
+
+  Printing commands, such as @code{lpr-buffer}
+@iftex
+(@pxref{Printing,,,emacs, the Emacs Manual}) and @code{ps-print-buffer}
+(@pxref{PostScript,,,emacs, the Emacs Manual})
+@end iftex
+@ifnottex
+(@pxref{Printing}) and @code{ps-print-buffer} (@pxref{PostScript})
+@end ifnottex
+can work on MS-DOS by sending the output to one of the printer ports,
+if a Posix-style @code{lpr} program is unavailable.  The same Emacs
+variables control printing on all systems, but in some cases they have
+different default values on MS-DOS.
+
+@iftex
+@xref{Windows Printing,,,emacs, the Emacs Manual},
+@end iftex
+@ifnottex
+@xref{Windows Printing},
+@end ifnottex
+for details about setting up printing to a networked printer.
+
+  Some printers expect DOS codepage encoding of non-@acronym{ASCII} text, even
+though they are connected to a Windows machine which uses a different
+encoding for the same locale.  For example, in the Latin-1 locale, DOS
+uses codepage 850 whereas Windows uses codepage 1252.  @xref{MS-DOS and
+MULE}.  When you print to such printers from Windows, you can use the
+@kbd{C-x RET c} (@code{universal-coding-system-argument}) command before
+@kbd{M-x lpr-buffer}; Emacs will then convert the text to the DOS
+codepage that you specify.  For example, @kbd{C-x RET c cp850-dos RET
+M-x lpr-region RET} will print the region while converting it to the
+codepage 850 encoding.  You may need to create the @code{cp@var{nnn}}
+coding system with @kbd{M-x codepage-setup}.
+
+@vindex dos-printer
+@vindex dos-ps-printer
+  For backwards compatibility, the value of @code{dos-printer}
+(@code{dos-ps-printer}), if it has a value, overrides the value of
+@code{printer-name} (@code{ps-printer-name}), on MS-DOS.
+
+
+@node MS-DOS and MULE
+@subsection International Support on MS-DOS
+@cindex international support @r{(MS-DOS)}
+
+  Emacs on MS-DOS supports the same international character sets as it
+does on GNU, Unix and other platforms
+@iftex
+(@pxref{International,,,emacs, the Emacs Manual}),
+@end iftex
+@ifnottex
+(@pxref{International}),
+@end ifnottex
+including coding systems for converting between the different
+character sets.  However, due to incompatibilities between
+MS-DOS/MS-Windows and other systems, there are several DOS-specific
+aspects of this support that you should be aware of.  This section
+describes these aspects.
+
+  The description below is largely specific to the MS-DOS port of
+Emacs, especially where it talks about practical implications for
+Emacs users.  For other operating systems, see the @file{code-pages.el}
+package, which implements support for MS-DOS- and MS-Windows-specific
+encodings for all platforms other than MS-DOS.
+
+@table @kbd
+@item M-x dos-codepage-setup
+Set up Emacs display and coding systems as appropriate for the current
+DOS codepage.
+
+@item M-x codepage-setup
+Create a coding system for a certain DOS codepage.
+@end table
+
+@cindex codepage, MS-DOS
+@cindex DOS codepages
+  MS-DOS is designed to support one character set of 256 characters at
+any given time, but gives you a variety of character sets to choose
+from.  The alternative character sets are known as @dfn{DOS codepages}.
+Each codepage includes all 128 @acronym{ASCII} characters, but the other 128
+characters (codes 128 through 255) vary from one codepage to another.
+Each DOS codepage is identified by a 3-digit number, such as 850, 862,
+etc.
+
+  In contrast to X, which lets you use several fonts at the same time,
+MS-DOS normally doesn't allow use of several codepages in a single
+session.  MS-DOS was designed to load a single codepage at system
+startup, and require you to reboot in order to change
+it@footnote{Normally, one particular codepage is burnt into the
+display memory, while other codepages can be installed by modifying
+system configuration files, such as @file{CONFIG.SYS}, and rebooting.
+While there is third-party software that allows changing the codepage
+without rebooting, we describe here how a stock MS-DOS system
+behaves.}.  Much the same limitation applies when you run DOS
+executables on other systems such as MS-Windows.
+
+@cindex unibyte operation @r{(MS-DOS)}
+  If you invoke Emacs on MS-DOS with the @samp{--unibyte} option
+@iftex
+(@pxref{Initial Options,,,emacs, the Emacs Manual}),
+@end iftex
+@ifnottex
+(@pxref{Initial Options}),
+@end ifnottex
+Emacs does not perform any conversion of non-@acronym{ASCII}
+characters.  Instead, it reads and writes any non-@acronym{ASCII}
+characters verbatim, and sends their 8-bit codes to the display
+verbatim.  Thus, unibyte Emacs on MS-DOS supports the current
+codepage, whatever it may be, but cannot even represent any other
+characters.
+
+@vindex dos-codepage
+  For multibyte operation on MS-DOS, Emacs needs to know which
+characters the chosen DOS codepage can display.  So it queries the
+system shortly after startup to get the chosen codepage number, and
+stores the number in the variable @code{dos-codepage}.  Some systems
+return the default value 437 for the current codepage, even though the
+actual codepage is different.  (This typically happens when you use the
+codepage built into the display hardware.)  You can specify a different
+codepage for Emacs to use by setting the variable @code{dos-codepage} in
+your init file.
+
+@cindex language environment, automatic selection on @r{MS-DOS}
+  Multibyte Emacs supports only certain DOS codepages: those which can
+display Far-Eastern scripts, like the Japanese codepage 932, and those
+that encode a single ISO 8859 character set.
+
+  The Far-Eastern codepages can directly display one of the MULE
+character sets for these countries, so Emacs simply sets up to use the
+appropriate terminal coding system that is supported by the codepage.
+The special features described in the rest of this section mostly
+pertain to codepages that encode ISO 8859 character sets.
+
+  For the codepages which correspond to one of the ISO character sets,
+Emacs knows the character set name based on the codepage number.  Emacs
+automatically creates a coding system to support reading and writing
+files that use the current codepage, and uses this coding system by
+default.  The name of this coding system is @code{cp@var{nnn}}, where
+@var{nnn} is the codepage number.@footnote{The standard Emacs coding
+systems for ISO 8859 are not quite right for the purpose, because
+typically the DOS codepage does not match the standard ISO character
+codes.  For example, the letter @samp{@,{c}} (@samp{c} with cedilla) has
+code 231 in the standard Latin-1 character set, but the corresponding
+DOS codepage 850 uses code 135 for this glyph.}
+
+@cindex mode line @r{(MS-DOS)}
+  All the @code{cp@var{nnn}} coding systems use the letter @samp{D}
+(for ``DOS'') as their mode-line mnemonic.  Since both the terminal
+coding system and the default coding system for file I/O are set to
+the proper @code{cp@var{nnn}} coding system at startup, it is normal
+for the mode line on MS-DOS to begin with @samp{-DD\-}.
+@iftex
+@xref{Mode Line,,,emacs, the Emacs Manual}.
+@end iftex
+@ifnottex
+@xref{Mode Line}.
+@end ifnottex
+Far-Eastern DOS terminals do not use the @code{cp@var{nnn}} coding
+systems, and thus their initial mode line looks like the Emacs
+default.
+
+  Since the codepage number also indicates which script you are using,
+Emacs automatically runs @code{set-language-environment} to select the
+language environment for that script
+@iftex
+(@pxref{Language Environments,,,emacs, the Emacs Manual}).
+@end iftex
+@ifnottex
+(@pxref{Language Environments}).
+@end ifnottex
+
+  If a buffer contains a character belonging to some other ISO 8859
+character set, not the one that the chosen DOS codepage supports, Emacs
+displays it using a sequence of @acronym{ASCII} characters.  For example, if the
+current codepage doesn't have a glyph for the letter @samp{@`o} (small
+@samp{o} with a grave accent), it is displayed as @samp{@{`o@}}, where
+the braces serve as a visual indication that this is a single character.
+(This may look awkward for some non-Latin characters, such as those from
+Greek or Hebrew alphabets, but it is still readable by a person who
+knows the language.)  Even though the character may occupy several
+columns on the screen, it is really still just a single character, and
+all Emacs commands treat it as one.
+
+@cindex IBM graphics characters (MS-DOS)
+@cindex box-drawing characters (MS-DOS)
+@cindex line-drawing characters (MS-DOS)
+  Not all characters in DOS codepages correspond to ISO 8859
+characters---some are used for other purposes, such as box-drawing
+characters and other graphics.  Emacs maps these characters to two
+special character sets called @code{eight-bit-control} and
+@code{eight-bit-graphic}, and displays them as their IBM glyphs.
+However, you should be aware that other systems might display these
+characters differently, so you should avoid them in text that might be
+copied to a different operating system, or even to another DOS machine
+that uses a different codepage.
+
+@vindex dos-unsupported-character-glyph
+  Emacs supports many other characters sets aside from ISO 8859, but it
+cannot display them on MS-DOS.  So if one of these multibyte characters
+appears in a buffer, Emacs on MS-DOS displays them as specified by the
+@code{dos-unsupported-character-glyph} variable; by default, this glyph
+is an empty triangle.  Use the @kbd{C-u C-x =} command to display the
+actual code and character set of such characters.
+@iftex
+@xref{Position Info,,,emacs, the Emacs Manual}.
+@end iftex
+@ifnottex
+@xref{Position Info}.
+@end ifnottex
+
+@findex codepage-setup
+  By default, Emacs defines a coding system to support the current
+codepage.  To define a coding system for some other codepage (e.g., to
+visit a file written on a DOS machine in another country), use the
+@kbd{M-x codepage-setup} command.  It prompts for the 3-digit code of
+the codepage, with completion, then creates the coding system for the
+specified codepage.  You can then use the new coding system to read and
+write files, but you must specify it explicitly for the file command
+when you want to use it
+@iftex
+(@pxref{Text Coding,,,emacs, the Emacs Manual}).
+@end iftex
+@ifnottex
+(@pxref{Text Coding}).
+@end ifnottex
+
+  These coding systems are also useful for visiting a file encoded using
+a DOS codepage, using Emacs running on some other operating system.
+
+@cindex MS-Windows codepages
+  MS-Windows provides its own codepages, which are different from the
+DOS codepages for the same locale.  For example, DOS codepage 850
+supports the same character set as Windows codepage 1252; DOS codepage
+855 supports the same character set as Windows codepage 1251, etc.
+The MS-Windows version of Emacs uses the current codepage for display
+when invoked with the @samp{-nw} option.  Support for codepages in the
+Windows port of Emacs is part of the @file{code-pages.el} package.
+
+@node MS-DOS Processes
+@subsection Subprocesses on MS-DOS
+
+@cindex compilation under MS-DOS
+@cindex inferior processes under MS-DOS
+@findex compile @r{(MS-DOS)}
+@findex grep @r{(MS-DOS)}
+  Because MS-DOS is a single-process ``operating system,''
+asynchronous subprocesses are not available.  In particular, Shell
+mode and its variants do not work.  Most Emacs features that use
+asynchronous subprocesses also don't work on MS-DOS, including
+Shell mode and GUD.  When in doubt, try and see; commands that
+don't work output an error message saying that asynchronous processes
+aren't supported.
+
+  Compilation under Emacs with @kbd{M-x compile}, searching files with
+@kbd{M-x grep} and displaying differences between files with @kbd{M-x
+diff} do work, by running the inferior processes synchronously.  This
+means you cannot do any more editing until the inferior process
+finishes.
+
+  Spell checking also works, by means of special support for synchronous
+invocation of the @code{ispell} program.  This is slower than the
+asynchronous invocation on other platforms
+
+  Instead of the Shell mode, which doesn't work on MS-DOS, you can use
+the @kbd{M-x eshell} command.  This invokes the Eshell package that
+implements a Posix-like shell entirely in Emacs Lisp.
+
+  By contrast, Emacs compiled as a native Windows application
+@strong{does} support asynchronous subprocesses.
+@iftex
+@xref{Windows Processes,,,emacs, the Emacs Manual}.
+@end iftex
+@ifnottex
+@xref{Windows Processes}.
+@end ifnottex
+
+@cindex printing under MS-DOS
+  Printing commands, such as @code{lpr-buffer}
+@iftex
+(@pxref{Printing,,,emacs, the Emacs Manual}) and
+@code{ps-print-buffer} (@pxref{PostScript,,,emacs, the Emacs Manual}),
+work in MS-DOS by sending the output to one of the printer ports.
+@xref{MS-DOS Printing,,,emacs, the Emacs Manual}.
+@end iftex
+@ifnottex
+(@pxref{Printing}) and @code{ps-print-buffer} (@pxref{PostScript}),
+work in MS-DOS by sending the output to one of the printer ports.
+@xref{MS-DOS Printing}.
+@end ifnottex
+
+  When you run a subprocess synchronously on MS-DOS, make sure the
+program terminates and does not try to read keyboard input.  If the
+program does not terminate on its own, you will be unable to terminate
+it, because MS-DOS provides no general way to terminate a process.
+Pressing @kbd{C-c} or @kbd{C-@key{BREAK}} might sometimes help in these
+cases.
+
+  Accessing files on other machines is not supported on MS-DOS.  Other
+network-oriented commands such as sending mail, Web browsing, remote
+login, etc., don't work either, unless network access is built into
+MS-DOS with some network redirector.
+
+@cindex directory listing on MS-DOS
+@vindex dired-listing-switches @r{(MS-DOS)}
+  Dired on MS-DOS uses the @code{ls-lisp} package where other
+platforms use the system @code{ls} command.  Therefore, Dired on
+MS-DOS supports only some of the possible options you can mention in
+the @code{dired-listing-switches} variable.  The options that work are
+@samp{-A}, @samp{-a}, @samp{-c}, @samp{-i}, @samp{-r}, @samp{-S},
+@samp{-s}, @samp{-t}, and @samp{-u}.
+
+@ignore
+   arch-tag: 868d50ff-07f8-4a13-a807-dab6f1cdb431
+@end ignore
--- a/man/msdog.texi	Tue May 02 08:50:29 2006 +0000
+++ b/man/msdog.texi	Wed May 10 20:42:41 2006 +0000
@@ -2,8 +2,8 @@
 @c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2000, 2001,
 @c   2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
 @c See file emacs.texi for copying conditions.
-@node Emacs and Microsoft Windows, Manifesto, Mac OS, Top
-@appendix Emacs and Microsoft Windows
+@node Microsoft Windows, Manifesto, Mac OS, Top
+@appendix Emacs and Microsoft Windows/MS-DOS
 @cindex Microsoft Windows
 @cindex MS-Windows, Emacs peculiarities
 
@@ -11,7 +11,14 @@
 Windows.  Some of these peculiarities are also relevant to Microsoft's
 older MS-DOS ``operating system'' (also known as ``MS-DOG'').
 However, Emacs features that are relevant @emph{only} to MS-DOS are
-described in a separate manual (@inforef{MS-DOG,, emacs-xtra}).
+described in a separate
+@iftex
+manual (@pxref{MS-DOS,,, emacs-xtra, Specialized Emacs Features}).
+@end iftex
+@ifnottex
+section (@pxref{MS-DOS}).
+@end ifnottex
+
 
   The behavior of Emacs on MS-Windows is reasonably similar to what is
 documented in the rest of the manual, including support for long file
@@ -20,12 +27,15 @@
 here.
 
 @menu
-* Text and Binary::            Text files use CRLF to terminate lines.
-* Windows Files::              File-name conventions on Windows.
-* Windows HOME::               Where Emacs looks for your @file{.emacs}.
-* Windows Processes::          Running subprocesses on Windows.
-* Windows Printing::           How to specify the printer on MS-Windows.
-* Windows System Menu::        Controlling what the ALT key does.
+* Text and Binary::     Text files use CRLF to terminate lines.
+* Windows Files::       File-name conventions on Windows.
+* Windows HOME::        Where Emacs looks for your @file{.emacs}.
+* Windows Processes::   Running subprocesses on Windows.
+* Windows Printing::    How to specify the printer on MS-Windows.
+* Windows System Menu:: Controlling what the ALT key does.
+@ifnottex
+* MS-DOS::              Using Emacs on MS-DOS (otherwise known as @dfn{MS-DOG}).
+@end ifnottex
 @end menu
 
 @node Text and Binary
@@ -408,6 +418,10 @@
 You can re-enable Windows' default handling of tapping the @key{ALT} key
 by setting @code{w32-pass-alt-to-system} to a non-@code{nil} value.
 
+@ifnottex
+@include msdog-xtra.texi
+@end ifnottex
+
 @ignore
    arch-tag: f39d2590-5dcc-4318-88d9-0eb73ca10fa2
 @end ignore
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/man/picture-xtra.texi	Wed May 10 20:42:41 2006 +0000
@@ -0,0 +1,291 @@
+@c This is part of the Emacs manual.
+@c Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
+@c See file emacs.texi for copying conditions.
+@c
+@c This file is included either in emacs-xtra.texi (when producing the
+@c printed version) or in the main Emacs manual (for the on-line version).
+@node Picture Mode
+@chapter Editing Pictures
+@cindex pictures
+@cindex making pictures out of text characters
+@findex edit-picture
+
+  To edit a picture made out of text characters (for example, a picture
+of the division of a register into fields, as a comment in a program),
+use the command @kbd{M-x edit-picture} to enter Picture mode.
+
+  In Picture mode, editing is based on the @dfn{quarter-plane} model of
+text, according to which the text characters lie studded on an area that
+stretches infinitely far to the right and downward.  The concept of the end
+of a line does not exist in this model; the most you can say is where the
+last nonblank character on the line is found.
+
+  Of course, Emacs really always considers text as a sequence of
+characters, and lines really do have ends.  But Picture mode replaces
+the most frequently-used commands with variants that simulate the
+quarter-plane model of text.  They do this by inserting spaces or by
+converting tabs to spaces.
+
+  Most of the basic editing commands of Emacs are redefined by Picture mode
+to do essentially the same thing but in a quarter-plane way.  In addition,
+Picture mode defines various keys starting with the @kbd{C-c} prefix to
+run special picture editing commands.
+
+  One of these keys, @kbd{C-c C-c}, is particularly important.  Often a
+picture is part of a larger file that is usually edited in some other
+major mode.  @kbd{M-x edit-picture} records the name of the previous
+major mode so you can use the @kbd{C-c C-c} command
+(@code{picture-mode-exit}) later to go back to that mode.  @kbd{C-c C-c}
+also deletes spaces from the ends of lines, unless given a numeric
+argument.
+
+  The special commands of Picture mode all work in other modes (provided
+the @file{picture} library is loaded), but are not bound to keys except
+in Picture mode.  The descriptions below talk of moving ``one column''
+and so on, but all the picture mode commands handle numeric arguments as
+their normal equivalents do.
+
+@vindex picture-mode-hook
+  Turning on Picture mode runs the hook @code{picture-mode-hook}.
+Additional extensions to Picture mode can be found in
+@file{artist.el}.
+
+@menu
+* Basic Picture::         Basic concepts and simple commands of Picture Mode.
+* Insert in Picture::     Controlling direction of cursor motion
+                            after "self-inserting" characters.
+* Tabs in Picture::       Various features for tab stops and indentation.
+* Rectangles in Picture:: Clearing and superimposing rectangles.
+@end menu
+
+@node Basic Picture
+@section Basic Editing in Picture Mode
+
+@findex picture-forward-column
+@findex picture-backward-column
+@findex picture-move-down
+@findex picture-move-up
+@cindex editing in Picture mode
+
+  Most keys do the same thing in Picture mode that they usually do, but
+do it in a quarter-plane style.  For example, @kbd{C-f} is rebound to
+run @code{picture-forward-column}, a command which moves point one
+column to the right, inserting a space if necessary so that the actual
+end of the line makes no difference.  @kbd{C-b} is rebound to run
+@code{picture-backward-column}, which always moves point left one
+column, converting a tab to multiple spaces if necessary.  @kbd{C-n} and
+@kbd{C-p} are rebound to run @code{picture-move-down} and
+@code{picture-move-up}, which can either insert spaces or convert tabs
+as necessary to make sure that point stays in exactly the same column.
+@kbd{C-e} runs @code{picture-end-of-line}, which moves to after the last
+nonblank character on the line.  There is no need to change @kbd{C-a},
+as the choice of screen model does not affect beginnings of
+lines.
+
+@findex picture-newline
+  Insertion of text is adapted to the quarter-plane screen model
+through the use of Overwrite mode
+@iftex
+(@pxref{Minor Modes,,, emacs, the Emacs Manual}.)
+@end iftex
+@ifnottex
+(@pxref{Minor Modes}.)
+@end ifnottex
+Self-inserting characters replace existing text, column by column,
+rather than pushing existing text to the right.  @key{RET} runs
+@code{picture-newline}, which just moves to the beginning of the
+following line so that new text will replace that line.
+
+@findex picture-backward-clear-column
+@findex picture-clear-column
+@findex picture-clear-line
+  In Picture mode, the commands that normally delete or kill text,
+instead erase text (replacing it with spaces).  @key{DEL}
+(@code{picture-backward-clear-column}) replaces the preceding
+character with a space rather than removing it; this moves point
+backwards.  @kbd{C-d} (@code{picture-clear-column}) replaces the next
+character or characters with spaces, but does not move point.  (If you
+want to clear characters to spaces and move forward over them, use
+@key{SPC}.)  @kbd{C-k} (@code{picture-clear-line}) really kills the
+contents of lines, but does not delete the newlines from the buffer.
+
+@findex picture-open-line
+  To do actual insertion, you must use special commands.  @kbd{C-o}
+(@code{picture-open-line}) creates a blank line after the current
+line; it never splits a line.  @kbd{C-M-o} (@code{split-line}) makes
+sense in Picture mode, so it is not changed.  @kbd{C-j}
+(@code{picture-duplicate-line}) inserts another line with the same
+contents below the current line.
+
+@kindex C-c C-d @r{(Picture mode)}
+   To do actual deletion in Picture mode, use @kbd{C-w}, @kbd{C-c C-d}
+(which is defined as @code{delete-char}, as @kbd{C-d} is in other
+modes), or one of the picture rectangle commands (@pxref{Rectangles in
+Picture}).
+
+@node Insert in Picture
+@section Controlling Motion after Insert
+
+@findex picture-movement-up
+@findex picture-movement-down
+@findex picture-movement-left
+@findex picture-movement-right
+@findex picture-movement-nw
+@findex picture-movement-ne
+@findex picture-movement-sw
+@findex picture-movement-se
+@kindex C-c < @r{(Picture mode)}
+@kindex C-c > @r{(Picture mode)}
+@kindex C-c ^ @r{(Picture mode)}
+@kindex C-c . @r{(Picture mode)}
+@kindex C-c ` @r{(Picture mode)}
+@kindex C-c ' @r{(Picture mode)}
+@kindex C-c / @r{(Picture mode)}
+@kindex C-c \ @r{(Picture mode)}
+  Since ``self-inserting'' characters in Picture mode overwrite and move
+point, there is no essential restriction on how point should be moved.
+Normally point moves right, but you can specify any of the eight
+orthogonal or diagonal directions for motion after a ``self-inserting''
+character.  This is useful for drawing lines in the buffer.
+
+@table @kbd
+@item C-c <
+@itemx C-c @key{LEFT}
+Move left after insertion (@code{picture-movement-left}).
+@item C-c >
+@itemx C-c @key{RIGHT}
+Move right after insertion (@code{picture-movement-right}).
+@item C-c ^
+@itemx C-c @key{UP}
+Move up after insertion (@code{picture-movement-up}).
+@item C-c .
+@itemx C-c @key{DOWN}
+Move down after insertion (@code{picture-movement-down}).
+@item C-c `
+@itemx C-c @key{HOME}
+Move up and left (``northwest'') after insertion (@code{picture-movement-nw}).
+@item C-c '
+@itemx C-c @key{PAGEUP}
+Move up and right (``northeast'') after insertion
+(@code{picture-movement-ne}).
+@item C-c /
+@itemx C-c @key{END}
+Move down and left (``southwest'') after insertion
+@*(@code{picture-movement-sw}).
+@item C-c \
+@itemx C-c @key{PAGEDOWN}
+Move down and right (``southeast'') after insertion
+@*(@code{picture-movement-se}).
+@end table
+
+@kindex C-c C-f @r{(Picture mode)}
+@kindex C-c C-b @r{(Picture mode)}
+@findex picture-motion
+@findex picture-motion-reverse
+  Two motion commands move based on the current Picture insertion
+direction.  The command @kbd{C-c C-f} (@code{picture-motion}) moves in the
+same direction as motion after ``insertion'' currently does, while @kbd{C-c
+C-b} (@code{picture-motion-reverse}) moves in the opposite direction.
+
+@node Tabs in Picture
+@section Picture Mode Tabs
+
+@kindex M-TAB @r{(Picture mode)}
+@findex picture-tab-search
+@vindex picture-tab-chars
+  Two kinds of tab-like action are provided in Picture mode.  Use
+@kbd{M-@key{TAB}} (@code{picture-tab-search}) for context-based tabbing.
+With no argument, it moves to a point underneath the next
+``interesting'' character that follows whitespace in the previous
+nonblank line.  ``Next'' here means ``appearing at a horizontal position
+greater than the one point starts out at.''  With an argument, as in
+@kbd{C-u M-@key{TAB}}, this command moves to the next such interesting
+character in the current line.  @kbd{M-@key{TAB}} does not change the
+text; it only moves point.  ``Interesting'' characters are defined by
+the variable @code{picture-tab-chars}, which should define a set of
+characters.  The syntax for this variable is like the syntax used inside
+of @samp{[@dots{}]} in a regular expression---but without the @samp{[}
+and the @samp{]}.  Its default value is @code{"!-~"}.
+
+@findex picture-tab
+  @key{TAB} itself runs @code{picture-tab}, which operates based on the
+current tab stop settings; it is the Picture mode equivalent of
+@code{tab-to-tab-stop}.  Normally it just moves point, but with a numeric
+argument it clears the text that it moves over.
+
+@kindex C-c TAB @r{(Picture mode)}
+@findex picture-set-tab-stops
+  The context-based and tab-stop-based forms of tabbing are brought
+together by the command @kbd{C-c @key{TAB}} (@code{picture-set-tab-stops}).
+This command sets the tab stops to the positions which @kbd{M-@key{TAB}}
+would consider significant in the current line.  The use of this command,
+together with @key{TAB}, can get the effect of context-based tabbing.  But
+@kbd{M-@key{TAB}} is more convenient in the cases where it is sufficient.
+
+  It may be convenient to prevent use of actual tab characters in
+pictures.  For example, this prevents @kbd{C-x @key{TAB}} from messing
+up the picture.  You can do this by setting the variable
+@code{indent-tabs-mode} to @code{nil}.
+
+@node Rectangles in Picture
+@section Picture Mode Rectangle Commands
+@cindex rectangles and Picture mode
+@cindex Picture mode and rectangles
+
+  Picture mode defines commands for working on rectangular pieces of
+the text in ways that fit with the quarter-plane model.  The standard
+rectangle commands may also be useful.
+@iftex
+@xref{Rectangles,,, emacs, the Emacs Manual}.
+@end iftex
+@ifnottex
+@xref{Rectangles}.
+@end ifnottex
+
+@table @kbd
+@item C-c C-k
+Clear out the region-rectangle with spaces
+(@code{picture-clear-rectangle}).  With argument, delete the text.
+@item C-c C-w @var{r}
+Similar, but save rectangle contents in register @var{r} first
+(@code{picture-clear-rectangle-to-register}).
+@item C-c C-y
+Copy last killed rectangle into the buffer by overwriting, with upper
+left corner at point (@code{picture-yank-rectangle}).  With argument,
+insert instead.
+@item C-c C-x @var{r}
+Similar, but use the rectangle in register @var{r}
+(@code{picture-yank-rectangle-from-register}).
+@end table
+
+@kindex C-c C-k @r{(Picture mode)}
+@kindex C-c C-w @r{(Picture mode)}
+@findex picture-clear-rectangle
+@findex picture-clear-rectangle-to-register
+  The picture rectangle commands @kbd{C-c C-k}
+(@code{picture-clear-rectangle}) and @kbd{C-c C-w}
+(@code{picture-clear-rectangle-to-register}) differ from the standard
+rectangle commands in that they normally clear the rectangle instead of
+deleting it; this is analogous with the way @kbd{C-d} is changed in Picture
+mode.
+
+  However, deletion of rectangles can be useful in Picture mode, so
+these commands delete the rectangle if given a numeric argument.
+@kbd{C-c C-k} either with or without a numeric argument saves the
+rectangle for @kbd{C-c C-y}.
+
+@kindex C-c C-y @r{(Picture mode)}
+@kindex C-c C-x @r{(Picture mode)}
+@findex picture-yank-rectangle
+@findex picture-yank-rectangle-from-register
+  The Picture mode commands for yanking rectangles differ from the
+standard ones in that they overwrite instead of inserting.  This is
+the same way that Picture mode insertion of other text differs from
+other modes.  @kbd{C-c C-y} (@code{picture-yank-rectangle}) inserts
+(by overwriting) the rectangle that was most recently killed, while
+@kbd{C-c C-x} (@code{picture-yank-rectangle-from-register}) does
+likewise for the rectangle found in a specified register.
+
+@ignore
+   arch-tag: 10e423ad-d896-42f2-a7e8-7018adeaf8c2
+@end ignore
--- a/man/programs.texi	Tue May 02 08:50:29 2006 +0000
+++ b/man/programs.texi	Wed May 10 20:42:41 2006 +0000
@@ -42,6 +42,9 @@
 * C Modes::             Special commands of C, C++, Objective-C,
                           Java, and Pike modes.
 * Asm Mode::            Asm mode and its special features.
+@ifnottex
+* Fortran::             Fortran mode and its special features.
+@end ifnottex
 @end menu
 
 @node Program Modes
@@ -109,7 +112,14 @@
 Mode, ada-mode, Ada Mode}), C/C++/Objective C/Java/Corba IDL/Pike/AWK
 (@pxref{Top, , CC Mode, ccmode, CC Mode}) and the IDLWAVE modes
 (@pxref{Top, , IDLWAVE, idlwave, IDLWAVE User Manual}).  For Fortran
-mode, @inforef{Fortran,, emacs-xtra}.
+mode, see
+@iftex
+@ref{Fortran,,, emacs-xtra, Specialized Emacs Features}.
+@end iftex
+@ifnottex
+@ref{Fortran}.
+@end ifnottex
+
 
 @cindex mode hook
 @vindex c-mode-hook
@@ -1591,7 +1601,7 @@
 @itemx M-x c-subword-mode
 @findex c-subword-mode
 Enable (or disable) @dfn{subword mode}.  In subword mode, Emacs's word
-commands then recognize upper case letters in
+commands recognize upper case letters in
 @samp{StudlyCapsIdentifiers} as word boundaries.  This is indicated by
 the flag @samp{/w} on the mode line after the mode name
 (e.g. @samp{C/law}).  You can even use @kbd{M-x c-subword-mode} in
@@ -1742,6 +1752,10 @@
   The variable @code{asm-comment-char} specifies which character
 starts comments in assembler syntax.
 
+@ifnottex
+@include fortran-xtra.texi
+@end ifnottex
+
 @ignore
    arch-tag: c7ee7409-40a4-45c7-bfb7-ae7f2c74d0c0
 @end ignore
--- a/man/screen.texi	Tue May 02 08:50:29 2006 +0000
+++ b/man/screen.texi	Wed May 10 20:42:41 2006 +0000
@@ -24,8 +24,8 @@
 you click on them.  Below this, the window begins, often with a
 @dfn{scroll bar} on one side.  Below the window comes the last line of
 the frame, a special @dfn{echo area} or @dfn{minibuffer window}, where
-prompts appear and where you enter information when Emacs asks for it.
-See following sections for more information about these special lines.
+prompts appear and you enter information when Emacs asks for it.  See
+following sections for more information about these special lines.
 
   You can subdivide the window horizontally or vertically to make
 multiple text windows, each of which can independently display some
@@ -34,22 +34,22 @@
 the multiple windows you have subdivided it into.
 
   At any time, one window is the @dfn{selected window}.  On graphical
-terminals, the selected window normally shows a more prominent cursor
+displays, the selected window normally shows a more prominent cursor
 (usually solid and blinking) while other windows show a weaker cursor
-(such as a hollow box).  On text terminals, which have just one
-cursor, that cursor always appears in the selected window.
+(such as a hollow box).   Text terminals have just one cursor, so it
+always appears in the selected window.
 
   Most Emacs commands implicitly apply to the text in the selected
-window (though mouse commands generally operate on whatever window you
-click them in, whether selected or not).  The text in other windows is
-mostly visible for reference, unless/until you select them.  If you
-use multiple frames on a graphical display, then giving the input
-focus to a particular frame selects a window in that frame.
+window; the text in unselected windows is mostly visible for
+reference.  However, mouse commands generally operate on whatever
+window you click them in, whether selected or not.  If you use
+multiple frames on a graphical display, then giving the input focus to
+a particular frame selects a window in that frame.
 
   Each window's last line is a @dfn{mode line}, which describes what
-is going on in that window.  It appears in different color and/or a
-``3D'' box, if the terminal supports that; its contents normally begin
-with @w{@samp{--:-- @ *scratch*}} when Emacs starts.  The mode line
+is going on in that window.  It appears in different color and/or a ``3D''
+box if the terminal supports them; its contents normally begin with
+@w{@samp{--:-- @ *scratch*}} when Emacs starts.  The mode line
 displays status information such as what buffer is being displayed
 above it in the window, what major and minor modes are in use, and
 whether the buffer contains unsaved changes.
@@ -89,18 +89,17 @@
 currently displayed remembers its point location in case you display
 it again later.  When Emacs displays multiple windows, each window has
 its own point location.  If the same buffer appears in more than one
-window, each window has its own position for point in that buffer, and
-(when possible) its own cursor.
+window, each window has its own point position in that buffer, and (when
+possible) its own cursor.
 
-  A text-only terminal has just one cursor, so Emacs puts it
-in the selected window.  The other windows do not show a cursor, even
-though they do have a location of point.  When Emacs updates the
-screen on a text-only terminal, it has to put the cursor temporarily
-at the place the output goes.  This doesn't mean point is there,
-though.  Once display updating finishes, Emacs puts the cursor where
-point is.
+  A text-only terminal has just one cursor, in the selected window.
+The other windows do not show a cursor, even though they do have their
+own position of point.  When Emacs updates the screen on a text-only
+terminal, it has to put the cursor temporarily at the place the output
+goes.  This doesn't mean point is there, though.  Once display
+updating finishes, Emacs puts the cursor where point is.
 
-  On graphical terminals, Emacs shows a cursor in each window; the
+  On graphical displays, Emacs shows a cursor in each window; the
 selected window's cursor is solid and blinking, and the other cursors
 are just hollow.  Thus, the most prominent cursor always shows you the
 selected window, on all kinds of terminals.
@@ -165,18 +164,19 @@
 are often collapsed into one in that buffer.)
 
 @vindex message-log-max
-  The size of @samp{*Messages*} is limited to a certain number of lines.
-The variable @code{message-log-max} specifies how many lines.  Once the
-buffer has that many lines, each line added at the end deletes one line
-from the beginning.  @xref{Variables}, for how to set variables such as
-@code{message-log-max}.
+  The size of @samp{*Messages*} is limited to a certain number of
+lines.  The variable @code{message-log-max} specifies how many lines.
+Once the buffer has that many lines, adding lines at the end deletes lines
+from the beginning, to keep the size constant.  @xref{Variables}, for
+how to set variables such as @code{message-log-max}.
 
-  The echo area is also used to display the @dfn{minibuffer}, a window that
-is used for reading arguments to commands, such as the name of a file to be
-edited.  When the minibuffer is in use, the echo area begins with a prompt
-string that usually ends with a colon; also, the cursor appears in that line
-because it is the selected window.  You can always get out of the
-minibuffer by typing @kbd{C-g}.  @xref{Minibuffer}.
+  The echo area is also used to display the @dfn{minibuffer}, a window
+where you can input arguments to commands, such as the name of a file
+to be edited.  When the minibuffer is in use, the echo area begins
+with a prompt string that usually ends with a colon; also, the cursor
+appears in that line because it is the selected window.  You can
+always get out of the minibuffer by typing @kbd{C-g}.
+@xref{Minibuffer}.
 
 @node Mode Line
 @section The Mode Line
@@ -188,11 +188,11 @@
 what is going on in that window.  The mode line starts and ends with
 dashes.  When there is only one text window, the mode line appears
 right above the echo area; it is the next-to-last line in the frame.
-On a text-mode display, the mode line is in inverse video if the
+On a text-only terminal, the mode line is in inverse video if the
 terminal supports that; on a graphics display, the mode line has a 3D
 box appearance to help it stand out.  The mode line of the selected
-window has a slightly different appearance than those of other
-windows; see @ref{Optional Mode Line}, for more about this.
+window is highlighted if possible; see @ref{Optional Mode Line}, for
+more information.
 
   Normally, the mode line looks like this:
 
@@ -201,26 +201,26 @@
 @end example
 
 @noindent
-This gives information about the buffer being displayed in the window: the
-buffer's name, what major and minor modes are in use, whether the buffer's
-text has been changed, and how far down the buffer you are currently
-looking.
+This gives information about the window and the buffer it displays: the
+buffer's name, what major and minor modes are in use, whether the
+buffer's text has been changed, and how far down the buffer you are
+currently looking.
 
   @var{ch} contains two stars @samp{**} if the text in the buffer has
 been edited (the buffer is ``modified''), or @samp{--} if the buffer has
 not been edited.  For a read-only buffer, it is @samp{%*} if the buffer
 is modified, and @samp{%%} otherwise.
 
-  @var{fr} appears only on text-only terminals, to show the selected
-frame name.  @xref{Frames}.  The initial frame's name is @samp{F1}.
+  @var{fr} gives the selected frame name (@pxref{Frames}).  It appears
+only on text-only terminals.  The initial frame's name is @samp{F1}.
 
-  @var{buf} is the name of the window's @dfn{buffer}.  In most cases
-this is the same as the name of a file you are editing.  @xref{Buffers}.
+  @var{buf} is the name of the window's @dfn{buffer}.  Usually this is
+the same as the name of a file you are editing.  @xref{Buffers}.
 
-  The buffer displayed in the selected window (the window that the
-cursor is in) is the @dfn{current buffer}--the one that editing takes
-place in.  When we speak of what some command does to ``the buffer,''
-we mean it does those things to the current buffer.
+  The buffer displayed in the selected window (the window with the
+cursor) is the @dfn{current buffer}, where editing happens.  When a
+command's effect applies to ``the buffer,'' we mean it does those
+things to the current buffer.
 
   @var{pos} tells you whether there is additional text above the top of
 the window, or below the bottom.  If your buffer is small and it is all
@@ -232,17 +232,17 @@
 well.  @xref{Optional Mode Line}.
 
   @var{line} is @samp{L} followed by the current line number of point.
-This is present when Line Number mode is enabled (which it normally is).
-You can optionally display the current column number too, by turning on
-Column Number mode (which is not enabled by default because it is
-somewhat slower).  @xref{Optional Mode Line}.
+This is present when Line Number mode is enabled (it normally is).
+You can display the current column number too, by turning on Column
+Number mode.  It is not enabled by default because it is somewhat
+slower.  @xref{Optional Mode Line}.
 
   @var{major} is the name of the @dfn{major mode} in effect in the
-buffer.  At any time, each buffer is in one and only one of the possible
-major modes.  The major modes available include Fundamental mode (the
-least specialized), Text mode, Lisp mode, C mode, Texinfo mode, and many
-others.  @xref{Major Modes}, for details of how the modes differ and how
-to select one.@refill
+buffer.  A buffer can only be in one major mode at a time.  The major
+modes available include Fundamental mode (the least specialized), Text
+mode, Lisp mode, C mode, Texinfo mode, and many others.  @xref{Major
+Modes}, for details of how the modes differ and how to select
+them.
 
   Some major modes display additional information after the major mode
 name.  For example, Rmail buffers display the current message number and
@@ -253,14 +253,15 @@
 turned on at the moment in the window's chosen buffer.  For example,
 @samp{Fill} means that Auto Fill mode is on.  @samp{Abbrev} means that
 Word Abbrev mode is on.  @samp{Ovwrt} means that Overwrite mode is on.
-@xref{Minor Modes}, for more information.  @samp{Narrow} means that
-the buffer being displayed has editing restricted to only a portion of
-its text.  (This is not really a minor mode, but is like one.)
-@xref{Narrowing}.  @samp{Def} means that a keyboard macro is being
-defined.  @xref{Keyboard Macros}.
+@xref{Minor Modes}, for more information.  
 
-  In addition, if Emacs is currently inside a recursive editing level,
-square brackets (@samp{[@dots{}]}) appear around the parentheses that
+  @samp{Narrow} means that the buffer being displayed has editing
+restricted to only a portion of its text.  (This is not really a minor
+mode, but is like one.)  @xref{Narrowing}.  @samp{Def} means that a
+keyboard macro is being defined.  @xref{Keyboard Macros}.
+
+  In addition, if Emacs is inside a recursive editing level, square
+brackets (@samp{[@dots{}]}) appear around the parentheses that
 surround the modes.  If Emacs is in one recursive editing level within
 another, double square brackets appear, and so on.  Since recursive
 editing levels affect Emacs globally, not just one buffer, the square
@@ -288,22 +289,21 @@
 all.  @xref{Enabling Multibyte}.
 
 @cindex end-of-line conversion, mode-line indication
-  The colon after @var{cs} can change to another string in certain
-circumstances.  Emacs uses newline characters to separate lines in the buffer.
-Some files use different conventions for separating lines: either
-carriage-return linefeed (the MS-DOS convention) or just carriage-return
-(the Macintosh convention).  If the buffer's file uses carriage-return
-linefeed, the colon changes to either a backslash (@samp{\}) or
-@samp{(DOS)}, depending on the operating system.  If the file uses just
-carriage-return, the colon indicator changes to either a forward slash
-(@samp{/}) or @samp{(Mac)}.  On some systems, Emacs displays
-@samp{(Unix)} instead of the colon even for files that use newline to
-separate lines.
+  The colon after @var{cs} changes to another string in some cases.
+Emacs uses newline characters to separate lines in the buffer.  Some
+files use different conventions for separating lines: either
+carriage-return linefeed (the MS-DOS convention) or just
+carriage-return (the Macintosh convention).  If the buffer's file uses
+carriage-return linefeed, the colon changes to either a backslash
+(@samp{\}) or @samp{(DOS)}, depending on the operating system.  If the
+file uses just carriage-return, the colon indicator changes to either
+a forward slash (@samp{/}) or @samp{(Mac)}.  On some systems, Emacs
+displays @samp{(Unix)} instead of the colon for files that use newline
+as the line separator.
 
-  @xref{Optional Mode Line}, for features that add other handy
-information to the mode line, such as the size of the buffer, the
-current column number of point, and whether new mail for you has
-arrived.
+  @xref{Optional Mode Line}, to add other handy information to the
+mode line, such as the size of the buffer, the current column number
+of point, and whether new mail for you has arrived.
 
   The mode line is mouse-sensitive; when you move the mouse across
 various parts of it, Emacs displays help text to say what a click in
@@ -314,17 +314,17 @@
 @cindex menu bar
 
   Each Emacs frame normally has a @dfn{menu bar} at the top which you
-can use to perform certain common operations.  There's no need to list
-them here, as you can more easily see for yourself.
+can use to perform common operations.  There's no need to list them
+here, as you can more easily see them yourself.
 
 @kindex M-`
 @kindex F10
 @findex tmm-menubar
-  On a graphical terminal, you can use the mouse to choose a command
-from the menu bar.  An arrow pointing right, after the menu item,
-indicates that the item leads to a subsidiary menu; @samp{...} at the
-end means that the command will read arguments (further input from
-you) before it actually does anything.
+  On a graphical display, you can use the mouse to choose a command
+from the menu bar.  A right-arrow at the end of the menu item means it
+leads to a subsidiary menu; @samp{...} at the end means that the
+command invoked will read arguments (further input from you) before it
+actually does anything.
 
   To view the full command name and documentation for a menu item, type
 @kbd{C-h k}, and then select the menu bar with the mouse in the usual
@@ -332,11 +332,10 @@
 
   On text-only terminals with no mouse, you can use the menu bar by
 typing @kbd{M-`} or @key{F10} (these run the command
-@code{tmm-menubar}).  This command enters a mode in which you can select
-a menu item from the keyboard.  A provisional choice appears in the echo
-area.  You can use the up and down arrow keys to move through the
-menu to different choices.  When you have found the choice you want,
-type @key{RET} to select it.
+@code{tmm-menubar}).  This lets you select a menu item with the
+keyboard.  A provisional choice appears in the echo area.  You can use
+the up and down arrow keys to move through the menu to different
+items, and then you can type @key{RET} to select the item.
 
   Each menu item also has an assigned letter or digit which designates
 that item; it is usually the initial of some word in the item's name.
@@ -344,8 +343,7 @@
 can type the item's letter or digit to select the item.
 
   Some of the commands in the menu bar have ordinary key bindings as
-well; if so, the menu lists one equivalent key binding in parentheses
-after the item itself.
+well; one such binding is shown in parentheses after the item itself.
 
 @ignore
    arch-tag: 104ba40e-d972-4866-a542-a98be94bdf2f
--- a/man/sending.texi	Tue May 02 08:50:29 2006 +0000
+++ b/man/sending.texi	Wed May 10 20:42:41 2006 +0000
@@ -2,7 +2,7 @@
 @c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2000, 2001, 2002,
 @c   2003, 2004, 2005, 2006 Free Software Foundation, Inc.
 @c See file emacs.texi for copying conditions.
-@node Sending Mail, Rmail, Abbrevs, Top
+@node Sending Mail
 @chapter Sending Mail
 @cindex sending mail
 @cindex mail
--- a/man/texinfo.tex	Tue May 02 08:50:29 2006 +0000
+++ b/man/texinfo.tex	Wed May 10 20:42:41 2006 +0000
@@ -3,7 +3,7 @@
 % Load plain if necessary, i.e., if running under initex.
 \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
 %
-\def\texinfoversion{2006-03-21.13}
+\def\texinfoversion{2006-05-07.15}
 %
 % Copyright (C) 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
 % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free
@@ -1237,9 +1237,10 @@
 \ifpdf
   \input pdfcolor
   \pdfcatalog{/PageMode /UseOutlines}%
+  % #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto).
   \def\dopdfimage#1#2#3{%
-    \def\imagewidth{#2}%
-    \def\imageheight{#3}%
+    \def\imagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}%
+    \def\imageheight{#3}\setbox2 = \hbox{\ignorespaces #3}%
     % without \immediate, pdftex seg faults when the same image is
     % included twice.  (Version 3.14159-pre-1.0-unofficial-20010704.)
     \ifnum\pdftexversion < 14
@@ -1247,8 +1248,8 @@
     \else
       \immediate\pdfximage
     \fi
-      \ifx\empty\imagewidth\else width \imagewidth \fi
-      \ifx\empty\imageheight\else height \imageheight \fi
+      \ifdim \wd0 >0pt width \imagewidth \fi
+      \ifdim \wd2 >0pt height \imageheight \fi
       \ifnum\pdftexversion<13
          #1.pdf%
        \else
@@ -1471,6 +1472,7 @@
 % We don't need math for this font style.
 \def\ttsl{\setfontstyle{ttsl}}
 
+
 % Default leading.
 \newdimen\textleading  \textleading = 13.2pt
 
@@ -1492,11 +1494,13 @@
   }%
 }
 
+
 % Set the font macro #1 to the font named #2, adding on the
 % specified font prefix (normally `cm').
 % #3 is the font's design size, #4 is a scale factor
 \def\setfont#1#2#3#4{\font#1=\fontprefix#2#3 scaled #4}
 
+
 % Use cm as the default font prefix.
 % To specify the font prefix, you must define \fontprefix
 % before you read in texinfo.tex.
@@ -1520,6 +1524,10 @@
 \def\scshape{csc}
 \def\scbshape{csc}
 
+% Definitions for a main text size of 11pt.  This is the default in
+% Texinfo.
+% 
+\def\definetextfontsizexi{
 % Text fonts (11.2pt, magstep1).
 \def\textnominalsize{11pt}
 \edef\mainmagstep{\magstephalf}
@@ -1633,6 +1641,165 @@
 \font\reducedi=cmmi10
 \font\reducedsy=cmsy10
 
+% reset the current fonts
+\textfonts
+\rm
+} % end of 11pt text font size definitions
+
+
+% Definitions to make the main text be 10pt Computer Modern, with
+% section, chapter, etc., sizes following suit.  This is for the GNU
+% Press printing of the Emacs 22 manual.  Maybe other manuals in the
+% future.  Used with @smallbook, which sets the leading to 12pt.
+% 
+\def\definetextfontsizex{%
+% Text fonts (10pt).
+\def\textnominalsize{10pt}
+\edef\mainmagstep{1000}
+\setfont\textrm\rmshape{10}{\mainmagstep}
+\setfont\texttt\ttshape{10}{\mainmagstep}
+\setfont\textbf\bfshape{10}{\mainmagstep}
+\setfont\textit\itshape{10}{\mainmagstep}
+\setfont\textsl\slshape{10}{\mainmagstep}
+\setfont\textsf\sfshape{10}{\mainmagstep}
+\setfont\textsc\scshape{10}{\mainmagstep}
+\setfont\textttsl\ttslshape{10}{\mainmagstep}
+\font\texti=cmmi10 scaled \mainmagstep
+\font\textsy=cmsy10 scaled \mainmagstep
+
+% A few fonts for @defun names and args.
+\setfont\defbf\bfshape{10}{\magstephalf}
+\setfont\deftt\ttshape{10}{\magstephalf}
+\setfont\defttsl\ttslshape{10}{\magstephalf}
+\def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf}
+
+% Fonts for indices, footnotes, small examples (9pt).
+\def\smallnominalsize{9pt}
+\setfont\smallrm\rmshape{9}{1000}
+\setfont\smalltt\ttshape{9}{1000}
+\setfont\smallbf\bfshape{10}{900}
+\setfont\smallit\itshape{9}{1000}
+\setfont\smallsl\slshape{9}{1000}
+\setfont\smallsf\sfshape{9}{1000}
+\setfont\smallsc\scshape{10}{900}
+\setfont\smallttsl\ttslshape{10}{900}
+\font\smalli=cmmi9
+\font\smallsy=cmsy9
+
+% Fonts for small examples (8pt).
+\def\smallernominalsize{8pt}
+\setfont\smallerrm\rmshape{8}{1000}
+\setfont\smallertt\ttshape{8}{1000}
+\setfont\smallerbf\bfshape{10}{800}
+\setfont\smallerit\itshape{8}{1000}
+\setfont\smallersl\slshape{8}{1000}
+\setfont\smallersf\sfshape{8}{1000}
+\setfont\smallersc\scshape{10}{800}
+\setfont\smallerttsl\ttslshape{10}{800}
+\font\smalleri=cmmi8
+\font\smallersy=cmsy8
+
+% Fonts for title page (20.4pt):
+\def\titlenominalsize{20pt}
+\setfont\titlerm\rmbshape{12}{\magstep3}
+\setfont\titleit\itbshape{10}{\magstep4}
+\setfont\titlesl\slbshape{10}{\magstep4}
+\setfont\titlett\ttbshape{12}{\magstep3}
+\setfont\titlettsl\ttslshape{10}{\magstep4}
+\setfont\titlesf\sfbshape{17}{\magstep1}
+\let\titlebf=\titlerm
+\setfont\titlesc\scbshape{10}{\magstep4}
+\font\titlei=cmmi12 scaled \magstep3
+\font\titlesy=cmsy10 scaled \magstep4
+\def\authorrm{\secrm}
+\def\authortt{\sectt}
+
+% Chapter fonts (14.4pt).
+\def\chapnominalsize{14pt}
+\setfont\chaprm\rmbshape{12}{\magstep1}
+\setfont\chapit\itbshape{10}{\magstep2}
+\setfont\chapsl\slbshape{10}{\magstep2}
+\setfont\chaptt\ttbshape{12}{\magstep1}
+\setfont\chapttsl\ttslshape{10}{\magstep2}
+\setfont\chapsf\sfbshape{12}{\magstep1}
+\let\chapbf\chaprm
+\setfont\chapsc\scbshape{10}{\magstep2}
+\font\chapi=cmmi12 scaled \magstep1
+\font\chapsy=cmsy10 scaled \magstep2
+
+% Section fonts (12pt).
+\def\secnominalsize{12pt}
+\setfont\secrm\rmbshape{12}{1000}
+\setfont\secit\itbshape{10}{\magstep1}
+\setfont\secsl\slbshape{10}{\magstep1}
+\setfont\sectt\ttbshape{12}{1000}
+\setfont\secttsl\ttslshape{10}{\magstep1}
+\setfont\secsf\sfbshape{12}{1000}
+\let\secbf\secrm
+\setfont\secsc\scbshape{10}{\magstep1}
+\font\seci=cmmi12 
+\font\secsy=cmsy10 scaled \magstep1
+
+% Subsection fonts (10pt).
+\def\ssecnominalsize{10pt}
+\setfont\ssecrm\rmbshape{10}{1000}
+\setfont\ssecit\itbshape{10}{1000}
+\setfont\ssecsl\slbshape{10}{1000}
+\setfont\ssectt\ttbshape{10}{1000}
+\setfont\ssecttsl\ttslshape{10}{1000}
+\setfont\ssecsf\sfbshape{10}{1000}
+\let\ssecbf\ssecrm
+\setfont\ssecsc\scbshape{10}{1000}
+\font\sseci=cmmi10
+\font\ssecsy=cmsy10
+
+% Reduced fonts for @acro in text (9pt).
+\def\reducednominalsize{9pt}
+\setfont\reducedrm\rmshape{9}{1000}
+\setfont\reducedtt\ttshape{9}{1000}
+\setfont\reducedbf\bfshape{10}{900}
+\setfont\reducedit\itshape{9}{1000}
+\setfont\reducedsl\slshape{9}{1000}
+\setfont\reducedsf\sfshape{9}{1000}
+\setfont\reducedsc\scshape{10}{900}
+\setfont\reducedttsl\ttslshape{10}{900}
+\font\reducedi=cmmi9
+\font\reducedsy=cmsy9
+
+% reduce space between paragraphs
+\divide\parskip by 2
+
+% reset the current fonts
+\textfonts
+\rm
+} % end of 10pt text font size definitions
+
+
+% We provide the user-level command
+%   @fonttextsize 10
+% (or 11) to redefine the text font size.  pt is assumed.
+% 
+\def\xword{10}
+\def\xiword{11}
+%
+\parseargdef\fonttextsize{%
+  \def\textsizearg{#1}%
+  \wlog{doing @fonttextsize \textsizearg}%
+  %
+  % Set \globaldefs so that documents can use this inside @tex, since
+  % makeinfo 4.8 does not support it, but we need it nonetheless.
+  % 
+ \begingroup \globaldefs=1
+  \ifx\textsizearg\xword \definetextfontsizex
+  \else \ifx\textsizearg\xiword \definetextfontsizexi
+  \else
+    \errhelp=\EMsimple
+    \errmessage{@fonttextsize only supports `10' or `11', not `\textsizearg'}
+  \fi\fi
+ \endgroup
+}
+
+
 % In order for the font changes to affect most math symbols and letters,
 % we have to define the \textfont of the standard families.  Since
 % texinfo doesn't allow for producing subscripts and superscripts except
@@ -1743,7 +1910,7 @@
 
 % Set up the default fonts, so we can use them for creating boxes.
 %
-\textfonts \rm
+\definetextfontsizexi
 
 % Define these so they can be easily changed for other fonts.
 \def\angleleft{$\langle$}
--- a/man/text.texi	Tue May 02 08:50:29 2006 +0000
+++ b/man/text.texi	Wed May 10 20:42:41 2006 +0000
@@ -55,7 +55,13 @@
   If you need to edit pictures made out of text characters (commonly
 referred to as ``ASCII art''), use @kbd{M-x edit-picture} to enter
 Picture mode, a special major mode for editing such pictures.
-@inforef{Picture Mode,, emacs-xtra}.
+@iftex
+@xref{Picture Mode,,, emacs-xtra, Specialized Emacs Features}.
+@end iftex
+@ifnottex
+@xref{Picture Mode}.
+@end ifnottex
+
 
 @cindex skeletons
 @cindex templates
--- a/man/tramp.texi	Tue May 02 08:50:29 2006 +0000
+++ b/man/tramp.texi	Wed May 10 20:42:41 2006 +0000
@@ -1831,9 +1831,15 @@
 @section Filename completion
 @cindex filename completion
 
-Filename completion works with @value{tramp} for both completing methods,
-user names and machine names (except multi hop methods) as well as for
-files on remote machines.
+Filename completion works with @value{tramp} for completion of method
+names, of user names and of machine names (except multi-hop methods)
+as well as for completion of file names on remote machines.
+@ifset emacs
+In order to enable this, Partial Completion mode must be set on.
+@ifinfo
+@xref{Completion Options, , , @value{emacsdir}}.
+@end ifinfo
+@end ifset
 
 If you, for example, type @kbd{C-x C-f @value{prefix}t
 @key{TAB}}, @value{tramp} might give you as result the choice for
--- a/man/trouble.texi	Tue May 02 08:50:29 2006 +0000
+++ b/man/trouble.texi	Wed May 10 20:42:41 2006 +0000
@@ -58,8 +58,14 @@
 like @kbd{C-g}.  The reason is that it is not feasible, on MS-DOS, to
 recognize @kbd{C-g} while a command is running, between interactions
 with the user.  By contrast, it @emph{is} feasible to recognize
-@kbd{C-@key{BREAK}} at all times.  @xref{MS-DOS Keyboard,,,emacs-xtra,
-Specialized Emacs Features}.
+@kbd{C-@key{BREAK}} at all times.
+@iftex
+@xref{MS-DOS Keyboard,,,emacs-xtra, Specialized Emacs Features}.
+@end iftex
+@ifnottex
+@xref{MS-DOS Keyboard}.
+@end ifnottex
+
 
 @findex keyboard-quit
   @kbd{C-g} works by setting the variable @code{quit-flag} to @code{t}
@@ -381,9 +387,9 @@
 answer @kbd{n} to both questions, and you will get back to the former
 state.  The quit you requested will happen by and by.
 
-  Emergency escape is active only for text terminals.  On a graphical
-display that supports multiple windows, you can use the window manager
-to kill Emacs, or to switch to some other program.
+  Emergency escape is active only for text terminals.  On graphical
+displays, you can use the mouse to kill Emacs or switch to another
+program.
 
   On MS-DOS, you must type @kbd{C-@key{BREAK}} (twice) to cause
 emergency escape---but there are cases where it won't work, when
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/man/vc-xtra.texi	Wed May 10 20:42:41 2006 +0000
@@ -0,0 +1,32 @@
+@c This is part of the Emacs manual.
+@c Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
+@c See file emacs.texi for copying conditions.
+@c
+@c This file is included in emacs-xtra.texi when producing the printed
+@c version.
+@iftex
+@node Advanced VC Usage
+@section Advanced VC Usage
+
+  Commonly used features of Emacs' version control (VC) support are
+described in the main Emacs manual (@pxref{Version Control,,,emacs,
+the Emacs Manual}).  This chapter describes more advanced VC usage.
+
+@menu
+* VC Dired Mode::       Listing files managed by version control.
+* VC Dired Commands::   Commands to use in a VC Dired buffer.
+* Remote Repositories:: Efficient access to remote CVS servers.
+* Snapshots::           Sets of file versions treated as a unit.
+* Miscellaneous VC::    Various other commands and features of VC.
+* Customizing VC::      Variables that change VC's behavior.
+@end menu
+@end iftex
+
+@iftex
+@include vc1-xtra.texi
+@include vc2-xtra.texi
+@end iftex
+
+@ignore
+   arch-tag: 11a18d0e-1baf-49da-8e38-f61195ae4dc3
+@end ignore
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/man/vc1-xtra.texi	Wed May 10 20:42:41 2006 +0000
@@ -0,0 +1,151 @@
+@c This is part of the Emacs manual.
+@c Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
+@c See file emacs.texi for copying conditions.
+@c
+@c This file is included either in vc-xtra.texi (when producing the
+@c printed version) or in the main Emacs manual (for the on-line version).
+@node VC Dired Mode
+@subsection Dired under VC
+
+@cindex PCL-CVS
+@pindex cvs
+@cindex CVS Dired Mode
+  The VC Dired Mode described here works with all the version control
+systems that VC supports.  Another more powerful facility, designed
+specifically for CVS, is called PCL-CVS.  @xref{Top, , About PCL-CVS,
+pcl-cvs, PCL-CVS --- The Emacs Front-End to CVS}.
+
+@kindex C-x v d
+@findex vc-directory
+  When you are working on a large program, it is often useful to find
+out which files have changed within an entire directory tree, or to view
+the status of all files under version control at once, and to perform
+version control operations on collections of files.  You can use the
+command @kbd{C-x v d} (@code{vc-directory}) to make a directory listing
+that includes only files relevant for version control.
+
+@vindex vc-dired-terse-display
+  @kbd{C-x v d} creates a buffer which uses VC Dired Mode.  This looks
+much like an ordinary Dired buffer
+@iftex
+(@pxref{Dired,,,emacs, the Emacs Manual});
+@end iftex
+@ifnottex
+(@pxref{Dired});
+@end ifnottex
+however, normally it shows only the noteworthy files (those locked or
+not up-to-date).  This is called @dfn{terse display}.  If you set the
+variable @code{vc-dired-terse-display} to @code{nil}, then VC Dired
+shows all relevant files---those managed under version control, plus
+all subdirectories (@dfn{full display}).  The command @kbd{v t} in a
+VC Dired buffer toggles between terse display and full display
+(@pxref{VC Dired Commands}).
+
+@vindex vc-dired-recurse
+  By default, VC Dired produces a recursive listing of noteworthy or
+relevant files at or below the given directory.  You can change this by
+setting the variable @code{vc-dired-recurse} to @code{nil}; then VC
+Dired shows only the files in the given directory.
+
+  The line for an individual file shows the version control state in the
+place of the hard link count, owner, group, and size of the file.  If
+the file is unmodified, in sync with the master file, the version
+control state shown is blank.  Otherwise it consists of text in
+parentheses.  Under RCS and SCCS, the name of the user locking the file
+is shown; under CVS, an abbreviated version of the @samp{cvs status}
+output is used.  Here is an example using RCS:
+
+@smallexample
+@group
+  /home/jim/project:
+
+  -rw-r--r-- (jim)      Apr  2 23:39 file1
+  -r--r--r--            Apr  5 20:21 file2
+@end group
+@end smallexample
+
+@noindent
+The files @samp{file1} and @samp{file2} are under version control,
+@samp{file1} is locked by user jim, and @samp{file2} is unlocked.
+
+  Here is an example using CVS:
+
+@smallexample
+@group
+  /home/joe/develop:
+
+  -rw-r--r-- (modified) Aug  2  1997 file1.c
+  -rw-r--r--            Apr  4 20:09 file2.c
+  -rw-r--r-- (merge)    Sep 13  1996 file3.c
+@end group
+@end smallexample
+
+  Here @samp{file1.c} is modified with respect to the repository, and
+@samp{file2.c} is not.  @samp{file3.c} is modified, but other changes
+have also been checked in to the repository---you need to merge them
+with the work file before you can check it in.
+
+@vindex vc-stay-local
+@vindex vc-cvs-stay-local
+  In the above, if the repository were on a remote machine, VC would
+only contact it when the variable @code{vc-stay-local} (or
+@code{vc-cvs-stay-local}) is nil (@pxref{CVS Options}).  This is
+because access to the repository may be slow, or you may be working
+offline and not have access to the repository at all.  As a
+consequence, VC would not be able to tell you that @samp{file3.c} is
+in the ``merge'' state; you would learn that only when you try to
+check-in your modified copy of the file, or use a command such as
+@kbd{C-x v m}.
+
+  In practice, this is not a problem because CVS handles this case
+consistently whenever it arises.  In VC, you'll simply get prompted to
+merge the remote changes into your work file first.  The benefits of
+less network communication usually outweigh the disadvantage of not
+seeing remote changes immediately.
+
+@vindex vc-directory-exclusion-list
+  When VC Dired displays subdirectories (in the ``full'' display mode),
+it omits some that should never contain any files under version control.
+By default, this includes Version Control subdirectories such as
+@samp{RCS} and @samp{CVS}; you can customize this by setting the
+variable @code{vc-directory-exclusion-list}.
+
+  You can fine-tune VC Dired's format by typing @kbd{C-u C-x v d}---as in
+ordinary Dired, that allows you to specify additional switches for the
+@samp{ls} command.
+
+@node VC Dired Commands
+@subsection VC Dired Commands
+
+  All the usual Dired commands work normally in VC Dired mode, except
+for @kbd{v}, which is redefined as the version control prefix.  You can
+invoke VC commands such as @code{vc-diff} and @code{vc-print-log} by
+typing @kbd{v =}, or @kbd{v l}, and so on.  Most of these commands apply
+to the file name on the current line.
+
+  The command @kbd{v v} (@code{vc-next-action}) operates on all the
+marked files, so that you can lock or check in several files at once.
+If it operates on more than one file, it handles each file according to
+its current state; thus, it might lock one file, but check in another
+file.  This could be confusing; it is up to you to avoid confusing
+behavior by marking a set of files that are in a similar state.  If no
+files are marked, @kbd{v v} operates on the file in the current line.
+
+  If any files call for check-in, @kbd{v v} reads a single log entry,
+then uses it for all the files being checked in.  This is convenient for
+registering or checking in several files at once, as part of the same
+change.
+
+@findex vc-dired-toggle-terse-mode
+@findex vc-dired-mark-locked
+  You can toggle between terse display (only locked files, or files not
+up-to-date) and full display at any time by typing @kbd{v t}
+(@code{vc-dired-toggle-terse-mode}).  There is also a special command
+@kbd{* l} (@code{vc-dired-mark-locked}), which marks all files currently
+locked (or, with CVS, all files not up-to-date).  Thus, typing @kbd{* l
+t k} is another way to delete from the buffer all files except those
+currently locked.
+
+@ignore
+   arch-tag: 8e8c2a01-ad41-4e61-a89a-60131ad67263
+@end ignore
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/man/vc2-xtra.texi	Wed May 10 20:42:41 2006 +0000
@@ -0,0 +1,789 @@
+@c This is part of the Emacs manual.
+@c Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
+@c See file emacs.texi for copying conditions.
+@c
+@c This file is included either in vc-xtra.texi (when producing the
+@c printed version) or in the main Emacs manual (for the on-line version).
+@node Remote Repositories
+@subsection Remote Repositories
+@cindex remote repositories (CVS)
+
+  A common way of using CVS is to set up a central CVS repository on
+some Internet host, then have each developer check out a personal
+working copy of the files on his local machine.  Committing changes to
+the repository, and picking up changes from other users into one's own
+working area, then works by direct interactions with the CVS server.
+
+  One difficulty is that access to the CVS server is often slow, and
+that developers might need to work off-line as well.  VC is designed
+to reduce the amount of network interaction necessary.
+
+@menu
+* Version Backups::        Keeping local copies of repository versions.
+* Local Version Control::  Using another version system for local editing.
+@end menu
+
+@node Version Backups
+@subsubsection Version Backups
+@cindex version backups
+
+@cindex automatic version backups
+  When VC sees that the CVS repository for a file is on a remote
+machine, it automatically makes local backups of unmodified versions
+of the file---@dfn{automatic version backups}.  This means that you
+can compare the file to the repository version (@kbd{C-x v =}), or
+revert to that version (@kbd{C-x v u}), without any network
+interactions.
+
+  The local copy of the unmodified file is called a @dfn{version
+backup} to indicate that it corresponds exactly to a version that is
+stored in the repository.  Note that version backups are not the same
+as ordinary Emacs backup files
+@iftex
+(@pxref{Backup,,,emacs, the Emacs Manual}).
+@end iftex
+@ifnottex
+(@pxref{Backup}).
+@end ifnottex
+But they follow a similar naming convention.
+
+  For a file that comes from a remote CVS repository, VC makes a
+version backup whenever you save the first changes to the file, and
+removes it after you have committed your modified version to the
+repository. You can disable the making of automatic version backups by
+setting @code{vc-cvs-stay-local} to @code{nil} (@pxref{CVS Options}).
+
+@cindex manual version backups
+  The name of the automatic version backup for version @var{version}
+of file @var{file} is @code{@var{file}.~@var{version}.~}.  This is
+almost the same as the name used by @kbd{C-x v ~}
+@iftex
+(@pxref{Old Versions,,,emacs, the Emacs Manual}),
+@end iftex
+@ifnottex
+(@pxref{Old Versions}),
+@end ifnottex
+the only difference being the additional dot (@samp{.})  after the
+version number.  This similarity is intentional, because both kinds of
+files store the same kind of information.  The file made by @kbd{C-x v
+~} acts as a @dfn{manual version backup}.
+
+  All the VC commands that operate on old versions of a file can use
+both kinds of version backups.  For instance, @kbd{C-x v ~} uses
+either an automatic or a manual version backup, if possible, to get
+the contents of the version you request.  Likewise, @kbd{C-x v =} and
+@kbd{C-x v u} use either an automatic or a manual version backup, if
+one of them exists, to get the contents of a version to compare or
+revert to.  If you changed a file outside of Emacs, so that no
+automatic version backup was created for the previous text, you can
+create a manual backup of that version using @kbd{C-x v ~}, and thus
+obtain the benefit of the local copy for Emacs commands.
+
+  The only difference in Emacs's handling of manual and automatic
+version backups, once they exist, is that Emacs deletes automatic
+version backups when you commit to the repository.  By contrast,
+manual version backups remain until you delete them.
+
+@node Local Version Control
+@subsubsection Local Version Control
+@cindex local version control
+@cindex local back end (version control)
+
+When you make many changes to a file that comes from a remote
+repository, it can be convenient to have version control on your local
+machine as well.  You can then record intermediate versions, revert to
+a previous state, etc., before you actually commit your changes to the
+remote server.
+
+VC lets you do this by putting a file under a second, local version
+control system, so that the file is effectively registered in two
+systems at the same time.  For the description here, we will assume
+that the remote system is CVS, and you use RCS locally, although the
+mechanism works with any combination of version control systems
+(@dfn{back ends}).
+
+To make it work with other back ends, you must make sure that the
+``more local'' back end comes before the ``more remote'' back end in
+the setting of @code{vc-handled-backends} (@pxref{Customizing VC}).  By
+default, this variable is set up so that you can use remote CVS and
+local RCS as described here.
+
+To start using local RCS for a file that comes from a remote CVS
+server, you must @emph{register the file in RCS}, by typing @kbd{C-u
+C-x v v rcs @key{RET}}.  (In other words, use @code{vc-next-action} with a
+prefix argument, and specify RCS as the back end.)
+
+You can do this at any time; it does not matter whether you have
+already modified the file with respect to the version in the CVS
+repository.  If possible, VC tries to make the RCS master start with
+the unmodified repository version, then checks in any local changes
+as a new version.  This works if you have not made any changes yet, or
+if the unmodified repository version exists locally as a version
+backup (@pxref{Version Backups}).  If the unmodified version is not
+available locally, the RCS master starts with the modified version;
+the only drawback to this is that you cannot compare your changes
+locally to what is stored in the repository.
+
+The version number of the RCS master is derived from the current CVS
+version, starting a branch from it.  For example, if the current CVS
+version is 1.23, the local RCS branch will be 1.23.1.  Version 1.23 in
+the RCS master will be identical to version 1.23 under CVS; your first
+changes are checked in as 1.23.1.1.  (If the unmodified file is not
+available locally, VC will check in the modified file twice, both as
+1.23 and 1.23.1.1, to make the revision numbers consistent.)
+
+If you do not use locking under CVS (the default), locking is also
+disabled for RCS, so that editing under RCS works exactly as under
+CVS.
+
+When you are done with local editing, you can commit the final version
+back to the CVS repository by typing @kbd{C-u C-x v v cvs @key{RET}}.
+This initializes the log entry buffer
+@iftex
+(@pxref{Log Buffer,,,emacs, the Emacs Manual})
+@end iftex
+@ifnottex
+(@pxref{Log Buffer})
+@end ifnottex
+to contain all the log entries you have recorded in the RCS master;
+you can edit them as you wish, and then commit in CVS by typing
+@kbd{C-c C-c}.  If the commit is successful, VC removes the RCS
+master, so that the file is once again registered under CVS only.
+(The RCS master is not actually deleted, just renamed by appending
+@samp{~} to the name, so that you can refer to it later if you wish.)
+
+While using local RCS, you can pick up recent changes from the CVS
+repository into your local file, or commit some of your changes back
+to CVS, without terminating local RCS version control.  To do this,
+switch to the CVS back end temporarily, with the @kbd{C-x v b} command:
+
+@table @kbd
+@item C-x v b
+Switch to another back end that the current file is registered
+under (@code{vc-switch-backend}).
+
+@item C-u C-x v b @var{backend} @key{RET}
+Switch to @var{backend} for the current file.
+@end table
+
+@kindex C-x v b
+@findex vc-switch-backend
+@kbd{C-x v b} does not change the buffer contents, or any files; it
+only changes VC's perspective on how to handle the file.  Any
+subsequent VC commands for that file will operate on the back end that
+is currently selected.
+
+If the current file is registered in more than one back end, typing
+@kbd{C-x v b} ``cycles'' through all of these back ends.  With a
+prefix argument, it asks for the back end to use in the minibuffer.
+
+Thus, if you are using local RCS, and you want to pick up some recent
+changes in the file from remote CVS, first visit the file, then type
+@kbd{C-x v b} to switch to CVS, and finally use @kbd{C-x v m
+@key{RET}} to merge the news
+@iftex
+(@pxref{Merging,,,emacs, the Emacs Manual}).
+@end iftex
+@ifnottex
+(@pxref{Merging}).
+@end ifnottex
+You can then switch back to RCS by typing @kbd{C-x v b} again, and
+continue to edit locally.
+
+But if you do this, the revision numbers in the RCS master no longer
+correspond to those of CVS.  Technically, this is not a problem, but
+it can become difficult to keep track of what is in the CVS repository
+and what is not.  So we suggest that you return from time to time to
+CVS-only operation, by committing your local changes back to the
+repository using @kbd{C-u C-x v v cvs @key{RET}}.
+
+@node Snapshots
+@subsection Snapshots
+@cindex snapshots and version control
+
+  A @dfn{snapshot} is a named set of file versions (one for each
+registered file) that you can treat as a unit.  One important kind of
+snapshot is a @dfn{release}, a (theoretically) stable version of the
+system that is ready for distribution to users.
+
+@menu
+* Making Snapshots::		The snapshot facilities.
+* Snapshot Caveats::		Things to be careful of when using snapshots.
+@end menu
+
+@node Making Snapshots
+@subsubsection Making and Using Snapshots
+
+  There are two basic commands for snapshots; one makes a
+snapshot with a given name, the other retrieves a named snapshot.
+
+@table @code
+@kindex C-x v s
+@findex vc-create-snapshot
+@item C-x v s @var{name} @key{RET}
+Define the last saved versions of every registered file in or under the
+current directory as a snapshot named @var{name}
+(@code{vc-create-snapshot}).
+
+@kindex C-x v r
+@findex vc-retrieve-snapshot
+@item C-x v r @var{name} @key{RET}
+For all registered files at or below the current directory level, select
+whatever versions correspond to the snapshot @var{name}
+(@code{vc-retrieve-snapshot}).
+
+This command reports an error if any files are locked at or below the
+current directory, without changing anything; this is to avoid
+overwriting work in progress.
+@end table
+
+  A snapshot uses a very small amount of resources---just enough to record
+the list of file names and which version belongs to the snapshot.  Thus,
+you need not hesitate to create snapshots whenever they are useful.
+
+  You can give a snapshot name as an argument to @kbd{C-x v =} or
+@kbd{C-x v ~}
+@iftex
+(@pxref{Old Versions,,,emacs, the Emacs Manual}).
+@end iftex
+@ifnottex
+(@pxref{Old Versions}).
+@end ifnottex
+Thus, you can use it to compare a snapshot against the current files,
+or two snapshots against each other, or a snapshot against a named
+version.
+
+@node Snapshot Caveats
+@subsubsection Snapshot Caveats
+
+@cindex named configurations (RCS)
+  VC's snapshot facilities are modeled on RCS's named-configuration
+support.  They use RCS's native facilities for this, so
+snapshots made using RCS through VC are visible even when you bypass VC.
+
+  With CVS, Meta-CVS, and Subversion, VC also uses the native
+mechanism provided by that back end to make snapshots and retrieve them
+(@dfn{tags} for CVS and Meta-CVS, @dfn{copies} for Subversion).
+
+@c worded verbosely to avoid overfull hbox.
+  For SCCS, VC implements snapshots itself.  The files it uses contain
+name/file/version-number triples.  These snapshots are visible only
+through VC.
+
+  There is no support for VC snapshots using GNU Arch yet.
+
+  A snapshot is a set of checked-in versions.  So make sure that all the
+files are checked in and not locked when you make a snapshot.
+
+  File renaming and deletion can create some difficulties with snapshots.
+This is not a VC-specific problem, but a general design issue in version
+control systems that no one has solved very well yet.
+
+  If you rename a registered file, you need to rename its master along
+with it (the command @code{vc-rename-file} does this automatically).  If
+you are using SCCS, you must also update the records of the snapshot, to
+mention the file by its new name (@code{vc-rename-file} does this,
+too).  An old snapshot that refers to a master file that no longer
+exists under the recorded name is invalid; VC can no longer retrieve
+it.  It would be beyond the scope of this manual to explain enough about
+RCS and SCCS to explain how to update the snapshots by hand.
+
+  Using @code{vc-rename-file} makes the snapshot remain valid for
+retrieval, but it does not solve all problems.  For example, some of the
+files in your program probably refer to others by name.  At the very
+least, the makefile probably mentions the file that you renamed.  If you
+retrieve an old snapshot, the renamed file is retrieved under its new
+name, which is not the name that the makefile expects.  So the program
+won't really work as retrieved.
+
+@node Miscellaneous VC
+@subsection Miscellaneous Commands and Features of VC
+
+  This section explains the less-frequently-used features of VC.
+
+@menu
+* Change Logs and VC::  Generating a change log file from log entries.
+* Renaming and VC::     A command to rename both the source and master
+                          file correctly.
+* Version Headers::     Inserting version control headers into working files.
+@end menu
+
+@node Change Logs and VC
+@subsubsection Change Logs and VC
+
+  If you use RCS or CVS for a program and also maintain a change log
+file for it
+@iftex
+(@pxref{Change Log,,,emacs, the Emacs Manual}),
+@end iftex
+@ifnottex
+(@pxref{Change Log}),
+@end ifnottex
+you can generate change log entries automatically from the version
+control log entries:
+
+@table @kbd
+@item C-x v a
+@kindex C-x v a
+@findex vc-update-change-log
+Visit the current directory's change log file and, for registered files
+in that directory, create new entries for versions checked in since the
+most recent entry in the change log file.
+(@code{vc-update-change-log}).
+
+This command works with RCS or CVS only, not with any of the other
+back ends.
+
+@item C-u C-x v a
+As above, but only find entries for the current buffer's file.
+
+@item M-1 C-x v a
+As above, but find entries for all the currently visited files that are
+maintained with version control.  This works only with RCS, and it puts
+all entries in the log for the default directory, which may not be
+appropriate.
+@end table
+
+  For example, suppose the first line of @file{ChangeLog} is dated
+1999-04-10, and that the only check-in since then was by Nathaniel
+Bowditch to @file{rcs2log} on 1999-05-22 with log text @samp{Ignore log
+messages that start with `#'.}.  Then @kbd{C-x v a} visits
+@file{ChangeLog} and inserts text like this:
+
+@iftex
+@medbreak
+@end iftex
+@smallexample
+@group
+1999-05-22  Nathaniel Bowditch  <nat@@apn.org>
+
+        * rcs2log: Ignore log messages that start with `#'.
+@end group
+@end smallexample
+@iftex
+@medbreak
+@end iftex
+
+@noindent
+You can then edit the new change log entry further as you wish.
+
+  Some of the new change log entries may duplicate what's already in
+ChangeLog.  You will have to remove these duplicates by hand.
+
+  Normally, the log entry for file @file{foo} is displayed as @samp{*
+foo: @var{text of log entry}}.  The @samp{:} after @file{foo} is omitted
+if the text of the log entry starts with @w{@samp{(@var{functionname}):
+}}.  For example, if the log entry for @file{vc.el} is
+@samp{(vc-do-command): Check call-process status.}, then the text in
+@file{ChangeLog} looks like this:
+
+@iftex
+@medbreak
+@end iftex
+@smallexample
+@group
+1999-05-06  Nathaniel Bowditch  <nat@@apn.org>
+
+        * vc.el (vc-do-command): Check call-process status.
+@end group
+@end smallexample
+@iftex
+@medbreak
+@end iftex
+
+  When @kbd{C-x v a} adds several change log entries at once, it groups
+related log entries together if they all are checked in by the same
+author at nearly the same time.  If the log entries for several such
+files all have the same text, it coalesces them into a single entry.
+For example, suppose the most recent check-ins have the following log
+entries:
+
+@flushleft
+@bullet{} For @file{vc.texinfo}: @samp{Fix expansion typos.}
+@bullet{} For @file{vc.el}: @samp{Don't call expand-file-name.}
+@bullet{} For @file{vc-hooks.el}: @samp{Don't call expand-file-name.}
+@end flushleft
+
+@noindent
+They appear like this in @file{ChangeLog}:
+
+@iftex
+@medbreak
+@end iftex
+@smallexample
+@group
+1999-04-01  Nathaniel Bowditch  <nat@@apn.org>
+
+        * vc.texinfo: Fix expansion typos.
+
+        * vc.el, vc-hooks.el: Don't call expand-file-name.
+@end group
+@end smallexample
+@iftex
+@medbreak
+@end iftex
+
+  Normally, @kbd{C-x v a} separates log entries by a blank line, but you
+can mark several related log entries to be clumped together (without an
+intervening blank line) by starting the text of each related log entry
+with a label of the form @w{@samp{@{@var{clumpname}@} }}.  The label
+itself is not copied to @file{ChangeLog}.  For example, suppose the log
+entries are:
+
+@flushleft
+@bullet{} For @file{vc.texinfo}: @samp{@{expand@} Fix expansion typos.}
+@bullet{} For @file{vc.el}: @samp{@{expand@} Don't call expand-file-name.}
+@bullet{} For @file{vc-hooks.el}: @samp{@{expand@} Don't call expand-file-name.}
+@end flushleft
+
+@noindent
+Then the text in @file{ChangeLog} looks like this:
+
+@iftex
+@medbreak
+@end iftex
+@smallexample
+@group
+1999-04-01  Nathaniel Bowditch  <nat@@apn.org>
+
+        * vc.texinfo: Fix expansion typos.
+        * vc.el, vc-hooks.el: Don't call expand-file-name.
+@end group
+@end smallexample
+@iftex
+@medbreak
+@end iftex
+
+  A log entry whose text begins with @samp{#} is not copied to
+@file{ChangeLog}.  For example, if you merely fix some misspellings in
+comments, you can log the change with an entry beginning with @samp{#}
+to avoid putting such trivia into @file{ChangeLog}.
+
+@node Renaming and VC
+@subsubsection Renaming VC Work Files and Master Files
+
+@findex vc-rename-file
+  When you rename a registered file, you must also rename its master
+file correspondingly to get proper results.  Use @code{vc-rename-file}
+to rename the source file as you specify, and rename its master file
+accordingly.  It also updates any snapshots (@pxref{Snapshots}) that
+mention the file, so that they use the new name; despite this, the
+snapshot thus modified may not completely work (@pxref{Snapshot
+Caveats}).
+
+  Some back ends do not provide an explicit rename operation to their
+repositories.  After issuing @code{vc-rename-file}, use @kbd{C-x v v}
+on the original and renamed buffers and provide the necessary edit
+log.
+
+  You cannot use @code{vc-rename-file} on a file that is locked by
+someone else.
+
+@node Version Headers
+@subsubsection Inserting Version Control Headers
+
+   Sometimes it is convenient to put version identification strings
+directly into working files.  Certain special strings called
+@dfn{version headers} are replaced in each successive version by the
+number of that version, the name of the user who created it, and other
+relevant information.  All of the back ends that VC supports have such
+a mechanism, except GNU Arch.
+
+  VC does not normally use the information contained in these headers.
+The exception is RCS---with RCS, version headers are sometimes more
+reliable than the master file to determine which version of the file
+you are editing.  Note that in a multi-branch environment, version
+headers are necessary to make VC behave correctly
+@iftex
+(@pxref{Multi-User Branching,,,emacs, the Emacs Manual}).
+@end iftex
+@ifnottex
+(@pxref{Multi-User Branching}).
+@end ifnottex
+
+  Searching for RCS version headers is controlled by the variable
+@code{vc-consult-headers}.  If it is non-@code{nil} (the default),
+Emacs searches for headers to determine the version number you are
+editing.  Setting it to @code{nil} disables this feature.
+
+  Note that although CVS uses the same kind of version headers as RCS
+does, VC never searches for these headers if you are using CVS,
+regardless of the above setting.
+
+@kindex C-x v h
+@findex vc-insert-headers
+  You can use the @kbd{C-x v h} command (@code{vc-insert-headers}) to
+insert a suitable header string.
+
+@table @kbd
+@item C-x v h
+Insert headers in a file for use with your version-control system.
+@end table
+
+@vindex vc-@var{backend}-header
+  The default header string is @samp{@w{$}Id$} for RCS and
+@samp{@w{%}W%} for SCCS.  You can specify other headers to insert by
+setting the variables @code{vc-@var{backend}-header} where
+@var{backend} is @code{rcs} or @code{sccs}.
+
+  Instead of a single string, you can specify a list of strings; then
+each string in the list is inserted as a separate header on a line of
+its own.
+
+  It may be necessary to use apparently-superfluous backslashes when
+writing the strings that you put in this variable.  For instance, you
+might write @code{"$Id\$"} rather than @code{"$Id@w{$}"}.  The extra
+backslash prevents the string constant from being interpreted as a
+header, if the Emacs Lisp file containing it is maintained with
+version control.
+
+@vindex vc-comment-alist
+  Each header is inserted surrounded by tabs, inside comment delimiters,
+on a new line at point.  Normally the ordinary comment
+start and comment end strings of the current mode are used, but for
+certain modes, there are special comment delimiters for this purpose;
+the variable @code{vc-comment-alist} specifies them.  Each element of
+this list has the form @code{(@var{mode} @var{starter} @var{ender})}.
+
+@vindex vc-static-header-alist
+  The variable @code{vc-static-header-alist} specifies further strings
+to add based on the name of the buffer.  Its value should be a list of
+elements of the form @code{(@var{regexp} . @var{format})}.  Whenever
+@var{regexp} matches the buffer name, @var{format} is inserted as part
+of the header.  A header line is inserted for each element that matches
+the buffer name, and for each string specified by
+@code{vc-@var{backend}-header}.  The header line is made by processing the
+string from @code{vc-@var{backend}-header} with the format taken from the
+element.  The default value for @code{vc-static-header-alist} is as follows:
+
+@example
+@group
+(("\\.c$" .
+  "\n#ifndef lint\nstatic char vcid[] = \"\%s\";\n\
+#endif /* lint */\n"))
+@end group
+@end example
+
+@noindent
+It specifies insertion of text of this form:
+
+@example
+@group
+
+#ifndef lint
+static char vcid[] = "@var{string}";
+#endif /* lint */
+@end group
+@end example
+
+@noindent
+Note that the text above starts with a blank line.
+
+  If you use more than one version header in a file, put them close
+together in the file.  The mechanism in @code{revert-buffer} that
+preserves markers may not handle markers positioned between two version
+headers.
+
+@node Customizing VC
+@subsection Customizing VC
+
+@vindex vc-handled-backends
+The variable @code{vc-handled-backends} determines which version
+control systems VC should handle.  The default value is @code{(RCS CVS
+SVN SCCS Arch MCVS)}, so it contains all six version systems that are
+currently supported.  If you want VC to ignore one or more of these
+systems, exclude its name from the list.  To disable VC entirely, set
+this variable to @code{nil}.
+
+The order of systems in the list is significant: when you visit a file
+registered in more than one system (@pxref{Local Version Control}), VC
+uses the system that comes first in @code{vc-handled-backends} by
+default.  The order is also significant when you register a file for
+the first time, see
+@iftex
+@ref{Registering,,,emacs, the Emacs Manual},
+@end iftex
+@ifnottex
+@ref{Registering},
+@end ifnottex
+for details.
+
+@menu
+* General VC Options::  Options that apply to multiple back ends.
+* RCS and SCCS::        Options for RCS and SCCS.
+* CVS Options::         Options for CVS.
+@end menu
+
+@node General VC Options
+@subsubsection General Options
+
+@vindex vc-make-backup-files
+  Emacs normally does not save backup files for source files that are
+maintained with version control.  If you want to make backup files even
+for files that use version control, set the variable
+@code{vc-make-backup-files} to a non-@code{nil} value.
+
+@vindex vc-keep-workfiles
+  Normally the work file exists all the time, whether it is locked or
+not.  If you set @code{vc-keep-workfiles} to @code{nil}, then checking
+in a new version with @kbd{C-x v v} deletes the work file; but any
+attempt to visit the file with Emacs creates it again.  (With CVS, work
+files are always kept.)
+
+@vindex vc-follow-symlinks
+  Editing a version-controlled file through a symbolic link can be
+dangerous.  It bypasses the version control system---you can edit the
+file without locking it, and fail to check your changes in.  Also,
+your changes might overwrite those of another user.  To protect against
+this, VC checks each symbolic link that you visit, to see if it points
+to a file under version control.
+
+  The variable @code{vc-follow-symlinks} controls what to do when a
+symbolic link points to a version-controlled file.  If it is @code{nil},
+VC only displays a warning message.  If it is @code{t}, VC automatically
+follows the link, and visits the real file instead, telling you about
+this in the echo area.  If the value is @code{ask} (the default), VC
+asks you each time whether to follow the link.
+
+@vindex vc-suppress-confirm
+  If @code{vc-suppress-confirm} is non-@code{nil}, then @kbd{C-x v v}
+and @kbd{C-x v i} can save the current buffer without asking, and
+@kbd{C-x v u} also operates without asking for confirmation.  (This
+variable does not affect @kbd{C-x v c}; that operation is so drastic
+that it should always ask for confirmation.)
+
+@vindex vc-command-messages
+  VC mode does much of its work by running the shell commands for RCS,
+CVS and SCCS.  If @code{vc-command-messages} is non-@code{nil}, VC
+displays messages to indicate which shell commands it runs, and
+additional messages when the commands finish.
+
+@vindex vc-path
+  You can specify additional directories to search for version control
+programs by setting the variable @code{vc-path}.  These directories
+are searched before the usual search path.  It is rarely necessary to
+set this variable, because VC normally finds the proper files
+automatically.
+
+@node RCS and SCCS
+@subsubsection Options for RCS and SCCS
+
+@cindex non-strict locking (RCS)
+@cindex locking, non-strict (RCS)
+  By default, RCS uses locking to coordinate the activities of several
+users, but there is a mode called @dfn{non-strict locking} in which
+you can check-in changes without locking the file first.  Use
+@samp{rcs -U} to switch to non-strict locking for a particular file,
+see the @code{rcs} manual page for details.
+
+  When deducing the version control state of an RCS file, VC first
+looks for an RCS version header string in the file (@pxref{Version
+Headers}).  If there is no header string, VC normally looks at the
+file permissions of the work file; this is fast.  But there might be
+situations when the file permissions cannot be trusted.  In this case
+the master file has to be consulted, which is rather expensive.  Also
+the master file can only tell you @emph{if} there's any lock on the
+file, but not whether your work file really contains that locked
+version.
+
+@vindex vc-consult-headers
+  You can tell VC not to use version headers to determine the file
+status by setting @code{vc-consult-headers} to @code{nil}.  VC then
+always uses the file permissions (if it is supposed to trust them), or
+else checks the master file.
+
+@vindex vc-mistrust-permissions
+  You can specify the criterion for whether to trust the file
+permissions by setting the variable @code{vc-mistrust-permissions}.
+Its value can be @code{t} (always mistrust the file permissions and
+check the master file), @code{nil} (always trust the file
+permissions), or a function of one argument which makes the decision.
+The argument is the directory name of the @file{RCS} subdirectory.  A
+non-@code{nil} value from the function says to mistrust the file
+permissions.  If you find that the file permissions of work files are
+changed erroneously, set @code{vc-mistrust-permissions} to @code{t}.
+Then VC always checks the master file to determine the file's status.
+
+  VC determines the version control state of files under SCCS much as
+with RCS.  It does not consider SCCS version headers, though.  Thus,
+the variable @code{vc-mistrust-permissions} affects SCCS use, but
+@code{vc-consult-headers} does not.
+
+@node CVS Options
+@subsubsection Options specific for CVS
+
+@cindex locking (CVS)
+  By default, CVS does not use locking to coordinate the activities of
+several users; anyone can change a work file at any time.  However,
+there are ways to restrict this, resulting in behavior that resembles
+locking.
+
+@cindex CVSREAD environment variable (CVS)
+  For one thing, you can set the @env{CVSREAD} environment variable
+(the value you use makes no difference).  If this variable is defined,
+CVS makes your work files read-only by default.  In Emacs, you must
+type @kbd{C-x v v} to make the file writable, so that editing works
+in fact similar as if locking was used.  Note however, that no actual
+locking is performed, so several users can make their files writable
+at the same time.  When setting @env{CVSREAD} for the first time, make
+sure to check out all your modules anew, so that the file protections
+are set correctly.
+
+@cindex cvs watch feature
+@cindex watching files (CVS)
+  Another way to achieve something similar to locking is to use the
+@dfn{watch} feature of CVS.  If a file is being watched, CVS makes it
+read-only by default, and you must also use @kbd{C-x v v} in Emacs to
+make it writable.  VC calls @code{cvs edit} to make the file writable,
+and CVS takes care to notify other developers of the fact that you
+intend to change the file.  See the CVS documentation for details on
+using the watch feature.
+
+@vindex vc-stay-local
+@vindex vc-cvs-stay-local
+@cindex remote repositories (CVS)
+  When a file's repository is on a remote machine, VC tries to keep
+network interactions to a minimum.  This is controlled by the variable
+@code{vc-cvs-stay-local}.  There is another variable,
+@code{vc-stay-local}, which enables the feature also for other back
+ends that support it, including CVS.  In the following, we will talk
+only about @code{vc-cvs-stay-local}, but everything applies to
+@code{vc-stay-local} as well.
+
+If @code{vc-cvs-stay-local} is @code{t} (the default), then VC uses
+only the entry in the local CVS subdirectory to determine the file's
+state (and possibly information returned by previous CVS commands).
+One consequence of this is that when you have modified a file, and
+somebody else has already checked in other changes to the file, you
+are not notified of it until you actually try to commit.  (But you can
+try to pick up any recent changes from the repository first, using
+@kbd{C-x v m @key{RET}},
+@iftex
+@pxref{Merging,,,emacs, the Emacs Manual}).
+@end iftex
+@ifnottex
+@pxref{Merging}).
+@end ifnottex
+
+  When @code{vc-cvs-stay-local} is @code{t}, VC also makes local
+version backups, so that simple diff and revert operations are
+completely local (@pxref{Version Backups}).
+
+  On the other hand, if you set @code{vc-cvs-stay-local} to @code{nil},
+then VC queries the remote repository @emph{before} it decides what to
+do in @code{vc-next-action} (@kbd{C-x v v}), just as it does for local
+repositories.  It also does not make any version backups.
+
+  You can also set @code{vc-cvs-stay-local} to a regular expression
+that is matched against the repository host name; VC then stays local
+only for repositories from hosts that match the pattern.
+
+@vindex vc-cvs-global-switches
+  You can specify additional command line options to pass to all CVS
+operations in the variable @code{vc-cvs-global-switches}.  These
+switches are inserted immediately after the @code{cvs} command, before
+the name of the operation to invoke.
+
+@ignore
+   arch-tag: 140b8629-4339-4b5e-9e50-72453e51615e
+@end ignore
--- a/man/xresmini.texi	Tue May 02 08:50:29 2006 +0000
+++ b/man/xresmini.texi	Wed May 10 20:42:41 2006 +0000
@@ -131,8 +131,8 @@
 @item @code{menuBar} (class @code{MenuBar})
 @cindex menu bar
 Give frames menu bars if @samp{on}; don't have menu bars if
-@samp{off}.  @xref{Lucid Resources}, and @ref{LessTif Resources}, for
-how to control the appearance of the menu bar if you have one.
+@samp{off}.  @xref{Lucid Resources}, for how to control the appearance
+of the menu bar if you have one.
 
 @item @code{pointerColor} (class @code{Foreground})
 Color of the mouse cursor.
@@ -296,7 +296,136 @@
 @node GTK resources
 @appendixsec GTK resources
 
-@c  Waiting for contents
+  The most common way to customize the GTK widgets Emacs uses (menus, dialogs
+tool bars and scroll bars) is by choosing an appropriate theme, for example
+with the GNOME theme selector.  You can also do Emacs specific customization
+by inserting GTK style directives in the file @file{~/.emacs.d/gtkrc}.  Some GTK
+themes ignore customizations in @file{~/.emacs.d/gtkrc} so not everything
+works with all themes.  To customize Emacs font, background, faces, etc., use
+the normal X resources (@pxref{Resources}).  We will present some examples of
+customizations here, but for a more detailed description, see the online manual.
+
+  The first example is just one line.  It changes the font on all GTK widgets
+to courier with size 12:
+
+@smallexample
+gtk-font-name = "courier 12"
+@end smallexample
+
+  The thing to note is that the font name is not an X font name, like
+-*-helvetica-medium-r-*--*-120-*-*-*-*-*-*, but a Pango font name.  A Pango
+font name is basically of the format "family style size", where the style
+is optional as in the case above.  A name with a style could be for example:
+
+@smallexample
+gtk-font-name = "helvetica bold 10"
+@end smallexample
+
+  To customize widgets you first define a style and then apply the style to
+the widgets.  Here is an example that sets the font for menus, but not
+for other widgets:
+
+@smallexample
+# @r{Define the style @samp{menufont}.}
+style "menufont"
+@{
+  font_name = "helvetica bold 14"  # This is a Pango font name
+@}
+
+# @r{Specify that widget type @samp{*emacs-menuitem*} uses @samp{menufont}.}
+widget "*emacs-menuitem*" style "menufont"
+@end smallexample
+
+The widget name in this example contains wildcards, so the style will be
+applied to all widgets that match "*emacs-menuitem*".  The widgets are
+named by the way they are contained, from the outer widget to the inner widget.
+So to apply the style "my_style" (not shown) with the full, absolute name, for
+the menubar and the scroll bar in Emacs we use:
+
+@smallexample
+widget "Emacs.pane.menubar" style "my_style"
+widget "Emacs.pane.emacs.verticalScrollBar" style "my_style"
+@end smallexample
+ 
+But to aoid having to type it all, wildcards are often used.  @samp{*}
+matches zero or more characters and @samp{?} matches one character.  So "*"
+matches all widgets.
+
+  Each widget has a class (for example GtkMenuItem) and a name (emacs-menuitem).
+You can assign styles by name or by class.  In this example we have used the
+class:
+
+@smallexample
+style "menufont"
+@{
+  font_name = "helvetica bold 14"
+@}
+
+widget_class "*GtkMenuBar" style "menufont"
+@end smallexample
+
+@noindent
+The names and classes for the GTK widgets Emacs uses are:
+
+@multitable {@code{verticalScrollbar plus}} {@code{GtkFileSelection} and some}
+@item @code{emacs-filedialog}
+@tab @code{GtkFileSelection}
+@item @code{emacs-dialog}
+@tab @code{GtkDialog}
+@item @code{Emacs}
+@tab @code{GtkWindow}
+@item @code{pane}
+@tab @code{GtkVHbox}
+@item @code{emacs}
+@tab @code{GtkFixed}
+@item @code{verticalScrollBar}
+@tab @code{GtkVScrollbar}
+@item @code{emacs-toolbar}
+@tab @code{GtkToolbar}
+@item @code{menubar}
+@tab @code{GtkMenuBar}
+@item @code{emacs-menuitem}
+@tab anything in menus
+@end multitable
+
+  GTK absolute names are quite strange when it comes to menus
+and dialogs.  The names do not start with @samp{Emacs}, as they are
+free-standing windows and not contained (in the GTK sense) by the
+Emacs GtkWindow.  To customize the dialogs and menus, use wildcards like this:
+
+@smallexample
+widget "*emacs-dialog*" style "my_dialog_style"
+widget "*emacs-filedialog* style "my_file_style"
+widget "*emacs-menuitem* style "my_menu_style"
+@end smallexample
+
+  If you specify a customization in @file{~/.emacs.d/gtkrc}, then it
+automatically applies only to Emacs, since other programs don't read
+that file.  For example, the drop down menu in the file dialog can not
+be customized by any absolute widget name, only by an absolute class
+name.  This is because the widgets in the drop down menu do not
+have names and the menu is not contained in the Emacs GtkWindow.  To
+have all menus in Emacs look the same, use this in
+@file{~/.emacs.d/gtkrc}:
+
+@smallexample
+widget_class "*Menu*" style "my_menu_style"
+@end smallexample
+
+  Here is a more elaborate example, showing how to change the parts of
+the scroll bar:
+
+@smallexample
+style "scroll"
+@{
+  fg[NORMAL] = "red"@ @ @ @ @ # @r{The arrow color.}
+  bg[NORMAL] = "yellow"@ @ # @r{The thumb and background around the arrow.}
+  bg[ACTIVE] = "blue"@ @ @ @ # @r{The trough color.}
+  bg[PRELIGHT] = "white"@ # @r{The thumb color when the mouse is over it.}
+@}
+
+widget "*verticalScrollBar*" style "scroll"
+@end smallexample
 
 @ignore
    arch-tag: e1856f29-2482-42c0-a990-233cdccd1f21
--- a/man/xresources.texi	Tue May 02 08:50:29 2006 +0000
+++ b/man/xresources.texi	Wed May 10 20:42:41 2006 +0000
@@ -585,7 +585,7 @@
 @cindex @file{~/.gtkrc-2.0} file
 @cindex @file{~/.emacs.d/gtkrc} file
 
-  If Emacs was built to use the GTK widget set, then the menu bar,
+  If Emacs was built to use the GTK widget set, then the menu bar, tool bar,
 scroll bar and the dialogs are customized with the standard GTK
 customization file, @file{~/.gtkrc-2.0}, or with the Emacs specific
 file @file{~/.emacs.d/gtkrc}.  We recommend that you use
@@ -603,13 +603,13 @@
 Emacs menus:
 
 @smallexample
-# @r{Define the style @samp{metafont}.}
+# @r{Define the style @samp{menufont}.}
 style "menufont"
 @{
   font_name = "helvetica bold 14"  # This is a Pango font name
 @}
 
-# @r{Specify that widget type @samp{*emacs-menuitem*} uses @samp{metafont}.}
+# @r{Specify that widget type @samp{*emacs-menuitem*} uses @samp{menufont}.}
 widget "*emacs-menuitem*" style "menufont"
 @end smallexample
 
--- a/src/.gdbinit	Tue May 02 08:50:29 2006 +0000
+++ b/src/.gdbinit	Wed May 10 20:42:41 2006 +0000
@@ -211,6 +211,7 @@
   printf "vpos=%d hpos=%d", $it->vpos, $it->hpos,
   printf " y=%d lvy=%d", $it->current_y, $it->last_visible_y
   printf " x=%d vx=%d-%d", $it->current_x, $it->first_visible_x, $it->last_visible_x
+  printf " w=%d", $it->pixel_width
   printf " a+d=%d+%d=%d", $it->ascent, $it->descent, $it->ascent+$it->descent
   printf " max=%d+%d=%d", $it->max_ascent, $it->max_descent, $it->max_ascent+$it->max_descent
   printf "\n"
@@ -544,6 +545,10 @@
 define xframe
   xgetptr $
   print (struct frame *) $ptr
+  xgetptr $->name
+  set $ptr = (struct Lisp_String *) $ptr
+  xprintstr $ptr
+  echo \n
 end
 document xframe
 Print $ as a frame pointer, assuming it is an Emacs Lisp frame value.
@@ -676,6 +681,31 @@
 Print the cdr of $, assuming it is an Emacs Lisp pair.
 end
 
+define xlist
+  xgetptr $
+  set $cons = (struct Lisp_Cons *) $ptr
+  xgetptr Qnil
+  set $nil = $ptr
+  set $i = 0
+  while $cons != $nil && $i < 10
+    p/x $cons->car
+    xpr
+    xgetptr $cons->u.cdr
+    set $cons = (struct Lisp_Cons *) $ptr
+    set $i = $i + 1
+    printf "---\n"
+  end
+  if $cons == $nil
+    printf "nil\n"
+  else
+    printf "...\n"
+    p $ptr
+  end
+end
+document xlist
+Print $ assuming it is a list.
+end
+
 define xfloat
   xgetptr $
   print ((struct Lisp_Float *) $ptr)->u.data
@@ -694,6 +724,108 @@
 Print $ as a scrollbar pointer.
 end
 
+define xpr
+  xtype
+  if $type == Lisp_Int
+    xint
+  end
+  if $type == Lisp_Symbol
+    xsymbol
+  end
+  if $type == Lisp_String
+    xstring
+  end
+  if $type == Lisp_Cons
+    xcons
+  end
+  if $type == Lisp_Float
+    xfloat
+  end
+  if $type == Lisp_Misc
+    set $misc = (enum Lisp_Misc_Type) (((struct Lisp_Free *) $ptr)->type)
+    if $misc == Lisp_Misc_Free
+      xmiscfree
+    end
+    if $misc == Lisp_Misc_Boolfwd
+      xboolfwd
+    end
+    if $misc == Lisp_Misc_Marker
+      xmarker
+    end
+    if $misc == Lisp_Misc_Intfwd
+      xintfwd
+    end
+    if $misc == Lisp_Misc_Boolfwd
+      xboolfwd
+    end
+    if $misc == Lisp_Misc_Objfwd
+      xobjfwd
+    end
+    if $misc == Lisp_Misc_Buffer_Objfwd
+      xbufobjfwd
+    end
+    if $misc == Lisp_Misc_Buffer_Local_Value
+      xbuflocal
+    end
+#    if $misc == Lisp_Misc_Some_Buffer_Local_Value
+#      xvalue
+#    end
+    if $misc == Lisp_Misc_Overlay
+      xoverlay
+    end
+    if $misc == Lisp_Misc_Kboard_Objfwd
+      xkbobjfwd
+    end
+#    if $misc == Lisp_Misc_Save_Value
+#      xsavevalue
+#    end
+  end
+  if $type == Lisp_Vectorlike
+    set $size = ((struct Lisp_Vector *) $ptr)->size
+    if ($size & PVEC_FLAG)
+      set $vec = (enum pvec_type) ($size & PVEC_TYPE_MASK)
+      if $vec == PVEC_NORMAL_VECTOR
+	xvector
+      end
+      if $vec == PVEC_PROCESS
+	xprocess
+      end
+      if $vec == PVEC_FRAME
+	xframe
+      end
+      if $vec == PVEC_COMPILED
+	xcompiled
+      end
+      if $vec == PVEC_WINDOW
+	xwindow
+      end
+      if $vec == PVEC_WINDOW_CONFIGURATION
+	xwinconfig
+      end
+      if $vec == PVEC_SUBR
+	xsubr
+      end
+      if $vec == PVEC_CHAR_TABLE
+	xchartable
+      end
+      if $vec == PVEC_BOOL_VECTOR
+	xboolvector
+      end
+      if $vec == PVEC_BUFFER
+	xbuffer
+      end
+      if $vec == PVEC_HASH_TABLE
+	xhashtable
+      end
+    else
+      xvector
+    end
+  end
+end
+document xpr
+Print $ as a lisp object of any type.
+end
+
 define xprintstr
   set $data = $arg0->data
   output ($arg0->size > 1000) ? 0 : ($data[0])@($arg0->size_byte < 0 ? $arg0->size & ~gdb_array_mark_flag : $arg0->size_byte)
@@ -739,7 +871,7 @@
     xgettype (*$bt->function)
     if $type == Lisp_Symbol
       xprintsym (*$bt->function)
-      echo \n
+      printf " (0x%x)\n", *$bt->args
     else
       printf "0x%x ", *$bt->function
       if $type == Lisp_Vectorlike
@@ -760,6 +892,27 @@
   an error was signaled.
 end
 
+define which
+  set debug_print (which_symbols ($arg0))
+end
+document which
+  Print symbols which references a given lisp object,
+  either as its symbol value or symbol function.
+end
+
+define xbytecode
+  set $bt = byte_stack_list
+  while $bt
+    xgettype ($bt->byte_string)
+    printf "0x%x => ", $bt->byte_string
+    which $bt->byte_string
+    set $bt = $bt->next
+  end
+end
+document xbytecode
+  Print a backtrace of the byte code stack.
+end
+
 # Show Lisp backtrace after normal backtrace.
 define hookpost-backtrace
   set $bt = backtrace_list
--- a/src/ChangeLog	Tue May 02 08:50:29 2006 +0000
+++ b/src/ChangeLog	Wed May 10 20:42:41 2006 +0000
@@ -1,3 +1,203 @@
+2006-05-10  Kenichi Handa  <handa@m17n.org>
+
+	* xfaces.c (realize_default_face) [HAVE_X_WINDOWS]: If the font
+	chosen for the default face was different from the frame font,
+	adjust the frame font.
+
+2006-05-10  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+	* image.c (Qduration) [MAC_OS]: Undo previous change.
+	(syms_of_image) [MAC_OS]: Likewise.
+	[MAC_OS] (gif_load): Emulate Graphic Control Extension block.
+
+	* macfns.c (x_to_mac_color): Fix shift amount change.
+	[USE_MAC_FONT_PANEL] (mac_set_font): Use x_get_focus_frame.
+	[USE_MAC_FONT_PANEL] (Fmac_set_font_panel_visibility): Doc fix.
+
+	* macselect.c (Vmac_service_selection) [MAC_OSX]: Rename from
+	Vmac_services_selection.  All uses changed.
+	(mac_store_service_event): Rename from mac_store_services_event in
+	extern and calls.
+
+	* macterm.c (Qservice) [MAC_OSX]: Rename from Qservices.  All uses
+	changed.
+	[MAC_OSX] (mac_store_service_event): Rename from
+	mac_store_services_event.  All callers changed.
+	[USE_MAC_FONT_PANEL] (mac_set_font_info_for_selection): Add args
+	FACE_ID and C.  All callers changed.
+	(x_free_frame_resources) [USE_MAC_FONT_PANEL]: Call
+	mac_set_font_info_for_selection when focus frame is destroyed.
+	(XTread_socket): Revert to FrontNonFloatingWindow/FrontWindow.
+
+	* macterm.h (mac_set_font_info_for_selection): Add 2nd and 3rd
+	args in extern.
+
+2006-05-09  Chong Yidong  <cyd@stupidchicken.com>
+
+	* keymap.c (describe_map): Avoid generating duplicate entries if
+	the shadowed binding has the same definition.
+
+2006-05-09  Kenichi Handa  <handa@m17n.org>
+
+	* keymap.c (push_key_description): Handle invalid character key.
+
+2006-05-08  Kenichi Handa  <handa@m17n.org>
+
+	* callproc.c (Fcall_process): Use system_eol_type for encoding
+	arguments if eol_type is not yet decided.
+
+	* coding.h (system_eol_type): Extern it.
+
+	* coding.c (setup_coding_system): For invalid coding-system, set
+	coding->eol_type to CODING_EOL_UNDECIDED.
+	(encode_coding): Cancel previous change.
+	(shrink_encoding_region): Likewise.
+	(code_convert_region1): Likewise.
+	(code_convert_string1): Likewise.
+	(code_convert_string_norecord): Likewise.
+
+	* fileio.c (choose_write_coding_system): Use system_eol_type for
+	encoding if eol_type is not yet decided.
+
+	* process.c (setup_process_coding_systems): Use system_eol_type
+	for encoding if eol_type is not yet decided.
+	(read_process_output): Likewise.
+	(send_process): Likewise.
+
+2006-05-07  Juanma Barranquero  <lekktu@gmail.com>
+
+	* minibuf.c (syms_of_minibuf) <history-length>: Fix typo in doc.
+
+2006-05-07  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+	* mac.c (Fmac_clear_font_name_table): Move defun to macfns.c.
+	(syms_of_mac): Likewise for defsubr.
+
+	* macfns.c (mac_set_font): New function.
+	(mac_frame_parm_handlers, syms_of_macfns): Replace x_set_font with it.
+	(mac_window) [TARGET_API_MAC_CARBON && MAC_OSX]: Specify
+	kWindowToolbarButtonAttribute when creating window.
+	(Fmac_clear_font_name_table): Move from macfns.c.
+	(syms_of_macfns): Likewise for defsubr.
+	[USE_MAC_FONT_PANEL] (Fmac_set_font_panel_visibility): New defun.
+	(syms_of_macfns) [USE_MAC_FONT_PANEL]: Defsubr it.
+
+	* macgui.h (USE_MAC_FONT_PANEL): Define to 1 if USE_ATSUI is set
+	and build is done on Mac OS X 10.2 and later.
+
+	* macselect.c (mac_do_receive_drag): Remove unused variable `index'.
+	(mac_store_services_event): Change return type in extern.
+
+	* macterm.c (XLoadQueryFont) [USE_ATSUI]: Set font->mac_fontnum to
+	FMFontFamily value.
+	[USE_MAC_FONT_PANEL] (mac_set_font_info_for_selection): New function.
+	(x_new_focus_frame) [USE_MAC_FONT_PANEL]: Use it.
+	(QCfamily, QCweight, QCslant, Qnormal, Qbold, Qitalic): Add extern.
+	(QWindow) [MAC_OSX]: Likewise.
+	(Qfont) [USE_MAC_FONT_PANEL]: Likewise.
+	(Vmac_atsu_font_table) [USE_ATSUI]: New variable.
+	(syms_of_macterm) [USE_ATSUI]: Defvar it.
+	(Qtoolbar_switch_mode) [MAC_OSX]: New variable.
+	(Qpanel_closed, Qselection) [USE_MAC_FONT_PANEL]: Likewise.
+	(syms_of_macterm): Intern and staticpro them.
+	(init_font_name_table) [USE_ATSUI]: Add data to Vmac_atsu_font_table.
+	[TARGET_API_MAC_CARBON] (mac_store_event_ref_as_apple_event): New
+	function.
+	[USE_CARBON_EVENTS] (mac_handle_command_event): Use it.
+	[MAC_OSX] (mac_store_services_event): Likewise.
+	[USE_CARBON_EVENTS] (mac_handle_window_event) [MAC_OSX]: Handle
+	kEventWindowToolbarSwitchMode event.
+	(install_window_handler) [USE_CARBON_EVENTS && MAC_OSX]: Register it.
+	[MAC_OSX] (mac_store_services_event): Change return type to OSStatus.
+	[USE_MAC_FONT_PANEL] (mac_handle_font_event): New function.
+	(install_window_handler) [USE_MAC_FONT_PANEL]: Install it.
+	(XTread_socket): Select window on mouse click if x_focus_frame is NULL.
+
+	* macterm.h (mac_set_font_info_for_selection): Add extern.
+
+2006-05-06  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+	* image.c (Qduration) [MAC_OS]: New variable.
+	(syms_of_image) [MAC_OS]: Intern and staticpro it.
+	[MAC_OS] (gif_load): Save image extension data in img->data.lisp_val.
+	[MAC_OSX] (image_load_quartz2d): Use cfstring_create_with_utf8_cstring
+	instead of cfstring_create_with_string.
+
+2006-05-06  Kim F. Storm  <storm@cua.dk>
+
+	* .gdbinit (xframe): Print frame name.
+	(xlist): New command to print a list (max 10 elements).
+	(xpr): Print lisp object of any type.
+	(pitx): Print it->pixel_width.
+
+2006-05-05  Kenichi Handa  <handa@m17n.org>
+
+	* xdisp.c (handle_composition_prop): Fix for the case of empty
+	composition component.
+
+2006-05-05  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+	* keyboard.c (make_lispy_event) [MAC_OS]: Get Apple event info
+	from event->arg.
+
+	* termhooks.h (enum event_kind) [MAC_OS]: Update comment for
+	MAC_APPLE_EVENT.
+
+	* macterm.h (mac_make_lispy_event_code): Remove extern.
+	(mac_post_mouse_moved_event): Add extern.
+	(mac_aelist_to_lisp, mac_aedesc_to_lisp): Change arg 1 to
+	`const AEDesc *' in externs.
+	(create_apple_event_from_drag_ref) [TARGET_API_MAC_CARBON]: New extern.
+
+	* mac.c (mac_aelist_to_lisp, mac_aedesc_to_lisp): Change arg 1 to
+	`const AEDesc *'.
+	[TARGET_API_MAC_CARBON] (create_apple_event): New function.
+	[TARGET_API_MAC_CARBON] (create_apple_event_from_event_ref): Use it.
+	Use xrealloc instead of repeated xmalloc/xfree.
+	[TARGET_API_MAC_CARBON] (create_apple_event_from_drag_ref): New
+	function.
+
+	* macmenu.c (restore_menu_items, cleanup_popup_menu): Return a value.
+
+	* macselect.c: Update copyright year.
+	(mac_store_apple_event): Change return type to void in extern.
+	(mac_handle_apple_event): Don't get return value from
+	mac_store_apple_event.
+	[TARGET_API_MAC_CARBON] (Vmac_dnd_known_types): New variable.
+	(syms_of_macselect) [TARGET_API_MAC_CARBON]: Defvar it.
+	[TARGET_API_MAC_CARBON] (mac_do_track_drag): Move function from
+	macterm.c.  Use Vmac_dnd_known_types as acceptable flavors.
+	[TARGET_API_MAC_CARBON] (mac_do_receive_drag): Likewise.  New
+	implementation using create_apple_event_from_drag_ref.
+	[TARGET_API_MAC_CARBON] (mac_do_track_dragUPP)
+	(mac_do_receive_dragUPP): Move variables from macterm.c.
+	(install_drag_handler, remove_drag_handler): New functions.
+
+	* macterm.c (XTread_socket) [TARGET_API_MAC_CARBON]: Try window
+	path select also for proxy icon click.
+	[TARGET_API_MAC_CARBON] (mac_post_mouse_moved_event): New function.
+	[USE_TOOLKIT_SCROLL_BARS] (scroll_bar_timer_callback): Use it.
+	(xlfdpat_create): Remove unused label `error' and trailing sentences.
+	(mac_do_track_drag, mac_do_receive_drag): Move functions to macselect.c.
+	(mac_do_track_dragUPP, mac_do_receive_dragUPP): Move variables to
+	macselect.c.
+	(install_drag_handler, remove_drag_handler): Add extern.
+	(mac_store_apple_event): Change return type to void.  All uses changed.
+	Create Lisp object from Apple event and store it into input event.
+	(mac_make_lispy_event_code): Remove function.
+	[TARGET_API_MAC_CARBON] (mac_store_drag_event): New function.
+	(install_window_handler): Call install_drag_handler.
+	(remove_window_handler): Call remove_drag_handler.
+
+2006-05-03  Richard Stallman  <rms@gnu.org>
+
+	* sound.c (Fplay_sound_internal): Dynamically allocate
+	current_sound_device and current_sound.
+	(sound_cleanup): Free them.
+
+	* minibuf.c (read_minibuf): Don't use read_minibuf_noninteractive
+	when inside a keyboard macro.
+
 2006-05-02  Andreas Schwab  <schwab@suse.de>
 
 	* xmenu.c (restore_menu_items): Return a value.
--- a/src/callproc.c	Tue May 02 08:50:29 2006 +0000
+++ b/src/callproc.c	Wed May 10 20:42:41 2006 +0000
@@ -295,6 +295,8 @@
 	      val = Qnil;
 	  }
 	setup_coding_system (Fcheck_coding_system (val), &argument_coding);
+	if (argument_coding.eol_type == CODING_EOL_UNDECIDED)
+	  argument_coding.eol_type = system_eol_type;
       }
   }
 
--- a/src/coding.h	Tue May 02 08:50:29 2006 +0000
+++ b/src/coding.h	Wed May 10 20:42:41 2006 +0000
@@ -717,6 +717,9 @@
 /* Mnemonic string to indicate type of end-of-line is not yet decided.  */
 extern Lisp_Object eol_mnemonic_undecided;
 
+/* Format of end-of-line decided by system.  */
+extern int system_eol_type;
+
 #ifdef emacs
 extern Lisp_Object Qfile_coding_system;
 extern Lisp_Object Qcall_process, Qcall_process_region;
--- a/src/image.c	Tue May 02 08:50:29 2006 +0000
+++ b/src/image.c	Wed May 10 20:42:41 2006 +0000
@@ -2628,7 +2628,7 @@
 	  UNGCPRO;
 	  return 0;
 	}
-      path = cfstring_create_with_string (file);
+      path = cfstring_create_with_utf8_cstring (SDATA (file));
       url = CFURLCreateWithFileSystemPath (NULL, path,
 					   kCFURLPOSIXPathStyle, 0);
       CFRelease (path);
@@ -7920,7 +7920,8 @@
   RGBColor bg_color;
   int width, height;
   XImagePtr ximg;
-  TimeValue time;
+  TimeScale time_scale;
+  TimeValue time, duration;
   int ino;
   CGrafPtr old_port;
   GDHandle old_gdh;
@@ -8028,6 +8029,7 @@
 		   image, img->spec);
       goto error;
     }
+  time_scale = GetMediaTimeScale (media);
 
   specified_bg = image_spec_value (img->spec, QCbackground, NULL);
   if (!STRINGP (specified_bg) ||
@@ -8053,7 +8055,7 @@
   SetGWorld (old_port, old_gdh);
   SetMovieActive (movie, 1);
   SetMovieGWorld (movie, ximg, NULL);
-  SampleNumToMediaTime (media, ino + 1, &time, NULL);
+  SampleNumToMediaTime (media, ino + 1, &time, &duration);
   SetMovieTimeValue (movie, time);
   MoviesTask (movie, 0L);
   DisposeTrackMedia (media);
@@ -8061,6 +8063,24 @@
   DisposeMovie (movie);
   if (dh)
     DisposeHandle (dh);
+
+  /* Save GIF image extension data for `image-extension-data'.
+     Format is (count IMAGES 0xf9 GRAPHIC_CONTROL_EXTENSION_BLOCK).  */
+  {
+    unsigned char gce[4];
+    int centisec = ((float)duration / time_scale) * 100.0f + 0.5f;
+
+    /* Fill the delay time field.  */
+    gce[1] = centisec & 0xff;
+    gce[2] = (centisec >> 8) & 0xff;
+    /* We don't know about other fields.  */
+    gce[0] = gce[3] = 0;
+
+    img->data.lisp_val = list4 (Qcount, make_number (nsamples),
+				make_number (0xf9),
+				make_unibyte_string (gce, 4));
+  }
+
   /* Maybe fill in the background field while we have ximg handy. */
   if (NILP (image_spec_value (img->spec, QCbackground, NULL)))
     IMAGE_BACKGROUND (img, f, ximg);
--- a/src/keyboard.c	Tue May 02 08:50:29 2006 +0000
+++ b/src/keyboard.c	Wed May 10 20:42:41 2006 +0000
@@ -5881,8 +5881,7 @@
 	spec[1] = event->y;
 	return Fcons (Qmac_apple_event,
 		      Fcons (Fvector (2, spec),
-			     Fcons (mac_make_lispy_event_code (event->code),
-				    Qnil)));
+			     Fcons (event->arg, Qnil)));
       }
 #endif
 
--- a/src/keymap.c	Tue May 02 08:50:29 2006 +0000
+++ b/src/keymap.c	Wed May 10 20:42:41 2006 +0000
@@ -2120,12 +2120,21 @@
      int force_multibyte;
 {
   unsigned c2;
+  int valid_p;
 
   /* Clear all the meaningless bits above the meta bit.  */
   c &= meta_modifier | ~ - meta_modifier;
   c2 = c & ~(alt_modifier | ctrl_modifier | hyper_modifier
 	     | meta_modifier | shift_modifier | super_modifier);
 
+  valid_p = SINGLE_BYTE_CHAR_P (c2) || char_valid_p (c2, 0);
+  if (! valid_p)
+    {
+      /* KEY_DESCRIPTION_SIZE is large enough for this.  */
+      p += sprintf (p, "[%d]", c);
+      return p;
+    }
+
   if (c & alt_modifier)
     {
       *p++ = 'A';
@@ -3310,7 +3319,9 @@
 	      tem = shadow_lookup (shadow, kludge, Qt);
 	      if (!NILP (tem))
 		{
-		  if (mention_shadow)
+		  /* Avoid generating duplicate entries if the
+		     shadowed binding has the same definition. */
+		  if (mention_shadow && !EQ (tem, definition))
 		    this_shadowed = 1;
 		  else
 		    continue;
--- a/src/mac.c	Tue May 02 08:50:29 2006 +0000
+++ b/src/mac.c	Wed May 10 20:42:41 2006 +0000
@@ -272,7 +272,7 @@
 
 static Lisp_Object
 mac_aelist_to_lisp (desc_list)
-     AEDescList *desc_list;
+     const AEDescList *desc_list;
 {
   OSErr err;
   long count;
@@ -337,7 +337,7 @@
 
 Lisp_Object
 mac_aedesc_to_lisp (desc)
-     AEDesc *desc;
+     const AEDesc *desc;
 {
   OSErr err = noErr;
   DescType desc_type = desc->descriptorType;
@@ -665,6 +665,31 @@
 }
 
 #if TARGET_API_MAC_CARBON
+static OSErr
+create_apple_event (class, id, result)
+     AEEventClass class;
+     AEEventID id;
+     AppleEvent *result;
+{
+  OSErr err;
+  static const ProcessSerialNumber psn = {0, kCurrentProcess};
+  AEAddressDesc address_desc;
+
+  err = AECreateDesc (typeProcessSerialNumber, &psn,
+		      sizeof (ProcessSerialNumber), &address_desc);
+  if (err == noErr)
+    {
+      err = AECreateAppleEvent (class, id,
+				&address_desc, /* NULL is not allowed
+						  on Mac OS Classic. */
+				kAutoGenerateReturnID,
+				kAnyTransactionID, result);
+      AEDisposeDesc (&address_desc);
+    }
+
+  return err;
+}
+
 OSErr
 create_apple_event_from_event_ref (event, num_params, names, types, result)
      EventRef event;
@@ -674,24 +699,12 @@
      AppleEvent *result;
 {
   OSErr err;
-  static const ProcessSerialNumber psn = {0, kCurrentProcess};
-  AEAddressDesc address_desc;
   UInt32 i, size;
   CFStringRef string;
   CFDataRef data;
-  char *buf;
-
-  err = AECreateDesc (typeProcessSerialNumber, &psn,
-		      sizeof (ProcessSerialNumber), &address_desc);
-  if (err == noErr)
-    {
-      err = AECreateAppleEvent (0, 0, /* Dummy class and ID.   */
-				&address_desc, /* NULL is not allowed
-						  on Mac OS Classic. */
-				kAutoGenerateReturnID,
-				kAnyTransactionID, result);
-      AEDisposeDesc (&address_desc);
-    }
+  char *buf = NULL;
+
+  err = create_apple_event (0, 0, result); /* Dummy class and ID.  */
   if (err != noErr)
     return err;
 
@@ -721,19 +734,88 @@
 				 0, &size, NULL);
 	if (err != noErr)
 	  break;
-	buf = xmalloc (size);
+	buf = xrealloc (buf, size);
 	err = GetEventParameter (event, names[i], types[i], NULL,
 				 size, NULL, buf);
 	if (err == noErr)
 	  AEPutParamPtr (result, names[i], types[i], buf, size);
-	xfree (buf);
 	break;
       }
+  if (buf)
+    xfree (buf);
 
   return noErr;
 }
-#endif
-
+
+OSErr
+create_apple_event_from_drag_ref (drag, num_types, types, result)
+     DragRef drag;
+     UInt32 num_types;
+     FlavorType *types;
+     AppleEvent *result;
+{
+  OSErr err;
+  UInt16 num_items;
+  AppleEvent items;
+  long index;
+  char *buf = NULL;
+
+  err = CountDragItems (drag, &num_items);
+  if (err != noErr)
+    return err;
+  err = AECreateList (NULL, 0, false, &items);
+  if (err != noErr)
+    return err;
+
+  for (index = 1; index <= num_items; index++)
+    {
+      ItemReference item;
+      DescType desc_type = typeNull;
+      Size size;
+
+      err = GetDragItemReferenceNumber (drag, index, &item);
+      if (err == noErr)
+	{
+	  int i;
+
+	  for (i = 0; i < num_types; i++)
+	    {
+	      err = GetFlavorDataSize (drag, item, types[i], &size);
+	      if (err == noErr)
+		{
+		  buf = xrealloc (buf, size);
+		  err = GetFlavorData (drag, item, types[i], buf, &size, 0);
+		}
+	      if (err == noErr)
+		{
+		  desc_type = types[i];
+		  break;
+		}
+	    }
+	}
+      err = AEPutPtr (&items, index, desc_type,
+		      desc_type != typeNull ? buf : NULL,
+		      desc_type != typeNull ? size : 0);
+      if (err != noErr)
+	break;
+    }
+  if (buf)
+    xfree (buf);
+
+  if (err == noErr)
+    {
+      err = create_apple_event (0, 0, result); /* Dummy class and ID.  */
+      if (err == noErr)
+	err = AEPutParamDesc (result, keyDirectObject, &items);
+      if (err != noErr)
+	AEDisposeDesc (result);
+    }
+
+  AEDisposeDesc (&items);
+
+  return err;
+}
+#endif	/* TARGET_API_MAC_CARBON */
 
 /***********************************************************************
 	 Conversion between Lisp and Core Foundation objects
@@ -4686,16 +4768,6 @@
 #endif	/* TARGET_API_MAC_CARBON */
 
 
-DEFUN ("mac-clear-font-name-table", Fmac_clear_font_name_table, Smac_clear_font_name_table, 0, 0, 0,
-       doc: /* Clear the font name table.  */)
-     ()
-{
-  check_mac ();
-  mac_clear_font_name_table ();
-  return Qnil;
-}
-
-
 static Lisp_Object
 mac_get_system_locale ()
 {
@@ -5167,7 +5239,6 @@
   defsubr (&Smac_get_preference);
   defsubr (&Smac_code_convert_string);
 #endif
-  defsubr (&Smac_clear_font_name_table);
 
   defsubr (&Smac_set_file_creator);
   defsubr (&Smac_set_file_type);
--- a/src/macfns.c	Tue May 02 08:50:29 2006 +0000
+++ b/src/macfns.c	Wed May 10 20:42:41 2006 +0000
@@ -1091,7 +1091,7 @@
       char *color;
       unsigned long colorval;
       int i, pos;
-      pos = 0;
+      pos = 16;
 
       colorval = 0;
       color = colorname + 4;
@@ -1127,7 +1127,7 @@
 	  if (value == ULONG_MAX)
 	    break;
 	  colorval |= (value << pos);
-	  pos += 0x8;
+	  pos -= 0x8;
 	  if (i == 2)
 	    {
 	      if (*end != '\0')
@@ -1146,7 +1146,7 @@
       char *color;
       unsigned long colorval;
       int i, pos;
-      pos = 0;
+      pos = 16;
 
       colorval = 0;
       color = colorname + 5;
@@ -1168,7 +1168,7 @@
 	  if (val == 0x100)
 	    val = 0xFF;
 	  colorval |= (val << pos);
-	  pos += 0x8;
+	  pos -= 0x8;
 	  if (i == 2)
 	    {
 	      if (*end != '\0')
@@ -1919,6 +1919,27 @@
   x_set_scroll_bar_width (f, arg, oldval);
 }
 
+static void
+mac_set_font (f, arg, oldval)
+     struct frame *f;
+     Lisp_Object arg, oldval;
+{
+  x_set_font (f, arg, oldval);
+#if USE_MAC_FONT_PANEL
+  {
+    Lisp_Object focus_frame = x_get_focus_frame (f);
+
+    if ((NILP (focus_frame) && f == SELECTED_FRAME ())
+	|| XFRAME (focus_frame) == f)
+      {
+	BLOCK_INPUT;
+	mac_set_font_info_for_selection (f, DEFAULT_FACE_ID, 0);
+	UNBLOCK_INPUT;
+      }
+  }
+#endif
+}
+
 #if TARGET_API_MAC_CARBON
 static void
 mac_update_proxy_icon (f)
@@ -2213,8 +2234,10 @@
 #if TARGET_API_MAC_CARBON
   CreateNewWindow (kDocumentWindowClass,
 		   kWindowStandardDocumentAttributes
-		   /* | kWindowToolbarButtonAttribute */,
-		   &r, &FRAME_MAC_WINDOW (f));
+#ifdef MAC_OSX
+		   | kWindowToolbarButtonAttribute
+#endif
+		   , &r, &FRAME_MAC_WINDOW (f));
   if (FRAME_MAC_WINDOW (f))
     {
       SetWRefCon (FRAME_MAC_WINDOW (f), (long) f->output_data.mac);
@@ -4469,6 +4492,43 @@
 #endif
 
 /***********************************************************************
+				Fonts
+ ***********************************************************************/
+
+DEFUN ("mac-clear-font-name-table", Fmac_clear_font_name_table,
+       Smac_clear_font_name_table, 0, 0, 0,
+       doc: /* Clear the font name table.  */)
+     ()
+{
+  check_mac ();
+  mac_clear_font_name_table ();
+  return Qnil;
+}
+
+#if USE_MAC_FONT_PANEL
+DEFUN ("mac-set-font-panel-visibility", Fmac_set_font_panel_visibility,
+       Smac_set_font_panel_visibility, 1, 1, 0,
+  doc: /* Make the font panel visible if and only if VISIBLE is non-nil.
+This is for internal use only.  Use `mac-font-panel-mode' instead.  */)
+     (visible)
+     Lisp_Object visible;
+{
+  OSStatus err = noErr;
+
+  check_mac ();
+
+  BLOCK_INPUT;
+  if (NILP (visible) == (FPIsFontPanelVisible () == true))
+    err = FPShowHideFontPanel ();
+  UNBLOCK_INPUT;
+
+  if (err != noErr)
+    error ("Cannot change visibility of the font panel");
+  return Qnil;
+}
+#endif
+
+/***********************************************************************
 			    Initialization
  ***********************************************************************/
 
@@ -4484,7 +4544,7 @@
   x_set_border_width,
   x_set_cursor_color,
   x_set_cursor_type,
-  x_set_font,
+  mac_set_font,
   x_set_foreground_color,
   x_set_icon_name,
   0, /* MAC_TODO: x_set_icon_type, */
@@ -4660,7 +4720,7 @@
   load_font_func = x_load_font;
   find_ccl_program_func = x_find_ccl_program;
   query_font_func = x_query_font;
-  set_frame_fontset_func = x_set_font;
+  set_frame_fontset_func = mac_set_font;
   check_window_system_func = check_mac;
 
   hourglass_atimer = NULL;
@@ -4679,6 +4739,10 @@
 #if TARGET_API_MAC_CARBON
   defsubr (&Sx_file_dialog);
 #endif
+  defsubr (&Smac_clear_font_name_table);
+#if USE_MAC_FONT_PANEL
+  defsubr (&Smac_set_font_panel_visibility);
+#endif
 }
 
 /* arch-tag: d7591289-f374-4377-b245-12f5dbbb8edc
--- a/src/macgui.h	Tue May 02 08:50:29 2006 +0000
+++ b/src/macgui.h	Wed May 10 20:42:41 2006 +0000
@@ -105,6 +105,13 @@
 #endif
 #endif
 
+/* Whether to use the standard Font Panel floating dialog.  */
+#ifndef USE_MAC_FONT_PANEL
+#if USE_ATSUI && MAC_OS_X_VERSION_MAX_ALLOWED >= 1020
+#define USE_MAC_FONT_PANEL 1
+#endif
+#endif
+
 typedef WindowPtr Window;
 typedef GWorldPtr Pixmap;
 
--- a/src/macmenu.c	Tue May 02 08:50:29 2006 +0000
+++ b/src/macmenu.c	Wed May 10 20:42:41 2006 +0000
@@ -318,6 +318,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.
@@ -634,6 +635,7 @@
      Lisp_Object arg;
 {
   discard_menu_items ();
+  return Qnil;
 }
 
 DEFUN ("x-popup-menu", Fx_popup_menu, Sx_popup_menu, 2, 2, 0,
--- a/src/macselect.c	Tue May 02 08:50:29 2006 +0000
+++ b/src/macselect.c	Wed May 10 20:42:41 2006 +0000
@@ -1,5 +1,5 @@
 /* Selection processing for Emacs on Mac OS.
-   Copyright (C) 2005 Free Software Foundation, Inc.
+   Copyright (C) 2005, 2006 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -101,7 +101,7 @@
 
 #ifdef MAC_OSX
 /* Selection name for communication via Services menu.  */
-static Lisp_Object Vmac_services_selection;
+static Lisp_Object Vmac_service_selection;
 #endif
 
 /* Get a reference to the scrap corresponding to the symbol SYM.  The
@@ -918,8 +918,8 @@
   int size, count;
 } deferred_apple_events;
 extern Lisp_Object Qundefined;
-extern OSErr mac_store_apple_event P_ ((Lisp_Object, Lisp_Object,
-					const AEDesc *));
+extern void mac_store_apple_event P_ ((Lisp_Object, Lisp_Object,
+				       const AEDesc *));
 
 struct apple_event_binding
 {
@@ -1079,9 +1079,8 @@
 	{
 	  if (INTEGERP (binding))
 	    return XINT (binding);
-	  err = mac_store_apple_event (class_key, id_key, apple_event);
-	  if (err == noErr)
-	    return noErr;
+	  mac_store_apple_event (class_key, id_key, apple_event);
+	  return noErr;
 	}
     }
   return errAEEventNotHandled;
@@ -1146,6 +1145,198 @@
 }
 
 
+#if TARGET_API_MAC_CARBON
+static Lisp_Object Vmac_dnd_known_types;
+static pascal OSErr mac_do_track_drag P_ ((DragTrackingMessage, WindowRef,
+					   void *, DragRef));
+static pascal OSErr mac_do_receive_drag P_ ((WindowRef, void *, DragRef));
+static DragTrackingHandlerUPP mac_do_track_dragUPP = NULL;
+static DragReceiveHandlerUPP mac_do_receive_dragUPP = NULL;
+
+extern void mac_store_drag_event P_ ((WindowRef, Point, SInt16,
+				      const AEDesc *));
+
+static pascal OSErr
+mac_do_track_drag (message, window, refcon, drag)
+     DragTrackingMessage message;
+     WindowRef window;
+     void *refcon;
+     DragRef drag;
+{
+  OSErr err = noErr;
+  static int can_accept;
+  UInt16 num_items, index;
+
+  if (GetFrontWindowOfClass (kMovableModalWindowClass, false))
+    return dragNotAcceptedErr;
+
+  switch (message)
+    {
+    case kDragTrackingEnterHandler:
+      err = CountDragItems (drag, &num_items);
+      if (err != noErr)
+	break;
+      can_accept = 0;
+      for (index = 1; index <= num_items; index++)
+	{
+	  ItemReference item;
+	  FlavorFlags flags;
+	  Lisp_Object rest;
+
+	  err = GetDragItemReferenceNumber (drag, index, &item);
+	  if (err != noErr)
+	    continue;
+	  for (rest = Vmac_dnd_known_types; CONSP (rest); rest = XCDR (rest))
+	    {
+	      Lisp_Object str;
+	      FlavorType type;
+
+	      str = XCAR (rest);
+	      if (!(STRINGP (str) && SBYTES (str) == 4))
+		continue;
+	      type = EndianU32_BtoN (*((UInt32 *) SDATA (str)));
+
+	      err = GetFlavorFlags (drag, item, type, &flags);
+	      if (err == noErr)
+		{
+		  can_accept = 1;
+		  break;
+		}
+	    }
+	}
+      break;
+
+    case kDragTrackingEnterWindow:
+      if (can_accept)
+	{
+	  RgnHandle hilite_rgn = NewRgn ();
+
+	  if (hilite_rgn)
+	    {
+	      Rect r;
+
+	      GetWindowPortBounds (window, &r);
+	      OffsetRect (&r, -r.left, -r.top);
+	      RectRgn (hilite_rgn, &r);
+	      ShowDragHilite (drag, hilite_rgn, true);
+	      DisposeRgn (hilite_rgn);
+	    }
+	  SetThemeCursor (kThemeCopyArrowCursor);
+	}
+      break;
+
+    case kDragTrackingInWindow:
+      break;
+
+    case kDragTrackingLeaveWindow:
+      if (can_accept)
+	{
+	  HideDragHilite (drag);
+	  SetThemeCursor (kThemeArrowCursor);
+	}
+      break;
+
+    case kDragTrackingLeaveHandler:
+      break;
+    }
+
+  if (err != noErr)
+    return dragNotAcceptedErr;
+  return noErr;
+}
+
+static pascal OSErr
+mac_do_receive_drag (window, refcon, drag)
+     WindowRef window;
+     void *refcon;
+     DragRef drag;
+{
+  OSErr err;
+  int num_types, i;
+  Lisp_Object rest, str;
+  FlavorType *types;
+  AppleEvent apple_event;
+  Point mouse_pos;
+  SInt16 modifiers;
+
+  if (GetFrontWindowOfClass (kMovableModalWindowClass, false))
+    return dragNotAcceptedErr;
+
+  num_types = 0;
+  for (rest = Vmac_dnd_known_types; CONSP (rest); rest = XCDR (rest))
+    {
+      str = XCAR (rest);
+      if (STRINGP (str) && SBYTES (str) == 4)
+	num_types++;
+    }
+
+  types = xmalloc (sizeof (FlavorType) * num_types);
+  i = 0;
+  for (rest = Vmac_dnd_known_types; CONSP (rest); rest = XCDR (rest))
+    {
+      str = XCAR (rest);
+      if (STRINGP (str) && SBYTES (str) == 4)
+	types[i++] = EndianU32_BtoN (*((UInt32 *) SDATA (str)));
+    }
+
+  err = create_apple_event_from_drag_ref (drag, num_types, types,
+					  &apple_event);
+  xfree (types);
+
+  if (err == noErr)
+    err = GetDragMouse (drag, &mouse_pos, NULL);
+  if (err == noErr)
+    {
+      GlobalToLocal (&mouse_pos);
+      err = GetDragModifiers (drag, NULL, NULL, &modifiers);
+    }
+
+  if (err == noErr)
+    {
+      mac_store_drag_event (window, mouse_pos, modifiers, &apple_event);
+      AEDisposeDesc (&apple_event);
+      /* Post a harmless event so as to wake up from ReceiveNextEvent.  */
+      mac_post_mouse_moved_event ();
+      return noErr;
+    }
+  else
+    return dragNotAcceptedErr;
+}
+#endif	/* TARGET_API_MAC_CARBON */
+
+OSErr
+install_drag_handler (window)
+     WindowRef window;
+{
+  OSErr err = noErr;
+
+#if TARGET_API_MAC_CARBON
+  if (mac_do_track_dragUPP == NULL)
+    mac_do_track_dragUPP = NewDragTrackingHandlerUPP (mac_do_track_drag);
+  if (mac_do_receive_dragUPP == NULL)
+    mac_do_receive_dragUPP = NewDragReceiveHandlerUPP (mac_do_receive_drag);
+
+  err = InstallTrackingHandler (mac_do_track_dragUPP, window, NULL);
+  if (err == noErr)
+    err = InstallReceiveHandler (mac_do_receive_dragUPP, window, NULL);
+#endif
+
+  return err;
+}
+
+void
+remove_drag_handler (window)
+     WindowRef window;
+{
+#if TARGET_API_MAC_CARBON
+  if (mac_do_track_dragUPP)
+    RemoveTrackingHandler (mac_do_track_dragUPP, window);
+  if (mac_do_receive_dragUPP)
+    RemoveReceiveHandler (mac_do_receive_dragUPP, window);
+#endif
+}
+
+
 #ifdef MAC_OSX
 void
 init_service_handler ()
@@ -1158,7 +1349,7 @@
 				  GetEventTypeCount (specs), specs, NULL, NULL);
 }
 
-extern OSErr mac_store_services_event P_ ((EventRef));
+extern OSStatus mac_store_service_event P_ ((EventRef));
 
 static OSStatus
 copy_scrap_flavor_data (from_scrap, to_scrap, flavor_type)
@@ -1215,12 +1406,12 @@
   Lisp_Object rest;
   ScrapFlavorType flavor_type;
 
-  /* Check if Vmac_services_selection is a valid selection that has a
+  /* Check if Vmac_service_selection is a valid selection that has a
      corresponding scrap.  */
-  if (!SYMBOLP (Vmac_services_selection))
+  if (!SYMBOLP (Vmac_service_selection))
     err = eventNotHandledErr;
   else
-    err = get_scrap_from_symbol (Vmac_services_selection, 0, &cur_scrap);
+    err = get_scrap_from_symbol (Vmac_service_selection, 0, &cur_scrap);
   if (!(err == noErr && cur_scrap))
     return eventNotHandledErr;
 
@@ -1257,7 +1448,7 @@
       if (err != noErr)
 	break;
 
-      if (NILP (Fx_selection_owner_p (Vmac_services_selection)))
+      if (NILP (Fx_selection_owner_p (Vmac_service_selection)))
 	break;
       else
 	goto copy_all_flavors;
@@ -1267,7 +1458,7 @@
 			       typeScrapRef, NULL,
 			       sizeof (ScrapRef), NULL, &specific_scrap);
       if (err != noErr
-	  || NILP (Fx_selection_owner_p (Vmac_services_selection)))
+	  || NILP (Fx_selection_owner_p (Vmac_service_selection)))
 	{
 	  err = eventNotHandledErr;
 	  break;
@@ -1342,7 +1533,7 @@
 	if (!data_exists_p)
 	  err = eventNotHandledErr;
 	else
-	  err = mac_store_services_event (event);
+	  err = mac_store_service_event (event);
       }
       break;
     }
@@ -1408,10 +1599,21 @@
 	       doc: /* Keymap for Apple events handled by Emacs.  */);
   Vmac_apple_event_map = Qnil;
 
+#if TARGET_API_MAC_CARBON
+  DEFVAR_LISP ("mac-dnd-known-types", &Vmac_dnd_known_types,
+	       doc: /* The types accepted by default for dropped data.
+The types are chosen in the order they appear in the list.  */);
+  Vmac_dnd_known_types = list4 (build_string ("hfs "), build_string ("utxt"),
+				build_string ("TEXT"), build_string ("TIFF"));
 #ifdef MAC_OSX
-  DEFVAR_LISP ("mac-services-selection", &Vmac_services_selection,
+  Vmac_dnd_known_types = Fcons (build_string ("furl"), Vmac_dnd_known_types);
+#endif
+#endif
+
+#ifdef MAC_OSX
+  DEFVAR_LISP ("mac-service-selection", &Vmac_service_selection,
 	       doc: /* Selection name for communication via Services menu.  */);
-  Vmac_services_selection = intern ("PRIMARY");
+  Vmac_service_selection = intern ("PRIMARY");
 #endif
 
   QPRIMARY   = intern ("PRIMARY");	staticpro (&QPRIMARY);
--- a/src/macterm.c	Tue May 02 08:50:29 2006 +0000
+++ b/src/macterm.c	Wed May 10 20:42:41 2006 +0000
@@ -4099,6 +4099,11 @@
 	pending_autoraise_frame = dpyinfo->x_focus_frame;
       else
 	pending_autoraise_frame = 0;
+
+#if USE_MAC_FONT_PANEL
+      if (frame)
+	mac_set_font_info_for_selection (frame, DEFAULT_FACE_ID, 0);
+#endif
     }
 
   x_frame_rehighlight (dpyinfo);
@@ -4456,35 +4461,11 @@
      EventLoopTimerRef timer;
      void *data;
 {
-  EventRef event = NULL;
-  OSErr err;
-
-  err = CreateEvent (NULL, kEventClassMouse, kEventMouseMoved, 0,
-		     kEventAttributeNone, &event);
-  if (err == noErr)
-    {
-      Point mouse_pos;
-
-      GetMouse (&mouse_pos);
-      LocalToGlobal (&mouse_pos);
-      err = SetEventParameter (event, kEventParamMouseLocation, typeQDPoint,
-			       sizeof (Point), &mouse_pos);
-    }
-  if (err == noErr)
-    {
-      UInt32 modifiers = GetCurrentKeyModifiers ();
-
-      err = SetEventParameter (event, kEventParamKeyModifiers, typeUInt32,
-			       sizeof (UInt32), &modifiers);
-    }
-  if (err == noErr)
-    err = PostEventToQueue (GetCurrentEventQueue (), event,
-			    kEventPriorityStandard);
+  OSStatus err;
+
+  err = mac_post_mouse_moved_event ();
   if (err == noErr)
     scroll_bar_timer_event_posted_p = 1;
-
-  if (event)
-    ReleaseEvent (event);
 }
 
 static OSStatus
@@ -6386,7 +6367,12 @@
   f->output_data.mac = NULL;
 
   if (f == dpyinfo->x_focus_frame)
-    dpyinfo->x_focus_frame = 0;
+    {
+      dpyinfo->x_focus_frame = 0;
+#if USE_MAC_FONT_PANEL
+      mac_set_font_info_for_selection (NULL, DEFAULT_FACE_ID, 0);
+#endif
+    }
   if (f == dpyinfo->x_focus_event_frame)
     dpyinfo->x_focus_event_frame = 0;
   if (f == dpyinfo->x_highlight_frame)
@@ -6742,10 +6728,6 @@
       }
 
   return pat;
-
- error:
-  xlfdpat_destroy (pat);
-  return NULL;
 }
 
 static INLINE int
@@ -6914,6 +6896,8 @@
 #if USE_ATSUI
 /* Hash table linking font family names to ATSU font IDs.  */
 static Lisp_Object atsu_font_id_hash;
+static Lisp_Object Vmac_atsu_font_table;
+extern Lisp_Object QCfamily, QCweight, QCslant, Qnormal, Qbold, Qitalic;
 #endif
 
 /* Alist linking character set strings to Mac text encoding and Emacs
@@ -7209,8 +7193,21 @@
 				    NULL, NULL);
 	    if (err == noErr)
 	      {
+		FMFontFamily ff;
+		FMFontStyle style = normal;
+
 		decode_mac_font_name (name, name_len + 1, Qnil);
 		family = make_unibyte_string (name, name_len);
+		FMGetFontFamilyInstanceFromFont (font_ids[i], &ff, &style);
+		Fputhash (make_unibyte_string ((char *)(font_ids + i),
+					       sizeof (ATSUFontID)),
+			  Fcons (QCfamily,
+				 list5 (family,
+					QCweight,
+					style & bold ? Qbold : Qnormal,
+					QCslant,
+					style & italic ? Qitalic : Qnormal)),
+			  Vmac_atsu_font_table);
 		if (*name != '.'
 		    && hash_lookup (h, family, &hash_code) < 0)
 		  {
@@ -7756,6 +7753,7 @@
       ATSUFontFeatureSelector selectors[] = {kAllTypeFeaturesOffSelector,
 					     kDecomposeDiacriticsSelector};
       Lisp_Object font_id_cons;
+      FMFontStyle style;
 
       font_id_cons = Fgethash (make_unibyte_string (family, strlen (family)),
 			       atsu_font_id_hash, Qnil);
@@ -7774,7 +7772,11 @@
 	return NULL;
       err = ATSUSetAttributes (mac_style, sizeof (tags) / sizeof (tags[0]),
 			       tags, sizes, values);
-      fontnum = -1;
+      if (err != noErr)
+	return NULL;
+      err = FMGetFontFamilyInstanceFromFont (font_id, &fontnum, &style);
+      if (err != noErr)
+	fontnum = -1;
       scriptcode = kTextEncodingMacUnicode;
     }
   else
@@ -7834,22 +7836,20 @@
       pcm_init (font->bounds.rows[0], 0x100);
 
 #if USE_CG_TEXT_DRAWING
-      {
-	FMFontFamily font_family;
-	FMFontStyle style;
-	ATSFontRef ats_font;
-
-	err = FMGetFontFamilyInstanceFromFont (font_id, &font_family, &style);
-	if (err == noErr)
-	  err = FMGetFontFromFontFamilyInstance (font_family, fontface,
+      if (fontnum != -1)
+	{
+	  FMFontStyle style;
+	  ATSFontRef ats_font;
+
+	  err = FMGetFontFromFontFamilyInstance (fontnum, fontface,
 						 &font_id, &style);
-	/* Use CG text drawing if italic/bold is not synthesized.  */
-	if (err == noErr && style == fontface)
-	  {
-	    ats_font = FMGetATSFontRefFromFont (font_id);
-	    font->cg_font = CGFontCreateWithPlatformFont (&ats_font);
-	  }
-      }
+	  /* Use CG text drawing if italic/bold is not synthesized.  */
+	  if (err == noErr && style == fontface)
+	    {
+	      ats_font = FMGetATSFontRefFromFont (font_id);
+	      font->cg_font = CGFontCreateWithPlatformFont (&ats_font);
+	    }
+	}
 
       if (font->cg_font)
 	{
@@ -8340,6 +8340,55 @@
     }
 }
 
+#if USE_MAC_FONT_PANEL
+OSStatus
+mac_set_font_info_for_selection (f, face_id, c)
+     struct frame *f;
+     int face_id, c;
+{
+  OSStatus err;
+  EventTargetRef target = NULL;
+  XFontStruct *font = NULL;
+
+  if (f)
+    {
+      target = GetWindowEventTarget (FRAME_MAC_WINDOW (f));
+
+      if (FRAME_FACE_CACHE (f) && CHAR_VALID_P (c, 0))
+	{
+	  struct face *face;
+
+	  face_id = FACE_FOR_CHAR (f, FACE_FROM_ID (f, face_id), c);
+	  face = FACE_FROM_ID (f, face_id);
+	  font = face->font;
+	}
+    }
+
+  if (font == NULL)
+    err = SetFontInfoForSelection (kFontSelectionATSUIType, 0, NULL, target);
+  else
+    {
+      if (font->mac_fontnum != -1)
+	{
+	  FontSelectionQDStyle qd_style;
+
+	  qd_style.version = kFontSelectionQDStyleVersionZero;
+	  qd_style.instance.fontFamily = font->mac_fontnum;
+	  qd_style.instance.fontStyle = font->mac_fontface;
+	  qd_style.size = font->mac_fontsize;
+	  qd_style.hasColor = false;
+
+	  err = SetFontInfoForSelection (kFontSelectionQDType,
+					 1, &qd_style, target);
+	}
+      else
+	err = SetFontInfoForSelection (kFontSelectionATSUIType,
+				       1, &font->mac_style, target);
+    }
+
+  return err;
+}
+#endif
 
 
 /* The Mac Event loop code */
@@ -8427,6 +8476,14 @@
 /* Apple Events */
 #if USE_CARBON_EVENTS
 static Lisp_Object Qhicommand;
+#ifdef MAC_OSX
+extern Lisp_Object Qwindow;
+static Lisp_Object Qtoolbar_switch_mode;
+#endif
+#if USE_MAC_FONT_PANEL
+extern Lisp_Object Qfont;
+static Lisp_Object Qpanel_closed, Qselection;
+#endif
 #endif
 extern int mac_ready_for_apple_events;
 extern Lisp_Object Qundefined;
@@ -8436,18 +8493,14 @@
 					   Lisp_Object *));
 extern OSErr init_coercion_handler P_ ((void));
 
-#if TARGET_API_MAC_CARBON
 /* Drag and Drop */
-static pascal OSErr mac_do_track_drag (DragTrackingMessage, WindowPtr, void*, DragReference);
-static pascal OSErr mac_do_receive_drag (WindowPtr, void*, DragReference);
-static DragTrackingHandlerUPP mac_do_track_dragUPP = NULL;
-static DragReceiveHandlerUPP mac_do_receive_dragUPP = NULL;
-#endif
+OSErr install_drag_handler P_ ((WindowRef));
+void remove_drag_handler P_ ((WindowRef));
 
 #if USE_CARBON_EVENTS
 #ifdef MAC_OSX
 extern void init_service_handler ();
-static Lisp_Object Qservices, Qpaste, Qperform;
+static Lisp_Object Qservice, Qpaste, Qperform;
 #endif
 /* Window Event Handler */
 static pascal OSStatus mac_handle_window_event (EventHandlerCallRef,
@@ -8998,47 +9051,84 @@
   x_real_positions (f, &f->left_pos, &f->top_pos);
 }
 
-OSErr
+void
 mac_store_apple_event (class, id, desc)
      Lisp_Object class, id;
      const AEDesc *desc;
 {
-  OSErr err;
   struct input_event buf;
-  AEDesc *desc_copy;
-
-  desc_copy = xmalloc (sizeof (AEDesc));
-  err = AEDuplicateDesc (desc, desc_copy);
-  if (err == noErr)
-    {
-      EVENT_INIT (buf);
-
-      buf.kind = MAC_APPLE_EVENT;
-      buf.x = class;
-      buf.y = id;
-      buf.code = (int)desc_copy;
-      XSETFRAME (buf.frame_or_window,
-		 mac_focus_frame (&one_mac_display_info));
-      buf.arg = Qnil;
-      kbd_buffer_store_event (&buf);
+
+  EVENT_INIT (buf);
+
+  buf.kind = MAC_APPLE_EVENT;
+  buf.x = class;
+  buf.y = id;
+  XSETFRAME (buf.frame_or_window,
+	     mac_focus_frame (&one_mac_display_info));
+  /* Now that Lisp object allocations are protected by BLOCK_INPUT, it
+     is safe to use them during read_socket_hook.  */
+  buf.arg = mac_aedesc_to_lisp (desc);
+  kbd_buffer_store_event (&buf);
+}
+
+#if TARGET_API_MAC_CARBON
+static OSStatus
+mac_store_event_ref_as_apple_event (class, id, class_key, id_key,
+				    event, num_params, names, types)
+     AEEventClass class;
+     AEEventID id;
+     Lisp_Object class_key, id_key;
+     EventRef event;
+     UInt32 num_params;
+     EventParamName *names;
+     EventParamType *types;
+{
+  OSStatus err = eventNotHandledErr;
+  Lisp_Object binding;
+
+  mac_find_apple_event_spec (class, id, &class_key, &id_key, &binding);
+  if (!NILP (binding) && !EQ (binding, Qundefined))
+    {
+      if (INTEGERP (binding))
+	err = XINT (binding);
+      else
+	{
+	  AppleEvent apple_event;
+	  err = create_apple_event_from_event_ref (event, num_params,
+						   names, types,
+						   &apple_event);
+	  if (err == noErr)
+	    {
+	      mac_store_apple_event (class_key, id_key, &apple_event);
+	      AEDisposeDesc (&apple_event);
+	    }
+	}
     }
 
   return err;
 }
 
-Lisp_Object
-mac_make_lispy_event_code (code)
-     int code;
-{
-  AEDesc *desc = (AEDesc *)code;
-  Lisp_Object obj;
-
-  obj = mac_aedesc_to_lisp (desc);
-  AEDisposeDesc (desc);
-  xfree (desc);
-
-  return obj;
-}
+void
+mac_store_drag_event (window, mouse_pos, modifiers, desc)
+     WindowRef window;
+     Point mouse_pos;
+     SInt16 modifiers;
+     const AEDesc *desc;
+{
+  struct input_event buf;
+
+  EVENT_INIT (buf);
+
+  buf.kind = DRAG_N_DROP_EVENT;
+  buf.modifiers = mac_to_emacs_modifiers (modifiers);
+  buf.timestamp = TickCount () * (1000 / 60);
+  XSETINT (buf.x, mouse_pos.h);
+  XSETINT (buf.y, mouse_pos.v);
+  XSETFRAME (buf.frame_or_window, mac_window_to_frame (window));
+  buf.arg = mac_aedesc_to_lisp (desc);
+  kbd_buffer_store_event (&buf);
+}
+#endif
 
 #if USE_CARBON_EVENTS
 static pascal OSStatus
@@ -9049,7 +9139,11 @@
 {
   OSStatus result, err;
   HICommand command;
-  Lisp_Object class_key, id_key, binding;
+  static EventParamName names[] = {kEventParamDirectObject,
+				   kEventParamKeyModifiers};
+  static EventParamType types[] = {typeHICommand,
+				   typeUInt32};
+  int num_params = sizeof (names) / sizeof (names[0]);
 
   result = CallNextEventHandler (next_handler, event);
   if (result != eventNotHandledErr)
@@ -9063,33 +9157,10 @@
 
   /* A HICommand event is mapped to an Apple event whose event class
      symbol is `hicommand' and event ID is its command ID.  */
-  class_key = Qhicommand;
-  mac_find_apple_event_spec (0, command.commandID,
-			     &class_key, &id_key, &binding);
-  if (!NILP (binding) && !EQ (binding, Qundefined))
-    {
-      if (INTEGERP (binding))
-	return XINT (binding);
-      else
-	{
-	  AppleEvent apple_event;
-	  static EventParamName names[] = {kEventParamDirectObject,
-					   kEventParamKeyModifiers};
-	  static EventParamType types[] = {typeHICommand,
-					   typeUInt32};
-	  err = create_apple_event_from_event_ref (event, 2, names, types,
-						   &apple_event);
-	  if (err == noErr)
-	    {
-	      err = mac_store_apple_event (class_key, id_key, &apple_event);
-	      AEDisposeDesc (&apple_event);
-	    }
-	  if (err == noErr)
-	    return noErr;
-	}
-    }
-
-  return eventNotHandledErr;
+  err = mac_store_event_ref_as_apple_event (0, command.commandID,
+					    Qhicommand, Qnil,
+					    event, num_params, names, types);
+  return err == noErr ? noErr : eventNotHandledErr;
 }
 
 static OSErr
@@ -9192,6 +9263,33 @@
       return noErr;
 
       break;
+
+#ifdef MAC_OSX
+    case kEventWindowToolbarSwitchMode:
+      result = CallNextEventHandler (next_handler, event);
+      {
+	static EventParamName names[] = {kEventParamDirectObject,
+					 kEventParamWindowMouseLocation,
+					 kEventParamKeyModifiers,
+					 kEventParamMouseButton,
+					 kEventParamClickCount,
+					 kEventParamMouseChord};
+	static EventParamType types[] = {typeWindowRef,
+					 typeQDPoint,
+					 typeUInt32,
+					 typeMouseButton,
+					 typeUInt32,
+					 typeUInt32};
+	int num_params = sizeof (names) / sizeof (names[0]);
+
+	err = mac_store_event_ref_as_apple_event (0, 0,
+						  Qwindow,
+						  Qtoolbar_switch_mode,
+						  event, num_params,
+						  names, types);
+      }
+      return err == noErr ? noErr : result;
+#endif
     }
 
   return eventNotHandledErr;
@@ -9266,45 +9364,96 @@
   return eventNotHandledErr;
 }
 
-#ifdef MAC_OSX
-OSErr
-mac_store_services_event (event)
+#if USE_MAC_FONT_PANEL
+static pascal OSStatus
+mac_handle_font_event (next_handler, event, data)
+     EventHandlerCallRef next_handler;
      EventRef event;
-{
-  OSErr err;
-  AppleEvent apple_event;
+     void *data;
+{
+  OSStatus result, err;
   Lisp_Object id_key;
+  int num_params;
+  EventParamName *names;
+  EventParamType *types;
+  static EventParamName names_sel[] = {kEventParamATSUFontID,
+				       kEventParamATSUFontSize,
+				       kEventParamFMFontFamily,
+				       kEventParamFMFontSize,
+				       kEventParamFontColor};
+  static EventParamType types_sel[] = {typeATSUFontID,
+				       typeATSUSize,
+				       typeFMFontFamily,
+				       typeFMFontSize,
+				       typeFontColor};
+
+  result = CallNextEventHandler (next_handler, event);
+  if (result != eventNotHandledErr)
+    return result;
+
+  switch (GetEventKind (event))
+    {
+    case kEventFontPanelClosed:
+      id_key = Qpanel_closed;
+      num_params = 0;
+      names = NULL;
+      types = NULL;
+      break;
+
+    case kEventFontSelection:
+      id_key = Qselection;
+      num_params = sizeof (names_sel) / sizeof (names_sel[0]);
+      names = names_sel;
+      types = types_sel;
+      break;
+    }
+
+  err = mac_store_event_ref_as_apple_event (0, 0, Qfont, id_key,
+					    event, num_params,
+					    names, types);
+
+  return err == noErr ? noErr : eventNotHandledErr;
+}
+#endif
+
+#ifdef MAC_OSX
+OSStatus
+mac_store_service_event (event)
+     EventRef event;
+{
+  OSStatus err;
+  Lisp_Object id_key;
+  int num_params;
+  EventParamName *names;
+  EventParamType *types;
+  static EventParamName names_pfm[] = {kEventParamServiceMessageName,
+				       kEventParamServiceUserData};
+  static EventParamType types_pfm[] = {typeCFStringRef,
+				       typeCFStringRef};
 
   switch (GetEventKind (event))
     {
     case kEventServicePaste:
       id_key = Qpaste;
-      err = create_apple_event_from_event_ref (event, 0, NULL, NULL,
-					       &apple_event);
+      num_params = 0;
+      names = NULL;
+      types = NULL;
       break;
 
     case kEventServicePerform:
-      {
-	static EventParamName names[] = {kEventParamServiceMessageName,
-					 kEventParamServiceUserData};
-	static EventParamType types[] = {typeCFStringRef,
-					 typeCFStringRef};
-
-	id_key = Qperform;
-	err = create_apple_event_from_event_ref (event, 2, names, types,
-						 &apple_event);
-      }
+      id_key = Qperform;
+      num_params = sizeof (names_pfm) / sizeof (names_pfm[0]);
+      names = names_pfm;
+      types = types_pfm;
       break;
 
     default:
       abort ();
     }
 
-  if (err == noErr)
-    {
-      err = mac_store_apple_event (Qservices, id_key, &apple_event);
-      AEDisposeDesc (&apple_event);
-    }
+  err = mac_store_event_ref_as_apple_event (0, 0, Qservice, id_key,
+					    event, num_params,
+					    names, types);
 
   return err;
 }
@@ -9324,15 +9473,28 @@
      {kEventClassWindow, kEventWindowShown},
      {kEventClassWindow, kEventWindowHidden},
      {kEventClassWindow, kEventWindowExpanded},
-     {kEventClassWindow, kEventWindowCollapsed}};
+     {kEventClassWindow, kEventWindowCollapsed},
+#ifdef MAC_OSX
+     {kEventClassWindow, kEventWindowToolbarSwitchMode},
+#endif
+  };
   EventTypeSpec specs_mouse[] = {{kEventClassMouse, kEventMouseWheelMoved}};
   static EventHandlerUPP handle_window_eventUPP = NULL;
   static EventHandlerUPP handle_mouse_eventUPP = NULL;
+#if USE_MAC_FONT_PANEL
+  EventTypeSpec specs_font[] = {{kEventClassFont, kEventFontPanelClosed},
+				{kEventClassFont, kEventFontSelection}};
+  static EventHandlerUPP handle_font_eventUPP = NULL;
+#endif
 
   if (handle_window_eventUPP == NULL)
     handle_window_eventUPP = NewEventHandlerUPP (mac_handle_window_event);
   if (handle_mouse_eventUPP == NULL)
     handle_mouse_eventUPP = NewEventHandlerUPP (mac_handle_mouse_event);
+#if USE_MAC_FONT_PANEL
+  if (handle_font_eventUPP == NULL)
+    handle_font_eventUPP = NewEventHandlerUPP (mac_handle_font_event);
+#endif
   err = InstallWindowEventHandler (window, handle_window_eventUPP,
 				   GetEventTypeCount (specs_window),
 				   specs_window, NULL, NULL);
@@ -9340,18 +9502,16 @@
     err = InstallWindowEventHandler (window, handle_mouse_eventUPP,
 				     GetEventTypeCount (specs_mouse),
 				     specs_mouse, NULL, NULL);
-#endif
-#if TARGET_API_MAC_CARBON
-  if (mac_do_track_dragUPP == NULL)
-    mac_do_track_dragUPP = NewDragTrackingHandlerUPP (mac_do_track_drag);
-  if (mac_do_receive_dragUPP == NULL)
-    mac_do_receive_dragUPP = NewDragReceiveHandlerUPP (mac_do_receive_drag);
-
+#if USE_MAC_FONT_PANEL
   if (err == noErr)
-    err = InstallTrackingHandler (mac_do_track_dragUPP, window, NULL);
+    err = InstallWindowEventHandler (window, handle_font_eventUPP,
+				     GetEventTypeCount (specs_font),
+				     specs_font, NULL, NULL);
+#endif
+#endif
   if (err == noErr)
-    err = InstallReceiveHandler (mac_do_receive_dragUPP, window, NULL);
-#endif
+    err = install_drag_handler (window);
+
   return err;
 }
 
@@ -9359,166 +9519,8 @@
 remove_window_handler (window)
      WindowPtr window;
 {
-#if TARGET_API_MAC_CARBON
-  if (mac_do_track_dragUPP)
-    RemoveTrackingHandler (mac_do_track_dragUPP, window);
-  if (mac_do_receive_dragUPP)
-    RemoveReceiveHandler (mac_do_receive_dragUPP, window);
-#endif
-}
-
-#if TARGET_API_MAC_CARBON
-static pascal OSErr
-mac_do_track_drag (DragTrackingMessage message, WindowPtr window,
-		   void *handlerRefCon, DragReference theDrag)
-{
-  static int can_accept;
-  short items;
-  short index;
-  ItemReference theItem;
-  FlavorFlags theFlags;
-  OSErr result;
-
-  if (GetFrontWindowOfClass (kMovableModalWindowClass, false))
-    return dragNotAcceptedErr;
-
-  switch (message)
-    {
-    case kDragTrackingEnterHandler:
-      CountDragItems (theDrag, &items);
-      can_accept = 0;
-      for (index = 1; index <= items; index++)
-	{
-	  GetDragItemReferenceNumber (theDrag, index, &theItem);
-	  result = GetFlavorFlags (theDrag, theItem, flavorTypeHFS, &theFlags);
-	  if (result == noErr)
-	    {
-	      can_accept = 1;
-	      break;
-	    }
-	}
-      break;
-
-    case kDragTrackingEnterWindow:
-      if (can_accept)
-	{
-	  RgnHandle hilite_rgn = NewRgn ();
-	  Rect r;
-	  struct frame *f = mac_window_to_frame (window);
-
-	  GetWindowPortBounds (window, &r);
-	  OffsetRect (&r, -r.left, -r.top);
-	  RectRgn (hilite_rgn, &r);
-	  ShowDragHilite (theDrag, hilite_rgn, true);
-	  DisposeRgn (hilite_rgn);
-	  SetThemeCursor (kThemeCopyArrowCursor);
-	}
-      break;
-
-    case kDragTrackingInWindow:
-      break;
-
-    case kDragTrackingLeaveWindow:
-      if (can_accept)
-	{
-	  struct frame *f = mac_window_to_frame (window);
-
-	  HideDragHilite (theDrag);
-	  SetThemeCursor (kThemeArrowCursor);
-	}
-      break;
-
-    case kDragTrackingLeaveHandler:
-      break;
-    }
-
-  return noErr;
-}
-
-static pascal OSErr
-mac_do_receive_drag (WindowPtr window, void *handlerRefCon,
-		     DragReference theDrag)
-{
-  short items;
-  short index;
-  FlavorFlags theFlags;
-  Point mouse;
-  OSErr result;
-  ItemReference theItem;
-  HFSFlavor data;
-  Size size = sizeof (HFSFlavor);
-  Lisp_Object file_list;
-
-  if (GetFrontWindowOfClass (kMovableModalWindowClass, false))
-    return dragNotAcceptedErr;
-
-  file_list = Qnil;
-  GetDragMouse (theDrag, &mouse, 0L);
-  CountDragItems (theDrag, &items);
-  for (index = 1; index <= items; index++)
-    {
-      /* Only handle file references.  */
-      GetDragItemReferenceNumber (theDrag, index, &theItem);
-      result = GetFlavorFlags (theDrag, theItem, flavorTypeHFS, &theFlags);
-      if (result == noErr)
-	{
-	  OSErr err;
-	  AEDesc desc;
-
-	  err = GetFlavorData (theDrag, theItem, flavorTypeHFS,
-			       &data, &size, 0L);
-	  if (err == noErr)
-	    err = AECoercePtr (typeFSS, &data.fileSpec, sizeof (FSSpec),
-			       TYPE_FILE_NAME, &desc);
-	  if (err == noErr)
-	    {
-	      Lisp_Object file;
-
-	      /* x-dnd functions expect undecoded filenames.  */
-	      file = make_uninit_string (AEGetDescDataSize (&desc));
-	      err = AEGetDescData (&desc, SDATA (file), SBYTES (file));
-	      if (err == noErr)
-		file_list = Fcons (file, file_list);
-	      AEDisposeDesc (&desc);
-	    }
-	}
-    }
-  /* If there are items in the list, construct an event and post it to
-     the queue like an interrupt using kbd_buffer_store_event.  */
-  if (!NILP (file_list))
-    {
-      struct input_event event;
-      Lisp_Object frame;
-      struct frame *f = mac_window_to_frame (window);
-      SInt16 modifiers;
-
-      GlobalToLocal (&mouse);
-      GetDragModifiers (theDrag, NULL, NULL, &modifiers);
-
-      event.kind = DRAG_N_DROP_EVENT;
-      event.code = 0;
-      event.modifiers = mac_to_emacs_modifiers (modifiers);
-      event.timestamp = TickCount () * (1000 / 60);
-      XSETINT (event.x, mouse.h);
-      XSETINT (event.y, mouse.v);
-      XSETFRAME (frame, f);
-      event.frame_or_window = frame;
-      event.arg = file_list;
-      /* Post to the interrupt queue */
-      kbd_buffer_store_event (&event);
-      /* MAC_TODO: Mimic behavior of windows by switching contexts to Emacs */
-      {
-	ProcessSerialNumber psn;
-	GetCurrentProcess (&psn);
-	SetFrontProcess (&psn);
-      }
-
-      return noErr;
-    }
-  else
-    return dragNotAcceptedErr;
-}
-#endif
+  remove_drag_handler (window);
+}
 
 
 #if __profile__
@@ -9805,6 +9807,41 @@
 }
 #endif /* not USE_CARBON_EVENTS */
 
+#if TARGET_API_MAC_CARBON
+OSStatus
+mac_post_mouse_moved_event ()
+{
+  EventRef event = NULL;
+  OSStatus err;
+
+  err = CreateEvent (NULL, kEventClassMouse, kEventMouseMoved, 0,
+		     kEventAttributeNone, &event);
+  if (err == noErr)
+    {
+      Point mouse_pos;
+
+      GetMouse (&mouse_pos);
+      LocalToGlobal (&mouse_pos);
+      err = SetEventParameter (event, kEventParamMouseLocation, typeQDPoint,
+			       sizeof (Point), &mouse_pos);
+    }
+  if (err == noErr)
+    {
+      UInt32 modifiers = GetCurrentKeyModifiers ();
+
+      err = SetEventParameter (event, kEventParamKeyModifiers, typeUInt32,
+			       sizeof (UInt32), &modifiers);
+    }
+  if (err == noErr)
+    err = PostEventToQueue (GetCurrentEventQueue (), event,
+			    kEventPriorityStandard);
+  if (event)
+    ReleaseEvent (event);
+
+  return err;
+}
+#endif
+
 /* Emacs calls this whenever it wants to read an input event from the
    user. */
 int
@@ -9932,7 +9969,13 @@
 		break;
 
 	      case inContent:
-		if (window_ptr != FRAME_MAC_WINDOW (mac_focus_frame (dpyinfo)))
+		if (
+#if TARGET_API_MAC_CARBON
+		    FrontNonFloatingWindow ()
+#else
+		    FrontWindow ()
+#endif
+		    != window_ptr)
 		  SelectWindow (window_ptr);
 		else
 		  {
@@ -10079,20 +10122,18 @@
 		  }
 		break;
 
+	      case inDrag:
 #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;
 		  }
+		if (part_code == inProxyIcon
+		    && (TrackWindowProxyDrag (window_ptr, er.where)
+			!= errUserWantsToDragWindow))
+		  break;
 		DragWindow (window_ptr, er.where, NULL);
 #else /* not TARGET_API_MAC_CARBON */
 		DragWindow (window_ptr, er.where, &qd.screenBits.bounds);
@@ -11030,7 +11071,14 @@
 #if USE_CARBON_EVENTS
   Qhicommand   = intern ("hicommand");    staticpro (&Qhicommand);
 #ifdef MAC_OSX
-  Qservices    = intern ("services");	  staticpro (&Qservices);
+  Qtoolbar_switch_mode = intern ("toolbar-switch-mode");
+  staticpro (&Qtoolbar_switch_mode);
+#if USE_MAC_FONT_PANEL
+  Qpanel_closed = intern ("panel-closed");  staticpro (&Qpanel_closed);
+  Qselection    = intern ("selection");     staticpro (&Qselection);
+#endif
+
+  Qservice     = intern ("service");	  staticpro (&Qservice);
   Qpaste       = intern ("paste");	  staticpro (&Qpaste);
   Qperform     = intern ("perform");	  staticpro (&Qperform);
 #endif
@@ -11070,7 +11118,7 @@
   x_use_underline_position_properties = 0;
 
   DEFVAR_LISP ("x-toolkit-scroll-bars", &Vx_toolkit_scroll_bars,
-	       doc: /* If not nil, Emacs uses toolkit scroll bars.  */);
+    doc: /* If not nil, Emacs uses toolkit scroll bars.  */);
 #ifdef USE_TOOLKIT_SCROLL_BARS
   Vx_toolkit_scroll_bars = Qt;
 #else
@@ -11124,23 +11172,23 @@
 
 #if USE_CARBON_EVENTS
   DEFVAR_BOOL ("mac-wheel-button-is-mouse-2", &mac_wheel_button_is_mouse_2,
-   doc: /* *Non-nil if the wheel button is mouse-2 and the right click mouse-3.
+    doc: /* *Non-nil if the wheel button is mouse-2 and the right click mouse-3.
 Otherwise, the right click will be treated as mouse-2 and the wheel
 button will be mouse-3.  */);
   mac_wheel_button_is_mouse_2 = 1;
 
   DEFVAR_BOOL ("mac-pass-command-to-system", &mac_pass_command_to_system,
-   doc: /* *Non-nil if command key presses are passed on to the Mac Toolbox.  */);
+    doc: /* *Non-nil if command key presses are passed on to the Mac Toolbox.  */);
   mac_pass_command_to_system = 1;
 
   DEFVAR_BOOL ("mac-pass-control-to-system", &mac_pass_control_to_system,
-   doc: /* *Non-nil if control key presses are passed on to the Mac Toolbox.  */);
+    doc: /* *Non-nil if control key presses are passed on to the Mac Toolbox.  */);
   mac_pass_control_to_system = 1;
 
 #endif
 
   DEFVAR_BOOL ("mac-allow-anti-aliasing", &mac_use_core_graphics,
-   doc: /* *If non-nil, allow anti-aliasing.
+    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
@@ -11153,7 +11201,7 @@
      creating the terminal frame on Mac OS 9 before loading
      term/mac-win.elc.  */
   DEFVAR_LISP ("mac-charset-info-alist", &Vmac_charset_info_alist,
-               doc: /* Alist of Emacs character sets vs text encodings and coding systems.
+    doc: /* Alist of Emacs character sets vs text encodings and coding systems.
 Each entry should be of the form:
 
    (CHARSET-NAME TEXT-ENCODING CODING-SYSTEM)
@@ -11164,6 +11212,18 @@
   Vmac_charset_info_alist =
     Fcons (list3 (build_string ("mac-roman"),
 		  make_number (smRoman), Qnil), Qnil);
+
+#if USE_ATSUI
+  DEFVAR_LISP ("mac-atsu-font-table", &Vmac_atsu_font_table,
+    doc: /* Hash table of ATSU font IDs vs plist of attributes and values.
+Each font ID is represented as a four-byte string in native byte
+order.  */);
+  Vmac_atsu_font_table =
+    make_hash_table (Qequal, make_number (DEFAULT_HASH_SIZE),
+		     make_float (DEFAULT_REHASH_SIZE),
+		     make_float (DEFAULT_REHASH_THRESHOLD),
+		     Qnil, Qnil, Qnil);
+#endif
 }
 
 /* arch-tag: f2259165-4454-4c04-a029-a133c8af7b5b
--- a/src/macterm.h	Tue May 02 08:50:29 2006 +0000
+++ b/src/macterm.h	Wed May 10 20:42:41 2006 +0000
@@ -584,10 +584,11 @@
 extern void mac_clear_area P_ ((struct frame *, int, int,
 				unsigned int, unsigned int));
 extern void mac_unload_font P_ ((struct mac_display_info *, XFontStruct *));
+extern OSStatus mac_set_font_info_for_selection P_ ((struct frame *, int, int));
 extern OSErr install_window_handler P_ ((WindowPtr));
 extern void remove_window_handler P_ ((WindowPtr));
-extern Lisp_Object mac_make_lispy_event_code P_ ((int));
 extern void do_menu_choice P_ ((SInt32));
+extern OSStatus mac_post_mouse_moved_event P_ ((void));
 #if USE_CG_DRAWING
 extern void mac_prepare_for_quickdraw P_ ((struct frame *));
 #endif
@@ -623,12 +624,15 @@
 /* Defined in mac.c.  */
 
 extern void mac_clear_font_name_table P_ ((void));
-extern Lisp_Object mac_aedesc_to_lisp P_ ((AEDesc *));
+extern Lisp_Object mac_aedesc_to_lisp P_ ((const AEDesc *));
 #if TARGET_API_MAC_CARBON
 extern OSErr create_apple_event_from_event_ref P_ ((EventRef, UInt32,
 						    EventParamName *,
 						    EventParamType *,
 						    AppleEvent *));
+extern OSErr create_apple_event_from_drag_ref P_ ((DragRef, UInt32,
+						   FlavorType *,
+						   AppleEvent *));
 extern CFStringRef cfstring_create_with_utf8_cstring P_ ((const char *));
 extern CFStringRef cfstring_create_with_string P_ ((Lisp_Object));
 extern Lisp_Object cfdata_to_lisp P_ ((CFDataRef));
--- a/src/minibuf.c	Tue May 02 08:50:29 2006 +0000
+++ b/src/minibuf.c	Wed May 10 20:42:41 2006 +0000
@@ -523,7 +523,7 @@
 		build_string ("Command attempted to use minibuffer while in minibuffer"));
     }
 
-  if (noninteractive)
+  if (noninteractive && NILP (Vexecuting_kbd_macro))
     {
       val = read_minibuf_noninteractive (map, initial, prompt,
 					 make_number (pos),
@@ -2790,7 +2790,7 @@
   DEFVAR_LISP ("history-length", &Vhistory_length,
 	       doc: /* *Maximum length for history lists before truncation takes place.
 A number means that length; t means infinite.  Truncation takes place
-just after a new element is inserted.  Setting the history-length
+just after a new element is inserted.  Setting the `history-length'
 property of a history variable overrides this default.  */);
   XSETFASTINT (Vhistory_length, 30);
 
--- a/src/process.c	Tue May 02 08:50:29 2006 +0000
+++ b/src/process.c	Wed May 10 20:42:41 2006 +0000
@@ -696,6 +696,8 @@
       = (struct coding_system *) xmalloc (sizeof (struct coding_system));
   setup_coding_system (p->encode_coding_system,
 		       proc_encode_coding_system[outch]);
+  if (proc_encode_coding_system[outch]->eol_type == CODING_EOL_UNDECIDED)
+    proc_encode_coding_system[outch]->eol_type = system_eol_type;
 }
 
 DEFUN ("processp", Fprocessp, Sprocessp, 1, 1, 0,
@@ -5067,6 +5069,10 @@
 	      p->encode_coding_system = Vlast_coding_system_used;
 	      setup_coding_system (p->encode_coding_system,
 				   proc_encode_coding_system[XINT (p->outfd)]);
+	      if (proc_encode_coding_system[XINT (p->outfd)]->eol_type
+		  == CODING_EOL_UNDECIDED)
+		proc_encode_coding_system[XINT (p->outfd)]->eol_type
+		  = system_eol_type;
 	    }
 	}
 
@@ -5176,6 +5182,10 @@
 	      p->encode_coding_system = Vlast_coding_system_used;
 	      setup_coding_system (p->encode_coding_system,
 				   proc_encode_coding_system[XINT (p->outfd)]);
+	      if (proc_encode_coding_system[XINT (p->outfd)]->eol_type
+		  == CODING_EOL_UNDECIDED)
+		proc_encode_coding_system[XINT (p->outfd)]->eol_type
+		  = system_eol_type;
 	    }
 	}
       if (coding->carryover_bytes > 0)
--- a/src/sound.c	Tue May 02 08:50:29 2006 +0000
+++ b/src/sound.c	Wed May 10 20:42:41 2006 +0000
@@ -452,13 +452,12 @@
 sound_cleanup (arg)
      Lisp_Object arg;
 {
-  if (current_sound_device)
-    {
-      if (current_sound_device->close)
-	current_sound_device->close (current_sound_device);
-      if (current_sound->fd > 0)
-	emacs_close (current_sound->fd);
-    }
+  if (current_sound_device->close)
+    current_sound_device->close (current_sound_device);
+  if (current_sound->fd > 0)
+    emacs_close (current_sound->fd);
+  free (current_sound_device);
+  free (current_sound);
 
   return Qnil;
 }
@@ -991,8 +990,6 @@
 #ifndef WINDOWSNT
   Lisp_Object file;
   struct gcpro gcpro1, gcpro2;
-  struct sound_device sd;
-  struct sound s;
   Lisp_Object args[2];
 #else /* WINDOWSNT */
   int len = 0;
@@ -1010,48 +1007,50 @@
 #ifndef WINDOWSNT
   file = Qnil;
   GCPRO2 (sound, file);
-  bzero (&sd, sizeof sd);
-  bzero (&s, sizeof s);
-  current_sound_device = &sd;
-  current_sound = &s;
+  current_sound_device = (struct sound_device *) xmalloc (sizeof (struct sound_device));
+  bzero (current_sound_device, sizeof (struct sound_device));
+  current_sound = (struct sound *) xmalloc (sizeof (struct sound));
+  bzero (current_sound, sizeof (struct sound));
   record_unwind_protect (sound_cleanup, Qnil);
-  s.header = (char *) alloca (MAX_SOUND_HEADER_BYTES);
+  current_sound->header = (char *) alloca (MAX_SOUND_HEADER_BYTES);
 
   if (STRINGP (attrs[SOUND_FILE]))
     {
       /* Open the sound file.  */
-      s.fd = openp (Fcons (Vdata_directory, Qnil),
-		    attrs[SOUND_FILE], Qnil, &file, Qnil);
-      if (s.fd < 0)
+      current_sound->fd = openp (Fcons (Vdata_directory, Qnil),
+				 attrs[SOUND_FILE], Qnil, &file, Qnil);
+      if (current_sound->fd < 0)
 	sound_perror ("Could not open sound file");
 
       /* Read the first bytes from the file.  */
-      s.header_size = emacs_read (s.fd, s.header, MAX_SOUND_HEADER_BYTES);
-      if (s.header_size < 0)
+      current_sound->header_size
+	= emacs_read (current_sound->fd, current_sound->header,
+		      MAX_SOUND_HEADER_BYTES);
+      if (current_sound->header_size < 0)
 	sound_perror ("Invalid sound file header");
     }
   else
     {
-      s.data = attrs[SOUND_DATA];
-      s.header_size = min (MAX_SOUND_HEADER_BYTES, SBYTES (s.data));
-      bcopy (SDATA (s.data), s.header, s.header_size);
+      current_sound->data = attrs[SOUND_DATA];
+      current_sound->header_size = min (MAX_SOUND_HEADER_BYTES, SBYTES (current_sound->data));
+      bcopy (SDATA (current_sound->data), current_sound->header, current_sound->header_size);
     }
 
   /* Find out the type of sound.  Give up if we can't tell.  */
-  find_sound_type (&s);
+  find_sound_type (current_sound);
 
   /* Set up a device.  */
   if (STRINGP (attrs[SOUND_DEVICE]))
     {
       int len = SCHARS (attrs[SOUND_DEVICE]);
-      sd.file = (char *) alloca (len + 1);
-      strcpy (sd.file, SDATA (attrs[SOUND_DEVICE]));
+      current_sound_device->file = (char *) alloca (len + 1);
+      strcpy (current_sound_device->file, SDATA (attrs[SOUND_DEVICE]));
     }
 
   if (INTEGERP (attrs[SOUND_VOLUME]))
-    sd.volume = XFASTINT (attrs[SOUND_VOLUME]);
+    current_sound_device->volume = XFASTINT (attrs[SOUND_VOLUME]);
   else if (FLOATP (attrs[SOUND_VOLUME]))
-    sd.volume = XFLOAT_DATA (attrs[SOUND_VOLUME]) * 100;
+    current_sound_device->volume = XFLOAT_DATA (attrs[SOUND_VOLUME]) * 100;
 
   args[0] = Qplay_sound_functions;
   args[1] = sound;
@@ -1060,27 +1059,15 @@
   /* There is only one type of device we currently support, the VOX
      sound driver.  Set up the device interface functions for that
      device.  */
-  vox_init (&sd);
+  vox_init (current_sound_device);
 
   /* Open the device.  */
-  sd.open (&sd);
+  current_sound_device->open (current_sound_device);
 
   /* Play the sound.  */
-  s.play (&s, &sd);
-
-  /* Close the input file, if any.  */
-  if (!STRINGP (s.data))
-    {
-      emacs_close (s.fd);
-      s.fd = -1;
-    }
-
-  /* Close the device.  */
-  sd.close (&sd);
+  current_sound->play (current_sound, current_sound_device);
 
   /* Clean up.  */
-  current_sound_device = NULL;
-  current_sound = NULL;
   UNGCPRO;
 
 #else /* WINDOWSNT */
--- a/src/termhooks.h	Tue May 02 08:50:29 2006 +0000
+++ b/src/termhooks.h	Wed May 10 20:42:41 2006 +0000
@@ -332,9 +332,9 @@
   /* Generated when an Apple event, a HICommand event, or a Services
      menu event is received and the corresponding handler is
      registered.  Members `x' and `y' are for the event class and ID
-     symbols, respectively.  Member `code' points to the Apple event
-     descriptor.  Parameters for Non-Apple events are converted to
-     those in Apple events.  */
+     symbols, respectively.  Member `arg' is a Lisp object converted
+     from the received Apple event.  Parameters for non-Apple events
+     are converted to those in Apple events.  */
   MAC_APPLE_EVENT
 #endif
 };
--- a/src/xdisp.c	Tue May 02 08:50:29 2006 +0000
+++ b/src/xdisp.c	Wed May 10 20:42:41 2006 +0000
@@ -4543,6 +4543,24 @@
 
       if (id >= 0)
 	{
+	  struct composition *cmp = composition_table[id];
+
+	  if (cmp->glyph_len == 0)
+	    {
+	      /* No glyph.  */
+	      if (STRINGP (it->string))
+		{
+		  IT_STRING_CHARPOS (*it) = end;
+		  IT_STRING_BYTEPOS (*it) = string_char_to_byte (it->string,
+								 end);
+		}
+	      else
+		{
+		  IT_CHARPOS (*it) = end;
+		  IT_BYTEPOS (*it) = CHAR_TO_BYTE (end);
+		}
+	      return HANDLED_RECOMPUTE_PROPS;
+	    }
 	  it->method = GET_FROM_COMPOSITION;
 	  it->cmp_id = id;
 	  it->cmp_len = COMPOSITION_LENGTH (prop);
--- a/src/xfaces.c	Tue May 02 08:50:29 2006 +0000
+++ b/src/xfaces.c	Wed May 10 20:42:41 2006 +0000
@@ -7255,6 +7255,16 @@
   check_lface (lface);
   bcopy (XVECTOR (lface)->contents, attrs, sizeof attrs);
   face = realize_face (c, attrs, DEFAULT_FACE_ID);
+
+#ifdef HAVE_WINDOW_SYSTEM
+#ifdef HAVE_X_WINDOWS  
+  if (face->font != FRAME_FONT (f))
+    /* As the font specified for the frame was not acceptable as a
+       font for the default face (perhaps because auto-scaled fonts
+       are rejected), we must adjust the frame font.  */
+    x_set_font (f, build_string (face->font_name), Qnil);
+#endif	/* HAVE_X_WINDOWS */
+#endif	/* HAVE_WINDOW_SYSTEM */
   return 1;
 }