changeset 90573:858cb33ae39d

Merge from emacs--devo--0 Patches applied: * emacs--devo--0 (patch 357-381) - Merge from gnus--rel--5.10 - Update from CVS - Merge from erc--emacs--21 * gnus--rel--5.10 (patch 116-122) - Update from CVS - Merge from emacs--devo--0 Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-98
author Miles Bader <miles@gnu.org>
date Thu, 03 Aug 2006 11:45:23 +0000
parents ab9b8d043c39 (current diff) 27bf187aaf90 (diff)
children cb32f6952a5b
files admin/FOR-RELEASE etc/ChangeLog etc/NEWS lib-src/ChangeLog lib-src/etags.c lib-src/fakemail.c lisp/ChangeLog lisp/Makefile.in lisp/allout.el lisp/arc-mode.el lisp/bindings.el lisp/calc/calc-aent.el lisp/calc/calc-map.el lisp/calc/calc-rewr.el lisp/calc/calc-sel.el lisp/calc/calc.el lisp/calc/calcalg3.el lisp/complete.el lisp/cus-edit.el lisp/dired.el lisp/dos-w32.el lisp/edmacro.el lisp/emacs-lisp/find-func.el lisp/files.el lisp/font-core.el lisp/font-lock.el lisp/format.el lisp/frame.el lisp/gnus/ChangeLog lisp/gnus/gnus-srvr.el lisp/gnus/gnus-sum.el lisp/gnus/nnheader.el lisp/gnus/nnmail.el lisp/gnus/nnweb.el lisp/help-mode.el lisp/ibuffer.el lisp/international/mule-cmds.el lisp/jit-lock.el lisp/loadhist.el lisp/mouse.el lisp/pcvs-util.el lisp/progmodes/cc-langs.el lisp/progmodes/cc-mode.el lisp/progmodes/compile.el lisp/progmodes/delphi.el lisp/progmodes/gdb-ui.el lisp/progmodes/grep.el lisp/progmodes/ld-script.el lisp/progmodes/sh-script.el lisp/progmodes/vhdl-mode.el lisp/progmodes/which-func.el lisp/replace.el lisp/startup.el lisp/subr.el lisp/tabify.el lisp/term/xterm.el lisp/textmodes/ispell.el lisp/textmodes/po.el lisp/textmodes/table.el lisp/tumme.el lisp/window.el lisp/xml.el lispref/ChangeLog lispref/commands.texi lispref/customize.texi lispref/display.texi lispref/elisp.texi lispref/frames.texi lispref/keymaps.texi lispref/lists.texi lispref/maps.texi lispref/modes.texi lispref/objects.texi lispref/os.texi lispref/processes.texi lispref/sequences.texi lispref/text.texi lispref/variables.texi mac/ChangeLog mac/makefile.MPW man/ChangeLog man/ack.texi man/anti.texi man/basic.texi man/building.texi man/calc.texi man/cmdargs.texi man/commands.texi man/dired.texi man/display.texi man/doclicense.texi man/emacs.texi man/faq.texi man/files.texi man/forms.texi man/frames.texi man/glossary.texi man/gnus.texi man/help.texi man/info.texi man/killing.texi man/mark.texi man/misc.texi man/programs.texi man/search.texi man/xresources.texi nt/ChangeLog nt/INSTALL src/ChangeLog src/alloc.c src/callint.c src/coding.c src/editfns.c src/fns.c src/keyboard.c src/keyboard.h src/keymap.c src/lisp.h src/lread.c src/process.c src/puresize.h src/w32.c src/w32fns.c src/xdisp.c src/xfaces.c
diffstat 147 files changed, 3527 insertions(+), 1924 deletions(-) [+]
line wrap: on
line diff
--- a/admin/FOR-RELEASE	Thu Aug 03 00:41:54 2006 +0000
+++ b/admin/FOR-RELEASE	Thu Aug 03 11:45:23 2006 +0000
@@ -31,6 +31,11 @@
 
 * BUGS
 
+** bojohan's and johnsu01@wjsullivan.net's 18 July bug reports that
+  "C-n doesn't work in Customize Option buffer in -nw with long value
+  displayed".  Yidong proposed a fix, but needs a field expert to check
+  it.
+
 ** 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)
@@ -41,6 +46,10 @@
 
 ** David Kastrup's report on strange scrolling of large images.
 
+** Jorgen Schaefer <forcer@forcix.cx>'s June 18 bug report about
+  fields and invisible overlays needs attention from a field expert.
+
+** Implement buffer-chars-modified-tick.
 
 * DOCUMENTATION
 
--- a/etc/ChangeLog	Thu Aug 03 00:41:54 2006 +0000
+++ b/etc/ChangeLog	Thu Aug 03 11:45:23 2006 +0000
@@ -1,3 +1,21 @@
+2006-08-03  Michael Olson  <mwolson@gnu.org>
+
+	* ERC-NEWS: Update for ERC 5.1.4.
+
+2006-08-01  Kenichi Handa  <handa@m17n.org>
+
+	* NEWS (find-operation-coding-system): Describe the more detail of
+	the change.
+
+2006-07-28  Reiner Steib  <Reiner.Steib@gmx.de>
+
+	* GNUS-NEWS: Regenerate from Oort Gnus node in texi/gnus.texi using
+	texi/gnus-news.el of the trunk.
+
+2006-07-29  Reiner Steib  <Reiner.Steib@gmx.de>
+
+	* NEWS: Fix typo.
+
 2006-07-17  Reiner Steib  <Reiner.Steib@gmx.de>
 
 	* ru-refcard.ps: Regenerate.
--- a/etc/ERC-NEWS	Thu Aug 03 00:41:54 2006 +0000
+++ b/etc/ERC-NEWS	Thu Aug 03 11:45:23 2006 +0000
@@ -1,6 +1,27 @@
 ERC NEWS                                                       -*- outline -*-
 
-* Changes in ERC 5.2 (unreleased)
+* Changes in ERC 5.1.4
+
+** Make find-function and find-variable work in Emacs 22 for
+names that are constructed by `define-erc-module'.
+
+** Fix bug introduced in ERC 5.1.3 that caused messages to go the
+wrong buffer.
+
+** Changes and additions to modules
+
+*** Highlighting (erc-match.el)
+
+**** Don't activate view-mode.
+
+*** Logging (erc-log.el)
+
+**** When this module is activated, make sure logging is enabled on
+already-opened buffers.  Ditto for disabling logging when the module
+is deactivated.
+
+**** Fix some errors that occur when exiting Emacs without first
+quitting open IRC servers.
 
 * Changes in ERC 5.1.3
 
--- a/etc/GNUS-NEWS	Thu Aug 03 00:41:54 2006 +0000
+++ b/etc/GNUS-NEWS	Thu Aug 03 11:45:23 2006 +0000
@@ -1,152 +1,201 @@
 GNUS NEWS -- history of user-visible changes.
-Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004,
-   2005, 2006 Free Software Foundation, Inc.
+Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+   2006 Free Software Foundation, Inc.
 See the end for copying conditions.
 
 Please send Gnus bug reports to bugs@gnus.org.
 For older news, see Gnus info node "New Features".
 
 
-* Changes in Oort Gnus
-
-** `F' (`gnus-article-followup-with-original') and `R'
-(`gnus-article-reply-with-original') only yank the text in the region if the
-region is active.
-
-** `gnus-group-read-ephemeral-group' can be called interactively, using `G M'.
-
-** In draft groups, `e' is now bound to `gnus-draft-edit-message'.
-Use `B w' for `gnus-summary-edit-article' instead.
-
-** The revised Gnus FAQ is included in the manual.
-See the info node "Frequently Asked Questions".
+* Installation changes
 
 ** Upgrading from previous (stable) version if you have used Oort.
 
 If you have tried Oort (the unstable Gnus branch leading to this
-release) but went back to a stable version, be careful when upgrading
-to this version.  In particular, you will probably want to remove all
-.marks (nnml) and .mrk (nnfolder) files, so that flags are read from
-your ~/.newsrc.eld instead of from the .marks/.mrk file where this
+release) but went back to a stable version, be careful when upgrading to
+this version.  In particular, you will probably want to remove all
+`.marks' (nnml) and `.mrk' (nnfolder) files, so that flags are read from
+your `.newsrc.eld' instead of from the `.marks'/`.mrk' file where this
 release store flags.  See a later entry for more information about
-marks.  Note that downgrading isn't safe in general.
+marks.  Note that downgrading isn't save in general.
+
+** Lisp files are now installed in `.../site-lisp/gnus/' by default.  It
+defaulted to `.../site-lisp/' formerly.  In addition to this, the new
+installer issues a warning if other Gnus installations which will shadow
+the latest one are detected.  You can then remove those shadows manually
+or remove them using `make remove-installed-shadows'.
+
+** New `make.bat' for compiling and installing Gnus under MS Windows
+
+Use `make.bat' if you want to install Gnus under MS Windows, the first
+argument to the batch-program should be the directory where `xemacs.exe'
+respectively `emacs.exe' is located, iff you want to install Gnus after
+compiling it, give `make.bat' `/copy' as the second parameter.
+
+`make.bat' has been rewritten from scratch, it now features automatic
+recognition of XEmacs and GNU Emacs, generates `gnus-load.el', checks if
+errors occur while compilation and generation of info files and reports
+them at the end of the build process.  It now uses `makeinfo' if it is
+available and falls back to `infohack.el' otherwise.  `make.bat' should
+now install all files which are necessary to run Gnus and be generally a
+complete replacement for the `configure; make; make install' cycle used
+under Unix systems.
+
+The new `make.bat' makes `make-x.bat' and `xemacs.mak' superfluous, so
+they have been removed.
+
+** `~/News/overview/' not used.
+
+As a result of the following change, the `~/News/overview/' directory is
+not used any more.  You can safely delete the entire hierarchy.
+
+** `(require 'gnus-load)'
+
+If you use a stand-alone Gnus distribution, you'd better add `(require
+'gnus-load)' into your `~/.emacs' after adding the Gnus lisp directory
+into load-path.
+
+File `gnus-load.el' contains autoload commands, functions and variables,
+some of which may not be included in distributions of Emacsen.
+
+
+
+* New packages and libraries within Gnus
+
+** The revised Gnus FAQ is included in the manual, *Note Frequently Asked
+Questions::.
+
+** TLS wrapper shipped with Gnus
+
+TLS/SSL is now supported in IMAP and NNTP via `tls.el' and GNUTLS.  The
+old TLS/SSL support via (external third party) `ssl.el' and OpenSSL
+still works.
+
+** Improved anti-spam features.
+
+Gnus is now able to take out spam from your mail and news streams using
+a wide variety of programs and filter rules.  Among the supported
+methods are RBL blocklists, bogofilter and white/blacklists.  Hooks for
+easy use of external packages such as SpamAssassin and Hashcash are also
+new.  *Note Thwarting Email Spam::.
+
+** Gnus supports server-side mail filtering using Sieve.
+
+Sieve rules can be added as Group Parameters for groups, and the
+complete Sieve script is generated using `D g' from the Group buffer,
+and then uploaded to the server using `C-c C-l' in the generated Sieve
+buffer.  *Note Sieve Commands::, and the new Sieve manual *Note Top:
+(sieve)Top.
+
+
+
+* Changes in group mode
+
+** `gnus-group-read-ephemeral-group' can be called interactively, using `G
+M'.
+
+** Retrieval of charters and control messages
+
+There are new commands for fetching newsgroup charters (`H c') and
+control messages (`H C').
+
+** The new variable `gnus-parameters' can be used to set group parameters.
+
+Earlier this was done only via `G p' (or `G c'), which stored the
+parameters in `~/.newsrc.eld', but via this variable you can enjoy the
+powers of customize, and simplified backups since you set the variable
+in `~/.gnus.el' instead of `~/.newsrc.eld'.  The variable maps regular
+expressions matching group names to group parameters, a'la:
+(setq gnus-parameters
+ '(("mail\\..*"
+    (gnus-show-threads nil)
+    (gnus-use-scoring nil))
+   ("^nnimap:\\(foo.bar\\)$"
+    (to-group . "\\1"))))
+
+** Unread count correct in nnimap groups.
+
+The estimated number of unread articles in the group buffer should now
+be correct for nnimap groups.  This is achieved by calling
+`nnimap-fixup-unread-after-getting-new-news' from the
+`gnus-setup-news-hook' (called on startup) and
+`gnus-after-getting-new-news-hook'. (called after getting new mail).  If
+you have modified those variables from the default, you may want to add
+`nnimap-fixup-unread-after-getting-new-news' again.  If you were happy
+with the estimate and want to save some (minimal) time when getting new
+mail, remove the function.
+
+** Group names are treated as UTF-8 by default.
+
+This is supposedly what USEFOR wanted to migrate to.  See
+`gnus-group-name-charset-group-alist' and
+`gnus-group-name-charset-method-alist' for customization.
+
+** `gnus-group-charset-alist' and `gnus-group-ignored-charsets-alist'.
+
+The regexps in these variables are compared with full group names
+instead of real group names in 5.8.  Users who customize these variables
+should change those regexps accordingly.  For example:
+("^han\\>" euc-kr) -> ("\\(^\\|:\\)han\\>" euc-kr)
+
+
+
+* Changes in summary and article mode
+
+** `F' (`gnus-article-followup-with-original') and `R'
+(`gnus-article-reply-with-original') only yank the text in the region if
+the region is active.
+
+** In draft groups, `e' is now bound to `gnus-draft-edit-message'.  Use `B
+w' for `gnus-summary-edit-article' instead.
 
 ** Article Buttons
 
-More buttons for URLs, mail addresses, Message-IDs, Info links, man pages and
-Emacs or Gnus related references, see the info node "Article Buttons".  The
-variables `gnus-button-*-level' can be used to control the appearance of all
-article buttons, see the info node "Article Button Levels".
-
-** Dired integration
-
-`gnus-dired-minor-mode' installs key bindings in dired buffers to send a file
-as an attachment (`C-c C-m C-a'), open a file using the approriate mailcap
-entry (`C-c C-m C-l'), and print a file using the mailcap entry (`C-c C-m
-C-p').  See the info node "Other modes".
-
-
-** Gnus can display RSS newsfeeds as a newsgroup.  To get started do `B
-nnrss RET RET' in the Group buffer.
+More buttons for URLs, mail addresses, Message-IDs, Info links, man
+pages and Emacs or Gnus related references.  *Note Article Buttons::.
+The variables `gnus-button-*-level' can be used to control the
+appearance of all article buttons.  *Note Article Button Levels::.
 
 ** Single-part yenc encoded attachments can be decoded.
 
 ** Picons
-The picons code has been reimplemented to work in Emacs 21 -- some of
-the previous options have been removed or renamed.
+
+The picons code has been reimplemented to work in GNU Emacs--some of the
+previous options have been removed or renamed.
 
 Picons are small "personal icons" representing users, domain and
-newsgroups, which can be displayed in the Article buffer.  To enable
-picons, install the picons database from
-
-      http://www.cs.indiana.edu/picons/ftp/index.html
-
-and point `gnus-picon-databases' to that location.
-
-** If the new option `gnus-treat-body-boundary' is `head', a boundary
-line is drawn at the end of the headers.
+newsgroups, which can be displayed in the Article buffer.  *Note
+Picons::.
 
-** Retrieval of charters and control messages
-There are new commands for fetching newsgroup charters (`H c') and
-control messages (`H C').
-
-** Delayed articles
-You can delay the sending of a message with `C-c C-j' in the Message
-buffer.  The messages are delivered at specified time.  This is useful
-for sending yourself reminders.  Setup with (gnus-delay-initialize).
-
-** If `auto-compression-mode' is enabled, attachments are automatically
-decompressed when activated.
-
-** If the new option `nnml-use-compressed-files' is non-nil,
-the nnml back end allows compressed message files.
+** If the new option `gnus-treat-body-boundary' is non-`nil', a boundary
+line is drawn at the end of the headers.
 
 ** Signed article headers (X-PGP-Sig) can be verified with `W p'.
 
-** The Summary Buffer uses an arrow in the fringe to indicate the
-current article in Emacs 21 running on a graphical display.  Customize
-`gnus-summary-display-arrow' to disable it.
+** The Summary Buffer uses an arrow in the fringe to indicate the current
+article.  Use `(setq gnus-summary-display-arrow nil)' to disable it.
 
 ** Warn about email replies to news
+
 Do you often find yourself replying to news by email by mistake?  Then
 the new option `gnus-confirm-mail-reply-to-news' is just the thing for
 you.
 
-** If the new option `gnus-summary-display-while-building' is non-nil,
+** If the new option `gnus-summary-display-while-building' is non-`nil',
 the summary buffer is shown and updated as it's being built.
 
-** The new `recent' mark "." indicates newly arrived messages (as
-opposed to old but unread messages).
-
-** The new option `gnus-gcc-mark-as-read' automatically marks
-Gcc articles as read.
-
-** The nndoc back end now supports mailman digests and exim bounces.
+** The new `recent' mark `.' indicates newly arrived messages (as opposed
+to old but unread messages).
 
 ** Gnus supports RFC 2369 mailing list headers, and adds a number of
-related commands in mailing list groups.
+related commands in mailing list groups.  *Note Mailing List::.
 
-** The Date header can be displayed in a format that can be read aloud
-in English, see `gnus-treat-date-english'.
-
-** The envelope sender address can be customized when using Sendmail, see
-`message-sendmail-envelope-from'.
+** The Date header can be displayed in a format that can be read aloud in
+English.  *Note Article Date::.
 
 ** diffs are automatically highlighted in groups matching
 `mm-uu-diff-groups-regexp'
 
-** TLS wrapper shipped with Gnus
-
-TLS/SSL is now supported in IMAP and NNTP via tls.el and GNUTLS.  The
-old TLS/SSL support via (external third party) ssl.el and OpenSSL
-still works.
-
-** New make.bat for compiling and installing Gnus under MS Windows
-
-Use make.bat if you want to install Gnus under MS Windows, the first
-argument to the batch-program should be the directory where xemacs.exe
-respectively emacs.exe is located, iff you want to install Gnus after
-compiling it, give make.bat /copy as the second parameter.
-
-`make.bat' has been rewritten from scratch, it now features automatic
-recognition of XEmacs and GNU Emacs, generates gnus-load.el, checks if
-errors occur while compilation and generation of info files and reports
-them at the end of the build process.  It now uses makeinfo if it is
-available and falls back to infohack.el otherwise.  `make.bat' should now
-install all files which are necessary to run Gnus and be generally a
-complete replacement for the "configure; make; make install" cycle used
-under Unix systems.
-
-The new make.bat makes make-x.bat superfluous, so it has been removed.
-
-** Support for non-ASCII domain names
-
-Message supports non-ASCII domain names in From:, To: and Cc: and will
-encode them when you try to send a message.  The variable
-`message-use-idna' controls this.  Gnus will also decode non-ASCII
-domain names in From:, To: and Cc: when you view a message.  The
-variable `gnus-use-idna' controls this.
-
 ** Better handling of Microsoft citation styles
 
 Gnus now tries to recognize the mangled header block that some Microsoft
@@ -155,227 +204,183 @@
 `gnus-cite-unsightly-citation-regexp' matches the start of these
 citations.
 
-** gnus-article-skip-boring
-
-If you set `gnus-article-skip-boring' to t, then Gnus will not scroll
-down to show you a page that contains only boring text, which by
-default means cited text and signature.  You can customize what is
-skippable using `gnus-article-boring-faces'.
-
-This feature is especially useful if you read many articles that
-consist of a little new content at the top with a long, untrimmed
-message cited below.
-
-** The format spec %C for positioning point has changed to %*.
+The new command `W Y f' (`gnus-article-outlook-deuglify-article') allows
+deuglifying broken Outlook (Express) articles.
 
-** The new variable `gnus-parameters' can be used to set group parameters.
-
-Earlier this was done only via `G p' (or `G c'), which stored the
-parameters in ~/.newsrc.eld, but via this variable you can enjoy the
-powers of customize, and simplified backups since you set the variable
-in ~/.emacs instead of ~/.newsrc.eld.  The variable maps regular
-expressions matching group names to group parameters, a'la:
-
-     (setq gnus-parameters
-           '(("mail\\..*"
-              (gnus-show-threads nil)
-              (gnus-use-scoring nil))
-             ("^nnimap:\\(foo.bar\\)$"
-              (to-group . "\\1"))))
+** `gnus-article-skip-boring'
 
-** Smileys (":-)", ";-)" etc) are now iconized for Emacs too.
-
-Customize `gnus-treat-display-smileys' to disable it.
-
-** Gnus no longer generates the Sender: header automatically.
+If you set `gnus-article-skip-boring' to `t', then Gnus will not scroll
+down to show you a page that contains only boring text, which by default
+means cited text and signature.  You can customize what is skippable
+using `gnus-article-boring-faces'.
 
-Earlier it was generated iff the user configurable email address was
-different from the Gnus guessed default user address.  As the guessing
-algorithm is rarely correct these days, and (more controversially) the
-only use of the Sender: header was to check if you are entitled to
-cancel/supersede news (which is now solved by Cancel Locks instead,
-see another entry), generation of the header has been disabled by
-default.  See the variables `message-required-headers',
-`message-required-news-headers', and `message-required-mail-headers'.
-
-** Features from third party message-utils.el added to message.el.
-
-Message now asks if you wish to remove "(was: <old subject>)" from
-subject lines (see `message-subject-trailing-was-query').  C-c M-m and
-C-c M-f inserts markers indicating included text.  C-c C-f a adds a
-X-No-Archive: header.  C-c C-f x inserts appropriate headers and a
-note in the body for cross-postings and followups (see the variables
-`message-cross-post-*').
-
-** References and X-Draft-Headers are no longer generated when you
-start composing messages and `message-generate-headers-first' is nil.
-
-** Improved anti-spam features.
+This feature is especially useful if you read many articles that consist
+of a little new content at the top with a long, untrimmed message cited
+below.
 
-Gnus is now able to take out spam from your mail and news streams
-using a wide variety of programs and filter rules.  Among the supported
-methods are RBL blocklists, bogofilter and white/blacklists.  Hooks
-for easy use of external packages such as SpamAssassin and Hashcash
-are also new.
-
-** Easy inclusion of X-Faces headers.
-
-** In the summary buffer, the new command / N inserts new messages and
-/ o inserts old messages.
-
-** Gnus decodes morse encoded messages if you press W m.
+** Smileys (`:-)', `;-)' etc) are now displayed graphically in Emacs too.
 
-** Unread count correct in nnimap groups.
+Put `(setq gnus-treat-display-smileys nil)' in `~/.gnus.el' to disable
+it.
 
-The estimated number of unread articles in the group buffer should now
-be correct for nnimap groups.  This is achieved by calling
-`nnimap-fixup-unread-after-getting-new-news' from the
-`gnus-setup-news-hook' (called on startup) and
-`gnus-after-getting-new-news-hook' (called after getting new mail).
-If you have modified those variables from the default, you may want to
-add n-f-u-a-g-n-n again.  If you were happy with the estimate and want
-to save some (minimal) time when getting new mail, remove the
-function.
-
-** Group Carbon Copy (GCC) quoting
+** Face headers handling.  *Note Face::.
 
-To support groups that contains SPC and other weird characters, groups
-are quoted before they are placed in the Gcc: header.  This means
-variables such as `gnus-message-archive-group' should no longer
-contain quote characters to make groups containing SPC work.  Also, if
-you are using the string "nnml:foo, nnml:bar" (indicating Gcc into two
-groups) you must change it to return the list ("nnml:foo" "nnml:bar"),
-otherwise the Gcc: line will be quoted incorrectly.  Note that
-returning the string "nnml:foo, nnml:bar" was incorrect earlier, it
-just didn't generate any problems since it was inserted directly.
-
-** ~/News/overview/ not used.
-
-As a result of the following change, the ~/News/overview/ directory is
-not used any more.  You can safely delete the entire hierarchy.
-
-** gnus-agent
+** In the summary buffer, the new command `/ N' inserts new messages and `/
+o' inserts old messages.
 
-The Gnus Agent has seen a major update.  It is now enabled by default,
-and all nntp and nnimap servers from `gnus-select-method' and
-`gnus-secondary-select-method' are agentized by default.  Earlier only
-the server in `gnus-select-method' was agentized by the default, and the
-agent was disabled by default.  When the agent is enabled, headers are
-now also retrieved from the Agent cache instead of the backends when
-possible.  Earlier this only happened in the unplugged state.  You can
-enroll or remove servers with `J a' and `J r' in the server buffer.
-Gnus will not download articles into the Agent cache, unless you
-instruct it to do so, though, by using `J u' or `J s' from the Group
-buffer.  You revert to the old behaviour of having the Agent disabled
-by customizing `gnus-agent'.  Note that putting `(gnus-agentize)' in
-~/.gnus is not needed any more.
+** Gnus decodes morse encoded messages if you press `W m'.
 
-** gnus-summary-line-format
+** `gnus-summary-line-format'
 
-The default value changed to "%U%R%z%I%(%[%4L: %-23,23f%]%) %s\n".
+The default value changed to `%U%R%z%I%(%[%4L: %-23,23f%]%) %s\n'.
 Moreover `gnus-extra-headers', `nnmail-extra-headers' and
 `gnus-ignored-from-addresses' changed their default so that the users
-name will be replaced by the recipient's name or the group name
-posting to for NNTP groups.
-
-** deuglify.el (gnus-article-outlook-deuglify-article)
-
-A new file from Raymond Scholz <rscholz@zonix.de> for deuglifying
-broken Outlook (Express) articles.
-
-** (require 'gnus-load)
-
-If you use a stand-alone Gnus distribution, you'd better add
-"(require 'gnus-load)" to your ~/.emacs after adding the Gnus
-lisp directory into load-path.
-
-File gnus-load.el contains autoload commands, functions and variables,
-some of which may not be included in distributions of Emacsen.
-
-** gnus-slave-unplugged
+name will be replaced by the recipient's name or the group name posting
+to for NNTP groups.
 
-A new command which starts gnus offline in slave mode.
-
-** message-insinuate-rmail
-
-Adding (message-insinuate-rmail) in .emacs and customizing
-`mail-user-agent' to `gnus-user-agent' convinces Rmail to compose,
-reply and forward messages in Message mode, where you can enjoy the
-power of MML.
-
-** message-minibuffer-local-map
-
-The line below enables BBDB in resending a message:
-
-(define-key message-minibuffer-local-map [?\t] 'bbdb-complete-name)
-
-** Externalizing and deleting of attachments.
-
-If `gnus-gcc-externalize-attachments' (or
-`message-fcc-externalize-attachments') is non-nil, attach local files
-as external parts.
+** Deleting of attachments.
 
 The command `gnus-mime-save-part-and-strip' (bound to `C-o' on MIME
 buttons) saves a part and replaces the part with an external one.
 `gnus-mime-delete-part' (bound to `d' on MIME buttons) removes a part.
 It works only on back ends that support editing.
 
-** gnus-default-charset
+** `gnus-default-charset'
+
+The default value is determined from the `current-language-environment'
+variable, instead of `iso-8859-1'.  Also the `.*' item in
+`gnus-group-charset-alist' is removed.
+
+** Printing capabilities are enhanced.
+
+Gnus supports Muttprint natively with `O P' from the Summary and Article
+buffers.  Also, each individual MIME part can be printed using `p' on
+the MIME button.
+
+** Extended format specs.
+
+Format spec `%&user-date;' is added into
+`gnus-summary-line-format-alist'.  Also, user defined extended format
+specs are supported.  The extended format specs look like `%u&foo;',
+which invokes function `gnus-user-format-function-FOO'.  Because `&' is
+used as the escape character, old user defined format `%u&' is no longer
+supported.
+
+** `/ *' (`gnus-summary-limit-include-cached') is rewritten.
+
+It was aliased to `Y c' (`gnus-summary-insert-cached-articles').  The
+new function filters out other articles.
+
+** Some limiting commands accept a `C-u' prefix to negate the match.
+
+If `C-u' is used on subject, author or extra headers, i.e., `/ s', `/
+a', and `/ x' (`gnus-summary-limit-to-{subject,author,extra}')
+respectively, the result will be to display all articles that do not
+match the expression.
+
+** Gnus inlines external parts (message/external).
+
+
+
+* Changes in Message mode and related Gnus features
+
+** Delayed articles
+
+You can delay the sending of a message with `C-c C-j' in the Message
+buffer.  The messages are delivered at specified time.  This is useful
+for sending yourself reminders.  *Note Delayed Articles::.
+
+** If the new option `nnml-use-compressed-files' is non-`nil', the nnml
+back end allows compressed message files.
+
+** The new option `gnus-gcc-mark-as-read' automatically marks Gcc articles
+as read.
+
+** Externalizing of attachments
 
-The default value now guesses on the basis of your environment instead
-of using Latin-1.  Also the ".*" item in gnus-group-charset-alist is
-removed.
+If `gnus-gcc-externalize-attachments' or
+`message-fcc-externalize-attachments' is non-`nil', attach local files
+as external parts.
+
+** The envelope sender address can be customized when using Sendmail.
+ *Note Mail Variables: (message)Mail Variables.
+
+** Gnus no longer generate the Sender: header automatically.
+
+Earlier it was generated iff the user configurable email address was
+different from the Gnus guessed default user address.  As the guessing
+algorithm is rarely correct these days, and (more controversially) the
+only use of the Sender: header was to check if you are entitled to
+cancel/supersede news (which is now solved by Cancel Locks instead, see
+another entry), generation of the header has been disabled by default.
+See the variables `message-required-headers',
+`message-required-news-headers', and `message-required-mail-headers'.
+
+** Features from third party `message-utils.el' added to `message.el'.
+
+Message now asks if you wish to remove `(was: <old subject>)' from
+subject lines (see `message-subject-trailing-was-query').  `C-c M-m' and
+`C-c M-f' inserts markers indicating included text.  `C-c C-f a' adds a
+X-No-Archive: header.  `C-c C-f x' inserts appropriate headers and a
+note in the body for cross-postings and followups (see the variables
+`message-cross-post-*').
 
-** gnus-posting-styles
+** References and X-Draft-From headers are no longer generated when you
+start composing messages and `message-generate-headers-first' is `nil'.
+
+** Easy inclusion of X-Faces headers.  *Note X-Face::.
+
+** Group Carbon Copy (GCC) quoting
+
+To support groups that contains SPC and other weird characters, groups
+are quoted before they are placed in the Gcc: header.  This means
+variables such as `gnus-message-archive-group' should no longer contain
+quote characters to make groups containing SPC work.  Also, if you are
+using the string `nnml:foo, nnml:bar' (indicating Gcc into two groups)
+you must change it to return the list `("nnml:foo" "nnml:bar")',
+otherwise the Gcc: line will be quoted incorrectly.  Note that returning
+the string `nnml:foo, nnml:bar' was incorrect earlier, it just didn't
+generate any problems since it was inserted directly.
+
+** `message-insinuate-rmail'
+
+Adding `(message-insinuate-rmail)' and `(setq mail-user-agent
+'gnus-user-agent)' in `.emacs' convinces Rmail to compose, reply and
+forward messages in message-mode, where you can enjoy the power of MML.
+
+** `message-minibuffer-local-map'
+
+The line below enables BBDB in resending a message:
+(define-key message-minibuffer-local-map [(tab)]
+  'bbdb-complete-name)
+
+** `gnus-posting-styles'
 
 Add a new format of match like
-
-        ((header "to" "larsi.*org")
-         (Organization "Somewhere, Inc."))
-
+((header "to" "larsi.*org")
+ (Organization "Somewhere, Inc."))
 The old format like the lines below is obsolete, but still accepted.
+(header "to" "larsi.*org"
+   (Organization "Somewhere, Inc."))
 
-        (header "to" "larsi.*org"
-         (Organization "Somewhere, Inc."))
+** `message-ignored-news-headers' and `message-ignored-mail-headers'
 
-** message-ignored-news-headers and message-ignored-mail-headers
-
-X-Draft-From and X-Gnus-Agent-Meta-Information have been added into
+`X-Draft-From' and `X-Gnus-Agent-Meta-Information' have been added into
 these two variables.  If you customized those, perhaps you need add
 those two headers too.
 
-** Gnus reads the NOV and articles in the Agent if plugged.
-
-If one reads an article while plugged, and the article already exists
-in the Agent, it won't get downloaded once more.  Customize
-`gnus-agent-cache' to revert to the old behavior.
-
-** Gnus supports the "format=flowed" (RFC 2646) parameter.
-
-On composing messages, it is enabled by `use-hard-newlines'.  Decoding
-format=flowed was present but not documented in earlier versions.
+** Gnus supports the "format=flowed" (RFC 2646) parameter.  On composing
+messages, it is enabled by `use-hard-newlines'.  Decoding format=flowed
+was present but not documented in earlier versions.
 
 ** The option `mm-fill-flowed' can be used to disable treatment of
-format=flowed messages.  Also, flowed text is disabled when sending
-inline PGP signed messages.  (New in Gnus 5.10.8)
-
-** The tool bar icons are now (de)activated correctly in the group
-buffer, see the variable `gnus-group-update-tool-bar'.  It's default
-value depends on your Emacs version.  (New in Gnus 5.10.8)
-
-** Gnus supports the generation of RFC 2298 Disposition Notification requests.
+"format=flowed" messages.  Also, flowed text is disabled when sending
+inline PGP signed messages.  (New in Gnus 5.10.7)
 
-This is invoked with the C-c M-n key binding from message mode.
-
-** Gnus supports Maildir groups.
-
-Gnus includes a new backend nnmaildir.el.
+** Gnus supports the generation of RFC 2298 Disposition Notification
+requests.
 
-** Printing capabilities are enhanced.
-
-Gnus supports Muttprint natively with O P from the Summary and Article
-buffers.  Also, each individual MIME part can be printed using p on
-the MIME button.
+This is invoked with the `C-c M-n' key binding from message mode.
 
 ** Message supports the Importance: (RFC 2156) header.
 
@@ -384,151 +389,130 @@
 
 ** Gnus supports Cancel Locks in News.
 
-This means a header "Cancel-Lock" is inserted in news posting.  It is
-used to determine if you wrote a article or not (for cancelling and
+This means a header `Cancel-Lock' is inserted in news posting.  It is
+used to determine if you wrote an article or not (for canceling and
 superseding).  Gnus generates a random password string the first time
-you post a message, and saves it using the Custom system.  While the
-variable is called `canlock-password', it is not security sensitive
-data.  Publishing your canlock string on the web will not allow anyone
-to be able to anything she could not already do.  The behaviour can be
-changed by customizing `message-insert-canlock'.
-
-** Gnus supports server-side mail filtering using Sieve.
-
-Sieve rules can be added as Group Parameters for groups, and the
-complete Sieve script is generated using `D g' from the Group buffer,
-and then uploaded to the server using `C-c C-l' in the generated Sieve
-buffer.  Search the online Gnus manual for "sieve", and see the new
-Sieve manual, for more information.
-
-** Extended format specs.
-
-Format spec "%&user-date;" is added into
-`gnus-summary-line-format-alist'.  Also, user defined extended format
-specs are supported.  The extended format specs look like "%u&foo;",
-which invokes function `gnus-user-format-function-foo'.  Because "&" is
-used as the escape character, old user defined format "%u&" is no
-longer supported.
-
-** `/ *' (gnus-summary-limit-include-cached) is rewritten.
-
-It was aliased to `Y c' (gnus-summary-insert-cached-articles). The new
-function filters out other articles.
-
-** Some limiting commands accept a C-u prefix to negate the match.
+you post a message, and saves it in your `~/.emacs' using the Custom
+system.  While the variable is called `canlock-password', it is not
+security sensitive data.  Publishing your canlock string on the web will
+not allow anyone to be able to anything she could not already do.  The
+behavior can be changed by customizing `message-insert-canlock'.
 
-If C-u is used on subject, author or extra headers, i.e., `/ s', `/
-a', and `/ x' (gnus-summary-limit-to-{subject,author,extra})
-respectively, the result will be to display all articles that do not
-match the expression.
-
-** Group names are treated as UTF-8 by default.
-
-This is supposedly what USEFOR wanted to migrate to.  See
-`gnus-group-name-charset-group-alist' and
-`gnus-group-name-charset-method-alist' for customization.
-
-** The nnml and nnfolder backends store marks for each group.
-
-This makes it possible to take backup of nnml/nnfolder servers/groups
-separately of ~/.newsrc.eld, while preserving marks.  It also makes it
-possible to share articles and marks between users (without sharing
-the ~/.newsrc.eld file) within e.g. a department.  It works by storing
-the marks stored in ~/.newsrc.eld in a per-group file ".marks" (for
-nnml) and "groupname.mrk" (for nnfolder, named "groupname").  If the
-nnml/nnfolder is moved to another machine, Gnus will automatically use
-the .marks or .mrk file instead of the information in ~/.newsrc.eld.
-The new server variables `nnml-marks-is-evil' and
-`nnfolder-marks-is-evil' can be used to disable this feature.
-
-** The menu bar item (in Group and Summary buffer) named "Misc" has
-been renamed to "Gnus".
-
-** The menu bar item (in Message mode) named "MML" has been renamed to
-"Attachments".  Note that this menu also contains security related
-stuff, like signing and encryption.
-
-** gnus-group-charset-alist and gnus-group-ignored-charsets-alist.
-
-The regexps in these variables are compared with full group names
-instead of real group names in 5.8.  Users who customize these
-variables should change those regexps accordingly. For example:
-
-   ("^han\\>" euc-kr) -> ("\\(^\\|:\\)han\\>" euc-kr)
-
-** Gnus supports PGP (RFC 1991/2440), PGP/MIME (RFC 2015/3156) and
-S/MIME (RFC 2630-2633).
+** Gnus supports PGP (RFC 1991/2440), PGP/MIME (RFC 2015/3156) and S/MIME
+(RFC 2630-2633).
 
 It needs an external S/MIME and OpenPGP implementation, but no
-additional lisp libraries.  This add several menu items to the
-Attachments menu, and C-c RET key bindings, when composing messages.
+additional Lisp libraries.  This add several menu items to the
+Attachments menu, and `C-c RET' key bindings, when composing messages.
 This also obsoletes `gnus-article-hide-pgp-hook'.
 
-** Gnus inlines external parts (message/external).
-
 ** MML (Mime compose) prefix changed from `M-m' to `C-c C-m'.
 
 This change was made to avoid conflict with the standard binding of
 `back-to-indentation', which is also useful in message mode.
 
-** The default for message-forward-show-mml changed to symbol best.
+** The default for `message-forward-show-mml' changed to the symbol `best'.
+
+The behavior for the `best' value is to show MML (i.e., convert to MIME)
+when appropriate.  MML will not be used when forwarding signed or
+encrypted messages, as the conversion invalidate the digital signature.
+
+** If `auto-compression-mode' is enabled, attachments are automatically
+decompressed when activated.
+
+** Support for non-ASCII domain names
+
+Message supports non-ASCII domain names in From:, To: and Cc: and will
+query you whether to perform encoding when you try to send a message.
+The variable `message-use-idna' controls this.  Gnus will also decode
+non-ASCII domain names in From:, To: and Cc: when you view a message.
+The variable `gnus-use-idna' controls this.
+
+** You can now drag and drop attachments to the Message buffer.  See
+`mml-dnd-protocol-alist' and `mml-dnd-attach-options'.  *Note MIME:
+(message)MIME.
+
 
-The behaviour for the `best' value is to show MML (i.e., convert MIME
-to MML) when appropriate.  MML will not be used when forwarding signed
-or encrypted messages, as the conversion invalidate the digital
-signature.
+
+* Changes in back ends
+
+** Gnus can display RSS newsfeeds as a newsgroup.  *Note RSS::.
+
+** The nndoc back end now supports mailman digests and exim bounces.
+
+** Gnus supports Maildir groups.
+
+Gnus includes a new back end `nnmaildir.el'.  *Note Maildir::.
 
-** Bug fixes.
+** The nnml and nnfolder back ends store marks for each groups.
+
+This makes it possible to take backup of nnml/nnfolder servers/groups
+separately of `~/.newsrc.eld', while preserving marks.  It also makes it
+possible to share articles and marks between users (without sharing the
+`~/.newsrc.eld' file) within e.g. a department.  It works by storing the
+marks stored in `~/.newsrc.eld' in a per-group file `.marks' (for nnml)
+and `GROUPNAME.mrk' (for nnfolder, named GROUPNAME).  If the
+nnml/nnfolder is moved to another machine, Gnus will automatically use
+the `.marks' or `.mrk' file instead of the information in
+`~/.newsrc.eld'.  The new server variables `nnml-marks-is-evil' and
+`nnfolder-marks-is-evil' can be used to disable this feature.
+
 
 
-* Changes in Pterodactyl Gnus (5.8/5.9)
+* Appearance
 
-The Gnus NEWS entries are short, but they reflect sweeping changes in
-four areas: Article display treatment, MIME treatment,
-internationalization and mail-fetching.
+** The menu bar item (in Group and Summary buffer) named "Misc" has been
+renamed to "Gnus".
 
-** The mail-fetching functions have changed.  See the manual for the
-many details.  In particular, all procmail fetching variables are gone.
-
-If you used procmail like in
+** The menu bar item (in Message mode) named "MML" has been renamed to
+"Attachments".  Note that this menu also contains security related
+stuff, like signing and encryption (*note Security: (message)Security.).
 
-(setq nnmail-use-procmail t)
-(setq nnmail-spool-file 'procmail)
-(setq nnmail-procmail-directory "~/mail/incoming/")
-(setq nnmail-procmail-suffix "\\.in")
+** The tool bars have been updated to use GNOME icons in Group, Summary and
+Message mode.  You can also customize the tool bars.  This is a new
+feature in Gnus 5.10.9.  (Only for Emacs, not in XEmacs.)
 
-this now has changed to
+** The tool bar icons are now (de)activated correctly in the group buffer,
+see the variable `gnus-group-update-tool-bar'.  Its default value
+depends on your Emacs version.  This is a new feature in Gnus 5.10.9.
 
-(setq mail-sources
-      '((directory :path "~/mail/incoming/"
-		   :suffix ".in")))
+
+* Miscellaneous changes
+
+** `gnus-agent'
 
-More information is available in the info doc at Select Methods ->
-Getting Mail -> Mail Sources
-
-** Gnus is now a MIME-capable reader.  This affects many parts of
-Gnus, and adds a slew of new commands.  See the manual for details.
+The Gnus Agent has seen a major updated and is now enabled by default,
+and all nntp and nnimap servers from `gnus-select-method' and
+`gnus-secondary-select-method' are agentized by default.  Earlier only
+the server in `gnus-select-method' was agentized by the default, and the
+agent was disabled by default.  When the agent is enabled, headers are
+now also retrieved from the Agent cache instead of the back ends when
+possible.  Earlier this only happened in the unplugged state.  You can
+enroll or remove servers with `J a' and `J r' in the server buffer.
+Gnus will not download articles into the Agent cache, unless you
+instruct it to do so, though, by using `J u' or `J s' from the Group
+buffer.  You revert to the old behavior of having the Agent disabled
+with `(setq gnus-agent nil)'.  Note that putting `(gnus-agentize)' in
+`~/.gnus.el' is not needed any more.
 
-** Gnus has also been multilingualized.  This also affects too
-many parts of Gnus to summarize here, and adds many new variables.
-
-** gnus-auto-select-first can now be a function to be
-called to position point.
+** Gnus reads the NOV and articles in the Agent if plugged.
 
-** The user can now decide which extra headers should be included in
-summary buffers and NOV files.
+If one reads an article while plugged, and the article already exists in
+the Agent, it won't get downloaded once more.  `(setq gnus-agent-cache
+nil)' reverts to the old behavior.
 
-** `gnus-article-display-hook' has been removed.  Instead, a number
-of variables starting with `gnus-treat-' have been added.
+** Dired integration
 
-** The Gnus posting styles have been redone again and now works in a
-subtly different manner.
+`gnus-dired-minor-mode' (see *Note Other modes::) installs key bindings
+in dired buffers to send a file as an attachment, open a file using the
+appropriate mailcap entry, and print a file using the mailcap entry.
 
-** New web-based backends have been added: nnslashdot, nnwarchive
-and nnultimate.  nnweb has been revamped, again, to keep up with
-ever-changing layouts.
+** The format spec `%C' for positioning point has changed to `%*'.
 
-** Gnus can now read IMAP mail via nnimap.
+** `gnus-slave-unplugged'
+
+A new command which starts Gnus offline in slave mode.
+
 
 
 * For older news, see Gnus info node "New Features".
@@ -536,8 +520,8 @@
 ----------------------------------------------------------------------
 Copyright information:
 
-Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004,
-   2005, 2006 Free Software Foundation, Inc.
+Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+   2006 Free Software Foundation, Inc.
 
    Permission is granted to anyone to make or distribute verbatim copies
    of this document as received, in any medium, provided that the
--- a/etc/NEWS	Thu Aug 03 00:41:54 2006 +0000
+++ b/etc/NEWS	Thu Aug 03 11:45:23 2006 +0000
@@ -170,7 +170,6 @@
 Its name is `pt-br-refcard.tex'.  The corresponding PostScript file is
 also included.
 
-
 ---
 ** A French translation of the `Emacs Survival Guide' is available.
 
@@ -277,6 +276,13 @@
 all frames you create.  A position specified with --geometry only
 affects the initial frame.
 
+---
+** Emacs built for MS-Windows now behaves like Emacs on X does,
+wrt its frame position: if you don't specify a position (in your
+.emacs init file, in the Registry, or with the --geometry command-line
+option), Emacs leaves the frame position to the Windows' window
+manager.
+
 +++
 ** Emacs can now be invoked in full-screen mode on a windowed display.
 When Emacs is invoked on a window system, the new command-line options
@@ -313,6 +319,12 @@
 modified buffers, it saves the abbrevs too if they have changed.  It
 can do this either silently or asking for confirmation first,
 according to the value of `save-abbrevs'.
+
++++
+** If the environment variable EMAIL is defined, Emacs now uses its value
+to compute the default value of `user-mail-address', in preference to
+concatenation of `user-login-name' with the name of your host machine.
+
 
 * Incompatible Editing Changes in Emacs 22.1
 
@@ -3724,8 +3736,10 @@
 
 * Incompatible Lisp Changes in Emacs 22.1
 
-** The function find-operation-coding-system accepts a cons (FILENAME
-. BUFFER) in an argument correponding to the target.
+** The function find-operation-coding-system may be called with a cons
+(FILENAME . BUFFER) in the second argument if the first argument
+OPERATION is `insert-file-contents', and thus a function registered in
+`file-coding-system-alist' is also called with such an argument.
 
 ---
 ** The variables post-command-idle-hook and post-command-idle-delay have
@@ -4479,6 +4493,12 @@
 ** Input changes:
 
 +++
+*** The functions `read-event', `read-char', and `read-char-exclusive'
+have a new optional argument SECONDS.  If non-nil, this specifies a
+maximum time to wait for input, in seconds.  If no input arrives after
+this time elapses, the functions stop waiting and return nil.
+
++++
 *** An interactive specification can now use the code letter 'U' to get
 the up-event that was discarded in case the last key sequence read for a
 previous `k' or `K' argument was a down-event; otherwise nil is used.
@@ -4687,6 +4707,8 @@
 keymap alist separate from `minor-mode-map-alist' by adding their
 keymap alist to this list.
 
+*** The definition of a key-binding passed to define-key can use XEmacs-style
+key-sequences, such as [(control a)].
 ** Abbrev changes:
 
 +++
@@ -5416,6 +5438,11 @@
 property over the second half of the command to force (deferred)
 refontification of `bar' whenever the `e' is added/removed.
 
+*** `font-lock-extend-region-functions' makes it possible to alter the way
+the fontification region is chosen.  This can be used to prevent rounding
+up to whole lines, or to extend the region to include all related lines
+of multiline constructs so that such constructs get properly recognized.
+
 ** Major mode mechanism changes:
 
 +++
--- a/lib-src/ChangeLog	Thu Aug 03 00:41:54 2006 +0000
+++ b/lib-src/ChangeLog	Thu Aug 03 11:45:23 2006 +0000
@@ -1,3 +1,19 @@
+2002-07-30  Adrian Aichner  <adrian@xemacs.org>  (tiny change)
+
+	* etags.c: It's XEmacs, not Xemacs: change all the occurences.
+
+2006-07-30  Francesco Potort,Al(B  <pot@gnu.org>
+
+	* etags.c [ETAGS_REGEXPS]: Now is unconditionally defined.
+	[LONG_OPTIONS]: Changed to NO_LONG_OPTIONS, which is undefined.
+	(Objc_suffixes): Suggest using --lang=c for full help.
+	(C_entries): Initialise savetoken to 0 to shut up the compiler.
+
+2006-07-20  Andreas Schwab  <schwab@suse.de>
+
+	* fakemail.c (fatal): Drop second parameter and treat first
+	parameter as a plain string.  Callers changed.
+
 2006-07-18  Dan Nicolaescu  <dann@ics.uci.edu>
 
 	* ebrowse.c (usage, version): Mark as NO_RETURN.
--- a/lib-src/etags.c	Thu Aug 03 00:41:54 2006 +0000
+++ b/lib-src/etags.c	Thu Aug 03 11:45:23 2006 +0000
@@ -41,7 +41,7 @@
  * configuration file containing regexp definitions for etags.
  */
 
-char pot_etags_version[] = "@(#) pot revision number is 17.18";
+char pot_etags_version[] = "@(#) pot revision number is 17.20";
 
 #define	TRUE	1
 #define	FALSE	0
@@ -59,12 +59,10 @@
   /* On some systems, Emacs defines static as nothing for the sake
      of unexec.  We don't want that here since we don't use unexec. */
 # undef static
-# define ETAGS_REGEXPS		/* use the regexp features */
-# define LONG_OPTIONS		/* accept long options */
-# ifndef PTR			/* for Xemacs */
+# ifndef PTR			/* for XEmacs */
 #   define PTR void *
 # endif
-# ifndef __P			/* for Xemacs */
+# ifndef __P			/* for XEmacs */
 #   define __P(args) args
 # endif
 #else  /* no config.h */
@@ -82,14 +80,7 @@
 # define _GNU_SOURCE 1		/* enables some compiler checks on GNU */
 #endif
 
-#ifdef LONG_OPTIONS
-#  undef LONG_OPTIONS
-#  define LONG_OPTIONS TRUE
-#else
-#  define LONG_OPTIONS  FALSE
-#endif
-
-/* WIN32_NATIVE is for Xemacs.
+/* WIN32_NATIVE is for XEmacs.
    MSDOS, WINDOWSNT, DOS_NT are for Emacs. */
 #ifdef WIN32_NATIVE
 # undef MSDOS
@@ -167,25 +158,25 @@
 # define S_ISREG(m)	(((m) & S_IFMT) == S_IFREG)
 #endif
 
-#if LONG_OPTIONS
-# include <getopt.h>
-#else
+#ifdef NO_LONG_OPTIONS		/* define this if you don't have GNU getopt */
+# define NO_LONG_OPTIONS TRUE
 # define getopt_long(argc,argv,optstr,lopts,lind) getopt (argc, argv, optstr)
   extern char *optarg;
   extern int optind, opterr;
-#endif /* LONG_OPTIONS */
-
-#ifdef ETAGS_REGEXPS
-# ifndef HAVE_CONFIG_H		/* this is a standalone compilation */
-#   ifdef __CYGWIN__         	/* compiling on Cygwin */
+#else
+# define NO_LONG_OPTIONS FALSE
+# include <getopt.h>
+#endif /* NO_LONG_OPTIONS */
+
+#ifndef HAVE_CONFIG_H		/* this is a standalone compilation */
+# ifdef __CYGWIN__         	/* compiling on Cygwin */
 			     !!! NOTICE !!!
  the regex.h distributed with Cygwin is not compatible with etags, alas!
 If you want regular expression support, you should delete this notice and
 	      arrange to use the GNU regex.h and regex.c.
-#   endif
 # endif
-# include <regex.h>
-#endif /* ETAGS_REGEXPS */
+#endif
+#include <regex.h>
 
 /* Define CTAGS to make the program "ctags" compatible with the usual one.
  Leave it undefined to make the program "etags", which makes emacs-style
@@ -312,7 +303,6 @@
   char *what;			/* the argument itself */
 } argument;
 
-#ifdef ETAGS_REGEXPS
 /* Structure defining a regular expression. */
 typedef struct regexp
 {
@@ -327,7 +317,6 @@
   bool ignore_case;		/* ignore case when matching */
   bool multi_line;		/* do a multi-line match on the whole file */
 } regexp;
-#endif /* ETAGS_REGEXPS */
 
 
 /* Many compilers barf on this:
@@ -375,11 +364,9 @@
 static bool nocase_tail __P((char *));
 static void get_tag __P((char *, char **));
 
-#ifdef ETAGS_REGEXPS
 static void analyse_regex __P((char *));
 static void free_regexps __P((void));
 static void regex_tag_multiline __P((void));
-#endif /* ETAGS_REGEXPS */
 static void error __P((const char *, const char *));
 static void suggest_asking_for_help __P((void));
 void fatal __P((char *, char *));
@@ -485,14 +472,9 @@
 #define STDIN 0x1001		/* returned by getopt_long on --parse-stdin */
 static bool parsing_stdin;	/* --parse-stdin used */
 
-#ifdef ETAGS_REGEXPS
 static regexp *p_head;		/* list of all regexps */
 static bool need_filebuf;	/* some regexes are multi-line */
-#else
-# define need_filebuf FALSE
-#endif /* ETAGS_REGEXPS */
-
-#if LONG_OPTIONS
+
 static struct option longopts[] =
 {
   { "append",		  no_argument,	     NULL,	     	 'a'   },
@@ -507,11 +489,9 @@
   { "members",		  no_argument,	     &members, 	     	 TRUE  },
   { "no-members",	  no_argument,	     &members, 	     	 FALSE },
   { "output",		  required_argument, NULL,	     	 'o'   },
-#ifdef ETAGS_REGEXPS
   { "regex",		  required_argument, NULL,	     	 'r'   },
   { "no-regex",		  no_argument,	     NULL,	     	 'R'   },
   { "ignore-case-regex",  required_argument, NULL,	     	 'c'   },
-#endif /* ETAGS_REGEXPS */
   { "parse-stdin",        required_argument, NULL,               STDIN },
   { "version",		  no_argument,	     NULL,     	     	 'V'   },
 
@@ -533,7 +513,6 @@
 #endif
   { NULL }
 };
-#endif /* LONG_OPTIONS */
 
 static compressor compressors[] =
 {
@@ -681,13 +660,15 @@
 static char Objc_help [] =
 "In Objective C code, tags include Objective C definitions for classes,\n\
 class categories, methods and protocols.  Tags for variables and\n\
-functions in classes are named `CLASS::VARIABLE' and `CLASS::FUNCTION'.";
+functions in classes are named `CLASS::VARIABLE' and `CLASS::FUNCTION'.\n\
+(Use --help --lang=c --lang=objc --lang=java for full help.)";
 
 static char *Pascal_suffixes [] =
   { "p", "pas", NULL };
 static char Pascal_help [] =
 "In Pascal code, the tags are the functions and procedures defined\n\
 in the file.";
+/* " // this is for working around an Emacs highlighting bug... */
 
 static char *Perl_suffixes [] =
   { "pl", "pm", NULL };
@@ -885,11 +866,11 @@
   printf ("Usage: %s [options] [[regex-option ...] file-name] ...\n\
 \n\
 These are the options accepted by %s.\n", progname, progname);
-  if (LONG_OPTIONS)
-    puts ("You may use unambiguous abbreviations for the long option names.");
+  if (NO_LONG_OPTIONS)
+    puts ("WARNING: long option names do not work with this executable,\n\
+as it is not linked with GNU getopt.");
   else
-    puts ("Long option names do not work with this executable, as it is not\n\
-linked with GNU getopt.");
+    puts ("You may use unambiguous abbreviations for the long option names.");
   puts ("  A - as file name means read names from stdin (one per line).\n\
 Absolute names are stored in the output file as they are.\n\
 Relative ones are stored relative to the output file's directory.\n");
@@ -949,7 +930,6 @@
   puts ("--members\n\
 	Create tag entries for members of structures in some languages.");
 
-#ifdef ETAGS_REGEXPS
   puts ("-r REGEXP, --regex=REGEXP or --regex=@regexfile\n\
         Make a tag for each line matching a regular expression pattern\n\
 	in the following files.  {LANGUAGE}REGEXP uses REGEXP for LANGUAGE\n\
@@ -964,7 +944,6 @@
 	causes dot to match any character, including newline.");
   puts ("-R, --no-regex\n\
         Don't create tags from regexps for the following files.");
-#endif /* ETAGS_REGEXPS */
   puts ("-I, --ignore-indentation\n\
         In C and C++ do not assume that a closing brace in the first\n\
         column is the final brace of a function or structure definition.");
@@ -1194,14 +1173,8 @@
 
   /* When the optstring begins with a '-' getopt_long does not rearrange the
      non-options arguments to be at the end, but leaves them alone. */
-  optstring = "-";
-#ifdef ETAGS_REGEXPS
-  optstring = "-r:Rc:";
-#endif /* ETAGS_REGEXPS */
-  if (!LONG_OPTIONS)
-    optstring += 1;		/* remove the initial '-' */
-  optstring = concat (optstring,
-		      "aCf:Il:o:SVhH",
+  optstring = concat (NO_LONG_OPTIONS ? "" : "-",
+		      "ac:Cf:Il:o:r:RSVhH",
 		      (CTAGS) ? "BxdtTuvw" : "Di:");
 
   while ((opt = getopt_long (argc, argv, optstring, longopts, NULL)) != EOF)
@@ -1375,11 +1348,9 @@
 	case at_language:
 	  lang = argbuffer[i].lang;
 	  break;
-#ifdef ETAGS_REGEXPS
 	case at_regexp:
 	  analyse_regex (argbuffer[i].what);
 	  break;
-#endif
 	case at_filename:
 #ifdef VMS
 	  while ((this_file = gfnames (argbuffer[i].what, &got_err)) != NULL)
@@ -1419,9 +1390,7 @@
 	}
     }
 
-#ifdef ETAGS_REGEXPS
   free_regexps ();
-#endif /* ETAGS_REGEXPS */
   free (lb.buffer);
   free (filebuf.buffer);
   free (token_name.buffer);
@@ -1979,9 +1948,7 @@
 
   parser (inf);
 
-#ifdef ETAGS_REGEXPS
   regex_tag_multiline ();
-#endif /* ETAGS_REGEXPS */
 }
 
 
@@ -3239,7 +3206,7 @@
   int typdefbracelev;		/* bracelev where a typedef struct body begun */
   bool incomm, inquote, inchar, quotednl, midtoken;
   bool yacc_rules;		/* in the rules part of a yacc file */
-  struct tok savetoken;	        /* token saved during preprocessor handling */
+  struct tok savetoken = {0};	/* token saved during preprocessor handling */
 
 
   linebuffer_init (&lbs[0].lb);
@@ -5735,8 +5702,6 @@
 }
 
 
-#ifdef ETAGS_REGEXPS
-
 static char *scan_separators __P((char *));
 static void add_regex __P((char *, language *));
 static char *substitute __P((char *, char *, struct re_registers *));
@@ -6141,8 +6106,6 @@
     }
 }
 
-#endif /* ETAGS_REGEXPS */
-
 
 static bool
 nocase_tail (cp)
@@ -6405,7 +6368,6 @@
 	}
     } /* if #line directives should be considered */
 
-#ifdef ETAGS_REGEXPS
   {
     int match;
     regexp *rp;
@@ -6462,7 +6424,6 @@
 	    }
 	}
   }
-#endif /* ETAGS_REGEXPS */
 }
 
 
@@ -6623,7 +6584,7 @@
 suggest_asking_for_help ()
 {
   fprintf (stderr, "\tTry `%s %s' for a complete list of options.\n",
-	   progname, LONG_OPTIONS ? "--help" : "-h");
+	   progname, NO_LONG_OPTIONS ? "-h" : "--help");
   exit (EXIT_FAILURE);
 }
 
--- a/lib-src/fakemail.c	Thu Aug 03 00:41:54 2006 +0000
+++ b/lib-src/fakemail.c	Thu Aug 03 11:45:23 2006 +0000
@@ -175,10 +175,10 @@
 /* Print error message and exit.  */
 
 static void
-fatal (s1, s2)
-     char *s1, *s2;
+fatal (s1)
+     char *s1;
 {
-  error (s1, s2);
+  error ("%s", s1);
   exit (EXIT_FAILURE);
 }
 
@@ -190,7 +190,7 @@
 {
   long *result = (long *) malloc (((unsigned) size));
   if (result == ((long *) NULL))
-    fatal ("virtual memory exhausted", 0);
+    fatal ("virtual memory exhausted");
   return result;
 }
 
@@ -377,7 +377,7 @@
   tm = localtime (&idiotic_interface);
   if (! (tm && TM_YEAR_IN_ASCTIME_RANGE (tm->tm_year)
 	 && (the_date = asctime (tm))))
-    fatal ("current time is out of range", 0);
+    fatal ("current time is out of range");
   /* the_date has an unwanted newline at the end */
   date_length = strlen (the_date) - 1;
   the_date[date_length] = '\0';
--- a/lisp/ChangeLog	Thu Aug 03 00:41:54 2006 +0000
+++ b/lisp/ChangeLog	Thu Aug 03 11:45:23 2006 +0000
@@ -1,3 +1,398 @@
+2006-08-03  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* font-lock.el (font-lock-beg, font-lock-end)
+	(font-lock-extend-region-functions): New vars.
+	(font-lock-extend-region-multiline)
+	(font-lock-extend-region-wholelines): New functions.
+	(font-lock-default-fontify-region): Use them.
+	(font-lock-extend-jit-lock-region-after-change): Only round up
+	if font-lock-default-fontify-region will do it as well.
+
+	* font-lock.el (font-lock-extend-after-change-region-function):
+	Rename from font-lock-extend-region-function.
+	(font-lock-extend-region): Remove by inlining at call sites.
+	(font-lock-after-change-function): Don't needlessly round up to a whole
+	number of lines.
+	(font-lock-extend-jit-lock-region-after-change): Be more careful about
+	the boundary conditions and the interactions between the various ways
+	to extend the region.
+
+2006-08-02  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* jit-lock.el (jit-lock-fontify-now): Preserve the buffer's
+	modification status when forcing the second redisplay.
+
+2006-08-03  Kim F. Storm  <storm@cua.dk>
+
+	* edmacro.el (edmacro-fix-menu-commands): Ignore switch-frame.
+
+2006-08-02  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* pcvs-util.el (cvs-get-buffer-create): Obey `noreuse' even if `name'
+	doesn't look like a file name.
+
+	* complete.el (PC-expand-many-files): Avoid signalling an error when
+	the current directory doesn't exist.  Reported by Micha,Ak(Bl Cadilhac.
+
+2006-08-02  Andreas Schwab  <schwab@suse.de>
+
+	* bindings.el (mode-line-format): Simplify reference to vc-mode.
+
+2006-08-02  Nick Roberts  <nickrob@snap.net.nz>
+
+	* bindings.el (map): Make mode-line-buffer-identification-keymap
+	before defining propertized-buffer-identification.
+
+2006-08-01  Richard Stallman  <rms@gnu.org>
+
+	* bindings.el (mode-line-format): Adjust spacing around vc-mode.
+
+2006-08-02  Nick Roberts  <nickrob@snap.net.nz>
+
+	* progmodes/gdb-ui.el (gdb-find-source-frame): Make nil the
+	default value.
+	(gdb-find-source-frame): New function.
+	(menu): Add to menu bar.
+
+2006-08-01  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* font-core.el (font-lock-extend-region-function)
+	(font-lock-extend-region): Move to font-lock.el.
+
+	* font-lock.el (font-lock-extend-region-function)
+	(font-lock-extend-region): Move from font-core.el.  Simplify.
+
+	* jit-lock.el (jit-lock-fontify-now): Cause a second redisplay
+	if needed.
+	(jit-lock-start, jit-lock-end): New dynamic scoped vars.
+	(jit-lock-after-change-extend-region-functions): New hook.
+	(jit-lock-after-change): Use it instead of hard-coding font-lock code.
+
+	* font-lock.el (font-lock-extend-jit-lock-region-after-change): New fun.
+	(font-lock-turn-on-thing-lock): Use it.
+
+	* longlines.el (longlines-show-region): Make it work on read-only
+	buffers as well.
+
+2006-08-01  Nick Roberts  <nickrob@snap.net.nz>
+
+	* progmodes/gdb-ui.el (gdb-set-hollow): Check for gud-last-last-frame.
+
+2006-07-31  Richard Stallman  <rms@gnu.org>
+
+	* progmodes/vhdl-mode.el (vhdl-speedbar-display-directory)
+	(vhdl-speedbar-display-projects): Update old obsolete
+	speedbar variable names.
+
+2006-07-31  Nick Roberts  <nickrob@snap.net.nz>
+
+	* progmodes/gdb-ui.el (gdb-find-source-frame): New option.
+	(gdb-stopped): Use it.
+
+	* t-mouse.el (t-mouse-mode): Use set-process-query-on-exit-flag.
+
+2006-07-29  Chong Yidong  <cyd@stupidchicken.com>
+
+	* loadhist.el (unload-feature): Handle new `(t . SYMBOL)' format
+	for load-history elements.
+
+2006-07-29  Eli Zaretskii  <eliz@gnu.org>
+
+	* files.el (convert-standard-filename): For Cygwin, replace
+	characters not allowed in Windows file names.
+	(make-auto-save-file-name): Add Cygwin to the list of systems
+	where the auto-save file name needs to be run through
+	convert-standard-filename.
+
+2006-07-29  Lennart Borgman  <lennart.borgman.073@student.lu.se>
+
+	* window.el (bw-get-tree): Don't integerp subtree if it's nil.
+
+2006-07-28  Richard Stallman  <rms@gnu.org>
+
+	* bindings.el (mode-line-frame-identification)
+	(propertized-buffer-identification): Centralize the code
+	to initialize the variable.
+
+	* progmodes/grep.el (grep-default-command): Catch errors from
+	wildcard-to-regexp.
+
+2006-07-29  Kim F. Storm  <storm@cua.dk>
+
+	* progmodes/grep.el (grep-tag-default): New function.
+	(grep-default-command, grep-read-regexp): Use it.
+	(grep-read-files): Use car of grep-files-history or grep-files-aliases
+	as default if nothing else applies.
+
+2006-07-28  Bill Atkins  <atkinw@rpi.edu>  (tiny change)
+
+	* wdired.el (wdired-change-to-wdired-mode, wdired-change-to-dired-mode):
+	Throw error if buffer is not in Dired and Wdired mode, respectively.
+
+2006-07-28  Chong Yidong  <cyd@stupidchicken.com>
+
+	* cus-edit.el (custom-no-edit): Revert 2006-07-27 change, so that
+	self-insert-command keys don't activate buttons.
+	(custom-mode-map): Just don't bind "\C-m" to `custom-no-edit'.
+
+2006-07-29  Nick Roberts  <nickrob@snap.net.nz>
+
+	* progmodes/gdb-ui.el (gdb-info-breakpoints-custom): Use different
+	faces for enable character.
+
+2006-07-28  Nick Roberts  <nickrob@snap.net.nz>
+
+	* Makefile.in (recompile): Update comment to reflect change
+	on 2004-04-21.
+
+2006-07-27  Richard Stallman  <rms@gnu.org>
+
+	* cus-edit.el (customize-package-emacs-version-alist): Doc fix.
+	(customize-package-emacs-version): Change msg when pkg has no entry.
+	(custom-no-edit): On a button, do like widget-button-press.
+
+2006-07-27  Dan Nicolaescu  <dann@ics.uci.edu>
+
+	* term/xterm.el (terminal-init-xterm): Fix bindings for C-tab,
+	S-tab and C-S-tab.
+
+2006-07-28  Nick Roberts  <nickrob@snap.net.nz>
+
+	* progmodes/which-func.el (which-function): Fix documentation/
+	comment typo.
+
+2006-07-26  Richard Stallman  <rms@gnu.org>
+
+	* textmodes/ispell.el (ispell-word): If we replace the word,
+	move point to the end.  Insert before deleting.
+
+2006-07-26  Chong Yidong  <cyd@stupidchicken.com>
+
+	* subr.el (sit-for): Use new SECONDS arg of read-event instead of
+	a timer.
+
+2006-07-26  Mathias Dahl  <mathias.dahl@gmail.com>
+
+	* tumme.el (tumme-backward-image): Add prefix argument. Add error
+	when at first image.
+	(tumme-forward-image): Add prefix argument. Add error when at last
+	image.
+
+2006-07-25  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* tabify.el (tabify-regexp): Use more specific regexps.
+	(tabify): Avoid modifying the buffer unnecessarily.
+
+2006-07-25  Mathias Dahl  <mathias.dahl@gmail.com>
+
+	* tumme.el (tumme-track-original-file): Add `buffer-live-p' check.
+	(tumme-format-properties-string): Handle empty `buf'.
+	(tumme-get-comment): Change variable names inside `let'.
+	Add missing `let' variable that cause font-lock problems.
+	(tumme-write-comments): Change variable names inside `let'.
+	Add missing `let' variable that cause font-lock problems.
+	(tumme-forward-image): Rename from `tumme-forward-char'.
+	(tumme-backward-image): Rename from `tumme-backward-char'.
+
+2006-07-25  Masatake YAMATO  <jet@gyve.org>
+
+	* progmodes/ld-script.el (ld-script-keywords)
+	(ld-script-font-lock-keywords, ld-script-builtins): Update keywords
+	and add comments.
+
+2006-07-25  Nick Roberts  <nickrob@snap.net.nz>
+
+	* progmodes/gdb-ui.el (gdb-set-gud-minor-mode-existing-buffers)
+	(gdb-resync, gdb-prompt, gdb-starting, gdb-exited, gdb-stopped)
+	(gdb-set-gud-minor-mode-existing-buffers-1): Use different faces
+	for status indicator.
+
+2006-07-24  Richard Stallman  <rms@gnu.org>
+
+	* xml.el (xml-parse-file): Clean up, and use with-temp-buffer.
+
+	* subr.el (dolist, dotimes): Use interned symbols for locals.
+	(--dotimes-limit--, --dolist-tail--): New defvars.
+	(looking-back): Doc fix.
+
+	* replace.el (replace-match-string-symbols): Handle dotted lists.
+
+2006-07-24  mathias  <mathias@mattis>
+
+	* tumme.el (tumme-write-tags): Add.
+	(tumme-write-comments): Add.
+	(tumme-tag-files): Change to use `tumme-write-tags'.
+	(tumme-tag-thumbnail): Change to use `tumme-write-tags'.
+	(tumme-dired-comment-files): Change to use `tumme-write-comments'.
+	(tumme-save-information-from-widgets): Change to use
+	`tumme-write-comments' and `tumme-write-tags'.
+	(tumme-comment-thumbnail): Change to use `tumme-write-comments'.
+	(tumme-write-tag): Remove.
+	(tumme-write-comment): Remove.
+	(tumme-display-previous-thumbnail-original): Remove empty line.
+	(tumme-widget-list): Add punctuation.
+
+2006-07-24  mathias  <mathias.dahl@gmail.com>
+
+	* tumme.el (tumme-line-up): Add an extra check for end of buffer.
+
+2006-07-24  Daiki Ueno  <ueno@unixuser.org>
+
+	* pgg-def.el (pgg-truncate-key-identifier): Truncate the key ID to 8
+	letters from the end.  Thanks to "David Smith" <davidsmith@acm.org> and
+	andreas@altroot.de (Andreas V,Av(Bgele)
+
+2006-07-23  Thien-Thi Nguyen  <ttn@gnu.org>
+
+	* mouse.el (mouse-on-link-p): Doc fix.
+
+2006-07-23  Nick Roberts  <nickrob@snap.net.nz>
+
+	* emacs-lisp/find-func.el (find-function-search-for-symbol):
+	Handle "C-h f `".
+
+2006-07-22  Dan Nicolaescu  <dann@ics.uci.edu>
+
+	* ibuffer.el (ibuffer-formats): Use left alignment for the mode
+	column.
+
+2006-07-22  Matt Hodges  <MPHodges@member.fsf.org>
+
+	* textmodes/table.el: Add move-beginning-of-line and
+	move-end-of-line to Point Motion Only Group.
+
+2006-07-22  Eric Hanchrow  <offby1@blarg.net>
+
+	* progmodes/delphi.el (delphi-fill-comment): Use save-restriction.
+
+2006-07-22  Micha,Ak(Bl Cadilhac  <michael.cadilhac@lrde.org>
+
+	* startup.el (user-mail-address): Initialize from the `EMAIL'
+	environment variable first.  Document this.
+	(command-line): Ditto.
+
+2006-07-22  Nick Roberts  <nickrob@snap.net.nz>
+
+	* help-mode.el (help-function-def, help-variable-def)
+	(help-face-def): Print a message in the minibuffer.
+
+2006-07-21  Dan Nicolaescu  <dann@ics.uci.edu>
+
+	* term/xterm.el (terminal-init-xterm): Fix key bindings
+	syntax. Bind S-return, C-M-., C-TAB, S-TAB and C-S-TAB.
+
+2006-07-21  Eli Zaretskii  <eliz@gnu.org>
+
+	* dos-w32.el (find-buffer-file-type-coding-system): Support calls
+	where `(nth 1 command)' is a cons cell.  Doc fix.
+
+	* textmodes/po.el (po-find-charset): Doc fix.
+
+2006-07-21  Ken Manheimer  <ken.manheimer@gmail.com>
+
+	* allout.el (allout-unprotected, allout-e-o-prefix-p)
+	(allout-beginning-of-current-line, allout-end-of-current-line)
+	(allout-next-visible-heading, allout-open-topic)
+	(allout-kill-topic, allout-yank-processing, allout-resolve-xref)
+	(allout-flag-current-subtree, allout-show-to-offshoot)
+	(allout-hide-current-entry, allout-show-current-branches)
+	(allout-hide-region-body, allout-old-expose-topic)
+	(allout-listify-exposed, allout-latex-verbatim-quote-curr-line)
+	(allout-mark-topic, allout-adjust-file-variable): Enclose scopes
+	containing `beginning-of-line' and `end-of-line' with
+	`inhibit-field-text-motion' t.
+
+2006-07-21  Eli Zaretskii  <eliz@gnu.org>
+
+	* frame.el (focus-follows-mouse): Document that it doesn't have
+	any effect on MS-Windows.
+
+2006-07-20  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* progmodes/sh-script.el (sh-quoted-subshell): Further fix last change.
+
+2006-07-20  Jay Belanger  <belanger@truman.edu>
+
+	* calc.el (calc-previous-alg-entry):  Remove variable.
+
+	* calc-aent.el  (calc-alg-entry-history, calc-quick-calc-history):
+	New variables.
+	(calc-alg-entry): Use `calc-alg-entry-history'.
+	(calc-do-quick-calc): Use `calc-quick-calc-history'.
+	Remove reference to `calc-previous-alg-entry'.
+	(calcAlg-edit, calcAlg-enter): Remove reference to
+	`calc-previous-alg-entry'.
+	(calcAlg-previous): Use `previous-history-element' instead of
+	`calc-previous-alg-entry'.
+	(calc-do-alg-entry): Use history when calling `read-from-minibuffer'.
+	Change keybinding for `calcAlg-plus-minus', add keybindings for
+	`previous-history-element' and `next-history-element'.
+
+	* calc-rewr.el (calc-match): Remove reference to
+	`calc-previous-alg-entry'.
+
+	* calc-sel.el (calc-selection-history): New variable.
+	(calc-enter-selection, calc-sel-mult-both-sides)
+	(calc-sel-add-both-sides): Use `calc-selection-history'.
+
+	* calc-map.el (calc-get-operator-history): New variable.
+	(calc-get-operator): Use `calc-get-operator-history'.
+
+	* calcalg3.el (calc-curve-fit-history): New variable.
+	(calc-curve-fit): Use `calc-curve-fit-history'.
+
+2006-07-20  Kenichi Handa  <handa@m17n.org>
+
+	* international/mule-cmds.el (select-safe-coding-system): Fix the
+	way of deciding eol-type of the coding system.
+
+2006-07-20  Alan Mackenzie  <acm@muc.de>
+
+	* progmodes/cc-langs.el (c-emacs-variable-inits): New variable.
+	(c-lang-setvar): New macro.
+	(c-make-init-lang-vars-fun): Use the initialization forms in
+	c-emacs-variable-inits in addition to those in c-lang-variable-inits.
+	(comment-start, comment-end, comment-start-skip): Change these from
+	c-lang-defvar's to c-lang-setvar's.
+
+	* progmodes/cc-mode.el (c-make-emacs-variables-local): New macro,
+	which calls make-local-variable on the elements of
+	c-emacs-variable-inits.
+	(c-init-language-vars-for): Call this new macro.
+
+2006-07-19  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* progmodes/compile.el (compilation-error-regexp-alist-alist) <gnu>:
+	Try to rule out false positives due to time stamps.
+	(compilation-mode-font-lock-keywords): Remove rules made redundant
+	because of the above change.  Add `segmentation fault' to the known and
+	highlighted compilation termination messages.
+
+2006-07-19  Kim F. Storm  <storm@cua.dk>
+
+	* progmodes/grep.el (grep-find-ignored-directories):
+	Add .svn and _darcs to list.
+
+2006-07-19  Mathias Dahl  <mathias.dahl@gmail.com>
+
+	* dired.el (dired-mode-map): Add key binding `C-te' for
+	`tumme-dired-edit-comment-and-tags'.
+
+	* tumme.el (tumme-display-thumbnail-original-image): Make sure
+	image display buffer is displayed before call to
+	`tumme-display-image.
+	(tumme-dired-display-image): Make sure image display buffer is
+	displayed before call to `tumme-display-image.
+	(tumme-mouse-display-image): Make sure image display buffer is
+	displayed before call to `tumme-display-image.
+	(tumme-widget-list): Add.
+	(tumme-dired-edit-comment-and-tags): Add.
+	(tumme-save-information-from-widgets): Add.
+
+2006-07-19  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* progmodes/sh-script.el (sh-quoted-subshell): Fix last change.
+
 2006-07-18  Stefan Monnier  <monnier@iro.umontreal.ca>
 
 	* progmodes/sh-script.el (sh-font-lock-keywords-1):
--- a/lisp/Makefile.in	Thu Aug 03 00:41:54 2006 +0000
+++ b/lisp/Makefile.in	Thu Aug 03 11:45:23 2006 +0000
@@ -206,9 +206,8 @@
 
 compile-after-backup: backup-compiled-files compile-always
 
-# Recompile all Lisp files which are newer than their .elc files.
-# Note that this doesn't create .elc files.  It only recompiles if an
-# .elc is present.
+# Recompile all Lisp files which are newer than their .elc files and compile
+# new ones.
 
 recompile: doit mh-autoloads $(lisp)/progmodes/cc-mode.elc
 	LC_ALL=C $(EMACS) $(EMACSOPT) --eval "(batch-byte-recompile-directory 0)" $(lisp)
--- a/lisp/allout.el	Thu Aug 03 00:41:54 2006 +0000
+++ b/lisp/allout.el	Thu Aug 03 11:45:23 2006 +0000
@@ -1107,7 +1107,8 @@
 ;;;_   > allout-unprotected (expr)
 (defmacro allout-unprotected (expr)
   "Enable internal outline operations to alter invisible text."
-  `(let ((inhibit-read-only t))
+  `(let ((inhibit-read-only t)
+         (inhibit-field-text-motion t))
      ,expr))
 ;;;_   = allout-mode-hook
 (defvar allout-mode-hook nil
@@ -1920,7 +1921,8 @@
 ;;;_    > allout-e-o-prefix-p ()
 (defun allout-e-o-prefix-p ()
   "True if point is located where current topic prefix ends, heading begins."
-  (and (save-excursion (beginning-of-line)
+  (and (save-excursion (let ((inhibit-field-text-motion t))
+                         (beginning-of-line))
 		       (looking-at allout-regexp))
        (= (point)(save-excursion (allout-end-of-prefix)(point)))))
 ;;;_   : Location attributes
@@ -2024,22 +2026,24 @@
 
   ;; This combination of move-beginning-of-line and beginning-of-line is
   ;; deliberate, but the (beginning-of-line) may now be superfluous.
-  (move-beginning-of-line 1)
-  (beginning-of-line)
-  (while (and (not (bobp)) (or (not (bolp)) (allout-hidden-p)))
+  (let ((inhibit-field-text-motion t))
+    (move-beginning-of-line 1)
     (beginning-of-line)
-    (if (or (allout-hidden-p) (not (bolp)))
-        (forward-char -1))))
+    (while (and (not (bobp)) (or (not (bolp)) (allout-hidden-p)))
+      (beginning-of-line)
+      (if (or (allout-hidden-p) (not (bolp)))
+          (forward-char -1)))))
 ;;;_   > allout-end-of-current-line ()
 (defun allout-end-of-current-line ()
   "Move to the end of line, past concealed text if any."
   ;; XXX This is for symmetry with `allout-beginning-of-current-line' -
   ;; `move-end-of-line' doesn't suffer the same problem as
   ;; `move-beginning-of-line'.
-  (end-of-line)
-  (while (allout-hidden-p)
+  (let ((inhibit-field-text-motion t))
     (end-of-line)
-    (if (allout-hidden-p) (forward-char 1))))
+    (while (allout-hidden-p)
+      (end-of-line)
+      (if (allout-hidden-p) (forward-char 1)))))
 ;;;_   > allout-next-heading ()
 (defsubst allout-next-heading ()
   "Move to the heading for the topic \(possibly invisible) after this one.
@@ -2577,7 +2581,8 @@
 Move to buffer limit in indicated direction if headings are exhausted."
 
   (interactive "p")
-  (let* ((backward (if (< arg 0) (setq arg (* -1 arg))))
+  (let* ((inhibit-field-text-motion t)
+         (backward (if (< arg 0) (setq arg (* -1 arg))))
 	 (step (if backward -1 1))
 	 prev got)
 
@@ -3008,7 +3013,8 @@
   from there."
 
   (allout-beginning-of-current-line)
-  (let* ((depth (+ (allout-current-depth) relative-depth))
+  (let* ((inhibit-field-text-motion t)
+         (depth (+ (allout-current-depth) relative-depth))
          (opening-on-blank (if (looking-at "^\$")
                                (not (setq before nil))))
          ;; bunch o vars set while computing ref-topic
@@ -3626,7 +3632,8 @@
   ;; a lag *after* a kill has been performed.
 
   (interactive)
-  (let* ((collapsed (allout-current-topic-collapsed-p))
+  (let* ((inhibit-field-text-motion t)
+         (collapsed (allout-current-topic-collapsed-p))
          (beg (prog1 (allout-back-to-current-heading) (beginning-of-line)))
          (depth (allout-recent-depth)))
     (allout-end-of-current-subtree)
@@ -3676,7 +3683,8 @@
 					; region around subject:
   (if (< (allout-mark-marker t) (point))
       (exchange-point-and-mark))
-  (let* ((subj-beg (point))
+  (let* ((inhibit-field-text-motion t)
+         (subj-beg (point))
          (into-bol (bolp))
 	 (subj-end (allout-mark-marker t))
          (was-collapsed (get-text-property subj-beg 'allout-was-collapsed))
@@ -3845,7 +3853,8 @@
     (if (not (string= (allout-current-bullet) allout-file-xref-bullet))
         (error "Current heading lacks cross-reference bullet `%s'"
                allout-file-xref-bullet)
-      (let (file-name)
+      (let ((inhibit-field-text-motion t)
+            file-name)
         (save-excursion
           (let* ((text-start allout-recent-prefix-end)
                  (heading-end (progn (end-of-line) (point))))
@@ -3893,7 +3902,8 @@
 
   (save-excursion
     (allout-back-to-current-heading)
-    (end-of-line)
+    (let ((inhibit-field-text-motion t))
+      (end-of-line))
     (allout-flag-region (point)
                         ;; Exposing must not leave trailing blanks hidden,
                         ;; but can leave them exposed when hiding, so we
@@ -3982,7 +3992,8 @@
 Useful for coherently exposing to a random point in a hidden region."
   (interactive)
   (save-excursion
-    (let ((orig-pt (point))
+    (let ((inhibit-field-text-motion t)
+          (orig-pt (point))
 	  (orig-pref (allout-goto-prefix))
 	  (last-at (point))
 	  bag-it)
@@ -4014,7 +4025,8 @@
   (interactive)
   (allout-back-to-current-heading)
   (save-excursion
-    (end-of-line)
+    (let ((inhibit-field-text-motion t))
+      (end-of-line))
     (allout-flag-region (point)
                         (progn (allout-end-of-entry) (point))
                         t)))
@@ -4092,7 +4104,8 @@
 (defun allout-show-current-branches ()
   "Show all subheadings of this heading, but not their bodies."
   (interactive)
-  (beginning-of-line)
+  (let ((inhibit-field-text-motion t))
+    (beginning-of-line))
   (allout-show-children t))
 ;;;_   > allout-hide-current-leaves ()
 (defun allout-hide-current-leaves ()
@@ -4122,13 +4135,14 @@
     (save-restriction
       (narrow-to-region start end)
       (goto-char (point-min))
-      (while (not (eobp))
-        (end-of-line)
-	(allout-flag-region (point) (allout-end-of-entry) t)
-	(if (not (eobp))
-	    (forward-char
-	     (if (looking-at "\n\n")
-		 2 1)))))))
+      (let ((inhibit-field-text-motion t))
+        (while (not (eobp))
+          (end-of-line)
+          (allout-flag-region (point) (allout-end-of-entry) t)
+          (if (not (eobp))
+              (forward-char
+               (if (looking-at "\n\n")
+                   2 1))))))))
 
 ;;;_   > allout-expose-topic (spec)
 (defun allout-expose-topic (spec)
@@ -4281,7 +4295,8 @@
 Optional FOLLOWERS arguments dictate exposure for succeeding siblings."
 
   (interactive "xExposure spec: ")
-  (let ((depth (allout-current-depth))
+  (let ((inhibit-field-text-motion t)
+        (depth (allout-current-depth))
 	max-pos)
     (cond ((null spec) nil)
 	  ((symbolp spec)
@@ -4460,8 +4475,9 @@
   (interactive "r")
   (save-excursion
     (let*
-	;; state vars:
-	(strings prefix result depth new-depth out gone-out bullet beg
+        ((inhibit-field-text-motion t)
+         ;; state vars:
+         strings prefix result depth new-depth out gone-out bullet beg
 		 next done)
 
       (goto-char start)
@@ -4740,18 +4756,19 @@
 Adjust line contents so it is unaltered \(from the original line)
 across LaTeX processing, within the context of a `verbatim'
 environment.  Leaves point at the end of the line."
-  (beginning-of-line)
-  (let ((beg (point))
-	(end (progn (end-of-line)(point))))
-    (goto-char beg)
-    (while (re-search-forward "\\\\"
-	    ;;"\\\\\\|\\{\\|\\}\\|\\_\\|\\$\\|\\\"\\|\\&\\|\\^\\|\\-\\|\\*\\|#"
-			      end	; bounded by end-of-line
-			      1)	; no matches, move to end & return nil
-      (goto-char (match-beginning 0))
-      (insert "\\")
-      (setq end (1+ end))
-      (goto-char (1+ (match-end 0))))))
+  (let ((inhibit-field-text-motion t))
+    (beginning-of-line)
+    (let ((beg (point))
+          (end (progn (end-of-line)(point))))
+      (goto-char beg)
+      (while (re-search-forward "\\\\"
+                                ;;"\\\\\\|\\{\\|\\}\\|\\_\\|\\$\\|\\\"\\|\\&\\|\\^\\|\\-\\|\\*\\|#"
+                                end	; bounded by end-of-line
+                                1)   ; no matches, move to end & return nil
+        (goto-char (match-beginning 0))
+        (insert "\\")
+        (setq end (1+ end))
+        (goto-char (1+ (match-end 0)))))))
 ;;;_   > allout-insert-latex-header (buffer)
 (defun allout-insert-latex-header (buffer)
   "Insert initial LaTeX commands at point in BUFFER."
@@ -5599,7 +5616,8 @@
 (defun allout-mark-topic ()
   "Put the region around topic currently containing point."
   (interactive)
-  (beginning-of-line)
+  (let ((inhibit-field-text-motion t))
+    (beginning-of-line))
   (allout-goto-prefix)
   (push-mark (point))
   (allout-end-of-current-subtree)
@@ -5674,7 +5692,8 @@
                 allout-enable-file-variable-adjustment))
       nil
     (save-excursion
-      (let ((section-data (allout-file-vars-section-data))
+      (let ((inhibit-field-text-motion t)
+            (section-data (allout-file-vars-section-data))
             beg prefix suffix)
         (if section-data
             (setq beg (car section-data)
--- a/lisp/arc-mode.el	Thu Aug 03 00:41:54 2006 +0000
+++ b/lisp/arc-mode.el	Thu Aug 03 11:45:23 2006 +0000
@@ -892,10 +892,14 @@
 		    (save-excursion
 		      (funcall set-auto-coding-function
 			       filename (- (point-max) (point-min)))))
-	       ;; dos-w32.el defines find-operation-coding-system for
-	       ;; DOS/Windows systems which preserves the coding-system
-	       ;; of existing files.  We want it to act here as if the
-	       ;; extracted file existed.
+	       ;; dos-w32.el defines the function
+	       ;; find-buffer-file-type-coding-system for DOS/Windows
+	       ;; systems which preserves the coding-system of existing files.
+	       ;; (That function is called via file-coding-system-alist.)
+	       ;; Here, we want it to act as if the extracted file existed.
+	       ;; The following let-binding of file-name-handler-alist forces
+	       ;; find-file-not-found-set-buffer-file-coding-system to ignore
+	       ;; the file's name (see dos-w32.el).
 	       (let ((file-name-handler-alist
 		      '(("" . archive-file-name-handler))))
 		 (car (find-operation-coding-system
--- a/lisp/bindings.el	Thu Aug 03 00:41:54 2006 +0000
+++ b/lisp/bindings.el	Thu Aug 03 11:45:23 2006 +0000
@@ -209,14 +209,6 @@
 
 (make-variable-buffer-local 'mode-line-mule-info)
 
-(defvar mode-line-buffer-identification (purecopy '("%12b")) "\
-Mode-line control for identifying the buffer being displayed.
-Its default value is (\"%12b\").
-Major modes that edit things other than ordinary files may change this
-\(e.g. Info, Dired,...)")
-
-(make-variable-buffer-local 'mode-line-buffer-identification)
-
 (defvar mode-line-frame-identification '("-%F  ")
   "Mode-line control to describe the current frame.")
 
@@ -299,7 +291,8 @@
      'mode-line-buffer-identification
      (propertize "   " 'help-echo help-echo)
      'mode-line-position
-     `(vc-mode ("" vc-mode ,(propertize "   " 'help-echo help-echo)))
+     '(vc-mode vc-mode)
+     (propertize "  " 'help-echo help-echo)
      'mode-line-modes
      `(which-func-mode ("" which-func-format ,dashes))
      `(global-mode-string (,dashes global-mode-string))
@@ -337,6 +330,40 @@
 (defvar mode-line-buffer-identification-keymap nil "\
 Keymap for what is displayed by `mode-line-buffer-identification'.")
 
+;; Add menu of buffer operations to the buffer identification part
+;; of the mode line.or header line.
+;
+(let ((map (make-sparse-keymap)))
+  ;; Bind down- events so that the global keymap won't ``shine
+  ;; through''.
+  (define-key map [mode-line mouse-1] 'mode-line-previous-buffer)
+  (define-key map [header-line down-mouse-1] 'ignore)
+  (define-key map [header-line mouse-1] 'mode-line-previous-buffer)
+  (define-key map [header-line down-mouse-3] 'ignore)
+  (define-key map [mode-line mouse-3] 'mode-line-next-buffer)
+  (define-key map [header-line down-mouse-3] 'ignore)
+  (define-key map [header-line mouse-3] 'mode-line-next-buffer)
+  (setq mode-line-buffer-identification-keymap map))
+
+(defun propertized-buffer-identification (fmt)
+  "Return a list suitable for `mode-line-buffer-identification'.
+FMT is a format specifier such as \"%12b\".  This function adds
+text properties for face, help-echo, and local-map to it."
+  (list (propertize fmt
+		    'face 'mode-line-buffer-id
+		    'help-echo
+		    (purecopy "mouse-1: previous buffer, mouse-3: next buffer")
+		    'mouse-face 'mode-line-highlight
+		    'local-map mode-line-buffer-identification-keymap)))
+
+(defvar mode-line-buffer-identification (propertized-buffer-identification "%12b") "\
+Mode-line control for identifying the buffer being displayed.
+Its default value is (\"%12b\") with some text properties added.
+Major modes that edit things other than ordinary files may change this
+\(e.g. Info, Dired,...)")
+
+(make-variable-buffer-local 'mode-line-buffer-identification)
+
 (defun unbury-buffer () "\
 Switch to the last buffer in the buffer list."
   (interactive)
@@ -442,35 +469,6 @@
   (let ((indicator (car (nth 4 (car (cdr event))))))
     (describe-minor-mode-from-indicator indicator)))
 
-;; Add menu of buffer operations to the buffer identification part
-;; of the mode line.or header line.
-;
-(let ((map (make-sparse-keymap)))
-  ;; Bind down- events so that the global keymap won't ``shine
-  ;; through''.
-  (define-key map [mode-line mouse-1] 'mode-line-previous-buffer)
-  (define-key map [header-line down-mouse-1] 'ignore)
-  (define-key map [header-line mouse-1] 'mode-line-previous-buffer)
-  (define-key map [header-line down-mouse-3] 'ignore)
-  (define-key map [mode-line mouse-3] 'mode-line-next-buffer)
-  (define-key map [header-line down-mouse-3] 'ignore)
-  (define-key map [header-line mouse-3] 'mode-line-next-buffer)
-  (setq mode-line-buffer-identification-keymap map))
-
-(defun propertized-buffer-identification (fmt)
-  "Return a list suitable for `mode-line-buffer-identification'.
-FMT is a format specifier such as \"%12b\".  This function adds
-text properties for face, help-echo, and local-map to it."
-  (list (propertize fmt
-		    'face 'mode-line-buffer-id
-		    'help-echo
-		    (purecopy "mouse-1: previous buffer, mouse-3: next buffer")
-		    'mouse-face 'mode-line-highlight
-		    'local-map mode-line-buffer-identification-keymap)))
-
-(setq-default mode-line-buffer-identification
-	      (propertized-buffer-identification "%12b"))
-
 (defvar minor-mode-alist nil "\
 Alist saying how to show minor modes in the mode line.
 Each element looks like (VARIABLE STRING);
--- a/lisp/calc/calc-aent.el	Thu Aug 03 00:41:54 2006 +0000
+++ b/lisp/calc/calc-aent.el	Thu Aug 03 11:45:23 2006 +0000
@@ -32,7 +32,11 @@
 (require 'calc)
 (require 'calc-macs)
 
+(defvar calc-quick-calc-history nil
+  "The history list for quick-calc.")
+
 (defun calc-do-quick-calc ()
+  (require 'calc-ext)
   (calc-check-defines)
   (if (eq major-mode 'calc-mode)
       (calc-algebraic-entry t)
@@ -45,23 +49,12 @@
 	       (enable-recursive-minibuffers t)
 	       (calc-language (if (memq calc-language '(nil big))
 				  'flat calc-language))
-	       (entry (calc-do-alg-entry "" "Quick calc: " t))
-	       (alg-exp (mapcar (function
-				 (lambda (x)
-				   (if (and (not (featurep 'calc-ext))
-					    calc-previous-alg-entry
-					    (string-match
-					     "\\`[-0-9._+*/^() ]+\\'"
-					     calc-previous-alg-entry))
-				       (calc-normalize x)
-				     (require 'calc-ext)
-				     (math-evaluate-expr x))))
-				entry)))
+	       (entry (calc-do-alg-entry "" "Quick calc: " t 'calc-quick-calc-history))
+	       (alg-exp (mapcar 'math-evaluate-expr entry)))
 	  (when (and (= (length alg-exp) 1)
 		     (eq (car-safe (car alg-exp)) 'calcFunc-assign)
 		     (= (length (car alg-exp)) 3)
 		     (eq (car-safe (nth 1 (car alg-exp))) 'var))
-	    (require 'calc-ext)
 	    (set (nth 2 (nth 1 (car alg-exp))) (nth 2 (car alg-exp)))
 	    (calc-refresh-evaltos (nth 2 (nth 1 (car alg-exp))))
 	    (setq alg-exp (list (nth 2 (car alg-exp)))))
@@ -264,13 +257,16 @@
 	 (math-expr-opers (if prefix math-standard-opers math-expr-opers)))
      (calc-alg-entry (and auto (char-to-string last-command-char))))))
 
+(defvar calc-alg-entry-history nil
+  "History for algebraic entry.")
+
 (defun calc-alg-entry (&optional initial prompt)
   (let* ((sel-mode nil)
 	 (calc-dollar-values (mapcar 'calc-get-stack-element
 				     (nthcdr calc-stack-top calc-stack)))
 	 (calc-dollar-used 0)
 	 (calc-plain-entry t)
-	 (alg-exp (calc-do-alg-entry initial prompt t)))
+	 (alg-exp (calc-do-alg-entry initial prompt t 'calc-alg-entry-history)))
     (if (stringp alg-exp)
 	(progn
 	  (require 'calc-ext)
@@ -301,7 +297,7 @@
 
 (defvar calc-alg-exp)
 
-(defun calc-do-alg-entry (&optional initial prompt no-normalize)
+(defun calc-do-alg-entry (&optional initial prompt no-normalize history)
   (let* ((calc-buffer (current-buffer))
 	 (blink-paren-function 'calcAlg-blink-matching-open)
 	 (calc-alg-exp 'error))
@@ -319,15 +315,17 @@
     (define-key calc-alg-ent-map "\e" nil)
     (if (eq calc-algebraic-mode 'total)
 	(define-key calc-alg-ent-map "\e" calc-alg-ent-esc-map)
-      (define-key calc-alg-ent-map "\ep" 'calcAlg-plus-minus)
+      (define-key calc-alg-ent-map "\e+" 'calcAlg-plus-minus)
       (define-key calc-alg-ent-map "\em" 'calcAlg-mod)
       (define-key calc-alg-ent-map "\e=" 'calcAlg-equals)
       (define-key calc-alg-ent-map "\e\r" 'calcAlg-equals)
+      (define-key calc-alg-ent-map "\ep" 'previous-history-element)
+      (define-key calc-alg-ent-map "\en" 'next-history-element)
       (define-key calc-alg-ent-map "\e%" 'self-insert-command))
     (setq calc-aborted-prefix nil)
     (let ((buf (read-from-minibuffer (or prompt "Algebraic: ")
 				     (or initial "")
-				     calc-alg-ent-map nil)))
+				     calc-alg-ent-map nil history)))
       (when (eq calc-alg-exp 'error)
 	(when (eq (car-safe (setq calc-alg-exp (math-read-exprs buf))) 'error)
 	  (setq calc-alg-exp nil)))
@@ -355,9 +353,7 @@
 (defun calcAlg-previous ()
   (interactive)
   (if (calc-minibuffer-contains "\\'")
-      (if calc-previous-alg-entry
-	  (insert calc-previous-alg-entry)
-	(beep))
+      (previous-history-element 1)
     (insert "'")))
 
 (defun calcAlg-equals ()
@@ -384,7 +380,6 @@
 	   "\\`\\([^\"]*\"[^\"]*\"\\)*[^\"]*\"[^\"]*\\'"))
       (insert "`")
     (setq calc-alg-exp (minibuffer-contents))
-    (and (> (length calc-alg-exp) 0) (setq calc-previous-alg-entry calc-alg-exp))
     (exit-minibuffer)))
 
 (defvar calc-buffer)
@@ -407,7 +402,6 @@
       (setq calc-alg-exp (if (calc-minibuffer-contains "\\` *\\[ *\\'")
 			'((incomplete vec))
 		      exp))
-      (and (> (length str) 0) (setq calc-previous-alg-entry str))
       (exit-minibuffer))))
 
 (defun calcAlg-blink-matching-open ()
--- a/lisp/calc/calc-map.el	Thu Aug 03 00:41:54 2006 +0000
+++ b/lisp/calc/calc-map.el	Thu Aug 03 11:45:23 2006 +0000
@@ -498,6 +498,9 @@
 
 
 ;;; Return a list of the form (nargs func name)
+(defvar calc-get-operator-history nil
+  "History for calc-get-operator.")
+
 (defun calc-get-operator (msg &optional nargs)
   (setq calc-aborted-prefix nil)
   (let ((inv nil) (hyp nil) (prefix nil) (forcenargs nil)
@@ -583,7 +586,8 @@
 			    (let* ((calc-dollar-values calc-arg-values)
 				   (calc-dollar-used 0)
 				   (calc-hashes-used 0)
-				   (func (calc-do-alg-entry "" "Function: ")))
+				   (func (calc-do-alg-entry "" "Function: " nil
+                                                      'calc-get-operator-history)))
 			      (setq record-entry t)
 			      (or (= (length func) 1)
 				  (error "Bad format"))
--- a/lisp/calc/calc-rewr.el	Thu Aug 03 00:41:54 2006 +0000
+++ b/lisp/calc/calc-rewr.el	Thu Aug 03 11:45:23 2006 +0000
@@ -154,7 +154,6 @@
 	 (setq expr (calc-top-n 2)
 	       pat (calc-top-n 1)
 	       n 2)
-       (if interactive (setq calc-previous-alg-entry pat))
        (setq pat (if (stringp pat) (math-read-expr pat) pat))
        (if (eq (car-safe pat) 'error)
 	   (error "Bad format in expression: %s" (nth 1 pat)))
--- a/lisp/calc/calc-sel.el	Thu Aug 03 00:41:54 2006 +0000
+++ b/lisp/calc/calc-sel.el	Thu Aug 03 11:45:23 2006 +0000
@@ -633,6 +633,9 @@
      (setcar (nthcdr 2 entry) (and (not (eq sel (car entry))) sel))
      (calc-delete-selection num))))
 
+(defvar calc-selection-history nil
+  "History for calc selections.")
+
 (defun calc-enter-selection ()
   (interactive)
   (calc-wrapper
@@ -645,7 +648,8 @@
 	  alg)
      (let ((calc-dollar-values (list sel))
 	   (calc-dollar-used 0))
-       (setq alg (calc-do-alg-entry "" "Replace selection with: "))
+       (setq alg (calc-do-alg-entry "" "Replace selection with: " nil 
+                                    'calc-selection-history))
        (and alg
 	    (progn
 	      (setq alg (calc-encase-atoms (car alg)))
@@ -765,7 +769,8 @@
 		(car (calc-do-alg-entry ""
 					(if divide
 					    "Divide both sides by: "
-					  "Multiply both sides by: ")))))
+					  "Multiply both sides by: ")
+                                        nil 'calc-selection-history))))
      (and alg
 	  (progn
 	    (if (and (or (eq func '/)
@@ -830,7 +835,8 @@
 		(car (calc-do-alg-entry ""
 					(if subtract
 					    "Subtract from both sides: "
-					  "Add to both sides: ")))))
+					  "Add to both sides: ")
+                                        nil 'calc-selection-history))))
      (and alg
 	  (progn
 	    (if (and (assq func calc-tweak-eqn-table)
--- a/lisp/calc/calc.el	Thu Aug 03 00:41:54 2006 +0000
+++ b/lisp/calc/calc.el	Thu Aug 03 11:45:23 2006 +0000
@@ -886,7 +886,6 @@
   "Formatting function used for non-decimal numbers.")
 
 (defvar calc-last-kill nil)		; Last number killed in calc-mode.
-(defvar calc-previous-alg-entry nil)	; Previous algebraic entry.
 (defvar calc-dollar-values nil)		; Values to be used for '$'.
 (defvar calc-dollar-used nil)		; Highest order of '$' that occurred.
 (defvar calc-hashes-used nil)		; Highest order of '#' that occurred.
--- a/lisp/calc/calcalg3.el	Thu Aug 03 00:41:54 2006 +0000
+++ b/lisp/calc/calcalg3.el	Thu Aug 03 11:45:23 2006 +0000
@@ -103,6 +103,9 @@
 (defvar calc-curve-model)
 (defvar calc-curve-coefnames)
 
+(defvar calc-curve-fit-history nil
+  "History for calc-curve-fit.")
+
 (defun calc-curve-fit (arg &optional calc-curve-model 
                            calc-curve-coefnames calc-curve-varnames)
   (interactive "P")
@@ -259,7 +262,8 @@
 		    (let* ((calc-dollar-values calc-arg-values)
 			   (calc-dollar-used 0)
 			   (calc-hashes-used 0))
-		      (setq calc-curve-model (calc-do-alg-entry "" "Model formula: "))
+		      (setq calc-curve-model (calc-do-alg-entry "" "Model formula: "
+                                                        nil 'calc-curve-fit-history))
 		      (if (/= (length calc-curve-model) 1)
 			  (error "Bad format"))
 		      (setq calc-curve-model (car calc-curve-model)
--- a/lisp/complete.el	Thu Aug 03 00:41:54 2006 +0000
+++ b/lisp/complete.el	Thu Aug 03 11:45:23 2006 +0000
@@ -811,6 +811,12 @@
 (defun PC-expand-many-files (name)
   (with-current-buffer (generate-new-buffer " *Glob Output*")
     (erase-buffer)
+    (when (and (file-name-absolute-p name)
+               (not (file-directory-p default-directory)))
+      ;; If the current working directory doesn't exist `shell-command'
+      ;; signals an error.  So if the file names we're looking for don't
+      ;; depend on the working directory, switch to a valid directory first.
+      (setq default-directory "/"))
     (shell-command (concat "echo " name) t)
     (goto-char (point-min))
     ;; CSH-style shells were known to output "No match", whereas
--- a/lisp/cus-edit.el	Thu Aug 03 00:41:54 2006 +0000
+++ b/lisp/cus-edit.el	Thu Aug 03 11:45:23 2006 +0000
@@ -1087,18 +1087,24 @@
 ;; Packages will update this variable, so make it available.
 ;;;###autoload
 (defvar customize-package-emacs-version-alist nil
-  "Alist mapping versions of Emacs to versions of a package.
-These package versions are listed in the :package-version
-keyword used in `defcustom', `defgroup', and `defface'. Its
-elements look like this:
+  "Alist mapping versions of a package to Emacs versions.
+We use this for packages that have their own names, but are released
+as part of Emacs itself.
+
+Each elements looks like this:
 
      (PACKAGE (PVERSION . EVERSION)...)
 
-For each PACKAGE, which is a symbol, there are one or more
-elements that contain a package version PVERSION with an
-associated Emacs version EVERSION.  These versions are strings.
-For example, the MH-E package updates this alist with the
-following:
+Here PACKAGE is the name of a package, as a symbol.  After
+PACKAGE come one or more elements, each associating a
+package version PVERSION with the first Emacs version
+EVERSION in which it (or a subsequent version of PACKAGE)
+was first released.  Both PVERSION and EVERSION are strings.
+PVERSION should be a string that this package used in
+the :package-version keyword for `defcustom', `defgroup',
+and `defface'.
+
+For example, the MH-E package updates this alist as follows:
 
      (add-to-list 'customize-package-emacs-version-alist
                   '(MH-E (\"6.0\" . \"22.1\") (\"6.1\" . \"22.1\")
@@ -1173,11 +1179,10 @@
 	     since-version))))
 
 (defun customize-package-emacs-version (symbol package-version)
-  "Return Emacs version of SYMBOL.
-PACKAGE-VERSION has the form (PACKAGE . VERSION).  The VERSION of
-PACKAGE is looked up in the associated list
+  "Return the Emacs version in which SYMBOL's meaning last changed.
+PACKAGE-VERSION has the form (PACKAGE . VERSION).  We use
 `customize-package-emacs-version-alist' to find the version of
-Emacs that is associated with it."
+Emacs that is associated with version VERSION of PACKAGE."
   (let (package-versions emacs-version)
     ;; Use message instead of error since we want user to be able to
     ;; see the rest of the symbols even if a package author has
@@ -1193,9 +1198,9 @@
                       (cdr package-version)
                       "customize-package-emacs-version-alist")))
           (t
-           (message "Package %s neglected to update %s"
+           (message "Package %s version %s lists no corresponding Emacs version"
                     (car package-version)
-                    "customize-package-emacs-version-alist")))
+                    (cdr package-version))))
     emacs-version))
 
 (defun customize-version-lessp (version1 version2)
@@ -4430,9 +4435,7 @@
   ;; Actually, this misfeature of dense keymaps was fixed on 2001-11-26.
   (let ((map (make-keymap)))
     (set-keymap-parent map widget-keymap)
-    (define-key map [remap self-insert-command]
-      'custom-no-edit)
-    (define-key map "\^m" 'custom-no-edit)
+    (define-key map [remap self-insert-command] 'custom-no-edit)
     (define-key map " " 'scroll-up)
     (define-key map "\177" 'scroll-down)
     (define-key map "\C-c\C-c" 'Custom-set)
@@ -4444,9 +4447,9 @@
     map)
   "Keymap for `custom-mode'.")
 
-(defun custom-no-edit ()
-  "Refuse to allow editing of Custom buffer."
-  (interactive)
+(defun custom-no-edit (pos &optional event)
+  "Invoke button at POS, or refuse to allow editing of Custom buffer."
+  (interactive "@d")
   (error "You can't edit this part of the Custom buffer"))
 
 (easy-menu-define Custom-mode-menu
--- a/lisp/dired.el	Thu Aug 03 00:41:54 2006 +0000
+++ b/lisp/dired.el	Thu Aug 03 11:45:23 2006 +0000
@@ -1260,6 +1260,7 @@
     (define-key map "\C-tc" 'tumme-dired-comment-files)
     (define-key map "\C-tf" 'tumme-mark-tagged-files)
     (define-key map "\C-t\C-t" 'tumme-dired-insert-marked-thumbs)
+    (define-key map "\C-te" 'tumme-dired-edit-comment-and-tags)
 
     ;; Make menu bar items.
 
--- a/lisp/dos-w32.el	Thu Aug 03 00:41:54 2006 +0000
+++ b/lisp/dos-w32.el	Thu Aug 03 11:45:23 2006 +0000
@@ -88,10 +88,13 @@
 (setq-default buffer-file-coding-system 'undecided-dos)
 
 (defun find-buffer-file-type-coding-system (command)
-  "Choose a coding system for a file operation.
-If COMMAND is `insert-file-contents', the coding system is chosen based
-upon the filename, the contents of `untranslated-filesystem-list' and
-`file-name-buffer-file-type-alist', and whether the file exists:
+  "Choose a coding system for a file operation in COMMAND.
+COMMAND is a list that specifies the operation, and I/O primitive as its
+CAR, and the arguments that might be given to that operation as its CDR.
+If operation is `insert-file-contents', the coding system is chosen based
+upon the filename (the CAR of the arguments beyond the operation), the contents
+of `untranslated-filesystem-list' and `file-name-buffer-file-type-alist',
+and whether the file exists:
 
   If it matches in `untranslated-filesystem-list':
     If the file exists:					`undecided'
@@ -103,7 +106,7 @@
     If the file exists:					`undecided'
     If the file does not exist:	       default-buffer-file-coding-system
 
-If COMMAND is `write-region', the coding system is chosen based upon
+If operation is `write-region', the coding system is chosen based upon
 the value of `buffer-file-coding-system' and `buffer-file-type'. If
 `buffer-file-coding-system' is non-nil, its value is used.  If it is
 nil and `buffer-file-type' is t, the coding system is `no-conversion'.
@@ -126,6 +129,13 @@
 	(undecided nil) (undecided-unix nil))
     (cond ((eq op 'insert-file-contents)
 	   (setq target (nth 1 command))
+	   ;; If TARGET is a cons cell, it has the form (FILENAME . BUFFER),
+	   ;; where BUFFER is a buffer into which the file was already read,
+	   ;; but its contents were not yet decoded.  (This form of the
+	   ;; arguments is used, e.g., in arc-mode.el.)  This function
+	   ;; doesn't care about the contents, it only looks at the file's
+	   ;; name, which is the CAR of the cons cell.
+	   (if (consp target) (setq target (car target)))
 	   ;; First check for a file name that indicates
 	   ;; it is truly binary.
 	   (setq binary (find-buffer-file-type target))
--- a/lisp/edmacro.el	Thu Aug 03 00:41:54 2006 +0000
+++ b/lisp/edmacro.el	Thu Aug 03 11:45:23 2006 +0000
@@ -670,6 +670,7 @@
 	  (cond ((atom ev)
 		 (push ev result))
 		((eq (car ev) 'help-echo))
+		((eq (car ev) 'switch-frame))
 		((equal ev '(menu-bar))
 		 (push 'menu-bar result))
 		((equal (cadadr ev) '(menu-bar))
--- a/lisp/emacs-lisp/find-func.el	Thu Aug 03 00:41:54 2006 +0000
+++ b/lisp/emacs-lisp/find-func.el	Thu Aug 03 11:45:23 2006 +0000
@@ -226,7 +226,12 @@
 	   (regexp-symbol (cdr (assq type find-function-regexp-alist))))
       (with-current-buffer (find-file-noselect filename)
 	(let ((regexp (format (symbol-value regexp-symbol)
-			      (regexp-quote (symbol-name symbol))))
+			      ;; Entry for ` (backquote) macro in loaddefs.el,
+			      ;; (defalias (quote \`)..., has a \ but
+			      ;; (symbol-name symbol) doesn't.  Add an
+			      ;; optional \ to catch this.
+			      (concat "\\\\?"
+				      (regexp-quote (symbol-name symbol)))))
 	      (case-fold-search))
 	  (with-syntax-table emacs-lisp-mode-syntax-table
 	    (goto-char (point-min))
--- a/lisp/erc/ChangeLog	Thu Aug 03 00:41:54 2006 +0000
+++ b/lisp/erc/ChangeLog	Thu Aug 03 11:45:23 2006 +0000
@@ -1,3 +1,40 @@
+2006-08-02  Michael Olson  <mwolson@gnu.org>
+
+	* erc.el (erc-version-string): Release ERC 5.1.4.
+
+	* Makefile, NEWS, erc.texi: Update for the 5.1.4 release.
+
+	* erc.el (erc-active-buffer): Fix bug that caused messages to go
+	to the wrong buffer.  Thanks to offby1 for the report.
+
+	* erc-backend.el (erc-coding-system-for-target): Handle case where
+	target is nil.  Thanks to Kai Fan for the patch.
+
+2006-07-29  Michael Olson  <mwolson@gnu.org>
+
+	* erc-log.el (erc-log-setup-logging): Don't offer to save the
+	buffer.  It will be saved automatically killed.  Thanks to Johan
+	Bockgård and Tassilo Horn for pointing this out.
+
+2006-07-27  Johan Bockgård  <bojohan@users.sourceforge.net>
+
+	* erc.el (define-erc-module): Make find-function and find-variable
+	find the names constructed by `define-erc-module' in Emacs 22.
+
+2006-07-14  Michael Olson  <mwolson@gnu.org>
+
+	* erc-log.el (log): Make sure that we enable logging on
+	already-opened buffers as well, in case the user toggles this
+	module after loading ERC.  Also be sure to remove logging ability
+	from all ERC buffers when the module is disabled.
+	(erc-log-setup-logging): Set buffer-file-name to nil rather than
+	the empty string.  This should fix some errors that occur when
+	quitting Emacs without first killing all ERC buffers.
+	(erc-log-disable-logging): New function that removes the logging
+	ability from the current buffer.
+
+	* erc-spelling.el (spelling): Use dolist and buffer-live-p.
+
 2006-07-12  Michael Olson  <mwolson@gnu.org>
 
 	* erc-match.el (erc-log-matches): Bind inhibit-read-only rather
--- a/lisp/erc/erc-backend.el	Thu Aug 03 00:41:54 2006 +0000
+++ b/lisp/erc/erc-backend.el	Thu Aug 03 11:45:23 2006 +0000
@@ -563,11 +563,12 @@
   "Return the coding system or cons cell appropriate for TARGET.
 This is determined via `erc-encoding-coding-alist' or
 `erc-server-coding-system'."
-  (or (let ((case-fold-search t))
-        (catch 'match
-          (dolist (pat erc-encoding-coding-alist)
-            (when (string-match (car pat) target)
-              (throw 'match (cdr pat))))))
+  (or (when target
+        (let ((case-fold-search t))
+          (catch 'match
+            (dolist (pat erc-encoding-coding-alist)
+              (when (string-match (car pat) target)
+                (throw 'match (cdr pat)))))))
       (and (functionp erc-server-coding-system)
            (funcall erc-server-coding-system))
       erc-server-coding-system))
--- a/lisp/erc/erc-log.el	Thu Aug 03 00:41:54 2006 +0000
+++ b/lisp/erc/erc-log.el	Thu Aug 03 11:45:23 2006 +0000
@@ -218,7 +218,10 @@
    (add-hook 'erc-quit-hook 'erc-conditional-save-queries)
    (add-hook 'erc-part-hook 'erc-conditional-save-buffer)
    ;; append, so that 'erc-initialize-log-marker runs first
-   (add-hook 'erc-connect-pre-hook 'erc-log-setup-logging 'append))
+   (add-hook 'erc-connect-pre-hook 'erc-log-setup-logging 'append)
+   (dolist (buffer (erc-buffer-list))
+     (when (buffer-live-p buffer)
+       (with-current-buffer buffer (erc-log-setup-logging)))))
   ;; disable
   ((remove-hook 'erc-insert-post-hook 'erc-save-buffer-in-logs)
    (remove-hook 'erc-send-post-hook 'erc-save-buffer-in-logs)
@@ -226,7 +229,10 @@
    (remove-hook 'erc-kill-channel-hook 'erc-save-buffer-in-logs)
    (remove-hook 'erc-quit-hook 'erc-conditional-save-queries)
    (remove-hook 'erc-part-hook 'erc-conditional-save-buffer)
-   (remove-hook 'erc-connect-pre-hook 'erc-log-setup-logging)))
+   (remove-hook 'erc-connect-pre-hook 'erc-log-setup-logging)
+   (dolist (buffer (erc-buffer-list))
+     (when (buffer-live-p buffer)
+       (with-current-buffer buffer (erc-log-disable-logging))))))
 
 (define-key erc-mode-map "\C-c\C-l" 'erc-save-buffer-in-logs)
 
@@ -236,8 +242,7 @@
 This function is destined to be run from `erc-connect-pre-hook'."
   (when (erc-logging-enabled)
     (auto-save-mode -1)
-    (setq buffer-offer-save t
-	  buffer-file-name "")
+    (setq buffer-file-name nil)
     (set (make-local-variable 'write-file-functions)
 	 '(erc-save-buffer-in-logs))
     (when erc-log-insert-log-on-open
@@ -245,6 +250,12 @@
 		     (move-marker erc-last-saved-position
 				  (1- (point-max)))))))
 
+(defun erc-log-disable-logging ()
+  "Disable logging in the current buffer."
+  (when (erc-logging-enabled)
+    (setq buffer-offer-save nil
+	  erc-enable-logging nil)))
+
 (defun erc-log-all-but-server-buffers (buffer)
   "Returns t if logging should be enabled in BUFFER.
 Returns nil iff `erc-server-buffer-p' returns t."
--- a/lisp/erc/erc-spelling.el	Thu Aug 03 00:41:54 2006 +0000
+++ b/lisp/erc/erc-spelling.el	Thu Aug 03 11:45:23 2006 +0000
@@ -40,15 +40,13 @@
   ;; Use erc-connect-pre-hook instead of erc-mode-hook as pre-hook is
   ;; called AFTER the server buffer is initialized.
   ((add-hook 'erc-connect-pre-hook 'erc-spelling-init)
-   (mapc (lambda (buffer)
-           (when buffer
-             (with-current-buffer buffer (erc-spelling-init))))
-         (erc-buffer-list)))
+   (dolist (buffer (erc-buffer-list))
+     (when (buffer-live-p buffer)
+       (with-current-buffer buffer (erc-spelling-init)))))
   ((remove-hook 'erc-connect-pre-hook 'erc-spelling-init)
-   (mapc (lambda (buffer)
-           (when buffer
-             (with-current-buffer buffer (flyspell-mode 0))))
-         (erc-buffer-list))))
+   (dolist (buffer (erc-buffer-list))
+     (when (buffer-live-p buffer)
+       (with-current-buffer buffer (flyspell-mode 0))))))
 
 (defcustom erc-spelling-dictionaries nil
   "An alist mapping buffer names to dictionaries.
--- a/lisp/erc/erc.el	Thu Aug 03 00:41:54 2006 +0000
+++ b/lisp/erc/erc.el	Thu Aug 03 11:45:23 2006 +0000
@@ -67,7 +67,7 @@
 
 ;;; Code:
 
-(defconst erc-version-string "Version 5.1.3"
+(defconst erc-version-string "Version 5.1.4"
   "ERC version.  This is used by function `erc-version'.")
 
 (eval-when-compile (require 'cl))
@@ -1243,7 +1243,11 @@
 		(format "erc-%s-mode"
 			(downcase (symbol-name alias)))))
 	     (quote
-	      ,mode))))))
+	      ,mode)))
+       ;; For find-function and find-variable.
+       (put ',mode    'definition-name ',name)
+       (put ',enable  'definition-name ',name)
+       (put ',disable 'definition-name ',name))))
 
 (put 'define-erc-module 'doc-string-elt 3)
 
@@ -1388,8 +1392,8 @@
 Defaults to the server buffer."
   (with-current-buffer (erc-server-buffer)
     (if (buffer-live-p erc-active-buffer)
-	erc-active-buffer)
-    (setq erc-active-buffer (current-buffer))))
+	erc-active-buffer
+      (setq erc-active-buffer (current-buffer)))))
 
 (defun erc-set-active-buffer (buffer)
   "Set the value of `erc-active-buffer' to BUFFER."
--- a/lisp/files.el	Thu Aug 03 00:41:54 2006 +0000
+++ b/lisp/files.el	Thu Aug 03 11:45:23 2006 +0000
@@ -540,13 +540,21 @@
 
 This function's standard definition is trivial; it just returns
 the argument.  However, on Windows and DOS, replace invalid
-characters.  On DOS, make sure to obey the 8.3 limitations.  On
-Windows, turn Cygwin names into native names, and also turn
-slashes into backslashes if the shell requires it (see
+characters.  On DOS, make sure to obey the 8.3 limitations.
+In the native Windows build, turn Cygwin names into native names,
+and also turn slashes into backslashes if the shell requires it (see
 `w32-shell-dos-semantics').
 
 See Info node `(elisp)Standard File Names' for more details."
-  filename)
+  (if (eq system-type 'cygwin)
+      (let ((name (copy-sequence filename))
+	    (start 0))
+	;; Replace invalid filename characters with !
+	(while (string-match "[?*:<>|\"\000-\037]" name start)
+	  (aset name (match-beginning 0) ?!)
+	  (setq start (match-end 0)))
+	name)
+    filename))
 
 (defun read-directory-name (prompt &optional dir default-dirname mustmatch initial)
   "Read directory name, prompting with PROMPT and completing in directory DIR.
@@ -4368,7 +4376,7 @@
 			    "#")))
 	    ;; Make sure auto-save file names don't contain characters
 	    ;; invalid for the underlying filesystem.
-	    (if (and (memq system-type '(ms-dos windows-nt))
+	    (if (and (memq system-type '(ms-dos windows-nt cygwin))
 		     ;; Don't modify remote (ange-ftp) filenames
 		     (not (string-match "^/\\w+@[-A-Za-z0-9._]+:" result)))
 		(convert-standard-filename result)
@@ -4403,7 +4411,7 @@
 		      ((file-writable-p default-directory) default-directory)
 		      ((file-writable-p "/var/tmp/") "/var/tmp/")
 		      ("~/")))))
-	       (if (and (memq system-type '(ms-dos windows-nt))
+	       (if (and (memq system-type '(ms-dos windows-nt cygwin))
 			;; Don't modify remote (ange-ftp) filenames
 			(not (string-match "^/\\w+@[-A-Za-z0-9._]+:" fname)))
 		   ;; The call to convert-standard-filename is in case
--- a/lisp/font-core.el	Thu Aug 03 00:41:54 2006 +0000
+++ b/lisp/font-core.el	Thu Aug 03 11:45:23 2006 +0000
@@ -83,34 +83,6 @@
 settings.  See the variable `font-lock-defaults', which takes precedence.")
 (make-obsolete-variable 'font-lock-defaults-alist 'font-lock-defaults)
 
-(defvar font-lock-extend-region-function nil
-  "A function that determines the region to fontify after a change.
-
-This buffer-local variable is either nil, or is a function that determines the
-region to fontify.  It is usually set by the major mode.  The currently active
-font-lock after-change function calls this function after each buffer change.
-
-The function is given three parameters, the standard BEG, END, and OLD-LEN
-from after-change-functions.  It should return either a cons of the beginning
-and end buffer positions \(in that order) of the region to fontify, or nil
-\(which directs the caller to fontify a default region).  This function need
-not preserve point or the match-data, but must preserve the current
-restriction.  The region it returns may start or end in the middle of a
-line.")
-(make-variable-buffer-local 'font-lock-extend-region-function)
-
-(defun font-lock-extend-region (beg end old-len)
-  "Determine the region to fontify after a buffer change.
-
-BEG END and OLD-LEN are the standard parameters from after-change-functions.
-The return value is either nil \(which directs the caller to chose the region
-itself), or a cons of the beginning and end \(in that order) of the region.
-The region returned may start or end in the middle of a line."
-  (if font-lock-extend-region-function
-      (save-match-data
-	(save-excursion
-	  (funcall font-lock-extend-region-function beg end old-len)))))
-
 (defvar font-lock-function 'font-lock-default-function
   "A function which is called when `font-lock-mode' is toggled.
 It will be passed one argument, which is the current value of
--- a/lisp/font-lock.el	Thu Aug 03 00:41:54 2006 +0000
+++ b/lisp/font-lock.el	Thu Aug 03 11:45:23 2006 +0000
@@ -893,7 +893,11 @@
 	   (set (make-local-variable 'font-lock-fontified) t)
 	   ;; Use jit-lock.
 	   (jit-lock-register 'font-lock-fontify-region
-			      (not font-lock-keywords-only))))))
+			      (not font-lock-keywords-only))
+           ;; Tell jit-lock how we extend the region to refontify.
+           (add-hook 'jit-lock-after-change-extend-region-functions
+                     'font-lock-extend-jit-lock-region-after-change
+                     nil t)))))
 
 (defun font-lock-turn-off-thing-lock ()
   (cond ((and (boundp 'fast-lock-mode) fast-lock-mode)
@@ -971,6 +975,21 @@
 ;; directives correctly and cleanly.  (It is the same problem as fontifying
 ;; multi-line strings and comments; regexps are not appropriate for the job.)
 
+(defvar font-lock-extend-after-change-region-function nil
+  "A function that determines the region to fontify after a change.
+
+This variable is either nil, or is a function that determines the
+region to refontify after a change.
+It is usually set by the major mode via `font-lock-defaults'.
+Font-lock calls this function after each buffer change.
+
+The function is given three parameters, the standard BEG, END, and OLD-LEN
+from `after-change-functions'.  It should return either a cons of the beginning
+and end buffer positions \(in that order) of the region to fontify, or nil
+\(which directs the caller to fontify a default region).
+This function should preserve the match-data.
+The region it returns may start or end in the middle of a line.")
+
 (defun font-lock-fontify-buffer ()
   "Fontify the current buffer the way the function `font-lock-mode' would."
   (interactive)
@@ -1021,6 +1040,53 @@
 Useful for things like RMAIL and Info where the whole buffer is not
 a very meaningful entity to highlight.")
 
+
+(defvar font-lock-beg) (defvar font-lock-end)
+(defvar font-lock-extend-region-functions
+  '(font-lock-extend-region-wholelines
+    font-lock-extend-region-multiline)
+  "Special hook run just before proceeding to fontify a region.
+This is used to allow major modes to help font-lock find safe buffer positions
+as beginning and end of the fontified region.  Its most common use is to solve
+the problem of /identification/ of multiline elements by providing a function
+that tries to find such elements and move the boundaries such that they do
+not fall in the middle of one.
+Each function is called with no argument; it is expected to adjust the
+dynamically bound variables `font-lock-beg' and `font-lock-end'; and return
+non-nil iff it did make such an adjustment.
+These functions are run in turn repeatedly until they all return nil.
+Put first the functions more likely to cause a change and cheaper to compute.")
+;; Mark it as a special hook which doesn't use any global setting
+;; (i.e. doesn't obey the element t in the buffer-local value).
+(make-variable-buffer-local 'font-lock-extend-region-functions)
+
+(defun font-lock-extend-region-multiline ()
+  "Move fontification boundaries away from any `font-lock-multiline' property."
+  (let ((changed nil))
+    (when (and (> font-lock-beg (point-min))
+               (get-text-property (1- font-lock-beg) 'font-lock-multiline))
+      (setq changed t)
+      (setq font-lock-beg (or (previous-single-property-change
+                               font-lock-beg 'font-lock-multiline)
+                              (point-min))))
+    ;; 
+    (when (get-text-property font-lock-end 'font-lock-multiline)
+      (setq changed t)
+      (setq font-lock-end (or (text-property-any font-lock-end (point-max)
+                                                 'font-lock-multiline nil)
+                              (point-max))))
+    changed))
+  
+  
+(defun font-lock-extend-region-wholelines ()
+  "Move fontification boundaries to beginning of lines."
+  (let ((changed nil))
+    (goto-char font-lock-beg)
+    (unless (bobp) (setq changed t font-lock-beg (line-beginning-position)))
+    (goto-char font-lock-end)
+    (unless (bobp) (setq changed t font-lock-end (line-beginning-position 2)))
+    changed))
+
 (defun font-lock-default-fontify-region (beg end loudly)
   (save-buffer-state
       ((parse-sexp-lookup-properties
@@ -1032,24 +1098,21 @@
 	  ;; Use the fontification syntax table, if any.
 	  (when font-lock-syntax-table
 	    (set-syntax-table font-lock-syntax-table))
-          (goto-char beg)
-	  (setq beg (line-beginning-position))
-	  ;; check to see if we should expand the beg/end area for
-	  ;; proper multiline matches
-	  (when (and (> beg (point-min))
-		     (get-text-property (1- beg) 'font-lock-multiline))
-	    ;; We are just after or in a multiline match.
-	    (setq beg (or (previous-single-property-change
-			   beg 'font-lock-multiline)
-			  (point-min)))
-	    (goto-char beg)
-	    (setq beg (line-beginning-position)))
-          (setq end (or (text-property-any end (point-max)
-                                           'font-lock-multiline nil)
-                        (point-max)))
-	  (goto-char end)
-	  ;; Round up to a whole line.
-          (unless (bolp) (setq end (line-beginning-position 2)))
+          ;; Extend the region to fontify so that it starts and ends at
+          ;; safe places.
+          (let ((funs font-lock-extend-region-functions)
+                (font-lock-beg beg)
+                (font-lock-end end))
+            (while funs
+              (setq funs (if (or (not (funcall (car funs)))
+                                 (eq funs font-lock-extend-region-functions))
+                             (cdr funs)
+                           ;; If there's been a change, we should go through
+                           ;; the list again since this new position may
+                           ;; warrant a different answer from one of the fun
+                           ;; we've already seen.
+                           font-lock-extend-region-functions)))
+            (setq beg font-lock-beg end font-lock-end))
 	  ;; Now do the fontification.
 	  (font-lock-unfontify-region beg end)
 	  (when font-lock-syntactic-keywords
@@ -1083,19 +1146,57 @@
 
 ;; Called when any modification is made to buffer text.
 (defun font-lock-after-change-function (beg end old-len)
-  (let ((inhibit-point-motion-hooks t)
-	(inhibit-quit t)
-	(region (font-lock-extend-region beg end old-len)))
-    (save-excursion
+  (save-excursion
+    (let ((inhibit-point-motion-hooks t)
+          (inhibit-quit t)
+          (region (if font-lock-extend-after-change-region-function
+                      (funcall font-lock-extend-after-change-region-function
+                               beg end old-len))))
       (save-match-data
 	(if region
 	    ;; Fontify the region the major mode has specified.
 	    (setq beg (car region) end (cdr region))
 	  ;; Fontify the whole lines which enclose the region.
-	  (setq beg (progn (goto-char beg) (line-beginning-position))
-		end (progn (goto-char end) (line-beginning-position 2))))
+          ;; Actually, this is not needed because
+          ;; font-lock-default-fontify-region already rounds up to a whole
+          ;; number of lines.
+	  ;; (setq beg (progn (goto-char beg) (line-beginning-position))
+	  ;;       end (progn (goto-char end) (line-beginning-position 2)))
+          )
 	(font-lock-fontify-region beg end)))))
 
+(defvar jit-lock-start) (defvar jit-lock-end)
+(defun font-lock-extend-jit-lock-region-after-change (beg end old-len)
+  (save-excursion
+    ;; First extend the region as font-lock-after-change-function would.
+    (let ((region (if font-lock-extend-after-change-region-function
+                      (funcall font-lock-extend-after-change-region-function
+                               beg end old-len))))
+      (if region
+          (setq beg (min jit-lock-start (car region))
+                end (max jit-lock-end (cdr region))))
+      ;; Then extend the region obeying font-lock-multiline properties,
+      ;; indicating which part of the buffer needs to be refontified.
+      (when (and (> beg (point-min))
+                 (get-text-property (1- beg) 'font-lock-multiline))
+        (setq beg (or (previous-single-property-change
+                       beg 'font-lock-multiline)
+                      (point-min))))
+      (setq end (or (text-property-any end (point-max)
+                                       'font-lock-multiline nil)
+                    (point-max)))
+      ;; Finally, pre-enlarge the region to a whole number of lines, to try
+      ;; and predict what font-lock-default-fontify-region will do, so as to
+      ;; avoid double-redisplay.
+      (when (memq 'font-lock-extend-region-wholelines
+                  font-lock-extend-region-functions)
+        (goto-char beg)
+        (forward-line 0)
+        (setq jit-lock-start (min jit-lock-start (point)))
+        (goto-char end)
+        (forward-line 1)
+        (setq jit-lock-end (max jit-lock-end (point)))))))
+
 (defun font-lock-fontify-block (&optional arg)
   "Fontify some lines the way `font-lock-fontify-buffer' would.
 The lines could be a function or paragraph, or a specified number of lines.
--- a/lisp/format.el	Thu Aug 03 00:41:54 2006 +0000
+++ b/lisp/format.el	Thu Aug 03 11:45:23 2006 +0000
@@ -108,17 +108,17 @@
 
 REGEXP  is a regular expression to match against the beginning of the file;
         it should match only files in that format.  Use nil to avoid
-        matching at all for formats for which this isn't appropriate to
+        matching at all for formats for which it isn't appropriate to
         require explicit encoding/decoding.
 
-FROM-FN is called to decode files in that format; it gets two args, BEGIN
+FROM-FN is called to decode files in that format; it takes two args, BEGIN
         and END, and can make any modifications it likes, returning the new
         end.  It must make sure that the beginning of the file no longer
         matches REGEXP, or else it will get called again.
 	Alternatively, FROM-FN can be a string, which specifies a shell command
 	(including options) to be used as a filter to perform the conversion.
 
-TO-FN   is called to encode a region into that format; it is passed three
+TO-FN   is called to encode a region into that format; it takes three
         arguments: BEGIN, END, and BUFFER.  BUFFER is the original buffer that
         the data being written came from, which the function could use, for
         example, to find the values of local variables.  TO-FN should either
@@ -133,7 +133,7 @@
 
 MODE-FN, if specified, is called when visiting a file with that format.
          It is called with a single positive argument, on the assumption
-         that it turns on some Emacs mode.
+         that this would turn on some minor mode.
 
 PRESERVE, if non-nil, means that `format-write-file' should not remove
           this format from `buffer-file-formats'.")
@@ -141,8 +141,8 @@
 ;;; Basic Functions (called from Lisp)
 
 (defun format-encode-run-method (method from to &optional buffer)
-  "Translate using function or shell script METHOD the text from FROM to TO.
-If METHOD is a string, it is a shell command;
+  "Translate using METHOD the text from FROM to TO.
+If METHOD is a string, it is a shell command (including options);
 otherwise, it should be a Lisp function.
 BUFFER should be the buffer that the output originally came from."
   (if (stringp method)
@@ -164,9 +164,9 @@
     (funcall method from to buffer)))
 
 (defun format-decode-run-method (method from to &optional buffer)
-  "Decode using function or shell script METHOD the text from FROM to TO.
-If METHOD is a string, it is a shell command; otherwise, it should be
-a Lisp function.  Decoding is done for the given BUFFER."
+  "Decode using METHOD the text from FROM to TO.
+If METHOD is a string, it is a shell command (including options); otherwise,
+it should be a Lisp function.  Decoding is done for the given BUFFER."
   (if (stringp method)
       (let ((error-buff (get-buffer-create "*Format Errors*"))
 	    (coding-system-for-write 'no-conversion)
@@ -191,15 +191,15 @@
 
 (defun format-annotate-function (format from to orig-buf format-count)
   "Return annotations for writing region as FORMAT.
-FORMAT is a symbol naming one of the formats defined in `format-alist',
-it must be a single symbol, not a list like `buffer-file-format'.
+FORMAT is a symbol naming one of the formats defined in `format-alist'.
+It must be a single symbol, not a list like `buffer-file-format'.
 FROM and TO delimit the region to be operated on in the current buffer.
 ORIG-BUF is the original buffer that the data came from.
 
 FORMAT-COUNT is an integer specifying how many times this function has
 been called in the process of decoding ORIG-BUF.
 
-This function works like a function on `write-region-annotate-functions':
+This function works like a function in `write-region-annotate-functions':
 it either returns a list of annotations, or returns with a different buffer
 current, which contains the modified text to write.  In the latter case,
 this function's value is nil.
@@ -244,7 +244,7 @@
 to the reverted list of formats used, and call any mode functions defined
 for those formats.
 
-Returns the new length of the decoded region.
+Return the new length of the decoded region.
 
 For most purposes, consider using `format-decode-region' instead."
   (let ((mod (buffer-modified-p))
@@ -303,9 +303,9 @@
 
 (defun format-decode-buffer (&optional format)
   "Translate the buffer from some FORMAT.
-If the format is not specified, this function attempts to guess.
-`buffer-file-format' is set to the format used, and any mode-functions
-for the format are called."
+If the format is not specified, attempt a regexp-based guess.
+Set `buffer-file-format' to the format used, and call any
+format-specific mode functions."
   (interactive
    (list (format-read "Translate buffer from format (default guess): ")))
   (save-excursion
@@ -334,7 +334,7 @@
 
 (defun format-encode-region (beg end &optional format)
   "Translate the region into some FORMAT.
-FORMAT defaults to `buffer-file-format', it is a symbol naming
+FORMAT defaults to `buffer-file-format'.  It is a symbol naming
 one of the formats defined in `format-alist', or a list of such symbols."
   (interactive
    (list (region-beginning) (region-end)
@@ -365,9 +365,9 @@
 saves.  If the buffer is already visiting a file, you can specify a directory
 name as FILENAME, to write a file of the same old name in that directory.
 
-If optional third arg CONFIRM is non-nil, this function asks for
-confirmation before overwriting an existing file.  Interactively,
-confirmation is required unless you supply a prefix argument."
+If optional third arg CONFIRM is non-nil, ask for confirmation before
+overwriting an existing file.  Interactively, confirmation is required
+unless you supply a prefix argument."
   (interactive
    ;; Same interactive spec as write-file, plus format question.
    (let* ((file (if buffer-file-name
@@ -410,7 +410,7 @@
   "Insert the contents of file FILENAME using data format FORMAT.
 If FORMAT is nil then do not do any format conversion.
 The optional third and fourth arguments BEG and END specify
-the part of the file to read.
+the part (in bytes) of the file to read.
 
 The return value is like the value of `insert-file-contents':
 a list (ABSOLUTE-FILE-NAME SIZE)."
@@ -447,10 +447,10 @@
 (defun format-replace-strings (alist &optional reverse beg end)
   "Do multiple replacements on the buffer.
 ALIST is a list of (FROM . TO) pairs, which should be proper arguments to
-`search-forward' and `replace-match' respectively.
-Optional 2nd arg REVERSE, if non-nil, means the pairs are (TO . FROM), so that
-you can use the same list in both directions if it contains only literal
-strings.
+`search-forward' and `replace-match', respectively.
+Optional second arg REVERSE, if non-nil, means the pairs are (TO . FROM),
+so that you can use the same list in both directions if it contains only
+literal strings.
 Optional args BEG and END specify a region of the buffer on which to operate."
   (save-excursion
     (save-restriction
@@ -488,7 +488,7 @@
 
 (defun format-make-relatively-unique (a b)
   "Delete common elements of lists A and B, return as pair.
-Compares using `equal'."
+Compare using `equal'."
   (let* ((acopy (copy-sequence a))
 	 (bcopy (copy-sequence b))
 	 (tail acopy))
@@ -502,9 +502,9 @@
 
 (defun format-common-tail (a b)
   "Given two lists that have a common tail, return it.
-Compares with `equal', and returns the part of A that is equal to the
+Compare with `equal', and return the part of A that is equal to the
 equivalent part of B.  If even the last items of the two are not equal,
-returns nil."
+return nil."
   (let ((la (length a))
 	(lb (length b)))
     ;; Make sure they are the same length
@@ -525,9 +525,9 @@
     (null list)))
 
 (defun format-reorder (items order)
-  "Arrange ITEMS to following partial ORDER.
-Elements of ITEMS equal to elements of ORDER will be rearranged to follow the
-ORDER.  Unmatched items will go last."
+  "Arrange ITEMS to follow partial ORDER.
+Elements of ITEMS equal to elements of ORDER will be rearranged
+to follow the ORDER.  Unmatched items will go last."
   (if order
       (let ((item (member (car order) items)))
 	(if item
@@ -784,7 +784,7 @@
 ;; next-single-property-change instead of text-property-not-all, but then
 ;; we have to see if we passed TO.
 (defun format-property-increment-region (from to prop delta default)
-  "Over the region between FROM and TO increment property PROP by amount DELTA.
+  "In the region from FROM to TO increment property PROP by amount DELTA.
 DELTA may be negative.  If property PROP is nil anywhere
 in the region, it is treated as though it were DEFAULT."
   (let ((cur from) val newval next)
@@ -801,7 +801,7 @@
 
 (defun format-insert-annotations (list &optional offset)
   "Apply list of annotations to buffer as `write-region' would.
-Inserts each element of the given LIST of buffer annotations at its
+Insert each element of the given LIST of buffer annotations at its
 appropriate place.  Use second arg OFFSET if the annotations' locations are
 not relative to the beginning of the buffer: annotations will be inserted
 at their location-OFFSET+1 \(ie, the offset is treated as the position of
@@ -825,7 +825,7 @@
 
 (defun format-annotate-region (from to translations format-fn ignore)
   "Generate annotations for text properties in the region.
-Searches for changes between FROM and TO, and describes them with a list of
+Search for changes between FROM and TO, and describe them with a list of
 annotations as defined by alist TRANSLATIONS and FORMAT-FN.  IGNORE lists text
 properties not to consider; any text properties that are neither ignored nor
 listed in TRANSLATIONS are warned about.
@@ -966,9 +966,9 @@
   "Return annotations for property PROP changing from OLD to NEW.
 These are searched for in the translations alist TRANSLATIONS
  (see `format-annotate-region' for the format).
-If NEW does not appear in the list, but there is a default function, then that
-function is called.
-Returns a cons of the form (CLOSE . OPEN)
+If NEW does not appear in the list, but there is a default function,
+then call that function.
+Return a cons of the form (CLOSE . OPEN)
 where CLOSE is a list of annotations to close
 and OPEN is a list of annotations to open.
 
@@ -1007,7 +1007,7 @@
 	(format-annotate-atomic-property-change prop-alist old new)))))
 
 (defun format-annotate-atomic-property-change (prop-alist old new)
-  "Internal function annotate a single property change.
+  "Internal function to annotate a single property change.
 PROP-ALIST is the relevant element of a TRANSLATIONS list.
 OLD and NEW are the values."
   (let (num-ann)
--- a/lisp/frame.el	Thu Aug 03 00:41:54 2006 +0000
+++ b/lisp/frame.el	Thu Aug 03 11:45:23 2006 +0000
@@ -685,7 +685,9 @@
   "*Non-nil if window system changes focus when you move the mouse.
 You should set this variable to tell Emacs how your window manager
 handles focus, since there is no way in general for Emacs to find out
-automatically."
+automatically.
+
+This variable does not have any effect on MS-Windows."
   :type 'boolean
   :group 'frames
   :version "20.3")
--- a/lisp/gnus/ChangeLog	Thu Aug 03 00:41:54 2006 +0000
+++ b/lisp/gnus/ChangeLog	Thu Aug 03 11:45:23 2006 +0000
@@ -1,3 +1,43 @@
+2006-07-28  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+	* nnheader.el (nnheader-insert-head): Make it work with Mac as well.
+
+2006-07-27  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+	* nnheader.el (nnheader-insert-head): Make it work even if the file
+	uses CRLF for the line-break code.
+
+2006-07-19  Andreas Seltenreich  <uwi7@rz.uni-karlsruhe.de>
+
+	* mm-url.el (mm-url-insert-file-contents): Inhibit Connection: close
+	workaround for the url package included with Emacs.
+
+	* nnweb.el (nnweb-google-create-mapping): Update regexp.
+
+2006-07-18  Karl Fogel  <kfogel@red-bean.com>
+
+	* nnmail.el (nnmail-article-group): If splitting raises an error, give
+	some information about the error when saying that the `bogus' mail
+	group will be used.
+
+2006-07-18  Andreas Seltenreich  <uwi7@rz.uni-karlsruhe.de>
+
+	[ Backported bug fixes from No Gnus. ]
+
+	* nnweb.el (nnweb-google-parse-1): Update regexp for author and date.
+	(nnweb-google-search): Respect nnweb-max-hits as upper bound.
+	(nnweb-request-article): Do proper xwfu encoding when fetching articles
+	by message-id.
+
+	* gnus-srvr.el (gnus-browse-unsubscribe-group): Don't subscribe
+	unsubscribed groups as if they were killed ones.  It causes duplicate
+	entries in gnus-newsrc-alist.
+
+2006-07-17  Reiner Steib  <Reiner.Steib@gmx.de>
+
+	* gnus-sum.el (gnus-summary-delete-article): Don't use TAB in doc
+	string.
+
 2006-07-16  NAKAJI Hiroyuki  <nakaji@heimat.jp>  (tiny change)
 
 	* mm-util.el (mm-charset-synonym-alist): Map windows-31j to cp932.
@@ -135,8 +175,7 @@
 	(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-art.el (gnus-mime-view-part-as-type): Add optional PRED arg.
 	(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.
@@ -146,8 +185,7 @@
 	* 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.
+	(gnus-mime-view-part-as-type): Set default instead of initial-input.
 
 2006-04-28  Katsumi Yamaoka  <yamaoka@jpl.org>
 
@@ -170,8 +208,8 @@
 
 	* mml-sec.el (mml-secure-method): New internal variable.
 	(mml-secure-sign, mml-secure-encrypt, mml-secure-message-sign)
-	(mml-secure-message-sign-encrypt, mml-secure-message-encrypt): New
-	functions using mml-secure-method.  Sync from the trunk.
+	(mml-secure-message-sign-encrypt, mml-secure-message-encrypt):
+	New functions using mml-secure-method.  Sync from the trunk.
 
 	* mml.el (mml-mode-map): Add key bindings for those functions.
 	(mml-menu): Simplify security menu entries.  Suggested by Jesper
@@ -215,8 +253,8 @@
 
 2006-04-20  Reiner Steib  <Reiner.Steib@gmx.de>
 
-	* gnus-util.el (gnus-replace-in-string): Prefer
-	replace-regexp-in-string over of replace-in-string.
+	* gnus-util.el (gnus-replace-in-string):
+	Prefer replace-regexp-in-string over of replace-in-string.
 
 2006-04-20  Katsumi Yamaoka  <yamaoka@jpl.org>
 
@@ -224,8 +262,8 @@
 
 	* gnus-sum.el: Ditto.
 
-	* gnus-util.el (gnus-select-frame-set-input-focus): Use
-	select-frame-set-input-focus if it is available in XEmacs; use
+	* gnus-util.el (gnus-select-frame-set-input-focus):
+	Use select-frame-set-input-focus if it is available in XEmacs; use
 	definition defined in Emacs 22 for old Emacsen.
 
 2006-04-17  Reiner Steib  <Reiner.Steib@gmx.de>
@@ -237,13 +275,13 @@
 	(mm-charset-to-coding-system): Use it.
 	(mm-codepage-setup): New helper function.
 	(mm-charset-eval-alist): New variable.
-	(mm-charset-to-coding-system): Use mm-charset-eval-alist.  Warn
-	about unknown charsets.  Add allow-override.  Use
-	`mm-charset-override-alist' only when decoding.
+	(mm-charset-to-coding-system): Use mm-charset-eval-alist.
+	Warn about unknown charsets.  Add allow-override.
+	Use `mm-charset-override-alist' only when decoding.
 	(mm-detect-mime-charset-region): Use :mime-charset.
 
-	* mm-bodies.el (mm-decode-body, mm-decode-string): Call
-	`mm-charset-to-coding-system' with allow-override argument.
+	* mm-bodies.el (mm-decode-body, mm-decode-string):
+	Call `mm-charset-to-coding-system' with allow-override argument.
 
 	* message.el (message-tool-bar-zap-list, message-tool-bar)
 	(message-tool-bar-gnome, message-tool-bar-retro): New variables.
@@ -259,8 +297,8 @@
 	`gmm-tool-bar-from-list'.
 
 	* gnus-group.el (gnus-group-tool-bar, gnus-group-tool-bar-gnome)
-	(gnus-group-tool-bar-retro, gnus-group-tool-bar-zap-list): New
-	variables.
+	(gnus-group-tool-bar-retro, gnus-group-tool-bar-zap-list):
+	New variables.
 	(gnus-group-make-tool-bar): Complete rewrite using
 	`gmm-tool-bar-from-list'.
 	(gnus-group-tool-bar-update): New function.
@@ -274,8 +312,8 @@
 
 2006-04-12  Reiner Steib  <Reiner.Steib@gmx.de>
 
-	* gnus-art.el (gnus-article-mode): Set
-	cursor-in-non-selected-windows to nil.
+	* gnus-art.el (gnus-article-mode):
+	Set cursor-in-non-selected-windows to nil.
 
 2006-04-12  Katsumi Yamaoka  <yamaoka@jpl.org>
 
@@ -306,8 +344,7 @@
 
 2006-04-11  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
-	* nnslashdot.el (nnslashdot-retrieve-headers-1): Fix up to new
-	layout.
+	* nnslashdot.el (nnslashdot-retrieve-headers-1): Fix up to new layout.
 
 	* rfc2047.el (rfc2047-decode-encoded-words): Don't message about
 	unknown charset.
@@ -369,13 +406,12 @@
 
 	* gnus-agent.el (gnus-agent-queue-mail): Fix custom tag for `t'.
 
-	* spam.el (spam-mark-new-messages-in-spam-group-as-spam): Add
-	comment on version.
+	* spam.el (spam-mark-new-messages-in-spam-group-as-spam):
+	Add comment on version.
 
 2006-03-20  Teodor Zlatanov  <tzz@lifelogs.com>
 
-	* spam.el (spam-mark-new-messages-in-spam-group-as-spam): New
-	variable.
+	* spam.el (spam-mark-new-messages-in-spam-group-as-spam): New variable.
 	(spam-mark-junk-as-spam-routine): Use it.  Allow to disable
 	assigning the spam-mark to new messages.
 
@@ -406,14 +442,14 @@
 
 	* gnus-art.el (gnus-article-only-boring-p):
 	Bind inhibit-point-motion-hooks to avoid infinite loop when entering
-	intangible text.  Reported by Ralf Wachinger
-	<rwnewsmampfer@geekmail.de>.
+	intangible text.
+	Reported by Ralf Wachinger <rwnewsmampfer@geekmail.de>.
 
 2006-03-14  Simon Josefsson  <jas@extundo.com>
 
 	* message.el (message-unique-id): Don't use message-number-base36
-	if (user-uid) is a float.  Reported by Bjorn Solberg
-	<bjorn_ding1@hekneby.org>.
+	if (user-uid) is a float.
+	Reported by Bjorn Solberg <bjorn_ding1@hekneby.org>.
 
 2006-03-13  Katsumi Yamaoka  <yamaoka@jpl.org>
 
--- a/lisp/gnus/gnus-srvr.el	Thu Aug 03 00:41:54 2006 +0000
+++ b/lisp/gnus/gnus-srvr.el	Thu Aug 03 11:45:23 2006 +0000
@@ -943,19 +943,23 @@
 	  (progn
 	    ;; Make sure the group has been properly removed before we
 	    ;; subscribe to it.
-	    (gnus-kill-ephemeral-group group)
+ 	    (if (gnus-ephemeral-group-p group)
+		(gnus-kill-ephemeral-group group))
+	    ;; We need to discern between killed/zombie groups and
+	    ;; just unsubscribed ones.
 	    (gnus-group-change-level
-	     (list t group gnus-level-default-subscribed
-		   nil nil (if (gnus-server-equal
-				gnus-browse-current-method "native")
-			       nil
-			     (gnus-method-simplify
-			      gnus-browse-current-method)))
+	     (or (gnus-group-entry group)
+		 (list t group gnus-level-default-subscribed
+		       nil nil (if (gnus-server-equal
+				    gnus-browse-current-method "native")
+				   nil
+				 (gnus-method-simplify
+				  gnus-browse-current-method))))
 	     gnus-level-default-subscribed (gnus-group-level group)
 	     (and (car (nth 1 gnus-newsrc-alist))
 		  (gnus-gethash (car (nth 1 gnus-newsrc-alist))
 				gnus-newsrc-hashtb))
-	     t)
+	     (null (gnus-group-entry group)))
 	    (delete-char 1)
 	    (insert ? ))
 	(gnus-group-change-level
--- a/lisp/gnus/gnus-sum.el	Thu Aug 03 00:41:54 2006 +0000
+++ b/lisp/gnus/gnus-sum.el	Thu Aug 03 11:45:23 2006 +0000
@@ -9510,7 +9510,7 @@
 ;; Suggested by Jack Vinson <vinson@unagi.cis.upenn.edu>.
 (defun gnus-summary-delete-article (&optional n)
   "Delete the N next (mail) articles.
-This command actually deletes articles.	 This is not a marking
+This command actually deletes articles.  This is not a marking
 command.  The article will disappear forever from your life, never to
 return.
 
--- a/lisp/gnus/mm-url.el	Thu Aug 03 00:41:54 2006 +0000
+++ b/lisp/gnus/mm-url.el	Thu Aug 03 11:45:23 2006 +0000
@@ -301,7 +301,13 @@
 	(list url (buffer-size)))
     (mm-url-load-url)
     (let ((name buffer-file-name)
-	  (url-request-extra-headers (list (cons "Connection" "Close")))
+	  (url-request-extra-headers
+	   ;; ISTM setting a Connection header was a workaround for
+	   ;; older versions of url included with w3, but it does more
+	   ;; harm than good with the one shipped with Emacs. --ansel
+	   (if (not (and (boundp 'url-version)
+			 (equal url-version "Emacs")))
+	       (list (cons "Connection" "Close"))))
 	  (url-package-name (or mm-url-package-name
 				url-package-name))
 	  (url-package-version (or mm-url-package-version
--- a/lisp/gnus/nnheader.el	Thu Aug 03 00:41:54 2006 +0000
+++ b/lisp/gnus/nnheader.el	Thu Aug 03 11:45:23 2006 +0000
@@ -586,17 +586,27 @@
     (if (eq nnheader-max-head-length t)
 	;; Just read the entire file.
 	(nnheader-insert-file-contents file)
-      ;; Read 1K blocks until we find a separator.
+      ;; Read blocks of the size specified by `nnheader-head-chop-length'
+      ;; until we find a separator.
       (let ((beg 0)
-	    format-alist)
+	    (start (point))
+	    ;; Use `binary' to prevent the contents from being decoded,
+	    ;; or it will change the number of characters that
+	    ;; `insert-file-contents' returns.
+	    (coding-system-for-read 'binary))
 	(while (and (eq nnheader-head-chop-length
-			(nth 1 (nnheader-insert-file-contents
+			(nth 1 (mm-insert-file-contents
 				file nil beg
 				(incf beg nnheader-head-chop-length))))
-		    (prog1 (not (search-forward "\n\n" nil t))
+		    ;; CRLF of CR might be used for the line-break code.
+		    (prog1 (not (re-search-forward "\n\r?\n\\|\r\r" nil t))
 		      (goto-char (point-max)))
 		    (or (null nnheader-max-head-length)
-			(< beg nnheader-max-head-length))))))
+			(< beg nnheader-max-head-length))))
+	;; Finally decode the contents.
+	(when (mm-coding-system-p nnheader-file-coding-system)
+	  (mm-decode-coding-region start (point-max)
+				   nnheader-file-coding-system))))
     t))
 
 (defun nnheader-article-p ()
--- a/lisp/gnus/nnmail.el	Thu Aug 03 00:41:54 2006 +0000
+++ b/lisp/gnus/nnmail.el	Thu Aug 03 11:45:23 2006 +0000
@@ -1131,7 +1131,7 @@
 	(if (and (symbolp nnmail-split-methods)
 		 (fboundp nnmail-split-methods))
 	    (let ((split
-		   (condition-case nil
+		   (condition-case error-info
 		       ;; `nnmail-split-methods' is a function, so we
 		       ;; just call this function here and use the
 		       ;; result.
@@ -1139,7 +1139,7 @@
 			   '("bogus"))
 		     (error
 		      (nnheader-message
-		       5 "Error in `nnmail-split-methods'; using `bogus' mail group")
+		       5 "Error in `nnmail-split-methods'; using `bogus' mail group: %S" error-info)
 		      (sit-for 1)
 		      '("bogus")))))
 	      (setq split (mm-delete-duplicates split))
--- a/lisp/gnus/nnweb.el	Thu Aug 03 00:41:54 2006 +0000
+++ b/lisp/gnus/nnweb.el	Thu Aug 03 11:45:23 2006 +0000
@@ -171,7 +171,8 @@
 		       (when (string-match "^<\\(.*\\)>$" article)
 			 (setq art (match-string 1 article)))
 		       (when (and fetch art)
-			 (setq url (format fetch art))
+			 (setq url (format fetch
+					   (mm-url-form-encode-xwfu art)))
 			 (mm-with-unibyte-current-buffer
 			   (mm-url-insert url))
 			 (if (nnweb-definition 'reference t)
@@ -365,7 +366,7 @@
       (mm-url-decode-entities)
       (search-backward " - ")
       (when (looking-at
-	     " - \\([a-zA-Z]+\\) \\([0-9]+\\)\\(?: \\([0-9]\\{4\\}\\)\\)?, [^\n]+by \\([^<\n]+\\)\n")
+	     " - \\([a-zA-Z]+\\) \\([0-9]+\\)\\(?: \\([0-9]\\{4\\}\\)\\)?[^\n]+by ?\n?\\([^<\n]+\\)\n")
 	(setq From (match-string 4)
 	      Date (format "%s %s 00:00:00 %s"
 			   (match-string 1)
@@ -415,7 +416,7 @@
 	    (goto-char (point-min))
 	    (incf i 100)
 	    (if (or (not (re-search-forward
-			  "<a href=\"\n\\([^>\" \n\t]+\\)[^<]*<img src=[^>]+next"
+			  "<a [^>]+href=\"\n?\\([^>\" \n\t]+\\)[^<]*<img[^>]+src=[^>]+next"
 			  nil t))
 		    (>= i nnweb-max-hits))
 		(setq more nil)
@@ -437,7 +438,8 @@
     "?"
     (mm-url-encode-www-form-urlencoded
      `(("q" . ,search)
-       ("num" . "100")
+       ("num" . ,(number-to-string
+		  (min 100 nnweb-max-hits)))
        ("hq" . "")
        ("hl" . "en")
        ("lr" . "")
--- a/lisp/help-mode.el	Thu Aug 03 00:41:54 2006 +0000
+++ b/lisp/help-mode.el	Thu Aug 03 11:45:23 2006 +0000
@@ -157,8 +157,9 @@
 		   (let ((location
 			  (find-function-search-for-symbol fun nil file)))
 		     (pop-to-buffer (car location))
-		     (when (cdr location)
-		       (goto-char (cdr location)))))
+		     (if (cdr location)
+			 (goto-char (cdr location))
+		       (message "Unable to find location in file"))))
   'help-echo (purecopy "mouse-2, RET: find function's definition"))
 
 (define-button-type 'help-variable-def
@@ -168,8 +169,9 @@
 		     (setq file (help-C-file-name var 'var)))
 		   (let ((location (find-variable-noselect var file)))
 		     (pop-to-buffer (car location))
-		     (when (cdr location)
-		       (goto-char (cdr location)))))
+		     (if (cdr location)
+		       (goto-char (cdr location))
+		       (message "Unable to find location in file"))))
   'help-echo (purecopy "mouse-2, RET: find variable's definition"))
 
 (define-button-type 'help-face-def
@@ -181,8 +183,9 @@
 		   (let ((location
 			  (find-function-search-for-symbol fun 'defface file)))
 		     (pop-to-buffer (car location))
-		     (when (cdr location)
-		       (goto-char (cdr location)))))
+		     (if (cdr location)
+			 (goto-char (cdr location))
+		       (message "Unable to find location in file"))))
   'help-echo (purecopy "mouse-2, RET: find face's definition"))
 
 
--- a/lisp/ibuffer.el	Thu Aug 03 00:41:54 2006 +0000
+++ b/lisp/ibuffer.el	Thu Aug 03 11:45:23 2006 +0000
@@ -66,7 +66,7 @@
 
 (defcustom ibuffer-formats '((mark modified read-only " " (name 18 18 :left :elide)
 				   " " (size 9 -1 :right)
-				   " " (mode 16 16 :right :elide) " " filename-and-process)
+				   " " (mode 16 16 :left :elide) " " filename-and-process)
 			     (mark " " (name 16 -1) " " filename))
   "A list of ways to display buffer lines.
 
--- a/lisp/international/mule-cmds.el	Thu Aug 03 00:41:54 2006 +0000
+++ b/lisp/international/mule-cmds.el	Thu Aug 03 11:45:23 2006 +0000
@@ -811,7 +811,7 @@
 Optional 3rd arg DEFAULT-CODING-SYSTEM specifies a coding system or a
 list of coding systems to be prepended to the default coding system
 list.  However, if DEFAULT-CODING-SYSTEM is a list and the first
-element is t, the cdr part is used as the defualt coding system list,
+element is t, the cdr part is used as the default coding system list,
 i.e. `buffer-file-coding-system', `default-buffer-file-coding-system',
 and the most preferred coding system are not used.
 
@@ -878,9 +878,6 @@
 	      (rassq base default-coding-system)
 	      (push (cons auto-cs base) default-coding-system))))
 
-    ;; From now on, the list of defaults is reversed.
-    (setq default-coding-system (nreverse default-coding-system))
-
     (unless no-other-defaults
       ;; If buffer-file-coding-system is not nil nor undecided, append it
       ;; to the defaults.
@@ -888,8 +885,9 @@
 	  (let ((base (coding-system-base buffer-file-coding-system)))
 	    (or (eq base 'undecided)
 		(rassq base default-coding-system)
-		(push (cons buffer-file-coding-system base)
-		      default-coding-system))))
+		(setq default-coding-system
+		      (append default-coding-system
+			      (list (cons buffer-file-coding-system base)))))))
 
       ;; If default-buffer-file-coding-system is not nil nor undecided,
       ;; append it to the defaults.
@@ -897,8 +895,10 @@
 	  (let ((base (coding-system-base default-buffer-file-coding-system)))
 	    (or (eq base 'undecided)
 		(rassq base default-coding-system)
-		(push (cons default-buffer-file-coding-system base)
-		      default-coding-system))))
+		(setq default-coding-system
+		      (append default-coding-system
+			      (list (cons default-buffer-file-coding-system 
+					  base)))))))
 
       ;; If the most preferred coding system has the property mime-charset,
       ;; append it to the defaults.
@@ -908,8 +908,9 @@
 	     (setq base (coding-system-base preferred))
 	     (coding-system-get preferred :mime-charset)
 	     (not (rassq base default-coding-system))
-	     (push (cons preferred base)
-		   default-coding-system))))
+	     (setq default-coding-system
+		   (append default-coding-system
+			   (list (cons preferred base)))))))
 
     (if select-safe-coding-system-accept-default-p
 	(setq accept-default-p select-safe-coding-system-accept-default-p))
--- a/lisp/jit-lock.el	Thu Aug 03 00:41:54 2006 +0000
+++ b/lisp/jit-lock.el	Thu Aug 03 11:45:23 2006 +0000
@@ -31,6 +31,8 @@
 
 
 (eval-when-compile
+  (require 'cl)
+
   (defmacro with-buffer-unmodified (&rest body)
     "Eval BODY, preserving the current buffer's modified state."
     (declare (debug t))
@@ -331,7 +333,7 @@
      ;; from the end of a buffer to its start, can do repeated
      ;; `parse-partial-sexp' starting from `point-min', which can
      ;; take a long time in a large buffer.
-     (let (next)
+     (let ((orig-start start) next)
        (save-match-data
 	 ;; Fontify chunks beginning at START.  The end of a
 	 ;; chunk is either `end', or the start of a region
@@ -374,6 +376,25 @@
 	     (quit (put-text-property start next 'fontified nil)
 		   (funcall 'signal (car err) (cdr err))))
 
+           ;; The redisplay engine has already rendered the buffer up-to
+           ;; `orig-start' and won't notice if the above jit-lock-functions
+           ;; changed the appearance of any part of the buffer prior
+           ;; to that.  So if `start' is before `orig-start', we need to
+           ;; cause a new redisplay cycle after this one so that any changes
+           ;; are properly reflected on screen.
+           ;; To make such repeated redisplay happen less often, we can
+           ;; eagerly extend the refontified region with
+           ;; jit-lock-after-change-extend-region-functions.
+           (when (< start orig-start)
+             (lexical-let ((start start)
+                           (orig-start orig-start)
+                           (buf (current-buffer)))
+               (run-with-timer
+                0 nil (lambda ()
+                        (with-buffer-prepared-for-jit-lock
+                            (put-text-property start orig-start
+                                               'fontified t buf))))))
+
 	   ;; Find the start of the next chunk, if any.
 	   (setq start (text-property-any next end 'fontified nil))))))))
 
@@ -548,6 +569,19 @@
 		'(fontified nil jit-lock-defer-multiline nil)))
 	      (setq jit-lock-context-unfontify-pos (point-max)))))))))
 
+(defvar jit-lock-start) (defvar jit-lock-end) ; Dynamically scoped variables.
+(defvar jit-lock-after-change-extend-region-functions nil
+  "Hook that can extend the text to refontify after a change.
+This is run after every buffer change.  The functions are called with
+the three arguments of `after-change-functions': START END OLD-LEN.
+The extended region to refontify is returned indirectly by modifying
+the variables `jit-lock-start' and `jit-lock-end'.
+
+Note that extending the region this way is not strictly necessary,
+except that the nature of the redisplay code tends to otherwise leave
+some of the rehighlighted text displayed with the old highlight until the
+next redisplay.  See comment in `jit-lock-fontify-now'.")
+
 (defun jit-lock-after-change (start end old-len)
   "Mark the rest of the buffer as not fontified after a change.
 Installed on `after-change-functions'.
@@ -557,44 +591,24 @@
 in case the syntax of those lines has changed.  Refontification
 will take place when text is fontified stealthily."
   (when (and jit-lock-mode (not memory-full))
-    (let ((region (font-lock-extend-region start end old-len)))
-      (save-excursion
-	(with-buffer-prepared-for-jit-lock
-	 ;; It's important that the `fontified' property be set from the
-	 ;; beginning of the line, else font-lock will properly change the
-	 ;; text's face, but the display will have been done already and will
-	 ;; be inconsistent with the buffer's content.
-	 ;; 
-	 ;; FIXME!!! (Alan Mackenzie, 2006-03-14): If start isn't at a BOL,
-	 ;; expanding the region to BOL might mis-fontify, should the BOL not
-	 ;; be at a "safe" position.
-	 (setq start (if region
-			 (car region)
-		       (goto-char start)
-		       (line-beginning-position)))
-
-	 ;; If we're in text that matches a multi-line font-lock pattern,
-	 ;; make sure the whole text will be redisplayed.
-	 ;; I'm not sure this is ever necessary and/or sufficient.  -stef
-	 (when (get-text-property start 'font-lock-multiline)
-	   (setq start (or (previous-single-property-change
-			    start 'font-lock-multiline)
-			   (point-min))))
-
-	 (if region (setq end (cdr region)))
-	 ;; Make sure we change at least one char (in case of deletions).
-	 (setq end (min (max end (1+ start)) (point-max)))
-	 ;; Request refontification.
-	 (put-text-property start end 'fontified nil))
-	;; Mark the change for deferred contextual refontification.
-	(when jit-lock-context-unfontify-pos
-	  (setq jit-lock-context-unfontify-pos
-		;; Here we use `start' because nothing guarantees that the
-		;; text between start and end will be otherwise refontified:
-		;; usually it will be refontified by virtue of being
-		;; displayed, but if it's outside of any displayed area in the
-		;; buffer, only jit-lock-context-* will re-fontify it.
-		(min jit-lock-context-unfontify-pos start)))))))
+    (let ((jit-lock-start start)
+          (jit-lock-end end))
+      (with-buffer-prepared-for-jit-lock
+          (run-hook-with-args 'jit-lock-after-change-extend-region-functions
+                              start end old-len)
+          ;; Make sure we change at least one char (in case of deletions).
+          (setq jit-lock-end (min (max jit-lock-end (1+ start)) (point-max)))
+          ;; Request refontification.
+          (put-text-property jit-lock-start jit-lock-end 'fontified nil))
+      ;; Mark the change for deferred contextual refontification.
+      (when jit-lock-context-unfontify-pos
+        (setq jit-lock-context-unfontify-pos
+              ;; Here we use `start' because nothing guarantees that the
+              ;; text between start and end will be otherwise refontified:
+              ;; usually it will be refontified by virtue of being
+              ;; displayed, but if it's outside of any displayed area in the
+              ;; buffer, only jit-lock-context-* will re-fontify it.
+              (min jit-lock-context-unfontify-pos jit-lock-start))))))
 
 (provide 'jit-lock)
 
--- a/lisp/loadhist.el	Thu Aug 03 00:41:54 2006 +0000
+++ b/lisp/loadhist.el	Thu Aug 03 11:45:23 2006 +0000
@@ -222,8 +222,8 @@
 		  (if aload
                       (fset fun (cons 'autoload aload))
                     (fmakunbound fun))))))
-           (require nil)
-           (t (message "Unexpected element %s in load-history" x)))
+           ((t require) nil)
+	   (t (message "Unexpected element %s in load-history" x)))
 	;; Kill local values as much as possible.
 	(dolist (buf (buffer-list))
 	  (with-current-buffer buf
--- a/lisp/longlines.el	Thu Aug 03 00:41:54 2006 +0000
+++ b/lisp/longlines.el	Thu Aug 03 11:45:23 2006 +0000
@@ -44,7 +44,7 @@
   :group 'fill)
 
 (defcustom longlines-auto-wrap t
-  "*Non-nil means long lines are automatically wrapped after each command.
+  "Non-nil means long lines are automatically wrapped after each command.
 Otherwise, you can perform filling using `fill-paragraph' or
 `auto-fill-mode'.  In any case, the soft newlines will be removed
 when the file is saved to disk."
@@ -52,7 +52,7 @@
   :type 'boolean)
 
 (defcustom longlines-wrap-follows-window-size nil
-  "*Non-nil means wrapping and filling happen at the edge of the window.
+  "Non-nil means wrapping and filling happen at the edge of the window.
 Otherwise, `fill-column' is used, regardless of the window size.  This
 does not work well when the buffer is displayed in multiple windows
 with differing widths."
@@ -60,7 +60,7 @@
   :type 'boolean)
 
 (defcustom longlines-show-hard-newlines nil
-  "*Non-nil means each hard newline is marked on the screen.
+  "Non-nil means each hard newline is marked on the screen.
 \(The variable `longlines-show-effect' controls what they look like.)
 You can also enable the display temporarily, using the command
 `longlines-show-hard-newlines'"
@@ -68,7 +68,7 @@
   :type 'boolean)
 
 (defcustom longlines-show-effect (propertize "|\n" 'face 'escape-glyph)
-  "*A string to display when showing hard newlines.
+  "A string to display when showing hard newlines.
 This is used when `longlines-show-hard-newlines' is on."
   :group 'longlines
   :type 'string)
@@ -202,7 +202,8 @@
   "Make hard newlines between BEG and END visible."
   (let* ((pmin (min beg end))
          (pmax (max beg end))
-         (pos (text-property-not-all pmin pmax 'hard nil)))
+         (pos (text-property-not-all pmin pmax 'hard nil))
+         (inhibit-read-only t))
     (while pos
       (put-text-property pos (1+ pos) 'display
                          (copy-sequence longlines-show-effect))
--- a/lisp/mouse.el	Thu Aug 03 00:41:54 2006 +0000
+++ b/lisp/mouse.el	Thu Aug 03 11:45:23 2006 +0000
@@ -777,8 +777,8 @@
 
 (defun mouse-on-link-p (pos)
   "Return non-nil if POS is on a link in the current buffer.
-POS must be a buffer position in the current buffer or an mouse
-event location in the selected window, see `event-start'.
+POS must be a buffer position in the current buffer or a mouse
+event location in the selected window (see `event-start').
 However, if `mouse-1-click-in-non-selected-windows' is non-nil,
 POS may be a mouse event location in any window.
 
@@ -798,7 +798,7 @@
 
 - If the value is a function, FUNC, POS is inside a link if
 the call \(FUNC POS) returns non-nil.  Return the return value
-from that call.  Arg is \(posn-point POS) if POS is a mouse event,
+from that call.  Arg is \(posn-point POS) if POS is a mouse event.
 
 - Otherwise, return the value itself.
 
--- a/lisp/pcvs-util.el	Thu Aug 03 00:41:54 2006 +0000
+++ b/lisp/pcvs-util.el	Thu Aug 03 11:45:23 2006 +0000
@@ -126,7 +126,9 @@
 In such a case, the search for another buffer with the same name doesn't
 use the buffer name but the buffer's `list-buffers-directory' variable.
 If NOREUSE is non-nil, always return a new buffer."
-  (or (and (not (file-name-absolute-p name)) (get-buffer-create name))
+  (or (and (not (file-name-absolute-p name))
+           (if noreuse (generate-new-buffer name)
+             (get-buffer-create name)))
       (unless noreuse
 	(dolist (buf (buffer-list))
 	  (with-current-buffer buf
--- a/lisp/pgg-def.el	Thu Aug 03 00:41:54 2006 +0000
+++ b/lisp/pgg-def.el	Thu Aug 03 11:45:23 2006 +0000
@@ -87,7 +87,7 @@
   "If t, inform the recipient that the input is text.")
 
 (defmacro pgg-truncate-key-identifier (key)
-  `(if (> (length ,key) 8) (substring ,key 8) ,key))
+  `(if (> (length ,key) 8) (substring ,key -8) ,key))
 
 (provide 'pgg-def)
 
--- a/lisp/progmodes/cc-langs.el	Thu Aug 03 00:41:54 2006 +0000
+++ b/lisp/progmodes/cc-langs.el	Thu Aug 03 11:45:23 2006 +0000
@@ -134,12 +134,18 @@
 
 (eval-and-compile
   ;; These are used to collect the init forms from the subsequent
-  ;; `c-lang-defvar'.  They are used to build the lambda in
-  ;; `c-make-init-lang-vars-fun' below.
+  ;; `c-lang-defvar' and `c-lang-setvar'.  They are used to build the
+  ;;  lambda in `c-make-init-lang-vars-fun' below, and to build `defvar's
+  ;;  and `make-variable-buffer-local's in cc-engine and
+  ;;  `make-local-variable's in `c-init-language-vars-for'.
   (defvar c-lang-variable-inits nil)
   (defvar c-lang-variable-inits-tail nil)
   (setq c-lang-variable-inits (list nil)
-	c-lang-variable-inits-tail c-lang-variable-inits))
+	c-lang-variable-inits-tail c-lang-variable-inits)
+  (defvar c-emacs-variable-inits nil)
+  (defvar c-emacs-variable-inits-tail nil)
+  (setq c-emacs-variable-inits (list nil)
+	c-emacs-variable-inits-tail c-emacs-variable-inits))
 
 (defmacro c-lang-defvar (var val &optional doc)
   "Declares the buffer local variable VAR to get the value VAL.  VAL is
@@ -172,6 +178,25 @@
   ;; Return the symbol, like the other def* forms.
   `',var)
 
+(defmacro c-lang-setvar (var val)
+  "Causes the variable VAR to be made buffer local and to get set to the
+value VAL.  VAL is evaluated and assigned at mode initialization.  More
+precisely, VAL is evaluated and bound to VAR when the result from the
+macro `c-init-language-vars' is evaluated.  VAR is typically a standard
+Emacs variable like `comment-start'.
+
+`c-lang-const' is typically used in VAL to get the right value for the
+language being initialized, and such calls will be macro expanded to
+the evaluated constant value at compile time."
+  (let ((elem (assq var (cdr c-emacs-variable-inits))))
+    (if elem
+	(setcdr elem (list val)) ; Maybe remove "list", sometime. 2006-07-19
+      (setcdr c-emacs-variable-inits-tail (list (list var val)))
+      (setq c-emacs-variable-inits-tail (cdr c-emacs-variable-inits-tail))))
+
+  ;; Return the symbol, like the other def* forms.
+  `',var)
+
 (put 'c-lang-defvar 'lisp-indent-function 'defun)
 ; (eval-after-load "edebug" ; 2006-07-09: def-edebug-spec is now in subr.el.
 ;  '
@@ -1103,8 +1128,7 @@
   ;; In C we still default to the block comment style since line
   ;; comments aren't entirely portable.
   c "/* ")
-(c-lang-defvar comment-start (c-lang-const comment-start)
-  'dont-doc)
+(c-lang-setvar comment-start (c-lang-const comment-start))
 
 (c-lang-defconst comment-end
   "String that ends comments inserted with M-; etc.
@@ -1117,8 +1141,7 @@
 		      (c-lang-const comment-start))
 	(concat " " (c-lang-const c-block-comment-ender))
       ""))
-(c-lang-defvar comment-end (c-lang-const comment-end)
-  'dont-doc)
+(c-lang-setvar comment-end (c-lang-const comment-end))
 
 (c-lang-defconst comment-start-skip
   "Regexp to match the start of a comment plus everything up to its body.
@@ -1134,8 +1157,7 @@
 			   (c-lang-const c-block-comment-starter)))
 	     "\\|")
 	    "\\)\\s *"))
-(c-lang-defvar comment-start-skip (c-lang-const comment-start-skip)
-  'dont-doc)
+(c-lang-setvar comment-start-skip (c-lang-const comment-start-skip))
 
 (c-lang-defconst c-syntactic-ws-start
   ;; Regexp matching any sequence that can start syntactic whitespace.
@@ -2806,9 +2828,10 @@
 ;;; Wrap up the `c-lang-defvar' system.
 
 ;; Compile in the list of language variables that has been collected
-;; with the `c-lang-defvar' macro.  Note that the first element is
-;; nil.
+;; with the `c-lang-defvar' and `c-lang-setvar' macros.  Note that the
+;; first element of each is nil.
 (defconst c-lang-variable-inits (cc-eval-when-compile c-lang-variable-inits))
+(defconst c-emacs-variable-inits (cc-eval-when-compile c-emacs-variable-inits))
 
 (defun c-make-init-lang-vars-fun (mode)
   "Create a function that initializes all the language dependent variables
@@ -2841,12 +2864,16 @@
 			     ;; `c-lang-const' will expand to the evaluated
 			     ;; constant immediately in `cl-macroexpand-all'
 			     ;; below.
-			     (mapcan
-			      (lambda (init)
-				`(current-var ',(car init)
-				  ,(car init) ,(cl-macroexpand-all
-						(elt init 1))))
-			      (cdr c-lang-variable-inits))))
+			      (mapcan
+			       (lambda (init)
+				 `(current-var ',(car init)
+				   ,(car init) ,(cl-macroexpand-all
+						 (elt init 1))))
+			       ;; Note: The following `append' copies the
+			       ;; first argument.  That list is small, so
+			       ;; this doesn't matter too much.
+			      (append (cdr c-emacs-variable-inits)
+				      (cdr c-lang-variable-inits)))))
 
 		 ;; This diagnostic message isn't useful for end
 		 ;; users, so it's disabled.
@@ -2859,7 +2886,8 @@
 
 		 (require 'cc-langs)
 		 (setq source-eval t)
-		 (let ((init (cdr c-lang-variable-inits)))
+		 (let ((init (append (cdr c-emacs-variable-inits)
+				     (cdr c-lang-variable-inits))))
 		   (while init
 		     (setq current-var (caar init))
 		     (set (caar init) (eval (cadar init)))
@@ -2867,7 +2895,7 @@
 
 	     (error
 	      (if current-var
-		  (message "Eval error in the `c-lang-defvar' for `%s'%s: %S"
+		  (message "Eval error in the `c-lang-defvar' or `c-lang-setvar' for `%s'%s: %S"
 			   current-var
 			   (if source-eval
 			       (format "\
@@ -2883,7 +2911,8 @@
     `(lambda ()
        (require 'cc-langs)
        (let ((c-buffer-is-cc-mode ',mode)
-	     (init (cdr c-lang-variable-inits))
+	     (init (append (cdr c-emacs-variable-inits)
+			   (cdr c-lang-variable-inits)))
 	     current-var)
 	 (condition-case err
 
@@ -2895,7 +2924,7 @@
 	   (error
 	    (if current-var
 		(message
-		 "Eval error in the `c-lang-defvar' for `%s' (source eval): %S"
+		 "Eval error in the `c-lang-defvar' or `c-lang-setver' for `%s' (source eval): %S"
 		 current-var err)
 	      (signal (car err) (cdr err)))))))
     ))
--- a/lisp/progmodes/cc-mode.el	Thu Aug 03 00:41:54 2006 +0000
+++ b/lisp/progmodes/cc-mode.el	Thu Aug 03 11:45:23 2006 +0000
@@ -153,12 +153,21 @@
 (defun c-leave-cc-mode-mode ()
   (setq c-buffer-is-cc-mode nil))
 
+;; Make the `c-lang-setvar' variables buffer local in the current buffer.
+;; These are typically standard emacs variables such as `comment-start'.
+(defmacro c-make-emacs-variables-local ()
+  `(progn
+     ,@(mapcan (lambda (init)
+		 `((make-local-variable ',(car init))))
+	       (cdr c-emacs-variable-inits))))
+
 (defun c-init-language-vars-for (mode)
   "Initialize the language variables for one of the language modes
 directly supported by CC Mode.  This can be used instead of the
 `c-init-language-vars' macro if the language you want to use is one of
 those, rather than a derived language defined through the language
 variable system (see \"cc-langs.el\")."
+  (c-make-emacs-variables-local)
   (cond ((eq mode 'c-mode)    (c-init-language-vars c-mode))
 	((eq mode 'c++-mode)  (c-init-language-vars c++-mode))
 	((eq mode 'objc-mode) (c-init-language-vars objc-mode))
--- a/lisp/progmodes/compile.el	Thu Aug 03 00:41:54 2006 +0000
+++ b/lisp/progmodes/compile.el	Thu Aug 03 11:45:23 2006 +0000
@@ -226,14 +226,19 @@
      ;; I have no idea what this first line is supposed to match, but it
      ;; makes things ambiguous with output such as "foo:344:50:blabla" since
      ;; the "foo" part can match this first line (in which case the file
-     ;; name as "344").  To avoid this, we disallow filenames exclusively
-     ;; composed of digits.  --Stef
+     ;; name as "344").  To avoid this, the second line disallows filenames
+     ;; exclusively composed of digits.  --Stef
+     ;; Similarly, we get lots of false positives with messages including
+     ;; times of the form "HH:MM:SS" where MM is taken as a line number, so
+     ;; the last line tries to rule out message where the info after the
+     ;; line number starts with "SS".  --Stef
      "^\\(?:[[:alpha:]][-[:alnum:].]+: ?\\)?\
 \\([0-9]*[^0-9\n].*?\\): ?\
 \\([0-9]+\\)\\(?:\\([.:]\\)\\([0-9]+\\)\\)?\
 \\(?:-\\([0-9]+\\)?\\(?:\\3\\([0-9]+\\)\\)?\\)?:\
 \\(?: *\\(\\(?:Future\\|Runtime\\)?[Ww]arning\\|W:\\)\\|\
- *\\([Ii]nfo\\(?:\\>\\|rmationa?l?\\)\\|I:\\|instantiated from\\)\\)?"
+ *\\([Ii]nfo\\(?:\\>\\|rmationa?l?\\)\\|I:\\|instantiated from\\)\\|\
+\[0-9]?\\(?:[^0-9\n]\\|$\\)\\|[0-9][0-9][0-9]\\)"
      1 (2 . 5) (4 . 6) (7 . 8))
 
     (lcc
@@ -405,12 +410,7 @@
   "Value of `page-delimiter' in Compilation mode.")
 
 (defvar compilation-mode-font-lock-keywords
-   '(;; Don't highlight this as a compilation message.
-     ("^Compilation started at.*"
-      (0 '(face nil message nil help-echo nil mouse-face nil) t))
-     ("^Compiling file .*"
-      (0 '(face nil message nil help-echo nil mouse-face nil) t))
-     ;; configure output lines.
+   '(;; configure output lines.
      ("^[Cc]hecking \\(?:[Ff]or \\|[Ii]f \\|[Ww]hether \\(?:to \\)?\\)?\\(.+\\)\\.\\.\\. *\\(?:(cached) *\\)?\\(\\(yes\\(?: .+\\)?\\)\\|no\\|\\(.*\\)\\)$"
       (1 font-lock-variable-name-face)
       (2 (compilation-face '(4 . 3))))
@@ -421,7 +421,7 @@
      ("^Compilation \\(finished\\).*"
       (0 '(face nil message nil help-echo nil mouse-face nil) t)
       (1 compilation-info-face))
-     ("^Compilation \\(exited abnormally\\|interrupt\\|killed\\|terminated\\)\\(?:.*with code \\([0-9]+\\)\\)?.*"
+     ("^Compilation \\(exited abnormally\\|interrupt\\|killed\\|terminated\\|segmentation fault\\)\\(?:.*with code \\([0-9]+\\)\\)?.*"
       (0 '(face nil message nil help-echo nil mouse-face nil) t)
       (1 compilation-error-face)
       (2 compilation-error-face nil t)))
--- a/lisp/progmodes/delphi.el	Thu Aug 03 00:41:54 2006 +0000
+++ b/lisp/progmodes/delphi.el	Thu Aug 03 11:45:23 2006 +0000
@@ -1767,6 +1767,7 @@
 An error is raised if not in a comment."
   (interactive)
   (save-excursion
+    (save-restriction
     (let* ((comment (delphi-current-token))
            (comment-kind (delphi-token-kind comment)))
       (if (not (delphi-is comment-kind delphi-comments))
@@ -1845,7 +1846,7 @@
           ;; React to the entire fill change as a whole.
           (delphi-progress-start)
           (delphi-parse-region comment-start comment-end)
-          (delphi-progress-done))))))
+            (delphi-progress-done)))))))
 
 (defun delphi-new-comment-line ()
   "If in a // comment, does a newline, indented such that one is still in the
--- a/lisp/progmodes/gdb-ui.el	Thu Aug 03 00:41:54 2006 +0000
+++ b/lisp/progmodes/gdb-ui.el	Thu Aug 03 11:45:23 2006 +0000
@@ -434,7 +434,8 @@
 	    (make-local-variable 'gdb-define-alist)
 	    (gdb-create-define-alist)
 	    (add-hook 'after-save-hook 'gdb-create-define-alist nil t))))))
-  (gdb-force-mode-line-update "ready"))
+  (gdb-force-mode-line-update
+   (propertize "ready" 'face font-lock-variable-name-face)))
 
 (defun gdb-find-watch-expression ()
   (let* ((var (nth (- (line-number-at-pos (point)) 2) gdb-var-list))
@@ -1209,7 +1210,8 @@
 (defun gdb-resync()
   (setq gdb-flush-pending-output t)
   (setq gud-running nil)
-  (gdb-force-mode-line-update "stopped")
+  (gdb-force-mode-line-update
+   (propertize "stopped"'face font-lock-warning-face))
   (setq gdb-output-sink 'user)
   (setq gdb-input-queue nil)
   (setq gdb-pending-triggers nil)
@@ -1249,7 +1251,8 @@
   "An annotation handler for `prompt'.
 This sends the next command (if any) to gdb."
   (when gdb-first-prompt
-    (gdb-force-mode-line-update "initializing...")
+    (gdb-force-mode-line-update 
+     (propertize "initializing..." 'face font-lock-variable-name-face))
     (gdb-init-1)
     (setq gdb-first-prompt nil))
   (let ((sink gdb-output-sink))
@@ -1287,7 +1290,8 @@
       (progn
 	(setq gud-running t)
 	(setq gdb-inferior-status "running")
-	(gdb-force-mode-line-update gdb-inferior-status)
+	(gdb-force-mode-line-update
+	 (propertize gdb-inferior-status 'face font-lock-type-face))
 	(gdb-remove-text-properties)
 	(setq gud-old-arrow gud-overlay-arrow-position)
 	(setq gud-overlay-arrow-position nil)
@@ -1300,7 +1304,8 @@
 
 (defun gdb-signal (ignored)
   (setq gdb-inferior-status "signal")
-  (gdb-force-mode-line-update gdb-inferior-status)
+  (gdb-force-mode-line-update
+   (propertize gdb-inferior-status 'face font-lock-warning-face))
   (gdb-stopping ignored))
 
 (defun gdb-stopping (ignored)
@@ -1327,7 +1332,8 @@
   (setq gdb-overlay-arrow-position nil)
   (setq gud-old-arrow nil)
   (setq gdb-inferior-status "exited")
-  (gdb-force-mode-line-update gdb-inferior-status)
+  (gdb-force-mode-line-update
+   (propertize gdb-inferior-status 'face font-lock-warning-face))
   (gdb-stopping ignored))
 
 (defun gdb-signalled (ignored)
@@ -1352,6 +1358,23 @@
   :type 'boolean
   :version "22.1")
 
+(defcustom gdb-find-source-frame nil
+  "Non-nil means try to find a source frame further up stack e.g after signal."
+  :group 'gud
+  :type 'boolean
+  :version "22.1")
+
+(defun gdb-find-source-frame (arg)
+  "Toggle trying to find a source frame further up stack.
+With arg, look for a source frame further up stack iff arg is positive."
+  (interactive "P")
+  (setq gdb-find-source-frame
+	(if (null arg)
+	    (not gdb-find-source-frame)
+	  (> (prefix-numeric-value arg) 0)))
+  (message (format "Looking for source frame %sabled"
+		   (if gdb-find-source-frame "en" "dis"))))
+
 (defun gdb-stopped (ignored)
   "An annotation handler for `stopped'.
 It is just like `gdb-stopping', except that if we already set the output
@@ -1365,17 +1388,19 @@
     (if gdb-same-frame
 	(gdb-display-gdb-buffer)
       (gdb-frame-gdb-buffer))
+    (if gdb-find-source-frame
     ;;Try to find source further up stack e.g after signal.
-    (setq gdb-look-up-stack
-	  (if (gdb-get-buffer 'gdb-stack-buffer)
-	      'keep
-	    (progn
-	      (gdb-get-buffer-create 'gdb-stack-buffer)
-	      (gdb-invalidate-frames)
-	      'delete)))))
+	(setq gdb-look-up-stack
+	      (if (gdb-get-buffer 'gdb-stack-buffer)
+		  'keep
+		(progn
+		  (gdb-get-buffer-create 'gdb-stack-buffer)
+		  (gdb-invalidate-frames)
+		  'delete))))))
   (unless (member gdb-inferior-status '("exited" "signal"))
     (setq gdb-inferior-status "stopped")
-    (gdb-force-mode-line-update gdb-inferior-status))
+    (gdb-force-mode-line-update
+     (propertize gdb-inferior-status 'face font-lock-warning-face)))
   (let ((sink gdb-output-sink))
     (cond
      ((eq sink 'inferior)
@@ -1747,6 +1772,7 @@
 	    (gdb-remove-breakpoint-icons (point-min) (point-max)))))
     (with-current-buffer (gdb-get-buffer 'gdb-breakpoints-buffer)
       (save-excursion
+	(let ((buffer-read-only nil))
 	(goto-char (point-min))
 	(while (< (point) (- (point-max) 1))
 	  (forward-line 1)
@@ -1755,14 +1781,19 @@
 		(looking-at "\\([0-9]+\\)\\s-+\\S-+\\s-+\\S-+\\s-+\\(.\\)")
 		(setq bptno (match-string 1))
 		(setq flag (char-after (match-beginning 2)))
+		(add-text-properties
+		 (match-beginning 2) (match-end 2)
+		 (if (eq flag ?y)
+		     '(face font-lock-warning-face)
+		   '(face font-lock-type-face)))
 		(beginning-of-line)
 		(if (re-search-forward " in \\(.*\\) at\\s-+" nil t)
 		    (progn
-		      (let ((buffer-read-only nil))
-			(add-text-properties (match-beginning 1) (match-end 1)
-					     '(face font-lock-function-name-face)))
+		      (add-text-properties
+		       (match-beginning 1) (match-end 1)
+		       '(face font-lock-function-name-face))
 		      (looking-at "\\(\\S-+\\):\\([0-9]+\\)")
-		      (let ((line (match-string 2)) (buffer-read-only nil)
+		      (let ((line (match-string 2))
 			    (file (match-string 1)))
 			(add-text-properties (line-beginning-position)
 					     (line-end-position)
@@ -1792,7 +1823,7 @@
 			   (list (concat gdb-server-prefix "info source\n")
 				 `(lambda () (gdb-get-location
 					      ,bptno ,line ,flag))))))))))
-	  (end-of-line)))))
+	  (end-of-line))))))
   (if (gdb-get-buffer 'gdb-assembler-buffer) (gdb-assembler-custom)))
 
 (defun gdb-mouse-set-clear-breakpoint (event)
@@ -2029,9 +2060,10 @@
   (setq gdb-look-up-stack nil))
 
 (defun gdb-set-hollow ()
-  (with-current-buffer (gud-find-file (car gud-last-last-frame))
-    (setq fringe-indicator-alist
-	  '((overlay-arrow . hollow-right-triangle)))))
+  (if gud-last-last-frame
+      (with-current-buffer (gud-find-file (car gud-last-last-frame))
+	(setq fringe-indicator-alist
+	      '((overlay-arrow . hollow-right-triangle))))))
 
 (defun gdb-stack-buffer-name ()
   (with-current-buffer gud-comint-buffer
@@ -2764,8 +2796,13 @@
   (define-key gud-menu-map [ui]
     `(menu-item (if (eq gud-minor-mode 'gdba) "GDB-UI" "GDB-MI")
 		,menu :visible (memq gud-minor-mode '(gdbmi gdba))))
+  (define-key menu [gdb-find-source-frame]
+  '(menu-item "Look For Source Frame" gdb-find-source-frame
+	      :visible (eq gud-minor-mode 'gdba)
+	      :help "Toggle look for source frame."
+	      :button (:toggle . gdb-find-source-frame)))
   (define-key menu [gdb-use-separate-io]
-  '(menu-item "Separate inferior IO" gdb-use-separate-io-buffer
+  '(menu-item "Separate Inferior IO" gdb-use-separate-io-buffer
 	      :visible (eq gud-minor-mode 'gdba)
 	      :help "Toggle separate IO for inferior."
 	      :button (:toggle . gdb-use-separate-io-buffer)))
@@ -3268,7 +3305,8 @@
 	  (make-local-variable 'gdb-define-alist)
 	  (gdb-create-define-alist)
 	  (add-hook 'after-save-hook 'gdb-create-define-alist nil t)))))
-  (gdb-force-mode-line-update "ready"))
+  (gdb-force-mode-line-update
+   (propertize "ready" 'face font-lock-variable-name-face)))
 
 ; Uses "-var-list-children --all-values".  Needs GDB 6.1 onwards.
 (defun gdb-var-list-children-1 (varnum)
--- a/lisp/progmodes/grep.el	Thu Aug 03 00:41:54 2006 +0000
+++ b/lisp/progmodes/grep.el	Thu Aug 03 11:45:23 2006 +0000
@@ -155,7 +155,7 @@
   :type 'alist
   :group 'grep)
 
-(defcustom grep-find-ignored-directories '("CVS" ".hg" "{arch}")
+(defcustom grep-find-ignored-directories '("CVS" ".svn" "{arch}" ".hg" "_darcs")
   "*List of names of sub-directories which `rgrep' shall not recurse into."
   :type '(repeat string)
   :group 'grep)
@@ -455,34 +455,48 @@
 		   (search-forward "--color" nil t))
 		 t)))))
 
+(defun grep-tag-default ()
+  (or (and transient-mark-mode mark-active
+	   (/= (point) (mark))
+	   (buffer-substring-no-properties (point) (mark)))
+      (funcall (or find-tag-default-function
+		   (get major-mode 'find-tag-default-function)
+		   'find-tag-default))
+      ""))
+
 (defun grep-default-command ()
-  (let ((tag-default
-         (shell-quote-argument
-          (or (funcall (or find-tag-default-function
-                           (get major-mode 'find-tag-default-function)
-                           'find-tag-default))
-              "")))
+  "Compute the default grep command for C-u M-x grep to offer."
+  (let ((tag-default (shell-quote-argument (grep-tag-default)))
+	;; This a regexp to match single shell arguments.
+	;; Could someone please add comments explaining it?
 	(sh-arg-re "\\(\\(?:\"\\(?:[^\"]\\|\\\\\"\\)+\"\\|'[^']+'\\|[^\"' \t\n]\\)+\\)")
 	(grep-default (or (car grep-history) grep-command)))
-    ;; Replace the thing matching for with that around cursor.
+    ;; In the default command, find the arg that specifies the pattern.
     (when (or (string-match
 	       (concat "[^ ]+\\s +\\(?:-[^ ]+\\s +\\)*"
 		       sh-arg-re "\\(\\s +\\(\\S +\\)\\)?")
 	       grep-default)
 	      ;; If the string is not yet complete.
 	      (string-match "\\(\\)\\'" grep-default))
-      (unless (or (not (stringp buffer-file-name))
-		  (when (match-beginning 2)
-		    (save-match-data
-		      (string-match
-		       (wildcard-to-regexp
-			(file-name-nondirectory
-			 (match-string 3 grep-default)))
-		       (file-name-nondirectory buffer-file-name)))))
-	(setq grep-default (concat (substring grep-default
-					      0 (match-beginning 2))
-				   " *."
-				   (file-name-extension buffer-file-name))))
+      ;; Maybe we will replace the pattern with the default tag.
+      ;; But first, maybe replace the file name pattern.
+      (condition-case nil
+	  (unless (or (not (stringp buffer-file-name))
+		      (when (match-beginning 2)
+			(save-match-data
+			  (string-match
+			   (wildcard-to-regexp
+			    (file-name-nondirectory
+			     (match-string 3 grep-default)))
+			   (file-name-nondirectory buffer-file-name)))))
+	    (setq grep-default (concat (substring grep-default
+						  0 (match-beginning 2))
+				       " *."
+				       (file-name-extension buffer-file-name))))
+	;; In case wildcard-to-regexp gets an error
+	;; from invalid data.
+	(error nil))
+      ;; Now replace the pattern with the default tag.
       (replace-match tag-default t t grep-default 1))))
 
 
@@ -590,15 +604,11 @@
 
 (defun grep-read-regexp ()
   "Read regexp arg for interactive grep."
-  (let ((default
-	  (or (funcall (or find-tag-default-function
-			   (get major-mode 'find-tag-default-function)
-			   'find-tag-default))
-	      "")))
+  (let ((default (grep-tag-default)))
     (read-string
      (concat "Search for"
 	     (if (and default (> (length default) 0))
-		 (format " (default %s): " default) ": "))
+		 (format " (default \"%s\"): " default) ": "))
      nil 'grep-regexp-history default)))
 
 (defun grep-read-files (regexp)
@@ -620,7 +630,9 @@
 		      (cdr alias)))
 	       (and fn
 		    (let ((ext (file-name-extension fn)))
-		      (and ext (concat "*." ext))))))
+		      (and ext (concat "*." ext))))
+	       (car grep-files-history)
+	       (car (car grep-files-aliases))))
 	 (files (read-string
 		 (concat "Search for \"" regexp
 			 "\" in files"
--- a/lisp/progmodes/ld-script.el	Thu Aug 03 00:41:54 2006 +0000
+++ b/lisp/progmodes/ld-script.el	Thu Aug 03 11:45:23 2006 +0000
@@ -74,25 +74,55 @@
   "Syntax table used while in `ld-script-mode'.")
 
 ;; Font lock keywords
+;; (The section number comes from ld's info.)
 (defvar ld-script-keywords
-  '("ENTRY" "INCLUDE" "INPUT" "GROUP"
-    "OUTPUT" "SEARCH_DIR" "STARTUP"
+  '(
+    ;; 3.4.1 Setting the Entry Point
+    "ENTRY" 
+    ;; 3.4.2 Commands Dealing with Files
+    "INCLUDE" "INPUT" "GROUP" "AS_NEEDED" "OUTPUT" "SEARCH_DIR" "STARTUP"
+    ;; 3.4.3 Commands Dealing with Object File Formats
     "OUTPUT_FORMAT" "TARGET"
-    "ASSERT" "EXTERN" "FORCE_COMMON_ALLOCATION" "NOCROSSREFS" "OUTPUT_ARCH"
+    ;; 3.4.3 Other Linker Script Commands
+    "ASSERT" "EXTERN" "FORCE_COMMON_ALLOCATION" 
+    "INHIBIT_COMMON_ALLOCATION" "NOCROSSREFS" "OUTPUT_ARCH"
+    ;; 3.5.2 PROVIDE
     "PROVIDE"
-    "SECTIONS" "SORT" "COMMON" "KEEP"
-    "BYTE" "SHORT" "LONG" "QUAD" "SQAD"
-    "FILL"
-    "CREATE_OBJECT_SYMBOLS"
-    "CONSTRUCTORS"
+    ;; 3.5.3 PROVIDE_HIDDEN
+    "PROVIDE_HIDEN"
+    ;; 3.6 SECTIONS Command
+    "SECTIONS" 
+    ;; 3.6.4.2 Input Section Wildcard Patterns
+    "SORT" "SORT_BY_NAME" "SORT_BY_ALIGNMENT"
+    ;; 3.6.4.3 Input Section for Common Symbols
+    "COMMON"
+    ;; 3.6.4.4 Input Section and Garbage Collection
+    "KEEP"
+    ;; 3.6.5 Output Section Data
+    "BYTE" "SHORT" "LONG" "QUAD" "SQUAD" "FILL"
+    ;; 3.6.6 Output Section Keywords
+    "CREATE_OBJECT_SYMBOLS" "CONSTRUCTORS"
+    "__CTOR_LIST__" "__CTOR_END__" "__DTOR_LIST__" "__DTOR_END__"
+    ;; 3.6.7 Output Section Discarding
+    ;; See `ld-script-font-lock-keywords'
+    ;; 3.6.8.1 Output Section Type
     "NOLOAD" "DSECT" "COPY" "INFO" "OVERLAY"
+    ;; 3.6.8.2 Output Section LMA
     "AT"
+    ;; 3.6.8.4 Forced Input Alignment
+    "SUBALIGN"
+    ;; 3.6.8.6 Output Section Phdr
+    ":PHDR"
+    ;; 3.7 MEMORY Command
     "MEMORY"
+    ;; 3.8 PHDRS Command
     "PHDRS" "FILEHDR" "FLAGS"
     "PT_NULL" "PT_LOAD" "PT_DYNAMIC" "PT_INTERP" "PT_NONE" "PT_SHLIB" "PT_PHDR"
+    ;; 3.9 VERSION Command
     "VERSION")
   "Keywords used of GNU ld script.")
 
+;; 3.10.8 Builtin Functions
 (defvar ld-script-builtins
   '("ABSOLUTE"
     "ADDR"
@@ -102,12 +132,12 @@
     "DATA_SEGMENT_END"
     "DATA_SEGMENT_RELRO_END"
     "DEFINED"
-    "LENGTH"
+    "LENGTH" "len" "l"
     "LOADADDR"
     "MAX"
     "MIN"
     "NEXT"
-    "ORIGIN"
+    "ORIGIN" "org" "o"
     "SEGMENT_START"
     "SIZEOF"
     "SIZEOF_HEADERS"
@@ -120,7 +150,10 @@
       1 font-lock-keyword-face)
      (,(regexp-opt ld-script-builtins 'words)
       1 font-lock-builtin-face)
-     ("/DISCARD/" . font-lock-warning-face)
+     ;; 3.6.7 Output Section Discarding
+     ;; 3.6.4.1 Input Section Basics
+     ;; 3.6.8.6 Output Section Phdr
+     ("/DISCARD/\\|EXCLUDE_FILE\\|:NONE" . font-lock-warning-face)
      ("\\W\\(\\.\\)\\W" 1 ld-script-location-counter-face)
      )
    cpp-font-lock-keywords)
--- a/lisp/progmodes/sh-script.el	Thu Aug 03 00:41:54 2006 +0000
+++ b/lisp/progmodes/sh-script.el	Thu Aug 03 11:45:23 2006 +0000
@@ -980,54 +980,55 @@
   (re-search-forward sh-here-doc-re limit t))
 
 (defun sh-quoted-subshell (limit)
-  "Search for a subshell embedded in a string. Find all the unescaped
-\" characters within said subshell, remembering that subshells can nest."
+  "Search for a subshell embedded in a string.
+Find all the unescaped \" characters within said subshell, remembering that
+subshells can nest."
   ;; FIXME: This can (and often does) match multiple lines, yet it makes no
   ;; effort to handle multiline cases correctly, so it ends up being
   ;; rather flakey.
-  (if (re-search-forward "\"\\(?:\\(?:.\\|\n\\)*?[^\\]\\(\\\\\\\\\\)*\\)?\\(\\$(\\|`\\)" limit t)
-      ;; bingo we have a $( or a ` inside a ""
-      (let ((char (char-after (point)))
-            (continue t)
-            (pos (point))
-            (data nil)    ;; value to put into match-data (and return)
-            (last nil)    ;; last char seen
-            (bq  (equal (match-string 1) "`")) ;; ` state flip-flop
-            (seen nil)    ;; list of important positions
-            (nest 1))     ;; subshell nesting level
-        (while (and continue char (<= pos limit))
-          ;; unescaped " inside a $( ... ) construct.
-          ;; state machine time...
-          ;; \ => ignore next char;
-          ;; ` => increase or decrease nesting level based on bq flag
-          ;; ) [where nesting > 0] => decrease nesting
-          ;; ( [where nesting > 0] => increase nesting
-          ;; ( [preceeded by $ ]   => increase nesting
-          ;; " [nesting <= 0 ]     => terminate, we're done.
-          ;; " [nesting >  0 ]     => remember this, it's not a proper "
-          ;; FIXME: don't count parens that appear within quotes.
-          (cond
-           ((eq ?\\ last) nil)
-           ((eq ?\` char) (setq nest (+ nest (if bq -1 1)) bq (not bq)))
-           ((and (> nest 0) (eq ?\) char))   (setq nest (1- nest)))
-           ((and (eq ?$ last) (eq ?\( char)) (setq nest (1+ nest)))
-           ((and (> nest 0) (eq ?\( char))   (setq nest (1+ nest)))
-           ((eq char ?\")
-            (if (>= 0 nest) (setq continue nil) (push pos seen))))
-          ;;(message "POS: %d [%d]" pos nest)
-          (setq last char
-                pos  (1+ pos)
-                char (char-after pos)) )
-        ;; FIXME: why construct a costly match data to pass to
-        ;; sh-apply-quoted-subshell rather than apply the highlight
-        ;; directly here?  -- Stef
-        (when seen
-          ;;(message "SEEN: %S" seen)
-          (setq data (list (current-buffer)))
-          (dolist(P seen)
-            (setq data (cons P (cons (1+ P) data))))
-          (store-match-data data))
-        data) ))
+  (when (re-search-forward "\"\\(?:\\(?:.\\|\n\\)*?[^\\]\\(?:\\\\\\\\\\)*\\)??\\(\\$(\\|`\\)" limit t)
+    ;; bingo we have a $( or a ` inside a ""
+    (let ((char (char-after (point)))
+          (continue t)
+          (pos (point))
+          (data nil)      ;; value to put into match-data (and return)
+          (last nil)      ;; last char seen
+          (bq  (equal (match-string 1) "`")) ;; ` state flip-flop
+          (seen nil)                         ;; list of important positions
+          (nest 1))                          ;; subshell nesting level
+      (while (and continue char (<= pos limit))
+        ;; unescaped " inside a $( ... ) construct.
+        ;; state machine time...
+        ;; \ => ignore next char;
+        ;; ` => increase or decrease nesting level based on bq flag
+        ;; ) [where nesting > 0] => decrease nesting
+        ;; ( [where nesting > 0] => increase nesting
+        ;; ( [preceeded by $ ]   => increase nesting
+        ;; " [nesting <= 0 ]     => terminate, we're done.
+        ;; " [nesting >  0 ]     => remember this, it's not a proper "
+        ;; FIXME: don't count parens that appear within quotes.
+        (cond
+         ((eq ?\\ last) nil)
+         ((eq ?\` char) (setq nest (+ nest (if bq -1 1)) bq (not bq)))
+         ((and (> nest 0) (eq ?\) char))   (setq nest (1- nest)))
+         ((and (eq ?$ last) (eq ?\( char)) (setq nest (1+ nest)))
+         ((and (> nest 0) (eq ?\( char))   (setq nest (1+ nest)))
+         ((eq char ?\")
+          (if (>= 0 nest) (setq continue nil) (push pos seen))))
+        ;;(message "POS: %d [%d]" pos nest)
+        (setq last char
+              pos  (1+ pos)
+              char (char-after pos)) )
+      ;; FIXME: why construct a costly match data to pass to
+      ;; sh-apply-quoted-subshell rather than apply the highlight
+      ;; directly here?  -- Stef
+      (when seen
+        ;;(message "SEEN: %S" seen)
+        (setq data (list (current-buffer)))
+        (dolist(P seen)
+          (setq data (cons P (cons (1+ P) data))))
+        (store-match-data data))
+      data) ))
 
 (defun sh-is-quoted-p (pos)
   (and (eq (char-before pos) ?\\)
--- a/lisp/progmodes/vhdl-mode.el	Thu Aug 03 00:41:54 2006 +0000
+++ b/lisp/progmodes/vhdl-mode.el	Thu Aug 03 11:45:23 2006 +0000
@@ -14112,8 +14112,8 @@
 (defun vhdl-speedbar-display-directory (directory depth &optional rescan)
   "Display directory and hierarchy information in speedbar."
   (setq vhdl-speedbar-show-projects nil)
-  (setq speedbar-ignored-path-regexp
-	(speedbar-extension-list-to-regex speedbar-ignored-path-expressions))
+  (setq speedbar-ignored-directory-regexp
+	(speedbar-extension-list-to-regex speedbar-ignored-directory-expressions))
   (setq directory (abbreviate-file-name (file-name-as-directory directory)))
   (setq speedbar-last-selected-file nil)
   (speedbar-with-writable
@@ -14133,7 +14133,7 @@
 (defun vhdl-speedbar-display-projects (project depth &optional rescan)
   "Display projects and hierarchy information in speedbar."
   (setq vhdl-speedbar-show-projects t)
-  (setq speedbar-ignored-path-regexp ".")
+  (setq speedbar-ignored-directory-regexp ".")
   (setq speedbar-last-selected-file nil)
   (setq vhdl-speedbar-last-selected-project nil)
   (speedbar-with-writable
--- a/lisp/progmodes/which-func.el	Thu Aug 03 00:41:54 2006 +0000
+++ b/lisp/progmodes/which-func.el	Thu Aug 03 11:45:23 2006 +0000
@@ -262,11 +262,11 @@
 
 (defun which-function ()
   "Return current function name based on point.
-Uses `which-function-functions', `imenu--index-alist'
+Uses `which-func-functions', `imenu--index-alist'
 or `add-log-current-defun-function'.
 If no function name is found, return nil."
   (let ((name
-	 ;; Try the `which-function-functions' functions first.
+	 ;; Try the `which-func-functions' functions first.
 	 (run-hook-with-args-until-success 'which-func-functions)))
 
     ;; If Imenu is loaded, try to make an index alist with it.
--- a/lisp/replace.el	Thu Aug 03 00:41:54 2006 +0000
+++ b/lisp/replace.el	Thu Aug 03 11:45:23 2006 +0000
@@ -1283,8 +1283,8 @@
 #     replace-count
 
 Note that these symbols must be preceeded by a backslash in order to
-type them."
-  (while n
+type them using Lisp syntax."
+  (while (consp n)
     (cond
      ((consp (car n))
       (replace-match-string-symbols (car n))) ;Process sub-list
--- a/lisp/startup.el	Thu Aug 03 00:41:54 2006 +0000
+++ b/lisp/startup.el	Thu Aug 03 11:45:23 2006 +0000
@@ -247,14 +247,16 @@
   :group 'mail)
 
 (defcustom user-mail-address (if command-line-processed
-				 (concat (user-login-name) "@"
-					 (or mail-host-address
-					     (system-name)))
+				 (or (getenv "EMAIL")
+				     (concat (user-login-name) "@"
+					     (or mail-host-address
+						 (system-name))))
 			       ;; Empty string means "not set yet".
 			       "")
   "*Full mailing address of this user.
-This is initialized based on `mail-host-address',
-after your init file is read, in case it sets `mail-host-address'."
+This is initialized with environment variable `EMAIL' or, as a
+fallback, using `mail-host-address'. This is done after your
+init file is read, in case it sets `mail-host-address'."
   :type 'string
   :group 'mail)
 
@@ -978,9 +980,10 @@
 
     ;; Do this here in case the init file sets mail-host-address.
     (if (equal user-mail-address "")
-	(setq user-mail-address (concat (user-login-name) "@"
-					(or mail-host-address
-					    (system-name)))))
+	(setq user-mail-address (or (getenv "EMAIL")
+				    (concat (user-login-name) "@"
+					    (or mail-host-address
+						(system-name))))))
 
     ;; Originally face attributes were specified via
     ;; `font-lock-face-attributes'.  Users then changed the default
--- a/lisp/subr.el	Thu Aug 03 00:41:54 2006 +0000
+++ b/lisp/subr.el	Thu Aug 03 11:45:23 2006 +0000
@@ -108,6 +108,9 @@
   (declare (indent 1) (debug t))
   (cons 'if (cons cond (cons nil body))))
 
+(defvar --dolist-tail-- nil
+  "Temporary variable used in `dolist' expansion.")
+
 (defmacro dolist (spec &rest body)
   "Loop over a list.
 Evaluate BODY with VAR bound to each car from LIST, in turn.
@@ -115,16 +118,22 @@
 
 \(fn (VAR LIST [RESULT]) BODY...)"
   (declare (indent 1) (debug ((symbolp form &optional form) body)))
-  (let ((temp (make-symbol "--dolist-temp--")))
+  ;; It would be cleaner to create an uninterned symbol,
+  ;; but that uses a lot more space when many functions in many files
+  ;; use dolist.
+  (let ((temp '--dolist-tail--))
     `(let ((,temp ,(nth 1 spec))
 	   ,(car spec))
        (while ,temp
 	 (setq ,(car spec) (car ,temp))
-	 (setq ,temp (cdr ,temp))
-	 ,@body)
+	 ,@body
+	 (setq ,temp (cdr ,temp)))
        ,@(if (cdr (cdr spec))
 	     `((setq ,(car spec) nil) ,@(cdr (cdr spec)))))))
 
+(defvar --dotimes-limit-- nil
+  "Temporary variable used in `dotimes' expansion.")
+
 (defmacro dotimes (spec &rest body)
   "Loop a certain number of times.
 Evaluate BODY with VAR bound to successive integers running from 0,
@@ -133,7 +142,10 @@
 
 \(fn (VAR COUNT [RESULT]) BODY...)"
   (declare (indent 1) (debug dolist))
-  (let ((temp (make-symbol "--dotimes-temp--"))
+  ;; It would be cleaner to create an uninterned symbol,
+  ;; but that uses a lot more space when many functions in many files
+  ;; use dotimes.
+  (let ((temp '--dotimes-limit--)
 	(start 0)
 	(end (nth 1 spec)))
     `(let ((,temp ,end)
@@ -1725,19 +1737,9 @@
       (progn (sleep-for seconds) t)
     (unless nodisp (redisplay))
     (or (<= seconds 0)
-	(let ((timer (timer-create))
-	      (echo-keystrokes 0))
-	  (if (catch 'sit-for-timeout
-		(timer-set-time timer (timer-relative-time
-				       (current-time) seconds))
-		(timer-set-function timer 'with-timeout-handler
-				    '(sit-for-timeout))
-		(timer-activate timer)
-		(push (read-event) unread-command-events)
-		nil)
-	      t
-	    (cancel-timer timer)
-	    nil)))))
+	(let ((read (read-event nil nil seconds)))
+	  (or (null read)
+	      (progn (push read unread-command-events) nil))))))
 
 ;;; Atomic change groups.
 
@@ -2531,8 +2533,9 @@
 (defun looking-back (regexp &optional limit greedy)
   "Return non-nil if text before point matches regular expression REGEXP.
 Like `looking-at' except matches before point, and is slower.
-LIMIT if non-nil speeds up the search by specifying how far back the
-match can start.
+LIMIT if non-nil speeds up the search by specifying a minimum
+starting position, to avoid checking matches that would start
+before LIMIT.
 
 If GREEDY is non-nil, extend the match backwards as far as possible,
 stopping when a single additional previous character cannot be part
--- a/lisp/t-mouse.el	Thu Aug 03 00:41:54 2006 +0000
+++ b/lisp/t-mouse.el	Thu Aug 03 11:45:23 2006 +0000
@@ -292,9 +292,7 @@
 				"-f")))
 	 (setq t-mouse-filter-accumulator "")
 	 (set-process-filter t-mouse-process 't-mouse-process-filter)
-; use commented line instead for emacs 21.4 onwards
-	 (process-kill-without-query t-mouse-process)))
-;	 (set-process-query-on-exit-flag t-mouse-process nil)))
+	 (set-process-query-on-exit-flag t-mouse-process nil)))
     ;; Turn it off
     (setq mouse-position-function nil)
     (delete-process t-mouse-process)
--- a/lisp/tabify.el	Thu Aug 03 00:41:54 2006 +0000
+++ b/lisp/tabify.el	Thu Aug 03 11:45:23 2006 +0000
@@ -50,10 +50,10 @@
 	  (delete-region tab-beg (point))
 	  (indent-to column))))))
 
-(defvar tabify-regexp "[ \t][ \t]+"
+(defvar tabify-regexp " [ \t]+"
   "Regexp matching whitespace that tabify should consider.
-Usually this will be \"[ \\t][ \\t]+\" to match two or more spaces or tabs.
-\"^[ \\t]+\" is also useful, for tabifying only initial whitespace.")
+Usually this will be \" [ \\t]+\" to match two or more spaces or tabs.
+\"^\\t* [ \\t]+\" is also useful, for tabifying only initial whitespace.")
 
 ;;;###autoload
 (defun tabify (start end)
@@ -72,13 +72,24 @@
       (beginning-of-line)
       (narrow-to-region (point) end)
       (goto-char start)
-      (while (re-search-forward tabify-regexp nil t)
-	(let ((column (current-column))
-	      (indent-tabs-mode t))
-	  (delete-region (match-beginning 0) (point))
-	  (indent-to column))))))
+      (let ((indent-tabs-mode t))
+        (while (re-search-forward tabify-regexp nil t)
+          ;; The region between (match-beginning 0) and (match-end 0) is just
+          ;; spacing which we want to adjust to use TABs where possible.
+          (let ((end-col (current-column))
+                (beg-col (save-excursion (goto-char (match-beginning 0))
+                                         (skip-chars-forward "\t")
+                                         (current-column))))
+            (if (= (/ end-col tab-width) (/ beg-col tab-width))
+                ;; The spacing (after some leading TABs which we wouldn't
+                ;; want to touch anyway) does not straddle a TAB boundary,
+                ;; so it neither contains a TAB, nor will we be able to use
+                ;; a TAB here anyway: there's nothing to do.
+                nil
+              (delete-region (match-beginning 0) (point))
+              (indent-to end-col))))))))
 
 (provide 'tabify)
 
-;;; arch-tag: c83893b1-e0cc-4e57-8a09-73fd03466416
+;; arch-tag: c83893b1-e0cc-4e57-8a09-73fd03466416
 ;;; tabify.el ends here
--- a/lisp/term/xterm.el	Thu Aug 03 00:41:54 2006 +0000
+++ b/lisp/term/xterm.el	Thu Aug 03 11:45:23 2006 +0000
@@ -229,13 +229,21 @@
       (define-key map "\e[29~" [print])
       
       ;; These keys are available in xterm starting from version 214
-      ;; if the modifyOtherKeys resource is set.
-      (define-key map "\e[27;5;9~"  [(control ?\t)])
+      ;; if the modifyOtherKeys resource is set to 1.
+      (define-key map "\e[27;5;9~"  [C-tab])
       (define-key map "\e[27;5;13~" [C-return])
-      (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 ?\\)])
+      (define-key map "\e[27;5;44~" [?\C-,])
+      (define-key map "\e[27;5;46~" [?\C-.])
+      (define-key map "\e[27;5;47~" [?\C-/])
+      (define-key map "\e[27;5;92~" [?\C-\\])
+
+      (define-key map "\e[27;2;9~"  [S-tab])
+      (define-key map "\e[27;2;13~" [S-return])
+
+      (define-key map "\e[27;6;9~"  [(C-S-tab)])
+
+      (define-key map "\e[27;13;46~" [?\C-\M-.])
+
 
       ;; Other versions of xterm might emit these.
       (define-key map "\e[A" [up])
--- a/lisp/textmodes/ispell.el	Thu Aug 03 00:41:54 2006 +0000
+++ b/lisp/textmodes/ispell.el	Thu Aug 03 11:45:23 2006 +0000
@@ -1620,9 +1620,15 @@
 					     cursor-location))
 		    (if (not (equal new-word (car poss)))
 			(progn
-			  (delete-region start end)
-			  (setq start (point))
+			  (goto-char start)
+			  ;; Insert first and then delete,
+			  ;; to avoid collapsing markers before and after
+			  ;; into a single place.
 			  (ispell-insert-word new-word)
+			  (delete-region (point) (+ (point) (- end start)))
+			  ;; It is meaningless to preserve the cursor position
+			  ;; inside a word that has changed.
+			  (setq cursor-location (point))
 			  (setq end (point))))
 		    (if (not (atom replace)) ;recheck spelling of replacement
 			(progn
--- a/lisp/textmodes/po.el	Thu Aug 03 00:41:54 2006 +0000
+++ b/lisp/textmodes/po.el	Thu Aug 03 11:45:23 2006 +0000
@@ -42,7 +42,7 @@
 
 (defun po-find-charset (filename)
   "Return PO charset value for FILENAME.
-If FILENAME is a cons, the cdr part is a buffer that already contains
+If FILENAME is a cons cell, its CDR is a buffer that already contains
 the PO file (but not yet decoded)."
   (let ((charset-regexp
 	 "^\"Content-Type:[ \t]*text/plain;[ \t]*charset=\\(.*\\)\\\\n\"")
--- a/lisp/textmodes/table.el	Thu Aug 03 00:41:54 2006 +0000
+++ b/lisp/textmodes/table.el	Thu Aug 03 11:45:23 2006 +0000
@@ -6,7 +6,7 @@
 ;; Keywords: wp, convenience
 ;; Author: Takaaki Ota <Takaaki.Ota@am.sony.com>
 ;; Created: Sat Jul 08 2000 13:28:45 (PST)
-;; Revised: Tue May 30 2006 10:01:43 (PDT)
+;; Revised: Thu Jul 20 2006 17:30:09 (PDT)
 
 ;; This file is part of GNU Emacs.
 
@@ -1394,7 +1394,9 @@
      (setq table-command-remap-alist
 	   (cons (cons command func-symbol)
 		 table-command-remap-alist))))
- '(beginning-of-line
+ '(move-beginning-of-line
+   beginning-of-line
+   move-end-of-line
    end-of-line
    beginning-of-buffer
    end-of-buffer
--- a/lisp/tumme.el	Thu Aug 03 00:41:54 2006 +0000
+++ b/lisp/tumme.el	Thu Aug 03 11:45:23 2006 +0000
@@ -84,7 +84,7 @@
 ;; USAGE
 ;; =====
 ;;
-;; This information has been moved to the manual. Type `C-h r' to open
+;; This information has been moved to the manual.  Type `C-h r' to open
 ;; the Emacs manual and go to the node Thumbnails by typing `g
 ;; Thumbnails RET'.
 ;;
@@ -161,6 +161,10 @@
 
 (require 'dired)
 (require 'format-spec)
+(require 'widget)
+
+(eval-when-compile
+  (require 'wid-edit))
 
 (defgroup tumme nil
   "Use dired to browse your images as thumbnails, and more."
@@ -644,7 +648,7 @@
                                ;; Can't use (overlays-at (point)), BUG?
                                (overlays-in (point) (1+ (point)))))
        (put-image thumb-file image-pos)
-       (setq 
+       (setq
 	overlay
 	(car (delq nil (mapcar (lambda (o) (and (overlay-get o 'put-image) o))
 			       (overlays-in (point) (1+ (point)))))))
@@ -864,32 +868,27 @@
 ;;;###autoload
 (defalias 'tumme 'tumme-show-all-from-dir)
 
-(defun tumme-write-tag (files tag)
-  "For all FILES, writes TAG to the image database."
-  (save-excursion
-    (let (end buf)
-      (setq buf (find-file tumme-db-file))
-      (if (not (listp files))
-          (if (stringp files)
-              (setq files (list files))
-            (error "Files must be a string or a list of strings!")))
-      (mapcar
-       (lambda (file)
-         (goto-char (point-min))
-         (if (search-forward-regexp
-              (format "^%s" file) nil t)
-             (progn
-               (end-of-line)
-               (setq end (point))
-               (beginning-of-line)
-               (when (not (search-forward (format ";%s" tag) end t))
-                 (end-of-line)
-                 (insert (format ";%s" tag))))
-           (goto-char (point-max))
-           (insert (format "\n%s;%s" file tag))))
-       files)
-      (save-buffer)
-      (kill-buffer buf))))
+(defun tumme-write-tags (file-tags)
+  "Write file tags to database.
+Write each file and tag in FILE-TAGS to the database.  FILE-TAGS
+is an alist in the following form:
+ ((FILE . TAG) ... )"
+  (let (end file tag)
+    (with-temp-file tumme-db-file
+      (insert-file-contents tumme-db-file)
+      (dolist (elt file-tags)
+	(setq file (car elt)
+	      tag (cdr elt))
+	(goto-char (point-min))
+	(if (search-forward-regexp (format "^%s.*$" file) nil t)
+	    (progn
+	      (setq end (point))
+	      (beginning-of-line)
+	      (when (not (search-forward (format ";%s" tag) end t))
+		(end-of-line)
+		(insert (format ";%s" tag))))
+	  (goto-char (point-max))
+	  (insert (format "\n%s;%s" file tag)))))))
 
 (defun tumme-remove-tag (files tag)
   "For all FILES, remove TAG from the image database."
@@ -951,15 +950,19 @@
   (let ((tag (read-string "Tags to add (separate tags with a semicolon): "))
         curr-file files)
     (if arg
-        (setq files (dired-get-filename))
+        (setq files (list (dired-get-filename)))
       (setq files (dired-get-marked-files)))
-    (tumme-write-tag files tag)))
+    (tumme-write-tags
+     (mapcar
+      (lambda (x)
+        (cons x tag))
+      files))))
 
 (defun tumme-tag-thumbnail ()
   "Tag current thumbnail."
   (interactive)
   (let ((tag (read-string "Tags to add (separate tags with a semicolon): ")))
-    (tumme-write-tag (tumme-original-file-name) tag))
+    (tumme-write-tags (list (cons (tumme-original-file-name) tag))))
   (tumme-update-property
    'tags (tumme-list-tags (tumme-original-file-name))))
 
@@ -1006,7 +1009,7 @@
   (let ((old-buf (current-buffer))
         (dired-buf (tumme-associated-dired-buffer))
         (file-name (tumme-original-file-name)))
-    (when (and dired-buf file-name)
+    (when (and (buffer-live-p dired-buf) file-name)
       (setq file-name (file-name-nondirectory file-name))
       (set-buffer dired-buf)
       (goto-char (point-min))
@@ -1069,32 +1072,46 @@
   (if tumme-track-movement
       (tumme-track-thumbnail)))
 
-(defun tumme-forward-char ()
-  "Move to next image and display properties."
-  (interactive)
-  ;; Before we move, make sure that there is an image two positions
-  ;; forward.
-  (when (save-excursion
-        (forward-char 2)
-        (tumme-image-at-point-p))
-    (forward-char)
-    (while (and (not (eobp))
-                (not (tumme-image-at-point-p)))
-      (forward-char))
-    (if tumme-track-movement
-        (tumme-track-original-file)))
+(defun tumme-forward-image (&optional arg)
+  "Move to next image and display properties.
+Optional prefix ARG says how many images to move; default is one
+image."
+  (interactive "p")
+  (let (pos (steps (or arg 1)))
+    (dotimes (i steps)
+      (if (and (not (eobp))
+               (save-excursion
+                 (forward-char)
+                 (while (and (not (eobp))
+                             (not (tumme-image-at-point-p)))
+                   (forward-char))
+                 (setq pos (point))
+                 (tumme-image-at-point-p)))
+          (goto-char pos)
+        (error "At last image"))))
+  (when tumme-track-movement
+    (tumme-track-original-file))
   (tumme-display-thumb-properties))
 
-(defun tumme-backward-char ()
-  "Move to previous image and display properties."
-  (interactive)
-  (when (not (bobp))
-    (backward-char)
-    (while (and (not (bobp))
-                (not (tumme-image-at-point-p)))
-      (backward-char))
-    (if tumme-track-movement
-        (tumme-track-original-file)))
+(defun tumme-backward-image (&optional arg)
+  "Move to previous image and display properties.
+Optional prefix ARG says how many images to move; default is one
+image."
+  (interactive "p")
+  (let (pos (steps (or arg 1)))
+    (dotimes (i steps)
+      (if (and (not (bobp))
+               (save-excursion
+                 (backward-char)
+                 (while (and (not (bobp))
+                             (not (tumme-image-at-point-p)))
+                   (backward-char))
+                 (setq pos (point))
+                 (tumme-image-at-point-p)))
+          (goto-char pos)
+        (error "At first image"))))
+  (when tumme-track-movement
+    (tumme-track-original-file))
   (tumme-display-thumb-properties))
 
 (defun tumme-next-line ()
@@ -1103,7 +1120,7 @@
   (next-line 1)
   ;; If we end up in an empty spot, back up to the next thumbnail.
   (if (not (tumme-image-at-point-p))
-      (tumme-backward-char))
+      (tumme-backward-image))
   (if tumme-track-movement
       (tumme-track-original-file))
   (tumme-display-thumb-properties))
@@ -1118,7 +1135,7 @@
   ;; thumbnail and did not refresh, so it is not very common. But we
   ;; can handle it in a good manner, so why not?
   (if (not (tumme-image-at-point-p))
-      (tumme-backward-char))
+      (tumme-backward-image))
   (if tumme-track-movement
       (tumme-track-original-file))
   (tumme-display-thumb-properties))
@@ -1131,7 +1148,7 @@
   (format-spec
    tumme-display-properties-format
    (list
-    (cons ?b buf)
+    (cons ?b (or buf ""))
     (cons ?f file)
     (cons ?t (or (princ props) ""))
     (cons ?c (or comment "")))))
@@ -1187,19 +1204,19 @@
   "Mark original image file in associated dired buffer."
   (interactive)
   (tumme-modify-mark-on-thumb-original-file 'mark)
-  (tumme-forward-char))
+  (tumme-forward-image))
 
 (defun tumme-unmark-thumb-original-file ()
   "Unmark original image file in associated dired buffer."
   (interactive)
   (tumme-modify-mark-on-thumb-original-file 'unmark)
-  (tumme-forward-char))
+  (tumme-forward-image))
 
 (defun tumme-flag-thumb-original-file ()
   "Flag original image file for deletion in associated dired buffer."
   (interactive)
   (tumme-modify-mark-on-thumb-original-file 'flag)
-  (tumme-forward-char))
+  (tumme-forward-image))
 
 (defun tumme-toggle-mark-thumb-original-file ()
   "Toggle mark on original image file in associated dired buffer."
@@ -1247,12 +1264,12 @@
   "Define keymap for `tumme-thumbnail-mode'."
 
   ;; Keys
-  (define-key tumme-thumbnail-mode-map [right] 'tumme-forward-char)
-  (define-key tumme-thumbnail-mode-map [left] 'tumme-backward-char)
+  (define-key tumme-thumbnail-mode-map [right] 'tumme-forward-image)
+  (define-key tumme-thumbnail-mode-map [left] 'tumme-backward-image)
   (define-key tumme-thumbnail-mode-map [up] 'tumme-previous-line)
   (define-key tumme-thumbnail-mode-map [down] 'tumme-next-line)
-  (define-key tumme-thumbnail-mode-map "\C-f" 'tumme-forward-char)
-  (define-key tumme-thumbnail-mode-map "\C-b" 'tumme-backward-char)
+  (define-key tumme-thumbnail-mode-map "\C-f" 'tumme-forward-image)
+  (define-key tumme-thumbnail-mode-map "\C-b" 'tumme-backward-image)
   (define-key tumme-thumbnail-mode-map "\C-p" 'tumme-previous-line)
   (define-key tumme-thumbnail-mode-map "\C-n" 'tumme-next-line)
 
@@ -1655,7 +1672,8 @@
             (insert "\n")
           (insert " ")
           (setq count (1+ count))
-          (when (= count (- tumme-thumbs-per-row 1))
+          (when (and (= count (- tumme-thumbs-per-row 1))
+		     (not (eobp)))
             (forward-char)
             (insert "\n")
             (setq count 0)))))
@@ -1798,8 +1816,10 @@
           (message "No thumbnail at point")
         (if (not file)
             (message "No original file name found")
-          (tumme-display-image file arg)
-          (display-buffer tumme-display-image-buffer))))))
+	  (tumme-create-display-image-buffer)
+          (display-buffer tumme-display-image-buffer)
+          (tumme-display-image file arg))))))
+
 
 ;;;###autoload
 (defun tumme-dired-display-image (&optional arg)
@@ -1807,8 +1827,9 @@
 See documentation for `tumme-display-image' for more information.
 With prefix argument ARG, display image in its original size."
   (interactive "P")
-  (tumme-display-image (dired-get-filename) arg)
-  (display-buffer tumme-display-image-buffer))
+  (tumme-create-display-image-buffer)
+  (display-buffer tumme-display-image-buffer)
+  (tumme-display-image (dired-get-filename) arg))
 
 (defun tumme-image-at-point-p ()
   "Return true if there is a tumme thumbnail at point."
@@ -2000,49 +2021,49 @@
 (defun tumme-display-next-thumbnail-original ()
   "In thubnail buffer, move to next thumbnail and display the image."
   (interactive)
-  (tumme-forward-char)
+  (tumme-forward-image)
   (tumme-display-thumbnail-original-image))
 
 (defun tumme-display-previous-thumbnail-original ()
   "Move to previous thumbnail and display image."
-
   (interactive)
-  (tumme-backward-char)
+  (tumme-backward-image)
   (tumme-display-thumbnail-original-image))
 
-(defun tumme-write-comment (file comment)
-  "For FILE, write comment COMMENT in database."
-  (save-excursion
-    (let (end buf comment-beg)
-      (setq buf (find-file tumme-db-file))
-      (goto-char (point-min))
-      (if (search-forward-regexp
-           (format "^%s" file) nil t)
-          (progn
-            (end-of-line)
-            (setq end (point))
-            (beginning-of-line)
-            ;; Delete old comment, if any
-            (cond ((search-forward ";comment:" end t)
-                   (setq comment-beg (match-beginning 0))
-                   ;; Any tags after the comment?
-                   (if (search-forward ";" end t)
-                       (setq comment-end (- (point) 1))
-                     (setq comment-end end))
-                   ;; Delete comment tag and comment
-                   (delete-region comment-beg comment-end)))
-            ;; Insert new comment
-            (beginning-of-line)
-            (if (not (search-forward ";" end t))
-                (progn
-                  (end-of-line)
-                  (insert ";")))
-            (insert (format "comment:%s;" comment)))
-        ;; File does not exist in databse - add it.
-        (goto-char (point-max))
-        (insert (format "\n%s;comment:%s" file comment)))
-      (save-buffer)
-      (kill-buffer buf))))
+(defun tumme-write-comments (file-comments)
+  "Write file comments to database.
+Write file comments to one or more files.  FILE-COMMENTS is an alist on
+the following form:
+ ((FILE . COMMENT) ... )"
+  (let (end comment-beg-pos comment-end-pos file comment)
+    (with-temp-file tumme-db-file
+      (insert-file-contents tumme-db-file)
+      (dolist (elt file-comments)
+	(setq file (car elt)
+	      comment (cdr elt))
+	(goto-char (point-min))
+	(if (search-forward-regexp (format "^%s.*$" file) nil t)
+	    (progn
+	      (setq end (point))
+	      (beginning-of-line)
+	      ;; Delete old comment, if any
+	      (when (search-forward ";comment:" end t)
+		(setq comment-beg-pos (match-beginning 0))
+		;; Any tags after the comment?
+		(if (search-forward ";" end t)
+		    (setq comment-end-pos (- (point) 1))
+		  (setq comment-end-pos end))
+		;; Delete comment tag and comment
+		(delete-region comment-beg-pos comment-end-pos))
+	      ;; Insert new comment
+	      (beginning-of-line)
+	      (unless (search-forward ";" end t)
+		(end-of-line)
+		(insert ";"))
+	      (insert (format "comment:%s;" comment)))
+	  ;; File does not exist in database - add it.
+	  (goto-char (point-max))
+	  (insert (format "\n%s;comment:%s" file comment)))))))
 
 (defun tumme-update-property (prop value)
   "Update text property PROP with value VALUE at point."
@@ -2056,19 +2077,19 @@
 (defun tumme-dired-comment-files ()
   "Add comment to current or marked files in dired."
   (interactive)
-  (let ((files (dired-get-marked-files))
-         (comment (tumme-read-comment)))
-    (mapcar
-     (lambda (curr-file)
-       (tumme-write-comment curr-file comment))
-     files)))
+  (let ((comment (tumme-read-comment)))
+    (tumme-write-comments
+     (mapcar
+      (lambda (curr-file)
+        (cons curr-file comment))
+      (dired-get-marked-files)))))
 
 (defun tumme-comment-thumbnail ()
   "Add comment to current thumbnail in thumbnail buffer."
   (interactive)
   (let* ((file (tumme-original-file-name))
          (comment (tumme-read-comment file)))
-    (tumme-write-comment file comment)
+    (tumme-write-comments (list (cons file comment)))
     (tumme-update-property 'comment comment))
   (tumme-display-thumb-properties))
 
@@ -2085,7 +2106,7 @@
 (defun tumme-get-comment (file)
   "Get comment for file FILE."
   (save-excursion
-    (let (end buf comment-beg comment)
+    (let (end buf comment-beg-pos comment-end-pos comment)
       (setq buf (find-file tumme-db-file))
       (goto-char (point-min))
       (when (search-forward-regexp
@@ -2094,12 +2115,12 @@
         (setq end (point))
         (beginning-of-line)
         (cond ((search-forward ";comment:" end t)
-               (setq comment-beg (point))
+               (setq comment-beg-pos (point))
                (if (search-forward ";" end t)
-                   (setq comment-end (- (point) 1))
-                 (setq comment-end end))
+                   (setq comment-end-pos (- (point) 1))
+                 (setq comment-end-pos end))
                (setq comment (buffer-substring
-                              comment-beg comment-end)))))
+                              comment-beg-pos comment-end-pos)))))
       (kill-buffer buf)
       comment)))
 
@@ -2153,6 +2174,8 @@
     (setq file (tumme-original-file-name))
     (if tumme-track-movement
         (tumme-track-original-file))
+    (tumme-create-display-image-buffer)
+    (display-buffer tumme-display-image-buffer)
     (tumme-display-image file)))
 
 (defun tumme-mouse-select-thumbnail (event)
@@ -2421,6 +2444,107 @@
       (error nil))
     (kill-buffer buffer)))
 
+(defvar tumme-widget-list nil
+  "List to keep track of meta data in edit buffer.")
+
+;;;###autoload
+(defun tumme-dired-edit-comment-and-tags ()
+  "Edit comment and tags of current or marked image files.
+Edit comment and tags for all marked image files in an
+easy-to-use form."
+  (interactive)
+  (setq tumme-widget-list nil)
+  ;; Setup buffer.
+  (let ((files (dired-get-marked-files)))
+    (switch-to-buffer "*Tumme Edit Meta Data*")
+    (kill-all-local-variables)
+    (make-local-variable 'widget-example-repeat)
+    (let ((inhibit-read-only t))
+      (erase-buffer))
+    (remove-overlays)
+    ;; Some help for the user.
+    (widget-insert
+"\nEdit comments and tags for each image.  Separate multiple tags
+with a comma.  Move forward between fields using TAB or RET.
+Move to the previous field using backtab (S-TAB).  Save by
+activating the Save button at the bottom of the form or cancel
+the operation by activating the Cancel button.\n\n")
+    ;; Here comes all images and a comment and tag field for each
+    ;; image.
+    (let (thumb-file img comment-widget tag-widget)
+
+      (dolist (file files)
+
+       (setq thumb-file (tumme-thumb-name file)
+             img (create-image thumb-file))
+
+       (insert-image img)
+       (widget-insert "\n\nComment: ")
+       (setq comment-widget
+             (widget-create 'editable-field
+                            :size 60
+                            :format "%v "
+                            :value (or (tumme-get-comment file) "")))
+       (widget-insert "\nTags:    ")
+       (setq tag-widget
+             (widget-create 'editable-field
+                            :size 60
+                            :format "%v "
+                            :value (or (mapconcat
+                                        (lambda (tag)
+                                          tag)
+                                        (tumme-list-tags file)
+                                        ",") "")))
+       ;; Save information in all widgets so that we can use it when
+       ;; the user saves the form.
+       (setq tumme-widget-list
+             (append tumme-widget-list
+                     (list (list file comment-widget tag-widget))))
+       (widget-insert "\n\n")))
+
+    ;; Footer with Save and Cancel button.
+    (widget-insert "\n")
+    (widget-create 'push-button
+                 :notify
+                 (lambda (&rest ignore)
+                   (tumme-save-information-from-widgets)
+                   (bury-buffer)
+                   (message "Done."))
+                 "Save")
+    (widget-insert " ")
+    (widget-create 'push-button
+                   :notify
+                   (lambda (&rest ignore)
+                     (bury-buffer)
+                     (message "Operation canceled."))
+                   "Cancel")
+    (widget-insert "\n")
+    (use-local-map widget-keymap)
+    (widget-setup)
+    ;; Jump to the first widget.
+    (widget-forward 1)))
+
+(defun tumme-save-information-from-widgets ()
+  "Save information found in `tumme-widget-list'.
+Use the information in `tumme-widget-list' to save comments and
+tags to their respective image file.  Internal function used by
+`tumme-dired-edit-comment-and-tags'."
+  (let (file comment tag-string tag-list lst)
+    (tumme-write-comments
+          (mapcar
+           (lambda (widget)
+             (setq file (car widget)
+                   comment (widget-value (cadr widget)))
+             (cons file comment))
+           tumme-widget-list))
+    (tumme-write-tags
+     (dolist (widget tumme-widget-list lst)
+       (setq file (car widget)
+             tag-string (widget-value (car (cddr widget)))
+             tag-list (split-string tag-string ","))
+       (dolist (tag tag-list)
+         (push (cons file tag) lst))))))
+
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;;;;;;;; TEST-SECTION ;;;;;;;;;;;
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
--- a/lisp/url/ChangeLog	Thu Aug 03 00:41:54 2006 +0000
+++ b/lisp/url/ChangeLog	Thu Aug 03 11:45:23 2006 +0000
@@ -1,3 +1,15 @@
+2006-07-31  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* url-util.el (url-hexify-string): Only utf-8 encode if it's
+	a multibyte string.
+	(url-normalize-url): Remove unused var `grok'.
+	(url-truncate-url-for-viewing): Remove unused var `tail'.
+
+2006-07-30  Thien-Thi Nguyen  <ttn@gnu.org>
+
+	* url-util.el (url-hexify-string): Rewrite.
+	Suggested by David Smith <davidsmith@acm.org>.
+
 2006-07-12  Michael Olson  <mwolson@gnu.org>
 
 	* url-irc.el (url-irc-erc): Call erc-handle-irc-url.
--- a/lisp/url/url-util.el	Thu Aug 03 00:41:54 2006 +0000
+++ b/lisp/url/url-util.el	Thu Aug 03 11:45:23 2006 +0000
@@ -163,7 +163,7 @@
 (defun url-normalize-url (url)
   "Return a 'normalized' version of URL.
 Strips out default port numbers, etc."
-  (let (type data grok retval)
+  (let (type data retval)
     (setq data (url-generic-parse-url url)
 	  type (url-type data))
     (if (member type '("www" "about" "mailto" "info"))
@@ -352,17 +352,31 @@
 This is taken from RFC 2396.")
 
 ;;;###autoload
-(defun url-hexify-string (str)
-  "Escape characters in a string."
-  (mapconcat
-   (lambda (char)
-     ;; Fixme: use a char table instead.
-     (if (not (memq char url-unreserved-chars))
-	 (if (> char 255)
-	       (error "Hexifying multibyte character %s" str)
-	   (format "%%%02X" char))
-       (char-to-string char)))
-   str ""))
+(defun url-hexify-string (string)
+  "Return a new string that is STRING URI-encoded.
+First, STRING is converted to utf-8, if necessary.  Then, for each
+character in the utf-8 string, those found in `url-unreserved-chars'
+are left as-is, all others are represented as a three-character
+string: \"%\" followed by two lowercase hex digits."
+  ;; To go faster and avoid a lot of consing, we could do:
+  ;; 
+  ;; (defconst url-hexify-table
+  ;;   (let ((map (make-vector 256 nil)))
+  ;;     (dotimes (byte 256) (aset map byte
+  ;;                               (if (memq byte url-unreserved-chars)
+  ;;                                   (char-to-string byte)
+  ;;                                 (format "%%%02x" byte))))
+  ;;     map))
+  ;;
+  ;; (mapconcat (curry 'aref url-hexify-table) ...)
+  (mapconcat (lambda (byte)
+               (if (memq byte url-unreserved-chars)
+                   (char-to-string byte)
+                 (format "%%%02x" byte)))
+             (if (multibyte-string-p string)
+                 (encode-coding-string string 'utf-8)
+               string)
+             ""))
 
 ;;;###autoload
 (defun url-file-extension (fname &optional x)
@@ -389,7 +403,6 @@
 WIDTH defaults to the current frame width."
   (let* ((fr-width (or width (frame-width)))
 	 (str-width (length url))
-	 (tail (file-name-nondirectory url))
 	 (fname nil)
 	 (modified 0)
 	 (urlobj nil))
@@ -397,8 +410,7 @@
     (if (and (>= str-width fr-width)
 	     (string-match "?" url))
 	(setq url (concat (substring url 0 (match-beginning 0)) "?...")
-	      str-width (length url)
-	      tail (file-name-nondirectory url)))
+	      str-width (length url)))
     (if (< str-width fr-width)
 	nil				; Hey, we are done!
       (setq urlobj (url-generic-parse-url url)
--- a/lisp/wdired.el	Thu Aug 03 00:41:54 2006 +0000
+++ b/lisp/wdired.el	Thu Aug 03 11:45:23 2006 +0000
@@ -238,6 +238,8 @@
 
 See `wdired-mode'."
   (interactive)
+  (or (eq major-mode 'dired-mode)
+      (error "Not a Dired buffer"))
   (set (make-local-variable 'wdired-old-content)
        (buffer-substring (point-min) (point-max)))
   (set (make-local-variable 'wdired-old-point) (point))
@@ -328,6 +330,8 @@
 
 (defun wdired-change-to-dired-mode ()
   "Change the mode back to dired."
+  (or (eq major-mode 'wdired-mode)
+      (error "Not a Wdired buffer"))
   (let ((inhibit-read-only t))
     (remove-text-properties (point-min) (point-max)
 			    '(read-only nil local-map nil)))
--- a/lisp/window.el	Thu Aug 03 00:41:54 2006 +0000
+++ b/lisp/window.el	Thu Aug 03 11:45:23 2006 +0000
@@ -246,9 +246,10 @@
                 (windowp window-or-frame))
       (error "Not a frame or window: %s" window-or-frame)))
   (let ((subtree (bw-find-tree-sub window-or-frame)))
-    (if (integerp subtree)
-        nil
-      (bw-get-tree-1 subtree))))
+    (when subtree
+      (if (integerp subtree)
+	  nil
+	(bw-get-tree-1 subtree)))))
 
 (defun bw-get-tree-1 (split)
   (if (windowp split)
--- a/lisp/xml.el	Thu Aug 03 00:41:54 2006 +0000
+++ b/lisp/xml.el	Thu Aug 03 11:45:23 2006 +0000
@@ -165,22 +165,19 @@
 Returns the top node with all its children.
 If PARSE-DTD is non-nil, the DTD is parsed rather than skipped.
 If PARSE-NS is non-nil, then QNAMES are expanded."
-  (let ((keep))
-    (if (get-file-buffer file)
-	(progn
-	  (set-buffer (get-file-buffer file))
-	  (setq keep (point)))
-      (let (auto-mode-alist)		; no need for xml-mode
-	(find-file file)))
-
-    (let ((xml (xml-parse-region (point-min)
-				 (point-max)
-				 (current-buffer)
-				 parse-dtd parse-ns)))
-      (if keep
-	  (goto-char keep)
-	(kill-buffer (current-buffer)))
-      xml)))
+  (if (get-file-buffer file)
+      (with-current-buffer (get-file-buffer file)
+	(save-excursion
+	  (xml-parse-region (point-min)
+			    (point-max)
+			    (current-buffer)
+			    parse-dtd parse-ns)))
+    (with-temp-buffer
+      (insert-file-contents file)
+      (xml-parse-region (point-min)
+			(point-max)
+			(current-buffer)
+			parse-dtd parse-ns))))
 
 
 (defvar xml-name-re)
--- a/lispref/ChangeLog	Thu Aug 03 00:41:54 2006 +0000
+++ b/lispref/ChangeLog	Thu Aug 03 11:45:23 2006 +0000
@@ -1,3 +1,99 @@
+2006-07-31  Thien-Thi Nguyen  <ttn@gnu.org>
+
+	* text.texi (Clickable Text): Mention `help-echo' text property.
+	Update intro, examples and associated explanations.
+
+2006-07-31  Richard Stallman  <rms@gnu.org>
+
+	* commands.texi: Update xrefs.
+	(Event Mod): New node, cut out from old Translating Input.
+
+	* maps.texi: Update xrefs.
+
+	* keymaps.texi (Translation Keymaps): New node.
+	Update xrefs from Translating Input to Translation Keymaps.
+
+	* elisp.texi (Top): Update subnode menu.
+
+	* display.texi (Face Functions): Fix explanations of FRAME=t or nil.
+
+	* os.texi (System Interface): Fix menu descriptions of some nodes.
+	(Translating Input): Node deleted.
+
+2006-07-31  Nick Roberts  <nickrob@snap.net.nz>
+
+	* modes.texi (Minor Mode Conventions): Update link for add-to-list.
+
+	* lists.texi (Sets And Lists): Likewise.
+
+2006-07-30  Thien-Thi Nguyen  <ttn@gnu.org>
+
+	* text.texi (Fields): Mention POS
+	requirement when narrowing is in effect.
+
+2006-07-28  Richard Stallman  <rms@gnu.org>
+
+	* display.texi (Face Attributes): Simplify wording.
+	(Attribute Functions): Clarify meaning of new-frame default
+	attribute settings.
+
+	* customize.texi (Common Keywords): Document how to use
+	:package-version in a package not in Emacs.
+
+2006-07-28  Kim F. Storm  <storm@cua.dk>
+
+	* commands.texi (Reading One Event): Fix last change.
+
+2006-07-26  Chong Yidong  <cyd@stupidchicken.com>
+
+	* commands.texi (Reading One Event): Document SECONDS argument for
+	read-event, read-char, and read-char-exclusive.
+
+2006-07-25  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* modes.texi (Multiline Font Lock): Can't use jit-lock-defer-multiline
+	to ensure correct identification.
+
+2006-07-24  Richard Stallman  <rms@gnu.org>
+
+	* text.texi (Clickable Text): Clarify.
+
+	* sequences.texi (Vector Functions): Delete duplicate xref.
+
+	* objects.texi (Function Type): Clarify.
+
+	* modes.texi (Keymaps and Minor Modes): List punct chars for minor
+	modes.
+
+	* lists.texi (List Variables): New node.
+	Material moved from other nodes.
+
+	* variables.texi (Setting Variables): add-to-list and
+	add-to-ordered-list moved to List Variables node.
+
+2006-07-23  Thien-Thi Nguyen  <ttn@gnu.org>
+
+	* text.texi (Links and Mouse-1):
+	For mouse-on-link-p, expand on arg POS.
+
+2006-07-21  Kim F. Storm  <storm@cua.dk>
+
+	* display.texi (Forcing Redisplay): Don't mention systems which
+	don't support sub-second timers for redisplay-preemption-period.
+
+	* os.texi (Terminal Output): Clarify text vs graphical terminal.
+
+2006-07-21  Eli Zaretskii  <eliz@gnu.org>
+
+	* frames.texi (Input Focus): Document that focus-follows-mouse has
+	no effect on MS-Windows.
+
+2006-07-18  Richard Stallman  <rms@gnu.org>
+
+	* display.texi (Forcing Redisplay): Cleanups in previous change.
+
+	* processes.texi (Low-Level Network): Make menu more convenient.
+
 2006-07-18  Kim F. Storm  <storm@cua.dk>
 
 	* display.texi (Forcing Redisplay): redisplay-preemption-period
--- a/lispref/commands.texi	Thu Aug 03 00:41:54 2006 +0000
+++ b/lispref/commands.texi	Thu Aug 03 11:45:23 2006 +0000
@@ -1087,7 +1087,7 @@
 latter as the symbol @code{tab}.
 
 Most of the time, it's not useful to distinguish the two.  So normally
-@code{function-key-map} (@pxref{Translating Input}) is set up to map
+@code{function-key-map} (@pxref{Translation Keymaps}) is set up to map
 @code{tab} into 9.  Thus, a key binding for character code 9 (the
 character @kbd{C-i}) also applies to @code{tab}.  Likewise for the other
 symbols in this group.  The function @code{read-char} likewise converts
@@ -2051,14 +2051,14 @@
 See also @code{momentary-string-display} in @ref{Temporary Displays},
 and @code{sit-for} in @ref{Waiting}.  @xref{Terminal Input}, for
 functions and variables for controlling terminal input modes and
-debugging terminal input.  @xref{Translating Input}, for features you
-can use for translating or modifying input events while reading them.
+debugging terminal input.
 
   For higher-level input facilities, see @ref{Minibuffers}.
 
 @menu
 * Key Sequence Input::		How to read one key sequence.
 * Reading One Event::		How to read just one event.
+* Event Mod::                   How Emacs modifies events as they are read.
 * Invoking the Input Method::   How reading an event uses the input method.
 * Quoted Character Input::	Asking the user to specify a character.
 * Event Input Misc::    	How to reread or throw away input events.
@@ -2088,7 +2088,7 @@
 vector are the events in the key sequence.
 
 Reading a key sequence includes translating the events in various
-ways.  @xref{Translating Input}.
+ways.  @xref{Translation Keymaps}.
 
 The argument @var{prompt} is either a string to be displayed in the
 echo area as a prompt, or @code{nil}, meaning not to display a prompt.
@@ -2199,7 +2199,7 @@
 
 None of the three functions below suppresses quitting.
 
-@defun read-event &optional prompt inherit-input-method
+@defun read-event &optional prompt inherit-input-method seconds
 This function reads and returns the next event of command input, waiting
 if necessary until an event is available.  Events can come directly from
 the user or from a keyboard macro.
@@ -2220,6 +2220,15 @@
 moves the cursor temporarily to the echo area, to the end of any message
 displayed there.  Otherwise @code{read-event} does not move the cursor.
 
+If @var{seconds} is non-@code{nil}, it should be a number specifying
+the maximum time to wait for input, in seconds.  If no input arrives
+within that time, @code{read-event} stops waiting and returns
+@code{nil}.  A floating-point value for @var{seconds} means to wait
+for a fractional number of seconds.  Some systems support only a whole
+number of seconds; on these systems, @var{seconds} is rounded down.
+If @var{seconds} is @code{nil}, @code{read-event} waits as long as
+necessary for input to arrive.
+
 If @code{read-event} gets an event that is defined as a help character,
 then in some cases @code{read-event} processes the event directly without
 returning.  @xref{Help Functions}.  Certain other events, called
@@ -2237,7 +2246,7 @@
 @end example
 @end defun
 
-@defun read-char &optional prompt inherit-input-method
+@defun read-char &optional prompt inherit-input-method seconds
 This function reads and returns a character of command input.  If the
 user generates an event which is not a character (i.e. a mouse click or
 function key event), @code{read-char} signals an error.  The arguments
@@ -2269,7 +2278,7 @@
 @end example
 @end defun
 
-@defun read-char-exclusive &optional prompt inherit-input-method
+@defun read-char-exclusive &optional prompt inherit-input-method seconds
 This function reads and returns a character of command input.  If the
 user generates an event which is not a character,
 @code{read-char-exclusive} ignores it and reads another event, until it
@@ -2281,6 +2290,87 @@
 from the terminal---not counting those generated by keyboard macros.
 @end defvar
 
+@node Event Mod
+@subsection Modifying and Translating Input Events
+
+  Emacs modifies every event it reads according to
+@code{extra-keyboard-modifiers}, then translates it through
+@code{keyboard-translate-table} (if applicable), before returning it
+from @code{read-event}.
+
+@c Emacs 19 feature
+@defvar extra-keyboard-modifiers
+This variable lets Lisp programs ``press'' the modifier keys on the
+keyboard.  The value is a character.  Only the modifiers of the
+character matter.  Each time the user types a keyboard key, it is
+altered as if those modifier keys were held down.  For instance, if
+you bind @code{extra-keyboard-modifiers} to @code{?\C-\M-a}, then all
+keyboard input characters typed during the scope of the binding will
+have the control and meta modifiers applied to them.  The character
+@code{?\C-@@}, equivalent to the integer 0, does not count as a control
+character for this purpose, but as a character with no modifiers.
+Thus, setting @code{extra-keyboard-modifiers} to zero cancels any
+modification.
+
+When using a window system, the program can ``press'' any of the
+modifier keys in this way.  Otherwise, only the @key{CTL} and @key{META}
+keys can be virtually pressed.
+
+Note that this variable applies only to events that really come from
+the keyboard, and has no effect on mouse events or any other events.
+@end defvar
+
+@defvar keyboard-translate-table
+This variable is the translate table for keyboard characters.  It lets
+you reshuffle the keys on the keyboard without changing any command
+bindings.  Its value is normally a char-table, or else @code{nil}.
+(It can also be a string or vector, but this is considered obsolete.)
+
+If @code{keyboard-translate-table} is a char-table
+(@pxref{Char-Tables}), then each character read from the keyboard is
+looked up in this char-table.  If the value found there is
+non-@code{nil}, then it is used instead of the actual input character.
+
+Note that this translation is the first thing that happens to a
+character after it is read from the terminal.  Record-keeping features
+such as @code{recent-keys} and dribble files record the characters after
+translation.
+
+Note also that this translation is done before the characters are
+supplied to input methods (@pxref{Input Methods}).  Use
+@code{translation-table-for-input} (@pxref{Translation of Characters}),
+if you want to translate characters after input methods operate.
+@end defvar
+
+@defun keyboard-translate from to
+This function modifies @code{keyboard-translate-table} to translate
+character code @var{from} into character code @var{to}.  It creates
+the keyboard translate table if necessary.
+@end defun
+
+  Here's an example of using the @code{keyboard-translate-table} to
+make @kbd{C-x}, @kbd{C-c} and @kbd{C-v} perform the cut, copy and paste
+operations:
+
+@example
+(keyboard-translate ?\C-x 'control-x)
+(keyboard-translate ?\C-c 'control-c)
+(keyboard-translate ?\C-v 'control-v)
+(global-set-key [control-x] 'kill-region)
+(global-set-key [control-c] 'kill-ring-save)
+(global-set-key [control-v] 'yank)
+@end example
+
+@noindent
+On a graphical terminal that supports extended @acronym{ASCII} input,
+you can still get the standard Emacs meanings of one of those
+characters by typing it with the shift key.  That makes it a different
+character as far as keyboard translation is concerned, but it has the
+same usual meaning.
+
+  @xref{Translation Keymaps}, for mechanisms that translate event sequences
+at the level of @code{read-key-sequence}.
+
 @node Invoking the Input Method
 @subsection Invoking the Input Method
 
--- a/lispref/customize.texi	Thu Aug 03 00:41:54 2006 +0000
+++ b/lispref/customize.texi	Thu Aug 03 11:45:23 2006 +0000
@@ -133,18 +133,21 @@
 
 @item :package-version '(@var{package} . @var{version})
 This option specifies that the item was first introduced in
-@var{package} version @var{version}, or that its default value was
-changed in that version.  This keyword takes priority over :version.
-The value of @var{package} is a symbol and @var{version} is a string.
-The @var{package} and @var{version} must appear in the alist
-@code{customize-package-emacs-version-alist}.  Since @var{package} must
-be unique and the user might see it in an error message, a good choice
-is the official name of the package, such as MH-E or Gnus.
+@var{package} version @var{version}, or that its meaning or default
+value was changed in that version.  The value of @var{package} is a
+symbol and @var{version} is a string.
 
+This keyword takes priority over @code{:version}.
+
+@var{package} should be the official name of the package, such as MH-E
+or Gnus.  If the package @var{package} is released as part of Emacs,
+@var{package} and @var{version} should appear in the value of
+@code{customize-package-emacs-version-alist}.
 @end table
 
-Packages that use the @code{:package-version} keyword must also update
-the @code{customize-package-emacs-version-alist} variable.
+Packages distributed as part of Emacs that use the
+@code{:package-version} keyword must also update the
+@code{customize-package-emacs-version-alist} variable.
 
 @defvar customize-package-emacs-version-alist
 This alist provides a mapping for the versions of Emacs that are
--- a/lispref/display.texi	Thu Aug 03 00:41:54 2006 +0000
+++ b/lispref/display.texi	Thu Aug 03 11:45:23 2006 +0000
@@ -103,9 +103,8 @@
 If this variable is @code{nil}, Emacs does not check for input during
 redisplay, and redisplay cannot be preempted by input.
 
-@emph{Note} that this variable is only used on window systems,
-and is only available if Emacs is built with support for sub-second timers.
-For other platforms; @xref{Terminal Output}.
+This variable is only obeyed on graphical terminals.  For
+text terminals, see @ref{Terminal Output}.
 @end defvar
 
 @defvar redisplay-dont-pause
@@ -1858,9 +1857,9 @@
 
   The effect of using a face is determined by a fixed set of @dfn{face
 attributes}.  This table lists all the face attributes, and what they
-mean.  Note that in general, more than one face can be specified for a
-given piece of text; when that happens, the attributes of all the faces
-are merged to specify how to display the text.  @xref{Displaying Faces}.
+mean.  You can specify more than one face for a given piece of text;
+Emacs merges the attributes of all the faces to determine how to
+display the text.  @xref{Displaying Faces}.
 
   Any attribute in a face can have the value @code{unspecified}.  This
 means the face doesn't specify that attribute.  In face merging, when
@@ -2049,15 +2048,13 @@
 @node Attribute Functions
 @subsection Face Attribute Functions
 
-  You can modify the attributes of an existing face with the following
-functions.  If you specify @var{frame}, they affect just that frame;
-otherwise, they affect all frames as well as the defaults that apply to
-new frames.
+  This section describes the functions for accessing and modifying the
+attributes of an existing face.
 
 @defun set-face-attribute face frame &rest arguments
-This function sets one or more attributes of face @var{face}
-for frame @var{frame}.  If @var{frame} is @code{nil}, it sets
-the attribute for all frames, and the defaults for new frames.
+This function sets one or more attributes of face @var{face} for frame
+@var{frame}.  The attributes you specify this way override whatever
+the @code{defface} says.
 
 The extra arguments @var{arguments} specify the attributes to set, and
 the values for them.  They should consist of alternating attribute names
@@ -2074,6 +2071,13 @@
 @noindent
 sets the attributes @code{:width}, @code{:weight} and @code{:underline}
 to the corresponding values.
+
+If @var{frame} is @code{t}, this function sets the default attributes
+for new frames.  Default attribute values specified this way override
+the @code{defface} for newly created frames.
+
+If @var{frame} is @code{nil}, this function sets the attributes for
+all existing frames, and the default for new frames.
 @end defun
 
 @defun face-attribute face attribute &optional frame inherit
@@ -2081,8 +2085,10 @@
 @var{face} on @var{frame}.  If @var{frame} is @code{nil},
 that means the selected frame (@pxref{Input Focus}).
 
-If @var{frame} is @code{t}, the value is the default for
-@var{face} for new frames.
+If @var{frame} is @code{t}, this returns whatever new-frames default
+value you previously specified with @code{set-face-attribute} for the
+@var{attribute} attribute of @var{face}.  If you have not specified
+one, it returns @code{nil}.
 
 If @var{inherit} is @code{nil}, only attributes directly defined by
 @var{face} are considered, so the return value may be
@@ -2136,6 +2142,8 @@
   The functions above did not exist before Emacs 21.  For compatibility
 with older Emacs versions, you can use the following functions to set
 and examine the face attributes which existed in those versions.
+They use values of @code{t} and @code{nil} for @var{frame}
+just like @code{set-face-attribute} and @code{face-attribute}.
 
 @defun set-face-foreground face color &optional frame
 @defunx set-face-background face color &optional frame
@@ -2192,9 +2200,10 @@
 @end defun
 
   These functions examine the attributes of a face.  If you don't
-specify @var{frame}, they refer to the default data for new frames.
-They return the symbol @code{unspecified} if the face doesn't define any
-value for that attribute.
+specify @var{frame}, they refer to the selected frame; @code{t} refers
+to the default data for new frames.  They return the symbol
+@code{unspecified} if the face doesn't define any value for that
+attribute.
 
 @defun face-foreground face &optional frame inherit
 @defunx face-background face &optional frame inherit
--- a/lispref/elisp.texi	Thu Aug 03 00:41:54 2006 +0000
+++ b/lispref/elisp.texi	Thu Aug 03 11:45:23 2006 +0000
@@ -1039,8 +1039,8 @@
 * Processor Run Time::      Getting the run time used by Emacs.
 * Time Calculations::       Adding, subtracting, comparing times, etc.
 * Timers::		    Setting a timer to call a function at a certain time.
-* Terminal Input::          Recording terminal input for debugging.
-* Terminal Output::         Recording terminal output for debugging.
+* Terminal Input::          Accessing and recordingo terminal input.
+* Terminal Output::         Controlling and recording terminal output.
 * Sound Output::            Playing sounds on the computer's speaker.
 * X11 Keysyms::             Operating on key symbols for X Windows
 * Batch Mode::              Running Emacs without terminal interaction.
--- a/lispref/frames.texi	Thu Aug 03 00:41:54 2006 +0000
+++ b/lispref/frames.texi	Thu Aug 03 11:45:23 2006 +0000
@@ -1189,7 +1189,9 @@
 This option is how you inform Emacs whether the window manager transfers
 focus when the user moves the mouse.  Non-@code{nil} says that it does.
 When this is so, the command @code{other-frame} moves the mouse to a
-position consistent with the new selected frame.
+position consistent with the new selected frame.  (This option has no
+effect on MS-Windows, where the mouse pointer is always automatically
+moved by the OS to the selected frame.)
 @end defopt
 
 @node Visibility of Frames
--- a/lispref/keymaps.texi	Thu Aug 03 00:41:54 2006 +0000
+++ b/lispref/keymaps.texi	Thu Aug 03 11:45:23 2006 +0000
@@ -33,6 +33,7 @@
 * Functions for Key Lookup::    How to request key lookup.
 * Changing Key Bindings::       Redefining a key in a keymap.
 * Remapping Commands::          Bindings that translate one command to another.
+* Translation Keymaps::         Keymaps for translating sequences of events.
 * Key Binding Commands::        Interactive interfaces for redefining keys.
 * Scanning Keymaps::            Looking through all keymaps, for printing help.
 * Menu Keymaps::		Defining a menu as a keymap.
@@ -642,7 +643,7 @@
 and exit commands.  @xref{Intro to Minibuffers}.
 
   Emacs has other keymaps that are used in a different way---translating
-events within @code{read-key-sequence}.  @xref{Translating Input}.
+events within @code{read-key-sequence}.  @xref{Translation Keymaps}.
 
   @xref{Standard Keymaps}, for a list of standard keymaps.
 
@@ -682,7 +683,7 @@
 @node Searching Keymaps
 @section Searching the Active Keymaps
 
-  After translation of the input events (@pxref{Translating Input})
+  After translation of event subsequences (@pxref{Translation Keymaps})
 Emacs looks for them in the active keymaps.  Here is a pseudo-Lisp
 description of the order in which the active keymaps are searched:
 
@@ -1472,6 +1473,125 @@
 @code{nil}.
 @end defun
 
+@node Translation Keymaps
+@section Keymaps for Translating Sequences of Events
+
+  This section describes keymaps that are used during reading a key
+sequence, to translate certain event sequences into others.
+@code{read-key-sequence} checks every subsequence of the key sequence
+being read, as it is read, against @code{function-key-map} and then
+against @code{key-translation-map}.
+
+@defvar function-key-map
+This variable holds a keymap that describes the character sequences sent
+by function keys on an ordinary character terminal.  This keymap has the
+same structure as other keymaps, but is used differently: it specifies
+translations to make while reading key sequences, rather than bindings
+for key sequences.
+
+If @code{function-key-map} ``binds'' a key sequence @var{k} to a vector
+@var{v}, then when @var{k} appears as a subsequence @emph{anywhere} in a
+key sequence, it is replaced with the events in @var{v}.
+
+For example, VT100 terminals send @kbd{@key{ESC} O P} when the
+keypad @key{PF1} key is pressed.  Therefore, we want Emacs to translate
+that sequence of events into the single event @code{pf1}.  We accomplish
+this by ``binding'' @kbd{@key{ESC} O P} to @code{[pf1]} in
+@code{function-key-map}, when using a VT100.
+
+Thus, typing @kbd{C-c @key{PF1}} sends the character sequence @kbd{C-c
+@key{ESC} O P}; later the function @code{read-key-sequence} translates
+this back into @kbd{C-c @key{PF1}}, which it returns as the vector
+@code{[?\C-c pf1]}.
+
+Entries in @code{function-key-map} are ignored if they conflict with
+bindings made in the minor mode, local, or global keymaps.  The intent
+is that the character sequences that function keys send should not have
+command bindings in their own right---but if they do, the ordinary
+bindings take priority.
+
+The value of @code{function-key-map} is usually set up automatically
+according to the terminal's Terminfo or Termcap entry, but sometimes
+those need help from terminal-specific Lisp files.  Emacs comes with
+terminal-specific files for many common terminals; their main purpose is
+to make entries in @code{function-key-map} beyond those that can be
+deduced from Termcap and Terminfo.  @xref{Terminal-Specific}.
+@end defvar
+
+@defvar key-translation-map
+This variable is another keymap used just like @code{function-key-map}
+to translate input events into other events.  It differs from
+@code{function-key-map} in two ways:
+
+@itemize @bullet
+@item
+@code{key-translation-map} goes to work after @code{function-key-map} is
+finished; it receives the results of translation by
+@code{function-key-map}.
+
+@item
+Non-prefix bindings in @code{key-translation-map} override actual key
+bindings.  For example, if @kbd{C-x f} has a non-prefix binding in
+@code{key-translation-map}, that translation takes effect even though
+@kbd{C-x f} also has a key binding in the global map.
+@end itemize
+
+Note however that actual key bindings can have an effect on
+@code{key-translation-map}, even though they are overridden by it.
+Indeed, actual key bindings override @code{function-key-map} and thus
+may alter the key sequence that @code{key-translation-map} receives.
+Clearly, it is better to avoid this type of situation.
+
+The intent of @code{key-translation-map} is for users to map one
+character set to another, including ordinary characters normally bound
+to @code{self-insert-command}.
+@end defvar
+
+@cindex key translation function
+You can use @code{function-key-map} or @code{key-translation-map} for
+more than simple aliases, by using a function, instead of a key
+sequence, as the ``translation'' of a key.  Then this function is called
+to compute the translation of that key.
+
+The key translation function receives one argument, which is the prompt
+that was specified in @code{read-key-sequence}---or @code{nil} if the
+key sequence is being read by the editor command loop.  In most cases
+you can ignore the prompt value.
+
+If the function reads input itself, it can have the effect of altering
+the event that follows.  For example, here's how to define @kbd{C-c h}
+to turn the character that follows into a Hyper character:
+
+@example
+@group
+(defun hyperify (prompt)
+  (let ((e (read-event)))
+    (vector (if (numberp e)
+                (logior (lsh 1 24) e)
+              (if (memq 'hyper (event-modifiers e))
+                  e
+                (add-event-modifier "H-" e))))))
+
+(defun add-event-modifier (string e)
+  (let ((symbol (if (symbolp e) e (car e))))
+    (setq symbol (intern (concat string
+                                 (symbol-name symbol))))
+@end group
+@group
+    (if (symbolp e)
+        symbol
+      (cons symbol (cdr e)))))
+
+(define-key function-key-map "\C-ch" 'hyperify)
+@end group
+@end example
+
+  If you have enabled keyboard character set decoding using
+@code{set-keyboard-coding-system}, decoding is done after the
+translations listed above.  @xref{Terminal I/O Encoding}.  However, in
+future Emacs versions, character set decoding may be done at an
+earlier stage.
+
 @node Key Binding Commands
 @section Commands for Binding Keys
 
--- a/lispref/lists.texi	Thu Aug 03 00:41:54 2006 +0000
+++ b/lispref/lists.texi	Thu Aug 03 11:45:23 2006 +0000
@@ -20,6 +20,7 @@
 * List-related Predicates::        Is this object a list?  Comparing two lists.
 * List Elements::       Extracting the pieces of a list.
 * Building Lists::      Creating list structure.
+* List Variables::      Modifying lists stored in variables.
 * Modifying Lists::     Storing new pieces into an existing list.
 * Sets And Lists::      A list can represent a finite mathematical set.
 * Association Lists::   A list can represent a finite relation or mapping.
@@ -431,20 +432,6 @@
 any symbol can serve both purposes.
 @end defun
 
-@defmac push newelt listname
-This macro provides an alternative way to write
-@code{(setq @var{listname} (cons @var{newelt} @var{listname}))}.
-
-@example
-(setq l '(a b))
-     @result{} (a b)
-(push 'c l)
-     @result{} (c a b)
-l
-     @result{} (c a b)
-@end example
-@end defmac
-
 @defun list &rest objects
 This function creates a list with @var{objects} as its elements.  The
 resulting list is always @code{nil}-terminated.  If no @var{objects}
@@ -704,6 +691,124 @@
 @end example
 @end defun
 
+@node List Variables
+@section Modifying List Variables
+
+  These functions, and one macro, provide convenient ways
+to modify a list which is stored in a variable.
+
+@defmac push newelt listname
+This macro provides an alternative way to write
+@code{(setq @var{listname} (cons @var{newelt} @var{listname}))}.
+
+@example
+(setq l '(a b))
+     @result{} (a b)
+(push 'c l)
+     @result{} (c a b)
+l
+     @result{} (c a b)
+@end example
+@end defmac
+
+  Two functions modify lists that are the values of variables.
+
+@defun add-to-list symbol element &optional append
+This function sets the variable @var{symbol} by consing @var{element}
+onto the old value, if @var{element} is not already a member of that
+value.  It returns the resulting list, whether updated or not.  The
+value of @var{symbol} had better be a list already before the call.
+Membership is tested using @code{equal}.
+
+Normally, if @var{element} is added, it is added to the front of
+@var{symbol}, but if the optional argument @var{append} is
+non-@code{nil}, it is added at the end.
+
+The argument @var{symbol} is not implicitly quoted; @code{add-to-list}
+is an ordinary function, like @code{set} and unlike @code{setq}.  Quote
+the argument yourself if that is what you want.
+@end defun
+
+Here's a scenario showing how to use @code{add-to-list}:
+
+@example
+(setq foo '(a b))
+     @result{} (a b)
+
+(add-to-list 'foo 'c)     ;; @r{Add @code{c}.}
+     @result{} (c a b)
+
+(add-to-list 'foo 'b)     ;; @r{No effect.}
+     @result{} (c a b)
+
+foo                       ;; @r{@code{foo} was changed.}
+     @result{} (c a b)
+@end example
+
+  An equivalent expression for @code{(add-to-list '@var{var}
+@var{value})} is this:
+
+@example
+(or (member @var{value} @var{var})
+    (setq @var{var} (cons @var{value} @var{var})))
+@end example
+
+@defun add-to-ordered-list symbol element &optional order
+This function sets the variable @var{symbol} by inserting
+@var{element} into the old value, which must be a list, at the
+position specified by @var{order}.  If @var{element} is already a
+member of the list, its position in the list is adjusted according
+to @var{order}.  Membership is tested using @code{eq}.
+This function returns the resulting list, whether updated or not.
+
+The @var{order} is typically a number (integer or float), and the
+elements of the list are sorted in non-decreasing numerical order.
+
+@var{order} may also be omitted or @code{nil}.  Then the numeric order
+of @var{element} stays unchanged if it already has one; otherwise,
+@var{element} has no numeric order.  Elements without a numeric list
+order are placed at the end of the list, in no particular order.
+
+Any other value for @var{order} removes the numeric order of @var{element}
+if it already has one; otherwise, it is equivalent to @code{nil}.
+
+The argument @var{symbol} is not implicitly quoted;
+@code{add-to-ordered-list} is an ordinary function, like @code{set}
+and unlike @code{setq}.  Quote the argument yourself if that is what
+you want.
+
+The ordering information is stored in a hash table on @var{symbol}'s
+@code{list-order} property.
+@end defun
+
+Here's a scenario showing how to use @code{add-to-ordered-list}:
+
+@example
+(setq foo '())
+     @result{} nil
+
+(add-to-ordered-list 'foo 'a 1)     ;; @r{Add @code{a}.}
+     @result{} (a)
+
+(add-to-ordered-list 'foo 'c 3)     ;; @r{Add @code{c}.}
+     @result{} (a c)
+
+(add-to-ordered-list 'foo 'b 2)     ;; @r{Add @code{b}.}
+     @result{} (a b c)
+
+(add-to-ordered-list 'foo 'b 4)     ;; @r{Move @code{b}.}
+     @result{} (a c b)
+
+(add-to-ordered-list 'foo 'd)       ;; @r{Append @code{d}.}
+     @result{} (a c b d)
+
+(add-to-ordered-list 'foo 'e)       ;; @r{Add @code{e}}.
+     @result{} (a c b e d)
+
+foo                       ;; @r{@code{foo} was changed.}
+     @result{} (a c b e d)
+@end example
+
 @node Modifying Lists
 @section Modifying Existing List Structure
 @cindex destructive list operations
@@ -1384,7 +1489,7 @@
 @code{delete-dups} keeps the first one.
 @end defun
 
-  See also the function @code{add-to-list}, in @ref{Setting Variables},
+  See also the function @code{add-to-list}, in @ref{List Variables},
 for another way to add an element to a list stored in a variable.
 
 @node Association Lists
--- a/lispref/maps.texi	Thu Aug 03 00:41:54 2006 +0000
+++ b/lispref/maps.texi	Thu Aug 03 11:45:23 2006 +0000
@@ -115,7 +115,7 @@
 @item function-key-map
 The keymap for translating keypad and function keys.@*
 If there are none, then it contains an empty sparse keymap.
-@xref{Translating Input}.
+@xref{Translation Keymaps}.
 
 @item fundamental-mode-map
 @vindex fundamental-mode-map
@@ -158,7 +158,7 @@
 
 @item key-translation-map
 A keymap for translating keys.  This one overrides ordinary key
-bindings, unlike @code{function-key-map}.  @xref{Translating Input}.
+bindings, unlike @code{function-key-map}.  @xref{Translation Keymaps}.
 
 @item kmacro-map
 @vindex kmacro-map
--- a/lispref/modes.texi	Thu Aug 03 00:41:54 2006 +0000
+++ b/lispref/modes.texi	Thu Aug 03 11:45:23 2006 +0000
@@ -1295,7 +1295,7 @@
 @end smallexample
 
 @noindent
-or like this, using @code{add-to-list} (@pxref{Setting Variables}):
+or like this, using @code{add-to-list} (@pxref{List Variables}):
 
 @smallexample
 @group
@@ -1354,9 +1354,8 @@
 standard one.  The editor command loop handles this function specially.)
 
 The key sequences bound in a minor mode should consist of @kbd{C-c}
-followed by a punctuation character @emph{other than} @kbd{@{},
-@kbd{@}}, @kbd{<}, @kbd{>}, @kbd{:}, and @kbd{;}.  (Those few punctuation
-characters are reserved for major modes.)
+followed by one of @kbd{.,/?`'"[]\|~!#$%^&*()-_+=}.  (The other
+punctuation characters are reserved for major modes.)
 
 @node Defining Minor Modes
 @subsection Defining Minor Modes
@@ -3045,17 +3044,21 @@
 make the other also work.  However, for reliable results you must
 attend explicitly to both aspects.
 
-  There are two ways to ensure correct identification of multiline
+  There are three ways to ensure correct identification of multiline
 constructs:
 
 @itemize
 @item
-Place a @code{font-lock-multiline} or @code{jit-lock-defer-multiline}
+Place a @code{font-lock-multiline}
 property on the construct when it is added to the buffer.
 @item
 Use @code{font-lock-fontify-region-function} hook to extend the scan
 so that the scanned text never starts or ends in the middle of a
 multiline construct.
+@item
+Add a function to @code{font-lock-extend-region-functions} that does
+the \emph{identification} and extends the scan so that the scanned
+text never starts or ends in the middle of a multiline construct.
 @end itemize
 
   There are three ways to do rehighlighting of multiline constructs:
@@ -3077,7 +3080,6 @@
 Place a @code{jit-lock-defer-multiline} property on the construct.
 This works only if @code{jit-lock-contextually} is used, but it can
 handle the case where highlighting depends on subsequent lines.
-@item
 @end itemize
 
 @menu
@@ -3146,7 +3148,7 @@
   You can enlarge (or even reduce) the region to fontify by setting
 one the following variables:
 
-@defvar font-lock-extend-region-function
+@defvar font-lock-extend-after-change-region-function
 This buffer-local variable is either @code{nil} or a function for
 Font-Lock to call to determine the region to scan and fontify.
 
--- a/lispref/objects.texi	Thu Aug 03 00:41:54 2006 +0000
+++ b/lispref/objects.texi	Thu Aug 03 11:45:23 2006 +0000
@@ -1195,18 +1195,19 @@
 @node Function Type
 @subsection Function Type
 
-  Just as functions in other programming languages are executable,
-@dfn{Lisp function} objects are pieces of executable code.  However,
-functions in Lisp are primarily Lisp objects, and only secondarily the
-text which represents them.  These Lisp objects are lambda expressions:
-lists whose first element is the symbol @code{lambda} (@pxref{Lambda
-Expressions}).
+  Lisp functions are executable code, just like functions in other
+programming languages.  In Lisp, unlike most languages, functions are
+also Lisp objects.  A non-compiled function in Lisp is a lambda
+expression: that is, a list whose first element is the symbol
+@code{lambda} (@pxref{Lambda Expressions}).
 
   In most programming languages, it is impossible to have a function
 without a name.  In Lisp, a function has no intrinsic name.  A lambda
-expression is also called an @dfn{anonymous function} (@pxref{Anonymous
-Functions}).  A named function in Lisp is actually a symbol with a valid
-function in its function cell (@pxref{Defining Functions}).
+expression can be called as a function even though it has no name; to
+emphasize this, we also call it an @dfn{anonymous function}
+(@pxref{Anonymous Functions}).  A named function in Lisp is just a
+symbol with a valid function in its function cell (@pxref{Defining
+Functions}).
 
   Most of the time, functions are called when their names are written in
 Lisp expressions in Lisp programs.  However, you can construct or obtain
--- a/lispref/os.texi	Thu Aug 03 00:41:54 2006 +0000
+++ b/lispref/os.texi	Thu Aug 03 11:45:23 2006 +0000
@@ -28,8 +28,8 @@
 * Processor Run Time::  Getting the run time used by Emacs.
 * Time Calculations::   Adding, subtracting, comparing times, etc.
 * Timers::		Setting a timer to call a function at a certain time.
-* Terminal Input::      Recording terminal input for debugging.
-* Terminal Output::     Recording terminal output for debugging.
+* Terminal Input::      Accessing and recording terminal input.
+* Terminal Output::     Controlling and recording terminal output.
 * Sound Output::        Playing sounds on the computer's speaker.
 * X11 Keysyms::         Operating on key symbols for X Windows
 * Batch Mode::          Running Emacs without terminal interaction.
@@ -1521,8 +1521,6 @@
 
 @menu
 * Input Modes::		Options for how input is processed.
-* Translating Input::   Low level conversion of some characters or events
-			  into others.
 * Recording Input::	Saving histories of recent or all input events.
 @end menu
 
@@ -1587,204 +1585,6 @@
 @end table
 @end defun
 
-@node Translating Input
-@subsection Translating Input Events
-@cindex translating input events
-
-  This section describes features for translating input events into
-other input events before they become part of key sequences.  These
-features apply to each event in the order they are described here: each
-event is first modified according to @code{extra-keyboard-modifiers},
-then translated through @code{keyboard-translate-table} (if applicable),
-and finally decoded with the specified keyboard coding system.  If it is
-being read as part of a key sequence, it is then added to the sequence
-being read; then subsequences containing it are checked first with
-@code{function-key-map} and then with @code{key-translation-map}.
-
-@c Emacs 19 feature
-@defvar extra-keyboard-modifiers
-This variable lets Lisp programs ``press'' the modifier keys on the
-keyboard.  The value is a character.  Only the modifiers of the
-character matter.  Each time the user types a keyboard key, it is
-altered as if those modifier keys were held down.  For instance, if
-you bind @code{extra-keyboard-modifiers} to @code{?\C-\M-a}, then all
-keyboard input characters typed during the scope of the binding will
-have the control and meta modifiers applied to them.  The character
-@code{?\C-@@}, equivalent to the integer 0, does not count as a control
-character for this purpose, but as a character with no modifiers.
-Thus, setting @code{extra-keyboard-modifiers} to zero cancels any
-modification.
-
-When using a window system, the program can ``press'' any of the
-modifier keys in this way.  Otherwise, only the @key{CTL} and @key{META}
-keys can be virtually pressed.
-
-Note that this variable applies only to events that really come from
-the keyboard, and has no effect on mouse events or any other events.
-@end defvar
-
-@defvar keyboard-translate-table
-This variable is the translate table for keyboard characters.  It lets
-you reshuffle the keys on the keyboard without changing any command
-bindings.  Its value is normally a char-table, or else @code{nil}.
-(It can also be a string or vector, but this is considered obsolete.)
-
-If @code{keyboard-translate-table} is a char-table
-(@pxref{Char-Tables}), then each character read from the keyboard is
-looked up in this char-table.  If the value found there is
-non-@code{nil}, then it is used instead of the actual input character.
-
-Note that this translation is the first thing that happens to a
-character after it is read from the terminal.  Record-keeping features
-such as @code{recent-keys} and dribble files record the characters after
-translation.
-
-Note also that this translation is done before the characters are
-supplied to input methods (@pxref{Input Methods}).  Use
-@code{translation-table-for-input} (@pxref{Translation of Characters}),
-if you want to translate characters after input methods operate.
-@end defvar
-
-@defun keyboard-translate from to
-This function modifies @code{keyboard-translate-table} to translate
-character code @var{from} into character code @var{to}.  It creates
-the keyboard translate table if necessary.
-@end defun
-
-  Here's an example of using the @code{keyboard-translate-table} to
-make @kbd{C-x}, @kbd{C-c} and @kbd{C-v} perform the cut, copy and paste
-operations:
-
-@example
-(keyboard-translate ?\C-x 'control-x)
-(keyboard-translate ?\C-c 'control-c)
-(keyboard-translate ?\C-v 'control-v)
-(global-set-key [control-x] 'kill-region)
-(global-set-key [control-c] 'kill-ring-save)
-(global-set-key [control-v] 'yank)
-@end example
-
-@noindent
-On a graphical terminal that supports extended @acronym{ASCII} input,
-you can still get the standard Emacs meanings of one of those
-characters by typing it with the shift key.  That makes it a different
-character as far as keyboard translation is concerned, but it has the
-same usual meaning.
-
-  The remaining translation features translate subsequences of key
-sequences being read.  They are implemented in @code{read-key-sequence}
-and have no effect on input read with @code{read-event}.
-
-@defvar function-key-map
-This variable holds a keymap that describes the character sequences sent
-by function keys on an ordinary character terminal.  This keymap has the
-same structure as other keymaps, but is used differently: it specifies
-translations to make while reading key sequences, rather than bindings
-for key sequences.
-
-If @code{function-key-map} ``binds'' a key sequence @var{k} to a vector
-@var{v}, then when @var{k} appears as a subsequence @emph{anywhere} in a
-key sequence, it is replaced with the events in @var{v}.
-
-For example, VT100 terminals send @kbd{@key{ESC} O P} when the
-keypad @key{PF1} key is pressed.  Therefore, we want Emacs to translate
-that sequence of events into the single event @code{pf1}.  We accomplish
-this by ``binding'' @kbd{@key{ESC} O P} to @code{[pf1]} in
-@code{function-key-map}, when using a VT100.
-
-Thus, typing @kbd{C-c @key{PF1}} sends the character sequence @kbd{C-c
-@key{ESC} O P}; later the function @code{read-key-sequence} translates
-this back into @kbd{C-c @key{PF1}}, which it returns as the vector
-@code{[?\C-c pf1]}.
-
-Entries in @code{function-key-map} are ignored if they conflict with
-bindings made in the minor mode, local, or global keymaps.  The intent
-is that the character sequences that function keys send should not have
-command bindings in their own right---but if they do, the ordinary
-bindings take priority.
-
-The value of @code{function-key-map} is usually set up automatically
-according to the terminal's Terminfo or Termcap entry, but sometimes
-those need help from terminal-specific Lisp files.  Emacs comes with
-terminal-specific files for many common terminals; their main purpose is
-to make entries in @code{function-key-map} beyond those that can be
-deduced from Termcap and Terminfo.  @xref{Terminal-Specific}.
-@end defvar
-
-@defvar key-translation-map
-This variable is another keymap used just like @code{function-key-map}
-to translate input events into other events.  It differs from
-@code{function-key-map} in two ways:
-
-@itemize @bullet
-@item
-@code{key-translation-map} goes to work after @code{function-key-map} is
-finished; it receives the results of translation by
-@code{function-key-map}.
-
-@item
-Non-prefix bindings in @code{key-translation-map} override actual key
-bindings.  For example, if @kbd{C-x f} has a non-prefix binding in
-@code{key-translation-map}, that translation takes effect even though
-@kbd{C-x f} also has a key binding in the global map.
-@end itemize
-
-Note however that actual key bindings can have an effect on
-@code{key-translation-map}, even though they are overridden by it.
-Indeed, actual key bindings override @code{function-key-map} and thus
-may alter the key sequence that @code{key-translation-map} receives.
-Clearly, it is better to avoid this type of situation.
-
-The intent of @code{key-translation-map} is for users to map one
-character set to another, including ordinary characters normally bound
-to @code{self-insert-command}.
-@end defvar
-
-@cindex key translation function
-You can use @code{function-key-map} or @code{key-translation-map} for
-more than simple aliases, by using a function, instead of a key
-sequence, as the ``translation'' of a key.  Then this function is called
-to compute the translation of that key.
-
-The key translation function receives one argument, which is the prompt
-that was specified in @code{read-key-sequence}---or @code{nil} if the
-key sequence is being read by the editor command loop.  In most cases
-you can ignore the prompt value.
-
-If the function reads input itself, it can have the effect of altering
-the event that follows.  For example, here's how to define @kbd{C-c h}
-to turn the character that follows into a Hyper character:
-
-@example
-@group
-(defun hyperify (prompt)
-  (let ((e (read-event)))
-    (vector (if (numberp e)
-                (logior (lsh 1 24) e)
-              (if (memq 'hyper (event-modifiers e))
-                  e
-                (add-event-modifier "H-" e))))))
-
-(defun add-event-modifier (string e)
-  (let ((symbol (if (symbolp e) e (car e))))
-    (setq symbol (intern (concat string
-                                 (symbol-name symbol))))
-@end group
-@group
-    (if (symbolp e)
-        symbol
-      (cons symbol (cdr e)))))
-
-(define-key function-key-map "\C-ch" 'hyperify)
-@end group
-@end example
-
-Finally, if you have enabled keyboard character set decoding using
-@code{set-keyboard-coding-system}, decoding is done after the
-translations listed above.  @xref{Terminal I/O Encoding}.  In future
-Emacs versions, character set decoding may be done before the other
-translations.
-
 @node Recording Input
 @subsection Recording Input
 
@@ -1839,8 +1639,8 @@
 padding.
 
   It also affects decisions about whether to scroll part of the
-screen or repaint on non-window systems.  @xref{Forcing Redisplay},
-for the corresponding functionality on window systems.
+screen or repaint on text terminals.  @xref{Forcing Redisplay},
+for the corresponding functionality on graphical terminals.
 
 The value is measured in baud.
 @end defvar
--- a/lispref/processes.texi	Thu Aug 03 00:41:54 2006 +0000
+++ b/lispref/processes.texi	Thu Aug 03 11:45:23 2006 +0000
@@ -1724,9 +1724,10 @@
 @code{make-network-process}.
 
 @menu
-* Network Processes::        Using @code{make-network-process}.
-* Network Options::          Further control over network connections.
-* Network Feature Testing::  Determining which network features work on
+* Proc: Network Processes.   Using @code{make-network-process}.
+* Options: Network Options.  Further control over network connections.
+* Features: Network Feature Testing.
+                             Determining which network features work on
                                the machine you are using.
 @end menu
 
--- a/lispref/sequences.texi	Thu Aug 03 00:41:54 2006 +0000
+++ b/lispref/sequences.texi	Thu Aug 03 11:45:23 2006 +0000
@@ -513,8 +513,8 @@
 in @ref{Building Lists}.
 @end defun
 
-  The @code{append} function provides a way to convert a vector into a
-list with the same elements (@pxref{Building Lists}):
+  The @code{append} function also provides a way to convert a vector into a
+list with the same elements:
 
 @example
 @group
--- a/lispref/text.texi	Thu Aug 03 00:41:54 2006 +0000
+++ b/lispref/text.texi	Thu Aug 03 11:45:23 2006 +0000
@@ -3479,27 +3479,32 @@
 @subsection Defining Clickable Text
 @cindex clickable text
 
-  There are two ways to set up @dfn{clickable text} in a buffer.
-There are typically two parts of this: to make the text highlight
-when the mouse is over it, and to make a mouse button do something
-when you click it on that part of the text.
-
-  Highlighting is done with the @code{mouse-face} text property.
+  There are two parts of setting up @dfn{clickable text} in a buffer:
+(1) to indicate clickability when the mouse moves over the text, and (2)
+to make a mouse button do something when you click on that text.
+
+  Indicating clickability usually involves highlighting the text, and
+often involves displaying helpful information about the action, such
+as which mouse button to press, or a short summary of the action.
+This can be done with the @code{mouse-face} and @code{help-echo}
+text properties.  @xref{Special Properties}.
 Here is an example of how Dired does it:
 
 @smallexample
 (condition-case nil
     (if (dired-move-to-filename)
-        (put-text-property (point)
-                           (save-excursion
-                             (dired-move-to-end-of-filename)
-                             (point))
-                           'mouse-face 'highlight))
+        (add-text-properties
+         (point)
+         (save-excursion
+           (dired-move-to-end-of-filename)
+           (point))
+         '(mouse-face highlight
+           help-echo "mouse-2: visit this file in other window")))
   (error nil))
 @end smallexample
 
 @noindent
-The first two arguments to @code{put-text-property} specify the
+The first two arguments to @code{add-text-properties} specify the
 beginning and end of the text.
 
   The usual way to make the mouse do something when you click it
@@ -3509,24 +3514,34 @@
 
 @smallexample
 (defun dired-mouse-find-file-other-window (event)
-  "In dired, visit the file or directory name you click on."
+  "In Dired, visit the file or directory name you click on."
   (interactive "e")
-  (let (file)
+  (let (window pos file)
     (save-excursion
-      (set-buffer (window-buffer (posn-window (event-end event))))
-      (save-excursion
-        (goto-char (posn-point (event-end event)))
-        (setq file (dired-get-filename))))
-    (select-window (posn-window (event-end event)))
-    (find-file-other-window (file-name-sans-versions file t))))
+      (setq window (posn-window (event-end event))
+            pos (posn-point (event-end event)))
+      (if (not (windowp window))
+          (error "No file chosen"))
+      (set-buffer (window-buffer window))
+      (goto-char pos)
+      (setq file (dired-get-file-for-visit)))
+    (if (file-directory-p file)
+        (or (and (cdr dired-subdir-alist)
+                 (dired-goto-subdir file))
+            (progn
+              (select-window window)
+              (dired-other-window file)))
+      (select-window window)
+      (find-file-other-window (file-name-sans-versions file t)))))
 @end smallexample
 
 @noindent
-The reason for the outer @code{save-excursion} construct is to avoid
-changing the current buffer; the reason for the inner one is to avoid
-permanently altering point in the buffer you click on.  In this case,
-Dired uses the function @code{dired-get-filename} to determine which
-file to visit, based on the position found in the event.
+The reason for the @code{save-excursion} construct is to avoid
+changing the current buffer.  In this case,
+Dired uses the functions @code{posn-window} and @code{posn-point}
+to determine which buffer the click happened in and where, and
+in that buffer, @code{dired-get-file-for-visit} to determine which
+file to visit.
 
   Instead of defining a mouse command for the major mode, you can define
 a key binding for the clickable text itself, using the @code{keymap}
@@ -3663,7 +3678,8 @@
 
 @defun mouse-on-link-p pos
 This function returns non-@code{nil} if position @var{pos} in the
-current buffer is on a link.
+current buffer is on a link.  @var{pos} can also be a mouse event
+location, as returned by @code{event-start} (@pxref{Accessing Events}).
 @end defun
 
 @node Fields
@@ -3697,7 +3713,8 @@
 to an empty field whose beginning and end are both at @var{pos}.
 
   In all of these functions, if @var{pos} is omitted or @code{nil}, the
-value of point is used by default.
+value of point is used by default.  If narrowing is in effect, then
+@var{pos} should fall within the accessible portion.  @xref{Narrowing}.
 
 @defun field-beginning &optional pos escape-from-edge limit
 This function returns the beginning of the field specified by @var{pos}.
--- a/lispref/variables.texi	Thu Aug 03 00:41:54 2006 +0000
+++ b/lispref/variables.texi	Thu Aug 03 11:45:23 2006 +0000
@@ -858,105 +858,6 @@
 @end quotation
 @end defun
 
-  One other function for setting a variable is designed to add
-an element to a list if it is not already present in the list.
-
-@defun add-to-list symbol element &optional append
-This function sets the variable @var{symbol} by consing @var{element}
-onto the old value, if @var{element} is not already a member of that
-value.  It returns the resulting list, whether updated or not.  The
-value of @var{symbol} had better be a list already before the call.
-Membership is tested using @code{equal}.
-
-Normally, if @var{element} is added, it is added to the front of
-@var{symbol}, but if the optional argument @var{append} is
-non-@code{nil}, it is added at the end.
-
-The argument @var{symbol} is not implicitly quoted; @code{add-to-list}
-is an ordinary function, like @code{set} and unlike @code{setq}.  Quote
-the argument yourself if that is what you want.
-@end defun
-
-Here's a scenario showing how to use @code{add-to-list}:
-
-@example
-(setq foo '(a b))
-     @result{} (a b)
-
-(add-to-list 'foo 'c)     ;; @r{Add @code{c}.}
-     @result{} (c a b)
-
-(add-to-list 'foo 'b)     ;; @r{No effect.}
-     @result{} (c a b)
-
-foo                       ;; @r{@code{foo} was changed.}
-     @result{} (c a b)
-@end example
-
-  An equivalent expression for @code{(add-to-list '@var{var}
-@var{value})} is this:
-
-@example
-(or (member @var{value} @var{var})
-    (setq @var{var} (cons @var{value} @var{var})))
-@end example
-
-@defun add-to-ordered-list symbol element &optional order
-This function sets the variable @var{symbol} by inserting
-@var{element} into the old value, which must be a list, at the
-position specified by @var{order}.  If @var{element} is already a
-member of the list, its position in the list is adjusted according
-to @var{order}.  Membership is tested using @code{eq}.
-This function returns the resulting list, whether updated or not.
-
-The @var{order} is typically a number (integer or float), and the
-elements of the list are sorted in non-decreasing numerical order.
-
-@var{order} may also be omitted or @code{nil}.  Then the numeric order
-of @var{element} stays unchanged if it already has one; otherwise,
-@var{element} has no numeric order.  Elements without a numeric list
-order are placed at the end of the list, in no particular order.
-
-Any other value for @var{order} removes the numeric order of @var{element}
-if it already has one; otherwise, it is equivalent to @code{nil}.
-
-The argument @var{symbol} is not implicitly quoted;
-@code{add-to-ordered-list} is an ordinary function, like @code{set}
-and unlike @code{setq}.  Quote the argument yourself if that is what
-you want.
-
-The ordering information is stored in a hash table on @var{symbol}'s
-@code{list-order} property.
-@end defun
-
-Here's a scenario showing how to use @code{add-to-ordered-list}:
-
-@example
-(setq foo '())
-     @result{} nil
-
-(add-to-ordered-list 'foo 'a 1)     ;; @r{Add @code{a}.}
-     @result{} (a)
-
-(add-to-ordered-list 'foo 'c 3)     ;; @r{Add @code{c}.}
-     @result{} (a c)
-
-(add-to-ordered-list 'foo 'b 2)     ;; @r{Add @code{b}.}
-     @result{} (a b c)
-
-(add-to-ordered-list 'foo 'b 4)     ;; @r{Move @code{b}.}
-     @result{} (a c b)
-
-(add-to-ordered-list 'foo 'd)       ;; @r{Append @code{d}.}
-     @result{} (a c b d)
-
-(add-to-ordered-list 'foo 'e)       ;; @r{Add @code{e}}.
-     @result{} (a c b e d)
-
-foo                       ;; @r{@code{foo} was changed.}
-     @result{} (a c b e d)
-@end example
-
 @node Variable Scoping
 @section Scoping Rules for Variable Bindings
 
--- a/mac/ChangeLog	Thu Aug 03 00:41:54 2006 +0000
+++ b/mac/ChangeLog	Thu Aug 03 11:45:23 2006 +0000
@@ -1,3 +1,8 @@
+2006-07-20  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+	* makefile.MPW (dired.c.x, editfns.c.x, fileio.c.x): Depend on
+	blockinput.h.
+
 2006-07-12  Kim F. Storm  <storm@cua.dk>
 
 	* INSTALL: More cleanup related to last change.
--- a/mac/makefile.MPW	Thu Aug 03 00:41:54 2006 +0000
+++ b/mac/makefile.MPW	Thu Aug 03 11:45:23 2006 +0000
@@ -370,7 +370,8 @@
 	"{Src}charset.h" ¶
 	"{Src}coding.h" ¶
 		"{Src}ccl.h" ¶
-	"{Src}regex.h"
+	"{Src}regex.h" ¶
+	"{Src}blockinput.h"
 
 {Src}dispnew.c.x Ä ¶
 	{CONFIG_H_GROUP} ¶
@@ -422,7 +423,8 @@
 	"{Src}ccl.h" ¶
 	{WINDOW_H_GROUP} ¶
 	"{Src}systime.h" ¶
-		"{Includes}sys:time.h"
+		"{Includes}sys:time.h" ¶
+	"{Src}blockinput.h"
 
 {Src}emacs.c.x Ä ¶
 	{CONFIG_H_GROUP} ¶
@@ -465,7 +467,8 @@
 	{WINDOW_H_GROUP} ¶
 	"{Src}systime.h" ¶
 		"{Includes}sys:time.h" ¶
-	"{Src}commands.h"
+	"{Src}commands.h" ¶
+	"{Src}blockinput.h"
 
 {Src}filemode.c.x Ä ¶
 	{CONFIG_H_GROUP} ¶
--- a/man/ChangeLog	Thu Aug 03 00:41:54 2006 +0000
+++ b/man/ChangeLog	Thu Aug 03 11:45:23 2006 +0000
@@ -1,3 +1,90 @@
+2006-08-03  Michael Olson  <mwolson@gnu.org>
+
+	* erc.texi: Update for ERC 5.1.4.
+
+2006-08-01  Richard Stallman  <rms@gnu.org>
+
+	* help.texi (Name Help): Add index entries for describe-variable.
+
+2006-08-01  Nick Roberts  <nickrob@snap.net.nz>
+
+	* building.texi (GDB Graphical Interface): Shorten node names.
+	(GDB-UI Layout): Use GDB-related.
+	(Stack Buffer): Simplify English.
+
+2006-07-31  Richard Stallman  <rms@gnu.org>
+
+	* search.texi (Query Replace): Add xref for Dired's Q command.
+
+2006-07-28  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+	* gnus.texi (Oort Gnus): Mention that the Lisp files are now installed
+	in .../site-lisp/gnus/ by default.
+	[ From gnus-news.texi in the trunk. ]
+
+2006-07-27  Reiner Steib  <Reiner.Steib@gmx.de>
+
+	* gnus.texi (MIME Commands): Additions for yEnc.
+
+2006-07-31  Nick Roberts  <nickrob@snap.net.nz>
+
+	* building.texi (GDB commands in Fringe): Rename to...
+	(Source Buffers): ..this and move forward.  Describe hollow arrow and
+	new option gdb-find-source-frame.
+	
+2006-07-29  Richard Stallman  <rms@gnu.org>
+
+	* dired.texi (Operating on Files): Simplify previous change
+	and fix Texinfo usage.
+
+2006-07-29  Eli Zaretskii  <eliz@gnu.org>
+
+	* dired.texi (Operating on Files): Add cross-references.  State the
+	Unix commands that do similar things.
+
+2006-07-28  Richard Stallman  <rms@gnu.org>
+
+	* mark.texi (Transient Mark): Clarify that region never disappears
+	when Transient Mark mode is off, and not when it is on.	
+
+2006-07-27  Richard Stallman  <rms@gnu.org>
+
+	* search.texi (Non-ASCII Isearch): Clarify.  Mention C-q.
+
+2006-07-24  Richard Stallman  <rms@gnu.org>
+
+	* xresources.texi (GTK styles): Fix texinfo usage.
+
+	* pgg.texi, org.texi, info.texi, forms.texi, flymake.texi: 
+	* faq.texi: Move periods and commas inside quotes.
+
+	* commands.texi (User Input): Explain why we teach keyboard cmds.
+	
+	* xresources.texi, xresmini.texi, search.texi, programs.texi: 
+	* misc.texi, kmacro.texi, killing.texi, glossary.texi: 
+	* fortran-xtra.texi, files.texi, emacs.texi, emacs-xtra.texi: 
+	* doclicense.texi, display.texi, dired.texi, basic.texi: 
+	* anti.texi, ack.texi: Move periods and commas inside quotes.
+
+2006-07-22  Eli Zaretskii  <eliz@gnu.org>
+
+	* cmdargs.texi (General Variables): Document EMAIL.
+
+2006-07-21  Eli Zaretskii  <eliz@gnu.org>
+
+	* frames.texi (Frame Commands): Mention that focus-follows-mouse
+	doesn't have effect on MS-Windows.
+
+2006-07-20  Jay Belanger  <belanger@truman.edu>
+
+	* calc.texi (Error forms):  Mention M-+ keybinding for
+	`calc-plus-minus'.
+
+2006-07-18  Chong Yidong  <cyd@stupidchicken.com>
+
+	* faq.texi (Security risks with Emacs): Document Emacs 22
+	file-local-variable mechanism.
+
 2006-07-17  Richard Stallman  <rms@gnu.org>
 
 	* building.texi (Grep Searching): Explain about chaining grep commands.
--- a/man/ack.texi	Thu Aug 03 00:41:54 2006 +0000
+++ b/man/ack.texi	Thu Aug 03 11:45:23 2006 +0000
@@ -1242,7 +1242,7 @@
 
 @item
 Jean-Philippe Theberge wrote @file{thumbs.el}, a package for viewing
-image files as ``thumbnails''.
+image files as ``thumbnails.''
 
 @item
 Jens T.@: Berger Thielemann wrote @file{word-help.el}, which is
--- a/man/anti.texi	Thu Aug 03 00:41:54 2006 +0000
+++ b/man/anti.texi	Thu Aug 03 11:45:23 2006 +0000
@@ -232,7 +232,7 @@
 
 @item
 The input methods for Emacs are included in a separate distribution
-called ``Leim''.  To use this, you must extract the Leim tar file on
+called ``Leim.''  To use this, you must extract the Leim tar file on
 top of the Emacs distribution, into the same directory, before you
 build Emacs.
 
--- a/man/basic.texi	Thu Aug 03 00:41:54 2006 +0000
+++ b/man/basic.texi	Thu Aug 03 11:45:23 2006 +0000
@@ -736,7 +736,7 @@
 @kbd{C-u}; for example, @kbd{C-u 6 4 C-u 1} does insert 64 copies of
 the character @samp{1}.
 
-  We use the term ``prefix argument'' as well as ``numeric argument'',
+  We use the term ``prefix argument'' as well as ``numeric argument,''
 to emphasize that you type these argument before the command, and to
 distinguish them from minibuffer arguments that come after the
 command.
--- a/man/building.texi	Thu Aug 03 00:41:54 2006 +0000
+++ b/man/building.texi	Thu Aug 03 11:45:23 2006 +0000
@@ -833,17 +833,17 @@
 that way, you can use @kbd{M-x gdba} to invoke GDB in graphical mode.
 
 @menu
-* GDB User Interface Layout::   Control the number of displayed buffers.
+* GDB-UI Layout::               Control the number of displayed buffers.
+* Source Buffers::              Use the mouse in the fringe/margin to
+                                control your program.
 * Breakpoints Buffer::          A breakpoint control panel.
 * Stack Buffer::                Select a frame from the call stack.
-* Other GDB User Interface Buffers:: Input/output, locals, registers,
+* Other GDB-UI Buffers::        Input/output, locals, registers,
                                 assembler, threads and memory buffers.
-* GDB commands in the Fringe::  Use the mouse in the fringe/margin to
-                                control your program.
 * Watch Expressions::           Monitor variable values in the speedbar.
 @end menu
 
-@node GDB User Interface Layout
+@node GDB-UI Layout
 @subsubsection GDB User Interface Layout
 @cindex GDB User Interface layout
 
@@ -863,7 +863,7 @@
 +--------------------------------+--------------------------------+
 |   GUD buffer (I/O of GDB)      |   Locals buffer                |
 |--------------------------------+--------------------------------+
-|   Source buffer                |   I/O buffer for debugged pgm  |
+|   Primary Source buffer        |   I/O buffer for debugged pgm  |
 |--------------------------------+--------------------------------+
 |   Stack buffer                 |   Breakpoints buffer           |
 +--------------------------------+--------------------------------+
@@ -871,8 +871,8 @@
 @end smallexample
 
   However, if @code{gdb-use-separate-io-buffer} is @code{nil}, the I/O
-buffer does not appear and the source buffer occupies the full width
-of the frame.
+buffer does not appear and the primary source buffer occupies the full
+width of the frame.
 
 @findex gdb-restore-windows
   If you change the window layout, for example, while editing and
@@ -884,7 +884,7 @@
 containing just the GUD buffer and a source file, type @kbd{M-x
 gdb-many-windows}.
 
-  You may also specify additional GUD-related buffers to display,
+  You may also specify additional GDB-related buffers to display,
 either in the same frame or a different one.  Select the buffers you
 want with the @samp{GUD->GDB-windows} and @samp{GUD->GDB-Frames}
 sub-menus.  If the menu-bar is unavailable, type @code{M-x
@@ -904,6 +904,61 @@
 breakpoints in recently edited source files are still in the right
 places.
 
+@node Source Buffers
+@subsubsection Source Buffers
+@cindex GDB commands in Fringe
+
+@c @findex gdb-mouse-set-clear-breakpoint
+@c @findex gdb-mouse-toggle-breakpoint
+Many GDB commands can be entered using keybindings or the tool bar but
+sometimes it is quicker to use the fringe.  These commands either
+manipulate breakpoints or control program execution.  When there is no
+fringe, you can use the margin but this is only present when the
+source file already has a breakpoint.
+
+You can click @kbd{Mouse-1} in the fringe or display margin of a
+source buffer to set a breakpoint there and, on a graphical display, a
+red bullet will appear on that line.  If a breakpoint already exists
+on that line, the same click will remove it.  You can also enable or
+disable a breakpoint by clicking @kbd{C-Mouse-1} on the bullet.
+
+A solid arrow in the left fringe of a source buffer indicates the line
+of the innermost frame where the debugged program has stopped. A
+hollow arrow indicates the current execution line of higher level
+frames.
+
+If you drag the arrow in the fringe with @kbd{Mouse-1}
+(@code{gdb-mouse-until}), execution will continue to the line where
+you release the button, provided it is still in the same frame.
+Alternatively, you can click @kbd{Mouse-3} at some point in the fringe
+of this buffer and execution will advance to there.  A similar command
+(@code{gdb-mouse-jump}) allows you to jump to a source line without
+executing the intermediate lines by clicking @kbd{C-Mouse-3}.  This
+command allows you to go backwards which can be useful for running
+through code that has already executed, in order to examine its
+execution in more detail.
+
+@table @kbd
+@item Mouse-1
+Set or clear a breakpoint.
+
+@item C-Mouse-1
+Enable or disable a breakpoint.
+
+@item Mouse-3
+Continue execution to here.
+
+@item C-Mouse-3
+Jump to here.
+@end table
+
+If the variable @code{gdb-find-source-frame} is non-@code{nil} and
+execution stops in a frame for which there is no source code e.g after
+an interrupt, then Emacs finds and displays the first frame further up
+stack for which there is source.  If it is @code{nil} then the source
+buffer continues to display the last frame which maybe more useful,
+for example, when re-setting a breakpoint.
+
 @node Breakpoints Buffer
 @subsubsection Breakpoints Buffer
 
@@ -918,7 +973,7 @@
 @findex gdb-toggle-breakpoint
 Enable/disable the current breakpoint (@code{gdb-toggle-breakpoint}).
 On a graphical display, this changes the color of a bullet in the
-margin of the source buffer at the relevant line.  This is red when
+margin of a source buffer at the relevant line.  This is red when
 the breakpoint is enabled and grey when it is disabled.  Text-only
 terminals correspondingly display a @samp{B} or @samp{b}.
 
@@ -953,21 +1008,20 @@
 selecting a stack frame updates it to display the local variables of
 the new frame.
 
-@node Other GDB User Interface Buffers
+@node Other GDB-UI Buffers
 @subsubsection Other Buffers
 
 @table @asis
 @item Input/Output Buffer
 @vindex gdb-use-separate-io-buffer
 If the variable @code{gdb-use-separate-io-buffer} is non-@code{nil},
-the executable program that is being debugged takes its input and
-displays its output here.  Otherwise it uses the GUD buffer for that.
-To toggle whether GUD mode uses this buffer, do @kbd{M-x
-gdb-use-separate-io-buffer}.  That takes effect when you next
-restart the program you are debugging.
+the program being debugged takes its input and displays its output
+here.  Otherwise it uses the GUD buffer for that.  To toggle whether
+GUD mode uses this buffer, do @kbd{M-x gdb-use-separate-io-buffer}.
+That takes effect when you next restart the program you are debugging.
 
 The history and replay commands from Shell mode are available here,
-as are the commands to send signals to the program you are debugging.
+as are the commands to send signals to the debugged program.
 @xref{Shell Mode}.
 
 @item Locals Buffer
@@ -1003,10 +1057,10 @@
 program (@pxref{Threads, Threads, Debugging programs with multiple
 threads, gdb, The GNU debugger}).  Move point to any thread in the
 list and press @key{RET} to select it (@code{gdb-threads-select}) and
-display the associated source in the source buffer.  Alternatively,
-click @kbd{Mouse-2} on a thread to select it.  If the locals buffer is
-visible, its contents update to display the variables that are local
-in the new thread.
+display the associated source in the primary source buffer.
+Alternatively, click @kbd{Mouse-2} on a thread to select it.  If the
+locals buffer is visible, its contents update to display the variables
+that are local in the new thread.
 
 @item Memory Buffer
 The memory buffer lets you examine sections of program memory
@@ -1017,49 +1071,6 @@
 display format or unit size for these data items.
 @end table
 
-@node GDB commands in the Fringe
-@subsubsection GDB commands in the Fringe
-@cindex GDB commands in the Fringe
-
-@c @findex gdb-mouse-set-clear-breakpoint
-@c @findex gdb-mouse-toggle-breakpoint
-Many GDB commands can be entered using keybindings or the tool bar but
-sometimes it is quicker to use the fringe.  These commands either
-manipulate breakpoints or control program execution.  When there is no
-fringe, you can use the margin but this is only present when the
-source file already has a breakpoint.
-
-You can click @kbd{Mouse-1} in the fringe or display margin of a
-source buffer to set a breakpoint there and, on a graphical display, a
-red bullet will appear on that line.  If a breakpoint already exists
-on that line, the same click will remove it.  You can also enable or
-disable a breakpoint by clicking @kbd{C-Mouse-1} on the bullet.
-
-If you drag the debugger arrow in the fringe with @kbd{Mouse-1}
-(@code{gdb-mouse-until}), execution will continue to the line where
-you release the button, provided it is still in the same frame.
-Alternatively, you can click @kbd{Mouse-3} at some point in the fringe
-of this buffer and execution will advance to there.  A similar command
-(@code{gdb-mouse-jump}) allows you to jump to a source line without
-executing the intermediate lines by clicking @kbd{C-Mouse-3}.  This
-command allows you to go backwards which can be useful for running
-through code that has already executed, in order to examine its
-execution in more detail.
-
-@table @kbd
-@item Mouse-1
-Set or clear a breakpoint.
-
-@item C-Mouse-1
-Enable or disable a breakpoint.
-
-@item Mouse-3
-Continue execution to here.
-
-@item C-Mouse-3
-Jump to here.
-@end table
-
 @node Watch Expressions
 @subsubsection Watch Expressions
 @cindex Watching expressions in GDB
--- a/man/calc.texi	Thu Aug 03 00:41:54 2006 +0000
+++ b/man/calc.texi	Thu Aug 03 11:45:23 2006 +0000
@@ -11635,7 +11635,7 @@
 To enter an error form during regular numeric entry, use the @kbd{p}
 (``plus-or-minus'') key to type the @samp{+/-} symbol.  (If you try actually
 typing @samp{+/-} the @kbd{+} key will be interpreted as the Calculator's
-@kbd{+} command!)  Within an algebraic formula, you can press @kbd{M-p} to
+@kbd{+} command!)  Within an algebraic formula, you can press @kbd{M-+} to
 type the @samp{+/-} symbol, or type it out by hand.
 
 Error forms and complex numbers can be mixed; the formulas shown above
--- a/man/cmdargs.texi	Thu Aug 03 00:41:54 2006 +0000
+++ b/man/cmdargs.texi	Thu Aug 03 11:45:23 2006 +0000
@@ -470,6 +470,11 @@
 @item EMACSPATH
 A colon-separated list of directories to search for executable
 files---used to initialize @code{exec-path}.
+@item EMAIL
+@vindex user-mail-address@r{, initialization}
+Your email address; used to initialize the Lisp variable
+@code{user-mail-address}, which the Emacs mail interface puts into
+the @samp{From} header of outgoing messages (@pxref{Mail Headers}).
 @item ESHELL
 Used for shell-mode to override the @env{SHELL} environment variable.
 @item HISTFILE
--- a/man/commands.texi	Thu Aug 03 00:41:54 2006 +0000
+++ b/man/commands.texi	Thu Aug 03 11:45:23 2006 +0000
@@ -25,9 +25,18 @@
 @cindex Control
 @cindex control characters
 
-  GNU Emacs uses an extension of the @acronym{ASCII} character set for keyboard
-input; it also accepts non-character input events including function
-keys and mouse button actions.
+  GNU Emacs is designed for use with keyboard commands because that is
+the most efficient way to edit.  You can do editing with the mouse, as
+in other editors, and you can give commands with the menu bar and tool
+bar, and scroll with the scroll bar.  But if you keep on editing that
+way, you won't get the benefits of Emacs.  Therefore, this manual
+documents primarily how to edit with the keyboard.  You can force
+yourself to practice using the keyboard by using the shell command
+@samp{emacs -nw} to start Emacs, so that the mouse won't work.
+
+  Emacs uses an extension of the @acronym{ASCII} character set for
+keyboard input; it also accepts non-character input events including
+function keys and mouse button actions.
 
   @acronym{ASCII} consists of 128 character codes.  Some of these codes are
 assigned graphic symbols such as @samp{a} and @samp{=}; the rest are
--- a/man/dired.texi	Thu Aug 03 00:41:54 2006 +0000
+++ b/man/dired.texi	Thu Aug 03 11:45:23 2006 +0000
@@ -550,34 +550,38 @@
 @item C @var{new} @key{RET}
 Copy the specified files (@code{dired-do-copy}).  The argument @var{new}
 is the directory to copy into, or (if copying a single file) the new
-name.
+name.  This is like the shell command @code{cp}.
 
 @vindex dired-copy-preserve-time
 If @code{dired-copy-preserve-time} is non-@code{nil}, then copying
 with this command preserves the modification time of the old file in
-the copy.
+the copy, like @samp{cp -p}.
 
 @vindex dired-recursive-copies
 @cindex recursive copying
 The variable @code{dired-recursive-copies} controls whether to copy
-directories recursively.  The default is @code{nil}, which means that
-directories cannot be copied.
+directories recursively (like @samp{cp -r}).  The default is
+@code{nil}, which means that directories cannot be copied.
 
 @item D
 @findex dired-do-delete
 @kindex D @r{(Dired)}
-Delete the specified files (@code{dired-do-delete}).  Like the other
-commands in this section, this command operates on the @emph{marked}
-files, or the next @var{n} files.  By contrast, @kbd{x}
+Delete the specified files (@code{dired-do-delete}).  This is like the
+shell command @code{rm}.
+
+Like the other commands in this section, this command operates on the
+@emph{marked} files, or the next @var{n} files.  By contrast, @kbd{x}
 (@code{dired-do-flagged-delete}) deletes all @dfn{flagged} files.
 
 @findex dired-do-rename
 @kindex R @r{(Dired)}
 @cindex renaming files (in Dired)
+@cindex moving files (in Dired)
 @item R @var{new} @key{RET}
-Rename the specified files (@code{dired-do-rename}).  The argument
-@var{new} is the directory to rename into, or (if renaming a single
-file) the new name.
+Rename the specified files (@code{dired-do-rename}).  If you rename a
+single file, the argument @var{new} is the new name of the file.  If
+you rename several files, the argument @var{new} is the directory into
+which to move the files (this is like the shell command @code{mv}).
 
 Dired automatically changes the visited file name of buffers associated
 with renamed files so that they refer to the new names.
@@ -586,17 +590,19 @@
 @kindex H @r{(Dired)}
 @cindex hard links (in Dired)
 @item H @var{new} @key{RET}
-Make hard links to the specified files (@code{dired-do-hardlink}).  The
-argument @var{new} is the directory to make the links in, or (if making
-just one link) the name to give the link.
+Make hard links to the specified files (@code{dired-do-hardlink}).
+This is like the shell command @code{ln}.  The argument @var{new} is
+the directory to make the links in, or (if making just one link) the
+name to give the link.
 
 @findex dired-do-symlink
 @kindex S @r{(Dired)}
 @cindex symbolic links (creation in Dired)
 @item S @var{new} @key{RET}
 Make symbolic links to the specified files (@code{dired-do-symlink}).
-The argument @var{new} is the directory to make the links in, or (if
-making just one link) the name to give the link.
+This is like @samp{ln -s}.  The argument @var{new} is the directory to
+make the links in, or (if making just one link) the name to give the
+link.
 
 @findex dired-do-chmod
 @kindex M @r{(Dired)}
@@ -631,7 +637,8 @@
 @cindex changing file time (in Dired)
 @item T @var{timestamp} @key{RET}
 Touch the specified files (@code{dired-do-touch}).  This means
-updating their modification times to the present time.
+updating their modification times to the present time.  This is like
+the shell command @code{touch}.
 
 @findex dired-do-print
 @kindex P @r{(Dired)}
@@ -1141,7 +1148,7 @@
 @findex wdired-change-to-wdired-mode
   Wdired is a special mode that allows you to perform file operations
 by editing the Dired buffer directly (the ``W'' in ``Wdired'' stands
-for ``writable''.)  To enter Wdired mode, type @kbd{M-x
+for ``writable.'')  To enter Wdired mode, type @kbd{M-x
 wdired-change-to-wdired-mode} while in a Dired buffer.  Alternatively,
 use @samp{Edit File Names} in the @samp{Immediate} menu bar menu.
 
@@ -1205,7 +1212,7 @@
 
   The default comparison method (used if you type @key{RET} at the
 prompt) is to compare just the file names---each file name that does
-not appear in the other directory is ``different''.  You can specify
+not appear in the other directory is ``different.''  You can specify
 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
@@ -1213,7 +1220,7 @@
 @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
-non-@code{nil}, those files are considered ``different''.
+non-@code{nil}, those files are considered ``different.''
 
   For instance, the sequence @code{M-x dired-compare-directories
 @key{RET} (> mtime1 mtime2) @key{RET}} marks files newer in this
--- a/man/display.texi	Thu Aug 03 00:41:54 2006 +0000
+++ b/man/display.texi	Thu Aug 03 11:45:23 2006 +0000
@@ -402,7 +402,7 @@
 when @code{show-trailing-whitespace} is non-@code{nil}; see
 @ref{Useless Whitespace}.
 @item nobreak-space
-The face for displaying the character ``nobreak space''.
+The face for displaying the character ``nobreak space.''
 @item escape-glyph
 The face for highlighting the @samp{\} or @samp{^} that indicates
 a control character.  It's also used when @samp{\} indicates a
@@ -1062,7 +1062,7 @@
 @vindex cursor-in-non-selected-windows
   Normally, the cursor appears in non-selected windows in the ``off''
 state, with the same appearance as when the blinking cursor blinks
-``off''.  For a box cursor, this is a hollow box; for a bar cursor,
+``off.''  For a box cursor, this is a hollow box; for a bar cursor,
 this is a thinner bar.  To turn off cursors in non-selected windows,
 customize the variable @code{cursor-in-non-selected-windows} and assign
 it a @code{nil} value.
--- a/man/doclicense.texi	Thu Aug 03 00:41:54 2006 +0000
+++ b/man/doclicense.texi	Thu Aug 03 11:45:23 2006 +0000
@@ -23,7 +23,7 @@
 to get credit for their work, while not being considered responsible
 for modifications made by others.
 
-This License is a kind of ``copyleft'', which means that derivative
+This License is a kind of ``copyleft,'' which means that derivative
 works of the document must themselves be free in the same sense.  It
 complements the GNU General Public License, which is a copyleft
 license designed for free software.
@@ -44,9 +44,9 @@
 contains a notice placed by the copyright holder saying it can be
 distributed under the terms of this License.  Such a notice grants a
 world-wide, royalty-free license, unlimited in duration, to use that
-work under the conditions stated herein.  The ``Document'', below,
+work under the conditions stated herein.  The ``Document,'' below,
 refers to any such manual or work.  Any member of the public is a
-licensee, and is addressed as ``you''.  You accept the license if you
+licensee, and is addressed as ``you.''  You accept the license if you
 copy, modify or distribute the work in a way requiring permission
 under copyright law.
 
@@ -113,8 +113,8 @@
 A section ``Entitled XYZ'' means a named subunit of the Document whose
 title either is precisely XYZ or contains XYZ in parentheses following
 text that translates XYZ in another language.  (Here XYZ stands for a
-specific section name mentioned below, such as ``Acknowledgements'',
-``Dedications'', ``Endorsements'', or ``History''.)  To ``Preserve the Title''
+specific section name mentioned below, such as ``Acknowledgements,''
+``Dedications,'' ``Endorsements,'' or ``History.'')  To ``Preserve the Title''
 of such a section when you modify the Document means that it remains a
 section ``Entitled XYZ'' according to this definition.
 
@@ -210,7 +210,7 @@
 G. Preserve in that license notice the full lists of Invariant Sections
    and required Cover Texts given in the Document's license notice.@*
 H. Include an unaltered copy of this License.@*
-I. Preserve the section Entitled ``History'', Preserve its Title, and add
+I. Preserve the section Entitled ``History,'' Preserve its Title, and add
    to it an item stating at least the title, year, new authors, and
    publisher of the Modified Version as given on the Title Page.  If
    there is no section Entitled ``History'' in the Document, create one
@@ -224,7 +224,7 @@
    You may omit a network location for a work that was published at
    least four years before the Document itself, or if the original
    publisher of the version it refers to gives permission.@*
-K. For any section Entitled ``Acknowledgements'' or ``Dedications'',
+K. For any section Entitled ``Acknowledgements'' or ``Dedications,''
    Preserve the Title of the section, and preserve in the section all
    the substance and tone of each of the contributor acknowledgements
    and/or dedications given therein.@*
@@ -244,7 +244,7 @@
 list of Invariant Sections in the Modified Version's license notice.
 These titles must be distinct from any other section titles.
 
-You may add a section Entitled ``Endorsements'', provided it contains
+You may add a section Entitled ``Endorsements,'' provided it contains
 nothing but endorsements of your Modified Version by various
 parties--for example, statements of peer review or that the text has
 been approved by an organization as the authoritative definition of a
@@ -285,7 +285,7 @@
 
 In the combination, you must combine any sections Entitled ``History''
 in the various original documents, forming one section Entitled
-``History''; likewise combine any sections Entitled ``Acknowledgements'',
+``History''; likewise combine any sections Entitled ``Acknowledgements,''
 and any sections Entitled ``Dedications.''  You must delete all sections
 Entitled ``Endorsements.''
 @sp 1
@@ -339,8 +339,8 @@
 the translation and the original version of this License or a notice
 or disclaimer, the original version will prevail.
 
-If a section in the Document is Entitled ``Acknowledgements'',
-``Dedications'', or ``History'', the requirement (section 4) to Preserve
+If a section in the Document is Entitled ``Acknowledgements,''
+``Dedications,'' or ``History,'' the requirement (section 4) to Preserve
 its Title (section 1) will typically require changing the actual
 title.
 @sp 1
@@ -389,7 +389,7 @@
 or any later version published by the Free Software Foundation;
 with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
 A copy of the license is included in the section entitled ``GNU
-Free Documentation License''.
+Free Documentation License.''
 @end group
 @end smallexample
 
--- a/man/emacs-xtra.texi	Thu Aug 03 00:41:54 2006 +0000
+++ b/man/emacs-xtra.texi	Thu Aug 03 11:45:23 2006 +0000
@@ -17,7 +17,7 @@
 under the terms of the GNU Free Documentation License, Version 1.2 or
 any later version published by the Free Software Foundation; with no
 Invariant Sections, with the Front-Cover texts being ``A GNU
-Manual'', and with the Back-Cover Texts as in (a) below.  A copy of the
+Manual,'' and with the Back-Cover Texts as in (a) below.  A copy of the
 license is included in the section entitled ``GNU Free Documentation
 License'' in the Emacs manual.
 
--- a/man/emacs.texi	Thu Aug 03 00:41:54 2006 +0000
+++ b/man/emacs.texi	Thu Aug 03 11:45:23 2006 +0000
@@ -19,8 +19,8 @@
 Permission is granted to copy, distribute and/or modify this document
 under the terms of the GNU Free Documentation License, Version 1.2 or
 any later version published by the Free Software Foundation; with the
-Invariant Sections being ``The GNU Manifesto'', ``Distribution'' and
-``GNU GENERAL PUBLIC LICENSE'', with the Front-Cover texts being ``A GNU
+Invariant Sections being ``The GNU Manifesto,'' ``Distribution'' and
+``GNU GENERAL PUBLIC LICENSE,'' with the Front-Cover texts being ``A GNU
 Manual,'' and with the Back-Cover Texts as in (a) below.  A copy of the
 license is included in the section entitled ``GNU Free Documentation
 License.''
--- a/man/erc.texi	Thu Aug 03 00:41:54 2006 +0000
+++ b/man/erc.texi	Thu Aug 03 11:45:23 2006 +0000
@@ -12,7 +12,7 @@
 @syncodeindex fn cp
 
 @copying
-This manual is for ERC version 5.1.3.
+This manual is for ERC version 5.1.4.
 
 Copyright @copyright{} 2005, 2006 Free Software Foundation, Inc.
 
--- a/man/faq.texi	Thu Aug 03 00:41:54 2006 +0000
+++ b/man/faq.texi	Thu Aug 03 11:45:23 2006 +0000
@@ -2481,7 +2481,7 @@
 
 More detailed information---and more examples of how to create and
 modify menu options---are in the @cite{Emacs Lisp Reference Manual}, under
-``Menu Keymaps''.  (@xref{Emacs Lisp documentation}, for information on
+``Menu Keymaps.''  (@xref{Emacs Lisp documentation}, for information on
 this manual.)
 
 @node Deleting menus and menu options, Turning on syntax highlighting, Modifying pull-down menus, Common requests
@@ -3125,14 +3125,12 @@
 Obviously, there is a potential for Trojan horses to exploit this
 feature.
 
-Emacs 18 allowed this feature by default; users could disable it by
-setting the variable @code{inhibit-local-variables} to a non-@code{nil} value.
-
-As of Emacs 19, Emacs has a list of local variables that create a
-security risk.  If a file tries to set one of them, it asks the user to
-confirm whether the variables should be set.  You can also tell Emacs
-whether to allow the evaluation of Emacs Lisp code found at the bottom
-of files by setting the variable @code{enable-local-eval}.
+As of Emacs 22, Emacs has a list of local variables that are known to
+be safe to set.  If a file tries to set any variable outside this
+list, it asks the user to confirm whether the variables should be set.
+You can also tell Emacs whether to allow the evaluation of Emacs Lisp
+code found at the bottom of files by setting the variable
+@code{enable-local-eval}.
 
 For more information, @inforef{File Variables, File Variables, emacs}.
 
@@ -3397,7 +3395,7 @@
 ``OpenWindows Programmers'' optional software category from the CD-ROM.
 
 On HP-UX 8.0, you may need to run @code{update} again to load the
-X11-PRG ``fileset''.  This may be missing even if you specified ``all
+X11-PRG ``fileset.''  This may be missing even if you specified ``all
 filesets'' the first time.  If @file{libcurses.a} is missing, you may
 need to load the ``Berkeley Development Option.''
 
--- a/man/files.texi	Thu Aug 03 00:41:54 2006 +0000
+++ b/man/files.texi	Thu Aug 03 11:45:23 2006 +0000
@@ -2334,7 +2334,7 @@
   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
-treats each hunk location as an ``error message'', so that you can use
+treats each hunk location as an ``error message,'' so that you can use
 commands such as @kbd{C-x '} to visit the corresponding source
 locations.  It also provides the following commands to navigate,
 manipulate and apply parts of patches:
--- a/man/flymake.texi	Thu Aug 03 00:41:54 2006 +0000
+++ b/man/flymake.texi	Thu Aug 03 11:45:23 2006 +0000
@@ -17,7 +17,7 @@
 Permission is granted to copy, distribute and/or modify this document
 under the terms of the GNU Free Documentation License, Version 1.2 or
 any later version published by the Free Software Foundation; with no
-Invariant Sections, with the Front-Cover texts being ``A GNU Manual'',
+Invariant Sections, with the Front-Cover texts being ``A GNU Manual,''
 and with the Back-Cover Texts as in (a) below.  A copy of the license
 is included in the section entitled ``GNU Free Documentation License''
 in the Emacs manual.
--- a/man/forms.texi	Thu Aug 03 00:41:54 2006 +0000
+++ b/man/forms.texi	Thu Aug 03 11:45:23 2006 +0000
@@ -26,7 +26,7 @@
 under the terms of the GNU Free Documentation License, Version 1.2 or
 any later version published by the Free Software Foundation; with no
 Invariant Sections, with the Front-Cover texts being ``A GNU
-Manual'', and with the Back-Cover Texts as in (a) below.  A copy of the
+Manual,'' and with the Back-Cover Texts as in (a) below.  A copy of the
 license is included in the section entitled ``GNU Free Documentation
 License'' in the Emacs manual.
 
--- a/man/fortran-xtra.texi	Thu Aug 03 00:41:54 2006 +0000
+++ b/man/fortran-xtra.texi	Thu Aug 03 11:45:23 2006 +0000
@@ -179,7 +179,7 @@
 @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'',
+continuation @dfn{tab format}.  (Fortran90 introduced ``free format,''
 with another style of continuation lines).
 
 @vindex indent-tabs-mode @r{(Fortran mode)}
--- a/man/frames.texi	Thu Aug 03 00:41:54 2006 +0000
+++ b/man/frames.texi	Thu Aug 03 11:45:23 2006 +0000
@@ -547,12 +547,18 @@
 how the system (or the window manager) generally handles
 focus-switching between windows.  There are two possibilities: either
 simply moving the mouse onto a window selects it (gives it focus), or
-you have to click on it in a suitable way to do so.  Unfortunately
-there is no way Emacs can find out automatically which way the system
-handles this, so you have to explicitly say, by setting the variable
-@code{focus-follows-mouse}.  If just moving the mouse onto a window
-selects it, that variable should be @code{t}; if a click is necessary,
-the variable should be @code{nil}.
+you have to click on it in a suitable way to do so.  On X, this focus
+policy also affects whether the focus is given to a frame that Emacs
+raises.  Unfortunately there is no way Emacs can find out
+automatically which way the system handles this, so you have to
+explicitly say, by setting the variable @code{focus-follows-mouse}.
+If just moving the mouse onto a window selects it, that variable
+should be @code{t}; if a click is necessary, the variable should be
+@code{nil}.
+
+The window manager that is part of MS-Windows always gives focus to a
+frame that raises, so this variable has no effect in the native
+MS-Windows build of Emacs.
 
 @node Speedbar
 @section Speedbar Frames
--- a/man/glossary.texi	Thu Aug 03 00:41:54 2006 +0000
+++ b/man/glossary.texi	Thu Aug 03 11:45:23 2006 +0000
@@ -665,7 +665,7 @@
 @item Keyboard Shortcut
 A keyboard shortcut is a key sequence (q.v.@:) which invokes a
 command.  What some programs call ``assigning a keyboard shortcut,''
-Emacs calls ``binding a key sequence''.  See `binding.'
+Emacs calls ``binding a key sequence.''  See `binding.'
 
 @item Key Sequence
 A key sequence (key, for short) is a sequence of input events (q.v.@:)
--- a/man/gnus.texi	Thu Aug 03 00:41:54 2006 +0000
+++ b/man/gnus.texi	Thu Aug 03 11:45:23 2006 +0000
@@ -9372,11 +9372,15 @@
 
 @item gnus-article-emulate-mime
 @vindex gnus-article-emulate-mime
+@cindex uuencode
+@cindex yEnc
 There are other, non-@acronym{MIME} encoding methods used.  The most common
 is @samp{uuencode}, but yEncode is also getting to be popular.  If
 this variable is non-@code{nil}, Gnus will look in message bodies to
 see if it finds these encodings, and if so, it'll run them through the
-Gnus @acronym{MIME} machinery.  The default is @code{t}.
+Gnus @acronym{MIME} machinery.  The default is @code{t}.  Only
+single-part yEnc encoded attachments can be decoded.  There's no support
+for encoding in Gnus.
 
 @item gnus-unbuttonized-mime-types
 @vindex gnus-unbuttonized-mime-types
@@ -26075,6 +26079,14 @@
 isn't save in general.
 
 @item
+Lisp files are now installed in @file{.../site-lisp/gnus/} by default.
+It defaulted to @file{.../site-lisp/} formerly.  In addition to this,
+the new installer issues a warning if other Gnus installations which
+will shadow the latest one are detected.  You can then remove those
+shadows manually or remove them using @code{make
+remove-installed-shadows}.
+
+@item
 New @file{make.bat} for compiling and installing Gnus under MS Windows
 
 Use @file{make.bat} if you want to install Gnus under MS Windows, the
--- a/man/help.texi	Thu Aug 03 00:41:54 2006 +0000
+++ b/man/help.texi	Thu Aug 03 11:45:23 2006 +0000
@@ -251,6 +251,8 @@
 @kbd{C-h f} command if you don't really want to view the
 documentation.
 
+@kindex C-h v
+@findex describe-variable
   @kbd{C-h v} (@code{describe-variable}) is like @kbd{C-h f} but
 describes Lisp variables instead of Lisp functions.  Its default is
 the Lisp symbol around or before point, if that is the name of a
--- a/man/info.texi	Thu Aug 03 00:41:54 2006 +0000
+++ b/man/info.texi	Thu Aug 03 11:45:23 2006 +0000
@@ -22,7 +22,7 @@
 under the terms of the GNU Free Documentation License, Version 1.2 or
 any later version published by the Free Software Foundation; with no
 Invariant Sections, with the Front-Cover texts being ``A GNU
-Manual'', and with the Back-Cover Texts as in (a) below.  A copy of the
+Manual,'' and with the Back-Cover Texts as in (a) below.  A copy of the
 license is included in the section entitled ``GNU Free Documentation
 License'' in the Emacs manual.
 
@@ -687,7 +687,7 @@
 change its appearance (usually, its background color will change), and
 the shape of the mouse pointer will change if your platform supports
 that.  After a while, if you leave the mouse on that spot, a small
-window will pop up, saying ``Mouse-2: go to that node'', or the same
+window will pop up, saying ``Mouse-2: go to that node,'' or the same
 message may appear at the bottom of the screen.
 
   @kbd{Mouse-2} is the second button of your mouse counting from the
@@ -1002,8 +1002,8 @@
 if you are not sure how they are spelled in the index.  For example,
 suppose you want to find something that is pertinent to commands which
 complete partial input (e.g., when you type @key{TAB}).  If you want
-to catch index entries that refer to ``complete'', ``completion'', and
-``completing'', you could type @kbd{icomplet@key{RET}}.
+to catch index entries that refer to ``complete,'' ``completion,'' and
+``completing,'' you could type @kbd{icomplet@key{RET}}.
 
   Info documents which describe programs should index the commands,
 options, and key sequences that the program provides.  If you are
@@ -1264,7 +1264,7 @@
 what appears after the @samp{Node: } in that node's first line.  For
 example, this node's name is @samp{Add}.  A node in another file is
 named by @samp{(@var{filename})@var{node-within-file}}, as in
-@samp{(info)Add} for this node.  If the file name starts with ``./'',
+@samp{(info)Add} for this node.  If the file name starts with @samp{./},
 then it is relative to the current directory; otherwise, it is
 relative starting from the standard directory for Info files of your
 site.  The name @samp{(@var{filename})Top} can be abbreviated to just
@@ -1322,7 +1322,7 @@
 the beginning of each item name which is the minimum acceptable
 abbreviation for it (a long menu is more than 5 or so entries).
 
-  The nodes listed in a node's menu are called its ``subnodes'', and it
+  The nodes listed in a node's menu are called its ``subnodes,'' and it
 is their ``superior''.  They should each have an @samp{Up:} pointing at
 the superior.  It is often useful to arrange all or most of the subnodes
 in a sequence of @samp{Next} and @samp{Previous} pointers so that
@@ -1336,7 +1336,7 @@
 files in that directory are not automatically listed in the Info
 Directory node.
 
-  Also, although the Info node graph is claimed to be a ``hierarchy'',
+  Also, although the Info node graph is claimed to be a ``hierarchy,''
 in fact it can be @emph{any} directed graph.  Shared structures and
 pointer cycles are perfectly possible, and can be used if they are
 appropriate to the meaning to be expressed.  There is no need for all
--- a/man/killing.texi	Thu Aug 03 00:41:54 2006 +0000
+++ b/man/killing.texi	Thu Aug 03 11:45:23 2006 +0000
@@ -293,7 +293,7 @@
 (@code{yank-pop}).
 @item M-w
 Save region as last killed text without actually killing it
-(@code{kill-ring-save}).  Some systems call this ``copying''.
+(@code{kill-ring-save}).  Some systems call this ``copying.''
 @item C-M-w
 Append next kill to last batch of killed text (@code{append-next-kill}).
 @end table
--- a/man/kmacro.texi	Thu Aug 03 00:41:54 2006 +0000
+++ b/man/kmacro.texi	Thu Aug 03 11:45:23 2006 +0000
@@ -173,7 +173,7 @@
 @node Keyboard Macro Ring
 @section The Keyboard Macro Ring
 
-  All defined keyboard macros are recorded in the ``keyboard macro ring'',
+  All defined keyboard macros are recorded in the ``keyboard macro ring,''
 a list of sequences of keys.  There is only one keyboard macro ring,
 shared by all buffers.
 
--- a/man/mark.texi	Thu Aug 03 00:41:54 2006 +0000
+++ b/man/mark.texi	Thu Aug 03 11:45:23 2006 +0000
@@ -139,21 +139,23 @@
   On a terminal that supports colors, Emacs has the ability to
 highlight the current region.  But normally it does not.  Why not?
 
-  Once you have set the mark in a buffer, there is @emph{always} a
-region in that buffer.  This is because every command that sets the
-mark also activates it, and nothing ever deactivates it.  Highlighting
-the region all the time would be a nuisance.  So normally Emacs
-highlights the region only immediately after you have selected one
-with the mouse.
+  In the normal mode of use, every command that sets the mark also
+activates it, and nothing ever deactivates it.  Thus, once you have
+set the mark in a buffer, there is @emph{always} a region in that
+buffer.  Highlighting the region all the time would be a nuisance.  So
+normally Emacs highlights the region only immediately after you have
+selected one with the mouse.
 
   If you want region highlighting, you can use Transient Mark mode.
-This is a more rigid mode of operation in which the region always
-``lasts'' only until you use it; you explicitly must set up a region
-for each command that uses one.  In Transient Mark mode, most of the
-time there is no region; therefore, highlighting the region when it
-exists is useful and not annoying.  When Transient Mark mode is
-enabled, Emacs always highlights the region whenever there is a
-region.
+This is a more rigid mode of operation in which the region ``lasts''
+only until you use it; operating on the region text deactivates the
+mark, so there is no region any more.  Therefore, you must explicitly
+set up a region for each command that uses one.
+
+  When Transient Mark mode is enabled, Emacs highlights the region,
+whenever there is a region.  In Transient Mark mode, most of the time
+there is no region; therefore, highlighting the region when it exists
+is useful and not annoying.
 
 @findex transient-mark-mode
   To enable Transient Mark mode, type @kbd{M-x transient-mark-mode}.
--- a/man/misc.texi	Thu Aug 03 00:41:54 2006 +0000
+++ b/man/misc.texi	Thu Aug 03 11:45:23 2006 +0000
@@ -2377,7 +2377,7 @@
   To enter Tumme, type @kbd{M-x tumme}.  It prompts for a directory;
 specify one that has images files.  This creates thumbnails for all
 the images in that directory, and displays them all in the ``thumbnail
-buffer''.  This takes a long time if the directory contains many image
+buffer.''  This takes a long time if the directory contains many image
 files, and it asks for confirmation if the number of image files
 exceeds @code{tumme-show-all-from-dir-max-files}.
 
--- a/man/org.texi	Thu Aug 03 00:41:54 2006 +0000
+++ b/man/org.texi	Thu Aug 03 11:45:23 2006 +0000
@@ -2160,7 +2160,7 @@
 
 The second possibility is to use TODO keywords to indicate different
 types of action items.  For example, you might want to indicate that
-items are for ``work'' or ``home''.  If you are into David Allen's
+items are for ``work'' or ``home.''  If you are into David Allen's
 @emph{Getting Things DONE}, you might want to use todo types
 @samp{NEXTACTION}, @samp{WAITING}, @samp{MAYBE}.  Or, when you work
 with several people on a single project, you might want to assign
--- a/man/pgg.texi	Thu Aug 03 00:41:54 2006 +0000
+++ b/man/pgg.texi	Thu Aug 03 11:45:23 2006 +0000
@@ -17,7 +17,7 @@
 any later version published by the Free Software Foundation; with no
 Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
 Texts.  A copy of the license is included in the section entitled ``GNU
-Free Documentation License''.
+Free Documentation License.''
 @end quotation
 @end copying
 
--- a/man/programs.texi	Thu Aug 03 00:41:54 2006 +0000
+++ b/man/programs.texi	Thu Aug 03 11:45:23 2006 +0000
@@ -1117,7 +1117,7 @@
 for a file name.
 
   If you use @kbd{C-h S} in a major mode that does not support it,
-it asks you to specify the ``symbol help mode''.  You should enter
+it asks you to specify the ``symbol help mode.''  You should enter
 a command such as @code{c-mode} that would select a major
 mode which @kbd{C-h S} does support.
 
--- a/man/search.texi	Thu Aug 03 00:41:54 2006 +0000
+++ b/man/search.texi	Thu Aug 03 11:45:23 2006 +0000
@@ -208,15 +208,15 @@
 
 @node Non-ASCII Isearch
 @subsection Isearch for Non-@acronym{ASCII} Characters
-
 @cindex searching for non-@acronym{ASCII} characters
 @cindex input method, during incremental search
 
   To enter non-@acronym{ASCII} characters in an incremental search,
-you must use an input method (@pxref{Input Methods}).  If an input
-method is enabled in the current buffer when you start the search, you
-can use it while you type the search string also.  Emacs indicates
-that by including the input method mnemonic in its prompt, like this:
+you can use @kbd{C-q} (see the previous section), but it is easier to
+use an input method (@pxref{Input Methods}).  If an input method is
+enabled in the current buffer when you start the search, you can use
+it in the search string also.  Emacs indicates that by including the
+input method mnemonic in its prompt, like this:
 
 @example
 I-search [@var{im}]:
@@ -225,10 +225,11 @@
 @noindent
 @findex isearch-toggle-input-method
 @findex isearch-toggle-specified-input-method
-where @var{im} is the mnemonic of the active input method.  You can
-toggle (enable or disable) the input method while you type the search
-string with @kbd{C-\} (@code{isearch-toggle-input-method}).  You can
-turn on a certain (non-default) input method with @kbd{C-^}
+where @var{im} is the mnemonic of the active input method.
+
+  You can toggle (enable or disable) the input method while you type
+the search string with @kbd{C-\} (@code{isearch-toggle-input-method}).
+You can turn on a certain (non-default) input method with @kbd{C-^}
 (@code{isearch-toggle-specified-input-method}), which prompts for the
 name of the input method.  The input method you enable during
 incremental search remains enabled in the current buffer afterwards.
@@ -1010,7 +1011,7 @@
 @samp{\&} in @var{newstring} stands for the entire match being
 replaced.  @samp{\@var{d}} in @var{newstring}, where @var{d} is a
 digit, stands for whatever matched the @var{d}th parenthesized
-grouping in @var{regexp}.  (This is called a ``back reference''.)
+grouping in @var{regexp}.  (This is called a ``back reference.'')
 @samp{\#} refers to the count of replacements already made in this
 command, as a decimal number.  In the first replacement, @samp{\#}
 stands for @samp{0}; in the second, for @samp{1}; and so on.  For
@@ -1240,8 +1241,10 @@
 used the minibuffer to read its arguments.  @xref{Repetition, C-x ESC
 ESC}.
 
-  See also @ref{Transforming File Names}, for Dired commands to rename,
-copy, or link files by replacing regexp matches in file names.
+  @xref{Operating on Files}, for the Dired @kbd{Q} command which
+performs query replace on selected files.  See also @ref{Transforming
+File Names}, for Dired commands to rename, copy, or link files by
+replacing regexp matches in file names.
 
 @node Other Repeating Search
 @section Other Search-and-Loop Commands
--- a/man/xresmini.texi	Thu Aug 03 00:41:54 2006 +0000
+++ b/man/xresmini.texi	Thu Aug 03 11:45:23 2006 +0000
@@ -11,12 +11,12 @@
 @xref{MS-Windows Registry}.  Likewise, Emacs on MacOS Carbon emulates X
 resources using the Preferences system.  @xref{Mac Environment Variables}.
 
-  When Emacs is built using an ``X toolkit'', such as Lucid or
+  When Emacs is built using an ``X toolkit,'' such as Lucid or
 LessTif, you need to use X resources to customize the appearance of
 the widgets, including the menu-bar, scroll-bar, and dialog boxes.
 This is because the libraries that implement these don't provide for
 customization through Emacs.  GTK+ widgets use a separate system of
-``GTK resources''.  In this chapter we describe the most commonly used
+``GTK resources.''  In this chapter we describe the most commonly used
 resource specifications.  For full documentation, see the online
 manual.
 
--- a/man/xresources.texi	Thu Aug 03 00:41:54 2006 +0000
+++ b/man/xresources.texi	Thu Aug 03 11:45:23 2006 +0000
@@ -951,7 +951,7 @@
 0-65535 or floats in the range 0.0-1.0.
 
   Pango font names have the form ``@var{family-list} @var{style-options}
-@var{size}''.
+@var{size}.''
 @cindex Pango font name
 @noindent
 @var{family-list} is a comma separated list of font families optionally
@@ -964,7 +964,7 @@
 @end smallexample
 
 @noindent
-the family name is ``times''.
+the family name is @samp{times}.
 
 @noindent
 @var{style-options} is a whitespace separated list of words where each word
--- a/nt/ChangeLog	Thu Aug 03 00:41:54 2006 +0000
+++ b/nt/ChangeLog	Thu Aug 03 11:45:23 2006 +0000
@@ -1,3 +1,7 @@
+2006-07-27  Jason Rumney  <jasonr@gnu.org>
+
+	* INSTALL: Add notes about Cygwin make to impatient section.
+
 2006-06-02  Eli Zaretskii  <eliz@gnu.org>
 
 	* INSTALL: Add Make 3.81 to the list of Make & shell combinations
--- a/nt/INSTALL	Thu Aug 03 00:41:54 2006 +0000
+++ b/nt/INSTALL	Thu Aug 03 11:45:23 2006 +0000
@@ -31,16 +31,19 @@
        nmake
 
      For the development environments based on GNU GCC (MinGW, MSYS,
-     Cygwin), depending on how Make is called, it could be:
+     Cygwin - but see notes about Cygwin make below), depending on how
+     Make is called, it could be:
 
        make
      or
+       mingw32-make
+     or
        gnumake
      or
        gmake
 
      (If you are building from CVS, say "make bootstrap" or "nmake
-     bootstrap" instead.)
+     bootstrap" instead and avoid using Cygwin make.)
 
   4. Generate the Info manuals (only if you are building out of CVS, and
      if you have makeinfo.exe installed):
--- a/src/ChangeLog	Thu Aug 03 00:41:54 2006 +0000
+++ b/src/ChangeLog	Thu Aug 03 11:45:23 2006 +0000
@@ -1,3 +1,84 @@
+2006-08-01  Kim F. Storm  <storm@cua.dk>
+
+	* process.c (wait_reading_process_output_unwind): New function.
+	Restores waiting_for_user_input_p to saved value.
+	(wait_reading_process_output): Unwind protect waiting_for_user_input_p
+	instead of save/restore old value on stack.
+
+2006-07-30  Thien-Thi Nguyen  <ttn@gnu.org>
+
+	* editfns.c: Undo 2006-06-27 change.
+
+2006-07-29  Eli Zaretskii  <eliz@gnu.org>
+
+	* coding.c (Ffind_operation_coding_system): Revert the change from
+	2006-05-29.
+
+	* alloc.c [WINDOWSNT]: Include fcntl.h, to fix last change.
+
+2006-07-28  Richard Stallman  <rms@gnu.org>
+
+	* xfaces.c (lookup_named_face, Fdisplay_supports_face_attributes_p):
+	Add conditional aborts for clarity.
+
+	* xdisp.c (update_menu_bar): New arg HOOKS_RUN.  Callers changed.
+	Used to avoid running the hooks over and over for each frame.
+	(prepare_menu_bars): Pass value from update_menu_bar
+	as HOOKS_RUN of next call.
+
+	* keyboard.c (safe_run_hooks_1): Don't crash if Vrun_hooks is nil.
+
+2006-07-28  Kim F. Storm  <storm@cua.dk>
+
+	* alloc.c (valid_pointer_p): New function (from valid_lisp_object_p).
+	(valid_lisp_object_p): Use it to check for valid SUBRP obj.
+
+2006-07-26  Chong Yidong  <cyd@stupidchicken.com>
+
+	* keyboard.c (read_char): New arg END_TIME specifying timeout.
+	All callers changed.  Turn off echoing if END_TIME is non-NULL.
+	(kbd_buffer_get_event): New arg END_TIME.
+
+	* lread.c (read_filtered_event): New arg SECONDS to wait until.
+	(Fread_char, Fread_event, Fread_char_exclusive): New arg SECONDS.
+
+	* lisp.h: Update read-char, read-event, and read_filtered_event
+	prototypes.
+
+	* keyboard.h: Include systime.h.  Update read_char prototype.
+
+2006-07-25  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+	* alloc.c (find_string_data_in_pure): New function.
+	(make_pure_string): Use it to reuse existing string data if possible.
+
+	* puresize.h (BASE_PURESIZE): Decrease to 1102000.
+
+2006-07-22  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* keymap.c (Fdefine_key): If the key binding definition looks like an
+	XEmacs-style key sequence, convert it to Emacs's format.
+
+2006-07-22  Ralf Angeli  <angeli@caeruleus.net>
+
+	* w32fns.c (w32_createwindow): If `left' and/or `top' frame
+	parameters are bound to some values, use that instead of
+	CW_USEDEFAULT.
+
+2006-07-21  Eli Zaretskii  <eliz@gnu.org>
+
+	* w32.c (convert_time): Use explicit long double constants to
+	ensure long double arithmetics is used throughout.
+
+2006-07-20  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+	* alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp): New	vars.
+	(init_alloc_once): Initialize them.
+	(pure_alloc): Allocate non-Lisp objects from the end of pure storage
+	without alignment.
+
+	* puresize.h (BASE_PURESIZE): Decrease to 1141000.
+
 2006-07-18  Francis Litterio  <franl@world.std.com>
 
 	* w32term.c (x_calc_absolute_position): Fix frame positioning
@@ -131,6 +212,14 @@
 	(mac_initialize_display_info) [MAC_OSX]: Use CGDisplaySamplesPerPixel.
 	(x_delete_display): Apply 2006-07-04 change for xterm.c.
 
+2006-07-17  Richard Stallman  <rms@gnu.org>
+
+	* keyboard.c (Vcommand_error_function): New variable.
+	(syms_of_keyboard): Defvar it.
+	(cmd_error_internal): Simplify, and handle Vcommand_error_function.
+
+	* dispnew.c (init_display): Mention DISPLAY as well as TERM in err msg.
+
 2006-07-17  Kim F. Storm  <storm@cua.dk>
 
 	* xdisp.c (handle_single_display_spec): Ensure the right value of
--- a/src/alloc.c	Thu Aug 03 00:41:54 2006 +0000
+++ b/src/alloc.c	Thu Aug 03 11:45:23 2006 +0000
@@ -78,6 +78,10 @@
 #define O_WRONLY 1
 #endif
 
+#ifdef WINDOWSNT
+#include <fcntl.h>
+#endif
+
 #ifdef DOUG_LEA_MALLOC
 
 #include <malloc.h>
@@ -289,10 +293,18 @@
       && ((PNTR_COMPARISON_TYPE) (P)				\
 	  >= (PNTR_COMPARISON_TYPE) purebeg))
 
-/* Index in pure at which next pure object will be allocated.. */
+/* Total number of bytes allocated in pure storage. */
 
 EMACS_INT pure_bytes_used;
 
+/* Index in pure at which next pure Lisp object will be allocated.. */
+
+static EMACS_INT pure_bytes_used_lisp;
+
+/* Number of bytes allocated for non-Lisp objects in pure storage.  */
+
+static EMACS_INT pure_bytes_used_non_lisp;
+
 /* If nonzero, this is a warning delivered by malloc and not yet
    displayed.  */
 
@@ -4555,6 +4567,28 @@
 #endif /* GC_MARK_STACK != 0 */
 
 
+/* Determine whether it is safe to access memory at address P.  */
+int
+valid_pointer_p (p)
+     void *p;
+{
+  int fd;
+
+  /* Obviously, we cannot just access it (we would SEGV trying), so we
+     trick the o/s to tell us whether p is a valid pointer.
+     Unfortunately, we cannot use NULL_DEVICE here, as emacs_write may
+     not validate p in that case.  */
+
+  if ((fd = emacs_open ("__Valid__Lisp__Object__", O_CREAT | O_WRONLY | O_TRUNC, 0666)) >= 0)
+    {
+      int valid = (emacs_write (fd, (char *)p, 16) == 16);
+      emacs_close (fd);
+      unlink ("__Valid__Lisp__Object__");
+      return valid;
+    }
+
+    return -1;
+}
 
 /* Return 1 if OBJ is a valid lisp object.
    Return 0 if OBJ is NOT a valid lisp object.
@@ -4567,9 +4601,7 @@
      Lisp_Object obj;
 {
   void *p;
-#if !GC_MARK_STACK
-  int fd;
-#else
+#if GC_MARK_STACK
   struct mem_node *m;
 #endif
 
@@ -4581,26 +4613,22 @@
     return 1;
 
 #if !GC_MARK_STACK
-  /* We need to determine whether it is safe to access memory at
-     address P.  Obviously, we cannot just access it (we would SEGV
-     trying), so we trick the o/s to tell us whether p is a valid
-     pointer.  Unfortunately, we cannot use NULL_DEVICE here, as
-     emacs_write may not validate p in that case.  */
-  if ((fd = emacs_open ("__Valid__Lisp__Object__", O_CREAT | O_WRONLY | O_TRUNC, 0666)) >= 0)
-    {
-      int valid = (emacs_write (fd, (char *)p, 16) == 16);
-      emacs_close (fd);
-      unlink ("__Valid__Lisp__Object__");
-      return valid;
-    }
-
-    return -1;
+  return valid_pointer_p (p);
 #else
 
   m = mem_find (p);
 
   if (m == MEM_NIL)
-    return 0;
+    {
+      int valid = valid_pointer_p (p);
+      if (valid <= 0)
+	return valid;
+
+      if (SUBRP (obj))
+	return 1;
+
+      return 0;
+    }
 
   switch (m->type)
     {
@@ -4649,10 +4677,7 @@
 
 /* Allocate room for SIZE bytes from pure Lisp storage and return a
    pointer to it.  TYPE is the Lisp type for which the memory is
-   allocated.  TYPE < 0 means it's not used for a Lisp object.
-
-   If store_pure_type_info is set and TYPE is >= 0, the type of
-   the allocated object is recorded in pure_types.  */
+   allocated.  TYPE < 0 means it's not used for a Lisp object.  */
 
 static POINTER_TYPE *
 pure_alloc (size, type)
@@ -4677,8 +4702,21 @@
 #endif
 
  again:
-  result = ALIGN (purebeg + pure_bytes_used, alignment);
-  pure_bytes_used = ((char *)result - (char *)purebeg) + size;
+  if (type >= 0)
+    {
+      /* Allocate space for a Lisp object from the beginning of the free
+	 space with taking account of alignment.  */
+      result = ALIGN (purebeg + pure_bytes_used_lisp, alignment);
+      pure_bytes_used_lisp = ((char *)result - (char *)purebeg) + size;
+    }
+  else
+    {
+      /* Allocate space for a non-Lisp object from the end of the free
+	 space.  */
+      pure_bytes_used_non_lisp += size;
+      result = purebeg + pure_size - pure_bytes_used_non_lisp;
+    }
+  pure_bytes_used = pure_bytes_used_lisp + pure_bytes_used_non_lisp;
 
   if (pure_bytes_used <= pure_size)
     return result;
@@ -4690,6 +4728,7 @@
   pure_size = 10000;
   pure_bytes_used_before_overflow += pure_bytes_used - size;
   pure_bytes_used = 0;
+  pure_bytes_used_lisp = pure_bytes_used_non_lisp = 0;
   goto again;
 }
 
@@ -4705,6 +4744,73 @@
 }
 
 
+/* Find the byte sequence {DATA[0], ..., DATA[NBYTES-1], '\0'} from
+   the non-Lisp data pool of the pure storage, and return its start
+   address.  Return NULL if not found.  */
+
+static char *
+find_string_data_in_pure (data, nbytes)
+     char *data;
+     int nbytes;
+{
+  int i, skip, bm_skip[256], last_char_skip, infinity, start, start_max;
+  unsigned char *p;
+  char *non_lisp_beg;
+
+  if (pure_bytes_used_non_lisp < nbytes + 1)
+    return NULL;
+
+  /* Set up the Boyer-Moore table.  */
+  skip = nbytes + 1;
+  for (i = 0; i < 256; i++)
+    bm_skip[i] = skip;
+
+  p = (unsigned char *) data;
+  while (--skip > 0)
+    bm_skip[*p++] = skip;
+
+  last_char_skip = bm_skip['\0'];
+
+  non_lisp_beg = purebeg + pure_size - pure_bytes_used_non_lisp;
+  start_max = pure_bytes_used_non_lisp - (nbytes + 1);
+
+  /* See the comments in the function `boyer_moore' (search.c) for the
+     use of `infinity'.  */
+  infinity = pure_bytes_used_non_lisp + 1;
+  bm_skip['\0'] = infinity;
+
+  p = (unsigned char *) non_lisp_beg + nbytes;
+  start = 0;
+  do
+    {
+      /* Check the last character (== '\0').  */
+      do
+	{
+	  start += bm_skip[*(p + start)];
+	}
+      while (start <= start_max);
+
+      if (start < infinity)
+	/* Couldn't find the last character.  */
+	return NULL;
+
+      /* No less than `infinity' means we could find the last
+	 character at `p[start - infinity]'.  */
+      start -= infinity;
+
+      /* Check the remaining characters.  */
+      if (memcmp (data, non_lisp_beg + start, nbytes) == 0)
+	/* Found.  */
+	return non_lisp_beg + start;
+
+      start += last_char_skip;
+    }
+  while (start <= start_max);
+
+  return NULL;
+}
+
+
 /* Return a string allocated in pure space.  DATA is a buffer holding
    NCHARS characters, and NBYTES bytes of string data.  MULTIBYTE
    non-zero means make the result string multibyte.
@@ -4723,11 +4829,15 @@
   struct Lisp_String *s;
 
   s = (struct Lisp_String *) pure_alloc (sizeof *s, Lisp_String);
-  s->data = (unsigned char *) pure_alloc (nbytes + 1, -1);
+  s->data = find_string_data_in_pure (data, nbytes);
+  if (s->data == NULL)
+    {
+      s->data = (unsigned char *) pure_alloc (nbytes + 1, -1);
+      bcopy (data, s->data, nbytes);
+      s->data[nbytes] = '\0';
+    }
   s->size = nchars;
   s->size_byte = multibyte ? nbytes : -1;
-  bcopy (data, s->data, nbytes);
-  s->data[nbytes] = '\0';
   s->intervals = NULL_INTERVAL;
   XSETSTRING (string, s);
   return string;
@@ -6182,6 +6292,7 @@
   purebeg = PUREBEG;
   pure_size = PURESIZE;
   pure_bytes_used = 0;
+  pure_bytes_used_lisp = pure_bytes_used_non_lisp = 0;
   pure_bytes_used_before_overflow = 0;
 
   /* Initialize the list of free aligned blocks.  */
--- a/src/callint.c	Thu Aug 03 00:41:54 2006 +0000
+++ b/src/callint.c	Thu Aug 03 11:45:23 2006 +0000
@@ -563,7 +563,7 @@
 	  break;
 
         case 'c':		/* Character */
-	  args[i] = Fread_char (build_string (callint_message), Qnil);
+	  args[i] = Fread_char (build_string (callint_message), Qnil, Qnil);
 	  message1_nolog ((char *) 0);
 	  /* Passing args[i] directly stimulates compiler bug */
 	  teml = args[i];
@@ -635,7 +635,7 @@
 		/* Ignore first element, which is the base key.  */
 		tem2 = Fmemq (intern ("down"), Fcdr (teml));
 		if (! NILP (tem2))
-		  up_event = Fread_event (Qnil, Qnil);
+		  up_event = Fread_event (Qnil, Qnil, Qnil);
 	      }
 	  }
 	  break;
@@ -663,7 +663,7 @@
 		/* Ignore first element, which is the base key.  */
 		tem2 = Fmemq (intern ("down"), Fcdr (teml));
 		if (! NILP (tem2))
-		  up_event = Fread_event (Qnil, Qnil);
+		  up_event = Fread_event (Qnil, Qnil, Qnil);
 	      }
 	  }
 	  break;
--- a/src/coding.c	Thu Aug 03 00:41:54 2006 +0000
+++ b/src/coding.c	Thu Aug 03 11:45:23 2006 +0000
@@ -8390,7 +8390,10 @@
 	    return Fcons (val, val);
 	  if (! NILP (Ffboundp (val)))
 	    {
-	      val = safe_call1 (val, Flist (nargs, args));
+	      /* We use call1 rather than safe_call1
+		 so as to get bug reports about functions called here
+		 which don't handle the current interface.  */
+	      val = call1 (val, Flist (nargs, args));
 	      if (CONSP (val))
 		return val;
 	      if (SYMBOLP (val) && ! NILP (Fcoding_system_p (val)))
--- a/src/editfns.c	Thu Aug 03 00:41:54 2006 +0000
+++ b/src/editfns.c	Thu Aug 03 11:45:23 2006 +0000
@@ -627,10 +627,7 @@
 DEFUN ("delete-field", Fdelete_field, Sdelete_field, 0, 1, 0,
        doc: /* Delete the field surrounding POS.
 A field is a region of text with the same `field' property.
-If POS is nil, the value of point is used for POS.
-
-An `args-out-of-range' error is signaled if POS is outside the
-buffer's accessible portion.  */)
+If POS is nil, the value of point is used for POS.  */)
      (pos)
      Lisp_Object pos;
 {
@@ -644,10 +641,7 @@
 DEFUN ("field-string", Ffield_string, Sfield_string, 0, 1, 0,
        doc: /* Return the contents of the field surrounding POS as a string.
 A field is a region of text with the same `field' property.
-If POS is nil, the value of point is used for POS.
-
-An `args-out-of-range' error is signaled if POS is outside the
-buffer's accessible portion.  */)
+If POS is nil, the value of point is used for POS.  */)
      (pos)
      Lisp_Object pos;
 {
@@ -659,10 +653,7 @@
 DEFUN ("field-string-no-properties", Ffield_string_no_properties, Sfield_string_no_properties, 0, 1, 0,
        doc: /* Return the contents of the field around POS, without text-properties.
 A field is a region of text with the same `field' property.
-If POS is nil, the value of point is used for POS.
-
-An `args-out-of-range' error is signaled if POS is outside the
-buffer's accessible portion.  */)
+If POS is nil, the value of point is used for POS.  */)
      (pos)
      Lisp_Object pos;
 {
@@ -678,10 +669,7 @@
 If ESCAPE-FROM-EDGE is non-nil and POS is at the beginning of its
 field, then the beginning of the *previous* field is returned.
 If LIMIT is non-nil, it is a buffer position; if the beginning of the field
-is before LIMIT, then LIMIT will be returned instead.
-
-An `args-out-of-range' error is signaled if POS is outside the
-buffer's accessible portion.  */)
+is before LIMIT, then LIMIT will be returned instead.  */)
      (pos, escape_from_edge, limit)
      Lisp_Object pos, escape_from_edge, limit;
 {
@@ -697,10 +685,7 @@
 If ESCAPE-FROM-EDGE is non-nil and POS is at the end of its field,
 then the end of the *following* field is returned.
 If LIMIT is non-nil, it is a buffer position; if the end of the field
-is after LIMIT, then LIMIT will be returned instead.
-
-An `args-out-of-range' error is signaled if POS is outside the
-buffer's accessible portion.  */)
+is after LIMIT, then LIMIT will be returned instead.  */)
      (pos, escape_from_edge, limit)
      Lisp_Object pos, escape_from_edge, limit;
 {
--- a/src/fns.c	Thu Aug 03 00:41:54 2006 +0000
+++ b/src/fns.c	Thu Aug 03 11:45:23 2006 +0000
@@ -2618,7 +2618,7 @@
 	  Fraise_frame (mini_frame);
 	}
 
-      obj = read_filtered_event (1, 0, 0, 0);
+      obj = read_filtered_event (1, 0, 0, 0, Qnil);
       cursor_in_echo_area = 0;
       /* If we need to quit, quit with cursor_in_echo_area = 0.  */
       QUIT;
--- a/src/keyboard.c	Thu Aug 03 00:41:54 2006 +0000
+++ b/src/keyboard.c	Thu Aug 03 11:45:23 2006 +0000
@@ -2032,6 +2032,8 @@
 safe_run_hooks_1 (hook)
      Lisp_Object hook;
 {
+  if (NILP (Vrun_hooks))
+    return Qnil;
   return call1 (Vrun_hooks, Vinhibit_quit);
 }
 
@@ -2385,15 +2387,20 @@
    if we used a mouse menu to read the input, or zero otherwise.  If
    USED_MOUSE_MENU is null, we don't dereference it.
 
+   If END_TIME is non-null, it is a pointer to an EMACS_TIME
+   specifying the maximum time to wait until.  If no input arrives by
+   that time, stop waiting and return nil.
+
    Value is t if we showed a menu and the user rejected it.  */
 
 Lisp_Object
-read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu)
+read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time)
      int commandflag;
      int nmaps;
      Lisp_Object *maps;
      Lisp_Object prev_event;
      int *used_mouse_menu;
+     EMACS_TIME *end_time;
 {
   volatile Lisp_Object c;
   int count;
@@ -2673,6 +2680,7 @@
      start echoing if enough time elapses.  */
 
   if (minibuf_level == 0
+      && !end_time
       && !current_kboard->immediate_echo
       && this_command_key_count > 0
       && ! noninteractive
@@ -2855,11 +2863,19 @@
     {
       KBOARD *kb;
 
+      if (end_time)
+	{
+	  EMACS_TIME now;
+	  EMACS_GET_TIME (now);
+	  if (EMACS_TIME_GE (now, *end_time))
+	    goto exit;
+	}
+
       /* Actually read a character, waiting if necessary.  */
       save_getcjmp (save_jump);
       restore_getcjmp (local_getcjmp);
       timer_start_idle ();
-      c = kbd_buffer_get_event (&kb, used_mouse_menu);
+      c = kbd_buffer_get_event (&kb, used_mouse_menu, end_time);
       restore_getcjmp (save_jump);
 
 #ifdef MULTI_KBOARD
@@ -3196,7 +3212,7 @@
 
       cancel_echoing ();
       do
-	c = read_char (0, 0, 0, Qnil, 0);
+	c = read_char (0, 0, 0, Qnil, 0, NULL);
       while (BUFFERP (c));
       /* Remove the help from the frame */
       unbind_to (count, Qnil);
@@ -3206,7 +3222,7 @@
 	{
 	  cancel_echoing ();
 	  do
-	    c = read_char (0, 0, 0, Qnil, 0);
+	    c = read_char (0, 0, 0, Qnil, 0, NULL);
 	  while (BUFFERP (c));
 	}
     }
@@ -3885,9 +3901,10 @@
    We always read and discard one event.  */
 
 static Lisp_Object
-kbd_buffer_get_event (kbp, used_mouse_menu)
+kbd_buffer_get_event (kbp, used_mouse_menu, end_time)
      KBOARD **kbp;
      int *used_mouse_menu;
+     EMACS_TIME *end_time;
 {
   register int c;
   Lisp_Object obj;
@@ -3931,13 +3948,24 @@
       if (!NILP (do_mouse_tracking) && some_mouse_moved ())
 	break;
 #endif
-      {
+      if (end_time)
+	{
+	  EMACS_TIME duration;
+	  EMACS_GET_TIME (duration);
+	  EMACS_SUB_TIME (duration, *end_time, duration);
+	  if (EMACS_TIME_NEG_P (duration))
+	    return Qnil;
+	  else
+	    wait_reading_process_output (EMACS_SECS (duration),
+					 EMACS_USECS (duration), 
+					 -1, 1, Qnil, NULL, 0);
+	}
+      else
 	wait_reading_process_output (0, 0, -1, 1, Qnil, NULL, 0);
 
-	if (!interrupt_input && kbd_fetch_ptr == kbd_store_ptr)
-	  /* Pass 1 for EXPECT since we just waited to have input.  */
-	  read_avail_input (1);
-      }
+      if (!interrupt_input && kbd_fetch_ptr == kbd_store_ptr)
+	/* Pass 1 for EXPECT since we just waited to have input.  */
+	read_avail_input (1);
 #endif /* not VMS */
     }
 
@@ -8282,7 +8310,7 @@
       orig_defn_macro = current_kboard->defining_kbd_macro;
       current_kboard->defining_kbd_macro = Qnil;
       do
-	obj = read_char (commandflag, 0, 0, Qt, 0);
+	obj = read_char (commandflag, 0, 0, Qt, 0, NULL);
       while (BUFFERP (obj));
       current_kboard->defining_kbd_macro = orig_defn_macro;
 
@@ -8655,7 +8683,7 @@
   /* Read the first char of the sequence specially, before setting
      up any keymaps, in case a filter runs and switches buffers on us.  */
   first_event = read_char (NILP (prompt), 0, submaps, last_nonmenu_event,
-			   &junk);
+			   &junk, NULL);
 #endif /* GOBBLE_FIRST_EVENT */
 
   orig_local_map = get_local_map (PT, current_buffer, Qlocal_map);
@@ -8858,7 +8886,7 @@
 #endif
 	    key = read_char (NILP (prompt), nmaps,
 			     (Lisp_Object *) submaps, last_nonmenu_event,
-			     &used_mouse_menu);
+			     &used_mouse_menu, NULL);
 	  }
 
 	  /* read_char returns t when it shows a menu and the user rejects it.
--- a/src/keyboard.h	Thu Aug 03 00:41:54 2006 +0000
+++ b/src/keyboard.h	Thu Aug 03 11:45:23 2006 +0000
@@ -19,6 +19,8 @@
 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 Boston, MA 02110-1301, USA.  */
 
+#include "systime.h"		/* for EMACS_TIME */
+
 /* Length of echobuf field in each KBOARD.  */
 
 /* Each KBOARD represents one logical input stream from which Emacs gets input.
@@ -297,7 +299,8 @@
 
 extern Lisp_Object parse_modifiers P_ ((Lisp_Object));
 extern Lisp_Object reorder_modifiers P_ ((Lisp_Object));
-extern Lisp_Object read_char P_ ((int, int, Lisp_Object *, Lisp_Object, int *));
+extern Lisp_Object read_char P_ ((int, int, Lisp_Object *, Lisp_Object,
+				  int *, EMACS_TIME *));
 /* User-supplied string to translate input characters through.  */
 extern Lisp_Object Vkeyboard_translate_table;
 
--- a/src/keymap.c	Thu Aug 03 00:41:54 2006 +0000
+++ b/src/keymap.c	Thu Aug 03 11:45:23 2006 +0000
@@ -1172,6 +1172,20 @@
 
   meta_bit = VECTORP (key) ? meta_modifier : 0x80;
 
+  if (VECTORP (def) && ASIZE (def) > 0 && CONSP (AREF (def, make_number (0))))
+    { /* DEF is apparently an XEmacs-style keyboard macro.  */
+      Lisp_Object tmp = Fmake_vector (make_number (ASIZE (def)), Qnil);
+      int i = ASIZE (def);
+      while (--i >= 0)
+	{
+	  Lisp_Object c = AREF (def, i);
+	  if (CONSP (c) && lucid_event_type_list_p (c))
+	    c = Fevent_convert_list (c);
+	  ASET (tmp, i, c);
+	}
+      def = tmp;
+    }
+
   idx = 0;
   while (1)
     {
--- a/src/lisp.h	Thu Aug 03 00:41:54 2006 +0000
+++ b/src/lisp.h	Thu Aug 03 11:45:23 2006 +0000
@@ -2681,9 +2681,9 @@
 EXFUN (Fload, 5);
 EXFUN (Fget_load_suffixes, 0);
 EXFUN (Fget_file_char, 0);
-EXFUN (Fread_char, 2);
-EXFUN (Fread_event, 2);
-extern Lisp_Object read_filtered_event P_ ((int, int, int, int));
+EXFUN (Fread_char, 3);
+EXFUN (Fread_event, 3);
+extern Lisp_Object read_filtered_event P_ ((int, int, int, int, Lisp_Object));
 EXFUN (Feval_region, 4);
 extern Lisp_Object intern P_ ((const char *));
 extern Lisp_Object make_symbol P_ ((char *));
--- a/src/lread.c	Thu Aug 03 00:41:54 2006 +0000
+++ b/src/lread.c	Thu Aug 03 11:45:23 2006 +0000
@@ -630,14 +630,19 @@
    character.
 
    If INPUT_METHOD is nonzero, we invoke the current input method
-   if the character warrants that.  */
+   if the character warrants that.
+
+   If SECONDS is a number, we wait that many seconds for input, and
+   return Qnil if no input arrives within that time.  */
 
 Lisp_Object
 read_filtered_event (no_switch_frame, ascii_required, error_nonascii,
-		     input_method)
+		     input_method, seconds)
      int no_switch_frame, ascii_required, error_nonascii, input_method;
+     Lisp_Object seconds;
 {
   Lisp_Object val, delayed_switch_frame;
+  EMACS_TIME end_time;
 
 #ifdef HAVE_WINDOW_SYSTEM
   if (display_hourglass_p)
@@ -646,11 +651,24 @@
 
   delayed_switch_frame = Qnil;
 
+  /* Compute timeout.  */
+  if (NUMBERP (seconds))
+    {
+      EMACS_TIME wait_time;
+      int sec, usec;
+      double duration = extract_float (seconds); 	 
+
+      sec  = (int) duration;
+      usec = (duration - sec) * 1000000;
+      EMACS_GET_TIME (end_time);
+      EMACS_SET_SECS_USECS (wait_time, sec, usec);
+      EMACS_ADD_TIME (end_time, end_time, wait_time);
+    }
+
   /* Read until we get an acceptable event.  */
  retry:
-  val = read_char (0, 0, 0,
-		   (input_method ? Qnil : Qt),
-		   0);
+  val = read_char (0, 0, 0, (input_method ? Qnil : Qt), 0,
+		   NUMBERP (seconds) ? &end_time : NULL);
 
   if (BUFFERP (val))
     goto retry;
@@ -668,7 +686,7 @@
       goto retry;
     }
 
-  if (ascii_required)
+  if (ascii_required && !(NUMBERP (seconds) && NILP (val)))
     {
       /* Convert certain symbols to their ASCII equivalents.  */
       if (SYMBOLP (val))
@@ -713,7 +731,7 @@
   return val;
 }
 
-DEFUN ("read-char", Fread_char, Sread_char, 0, 2, 0,
+DEFUN ("read-char", Fread_char, Sread_char, 0, 3, 0,
        doc: /* Read a character from the command input (keyboard or macro).
 It is returned as a number.
 If the user generates an event which is not a character (i.e. a mouse
@@ -726,43 +744,55 @@
 If the optional argument PROMPT is non-nil, display that as a prompt.
 If the optional argument INHERIT-INPUT-METHOD is non-nil and some
 input method is turned on in the current buffer, that input method
-is used for reading a character.  */)
-     (prompt, inherit_input_method)
-     Lisp_Object prompt, inherit_input_method;
+is used for reading a character.
+If the optional argument SECONDS is non-nil, it should be a number
+specifying the maximum number of seconds to wait for input.  If no
+input arrives in that time, return nil.  SECONDS may be a
+floating-point value.  */)
+     (prompt, inherit_input_method, seconds)
+     Lisp_Object prompt, inherit_input_method, seconds;
 {
   if (! NILP (prompt))
     message_with_string ("%s", prompt, 0);
-  return read_filtered_event (1, 1, 1, ! NILP (inherit_input_method));
+  return read_filtered_event (1, 1, 1, ! NILP (inherit_input_method), seconds);
 }
 
-DEFUN ("read-event", Fread_event, Sread_event, 0, 2, 0,
+DEFUN ("read-event", Fread_event, Sread_event, 0, 3, 0,
        doc: /* Read an event object from the input stream.
 If the optional argument PROMPT is non-nil, display that as a prompt.
 If the optional argument INHERIT-INPUT-METHOD is non-nil and some
 input method is turned on in the current buffer, that input method
-is used for reading a character.  */)
-     (prompt, inherit_input_method)
-     Lisp_Object prompt, inherit_input_method;
+is used for reading a character.
+If the optional argument SECONDS is non-nil, it should be a number
+specifying the maximum number of seconds to wait for input.  If no
+input arrives in that time, return nil.  SECONDS may be a
+floating-point value.  */)
+     (prompt, inherit_input_method, seconds)
+     Lisp_Object prompt, inherit_input_method, seconds;
 {
   if (! NILP (prompt))
     message_with_string ("%s", prompt, 0);
-  return read_filtered_event (0, 0, 0, ! NILP (inherit_input_method));
+  return read_filtered_event (0, 0, 0, ! NILP (inherit_input_method), seconds);
 }
 
-DEFUN ("read-char-exclusive", Fread_char_exclusive, Sread_char_exclusive, 0, 2, 0,
+DEFUN ("read-char-exclusive", Fread_char_exclusive, Sread_char_exclusive, 0, 3, 0,
        doc: /* Read a character from the command input (keyboard or macro).
 It is returned as a number.  Non-character events are ignored.
 
 If the optional argument PROMPT is non-nil, display that as a prompt.
 If the optional argument INHERIT-INPUT-METHOD is non-nil and some
 input method is turned on in the current buffer, that input method
-is used for reading a character.  */)
-     (prompt, inherit_input_method)
-     Lisp_Object prompt, inherit_input_method;
+is used for reading a character.
+If the optional argument SECONDS is non-nil, it should be a number
+specifying the maximum number of seconds to wait for input.  If no
+input arrives in that time, return nil.  SECONDS may be a
+floating-point value.  */)
+     (prompt, inherit_input_method, seconds)
+     Lisp_Object prompt, inherit_input_method, seconds;
 {
   if (! NILP (prompt))
     message_with_string ("%s", prompt, 0);
-  return read_filtered_event (1, 1, 0, ! NILP (inherit_input_method));
+  return read_filtered_event (1, 1, 0, ! NILP (inherit_input_method), seconds);
 }
 
 DEFUN ("get-file-char", Fget_file_char, Sget_file_char, 0, 0, 0,
--- a/src/process.c	Thu Aug 03 00:41:54 2006 +0000
+++ b/src/process.c	Thu Aug 03 11:45:23 2006 +0000
@@ -4157,6 +4157,14 @@
    when not inside wait_reading_process_output.  */
 static int waiting_for_user_input_p;
 
+static Lisp_Object
+wait_reading_process_output_unwind (data)
+     Lisp_Object data;
+{
+  waiting_for_user_input_p = XINT (data);
+  return Qnil;
+}
+
 /* This is here so breakpoints can be put on it.  */
 static void
 wait_reading_process_output_1 ()
@@ -4239,9 +4247,7 @@
   EMACS_TIME timeout, end_time;
   int wait_channel = -1;
   int got_some_input = 0;
-  /* Either nil or a cons cell, the car of which is of interest and
-     may be changed outside of this routine.  */
-  int saved_waiting_for_user_input_p = waiting_for_user_input_p;
+  int count = SPECPDL_INDEX ();
 
   FD_ZERO (&Available);
 #ifdef NON_BLOCKING_CONNECT
@@ -4252,6 +4258,8 @@
   if (wait_proc != NULL)
     wait_channel = XINT (wait_proc->infd);
 
+  record_unwind_protect (wait_reading_process_output_unwind,
+			 make_number (waiting_for_user_input_p));
   waiting_for_user_input_p = read_kbd;
 
   /* Since we may need to wait several times,
@@ -4878,7 +4886,7 @@
 	}			/* end for each file descriptor */
     }				/* end while exit conditions not met */
 
-  waiting_for_user_input_p = saved_waiting_for_user_input_p;
+  unbind_to (count, Qnil);
 
   /* If calling from keyboard input, do not quit
      since we want to return C-g as an input character.
--- a/src/puresize.h	Thu Aug 03 00:41:54 2006 +0000
+++ b/src/puresize.h	Thu Aug 03 11:45:23 2006 +0000
@@ -43,7 +43,7 @@
 #endif
 
 #ifndef BASE_PURESIZE
-#define BASE_PURESIZE (1211000 + SYSTEM_PURESIZE_EXTRA + SITELOAD_PURESIZE_EXTRA)
+#define BASE_PURESIZE (1102000 + SYSTEM_PURESIZE_EXTRA + SITELOAD_PURESIZE_EXTRA)
 #endif
 
 /* Increase BASE_PURESIZE by a ratio depending on the machine's word size.  */
--- a/src/w32.c	Thu Aug 03 00:41:54 2006 +0000
+++ b/src/w32.c	Thu Aug 03 11:45:23 2006 +0000
@@ -2256,16 +2256,17 @@
 
       SystemTimeToFileTime (&st, &utc_base_ft);
       utc_base = (long double) utc_base_ft.dwHighDateTime
-	* 4096 * 1024 * 1024 + utc_base_ft.dwLowDateTime;
+	* 4096.0L * 1024.0L * 1024.0L + utc_base_ft.dwLowDateTime;
       init = 1;
     }
 
   if (CompareFileTime (&ft, &utc_base_ft) < 0)
     return 0;
 
-  ret = (long double) ft.dwHighDateTime * 4096 * 1024 * 1024 + ft.dwLowDateTime;
+  ret = (long double) ft.dwHighDateTime
+    * 4096.0L * 1024.0L * 1024.0L + ft.dwLowDateTime;
   ret -= utc_base;
-  return (time_t) (ret * 1e-7);
+  return (time_t) (ret * 1e-7L);
 }
 
 void
--- a/src/w32fns.c	Thu Aug 03 00:41:54 2006 +0000
+++ b/src/w32fns.c	Thu Aug 03 11:45:23 2006 +0000
@@ -2067,6 +2067,7 @@
 {
   HWND hwnd;
   RECT rect;
+  Lisp_Object top, left;
 
   rect.left = rect.top = 0;
   rect.right = FRAME_PIXEL_WIDTH (f);
@@ -2082,12 +2083,17 @@
       w32_init_class (hinst);
     }
 
+  /* When called with RES_TYPE_NUMBER, w32_get_arg will return zero
+     for anything that is not a number and is not Qunbound.  */
+  left = w32_get_arg (Qnil, Qleft, "left", "Left", RES_TYPE_NUMBER);
+  top = w32_get_arg (Qnil, Qtop, "top", "Top", RES_TYPE_NUMBER);
+
   FRAME_W32_WINDOW (f) = hwnd
     = CreateWindow (EMACS_CLASS,
 		    f->namebuf,
 		    f->output_data.w32->dwStyle | WS_CLIPCHILDREN,
-		    CW_USEDEFAULT,
-		    SW_SHOW,
+		    EQ (left, Qunbound) ? CW_USEDEFAULT : XINT (left),
+		    EQ (top, Qunbound) ? CW_USEDEFAULT : XINT (top),
 		    rect.right - rect.left,
 		    rect.bottom - rect.top,
 		    NULL,
--- a/src/xdisp.c	Thu Aug 03 00:41:54 2006 +0000
+++ b/src/xdisp.c	Thu Aug 03 11:45:23 2006 +0000
@@ -909,7 +909,7 @@
 static Lisp_Object redisplay_window_error ();
 static Lisp_Object redisplay_window_0 P_ ((Lisp_Object));
 static Lisp_Object redisplay_window_1 P_ ((Lisp_Object));
-static void update_menu_bar P_ ((struct frame *, int));
+static int update_menu_bar P_ ((struct frame *, int, int));
 static int try_window_reusing_current_matrix P_ ((struct window *));
 static int try_window_id P_ ((struct window *));
 static int display_line P_ ((struct it *));
@@ -9190,6 +9190,9 @@
     {
       Lisp_Object tail, frame;
       int count = SPECPDL_INDEX ();
+      /* 1 means that update_menu_bar has run its hooks
+	 so any further calls to update_menu_bar shouldn't do so again.  */
+      int menu_bar_hooks_run = 0;
 
       record_unwind_save_match_data ();
 
@@ -9221,7 +9224,7 @@
 	    }
 
 	  GCPRO1 (tail);
-	  update_menu_bar (f, 0);
+	  menu_bar_hooks_run = update_menu_bar (f, 0, menu_bar_hooks_run);
 #ifdef HAVE_WINDOW_SYSTEM
 	  update_tool_bar (f, 0);
 #ifdef MAC_OS
@@ -9236,7 +9239,7 @@
   else
     {
       struct frame *sf = SELECTED_FRAME ();
-      update_menu_bar (sf, 1);
+      update_menu_bar (sf, 1, 0);
 #ifdef HAVE_WINDOW_SYSTEM
       update_tool_bar (sf, 1);
 #ifdef MAC_OS
@@ -9257,12 +9260,18 @@
    before we start to fill in any display lines, because it can call
    eval.
 
-   If SAVE_MATCH_DATA is non-zero, we must save and restore it here.  */
-
-static void
-update_menu_bar (f, save_match_data)
+   If SAVE_MATCH_DATA is non-zero, we must save and restore it here.
+
+   If HOOKS_RUN is 1, that means a previous call to update_menu_bar
+   already ran the menu bar hooks for this redisplay, so there
+   is no need to run them again.  The return value is the
+   updated value of this flag, to pass to the next call.  */
+
+static int
+update_menu_bar (f, save_match_data, hooks_run)
      struct frame *f;
      int save_match_data;
+     int hooks_run;
 {
   Lisp_Object window;
   register struct window *w;
@@ -9327,15 +9336,21 @@
 	      specbind (Qoverriding_local_map, Qnil);
 	    }
 
-	  /* Run the Lucid hook.  */
-	  safe_run_hooks (Qactivate_menubar_hook);
-
-	  /* If it has changed current-menubar from previous value,
-	     really recompute the menu-bar from the value.  */
-	  if (! NILP (Vlucid_menu_bar_dirty_flag))
-	    call0 (Qrecompute_lucid_menubar);
-
-	  safe_run_hooks (Qmenu_bar_update_hook);
+	  if (!hooks_run)
+	    {
+	      /* Run the Lucid hook.  */
+	      safe_run_hooks (Qactivate_menubar_hook);
+
+	      /* If it has changed current-menubar from previous value,
+		 really recompute the menu-bar from the value.  */
+	      if (! NILP (Vlucid_menu_bar_dirty_flag))
+		call0 (Qrecompute_lucid_menubar);
+
+	      safe_run_hooks (Qmenu_bar_update_hook);
+
+	      hooks_run = 1;
+	    }
+
 	  FRAME_MENU_BAR_ITEMS (f) = menu_bar_items (FRAME_MENU_BAR_ITEMS (f));
 
 	  /* Redisplay the menu bar in case we changed it.  */
@@ -9364,6 +9379,8 @@
 	  set_buffer_internal_1 (prev);
 	}
     }
+
+  return hooks_run;
 }
 
 
--- a/src/xfaces.c	Thu Aug 03 00:41:54 2006 +0000
+++ b/src/xfaces.c	Thu Aug 03 11:45:23 2006 +0000
@@ -6125,6 +6125,8 @@
       if (!realize_basic_faces (f))
 	return -1;
       default_face = FACE_FROM_ID (f, DEFAULT_FACE_ID);
+      if (default_face == NULL)
+	abort ();  /* realize_basic_faces must have set it up  */
     }
 
   if (!get_lface_attributes (f, symbol, symbol_attrs, signal_p))
@@ -6630,6 +6632,8 @@
       if (! realize_basic_faces (f))
 	error ("Cannot realize default face");
       def_face = FACE_FROM_ID (f, DEFAULT_FACE_ID);
+      if (def_face == NULL)
+	abort ();  /* realize_basic_faces must have set it up  */
     }
 
   /* Dispatch to the appropriate handler.  */