changeset 90602:b5c13d1564a9

Merge from emacs--devo--0 Patches applied: * emacs--devo--0 (patch 437-446) - Update from CVS - lisp/url/url-methods.el: Fix format error when http_proxy is empty string - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 137-140) - Update from CVS Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-111
author Miles Bader <miles@gnu.org>
date Wed, 20 Sep 2006 06:04:23 +0000
parents a1a25ac6c88a (current diff) 637b0854d9b5 (diff)
children d383ea975152
files ChangeLog INSTALL.CVS admin/FOR-RELEASE etc/ChangeLog etc/NEWS leim/ChangeLog lib-src/ChangeLog lisp/ChangeLog lisp/allout.el lisp/bindings.el lisp/cus-edit.el lisp/cus-start.el lisp/ediff-util.el lisp/ediff.el lisp/emulation/viper-cmd.el lisp/emulation/viper.el lisp/faces.el lisp/font-lock.el lisp/gnus/ChangeLog lisp/gnus/message.el lisp/gnus/nnslashdot.el lisp/help.el lisp/ido.el lisp/jit-lock.el lisp/menu-bar.el lisp/mouse-sel.el lisp/mouse.el lisp/play/life.el lisp/progmodes/compile.el lisp/progmodes/python.el lisp/saveplace.el lisp/select.el lisp/simple.el lisp/startup.el lisp/term/x-win.el lisp/textmodes/flyspell.el lisp/time.el lisp/wid-edit.el lispref/ChangeLog lispref/gpl.texi lispref/keymaps.texi lispref/text.texi lispref/variables.texi lwlib/ChangeLog mac/ChangeLog mac/INSTALL mac/inc/config.h mac/src/Emacs.r man/ChangeLog man/calc.texi man/emacs.texi man/frames.texi man/gnus.texi man/mh-e.texi msdos/ChangeLog nt/ChangeLog src/ChangeLog src/Makefile.in src/dispnew.c src/emacs.c src/gmalloc.c src/gtkutil.c src/indent.c src/keyboard.c src/keymap.c src/keymap.h src/mac.c src/macmenu.c src/macterm.c src/macterm.h src/md5.c src/md5.h src/print.c src/regex.c src/search.c src/strftime.c src/syntax.c src/window.c src/xdisp.c src/xfns.c
diffstat 98 files changed, 3312 insertions(+), 1780 deletions(-) [+]
line wrap: on
line diff
--- a/COPYING	Thu Sep 14 09:24:00 2006 +0000
+++ b/COPYING	Wed Sep 20 06:04:23 2006 +0000
@@ -1,8 +1,8 @@
 		    GNU GENERAL PUBLIC LICENSE
 		       Version 2, June 1991
 
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
-                       51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  Everyone is permitted to copy and distribute verbatim copies
  of this license document, but changing it is not allowed.
 
@@ -15,7 +15,7 @@
 General Public License applies to most of the Free Software
 Foundation's software and to any other program whose authors commit to
 using it.  (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.)  You can apply it to
+the GNU Lesser General Public License instead.)  You can apply it to
 your programs, too.
 
   When we speak of free software, we are referring to freedom, not
@@ -55,7 +55,7 @@
 
   The precise terms and conditions for copying, distribution and
 modification follow.
-
+
 		    GNU GENERAL PUBLIC LICENSE
    TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
 
@@ -110,7 +110,7 @@
     License.  (Exception: if the Program itself is interactive but
     does not normally print such an announcement, your work based on
     the Program is not required to print an announcement.)
-
+
 These requirements apply to the modified work as a whole.  If
 identifiable sections of that work are not derived from the Program,
 and can be reasonably considered independent and separate works in
@@ -168,7 +168,7 @@
 access to copy the source code from the same place counts as
 distribution of the source code, even though third parties are not
 compelled to copy the source along with the object code.
-
+
   4. You may not copy, modify, sublicense, or distribute the Program
 except as expressly provided under this License.  Any attempt
 otherwise to copy, modify, sublicense or distribute the Program is
@@ -225,7 +225,7 @@
 
 This section is intended to make thoroughly clear what is believed to
 be a consequence of the rest of this License.
-
+
   8. If the distribution and/or use of the Program is restricted in
 certain countries either by patents or by copyrighted interfaces, the
 original copyright holder who places the Program under this License
@@ -278,7 +278,7 @@
 POSSIBILITY OF SUCH DAMAGES.
 
 		     END OF TERMS AND CONDITIONS
-
+
 	    How to Apply These Terms to Your New Programs
 
   If you develop a new program, and you want it to be of the greatest
@@ -303,10 +303,9 @@
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     GNU General Public License for more details.
 
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-
+    You should have received a copy of the GNU General Public License along
+    with this program; if not, write to the Free Software Foundation, Inc.,
+    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 Also add information on how to contact you by electronic and paper mail.
 
@@ -336,5 +335,5 @@
 This General Public License does not permit incorporating your program into
 proprietary programs.  If your program is a subroutine library, you may
 consider it more useful to permit linking proprietary applications with the
-library.  If this is what you want to do, use the GNU Library General
+library.  If this is what you want to do, use the GNU Lesser General
 Public License instead of this License.
--- a/ChangeLog	Thu Sep 14 09:24:00 2006 +0000
+++ b/ChangeLog	Wed Sep 20 06:04:23 2006 +0000
@@ -1,3 +1,8 @@
+2006-09-15  Jay Belanger  <belanger@truman.edu>
+
+	* COPYING: Replace "Library Public License" by "Lesser Public
+	License" throughout.
+
 2006-09-11  Paul Eggert  <eggert@cs.ucla.edu>
 
 	* make-dist (EMACS): Exit and fail if the EMACS environment
--- a/INSTALL.CVS	Thu Sep 14 09:24:00 2006 +0000
+++ b/INSTALL.CVS	Wed Sep 20 06:04:23 2006 +0000
@@ -60,8 +60,8 @@
 
 If you execute cvs commands inside Emacs, specifically if you use
 pcl-cvs, output from CVS may be lost due to a problem in the
-interface between ssh, cvs, and libc.  Corrupted checkins have
-also been rumored to have happened.
+interface between ssh, cvs, and libc.  Corrupted checkins are
+also known to have happened.
 
 To fix the problem, save the following script into a file, make it
 executable, and set CVS_RSH to the file name of the script:
--- a/admin/FOR-RELEASE	Thu Sep 14 09:24:00 2006 +0000
+++ b/admin/FOR-RELEASE	Wed Sep 20 06:04:23 2006 +0000
@@ -33,14 +33,6 @@
 These don't need to be fixed to start pretest, but we call the
 attention of Windows users to fixing them.
 
-** 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)
-	(custom-set-variables
-	 '(hscroll-margin 20)
-	 '(hscroll-step 1)
-	)
-
 ** Drew Adams 12 Aug bug rpt: overlay  display artifact: trace left behind
 Windows only bug.
 
@@ -49,21 +41,18 @@
 
 * BUGS
 
-** Field handling in C-n.
-
 ** C-g fails to interrupt accept-process-output in Gnus.
   (Is that fixed?)
 
-** allout.el patch from Manheimer to be installed.
+** david.hansen@physik.fu-berlin.de: WoMan Bug, Sep 13.
 
-** regex char class matching needs a call to char-syntax.
+** Michael Cadilhac's line-move-partial is slow.
 
-** regex char class matching breaks if you change entries
-in the syntax table.
+** run-with-idle-timer change causes problem for Semantic.
 
-** Handa's Sep 6 compilation font lock bug report.
+** iampure@gmail.com's Sep 15 bug report about View Changes In File.
 
-** Michael Cadilhac's Sep 7 bug report about set-input-method.
+** Peter_Dyballa@Web.DE's Sep 17 bug report about i-search and non-ASCII chars
 
 * DOCUMENTATION
 
--- a/etc/COPYING	Thu Sep 14 09:24:00 2006 +0000
+++ b/etc/COPYING	Wed Sep 20 06:04:23 2006 +0000
@@ -1,8 +1,8 @@
 		    GNU GENERAL PUBLIC LICENSE
 		       Version 2, June 1991
 
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
-                       51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  Everyone is permitted to copy and distribute verbatim copies
  of this license document, but changing it is not allowed.
 
@@ -15,7 +15,7 @@
 General Public License applies to most of the Free Software
 Foundation's software and to any other program whose authors commit to
 using it.  (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.)  You can apply it to
+the GNU Lesser General Public License instead.)  You can apply it to
 your programs, too.
 
   When we speak of free software, we are referring to freedom, not
@@ -55,7 +55,7 @@
 
   The precise terms and conditions for copying, distribution and
 modification follow.
-
+
 		    GNU GENERAL PUBLIC LICENSE
    TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
 
@@ -110,7 +110,7 @@
     License.  (Exception: if the Program itself is interactive but
     does not normally print such an announcement, your work based on
     the Program is not required to print an announcement.)
-
+
 These requirements apply to the modified work as a whole.  If
 identifiable sections of that work are not derived from the Program,
 and can be reasonably considered independent and separate works in
@@ -168,7 +168,7 @@
 access to copy the source code from the same place counts as
 distribution of the source code, even though third parties are not
 compelled to copy the source along with the object code.
-
+
   4. You may not copy, modify, sublicense, or distribute the Program
 except as expressly provided under this License.  Any attempt
 otherwise to copy, modify, sublicense or distribute the Program is
@@ -225,7 +225,7 @@
 
 This section is intended to make thoroughly clear what is believed to
 be a consequence of the rest of this License.
-
+
   8. If the distribution and/or use of the Program is restricted in
 certain countries either by patents or by copyrighted interfaces, the
 original copyright holder who places the Program under this License
@@ -278,7 +278,7 @@
 POSSIBILITY OF SUCH DAMAGES.
 
 		     END OF TERMS AND CONDITIONS
-
+
 	    How to Apply These Terms to Your New Programs
 
   If you develop a new program, and you want it to be of the greatest
@@ -303,10 +303,9 @@
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     GNU General Public License for more details.
 
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-
+    You should have received a copy of the GNU General Public License along
+    with this program; if not, write to the Free Software Foundation, Inc.,
+    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 Also add information on how to contact you by electronic and paper mail.
 
@@ -336,5 +335,5 @@
 This General Public License does not permit incorporating your program into
 proprietary programs.  If your program is a subroutine library, you may
 consider it more useful to permit linking proprietary applications with the
-library.  If this is what you want to do, use the GNU Library General
+library.  If this is what you want to do, use the GNU Lesser General
 Public License instead of this License.
--- a/etc/ChangeLog	Thu Sep 14 09:24:00 2006 +0000
+++ b/etc/ChangeLog	Wed Sep 20 06:04:23 2006 +0000
@@ -1,3 +1,22 @@
+2006-09-18  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>
+
+	* NEWS: Rename x-use-old-gtk-file-dialog to x-gtk-use-old-file-dialog.
+
+2006-09-15  Jay Belanger  <belanger@truman.edu>
+
+	* COPYING: Replace "Library Public License" by "Lesser Public
+	License" throughout.
+
+2006-09-15  Richard Stallman  <rms@gnu.org>
+
+	* THE-GNU-PROJECT: Update with the latest footnotes
+	from www.gnu.org/gnu/the-gnu-project.html
+
+2006-09-15  David Kastrup  <dak@gnu.org>
+
+	* NEWS: explain new behavior and arguments of `key-binding' and
+	`command-remapping'.
+
 2006-09-11  Paul Eggert  <eggert@cs.ucla.edu>
 
 	* NEWS: In terminal-oriented subshells, the EMACS environment
@@ -102,7 +121,7 @@
 
 	* PROBLEMS: Emacs now requires ws2_32.dll on Windows.
 
-2006-07-14  K,Aa(Broly L,Bu(Brentey  <lorentey@elte.hu>
+2006-07-14  K,Aa(Broly L$,1 q(Brentey  <lorentey@elte.hu>
 
 	* HELLO: Update Hungarian sample.
 
--- a/etc/NEWS	Thu Sep 14 09:24:00 2006 +0000
+++ b/etc/NEWS	Wed Sep 20 06:04:23 2006 +0000
@@ -1134,7 +1134,7 @@
 
 +++
 *** For the Gtk+ version, you can make Emacs use the old file dialog
-by setting the variable `x-use-old-gtk-file-dialog' to t.  Default is to use
+by setting the variable `x-gtk-use-old-file-dialog' to t.  Default is to use
 the new dialog.
 
 ** Mouse changes:
@@ -2091,6 +2091,34 @@
 ---
 ** Changes in Allout
 
+*** Some previously rough topic-header format edge cases are reconciled.
+Level 1 topics use the mode's comment format, and lines starting with the
+asterisk - for instance, the comment close of some languages (eg, c's "*/"
+or mathematica's "*)") - at the beginning of line are no longer are
+interpreted as level 1 topics in those modes.
+
+*** Many or most commonly occuring "accidental" topics are disqualified.
+Text in item bodies that looks like a low-depth topic is no longer mistaken
+for one unless its first offspring (or that of its next sibling with
+offspring) is only one level deeper.
+
+For example, pasting some text with a bunch of leading asterisks into a
+topic that's followed by a level 3 or deeper topic will not cause the
+pasted text to be mistaken for outline structure.
+
+The same constraint is applied to any level 2 or 3 topics.
+
+This settles an old issue where typed or pasted text needed to be carefully
+reviewed, and sometimes doctored, to avoid accidentally disrupting the
+outline structure.  Now that should be generally unnecessary, as the most
+prone-to-occur accidents are disqualified.
+
+*** Allout now refuses to create "containment discontinuities", where a
+topic is shifted deeper than the offspring-depth of its container.  On the
+other hand, allout now operates gracefully with existing containment
+discontinuities, revealing excessively contained topics rather than either
+leaving them hidden or raising an error.
+
 *** Topic cryptography added, enabling easy gpg topic encryption and
 decryption.  Per-topic basis enables interspersing encrypted-text and
 clear-text within a single file to your heart's content, using symmetric
@@ -2100,56 +2128,52 @@
 powerful ways.  Encryption behavior customization is collected in the
 allout-encryption customization group.
 
-*** `allout-view-change-hook' marked as being deprecated - use
-`allout-exposure-change-hook' instead.  Both are still invoked, but
-`allout-view-change-hook' will eventually be ignored.  The new
-`allout-exposure-change-hook' is called with args that were passed to
-`allout-flag-region', making it easier to use.
-
-*** Other allout functions which change the outline structure also have
-hooks, enabling cooperative allout enhancements.  See
-`allout-structure-added-hook', `allout-structure-deleted-hook', and
-`allout-structure-shifted-hook'.
-
-*** Default command prefix changed to "\C-c " (control-c space), to avoid
-intruding on user's keybinding space.  Customize the
+*** Navigation within an item is easier.  Repeated beginning-of-line and
+end-of-line key commands (usually, ^A and ^E) cycle through the 
+beginning/end-of-line and then beginning/end of topic, etc.  See new
+customization vars `allout-beginning-of-line-cycles' and
+`allout-end-of-line-cycles'.
+
+*** New or revised allout-mode activity hooks enable creation of
+cooperative enhancements to allout mode without changes to the mode,
+itself.
+
+See `allout-exposure-change-hook', `allout-structure-added-hook',
+`allout-structure-deleted-hook', and `allout-structure-shifted-hook'.
+
+`allout-exposure-change-hook' replaces the existing
+`allout-view-change-hook', which is being deprecated.  Both are still
+invoked, but `allout-view-change-hook' will eventually be ignored.
+`allout-exposure-change-hook' is called with explicit arguments detailing
+the specifics of each change (as are the other new hooks), making it easier
+to use than the old version.
+
+There is a new mode deactivation hook, `allout-mode-deactivate-hook', for
+coordinating with deactivation of allout-mode.  Both that and the mode
+activation hook, `allout-mode-hook' are now run after the `allout-mode'
+variable is changed, rather than before.
+
+*** Default command prefix was changed to "\C-c " (control-c space), to
+avoid intruding on user's keybinding space.  Customize the
 `allout-command-prefix' variable to your preference.
 
-*** Allout now uses text overlay's `invisible' property (and others) for
-concealed text, instead of selective-display.  This simplifies the code, in
-particular avoiding the need for kludges for isearch dynamic-display,
-discretionary handling of edits of concealed text, undo concerns, etc.
-
-*** Some previously rough topic-header format edge cases are reconciled.
-Level 1 topics use the mode's comment format, and lines starting with the
-asterisk - for instance, the comment close of some languages (eg, c's "*/"
-or mathematica's "*)") - at the beginning of line are no longer are
-interpreted as level 1 topics in those modes.  (Yay!)
-
-*** Many substantial fixes and refinements, including:
-
-   - repaired regexp-quoting of custom header prefixes, so any literals
-     will now work (for instance, mathematica's "(*" is now properly
-     accepted).
-   - repaired inhibition of inadvertent edits to concealed text.
-   - refuse to create "containment discontinuities", where a
-     topic is shifted deeper than the offspring-depth of its' container
+*** Allout now uses text overlay's `invisible' property for concealed text,
+instead of selective-display.  This simplifies the code, in particular
+avoiding the need for kludges for isearch dynamic-display, discretionary
+handling of edits of concealed text, undo concerns, etc.
+
+*** There are many other fixes and refinements, including:
+
+   - repaired inhibition of inadvertent edits to concealed text, without
+     inhibiting undo; we now reveal undo changes within concealed text.
    - auto-fill-mode is now left inactive when allout-mode starts, if it
      already was inactive.  also, `allout-inhibit-auto-fill' custom
      configuration variable makes it easy to disable auto fill in allout
      outlines in general or on a per-buffer basis.
-   - mode hook changes: new hook `allout-mode-deactivate-hook', for
-     coordinating with deactivation of allout-mode.  `allout-mode-hook' is
-     now run after the `allout-mode' variable is changed, as is the new
-     `allout-mode-deactivate-hook'.
    - allout now tolerates fielded text in outlines without disruption.
    - hot-spot navigation now is modularized with a new function,
-     `allout-hotspot-key-handler', enabling easier articulation and
-     enhancement of the functionality by allout addons.
-   - topic body navigation is easier, where repeated beginning of line and
-     end of line key commands cycle through the actually beginning/end of
-     line and then beginning/end of topic, etc.  see new customization vars
-     `allout-beginning-of-line-cycles' and `allout-end-of-line-cycles'.
+     `allout-hotspot-key-handler', enabling easier use and enhancement of
+     the functionality in allout addons.
    - repaired retention of topic body hanging indent upon topic depth shifts
    - bulleting variation is simpler and more accommodating, both in the
      default behavior and in ability to vary when creating new topics
@@ -2160,8 +2184,7 @@
    - included a few unit-tests for interior functionality.  developers can
      have them automatically run at the end of module load by customizing
      the option `allout-run-unit-tests-on-load'.
-   - many, many minor tweaks and fixes.  many internal fixes and
-     refinements of docstrings.
+   - many, many other, more minor tweaks, fixes, and refinements.
    - version number incremented to 2.2
 
 ** The variable `woman-topic-at-point' was renamed
@@ -4741,6 +4764,12 @@
 text properties, according to their stickiness.  This also means that it
 works with empty overlays.  The same hold for the `local-map' property.
 
+*** `key-binding' will now look up mouse-specific bindings.  The
+keymaps consulted by `key-binding' will get adapted if the key
+sequence is started with a mouse event.  Instead of letting the click
+position be determined from the key sequence itself, it is also
+possible to specify it with an optional argument explicitly.
+
 *** Dense keymaps now handle inheritance correctly.
 
 Previously a dense keymap would hide all of the simple-char key
--- a/etc/THE-GNU-PROJECT	Thu Sep 14 09:24:00 2006 +0000
+++ b/etc/THE-GNU-PROJECT	Wed Sep 20 06:04:23 2006 +0000
@@ -7,163 +7,160 @@
   The first software-sharing community
 
    When I started working at the MIT Artificial Intelligence Lab in 1971,
-   I became part of a software-sharing community that had existed for
-   many years.  Sharing of software was not limited to our particular
-   community; it is as old as computers, just as sharing of recipes is as
-   old as cooking.  But we did it more than most.
+   I became part of a software-sharing community that had existed for many
+   years. Sharing of software was not limited to our particular community;
+   it is as old as computers, just as sharing of recipes is as old as
+   cooking. But we did it more than most.
 
    The AI Lab used a timesharing operating system called ITS (the
    Incompatible Timesharing System) that the lab's staff hackers (1) had
    designed and written in assembler language for the Digital PDP-10, one
-   of the large computers of the era.  As a member of this community, an
-   AI lab staff system hacker, my job was to improve this system.
+   of the large computers of the era. As a member of this community, an AI
+   lab staff system hacker, my job was to improve this system.
 
-   We did not call our software "free software", because that term did
-   not yet exist; but that is what it was.  Whenever people from another
-   university or a company wanted to port and use a program, we gladly
-   let them.  If you saw someone using an unfamiliar and interesting
-   program, you could always ask to see the source code, so that you
-   could read it, change it, or cannibalize parts of it to make a new
-   program.
+   We did not call our software "free software", because that term did not
+   yet exist; but that is what it was. Whenever people from another
+   university or a company wanted to port and use a program, we gladly let
+   them. If you saw someone using an unfamiliar and interesting program,
+   you could always ask to see the source code, so that you could read it,
+   change it, or cannibalize parts of it to make a new program.
 
    (1) The use of "hacker" to mean "security breaker" is a confusion on
-   the part of the mass media.  We hackers refuse to recognize that
+   the part of the mass media. We hackers refuse to recognize that
    meaning, and continue using the word to mean, "Someone who loves to
    program and enjoys being clever about it."
 
   The collapse of the community
 
    The situation changed drastically in the early 1980s when Digital
-   discontinued the PDP-10 series.  Its architecture, elegant and powerful
+   discontinued the PDP-10 series. Its architecture, elegant and powerful
    in the 60s, could not extend naturally to the larger address spaces
-   that were becoming feasible in the 80s.  This meant that nearly all of
+   that were becoming feasible in the 80s. This meant that nearly all of
    the programs composing ITS were obsolete.
 
-   The AI lab hacker community had already collapsed, not long before.  In
+   The AI lab hacker community had already collapsed, not long before. In
    1981, the spin-off company Symbolics had hired away nearly all of the
    hackers from the AI lab, and the depopulated community was unable to
-   maintain itself.  (The book Hackers, by Steve Levy, describes these
+   maintain itself. (The book Hackers, by Steve Levy, describes these
    events, as well as giving a clear picture of this community in its
-   prime.)  When the AI lab bought a new PDP-10 in 1982, its
-   administrators decided to use Digital's non-free timesharing system
-   instead of ITS.
+   prime.) When the AI lab bought a new PDP-10 in 1982, its administrators
+   decided to use Digital's non-free timesharing system instead of ITS.
 
    The modern computers of the era, such as the VAX or the 68020, had
    their own operating systems, but none of them were free software: you
    had to sign a nondisclosure agreement even to get an executable copy.
 
    This meant that the first step in using a computer was to promise not
-   to help your neighbor.  A cooperating community was forbidden.  The rule
-   made by the owners of proprietary software was, "If you share with
-   your neighbor, you are a pirate.  If you want any changes, beg us to
-   make them."
+   to help your neighbor. A cooperating community was forbidden. The rule
+   made by the owners of proprietary software was, "If you share with your
+   neighbor, you are a pirate. If you want any changes, beg us to make
+   them."
 
-   The idea that the proprietary software social system--the system that
+   The idea that the proprietary-software social system--the system that
    says you are not allowed to share or change software--is antisocial,
    that it is unethical, that it is simply wrong, may come as a surprise
-   to some readers.  But what else could we say about a system based on
+   to some readers. But what else could we say about a system based on
    dividing the public and keeping users helpless? Readers who find the
-   idea surprising may have taken proprietary social system as given, or
-   judged it on the terms suggested by proprietary software businesses.
-   Software publishers have worked long and hard to convince people that
-   there is only one way to look at the issue.
+   idea surprising may have taken proprietary-software social system as
+   given, or judged it on the terms suggested by proprietary software
+   businesses. Software publishers have worked long and hard to convince
+   people that there is only one way to look at the issue.
 
    When software publishers talk about "enforcing" their "rights" or
-   "stopping piracy", what they actually *say* is secondary.  The real
+   "stopping piracy", what they actually *say* is secondary. The real
    message of these statements is in the unstated assumptions they take
-   for granted; the public is supposed to accept them uncritically.  So
+   for granted; the public is supposed to accept them uncritically. So
    let's examine them.
 
    One assumption is that software companies have an unquestionable
    natural right to own software and thus have power over all its users.
    (If this were a natural right, then no matter how much harm it does to
-   the public, we could not object.)  Interestingly, the US Constitution
-   and legal tradition reject this view; copyright is not a natural
-   right, but an artificial government-imposed monopoly that limits the
-   users' natural right to copy.
+   the public, we could not object.) Interestingly, the US Constitution
+   and legal tradition reject this view; copyright is not a natural right,
+   but an artificial government-imposed monopoly that limits the users'
+   natural right to copy.
 
    Another unstated assumption is that the only important thing about
    software is what jobs it allows you to do--that we computer users
    should not care what kind of society we are allowed to have.
 
-   A third assumption is that we would have no usable software (or, would
+   A third assumption is that we would have no usable software (or would
    never have a program to do this or that particular job) if we did not
-   offer a company power over the users of the program.  This assumption
+   offer a company power over the users of the program. This assumption
    may have seemed plausible, before the free software movement
-   demonstrated that we can make plenty of useful software without
-   putting chains on it.
+   demonstrated that we can make plenty of useful software without putting
+   chains on it.
 
-   If we decline to accept these assumptions, and judge these issues
-   based on ordinary common-sense morality while placing the users first,
-   we arrive at very different conclusions.  Computer users should be free
-   to modify programs to fit their needs, and free to share software,
-   because helping other people is the basis of society.
+   If we decline to accept these assumptions, and judge these issues based
+   on ordinary common-sense morality while placing the users first, we
+   arrive at very different conclusions. Computer users should be free to
+   modify programs to fit their needs, and free to share software, because
+   helping other people is the basis of society.
 
    There is no room here for an extensive statement of the reasoning
    behind this conclusion, so I refer the reader to the web page,
-   <http://www.gnu.org/philosophy/why-free.html>.
+   http://www.gnu.org/philosophy/why-free.html.
 
   A stark moral choice.
 
-   With my community gone, to continue as before was impossible.  Instead,
+   With my community gone, to continue as before was impossible. Instead,
    I faced a stark moral choice.
 
    The easy choice was to join the proprietary software world, signing
    nondisclosure agreements and promising not to help my fellow hacker.
-   Most likely I would also be developing software that was released
-   under nondisclosure agreements, thus adding to the pressure on other
-   people to betray their fellows too.
+   Most likely I would also be developing software that was released under
+   nondisclosure agreements, thus adding to the pressure on other people
+   to betray their fellows too.
 
    I could have made money this way, and perhaps amused myself writing
-   code.  But I knew that at the end of my career, I would look back on
+   code. But I knew that at the end of my career, I would look back on
    years of building walls to divide people, and feel I had spent my life
    making the world a worse place.
 
-   I had already experienced being on the receiving end of a
-   nondisclosure agreement, when someone refused to give me and the MIT
-   AI lab the source code for the control program for our printer.  (The
-   lack of certain features in this program made use of the printer
-   extremely frustrating.)  So I could not tell myself that nondisclosure
-   agreements were innocent.  I was very angry when he refused to share
-   with us; I could not turn around and do the same thing to everyone
-   else.
+   I had already experienced being on the receiving end of a nondisclosure
+   agreement, when someone refused to give me and the MIT AI lab the
+   source code for the control program for our printer. (The lack of
+   certain features in this program made use of the printer extremely
+   frustrating.) So I could not tell myself that nondisclosure agreements
+   were innocent. I was very angry when he refused to share with us; I
+   could not turn around and do the same thing to everyone else.
 
    Another choice, straightforward but unpleasant, was to leave the
-   computer field.  That way my skills would not be misused, but they
-   would still be wasted.  I would not be culpable for dividing and
-   restricting computer users, but it would happen nonetheless.
+   computer field. That way my skills would not be misused, but they would
+   still be wasted. I would not be culpable for dividing and restricting
+   computer users, but it would happen nonetheless.
 
    So I looked for a way that a programmer could do something for the
-   good.  I asked myself, was there a program or programs that I could
+   good. I asked myself, was there a program or programs that I could
    write, so as to make a community possible once again?
 
    The answer was clear: what was needed first was an operating system.
-   That is the crucial software for starting to use a computer.  With an
+   That is the crucial software for starting to use a computer. With an
    operating system, you can do many things; without one, you cannot run
-   the computer at all.  With a free operating system, we could again have
-   a community of cooperating hackers--and invite anyone to join.  And
+   the computer at all. With a free operating system, we could again have
+   a community of cooperating hackers--and invite anyone to join. And
    anyone would be able to use a computer without starting out by
    conspiring to deprive his or her friends.
 
    As an operating system developer, I had the right skills for this job.
    So even though I could not take success for granted, I realized that I
-   was elected to do the job.  I chose to make the system compatible with
+   was elected to do the job. I chose to make the system compatible with
    Unix so that it would be portable, and so that Unix users could easily
-   switch to it.  The name GNU was chosen following a hacker tradition, as
+   switch to it. The name GNU was chosen following a hacker tradition, as
    a recursive acronym for "GNU's Not Unix."
 
    An operating system does not mean just a kernel, barely enough to run
-   other programs.  In the 1970s, every operating system worthy of the
-   name included command processors, assemblers, compilers, interpreters,
-   debuggers, text editors, mailers, and much more.  ITS had them, Multics
-   had them, VMS had them, and Unix had them.  The GNU operating system
+   other programs. In the 1970s, every operating system worthy of the name
+   included command processors, assemblers, compilers, interpreters,
+   debuggers, text editors, mailers, and much more. ITS had them, Multics
+   had them, VMS had them, and Unix had them. The GNU operating system
    would include them too.
 
    Later I heard these words, attributed to Hillel (1):
 
-   If I am not for myself, who will be for me?
-   If I am only for myself, what am I?
-   If not now, when?
+     If I am not for myself, who will be for me?
+     If I am only for myself, what am I?
+     If not now, when?
 
    The decision to start the GNU project was based on a similar spirit.
 
@@ -173,47 +170,46 @@
   Free as in freedom
 
    The term "free software" is sometimes misunderstood--it has nothing to
-   do with price.  It is about freedom.  Here, therefore, is the definition
+   do with price. It is about freedom. Here, therefore, is the definition
    of free software: a program is free software, for you, a particular
    user, if:
-
      * You have the freedom to run the program, for any purpose.
-     * You have the freedom to modify the program to suit your needs.  (To
+     * You have the freedom to modify the program to suit your needs. (To
        make this freedom effective in practice, you must have access to
        the source code, since making changes in a program without having
        the source code is exceedingly difficult.)
-     * You have the freedom to redistribute copies, either gratis or for
-       a fee.
+     * You have the freedom to redistribute copies, either gratis or for a
+       fee.
      * You have the freedom to distribute modified versions of the
        program, so that the community can benefit from your improvements.
 
-   Since "free" refers to freedom, not to price, there is no
-   contradiction between selling copies and free software.  In fact, the
-   freedom to sell copies is crucial: collections of free software sold
-   on CD-ROMs are important for the community, and selling them is an
-   important way to raise funds for free software development.  Therefore,
-   a program which people are not free to include on these collections is
-   not free software.
+   Since "free" refers to freedom, not to price, there is no contradiction
+   between selling copies and free software. In fact, the freedom to sell
+   copies is crucial: collections of free software sold on CD-ROMs are
+   important for the community, and selling them is an important way to
+   raise funds for free software development. Therefore, a program which
+   people are not free to include on these collections is not free
+   software.
 
    Because of the ambiguity of "free", people have long looked for
-   alternatives, but no one has found a suitable alternative.  The English
+   alternatives, but no one has found a suitable alternative. The English
    Language has more words and nuances than any other, but it lacks a
-   simple, unambiguous, word that means "free," as in
-   freedom--"unfettered," being the word that comes closest in meaning.
-   Such alternatives as "liberated", "freedom" and "open" have either the
+   simple, unambiguous, word that means "free", as in
+   freedom--"unfettered" being the word that comes closest in meaning.
+   Such alternatives as "liberated", "freedom", and "open" have either the
    wrong meaning or some other disadvantage.
 
   GNU software and the GNU system
 
-   Developing a whole system is a very large project.  To bring it into
+   Developing a whole system is a very large project. To bring it into
    reach, I decided to adapt and use existing pieces of free software
-   wherever that was possible.  For example, I decided at the very
+   wherever that was possible. For example, I decided at the very
    beginning to use TeX as the principal text formatter; a few years
-   later, I decided to use the X Window System rather than writing
-   another window system for GNU.
+   later, I decided to use the X Window System rather than writing another
+   window system for GNU.
 
    Because of this decision, the GNU system is not the same as the
-   collection of all GNU software.  The GNU system includes programs that
+   collection of all GNU software. The GNU system includes programs that
    are not GNU software, programs that were developed by other people and
    projects for their own purposes, but which we can use because they are
    free software.
@@ -222,12 +218,12 @@
 
    In January 1984 I quit my job at MIT and began writing GNU software.
    Leaving MIT was necessary so that MIT would not be able to interfere
-   with distributing GNU as free software.  If I had remained on the
-   staff, MIT could have claimed to own the work, and could have imposed
-   their own distribution terms, or even turned the work into a
-   proprietary software package.  I had no intention of doing a large
-   amount of work only to see it become useless for its intended purpose:
-   creating a new software-sharing community.
+   with distributing GNU as free software. If I had remained on the staff,
+   MIT could have claimed to own the work, and could have imposed their
+   own distribution terms, or even turned the work into a proprietary
+   software package. I had no intention of doing a large amount of work
+   only to see it become useless for its intended purpose: creating a new
+   software-sharing community.
 
    However, Professor Winston, then the head of the MIT AI Lab, kindly
    invited me to keep using the lab's facilities.
@@ -235,78 +231,78 @@
   The first steps
 
    Shortly before beginning the GNU project, I heard about the Free
-   University Compiler Kit, also known as VUCK.  (The Dutch word for
-   "free" is written with a V.)  This was a compiler designed to handle
-   multiple languages, including C and Pascal, and to support multiple
-   target machines.  I wrote to its author asking if GNU could use it.
+   University Compiler Kit, also known as VUCK. (The Dutch word for "free"
+   is written with a V.) This was a compiler designed to handle multiple
+   languages, including C and Pascal, and to support multiple target
+   machines. I wrote to its author asking if GNU could use it.
 
    He responded derisively, stating that the university was free but the
-   compiler was not.  I therefore decided that my first program for the
-   GNU project would be a multi-language, multi-platform compiler.
+   compiler was not. I therefore decided that my first program for the GNU
+   project would be a multi-language, multi-platform compiler.
 
-   Hoping to avoid the need to write the whole compiler myself, I
-   obtained the source code for the Pastel compiler, which was a
-   multi-platform compiler developed at Lawrence Livermore Lab.  It
-   supported, and was written in, an extended version of Pascal, designed
-   to be a system-programming language.  I added a C front end, and began
-   porting it to the Motorola 68000 computer.  But I had to give that up
-   when I discovered that the compiler needed many megabytes of stack
-   space, and the available 68000 Unix system would only allow 64k.
+   Hoping to avoid the need to write the whole compiler myself, I obtained
+   the source code for the Pastel compiler, which was a multi-platform
+   compiler developed at Lawrence Livermore Lab. It supported, and was
+   written in, an extended version of Pascal, designed to be a
+   system-programming language. I added a C front end, and began porting
+   it to the Motorola 68000 computer. But I had to give that up when I
+   discovered that the compiler needed many megabytes of stack space, and
+   the available 68000 Unix system would only allow 64k.
 
    I then realized that the Pastel compiler functioned by parsing the
    entire input file into a syntax tree, converting the whole syntax tree
    into a chain of "instructions", and then generating the whole output
-   file, without ever freeing any storage.  At this point, I concluded I
-   would have to write a new compiler from scratch.  That new compiler is
+   file, without ever freeing any storage. At this point, I concluded I
+   would have to write a new compiler from scratch. That new compiler is
    now known as GCC; none of the Pastel compiler is used in it, but I
-   managed to adapt and use the C front end that I had written.  But that
+   managed to adapt and use the C front end that I had written. But that
    was some years later; first, I worked on GNU Emacs.
 
   GNU Emacs
 
    I began work on GNU Emacs in September 1984, and in early 1985 it was
-   beginning to be usable.  This enabled me to begin using Unix systems to
+   beginning to be usable. This enabled me to begin using Unix systems to
    do editing; having no interest in learning to use vi or ed, I had done
    my editing on other kinds of machines until then.
 
    At this point, people began wanting to use GNU Emacs, which raised the
-   question of how to distribute it.  Of course, I put it on the anonymous
-   ftp server on the MIT computer that I used.  (This computer,
+   question of how to distribute it. Of course, I put it on the anonymous
+   ftp server on the MIT computer that I used. (This computer,
    prep.ai.mit.edu, thus became the principal GNU ftp distribution site;
    when it was decommissioned a few years later, we transferred the name
-   to our new ftp server.)  But at that time, many of the interested
-   people were not on the Internet and could not get a copy by ftp.  So
-   the question was, what would I say to them?
+   to our new ftp server.) But at that time, many of the interested people
+   were not on the Internet and could not get a copy by ftp. So the
+   question was, what would I say to them?
 
-   I could have said, "Find a friend who is on the net and who will make
-   a copy for you."  Or I could have done what I did with the original
-   PDP-10 Emacs: tell them, "Mail me a tape and a SASE, and I will mail
-   it back with Emacs on it."  But I had no job, and I was looking for
-   ways to make money from free software.  So I announced that I would
-   mail a tape to whoever wanted one, for a fee of $150.  In this way, I
-   started a free software distribution business, the precursor of the
-   companies that today distribute entire Linux-based GNU systems.
+   I could have said, "Find a friend who is on the net and who will make a
+   copy for you." Or I could have done what I did with the original PDP-10
+   Emacs: tell them, "Mail me a tape and a SASE, and I will mail it back
+   with Emacs on it." But I had no job, and I was looking for ways to make
+   money from free software. So I announced that I would mail a tape to
+   whoever wanted one, for a fee of $150. In this way, I started a free
+   software distribution business, the precursor of the companies that
+   today distribute entire Linux-based GNU systems.
 
   Is a program free for every user?
 
    If a program is free software when it leaves the hands of its author,
    this does not necessarily mean it will be free software for everyone
-   who has a copy of it.  For example, public domain software (software
+   who has a copy of it. For example, public domain software (software
    that is not copyrighted) is free software; but anyone can make a
-   proprietary modified version of it.  Likewise, many free programs are
+   proprietary modified version of it. Likewise, many free programs are
    copyrighted but distributed under simple permissive licenses which
    allow proprietary modified versions.
 
    The paradigmatic example of this problem is the X Window System.
    Developed at MIT, and released as free software with a permissive
-   license, it was soon adopted by various computer companies.  They added
+   license, it was soon adopted by various computer companies. They added
    X to their proprietary Unix systems, in binary form only, and covered
-   by the same nondisclosure agreement.  These copies of X were no more
+   by the same nondisclosure agreement. These copies of X were no more
    free software than Unix was.
 
    The developers of the X Window System did not consider this a
-   problem--they expected and intended this to happen.  Their goal was not
-   freedom, just "success", defined as "having many users."  They did not
+   problem--they expected and intended this to happen. Their goal was not
+   freedom, just "success", defined as "having many users." They did not
    care whether these users had freedom, only that they should be
    numerous.
 
@@ -314,93 +310,94 @@
    counting the amount of freedom gave different answers to the question,
    "Is this program free?" If you judged based on the freedom provided by
    the distribution terms of the MIT release, you would say that X was
-   free software.  But if you measured the freedom of the average user of
-   X, you would have to say it was proprietary software.  Most X users
-   were running the proprietary versions that came with Unix systems, not
-   the free version.
+   free software. But if you measured the freedom of the average user of
+   X, you would have to say it was proprietary software. Most X users were
+   running the proprietary versions that came with Unix systems, not the
+   free version.
 
   Copyleft and the GNU GPL
 
-   The goal of GNU was to give users freedom, not just to be popular.  So
+   The goal of GNU was to give users freedom, not just to be popular. So
    we needed to use distribution terms that would prevent GNU software
-   from being turned into proprietary software.  The method we use is
+   from being turned into proprietary software. The method we use is
    called "copyleft".(1)
 
-   Copyleft uses copyright law, but flips it over to serve the opposite
-   of its usual purpose: instead of a means of privatizing software, it
+   Copyleft uses copyright law, but flips it over to serve the opposite of
+   its usual purpose: instead of a means of privatizing software, it
    becomes a means of keeping software free.
 
-   The central idea of copyleft is that we give everyone permission to
-   run the program, copy the program, modify the program, and distribute
-   modified versions--but not permission to add restrictions of their
-   own.  Thus, the crucial freedoms that define "free software" are
-   guaranteed to everyone who has a copy; they become inalienable rights.
+   The central idea of copyleft is that we give everyone permission to run
+   the program, copy the program, modify the program, and distribute
+   modified versions--but not permission to add restrictions of their own.
+   Thus, the crucial freedoms that define "free software" are guaranteed
+   to everyone who has a copy; they become inalienable rights.
 
-   For an effective copyleft, modified versions must also be free.  This
+   For an effective copyleft, modified versions must also be free. This
    ensures that work based on ours becomes available to our community if
-   it is published.  When programmers who have jobs as programmers
+   it is published. When programmers who have jobs as programmers
    volunteer to improve GNU software, it is copyleft that prevents their
    employers from saying, "You can't share those changes, because we are
    going to use them to make our proprietary version of the program."
 
    The requirement that changes must be free is essential if we want to
-   ensure freedom for every user of the program.  The companies that
+   ensure freedom for every user of the program. The companies that
    privatized the X Window System usually made some changes to port it to
-   their systems and hardware.  These changes were small compared with the
-   great extent of X, but they were not trivial.  If making changes were
-   an excuse to deny the users freedom, it would be easy for anyone to
-   take advantage of the excuse.
+   their systems and hardware. These changes were small compared with the
+   great extent of X, but they were not trivial. If making changes were an
+   excuse to deny the users freedom, it would be easy for anyone to take
+   advantage of the excuse.
 
    A related issue concerns combining a free program with non-free code.
-   Such a combination would inevitably be non-free; whichever freedoms
-   are lacking for the non-free part would be lacking for the whole as
-   well.  To permit such combinations would open a hole big enough to sink
-   a ship.  Therefore, a crucial requirement for copyleft is to plug this
+   Such a combination would inevitably be non-free; whichever freedoms are
+   lacking for the non-free part would be lacking for the whole as well.
+   To permit such combinations would open a hole big enough to sink a
+   ship. Therefore, a crucial requirement for copyleft is to plug this
    hole: anything added to or combined with a copylefted program must be
    such that the larger combined version is also free and copylefted.
 
    The specific implementation of copyleft that we use for most GNU
-   software is the GNU General Public License, or GNU GPL for short.  We
+   software is the GNU General Public License, or GNU GPL for short. We
    have other kinds of copyleft that are used in specific circumstances.
    GNU manuals are copylefted also, but use a much simpler kind of
    copyleft, because the complexity of the GNU GPL is not necessary for
-   manuals.
+   manuals.(2)
 
    (1) In 1984 or 1985, Don Hopkins (a very imaginative fellow) mailed me
-   a letter.  On the envelope he had written several amusing sayings,
+   a letter. On the envelope he had written several amusing sayings,
    including this one: "Copyleft--all rights reversed." I used the word
    "copyleft" to name the distribution concept I was developing at the
    time.
 
+   (2) We now use the GNU Free Documentation License for documentation.
+
   The Free Software Foundation
 
-   As interest in using Emacs was growing, other people became involved
-   in the GNU project, and we decided that it was time to seek funding
-   once again.  So in 1985 we created the Free Software Foundation, a
-   tax-exempt charity for free software development.  The FSF also took
-   over the Emacs tape distribution business; later it extended this by
-   adding other free software (both GNU and non-GNU) to the tape, and by
-   selling free manuals as well.
+   As interest in using Emacs was growing, other people became involved in
+   the GNU project, and we decided that it was time to seek funding once
+   again. So in 1985 we created the Free Software Foundation, a tax-exempt
+   charity for free software development. The FSF also took over the Emacs
+   tape distribution business; later it extended this by adding other free
+   software (both GNU and non-GNU) to the tape, and by selling free
+   manuals as well.
 
    The FSF accepts donations, but most of its income has always come from
-   sales--of copies of free software, and of other related services.
-   Today it sells CD-ROMs of source code, CD-ROMs with binaries, nicely
-   printed manuals (all with freedom to redistribute and modify), and
-   Deluxe Distributions (where we build the whole collection of software
-   for your choice of platform).
+   sales--of copies of free software, and of other related services. Today
+   it sells CD-ROMs of source code, CD-ROMs with binaries, nicely printed
+   manuals (all with freedom to redistribute and modify), and Deluxe
+   Distributions (where we build the whole collection of software for your
+   choice of platform).
 
-   Free Software Foundation employees have written and maintained a
-   number of GNU software packages.  Two notable ones are the C library
-   and the shell.  The GNU C library is what every program running on a
-   GNU/Linux system uses to communicate with Linux.  It was developed by a
-   member of the Free Software Foundation staff, Roland McGrath.  The
-   shell used on most GNU/Linux systems is BASH, the Bourne Again
-   Shell(1), which was developed by FSF employee Brian Fox.
+   Free Software Foundation employees have written and maintained a number
+   of GNU software packages. Two notable ones are the C library and the
+   shell. The GNU C library is what every program running on a GNU/Linux
+   system uses to communicate with Linux. It was developed by a member of
+   the Free Software Foundation staff, Roland McGrath. The shell used on
+   most GNU/Linux systems is BASH, the Bourne Again Shell(1), which was
+   developed by FSF employee Brian Fox.
 
-   We funded development of these programs because the GNU project was
-   not just about tools or a development environment.  Our goal was a
-   complete operating system, and these programs were needed for that
-   goal.
+   We funded development of these programs because the GNU project was not
+   just about tools or a development environment. Our goal was a complete
+   operating system, and these programs were needed for that goal.
 
    (1) "Bourne again Shell" is a joke on the name ``Bourne Shell'', which
    was the usual shell on Unix.
@@ -408,41 +405,41 @@
   Free software support
 
    The free software philosophy rejects a specific widespread business
-   practice, but it is not against business.  When businesses respect the
+   practice, but it is not against business. When businesses respect the
    users' freedom, we wish them success.
 
    Selling copies of Emacs demonstrates one kind of free software
-   business.  When the FSF took over that business, I needed another way
-   to make a living.  I found it in selling services relating to the free
-   software I had developed.  This included teaching, for subjects such as
+   business. When the FSF took over that business, I needed another way to
+   make a living. I found it in selling services relating to the free
+   software I had developed. This included teaching, for subjects such as
    how to program GNU Emacs and how to customize GCC, and software
    development, mostly porting GCC to new platforms.
 
    Today each of these kinds of free software business is practiced by a
-   number of corporations.  Some distribute free software collections on
+   number of corporations. Some distribute free software collections on
    CD-ROM; others sell support at levels ranging from answering user
-   questions, to fixing bugs, to adding major new features.  We are even
+   questions, to fixing bugs, to adding major new features. We are even
    beginning to see free software companies based on launching new free
    software products.
 
-   Watch out, though--a number of companies that associate themselves
-   with the term "open source" actually base their business on non-free
-   software that works with free software.  These are not free software
-   companies, they are proprietary software companies whose products
-   tempt users away from freedom.  They call these "value added", which
-   reflects the values they would like us to adopt: convenience above
-   freedom.  If we value freedom more, we should call them "freedom
-   subtracted" products.
+   Watch out, though--a number of companies that associate themselves with
+   the term "open source" actually base their business on non-free
+   software that works with free software. These are not free software
+   companies, they are proprietary software companies whose products tempt
+   users away from freedom. They call these "value added", which reflects
+   the values they would like us to adopt: convenience above freedom. If
+   we value freedom more, we should call them "freedom subtracted"
+   products.
 
   Technical goals
 
-   The principal goal of GNU was to be free software.  Even if GNU had no
+   The principal goal of GNU was to be free software. Even if GNU had no
    technical advantage over Unix, it would have a social advantage,
    allowing users to cooperate, and an ethical advantage, respecting the
    user's freedom.
 
-   But it was natural to apply the known standards of good practice to
-   the work--for example, dynamically allocating data structures to avoid
+   But it was natural to apply the known standards of good practice to the
+   work--for example, dynamically allocating data structures to avoid
    arbitrary fixed size limits, and handling all the possible 8-bit codes
    wherever that made sense.
 
@@ -450,7 +447,7 @@
    deciding not to support 16-bit machines (it was clear that 32-bit
    machines would be the norm by the time the GNU system was finished),
    and to make no effort to reduce memory usage unless it exceeded a
-   megabyte.  In programs for which handling very large files was not
+   megabyte. In programs for which handling very large files was not
    crucial, we encouraged programmers to read an entire input file into
    core, then scan its contents without having to worry about I/O.
 
@@ -460,193 +457,197 @@
   Donated computers
 
    As the GNU project's reputation grew, people began offering to donate
-   machines running UNIX to the project.  These were very useful, because
+   machines running UNIX to the project. These were very useful, because
    the easiest way to develop components of GNU was to do it on a UNIX
-   system, and replace the components of that system one by one.  But they
+   system, and replace the components of that system one by one. But they
    raised an ethical issue: whether it was right for us to have a copy of
    UNIX at all.
 
    UNIX was (and is) proprietary software, and the GNU project's
-   philosophy said that we should not use proprietary software.  But,
+   philosophy said that we should not use proprietary software. But,
    applying the same reasoning that leads to the conclusion that violence
-   in self defense is justified, I concluded that it was legitimate to
-   use a proprietary package when that was crucial for developing free
+   in self defense is justified, I concluded that it was legitimate to use
+   a proprietary package when that was crucial for developing a free
    replacement that would help others stop using the proprietary package.
 
-   But, even if this was a justifiable evil, it was still an evil.  Today
+   But, even if this was a justifiable evil, it was still an evil. Today
    we no longer have any copies of Unix, because we have replaced them
-   with free operating systems.  If we could not replace a machine's
+   with free operating systems. If we could not replace a machine's
    operating system with a free one, we replaced the machine instead.
 
   The GNU Task List
 
    As the GNU project proceeded, and increasing numbers of system
-   components were found or developed, eventually it became useful to
-   make a list of the remaining gaps.  We used it to recruit developers to
-   write the missing pieces.  This list became known as the GNU task list.
-   In addition to missing Unix components, we listed added various other
+   components were found or developed, eventually it became useful to make
+   a list of the remaining gaps. We used it to recruit developers to write
+   the missing pieces. This list became known as the GNU task list. In
+   addition to missing Unix components, we listed added various other
    useful software and documentation projects that, we thought, a truly
    complete system ought to have.
 
    Today, hardly any Unix components are left in the GNU task list--those
-   jobs have been done, aside from a few inessential ones.  But the list
-   is full of projects that some might call "applications".  Any program
-   that appeals to more than a narrow class of users would be a useful
-   thing to add to an operating system.
+   jobs have been done, aside from a few inessential ones. But the list is
+   full of projects that some might call "applications". Any program that
+   appeals to more than a narrow class of users would be a useful thing to
+   add to an operating system.
 
    Even games are included in the task list--and have been since the
-   beginning.  Unix included games, so naturally GNU should too.  But
-   compatibility was not an issue for games, so we did not follow the
-   list of games that Unix had.  Instead, we listed a spectrum of
-   different kinds of games that users might like.
+   beginning. Unix included games, so naturally GNU should too. But
+   compatibility was not an issue for games, so we did not follow the list
+   of games that Unix had. Instead, we listed a spectrum of different
+   kinds of games that users might like.
 
   The GNU Library GPL
 
    The GNU C library uses a special kind of copyleft called the GNU
-   Library General Public License, which gives permission to link
-   proprietary software with the library.  Why make this exception?
+   Library General Public License(1), which gives permission to link
+   proprietary software with the library. Why make this exception?
 
    It is not a matter of principle; there is no principle that says
-   proprietary software products are entitled to include our code.  (Why
-   contribute to a project predicated on refusing to share with us?)
-   Using the LGPL for the C library, or for any library, is a matter of
+   proprietary software products are entitled to include our code. (Why
+   contribute to a project predicated on refusing to share with us?) Using
+   the LGPL for the C library, or for any library, is a matter of
    strategy.
 
    The C library does a generic job; every proprietary system or compiler
-   comes with a C library.  Therefore, to make our C library available
-   only to free software would not have given free software any
-   advantage--it would only have discouraged use of our library.
+   comes with a C library. Therefore, to make our C library available only
+   to free software would not have given free software any advantage--it
+   would only have discouraged use of our library.
 
    One system is an exception to this: on the GNU system (and this
-   includes GNU/Linux), the GNU C library is the only C library.  So the
+   includes GNU/Linux), the GNU C library is the only C library. So the
    distribution terms of the GNU C library determine whether it is
-   possible to compile a proprietary program for the GNU system.  There is
+   possible to compile a proprietary program for the GNU system. There is
    no ethical reason to allow proprietary applications on the GNU system,
    but strategically it seems that disallowing them would do more to
    discourage use of the GNU system than to encourage development of free
    applications.
 
-   That is why using the Library GPL is a good strategy for the C
-   library.  For other libraries, the strategic decision needs to be
-   considered on a case-by-case basis.  When a library does a special job
-   that can help write certain kinds of programs, then releasing it under
-   the GPL, limiting it to free programs only, is a way of helping other
-   free software developers, giving them an advantage against proprietary
+   That is why using the Library GPL is a good strategy for the C library.
+   For other libraries, the strategic decision needs to be considered on a
+   case-by-case basis. When a library does a special job that can help
+   write certain kinds of programs, then releasing it under the GPL,
+   limiting it to free programs only, is a way of helping other free
+   software developers, giving them an advantage against proprietary
    software.
 
    Consider GNU Readline, a library that was developed to provide
-   command-line editing for BASH.  Readline is released under the ordinary
-   GNU GPL, not the Library GPL.  This probably does reduce the amount
-   Readline is used, but that is no loss for us.  Meanwhile, at least one
-   useful application has been made free software specifically so it
-   could use Readline, and that is a real gain for the community.
+   command-line editing for BASH. Readline is released under the ordinary
+   GNU GPL, not the Library GPL. This probably does reduce the amount
+   Readline is used, but that is no loss for us. Meanwhile, at least one
+   useful application has been made free software specifically so it could
+   use Readline, and that is a real gain for the community.
 
    Proprietary software developers have the advantages money provides;
-   free software developers need to make advantages for each other.  I
-   hope some day we will have a large collection of GPL-covered libraries
-   that have no parallel available to proprietary software, providing
-   useful modules to serve as building blocks in new free software, and
-   adding up to a major advantage for further free software development.
+   free software developers need to make advantages for each other. I hope
+   some day we will have a large collection of GPL-covered libraries that
+   have no parallel available to proprietary software, providing useful
+   modules to serve as building blocks in new free software, and adding up
+   to a major advantage for further free software development.
+
+   (1) This license is now called the GNU Lesser General Public License,
+   to avoid giving the idea that all libraries ought to use it.
+   See http://www.gnu.org/philosophy/why-not-lgpl.html.
 
   Scratching an itch?
 
    Eric Raymond says that "Every good work of software starts by
-   scratching a developer's personal itch."  Maybe that happens sometimes,
+   scratching a developer's personal itch." Maybe that happens sometimes,
    but many essential pieces of GNU software were developed in order to
-   have a complete free operating system.  They come from a vision and a
+   have a complete free operating system. They come from a vision and a
    plan, not from impulse.
 
    For example, we developed the GNU C library because a Unix-like system
    needs a C library, the Bourne-Again Shell (bash) because a Unix-like
    system needs a shell, and GNU tar because a Unix-like system needs a
-   tar program.  The same is true for my own programs--the GNU C compiler,
+   tar program. The same is true for my own programs--the GNU C compiler,
    GNU Emacs, GDB and GNU Make.
 
    Some GNU programs were developed to cope with specific threats to our
-   freedom.  Thus, we developed gzip to replace the Compress program,
-   which had been lost to the community because of the LZW patents.  We
-   found people to develop LessTif, and more recently started GNOME and
-   Harmony, to address the problems caused by certain proprietary
-   libraries (see below).  We are developing the GNU Privacy Guard to
-   replace popular non-free encryption software, because users should not
-   have to choose between privacy and freedom.
+   freedom. Thus, we developed gzip to replace the Compress program, which
+   had been lost to the community because of the LZW patents. We found
+   people to develop LessTif, and more recently started GNOME and Harmony,
+   to address the problems caused by certain proprietary libraries (see
+   below). We are developing the GNU Privacy Guard to replace popular
+   non-free encryption software, because users should not have to choose
+   between privacy and freedom.
 
    Of course, the people writing these programs became interested in the
    work, and many features were added to them by various people for the
-   sake of their own needs and interests.  But that is not why the
-   programs exist.
+   sake of their own needs and interests. But that is not why the programs
+   exist.
 
   Unexpected developments
 
    At the beginning of the GNU project, I imagined that we would develop
-   the whole GNU system, then release it as a whole.  That is not how it
+   the whole GNU system, then release it as a whole. That is not how it
    happened.
 
    Since each component of the GNU system was implemented on a Unix
    system, each component could run on Unix systems, long before a
-   complete GNU system existed.  Some of these programs became popular,
-   and users began extending them and porting them---to the various
+   complete GNU system existed. Some of these programs became popular, and
+   users began extending them and porting them---to the various
    incompatible versions of Unix, and sometimes to other systems as well.
 
    The process made these programs much more powerful, and attracted both
-   funds and contributors to the GNU project.  But it probably also
-   delayed completion of a minimal working system by several years, as
-   GNU developers' time was put into maintaining these ports and adding
-   features to the existing components, rather than moving on to write
-   one missing component after another.
+   funds and contributors to the GNU project. But it probably also delayed
+   completion of a minimal working system by several years, as GNU
+   developers' time was put into maintaining these ports and adding
+   features to the existing components, rather than moving on to write one
+   missing component after another.
 
   The GNU Hurd
 
    By 1990, the GNU system was almost complete; the only major missing
-   component was the kernel.  We had decided to implement our kernel as a
-   collection of server processes running on top of Mach.  Mach is a
+   component was the kernel. We had decided to implement our kernel as a
+   collection of server processes running on top of Mach. Mach is a
    microkernel developed at Carnegie Mellon University and then at the
    University of Utah; the GNU HURD is a collection of servers (or ``herd
-   of gnus'') that run on top of Mach, and do the various jobs of the
-   Unix kernel.  The start of development was delayed as we waited for
-   Mach to be released as free software, as had been promised.
+   of gnus'') that run on top of Mach, and do the various jobs of the Unix
+   kernel. The start of development was delayed as we waited for Mach to
+   be released as free software, as had been promised.
 
    One reason for choosing this design was to avoid what seemed to be the
    hardest part of the job: debugging a kernel program without a
-   source-level debugger to do it with.  This part of the job had been
-   done already, in Mach, and we expected to debug the HURD servers as
-   user programs, with GDB.  But it took a long time to make that
-   possible, and the multi-threaded servers that send messages to each
-   other have turned out to be very hard to debug.  Making the HURD work
-   solidly has stretched on for many years.
+   source-level debugger to do it with. This part of the job had been done
+   already, in Mach, and we expected to debug the HURD servers as user
+   programs, with GDB. But it took a long time to make that possible, and
+   the multi-threaded servers that send messages to each other have turned
+   out to be very hard to debug. Making the HURD work solidly has
+   stretched on for many years.
 
   Alix
 
-   The GNU kernel was not originally supposed to be called the HURD.  Its
+   The GNU kernel was not originally supposed to be called the HURD. Its
    original name was Alix--named after the woman who was my sweetheart at
-   the time.  She, a Unix system administrator, had pointed out how her
+   the time. She, a Unix system administrator, had pointed out how her
    name would fit a common naming pattern for Unix system versions; as a
-   joke, she told her friends, "Someone should name a kernel after me."  I
+   joke, she told her friends, "Someone should name a kernel after me." I
    said nothing, but decided to surprise her with a kernel named Alix.
 
-   It did not stay that way.  Michael Bushnell (now Thomas), the main
-   developer of the kernel, preferred the name HURD, and redefined Alix
-   to refer to a certain part of the kernel--the part that would trap
-   system calls and handle them by sending messages to HURD servers.
+   It did not stay that way. Michael Bushnell (now Thomas), the main
+   developer of the kernel, preferred the name HURD, and redefined Alix to
+   refer to a certain part of the kernel--the part that would trap system
+   calls and handle them by sending messages to HURD servers.
 
    Ultimately, Alix and I broke up, and she changed her name;
    independently, the HURD design was changed so that the C library would
    send messages directly to servers, and this made the Alix component
    disappear from the design.
 
-   But before these things happened, a friend of hers came across the
-   name Alix in the HURD source code, and mentioned the name to her.  So
-   the name did its job.
+   But before these things happened, a friend of hers came across the name
+   Alix in the HURD source code, and mentioned the name to her. So the
+   name did its job.
 
   Linux and GNU/Linux
 
-   The GNU Hurd is not ready for production use.  Fortunately, another
-   kernel is available.  In 1991, Linus Torvalds developed a
-   Unix-compatible kernel and called it Linux.  Around 1992, combining
+   The GNU Hurd is not ready for production use. Fortunately, another
+   kernel is available. In 1991, Linus Torvalds developed a
+   Unix-compatible kernel and called it Linux. Around 1992, combining
    Linux with the not-quite-complete GNU system resulted in a complete
-   free operating system.  (Combining them was a substantial job in
-   itself, of course.) It is due to Linux that we can actually run a
-   version of the GNU system today.
+   free operating system. (Combining them was a substantial job in itself,
+   of course.) It is due to Linux that we can actually run a version of
+   the GNU system today.
 
    We call this system version GNU/Linux, to express its composition as a
    combination of the GNU system with Linux as the kernel.
@@ -654,89 +655,86 @@
   Challenges in our future
 
    We have proved our ability to develop a broad spectrum of free
-   software.  This does not mean we are invincible and unstoppable.
-   Several challenges make the future of free software uncertain; meeting
-   them will require steadfast effort and endurance, sometimes lasting
-   for years.  It will require the kind of determination that people
-   display when they value their freedom and will not let anyone take it
-   away.
+   software. This does not mean we are invincible and unstoppable. Several
+   challenges make the future of free software uncertain; meeting them
+   will require steadfast effort and endurance, sometimes lasting for
+   years. It will require the kind of determination that people display
+   when they value their freedom and will not let anyone take it away.
 
    The following four sections discuss these challenges.
 
   Secret hardware
 
    Hardware manufacturers increasingly tend to keep hardware
-   specifications secret.  This makes it difficult to write free drivers
-   so that Linux and XFree86 can support new hardware.  We have complete
-   free systems today, but we will not have them tomorrow if we cannot
-   support tomorrow's computers.
+   specifications secret. This makes it difficult to write free drivers so
+   that Linux and XFree86 can support new hardware. We have complete free
+   systems today, but we will not have them tomorrow if we cannot support
+   tomorrow's computers.
 
-   There are two ways to cope with this problem.  Programmers can do
-   reverse engineering to figure out how to support the hardware.  The
-   rest of us can choose the hardware that is supported by free software;
-   as our numbers increase, secrecy of specifications will become a
+   There are two ways to cope with this problem. Programmers can do
+   reverse engineering to figure out how to support the hardware. The rest
+   of us can choose the hardware that is supported by free software; as
+   our numbers increase, secrecy of specifications will become a
    self-defeating policy.
 
    Reverse engineering is a big job; will we have programmers with
    sufficient determination to undertake it? Yes--if we have built up a
    strong feeling that free software is a matter of principle, and
-   non-free drivers are intolerable.  And will large numbers of us spend
+   non-free drivers are intolerable. And will large numbers of us spend
    extra money, or even a little extra time, so we can use free drivers?
    Yes, if the determination to have freedom is widespread.
 
   Non-free libraries
 
    A non-free library that runs on free operating systems acts as a trap
-   for free software developers.  The library's attractive features are
-   the bait; if you use the library, you fall into the trap, because your
-   program cannot usefully be part of a free operating system.  (Strictly
+   for free software developers. The library's attractive features are the
+   bait; if you use the library, you fall into the trap, because your
+   program cannot usefully be part of a free operating system. (Strictly
    speaking, we could include your program, but it won't run with the
    library missing.) Even worse, if a program that uses the proprietary
    library becomes popular, it can lure other unsuspecting programmers
    into the trap.
 
    The first instance of this problem was the Motif toolkit, back in the
-   80s.  Although there were as yet no free operating systems, it was
-   clear what problem Motif would cause for them later on.  The GNU
-   Project responded in two ways: by asking individual free software
-   projects to support the free X toolkit widgets as well as Motif, and
-   by asking for someone to write a free replacement for Motif.  The job
-   took many years; LessTif, developed by the Hungry Programmers, became
-   powerful enough to support most Motif applications only in 1997.
+   80s. Although there were as yet no free operating systems, it was clear
+   what problem Motif would cause for them later on. The GNU Project
+   responded in two ways: by asking individual free software projects to
+   support the free X toolkit widgets as well as Motif, and by asking for
+   someone to write a free replacement for Motif. The job took many years;
+   LessTif, developed by the Hungry Programmers, became powerful enough to
+   support most Motif applications only in 1997.
 
-   Between 1996 and 1998, another non-free GUI toolkit library, called
-   Qt, was used in a substantial collection of free software, the desktop
-   KDE.
+   Between 1996 and 1998, another non-free GUI toolkit library, called Qt,
+   was used in a substantial collection of free software, the desktop KDE.
 
-   Free GNU/Linux systems were unable to use KDE, because we could not
-   use the library.  However, some commercial distributors of GNU/Linux
-   systems who were not strict about sticking with free software added
-   KDE to their systems--producing a system with more capabilities, but
-   less freedom.  The KDE group was actively encouraging more programmers
-   to use Qt, and millions of new "Linux users" had never been exposed to
-   the idea that there was a problem in this.  The situation appeared
-   grim.
+   Free GNU/Linux systems were unable to use KDE, because we could not use
+   the library. However, some commercial distributors of GNU/Linux systems
+   who were not strict about sticking with free software added KDE to
+   their systems--producing a system with more capabilities, but less
+   freedom. The KDE group was actively encouraging more programmers to use
+   Qt, and millions of new "Linux users" had never been exposed to the
+   idea that there was a problem in this. The situation appeared grim.
 
-   The free software community responded to the problem in two ways:
-   GNOME and Harmony.
+   The free software community responded to the problem in two ways: GNOME
+   and Harmony.
 
    GNOME, the GNU Network Object Model Environment, is GNU's desktop
-   project.  Started in 1997 by Miguel de Icaza, and developed with the
+   project. Started in 1997 by Miguel de Icaza, and developed with the
    support of Red Hat Software, GNOME set out to provide similar desktop
-   facilities, but using free software exclusively.  It has technical
-   advantages as well, such as supporting a variety of languages, not
-   just C++.  But its main purpose was freedom: not to require the use of
-   any non-free software.
+   facilities, but using free software exclusively. It has technical
+   advantages as well, such as supporting a variety of languages, not just
+   C++. But its main purpose was freedom: not to require the use of any
+   non-free software.
 
    Harmony is a compatible replacement library, designed to make it
    possible to run KDE software without using Qt.
 
    In November 1998, the developers of Qt announced a change of license
-   which, when carried out, should make Qt free software.  There is no way
+   which, when carried out, should make Qt free software. There is no way
    to be sure, but I think that this was partly due to the community's
-   firm response to the problem that Qt posed when it was non-free.  (The
-   new license is inconvenient and inequitable, so it remains desirable
-   to avoid using Qt.)
+   firm response to the problem that Qt posed when it was non-free. (The
+   new license is inconvenient and inequitable, so it remains desirable to
+   avoid using Qt.)
 
    [Subsequent note: in September 2000, Qt was rereleased under the GNU
    GPL, which essentially solved this problem.]
@@ -750,80 +748,82 @@
 
    The worst threat we face comes from software patents, which can put
    algorithms and features off limits to free software for up to twenty
-   years.  The LZW compression algorithm patents were applied for in 1983,
+   years. The LZW compression algorithm patents were applied for in 1983,
    and we still cannot release free software to produce proper compressed
-   GIFs.  In 1998, a free program to produce MP3 compressed audio was
+   GIFs. In 1998, a free program to produce MP3 compressed audio was
    removed from distribution under threat of a patent suit.
 
    There are ways to cope with patents: we can search for evidence that a
    patent is invalid, and we can look for alternative ways to do a job.
    But each of these methods works only sometimes; when both fail, a
    patent may force all free software to lack some feature that users
-   want.  What will we do when this happens?
+   want. What will we do when this happens?
 
    Those of us who value free software for freedom's sake will stay with
-   free software anyway.  We will manage to get work done without the
-   patented features.  But those who value free software because they
+   free software anyway. We will manage to get work done without the
+   patented features. But those who value free software because they
    expect it to be techically superior are likely to call it a failure
-   when a patent holds it back.  Thus, while it is useful to talk about
-   the practical effectiveness of the "cathedral" model of development,
+   when a patent holds it back. Thus, while it is useful to talk about the
+   practical effectiveness of the "cathedral" model of development (1),
    and the reliability and power of some free software, we must not stop
-   there.  We must talk about freedom and principle.
+   there. We must talk about freedom and principle.
+
+   (1) It would have been clearer to write `of the "bazaar" model', since
+   that was the alternative that was new and initially controversial.
 
   Free documentation
 
    The biggest deficiency in our free operating systems is not in the
    software--it is the lack of good free manuals that we can include in
-   our systems.  Documentation is an essential part of any software
+   our systems. Documentation is an essential part of any software
    package; when an important free software package does not come with a
-   good free manual, that is a major gap.  We have many such gaps today.
+   good free manual, that is a major gap. We have many such gaps today.
 
    Free documentation, like free software, is a matter of freedom, not
-   price.  The criterion for a free manual is pretty much the same as for
+   price. The criterion for a free manual is pretty much the same as for
    free software: it is a matter of giving all users certain freedoms.
    Redistribution (including commercial sale) must be permitted, on-line
    and on paper, so that the manual can accompany every copy of the
    program.
 
-   Permission for modification is crucial too.  As a general rule, I don't
+   Permission for modification is crucial too. As a general rule, I don't
    believe that it is essential for people to have permission to modify
-   all sorts of articles and books.  For example, I don't think you or I
+   all sorts of articles and books. For example, I don't think you or I
    are obliged to give permission to modify articles like this one, which
    describe our actions and our views.
 
    But there is a particular reason why the freedom to modify is crucial
-   for documentation for free software.  When people exercise their right
+   for documentation for free software. When people exercise their right
    to modify the software, and add or change its features, if they are
    conscientious they will change the manual too--so they can provide
-   accurate and usable documentation with the modified program.  A manual
+   accurate and usable documentation with the modified program. A manual
    which does not allow programmers to be conscientious and finish the
    job, does not fill our community's needs.
 
-   Some kinds of limits on how modifications are done pose no problem.
-   For example, requirements to preserve the original author's copyright
-   notice, the distribution terms, or the list of authors, are ok.  It is
+   Some kinds of limits on how modifications are done pose no problem. For
+   example, requirements to preserve the original author's copyright
+   notice, the distribution terms, or the list of authors, are ok. It is
    also no problem to require modified versions to include notice that
    they were modified, even to have entire sections that may not be
    deleted or changed, as long as these sections deal with nontechnical
-   topics.  These kinds of restrictions are not a problem because they
-   don't stop the conscientious programmer from adapting the manual to
-   fit the modified program.  In other words, they don't block the free
+   topics. These kinds of restrictions are not a problem because they
+   don't stop the conscientious programmer from adapting the manual to fit
+   the modified program. In other words, they don't block the free
    software community from making full use of the manual.
 
    However, it must be possible to modify all the *technical* content of
    the manual, and then distribute the result in all the usual media,
-   through all the usual channels; otherwise, the restrictions do
-   obstruct the community, the manual is not free, and we need another
-   manual.
+   through all the usual channels; otherwise, the restrictions do obstruct
+   the community, the manual is not free, and we need another manual.
 
    Will free software developers have the awareness and determination to
-   produce a full spectrum of free manuals? Once again, our future
-   depends on philosophy.
+   produce a full spectrum of free manuals? Once again, our future depends
+   on philosophy.
 
   We must talk about freedom
 
    Estimates today are that there are ten million users of GNU/Linux
-   systems such as Debian GNU/Linux and Red Hat Linux.  Free software has
+   systems such as Debian GNU/Linux and Red Hat Linux. Free software has
    developed such practical advantages that users are flocking to it for
    purely practical reasons.
 
@@ -833,15 +833,15 @@
    instead of proprietary software products.
 
    But interest in the software is growing faster than awareness of the
-   philosophy it is based on, and this leads to trouble.  Our ability to
+   philosophy it is based on, and this leads to trouble. Our ability to
    meet the challenges and threats described above depends on the will to
-   stand firm for freedom.  To make sure our community has this will, we
+   stand firm for freedom. To make sure our community has this will, we
    need to spread the idea to the new users as they come into the
    community.
 
    But we are failing to do so: the efforts to attract new users into our
    community are far outstripping the efforts to teach them the civics of
-   our community.  We need to do both, and we need to keep the two efforts
+   our community. We need to do both, and we need to keep the two efforts
    in balance.
 
   "Open Source"
@@ -851,50 +851,50 @@
    and say "open source software" instead.
 
    Some who favored this term aimed to avoid the confusion of "free" with
-   "gratis"--a valid goal.  Others, however, aimed to set aside the spirit
+   "gratis"--a valid goal. Others, however, aimed to set aside the spirit
    of principle that had motivated the free software movement and the GNU
    project, and to appeal instead to executives and business users, many
    of whom hold an ideology that places profit above freedom, above
-   community, above principle.  Thus, the rhetoric of "open source"
-   focuses on the potential to make high quality, powerful software, but
-   shuns the ideas of freedom, community, and principle.
+   community, above principle. Thus, the rhetoric of "open source" focuses
+   on the potential to make high quality, powerful software, but shuns the
+   ideas of freedom, community, and principle.
 
-   The "Linux" magazines are a clear example of this--they are filled
-   with advertisements for proprietary software that works with
-   GNU/Linux.  When the next Motif or Qt appears, will these magazines
-   warn programmers to stay away from it, or will they run ads for it?
+   The "Linux" magazines are a clear example of this--they are filled with
+   advertisements for proprietary software that works with GNU/Linux. When
+   the next Motif or Qt appears, will these magazines warn programmers to
+   stay away from it, or will they run ads for it?
 
    The support of business can contribute to the community in many ways;
-   all else being equal, it is useful.  But winning their support by
+   all else being equal, it is useful. But winning their support by
    speaking even less about freedom and principle can be disastrous; it
-   makes the previous imbalance between outreach and civics education
-   even worse.
+   makes the previous imbalance between outreach and civics education even
+   worse.
 
    "Free software" and "open source" describe the same category of
    software, more or less, but say different things about the software,
-   and about values.  The GNU Project continues to use the term "free
+   and about values. The GNU Project continues to use the term "free
    software", to express the idea that freedom, not just technology, is
    important.
 
   Try!
 
    Yoda's philosophy ("There is no `try'") sounds neat, but it doesn't
-   work for me.  I have done most of my work while anxious about whether I
+   work for me. I have done most of my work while anxious about whether I
    could do the job, and unsure that it would be enough to achieve the
-   goal if I did.  But I tried anyway, because there was no one but me
-   between the enemy and my city.  Surprising myself, I have sometimes
+   goal if I did. But I tried anyway, because there was no one but me
+   between the enemy and my city. Surprising myself, I have sometimes
    succeeded.
 
-   Sometimes I failed; some of my cities have fallen.  Then I found
-   another threatened city, and got ready for another battle.  Over time,
-   I've learned to look for threats and put myself between them and my
-   city, calling on other hackers to come and join me.
+   Sometimes I failed; some of my cities have fallen. Then I found another
+   threatened city, and got ready for another battle. Over time, I've
+   learned to look for threats and put myself between them and my city,
+   calling on other hackers to come and join me.
 
-   Nowadays, often I'm not the only one.  It is a relief and a joy when I
+   Nowadays, often I'm not the only one. It is a relief and a joy when I
    see a regiment of hackers digging in to hold the line, and I realize,
-   this city may survive--for now.  But the dangers are greater each year,
-   and now Microsoft has explicitly targeted our community.  We can't take
-   the future of freedom for granted.  Don't take it for granted! If you
+   this city may survive--for now. But the dangers are greater each year,
+   and now Microsoft has explicitly targeted our community. We can't take
+   the future of freedom for granted. Don't take it for granted! If you
    want to keep your freedom, you must be prepared to defend it.
 
   Copyright (C) 1998 Richard Stallman
--- a/leim/COPYING	Thu Sep 14 09:24:00 2006 +0000
+++ b/leim/COPYING	Wed Sep 20 06:04:23 2006 +0000
@@ -1,8 +1,8 @@
 		    GNU GENERAL PUBLIC LICENSE
 		       Version 2, June 1991
 
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
-                       51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  Everyone is permitted to copy and distribute verbatim copies
  of this license document, but changing it is not allowed.
 
@@ -15,7 +15,7 @@
 General Public License applies to most of the Free Software
 Foundation's software and to any other program whose authors commit to
 using it.  (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.)  You can apply it to
+the GNU Lesser General Public License instead.)  You can apply it to
 your programs, too.
 
   When we speak of free software, we are referring to freedom, not
@@ -55,7 +55,7 @@
 
   The precise terms and conditions for copying, distribution and
 modification follow.
-
+
 		    GNU GENERAL PUBLIC LICENSE
    TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
 
@@ -110,7 +110,7 @@
     License.  (Exception: if the Program itself is interactive but
     does not normally print such an announcement, your work based on
     the Program is not required to print an announcement.)
-
+
 These requirements apply to the modified work as a whole.  If
 identifiable sections of that work are not derived from the Program,
 and can be reasonably considered independent and separate works in
@@ -168,7 +168,7 @@
 access to copy the source code from the same place counts as
 distribution of the source code, even though third parties are not
 compelled to copy the source along with the object code.
-
+
   4. You may not copy, modify, sublicense, or distribute the Program
 except as expressly provided under this License.  Any attempt
 otherwise to copy, modify, sublicense or distribute the Program is
@@ -225,7 +225,7 @@
 
 This section is intended to make thoroughly clear what is believed to
 be a consequence of the rest of this License.
-
+
   8. If the distribution and/or use of the Program is restricted in
 certain countries either by patents or by copyrighted interfaces, the
 original copyright holder who places the Program under this License
@@ -278,7 +278,7 @@
 POSSIBILITY OF SUCH DAMAGES.
 
 		     END OF TERMS AND CONDITIONS
-
+
 	    How to Apply These Terms to Your New Programs
 
   If you develop a new program, and you want it to be of the greatest
@@ -303,10 +303,9 @@
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     GNU General Public License for more details.
 
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-
+    You should have received a copy of the GNU General Public License along
+    with this program; if not, write to the Free Software Foundation, Inc.,
+    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 Also add information on how to contact you by electronic and paper mail.
 
@@ -336,5 +335,5 @@
 This General Public License does not permit incorporating your program into
 proprietary programs.  If your program is a subroutine library, you may
 consider it more useful to permit linking proprietary applications with the
-library.  If this is what you want to do, use the GNU Library General
+library.  If this is what you want to do, use the GNU Lesser General
 Public License instead of this License.
--- a/leim/ChangeLog	Thu Sep 14 09:24:00 2006 +0000
+++ b/leim/ChangeLog	Wed Sep 20 06:04:23 2006 +0000
@@ -1,3 +1,8 @@
+2006-09-15  Jay Belanger  <belanger@truman.edu>
+
+	* COPYING: Replace "Library Public License" by "Lesser Public
+	License" throughout.
+
 2006-09-06  Micha,Ak(Bl Cadilhac  <michael.cadilhac@lrde.org>
 
 	* quail/uni-input.el (ucs-input-method): Don't make the action of
--- a/lib-src/COPYING	Thu Sep 14 09:24:00 2006 +0000
+++ b/lib-src/COPYING	Wed Sep 20 06:04:23 2006 +0000
@@ -1,8 +1,8 @@
 		    GNU GENERAL PUBLIC LICENSE
 		       Version 2, June 1991
 
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
-                       51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  Everyone is permitted to copy and distribute verbatim copies
  of this license document, but changing it is not allowed.
 
@@ -15,7 +15,7 @@
 General Public License applies to most of the Free Software
 Foundation's software and to any other program whose authors commit to
 using it.  (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.)  You can apply it to
+the GNU Lesser General Public License instead.)  You can apply it to
 your programs, too.
 
   When we speak of free software, we are referring to freedom, not
@@ -55,7 +55,7 @@
 
   The precise terms and conditions for copying, distribution and
 modification follow.
-
+
 		    GNU GENERAL PUBLIC LICENSE
    TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
 
@@ -110,7 +110,7 @@
     License.  (Exception: if the Program itself is interactive but
     does not normally print such an announcement, your work based on
     the Program is not required to print an announcement.)
-
+
 These requirements apply to the modified work as a whole.  If
 identifiable sections of that work are not derived from the Program,
 and can be reasonably considered independent and separate works in
@@ -168,7 +168,7 @@
 access to copy the source code from the same place counts as
 distribution of the source code, even though third parties are not
 compelled to copy the source along with the object code.
-
+
   4. You may not copy, modify, sublicense, or distribute the Program
 except as expressly provided under this License.  Any attempt
 otherwise to copy, modify, sublicense or distribute the Program is
@@ -225,7 +225,7 @@
 
 This section is intended to make thoroughly clear what is believed to
 be a consequence of the rest of this License.
-
+
   8. If the distribution and/or use of the Program is restricted in
 certain countries either by patents or by copyrighted interfaces, the
 original copyright holder who places the Program under this License
@@ -278,7 +278,7 @@
 POSSIBILITY OF SUCH DAMAGES.
 
 		     END OF TERMS AND CONDITIONS
-
+
 	    How to Apply These Terms to Your New Programs
 
   If you develop a new program, and you want it to be of the greatest
@@ -303,10 +303,9 @@
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     GNU General Public License for more details.
 
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-
+    You should have received a copy of the GNU General Public License along
+    with this program; if not, write to the Free Software Foundation, Inc.,
+    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 Also add information on how to contact you by electronic and paper mail.
 
@@ -336,5 +335,5 @@
 This General Public License does not permit incorporating your program into
 proprietary programs.  If your program is a subroutine library, you may
 consider it more useful to permit linking proprietary applications with the
-library.  If this is what you want to do, use the GNU Library General
+library.  If this is what you want to do, use the GNU Lesser General
 Public License instead of this License.
--- a/lib-src/ChangeLog	Thu Sep 14 09:24:00 2006 +0000
+++ b/lib-src/ChangeLog	Wed Sep 20 06:04:23 2006 +0000
@@ -1,3 +1,8 @@
+2006-09-15  Jay Belanger  <belanger@truman.edu>
+
+	* COPYING: Replace "Library Public License" by "Lesser Public
+	License" throughout.
+
 2006-08-09  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>
 
 	* etags.c (readline): expect sscanf returns >= 1.
--- a/lisp/COPYING	Thu Sep 14 09:24:00 2006 +0000
+++ b/lisp/COPYING	Wed Sep 20 06:04:23 2006 +0000
@@ -1,8 +1,8 @@
 		    GNU GENERAL PUBLIC LICENSE
 		       Version 2, June 1991
 
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
-                       51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  Everyone is permitted to copy and distribute verbatim copies
  of this license document, but changing it is not allowed.
 
@@ -15,7 +15,7 @@
 General Public License applies to most of the Free Software
 Foundation's software and to any other program whose authors commit to
 using it.  (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.)  You can apply it to
+the GNU Lesser General Public License instead.)  You can apply it to
 your programs, too.
 
   When we speak of free software, we are referring to freedom, not
@@ -55,7 +55,7 @@
 
   The precise terms and conditions for copying, distribution and
 modification follow.
-
+
 		    GNU GENERAL PUBLIC LICENSE
    TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
 
@@ -110,7 +110,7 @@
     License.  (Exception: if the Program itself is interactive but
     does not normally print such an announcement, your work based on
     the Program is not required to print an announcement.)
-
+
 These requirements apply to the modified work as a whole.  If
 identifiable sections of that work are not derived from the Program,
 and can be reasonably considered independent and separate works in
@@ -168,7 +168,7 @@
 access to copy the source code from the same place counts as
 distribution of the source code, even though third parties are not
 compelled to copy the source along with the object code.
-
+
   4. You may not copy, modify, sublicense, or distribute the Program
 except as expressly provided under this License.  Any attempt
 otherwise to copy, modify, sublicense or distribute the Program is
@@ -225,7 +225,7 @@
 
 This section is intended to make thoroughly clear what is believed to
 be a consequence of the rest of this License.
-
+
   8. If the distribution and/or use of the Program is restricted in
 certain countries either by patents or by copyrighted interfaces, the
 original copyright holder who places the Program under this License
@@ -278,7 +278,7 @@
 POSSIBILITY OF SUCH DAMAGES.
 
 		     END OF TERMS AND CONDITIONS
-
+
 	    How to Apply These Terms to Your New Programs
 
   If you develop a new program, and you want it to be of the greatest
@@ -303,10 +303,9 @@
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     GNU General Public License for more details.
 
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-
+    You should have received a copy of the GNU General Public License along
+    with this program; if not, write to the Free Software Foundation, Inc.,
+    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 Also add information on how to contact you by electronic and paper mail.
 
@@ -336,5 +335,5 @@
 This General Public License does not permit incorporating your program into
 proprietary programs.  If your program is a subroutine library, you may
 consider it more useful to permit linking proprietary applications with the
-library.  If this is what you want to do, use the GNU Library General
+library.  If this is what you want to do, use the GNU Lesser General
 Public License instead of this License.
--- a/lisp/ChangeLog	Thu Sep 14 09:24:00 2006 +0000
+++ b/lisp/ChangeLog	Wed Sep 20 06:04:23 2006 +0000
@@ -1,17 +1,374 @@
+2006-09-20  David Kastrup  <dak@gnu.org>
+
+	* mouse.el (mouse-posn-property): Improve doc string.
+	(mouse-on-link-p): Change buffers for function calls on links.
+
+	* menu-bar.el (clipboard-yank): bomb out in interactive use if
+	buffer is read-only.
+
+2006-09-18  Ken Manheimer  <ken.manheimer@gmail.com>
+
+	* allout.el (allout-unprotected): Let inhibit-read-only only when
+	buffer-read-only isn't set.
+	(allout-annotate-hidden): Enable topic annotation during copies even
+	when the buffer is read-only, eg for topic copies.  Ensure that the loop
+	advances, even when the span extends beyond the	deletion region.
+	(allout-toggle-subtree-encryption): Use	allout-structure-added-hook
+	rather than allout-exposure-changed-hook, as a stronger assertion.
+	(allout-keybindings-list): Add bindings for
+	allout-copy-line-as-kill and allout-copy-topic-as-kill.
+	(allout-copy-line-as-kill, allout-copy-topic-as-kill): copy
+	wrappers for allout-kill-line and allout-kill-topic.
+	(allout-listify-exposed): Position correctly to accumulate lines.
+
+2006-09-19  Chong Yidong  <cyd@stupidchicken.com>
+
+	* simple.el (line-move-1): Escape field boundaries occurring
+	exactly at point.  Update goal column if constrained to a field.
+	(line-move-finish): Escape field boundaries occurring exactly at
+	point.
+
+2006-09-19  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* mouse.el (mouse-on-link-p): Tentatively fix last change.
+	(mouse-drag-vertical-line): Remove unused var `wconfig'.
+
+2006-09-19  Kim F. Storm  <storm@cua.dk>
+
+	* help.el (describe-key-briefly, describe-key): Simplify printing
+	of descriptions by using format and %S.  Fix "is undefined"
+	messages to say "at that spot" for mouse events.
+
+	* simple.el (line-move-partial): Optimize.  Try window-line-height
+	before posn-at-point to get vpos of current line.
+
+2006-09-18  Michael Kifer  <kifer@cs.stonybrook.edu>
+
+	* viper.el: Bump up version/date of update to reflect the substantial
+	changes done in August 2006.
+
+	* viper-cmd (viper-next-line-at-bol): Make sure button-at, push-button
+	are defined.
+
+	* ediff-util.el (ediff-add-to-history): New function.
+
+	* ediff.el: Use ediff-add-to-history instead of add-to-history.
+
+2006-09-18  Wolfgang Jenkner  <wjenkner@inode.at>  (tiny change)
+
+	* textmodes/conf-mode.el (conf-space-mode): Doc fix.
+	Delete duplicate make-local-variable form.
+	(conf-space-keywords): Add autoload cookie.
+	Fix typo (`keywords', not `keyword').
+
+2006-09-18  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>
+
+	* cus-start.el (all): Rename x-gtk-show-chooser-help-text to
+	x-gtk-file-dialog-help-text.  Rename x-use-old-gtk-file-dialog
+	to x-gtk-use-old-file-dialog
+
+2006-09-18  Richard Stallman  <rms@gnu.org>
+
+	* wid-edit.el (widget-button-click): Handle non-mouse-motion events
+	that might come in during mouse tracking.
+
+2006-09-18  Kim F. Storm  <storm@cua.dk>
+
+	* simple.el (line-move-partial): Rework 2006-09-15 change to use
+	new window-line-height function.  Further optimize by not calling
+	pos-visible-in-window-p for window-end when window-line-height
+	returns useful information.
+
+2006-09-16  Richard Stallman  <rms@gnu.org>
+
+	* textmodes/conf-mode.el (conf-mode-map): Use conf-space-keywords cmd.
+	(conf-space-mode): Don't handle prefix arg.
+	Delete conf-space-keywords-override code.
+	Use add-hook.
+	(conf-space-keywords): New command.
+	(conf-space-mode-internal): Be careful with imenu-generic-expression.
+	Delete conf-space-keywords-override code.
+	(conf-space-keywords-alist): Doc fix.
+	(conf-space-font-lock-keywords): Doc fix.
+	(conf-space-keywords-override): Var deleted.
+
+2006-09-16  Chong Yidong  <cyd@stupidchicken.com>
+
+	* startup.el (fancy-splash-screens): Don't switch to the scratch
+	buffer; it may not be the next buffer.
+
+2006-09-16  Romain Francoise  <romain@orebokech.com>
+
+	* saveplace.el (load-save-place-alist-from-file): Use expanded name
+	in both messages.
+
+2006-09-16  Slawomir Nowaczyk  <slawomir.nowaczyk.847@student.lu.se>
+
+	* progmodes/python.el (python-preoutput-filter):
+	Fix arg order to string-match.
+
+2006-09-16  Richard Stallman  <rms@gnu.org>
+
+	* obsolete/fast-lock.el (fast-lock-cache-data): Provide 2nd arg to
+	font-lock-compile-keywords.
+
+	* font-lock.el (font-lock-compile-keywords): Rename optional arg
+	to SYNTACTIC-KEYWORDS and reverse the sense.  All callers changed.
+
+2006-09-16  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>
+
+	* cus-start.el (all): Add x-gtk-show-chooser-help-text.
+
+	* select.el (xselect-convert-to-string): If UTF8_STRING is requested
+	and the data doesn't look like UTF8, send STRING instead.
+
+2006-09-16  Agustin Martin <agustin.martin@hispalinux.es>
+
+	* textmodes/flyspell.el (flyspell-check-region-doublons):
+	New function to detect duplicated words.
+	(flyspell-large-region): Use it.
+
+2006-09-16  Chong Yidong  <cyd@stupidchicken.com>
+
+	* simple.el (line-move-to-column): Revert 2006-08-03 change.
+
+2006-09-16  Eli Zaretskii  <eliz@gnu.org>
+
+	* help.el (describe-prefix-bindings): Use let, not let*.
+
+2006-09-16  Ken Manheimer  <ken.manheimer@gmail.com>
+
+	* allout.el (allout-regexp, allout-line-boundary-regexp)
+	(allout-bob-regexp): Correct grouping and boundaries to fix
+	backwards traversal.
+	(allout-depth-specific-regexp, allout-depth-one-regexp):
+	New versions that exploit \\{M\\} regexp syntax, to avoid geometric or
+	worse time in allout-ascend.
+	(allout-doublecheck-at-and-shallower): Identify depth threshold
+	below which topics are checked for and disqualified by containment
+	discontinuities.
+	(allout-hotspot-key-handler): Correctly handle multiple-key
+	strokes.  Remove some unused variables.
+	(allout-mode-leaders): Clarify that mode-specific comment-start
+	will be used.
+	(set-allout-regexp): Correctly regexp-quote allout regexps to
+	properly accept alternative header-leads and primary bullets with
+	regexp-specific characters (eg, C "/*", mathematica "(*").
+	Include new regular expressions among those configured.
+	(allout-infer-header-lead-and-primary-bullet):
+	Rename allout-infer-header-lead.
+	(allout-recent-depth): Manifest as a variable as well as a function.
+	(allout-prefix-data): Simplify into an inline instead of a macro,
+	assuming current match data rather than being explicitly passed
+	it.  Establish allout-recent-depth value as well as
+	allout-recent-prefix-beginning and allout-recent-prefix-end.
+	(allout-aberrant-container-p): True when an item's immediate
+	offspring discontinuously contained.  Useful for disqualifying
+	unintended topic prefixes, likely at low depths.
+	(allout-goto-prefix-doublechecked): Elaborate version of
+	allout-goto-prefix which disqualifies aberrant pseudo-items.
+	(allout-pre-next-prefix): Layer on top of lower-level routines, to
+	get disqualification of aberrant containers.
+	(allout-end-of-prefix, allout-end-of-subtree): Disqualify aberrant
+	containers.
+	(allout-beginning-of-current-entry): Position at start of buffer
+	when in container (depth 0) entry.
+	(nullify-allout-prefix-data): Invalidate allout-recent-* prefix data.
+	(allout-current-bullet): Strip text properties.
+	(allout-get-prefix-bullet): Use right match groups.
+	(allout-beginning-of-line, allout-next-heading):
+	Disqualify aberrant containers.
+	(allout-previous-heading): Disqualify aberrant containers, and
+	change to regular (rather than inline) function, to allow
+	self-recursion.
+	(allout-get-invisibility-overlay): Increment so progress is made
+	when the first overlay is not the sought one.
+	(allout-end-of-prefix): Disqualify aberrant containers.
+	(allout-end-of-line): Cycle something like allout-beginning-of-line.
+	(allout-mode): Make allout-old-style-prefixes (ie, enabling use with
+	outline.el outlines) functional again.  Change the primary bullet
+	along with the header-lead - level 1 new-style bullets now work.
+	Engage allout-before-change-handler in mainline emacs, not just
+	xemacs, to do undo handling.
+	(allout-before-change-handler): Expose undo changes occurring in
+	hidden regions.  Use allout-get-invisibility-overlay instead of
+	reimplementing it inline.
+	(allout-chart-subtree): Use start rather than end of prefix in
+	charts.  Use allout-recent-depth variable.
+	(allout-chart-siblings): Disqualify aberrant topics.
+	(allout-beginning-of-current-entry): Position correctly.
+	(allout-ascend): Use new allout-depth-specific-regexp and
+	allout-depth-one-regexp for linear instead of O(N^2) or worse
+	behavior.
+	(allout-ascend-to-depth): Depend on allout-ascend, rather than
+	reimplementing an algorithm.
+	(allout-up-current-level): Depend on allout-ascend, rather than
+	reimplementing an algorithm.  Return to start-point if we fail.
+	(allout-descend-to-depth): Use allout-recent-depth variable
+	instead of function.
+	(allout-next-sibling): On traversal of numerous intervening
+	topics, resort to economical allout-next-sibling-leap.
+	(allout-next-sibling-leap): Specialized version of
+	allout-next-sibling that uses allout-ascend cleverly, to depend on
+	a regexp search to leap large numbers of contained topics, rather
+	than arbitrarily many one-by-one traversals.
+	(allout-next-visible-heading): Disqualify aberrant topics.
+	(allout-previous-visible-heading): Position consistently when
+	interactive.
+	(allout-forward-current-level): Base on allout-previous-sibling
+	rather than (differently) reimplmenting the algorithm.  Remove some
+	unused variables.
+	(allout-solicit-alternate-bullet): Present default choice stripped
+	of text properties.
+	(allout-rebullet-heading): Use bullet stripped of text properties.
+	Register changes using allout-exposure-change-hook.
+	Disregard aberrant topics.
+	(allout-shift-in): With universal-argument, make topic a peer of
+	it's former offspring.  Simplify the code by separating out
+	allout-shift-out functionality.
+	(allout-shift-out): With universal-argument, make offspring peers
+	of their former container, and its siblings.  Implement the
+	functionality here, rather than inappropriately muddling the
+	implementation of allout-shift-in.
+	(allout-rebullet-topic): Respect additional argument for new
+	parent-child separation function.
+	(allout-yank-processing): Use allout-ascend directly.
+	(allout-show-entry): Disqualify aberrant topics.
+	(allout-show-children): Handle discontinuous children gracefully,
+	extending the depth being revealed to expose them and posting a
+	message indicating the situation.
+	(allout-show-to-offshoot): Remove obsolete and incorrect comment.
+	Leave cursor in correct position.
+	(allout-hide-current-subtree): Use allout-ascend directly.
+	Disqualify aberrant topics.
+	(allout-kill-line, allout-kill-topic): Preserve exposure layout in
+	a way that the yanks can restore it, as used to happen.
+	(allout-yank-processing): Restore exposure layout as recorded by
+	allout-kill-*, as used to happen.
+	(allout-annotate-hidden, allout-hide-by-annotation): New routines
+	for preseving and restoring exposure layout across kills.
+	(allout-toggle-subtree-encryption): Run allout-exposure-change-hook.
+	(allout-encrypt-string): Strip text properties.
+	Rearranged order and outline-headings for some of the
+	miscellaneous functions.
+	(allout-resolve-xref): No need to quote the error name in the
+	condition-case handler section.
+	(allout-flatten): Classic recursive (and recursively intensive,
+	without tail-recursion) list-flattener, needed by allout-shift-out
+	when confronted with discontinuous children.
+
+2006-09-16  Jason Rumney  <jasonr@gnu.org>
+
+	* dnd.el (dnd-open-remote-file-function): Use dnd-open-local-file
+	on ms-windows.
+	(dnd-open-unc-file): Remove.
+	(dnd-open-local-file): Mention in doc string that it also handles
+	remote files if the system natively supports unc file-names.
+
+2006-09-15  Kim F. Storm  <storm@cua.dk>
+
+	* help.el (describe-key): Handle C-h k in *Help* buffer; collect
+	all necessary information about the event before erasing *Help*.
+
+	* simple.el (line-move-partial): Use window-line-visiblity to
+	quickly check whether last line is partially visible, and only do
+	the hard (and slow) part in that case.
+
+2006-09-15  Jay Belanger  <belanger@truman.edu>
+
+	* COPYING: Replace "Library Public License" by "Lesser Public
+	License" throughout.
+
+2006-09-15  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>
+
+	* term/x-win.el (x-menu-bar-open): New function for F10.
+
+2006-09-15  Chong Yidong  <cyd@stupidchicken.com>
+
+	* progmodes/compile.el (compilation-error-regexp-alist-alist):
+	Disallow filenames containing " -" to avoid confusion with libtool
+	compilation messages.  Suggested by Stefan Monnier.
+
+2006-09-15  David Kastrup  <dak@gnu.org>
+
+	* mouse-sel.el (mouse-sel-follow-link-p): Use event position
+	instead of buffer position for `mouse-on-link-p'.
+
+	* mouse.el (mouse-posn-property): New function looking up the
+	properties at a click position in overlays and text properties in
+	either buffer or strings.
+	(mouse-on-link-p): Use `mouse-posn-property' to streamline lookup
+	of both `follow-link' as well as `mouse-face' properties.
+	(mouse-drag-track): Check `mouse-on-link-p' on event position, not
+	buffer position.
+
+	* help.el (describe-key-briefly): When reading a down-event on
+	mode lines or scroll bar, swallow the following up event, too.
+	Use the new mouse sensitity of `key-binding' for lookup.
+	(describe-key): The same here.
+
+2006-09-15  Juanma Barranquero  <lekktu@gmail.com>
+
+	* play/life.el (life-patterns): Add a few more interesting patterns.
+	(life-setup): Force `show-trailing-whitespace' to nil.
+
+2006-09-14  Richard Stallman  <rms@gnu.org>
+
+	* startup.el (fancy-splash-text): Change text to improve alignment.
+	(fancy-splash-screens): Don't set non-standard tab width.
+	Bind cursor-type temporarily, and make it easy to patch to
+	preserve the splash buffer.
+	(normal-splash-screen, fancy-splash-tail): Spell out "Meta-x".
+	(fancy-splash-screens): Display echo-area message explicitly.
+	Don't set fancy-splash-help-echo.
+
+	* simple.el (line-number-mode): Group mode-line instead of
+	editing-basics.
+	(column-number-mode, size-indication-mode): Likewise.
+
+	* faces.el (mode-line-faces): Group mode-line instead of modeline.
+
+	* time.el (display-time): Group mode-line instead of modeline.
+
+	* cus-edit.el (mode-line): Rename from modeline.  All uses changed.
+
+2006-09-14  Chong Yidong  <cyd@stupidchicken.com>
+
+	* startup.el (fancy-splash-text): Move editing instructions to
+	fancy-splash-head.
+	(fancy-splash-head): Issue editing instructions.
+	(fancy-splash-screens): Fixup whitespace.
+
+2006-09-14  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* bindings.el (mode-line-buffer-identification-keymap):
+	Remove duplicate line.
+
+2006-09-14  Micha,Ak(Bl Cadilhac  <michael.cadilhac@lrde.org>
+
+	* ido.el (ido-ignore-item-p): Allow any kind of functions in
+	ignore lists.
+
+2006-09-14  Kim F. Storm  <storm@cua.dk>
+
+	* jit-lock.el (jit-lock-fontify-again): New function.
+	(jit-lock-fontify-now): Use it instead of lambda form.
+
 2006-09-13  Agustin Martin  <agustin.martin@hispalinux.es>
 
 	* textmodes/flyspell.el (flyspell-word, flyspell-correct-word)
 	(flyspell-auto-correct-word): Make ispell-filter local to these
 	functions.  Check that ispell-filter has new stuff before calling
 	ispell-parse-output.
- 
+
 2006-09-13  Kim F. Storm  <storm@cua.dk>
 
 	* simple.el (line-move-partial): Optimize.
 
 2006-09-13  Richard Stallman  <rms@gnu.org>
 
-	* thingatpt.el (thing-at-point-bounds-of-url-at-point): Delete spurious backquote.
+	* thingatpt.el (thing-at-point-bounds-of-url-at-point):
+	Delete spurious backquote.
 
 2006-09-07  Ryan Yeske  <rcyeske@gmail.com>
 
--- a/lisp/allout.el	Thu Sep 14 09:24:00 2006 +0000
+++ b/lisp/allout.el	Wed Sep 20 06:04:23 2006 +0000
@@ -698,9 +698,11 @@
         ("*" allout-rebullet-current-heading)
         ("#" allout-number-siblings)
         ("\C-k" allout-kill-line t)
+        ("\M-k" allout-copy-line-as-kill t)
         ("\C-y" allout-yank t)
         ("\M-y" allout-yank-pop t)
         ("\C-k" allout-kill-topic)
+        ("\M-k" allout-copy-topic-as-kill)
                                         ; Miscellaneous commands:
 	;([?\C-\ ] allout-mark-topic)
         ("@" allout-resolve-xref)
@@ -847,18 +849,37 @@
 (defvar allout-bullets-string-len 0
   "Length of current buffers' `allout-plain-bullets-string'.")
 (make-variable-buffer-local 'allout-bullets-string-len)
+;;;_   = allout-depth-specific-regexp
+(defvar allout-depth-specific-regexp ""
+  "*Regular expression to match a heading line prefix for a particular depth.
+
+This expression is used to search for depth-specific topic
+headers at depth 2 and greater.  Use `allout-depth-one-regexp'
+for to seek topics at depth one.
+
+This var is set according to the user configuration vars by
+`set-allout-regexp'.  It is prepared with format strings for two
+decimal numbers, which should each be one less than the depth of the
+topic prefix to be matched.")
+(make-variable-buffer-local 'allout-depth-specific-regexp)
+;;;_   = allout-depth-one-regexp
+(defvar allout-depth-one-regexp ""
+  "*Regular expression to match a heading line prefix for depth one.
+
+This var is set according to the user configuration vars by
+`set-allout-regexp'.  It is prepared with format strings for two
+decimal numbers, which should each be one less than the depth of the
+topic prefix to be matched.")
+(make-variable-buffer-local 'allout-depth-one-regexp)
 ;;;_   = allout-line-boundary-regexp
 (defvar allout-line-boundary-regexp ()
   "`allout-regexp' with outline style beginning-of-line anchor.
 
-This is properly set when `allout-regexp' is produced by
-`set-allout-regexp', so that (match-beginning 2) and (match-end
-2) delimit the prefix.")
+This is properly set by `set-allout-regexp'.")
 (make-variable-buffer-local 'allout-line-boundary-regexp)
 ;;;_   = allout-bob-regexp
 (defvar allout-bob-regexp ()
-  "Like `allout-line-boundary-regexp', for headers at beginning of buffer.
-\(match-beginning 2) and \(match-end 2) delimit the prefix.")
+  "Like `allout-line-boundary-regexp', for headers at beginning of buffer.")
 (make-variable-buffer-local 'allout-bob-regexp)
 ;;;_   = allout-header-subtraction
 (defvar allout-header-subtraction (1- (length allout-header-prefix))
@@ -869,7 +890,14 @@
   "Length of `allout-plain-bullets-string', updated by `set-allout-regexp'.")
 (make-variable-buffer-local 'allout-plain-bullets-string-len)
 
-
+;;;_   = allout-doublecheck-at-and-shallower
+(defconst allout-doublecheck-at-and-shallower 3
+  "Verify apparent topics of this depth and shallower as being non-aberrant.
+
+Verified with `allout-aberrant-container-p'.  This check's usefulness is
+limited to shallow prospects, because the determination of aberrance
+depends on the mistaken item being followed by a legitimate item of
+excessively greater depth.")
 ;;;_   X allout-reset-header-lead (header-lead)
 (defun allout-reset-header-lead (header-lead)
   "*Reset the leading string used to identify topic headers."
@@ -961,7 +989,9 @@
   "Generate proper topic-header regexp form for outline functions.
 
 Works with respect to `allout-plain-bullets-string' and
-`allout-distinctive-bullets-string'."
+`allout-distinctive-bullets-string'.
+
+Also refresh various data structures that hinge on the regexp."
 
   (interactive)
   ;; Derive allout-bullets-string from user configured components:
@@ -996,19 +1026,84 @@
   ;; Derive next for repeated use in allout-pending-bullet:
   (setq allout-plain-bullets-string-len (length allout-plain-bullets-string))
   (setq allout-header-subtraction (1- (length allout-header-prefix)))
-  ;; Produce the new allout-regexp:
-  (setq allout-regexp (concat "\\("
-                              (regexp-quote allout-header-prefix)
-                              "[ \t]*["
-                              allout-bullets-string
-                              "]\\)\\|"
-                              (regexp-quote allout-primary-bullet)
-                              "+\\|\^l"))
-  (setq allout-line-boundary-regexp
-        (concat "\\(\n\\)\\(" allout-regexp "\\)"))
-  (setq allout-bob-regexp
-        (concat "\\(\\`\\)\\(" allout-regexp "\\)"))
-  )
+
+  (let (new-part old-part)
+    (setq new-part (concat "\\("
+                           (regexp-quote allout-header-prefix)
+                           "[ \t]*"
+                           ;; already regexp-quoted in a custom way:
+                           "[" allout-bullets-string "]"
+                           "\\)")
+          old-part (concat "\\("
+                           (regexp-quote allout-primary-bullet)
+                           "\\|"
+                           (regexp-quote allout-header-prefix)
+                           "\\)"
+                           "+"
+                           " ?[^" allout-primary-bullet "]")
+          allout-regexp (concat new-part
+                                "\\|"
+                                old-part
+                                "\\|\^l")
+
+          allout-line-boundary-regexp (concat "\n" new-part
+                                              "\\|"
+                                              "\n" old-part)
+
+          allout-bob-regexp (concat "\\`" new-part
+                                    "\\|"
+                                    "\\`" old-part))
+
+    (setq allout-depth-specific-regexp
+          (concat "\\(^\\|\\`\\)"
+                  "\\("
+
+                  ;; new-style spacers-then-bullet string:
+                  "\\("
+                  (allout-format-quote (regexp-quote allout-header-prefix))
+                  " \\{%s\\}"
+                  "[" (allout-format-quote allout-bullets-string) "]"
+                  "\\)"
+
+                  ;; old-style all-bullets string, if primary not multi-char:
+                  (if (< 0 allout-header-subtraction)
+                      ""
+                    (concat "\\|\\("
+                            (allout-format-quote
+                             (regexp-quote allout-primary-bullet))
+                            (allout-format-quote
+                             (regexp-quote allout-primary-bullet))
+                            (allout-format-quote
+                             (regexp-quote allout-primary-bullet))
+                            "\\{%s\\}"
+                            ;; disqualify greater depths:
+                            "[^"
+                            (allout-format-quote allout-primary-bullet)
+                            "]\\)"
+                            ))
+                  "\\)"
+                  ))
+    (setq allout-depth-one-regexp
+          (concat "\\(^\\|\\`\\)"
+                  "\\("
+
+                  "\\("
+                  (regexp-quote allout-header-prefix)
+                  ;; disqualify any bullet char following any amount of
+                  ;; intervening whitespace:
+                  " *"
+                  (concat "[^ " allout-bullets-string "]")
+                  "\\)"
+                  (if (< 0 allout-header-subtraction)
+                      ;; Need not support anything like the old
+                      ;; bullet style if the prefix is multi-char.
+                      ""
+                    (concat "\\|"
+                            (regexp-quote allout-primary-bullet)
+                            ;; disqualify deeper primary-bullet sequences:
+                            "[^" allout-primary-bullet "]"))
+                  "\\)"
+                  ))))
 ;;;_  : Key bindings
 ;;;_   = allout-mode-map
 (defvar allout-mode-map nil "Keybindings for (allout) outline minor mode.")
@@ -1142,7 +1237,7 @@
       (if (not (symbolp name))
           (error "Pair's name, %S, must be a symbol, not %s"
                  name (type-of name)))
-      (setq prior-value (condition-case err
+      (setq prior-value (condition-case nil
                             (symbol-value name)
                           (void-variable nil)))
       (when (not (assoc name allout-mode-prior-settings))
@@ -1186,7 +1281,7 @@
 ;;;_   > allout-unprotected (expr)
 (defmacro allout-unprotected (expr)
   "Enable internal outline operations to alter invisible text."
-  `(let ((inhibit-read-only t)
+  `(let ((inhibit-read-only (if (not buffer-read-only) t))
          (inhibit-field-text-motion t))
      ,expr))
 ;;;_   = allout-mode-hook
@@ -1600,7 +1695,9 @@
 	Topic-oriented Killing and Yanking:
 	----------------------------------
 \\[allout-kill-topic]	allout-kill-topic	Kill current topic, including offspring.
-\\[allout-kill-line]	allout-kill-line	Like kill-line, but reconciles numbering, etc.
+\\[allout-copy-topic-as-kill]	allout-copy-topic-as-kill Copy current topic, including offspring.
+\\[allout-kill-line]	allout-kill-line	kill-line, attending to outline structure.
+\\[allout-copy-line-as-kill]	allout-copy-line-as-kill Copy line but don't delete it.
 \\[allout-yank]	allout-yank		Yank, adjusting depth of yanked topic to
 				depth of heading if yanking into bare topic
 				heading (ie, prefix sans text).
@@ -1792,8 +1889,7 @@
       (remove-from-invisibility-spec '(allout . t))
       (remove-hook 'pre-command-hook 'allout-pre-command-business t)
       (remove-hook 'post-command-hook 'allout-post-command-business t)
-      (when (featurep 'xemacs)
-        (remove-hook 'before-change-functions 'allout-before-change-handler t))
+      (remove-hook 'before-change-functions 'allout-before-change-handler t)
       (remove-hook 'isearch-mode-end-hook 'allout-isearch-end-handler t)
       (remove-hook write-file-hook-var-name 'allout-write-file-hook-handler t)
       (remove-hook 'auto-save-hook 'allout-auto-save-hook-handler t)
@@ -1813,7 +1909,7 @@
 
       (allout-overlay-preparations)     ; Doesn't hurt to redo this.
 
-      (allout-infer-header-lead)
+      (allout-infer-header-lead-and-primary-bullet)
       (allout-infer-body-reindent)
 
       (set-allout-regexp)
@@ -1854,9 +1950,8 @@
       (allout-add-resumptions '(line-move-ignore-invisible t))
       (add-hook 'pre-command-hook 'allout-pre-command-business nil t)
       (add-hook 'post-command-hook 'allout-post-command-business nil t)
-      (when (featurep 'xemacs)
-        (add-hook 'before-change-functions 'allout-before-change-handler
-                  nil t))
+      (add-hook 'before-change-functions 'allout-before-change-handler
+                nil t)
       (add-hook 'isearch-mode-end-hook 'allout-isearch-end-handler nil t)
       (add-hook write-file-hook-var-name 'allout-write-file-hook-handler
                 nil t)
@@ -1996,18 +2091,20 @@
 (defun allout-before-change-handler (beg end)
   "Protect against changes to invisible text.
 
-See allout-overlay-interior-modification-handler for details.
-
-This before-change handler is used only where modification-hooks
-overlay property is not supported."
+See allout-overlay-interior-modification-handler for details."
+
+  (if (and (allout-mode-p) undo-in-progress (allout-hidden-p))
+      (allout-show-to-offshoot))
+
   ;; allout-overlay-interior-modification-handler on an overlay handles
   ;; this in other emacs, via `allout-exposure-category's 'modification-hooks.
   (when (and (featurep 'xemacs) (allout-mode-p))
     ;; process all of the pending overlays:
-    (dolist (overlay (overlays-in beg end))
-      (if (eq (overlay-get ol 'invisible) 'allout)
-          (allout-overlay-interior-modification-handler
-             overlay nil beg end nil)))))
+    (save-excursion
+      (got-char beg)
+      (let ((overlay (allout-get-invisibility-overlay)))
+	(allout-overlay-interior-modification-handler
+	 overlay nil beg end nil)))))
 ;;;_  > allout-isearch-end-handler (&optional overlay)
 (defun allout-isearch-end-handler (&optional overlay)
   "Reconcile allout outline exposure on arriving in hidden text after isearch.
@@ -2035,19 +2132,35 @@
 (defvar allout-recent-prefix-end 0
   "Buffer point of the end of the last topic prefix encountered.")
 (make-variable-buffer-local 'allout-recent-prefix-end)
+;;;_  = allout-recent-depth
+(defvar allout-recent-depth 0
+  "Depth of the last topic prefix encountered.")
+(make-variable-buffer-local 'allout-recent-depth)
 ;;;_  = allout-recent-end-of-subtree
 (defvar allout-recent-end-of-subtree 0
   "Buffer point last returned by `allout-end-of-current-subtree'.")
 (make-variable-buffer-local 'allout-recent-end-of-subtree)
-;;;_  > allout-prefix-data (beg end)
-(defmacro allout-prefix-data (beg end)
-  "Register allout-prefix state data - BEGINNING and END of prefix.
+;;;_  > allout-prefix-data ()
+(defsubst allout-prefix-data ()
+  "Register allout-prefix state data.
 
 For reference by `allout-recent' funcs.  Returns BEGINNING."
-  `(setq allout-recent-prefix-end ,end
-         allout-recent-prefix-beginning ,beg))
+  (setq allout-recent-prefix-end (or (match-end 1) (match-end 2))
+        allout-recent-prefix-beginning (or (match-beginning 1)
+                                           (match-beginning 2))
+        allout-recent-depth (max 1 (- allout-recent-prefix-end
+                                      allout-recent-prefix-beginning
+                                      allout-header-subtraction)))
+  allout-recent-prefix-beginning)
+;;;_  > nullify-allout-prefix-data ()
+(defsubst nullify-allout-prefix-data ()
+  "Mark allout prefix data as being uninformative."
+  (setq allout-recent-prefix-end (point)
+        allout-recent-prefix-beginning (point)
+        allout-recent-depth 0)
+  allout-recent-prefix-beginning)
 ;;;_  > allout-recent-depth ()
-(defmacro allout-recent-depth ()
+(defsubst allout-recent-depth ()
   "Return depth of last heading encountered by an outline maneuvering function.
 
 All outline functions which directly do string matches to assess
@@ -2055,19 +2168,17 @@
 `allout-recent-prefix-end' if successful.  This function uses those settings
 to return the current depth."
 
-  '(max 1 (- allout-recent-prefix-end
-	     allout-recent-prefix-beginning
-	     allout-header-subtraction)))
+  allout-recent-depth)
 ;;;_  > allout-recent-prefix ()
-(defmacro allout-recent-prefix ()
+(defsubst allout-recent-prefix ()
   "Like `allout-recent-depth', but returns text of last encountered prefix.
 
 All outline functions which directly do string matches to assess
 headings set the variables `allout-recent-prefix-beginning' and
 `allout-recent-prefix-end' if successful.  This function uses those settings
-to return the current depth."
-  '(buffer-substring allout-recent-prefix-beginning
-		     allout-recent-prefix-end))
+to return the current prefix."
+  (buffer-substring-no-properties allout-recent-prefix-beginning
+                                  allout-recent-prefix-end))
 ;;;_  > allout-recent-bullet ()
 (defmacro allout-recent-bullet ()
   "Like allout-recent-prefix, but returns bullet of last encountered prefix.
@@ -2076,8 +2187,8 @@
 headings set the variables `allout-recent-prefix-beginning' and
 `allout-recent-prefix-end' if successful.  This function uses those settings
 to return the current depth of the most recently matched topic."
-  '(buffer-substring (1- allout-recent-prefix-end)
-		     allout-recent-prefix-end))
+  '(buffer-substring-no-properties (1- allout-recent-prefix-end)
+                                   allout-recent-prefix-end))
 
 ;;;_ #4 Navigation
 
@@ -2091,7 +2202,8 @@
   (save-excursion
     (allout-beginning-of-current-line)
     (and (looking-at allout-regexp)
-	 (allout-prefix-data (match-beginning 0) (match-end 0)))))
+         (not (allout-aberrant-container-p))
+	 (allout-prefix-data))))
 ;;;_    > allout-on-heading-p ()
 (defalias 'allout-on-heading-p 'allout-on-current-heading-p)
 ;;;_    > allout-e-o-prefix-p ()
@@ -2101,6 +2213,51 @@
                          (beginning-of-line))
 		       (looking-at allout-regexp))
        (= (point)(save-excursion (allout-end-of-prefix)(point)))))
+;;;_    > allout-aberrant-container-p ()
+(defun allout-aberrant-container-p ()
+  "True if topic, or next sibling with children, contains them discontinuously.
+
+Discontinuous means an immediate offspring that is nested more
+than one level deeper than the topic.
+
+If topic has no offspring, then the next sibling with offspring will
+determine whether or not this one is determined to be aberrant.
+
+If true, then the allout-recent-* settings are calibrated on the
+offspring that qaulifies it as aberrant, ie with depth that
+exceeds the topic by more than one."
+
+  ;; This is most clearly understood when considering standard-prefix-leader
+  ;; low-level topics, which can all too easily match text not intended as
+  ;; headers.  For example, any line with a leading '.' or '*' and lacking a
+  ;; following bullet qualifies without this protection.  (A sequence of
+  ;; them can occur naturally, eg a typical textual bullet list.)  We
+  ;; disqualify such low-level sequences when they are followed by a
+  ;; discontinuously contained child, inferring that the sequences are not
+  ;; actually connected with their prospective context.
+
+  (let ((depth (allout-depth))
+        (start-point (point))
+        done aberrant)
+    (save-excursion
+      (while (and (not done)
+                  (re-search-forward allout-line-boundary-regexp nil 0))
+        (allout-prefix-data)
+        (goto-char allout-recent-prefix-beginning)
+        (cond
+         ;; sibling - continue:
+         ((eq allout-recent-depth depth)) 
+         ;; first offspring is excessive - aberrant:
+         ((> allout-recent-depth (1+ depth))
+          (setq done t aberrant t))
+         ;; next non-sibling is lower-depth - not aberrant:
+         (t (setq done t)))))
+    (if aberrant
+        aberrant
+      (goto-char start-point)
+      ;; recalibrate allout-recent-*
+      (allout-depth)
+      nil)))
 ;;;_   : Location attributes
 ;;;_    > allout-depth ()
 (defun allout-depth ()
@@ -2113,10 +2270,10 @@
     (let ((start-point (point)))
       (if (and (allout-goto-prefix)
                (not (< start-point (point))))
-          (allout-recent-depth)
+          allout-recent-depth
         (progn
-          ;; Oops, no prefix, zero prefix data:
-          (allout-prefix-data (point)(point))
+          ;; Oops, no prefix, nullify it:
+          (nullify-allout-prefix-data)
           ;; ... and return 0:
           0)))))
 ;;;_    > allout-current-depth ()
@@ -2149,10 +2306,10 @@
   (condition-case nil
       (save-excursion
 	(allout-back-to-current-heading)
-	(buffer-substring (- allout-recent-prefix-end 1)
-			  allout-recent-prefix-end))
+	(buffer-substring-no-properties (- allout-recent-prefix-end 1)
+                                        allout-recent-prefix-end))
     ;; Quick and dirty provision, ostensibly for missing bullet:
-    ('args-out-of-range nil))
+    (args-out-of-range nil))
   )
 ;;;_    > allout-get-prefix-bullet (prefix)
 (defun allout-get-prefix-bullet (prefix)
@@ -2160,7 +2317,7 @@
   ;; Doesn't make sense if we're old-style prefixes, but this just
   ;; oughtn't be called then, so forget about it...
   (if (string-match allout-regexp prefix)
-      (substring prefix (1- (match-end 0)) (match-end 0))))
+      (substring prefix (1- (match-end 2)) (match-end 2))))
 ;;;_    > allout-sibling-index (&optional depth)
 (defun allout-sibling-index (&optional depth)
   "Item number of this prospective topic among its siblings.
@@ -2174,10 +2331,10 @@
     (cond ((and depth (<= depth 0) 0))
           ((or (not depth) (= depth (allout-depth)))
            (let ((index 1))
-             (while (allout-previous-sibling (allout-recent-depth) nil)
+             (while (allout-previous-sibling allout-recent-depth nil)
 	       (setq index (1+ index)))
              index))
-          ((< depth (allout-recent-depth))
+          ((< depth allout-recent-depth)
            (allout-ascend-to-depth depth)
            (allout-sibling-index))
           (0))))
@@ -2229,11 +2386,17 @@
   (if (or (not allout-beginning-of-line-cycles)
           (not (equal last-command this-command)))
       (move-beginning-of-line 1)
-    (let ((beginning-of-body (save-excursion
-                               (allout-beginning-of-current-entry)
-                               (point))))
+    (allout-depth)
+    (let ((beginning-of-body
+           (save-excursion
+             (while (and (<= allout-recent-depth
+                             allout-doublecheck-at-and-shallower)
+                         (allout-aberrant-container-p)
+                         (allout-previous-visible-heading 1)))
+             (allout-beginning-of-current-entry)
+             (point))))
       (cond ((= (current-column) 0)
-             (allout-beginning-of-current-entry))
+             (goto-char beginning-of-body))
             ((< (point) beginning-of-body)
              (allout-beginning-of-current-line))
             ((= (point) beginning-of-body)
@@ -2241,7 +2404,7 @@
             (t (allout-beginning-of-current-line)
                (if (< (point) beginning-of-body)
                    ;; we were on the headline after its start:
-                   (allout-beginning-of-current-entry)))))))
+                   (goto-char beginning-of-body)))))))
 ;;;_   > allout-end-of-line ()
 (defun allout-end-of-line ()
   "End-of-line with `allout-end-of-line-cycles' behavior, if set."
@@ -2261,6 +2424,7 @@
                                      (allout-hidden-p)))
              (allout-back-to-current-heading)
              (allout-show-current-entry)
+             (allout-show-children)
              (allout-end-of-entry))
             ((>= (point) end-of-entry)
              (allout-back-to-current-heading)
@@ -2270,40 +2434,49 @@
 (defsubst allout-next-heading ()
   "Move to the heading for the topic \(possibly invisible) after this one.
 
-Returns the location of the heading, or nil if none found."
-
-  (if (and (bobp) (not (eobp)) (looking-at allout-regexp))
+Returns the location of the heading, or nil if none found.
+
+We skip anomolous low-level topics, a la `allout-aberrant-container-p'."
+  (if (looking-at allout-regexp)
       (forward-char 1))
 
-  (if (re-search-forward allout-line-boundary-regexp nil 0)
-      (allout-prefix-data		; Got valid location state - set vars:
-       (goto-char (or (match-beginning 2)
-		      allout-recent-prefix-beginning))
-       (or (match-end 2) allout-recent-prefix-end))))
+  (when (re-search-forward allout-line-boundary-regexp nil 0)
+    (allout-prefix-data)
+    (and (<= allout-recent-depth allout-doublecheck-at-and-shallower)
+         ;; this will set allout-recent-* on the first non-aberrant topic,
+         ;; whether it's the current one or one that disqualifies it:
+         (allout-aberrant-container-p))
+    (goto-char allout-recent-prefix-beginning)))
 ;;;_   > allout-this-or-next-heading
 (defun allout-this-or-next-heading ()
   "Position cursor on current or next heading."
   ;; A throwaway non-macro that is defined after allout-next-heading
   ;; and usable by allout-mode.
-  (if (not (allout-goto-prefix)) (allout-next-heading)))
+  (if (not (allout-goto-prefix-doublechecked)) (allout-next-heading)))
 ;;;_   > allout-previous-heading ()
-(defmacro allout-previous-heading ()
+(defun allout-previous-heading ()
   "Move to the prior \(possibly invisible) heading line.
 
-Return the location of the beginning of the heading, or nil if not found."
-
-  '(if (bobp)
-       nil
-     (allout-goto-prefix)
-     (if
-	 ;; searches are unbounded and return nil if failed:
-	 (or (re-search-backward allout-line-boundary-regexp nil 0)
-	     (looking-at allout-bob-regexp))
-	 (progn				; Got valid location state - set vars:
-	   (allout-prefix-data
-	    (goto-char (or (match-beginning 2)
-			   allout-recent-prefix-beginning))
-	    (or (match-end 2) allout-recent-prefix-end))))))
+Return the location of the beginning of the heading, or nil if not found.
+
+We skip anomolous low-level topics, a la `allout-aberrant-container-p'."
+
+  (if (bobp)
+      nil
+    ;; allout-goto-prefix-doublechecked calls us, so we can't use it here.
+    (let ((start-point (point)))
+      (allout-goto-prefix)
+      (when (or (re-search-backward allout-line-boundary-regexp nil 0)
+                (looking-at allout-bob-regexp))
+        (goto-char (allout-prefix-data))
+        (if (and (<= allout-recent-depth allout-doublecheck-at-and-shallower)
+                 (allout-aberrant-container-p))
+            (or (allout-previous-heading)
+                (and (goto-char start-point)
+                     ;; recalibrate allout-recent-*:
+                     (allout-depth)
+                     nil))
+          (point))))))
 ;;;_   > allout-get-invisibility-overlay ()
 (defun allout-get-invisibility-overlay ()
   "Return the overlay at point that dictates allout invisibility."
@@ -2311,7 +2484,8 @@
         got)
     (while (and overlays (not got))
       (if (equal (overlay-get (car overlays) 'invisible) 'allout)
-          (setq got (car overlays))))
+          (setq got (car overlays))
+        (pop overlays)))
     got))
 ;;;_   > allout-back-to-visible-text ()
 (defun allout-back-to-visible-text ()
@@ -2324,11 +2498,8 @@
 ;;;_   " These routines either produce or assess charts, which are
 ;;; nested lists of the locations of topics within a subtree.
 ;;;
-;;; Use of charts enables efficient navigation of subtrees, by
-;;; requiring only a single regexp-search based traversal, to scope
-;;; out the subtopic locations.  The chart then serves as the basis
-;;; for assessment or adjustment of the subtree, without redundant
-;;; traversal of the structure.
+;;; Charts enable efficient subtree navigation by providing a reusable basis
+;;; for elaborate, compound assessment and adjustment of a subtree.
 
 ;;;_   > allout-chart-subtree (&optional levels visible orig-depth prev-depth)
 (defun allout-chart-subtree (&optional levels visible orig-depth prev-depth)
@@ -2348,12 +2519,12 @@
 routines need assess the structure only once, and then use the chart
 for their elaborate manipulations.
 
-Topics are entered in the chart so the last one is at the car.
-The entry for each topic consists of an integer indicating the point
-at the beginning of the topic.  Charts for offspring consists of a
-list containing, recursively, the charts for the respective subtopics.
-The chart for a topics' offspring precedes the entry for the topic
-itself.
+The chart entries for the topics are in reverse order, so the
+last topic is listed first.  The entry for each topic consists of
+an integer indicating the point at the beginning of the topic
+prefix.  Charts for offspring consists of a list containing,
+recursively, the charts for the respective subtopics.  The chart
+for a topics' offspring precedes the entry for the topic itself.
 
 The other function parameters are for internal recursion, and should
 not be specified by external callers.  ORIG-DEPTH is depth of topic at
@@ -2380,17 +2551,17 @@
 
     (while (and (not (eobp))
 					; Still within original topic?
-		(< orig-depth (setq curr-depth (allout-recent-depth)))
+		(< orig-depth (setq curr-depth allout-recent-depth))
 		(cond ((= prev-depth curr-depth)
 		       ;; Register this one and move on:
-		       (setq chart (cons (point) chart))
+		       (setq chart (cons allout-recent-prefix-beginning chart))
 		       (if (and levels (<= levels 1))
 			   ;; At depth limit - skip sublevels:
 			   (or (allout-next-sibling curr-depth)
 			       ;; or no more siblings - proceed to
 			       ;; next heading at lesser depth:
 			       (while (and (<= curr-depth
-					       (allout-recent-depth))
+					       allout-recent-depth)
                                            (if visible
                                                (allout-next-visible-heading 1)
                                              (allout-next-heading)))))
@@ -2437,11 +2608,11 @@
 Effectively a top-level chart of siblings.  See `allout-chart-subtree'
 for an explanation of charts."
   (save-excursion
-    (if (allout-goto-prefix)
-	(let ((chart (list (point))))
-	  (while (allout-next-sibling)
-	    (setq chart (cons (point) chart)))
-	  (if chart (setq chart (nreverse chart)))))))
+    (when (allout-goto-prefix-doublechecked)
+      (let ((chart (list (point))))
+        (while (allout-next-sibling)
+          (setq chart (cons (point) chart)))
+        (if chart (setq chart (nreverse chart)))))))
 ;;;_   > allout-chart-to-reveal (chart depth)
 (defun allout-chart-to-reveal (chart depth)
 
@@ -2514,15 +2685,25 @@
 		(search-backward "\n" nil 1))
       (forward-char 1)
       (if (looking-at allout-regexp)
-	  (setq done (allout-prefix-data (match-beginning 0)
-					  (match-end 0)))
+	  (setq done (allout-prefix-data))
 	(forward-char -1)))
     (if (bobp)
 	(cond ((looking-at allout-regexp)
-	       (allout-prefix-data (match-beginning 0)(match-end 0)))
+	       (allout-prefix-data))
 	      ((allout-next-heading))
 	      (done))
       done)))
+;;;_   > allout-goto-prefix-doublechecked ()
+(defun allout-goto-prefix-doublechecked ()
+  "Put point at beginning of immediately containing outline topic.
+
+Like `allout-goto-prefix', but shallow topics \(according to `allout-doublecheck-at-and-shallower') are checked and disqualified for child containment discontinuity, according to `allout-aberrant-container-p'."
+  (allout-goto-prefix)
+  (if (and (<= allout-recent-depth allout-doublecheck-at-and-shallower)
+           (allout-aberrant-container-p))
+      (allout-previous-heading)
+    (point)))
+
 ;;;_   > allout-end-of-prefix ()
 (defun allout-end-of-prefix (&optional ignore-decorations)
   "Position cursor at beginning of header text.
@@ -2530,24 +2711,22 @@
 If optional IGNORE-DECORATIONS is non-nil, put just after bullet,
 otherwise skip white space between bullet and ensuing text."
 
-  (if (not (allout-goto-prefix))
+  (if (not (allout-goto-prefix-doublechecked))
       nil
-    (let ((match-data (match-data)))
-      (goto-char (match-end 0))
-      (if ignore-decorations
-	  t
-	(while (looking-at "[0-9]") (forward-char 1))
-	(if (and (not (eolp)) (looking-at "\\s-")) (forward-char 1)))
-      (store-match-data match-data))
+    (goto-char allout-recent-prefix-end)
+    (if ignore-decorations
+        t
+      (while (looking-at "[0-9]") (forward-char 1))
+      (if (and (not (eolp)) (looking-at "\\s-")) (forward-char 1)))
     ;; Reestablish where we are:
     (allout-current-depth)))
 ;;;_   > allout-current-bullet-pos ()
 (defun allout-current-bullet-pos ()
   "Return position of current \(visible) topic's bullet."
 
- (if (not (allout-current-depth))
+  (if (not (allout-current-depth))
       nil
-   (1- (match-end 0))))
+    (1- allout-recent-prefix-end)))
 ;;;_   > allout-back-to-current-heading ()
 (defun allout-back-to-current-heading ()
   "Move to heading line of current topic, or beginning if already on the line.
@@ -2562,11 +2741,9 @@
                (progn (while (allout-hidden-p)
                         (allout-beginning-of-current-line)
                         (if (not (looking-at allout-regexp))
-                            (re-search-backward (concat
-                                                 "^\\(" allout-regexp "\\)")
+                            (re-search-backward allout-regexp
                                                 nil 'move)))
-                      (allout-prefix-data (match-beginning 1)
-                                          (match-end 1)))))
+                      (allout-prefix-data))))
       (if (interactive-p)
           (allout-end-of-prefix)
         (point))))
@@ -2578,9 +2755,8 @@
 
 Returns that character position."
 
-  (if (re-search-forward allout-line-boundary-regexp nil 'move)
-      (prog1 (goto-char (match-beginning 0))
-             (allout-prefix-data (match-beginning 2)(match-end 2)))))
+  (if (allout-next-heading)
+      (goto-char (1- allout-recent-prefix-beginning))))
 ;;;_   > allout-end-of-subtree (&optional current include-trailing-blank)
 (defun allout-end-of-subtree (&optional current include-trailing-blank)
   "Put point at the end of the last leaf in the containing topic.
@@ -2596,11 +2772,11 @@
   (interactive "P")
   (if current
       (allout-back-to-current-heading)
-    (allout-goto-prefix))
-  (let ((level (allout-recent-depth)))
+    (allout-goto-prefix-doublechecked))
+  (let ((level allout-recent-depth))
     (allout-next-heading)
     (while (and (not (eobp))
-                (> (allout-recent-depth) level))
+                (> allout-recent-depth level))
       (allout-next-heading))
     (if (eobp)
         (allout-end-of-entry)
@@ -2629,6 +2805,9 @@
   (interactive)
   (let ((start-point (point)))
     (move-beginning-of-line 1)
+    (if (< 0 (allout-current-depth))
+        (goto-char allout-recent-prefix-end)
+      (goto-char (point-min)))
     (allout-end-of-prefix)
     (if (and (interactive-p)
 	     (= (point) start-point))
@@ -2676,23 +2855,18 @@
 (defun allout-ascend-to-depth (depth)
   "Ascend to depth DEPTH, returning depth if successful, nil if not."
   (if (and (> depth 0)(<= depth (allout-depth)))
-      (let ((last-good (point)))
-        (while (and (< depth (allout-depth))
-                    (setq last-good (point))
-                    (allout-beginning-of-level)
-                    (allout-previous-heading)))
-        (if (= (allout-recent-depth) depth)
-            (progn (goto-char allout-recent-prefix-beginning)
-                   depth)
-          (goto-char last-good)
-          nil))
-    (if (interactive-p) (allout-end-of-prefix))))
+      (let (last-ascended)
+        (while (and (< depth allout-recent-depth)
+                    (setq last-ascended (allout-ascend))))
+        (goto-char allout-recent-prefix-beginning)
+        (if (interactive-p) (allout-end-of-prefix))
+        (and last-ascended allout-recent-depth))))
 ;;;_   > allout-ascend ()
 (defun allout-ascend ()
   "Ascend one level, returning t if successful, nil if not."
   (prog1
       (if (allout-beginning-of-level)
-	  (allout-previous-heading))
+          (allout-previous-heading))
     (if (interactive-p) (allout-end-of-prefix))))
 ;;;_   > allout-descend-to-depth (depth)
 (defun allout-descend-to-depth (depth)
@@ -2703,47 +2877,24 @@
         (start-depth (allout-depth)))
     (while
         (and (> (allout-depth) 0)
-             (not (= depth (allout-recent-depth))) ; ... not there yet
+             (not (= depth allout-recent-depth)) ; ... not there yet
              (allout-next-heading)     ; ... go further
-             (< start-depth (allout-recent-depth)))) ; ... still in topic
+             (< start-depth allout-recent-depth))) ; ... still in topic
     (if (and (> (allout-depth) 0)
-             (= (allout-recent-depth) depth))
+             (= allout-recent-depth depth))
         depth
       (goto-char start-point)
       nil))
   )
-;;;_   > allout-up-current-level (arg &optional dont-complain)
-(defun allout-up-current-level (arg &optional dont-complain)
-  "Move out ARG levels from current visible topic.
-
-Positions on heading line of containing topic.  Error if unable to
-ascend that far, or nil if unable to ascend but optional arg
-DONT-COMPLAIN is non-nil."
+;;;_   > allout-up-current-level (arg)
+(defun allout-up-current-level (arg)
+  "Move out ARG levels from current visible topic."
   (interactive "p")
-  (allout-back-to-current-heading)
-  (let ((present-level (allout-recent-depth))
-	(last-good (point))
-	failed)
-    ;; Loop for iterating arg:
-    (while (and (> (allout-recent-depth) 1)
-                (> arg 0)
-                (not (bobp))
-		(not failed))
-      (setq last-good (point))
-      ;; Loop for going back over current or greater depth:
-      (while (and (not (< (allout-recent-depth) present-level))
-		  (or (allout-previous-visible-heading 1)
-		      (not (setq failed present-level)))))
-      (setq present-level (allout-current-depth))
-      (setq arg (- arg 1)))
-    (if (or failed
-	    (> arg 0))
-	(progn (goto-char last-good)
-	       (if (interactive-p) (allout-end-of-prefix))
-	       (if (not dont-complain)
-		   (error "Can't ascend past outermost level")
-		 (if (interactive-p) (allout-end-of-prefix))
-		 nil))
+  (let ((start-point (point)))
+    (allout-back-to-current-heading)
+    (if (not (allout-ascend))
+        (progn (goto-char start-point)
+               (error "Can't ascend past outermost level"))
       (if (interactive-p) (allout-end-of-prefix))
       allout-recent-prefix-beginning)))
 
@@ -2756,24 +2907,101 @@
 
 Go backward if optional arg BACKWARD is non-nil.
 
-Return depth if successful, nil otherwise."
-
-  (if (and backward (bobp))
+Return the start point of the new topic if successful, nil otherwise."
+
+  (if (if backward (bobp) (eobp))
       nil
-    (let ((start-depth (or depth (allout-depth)))
+    (let ((target-depth (or depth (allout-depth)))
           (start-point (point))
+          (count 0)
+          leaping
 	  last-depth)
-      (while (and (not (if backward (bobp) (eobp)))
-                  (if backward (allout-previous-heading)
-                    (allout-next-heading))
-                  (> (setq last-depth (allout-recent-depth)) start-depth)))
-      (if (and (not (eobp))
-               (and (> (or last-depth (allout-depth)) 0)
-                    (= (allout-recent-depth) start-depth)))
-          allout-recent-prefix-beginning
-        (goto-char start-point)
-	(if depth (allout-depth) start-depth)
-        nil))))
+      (while (and
+              ;; done too few single steps to resort to the leap routine:
+              (not leaping)
+              ;; not at limit:
+              (not (if backward (bobp) (eobp)))
+              ;; still traversable:
+              (if backward (allout-previous-heading) (allout-next-heading))
+              ;; we're below the target depth
+              (> (setq last-depth allout-recent-depth) target-depth))
+        (setq count (1+ count))
+        (if (> count 7)                 ; lists are commonly 7 +- 2, right?-)
+            (setq leaping t)))
+      (cond (leaping
+             (or (allout-next-sibling-leap target-depth backward)
+                 (progn
+                   (goto-char start-point)
+                   (if depth (allout-depth) target-depth)
+                   nil)))
+            ((and (not (eobp))
+                  (and (> (or last-depth (allout-depth)) 0)
+                       (= allout-recent-depth target-depth)))
+             allout-recent-prefix-beginning)
+            (t
+             (goto-char start-point)
+             (if depth (allout-depth) target-depth)
+             nil)))))
+;;;_   > allout-next-sibling-leap (&optional depth backward)
+(defun allout-next-sibling-leap (&optional depth backward)
+  "Like `allout-next-sibling', but by direct search for topic at depth.
+
+Traverse at optional DEPTH, or current depth if none specified.
+
+Go backward if optional arg BACKWARD is non-nil.
+
+Return the start point of the new topic if successful, nil otherwise.
+
+Costs more than regular `allout-next-sibling' for short traversals:
+
+ - we have to check the prior \(next, if travelling backwards)
+   item to confirm connectivity with the prior topic, and
+ - if confirmed, we have to reestablish the allout-recent-* settings with
+   some extra navigation
+ - if confirmation fails, we have to do more work to recover
+
+It is an increasingly big win when there are many intervening
+offspring before the next sibling, however, so
+`allout-next-sibling' resorts to this if it finds itself in that
+situation."
+
+  (if (if backward (bobp) (eobp))
+      nil
+    (let* ((start-point (point))
+           (target-depth (or depth (allout-depth)))
+           (search-whitespace-regexp nil)
+           (depth-biased (- target-depth 2))
+           (expression (if (<= target-depth 1)
+                           allout-depth-one-regexp
+                         (format allout-depth-specific-regexp
+                                 depth-biased depth-biased)))
+           found
+           done)
+      (while (not done)
+        (setq found (if backward
+                        (re-search-backward expression nil 'to-limit)
+                      (forward-char 1)
+                      (re-search-forward expression nil 'to-limit)))
+        (if (and found (allout-aberrant-container-p))
+            (setq found nil))
+        (setq done (or found (if backward (bobp) (eobp)))))
+      (if (not found)
+          (progn (goto-char start-point)
+                 nil)
+        ;; rationale: if any intervening items were at a lower depth, we
+        ;; would now be on the first offspring at the target depth - ie,
+        ;; the preceeding item (per the search direction) must be at a
+        ;; lesser depth.  that's all we need to check.
+        (if backward (allout-next-heading) (allout-previous-heading))
+        (if (< allout-recent-depth target-depth)
+            ;; return to start and reestablish allout-recent-*:
+            (progn
+              (goto-char start-point)
+              (allout-depth)
+              nil)
+          (goto-char found)
+          ;; locate cursor and set allout-recent-*:
+          (allout-goto-prefix))))))
 ;;;_   > allout-previous-sibling (&optional depth backward)
 (defun allout-previous-sibling (&optional depth backward)
   "Like `allout-forward-current-level' backwards, respecting invisible topics.
@@ -2807,7 +3035,7 @@
 
   (let ((depth (allout-depth)))
     (while (allout-previous-sibling depth nil))
-    (prog1 (allout-recent-depth)
+    (prog1 allout-recent-depth
       (if (interactive-p) (allout-end-of-prefix)))))
 ;;;_   > allout-next-visible-heading (arg)
 (defun allout-next-visible-heading (arg)
@@ -2821,21 +3049,36 @@
 	 (step (if backward -1 1))
 	 prev got)
 
-    (while (> arg 0)			; limit condition
-      (while (and (not (if backward (bobp)(eobp))) ; boundary condition
-		  ;; Move, skipping over all those concealed lines:
-		  (prog1 (condition-case nil (or (line-move step) t)
-                           (error nil))
-                    (allout-beginning-of-current-line))
-		  (not (setq got (looking-at allout-regexp)))))
+    (while (> arg 0)
+      (while (and
+              ;; Boundary condition:
+              (not (if backward (bobp)(eobp)))
+              ;; Move, skipping over all concealed lines in one fell swoop:
+              (prog1 (condition-case nil (or (line-move step) t)
+                       (error nil))
+                (allout-beginning-of-current-line))
+              ;; Deal with apparent header line:
+              (if (not (looking-at allout-regexp))
+                  ;; not a header line, keep looking:
+                  t
+                (allout-prefix-data)
+                (if (and (<= allout-recent-depth
+                             allout-doublecheck-at-and-shallower)
+                         (allout-aberrant-container-p))
+                    ;; skip this aberrant prospective header line:
+                    t
+                  ;; this prospective headerline qualifies - register:
+                  (setq got allout-recent-prefix-beginning)
+                  ;; and break the loop:
+                  nil))))
       ;; Register this got, it may be the last:
       (if got (setq prev got))
       (setq arg (1- arg)))
     (cond (got				; Last move was to a prefix:
-	   (allout-prefix-data (match-beginning 0) (match-end 0))
-	   (allout-end-of-prefix))
+           (allout-end-of-prefix))
 	  (prev				; Last move wasn't, but prev was:
-	   (allout-prefix-data (match-beginning 0) (match-end 0)))
+           (goto-char prev)
+           (allout-end-of-prefix))
 	  ((not backward) (end-of-line) nil))))
 ;;;_   > allout-previous-visible-heading (arg)
 (defun allout-previous-visible-heading (arg)
@@ -2845,7 +3088,8 @@
 A heading line is one that starts with a `*' (or that `allout-regexp'
 matches)."
   (interactive "p")
-  (allout-next-visible-heading (- arg)))
+  (prog1 (allout-next-visible-heading (- arg))
+    (if (interactive-p) (allout-end-of-prefix))))
 ;;;_   > allout-forward-current-level (arg)
 (defun allout-forward-current-level (arg)
   "Position point at the next heading of the same level.
@@ -2856,38 +3100,25 @@
   (interactive "p")
   (let ((start-depth (allout-current-depth))
 	(start-arg arg)
-	(backward (> 0 arg))
-	last-depth
-	(last-good (point))
-	at-boundary)
+	(backward (> 0 arg)))
     (if (= 0 start-depth)
 	(error "No siblings, not in a topic..."))
     (if backward (setq arg (* -1 arg)))
-    (while (not (or (zerop arg)
-		    at-boundary))
-      (while (and (not (if backward (bobp) (eobp)))
-		  (if backward (allout-previous-visible-heading 1)
-		    (allout-next-visible-heading 1))
-		  (> (setq last-depth (allout-recent-depth)) start-depth)))
-      (if (and last-depth (= last-depth start-depth)
-	       (not (if backward (bobp) (eobp))))
-	  (setq last-good (point)
-		arg (1- arg))
-	(setq at-boundary t)))
-    (if (and (not (eobp))
-	     (= arg 0)
-	     (and (> (or last-depth (allout-depth)) 0)
-		  (= (allout-recent-depth) start-depth)))
-	allout-recent-prefix-beginning
-      (goto-char last-good)
-      (if (not (interactive-p))
-	  nil
-	(allout-end-of-prefix)
-	(error "Hit %s level %d topic, traversed %d of %d requested"
-	       (if backward "first" "last")
-	       (allout-recent-depth)
-	       (- (abs start-arg) arg)
-	       (abs start-arg))))))
+    (allout-back-to-current-heading)
+    (while (and (not (zerop arg))
+                (if backward
+                    (allout-previous-sibling)
+                  (allout-next-sibling)))
+      (setq arg (1- arg)))
+    (if (not (interactive-p))
+        nil
+      (allout-end-of-prefix)
+      (if (not (zerop arg))
+          (error "Hit %s level %d topic, traversed %d of %d requested"
+                 (if backward "first" "last")
+                 allout-recent-depth
+                 (- (abs start-arg) arg)
+                 (abs start-arg))))))
 ;;;_   > allout-backward-current-level (arg)
 (defun allout-backward-current-level (arg)
   "Inverse of `allout-forward-current-level'."
@@ -2977,34 +3208,41 @@
 
 Returns the qualifying command, if any, else nil."
   (interactive)
-  (let* ((key-num (cond ((numberp last-command-char) last-command-char)
+  (let* ((key-string (if (numberp last-command-char)
+                         (char-to-string last-command-char)))
+         (key-num (cond ((numberp last-command-char) last-command-char)
                         ;; for XEmacs character type:
                         ((and (fboundp 'characterp)
                               (apply 'characterp (list last-command-char)))
                          (apply 'char-to-int (list last-command-char)))
                         (t 0)))
-         mapped-binding
-         (on-bullet (eq (point) (allout-current-bullet-pos))))
+         mapped-binding)
 
     (if (zerop key-num)
         nil
 
-      (if (and (<= 33 key-num)
-               (setq mapped-binding
+      (if (and
+           ;; exclude control chars and escape:
+           (<= 33 key-num)
+           (setq mapped-binding
+                 (or (and (assoc key-string allout-keybindings-list)
+                          ;; translate literal membership on list:
+                          (cadr (assoc key-string allout-keybindings-list)))
+                     ;; translate as a keybinding:
                      (key-binding (concat allout-command-prefix
                                           (char-to-string
-                                           (if (and (<= 97 key-num) ; "a"
+                                           (if (and (<= 97 key-num)   ; "a"
                                                     (>= 122 key-num)) ; "z"
                                                (- key-num 96) key-num)))
-                                  t)))
-          ;; Qualified with the allout prefix - do hot-spot operation.
+                                  t))))
+          ;; Qualified as an allout command - do hot-spot operation.
           (setq allout-post-goto-bullet t)
         ;; accept-defaults nil, or else we'll get allout-item-icon-key-handler.
         (setq mapped-binding (key-binding (char-to-string key-num))))
 
       (while (keymapp mapped-binding)
         (setq mapped-binding
-              (lookup-key mapped-binding (read-key-sequence-vector nil t))))
+              (lookup-key mapped-binding (vector (read-char)))))
 
       (if mapped-binding
           (setq this-command mapped-binding)))))
@@ -3036,7 +3274,7 @@
       (setq choice (solicit-char-in-string
                     (format "Select bullet: %s ('%s' default): "
                             sans-escapes
-                            default-bullet)
+                            (substring-no-properties default-bullet))
                     sans-escapes
                     t)))
     (message "")
@@ -3275,7 +3513,7 @@
                              (allout-ascend-to-depth depth))
                             ((>= relative-depth 1) nil)
                             (t (allout-back-to-current-heading)))
-                      (setq ref-depth (allout-recent-depth))
+                      (setq ref-depth allout-recent-depth)
                       (setq ref-bullet
                             (if (> allout-recent-prefix-end 1)
                                 (allout-recent-bullet)
@@ -3363,7 +3601,7 @@
                 (setq dbl-space t))
             (if (save-excursion
                   (allout-next-heading)
-                  (when (> (allout-recent-depth) ref-depth)
+                  (when (> allout-recent-depth ref-depth)
                     ;; This is an offspring.
                     (forward-line -1)
                     (looking-at "^\\s-*$")))
@@ -3388,7 +3626,13 @@
                      (if (and dbl-space (not (> relative-depth 0)))
 			 (newline 1))
                      (if (and (not (eobp))
-                              (not (bolp)))
+                              (or (not (bolp))
+                                  (and (not (bobp))
+                                       ;; bolp doesnt detect concealed
+                                       ;; trailing newlines, compensate:
+                                       (save-excursion
+                                         (forward-char -1)
+                                         (allout-hidden-p)))))
                          (forward-char 1))))
           ))
     (setq start (point))
@@ -3507,23 +3751,28 @@
   (interactive "p")
   (let ((initial-col (current-column))
 	(on-bullet (eq (point)(allout-current-bullet-pos)))
+        from to
 	(backwards (if (< arg 0)
 		       (setq arg (* arg -1)))))
     (while (> arg 0)
       (save-excursion (allout-back-to-current-heading)
 		      (allout-end-of-prefix)
+                      (setq from allout-recent-prefix-beginning
+                            to allout-recent-prefix-end)
 		      (allout-rebullet-heading t	;;; solicit
 						nil	;;; depth
 						nil	;;; number-control
 						nil	;;; index
-						t))	;;; do-successors
+						t)	;;; do-successors
+                      (run-hook-with-args 'allout-exposure-change-hook
+                                          from to t))
       (setq arg (1- arg))
       (if (<= arg 0)
 	  nil
 	(setq initial-col nil)		; Override positioning back to init col
 	(if (not backwards)
 	    (allout-next-visible-heading 1)
-	  (allout-goto-prefix)
+	  (allout-goto-prefix-doublechecked)
 	  (allout-next-visible-heading -1))))
     (message "Done.")
     (cond (on-bullet (goto-char (allout-current-bullet-pos)))
@@ -3573,7 +3822,7 @@
          (new-depth (or new-depth current-depth))
          (mb allout-recent-prefix-beginning)
          (me allout-recent-prefix-end)
-         (current-bullet (buffer-substring (- me 1) me))
+         (current-bullet (buffer-substring-no-properties (- me 1) me))
          (new-prefix (allout-make-topic-prefix current-bullet
                                                 nil
                                                 new-depth
@@ -3627,11 +3876,17 @@
     ) ; let* ((current-depth (allout-depth))...)
   ) ; defun
 ;;;_    > allout-rebullet-topic (arg)
-(defun allout-rebullet-topic (arg)
+(defun allout-rebullet-topic (arg &optional sans-offspring)
   "Rebullet the visible topic containing point and all contained subtopics.
 
 Descends into invisible as well as visible topics, however.
 
+When optional sans-offspring is non-nil, subtopics are not
+shifted.  \(Shifting a topic outwards without shifting its
+offspring is disallowed, since this would create a \"containment
+discontinuity\", where the depth difference between a topic and
+its immediate offspring is greater than one.)
+
 With repeat count, shift topic depth by that amount."
   (interactive "P")
   (let ((start-col (current-column)))
@@ -3642,17 +3897,18 @@
       ;; Fill the user in, in case we're shifting a big topic:
       (if (not (zerop arg)) (message "Shifting..."))
       (allout-back-to-current-heading)
-      (if (<= (+ (allout-recent-depth) arg) 0)
+      (if (<= (+ allout-recent-depth arg) 0)
           (error "Attempt to shift topic below level 1"))
-      (allout-rebullet-topic-grunt arg)
+      (allout-rebullet-topic-grunt arg nil nil nil nil sans-offspring)
       (if (not (zerop arg)) (message "Shifting... done.")))
     (move-to-column (max 0 (+ start-col arg)))))
-;;;_     > allout-rebullet-topic-grunt (&optional relative-depth ...)
+;;;_    > allout-rebullet-topic-grunt (&optional relative-depth ...)
 (defun allout-rebullet-topic-grunt (&optional relative-depth
                                                starting-depth
                                                starting-point
                                                index
-                                               do-successors)
+                                               do-successors
+                                               sans-offspring)
   "Like `allout-rebullet-topic', but on nearest containing topic
 \(visible or not).
 
@@ -3663,8 +3919,23 @@
 First arg RELATIVE-DEPTH means to shift the depth of the entire
 topic that amount.
 
-The rest of the args are for internal recursive use by the function
-itself.  The are STARTING-DEPTH, STARTING-POINT, and INDEX."
+Several subsequent args are for internal recursive use by the function
+itself: STARTING-DEPTH, STARTING-POINT, and INDEX.
+
+Finally, if optional SANS-OFFSPRING is non-nil then the offspring
+are not shifted.  \(Shifting a topic outwards without shifting
+its offspring is disallowed, since this would create a
+\"containment discontinuity\", where the depth difference between
+a topic and its immediate offspring is greater than one..)"
+
+  ;; XXX the recursion here is peculiar, and in general the routine may
+  ;; need simplification with refactoring.
+
+  (if (and sans-offspring
+           relative-depth
+           (< relative-depth 0))
+      (error (concat "Attempt to shift topic outwards without offspring,"
+                     " would cause containment discontinuity.")))
 
   (let* ((relative-depth (or relative-depth 0))
          (new-depth (allout-depth))
@@ -3676,44 +3947,57 @@
                     (and (or (zerop relative-depth)
                              (not on-starting-call))
                          (allout-sibling-index))))
+         (starting-index index)
          (moving-outwards (< 0 relative-depth))
-         (starting-point (or starting-point (point))))
+         (starting-point (or starting-point (point)))
+         (local-point (point)))
 
     ;; Sanity check for excessive promotion done only on starting call:
     (and on-starting-call
          moving-outwards
          (> 0 (+ starting-depth relative-depth))
-         (error "Attempt to shift topic out beyond level 1"))	;;; ====>
+         (error "Attempt to shift topic out beyond level 1"))
 
     (cond ((= starting-depth new-depth)
-           ;; We're at depth to work on this one:
-           (allout-rebullet-heading nil		;;; solicit
-                                     (+ starting-depth	;;; starting-depth
-                                        relative-depth)
-                                     nil		;;; number
-                                     index		;;; index
-                                     ;; Every contained topic will get hit,
-                                     ;; and we have to get to outside ones
-                                     ;; deliberately:
-                                     nil)		;;; do-successors
-           ;; ... and work on subsequent ones which are at greater depth:
-           (setq index 0)
-           (allout-next-heading)
-           (while (and (not (eobp))
-                       (< starting-depth (allout-recent-depth)))
-             (setq index (1+ index))
-             (allout-rebullet-topic-grunt relative-depth   ;;; relative-depth
-                                           (1+ starting-depth);;;starting-depth
-                                           starting-point   ;;; starting-point
-                                           index)))	    ;;; index
+           ;; We're at depth to work on this one.
+
+           ;; When shifting out we work on the children before working on
+           ;; the parent to avoid interim `allout-aberrant-container-p'
+           ;; aberrancy, and vice-versa when shifting in:
+           (if (>= relative-depth 0)
+               (allout-rebullet-heading nil
+                                        (+ starting-depth relative-depth)
+                                        nil		;;; number
+                                        index
+                                        nil)) ;;; do-successors
+           (when (not sans-offspring)
+             ;; ... and work on subsequent ones which are at greater depth:
+             (setq index 0)
+             (allout-next-heading)
+             (while (and (not (eobp))
+                         (< starting-depth (allout-depth)))
+               (setq index (1+ index))
+               (allout-rebullet-topic-grunt relative-depth
+                                            (1+ starting-depth)
+                                            starting-point
+                                            index)))
+           (when (< relative-depth 0)
+             (save-excursion
+               (goto-char local-point)
+               (allout-rebullet-heading nil               ;;; solicit
+                                        (+ starting-depth relative-depth)
+                                        nil		;;; number
+                                        starting-index
+                                        nil)))) ;;; do-successors
 
           ((< starting-depth new-depth)
            ;; Rare case - subtopic more than one level deeper than parent.
            ;; Treat this one at an even deeper level:
-           (allout-rebullet-topic-grunt relative-depth   ;;; relative-depth
-                                         new-depth	  ;;; starting-depth
-                                         starting-point	  ;;; starting-point
-                                         index)))	  ;;; index
+           (allout-rebullet-topic-grunt relative-depth
+                                         new-depth
+                                         starting-point
+                                         index
+                                         sans-offspring)))
 
     (if on-starting-call
         (progn
@@ -3721,8 +4005,8 @@
           ;; if topic has changed depth
           (if (or do-successors
                   (and (not (zerop relative-depth))
-                       (or (= (allout-recent-depth) starting-depth)
-                           (= (allout-recent-depth) (+ starting-depth
+                       (or (= allout-recent-depth starting-depth)
+                           (= allout-recent-depth (+ starting-depth
                                                         relative-depth)))))
               (allout-rebullet-heading nil nil nil nil t))
           ;; Now rectify numbering of new siblings of the adjusted topic,
@@ -3747,24 +4031,24 @@
 	was-eobp)
     (while (and (not (eobp))
 		(allout-depth)
-                (>= (allout-recent-depth) depth)
+                (>= allout-recent-depth depth)
                 (>= ascender depth))
                                         ; Skip over all topics at
                                         ; lesser depths, which can not
                                         ; have been disturbed:
       (while (and (not (setq was-eobp (eobp)))
-		  (> (allout-recent-depth) ascender))
+		  (> allout-recent-depth ascender))
         (allout-next-heading))
                                         ; Prime ascender for ascension:
-      (setq ascender (1- (allout-recent-depth)))
-      (if (>= (allout-recent-depth) depth)
+      (setq ascender (1- allout-recent-depth))
+      (if (>= allout-recent-depth depth)
           (allout-rebullet-heading nil	;;; solicit
                                     nil	;;; depth
                                     nil	;;; number-control
                                     nil	;;; index
                                     t)) ;;; do-successors
       (if was-eobp (goto-char (point-max)))))
-  (allout-recent-depth))
+  allout-recent-depth)
 ;;;_    > allout-number-siblings (&optional denumber)
 (defun allout-number-siblings (&optional denumber)
   "Assign numbered topic prefix to this topic and its siblings.
@@ -3780,7 +4064,7 @@
   (save-excursion
     (allout-back-to-current-heading)
     (allout-beginning-of-level)
-    (let ((depth (allout-recent-depth))
+    (let ((depth allout-recent-depth)
 	  (index (if (not denumber) 1))
           (use-bullet (equal '(16) denumber))
           (more t))
@@ -3794,55 +4078,84 @@
         (setq more (allout-next-sibling depth nil))))))
 ;;;_    > allout-shift-in (arg)
 (defun allout-shift-in (arg)
-  "Increase depth of current heading and any topics collapsed within it.
-
-We disallow shifts that would result in the topic having a depth more than
-one level greater than the immediately previous topic, to avoid containment
-discontinuity.  The first topic in the file can be adjusted to any positive
-depth, however."
+  "Increase depth of current heading and any items collapsed within it.
+
+With a negative argument, the item is shifted out using
+`allout-shift-out', instead.
+
+With an argument greater than one, shift-in the item but not its
+offspring, making the item into a sibling of its former children,
+and a child of sibling that formerly preceeded it.
+
+You are not allowed to shift the first offspring of a topic
+inwards, because that would yield a \"containment
+discontinuity\", where the depth difference between a topic and
+its immediate offspring is greater than one.  The first topic in
+the file can be adjusted to any positive depth, however."
+
   (interactive "p")
-  (if (> arg 0)
-      ;; refuse to create a containment discontinuity:
-      (save-excursion
-        (allout-back-to-current-heading)
-        (if (not (bobp))
-            (let* ((current-depth (allout-recent-depth))
-                   (start-point (point))
-                   (predecessor-depth (progn
-                                        (forward-char -1)
-                                        (allout-goto-prefix)
-                                        (if (< (point) start-point)
-                                            (allout-recent-depth)
-                                          0))))
-              (if (and (> predecessor-depth 0)
-                       (> (+ current-depth arg)
-                          (1+ predecessor-depth)))
-                  (error (concat "Disallowed shift deeper than"
-                                 " containing topic's children.")))))))
-  (let ((where (point))
-        has-successor)
-    (if (and (< arg 0)
-             (allout-current-topic-collapsed-p)
-             (save-excursion (allout-next-sibling)))
-        (setq has-successor t))
-    (allout-rebullet-topic arg)
-    (when (< arg 0)
-      (save-excursion
-        (if (allout-ascend)
-            (allout-show-children)))
-      (if has-successor
-          (allout-show-children)))
-    (run-hook-with-args 'allout-structure-shifted-hook arg where)))
+  (if (< arg 0)
+      (allout-shift-out (* arg -1))
+    ;; refuse to create a containment discontinuity:
+    (save-excursion
+      (allout-back-to-current-heading)
+      (if (not (bobp))
+          (let* ((current-depth allout-recent-depth)
+                 (start-point (point))
+                 (predecessor-depth (progn
+                                      (forward-char -1)
+                                      (allout-goto-prefix-doublechecked)
+                                      (if (< (point) start-point)
+                                          allout-recent-depth
+                                        0))))
+            (if (and (> predecessor-depth 0)
+                     (> (1+ current-depth)
+                        (1+ predecessor-depth)))
+                (error (concat "Disallowed shift deeper than"
+                               " containing topic's children."))))))
+    (let ((where (point)))
+      (allout-rebullet-topic 1 (and (> arg 1) 'sans-offspring))
+      (run-hook-with-args 'allout-structure-shifted-hook arg where))))
 ;;;_    > allout-shift-out (arg)
 (defun allout-shift-out (arg)
   "Decrease depth of current heading and any topics collapsed within it.
-
-We disallow shifts that would result in the topic having a depth more than
-one level greater than the immediately previous topic, to avoid containment
-discontinuity.  The first topic in the file can be adjusted to any positive
-depth, however."
+This will make the item a sibling of its former container.
+
+With a negative argument, the item is shifted in using
+`allout-shift-in', instead.
+
+With an argument greater than one, shift-out the item's offspring
+but not the item itself, making the former children siblings of
+the item.
+
+With an argument greater than 1, the item's offspring are shifted
+out without shifting the item.  This will make the immediate
+subtopics into siblings of the item."
   (interactive "p")
-  (allout-shift-in (* arg -1)))
+  (if (< arg 0)
+      (allout-shift-in (* arg -1))
+    ;; Get proper exposure in this area:
+    (save-excursion (if (allout-ascend)
+                        (allout-show-children)))
+    ;; Show collapsed children if there's a successor which will become
+    ;; their sibling:
+    (if (and (allout-current-topic-collapsed-p)
+             (save-excursion (allout-next-sibling)))
+        (allout-show-children))
+    (let ((where (and (allout-depth) allout-recent-prefix-beginning)))
+      (save-excursion
+        (if (> arg 1)
+            ;; Shift the offspring but not the topic:
+            (let ((children-chart (allout-chart-subtree 1)))
+              (if (listp (car children-chart))
+                  ;; whoops:
+                  (setq children-chart (allout-flatten children-chart)))
+              (save-excursion
+                (dolist (child-point children-chart)
+                  (goto-char child-point)
+                  (allout-shift-out 1))))
+          (allout-rebullet-topic (* arg -1))))
+      (run-hook-with-args 'allout-structure-shifted-hook (* arg -1) where))))
 ;;;_   : Surgery (kill-ring) functions with special provisions for outlines:
 ;;;_    > allout-kill-line (&optional arg)
 (defun allout-kill-line (&optional arg)
@@ -3857,27 +4170,32 @@
       (kill-line arg)
     ;; Ah, have to watch out for adjustments:
     (let* ((beg (point))
+           end
            (beg-hidden (allout-hidden-p))
            (end-hidden (save-excursion (allout-end-of-current-line)
+                                       (setq end (point))
                                        (allout-hidden-p)))
-           (depth (allout-depth))
-           (collapsed (allout-current-topic-collapsed-p)))
-
-      (if collapsed
-          (put-text-property beg (1+ beg) 'allout-was-collapsed t)
-        (remove-text-properties beg (1+ beg) '(allout-was-collapsed t)))
+           (depth (allout-depth)))
+
+      (allout-annotate-hidden beg end)
 
       (if (and (not beg-hidden) (not end-hidden))
           (allout-unprotected (kill-line arg))
         (kill-line arg))
-                                        ; Provide some feedback:
-      (sit-for 0)
       (if allout-numbered-bullet
           (save-excursion               ; Renumber subsequent topics if needed:
             (if (not (looking-at allout-regexp))
                 (allout-next-heading))
             (allout-renumber-to-depth depth)))
       (run-hook-with-args 'allout-structure-deleted-hook depth (point)))))
+;;;_    > allout-copy-line-as-kill ()
+(defun allout-copy-line-as-kill ()
+  "Like allout-kill-topic, but save to kill ring instead of deleting."
+  (interactive)
+  (let ((buffer-read-only t))
+    (condition-case nil
+        (allout-kill-line)
+      (buffer-read-only nil))))
 ;;;_    > allout-kill-topic ()
 (defun allout-kill-topic ()
   "Kill topic together with subtopics.
@@ -3889,20 +4207,13 @@
  - would not be added to whitespace already separating the topic from the
    previous one.
 
-Completely collapsed topics are marked as such, for re-collapse
-when yank with allout-yank into an outline as a heading."
-
-  ;; Some finagling is done to make complex topic kills appear faster
-  ;; than they actually are.  A redisplay is performed immediately
-  ;; after the region is deleted, though the renumbering process
-  ;; has yet to be performed.  This means that there may appear to be
-  ;; a lag *after* a kill has been performed.
+Topic exposure is marked with text-properties, to be used by
+allout-yank-processing for exposure recovery."
 
   (interactive)
   (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)))
+         (depth allout-recent-depth))
     (allout-end-of-current-subtree)
     (if (and (/= (current-column) 0) (not (eobp)))
         (forward-char 1))
@@ -3910,21 +4221,99 @@
 	(if (and (looking-at "\n")
                  (or (save-excursion
                        (or (not (allout-next-heading))
-                           (= depth (allout-recent-depth))))
+                           (= depth allout-recent-depth)))
                      (and (> (- beg (point-min)) 3)
                           (string= (buffer-substring (- beg 2) beg) "\n\n"))))
 	    (forward-char 1)))
 
-    (if collapsed
-        (allout-unprotected
-         (put-text-property beg (1+ beg) 'allout-was-collapsed t))
-      (allout-unprotected
-       (remove-text-properties beg (1+ beg) '(allout-was-collapsed t))))
+    (allout-annotate-hidden beg (point))
+
     (allout-unprotected (kill-region beg (point)))
-    (sit-for 0)
     (save-excursion
       (allout-renumber-to-depth depth))
     (run-hook-with-args 'allout-structure-deleted-hook depth (point))))
+;;;_    > allout-copy-topic-as-kill ()
+(defun allout-copy-topic-as-kill ()
+  "Like allout-kill-topic, but save to kill ring instead of deleting."
+  (interactive)
+  (let ((buffer-read-only t))
+    (condition-case nil
+        (allout-kill-topic)
+      (buffer-read-only (message "Topic copied...")))))
+;;;_    > allout-annotate-hidden (begin end)
+(defun allout-annotate-hidden (begin end)
+  "Qualify text with properties to indicate exposure status."
+
+  (let ((was-modified (buffer-modified-p))
+        (buffer-read-only nil))
+    (allout-unprotected
+     (remove-text-properties begin end '(allout-was-hidden t)))
+    (save-excursion
+      (goto-char begin)
+      (let (done next prev overlay)
+        (while (not done)
+          ;; at or advance to start of next hidden region:
+          (if (not (allout-hidden-p))
+              (setq next
+                    (max (1+ (point))
+                         (next-single-char-property-change (point)
+                                                           'invisible
+                                                           nil end))))
+          (if (or (not next) (eq prev next))
+              ;; still not at start of hidden area - must not be any left.
+              (setq done t)
+            (goto-char next)
+            (setq prev next)
+            (if (not (allout-hidden-p))
+                ;; still not at start of hidden area.
+                (setq done t)
+              (setq overlay (allout-get-invisibility-overlay))
+              (setq next (overlay-end overlay)
+                    prev next)
+              ;; advance to end of this hidden area:
+              (when next
+                (goto-char next)
+                (allout-unprotected
+                 (put-text-property (overlay-start overlay) next
+                                    'allout-was-hidden t))))))))
+    (set-buffer-modified-p was-modified)))
+;;;_    > allout-hide-by-annotation (begin end)
+(defun allout-hide-by-annotation (begin end)
+  "Translate text properties indicating exposure status into actual exposure."
+  (save-excursion
+    (goto-char begin)
+    (let ((was-modified (buffer-modified-p))
+          done next prev)
+      (while (not done)
+        ;; at or advance to start of next annotation:
+        (if (not (get-text-property (point) 'allout-was-hidden))
+            (setq next (next-single-char-property-change (point)
+                                                         'allout-was-hidden
+                                                         nil end)))
+        (if (or (not next) (eq prev next))
+            ;; no more or not advancing - must not be any left.
+            (setq done t)
+          (goto-char next)
+          (setq prev next)
+          (if (not (get-text-property (point) 'allout-was-hidden))
+              ;; still not at start of annotation.
+              (setq done t)
+            ;; advance to just after end of this annotation:
+            (setq next (next-single-char-property-change (point)
+                                                         'allout-was-hidden
+                                                         nil end))
+            (overlay-put (make-overlay prev next)
+                         'category 'allout-exposure-category)
+            (allout-unprotected
+             (remove-text-properties prev next '(allout-was-hidden t)))
+            (setq prev next)
+            (if next (goto-char next)))))
+      (set-buffer-modified-p was-modified))))
+;;;_    > allout-remove-exposure-annotation (begin end)
+(defun allout-remove-exposure-annotation (begin end)
+  "Remove text properties indicating exposure status."
+  (remove-text-properties begin end '(allout-was-hidden t)))
+
 ;;;_    > allout-yank-processing ()
 (defun allout-yank-processing (&optional arg)
 
@@ -3955,12 +4344,10 @@
    (let* ((subj-beg (point))
           (into-bol (bolp))
           (subj-end (allout-mark-marker t))
-          (was-collapsed (get-text-property subj-beg 'allout-was-collapsed))
           ;; 'resituate' if yanking an entire topic into topic header:
           (resituate (and (allout-e-o-prefix-p)
-                          (looking-at (concat "\\(" allout-regexp "\\)"))
-                          (allout-prefix-data (match-beginning 1)
-					      (match-end 1))))
+                          (looking-at allout-regexp)
+                          (allout-prefix-data)))
           ;; `rectify-numbering' if resituating (where several topics may
           ;; be resituating) or yanking a topic into a topic slot (bol):
           (rectify-numbering (or resituate
@@ -3968,7 +4355,7 @@
      (if resituate
                                         ; The yanked stuff is a topic:
          (let* ((prefix-len (- (match-end 1) subj-beg))
-                (subj-depth (allout-recent-depth))
+                (subj-depth allout-recent-depth)
                 (prefix-bullet (allout-recent-bullet))
                 (adjust-to-depth
                  ;; Nil if adjustment unnecessary, otherwise depth to which
@@ -3982,15 +4369,13 @@
                                (beginning-of-line)
                                (not (= (point) subj-beg)))
                              (looking-at allout-regexp)
-                             (allout-prefix-data (match-beginning 0)
-						 (match-end 0)))
-                        (allout-recent-depth))))
+                             (allout-prefix-data))
+                        allout-recent-depth)))
                 (more t))
            (setq rectify-numbering allout-numbered-bullet)
            (if adjust-to-depth
                                         ; Do the adjustment:
                (progn
-                 (message "... yanking") (sit-for 0)
                  (save-restriction
                    (narrow-to-region subj-beg subj-end)
                                         ; Trim off excessive blank
@@ -4006,7 +4391,7 @@
                    (while more
                      (allout-back-to-current-heading)
                                         ; go as high as we can in each bunch:
-                     (while (allout-ascend-to-depth (1- (allout-depth))))
+                     (while (allout-ascend))
                      (save-excursion
                        (allout-rebullet-topic-grunt (- adjust-to-depth
 						       subj-depth))
@@ -4015,7 +4400,6 @@
                          (progn (widen)
                                 (forward-char -1)
                                 (narrow-to-region subj-beg (point))))))
-                 (message "")
                  ;; Preserve new bullet if it's a distinctive one, otherwise
                  ;; use old one:
                  (if (string-match (regexp-quote prefix-bullet)
@@ -4042,19 +4426,19 @@
          (progn
            (save-excursion
                                         ; Give some preliminary feedback:
-             (message "... reconciling numbers") (sit-for 0)
+             (message "... reconciling numbers")
                                         ; ... and renumber, in case necessary:
              (goto-char subj-beg)
-             (if (allout-goto-prefix)
+             (if (allout-goto-prefix-doublechecked)
                  (allout-rebullet-heading nil            ;;; solicit
 					  (allout-depth) ;;; depth
 					  nil            ;;; number-control
 					  nil            ;;; index
 					  t))
              (message ""))))
-     (when (and (or into-bol resituate) was-collapsed)
-       (remove-text-properties subj-beg (1+ subj-beg) '(allout-was-collapsed))
-       (allout-hide-current-subtree))
+     (if (or into-bol resituate)
+         (allout-hide-by-annotation (point) (allout-mark-marker t))
+       (allout-remove-exposure-annotation (allout-mark-marker t) (point)))
      (if (not resituate)
          (exchange-point-and-mark))
      (run-hook-with-args 'allout-structure-added-hook subj-beg subj-end))))
@@ -4139,7 +4523,7 @@
                   (error "%s not found and can't be created" file-name)))
             (condition-case failure
                 (find-file-other-window file-name)
-              ('error failure))
+              (error failure))
           (error "%s not found" file-name))
         )
       )
@@ -4198,7 +4582,7 @@
   (interactive)
   (save-excursion
     (let (beg end)
-      (allout-goto-prefix)
+      (allout-goto-prefix-doublechecked)
       (setq beg (if (allout-hidden-p) (1- (point)) (point)))
       (setq end (allout-pre-next-prefix))
       (allout-flag-region beg end nil)
@@ -4235,8 +4619,27 @@
       (save-excursion
         (allout-beginning-of-current-line)
         (save-restriction
-          (let* ((chart (allout-chart-subtree (or level 1)))
-                 (to-reveal (allout-chart-to-reveal chart (or level 1))))
+          (let* (depth
+                 (chart (allout-chart-subtree (or level 1)))
+                 (to-reveal (or (allout-chart-to-reveal chart (or level 1))
+                                ;; interactive, show discontinuous children:
+                                (and chart
+                                     (interactive-p)
+                                     (save-excursion
+                                       (allout-back-to-current-heading)
+                                       (setq depth (allout-current-depth))
+                                       (and (allout-next-heading)
+                                            (> allout-recent-depth
+                                               (1+ depth))))
+                                     (message
+                                      "Discontinuous offspring; use `%s %s'%s."
+                                      (substitute-command-keys
+                                       "\\[universal-argument]")
+                                      (substitute-command-keys
+                                       "\\[allout-shift-out]")
+                                      " to elevate them.")
+                                     (allout-chart-to-reveal
+                                      chart (- allout-recent-depth depth))))))
             (goto-char start-point)
             (when (and strict (allout-hidden-p))
               ;; Concealed root would already have been taken care of,
@@ -4267,14 +4670,12 @@
   (save-excursion
     (let ((inhibit-field-text-motion t)
           (orig-pt (point))
-	  (orig-pref (allout-goto-prefix))
+	  (orig-pref (allout-goto-prefix-doublechecked))
 	  (last-at (point))
 	  bag-it)
       (while (or bag-it (allout-hidden-p))
         (while (allout-hidden-p)
-          ;; XXX We would use `(move-beginning-of-line 1)', but it gets
-          ;; stuck on hidden newlines at column 80, as of GNU Emacs 22.0.50.
-          (beginning-of-line)
+          (move-beginning-of-line 1)
           (if (allout-hidden-p) (forward-char -1)))
 	(if (= last-at (setq last-at (point)))
 	    ;; Oops, we're not making any progress!  Show the current
@@ -4286,9 +4687,9 @@
 		   (beep)
 		   (message "%s: %s"
 			    "allout-show-to-offshoot: "
-			    "Aberrant nesting encountered.")))
-	(allout-show-children)
-	(goto-char orig-pref))
+			    "Aberrant nesting encountered."))
+          (allout-show-children)
+          (goto-char orig-pref)))
       (goto-char orig-pt)))
   (if (allout-hidden-p)
       (allout-show-entry)))
@@ -4368,10 +4769,10 @@
          (current-exposed (not (allout-current-topic-collapsed-p t))))
     (cond (current-exposed (allout-flag-current-subtree t))
           (just-close nil)
-          ((allout-up-current-level 1 t) (allout-hide-current-subtree))
+          ((allout-ascend) (allout-hide-current-subtree))
           (t (goto-char 0)
              (message sibs-msg)
-             (allout-goto-prefix)
+             (allout-goto-prefix-doublechecked)
              (allout-expose-topic '(0 :))
              (message (concat sibs-msg "  Done."))))
     (goto-char from)))
@@ -4636,7 +5037,7 @@
 	level, and expose children of subsequent topics at current
 	level *except* for the last, which should be opened completely."
   (list 'save-excursion
-	'(if (not (or (allout-goto-prefix)
+	'(if (not (or (allout-goto-prefix-doublechecked)
 		      (allout-next-heading)))
 	     (error "allout-new-exposure: Can't find any outline topics"))
 	(list 'allout-expose-topic (list 'quote spec))))
@@ -4758,20 +5159,20 @@
       (goto-char start)
       (beginning-of-line)
       ;; Goto initial topic, and register preceeding stuff, if any:
-      (if (> (allout-goto-prefix) start)
+      (if (> (allout-goto-prefix-doublechecked) start)
 	  ;; First topic follows beginning point - register preliminary stuff:
 	  (setq result (list (list 0 "" nil
 				   (buffer-substring start (1- (point)))))))
       (while (and (not done)
 		  (not (eobp))		; Loop until we've covered the region.
 		  (not (> (point) end)))
-	(setq depth (allout-recent-depth) 	; Current topics depth,
+	(setq depth allout-recent-depth 	; Current topics depth,
 	      bullet (allout-recent-bullet)	; ... bullet,
 	      prefix (allout-recent-prefix)
 	      beg (progn (allout-end-of-prefix t) (point))) ; and beginning.
 	(setq done			; The boundary for the current topic:
 	      (not (allout-next-visible-heading 1)))
-	(setq new-depth (allout-recent-depth))
+	(setq new-depth allout-recent-depth)
 	(setq gone-out out
 	      out (< new-depth depth))
 	(beginning-of-line)
@@ -4788,7 +5189,8 @@
                          (allout-back-to-visible-text)))
 		      strings))
 	  (when (< (point) next)      ; Resume from after hid text, if any.
-            (line-move 1))
+            (line-move 1)
+            (beginning-of-line))
 	  (setq beg (point)))
 	;; Accumulate list for this topic:
 	(setq strings (nreverse strings))
@@ -5040,10 +5442,10 @@
                                 ;;"\\\\\\|\\{\\|\\}\\|\\_\\|\\$\\|\\\"\\|\\&\\|\\^\\|\\-\\|\\*\\|#"
                                 end	; bounded by end-of-line
                                 1)   ; no matches, move to end & return nil
-        (goto-char (match-beginning 0))
+        (goto-char (match-beginning 2))
         (insert "\\")
         (setq end (1+ end))
-        (goto-char (1+ (match-end 0)))))))
+        (goto-char (1+ (match-end 2)))))))
 ;;;_   > allout-insert-latex-header (buffer)
 (defun allout-insert-latex-header (buffer)
   "Insert initial LaTeX commands at point in BUFFER."
@@ -5089,7 +5491,7 @@
 		       (allout-latex-verb-quote (if allout-title
 						(condition-case nil
 						    (eval allout-title)
-						  ('error "<unnamed buffer>"))
+						  (error "<unnamed buffer>"))
 					      "Unnamed Outline"))
 		       "}\n"
 		       "\\end{center}\n\n"))
@@ -5228,7 +5630,7 @@
 default to symmetric encryption - you must manually \(re)encrypt key-pair
 encrypted topics if you want them to continue to use the key-pair cipher.
 
-Level-1 topics, with prefix consisting solely of an `*' asterisk, cannot be
+Level-one topics, with prefix consisting solely of an `*' asterisk, cannot be
 encrypted.  If you want to encrypt the contents of a top-level topic, use
 \\[allout-shift-in] to increase its depth.
 
@@ -5291,12 +5693,13 @@
   (save-excursion
     (allout-end-of-prefix t)
 
-    (if (= (allout-recent-depth) 1)
+    (if (= allout-recent-depth 1)
         (error (concat "Cannot encrypt or decrypt level 1 topics -"
                        " shift it in to make it encryptable")))
 
     (let* ((allout-buffer (current-buffer))
            ;; Asses location:
+           (bullet-pos allout-recent-prefix-beginning)
            (after-bullet-pos (point))
            (was-encrypted
             (progn (if (= (point-max) after-bullet-pos)
@@ -5362,12 +5765,9 @@
                     (delete-char 1))
            ;; Add the is-encrypted bullet qualifier:
            (goto-char after-bullet-pos)
-           (insert "*"))
-         )
-       )
-      )
-    )
-  )
+           (insert "*"))))
+      (run-hook-with-args 'allout-structure-added-hook
+                          bullet-pos subtree-end))))
 ;;;_  > allout-encrypt-string (text decrypt allout-buffer key-type for-key
 ;;;                                  fetch-pass &optional retried verifying
 ;;;                                  passphrase)
@@ -5512,7 +5912,8 @@
                      (error "decryption failed")))))
 
           (setq result-text
-                (buffer-substring 1 (- (point-max) (if decrypt 0 1))))
+                (buffer-substring-no-properties
+                 1 (- (point-max) (if decrypt 0 1))))
           )
 
         ;; validate result - non-empty
@@ -5924,17 +6325,8 @@
   )
 
 ;;;_ #9 miscellaneous
-;;;_  > allout-mark-topic ()
-(defun allout-mark-topic ()
-  "Put the region around topic currently containing point."
-  (interactive)
-  (let ((inhibit-field-text-motion t))
-    (beginning-of-line))
-  (allout-goto-prefix)
-  (push-mark (point))
-  (allout-end-of-current-subtree)
-  (exchange-point-and-mark))
-;;;_  > outlineify-sticky ()
+;;;_  : Mode:
+;;;_   > outlineify-sticky ()
 ;; outlinify-sticky is correct spelling; provide this alias for sticklers:
 ;;;###autoload
 (defalias 'outlinify-sticky 'outlineify-sticky)
@@ -5958,7 +6350,7 @@
                       "`allout-mode' docstring: `^Hm'."))
       (allout-adjust-file-variable
        "allout-layout" (or allout-layout '(-1 : 0))))))
-;;;_  > allout-file-vars-section-data ()
+;;;_   > allout-file-vars-section-data ()
 (defun allout-file-vars-section-data ()
   "Return data identifying the file-vars section, or nil if none.
 
@@ -5986,7 +6378,7 @@
       )
     )
   )
-;;;_  > allout-adjust-file-variable (varname value)
+;;;_   > allout-adjust-file-variable (varname value)
 (defun allout-adjust-file-variable (varname value)
   "Adjust the setting of an emacs file variable named VARNAME to VALUE.
 
@@ -6050,7 +6442,38 @@
       )
     )
   )
-;;;_  > solicit-char-in-string (prompt string &optional do-defaulting)
+;;;_   > allout-get-configvar-values (varname)
+(defun allout-get-configvar-values (configvar-name)
+  "Return a list of values of the symbols in list bound to CONFIGVAR-NAME.
+
+The user is prompted for removal of symbols that are unbound, and they
+otherwise are ignored.
+
+CONFIGVAR-NAME should be the name of the configuration variable,
+not its value."
+
+  (let ((configvar-value (symbol-value configvar-name))
+        got)
+    (dolist (sym configvar-value)
+      (if (not (boundp sym))
+          (if (yes-or-no-p (format "%s entry `%s' is unbound - remove it? "
+                                   configvar-name sym))
+              (delq sym (symbol-value configvar-name)))
+        (push (symbol-value sym) got)))
+    (reverse got)))
+;;;_  : Topics:
+;;;_   > allout-mark-topic ()
+(defun allout-mark-topic ()
+  "Put the region around topic currently containing point."
+  (interactive)
+  (let ((inhibit-field-text-motion t))
+    (beginning-of-line))
+  (allout-goto-prefix-doublechecked)
+  (push-mark (point))
+  (allout-end-of-current-subtree)
+  (exchange-point-and-mark))
+;;;_  : UI:
+;;;_   > solicit-char-in-string (prompt string &optional do-defaulting)
 (defun solicit-char-in-string (prompt string &optional do-defaulting)
   "Solicit (with first arg PROMPT) choice of a character from string STRING.
 
@@ -6083,7 +6506,8 @@
       ;; got something out of loop - return it:
       got)
   )
-;;;_  > regexp-sans-escapes (string)
+;;;_  : Strings:
+;;;_   > regexp-sans-escapes (string)
 (defun regexp-sans-escapes (regexp &optional successive-backslashes)
   "Return a copy of REGEXP with all character escapes stripped out.
 
@@ -6106,7 +6530,7 @@
 		(regexp-sans-escapes (substring regexp 1)))
       ;; Exclude first char, but maintain count:
       (regexp-sans-escapes (substring regexp 1) successive-backslashes))))
-;;;_  > count-trailing-whitespace-region (beg end)
+;;;_   > count-trailing-whitespace-region (beg end)
 (defun count-trailing-whitespace-region (beg end)
   "Return number of trailing whitespace chars between BEG and END.
 
@@ -6117,29 +6541,25 @@
       (goto-char beg)
       (let ((count 0))
         (while (re-search-forward "[ 	][ 	]*$" end t)
-          (goto-char (1+ (match-beginning 0)))
+          (goto-char (1+ (match-beginning 2)))
           (setq count (1+ count)))
         count))))
-;;;_  > allout-get-configvar-values (varname)
-(defun allout-get-configvar-values (configvar-name)
-  "Return a list of values of the symbols in list bound to CONFIGVAR-NAME.
-
-The user is prompted for removal of symbols that are unbound, and they
-otherwise are ignored.
-
-CONFIGVAR-NAME should be the name of the configuration variable,
-not its value."
-
-  (let ((configvar-value (symbol-value configvar-name))
-        got)
-    (dolist (sym configvar-value)
-      (if (not (boundp sym))
-          (if (yes-or-no-p (format "%s entry `%s' is unbound - remove it? "
-                                   configvar-name sym))
-              (delq sym (symbol-value configvar-name)))
-        (push (symbol-value sym) got)))
-    (reverse got)))
-;;;_  > allout-mark-marker to accommodate divergent emacsen:
+;;;_   > allout-format-quote (string)
+(defun allout-format-quote (string)
+  "Return a copy of string with all \"%\" characters doubled."
+  (apply 'concat
+         (mapcar (lambda (char) (if (= char ?%) "%%" (char-to-string char)))
+                 string)))
+;;;_  : lists
+;;;_   > allout-flatten (list)
+(defun allout-flatten (list)
+  "Return a list of all atoms in list."
+  ;; classic.
+  (cond ((null list) nil)
+        ((atom (car list)) (cons (car list) (allout-flatten (cdr list))))
+        (t (append (allout-flatten (car list)) (allout-flatten (cdr list))))))
+;;;_  : Compatability:
+;;;_   > allout-mark-marker to accommodate divergent emacsen:
 (defun allout-mark-marker (&optional force buffer)
   "Accommodate the different signature for `mark-marker' across Emacsen.
 
@@ -6148,7 +6568,7 @@
   (if (featurep 'xemacs)
       (apply 'mark-marker force buffer)
     (mark-marker)))
-;;;_  > subst-char-in-string if necessary
+;;;_   > subst-char-in-string if necessary
 (if (not (fboundp 'subst-char-in-string))
     (defun subst-char-in-string (fromchar tochar string &optional inplace)
       "Replace FROMCHAR with TOCHAR in STRING each time it occurs.
@@ -6160,10 +6580,10 @@
           (if (eq (aref newstr i) fromchar)
               (aset newstr i tochar)))
         newstr)))
-;;;_  > wholenump if necessary
+;;;_   > wholenump if necessary
 (if (not (fboundp 'wholenump))
     (defalias 'wholenump 'natnump))
-;;;_  > remove-overlays if necessary
+;;;_   > remove-overlays if necessary
 (if (not (fboundp 'remove-overlays))
     (defun remove-overlays (&optional beg end name val)
       "Clear BEG and END of overlays whose property NAME has value VAL.
@@ -6190,7 +6610,7 @@
                   (move-overlay o end (overlay-end o))
                 (delete-overlay o)))))))
   )
-;;;_  > copy-overlay if necessary - xemacs ~ 21.4
+;;;_   > copy-overlay if necessary - xemacs ~ 21.4
 (if (not (fboundp 'copy-overlay))
     (defun copy-overlay (o)
       "Return a copy of overlay O."
@@ -6202,7 +6622,7 @@
         (while props
           (overlay-put o1 (pop props) (pop props)))
         o1)))
-;;;_  > add-to-invisibility-spec if necessary - xemacs ~ 21.4
+;;;_   > add-to-invisibility-spec if necessary - xemacs ~ 21.4
 (if (not (fboundp 'add-to-invisibility-spec))
     (defun add-to-invisibility-spec (element)
       "Add ELEMENT to `buffer-invisibility-spec'.
@@ -6212,14 +6632,14 @@
           (setq buffer-invisibility-spec (list t)))
       (setq buffer-invisibility-spec
             (cons element buffer-invisibility-spec))))
-;;;_  > remove-from-invisibility-spec if necessary - xemacs ~ 21.4
+;;;_   > remove-from-invisibility-spec if necessary - xemacs ~ 21.4
 (if (not (fboundp 'remove-from-invisibility-spec))
     (defun remove-from-invisibility-spec (element)
       "Remove ELEMENT from `buffer-invisibility-spec'."
       (if (consp buffer-invisibility-spec)
           (setq buffer-invisibility-spec (delete element
                                                  buffer-invisibility-spec)))))
-;;;_  > move-beginning-of-line if necessary - older emacs, xemacs
+;;;_   > move-beginning-of-line if necessary - older emacs, xemacs
 (if (not (fboundp 'move-beginning-of-line))
     (defun move-beginning-of-line (arg)
       "Move point to beginning of current line as displayed.
@@ -6243,7 +6663,7 @@
         (skip-chars-backward "^\n"))
       (vertical-motion 0))
 )
-;;;_  > move-end-of-line if necessary - older emacs, xemacs
+;;;_   > move-end-of-line if necessary - older emacs, xemacs
 (if (not (fboundp 'move-end-of-line))
     (defun move-end-of-line (arg)
       "Move point to end of current line as displayed.
@@ -6283,7 +6703,7 @@
                   (setq arg 1)
                 (setq done t)))))))
   )
-;;;_  > line-move-invisible-p if necessary
+;;;_   > line-move-invisible-p if necessary
 (if (not (fboundp 'line-move-invisible-p))
     (defun line-move-invisible-p (pos)
       "Return non-nil if the character after POS is currently invisible."
--- a/lisp/bindings.el	Thu Sep 14 09:24:00 2006 +0000
+++ b/lisp/bindings.el	Wed Sep 20 06:04:23 2006 +0000
@@ -346,7 +346,6 @@
     (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)
--- a/lisp/cus-edit.el	Thu Sep 14 09:24:00 2006 +0000
+++ b/lisp/cus-edit.el	Wed Sep 20 06:04:23 2006 +0000
@@ -389,7 +389,7 @@
   :link '(custom-manual "(emacs)Undo")
   :group 'editing)
 
-(defgroup modeline nil
+(defgroup mode-line nil
   "Content of the modeline."
   :group 'environment)
 
--- a/lisp/cus-start.el	Thu Sep 14 09:24:00 2006 +0000
+++ b/lisp/cus-start.el	Wed Sep 20 06:04:23 2006 +0000
@@ -374,8 +374,9 @@
 	     ;; xfns.c
 	     (x-bitmap-file-path installation
 				 (repeat (directory :format "%v")))
-	     (x-use-old-gtk-file-dialog menu boolean "22.1")
+	     (x-gtk-use-old-file-dialog menu boolean "22.1")
 	     (x-gtk-show-hidden-files menu boolean "22.1")
+	     (x-gtk-file-dialog-help-text menu boolean "22.1")
 	     (x-gtk-whole-detached-tool-bar x boolean "22.1")
 	     ;; xterm.c
 	     (x-use-underline-position-properties display boolean "22.1")
--- a/lisp/dnd.el	Thu Sep 14 09:24:00 2006 +0000
+++ b/lisp/dnd.el	Wed Sep 20 06:04:23 2006 +0000
@@ -61,16 +61,16 @@
 
 (defcustom dnd-open-remote-file-function
   (if (eq system-type 'windows-nt)
-      'dnd-open-unc-file
+      'dnd-open-local-file
     'dnd-open-remote-url)
   "The function to call when opening a file on a remote machine.
 The function will be called with two arguments; URI and ACTION. See
 `dnd-open-file' for details.
 If nil, then dragging remote files into Emacs will result in an error.
-Predefined functions are `dnd-open-unc-file' and `dnd-open-remote-url'.
-`dnd-open-unc-file' attempts to open the file using its UNC name and is the 
-default on MS-Windows.  `dnd-open-remote-url' uses `url-handler-mode' and
-is the default except for MS-Windows."
+Predefined functions are `dnd-open-local-file' and `dnd-open-remote-url'.
+`dnd-open-local-file' attempts to open a remote file using its UNC name and
+is the  default on MS-Windows.  `dnd-open-remote-url' uses `url-handler-mode'
+and is the default except for MS-Windows."
   :version "22.1"
   :type 'function
   :group 'dnd)
@@ -163,7 +163,11 @@
 The file is opened in the current window, or a new window if
 `dnd-open-file-other-window' is set.  URI is the url for the file,
 and must have the format file:file-name or file:///file-name.
-The last / in file:/// is part of the file name.  ACTION is ignored."
+The last / in file:/// is part of the file name.  If the system
+natively supports unc file names, then remote urls of the form
+file://server-name/file-name will also be handled by this function.
+An alternative for systems that do not support unc file names is
+`dnd-open-remote-url'. ACTION is ignored."
 
   (let* ((f (dnd-get-local-file-name uri t)))
     (if (and f (file-readable-p f))
@@ -174,22 +178,6 @@
 	  'private)
       (error "Can not read %s" uri))))
 
-(defun dnd-open-unc-file (uri action)
-  "Open a remote file using its unc path.
-The file is opened in the current window, or a new window if
-`dnd-open-file-other-window' is set. URI is the url for the file,
-and must have the format file://hostname/file-name. ACTION is ignored.
-//hostname/file-name is the unc path."
-  (let ((unc-file (if (string-match "^file:" uri)
-		      (substring uri 5))))
-    (if (and unc-file (file-readable-p unc-file))
-	(progn
-	  (if dnd-open-file-other-window
-	      (find-file-other-window unc-file)
-	    (find-file unc-file))
-	  'private)
-      (error "Invalid file url"))))
-
 (defun dnd-open-remote-url (uri action)
   "Open a remote file with `find-file' and `url-handler-mode'.
 Turns `url-handler-mode' on if not on before.  The file is opened in the
--- a/lisp/ediff-util.el	Thu Sep 14 09:24:00 2006 +0000
+++ b/lisp/ediff-util.el	Wed Sep 20 06:04:23 2006 +0000
@@ -4281,6 +4281,11 @@
       (setq lis1 (cdr lis1)))
     (cdr result)))
 
+(defun ediff-add-to-history (history-var newelt)
+  (if (fboundp 'add-to-history)
+      (add-to-history history-var newelt)
+    (set history-var (cons newelt (symbol-value history-var)))))
+
 (if (fboundp 'copy-sequence)
     (defalias 'ediff-copy-list 'copy-sequence)
   (defun ediff-copy-list (list)
--- a/lisp/ediff.el	Thu Sep 14 09:24:00 2006 +0000
+++ b/lisp/ediff.el	Wed Sep 20 06:04:23 2006 +0000
@@ -7,8 +7,8 @@
 ;; Created: February 2, 1994
 ;; Keywords: comparing, merging, patching, tools, unix
 
-(defconst ediff-version "2.81" "The current version of Ediff")
-(defconst ediff-date "February 18, 2006" "Date of last update")
+(defconst ediff-version "2.81.1" "The current version of Ediff")
+(defconst ediff-date "September 18, 2006" "Date of last update")
 
 
 ;; This file is part of GNU Emacs.
@@ -210,11 +210,12 @@
 					   ediff-last-dir-B
 					 (file-name-directory f)))
 				 (progn
-				   (add-to-history 'file-name-history
-						   (ediff-abbreviate-file-name
-						    (expand-file-name
-						     (file-name-nondirectory f)
-						     dir-B)))
+				   (ediff-add-to-history
+				    'file-name-history
+				    (ediff-abbreviate-file-name
+				     (expand-file-name
+				      (file-name-nondirectory f)
+				      dir-B)))
 				   (ediff-get-default-file-name f 1)))
 	   )))
   (ediff-files-internal file-A
@@ -245,22 +246,24 @@
 						    ediff-last-dir-B
 						  (file-name-directory f)))
 					  (progn
-					    (add-to-history 'file-name-history
-							    (ediff-abbreviate-file-name
-							     (expand-file-name
-							      (file-name-nondirectory f)
-							      dir-B)))
+					    (ediff-add-to-history
+					     'file-name-history
+					     (ediff-abbreviate-file-name
+					      (expand-file-name
+					       (file-name-nondirectory f)
+					       dir-B)))
 					    (ediff-get-default-file-name f 1))))
 	   (ediff-read-file-name "File C to compare"
 				 (setq dir-C (if ediff-use-last-dir
 						 ediff-last-dir-C
 					       (file-name-directory ff)))
 				 (progn
-				   (add-to-history 'file-name-history
-						   (ediff-abbreviate-file-name
-						    (expand-file-name
-						     (file-name-nondirectory ff)
-						     dir-C)))
+				   (ediff-add-to-history
+				    'file-name-history
+				    (ediff-abbreviate-file-name
+				     (expand-file-name
+				      (file-name-nondirectory ff)
+				      dir-C)))
 				   (ediff-get-default-file-name ff 2)))
 	   )))
   (ediff-files-internal file-A
@@ -1103,11 +1106,12 @@
 					   ediff-last-dir-B
 					 (file-name-directory f)))
 				 (progn
-				   (add-to-history 'file-name-history
-						   (ediff-abbreviate-file-name
-						    (expand-file-name
-						     (file-name-nondirectory f)
-						     dir-B)))
+				   (ediff-add-to-history
+				    'file-name-history
+				    (ediff-abbreviate-file-name
+				     (expand-file-name
+				      (file-name-nondirectory f)
+				      dir-B)))
 				   (ediff-get-default-file-name f 1)))
 	   )))
   (setq startup-hooks (cons 'ediff-merge-on-startup startup-hooks))
@@ -1146,11 +1150,12 @@
 						    ediff-last-dir-B
 						  (file-name-directory f)))
 					  (progn
-					    (add-to-history 'file-name-history
-							    (ediff-abbreviate-file-name
-							     (expand-file-name
-							      (file-name-nondirectory f)
-							      dir-B)))
+					    (ediff-add-to-history
+					     'file-name-history
+					     (ediff-abbreviate-file-name
+					      (expand-file-name
+					       (file-name-nondirectory f)
+					       dir-B)))
 					    (ediff-get-default-file-name f 1))))
 	   (ediff-read-file-name "Ancestor file"
 				 (setq dir-ancestor
@@ -1158,11 +1163,12 @@
 					   ediff-last-dir-ancestor
 					 (file-name-directory ff)))
 				 (progn
-				   (add-to-history 'file-name-history
-						   (ediff-abbreviate-file-name
-						    (expand-file-name
-						     (file-name-nondirectory ff)
-						     dir-ancestor)))
+				   (ediff-add-to-history
+				    'file-name-history
+				    (ediff-abbreviate-file-name
+				     (expand-file-name
+				      (file-name-nondirectory ff)
+				      dir-ancestor)))
 				   (ediff-get-default-file-name ff 2)))
 	   )))
   (setq startup-hooks (cons 'ediff-merge-on-startup startup-hooks))
--- a/lisp/emulation/viper-cmd.el	Thu Sep 14 09:24:00 2006 +0000
+++ b/lisp/emulation/viper-cmd.el	Wed Sep 20 06:04:23 2006 +0000
@@ -3098,7 +3098,7 @@
                (and (consp widget)
                     (get (widget-type widget) 'widget-type))))
         (widget-button-press (point))
-      (if (button-at (point))
+      (if (and (fboundp 'button-at) (fboundp 'push-button) (button-at (point)))
           (push-button)
 	;; not a widget or a button
         (viper-leave-region-active)
--- a/lisp/emulation/viper.el	Thu Sep 14 09:24:00 2006 +0000
+++ b/lisp/emulation/viper.el	Wed Sep 20 06:04:23 2006 +0000
@@ -9,7 +9,7 @@
 ;; Author: Michael Kifer <kifer@cs.stonybrook.edu>
 ;; Keywords: emulations
 
-(defconst viper-version "3.12 of February 18, 2006"
+(defconst viper-version "3.13 of September 18, 2006"
   "The current version of Viper")
 
 ;; This file is part of GNU Emacs.
--- a/lisp/ezimage.el	Thu Sep 14 09:24:00 2006 +0000
+++ b/lisp/ezimage.el	Wed Sep 20 06:04:23 2006 +0000
@@ -27,7 +27,7 @@
 ;;
 ;; A few routines for placing an image over text that will work for any
 ;; Emacs implementation without error.  When images are not supported, then
-;; they are justnot displayed.
+;; they are just not displayed.
 ;;
 ;; The idea is that gui buffers (trees, buttons, etc) will have text
 ;; representations of the GUI elements.  These routines will replace the text
--- a/lisp/faces.el	Thu Sep 14 09:24:00 2006 +0000
+++ b/lisp/faces.el	Wed Sep 20 06:04:23 2006 +0000
@@ -2080,7 +2080,7 @@
 
 (defgroup mode-line-faces nil
   "Faces used in the mode line."
-  :group 'modeline
+  :group 'mode-line
   :group 'faces
   :version "22.1")
 
--- a/lisp/font-lock.el	Thu Sep 14 09:24:00 2006 +0000
+++ b/lisp/font-lock.el	Wed Sep 20 06:04:23 2006 +0000
@@ -718,7 +718,7 @@
 	   ;; If the keywords were compiled before, compile them again.
 	   (if was-compiled
 	       (setq font-lock-keywords
-                     (font-lock-compile-keywords font-lock-keywords t)))))))
+                     (font-lock-compile-keywords font-lock-keywords)))))))
 
 (defun font-lock-update-removed-keyword-alist (mode keywords how)
   "Update `font-lock-removed-keywords-alist' when adding new KEYWORDS to MODE."
@@ -825,7 +825,7 @@
 	   ;; If the keywords were compiled before, compile them again.
 	   (if was-compiled
 	       (setq font-lock-keywords
-                     (font-lock-compile-keywords font-lock-keywords t)))))))
+                     (font-lock-compile-keywords font-lock-keywords)))))))
 
 ;;; Font Lock Support mode.
 
@@ -1414,7 +1414,8 @@
   ;; If `font-lock-syntactic-keywords' is not compiled, compile it.
   (unless (eq (car font-lock-syntactic-keywords) t)
     (setq font-lock-syntactic-keywords (font-lock-compile-keywords
-					font-lock-syntactic-keywords)))
+					font-lock-syntactic-keywords
+					t)))
   ;; Get down to business.
   (let ((case-fold-search font-lock-keywords-case-fold-search)
 	(keywords (cddr font-lock-syntactic-keywords))
@@ -1570,7 +1571,7 @@
 LOUDLY, if non-nil, allows progress-meter bar."
   (unless (eq (car font-lock-keywords) t)
     (setq font-lock-keywords
-	  (font-lock-compile-keywords font-lock-keywords t)))
+	  (font-lock-compile-keywords font-lock-keywords)))
   (let ((case-fold-search font-lock-keywords-case-fold-search)
 	(keywords (cddr font-lock-keywords))
 	(bufname (buffer-name)) (count 0)
@@ -1626,12 +1627,12 @@
 
 ;; Various functions.
 
-(defun font-lock-compile-keywords (keywords &optional regexp)
+(defun font-lock-compile-keywords (keywords &optional syntactic-keywords)
   "Compile KEYWORDS into the form (t KEYWORDS COMPILED...)
 Here each COMPILED is of the form (MATCHER HIGHLIGHT ...) as shown in the
 `font-lock-keywords' doc string.
-If REGEXP is non-nil, it means these keywords are used for
-`font-lock-keywords' rather than for `font-lock-syntactic-keywords'."
+If SYNTACTIC-KEYWORDS is non-nil, it means these keywords are used for
+`font-lock-syntactic-keywords' rather than for `font-lock-keywords'."
   (if (not font-lock-set-defaults)
       ;; This should never happen.  But some external packages sometimes
       ;; call font-lock in unexpected and incorrect ways.  It's important to
@@ -1644,7 +1645,7 @@
     (setq keywords
 	  (cons t (cons keywords
 			(mapcar 'font-lock-compile-keyword keywords))))
-    (if (and regexp
+    (if (and (not syntactic-keywords)
 	     (eq (or syntax-begin-function
 		     font-lock-beginning-of-syntax-function)
 		 'beginning-of-defun)
@@ -1774,7 +1775,7 @@
       ;; Now compile the keywords.
       (unless (eq (car font-lock-keywords) t)
 	(setq font-lock-keywords
-              (font-lock-compile-keywords font-lock-keywords t))))))
+              (font-lock-compile-keywords font-lock-keywords))))))
 
 ;;; Colour etc. support.
 
--- a/lisp/gnus/ChangeLog	Thu Sep 14 09:24:00 2006 +0000
+++ b/lisp/gnus/ChangeLog	Wed Sep 20 06:04:23 2006 +0000
@@ -1,3 +1,15 @@
+2006-09-19  Andreas Seltenreich  <uwi7@rz.uni-karlsruhe.de>
+
+	* nnslashdot.el (nnslashdot-request-article): Update end-of-article
+	regexp.  Articles containing quotation were cut prematurely.
+
+2006-09-16  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+	* message.el (message-cite-original-without-signature): Use nobody by
+	default for the value of From header.
+	(message-cite-original): Ditto.
+	(message-reply): Ditto.
+
 2006-09-09  Reiner Steib  <Reiner.Steib@gmx.de>
 
 	* pop3.el (pop3-leave-mail-on-server): Mention problem of duplicate
--- a/lisp/gnus/message.el	Thu Sep 14 09:24:00 2006 +0000
+++ b/lisp/gnus/message.el	Wed Sep 20 06:04:23 2006 +0000
@@ -3280,7 +3280,7 @@
 	    (message-narrow-to-head-1)
 	    (vector 0
 		    (or (message-fetch-field "subject") "none")
-		    (message-fetch-field "from")
+		    (or (message-fetch-field "from") "nobody")
 		    (message-fetch-field "date")
 		    (message-fetch-field "message-id" t)
 		    (message-fetch-field "references")
@@ -3329,7 +3329,7 @@
 	      (message-narrow-to-head-1)
 	      (vector 0
 		      (or (message-fetch-field "subject") "none")
-		      (message-fetch-field "from")
+		      (or (message-fetch-field "from") "nobody")
 		      (message-fetch-field "date")
 		      (message-fetch-field "message-id" t)
 		      (message-fetch-field "references")
@@ -5843,7 +5843,7 @@
       (setq message-id (message-fetch-field "message-id" t)
 	    references (message-fetch-field "references")
 	    date (message-fetch-field "date")
-	    from (message-fetch-field "from")
+	    from (or (message-fetch-field "from") "nobody")
 	    subject (or (message-fetch-field "subject") "none"))
       (when gnus-list-identifiers
 	(setq subject (message-strip-list-identifiers subject)))
--- a/lisp/gnus/nnslashdot.el	Thu Sep 14 09:24:00 2006 +0000
+++ b/lisp/gnus/nnslashdot.el	Wed Sep 20 06:04:23 2006 +0000
@@ -258,7 +258,9 @@
 		(setq contents
 		      (buffer-substring
 		       (search-forward "<div class=\"commentBody\">")
-		       (search-forward "</div>")))))))
+		       (progn
+			 (search-forward "<div class=\"commentSub\">")
+			 (match-beginning 0))))))))
       (search-failed (nnslashdot-lose why)))
 
     (when contents
--- a/lisp/help.el	Thu Sep 14 09:24:00 2006 +0000
+++ b/lisp/help.el	Wed Sep 20 06:04:23 2006 +0000
@@ -309,7 +309,7 @@
 The prefix described consists of all but the last event
 of the key sequence that ran this command."
   (interactive)
-  (let* ((key (this-command-keys)))
+  (let ((key (this-command-keys)))
     (describe-bindings
      (if (stringp key)
 	 (substring key 0 (1- (length key)))
@@ -567,11 +567,16 @@
 	     (menu-bar-update-yank-menu "(any string)" nil))
 	   (setq key (read-key-sequence "Describe key (or click or menu item): "))
 	   ;; If KEY is a down-event, read and discard the
-	   ;; corresponding up-event.
-	   (if (and (vectorp key)
-		    (eventp (elt key 0))
-		    (memq 'down (event-modifiers (elt key 0))))
-	       (read-event))
+	   ;; corresponding up-event.  Note that there are also
+	   ;; down-events on scroll bars and mode lines: the actual
+	   ;; event then is in the second element of the vector.
+	   (and (vectorp key)
+		(or (and (eventp (aref key 0))
+			 (memq 'down (event-modifiers (aref key 0))))
+		    (and (> (length key) 1)
+			 (eventp (aref key 1))
+			 (memq 'down (event-modifiers (aref key 1)))))
+		(read-event))
 	   (list
 	    key
 	    (if current-prefix-arg (prefix-numeric-value current-prefix-arg))
@@ -582,45 +587,33 @@
 	 (fset 'yank-menu (cons 'keymap yank-menu))))))
   (if (numberp untranslated)
       (setq untranslated (this-single-command-raw-keys)))
-  (save-excursion
-    (let ((modifiers (event-modifiers (aref key 0)))
-	  (standard-output (if insert (current-buffer) t))
-	  window position)
-      ;; For a mouse button event, go to the button it applies to
-      ;; to get the right key bindings.  And go to the right place
-      ;; in case the keymap depends on where you clicked.
-      (if (or (memq 'click modifiers) (memq 'down modifiers)
-	      (memq 'drag modifiers))
-	  (setq window (posn-window (event-start (aref key 0)))
-		position (posn-point (event-start (aref key 0)))))
-      (if (windowp window)
-	  (progn
-	    (set-buffer (window-buffer window))
-	    (goto-char position)))
-      ;; Ok, now look up the key and name the command.
-      (let ((defn (key-binding key t))
-	    key-desc)
-	;; Handle the case where we faked an entry in "Select and Paste" menu.
-	(if (and (eq defn nil)
-		 (stringp (aref key (1- (length key))))
-		 (eq (key-binding (substring key 0 -1)) 'yank-menu))
-	    (setq defn 'menu-bar-select-yank))
-	;; Don't bother user with strings from (e.g.) the select-paste menu.
-	(if (stringp (aref key (1- (length key))))
-	    (aset key (1- (length key)) "(any string)"))
-	(if (and (> (length untranslated) 0)
-		 (stringp (aref untranslated (1- (length untranslated)))))
-	    (aset untranslated (1- (length untranslated))
-		  "(any string)"))
-	;; Now describe the key, perhaps as changed.
-	(setq key-desc (help-key-description key untranslated))
-	(if (or (null defn) (integerp defn) (equal defn 'undefined))
-	    (princ (format "%s is undefined" key-desc))
-	  (princ (format (if (windowp window)
-			     "%s at that spot runs the command %s"
-			   "%s runs the command %s")
-			 key-desc
-			 (if (symbolp defn) defn (prin1-to-string defn)))))))))
+  (let* ((event (if (and (symbolp (aref key 0))
+			 (> (length key) 1)
+			 (consp (aref key 1)))
+		    (aref key 1)
+		  (aref key 0)))
+	 (modifiers (event-modifiers event))
+	 (standard-output (if insert (current-buffer) t))
+	 (mouse-msg (if (or (memq 'click modifiers) (memq 'down modifiers)
+			    (memq 'drag modifiers)) " at that spot" ""))
+	 (defn (key-binding key t))
+	 key-desc)
+    ;; Handle the case where we faked an entry in "Select and Paste" menu.
+    (if (and (eq defn nil)
+	     (stringp (aref key (1- (length key))))
+	     (eq (key-binding (substring key 0 -1)) 'yank-menu))
+	(setq defn 'menu-bar-select-yank))
+    ;; Don't bother user with strings from (e.g.) the select-paste menu.
+    (if (stringp (aref key (1- (length key))))
+	(aset key (1- (length key)) "(any string)"))
+    (if (and (> (length untranslated) 0)
+	     (stringp (aref untranslated (1- (length untranslated)))))
+	(aset untranslated (1- (length untranslated)) "(any string)"))
+    ;; Now describe the key, perhaps as changed.
+    (setq key-desc (help-key-description key untranslated))
+    (if (or (null defn) (integerp defn) (equal defn 'undefined))
+	(princ (format "%s%s is undefined" key-desc mouse-msg))
+      (princ (format "%s%s runs the command %S" key-desc mouse-msg defn)))))
 
 (defun describe-key (&optional key untranslated up-event)
   "Display documentation of the function invoked by KEY.
@@ -652,105 +645,107 @@
 	    (prefix-numeric-value current-prefix-arg)
 	    ;; If KEY is a down-event, read the corresponding up-event
 	    ;; and use it as the third argument.
-	    (if (and (vectorp key)
-		     (eventp (elt key 0))
-		     (memq 'down (event-modifiers (elt key 0))))
-		(read-event))))
+	    (and (vectorp key)
+		 (or (and (eventp (aref key 0))
+			  (memq 'down (event-modifiers (aref key 0))))
+		     (and (> (length key) 1)
+			  (eventp (aref key 1))
+			  (memq 'down (event-modifiers (aref key 1)))))
+		 (read-event))))
        ;; Put yank-menu back as it was, if we changed it.
        (when saved-yank-menu
 	 (setq yank-menu (copy-sequence saved-yank-menu))
 	 (fset 'yank-menu (cons 'keymap yank-menu))))))
   (if (numberp untranslated)
       (setq untranslated (this-single-command-raw-keys)))
-  (save-excursion
-    (let ((modifiers (event-modifiers (aref key 0)))
-	  window position)
-      ;; For a mouse button event, go to the button it applies to
-      ;; to get the right key bindings.  And go to the right place
-      ;; in case the keymap depends on where you clicked.
-      (if (or (memq 'click modifiers) (memq 'down modifiers)
-	      (memq 'drag modifiers))
-	  (setq window (posn-window (event-start (aref key 0)))
-		position (posn-point (event-start (aref key 0)))))
-      (when (windowp window)
-	    (set-buffer (window-buffer window))
-	(goto-char position))
-      (let ((defn (key-binding key t)))
-	;; Handle the case where we faked an entry in "Select and Paste" menu.
-	(if (and (eq defn nil)
-		 (stringp (aref key (1- (length key))))
-		 (eq (key-binding (substring key 0 -1)) 'yank-menu))
-	    (setq defn 'menu-bar-select-yank))
-	(if (or (null defn) (integerp defn) (equal defn 'undefined))
-	    (message "%s is undefined" (help-key-description key untranslated))
-	  (help-setup-xref (list #'describe-function defn) (interactive-p))
-	  ;; Don't bother user with strings from (e.g.) the select-paste menu.
-	  (if (stringp (aref key (1- (length key))))
-	      (aset key (1- (length key)) "(any string)"))
-	  (if (and untranslated
-		   (stringp (aref untranslated (1- (length untranslated)))))
-	      (aset untranslated (1- (length untranslated))
-		    "(any string)"))
-	  (with-output-to-temp-buffer (help-buffer)
-	    (princ (help-key-description key untranslated))
-	    (if (windowp window)
-		(princ " at that spot"))
-	    (princ " runs the command ")
-	    (prin1 defn)
-	    (princ "\n   which is ")
-	    (describe-function-1 defn)
-	    (when up-event
-	      (let ((type (event-basic-type up-event))
-		    (hdr "\n\n-------------- up event ---------------\n\n")
-		    defn sequence
-		    mouse-1-tricky mouse-1-remapped)
-		(setq sequence (vector up-event))
-		(when (and (eq type 'mouse-1)
-			   (windowp window)
+  (let* ((event (aref key (if (and (symbolp (aref key 0))
+				   (> (length key) 1)
+				   (consp (aref key 1)))
+			      1
+			    0)))
+	 (modifiers (event-modifiers event))
+	 (mouse-msg (if (or (memq 'click modifiers) (memq 'down modifiers)
+			    (memq 'drag modifiers)) " at that spot" ""))
+	 (defn (key-binding key t))
+	 defn-up defn-up-tricky ev-type
+	 mouse-1-remapped mouse-1-tricky)
+
+    ;; Handle the case where we faked an entry in "Select and Paste" menu.
+    (when (and (eq defn nil)
+	       (stringp (aref key (1- (length key))))
+	       (eq (key-binding (substring key 0 -1)) 'yank-menu))
+      (setq defn 'menu-bar-select-yank))
+    (if (or (null defn) (integerp defn) (equal defn 'undefined))
+	(message "%s%s is undefined"
+		 (help-key-description key untranslated) mouse-msg)
+      (help-setup-xref (list #'describe-function defn) (interactive-p))
+      ;; Don't bother user with strings from (e.g.) the select-paste menu.
+      (when (stringp (aref key (1- (length key))))
+	(aset key (1- (length key)) "(any string)"))
+      (when (and untranslated
+		 (stringp (aref untranslated (1- (length untranslated)))))
+	(aset untranslated (1- (length untranslated))
+	      "(any string)"))
+      ;; Need to do this before erasing *Help* buffer in case event
+      ;; is a mouse click in an existing *Help* buffer.
+      (when up-event
+	(setq ev-type (event-basic-type up-event))
+	(let ((sequence (vector up-event)))
+	  (when (and (eq ev-type 'mouse-1)
+		     mouse-1-click-follows-link
+		     (not (eq mouse-1-click-follows-link 'double))
+		     (setq mouse-1-remapped
+			   (mouse-on-link-p (event-start up-event))))
+	    (setq mouse-1-tricky (and (integerp mouse-1-click-follows-link)
+				      (> mouse-1-click-follows-link 0)))
+	    (cond ((stringp mouse-1-remapped)
+		   (setq sequence mouse-1-remapped))
+		  ((vectorp mouse-1-remapped)
+		   (setcar up-event (elt mouse-1-remapped 0)))
+		  (t (setcar up-event 'mouse-2))))
+	  (setq defn-up (key-binding sequence nil nil (event-start up-event)))
+	  (when mouse-1-tricky
+	    (setq sequence (vector up-event))
+	    (aset sequence 0 'mouse-1)
+	    (setq defn-up-tricky (key-binding sequence nil nil (event-start up-event))))))
+      (with-output-to-temp-buffer (help-buffer)
+	(princ (help-key-description key untranslated))
+	(princ (format "\
+%s runs the command %S
+  which is "
+		       mouse-msg defn))
+	(describe-function-1 defn)
+	(when up-event
+	  (unless (or (null defn-up)
+		      (integerp defn-up)
+		      (equal defn-up 'undefined))
+	    (princ (format "
+
+----------------- up-event %s----------------
+
+<%S>%s%s runs the command %S
+  which is "
+			   (if mouse-1-tricky "(short click) " "")
+			   ev-type mouse-msg
+			   (if mouse-1-remapped
+			       " is remapped to <mouse-2>\nwhich" "")
+			   defn-up))
+	    (describe-function-1 defn-up))
+	  (unless (or (null defn-up-tricky)
+		      (integerp defn-up-tricky)
+		      (eq defn-up-tricky 'undefined))
+	    (princ (format "
+
+----------------- up-event (long click) ----------------
+
+Pressing <%S>%s for longer than %d milli-seconds
+runs the command %S
+  which is "
+			   ev-type mouse-msg
 			   mouse-1-click-follows-link
-			   (not (eq mouse-1-click-follows-link 'double))
-			   (setq mouse-1-remapped
-				 (with-current-buffer (window-buffer window)
-				   (mouse-on-link-p (posn-point
-						     (event-start up-event))))))
-		  (setq mouse-1-tricky (and (integerp mouse-1-click-follows-link)
-					    (> mouse-1-click-follows-link 0)))
-		  (cond ((stringp mouse-1-remapped)
-			 (setq sequence mouse-1-remapped))
-			((vectorp mouse-1-remapped)
-			 (setcar up-event (elt mouse-1-remapped 0)))
-			(t (setcar up-event 'mouse-2))))
-		(setq defn (key-binding sequence))
-		(unless (or (null defn) (integerp defn) (equal defn 'undefined))
-		  (princ (if mouse-1-tricky
-			     "\n\n----------------- up-event (short click) ----------------\n\n"
-			   hdr))
-		  (setq hdr nil)
-		  (princ (symbol-name type))
-		  (if (windowp window)
-		      (princ " at that spot"))
-		  (if mouse-1-remapped
-		      (princ " is remapped to <mouse-2>\n  which" ))
-		  (princ " runs the command ")
-		  (prin1 defn)
-		  (princ "\n   which is ")
-		  (describe-function-1 defn))
-		(when mouse-1-tricky
-		  (setcar up-event 'mouse-1)
-		  (setq defn (key-binding (vector up-event)))
-		  (unless (or (null defn) (integerp defn) (eq defn 'undefined))
-		    (princ (or hdr
-			       "\n\n----------------- up-event (long click) ----------------\n\n"))
-		    (princ "Pressing mouse-1")
-		    (if (windowp window)
-			(princ " at that spot"))
-		    (princ (format " for longer than %d milli-seconds\n"
-				   mouse-1-click-follows-link))
-		    (princ " runs the command ")
-		    (prin1 defn)
-		    (princ "\n   which is ")
-		    (describe-function-1 defn)))))
-	    (print-help-return-message)))))))
+			   defn-up-tricky))
+	    (describe-function-1 defn-up-tricky)))
+	(print-help-return-message)))))
 
 (defun describe-mode (&optional buffer)
   "Display documentation of current major mode and minor modes.
--- a/lisp/ido.el	Thu Sep 14 09:24:00 2006 +0000
+++ b/lisp/ido.el	Wed Sep 20 06:04:23 2006 +0000
@@ -3618,7 +3618,7 @@
 		  ((stringp nextstr)
 		   (and (>= flen (setq slen (length nextstr)))
 			(string-equal (substring name (- flen slen)) nextstr)))
-		  ((fboundp nextstr) (funcall nextstr name))
+		  ((functionp nextstr) (funcall nextstr name))
 		  (t nil))
 		 (setq ignorep t
 		       ext-list nil
@@ -3628,7 +3628,7 @@
 	     (setq nextstr (car re-list))
 	     (if (cond
 		  ((stringp nextstr) (string-match nextstr name))
-		  ((fboundp nextstr) (funcall nextstr name))
+		  ((functionp nextstr) (funcall nextstr name))
 		  (t nil))
 		 (setq ignorep t
 		       re-list nil)
--- a/lisp/jit-lock.el	Thu Sep 14 09:24:00 2006 +0000
+++ b/lisp/jit-lock.el	Wed Sep 20 06:04:23 2006 +0000
@@ -397,19 +397,19 @@
            ;; 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-current-buffer buf
-                          (with-buffer-prepared-for-jit-lock
-                              (put-text-property start orig-start
-                                                 'fontified t)))))))
+	     (run-with-timer 0 nil 'jit-lock-fontify-again
+			     (current-buffer) start orig-start))
 
 	   ;; Find the start of the next chunk, if any.
 	   (setq start (text-property-any next end 'fontified nil))))))))
 
+(defun jit-lock-fontify-again (buf start end)
+  "Fontify in buffer BUF from START to END."
+  (with-current-buffer buf
+    (with-buffer-prepared-for-jit-lock
+     (put-text-property start end 'fontified t))))
+
+
 
 ;;; Stealth fontification.
 
--- a/lisp/menu-bar.el	Thu Sep 14 09:24:00 2006 +0000
+++ b/lisp/menu-bar.el	Wed Sep 20 06:04:23 2006 +0000
@@ -510,7 +510,7 @@
 
 (defun clipboard-yank ()
   "Insert the clipboard contents, or the last stretch of killed text."
-  (interactive)
+  (interactive "*")
   (let ((x-select-enable-clipboard t))
     (yank)))
 
--- a/lisp/mouse-sel.el	Thu Sep 14 09:24:00 2006 +0000
+++ b/lisp/mouse-sel.el	Wed Sep 20 06:04:23 2006 +0000
@@ -702,7 +702,7 @@
 using double-clicks."
   (and initial final mouse-1-click-follows-link
        (eq (car initial) 'down-mouse-1)
-       (mouse-on-link-p	(posn-point (event-start initial)))
+       (mouse-on-link-p (event-start initial))
        (= (posn-point (event-start initial))
 	  (posn-point (event-end final)))
        (= (event-click-count initial) 1)
--- a/lisp/mouse.el	Thu Sep 14 09:24:00 2006 +0000
+++ b/lisp/mouse.el	Wed Sep 20 06:04:23 2006 +0000
@@ -556,7 +556,7 @@
 	 (echo-keystrokes 0)
 	 (start-event-frame (window-frame (car (car (cdr start-event)))))
 	 (start-event-window (car (car (cdr start-event))))
-	 event mouse x left right edges wconfig growth
+	 event mouse x left right edges growth
 	 (which-side
 	  (or (cdr (assq 'vertical-scroll-bars (frame-parameters start-event-frame)))
 	      'right)))
@@ -775,6 +775,24 @@
       (mouse-drag-track start-event t))))
 
 
+(defun mouse-posn-property (pos property)
+  "Look for a property at click position.
+POS may be either a buffer position or a click position like
+those returned from `start-event'.  If the click position is on
+a string, the text property PROPERTY is examined.
+If this is nil or the click is not on a string, then
+the corresponding buffer position is searched for PROPERTY.
+If PROPERTY is encountered in one of those places,
+its value is returned."
+  (if (consp pos)
+      (let ((w (posn-window pos)) (pt (posn-point pos))
+	    (str (posn-string pos)))
+	(or (and str
+		 (get-text-property (cdr str) property (car str)))
+	    (and pt
+		 (get-char-property pt property w))))
+    (get-char-property pos property)))
+
 (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 a mouse
@@ -814,24 +832,23 @@
 
 - Otherwise, the mouse-1 event is translated into a mouse-2 event
 at the same position."
-  (let ((w (and (consp pos) (posn-window pos))))
-    (if (consp pos)
-	(setq pos (and (or mouse-1-click-in-non-selected-windows
-			   (eq (selected-window) w))
-		       (posn-point pos))))
-    (when pos
-      (with-current-buffer (window-buffer w)
-	(let ((action
-	       (or (get-char-property pos 'follow-link)
-		   (save-excursion
-		     (goto-char pos)
-		     (key-binding [follow-link] nil t)))))
-	  (cond
-	   ((eq action 'mouse-face)
-	    (and (get-char-property pos 'mouse-face) t))
-	   ((functionp action)
-	    (funcall action pos))
-	   (t action)))))))
+  (let ((action
+	 (and (or (not (consp pos))
+		  mouse-1-click-in-non-selected-windows
+		  (eq (selected-window) (posn-window pos)))
+	      (or (mouse-posn-property pos 'follow-link)
+		  (key-binding [follow-link] nil t pos)))))
+    (cond
+     ((eq action 'mouse-face)
+      (and (mouse-posn-property pos 'mouse-face) t))
+     ((functionp action)
+      ;; FIXME: This seems questionable if the click is not in a buffer.
+      ;; Should we instead decide that `action' takes a `posn'?
+      (if (consp pos)
+	  (with-current-buffer (window-buffer (posn-window pos))
+	    (funcall action (posn-point pos)))	
+	(funcall action pos)))
+     (t action))))
 
 (defun mouse-fixup-help-message (msg)
   "Fix help message MSG for `mouse-1-click-follows-link'."
@@ -904,7 +921,7 @@
                        ;; Use start-point before the intangibility
                        ;; treatment, in case we click on a link inside an
                        ;; intangible text.
-                       (mouse-on-link-p start-point)))
+                       (mouse-on-link-p start-posn)))
 	 (click-count (1- (event-click-count start-event)))
 	 (remap-double-click (and on-link
 				  (eq mouse-1-click-follows-link 'double)
--- a/lisp/obsolete/fast-lock.el	Thu Sep 14 09:24:00 2006 +0000
+++ b/lisp/obsolete/fast-lock.el	Wed Sep 20 06:04:23 2006 +0000
@@ -623,9 +623,9 @@
   ;; Compile all keywords in case some are and some aren't.
   (when font-lock-syntactic-keywords
     (setq font-lock-syntactic-keywords (font-lock-compile-keywords
-					font-lock-syntactic-keywords)))
+					font-lock-syntactic-keywords t)))
   (when syntactic-keywords
-    (setq syntactic-keywords (font-lock-compile-keywords syntactic-keywords)))
+    (setq syntactic-keywords (font-lock-compile-keywords syntactic-keywords t)))
   (setq font-lock-keywords (font-lock-compile-keywords font-lock-keywords)
 	keywords (font-lock-compile-keywords keywords))
   ;; Use the Font Lock cache SYNTACTIC-PROPERTIES and FACE-PROPERTIES if we're
--- a/lisp/play/life.el	Thu Sep 14 09:24:00 2006 +0000
+++ b/lisp/play/life.el	Wed Sep 20 06:04:23 2006 +0000
@@ -56,7 +56,28 @@
     "            @@   " "             @@  " "              @@ "
     "               @@")
    ("@@@@@@@@@" "@   @   @" "@ @@@@@ @" "@ @   @ @" "@@@   @@@"
-    "@ @   @ @" "@ @@@@@ @" "@   @   @" "@@@@@@@@@")]
+    "@ @   @ @" "@ @@@@@ @" "@   @   @" "@@@@@@@@@")
+   ("                        @           "
+    "                      @ @           "
+    "            @@      @@            @@"
+    "           @   @    @@            @@"
+    "@@        @     @   @@              "
+    "@@        @   @ @@    @ @           "
+    "          @     @       @           "
+    "           @   @                    "
+    "            @@                      ")
+   ("      @ "
+    "    @ @@"
+    "    @ @ "
+    "    @   "
+    "  @     "
+    "@ @     ")
+   ("@@@ @"
+    "@    "
+    "   @@"
+    " @@ @"
+    "@ @ @")
+   ("@@@@@@@@ @@@@@   @@@      @@@@@@@ @@@@@")]
   "Vector of rectangles containing some Life startup patterns.")
 
 ;; Macros are used macros for manifest constants instead of variables
@@ -128,6 +149,7 @@
 	  mode-name "Life"
 	  major-mode 'life-mode
 	  truncate-lines t
+          show-trailing-whitespace nil
 	  life-current-generation 0
 	  life-generation-string "0"
 	  mode-line-buffer-identification '("Life: generation "
--- a/lisp/progmodes/compile.el	Thu Sep 14 09:24:00 2006 +0000
+++ b/lisp/progmodes/compile.el	Wed Sep 20 06:04:23 2006 +0000
@@ -229,7 +229,7 @@
      ;; 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\n]\\(?:[^\n ]\\| [^-\n]\\)*?\\): ?\
 \\([0-9]+\\)\\(?:\\([.:]\\)\\([0-9]+\\)\\)?\
 \\(?:-\\([0-9]+\\)?\\(?:\\3\\([0-9]+\\)\\)?\\)?:\
 \\(?: *\\(\\(?:Future\\|Runtime\\)?[Ww]arning\\|W:\\)\\|\
--- a/lisp/progmodes/python.el	Thu Sep 14 09:24:00 2006 +0000
+++ b/lisp/progmodes/python.el	Wed Sep 20 06:04:23 2006 +0000
@@ -1289,7 +1289,7 @@
                     ;; Maybe we could be more selective here.
                     (if (zerop (length res))
                         (not (bolp))
-                      (string-match res ".\\'"))))
+                      (string-match ".\\'" res))))
            ;; The need for this seems to be system-dependent:
            ;; What is this all about, exactly?  --Stef
            ;; (if (and (eq ?. (aref s 0)))
--- a/lisp/saveplace.el	Thu Sep 14 09:24:00 2006 +0000
+++ b/lisp/saveplace.el	Wed Sep 20 06:04:23 2006 +0000
@@ -238,7 +238,7 @@
           ;; load it if it exists:
           (if (file-readable-p file)
               (save-excursion
-                (message "Loading places from %s..." save-place-file)
+                (message "Loading places from %s..." file)
                 ;; don't want to use find-file because we have been
                 ;; adding hooks to it.
                 (set-buffer (get-buffer-create " *Saved Places*"))
--- a/lisp/select.el	Thu Sep 14 09:24:00 2006 +0000
+++ b/lisp/select.el	Wed Sep 20 06:04:23 2006 +0000
@@ -223,8 +223,11 @@
 	      (setq str (encode-coding-string str coding))))
 
 	   ((eq type 'UTF8_STRING)
-	    (setq str (encode-coding-string str 'utf-8)))
-
+	    (let ((charsets (find-charset-string str)))
+	      (if (or (memq 'eight-bit-control charsets)
+		      (memq 'eight-bit-graphic charsets))
+		  (setq type 'STRING)
+		(setq str (encode-coding-string str 'utf-8)))))
 	   (t
 	    (error "Unknow selection type: %S" type))
 	   )))
--- a/lisp/simple.el	Thu Sep 14 09:24:00 2006 +0000
+++ b/lisp/simple.el	Wed Sep 20 06:04:23 2006 +0000
@@ -3487,43 +3487,53 @@
 	  (set-window-vscroll nil (- vs (frame-char-height)) t)))
 
     ;; Move forward (down).
-    (let* ((evis (or (pos-visible-in-window-p (window-end nil t) nil t)
-		     (pos-visible-in-window-p (1- (window-end nil t)) nil t)))
-	   (rbot (nth 3 evis))
-	   (vpos (nth 5 evis))
+    (let* ((lh (window-line-height -1))
+	   (vpos (nth 1 lh))
+	   (ypos (nth 2 lh))
+	   (rbot (nth 3 lh))
 	   ppos py vs)
-      (cond
-       ;; Last window line should be visible - fail if not.
-       ((null evis)
-	nil)
-       ;; If last line of window is fully visible, move forward.
-       ((null rbot)
-	nil)
-       ;; If cursor is not in the bottom scroll margin, move forward.
-       ((< (setq ppos (posn-at-point)
-		 py (cdr (or (posn-actual-col-row ppos)
-			     (posn-col-row ppos))))
-	   (min (- (window-text-height) scroll-margin 1) (1- vpos)))
-	nil)
-       ;; When already vscrolled, we vscroll some more if we can,
-       ;; or clear vscroll and move forward at end of tall image.
-       ((> (setq vs (window-vscroll nil t)) 0)
-	(when (> rbot 0)
-	  (set-window-vscroll nil (+ vs (min rbot (frame-char-height))) t)))
-       ;; If cursor just entered the bottom scroll margin, move forward,
-       ;; but also vscroll one line so redisplay wont recenter.
-       ((= py (min (- (window-text-height) scroll-margin 1)
-		   (1- vpos)))
-	(set-window-vscroll nil (frame-char-height) t)
-	(line-move-1 arg noerror to-end)
-	t)
-       ;; If there are lines above the last line, scroll-up one line.
-       ((> vpos 0)
-	(scroll-up 1)
-	t)
-       ;; Finally, start vscroll.
-       (t
-	(set-window-vscroll nil (frame-char-height) t))))))
+      (when (or (null lh)
+		(>= rbot (frame-char-height))
+		(<= ypos (- (frame-char-height))))
+	(unless lh
+	  (let* ((wend (window-end nil t))
+		 (evis (or (pos-visible-in-window-p wend nil t)
+			   (pos-visible-in-window-p (1- wend) nil t))))
+	    (setq rbot (nth 3 evis)
+		  vpos (nth 5 evis))))
+	(cond
+	 ;; If last line of window is fully visible, move forward.
+	 ((or (null rbot) (= rbot 0))
+	  nil)
+	 ;; If cursor is not in the bottom scroll margin, move forward.
+	 ((and (> vpos 0)
+	       (< (setq py
+			(or (nth 1 (window-line-height))
+			    (let ((ppos (posn-at-point)))
+			      (cdr (or (posn-actual-col-row ppos)
+				       (posn-col-row ppos))))))
+		  (min (- (window-text-height) scroll-margin 1) (1- vpos))))
+	  nil)
+	 ;; When already vscrolled, we vscroll some more if we can,
+	 ;; or clear vscroll and move forward at end of tall image.
+	 ((> (setq vs (window-vscroll nil t)) 0)
+	  (when (> rbot 0)
+	    (set-window-vscroll nil (+ vs (min rbot (frame-char-height))) t)))
+	 ;; If cursor just entered the bottom scroll margin, move forward,
+	 ;; but also vscroll one line so redisplay wont recenter.
+	 ((and (> vpos 0)
+	       (= py (min (- (window-text-height) scroll-margin 1)
+			  (1- vpos))))
+	  (set-window-vscroll nil (frame-char-height) t)
+	  (line-move-1 arg noerror to-end)
+	  t)
+	 ;; If there are lines above the last line, scroll-up one line.
+	 ((> vpos 0)
+	  (scroll-up 1)
+	  t)
+	 ;; Finally, start vscroll.
+	 (t
+	  (set-window-vscroll nil (frame-char-height) t)))))))
 
 
 ;; This is like line-move-1 except that it also performs
@@ -3551,7 +3561,7 @@
   ;; for intermediate positions.
   (let ((inhibit-point-motion-hooks t)
 	(opoint (point))
-	(forward (> arg 0)))
+	(orig-arg arg))
     (unwind-protect
 	(progn
 	  (if (not (memq last-command '(next-line previous-line)))
@@ -3584,14 +3594,27 @@
 			      'end-of-buffer)
 			    nil)))
 	    ;; Move by arg lines, but ignore invisible ones.
-	    (let (done)
+	    (let (done line-end)
 	      (while (and (> arg 0) (not done))
 		;; If the following character is currently invisible,
 		;; skip all characters with that same `invisible' property value.
 		(while (and (not (eobp)) (line-move-invisible-p (point)))
 		  (goto-char (next-char-property-change (point))))
-		;; Now move a line.
-		(end-of-line)
+		;; Move a line.
+		;; We don't use `end-of-line', since we want to escape
+		;; from field boundaries ocurring exactly at point.
+		(let ((inhibit-field-text-motion t))
+		  (setq line-end (line-end-position)))
+		(goto-char (constrain-to-field line-end (point) t t))
+		;; When moving a single line, update the goal-column
+		;; if we couldn't move to the end of line due to a
+		;; field boundary.  Otherwise we'll get stuck at the
+		;; original position during the column motion in
+		;; line-move-finish.
+		(and (/= line-end (point))
+		     (= orig-arg 1)
+		     (setq temporary-goal-column
+			   (max temporary-goal-column (current-column))))
 		;; If there's no invisibility here, move over the newline.
 		(cond
 		 ((eobp)
@@ -3649,7 +3672,7 @@
 	     (beginning-of-line))
 	    (t
 	     (line-move-finish (or goal-column temporary-goal-column)
-			       opoint forward))))))
+			       opoint (> orig-arg 0)))))))
 
 (defun line-move-finish (column opoint forward)
   (let ((repeat t))
@@ -3711,7 +3734,7 @@
 	(goto-char opoint)
 	(let ((inhibit-point-motion-hooks nil))
 	  (goto-char
-	   (constrain-to-field new opoint nil t
+	   (constrain-to-field new opoint t t
 			       'inhibit-line-move-field-capture)))
 
 	;; If all this moved us to a different line,
@@ -3727,10 +3750,7 @@
 and `current-column' to be able to ignore invisible text."
   (if (zerop col)
       (beginning-of-line)
-    (let ((opoint (point)))
-      (move-to-column col)
-      ;; move-to-column doesn't respect field boundaries.
-      (goto-char (constrain-to-field (point) opoint))))
+    (move-to-column col))
 
   (when (and line-move-ignore-invisible
 	     (not (bolp)) (line-move-invisible-p (1- (point))))
@@ -4366,21 +4386,21 @@
 Line numbers do not appear for very large buffers and buffers
 with very long lines; see variables `line-number-display-limit'
 and `line-number-display-limit-width'."
-  :init-value t :global t :group 'editing-basics)
+  :init-value t :global t :group 'mode-line)
 
 (define-minor-mode column-number-mode
   "Toggle Column Number mode.
 With arg, turn Column Number mode on iff arg is positive.
 When Column Number mode is enabled, the column number appears
 in the mode line."
-  :global t :group 'editing-basics)
+  :global t :group 'mode-line)
 
 (define-minor-mode size-indication-mode
   "Toggle Size Indication mode.
 With arg, turn Size Indication mode on iff arg is positive.  When
 Size Indication mode is enabled, the size of the accessible part
 of the buffer appears in the mode line."
-  :global t :group 'editing-basics)
+  :global t :group 'mode-line)
 
 (defgroup paren-blinking nil
   "Blinking matching of parens and expressions."
--- a/lisp/startup.el	Thu Sep 14 09:24:00 2006 +0000
+++ b/lisp/startup.el	Wed Sep 20 06:04:23 2006 +0000
@@ -1114,10 +1114,7 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 (defvar fancy-splash-text
-  '((:face variable-pitch
-	   "You can do basic editing with the menu bar and scroll bar \
-using the mouse.\n\n"
-	   :face (variable-pitch :weight bold)
+  '((:face (variable-pitch :weight bold)
 	   "Important Help menu items:\n"
 	   :face variable-pitch
            (lambda ()
@@ -1141,8 +1138,8 @@
                 "\n")))
            :face variable-pitch "\
 Emacs FAQ\tFrequently asked questions and answers
-Read the Emacs Manual\tView the Emacs manual using Info
-\(Non)Warranty\tGNU Emacs comes with "
+View Emacs Manual\tView the Emacs manual using Info
+Absence of Warranty\tGNU Emacs comes with "
 	   :face (variable-pitch :slant oblique)
 	   "ABSOLUTELY NO WARRANTY\n"
 	   :face variable-pitch
@@ -1150,18 +1147,16 @@
 Copying Conditions\tConditions for redistributing and changing Emacs
 Getting New Versions\tHow to obtain the latest version of Emacs
 More Manuals / Ordering Manuals       Buying printed manuals from the FSF\n")
-  (:face variable-pitch
-	   "You can do basic editing with the menu bar and scroll bar \
-using the mouse.\n\n"
-	   :face (variable-pitch :weight bold)
-	   "Useful File menu items:\n"
-	   :face variable-pitch "\
-Exit Emacs\t(Or type Control-x followed by Control-c)
+  (:face (variable-pitch :weight bold)
+	 "Useful File menu items:\n"
+	 :face variable-pitch "\
+Exit Emacs\t\t(Or type Control-x followed by Control-c)
 Recover Crashed Session\tRecover files you were editing before a crash
 
 
 
 
+
 "
 	   ))
   "A list of texts to show in the middle part of splash screens.
@@ -1269,6 +1264,10 @@
        "GNU Emacs is one component of the GNU/Linux operating system."
      "GNU Emacs is one component of the GNU operating system."))
   (insert "\n")
+  (fancy-splash-insert
+   :face 'variable-pitch
+   "You can do basic editing with the menu bar and scroll bar \
+using the mouse.\n\n")
   (if fancy-splash-outer-buffer
       (fancy-splash-insert
        :face 'variable-pitch
@@ -1305,7 +1304,7 @@
 	  t)
 	 (fancy-splash-insert :face '(variable-pitch :foreground "red")
 			      "\n\nIf an Emacs session crashed recently, "
-			      "type M-x recover-session RET\nto recover"
+			      "type Meta-x recover-session RET\nto recover"
 			      " the files you were editing."))))
 
 (defun fancy-splash-screens-1 (buffer)
@@ -1350,7 +1349,6 @@
 
 (defun fancy-splash-screens (&optional hide-on-input)
   "Display fancy splash screens when Emacs starts."
-  (setq fancy-splash-help-echo (startup-echo-area-message))
   (if hide-on-input
       (let ((old-hourglass display-hourglass)
 	    (fancy-splash-outer-buffer (current-buffer))
@@ -1362,18 +1360,17 @@
 	(save-selected-window
 	  (select-frame frame)
 	  (switch-to-buffer "GNU Emacs")
-	  (setq tab-width 20)
 	  (setq splash-buffer (current-buffer))
 	  (catch 'stop-splashing
 	    (unwind-protect
-		(let ((map (make-sparse-keymap)))
+		(let ((map (make-sparse-keymap))
+		      (cursor-type nil))
 		  (use-local-map map)
 		  (define-key map [switch-frame] 'ignore)
 		  (define-key map [t] 'fancy-splash-default-action)
 		  (define-key map [mouse-movement] 'ignore)
 		  (define-key map [mode-line t] 'ignore)
-		  (setq cursor-type nil
-			display-hourglass nil
+		  (setq display-hourglass nil
 			minor-mode-map-alist nil
 			emulation-mode-map-alists nil
 			buffer-undo-list t
@@ -1384,6 +1381,7 @@
 			timer (run-with-timer 0 fancy-splash-delay
 					      #'fancy-splash-screens-1
 					      splash-buffer))
+		  (message "%s" (startup-echo-area-message))
 		  (recursive-edit))
 	      (cancel-timer timer)
 	      (setq display-hourglass old-hourglass
@@ -1404,7 +1402,11 @@
     (let (fancy-splash-outer-buffer)
       (fancy-splash-head)
       (dolist (text fancy-splash-text)
-	(apply #'fancy-splash-insert text))
+	(apply #'fancy-splash-insert text)
+	(insert "\n"))
+      (skip-chars-backward "\n")
+      (delete-region (point) (point-max))
+      (insert "\n")
       (fancy-splash-tail)
       (set-buffer-modified-p nil)
       (setq buffer-read-only t)
@@ -1581,7 +1583,7 @@
                                        auto-save-list-file-prefix)))
                 t)
                (insert "\n\nIf an Emacs session crashed recently, "
-                       "type M-x recover-session RET\nto recover"
+                       "type Meta-x recover-session RET\nto recover"
                        " the files you were editing."))
 
           ;; Display the input that we set up in the buffer.
--- a/lisp/term/x-win.el	Thu Sep 14 09:24:00 2006 +0000
+++ b/lisp/term/x-win.el	Wed Sep 20 06:04:23 2006 +0000
@@ -2501,8 +2501,14 @@
 (define-key special-event-map [drag-n-drop] 'x-dnd-handle-drag-n-drop-event)
 
 ;; Let F10 do menu bar navigation.
+(defun x-menu-bar-open (&optional frame)
+  "Open the menu bar if `menu-bar-mode' is on. otherwise call `tmm-menubar'."
+  (interactive "i")
+  (if menu-bar-mode (menu-bar-open frame)
+    (tmm-menubar)))
+		   
 (and (fboundp 'menu-bar-open)
-     (global-set-key [f10] 'menu-bar-open))
+     (global-set-key [f10] 'x-menu-bar-open))
 
 ;; arch-tag: f1501302-db8b-4d95-88e3-116697d89f78
 ;;; x-win.el ends here
--- a/lisp/textmodes/conf-mode.el	Thu Sep 14 09:24:00 2006 +0000
+++ b/lisp/textmodes/conf-mode.el	Wed Sep 20 06:04:23 2006 +0000
@@ -75,8 +75,8 @@
     (define-key map "\C-c\C-u" 'conf-unix-mode)
     (define-key map "\C-c\C-w" 'conf-windows-mode)
     (define-key map "\C-c\C-j" 'conf-javaprop-mode)
-    (define-key map "\C-c\C-s" 'conf-space-mode)
-    (define-key map "\C-c " 'conf-space-mode)
+    (define-key map "\C-c\C-s" 'conf-space-keywords)
+    (define-key map "\C-c " 'conf-space-keywords)
     (define-key map "\C-c\C-c" 'conf-colon-mode)
     (define-key map "\C-c:" 'conf-colon-mode)
     (define-key map "\C-c\C-x" 'conf-xdefaults-mode)
@@ -168,7 +168,7 @@
     ("/resmgr\\.conf" . "class\\|add\\|allow\\|deny")
     ("/dictionary\\.lst\\'" . "DICT\\|HYPH\\|THES")
     ("/tuxracer/options" . "set"))
-  "File name based settings for `conf-space-keywords'.")
+  "File-name-based settings for the variable `conf-space-keywords'.")
 
 (defvar conf-space-keywords nil
   "Regexps for functions that may come before a space assignment.
@@ -188,7 +188,7 @@
 		'(1 'font-lock-keyword-face)
 		'(2 'font-lock-variable-name-face))
 	  '("^[ \t]*\\([^\000- ]+\\)" 1 'font-lock-variable-name-face)))
-  "Keywords to hilight in Conf Space mode.")
+  "Keywords to highlight in Conf Space mode.")
 
 (defvar conf-colon-font-lock-keywords
   `(;; [section] (do this first because it may look like a parameter)
@@ -442,17 +442,15 @@
   (setq imenu-generic-expression
 	'(("Parameters" "^[ \t]*\\(.+?\\)[=: \t]" 1))))
 
-(defvar conf-space-keywords-override nil
-  "Value to be put in `conf-space-keywords' after `conf-space-mode'.")
-
 ;;;###autoload
 (define-derived-mode conf-space-mode conf-unix-mode "Conf[Space]"
   "Conf Mode starter for space separated conf files.
 \"Assignments\" are with ` '.  Keywords before the parameters are
-recognized according to `conf-space-keywords'.  Interactively
-with a prefix ARG of `0' no keywords will be recognized.  With
-any other prefix arg you will be prompted for a regexp to match
-the keywords.
+recognized according to the variable `conf-space-keywords-alist'.
+Alternatively, you can specify a value for the file local variable
+`conf-space-keywords'.
+Use the function `conf-space-keywords' if you want to specify keywords
+in an interactive fashion instead.
 
 For details see `conf-mode'.  Example:
 
@@ -471,35 +469,32 @@
   (make-local-variable 'conf-assignment-sign)
   (setq conf-assignment-sign nil)
   (make-local-variable 'conf-space-keywords)
-  (make-local-variable 'conf-space-keywords-override)
-  (setq conf-space-keywords-override nil)
-  (cond (current-prefix-arg
-	 ;; By setting conf-space-keywords-override
-	 ;; we arrange for conf-space-mode-internal
-	 ;; to override any value of conf-space-keywords
-	 ;; specified in a local variables list.
-         (setq conf-space-keywords-override
-	       (if (> (prefix-numeric-value current-prefix-arg) 0)
-		   (read-string "Regexp to match keywords: "))))
-	;; If this is already set, don't replace it with the default.
-	(conf-space-keywords)
-        (buffer-file-name
-	 ;; By setting conf-space-keywords directly, 
-	 ;; we let a value in the local variables list take precedence.
-	 (make-local-variable 'conf-space-keywords)
+  (cond (buffer-file-name
+	 ;; We set conf-space-keywords directly, but a value which is
+	 ;; in the local variables list or interactively specified
+	 ;; (see the function conf-space-keywords) takes precedence.
          (setq conf-space-keywords
 	       (assoc-default buffer-file-name conf-space-keywords-alist
 			      'string-match))))
   (conf-space-mode-internal)
   ;; In case the local variables list specifies conf-space-keywords,
   ;; recompute other things from that afterward.
-  (push 'conf-space-mode-internal
-	hack-local-variables-hook))
+  (add-hook 'hack-local-variables-hook 'conf-space-mode-internal nil t))
+
+;;;###autoload
+(defun conf-space-keywords (keywords)
+  "Enter Conf Space mode using regexp KEYWORDS to match the keywords.
+See `conf-space-mode'."
+  (interactive "sConf Space keyword regexp: ")
+  (delay-mode-hooks
+    (conf-space-mode))
+  (if (string-equal keywords "")
+      (setq keywords nil))
+  (setq conf-space-keywords keywords)
+  (conf-space-mode-internal)
+  (run-mode-hooks))
 
 (defun conf-space-mode-internal ()
-  (when conf-space-keywords-override
-    (setq conf-space-keywords
-	  conf-space-keywords-override))
   (make-local-variable 'conf-assignment-regexp)
   (setq conf-assignment-regexp
 	(if conf-space-keywords
@@ -511,14 +506,21 @@
 	     (boundp 'font-lock-keywords)) ;see `normal-mode'
     (font-lock-add-keywords nil nil)
     (font-lock-mode 1))
+  ;; Copy so that we don't destroy shared structure.
+  (setq imenu-generic-expression (copy-sequence imenu-generic-expression))
+  ;; Get rid of any existing Parameters element.
   (setq imenu-generic-expression
-	`(,@(cdr imenu-generic-expression)
-	  ("Parameters"
-	   ,(if conf-space-keywords
-		(concat "^[ \t]*\\(?:" conf-space-keywords
-			"\\)[ \t]+\\([^ \t\n]+\\)\\(?:[ \t]\\|$\\)")
-	      "^[ \t]*\\([^ \t\n[]+\\)\\(?:[ \t]\\|$\\)")
-	   1))))
+	(delq (assoc "Parameters" imenu-generic-expression)
+	      imenu-generic-expression))
+  ;; Add a new one based on conf-space-keywords.
+  (setq imenu-generic-expression
+	(cons `("Parameters"
+		,(if conf-space-keywords
+		     (concat "^[ \t]*\\(?:" conf-space-keywords
+			     "\\)[ \t]+\\([^ \t\n]+\\)\\(?:[ \t]\\|$\\)")
+		   "^[ \t]*\\([^ \t\n[]+\\)\\(?:[ \t]\\|$\\)")
+		1)
+	      imenu-generic-expression)))
 
 ;;;###autoload
 (define-derived-mode conf-colon-mode conf-unix-mode "Conf[Colon]"
--- a/lisp/textmodes/flyspell.el	Thu Sep 14 09:24:00 2006 +0000
+++ b/lisp/textmodes/flyspell.el	Wed Sep 20 06:04:23 2006 +0000
@@ -1460,6 +1460,22 @@
 	    (while (re-search-forward regexp nil t)
 	      (delete-region (match-beginning 0) (match-end 0)))))))))
 
+;;* ---------------------------------------------------------------
+;;*     flyspell-check-region-doublons
+;;* ---------------------------------------------------------------
+(defun flyspell-check-region-doublons (beg end)
+  "Check for adjacent duplicated words (doublons) in the given region."
+  (save-excursion
+    (goto-char beg)
+    (flyspell-word)     ; Make sure current word is checked
+    (backward-word 1)
+    (while (and (< (point) end)
+		(re-search-forward "\\b\\([^ \n\t]+\\)[ \n\t]+\\1\\b"
+				   end 'move))
+      (flyspell-word)
+      (backward-word 1))
+    (flyspell-word)))
+
 ;;*---------------------------------------------------------------------*/
 ;;*    flyspell-large-region ...                                        */
 ;;*---------------------------------------------------------------------*/
@@ -1504,7 +1520,8 @@
 	  (progn
 	    (flyspell-process-localwords buffer)
 	    (with-current-buffer curbuf
-	      (flyspell-delete-region-overlays beg end))
+	      (flyspell-delete-region-overlays beg end)
+	      (flyspell-check-region-doublons beg end))
 	    (flyspell-external-point-words))
 	(error "Can't check region...")))))
 
--- a/lisp/time.el	Thu Sep 14 09:24:00 2006 +0000
+++ b/lisp/time.el	Wed Sep 20 06:04:23 2006 +0000
@@ -31,7 +31,7 @@
 
 (defgroup display-time nil
   "Display time and load in mode line of Emacs."
-  :group 'modeline
+  :group 'mode-line
   :group 'mail)
 
 
--- a/lisp/url/ChangeLog	Thu Sep 14 09:24:00 2006 +0000
+++ b/lisp/url/ChangeLog	Wed Sep 20 06:04:23 2006 +0000
@@ -1,3 +1,9 @@
+2006-09-18  Michael Olson  <mwolson@gnu.org>
+
+	* url-methods.el (url-scheme-register-proxy): Handle case where
+	getenv returns an empty string for http_proxy.  This prevents an
+	error when calling `format' later on.
+
 2006-08-31  Diane Murray  <disumu@x3y2z1.net>
 
 	* url-parse.el (url-recreate-url-attributes): New function, code
--- a/lisp/url/url-methods.el	Thu Sep 14 09:24:00 2006 +0000
+++ b/lisp/url/url-methods.el	Wed Sep 20 06:04:23 2006 +0000
@@ -75,6 +75,11 @@
 	 (cur-proxy (assoc scheme url-proxy-services))
 	 (urlobj nil))
 
+    ;; If env-proxy is an empty string, treat it as if it were nil
+    (when (and (stringp env-proxy)
+	       (string= env-proxy ""))
+      (setq env-proxy nil))
+
     ;; Store any proxying information - this will not overwrite an old
     ;; entry, so that people can still set this information in their
     ;; .emacs file
--- a/lisp/wid-edit.el	Thu Sep 14 09:24:00 2006 +0000
+++ b/lisp/wid-edit.el	Wed Sep 20 06:04:23 2006 +0000
@@ -959,15 +959,18 @@
 				  (push event unread-command-events)
 				  (setq event oevent)
 				  (throw 'button-press-cancelled t))
-				(setq pos (widget-event-point event))
-				(if (and pos
-					 (eq (get-char-property pos 'button)
-					     button))
-				    (when face
-				      (overlay-put overlay 'face pressed-face)
-				      (overlay-put overlay 'mouse-face pressed-face))
-				  (overlay-put overlay 'face face)
-				  (overlay-put overlay 'mouse-face mouse-face)))))
+				(unless (or (integerp event)
+					    (memq (car event) '(switch-frame select-window))
+					    (eq (car event) 'scroll-bar-movement))
+				  (setq pos (widget-event-point event))
+				  (if (and pos
+					   (eq (get-char-property pos 'button)
+					       button))
+				      (when face
+					(overlay-put overlay 'face pressed-face)
+					(overlay-put overlay 'mouse-face pressed-face))
+				    (overlay-put overlay 'face face)
+				    (overlay-put overlay 'mouse-face mouse-face))))))
 
 			  ;; When mouse is released over the button, run
 			  ;; its action function.
--- a/lispref/ChangeLog	Thu Sep 14 09:24:00 2006 +0000
+++ b/lispref/ChangeLog	Wed Sep 20 06:04:23 2006 +0000
@@ -1,3 +1,52 @@
+2006-09-19  David Kastrup  <dak@gnu.org>
+
+	* keymaps.texi (Searching Keymaps): Small clarification.
+
+2006-09-18  Richard Stallman  <rms@gnu.org>
+
+	* keymaps.texi (Creating Keymaps): Explain that keymap prompt strings
+	cause keyboard menus.
+	(Menu Keymaps): Likewise.
+	(Defining Menus, Keyboard Menus): Clarify.
+
+	* text.texi (Fields): Clarify explanation of constrain-to-field.
+
+2006-09-16  Eli Zaretskii  <eliz@gnu.org>
+
+	* variables.texi (Tips for Defining): Fix a typo.
+
+2006-09-15  Richard Stallman  <rms@gnu.org>
+
+	* keymaps.texi (Remapping Commands, Searching Keymaps)
+	(Active Keymaps): Clean up previous change.
+
+2006-09-15  Jay Belanger  <belanger@truman.edu>
+
+	* gpl.texi: Replace "Library Public License" by "Lesser Public
+	License" throughout.
+
+2006-09-15  David Kastrup  <dak@gnu.org>
+
+	* keymaps.texi (Active Keymaps): Adapt description to use
+	`get-char-property' instead `get-text-property'.  Explain how
+	mouse events change this.  Explain the new optional argument of
+	`key-binding' and its mouse-dependent lookup.
+	(Searching Keymaps): Adapt description similarly.
+	(Remapping Commands): Explain the new optional argument of
+	`command-remapping'.
+
+2006-09-14  Richard Stallman  <rms@gnu.org>
+
+	* keymaps.texi (Searching Keymaps): Clarification.
+	(Active Keymaps): Refer to Searching Keymaps instead of duplication.
+
+2006-09-13  Richard Stallman  <rms@gnu.org>
+
+	* objects.texi (Character Type): Node split.
+	Add xref to Describing Characters.
+	(Basic Char Syntax, General Escape Syntax)
+	(Ctl-Char Syntax, Meta-Char Syntax): New subnodes.
+
 2006-09-11  Richard Stallman  <rms@gnu.org>
 
 	* display.texi (Display Table Format): Wording clarification.
@@ -4859,7 +4908,7 @@
 	(info): Add target.
 	(installall): Target removed.
 
-2001-10-31  Pavel Jan,Bm(Bk  <Pavel@Janik.cz>
+2001-10-31  Pavel Jan,Am(Bk  <Pavel@Janik.cz>
 
 	* tips.texi (Coding Conventions): Fix typo.
 
--- a/lispref/gpl.texi	Thu Sep 14 09:24:00 2006 +0000
+++ b/lispref/gpl.texi	Wed Sep 20 06:04:23 2006 +0000
@@ -23,7 +23,7 @@
 General Public License applies to most of the Free Software
 Foundation's software and to any other program whose authors commit to
 using it.  (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.)  You can apply it to
+the GNU Lesser General Public License instead.)  You can apply it to
 your programs, too.
 
   When we speak of free software, we are referring to freedom, not
@@ -75,13 +75,13 @@
 @item
 This License applies to any program or other work which contains
 a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License.  The ``Program,'' below,
+under the terms of this General Public License.  The ``Program'', below,
 refers to any such program or work, and a ``work based on the Program''
 means either the Program or any derivative work under copyright law:
 that is to say, a work containing the Program or a portion of it,
 either verbatim or with modifications and/or translated into another
 language.  (Hereinafter, translation is included without limitation in
-the term ``modification.'')  Each licensee is addressed as ``you.''
+the term ``modification''.)  Each licensee is addressed as ``you''.
 
 Activities other than copying, distribution and modification are not
 covered by this License; they are outside its scope.  The act of
@@ -274,7 +274,7 @@
 
 Each version is given a distinguishing version number.  If the Program
 specifies a version number of this License which applies to it and ``any
-later version,'' you have the option of following the terms and conditions
+later version'', you have the option of following the terms and conditions
 either of that version or of any later version published by the Free
 Software Foundation.  If the Program does not specify a version number of
 this License, you may choose any version ever published by the Free Software
@@ -339,8 +339,8 @@
 the ``copyright'' line and a pointer to where the full notice is found.
 
 @smallexample
-@var{one line to give the program's name and an idea of what it does.}
-Copyright (C) @var{year}  @var{name of author}
+@var{one line to give the program's name and a brief idea of what it does.}
+Copyright (C) @var{yyyy}  @var{name of author}
 
 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
@@ -364,11 +364,10 @@
 when it starts in an interactive mode:
 
 @smallexample
-Gnomovision version 69, Copyright (C) @var{year} @var{name of author}
-Gnomovision comes with ABSOLUTELY NO WARRANTY; for details
-type `show w'.  This is free software, and you are welcome
-to redistribute it under certain conditions; type `show c'
-for details.
+Gnomovision version 69, Copyright (C) @var{yyyy} @var{name of author}
+Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+This is free software, and you are welcome to redistribute it 
+under certain conditions; type `show c' for details.
 @end smallexample
 
 The hypothetical commands @samp{show w} and @samp{show c} should show
--- a/lispref/keymaps.texi	Thu Sep 14 09:24:00 2006 +0000
+++ b/lispref/keymaps.texi	Wed Sep 20 06:04:23 2006 +0000
@@ -295,9 +295,13 @@
 @end group
 @end example
 
-If you specify @var{prompt}, that becomes the overall prompt string for
-the keymap.  The prompt string should be provided for menu keymaps
-(@pxref{Defining Menus}).
+If you specify @var{prompt}, that becomes the overall prompt string
+for the keymap.  You should specify this only for menu keymaps
+(@pxref{Defining Menus}).  A keymap with an overall prompt string will
+always present a mouse menu or a keyboard menu if it is active for
+looking up the next input event.  Don't specify an overall prompt string
+for the main map of a major or minor mode, because that would cause
+the command loop to present a keyboard menu every time.
 @end defun
 
 @defun make-keymap &optional prompt
@@ -569,35 +573,19 @@
 of them are @dfn{active}, meaning that they participate in the
 interpretation of user input.  All the active keymaps are used
 together to determine what command to execute when a key is entered.
-Emacs searches these keymaps one by one, in a standard order, until it
-finds a binding in one of the keymaps.
 
   Normally the active keymaps are the @code{keymap} property keymap,
 the keymaps of any enabled minor modes, the current buffer's local
-keymap, and the global keymap, in that order.  Therefore, Emacs
-searches for each input key sequence in all these keymaps.  Here is a
-pseudo-Lisp description of how this process works:
-
-@lisp
-(or (if overriding-terminal-local-map
-        (@var{find-in} overriding-terminal-local-map)
-      (if overriding-local-map
-          (@var{find-in} overriding-local-map)
-        (or (@var{find-in} (get-text-property (point) 'keymap))
-            (@var{find-in-any} emulation-mode-map-alists)
-            (@var{find-in-any} minor-mode-overriding-map-alist)
-            (@var{find-in-any} minor-mode-map-alist)
-            (if (get-text-property (point) 'local-map)
-                (@var{find-in} (get-text-property (point) 'local-map))
-              (@var{find-in} (current-local-map))))))
-    (@var{find-in} (current-global-map)))
-@end lisp
-
-@noindent
-Here, the pseudo-function @var{find-in} means to look up the key
-sequence in a single map, and @var{find-in-any} means to search the
-appropriate keymaps from an alist.  (Searching a single keymap for a
-binding is called @dfn{key lookup}; see @ref{Key Lookup}.)
+keymap, and the global keymap, in that order.  Emacs searches for each
+input key sequence in all these keymaps.  @xref{Searching Keymaps},
+for more details of this procedure.
+
+  When the key sequence starts with a mouse event (optionally preceded
+by a symbolic prefix), the active keymaps are determined based on the
+position in that event.  If the event happened on a string embedded
+with a @code{display}, @code{before-string}, or @code{after-string}
+property (@pxref{Special Properties}), the non-@code{nil} map
+properties of the string override those of the buffer.
 
   The @dfn{global keymap} holds the bindings of keys that are defined
 regardless of the current buffer, such as @kbd{C-f}.  The variable
@@ -655,25 +643,28 @@
 non-@code{nil} then it pays attention to them.
 @end defun
 
-@defun key-binding key &optional accept-defaults no-remap
+@defun key-binding key &optional accept-defaults no-remap position
 This function returns the binding for @var{key} according to the
 current active keymaps.  The result is @code{nil} if @var{key} is
 undefined in the keymaps.
 
-@c Emacs 19 feature
 The argument @var{accept-defaults} controls checking for default
 bindings, as in @code{lookup-key} (above).
 
-When @var{key} is a vector containing an input event, such as a mouse
-click, @code{key-binding} first looks for the binding in the keymaps
-that would be active at the position where the click was done.
-
 When commands are remapped (@pxref{Remapping Commands}),
 @code{key-binding} normally processes command remappings so as to
 returns the remapped command that will actually be executed.  However,
 if @var{no-remap} is non-@code{nil}, @code{key-binding} ignores
 remappings and returns the binding directly specified for @var{key}.
 
+If @var{key} starts with a mouse event (perhaps following a prefix
+event), the maps to be consulted are determined based on the event's
+position.  Otherwise, they are determined based on the value of point.
+However, you can override either of them by specifying @var{position}.
+If @var{position} is non-@code{nil}, it should be either a buffer
+position or an event position like the value of @code{event-start}.
+Then the maps consulted are determined based on @var{position}.
+
 An error is signaled if @var{key} is not a string or a vector.
 
 @example
@@ -687,21 +678,22 @@
 @node Searching Keymaps
 @section Searching the Active Keymaps
 
-  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:
+  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 and conditions for searching
+them:
 
 @lisp
 (or (if overriding-terminal-local-map
         (@var{find-in} overriding-terminal-local-map)
       (if overriding-local-map
           (@var{find-in} overriding-local-map)
-        (or (@var{find-in} (get-text-property (point) 'keymap))
+        (or (@var{find-in} (get-char-property (point) 'keymap))
             (@var{find-in-any} emulation-mode-map-alists)
             (@var{find-in-any} minor-mode-overriding-map-alist)
             (@var{find-in-any} minor-mode-map-alist)
             (if (get-text-property (point) 'local-map)
-                (@var{find-in} (get-text-property (point) 'local-map))
+                (@var{find-in} (get-char-property (point) 'local-map))
               (@var{find-in} (current-local-map))))))
     (@var{find-in} (current-global-map)))
 @end lisp
@@ -709,6 +701,12 @@
 @noindent
 The @var{find-in} and @var{find-in-any} are pseudo functions that
 search in one keymap and in an alist of keymaps, respectively.
+(Searching a single keymap for a binding is called @dfn{key lookup};
+see @ref{Key Lookup}.)  If the key sequence starts with a mouse event,
+or a symbolic prefix event followed by a mouse event, that event's
+position is used instead of point and the current buffer.  Mouse
+events on an embedded string use non-@code{nil} text properties from
+that string instead of the buffer.
 
 @enumerate
 @item
@@ -1470,11 +1468,13 @@
 if an ordinary binding specifies @code{my-kill-line}, this keymap will
 remap it to @code{my-other-kill-line}.
 
-@defun command-remapping command
+@defun command-remapping command &optional position
 This function returns the remapping for @var{command} (a symbol),
 given the current active keymaps.  If @var{command} is not remapped
 (which is the usual situation), or not a symbol, the function returns
-@code{nil}.
+@code{nil}.  @code{position} can optionally specify a buffer position
+or an event position to determine the keymaps to use, as in
+@code{key-binding}.
 @end defun
 
 @node Translation Keymaps
@@ -1904,15 +1904,16 @@
 @section Menu Keymaps
 @cindex menu keymaps
 
-@c Emacs 19 feature
-A keymap can define a menu as well as bindings for keyboard keys and
-mouse button.  Menus are usually actuated with the mouse, but they can
-work with the keyboard also.
+A keymap can operate as a menu as well as defining bindings for
+keyboard keys and mouse buttons.  Menus are usually actuated with the
+mouse, but they can function with the keyboard also.  If a menu keymap
+is active for the next input event, that activates the keyboard menu
+feature.
 
 @menu
 * Defining Menus::		How to make a keymap that defines a menu.
 * Mouse Menus::			How users actuate the menu with the mouse.
-* Keyboard Menus::		How they actuate it with the keyboard.
+* Keyboard Menus::		How users actuate the menu with the keyboard.
 * Menu Example::		Making a simple menu.
 * Menu Bar::			How to customize the menu bar.
 * Tool Bar::                    A tool bar is a row of images.
@@ -1925,20 +1926,21 @@
 @cindex menu prompt string
 @cindex prompt string (of menu)
 
-A keymap is suitable for menu use if it has an @dfn{overall prompt
-string}, which is a string that appears as an element of the keymap.
+A keymap acts as a menu if it has an @dfn{overall prompt string},
+which is a string that appears as an element of the keymap.
 (@xref{Format of Keymaps}.)  The string should describe the purpose of
 the menu's commands.  Emacs displays the overall prompt string as the
 menu title in some cases, depending on the toolkit (if any) used for
 displaying menus.@footnote{It is required for menus which do not use a
-toolkit, e.g.@: under MS-DOS.}  Keyboard menus also display the overall
-prompt string.
-
-The easiest way to construct a keymap with a prompt string is to specify
-the string as an argument when you call @code{make-keymap},
+toolkit, e.g.@: under MS-DOS.}  Keyboard menus also display the
+overall prompt string.
+
+The easiest way to construct a keymap with a prompt string is to
+specify the string as an argument when you call @code{make-keymap},
 @code{make-sparse-keymap} (@pxref{Creating Keymaps}), or
-@code{define-prefix-command} (@pxref{Definition of define-prefix-command}).
-
+@code{define-prefix-command} (@pxref{Definition of
+define-prefix-command}).  If you do not want the keymap to operate as
+a menu, don't specify a prompt string for it.
 
 @defun keymap-prompt keymap
 This function returns the overall prompt string of @var{keymap},
@@ -2296,21 +2298,23 @@
 @node Keyboard Menus
 @subsection Menus and the Keyboard
 
-When a prefix key ending with a keyboard event (a character or function
-key) has a definition that is a menu keymap, the user can use the
-keyboard to choose a menu item.
-
-Emacs displays the menu's overall prompt string followed by the
-alternatives (the item strings of the bindings) in the echo area.  If
-the bindings don't all fit at once, the user can type @key{SPC} to see
-the next line of alternatives.  Successive uses of @key{SPC} eventually
-get to the end of the menu and then cycle around to the beginning.  (The
-variable @code{menu-prompt-more-char} specifies which character is used
-for this; @key{SPC} is the default.)
-
-When the user has found the desired alternative from the menu, he or she
-should type the corresponding character---the one whose binding is that
-alternative.
+  When a prefix key ending with a keyboard event (a character or
+function key) has a definition that is a menu keymap, the keymap
+operates as a keyboard menu; the user specifies the next event by
+choosing a menu item with the keyboard.
+
+  Emacs displays the keyboard menu with the map's overall prompt
+string, followed by the alternatives (the item strings of the map's
+bindings), in the echo area.  If the bindings don't all fit at once,
+the user can type @key{SPC} to see the next line of alternatives.
+Successive uses of @key{SPC} eventually get to the end of the menu and
+then cycle around to the beginning.  (The variable
+@code{menu-prompt-more-char} specifies which character is used for
+this; @key{SPC} is the default.)
+
+  When the user has found the desired alternative from the menu, he or
+she should type the corresponding character---the one whose binding is
+that alternative.
 
 @ignore
 In a menu intended for keyboard use, each menu item must clearly
@@ -2321,7 +2325,7 @@
 key for each alternative.
 @end ignore
 
-This way of using menus in an Emacs-like editor was inspired by the
+  This way of using menus in an Emacs-like editor was inspired by the
 Hierarkey system.
 
 @defvar menu-prompt-more-char
--- a/lispref/text.texi	Thu Sep 14 09:24:00 2006 +0000
+++ b/lispref/text.texi	Wed Sep 20 06:04:23 2006 +0000
@@ -3783,20 +3783,25 @@
 closest to @var{new-pos} that is in the same field as @var{old-pos}.
 
 If @var{new-pos} is @code{nil}, then @code{constrain-to-field} uses
-the value of point instead, and moves point to the resulting position.
+the value of point instead, and moves point to the resulting position
+as well as returning it.
 
 If @var{old-pos} is at the boundary of two fields, then the acceptable
-positions for @var{new-pos} depend on the value of the optional argument
-@var{escape-from-edge}.  If @var{escape-from-edge} is @code{nil}, then
-@var{new-pos} is constrained to the field that has the same @code{field}
-property (either a text-property or an overlay property) that new
-characters inserted at @var{old-pos} would get.  (This depends on the
+final positions depend on the argument @var{escape-from-edge}.  If
+@var{escape-from-edge} is @code{nil}, then @var{new-pos} must be in
+the field whose @code{field} property equals what new characters
+inserted at @var{old-pos} would inherit.  (This depends on the
 stickiness of the @code{field} property for the characters before and
 after @var{old-pos}.)  If @var{escape-from-edge} is non-@code{nil},
-@var{new-pos} is constrained to the union of the two adjacent fields.
+@var{new-pos} can be anywhere in the two adjacent fields.
 Additionally, if two fields are separated by another field with the
-special value @code{boundary}, then any point within this special field
-is also considered to be ``on the boundary.''
+special value @code{boundary}, then any point within this special
+field is also considered to be ``on the boundary.''
+
+Commands like @kbd{C-a} with no argumemt, that normally move backward
+to a specific kind of location and stay there once there, probably
+should specify @code{nil} for @var{escape-from-edge}.  Other motion
+commands that check fields should probably pass @code{t}.
 
 If the optional argument @var{only-in-line} is non-@code{nil}, and
 constraining @var{new-pos} in the usual way would move it to a different
--- a/lispref/variables.texi	Thu Sep 14 09:24:00 2006 +0000
+++ b/lispref/variables.texi	Wed Sep 20 06:04:23 2006 +0000
@@ -626,7 +626,7 @@
 @item @dots{}-command
 The value is a whole shell command.
 
-@item @samp{}-switches
+@item @dots{}-switches
 The value specifies options for a command.
 @end table
 
--- a/lwlib/COPYING	Thu Sep 14 09:24:00 2006 +0000
+++ b/lwlib/COPYING	Wed Sep 20 06:04:23 2006 +0000
@@ -1,8 +1,8 @@
 		    GNU GENERAL PUBLIC LICENSE
 		       Version 2, June 1991
 
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
-                       51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  Everyone is permitted to copy and distribute verbatim copies
  of this license document, but changing it is not allowed.
 
@@ -15,7 +15,7 @@
 General Public License applies to most of the Free Software
 Foundation's software and to any other program whose authors commit to
 using it.  (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.)  You can apply it to
+the GNU Lesser General Public License instead.)  You can apply it to
 your programs, too.
 
   When we speak of free software, we are referring to freedom, not
@@ -55,7 +55,7 @@
 
   The precise terms and conditions for copying, distribution and
 modification follow.
-
+
 		    GNU GENERAL PUBLIC LICENSE
    TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
 
@@ -110,7 +110,7 @@
     License.  (Exception: if the Program itself is interactive but
     does not normally print such an announcement, your work based on
     the Program is not required to print an announcement.)
-
+
 These requirements apply to the modified work as a whole.  If
 identifiable sections of that work are not derived from the Program,
 and can be reasonably considered independent and separate works in
@@ -168,7 +168,7 @@
 access to copy the source code from the same place counts as
 distribution of the source code, even though third parties are not
 compelled to copy the source along with the object code.
-
+
   4. You may not copy, modify, sublicense, or distribute the Program
 except as expressly provided under this License.  Any attempt
 otherwise to copy, modify, sublicense or distribute the Program is
@@ -225,7 +225,7 @@
 
 This section is intended to make thoroughly clear what is believed to
 be a consequence of the rest of this License.
-
+
   8. If the distribution and/or use of the Program is restricted in
 certain countries either by patents or by copyrighted interfaces, the
 original copyright holder who places the Program under this License
@@ -278,7 +278,7 @@
 POSSIBILITY OF SUCH DAMAGES.
 
 		     END OF TERMS AND CONDITIONS
-
+
 	    How to Apply These Terms to Your New Programs
 
   If you develop a new program, and you want it to be of the greatest
@@ -303,10 +303,9 @@
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     GNU General Public License for more details.
 
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-
+    You should have received a copy of the GNU General Public License along
+    with this program; if not, write to the Free Software Foundation, Inc.,
+    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 Also add information on how to contact you by electronic and paper mail.
 
@@ -336,5 +335,5 @@
 This General Public License does not permit incorporating your program into
 proprietary programs.  If your program is a subroutine library, you may
 consider it more useful to permit linking proprietary applications with the
-library.  If this is what you want to do, use the GNU Library General
+library.  If this is what you want to do, use the GNU Lesser General
 Public License instead of this License.
--- a/lwlib/ChangeLog	Thu Sep 14 09:24:00 2006 +0000
+++ b/lwlib/ChangeLog	Wed Sep 20 06:04:23 2006 +0000
@@ -1,3 +1,8 @@
+2006-09-15  Jay Belanger  <belanger@truman.edu>
+
+	* COPYING: Replace "Library Public License" by "Lesser Public
+	License" throughout.
+
 2006-05-23  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>
 
 	* xlwmenu.c: Include xterm.h if emacs instead of declaring functions
--- a/mac/COPYING	Thu Sep 14 09:24:00 2006 +0000
+++ b/mac/COPYING	Wed Sep 20 06:04:23 2006 +0000
@@ -1,8 +1,8 @@
 		    GNU GENERAL PUBLIC LICENSE
 		       Version 2, June 1991
 
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
-                       51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  Everyone is permitted to copy and distribute verbatim copies
  of this license document, but changing it is not allowed.
 
@@ -15,7 +15,7 @@
 General Public License applies to most of the Free Software
 Foundation's software and to any other program whose authors commit to
 using it.  (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.)  You can apply it to
+the GNU Lesser General Public License instead.)  You can apply it to
 your programs, too.
 
   When we speak of free software, we are referring to freedom, not
@@ -55,7 +55,7 @@
 
   The precise terms and conditions for copying, distribution and
 modification follow.
-
+
 		    GNU GENERAL PUBLIC LICENSE
    TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
 
@@ -110,7 +110,7 @@
     License.  (Exception: if the Program itself is interactive but
     does not normally print such an announcement, your work based on
     the Program is not required to print an announcement.)
-
+
 These requirements apply to the modified work as a whole.  If
 identifiable sections of that work are not derived from the Program,
 and can be reasonably considered independent and separate works in
@@ -168,7 +168,7 @@
 access to copy the source code from the same place counts as
 distribution of the source code, even though third parties are not
 compelled to copy the source along with the object code.
-
+
   4. You may not copy, modify, sublicense, or distribute the Program
 except as expressly provided under this License.  Any attempt
 otherwise to copy, modify, sublicense or distribute the Program is
@@ -225,7 +225,7 @@
 
 This section is intended to make thoroughly clear what is believed to
 be a consequence of the rest of this License.
-
+
   8. If the distribution and/or use of the Program is restricted in
 certain countries either by patents or by copyrighted interfaces, the
 original copyright holder who places the Program under this License
@@ -278,7 +278,7 @@
 POSSIBILITY OF SUCH DAMAGES.
 
 		     END OF TERMS AND CONDITIONS
-
+
 	    How to Apply These Terms to Your New Programs
 
   If you develop a new program, and you want it to be of the greatest
@@ -303,10 +303,9 @@
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     GNU General Public License for more details.
 
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-
+    You should have received a copy of the GNU General Public License along
+    with this program; if not, write to the Free Software Foundation, Inc.,
+    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 Also add information on how to contact you by electronic and paper mail.
 
@@ -336,5 +335,5 @@
 This General Public License does not permit incorporating your program into
 proprietary programs.  If your program is a subroutine library, you may
 consider it more useful to permit linking proprietary applications with the
-library.  If this is what you want to do, use the GNU Library General
+library.  If this is what you want to do, use the GNU Lesser General
 Public License instead of this License.
--- a/mac/ChangeLog	Thu Sep 14 09:24:00 2006 +0000
+++ b/mac/ChangeLog	Wed Sep 20 06:04:23 2006 +0000
@@ -1,3 +1,17 @@
+2006-09-19  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+	* INSTALL: Remove descriptions about experimental flags.
+
+	* inc/config.h: Sync with src/config.in.
+
+	* src/Emacs.r (M_APPLE): New define.
+	(MENU): Use it.
+
+2006-09-15  Jay Belanger  <belanger@truman.edu>
+
+	* COPYING: Replace "Library Public License" by "Lesser Public
+	License" throughout.
+
 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
--- a/mac/INSTALL	Thu Sep 14 09:24:00 2006 +0000
+++ b/mac/INSTALL	Wed Sep 20 06:04:23 2006 +0000
@@ -213,16 +213,4 @@
 with PowerPC builds of Emacs; you will have to recompile for Intel.
 Therefore, builds of Emacs are architecture specific.
 
-There are some compile-time flags that enable experimental features.
-Please use them at your own risk after reading the corresponding
-threads in the emacs-devel@gnu.org archive.
-
-  SELECT_USE_CFSOCKET (on Mac OS X): Avoid polling in sys_select (in
-  src/mac.c).
-  http://lists.gnu.org/archive/html/emacs-devel/2004-12/msg00789.html
-
-  USE_ATSUI (on Mac OS 9/Carbon): Enable ATSUI (Apple Type Services
-  for Unicode Imaging) support.
-  http://lists.gnu.org/archive/html/emacs-devel/2005-10/msg00005.html
-
 Enjoy!
--- a/mac/inc/config.h	Thu Sep 14 09:24:00 2006 +0000
+++ b/mac/inc/config.h	Wed Sep 20 06:04:23 2006 +0000
@@ -98,6 +98,9 @@
 #define HAVE_ALLOCA_H 1
 #endif
 
+/* Define to 1 if ALSA is available. */
+/* #undef HAVE_ALSA */
+
 /* Define to 1 if you have the `bcmp' function. */
 /* #define HAVE_BCMP */
 
@@ -963,6 +966,9 @@
 #ifdef HAVE_SOUNDCARD_H
 #define HAVE_SOUND 1
 #endif
+#ifdef HAVE_ALSA
+#define HAVE_SOUND 1
+#endif
 #endif /* __FreeBSD__ || __NetBSD__ || __linux__  */
 
 /* If using GNU, then support inline function declarations. */
--- a/mac/src/Emacs.r	Thu Sep 14 09:24:00 2006 +0000
+++ b/mac/src/Emacs.r	Wed Sep 20 06:04:23 2006 +0000
@@ -63,8 +63,10 @@
 };
 #endif
 
+#define M_APPLE 234		/* Menu ID for Apple Menu.  */
+
 resource 'MENU' (128, preload) {
-	128,
+	M_APPLE,
 	textMenuProc,
 	0x7FFFFFFD,
 	enabled,
--- a/man/ChangeLog	Thu Sep 14 09:24:00 2006 +0000
+++ b/man/ChangeLog	Wed Sep 20 06:04:23 2006 +0000
@@ -1,3 +1,28 @@
+2006-09-19  Richard Stallman  <rms@gnu.org>
+
+	* frames.texi (Dialog Boxes): Clean up wording: avoid passive,
+	stick to present tense.
+
+2006-09-18  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>
+
+	* frames.texi (Dialog Boxes): Rename x-use-old-gtk-file-dialog
+	to x-gtk-use-old-file-dialog.
+	(Dialog Boxes): Document x-gtk-file-dialog-help-text.
+
+2006-09-15  Jay Belanger  <belanger@truman.edu>
+
+	* calc.texi, emacs.texi, mh-e.texi (GNU GENERAL PUBLIC LICENSE):
+	Change "Library Public License" to "Lesser Public License"
+	throughout.  Use "yyyy" to represent year.
+
+2006-09-15  Carsten Dominik  <dominik@science.uva.nl>
+
+	* org.texi (Setting tags): Typo fix.
+
+2006-09-14  Reiner Steib  <Reiner.Steib@gmx.de>
+
+	* gnus.texi (Oort Gnus): Add @xref for `mm-fill-flowed'.
+
 2006-09-12  Reiner Steib  <Reiner.Steib@gmx.de>
 
 	* files.texi (Visiting): Add index entry "open file".
@@ -20,6 +45,8 @@
 
 	* gnus.texi (Mail Source Specifiers): Mention problem of duplicate
 	mails with pop3-leave-mail-on-server.  Fix wording.
+	(Limiting): Improve gnus-summary-limit-to-articles.
+	(X-Face): Fix typo.
 
 2006-09-11  Simon Josefsson  <jas@extundo.com>
 
--- a/man/calc.texi	Thu Sep 14 09:24:00 2006 +0000
+++ b/man/calc.texi	Wed Sep 20 06:04:23 2006 +0000
@@ -203,7 +203,7 @@
 General Public License applies to most of the Free Software
 Foundation's software and to any other program whose authors commit to
 using it.  (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.)  You can apply it to
+the GNU Lesser General Public License instead.)  You can apply it to
 your programs, too.
 
   When we speak of free software, we are referring to freedom, not
@@ -543,7 +543,7 @@
 when it starts in an interactive mode:
 
 @smallexample
-Gnomovision version 69, Copyright (C) 19@var{yy} @var{name of author}
+Gnomovision version 69, Copyright (C) @var{yyyy} @var{name of author}
 Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
 This is free software, and you are welcome to redistribute it
 under certain conditions; type `show c' for details.
@@ -570,7 +570,7 @@
 This General Public License does not permit incorporating your program into
 proprietary programs.  If your program is a subroutine library, you may
 consider it more useful to permit linking proprietary applications with the
-library.  If this is what you want to do, use the GNU Library General
+library.  If this is what you want to do, use the GNU Lesser General
 Public License instead of this License.
 
 @node Getting Started, Tutorial, Copying, Top
--- a/man/emacs.texi	Thu Sep 14 09:24:00 2006 +0000
+++ b/man/emacs.texi	Wed Sep 20 06:04:23 2006 +0000
@@ -1196,7 +1196,7 @@
 General Public License applies to most of the Free Software
 Foundation's software and to any other program whose authors commit to
 using it.  (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.)  You can apply it to
+the GNU Lesser General Public License instead.)  You can apply it to
 your programs, too.
 
   When we speak of free software, we are referring to freedom, not
@@ -1513,7 +1513,7 @@
 
 @smallexample
 @var{one line to give the program's name and an idea of what it does.}
-Copyright (C) 19@var{yy}  @var{name of author}
+Copyright (C) @var{yyyy}  @var{name of author}
 
 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
@@ -1536,7 +1536,7 @@
 when it starts in an interactive mode:
 
 @smallexample
-Gnomovision version 69, Copyright (C) 20@var{yy} @var{name of author}
+Gnomovision version 69, Copyright (C) @var{yyyy} @var{name of author}
 Gnomovision comes with ABSOLUTELY NO WARRANTY; for details
 type `show w'.  This is free software, and you are welcome
 to redistribute it under certain conditions; type `show c'
@@ -1568,7 +1568,7 @@
 This General Public License does not permit incorporating your program into
 proprietary programs.  If your program is a subroutine library, you may
 consider it more useful to permit linking proprietary applications with the
-library.  If this is what you want to do, use the GNU Library General
+library.  If this is what you want to do, use the GNU Lesser General
 Public License instead of this License.
 
 @include doclicense.texi
--- a/man/frames.texi	Thu Sep 14 09:24:00 2006 +0000
+++ b/man/frames.texi	Wed Sep 20 06:04:23 2006 +0000
@@ -945,11 +945,18 @@
 variable @code{x-gtk-show-hidden-files} controls whether to show
 hidden files by default.
 
-@vindex x-use-old-gtk-file-dialog
-  For Gtk+ version 2.4 and 2.6, you can make Emacs use the old file dialog
-by setting the variable @code{x-use-old-gtk-file-dialog} to a non-@code{nil}
-value.  If Emacs is built with a Gtk+ version that has only one file dialog,
-the setting of this variable has no effect.
+@vindex x-gtk-use-old-file-dialog
+  For Gtk+ versions 2.4 through 2.10, you can select the old file
+dialog (@code{gtk-file-selector}) by setting the variable
+@code{x-gtk-use-old-file-dialog} to a non-@code{nil} value.  If it is
+@code{nil}, Emacs uses @code{gtk-file-chooser}.  If Emacs is built
+with a Gtk+ version that has only one file dialog, this variable has
+no effect.
+
+@vindex x-gtk-file-dialog-help-text
+  Emacs adds help text to the Gtk+ file chooser dialog.  The variable
+@code{x-gtk-file-dialog-help-text} specifies the text to add; if it is
+@code{nil}, that disables the added text.
 
 @node Tooltips
 @section Tooltips
--- a/man/gnus.texi	Thu Sep 14 09:24:00 2006 +0000
+++ b/man/gnus.texi	Wed Sep 20 06:04:23 2006 +0000
@@ -26538,7 +26538,9 @@
 @item
 The option @code{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.7)
+inline PGP signed messages.  @xref{Flowed text, , Flowed text,
+emacs-mime, The Emacs MIME Manual}.  (New in Gnus 5.10.7)
+@c This entry is also present in the node "No Gnus".
 
 @item
 Gnus supports the generation of RFC 2298 Disposition Notification requests.
--- a/man/mh-e.texi	Thu Sep 14 09:24:00 2006 +0000
+++ b/man/mh-e.texi	Wed Sep 20 06:04:23 2006 +0000
@@ -9288,7 +9288,7 @@
 General Public License applies to most of the Free Software
 Foundation's software and to any other program whose authors commit to
 using it.  (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.)  You can apply it to
+the GNU Lesser General Public License instead.)  You can apply it to
 your programs, too.
 
   When we speak of free software, we are referring to freedom, not
@@ -9605,7 +9605,7 @@
 
 @smallexample
 @var{one line to give the program's name and an idea of what it does.}
-Copyright (C) 19@var{yy}  @var{name of author}
+Copyright (C) @var{yyyy}  @var{name of author}
 
 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
@@ -9628,7 +9628,7 @@
 when it starts in an interactive mode:
 
 @smallexample
-Gnomovision version 69, Copyright (C) 20@var{yy} @var{name of author}
+Gnomovision version 69, Copyright (C) @var{yyyy} @var{name of author}
 Gnomovision comes with ABSOLUTELY NO WARRANTY; for details
 type `show w'.  This is free software, and you are welcome
 to redistribute it under certain conditions; type `show c'
@@ -9660,7 +9660,7 @@
 This General Public License does not permit incorporating your program into
 proprietary programs.  If your program is a subroutine library, you may
 consider it more useful to permit linking proprietary applications with the
-library.  If this is what you want to do, use the GNU Library General
+library.  If this is what you want to do, use the GNU Lesser General
 Public License instead of this License.
 
 @node Key Index, Command Index, GPL, Top
--- a/man/org.texi	Thu Sep 14 09:24:00 2006 +0000
+++ b/man/org.texi	Wed Sep 20 06:04:23 2006 +0000
@@ -2766,7 +2766,7 @@
 @end example
 
 @noindent you indicate that at most one of @samp{@@WORK}, @samp{@@HOME},
-and @samp{@@SAILBOAT} should be selected.
+and @samp{@@TENNISCLUB} should be selected.
 
 @noindent Don't forget to press @kbd{C-c C-c} with the cursor in one of
 these lines to activate any changes.
--- a/msdos/COPYING	Thu Sep 14 09:24:00 2006 +0000
+++ b/msdos/COPYING	Wed Sep 20 06:04:23 2006 +0000
@@ -1,8 +1,8 @@
 		    GNU GENERAL PUBLIC LICENSE
 		       Version 2, June 1991
 
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
-                       51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  Everyone is permitted to copy and distribute verbatim copies
  of this license document, but changing it is not allowed.
 
@@ -15,7 +15,7 @@
 General Public License applies to most of the Free Software
 Foundation's software and to any other program whose authors commit to
 using it.  (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.)  You can apply it to
+the GNU Lesser General Public License instead.)  You can apply it to
 your programs, too.
 
   When we speak of free software, we are referring to freedom, not
@@ -55,7 +55,7 @@
 
   The precise terms and conditions for copying, distribution and
 modification follow.
-
+
 		    GNU GENERAL PUBLIC LICENSE
    TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
 
@@ -110,7 +110,7 @@
     License.  (Exception: if the Program itself is interactive but
     does not normally print such an announcement, your work based on
     the Program is not required to print an announcement.)
-
+
 These requirements apply to the modified work as a whole.  If
 identifiable sections of that work are not derived from the Program,
 and can be reasonably considered independent and separate works in
@@ -168,7 +168,7 @@
 access to copy the source code from the same place counts as
 distribution of the source code, even though third parties are not
 compelled to copy the source along with the object code.
-
+
   4. You may not copy, modify, sublicense, or distribute the Program
 except as expressly provided under this License.  Any attempt
 otherwise to copy, modify, sublicense or distribute the Program is
@@ -225,7 +225,7 @@
 
 This section is intended to make thoroughly clear what is believed to
 be a consequence of the rest of this License.
-
+
   8. If the distribution and/or use of the Program is restricted in
 certain countries either by patents or by copyrighted interfaces, the
 original copyright holder who places the Program under this License
@@ -278,7 +278,7 @@
 POSSIBILITY OF SUCH DAMAGES.
 
 		     END OF TERMS AND CONDITIONS
-
+
 	    How to Apply These Terms to Your New Programs
 
   If you develop a new program, and you want it to be of the greatest
@@ -303,10 +303,9 @@
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     GNU General Public License for more details.
 
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-
+    You should have received a copy of the GNU General Public License along
+    with this program; if not, write to the Free Software Foundation, Inc.,
+    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 Also add information on how to contact you by electronic and paper mail.
 
@@ -336,5 +335,5 @@
 This General Public License does not permit incorporating your program into
 proprietary programs.  If your program is a subroutine library, you may
 consider it more useful to permit linking proprietary applications with the
-library.  If this is what you want to do, use the GNU Library General
+library.  If this is what you want to do, use the GNU Lesser General
 Public License instead of this License.
--- a/msdos/ChangeLog	Thu Sep 14 09:24:00 2006 +0000
+++ b/msdos/ChangeLog	Wed Sep 20 06:04:23 2006 +0000
@@ -1,3 +1,8 @@
+2006-09-15  Jay Belanger  <belanger@truman.edu>
+
+	* COPYING: Replace "Library Public License" by "Lesser Public
+	License" throughout.
+
 2005-09-10  Sven Joachim  <svenjoac@gmx.de>  (tiny change)
 
 	* sed3v2.inp (GETOPT_H, GETOPTOBJS): Define to use getopt.h,
--- a/nt/COPYING	Thu Sep 14 09:24:00 2006 +0000
+++ b/nt/COPYING	Wed Sep 20 06:04:23 2006 +0000
@@ -1,8 +1,8 @@
 		    GNU GENERAL PUBLIC LICENSE
 		       Version 2, June 1991
 
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
-                       51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  Everyone is permitted to copy and distribute verbatim copies
  of this license document, but changing it is not allowed.
 
@@ -15,7 +15,7 @@
 General Public License applies to most of the Free Software
 Foundation's software and to any other program whose authors commit to
 using it.  (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.)  You can apply it to
+the GNU Lesser General Public License instead.)  You can apply it to
 your programs, too.
 
   When we speak of free software, we are referring to freedom, not
@@ -55,7 +55,7 @@
 
   The precise terms and conditions for copying, distribution and
 modification follow.
-
+
 		    GNU GENERAL PUBLIC LICENSE
    TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
 
@@ -110,7 +110,7 @@
     License.  (Exception: if the Program itself is interactive but
     does not normally print such an announcement, your work based on
     the Program is not required to print an announcement.)
-
+
 These requirements apply to the modified work as a whole.  If
 identifiable sections of that work are not derived from the Program,
 and can be reasonably considered independent and separate works in
@@ -168,7 +168,7 @@
 access to copy the source code from the same place counts as
 distribution of the source code, even though third parties are not
 compelled to copy the source along with the object code.
-
+
   4. You may not copy, modify, sublicense, or distribute the Program
 except as expressly provided under this License.  Any attempt
 otherwise to copy, modify, sublicense or distribute the Program is
@@ -225,7 +225,7 @@
 
 This section is intended to make thoroughly clear what is believed to
 be a consequence of the rest of this License.
-
+
   8. If the distribution and/or use of the Program is restricted in
 certain countries either by patents or by copyrighted interfaces, the
 original copyright holder who places the Program under this License
@@ -278,7 +278,7 @@
 POSSIBILITY OF SUCH DAMAGES.
 
 		     END OF TERMS AND CONDITIONS
-
+
 	    How to Apply These Terms to Your New Programs
 
   If you develop a new program, and you want it to be of the greatest
@@ -303,10 +303,9 @@
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     GNU General Public License for more details.
 
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-
+    You should have received a copy of the GNU General Public License along
+    with this program; if not, write to the Free Software Foundation, Inc.,
+    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 Also add information on how to contact you by electronic and paper mail.
 
@@ -336,5 +335,5 @@
 This General Public License does not permit incorporating your program into
 proprietary programs.  If your program is a subroutine library, you may
 consider it more useful to permit linking proprietary applications with the
-library.  If this is what you want to do, use the GNU Library General
+library.  If this is what you want to do, use the GNU Lesser General
 Public License instead of this License.
--- a/nt/ChangeLog	Thu Sep 14 09:24:00 2006 +0000
+++ b/nt/ChangeLog	Wed Sep 20 06:04:23 2006 +0000
@@ -1,3 +1,8 @@
+2006-09-15  Jay Belanger  <belanger@truman.edu>
+
+	* COPYING: Replace "Library Public License" by "Lesser Public
+	License" throughout.
+
 2006-07-27  Jason Rumney  <jasonr@gnu.org>
 
 	* INSTALL: Add notes about Cygwin make to impatient section.
--- a/src/COPYING	Thu Sep 14 09:24:00 2006 +0000
+++ b/src/COPYING	Wed Sep 20 06:04:23 2006 +0000
@@ -1,8 +1,8 @@
 		    GNU GENERAL PUBLIC LICENSE
 		       Version 2, June 1991
 
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
-                       51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  Everyone is permitted to copy and distribute verbatim copies
  of this license document, but changing it is not allowed.
 
@@ -15,7 +15,7 @@
 General Public License applies to most of the Free Software
 Foundation's software and to any other program whose authors commit to
 using it.  (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.)  You can apply it to
+the GNU Lesser General Public License instead.)  You can apply it to
 your programs, too.
 
   When we speak of free software, we are referring to freedom, not
@@ -55,7 +55,7 @@
 
   The precise terms and conditions for copying, distribution and
 modification follow.
-
+
 		    GNU GENERAL PUBLIC LICENSE
    TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
 
@@ -110,7 +110,7 @@
     License.  (Exception: if the Program itself is interactive but
     does not normally print such an announcement, your work based on
     the Program is not required to print an announcement.)
-
+
 These requirements apply to the modified work as a whole.  If
 identifiable sections of that work are not derived from the Program,
 and can be reasonably considered independent and separate works in
@@ -168,7 +168,7 @@
 access to copy the source code from the same place counts as
 distribution of the source code, even though third parties are not
 compelled to copy the source along with the object code.
-
+
   4. You may not copy, modify, sublicense, or distribute the Program
 except as expressly provided under this License.  Any attempt
 otherwise to copy, modify, sublicense or distribute the Program is
@@ -225,7 +225,7 @@
 
 This section is intended to make thoroughly clear what is believed to
 be a consequence of the rest of this License.
-
+
   8. If the distribution and/or use of the Program is restricted in
 certain countries either by patents or by copyrighted interfaces, the
 original copyright holder who places the Program under this License
@@ -278,7 +278,7 @@
 POSSIBILITY OF SUCH DAMAGES.
 
 		     END OF TERMS AND CONDITIONS
-
+
 	    How to Apply These Terms to Your New Programs
 
   If you develop a new program, and you want it to be of the greatest
@@ -303,10 +303,9 @@
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     GNU General Public License for more details.
 
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-
+    You should have received a copy of the GNU General Public License along
+    with this program; if not, write to the Free Software Foundation, Inc.,
+    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 Also add information on how to contact you by electronic and paper mail.
 
@@ -336,5 +335,5 @@
 This General Public License does not permit incorporating your program into
 proprietary programs.  If your program is a subroutine library, you may
 consider it more useful to permit linking proprietary applications with the
-library.  If this is what you want to do, use the GNU Library General
+library.  If this is what you want to do, use the GNU Lesser General
 Public License instead of this License.
--- a/src/ChangeLog	Thu Sep 14 09:24:00 2006 +0000
+++ b/src/ChangeLog	Wed Sep 20 06:04:23 2006 +0000
@@ -1,3 +1,157 @@
+2006-09-19  Chong Yidong  <cyd@stupidchicken.com>
+
+	* search.c (struct regexp_cache): New entry syntax_table.
+	(compile_pattern_1): Set it.
+	(syms_of_search): Initialize it.
+	(compile_pattern): Require the syntax_table entry of the cache
+	element to match the current syntax table entry.
+
+2006-09-19  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* window.c (Fwindow_end): Fix recent change.
+
+2006-09-19  Kim F. Storm  <storm@cua.dk>
+
+	* window.c (Fset_window_hscroll, Fpos_visible_in_window_p):
+	Doc fix.  Use "off-screen" instead of "invisible".
+	(Fwindow_line_height): Make line numbers 0-based.  Make line arg
+	optional; if nil, use current cursor row.  Handle text terminals
+	properly.  Return nil if non-interactive or pseudo-window.
+
+2006-09-19  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* keymap.c: Include alloca.h if available.
+	(Fkey_binding): Only use AREF after checking it's a vector.
+	Remove unused var `window'.
+
+2006-09-19  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+	* emacs.c (shut_down_emacs) [!subprocesses]: Don't set
+	inhibit_sentinels.
+
+	* mac.c [!MAC_OSX] (select): Fix argument name.
+
+	* macmenu.c (enum mac_menu_kind, min_menu_id): New enumerator and
+	menu ID for Apple menu.
+	(menubar_selection_callback): Remove function.
+	(find_and_call_menu_selection): New function from xmenu.c.
+	(x_activate_menubar): Use it.
+	(set_frame_menubar): Don't use f->output_data.mac->menubar_active.
+
+	* macterm.c (menubar_selection_callback): Remove extern.
+	(M_APPLE): Change to 234.
+	(do_apple_menu) [!TARGET_API_MAC_CARBON]: Make non-static.
+	(do_menu_choice): Remove function.
+
+	* macterm.h (struct mac_output): Remove member menubar_active.
+	(do_menu_choice): Remove extern.
+	(do_apple_menu) [!TARGET_API_MAC_CARBON]: Add extern.
+
+2006-09-18  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>
+
+	* xfns.c (syms_of_xfns): Rename x_gtk_show_chooser_help_text to
+	x_gtk_file_dialog_help_text.
+
+	* gtkutil.c (xg_uses_old_file_dialog): Rename x-use-old-gtk-file-dialog
+	to x-gtk-use-old-file-dialog.
+	(xg_get_file_with_chooser): Rename x_gtk_show_chooser_help_text to
+	x_gtk_file_dialog_help_text.
+
+	* xfns.c (syms_of_xfns): Ditto.
+
+2006-09-18  Kim F. Storm  <storm@cua.dk>
+
+	* window.c (Fwindow_line_visibility): Remove.
+	(Fwindow_line_height): New defun replacing it.
+	(syms_of_window): Defsubr it.
+
+2006-09-18  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+	* mac.c (SELECT_USE_CFSOCKET) [MAC_OSX]: Set default to 1.
+	[MAC_OSX] (sys_select) [SELECT_USE_CFSOCKET]: Fix pointer type.
+
+2006-09-17  Jay Belanger  <belanger@truman.edu>
+
+	* gmalloc.c:
+	* md5.c:
+	* md5.h:
+	* strftime.c: Replace "GNU Library General Public License" by "GNU
+	General Public License" throughout.
+
+2006-09-17  Kim F. Storm  <storm@cua.dk>
+
+	* dispnew.c (update_text_area): Undo 2000-07-18 change.
+	Always redrawing whole row if line has mouse-face in it causes
+	excessive flickering of the mode line.
+
+2006-09-17  Chong Yidong  <cyd@stupidchicken.com>
+
+	* search.c (clear_regexp_cache): New function.
+
+	* syntax.c (Fmodify_syntax_entry): Clear regexp cache.
+
+2006-09-16  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>
+
+	* gtkutil.c (xg_get_file_with_chooser):
+	Check x-gtk-show-chooser-help-text before adding the help text.
+
+	* xfns.c (syms_of_xfns): New variable: x-gtk-show-chooser-help-text.
+
+	* gtkutil.c (get_utf8_string): Try harder to convert to UTF8.  Gtk+
+	will simply crash if we fail.
+
+2006-09-16  Richard Stallman  <rms@gnu.org>
+
+	* regex.c (re_compile_pattern): Set gl_state.current_syntax_table.
+
+2006-09-15  Kim F. Storm  <storm@cua.dk>
+
+	* window.c (Fwindow_line_visibility): New defun for line-move-partial.
+	(syms_of_window): Defsubr it.
+	(Fwindow_end): Use window's buffer rather than current buffer.
+
+2006-09-15  Jay Belanger  <belanger@truman.edu>
+
+	* COPYING: Replace "Library Public License" by "Lesser Public
+	License" throughout.
+
+2006-09-15  David Kastrup  <dak@gnu.org>
+
+	* Makefile.in (keymap.o): Add "keymap.h" and "window.h"
+	dependencies.
+
+	* keymap.c: include "window.h".
+	(Fcommand_remapping): New optional POSITION argument.
+	(Fkey_binding): New optional POSITION argument.  Completely rework
+	handling of mouse clicks to get the same order of keymaps as
+	`read-key-sequence' and heed POSITION.  Also temporarily switch
+	buffers to location of mouse click and back.
+
+	* keyboard.c (command_loop_1): Adjust call of `Fcommand_remapping'
+	for additional argument.
+	(parse_menu_item): Adjust call of `Fkey_binding' for additional
+	argument.
+	(read_key_sequence): If there are both `local-map' and `keymap'
+	text properties at some buffer position, heed both.
+
+	* keymap.h: Declare additional optional arguments of
+	`Fcommand_remapping' and `Fkey_binding'.
+
+2006-09-15  Juanma Barranquero  <lekktu@gmail.com>
+
+	* indent.c (Fcurrent_column, Findent_to): Fix typos in docstring.
+
+2006-09-14  Andreas Schwab  <schwab@suse.de>
+
+	* print.c: Whitespace fixup.
+
+2006-09-14  Kim F. Storm  <storm@cua.dk>
+
+	* xdisp.c (produce_image_glyph): Automatically crop wide images at
+	right window edge so we can draw the cursor on the same row to
+	avoid confusing redisplay by placing the cursor outside the visible
+	window area.
+
 2006-09-13  YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
 
 	* xterm.c (x_initialize): Don't install Xt event timer here.
@@ -67,12 +221,12 @@
 	* mac.c [MAC_OSX] (sys_select): Check argument `nfds' more rigidly.
 	Make variable `ofds' static.  Remove variable `maxfd'.
 
-	* macfns.c (Fx_file_dialog): Remove unused variable `f'.  Call
-	check_mac.
+	* macfns.c (Fx_file_dialog): Remove unused variable `f'.
+	Call check_mac.
 
 	* macmenu.c (Vmenu_updating_frame, syms_of_macmenu):
-	* w32menu.c (Vmenu_updating_frame, syms_of_w32menu): Apply
-	2006-09-08 change for xmenu.c.
+	* w32menu.c (Vmenu_updating_frame, syms_of_w32menu):
+	Apply 2006-09-08 change for xmenu.c.
 
 	* xfns.c (Fx_file_dialog): Call check_x.
 
@@ -332,11 +486,11 @@
 	* mac.c (create_apple_event_from_event_ref, select)
 	(Fmac_get_file_creator, Fmac_get_file_type, Fmac_set_file_creator)
 	(Fmac_set_file_type, cfstring_create_normalized)
-	(mac_get_system_locale, select_and_poll_event, sys_select): Use
-	OSStatus instead of OSErr.
-
-	* macfns.c [TARGET_API_MAC_CARBON] (mac_update_proxy_icon): Don't
-	use FRAME_FILE_NAME.  Use (FS)UpdateAlias.
+	(mac_get_system_locale, select_and_poll_event, sys_select):
+	Use OSStatus instead of OSErr.
+
+	* macfns.c [TARGET_API_MAC_CARBON] (mac_update_proxy_icon):
+	Don't use FRAME_FILE_NAME.  Use (FS)UpdateAlias.
 	(Fx_create_frame): Apply 2006-07-03 for xfns.c.
 
 	* macselect.c (get_scrap_from_symbol, clear_scrap, put_scrap_string)
@@ -505,7 +659,6 @@
 
 	* xterm.c (x_term_init): Initialize dpyinfo->x_dnd_atoms*
 
-
 2006-08-10  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>
 
 	* keyboard.c: Define in_sighandler.
@@ -699,7 +852,7 @@
 	(FletX, Flet, grow_specpdl): Use signal_error.
 	(Feval, Ffuncall, funcall_lambda): Use xsignal1, xsignal2.
 
-	* alloc.c (buffer_memory_full, memory_full): Use xsignal. Remove loop.
+	* alloc.c (buffer_memory_full, memory_full): Use xsignal.  Remove loop.
 	(list1): New function.
 
 	* lisp.h (list1): Add EXFUN.
@@ -10251,7 +10404,6 @@
 
 	* xterm.c (xim_destroy_callback): Ditto.
 
-
 2004-10-20  B. Anyos  <banyos@freemail.hu>  (tiny change)
 
 	* w32term.c (x_draw_glyph_string): Use overline_color for overlines.
@@ -18741,6 +18893,14 @@
 
 	* Makefile.in (fns.o): Depend on coding.h.
 
+2003-01-06  Dave Love  <fx@gnu.org>
+
+	* fns.c: Include coding.h.  Use POINTER_TYPE*, not void*.
+	(Vlocale_coding_system): Declare.
+	(Qcodeset, Qdays, Qmonths, Qpaper): New.
+	(Flanginfo): New.
+	(syms_of_fns): Initialize new stuff.
+
 2003-01-07  Markus Rost  <rost@math.ohio-state.edu>
 
 	* minibuf.c (Fread_variable): Doc fix.
--- a/src/Makefile.in	Thu Sep 14 09:24:00 2006 +0000
+++ b/src/Makefile.in	Wed Sep 20 06:04:23 2006 +0000
@@ -1171,7 +1171,8 @@
    systty.h systime.h dispextern.h syntax.h $(INTERVAL_SRC) blockinput.h \
    atimer.h xterm.h puresize.h msdos.h keymap.h w32term.h macterm.h $(config_h)
 keymap.o: keymap.c buffer.h commands.h keyboard.h termhooks.h blockinput.h \
-   atimer.h systime.h puresize.h character.h intervals.h $(config_h)
+   atimer.h systime.h puresize.h character.h intervals.h keymap.h window.h \
+   $(config_h)
 lastfile.o: lastfile.c  $(config_h)
 macros.o: macros.c window.h buffer.h commands.h macros.h keyboard.h \
 	dispextern.h $(config_h)
--- a/src/dispnew.c	Thu Sep 14 09:24:00 2006 +0000
+++ b/src/dispnew.c	Wed Sep 20 06:04:23 2006 +0000
@@ -4392,7 +4392,12 @@
       || desired_row->phys_height != current_row->phys_height
       || desired_row->visible_height != current_row->visible_height
       || current_row->overlapped_p
+#if 0
+      /* This causes excessive flickering when mouse is moved across
+	 the mode line.  Luckily everything seems to work just fine
+	 without doing this.  KFS 2006-09-17.  */
       || current_row->mouse_face_p
+#endif
       || current_row->x != desired_row->x)
     {
       rif->cursor_to (vpos, 0, desired_row->y, desired_row->x);
--- a/src/emacs.c	Thu Sep 14 09:24:00 2006 +0000
+++ b/src/emacs.c	Wed Sep 20 06:04:23 2006 +0000
@@ -2156,7 +2156,9 @@
 
   stuff_buffered_input (stuff);
 
+#ifdef subprocesses
   inhibit_sentinels = 1;
+#endif
   kill_buffer_processes (Qnil);
   Fdo_auto_save (Qt, Qnil);
 
--- a/src/gmalloc.c	Thu Sep 14 09:24:00 2006 +0000
+++ b/src/gmalloc.c	Wed Sep 20 06:04:23 2006 +0000
@@ -10,17 +10,17 @@
 		  Written May 1989 by Mike Haertel.
 
 This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Library General Public License as
+modify it under the terms of the GNU General Public License as
 published by the Free Software Foundation; either version 2 of the
 License, or (at your option) any later version.
 
 This library is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Library General Public License for more details.
+General Public License for more details.
 
-You should have received a copy of the GNU Library General Public
-License along with this library; see the file COPYING.LIB.  If
+You should have received a copy of the GNU General Public
+License along with this library; see the file COPYING.  If
 not, write to the Free Software Foundation, Inc., 51 Franklin Street,
 Fifth Floor, Boston, MA 02110-1301, USA.
 
@@ -329,17 +329,17 @@
 		  Written May 1989 by Mike Haertel.
 
 This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Library General Public License as
+modify it under the terms of the GNU General Public License as
 published by the Free Software Foundation; either version 2 of the
 License, or (at your option) any later version.
 
 This library is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Library General Public License for more details.
+General Public License for more details.
 
-You should have received a copy of the GNU Library General Public
-License along with this library; see the file COPYING.LIB.  If
+You should have received a copy of the GNU General Public
+License along with this library; see the file COPYING.  If
 not, write to the Free Software Foundation, Inc., 51 Franklin Street,
 Fifth Floor, Boston, MA 02110-1301, USA.
 
@@ -932,17 +932,17 @@
 		  Written May 1989 by Mike Haertel.
 
 This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Library General Public License as
+modify it under the terms of the GNU General Public License as
 published by the Free Software Foundation; either version 2 of the
 License, or (at your option) any later version.
 
 This library is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Library General Public License for more details.
+General Public License for more details.
 
-You should have received a copy of the GNU Library General Public
-License along with this library; see the file COPYING.LIB.  If
+You should have received a copy of the GNU General Public
+License along with this library; see the file COPYING.  If
 not, write to the Free Software Foundation, Inc., 51 Franklin Street,
 Fifth Floor, Boston, MA 02110-1301, USA.
 
@@ -1251,17 +1251,17 @@
 		     Written May 1989 by Mike Haertel.
 
 This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Library General Public License as
+modify it under the terms of the GNU General Public License as
 published by the Free Software Foundation; either version 2 of the
 License, or (at your option) any later version.
 
 This library is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Library General Public License for more details.
+General Public License for more details.
 
-You should have received a copy of the GNU Library General Public
-License along with this library; see the file COPYING.LIB.  If
+You should have received a copy of the GNU General Public
+License along with this library; see the file COPYING.  If
 not, write to the Free Software Foundation, Inc., 51 Franklin Street,
 Fifth Floor, Boston, MA 02110-1301, USA.
 
@@ -1496,17 +1496,17 @@
 /* Copyright (C) 1991, 1992, 1994 Free Software Foundation, Inc.
 
 This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Library General Public License as
+modify it under the terms of the GNU General Public License as
 published by the Free Software Foundation; either version 2 of the
 License, or (at your option) any later version.
 
 This library is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Library General Public License for more details.
+General Public License for more details.
 
-You should have received a copy of the GNU Library General Public
-License along with this library; see the file COPYING.LIB.  If
+You should have received a copy of the GNU General Public
+License along with this library; see the file COPYING.  If
 not, write to the Free Software Foundation, Inc., 51 Franklin Street,
 Fifth Floor, Boston, MA 02110-1301, USA.
 
@@ -1593,17 +1593,17 @@
 /* Copyright (C) 1991, 92, 93, 94, 95, 96 Free Software Foundation, Inc.
 
 This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Library General Public License as
+modify it under the terms of the GNU General Public License as
 published by the Free Software Foundation; either version 2 of the
 License, or (at your option) any later version.
 
 This library is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Library General Public License for more details.
+General Public License for more details.
 
-You should have received a copy of the GNU Library General Public
-License along with this library; see the file COPYING.LIB.  If
+You should have received a copy of the GNU General Public
+License along with this library; see the file COPYING.  If
 not, write to the Free Software Foundation, Inc., 51 Franklin Street,
 Fifth Floor, Boston, MA 02110-1301, USA.  */
 
@@ -1693,17 +1693,17 @@
    Copyright (C) 1991, 92, 93, 94, 96 Free Software Foundation, Inc.
 
 This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Library General Public License as
+modify it under the terms of the GNU General Public License as
 published by the Free Software Foundation; either version 2 of the
 License, or (at your option) any later version.
 
 This library is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Library General Public License for more details.
+General Public License for more details.
 
-You should have received a copy of the GNU Library General Public
-License along with this library; see the file COPYING.LIB.  If
+You should have received a copy of the GNU General Public
+License along with this library; see the file COPYING.  If
 not, write to the Free Software Foundation, Inc., 51 Franklin Street,
 Fifth Floor, Boston, MA 02110-1301, USA.
 
@@ -1760,17 +1760,17 @@
    Written May 1989 by Mike Haertel.
 
 This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Library General Public License as
+modify it under the terms of the GNU General Public License as
 published by the Free Software Foundation; either version 2 of the
 License, or (at your option) any later version.
 
 This library is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Library General Public License for more details.
+General Public License for more details.
 
-You should have received a copy of the GNU Library General Public
-License along with this library; see the file COPYING.LIB.  If
+You should have received a copy of the GNU General Public
+License along with this library; see the file COPYING.  If
 not, write to the Free Software Foundation, Inc., 51 Franklin Street,
 Fifth Floor, Boston, MA 02110-1301, USA.
 
--- a/src/gtkutil.c	Thu Sep 14 09:24:00 2006 +0000
+++ b/src/gtkutil.c	Wed Sep 20 06:04:23 2006 +0000
@@ -507,10 +507,66 @@
 {
   char *utf8_str = str;
 
+  if (!str) return NULL;
+
   /* If not UTF-8, try current locale.  */
-  if (str && !g_utf8_validate (str, -1, NULL))
+  if (!g_utf8_validate (str, -1, NULL))
     utf8_str = g_locale_to_utf8 (str, -1, 0, 0, 0);
 
+  if (!utf8_str) 
+    {
+      /* Probably some control characters in str.  Escape them. */
+      size_t nr_bad = 0;
+      gsize bytes_read;
+      gsize bytes_written;
+      unsigned char *p = (unsigned char *)str;
+      char *cp, *up;
+      GError *error = NULL;
+
+      while (! (cp = g_locale_to_utf8 (p, -1, &bytes_read,
+                                             &bytes_written, &error))
+             && error->code == G_CONVERT_ERROR_ILLEGAL_SEQUENCE)
+        {
+          ++nr_bad;
+          p += bytes_written+1;
+          g_error_free (error);
+          error = NULL;
+        }
+
+      if (error) 
+        {
+          g_error_free (error);
+          error = NULL;
+        }
+      if (cp) g_free (cp);
+
+      up = utf8_str = xmalloc (strlen (str) + nr_bad * 4 + 1);
+      p = str;
+
+      while (! (cp = g_locale_to_utf8 (p, -1, &bytes_read,
+                                       &bytes_written, &error))
+             && error->code == G_CONVERT_ERROR_ILLEGAL_SEQUENCE)
+        {
+          strncpy (up, p, bytes_written);
+          sprintf (up + bytes_written, "\\%03o", p[bytes_written]);
+          up[bytes_written+4] = '\0';
+          up += bytes_written+4;
+          p += bytes_written+1;
+          g_error_free (error);
+          error = NULL;
+        }
+
+      if (cp) 
+        {
+          strcat (utf8_str, cp);
+          g_free (cp);
+        }
+      if (error) 
+        {
+          g_error_free (error);
+          error = NULL;
+        }
+    }
   return utf8_str;
 }
 
@@ -1156,8 +1212,8 @@
 xg_uses_old_file_dialog ()
 {
 #ifdef HAVE_GTK_FILE_BOTH
-  extern int x_use_old_gtk_file_dialog;
-  return x_use_old_gtk_file_dialog;
+  extern int x_gtk_use_old_file_dialog;
+  return x_gtk_use_old_file_dialog;
 #else /* ! HAVE_GTK_FILE_BOTH */
 
 #ifdef HAVE_GTK_FILE_SELECTION_NEW
@@ -1294,6 +1350,8 @@
                                  GTK_FILE_CHOOSER_ACTION_OPEN :
                                  GTK_FILE_CHOOSER_ACTION_SAVE);
   extern int x_gtk_show_hidden_files;
+  extern int x_gtk_file_dialog_help_text;
+
 
   if (only_dir_p)
     action = GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER;
@@ -1321,17 +1379,22 @@
   g_signal_connect (G_OBJECT (filewin), "notify",
                     G_CALLBACK (xg_toggle_notify_cb), wtoggle);
 
-  message[0] = '\0';
-  if (action != GTK_FILE_CHOOSER_ACTION_SAVE)
-    strcat (message, "\nType C-l to display a file name text entry box.\n");
-  strcat (message, "\nIf you don't like this file selector, use the "
-          "corresponding\nkey binding or customize "
-          "use-file-dialog to turn it off.");
+  if (x_gtk_file_dialog_help_text)
+    {
+      message[0] = '\0';
+      if (action != GTK_FILE_CHOOSER_ACTION_SAVE)
+        strcat (message, "\nType C-l to display a file name text entry box.\n");
+      strcat (message, "\nIf you don't like this file selector, use the "
+              "corresponding\nkey binding or customize "
+              "use-file-dialog to turn it off.");
     
-  wmessage = gtk_label_new (message);
-  gtk_widget_show (wmessage);
+      wmessage = gtk_label_new (message);
+      gtk_widget_show (wmessage);
+    }
+
   gtk_box_pack_start (GTK_BOX (wbox), wtoggle, FALSE, FALSE, 0);
-  gtk_box_pack_start (GTK_BOX (wbox), wmessage, FALSE, FALSE, 0);
+  if (x_gtk_file_dialog_help_text)
+    gtk_box_pack_start (GTK_BOX (wbox), wmessage, FALSE, FALSE, 0);
   gtk_file_chooser_set_extra_widget (GTK_FILE_CHOOSER (filewin), wbox);
 
   if (default_filename)
--- a/src/indent.c	Thu Sep 14 09:24:00 2006 +0000
+++ b/src/indent.c	Wed Sep 20 06:04:23 2006 +0000
@@ -335,8 +335,8 @@
        doc: /* Return the horizontal position of point.  Beginning of line is column 0.
 This is calculated by adding together the widths of all the displayed
 representations of the character between the start of the previous line
-and point.  (eg control characters will have a width of 2 or 4, tabs
-will have a variable width)
+and point (eg. control characters will have a width of 2 or 4, tabs
+will have a variable width).
 Ignores finite width of frame, which means that this function may return
 values greater than (frame-width).
 Whether the line is visible (if `selective-display' is t) has no effect;
@@ -734,8 +734,8 @@
 
 DEFUN ("indent-to", Findent_to, Sindent_to, 1, 2, "NIndent to column: ",
        doc: /* Indent from point with tabs and spaces until COLUMN is reached.
-Optional second argument MININUM says always do at least MININUM spaces
-even if that goes past COLUMN; by default, MININUM is zero.  */)
+Optional second argument MINIMUM says always do at least MINIMUM spaces
+even if that goes past COLUMN; by default, MINIMUM is zero.  */)
      (column, minimum)
      Lisp_Object column, minimum;
 {
--- a/src/keyboard.c	Thu Sep 14 09:24:00 2006 +0000
+++ b/src/keyboard.c	Wed Sep 20 06:04:23 2006 +0000
@@ -1674,7 +1674,7 @@
       if (SYMBOLP (cmd))
 	{
 	  Lisp_Object cmd1;
-	  if (cmd1 = Fcommand_remapping (cmd), !NILP (cmd1))
+	  if (cmd1 = Fcommand_remapping (cmd, Qnil), !NILP (cmd1))
 	    cmd = cmd1;
 	}
 
@@ -7517,7 +7517,7 @@
       Lisp_Object prefix;
 
       if (!NILP (tem))
-	tem = Fkey_binding (tem, Qnil, Qnil);
+	tem = Fkey_binding (tem, Qnil, Qnil, Qnil);
 
       prefix = AREF (item_properties, ITEM_PROPERTY_KEYEQ);
       if (CONSP (prefix))
@@ -9134,16 +9134,19 @@
 			  if (!EQ (map_here, orig_local_map))
 			    {
 			      orig_local_map = map_here;
-			      keybuf[t] = key;
-			      mock_input = t + 1;
-
-			      goto replay_sequence;
+			      ++localized_local_map;
 			    }
+
 			  map_here = get_local_map (XINT (pos),
 						     current_buffer, Qkeymap);
 			  if (!EQ (map_here, orig_keymap))
 			    {
 			      orig_keymap = map_here;
+			      ++localized_local_map;
+			    }
+
+			  if (localized_local_map > 1)
+			    {
 			      keybuf[t] = key;
 			      mock_input = t + 1;
 
--- a/src/keymap.c	Thu Sep 14 09:24:00 2006 +0000
+++ b/src/keymap.c	Wed Sep 20 06:04:23 2006 +0000
@@ -23,6 +23,9 @@
 
 #include <config.h>
 #include <stdio.h>
+#if HAVE_ALLOCA_H
+# include <alloca.h>
+#endif
 #include "lisp.h"
 #include "commands.h"
 #include "buffer.h"
@@ -34,6 +37,7 @@
 #include "puresize.h"
 #include "intervals.h"
 #include "keymap.h"
+#include "window.h"
 
 /* The number of elements in keymap vectors.  */
 #define DENSE_TABLE_SIZE (0200)
@@ -1249,17 +1253,23 @@
 
 /* This function may GC (it calls Fkey_binding).  */
 
-DEFUN ("command-remapping", Fcommand_remapping, Scommand_remapping, 1, 1, 0,
+DEFUN ("command-remapping", Fcommand_remapping, Scommand_remapping, 1, 2, 0,
        doc: /* Return the remapping for command COMMAND in current keymaps.
-Returns nil if COMMAND is not remapped (or not a symbol).  */)
-     (command)
-     Lisp_Object command;
+Returns nil if COMMAND is not remapped (or not a symbol).
+
+If the optional argument POSITION is non-nil, it specifies a mouse
+position as returned by `event-start' and `event-end', and the
+remapping occurs in the keymaps associated with it.  It can also be a
+number or marker, in which case the keymap properties at the specified
+buffer position instead of point are used. */)
+     (command, position)
+     Lisp_Object command, position;
 {
   if (!SYMBOLP (command))
     return Qnil;
 
   ASET (command_remapping_vector, 1, command);
-  return Fkey_binding (command_remapping_vector, Qnil, Qt);
+  return Fkey_binding (command_remapping_vector, Qnil, Qt, position);
 }
 
 /* Value is number if KEY is too long; nil if valid but has no definition. */
@@ -1585,7 +1595,7 @@
 
 /* GC is possible in this function if it autoloads a keymap.  */
 
-DEFUN ("key-binding", Fkey_binding, Skey_binding, 1, 3, 0,
+DEFUN ("key-binding", Fkey_binding, Skey_binding, 1, 4, 0,
        doc: /* Return the binding for command KEY in current keymaps.
 KEY is a string or vector, a sequence of keystrokes.
 The binding is probably a symbol with a function definition.
@@ -1599,55 +1609,83 @@
 Like the normal command loop, `key-binding' will remap the command
 resulting from looking up KEY by looking up the command in the
 current keymaps.  However, if the optional third argument NO-REMAP
-is non-nil, `key-binding' returns the unmapped command.  */)
-     (key, accept_default, no_remap)
-     Lisp_Object key, accept_default, no_remap;
+is non-nil, `key-binding' returns the unmapped command.
+
+If KEY is a key sequence initiated with the mouse, the used keymaps
+will depend on the clicked mouse position with regard to the buffer
+and possible local keymaps on strings.
+
+If the optional argument POSITION is non-nil, it specifies a mouse
+position as returned by `event-start' and `event-end', and the lookup
+occurs in the keymaps associated with it instead of KEY.  It can also
+be a number or marker, in which case the keymap properties at the
+specified buffer position instead of point are used.
+  */)
+    (key, accept_default, no_remap, position)
+    Lisp_Object key, accept_default, no_remap, position;
 {
   Lisp_Object *maps, value;
   int nmaps, i;
-  struct gcpro gcpro1;
-
-  GCPRO1 (key);
-
-#ifdef HAVE_MOUSE
-  if (VECTORP (key) && ASIZE (key) > 0)
+  struct gcpro gcpro1, gcpro2;
+  int count = SPECPDL_INDEX ();
+
+  GCPRO2 (key, position);
+
+  if (NILP (position) && VECTORP (key))
     {
-      Lisp_Object ev, pos;
-      if ((ev = AREF (key, 0), CONSP (ev))
-	  && SYMBOLP (XCAR (ev))
-	  && CONSP (XCDR (ev))
-	  && (pos = XCAR (XCDR (ev)), CONSP (pos))
-	  && XINT (Flength (pos)) == 10
-	  && INTEGERP (XCAR (XCDR (pos))))
+      Lisp_Object event
+	/* mouse events may have a symbolic prefix indicating the
+	   scrollbar or mode line */
+	= AREF (key, SYMBOLP (AREF (key, 0)) && ASIZE (key) > 1 ? 1 : 0);
+
+      /* We are not interested in locations without event data */
+
+      if (EVENT_HAS_PARAMETERS (event)) {
+	Lisp_Object kind;
+
+	kind = EVENT_HEAD_KIND (EVENT_HEAD (event));
+	if (EQ (kind, Qmouse_click))
+	  position = EVENT_START (event);
+      }
+    }
+
+  /* Key sequences beginning with mouse clicks
+     are read using the keymaps of the buffer clicked on, not
+     the current buffer.  So we may have to switch the buffer
+     here. */
+  
+  if (CONSP (position))
+    {
+      Lisp_Object window;
+      
+      window = POSN_WINDOW (position);
+	  
+      if (WINDOWP (window)
+	  && BUFFERP (XWINDOW (window)->buffer)
+	  && XBUFFER (XWINDOW (window)->buffer) != current_buffer)
 	{
-	  Lisp_Object map, object;
-
-	  object = Fnth (make_number(4), pos);
-
-	  if (CONSP (object))
-	    map = Fget_char_property (XCDR (object), Qkeymap, XCAR (object));
-	  else
-	    map = Fget_char_property (XCAR (XCDR (pos)), Qkeymap,
-				      Fwindow_buffer (XCAR (pos)));
-
-	  if (!NILP (Fkeymapp (map)))
-	    {
-	      value = Flookup_key (map, key, accept_default);
-	      if (! NILP (value) && !INTEGERP (value))
-		goto done;
-	    }
+	  /* Arrange to go back to the original buffer once we're done
+	     processing the key sequence.  We don't use
+	     save_excursion_{save,restore} here, in analogy to
+	     `read-key-sequence' to avoid saving point.  Maybe this
+	     would not be a problem here, but it is easier to keep
+	     things the same.
+	  */
+	      
+	  record_unwind_protect (Fset_buffer, Fcurrent_buffer ());
+	  
+	  set_buffer_internal (XBUFFER (XWINDOW (window)->buffer));
 	}
     }
-#endif /* HAVE_MOUSE  */
-
-  if (!NILP (current_kboard->Voverriding_terminal_local_map))
+  
+  if (! NILP (current_kboard->Voverriding_terminal_local_map))
     {
       value = Flookup_key (current_kboard->Voverriding_terminal_local_map,
 			   key, accept_default);
       if (! NILP (value) && !INTEGERP (value))
 	goto done;
     }
-  else if (!NILP (Voverriding_local_map))
+  else if (! NILP (Voverriding_local_map))
     {
       value = Flookup_key (Voverriding_local_map, key, accept_default);
       if (! NILP (value) && !INTEGERP (value))
@@ -1655,12 +1693,70 @@
     }
   else
     {
-      Lisp_Object local;
-
-      local = get_local_map (PT, current_buffer, Qkeymap);
-      if (! NILP (local))
+      Lisp_Object keymap, local_map;
+      EMACS_INT pt;
+
+      pt = INTEGERP (position) ? XINT (position)
+	: MARKERP (position) ? marker_position (position)
+	: PT;
+
+      local_map = get_local_map (pt, current_buffer, Qlocal_map); 
+      keymap = get_local_map (pt, current_buffer, Qkeymap); 
+
+      if (CONSP (position))
 	{
-	  value = Flookup_key (local, key, accept_default);
+	  Lisp_Object string;
+
+	  /* For a mouse click, get the local text-property keymap
+	     of the place clicked on, rather than point.  */
+	  
+	  if (POSN_INBUFFER_P (position))
+	    {
+	      Lisp_Object pos;
+
+	      pos = POSN_BUFFER_POSN (position);
+	      if (INTEGERP (pos)
+		  && XINT (pos) >= BEG && XINT (pos) <= Z)
+		{
+		  local_map = get_local_map (XINT (pos),
+					     current_buffer, Qlocal_map);
+		  
+		  keymap = get_local_map (XINT (pos),
+					  current_buffer, Qkeymap);
+		}
+	    }
+
+	  /* If on a mode line string with a local keymap,
+	     or for a click on a string, i.e. overlay string or a
+	     string displayed via the `display' property,
+	     consider `local-map' and `keymap' properties of
+	     that string.  */
+	  
+	  if (string = POSN_STRING (position),
+	      (CONSP (string) && STRINGP (XCAR (string))))
+	    {
+	      Lisp_Object pos, map;
+	      
+	      pos = XCDR (string);
+	      string = XCAR (string);
+	      if (XINT (pos) >= 0
+		  && XINT (pos) < SCHARS (string))
+		{
+		  map = Fget_text_property (pos, Qlocal_map, string);
+		  if (!NILP (map))
+		    local_map = map;
+
+		  map = Fget_text_property (pos, Qkeymap, string);
+		  if (!NILP (map))
+		    keymap = map;
+		}
+	    }
+	  
+	}
+
+      if (! NILP (keymap))
+	{
+	  value = Flookup_key (keymap, key, accept_default);
 	  if (! NILP (value) && !INTEGERP (value))
 	    goto done;
 	}
@@ -1677,10 +1773,9 @@
 	      goto done;
 	  }
 
-      local = get_local_map (PT, current_buffer, Qlocal_map);
-      if (! NILP (local))
+      if (! NILP (local_map))
 	{
-	  value = Flookup_key (local, key, accept_default);
+	  value = Flookup_key (local_map, key, accept_default);
 	  if (! NILP (value) && !INTEGERP (value))
 	    goto done;
 	}
@@ -1689,6 +1784,8 @@
   value = Flookup_key (current_global_map, key, accept_default);
 
  done:
+  unbind_to (count, Qnil);
+
   UNGCPRO;
   if (NILP (value) || INTEGERP (value))
     return Qnil;
@@ -1699,7 +1796,7 @@
   if (NILP (no_remap) && SYMBOLP (value))
     {
       Lisp_Object value1;
-      if (value1 = Fcommand_remapping (value), !NILP (value1))
+      if (value1 = Fcommand_remapping (value, position), !NILP (value1))
 	value = value1;
     }
 
@@ -2449,7 +2546,7 @@
   if (NILP (no_remap) && SYMBOLP (definition))
     {
       Lisp_Object tem;
-      if (tem = Fcommand_remapping (definition), !NILP (tem))
+      if (tem = Fcommand_remapping (definition, Qnil), !NILP (tem))
 	return Qnil;
     }
 
--- a/src/keymap.h	Thu Sep 14 09:24:00 2006 +0000
+++ b/src/keymap.h	Wed Sep 20 06:04:23 2006 +0000
@@ -29,8 +29,8 @@
 EXFUN (Fkeymap_prompt, 1);
 EXFUN (Fdefine_key, 3);
 EXFUN (Flookup_key, 3);
-EXFUN (Fcommand_remapping, 1);
-EXFUN (Fkey_binding, 3);
+EXFUN (Fcommand_remapping, 2);
+EXFUN (Fkey_binding, 4);
 EXFUN (Fkey_description, 2);
 EXFUN (Fsingle_key_description, 2);
 EXFUN (Fwhere_is_internal, 5);
--- a/src/mac.c	Thu Sep 14 09:24:00 2006 +0000
+++ b/src/mac.c	Wed Sep 20 06:04:23 2006 +0000
@@ -2416,7 +2416,7 @@
 extern Boolean mac_wait_next_event P_ ((EventRecord *, UInt32, Boolean));
 
 int
-select (n,  rfds, wfds, efds, timeout)
+select (nfds, rfds, wfds, efds, timeout)
      int nfds;
      SELECT_TYPE *rfds, *wfds, *efds;
      EMACS_TIME *timeout;
@@ -4975,6 +4975,10 @@
          executing `select' with a short timeout
          (SELECT_POLLING_PERIOD_USEC microseconds).  */
 
+#ifndef SELECT_USE_CFSOCKET
+#define SELECT_USE_CFSOCKET 1
+#endif
+
 #define SELECT_POLLING_PERIOD_USEC 100000
 #if SELECT_USE_CFSOCKET
 #define SELECT_TIMEOUT_THRESHOLD_RUNLOOP 0.2
@@ -5115,7 +5119,7 @@
 	  int minfd, fd;
 	  CFRunLoopRef runloop =
 	    (CFRunLoopRef) GetCFRunLoopFromEventLoop (GetCurrentEventLoop ());
-	  static CFSocketContext context = {0, &ofds, NULL, NULL, NULL};
+	  static CFSocketContext context = {0, ofds, NULL, NULL, NULL};
 	  static CFMutableDictionaryRef sources;
 
 	  if (sources == NULL)
--- a/src/macmenu.c	Thu Sep 14 09:24:00 2006 +0000
+++ b/src/macmenu.c	Wed Sep 20 06:04:23 2006 +0000
@@ -64,7 +64,8 @@
 
 enum mac_menu_kind {		/* Menu ID range  */
   MAC_MENU_APPLE,		/* 0 (Reserved by Apple) */
-  MAC_MENU_MENU_BAR,		/* 1 .. 234       */
+  MAC_MENU_MENU_BAR,		/* 1 .. 233       */
+  MAC_MENU_M_APPLE,		/* 234      (== M_APPLE) */
   MAC_MENU_POPUP,		/* 235            */
   MAC_MENU_DRIVER,		/* 236 .. 255 (Reserved) */
   MAC_MENU_MENU_BAR_SUB,	/* 256 .. 16383   */
@@ -72,7 +73,7 @@
   MAC_MENU_END			/* 32768          */
 };
 
-static const int min_menu_id[] = {0, 1, 235, 236, 256, 16384, 32768};
+static const int min_menu_id[] = {0, 1, 234, 235, 236, 256, 16384, 32768};
 
 #define DIALOG_WINDOW_RESOURCE 130
 
@@ -196,6 +197,8 @@
 static void list_of_panes P_ ((Lisp_Object));
 static void list_of_items P_ ((Lisp_Object));
 
+static void find_and_call_menu_selection P_ ((FRAME_PTR, int, Lisp_Object,
+					      void *));
 static int fill_menu P_ ((MenuHandle, widget_value *, enum mac_menu_kind, int));
 static void fill_menubar P_ ((widget_value *, int));
 static void dispose_menus P_ ((enum mac_menu_kind, int));
@@ -1015,39 +1018,63 @@
      FRAME_PTR f;
 {
   SInt32 menu_choice;
+  SInt16 menu_id, menu_item;
   extern Point saved_menu_event_location;
 
   set_frame_menubar (f, 0, 1);
   BLOCK_INPUT;
 
   menu_choice = MenuSelect (saved_menu_event_location);
-  do_menu_choice (menu_choice);
+  menu_id = HiWord (menu_choice);
+  menu_item = LoWord (menu_choice);
+
+#if !TARGET_API_MAC_CARBON
+  if (menu_id == min_menu_id[MAC_MENU_M_APPLE])
+    do_apple_menu (menu_item);
+  else
+#endif
+    if (menu_id)
+      {
+        MenuHandle menu = GetMenuHandle (menu_id);
+
+        if (menu)
+          {
+            UInt32 refcon;
+
+            GetMenuItemRefCon (menu, menu_item, &refcon);
+            find_and_call_menu_selection (f, f->menu_bar_items_used,
+					  f->menu_bar_vector, (void *) refcon);
+          }
+      }
+
+  HiliteMenu (0);
 
   UNBLOCK_INPUT;
 }
 
-/* This callback is called from the menu bar pulldown menu
-   when the user makes a selection.
-   Figure out what the user chose
-   and put the appropriate events into the keyboard buffer.  */
-
-void
-menubar_selection_callback (FRAME_PTR f, int client_data)
+/* Find the menu selection and store it in the keyboard buffer.
+   F is the frame the menu is on.
+   MENU_BAR_ITEMS_USED is the length of VECTOR.
+   VECTOR is an array of menu events for the whole menu.  */
+
+static void
+find_and_call_menu_selection (f, menu_bar_items_used, vector, client_data)
+     FRAME_PTR f;
+     int menu_bar_items_used;
+     Lisp_Object vector;
+     void *client_data;
 {
   Lisp_Object prefix, entry;
-  Lisp_Object vector;
   Lisp_Object *subprefix_stack;
   int submenu_depth = 0;
   int i;
 
-  if (!f)
-    return;
   entry = Qnil;
-  subprefix_stack = (Lisp_Object *) alloca (f->menu_bar_items_used * sizeof (Lisp_Object));
-  vector = f->menu_bar_vector;
+  subprefix_stack = (Lisp_Object *) alloca (menu_bar_items_used * sizeof (Lisp_Object));
   prefix = Qnil;
   i = 0;
-  while (i < f->menu_bar_items_used)
+
+  while (i < menu_bar_items_used)
     {
       if (EQ (XVECTOR (vector)->contents[i], Qnil))
 	{
@@ -1105,13 +1132,11 @@
 	      buf.arg = entry;
 	      kbd_buffer_store_event (&buf);
 
-	      f->output_data.mac->menubar_active = 0;
 	      return;
 	    }
 	  i += MENU_ITEMS_ITEM_LENGTH;
 	}
     }
-  f->output_data.mac->menubar_active = 0;
 }
 
 /* Allocate a widget_value, blocking input.  */
@@ -1508,10 +1533,6 @@
   int *submenu_start, *submenu_end;
   int *submenu_top_level_items, *submenu_n_panes;
 
-  /* We must not change the menubar when actually in use.  */
-  if (f->output_data.mac->menubar_active)
-    return;
-
   XSETFRAME (Vmenu_updating_frame, f);
 
   if (! menubar_widget)
--- a/src/macterm.c	Thu Sep 14 09:24:00 2006 +0000
+++ b/src/macterm.c	Wed Sep 20 06:04:23 2006 +0000
@@ -263,9 +263,6 @@
 static XCharStruct *mac_per_char_metric P_ ((XFontStruct *, XChar2b *, int));
 static void XSetFont P_ ((Display *, GC, XFontStruct *));
 
-/* Defined in macmenu.h.  */
-extern void menubar_selection_callback (FRAME_PTR, int);
-
 #define GC_FORE_COLOR(gc)	(&(gc)->fore_color)
 #define GC_BACK_COLOR(gc)	(&(gc)->back_color)
 #define GC_FONT(gc)		((gc)->xgcv.font)
@@ -8513,7 +8510,7 @@
 #endif
 #endif /* ! TARGET_API_MAC_CARBON */
 
-#define M_APPLE 128
+#define M_APPLE 234
 #define I_ABOUT 1
 
 #define WINDOW_RESOURCE 128
@@ -9103,10 +9100,10 @@
 }
 #endif
 
-static void
+#if !TARGET_API_MAC_CARBON
+void
 do_apple_menu (SInt16 menu_item)
 {
-#if !TARGET_API_MAC_CARBON
   Str255 item_name;
   SInt16 da_driver_refnum;
 
@@ -9117,43 +9114,8 @@
       GetMenuItemText (GetMenuHandle (M_APPLE), menu_item, item_name);
       da_driver_refnum = OpenDeskAcc (item_name);
     }
+}
 #endif /* !TARGET_API_MAC_CARBON */
-}
-
-void
-do_menu_choice (SInt32 menu_choice)
-{
-  SInt16 menu_id, menu_item;
-
-  menu_id = HiWord (menu_choice);
-  menu_item = LoWord (menu_choice);
-
-  switch (menu_id)
-    {
-    case 0:
-      break;
-
-    case M_APPLE:
-      do_apple_menu (menu_item);
-      break;
-
-    default:
-      {
-        struct frame *f = mac_focus_frame (&one_mac_display_info);
-        MenuHandle menu = GetMenuHandle (menu_id);
-        if (menu)
-          {
-            UInt32 refcon;
-
-            GetMenuItemRefCon (menu, menu_item, &refcon);
-            menubar_selection_callback (f, refcon);
-          }
-      }
-    }
-
-  HiliteMenu (0);
-}
-
 
 /* Handle drags in size box.  Based on code contributed by Ben
    Mesander and IM - Window Manager A.  */
--- a/src/macterm.h	Thu Sep 14 09:24:00 2006 +0000
+++ b/src/macterm.h	Wed Sep 20 06:04:23 2006 +0000
@@ -226,7 +226,8 @@
 };
 
 /* The collection of data describing a window on the Mac.  */
-struct mac_output {
+struct mac_output
+{
   /* Placeholder for things accessed through output_data.x.  Must
      appear first.  */
   struct x_output x_compatible;
@@ -316,9 +317,6 @@
   /* Nonzero means tried already to make this frame visible.  */
   char asked_for_visible;
 
-  /* Nonzero means menubar is currently active.  */
-  char menubar_active;
-
   /* Relief GCs, colors etc.  */
   struct relief
   {
@@ -629,8 +627,10 @@
 extern OSStatus mac_set_font_info_for_selection P_ ((struct frame *, int, int));
 extern OSStatus install_window_handler P_ ((WindowPtr));
 extern void remove_window_handler P_ ((WindowPtr));
-extern void do_menu_choice P_ ((SInt32));
 extern OSStatus mac_post_mouse_moved_event P_ ((void));
+#if !TARGET_API_MAC_CARBON
+extern void do_apple_menu P_ ((SInt16));
+#endif
 #if USE_CG_DRAWING
 extern void mac_prepare_for_quickdraw P_ ((struct frame *));
 #endif
--- a/src/md5.c	Thu Sep 14 09:24:00 2006 +0000
+++ b/src/md5.c	Wed Sep 20 06:04:23 2006 +0000
@@ -5,17 +5,17 @@
    This file is part of the GNU Emacs.
 
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
+   modify it under the terms of the GNU General Public License as
    published by the Free Software Foundation; either version 2 of the
    License, or (at your option) any later version.
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   You should have received a copy of the GNU General Public
+   License along with the GNU C Library; see the file COPYING.  If not,
    write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
    Boston, MA 02110-1301, USA.  */
 
--- a/src/md5.h	Thu Sep 14 09:24:00 2006 +0000
+++ b/src/md5.h	Wed Sep 20 06:04:23 2006 +0000
@@ -5,17 +5,17 @@
    This file is part of GNU Emacs.
 
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
+   modify it under the terms of the GNU General Public License as
    published by the Free Software Foundation; either version 2 of the
    License, or (at your option) any later version.
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   You should have received a copy of the GNU General Public
+   License along with the GNU C Library; see the file COPYING.  If not,
    write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
    Boston, MA 02110-1301, USA.  */
 
--- a/src/print.c	Thu Sep 14 09:24:00 2006 +0000
+++ b/src/print.c	Wed Sep 20 06:04:23 2006 +0000
@@ -217,7 +217,7 @@
    if (MARKERP (printcharfun))						\
      {									\
        EMACS_INT marker_pos;						\
-       if (!(XMARKER (printcharfun)->buffer))				\
+       if (! XMARKER (printcharfun)->buffer)				\
          error ("Marker does not point anywhere");			\
        if (XMARKER (printcharfun)->buffer != current_buffer)		\
          set_buffer_internal (XMARKER (printcharfun)->buffer);		\
@@ -290,7 +290,7 @@
      SET_PT_BOTH (old_point + (old_point >= start_point			\
 			       ? PT - start_point : 0),			\
 		  old_point_byte + (old_point_byte >= start_point_byte	\
-			       ? PT_BYTE - start_point_byte : 0));	\
+				    ? PT_BYTE - start_point_byte : 0));	\
    if (old != current_buffer)						\
      set_buffer_internal (old);
 
@@ -956,7 +956,7 @@
   print_output_debug_flag = x;
 }
 
-#if defined(GNU_LINUX)
+#if defined (GNU_LINUX)
 
 /* This functionality is not vitally important in general, so we rely on
    non-portable ability to use stderr as lvalue.  */
@@ -976,7 +976,7 @@
      Lisp_Object file, append;
 {
   if (initial_stderr_stream != NULL)
-    fclose(stderr);
+    fclose (stderr);
   stderr = initial_stderr_stream;
   initial_stderr_stream = NULL;
 
@@ -984,7 +984,7 @@
     {
       file = Fexpand_file_name (file, Qnil);
       initial_stderr_stream = stderr;
-      stderr = fopen(SDATA (file), NILP (append) ? "w" : "a");
+      stderr = fopen (SDATA (file), NILP (append) ? "w" : "a");
       if (stderr == NULL)
 	{
 	  stderr = initial_stderr_stream;
@@ -2150,7 +2150,7 @@
 	  /* Do you think this is necessary?  */
 	  if (XMARKER (obj)->insertion_type != 0)
 	    strout ("(moves after insertion) ", -1, -1, printcharfun, 0);
-	  if (!(XMARKER (obj)->buffer))
+	  if (! XMARKER (obj)->buffer)
 	    strout ("in no buffer", -1, -1, printcharfun, 0);
 	  else
 	    {
@@ -2164,7 +2164,7 @@
 
 	case Lisp_Misc_Overlay:
 	  strout ("#<overlay ", -1, -1, printcharfun, 0);
-	  if (!(XMARKER (OVERLAY_START (obj))->buffer))
+	  if (! XMARKER (OVERLAY_START (obj))->buffer)
 	    strout ("in no buffer", -1, -1, printcharfun, 0);
 	  else
 	    {
@@ -2211,8 +2211,8 @@
 
 	case Lisp_Misc_Kboard_Objfwd:
 	  strout ("#<kboard_objfwd to ", -1, -1, printcharfun, 0);
-	  print_object (*(Lisp_Object *)((char *) current_kboard
-					 + XKBOARD_OBJFWD (obj)->offset),
+	  print_object (*(Lisp_Object *) ((char *) current_kboard
+					  + XKBOARD_OBJFWD (obj)->offset),
 			printcharfun, escapeflag);
 	  PRINTCHAR ('>');
 	  break;
@@ -2300,7 +2300,7 @@
   print_object (make_number (interval->position), printcharfun, 1);
   PRINTCHAR (' ');
   print_object (make_number (interval->position + LENGTH (interval)),
-	 printcharfun, 1);
+		printcharfun, 1);
   PRINTCHAR (' ');
   print_object (interval->plist, printcharfun, 1);
 }
--- a/src/regex.c	Thu Sep 14 09:24:00 2006 +0000
+++ b/src/regex.c	Wed Sep 20 06:04:23 2006 +0000
@@ -6332,6 +6332,10 @@
 {
   reg_errcode_t ret;
 
+#ifdef emacs
+  gl_state.current_syntax_table = current_buffer->syntax_table;
+#endif
+
   /* GNU code is written to assume at least RE_NREGS registers will be set
      (and at least one extra will be -1).  */
   bufp->regs_allocated = REGS_UNALLOCATED;
--- a/src/search.c	Thu Sep 14 09:24:00 2006 +0000
+++ b/src/search.c	Wed Sep 20 06:04:23 2006 +0000
@@ -42,6 +42,9 @@
 {
   struct regexp_cache *next;
   Lisp_Object regexp, whitespace_regexp;
+  /* Syntax table for which the regexp applies.  We need this because
+     of character classes.  */
+  Lisp_Object syntax_table;
   struct re_pattern_buffer buf;
   char fastmap[0400];
   /* Nonzero means regexp was compiled to do full POSIX backtracking.  */
@@ -134,6 +137,7 @@
   cp->buf.multibyte = STRING_MULTIBYTE (pattern);
   cp->buf.target_multibyte = multibyte;
   cp->whitespace_regexp = Vsearch_spaces_regexp;
+  cp->syntax_table = current_buffer->syntax_table;
   /* Doing BLOCK_INPUT here has the effect that
      the debugger won't run if an error occurs.
      Why is BLOCK_INPUT needed here?  */
@@ -173,6 +177,19 @@
     }
 }
 
+/* Clear the regexp cache.
+   There is no danger of memory leak here because re_compile_pattern
+   automagically manages the memory in each re_pattern_buffer struct,
+   based on its `allocated' and `buffer' values.  */
+void
+clear_regexp_cache ()
+{
+  int i;
+
+  for (i = 0; i < REGEXP_CACHE_SIZE; ++i)
+    searchbufs[i].regexp = Qnil;
+}
+
 /* Compile a regexp if necessary, but first check to see if there's one in
    the cache.
    PATTERN is the pattern to compile.
@@ -209,6 +226,10 @@
 	  && EQ (cp->buf.translate, (! NILP (translate) ? translate : make_number (0)))
 	  && cp->posix == posix
 	  && cp->buf.target_multibyte == multibyte
+	  /* TODO: Strictly speaking, we only need to match syntax
+	     tables when a character class like [[:space:]] occurs in
+	     the pattern. -- cyd*/
+	  && EQ (cp->syntax_table, current_buffer->syntax_table)
 	  && !NILP (Fequal (cp->whitespace_regexp, Vsearch_spaces_regexp)))
 	break;
 
@@ -3077,8 +3098,10 @@
       searchbufs[i].buf.fastmap = searchbufs[i].fastmap;
       searchbufs[i].regexp = Qnil;
       searchbufs[i].whitespace_regexp = Qnil;
+      searchbufs[i].syntax_table = Qnil;
       staticpro (&searchbufs[i].regexp);
       staticpro (&searchbufs[i].whitespace_regexp);
+      staticpro (&searchbufs[i].syntax_table);
       searchbufs[i].next = (i == REGEXP_CACHE_SIZE-1 ? 0 : &searchbufs[i+1]);
     }
   searchbuf_head = &searchbufs[0];
--- a/src/strftime.c	Thu Sep 14 09:24:00 2006 +0000
+++ b/src/strftime.c	Wed Sep 20 06:04:23 2006 +0000
@@ -7,17 +7,17 @@
    This file is part of the GNU Emacs.
 
    This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License
+   modify it under the terms of the GNU General Public License
    as published by the Free Software Foundation; either version 2, or
    (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   You should have received a copy of the GNU General Public
+   License along with the GNU C Library; see the file COPYING.  If not,
    write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
    Boston, MA 02110-1301, USA.  */
 
--- a/src/syntax.c	Thu Sep 14 09:24:00 2006 +0000
+++ b/src/syntax.c	Wed Sep 20 06:04:23 2006 +0000
@@ -1029,6 +1029,11 @@
     SET_RAW_SYNTAX_ENTRY_RANGE (syntax_table, c, newentry);
   else
     SET_RAW_SYNTAX_ENTRY (syntax_table, XINT (c), newentry);
+
+  /* We clear the regexp cache, since character classes can now have
+     different values from those in the compiled regexps.*/
+  clear_regexp_cache ();
+
   return Qnil;
 }
 
--- a/src/window.c	Thu Sep 14 09:24:00 2006 +0000
+++ b/src/window.c	Wed Sep 20 06:04:23 2006 +0000
@@ -340,8 +340,8 @@
 where X and Y are the pixel coordinates relative to the top left corner
 of the window.  The remaining elements are omitted if the character after
 POS is fully visible; otherwise, RTOP and RBOT are the number of pixels
-invisible at the top and bottom of the row, ROWH is the height of the display
-row, and VPOS is the row number (0-based) containing POS.  */)
+off-screen at the top and bottom of the row, ROWH is the height of the
+display row, and VPOS is the row number (0-based) containing POS.  */)
      (pos, window, partially)
      Lisp_Object pos, window, partially;
 {
@@ -390,6 +390,117 @@
   return in_window;
 }
 
+DEFUN ("window-line-height", Fwindow_line_height,
+       Swindow_line_height, 0, 2, 0,
+       doc: /* Return height in pixels of text line LINE in window WINDOW.
+If WINDOW is nil or omitted, use selected window.
+
+Return height of current line if LINE is omitted or nil.  Return height of
+header or mode line if LINE is `header-line' and `mode-line'.
+Otherwise, LINE is a text line number starting from 0.  A negative number
+counts from the end of the window.
+
+Value is a list (HEIGHT VPOS YPOS OFFBOT), where HEIGHT is the height
+in pixels of the visible part of the line, VPOS and YPOS are the
+vertical position in lines and pixels of the row, relative to the top
+of the first text line, and OFFBOT is the number of off-screen pixels at
+the bottom of the text row.  If there are off-screen pixels at the top
+of the (first) text row, YPOS is negative.
+
+Return nil if window display is not up-to-date.  In that case, use
+`pos-visible-in-window-p' to obtain the information.  */)
+     (line, window)
+     Lisp_Object line, window;
+{
+  register struct window *w;
+  register struct buffer *b;
+  struct glyph_row *row, *end_row;
+  int max_y, crop, i, n;
+
+  w = decode_window (window);
+
+  if (noninteractive
+      || w->pseudo_window_p)
+    return Qnil;
+
+  CHECK_BUFFER (w->buffer);
+  b = XBUFFER (w->buffer);
+
+  /* Fail if current matrix is not up-to-date.  */
+  if (NILP (w->window_end_valid)
+      || current_buffer->clip_changed
+      || current_buffer->prevent_redisplay_optimizations_p
+      || XFASTINT (w->last_modified) < BUF_MODIFF (b)
+      || XFASTINT (w->last_overlay_modified) < BUF_OVERLAY_MODIFF (b))
+    return Qnil;
+
+  if (NILP (line))
+    {
+      i = w->cursor.vpos;
+      if (i < 0 || i >= w->current_matrix->nrows
+	  || (row = MATRIX_ROW (w->current_matrix, i), !row->enabled_p))
+	return Qnil;
+      max_y = window_text_bottom_y (w);
+      goto found_row;
+    }
+
+  if (EQ (line, Qheader_line))
+    {
+      if (!WINDOW_WANTS_HEADER_LINE_P (w))
+	return Qnil;
+      row = MATRIX_HEADER_LINE_ROW (w->current_matrix);
+      if (!row->enabled_p)
+	return Qnil;
+      return list4 (make_number (row->height),
+		    make_number (0), make_number (0),
+		    make_number (0));
+    }
+
+  if (EQ (line, Qmode_line))
+    {
+      row = MATRIX_MODE_LINE_ROW (w->current_matrix);
+      if (!row->enabled_p)
+	return Qnil;
+      return list4 (make_number (row->height),
+		    make_number (0), /* not accurate */
+		    make_number (WINDOW_HEADER_LINE_HEIGHT (w)
+				 + window_text_bottom_y (w)),
+		    make_number (0));
+    }
+
+  CHECK_NUMBER (line);
+  n = XINT (line);
+
+  row = MATRIX_FIRST_TEXT_ROW (w->current_matrix);
+  end_row = MATRIX_BOTTOM_TEXT_ROW (w->current_matrix, w);
+  max_y = window_text_bottom_y (w);
+  i = 0;
+
+  while ((n < 0 || i < n)
+	 && row <= end_row && row->enabled_p
+	 && row->y + row->height < max_y)
+    row++, i++;
+
+  if (row > end_row || !row->enabled_p)
+    return Qnil;
+
+  if (++n < 0)
+    {
+      if (-n > i)
+	return Qnil;
+      row += n;
+      i += n;
+    }
+
+ found_row:
+  crop = max (0, (row->y + row->height) - max_y);
+  return list4 (make_number (row->height + min (0, row->y) - crop),
+		make_number (i),
+		make_number (row->y),
+		make_number (crop));
+}
+
+
 
 static struct window *
 decode_window (window)
@@ -454,7 +565,7 @@
 Return NCOL.  NCOL should be zero or positive.
 
 Note that if `automatic-hscrolling' is non-nil, you cannot scroll the
-window so that the location of point becomes invisible.  */)
+window so that the location of point moves off-screen.  */)
      (window, ncol)
      Lisp_Object window, ncol;
 {
@@ -1051,9 +1162,11 @@
   Lisp_Object value;
   struct window *w = decode_window (window);
   Lisp_Object buf;
+  struct buffer *b;
 
   buf = w->buffer;
   CHECK_BUFFER (buf);
+  b = XBUFFER (buf);
 
 #if 0 /* This change broke some things.  We should make it later.  */
   /* If we don't know the end position, return nil.
@@ -1066,12 +1179,20 @@
 
   if (! NILP (update)
       && ! (! NILP (w->window_end_valid)
-	    && XFASTINT (w->last_modified) >= MODIFF)
+	    && XFASTINT (w->last_modified) >= BUF_MODIFF (b))
       && !noninteractive)
     {
       struct text_pos startp;
       struct it it;
-      struct buffer *old_buffer = NULL, *b = XBUFFER (buf);
+      struct buffer *old_buffer = NULL;
+
+      /* Cannot use Fvertical_motion because that function doesn't
+	 cope with variable-height lines.  */
+      if (b != current_buffer)
+	{
+	  old_buffer = current_buffer;
+	  set_buffer_internal (b);
+	}
 
       /* In case W->start is out of the range, use something
          reasonable.  This situation occurred when loading a file with
@@ -1085,14 +1206,6 @@
       else
 	SET_TEXT_POS_FROM_MARKER (startp, w->start);
 
-      /* Cannot use Fvertical_motion because that function doesn't
-	 cope with variable-height lines.  */
-      if (b != current_buffer)
-	{
-	  old_buffer = current_buffer;
-	  set_buffer_internal (b);
-	}
-
       start_display (&it, w, startp);
       move_it_vertically (&it, window_box_height (w));
       if (it.current_y < it.last_visible_y)
@@ -1103,7 +1216,7 @@
 	set_buffer_internal (old_buffer);
     }
   else
-    XSETINT (value, BUF_Z (XBUFFER (buf)) - XFASTINT (w->window_end_pos));
+    XSETINT (value, BUF_Z (b) - XFASTINT (w->window_end_pos));
 
   return value;
 }
@@ -7365,6 +7478,7 @@
   defsubr (&Swindowp);
   defsubr (&Swindow_live_p);
   defsubr (&Spos_visible_in_window_p);
+  defsubr (&Swindow_line_height);
   defsubr (&Swindow_buffer);
   defsubr (&Swindow_height);
   defsubr (&Swindow_width);
--- a/src/xdisp.c	Thu Sep 14 09:24:00 2006 +0000
+++ b/src/xdisp.c	Wed Sep 20 06:04:23 2006 +0000
@@ -20047,7 +20047,7 @@
 {
   struct image *img;
   struct face *face;
-  int glyph_ascent;
+  int glyph_ascent, crop;
   struct glyph_slice slice;
 
   xassert (it->what == IT_IMAGE);
@@ -20155,6 +20155,15 @@
 
   take_vertical_position_into_account (it);
 
+  /* Automatically crop wide image glyphs at right edge so we can
+     draw the cursor on same display row.  */
+  if ((crop = it->pixel_width - (it->last_visible_x - it->current_x), crop > 0)
+      && (it->hpos == 0 || it->pixel_width > it->last_visible_x / 4))
+    {
+      it->pixel_width -= crop;
+      slice.width -= crop;
+    }
+
   if (it->glyph_row)
     {
       struct glyph *glyph;
--- a/src/xfns.c	Thu Sep 14 09:24:00 2006 +0000
+++ b/src/xfns.c	Wed Sep 20 06:04:23 2006 +0000
@@ -157,12 +157,16 @@
 
 /* Non-zero means prompt with the old GTK file selection dialog.  */
 
-int x_use_old_gtk_file_dialog;
+int x_gtk_use_old_file_dialog;
 
 /* If non-zero, by default show hidden files in the GTK file chooser.  */
 
 int x_gtk_show_hidden_files;
 
+/* If non-zero, don't show additional help text in the GTK file chooser.  */
+
+int x_gtk_file_dialog_help_text;
+
 /* If non-zero, don't collapse to tool bar when it is detached.  */
 
 int x_gtk_whole_detached_tool_bar;
@@ -5886,12 +5890,12 @@
   Vx_pixel_size_width_font_regexp = Qnil;
 
 /* This is not ifdef:ed, so other builds than GTK can customize it.  */
-  DEFVAR_BOOL ("x-use-old-gtk-file-dialog", &x_use_old_gtk_file_dialog,
+  DEFVAR_BOOL ("x-gtk-use-old-file-dialog", &x_gtk_use_old_file_dialog,
     doc: /* *Non-nil means prompt with the old GTK file selection dialog.
 If nil or if the file selection dialog is not available, the new GTK file
 chooser is used instead.  To turn off all file dialogs set the
 variable `use-file-dialog'.  */);
-  x_use_old_gtk_file_dialog = 0;
+  x_gtk_use_old_file_dialog = 0;
 
   DEFVAR_BOOL ("x-gtk-show-hidden-files", &x_gtk_show_hidden_files,
     doc: /* *If non-nil, the GTK file chooser will by default show hidden files.
@@ -5899,6 +5903,12 @@
 chooser to show or not show hidden files on a case by case basis.  */);
   x_gtk_show_hidden_files = 0;
 
+  DEFVAR_BOOL ("x-gtk-file-dialog-help-text", &x_gtk_file_dialog_help_text,
+    doc: /* *If non-nil, the GTK file chooser will by show additional help text.
+If more space for files in the file chooser dialog is wanted, set this to nil
+to turn the additional text off.  */);
+  x_gtk_file_dialog_help_text = 1;
+
   DEFVAR_BOOL ("x-gtk-whole-detached-tool-bar", &x_gtk_whole_detached_tool_bar,
     doc: /* *If non-nil, a detached tool bar is shown in full.
 The default is to just show an arrow and pressing on that arrow shows