changeset 90201:fbb2bea03df9

Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-69 Merge from emacs--cvs-trunk--0 Patches applied: * emacs--cvs-trunk--0 (patch 474-484) - Update from CVS - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 88-91) - Merge from emacs--cvs-trunk--0 - Update FSF's address in GPL notices - Update from CVS
author Miles Bader <miles@gnu.org>
date Thu, 14 Jul 2005 08:02:00 +0000
parents f9a65d7ebd29 (current diff) 487eee037b09 (diff)
children 7597b4a23c3b
files admin/FOR-RELEASE etc/ChangeLog etc/GNU etc/MORE.STUFF etc/NEWS etc/TODO etc/refcard.tex etc/tasks.texi leim/ChangeLog leim/quail/japanese.el lib-src/ChangeLog lib-src/pop.c lisp/ChangeLog lisp/allout.el lisp/calc/calc-embed.el lisp/calc/calc-units.el lisp/calc/calc.el lisp/comint.el lisp/cus-edit.el lisp/cus-face.el lisp/cus-start.el lisp/custom.el lisp/desktop.el lisp/dired-aux.el lisp/dired.el lisp/ediff-diff.el lisp/ediff-init.el lisp/ediff-mult.el lisp/ediff-ptch.el lisp/ediff-util.el lisp/ediff-vers.el lisp/ediff.el lisp/elide-head.el lisp/emacs-lisp/bytecomp.el lisp/emacs-lisp/checkdoc.el lisp/emacs-lisp/debug.el lisp/emacs-lisp/easy-mmode.el lisp/emacs-lisp/edebug.el lisp/emacs-lisp/timer.el lisp/emulation/viper-cmd.el lisp/emulation/viper-init.el lisp/emulation/viper-keym.el lisp/emulation/viper-macs.el lisp/emulation/viper-mous.el lisp/emulation/viper-util.el lisp/emulation/viper.el lisp/facemenu.el lisp/files.el lisp/font-lock.el lisp/frame.el lisp/fringe.el lisp/gnus/ChangeLog lisp/gnus/gnus-art.el lisp/gnus/gnus-salt.el lisp/gnus/gnus-topic.el lisp/ido.el lisp/mail/rmail.el lisp/progmodes/compile.el lisp/progmodes/gdb-ui.el lisp/progmodes/sh-script.el lisp/replace.el lisp/simple.el lisp/startup.el lisp/term/mac-win.el lisp/textmodes/ispell.el lisp/timezone.el lisp/tooltip.el lisp/whitespace.el lisp/winner.el lispref/ChangeLog lispref/book-spine.texinfo lispref/customize.texi lispref/display.texi lispref/elisp.texi lispref/os.texi mac/ChangeLog man/ChangeLog man/anti.texi man/calc.texi man/display.texi man/files.texi man/gnu.texi man/mule.texi man/search.texi man/viper.texi src/ChangeLog src/alloc.c src/bytecode.c src/coding.c src/coding.h src/eval.c src/indent.c src/keyboard.c src/lisp.h src/lread.c src/mac.c src/macterm.c src/window.c src/xdisp.c src/xfaces.c src/xselect.c
diffstat 104 files changed, 2830 insertions(+), 2301 deletions(-) [+]
line wrap: on
line diff
--- a/admin/FOR-RELEASE	Thu Jul 07 12:43:14 2005 +0000
+++ b/admin/FOR-RELEASE	Thu Jul 14 08:02:00 2005 +0000
@@ -21,6 +21,10 @@
 
 ** Regenerate the postscript files of the reference cards in etc.
 
+** Ask maintainers of refcard translations to update them.
+
+** Check what should be deleted or updated in MORE.STUFF.
+
 * NEW FEATURES
 
 ** Make VC-over-Tramp work where possible, or at least fail
@@ -101,14 +105,10 @@
 I think in the near future we will see more of this problem, so it might be
 time to make anfe-ftp more intelligent.
 
-** lisp/elide-head.el should recognize the FSF's new address as well.
-
 * DOCUMENTATION
 
 ** Document Custom Themes.
 
-** Update lispref/README.
-
 ** Update man/info.texi.
 
 ** Add missing years in copyright notices of all files.
@@ -128,7 +128,7 @@
 lisp/eshell		working		Thien-Thi Nguyen
 lisp/international	done		Kenichi Handa
 lisp/languages		done		Kenichi Handa
-lisp/mh-e		working		Thien-Thi Nguyen
+lisp/mh-e		working		Bill Wohler
 lisp/net		working		Thien-Thi Nguyen
 lisp/play		working		Thien-Thi Nguyen
 lisp/term		working		Thien-Thi Nguyen
--- a/etc/ChangeLog	Thu Jul 07 12:43:14 2005 +0000
+++ b/etc/ChangeLog	Thu Jul 14 08:02:00 2005 +0000
@@ -1,3 +1,30 @@
+2005-07-12  Juri Linkov  <juri@jurta.org>
+
+	* refcard.tex (Files): Change description of `C-x C-q' from
+	`checkin/checkout' to `toggle read-only'.
+	(Getting Help): Replace `C-h c' with `C-h k'.
+	(Error Recovery): Replace `recover-file' with `recover-session'.
+	(Info): Replace key binding `C-h C-i' with `C-h S'.  Add `t'.
+
+2005-07-07  Richard M. Stallman  <rms@gnu.org>
+
+	* GNU: Update how to help.  Improve footnote 7.
+
+2005-07-07  Lute Kamstra  <lute@gnu.org>
+
+	* tasks.texi: Delete file.  The GNU Task List is obsolete and has
+	been replaced by http://savannah.gnu.org/projects/tasklist.
+
+2005-07-07  Lute Kamstra  <lute@gnu.org>
+
+	* refcard.tex: Update `versionnumber' and `year'.  Update Emacs's
+	version to 22.
+	(Starting Emacs): Delete sentence to fix formatting problems.
+	(Multiple Windows): Clarify first sentence.  Mention C-x 5 1.
+	(Formatting): Update the binding of set face.
+	(International Character Sets): set-language-environment is bound
+	to C-x RET l.
+
 2005-07-05  Lute Kamstra  <lute@gnu.org>
 
 	Update FSF's address in GPL notices.
--- a/etc/GNU	Thu Jul 07 12:43:14 2005 +0000
+++ b/etc/GNU	Thu Jul 14 08:02:00 2005 +0000
@@ -22,8 +22,9 @@
      Footnotes added in 1993 help clarify these points.
 
      For up-to-date information about the available GNU software,
-     please see the latest issue of the GNU's Bulletin.  The list is
-     much too long to include here.
+     please see www.gnu.org.  For software tasks to work on, see
+     http://savannah.gnu.org/projects/tasklist.  For other ways
+     to contribute, see http://www.gnu.org/help.
 
 What's GNU?  Gnu's Not Unix!
 ============================
@@ -531,13 +532,13 @@
 disparate laws which raise very different issues.  Nowadays I urge
 people to reject the term "intellectual property" entirely, lest it
 lead others to suppose that those laws form one coherent issue.  The way to be
-clear is to to discuss patents, copyrights, and trademarks separately.
+clear is to discuss patents, copyrights, and trademarks separately.
 See http://www.gnu.org/philosophy/not-ipr.xhtml for more explanation
 of how this term spreads confusion and bias.
 
-   (7) In 1985 I had not yet recognized the importance of distinguishing
-between "free software" and "freeware".  The term "freeware" means
-software you are free to redistribute, but usually you are not free to study
-and change the source code, so most of it is not free software.
-See http://www.gnu.org/philosophy/words-to-avoid.html for more
+   (7) Subsequently we have learned to distinguish between "free
+software" and "freeware".  The term "freeware" means software you are
+free to redistribute, but usually you are not free to study and change
+the source code, so most of it is not free software.  See
+http://www.gnu.org/philosophy/words-to-avoid.html for more
 explanation.
--- a/etc/MORE.STUFF	Thu Jul 07 12:43:14 2005 +0000
+++ b/etc/MORE.STUFF	Thu Jul 14 08:02:00 2005 +0000
@@ -62,11 +62,6 @@
 
  * Expand: <URL:http://w3.teaser.fr/%7Eflepied/expand.el.gz>
 
- * Find Func:
-   <URL:http://www.kurims.kyoto-u.ac.jp/%7Epetersen/emacs/find-func.el>
-
- * Flyspell: <URL:http://kaolin.unice.fr/%7Eserrano/emacs/flyspell>
-
  * Fortune: <URL:http://www.coling.uni-freiburg.de/%7Eschauer/emacs.html>
 
  * Gnus: <URL:http://www.gnus.org/>
@@ -80,8 +75,6 @@
 
  * Iswitchb: <URL:http://www.anc.ed.ac.uk/%7Estephen/emacs/iswitchb.el>
 
- * MH-E: <URL:http://mh-e.sourceforge.net/>
-
  * PC Selection: <URL:ftp://ftp.thp.uni-duisburg.de/pub/source/elisp/>
 
  * PS mode: <URL:http://odur.let.rug.nl/%7Ekleiweg/postscript/>
--- a/etc/NEWS	Thu Jul 07 12:43:14 2005 +0000
+++ b/etc/NEWS	Thu Jul 14 08:02:00 2005 +0000
@@ -2256,6 +2256,9 @@
 The function `c-toggle-syntactic-indentation' can be used to toggle
 syntactic indentation.
 
+** In sh-script, a continuation line is only indented if the backslash was
+preceded by a SPC or a TAB.
+	
 ---
 ** Perl mode has a new variable `perl-indent-continued-arguments'.
 
--- a/etc/TODO	Thu Jul 07 12:43:14 2005 +0000
+++ b/etc/TODO	Thu Jul 14 08:02:00 2005 +0000
@@ -93,6 +93,12 @@
 
 * Other features we would like:
 
+** Create a category of errors called `process-error'
+  for some or all errors associated with using subprocesses.
+
+** Maybe reinterpret `parse-error' as a category of errors
+  and put some other errors under it.
+
 ** A function to check for customizable options that have been
   set but not saved, and ask the user whether to save them.
   This could go in kill-emacs-query-functions, to remind people
@@ -153,6 +159,8 @@
   which gives the same information through a menu structure.  [Dave
   Love started on this.]
 
+** Add a cpio mode, more or less like tar mode.
+
 ** Implement a variant of uncompress.el or jka-compr.el that works with
   GNU Privacy Guard for encryption.  [Code exists but isn't assigned.
   See the Gnus development sources for assigned code concerning GPG
--- a/etc/refcard.tex	Thu Jul 07 12:43:14 2005 +0000
+++ b/etc/refcard.tex	Thu Jul 14 08:02:00 2005 +0000
@@ -1,4 +1,4 @@
-% Reference Card for GNU Emacs version 21 on Unix systems
+% Reference Card for GNU Emacs version 22 on Unix systems
 %**start of header
 \newcount\columnsperpage
 \newcount\letterpaper
@@ -14,7 +14,7 @@
 \letterpaper=1
 
 % Nothing else needs to be changed below this line.
-% Copyright (c) 1987, 1993, 1996, 1997 Free Software Foundation, Inc.
+% Copyright (c) 1987, 1993, 1996, 1997, 2005 Free Software Foundation, Inc.
 
 % This file is part of GNU Emacs.
 
@@ -62,8 +62,8 @@
 
 % If there were room, it would be nice to see a section on Dired.
 
-\def\versionnumber{2.2}
-\def\year{1997}
+\def\versionnumber{2.3}
+\def\year{2005}
 
 \def\shortcopyrightnotice{\vskip 1ex plus 2 fill
   \centerline{\small \copyright\ \year\ Free Software Foundation, Inc.
@@ -72,7 +72,7 @@
 \def\copyrightnotice{
 \vskip 1ex plus 2 fill\begingroup\small
 \centerline{Copyright \copyright\ \year\ Free Software Foundation, Inc.}
-\centerline{v\versionnumber{} for GNU Emacs version 21, \year}
+\centerline{v\versionnumber{} for GNU Emacs version 22, \year}
 \centerline{designed by Stephen Gildea}
 
 Permission is granted to make and distribute copies of
@@ -270,13 +270,11 @@
 
 \title{GNU Emacs Reference Card}
 
-\centerline{(for version 21)}
+\centerline{(for version 22)}
 
 \section{Starting Emacs}
 
-To enter GNU Emacs 21, just type its name: \kbd{emacs}
-
-To read in a file to edit, see Files, below.
+To enter GNU Emacs 22, just type its name: \kbd{emacs}
 
 \section{Leaving Emacs}
 
@@ -291,7 +289,7 @@
 \key{{\bf insert} contents of another file into this buffer}{C-x i}
 \key{replace this file with the file you really want}{C-x C-v}
 \key{write buffer to a specified file}{C-x C-w}
-\key{version control checkin/checkout}{C-x C-q}
+\key{toggle read-only status of buffer}{C-x C-q}
 
 \section{Getting Help}
 
@@ -303,14 +301,14 @@
 \key{scroll help window}{C-M-v}
 
 \key{apropos: show commands matching a string}{C-h a}
-\key{show the function a key runs}{C-h c}
+\key{describe the function a key runs}{C-h k}
 \key{describe a function}{C-h f}
 \key{get mode-specific information}{C-h m}
 
 \section{Error Recovery}
 
 \key{{\bf abort} partially typed or executing command}{C-g}
-\metax{{\bf recover} a file lost by a system crash}{M-x recover-file}
+\metax{{\bf recover} files lost by a system crash}{M-x recover-session}
 \metax{{\bf undo} an unwanted change}{C-x u, C-_ {\rm or} C-/}
 \metax{restore a buffer to its original contents}{M-x revert-buffer}
 \key{redraw garbaged screen}{C-l}
@@ -388,6 +386,8 @@
 \section{Query Replace}
 
 \key{interactively replace a text string}{M-\%}
+% query-replace-regexp is bound to C-M-% but that can't be typed on
+% consoles.
 \metax{using regular expressions}{M-x query-replace-regexp}
 
 Valid responses in query-replace mode are
@@ -402,12 +402,12 @@
 
 \section{Multiple Windows}
 
-When two commands are shown, the second is for ``other frame.''
-
-\key{delete all other windows}{C-x 1}
+When two commands are shown, the second is a similar command for a
+frame instead of a window.
 
 {\setbox0=\hbox{\kbd{0}}\advance\hsize by 0\wd0
 \paralign to \hsize{#\tabskip=10pt plus 1 fil&#\tabskip=0pt&#\cr
+\threecol{delete all other windows}{C-x 1\ \ \ \ }{C-x 5 1}
 \threecol{split window, above and below}{C-x 2\ \ \ \ }{C-x 5 2}
 \threecol{delete this window}{C-x 0\ \ \ \ }{C-x 5 0}
 }}
@@ -449,7 +449,7 @@
 \key{set fill column}{C-x f}
 \key{set prefix each line starts with}{C-x .}
 
-\key{set face}{M-g}
+\key{set face}{M-o}
 
 \section{Case Change}
 
@@ -562,7 +562,7 @@
 
 \section{International Character Sets}
 
-\metax{specify principal language}{M-x set-language-environment}
+\key{specify principal language}{C-x RET l}
 \metax{show all input methods}{M-x list-input-methods}
 \key{enable or disable input method}{C-\\}
 \key{set coding system for next command}{C-x RET c}
@@ -572,7 +572,7 @@
 \section{Info}
 
 \key{enter the Info documentation reader}{C-h i}
-\key{find specified function or variable in Info}{C-h C-i}
+\key{find specified function or variable in Info}{C-h S}
 \beginindentedkeys
 
 Moving within a node:
@@ -591,6 +591,7 @@
 \key{follow cross reference  (return with \kbd{l})}{f}
 \key{return to last node you saw}{l}
 \key{return to directory node}{d}
+\key{go to top node of Info file}{t}
 \key{go to any node by name}{g}
 
 Other:
--- a/etc/tasks.texi	Thu Jul 07 12:43:14 2005 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,964 +0,0 @@
-\input texinfo @c -*-texinfo-*-
-@c %**start of header
-@setfilename tasks.info
-@settitle GNU Task List
-@c This date is automagically updated when you save this file:
-@set lastupdate October 24, 2002
-@c %**end of header
-
-@c On behalf of the Volunteer Coordinators, I humbly request that anyone
-@c who adds an entry to this file please add a pointer to some more info
-@c about that project.  People ask us (gvc@gnu.org) for more information
-@c about these projects and it's embarrassing to ask around and find out
-@c that nobody remembers what the project was supposed to be, or do.
-@c We don't need a huge elaborate ISO-9001 document, just a couple of
-@c paragraphs or a URL or something that explains what the e.g. ``stalker''
-@c project should do.  It will save us all time in the future.
-@c Thanks, toby@gnu.org
-@c April 27, 2002
-
-@dircategory GNU organization
-@direntry
-* Tasks: (tasks).               GNU task list.
-@end direntry
-
-@setchapternewpage off
-
-@copying
-The GNU task list, last updated @value{lastupdate}.
-
-Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
-1997, 1998, 1999, 2000, 2002 Free Software Foundation, Inc.
-
-@quotation
-Copying and distribution of this file, with or without modification,
-are permitted in any medium without royalty provided the copyright
-notice and this notice are preserved.
-@end quotation
-@end copying
-
-@titlepage
-@title GNU Task List
-@author Free Software Foundation
-@author last updated @value{lastupdate}
-@page
-@vskip 0pt plus 1filll
-@insertcopying
-@end titlepage
-
-@contents
-
-@ifnottex
-@node Top, Intro, (dir), (dir)
-@top GNU Task List
-
-@insertcopying
-
-See also
-@uref{http://www.gnu.org/help/help.html#helpgnu} for other suggested tasks.
-@end ifnottex
-
-@menu
-* Intro::
-* Highest Priority::
-* Documentation::
-* Unix-Related Projects::
-* Kernel Projects::
-* Extensions::
-* Java Projects::
-* X Windows Projects::
-* Network Projects::
-* Encryption Projects::
-* Other Projects::
-* Languages::
-* Education::
-* Games and Recreations::
-@end menu
-
-@node Intro, Highest Priority, Top, Top
-@chapter About the GNU Task List
-
-If you did not obtain this file directly from the GNU project and
-recently, please check for a newer version.  You can ftp the task list
-from any GNU FTP host in directory @file{/pub/gnu/tasks/}.  The task
-list is available there in several different formats: @file{tasks.text},
-@file{tasks.texi}, @file{tasks.info}, and @file{tasks.dvi}.
-@c to fix an overfill, join the paragraphs -len
-The task list is also available on the GNU World Wide Web server:
-@uref{http://www.gnu.org/prep/tasks_toc.html}.
-
-If you start working steadily on a project, please let @email{gvc@@gnu.org}
-know.  We might have information that could help you; we'd also like to
-send you the GNU coding standards.
-
-Because of the natural tendency for most volunteers to write programming
-tools or programming languages, we have a comparative shortage of
-applications useful for non-programmer users.  Therefore, we ask you to
-consider writing such a program.
-
-Typically, a new program that does a completely new job advances
-the GNU project, and the free software community, more than an
-improvement to an existing program.
-
-Typically, new features or new programs advance the free software
-community more, in the long run, than porting existing programs.  One
-reason is that portable new features and programs benefit people on many
-platforms, not just one.  At the same time, there tend to be many
-volunteers for porting---so your help will be more valuable in other
-areas, where volunteers are more scarce.
-
-Typically, it is more useful to extend a program in functionality than
-to improve performance.  Users who use the new functionality will
-appreciate it very much, if they use it; but even when they benefit from
-a performance improvement, they may not consider it very important.
-
-Finally, if you think of an important job that free software cannot
-solve yet that is typically solved by proprietary software, please send
-a short description of that job to @email{tasks@@gnu.org} so that we can
-add it to this task list.
-
-@node Highest Priority, Documentation, Intro, Top
-@chapter Highest Priority
-
-This task list mentions a large number of tasks that would be more or
-less useful.  With luck, at least one of them will inspire you to start
-writing.  It's better for you to work on any task that inspires you than
-not write free software at all.
-
-But if you would like to work on what we need most, here is a list of
-high priority projects.
-
-@itemize @bullet
-
-@item
-
-If you are good at writing documentation, please do that.  Pick a system
-or program you like, and write a Free tutorial or manual for it.
-
-@item
-
-Help to finish the missing features of the @command{docbook2texi} so
-that as many Docbook tags as possible can be translated into reasonable
-Texinfo.  See @uref{http://docbook2x.sourceforge.net/todo.html} for a
-task list of what needs to be done.
-
-@item
-If you are very good at C programming and interested in kernels, you
-can help develop the GNU HURD, the kernel for the GNU system.  Please
-have a look at @uref{http://www.gnu.org/software/hurd/hurd.html}, and
-then join the HURD mailing lists at
-@uref{http://www.debian.org/ports/hurd/hurd-contact}.
-
-@item
-If you are a Scheme fan, you can help develop Guile.  Please have a look
-at the URL @uref{http://www.gnu.org/software/guile/guile.html}
-and then contact the Guile developers at @email{guile-devel@@gnu.org}.
-
-@item
-Improve the facilities for translating other languages into Scheme,
-so that Guile can provide support for a variety of languages.
-
-@item
-A package to convert programs written using MS Access into Scheme,
-making use of a free data base system and the GTK toolkit.
-
-@item
-A general-purpose document viewing program that can handle PostScript,
-DVI, PDF, HTML, RTF, Word format and Word Perfect format.
-
-@item
-Help develop software to emulate Windows NT on top of GNU systems.
-For example, you could help work on Wine.
-See @uref{http://www.winehq.org/}.
-
-@ignore
-@c panda is a PDF generator library released under the GPL
-@c http://www.stillhq.com/cgi-bin/getpage?area=panda&page=index.htm
-@item
-A free replacement for pdflib. This is a library for generating PDF.
-@end ignore
-
-@item
-Add gettext support to GNU programs that don't have it already.  (Please
-contact the developers of the specific packages that you want to work
-on.)
-
-@item
-Develop a substitute, which runs on GNU systems, for some very popular
-or very important application that many non-programmers use on Windows,
-and which has no comparable free equivalent now.
-@end itemize
-
-@node Documentation, Unix-Related Projects, Highest Priority, Top
-@chapter Documentation
-
-We very urgently need documentation for many existing parts of the
-system.
-
-Note that there are proprietary manuals for many of these topics, but
-proprietary manuals do not count, for the same reason proprietary
-software does not count: we are not free to copy and modify them.
-We do not recommend any non-free materials as documentation.
-
-@itemize @bullet
-
-@item
-A reference document for SQL for use as a standard for implementors of
-free software versions of SQL.
-
-@item
-A manual for libstdc++.
-
-
-@ignore
-@c the Indian TeX Users Group has completed a freely distributable version of a LaTex manual - http://www.tug.org.in/tutorials.html
-@item
-A unified manual for La@TeX{}.  (Existing documentation is non-free.)
-@end ignore
-
-@ignore
-@c docbook definitive guide http://www.docbook.org/tdg/en/html/ is now FDL
-@item
-A manual for Docbook SGML format.
-@end ignore
-
-@item
-A tutorial introduction to Midnight Commander.
-
-@item
-A thorough manual for RCS.
-
-@item
-A reference manual for Mach.
-
-@item
-A reference manual for the GNU Hurd features in GNU libc.
-
-@item
-A manual for writing Hurd servers.
-
-@ignore
-@c this is done.
-@item
-A manual for GNU sed.
-@end ignore
-
-@item
-Reference manuals for C++, Objective C, Pascal, Fortran 77, and Java.
-
-@item
-A tutorial manual for the C++ STL (standard template library).
-
-@item
-A tutorial manual for Gforth.
-
-@item
-GNU Objective-C Runtime Library Manual; this would be a reference manual
-for the runtime library functions, structures, and classes.  Some work
-has been done on this job.
-
-@item
-Manuals for GNUstep: developer tutorial, developer programming manual,
-developer reference manual, and user manual.
-
-@item
-A manual for Ghostscript.
-
-@item
-A manual for TCSH.
-
-@item
-A coherent free reference manual for Perl.  Most of the Perl on-line
-reference documentation can be used as a starting point, but work is
-needed to weld them together into a coherent manual.
-
-@c Bradley M. Kuhn is working on this. <bkuhn@gnu.org>  Refer volunteers to
-@c  him.
-
-@item
-
-A good free Perl language tutorial introduction.  The existing Perl
-introductions are published with restrictions on copying and
-modification, so that they cannot be part of a GNU system.  bkuhn made a
-start at a free tutorial, but a lot of work is needed.
-
-
-@item
-A manual for PIC (the graphics formatting language).
-
-@item
-A book on how GCC works and why various machine descriptions
-are written as they are.
-
-@item
-A manual for programming applications for X11.
-
-@item
-Manuals for various X window managers.
-
-@item
-Reference cards for those manuals that don't have them: C
-Compiler, Texinfo, Termcap, and maybe the C Library.
-
-@item
-Many utilities still need documentation.
-@end itemize
-
-@node Unix-Related Projects, Kernel Projects, Documentation, Top
-@chapter Unix-Related Projects
-
-@itemize @bullet
-@ignore
-@item
-Modify the GNU @code{dc} program to use the math routines of GNU
-@code{bc}.
-@end ignore
-
-@item
-Rewrite @code{indent} from scratch to make it cleaner.
-
-@item
-Write a free software replacement for the @code{agrep} program.
-
-@item
-Less urgent: make a replacement for the ``writer's workbench'' program
-@code{style}, or something to do the same kind of job.  Compatibility
-with Unix is not especially important for this program.
-
-@end itemize
-
-@node Kernel Projects, Extensions, Unix-Related Projects, Top
-@chapter Kernel-Related Projects
-
-@itemize @bullet
-@item
-An over-the-ethernet debugger stub that will allow the kernel to be
-debugged from GDB running on another machine.
-
-This stub needs its own self-contained implementation of all protocols
-to be used, since the GNU system will use user processes to implement
-all but the lowest levels, and the stub won't be able to use those
-processes.  If a simple self-contained implementation of IP and TCP is
-impractical, it might be necessary to design a new, simple protocol
-based directly on ethernet.  It's not crucial to support high speed or
-communicating across gateways.
-
-It might be possible to use the Mach ethernet driver code, but it would
-need some changes.
-
-@item
-A shared memory X11 server to run under MACH is very desirable.  The
-machine specific parts should be kept well separated.
-
-@item
-An implementation of CIFS, the ``Common Internet File System,'' for the
-HURD.  This protocol is an offshoot of SMB.
-
-@item
-Support (in Linux?) for dumping the non-textual contents of an SVGA
-console.
-@end itemize
-
-@node Extensions, Java Projects, Kernel Projects, Top
-@chapter Extensions to Existing GNU Software
-
-@itemize @bullet
-@item
-Enhance GCC.  See files @file{PROJECTS} and @file{PROBLEMS} in the GCC
-distribution.
-
-@item
-Interface GDB to Guile, so that users can write debugging commands in
-Scheme.  This would also make it possible to write, in Scheme, a
-graphical interface that uses GTK and is tightly integrated into GDB.
-
-@item
-Extend Octave to support programs that were written
-to run on Khoros.
-
-@item
-Rewrite Automake in Scheme, so it can run in Guile.  Right now it is
-written in Perl.  There are also other programs, not terribly long,
-which we would also like to have rewritten in Scheme.
-
-@item
-Finish the partially-implemented C interpreter project.
-
-@item
-Help with the development of GNUstep, a GNU implementation of the
-OpenStep specification.
-
-@item
-Add features to GNU Make to record the precise rule with which each file
-was last recompiled; then recompile any file if its rule in the makefile
-has changed.
-
-@item
-Add a few features to GNU @code{diff}, such as handling large input
-files without reading entire files into core.
-
-@item
-An @code{nroff} macro package to simplify @code{texi2roff}.
-
-@item
-A queueing system for the mailer Smail that groups pending work by
-destination rather than by original message.  This makes it possible
-to schedule retries coherently for each destination.  Talk to
-@email{tron@@veritas.com} and @email{woods@@weird.com} about this.
-
-@end itemize
-
-@node  Java Projects, X Windows Projects, Extensions, Top
-@chapter Java Projects
-
-@itemize @bullet
-
-@item
-The GNU Classpath Extensions project is looking for help.  classpathx
-builds free versions of Sun's java extension libraries, the packages
-in the javax namespace.
-
-@item
-Write a replacement for the javadoc utility.  The Classpath
-(@uref{http://www.gnu.org/software/classpath}) team has already made a
-start to one.
-
-
-@end itemize
-
-@node X Windows Projects, Network Projects, Java Projects, Top
-@chapter X Windows Projects
-
-@itemize @bullet
-@item
-An emulator for Macintosh graphics calls on top of X Windows.
-
-@ignore
-@c winelib does this http://www.winehq.org/
-@item
-A package that emulates the API of Visual C++'s Foundation Classes
-(MFC), but operates on top of X11.  It need not match the screen
-appearance provided by MFC.  Instead, it would be best to use GTK, so as
-to give coherence with GNOME.
-@end ignore
-
-@ignore
-@c GNOME Basic is doing this
-@item
-A compatible replacement for Visual Basic, running on top of X11.
-It need not match the screen appearance of Visual C++.  Instead,
-it would be best to use GTK, so as to give coherence with GNOME.
-@end ignore
-
-@ignore
-@c Denemo is doing this.
-@item
-A music playing and editing system.  This should work with LilyPond, a
-GNU program for music typesetting.
-@end ignore
-
-@ignore  @c GNUskies should do this
-@item
-An ephemeris program to replace xephem (which is, alas, too restricted
-to qualify as free software).
-@end ignore
-
-@c Gepetto (@url{http://laurent.riesterer.free.fr/gepetto/intro-main.html},
-@c @email{laurent.riesterer@@free.fr}), according to @email{gnueval@@gnu.org},
-@c does the job of displaing dancers but does not allow editing notation.
-
-
-@item
-Make sure the Vibrant toolkit works with LessTif instead of Motif.
-
-@item
-A program to display and edit Hypercard stacks.
-
-@item
-A two-dimensional outliner program, which lets you draw
-graph structures of textual items, and then display them
-in various ways.
-
-@ignore  @c done
-@item
-A program for graphic morphing of scanned photographs.
-@end ignore
-
-@ignore  @c Done by gLabels
-@item
-Software for designing and printing business cards.
-@end ignore
-@end itemize
-
-@node Network Projects, Encryption Projects, X Windows Projects, Top
-@chapter Network Projects
-
-@itemize @bullet
-@ignore
-@c Cornell has released a program for this.
-@item
-A teleconferencing program which does the job of CU-SeeMe (which is,
-alas, not free software).
-@end ignore
-
-@ignore
-@c Bishop Bettini <bishop@synxcti.com> is working on this.
-@item
-A free ICQ-compatible server program.  (The ICQ server itself is not
-free software.)
-@end ignore
-
-@ignore
-@c if anyone knows what this means please send email to gvc@gnu.org
-@item
-Free software like Stalker for operating a web server for email
-services.
-@end ignore
-
-@end itemize
-
-@node Encryption Projects, Other Projects, Network Projects, Top
-@chapter Encryption Projects
-
-These projects need to be written outside the US by people who are not
-US citizens, to avoid problems with US export control law.
-
-@itemize @bullet
-@ignore
-@c libcrypt is doing this.
-@item
-A free library for public-key encryption.  This library can probably be
-developed from the code for the GNU Privacy Guard.
-@end ignore
-
-@ignore
-@item
-@c GNUtls is doing this.
-An implementation of SSLv3 (more precisely, TLSv1) which has
-distribution terms compatible with the GNU GPL.  We know of a
-GPL-covered implemention of a version of SSL that you can use as a
-starting point.
-@end ignore
-
-@ignore
-@c akopia interchange appears to do this.  if you'd like to re-open this
-@c item please let the GVC know what you want (in some detail)
-@item
-Free software for doing secure commercial transactions on the web.
-This should be based on libgcrypt and GNUtls.
-@end ignore
-
-@end itemize
-
-@node Other Projects, Languages, Encryption Projects, Top
-@chapter Other Projects
-
-If you think of others that should be added, please
-send them to @email{tasks@@gnu.org}.
-
-@itemize @bullet
-
-@ignore
-@c vcg as of version 1.30 (current as of 2002-10-24) is GPL
-@c toby 2002-10-24
-@item
-A library for automatic graph layout.  VCG version 1.0, which was free
-software, might provide a base for this.
-@end ignore
-
-@item
-A data visualization program along the lines of xgobi or ggobi.
-
-@item
-A graph visualization program, which would use that library and
-provide a front end for manual and interactive intervention so as to
-provide a full substitute for equivalent proprietory software.  It
-would be good to support DOT format as input, and perhaps other
-formats.
-
-@c Such proprietary software is daVinci and graphviz, but are uncommon enough
-@c that we don't mention them here publicly.
-@c http://www.research.att.com/~erg/graphviz/info/lang.html
-@c Some useful information about graph drawing programs can be found here
-@c http://www.research.att.com/sw/tools/graphviz/gdlinks.html
-
-@c At the time of making this entry, VCG's website was
-@c    http://rw4.cs.uni-sb.de/users/sander/html/gsvcg1.html
-
-@item
-
-A ``one stop shopping system'' for advocates involved with social
-justice or other non-profit campaigns.  The idea would be to create an
-easy-to-use interface to software that would allow someone to register a
-domain for their organisation, build a website, and set up mailing
-lists.  The software would need options to easily do all this, and be
-made easy for non-hackers.  Mainly the work would involve bringing
-together a number of existing tools with an overriding configuration
-program.
-
-@ignore LinuxBIOS is doing this
-@item
-A simple PC BIOS.  On most new PCs, the BIOS is stored in writable
-memory (misleadingly known as ``flash ROM'').  In order to have a wholly
-free system on these PCs, we need a free BIOS.
-
-This task is made simpler by the fact that this BIOS need only support
-enough features to enable a boot-loader such as LILO or GRUB to finish
-loading the kernel.  Neither Linux nor Mach actually uses the BIOS once
-it starts up.  Also, it is not absolutely necessary to do all the many
-diagnostics that an ordinary BIOS does (though it would be useful to do
-some of them).  However, there may be a need to configure certain data
-in the computer in a way that is specific to each model of computer.
-@end ignore
-
-@item
-An imitation of Page Maker or Ventura Publisher.
-
-@item
-An imitation of @code{dbase2} or @code{dbase3}.  (How dbased!)
-Harbour, a free replacement for Clipper, would provide a useful start.
-@uref{http://www.harbour-project.org/}.
-
-@ignore  @c being done by Jonas etc.
-@item
-A general ledger program, including support for accounts payable,
-account receivables, payroll, inventory control, order processing, etc.
-@end ignore
-
-@item
-A free replacement for Glimpse, which is not free software.
-Swish does some parts of the job, but not all.
-
-@item
-Software for desktop publishing.  We are extending Emacs into a WYSIWYG
-word processor, to handle primarily linear text; what this item proposes
-is software focused on page layout.
-
-@ignore It looks like TruePrint will fill this gap
-@item
-A program to typeset C code for printing, to make it easier to read on
-paper.  For ideas on what to do, see the book,
-
-@display
-Human Factors and Typography for More Readable Programs,
-Ronald M. Baecker and Aaron Marcus,
-Addison-Wesley, ISBN 0-201-10745-7
-@end display
-
-But you don't have to do exactly what they propose.
-@end ignore
-
-@ignore
-@c This is now being worked on -- rms, 22 June 1998
-@item
-A program to convert Microsoft Word documents to text/enriched, TeX,
-LaTeX, Texinfo, or some other format that free software can edit.
-@end ignore
-
-@ignore
-@c People are helping the developer of siff release it as free software.
-
-@item
-A free replacement for siff (sometimes called sif).  This would be a
-program to find similar files in a large file system, ``similar''
-meaning that the files contain a significant number of common substrings
-that are of a certain size or greater.  You can find some information
-about siff (which is, unfortunately, not free software) at
-@uref{ftp://ftp.cs.arizona.edu/reports/1993/TR93-33.ps.Z}.
-@end ignore
-
-@ignore
-@c This is being developed -- rms, 3 May 1998
-@item
-A free replacement for the semi-free Qt library.
-@end ignore
-
-@ignore
-@c Ogg Vorbis is doing this, see @url{http://www.xiph.org/ogg/vorbis/index.html} or contact @email{Monty <monty@xiph.org>}.
-
-@item
-High-quality music compression software.
-(Talk with @email{mt@@sulaco.org} for relevant suggestions.)
-Unfortunately we cannot implement the popular MP3 format
-due to patents, so this job includes working out some other
-non-patented format and compression method.
-@end ignore
-
-@item
-A program to play sound distributed in ``Real Audio'' format, if only
-because there is a large corpus of data encoded in this format.  We
-ask that you encode audio data in Ogg/Vorbis format since it is
-publically documented and there are Free Software encoders and
-decoders available.
-
-@ignore
-@c we do NOT want to provide software to encode data into proprietary secret formats.  People should use ogg/vorbis or another well-documented format instead
-@item
-A program to generate ``Real Audio'' format from audio input.
-@end ignore
-
-@item
-Programs to handle audio in RTSP format.
-
-@ignore  @c Software patents have made this domain off limits to free software.
-@item
-An MPEG III audio encoder/decoder (but it is necessary to check, first,
-whether patents make this impossible).
-
-@c Chris Hofstader is working on a non-Festival speech-generation program.
-@c Mario Lang <lang@zid.tu-graz.ac.at> reports that Festival needs only
-@c to be 2-5 times faster to work well with Emacspeak.
-@item
-Speech-generation programs that are faster than the Festival engine.
-This might be done by optimizing Festival.
-
-@c We have a project now.
-@item
-Speech-recognition programs (single-speaker, disconnected speech is sufficient).
-@end ignore
-
-@item
-A braille translation and formatting system which can convert marked up
-documents into braille.  This should let the user customize the braille
-translation rules; it would be good to divide it into a
-device-independent part plus drivers.  Contact Jason White,
-@email{jasonw@@ariel.ucs.unimelb.EDU.AU}.
-
-@ignore Being done
-@item
-A program to display text word by word, always showing just one word at
-a time.  This method permits much faster reading than ordinary text
-display.  If you want to work on this, contact @email{stutz@@dsl.org} to
-learn more.
-@end ignore
-
-@item
-More scientific mathematical subroutines.
-(A clone of SPSS is being written already.)
-
-@item
-A scientific data collection and processing tool,
-perhaps something like Scientific Workbench and/or Khoros,
-
-@item
-A free replacement for SciRun, which is not free software.
-
-@item
-A program to calculate properties of molecules by solving
-the Schroedinger equation.
-
-
-@ignore
-@c the Koha project appears to satisfy this need.  see www.koha.org
-@c toby 2002-06-21
-
-@item
-Software to replace card catalogs in libraries.
-@end ignore
-
-
-@item
-A simulator for heating and air conditioning systems for buildings.
-
-@ignore
-@c Pat Deegan @email{pat@@psychogenic.com} is working on this.
-@c no URL yet, the status is updated in @file{volunteers}
-
-@item
-A program for voting and tabulating election results.
-
-@end ignore
-
-@ignore
-@c at least 4 GPL program exist for this purpose (one of
-@c which, gramps, has a GNOME UI):
-@c http://www.gnu.org/search/fsd-search.py?q=geneology
-@c 2002-06-27 toby
-
-@item
-A package for editing genealogical records conveniently.
-This could perhaps be done as a Gnome program, or perhaps
-as an Emacs extension.
-
-@end ignore
-
-@ignore
-@c ToutDoux aims to do this.
-@c also Minkowsky (at least simple project management) - toby
-
-@item
-A project-scheduling package that accepts a list of project sub-tasks
-with their interdependencies, and generates Gantt charts and Pert charts
-and all the other standard project progress reports.
-@end ignore
-
-@item
-Grammar and style checking programs.
-
-@item
-A diagnostic program to test a hard disk.
-
-@item
-Optical character recognition programs; especially if suitable for
-scanning documents with multiple fonts and capturing font info as well
-as character codes.  Work is being done on this, but more help is needed.
-
-@c Some of the OCR work being done:
-@c   Luis Cearra <luisjc@lem.eui.upm.es>, http://lem.eui.upm.es/ocre.html
-@c The status of these projects is updated in @file{/gd/gnuorg/volunteers}
-
-@item
-A program to scan a line drawing and convert it to editable Postscript,
-or some other editable format.
-
-@item
-A program to recognize handwriting (we don't believe PocketLinux's
-handwriting capability is ready for non-PocketLinux environments, yet).
-
-
-@item
-A program that can translate from one natural language, into another.
-For example, a program to translate French into English.
-
-@item
-CAD software, such as a vague imitation of Autocad.
-
-@item
-A program to receive data from a serial-line tap to facilitate the
-reverse-engineering of communication protocols.
-
-@item
-A database program designed to store and retrieve patent information.
-
-@item
-A free software package to run on a Palm Pilot in place of its usual
-software, doing more or less the usual jobs.  (Linux, the kernel, has
-apparently been ported, but according to what we hear this port is not
-useful yet.)
-
-@end itemize
-
-@node Languages, Education, Other Projects, Top
-@chapter Programming Languages
-
-Volunteers are needed to write parsers/front ends for languages such as
-Algol 60, Algol 68, PL/I, Cobol, Fortran 90, Delphi, Modula 2, Modula 3,
-RPG, and any other languages designed for compilation, to be used with
-the code generation phases of the GNU C compiler.
-
-@ignore
-@c Fortran status is here so gnu@gnu.org and the volunteer coordinators
-@c don't have to answer the question -len
-@c as of 2002-09 this doesn't work anymore - toby
-You can get the status of the Fortran front end with this command:
-
-@example
-finger -l fortran@@gnu.org
-@end example
-@end ignore
-
-We would like to have translators from various languages into Scheme.
-These languages include TCL, Python, Perl, Java, Javascript, and Rexx.
-Perhaps Clipper as well.
-
-@node Education, Games and Recreations, Languages, Top
-@chapter Education
-
-Programs for studying, teaching or doing administrative tasks in schools.
-See @uref{http://www.gnu.org/education/} for additional information.
-
-@itemize @bullet
-@item
-A program to organize automatically the schedule of a school given
-constraints about teachers, rooms, times, and students.
-
-@item
-A program to edit dance notation (such as labanotation) and display
-dancers moving on the screen.  Gepetto does some of this work.  Contact
-@email{gvc@@gnu.org} if you are interested in helping finish the job.
-
-@end itemize
-
-@node Games and Recreations,  , Education, Top
-@chapter Games and Recreations
-
-Video-oriented games that work with the X window system.
-
-@itemize @bullet
-@item
-Empire (there is a free version but it needs upgrading)
-
-@item
-An ``empire builder'' system that makes it easy to write various kinds of
-simulation games.
-
-@item
-Improve GnuGo @uref{http://www.gnu.org/software/gnugo/gnugo.html}.
-
-@item
-Network servers and clients for board and card games for which such
-software does not yet exist.
-
-@item
-A Hierarchical Task Network package which can be used
-to program play the computer's side in various strategic games.
-
-@item
-A game like Mill/Nine Men's Morris.
-
-@item
-A realistic train-driving simulator.
-
-@item
-Write imitations of some popular video games:
-
-@itemize -
-@item
-Space war, Asteroids, Pong, Columns.
-@item
-Defending cities from missiles.
-@item
-Plane shoots at lots of other planes, tanks, etc.
-@item
-Wizard fights fanciful monsters.
-@ignore Peter Sundling peter.sundling@telia.com expressed interest in this.
-@item
-A golf game.
-@ignore Being done by jhall1@isd.net
-@item
-Program a robot by sticking building blocks together,
-then watch it explore a world.
-@end ignore
-@item
-Biomorph evolution (as in Scientific American and @cite{The Blind
-Watchmaker}).
-@end itemize
-@end itemize
-
-We do not need @code{rogue}, as we have @code{hack}.
-
-
-@bye
-@c  LocalWords:  dir texi lastupdate uref http www org html helpgnu ifinfo ftp
-@c  LocalWords:  dvi hurd toc gvc URL GTK XmHTML xs nl ripley NT com gettext Qt
-@c  LocalWords:  GUI libstdc Docbook SGML libc sed STL Gforth GNUstep TCSH Perl
-@c  LocalWords:  Ghostscript PIC GCC Texinfo grep dc bc ethernet GDB IP CIFS CU
-@c  LocalWords:  SMB SVGA Khoros Automake OpenStep diff roff Smail tron veritas
-@c  LocalWords:  cxref ctrace API LilyPond xephem labanotation LessTif outliner
-@c  LocalWords:  Hypercard morphing SeeMe ICQ Diffie Helman RSA SSLv TLSv GPL
-@c  LocalWords:  OpenBIOS BIOS LILO dbase dbased Harbour harbour WYSIWYG ISBN
-@c  LocalWords:  TruePrint Baecker siff sif cs arizona edu TR ps mt sulaco MP
-@c  LocalWords:  RTSP MPEG jasonw ariel ucs unimelb AU stutz dsl TCL Javascript
-@c  LocalWords:  Rexx GnuGo jhall isd Biomorph regexp eval gd gnuorg
-
-Local variables:
-eval: (add-hook 'write-file-hooks 'time-stamp)
-time-stamp-start: "@set lastupdate "
-time-stamp-end: "$"
-time-stamp-format: "%:b %:d, %:y"
-compile-command: "make just-tasks"
-End:
-
-@ignore
-   arch-tag: 7ed10085-fa7c-47d4-9ed5-39e885603e5c
-@end ignore
--- a/leim/ChangeLog	Thu Jul 07 12:43:14 2005 +0000
+++ b/leim/ChangeLog	Thu Jul 14 08:02:00 2005 +0000
@@ -1,3 +1,8 @@
+2005-07-08  Kenichi Handa  <handa@m17n.org>
+
+	* quail/japanese.el (quail-japanese-kanji-kkc): Fix order of
+	insertion and deletion.
+
 2005-07-04  Lute Kamstra  <lute@gnu.org>
 
 	Update FSF's address in GPL notices.
--- a/leim/quail/japanese.el	Thu Jul 07 12:43:14 2005 +0000
+++ b/leim/quail/japanese.el	Thu Jul 14 08:02:00 2005 +0000
@@ -79,9 +79,9 @@
   (when (= (char-before (overlay-end quail-conv-overlay)) ?n)
     ;; The last char is `n'.  We had better convert it to `$B$s(B'
     ;; before kana-kanji conversion.
-    (goto-char (overlay-end quail-conv-overlay))
-    (delete-char -1)
-    (insert ?$B$s(B))
+    (goto-char (1- (overlay-end quail-conv-overlay)))
+    (insert ?$B$s(B)
+    (delete-char 1))
   (let* ((from (copy-marker (overlay-start quail-conv-overlay)))
 	 (len (- (overlay-end quail-conv-overlay) from)))
     (quail-delete-overlays)
--- a/lib-src/ChangeLog	Thu Jul 07 12:43:14 2005 +0000
+++ b/lib-src/ChangeLog	Thu Jul 14 08:02:00 2005 +0000
@@ -1,3 +1,10 @@
+2005-07-13  Ken Raeburn  <raeburn@gnu.org>
+
+	* pop.c: Don't include des.h (or variants thereof); krb.h will do
+	it.
+	(sendline): Add the \r\n to the line in a temporary buffer, and
+	write it all at once.
+
 2005-07-04  Lute Kamstra  <lute@gnu.org>
 
 	Update FSF's address in GPL notices.
--- a/lib-src/pop.c	Thu Jul 07 12:43:14 2005 +0000
+++ b/lib-src/pop.c	Thu Jul 14 08:02:00 2005 +0000
@@ -76,17 +76,6 @@
 # ifdef HAVE_KRB5_H
 #  include <krb5.h>
 # endif
-# ifdef HAVE_DES_H
-#  include <des.h>
-# else
-#  ifdef HAVE_KERBEROSIV_DES_H
-#   include <kerberosIV/des.h>
-#  else
-#   ifdef HAVE_KERBEROS_DES_H
-#    include <kerberos/des.h>
-#   endif
-#  endif
-# endif
 # ifdef HAVE_KRB_H
 #  include <krb.h>
 # else
@@ -1403,12 +1392,24 @@
 {
 #define SENDLINE_ERROR "Error writing to POP server: "
   int ret;
+  char *buf;
 
-  ret = fullwrite (server->file, line, strlen (line));
-  if (ret >= 0)
-    {				/* 0 indicates that a blank line was written */
-      ret = fullwrite (server->file, "\r\n", 2);
-    }
+  /* Combine the string and the CR-LF into one buffer.  Otherwise, two
+     reasonable network stack optimizations, Nagle's algorithm and
+     delayed acks, combine to delay us a fraction of a second on every
+     message we send.  (Movemail writes line without \r\n, client
+     kernel sends packet, server kernel delays the ack to see if it
+     can combine it with data, movemail writes \r\n, client kernel
+     waits because it has unacked data already in its outgoing queue,
+     client kernel eventually times out and sends.)
+
+     This can be something like 0.2s per command, which can add up
+     over a few dozen messages, and is a big chunk of the time we
+     spend fetching mail from a server close by.  */
+  buf = alloca (strlen (line) + 3);
+  strcpy (buf, line);
+  strcat (buf, "\r\n");
+  ret = fullwrite (server->file, buf, strlen (buf));
 
   if (ret < 0)
     {
--- a/lisp/ChangeLog	Thu Jul 07 12:43:14 2005 +0000
+++ b/lisp/ChangeLog	Thu Jul 14 08:02:00 2005 +0000
@@ -1,3 +1,366 @@
+2005-07-13  Luc Teirlinck  <teirllm@auburn.edu>
+
+	* custom.el (custom-initialize-safe-set)
+	(custom-initialize-safe-default): Doc fixes.
+
+	* frame.el (blink-cursor-mode): Use `custom-initialize-safe-default'
+	and simplify :init-value again.
+
+	* tooltip.el (tooltip-mode): Use `custom-initialize-safe-default'
+	and simplify :init-value again.  Delete autoload.
+
+	* startup.el (command-line): Use `custom-reevaluate-setting' again
+	for tooltip-mode.
+
+	* emacs-lisp/easy-mmode.el (define-minor-mode): Do not override
+	explicitly specified :initialize keyword.
+
+2005-07-13  Juanma Barranquero  <lekktu@gmail.com>
+
+	* allout.el (my-mark-marker, allout-isearch-prior-pos)
+	(allout-unprotected, allout-undo-aggregation, allout-snug-back)
+	(allout-post-command-business, allout-flag-region)
+	(isearch-reenable-font-lock, allout-yank)
+	(allout-insert-latex-header, allout-insert-latex-trailer)
+	(allout-latex-verbatim-quote-curr-line, allout-latexify-exposed)
+	(allout-latex-verb-quote): Fix typos in docstrings.
+	(allout-enwrap-isearch, regexp-sans-escapes): Doc fix.
+	(allout-unprotected, allout-prefix-data):
+	Improve argument/docstring consistency.
+	(allout-chart-subtree): Fix argument spec.
+	(allout-open-topic): Rename `use_sib_bullet' argument to
+	`use-sib-bullet'.  Doc fix.
+
+	* whitespace.el (whitespace-check-buffer-leading)
+	(whitespace-check-buffer-trailing)
+	(whitespace-check-buffer-indent)
+	(whitespace-check-buffer-spacetab)
+	(whitespace-check-buffer-ateol, whitespace-highlighted-space)
+	(whitespace-check-leading-whitespace)
+	(whitespace-check-trailing-whitespace)
+	(whitespace-check-spacetab-whitespace)
+	(whitespace-check-indent-whitespace)
+	(whitespace-check-ateol-whitespace, whitespace-abort-on-error)
+	(whitespace-modes): Fix typos in docstrings.
+	(defgroup, defcustom): Doc fix.
+
+	* winner.el (winner-mode, winner-boring-buffers)
+	(winner-pending-undo-ring): Doc fixes.
+	(winner-ring): Remove unneeded `progn'.
+	(winner-equal): `defsubst' it.
+	(winner-redo): Fix message.
+
+2005-07-13  Kim F. Storm  <storm@cua.dk>
+
+	* simple.el (line-move-1): Always use vertical-motion to
+	do the last (or only) line move to ensure some movement.
+	Undo 2005-06-23 change--don't check for overlays.
+
+2005-07-13  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+	* term/mac-win.el (ccl-encode-mac-roman-font)
+	(ccl-encode-mac-centraleurroman-font)
+	(ccl-encode-mac-cyrillic-font, ccl-encode-mac-symbol-font):
+	(ccl-encode-mac-dingbats-font): Remove check for ASCII.
+	Change charset-id boundary of dimension to ?\xef.
+	(mac-char-fontspec-list): New constant.
+	(fontset-add-mac-fonts): Use it.  Accept non-string `base-family'
+	argument.  Nil uses itself as family in font-spec.  Previous
+	behavior for nil is now provided by non-nil non-string argument.
+	All callers changed.  Add font-specs for Mac fonts to
+	"fontset-default" unless iso8859-1 fonts are installed.
+
+2005-07-13  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* progmodes/sh-script.el (sh-get-indent-info): Only indent
+	a continuation line if the \ is preceded by SPC or TAB.
+	(sh-get-indent-info): Simplify.
+	(sh-mark-init, sh-learn-buffer-indent, sh-add-completer):
+	Use with-current-buffer.
+
+	* font-lock.el (font-lock-fontify-keywords-region): Avoid inf-loops
+	when the matched text is empty.
+
+2005-07-12  Luc Teirlinck  <teirllm@auburn.edu>
+
+	* startup.el (command-line): Revert to previous handling of
+	tooltip-mode.  Explain in comment why the complexity is needed.
+
+	* tooltip.el (tooltip-mode): Revert to previous implementation of
+	its defcustom.
+
+	* frame.el (blink-cursor-mode): Revert to previous implementation
+	of its defcustom.  Update comment.
+
+2005-07-12  Lars Hansen  <larsh@soem.dk>
+
+	* desktop.el: Update e-mail address.
+
+2005-07-12  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+	* term/mac-win.el (mac-services-mail-selection)
+	(mac-services-mail-to): New functions.
+	(mac-application-menu-map): Bind them.
+
+2005-07-12  wulei <milton@wulei.net>  (tiny change)
+
+	* progmodes/gdb-ui.el: Add note about buffering with Windows.
+
+2005-07-11  Luc Teirlinck  <teirllm@auburn.edu>
+
+	* custom.el (custom-reevaluate-setting): Doc fix.
+
+2005-07-11  Jay Belanger  <belanger@truman.edu>
+
+	* calc/calc.el (calc-embedded-announce-formula-alist)
+	(calc-embedded-open-close-plain-alist)
+	(calc-embedded-open-close-mode-alist): Add checks for additional
+	major modes (due to Robert J. Chassell <bob@rattlesnake.com>).
+
+2005-07-11  Juanma Barranquero  <lekktu@gmail.com>
+
+	* custom.el (custom-enable-theme): Don't add theme to
+	`custom-enabled-themes' with `push' because there is no
+	setf-method for `delq'.
+
+2005-07-11  Richard M. Stallman  <rms@gnu.org>
+
+	* custom.el (custom-declare-variable): Doc fix.
+
+	* dired-aux.el (dired-compare-directories): Remove "." and ".."
+	from the alists.
+
+	* emacs-lisp/edebug.el (edebug-slow-after, edebug-slow-before):
+	Do nothing if edebug-active.
+
+	* emacs-lisp/edebug.el (edebug-enter): Don't with-timeout-suspend here.
+	(edebug-display): Do it here instead.
+
+2005-07-10  Richard M. Stallman  <rms@gnu.org>
+
+	* cus-face.el (custom-theme-set-faces): Make it work.
+	(custom-reset-faces): Doc fix.
+	(custom-theme-reset-internal-face, custom-theme-face-value):
+	Functions deleted.
+
+	* custom.el (custom-push-theme): Maintain list of the settings
+	of a given theme in its theme-settings property.
+	Maintain position of old settings in the theme-value
+	or theme-face property.
+	(custom-enabled-themes): New variable.
+	(custom-theme-enabled-p): New function.
+	(provide-theme): Update custom-enabled-themes.
+	Disable and reenable the `user' theme.
+	(require-theme): Doc fix.
+	(custom-do-theme-reset, custom-remove-theme): Functions deleted.
+	(custom-theme-value, custom-theme-variable-value): Likewise.
+	(custom-theme-reset-internal): Likewise.
+	(custom-theme-load-themes): Fix bugs and use custom-disable-theme.
+	(custom-enable-theme, custom-disable-theme): New functions.
+	(custom-variable-theme-value, custom-face-theme-value): Likewise.
+	(custom-theme-recalc-variable, custom-theme-recalc-face): Likewise.
+	(custom-theme-reset-variables): Simplify.
+	(deftheme, custom-declare-theme, custom-make-theme-feature):
+	Definitions moved.
+
+2005-07-10  Chong Yidong  <cyd@stupidchicken.com>
+
+	* longlines.el (longlines-show-region)
+	(longlines-unshow-hard-newlines): Recognize hard newlines by
+	non-nil hard property, instead of t.
+
+2005-07-10  Michael Kifer  <kifer@cs.stonybrook.edu>
+
+	* viper-cmd.el (viper--key-maps): New variable.
+	(viper-normalize-minor-mode-map-alist): Use viper--key-maps and
+	emulation-mode-map-alists.
+	(viper-envelop-ESC-key): Use viper-subseq.
+	(viper-search-forward/backward/next): Disable debug-on-error.
+
+	* viper-keym.el (viper-toggle-key, viper-quoted-insert-key)
+	(viper-ESC-key): New defcustoms.
+
+	* viper-macs.el (ex-map-read-args): Use viper-subseq.
+
+	* viper-util.el (viper-key-to-emacs-key): Use viper-subseq.
+	(viper-subseq): Copy of subseq from cl.el.
+
+	* viper.el (viper-go-away, viper-set-hooks): Use
+	emulation-mode-map-alists, advise self-insert-command, add-minor-mode.
+
+	* viper-mous.el (viper-current-frame-saved): Use defvar.
+
+	* viper-init.el: Get rid of -face in face names.
+
+	* ediff-diff.el (ediff-extract-diffs, ediff-extract-diffs3):
+	Make it work with longlines mode
+
+	* ediff-mult.el (ediff-meta-mode-hook): New variable.
+
+	* ediff-ptch.el (ediff-file-name-sans-prefix): Quote regexp.
+
+	* ediff-init: Get rid of -face in face names.
+
+2005-07-10  Richard M. Stallman  <rms@gnu.org>
+
+	* emacs-lisp/edebug.el (edebug-enter): Call with-timeout-suspend
+	and with-timeout-unsuspend.
+
+	* emacs-lisp/debug.el (debug): Call with-timeout-suspend
+	and with-timeout-unsuspend.
+
+	* emacs-lisp/timer.el (with-timeout-timers): New variable.
+	(with-timeout): Bind that variable to record timers.
+	(with-timeout-suspend, with-timeout-unsuspend): New functions.
+
+	* emacs-lisp/debug.el (debug-help-follow): New function.
+	(debugger-mode-map): Use that instead of help-follow.
+	(debugger-setup-buffer): Use eval-buffer-list
+	to handle eval-buffer frames.
+
+2005-07-10  N. Raghavendra  <raghu@mri.ernet.in>  (tiny change)
+
+	* timezone.el (timezone-parse-date): Change first regexp
+	so it will not mistakenly match dates with no time zone.
+
+2005-07-10  Jeff Dwork  <jeff.dwork@amd.com>  (tiny change)
+
+	* facemenu.el (facemenu-read-color): Do case-insensitive matching.
+
+2005-07-10  Luc Teirlinck  <teirllm@auburn.edu>
+
+	* custom.el (custom-initialize-safe-set)
+	(custom-initialize-safe-default): New functions.
+
+	* frame.el (blink-cursor-mode): Use `custom-initialize-safe-default'
+	and simplify :init-value.
+
+	* tooltip.el (tooltip-mode): Use `custom-initialize-safe-default'
+	and simplify :init-value.  Delete obsolete comment.
+
+	* startup.el (command-line): Use `custom-reevaluate-setting' to
+	handle `tooltip-mode'.  Delete obsolete comment.
+
+	* files.el (set-visited-file-name): Avoid calling
+	`file-name-nondirectory' with a nil argument.
+
+2005-07-09  Richard M. Stallman  <rms@gnu.org>
+
+	* emacs-lisp/debug.el (debugger-setup-buffer): When eval-buffer
+	was called with nil for the buffer, handle the read position right.
+	Handle read position for eval-region, too.
+
+2005-07-09  Juri Linkov  <juri@jurta.org>
+
+	* fringe.el (fringe-mode): Add period in docstring.
+	(fringe-query-style): Build prompt depending on `all-frames' arg.
+
+	* dired.el (dired-marker-char): Avoid quotations for `do' and `mark'
+	to not create links to unrelated functions in the Help buffer.
+
+	* progmodes/compile.el (compilation-mode-hook, compilation-mode):
+	Doc fix.
+
+	* simple.el (next-error-hook): New variable.
+	(next-error): Use it.  Doc fix.
+
+	* textmodes/ispell.el (ispell-command-loop): Add current
+	dictionary name and program name to mode-line-format.
+	(ispell-region, ispell-process-line): Add current dictionary name
+	and program name to messages.
+
+2005-07-08  Jay Belanger  <belanger@truman.edu>
+
+	* calc/calc.el (calc-embedded-announce-formula-alist)
+	(calc-embedded-open-close-formula-alist)
+	(calc-embedded-open-close-word-alist)
+	(calc-embedded-open-close-plain-alist)
+	(calc-embedded-open-close-new-formula-alist)
+	(calc-embedded-open-close-mode-alist)
+	(calc-embedded-new-buffer-hook, calc-embedded-new-formula-hook)
+	(calc-embedded-mode-hook): New variables.
+
+	* calc/calc-embed.el (calc-embedded-firsttime)
+	(calc-embedded-firsttime-buf, calc-embedded-firsttime-formula):
+	New variables.
+	(calc-do-embedded): Use calc-embedded-firsttime,
+	calc-embedded-firsttime-buf and calc-embedded-firsttime-formula to
+	determine whether or not to run hooks.
+	(calc-embedded-make-info) Set calc-embedded-firsttime-buf and
+	calc-embedded-firsttime-formula appropriately.
+	Set calc-embedded delimiter variables according to mode.
+
+2005-07-08  Richard M. Stallman  <rms@gnu.org>
+
+	* emacs-lisp/checkdoc.el (checkdoc-proper-noun-list):
+	Check for "emacs", etc., as entire symbol, not just as word.
+	(checkdoc-file-comments-engine): Use regexp-quote on FN.
+
+	* files.el (set-visited-file-name): Report the error
+	for "empty filename" earlier.
+	(kill-some-buffers): Ignore buffers already dead.
+
+	* fringe.el (fringe-mode): Doc fix.
+
+	* emacs-lisp/bytecomp.el (byte-compile-maybe-guarded):
+	Check for (featurep 'xemacs) and turn off warnings in what it guards.
+	Use unwind-protect to ensure byte-compile-unresolved-functions
+	is updated.
+
+	* whitespace.el (whitespace-buffer-leading-cleanup):
+	Simplify w/ skip-chars-forward.
+	(whitespace-buffer-trailing-cleanup): Simplify w/ skip-chars-backward.
+
+	* mail/rmail.el (rmail-only-expunge): Fix paren error.
+	Unconditionally try to leave point at the same old place.
+
+2005-07-08  Ralf Angeli  <angeli@iwi.uni-sb.de>  (tiny change)
+
+	* comint.el (comint-postoutput-scroll-to-bottom)
+	(comint-show-maximum-output): Take scroll-margin into consideration.
+
+2005-07-08  Kim F. Storm  <storm@cua.dk>
+
+	* ido.el (ido-use-filename-at-point): New choice `guess'.
+	(ido-file-internal): Try ffap-guesser if selected.
+
+	* ido.el (ido-before-fallback-functions): New hook.
+	(ido-buffer-internal, ido-file-internal, ido-read-buffer)
+	(ido-read-file-name): Run it.
+
+2005-07-07  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* progmodes/hideif.el (hide-ifdef-use-define-alist): Pass a list of
+	strings rather than a list of symbols to the completion function.
+
+2005-07-07  Jay Belanger  <belanger@truman.edu>
+
+	* calc/calc-units.el (math-apply-units):  Change the places in
+	which units are simplified.
+
+2005-07-07  Luc Teirlinck  <teirllm@auburn.edu>
+
+	* cus-edit.el (customize-option, customize-option-other-window):
+	Make them handle aliases.
+
+	* custom.el (custom-variable-p): Make it recursively follow
+	aliases.  Mention that in the docstring.
+
+2005-07-07  Richard M. Stallman  <rms@gnu.org>
+
+	* cus-start.el (exec-path): Use `directory' instead of `file'.
+	Fix tag for nil.
+
+2005-07-07  Juanma Barranquero  <lekktu@gmail.com>
+
+	* replace.el (occur-rename-buffer): Use `generate-new-buffer' also
+	when called non-interactively.  Doc fix.
+
+2005-07-07  Lute Kamstra  <lute@gnu.org>
+
+	* elide-head.el (elide-head-headers-to-hide): Recognize the FSF's
+	new address as well.
+
 2005-07-07  Nick Roberts  <nickrob@snap.net.nz>
 
 	* progmodes/gud.el: Require font-lock for displaying errors.
--- a/lisp/allout.el	Thu Jul 07 12:43:14 2005 +0000
+++ b/lisp/allout.el	Thu Jul 14 08:02:00 2005 +0000
@@ -868,7 +868,7 @@
 (make-variable-buffer-local 'allout-pre-was-isearching)
 ;;;_   = allout-isearch-prior-pos nil
 (defvar allout-isearch-prior-pos nil
-  "Cue for isearch-dynamic-exposure tracking, used by allout-isearch-expose.")
+  "Cue for isearch-dynamic-exposure tracking, used by `allout-isearch-expose'.")
 (make-variable-buffer-local 'allout-isearch-prior-pos)
 ;;;_   = allout-isearch-did-quit
 (defvar allout-isearch-did-quit nil
@@ -887,16 +887,16 @@
 It's automatically reset to nil after every buffer modification.")
 (make-variable-buffer-local 'allout-override-protect)
 ;;;_   > allout-unprotected (expr)
-(defmacro allout-unprotected (expr)
-  "Evaluate EXPRESSION with `allout-override-protect' let-bound t."
+(defmacro allout-unprotected (expression)
+  "Evaluate EXPRESSION with `allout-override-protect' let-bound to t."
   `(let ((allout-override-protect t))
-     ,expr))
+     ,expression))
 ;;;_   = allout-undo-aggregation
 (defvar allout-undo-aggregation 30
   "Amount of successive self-insert actions to bunch together per undo.
 
 This is purely a kludge variable, regulating the compensation for a bug in
-the way that before-change-functions and undo interact.")
+the way that `before-change-functions' and undo interact.")
 (make-variable-buffer-local 'allout-undo-aggregation)
 ;;;_   = file-var-bug hack
 (defvar allout-v18/19-file-var-hack nil
@@ -1407,12 +1407,12 @@
   "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)
+(defmacro allout-prefix-data (beginning end)
   "Register allout-prefix state data - BEGINNING and END of prefix.
 
 For reference by `allout-recent' funcs.  Returns BEGINNING."
   `(setq allout-recent-prefix-end ,end
-         allout-recent-prefix-beginning ,beg))
+         allout-recent-prefix-beginning ,beginning))
 ;;;_  > allout-recent-depth ()
 (defmacro allout-recent-depth ()
   "Return depth of last heading encountered by an outline maneuvering function.
@@ -1632,7 +1632,7 @@
 The chart for a topics' offspring precedes the entry for the topic
 itself.
 
-\(fn &optional levels)"
+\(fn &optional LEVELS)"
 
   ;; The other function parameters are for internal recursion, and should
   ;; not be specified by external callers.  ORIG-DEPTH is depth of topic at
@@ -1999,7 +1999,7 @@
   )
 ;;;_   > allout-snug-back ()
 (defun allout-snug-back ()
-  "Position cursor at end of previous topic
+  "Position cursor at end of previous topic.
 
 Presumes point is at the start of a topic prefix."
  (if (or (bobp) (eobp))
@@ -2249,8 +2249,8 @@
 - Implement (and clear) `allout-post-goto-bullet', for hot-spot
   outline commands.
 
-- Massages buffer-undo-list so successive, standard character self-inserts are
-  aggregated.  This kludge compensates for lack of undo bunching when
+- Massages `buffer-undo-list' so successive, standard character self-inserts
+  are aggregated.  This kludge compensates for lack of undo bunching when
   `before-change-functions' is used."
 
 					; Apply any external change func:
@@ -2379,7 +2379,7 @@
 
 ;;;_   > allout-flag-region (from to flag)
 (defmacro allout-flag-region (from to flag)
-  "Hide or show lines from FROM to TO, via Emacs selective-display FLAG char.
+  "Hide or show lines from FROM to TO, via Emacs `selective-display' FLAG char.
 Ie, text following flag C-m \(carriage-return) is hidden until the
 next C-j (newline) char.
 
@@ -2421,7 +2421,7 @@
   (setq allout-isearch-did-quit nil))
 ;;;_   > allout-enwrap-isearch ()
 (defun allout-enwrap-isearch ()
-  "Impose `allout-mode' isearch-abort wrapper for dynamic exposure in isearch.
+  "Impose `isearch-abort' wrapper for dynamic exposure in isearch.
 
 The function checks to ensure that the rebinding is done only once."
 
@@ -2469,7 +2469,7 @@
 	    font-lock-mode nil)))
 (add-hook 'isearch-mode-hook 'isearch-inhibit-font-lock)
 (defun isearch-reenable-font-lock ()
-  "Reenable font-lock after isearching - for use on isearch-mode-end-hook."
+  "Reenable font-lock after isearching - for use on `isearch-mode-end-hook'."
   (if (and (boundp 'font-lock-mode) font-lock-mode)
       (if (and (allout-mode-p) isearch-was-font-locking)
 	  (setq isearch-was-font-locking nil
@@ -2671,15 +2671,15 @@
                                    ((allout-sibling-index))))))
     )
   )
-;;;_   > allout-open-topic (relative-depth &optional before use_sib_bullet)
-(defun allout-open-topic (relative-depth &optional before use_sib_bullet)
+;;;_   > allout-open-topic (relative-depth &optional before use-sib-bullet)
+(defun allout-open-topic (relative-depth &optional before use-sib-bullet)
   "Open a new topic at depth RELATIVE-DEPTH.
 
 New topic is situated after current one, unless optional flag BEFORE
 is non-nil, or unless current line is complete empty (not even
 whitespace), in which case open is done on current line.
 
-If USE_SIB_BULLET is true, use the bullet of the prior sibling.
+If USE-SIB-BULLET is true, use the bullet of the prior sibling.
 
 Nuances:
 
@@ -2821,7 +2821,7 @@
     ;;(if doing-beginning (save-excursion (newline (if dbl-space 2 1))))
 
 
-    (allout-rebullet-heading (and use_sib_bullet ref-bullet);;; solicit
+    (allout-rebullet-heading (and use-sib-bullet ref-bullet);;; solicit
                               depth			     ;;; depth
                               nil 			     ;;; number-control
                               nil			     ;;; index
@@ -3439,8 +3439,8 @@
 Numbering of yanked topics, and the successive siblings at the depth
 into which they're being yanked, is adjusted.
 
-`allout-yank-pop' works with `allout-yank' just like normal yank-pop
-works with normal yank in non-outline buffers."
+`allout-yank-pop' works with `allout-yank' just like normal `yank-pop'
+works with normal `yank' in non-outline buffers."
 
   (interactive "*P")
   (setq this-command 'yank)
@@ -4365,9 +4365,9 @@
 ;;;_  - LaTeX formatting
 ;;;_   > allout-latex-verb-quote (string &optional flow)
 (defun allout-latex-verb-quote (string &optional flow)
-  "Return copy of STRING for literal reproduction across latex processing.
+  "Return copy of STRING for literal reproduction across LaTeX processing.
 Expresses the original characters \(including carriage returns) of the
-string across latex processing."
+string across LaTeX processing."
   (mapconcat (function
 	      (lambda (char)
 		(cond ((memq char '(?\\ ?$ ?% ?# ?& ?{ ?} ?_ ?^ ?- ?*))
@@ -4378,10 +4378,10 @@
 	     ""))
 ;;;_   > allout-latex-verbatim-quote-curr-line ()
 (defun allout-latex-verbatim-quote-curr-line ()
-  "Express line for exact \(literal) representation across latex processing.
+  "Express line for exact \(literal) representation across LaTeX processing.
 
 Adjust line contents so it is unaltered \(from the original line)
-across latex processing, within the context of a `verbatim'
+across LaTeX processing, within the context of a `verbatim'
 environment.  Leaves point at the end of the line."
   (beginning-of-line)
   (let ((beg (point))
@@ -4397,7 +4397,7 @@
       (goto-char (1+ (match-end 0))))))
 ;;;_   > allout-insert-latex-header (buffer)
 (defun allout-insert-latex-header (buffer)
-  "Insert initial latex commands at point in BUFFER."
+  "Insert initial LaTeX commands at point in BUFFER."
   ;; Much of this is being derived from the stuff in appendix of E in
   ;; the TeXBook, pg 421.
   (set-buffer buffer)
@@ -4471,7 +4471,7 @@
 	    )))
 ;;;_   > allout-insert-latex-trailer (buffer)
 (defun allout-insert-latex-trailer (buffer)
-  "Insert concluding latex commands at point in BUFFER."
+  "Insert concluding LaTeX commands at point in BUFFER."
   (set-buffer buffer)
   (insert "\n\\end{document}\n"))
 ;;;_   > allout-latexify-one-item (depth prefix bullet text)
@@ -4526,7 +4526,7 @@
       )))
 ;;;_   > allout-latexify-exposed (arg &optional tobuf)
 (defun allout-latexify-exposed (arg &optional tobuf)
-  "Format current topics exposed portions to TOBUF for latex processing.
+  "Format current topics exposed portions to TOBUF for LaTeX processing.
 TOBUF defaults to a buffer named the same as the current buffer, but
 with \"*\" prepended and \" latex-formed*\" appended.
 
@@ -4640,7 +4640,8 @@
 Representations of actual backslashes - '\\\\\\\\' - are left as a
 single backslash.
 
-Optional arg SUCCESSIVE-BACKSLASHES is used internally for recursion."
+\(fn REGEXP)"
+;; Optional arg SUCCESSIVE-BACKSLASHES is used internally for recursion.
 
   (if (string= regexp "")
       ""
@@ -4683,7 +4684,7 @@
 		 (cons function (symbol-value hook)))))))
 ;;;_  : my-mark-marker to accommodate divergent emacsen:
 (defun my-mark-marker (&optional force buffer)
-  "Accommodate the different signature for mark-marker across Emacsen.
+  "Accommodate the different signature for `mark-marker' across Emacsen.
 
 XEmacs takes two optional args, while GNU Emacs does not,
 so pass them along when appropriate."
--- a/lisp/calc/calc-embed.el	Thu Jul 07 12:43:14 2005 +0000
+++ b/lisp/calc/calc-embed.el	Thu Jul 14 08:02:00 2005 +0000
@@ -200,6 +200,11 @@
 (defvar calc-embed-arg)
 
 (defvar calc-embedded-quiet nil)
+
+(defvar calc-embedded-firsttime)
+(defvar calc-embedded-firsttime-buf)
+(defvar calc-embedded-firsttime-formula)
+
 (defun calc-do-embedded (calc-embed-arg end obeg oend)
   (if calc-embedded-info
 
@@ -251,6 +256,9 @@
     (let ((modes (list mode-line-buffer-identification
 		       (current-local-map)
 		       truncate-lines))
+          (calc-embedded-firsttime (not calc-embedded-active))
+          (calc-embedded-firsttime-buf nil)
+          (calc-embedded-firsttime-formula nil)
 	  calc-embed-top calc-embed-bot calc-embed-outer-top calc-embed-outer-bot
 	  info chg ident)
       (barf-if-buffer-read-only)
@@ -297,6 +305,12 @@
         (unless (equal str mode-line-buffer-identification)
           (setq mode-line-buffer-identification str)
           (set-buffer-modified-p (buffer-modified-p))))
+      (if calc-embedded-firsttime
+          (run-hooks 'calc-embedded-mode-hook))
+      (if calc-embedded-firsttime-buf
+          (run-hooks 'calc-embedded-new-buffer-hook))
+      (if calc-embedded-firsttime-formula
+          (run-hooks 'calc-embedded-new-formula-hook))
       (or (eq calc-embedded-quiet t)
 	  (message "Embedded Calc mode enabled; %s to return to normal"
 		   (if calc-embedded-quiet
@@ -792,14 +806,52 @@
 	 (new-info nil)
 	 info str)
     (or found
-	(setq found (list (current-buffer))
-	      calc-embedded-active (cons found calc-embedded-active)))
+        (and
+         (setq found (list (current-buffer))
+               calc-embedded-active (cons found calc-embedded-active)
+               calc-embedded-firsttime-buf t)
+         (let ((newann (assoc major-mode calc-embedded-announce-formula-alist))
+               (newform (assoc major-mode calc-embedded-open-close-formula-alist))
+               (newword (assoc major-mode calc-embedded-open-close-word-alist))
+               (newplain (assoc major-mode calc-embedded-open-close-plain-alist))
+               (newnewform 
+                (assoc major-mode calc-embedded-open-close-new-formula-alist))
+               (newmode (assoc major-mode calc-embedded-open-close-mode-alist)))
+           (when newann
+             (make-local-variable 'calc-embedded-announce-formula)
+             (setq calc-embedded-announce-formula (cdr newann)))
+           (when newform
+             (make-local-variable 'calc-embedded-open-formula)
+             (make-local-variable 'calc-embedded-close-formula)
+             (setq calc-embedded-open-formula (nth 0 (cdr newform)))
+             (setq calc-embedded-close-formula (nth 1 (cdr newform))))
+           (when newword
+             (make-local-variable 'calc-embedded-open-word)
+             (make-local-variable 'calc-embedded-close-word)
+             (setq calc-embedded-open-word (nth 0 (cdr newword)))
+             (setq calc-embedded-close-word (nth 1 (cdr newword))))
+           (when newplain
+             (make-local-variable 'calc-embedded-open-plain)
+             (make-local-variable 'calc-embedded-close-plain)
+             (setq calc-embedded-open-plain (nth 0 (cdr newplain)))
+             (setq calc-embedded-close-plain (nth 1 (cdr newplain))))
+           (when newnewform
+             (make-local-variable 'calc-embedded-open-new-formula)
+             (make-local-variable 'calc-embedded-close-new-formula)
+             (setq calc-embedded-open-new-formula (nth 0 (cdr newnewform)))
+             (setq calc-embedded-close-new-formula (nth 1 (cdr newnewform))))
+           (when newmode
+             (make-local-variable 'calc-embedded-open-mode)
+             (make-local-variable 'calc-embedded-close-mode)
+             (setq calc-embedded-open-mode (nth 0 (cdr newmode)))
+             (setq calc-embedded-close-mode (nth 1 (cdr newmode)))))))
     (while (and (cdr found)
 		(> point (aref (car (cdr found)) 3)))
       (setq found (cdr found)))
     (if (and (cdr found)
 	     (>= point (aref (nth 1 found) 2)))
-	(setq info (nth 1 found))
+        (setq info (nth 1 found))
+      (setq calc-embedded-firsttime-formula t)
       (setq info (make-vector 16 nil)
 	    new-info t
 	    fresh t)
--- a/lisp/calc/calc-units.el	Thu Jul 07 12:43:14 2005 +0000
+++ b/lisp/calc/calc-units.el	Thu Jul 14 08:02:00 2005 +0000
@@ -810,10 +810,10 @@
 	    (mapcar 'math-to-standard-rec (cdr expr))))))
 
 (defun math-apply-units (expr units ulist &optional pure)
+  (setq expr (math-simplify-units expr))
   (if ulist
       (let ((new 0)
 	    value)
-	(setq expr (math-simplify-units expr))
 	(or (math-numberp expr)
 	    (error "Incompatible units"))
 	(while (cdr ulist)
@@ -826,9 +826,9 @@
 		ulist (cdr ulist)))
 	(math-add new (math-mul (math-div expr (nth 1 (car ulist)))
 				(car (car ulist)))))
-    (math-simplify-units (if pure
-			     expr
-			   (list '* expr units)))))
+    (if pure
+        expr
+      (math-simplify-units (list '* expr units)))))
 
 (defvar math-decompose-units-cache nil)
 (defun math-decompose-units (units)
--- a/lisp/calc/calc.el	Thu Jul 07 12:43:14 2005 +0000
+++ b/lisp/calc/calc.el	Thu Jul 14 08:02:00 2005 +0000
@@ -241,6 +241,23 @@
   :group 'calc
   :type '(regexp))
 
+(defcustom calc-embedded-announce-formula-alist
+  '((c++-mode     . "//Embed\n\\(// .*\n\\)*")
+    (c-mode       . "/\\*Embed\\*/\n\\(/\\* .*\\*/\n\\)*")
+    (f90-mode     . "!Embed\n\\(! .*\n\\)*")
+    (fortran-mode . "C Embed\n\\(C .*\n\\)*")
+    (html-helper-mode . "<!-- Embed -->\n\\(<!-- .* -->\n\\)*")
+    (html-mode    . "<!-- Embed -->\n\\(<!-- .* -->\n\\)*")
+    (nroff-mode   . "\\\\\"Embed\n\\(\\\\\" .*\n\\)*")
+    (pascal-mode  . "{Embed}\n\\({.*}\n\\)*")
+    (sgml-mode    . "<!-- Embed -->\n\\(<!-- .* -->\n\\)*")
+    (xml-mode     . "<!-- Embed -->\n\\(<!-- .* -->\n\\)*")
+    (texinfo-mode . "@c Embed\n\\(@c .*\n\\)*"))
+  "*Alist of major modes with appropriate values for `calc-embedded-announce-formula'."
+  :group 'calc
+  :type '(alist :key-type (symbol :tag "Major mode")
+                :value-type (regexp :tag "Regexp to announce formula")))
+
 (defcustom calc-embedded-open-formula 
   "\\`\\|^\n\\|\\$\\$?\\|\\\\\\[\\|^\\\\begin[^{].*\n\\|^\\\\begin{.*[^x]}.*\n\\|^@.*\n\\|^\\.EQ.*\n\\|\\\\(\\|^%\n\\|^\\.\\\\\"\n"
   "*A regular expression for the opening delimiter of a formula used by calc-embedded."
@@ -253,6 +270,14 @@
   :group 'calc
   :type '(regexp))
 
+(defcustom calc-embedded-open-close-formula-alist
+  nil
+  "*Alist of major modes with pairs of formula delimiters used by calc-embedded."
+  :group 'calc
+  :type '(alist :key-type (symbol :tag "Major mode")
+                :value-type (list (regexp :tag "Opening formula delimiter")
+                                  (regexp :tag "Closing formula delimiter"))))
+
 (defcustom calc-embedded-open-word 
   "^\\|[^-+0-9.eE]"
   "*A regular expression for the opening delimiter of a formula used by calc-embedded-word."
@@ -265,6 +290,14 @@
   :group 'calc
   :type '(regexp))
 
+(defcustom calc-embedded-open-close-word-alist
+  nil
+  "*Alist of major modes with pairs of word delimiters used by calc-embedded."
+  :group 'calc
+  :type '(alist :key-type (symbol :tag "Major mode")
+                :value-type (list (regexp :tag "Opening word delimiter")
+                                  (regexp :tag "Closing word delimiter"))))
+
 (defcustom calc-embedded-open-plain 
   "%%% "
   "*A string which is the opening delimiter for a \"plain\" formula.
@@ -280,6 +313,24 @@
   :group 'calc
   :type '(string))
 
+(defcustom calc-embedded-open-close-plain-alist
+  '((c++-mode     "// %% "   " %%\n")
+    (c-mode       "/* %% "   " %% */\n")
+    (f90-mode     "! %% "    " %%\n")
+    (fortran-mode "C %% "    " %%\n")
+    (html-helper-mode "<!-- %% " " %% -->\n")
+    (html-mode "<!-- %% " " %% -->\n")
+    (nroff-mode   "\\\" %% " " %%\n")
+    (pascal-mode  "{%% "    " %%}\n")
+    (sgml-mode     "<!-- %% " " %% -->\n")
+    (xml-mode     "<!-- %% " " %% -->\n")
+    (texinfo-mode "@c %% "   " %%\n"))
+  "*Alist of major modes with pairs of delimiters for \"plain\" formulas."
+  :group 'calc
+  :type '(alist :key-type (symbol :tag "Major mode")
+                :value-type (list (string :tag "Opening \"plain\" delimiter")
+                                  (string :tag "Closing \"plain\" delimiter"))))
+
 (defcustom calc-embedded-open-new-formula 
   "\n\n"
   "*A string which is inserted at front of formula by calc-embedded-new-formula."
@@ -292,6 +343,14 @@
   :group 'calc
   :type '(string))
 
+(defcustom calc-embedded-open-close-new-formula-alist
+  nil
+  "*Alist of major modes with pairs of new formula delimiters used by calc-embedded."
+  :group 'calc
+  :type '(alist :key-type (symbol :tag "Major mode")
+                :value-type (list (string :tag "Opening new formula delimiter")
+                                  (string :tag "Closing new formula delimiter"))))
+
 (defcustom calc-embedded-open-mode 
   "% "
   "*A string which should precede calc-embedded mode annotations.
@@ -306,6 +365,24 @@
   :group 'calc
   :type '(string))
 
+(defcustom calc-embedded-open-close-mode-alist
+  '((c++-mode     "// "   "\n")
+    (c-mode       "/* "   " */\n")
+    (f90-mode     "! "    "\n")
+    (fortran-mode "C "    "\n")
+    (html-helper-mode "<!-- " " -->\n")
+    (html-mode    "<!-- " " -->\n")
+    (nroff-mode   "\\\" " "\n")
+    (pascal-mode  "{ "    " }\n")
+    (sgml-mode    "<!-- " " -->\n")
+    (xml-mode     "<!-- " " -->\n")
+    (texinfo-mode "@c "   "\n"))
+  "*Alist of major modes with pairs of strings to delimit annotations."
+  :group 'calc
+  :type '(alist :key-type (symbol :tag "Major mode")
+                :value-type (list (string :tag "Opening annotation delimiter")
+                                  (string :tag "Closing annotation delimiter"))))
+
 (defcustom calc-gnuplot-name 
   "gnuplot"
   "*Name of GNUPLOT program, for calc-graph features."
@@ -726,6 +803,15 @@
 (defvar calc-trail-window-hook nil
   "Hook called to create the Calc trail window.")
 
+(defvar calc-embedded-new-buffer-hook nil
+  "Hook run when starting embedded mode in a new buffer.")
+
+(defvar calc-embedded-new-formula-hook nil
+  "Hook run when starting embedded mode in a new formula.")
+
+(defvar calc-embedded-mode-hook nil
+  "Hook run when starting embedded mode.")
+
 ;; Verify that Calc is running on the right kind of system.
 (defvar calc-emacs-type-lucid (not (not (string-match "Lucid" emacs-version))))
 
--- a/lisp/comint.el	Thu Jul 07 12:43:14 2005 +0000
+++ b/lisp/comint.el	Thu Jul 14 08:02:00 2005 +0000
@@ -1818,7 +1818,7 @@
 			      (= (point) (point-max)))
 			 (save-excursion
 			   (goto-char (point-max))
-			   (recenter -1)))
+			   (recenter (- -1 scroll-margin))))
 		     (select-window selected)))))
 	     nil t))
       (set-buffer current))))
@@ -1852,7 +1852,7 @@
   "Put the end of the buffer at the bottom of the window."
   (interactive)
   (goto-char (point-max))
-  (recenter -1))
+  (recenter (- -1 scroll-margin)))
 
 (defun comint-get-old-input-default ()
   "Default for `comint-get-old-input'.
--- a/lisp/cus-edit.el	Thu Jul 07 12:43:14 2005 +0000
+++ b/lisp/cus-edit.el	Thu Jul 14 08:02:00 2005 +0000
@@ -1021,9 +1021,12 @@
 (defun customize-option (symbol)
   "Customize SYMBOL, which must be a user option variable."
   (interactive (custom-variable-prompt))
-  (custom-buffer-create (list (list symbol 'custom-variable))
-			(format "*Customize Option: %s*"
-				(custom-unlispify-tag-name symbol))))
+  (let ((basevar (indirect-variable symbol)))
+    (custom-buffer-create (list (list basevar 'custom-variable))
+			  (format "*Customize Option: %s*"
+				  (custom-unlispify-tag-name basevar)))
+    (unless (eq symbol basevar)
+      (message "`%s' is an alias for `%s'" symbol basevar))))
 
 ;;;###autoload
 (defalias 'customize-variable-other-window 'customize-option-other-window)
@@ -1033,9 +1036,12 @@
   "Customize SYMBOL, which must be a user option variable.
 Show the buffer in another window, but don't select it."
   (interactive (custom-variable-prompt))
-  (custom-buffer-create-other-window
-   (list (list symbol 'custom-variable))
-   (format "*Customize Option: %s*" (custom-unlispify-tag-name symbol))))
+  (let ((basevar (indirect-variable symbol)))
+    (custom-buffer-create-other-window
+     (list (list basevar 'custom-variable))
+     (format "*Customize Option: %s*" (custom-unlispify-tag-name basevar)))
+    (unless (eq symbol basevar)
+      (message "`%s' is an alias for `%s'" symbol basevar))))
 
 (defvar customize-changed-options-previous-release "20.2"
   "Version for `customize-changed-options' to refer back to by default.")
--- a/lisp/cus-face.el	Thu Jul 07 12:43:14 2005 +0000
+++ b/lisp/cus-face.el	Thu Jul 14 08:02:00 2005 +0000
@@ -345,53 +345,27 @@
 	(setq args (cdr (cdr args))))))))
 
 ;;;###autoload
-(defun custom-theme-face-value (face theme)
-  "Return spec of FACE in THEME if THEME modifies FACE.
-Value is nil otherwise.  The association between theme and spec for FACE
-is stored in FACE's property `theme-face'.  The appropriate face
-is retrieved using `custom-theme-value'."
-  ;; Returns car because the value is stored inside a one element list
-  (car-safe (custom-theme-value theme (get face 'theme-face))))
+(defun custom-theme-reset-faces (theme &rest args)
+  "Reset the specs in THEME of some faces to their specs in other themes.
+Each of the arguments ARGS has this form:
 
-(defun custom-theme-reset-internal-face (face to-theme)
-  "Reset FACE to the value defined by TO-THEME.
-If FACE is not defined in TO-THEME, reset FACE to the standard
-value.  See `custom-theme-face-value'.  The standard value is
-stored in SYMBOL's property `face-defface-spec' by `defface'."
-  (let ((spec (custom-theme-face-value face to-theme))
-	was-in-theme)
-    (setq was-in-theme spec)
-    (setq spec (or spec (get face 'face-defface-spec)))
-    (when spec
-      (put face 'save-face was-in-theme)
-      (when (or (get face 'force-face) (facep face))
-	      (unless (facep face)
-		(make-empty-face face))
-	      (face-spec-set face spec)))
-    spec))
+    (FACE FROM-THEME)
 
-;;;###autoload
-(defun custom-theme-reset-faces (theme &rest args)
-  "Reset the value of the face to values previously defined.
-Associate this setting with THEME.
-
-ARGS is a list of lists of the form
-
-    (FACE TO-THEME)
-
-This means reset FACE to its value in TO-THEME."
+This means reset FACE to its value in FROM-THEME."
   (custom-check-theme theme)
-  (mapcar '(lambda (arg)
-	     (apply 'custom-theme-reset-internal-face arg)
-	     (custom-push-theme 'theme-face (car arg) theme 'reset (cadr arg)))
-	  args))
+  (dolist (arg args)
+    (custom-push-theme 'theme-face (car arg) theme 'reset (cadr arg))))
 
 ;;;###autoload
 (defun custom-reset-faces (&rest args)
-  "Reset the value of the face to values previously saved.
-This is the setting assosiated the `user' theme.
+  "Reset the specs of some faces to their specs in specified themes.
+This creates settings in the `user' theme.
 
-ARGS is defined as for `custom-theme-reset-faces'"
+Each of the arguments ARGS has this form:
+
+    (FACE FROM-THEME)
+
+This means reset FACE to its value in FROM-THEME."
   (apply 'custom-theme-reset-faces 'user args))
 
 ;;; The End.
--- a/lisp/cus-start.el	Thu Jul 07 12:43:14 2005 +0000
+++ b/lisp/cus-start.el	Thu Jul 14 08:02:00 2005 +0000
@@ -77,8 +77,8 @@
 	     ;; callproc.c
 	     (shell-file-name execute file)
 	     (exec-path execute
-			(repeat (choice (const :tag "default" nil)
-					(file :format "%v"))))
+			(repeat (choice (const :tag "default directory" nil)
+					(directory :format "%v"))))
 	     ;; charset.c
 	     (charset-map-path installation
 			       (repeat (directory :format "%v")))
--- a/lisp/custom.el	Thu Jul 07 12:43:14 2005 +0000
+++ b/lisp/custom.el	Thu Jul 14 08:02:00 2005 +0000
@@ -76,6 +76,28 @@
 		 (eval (car (get symbol 'saved-value)))
 	       (eval value)))))
 
+(defun custom-initialize-safe-set (symbol value)
+  "Like `custom-initialize-set', but catches errors.
+If an error occurs during initialization, SYMBOL is set to nil
+and no error is thrown.  This is meant for use in pre-loaded files
+where some variables or functions used to compute VALUE may not yet
+be defined.  You can then re-evaluate VALUE in startup.el, for instance
+using `custom-reevaluate-setting'."
+  (condition-case nil
+      (custom-initialize-set symbol value)
+    (error (set-default symbol nil))))
+
+(defun custom-initialize-safe-default (symbol value)
+  "Like `custom-initialize-default', but catches errors.
+If an error occurs during initialization, SYMBOL is set to nil
+and no error is thrown.  This is meant for use in pre-loaded files
+where some variables or functions used to compute VALUE may not yet
+be defined.  You can then re-evaluate VALUE in startup.el, for instance
+using `custom-reevaluate-setting'."
+  (condition-case nil
+      (custom-initialize-default symbol value)
+    (error (set-default symbol nil))))
+
 (defun custom-initialize-reset (symbol value)
   "Initialize SYMBOL based on VALUE.
 Set the symbol, using its `:set' function (or `set-default' if it has none).
@@ -115,14 +137,9 @@
 DEFAULT should be an expression to evaluate to compute the default value,
 not the default value itself.
 
-DEFAULT is stored as SYMBOL's value in the standard theme.  See
-`custom-known-themes' for a list of known themes.  For backwards
-compatibility, DEFAULT is also stored in SYMBOL's property
+DEFAULT is stored as SYMBOL's standard value, in SYMBOL's property
 `standard-value'.  At the same time, SYMBOL's property `force-value' is
 set to nil, as the value is no longer rogue."
-  ;; Remember the standard setting.  The value should be in the standard
-  ;; theme, not in this property.  However, this would require changing
-  ;; the C source of defvar and others as well...
   (put symbol 'standard-value (list default))
   ;; Maybe this option was rogue in an earlier version.  It no longer is.
   (when (get symbol 'force-value)
@@ -518,7 +535,9 @@
 
 ;; This test is also in the C code of `user-variable-p'.
 (defun custom-variable-p (variable)
-  "Return non-nil if VARIABLE is a custom variable."
+  "Return non-nil if VARIABLE is a custom variable.
+This recursively follows aliases."
+  (setq variable (indirect-variable variable))
   (or (get variable 'standard-value)
       (get variable 'custom-autoload)))
 
@@ -560,7 +579,7 @@
 	      ;; and it is not in load-history yet.
 	      ((equal load "cus-edit"))
 	      (t (condition-case nil (load load) (error nil))))))))
-
+
 (defvar custom-known-themes '(user standard)
    "Themes that have been defined with `deftheme'.
 The default value is the list (user standard).  The theme `standard'
@@ -569,95 +588,6 @@
 Additional themes declared with the `deftheme' macro will be added to
 the front of this list.")
 
-(defun custom-declare-theme (theme feature &optional doc &rest args)
-  "Like `deftheme', but THEME is evaluated as a normal argument.
-FEATURE is the feature this theme provides.  This symbol is created
-from THEME by `custom-make-theme-feature'."
-  (add-to-list 'custom-known-themes theme)
-  (put theme 'theme-feature feature)
-  (when doc
-    (put theme 'theme-documentation doc))
-  (while args
-    (let ((arg (car args)))
-      (setq args (cdr args))
-      (unless (symbolp arg)
-	(error "Junk in args %S" args))
-      (let ((keyword arg)
-	    (value (car args)))
-	(unless args
-	  (error "Keyword %s is missing an argument" keyword))
-	(setq args (cdr args))
-	(cond ((eq keyword :short-description)
-	       (put theme 'theme-short-description value))
-	      ((eq keyword :immediate)
-	       (put theme 'theme-immediate value))
-	      ((eq keyword :variable-set-string)
-	       (put theme 'theme-variable-set-string value))
-	      ((eq keyword :variable-reset-string)
-	       (put theme 'theme-variable-reset-string value))
-	      ((eq keyword :face-set-string)
-	       (put theme 'theme-face-set-string value))
-	      ((eq keyword :face-reset-string)
-	       (put theme 'theme-face-reset-string value)))))))
-
-(defmacro deftheme (theme &optional doc &rest args)
-  "Declare custom theme THEME.
-The optional argument DOC is a doc string describing the theme.
-The remaining arguments should have the form
-
-   [KEYWORD VALUE]...
-
-The following KEYWORD's are defined:
-
-:short-description
-	VALUE is a short (one line) description of the theme.  If not
-	given, DOC is used.
-:immediate
-	If VALUE is non-nil, variables specified in this theme are set
-	immediately when loading the theme.
-:variable-set-string
-	VALUE is a string used to indicate that a variable takes its
-	setting from this theme.  It is passed to FORMAT with the name
-	of the theme as an additional argument.  If not given, a
-	generic description is used.
-:variable-reset-string
-	VALUE is a string used in the case a variable has been forced
-	to its value in this theme.  It is passed to FORMAT with the
-	name of the theme as an additional argument.  If not given, a
-	generic description is used.
-:face-set-string
-	VALUE is a string used to indicate that a face takes its
-	setting from this theme.  It is passed to FORMAT with the name
-	of the theme as an additional argument.  If not given, a
-	generic description is used.
-:face-reset-string
-	VALUE is a string used in the case a face has been forced to
-	its value in this theme.  It is passed to FORMAT with the name
-	of the theme as an additional argument.  If not given, a
-	generic description is used.
-
-Any theme `foo' should be defined in a file called `foo-theme.el';
-see `custom-make-theme-feature' for more information."
-  (let ((feature (custom-make-theme-feature theme)))
-    ;; It is better not to use backquote in this file,
-    ;; because that makes a bootstrapping problem
-    ;; if you need to recompile all the Lisp files using interpreted code.
-    (nconc (list 'custom-declare-theme
-		 (list 'quote theme)
-		 (list 'quote feature)
-		 doc) args)))
-
-(defun custom-make-theme-feature (theme)
-  "Given a symbol THEME, create a new symbol by appending \"-theme\".
-Store this symbol in the `theme-feature' property of THEME.
-Calling `provide-theme' to provide THEME actually puts `THEME-theme'
-into `features'.
-
-This allows for a file-name convention for autoloading themes:
-Every theme X has a property `provide-theme' whose value is \"X-theme\".
-\(require-theme X) then attempts to load the file `X-theme.el'."
-  (intern (concat (symbol-name theme) "-theme")))
-
 (defsubst custom-theme-p (theme)
   "Non-nil when THEME has been defined."
   (memq theme custom-known-themes))
@@ -670,13 +600,15 @@
 ;;; Initializing.
 
 (defun custom-push-theme (prop symbol theme mode value)
-  "Add (THEME MODE VALUE) to the list in property PROP of SYMBOL.
-If the first element in that list is already (THEME ...),
-discard it first.
+  "Record a value for face or variable SYMBOL in custom theme THEME.
+PROP is`theme-face' for a face, `theme-value' for a variable.
+The value is specified by (THEME MODE VALUE), which is interpreted
+by `custom-theme-value'.
 
 MODE can be either the symbol `set' or the symbol `reset'.  If it is the
 symbol `set', then VALUE is the value to use.  If it is the symbol
-`reset', then VALUE is the mode to query instead.
+`reset', then VALUE is another theme, whose value for this face or
+variable should be used.
 
 In the following example for the variable `goto-address-url-face', the
 theme `subtle-hacker' uses the same value for the variable as the theme
@@ -709,11 +641,20 @@
 The user has not customized the face; had he done that,
 the list would contain an entry for the `user' theme, too.
 See `custom-known-themes' for a list of known themes."
-  (let ((old (get symbol prop)))
-    (if (eq (car-safe (car-safe old)) theme)
-        (setq old (cdr old)))
-    (put symbol prop (cons (list theme mode value) old))))
-
+  (let* ((old (get symbol prop))
+	 (setting (assq theme old)))
+    ;; Alter an existing theme-setting for the symbol,
+    ;; or add a new one.
+    (if setting
+	(progn
+	  (setcar (cdr setting) mode)
+	  (setcar (cddr setting) value))
+      (put symbol prop (cons (list theme mode value) old)))
+    ;; Record, for each theme, all its settings.
+    (put theme 'theme-settings
+	 (cons (list prop symbol theme mode value)
+	       (get theme 'theme-settings)))))
+
 (defvar custom-local-buffer nil
   "Non-nil, in a Customization buffer, means customize a specific buffer.
 If this variable is non-nil, it should be a buffer,
@@ -739,10 +680,10 @@
   (apply 'custom-theme-set-variables 'user args))
 
 (defun custom-reevaluate-setting (symbol)
-  "Reset the value of SYMBOL by re-evaluating its saved or default value.
-This is useful for variables that are defined before their default value
-can really be computed.  E.g. dumped variables whose default depends on
-run-time information."
+  "Reset the value of SYMBOL by re-evaluating its saved or standard value.
+Use the :set function to do so.  This is useful for customizable options
+that are defined before their standard value can really be computed.
+E.g. dumped variables whose default depends on run-time information."
   (funcall (or (get symbol 'custom-set) 'set-default)
 	   symbol
 	   (eval (car (or (get symbol 'saved-value) (get symbol 'standard-value))))))
@@ -922,11 +863,134 @@
       (put symbol 'customized-value nil))
     ;; Changed?
     (not (equal customized (get symbol 'customized-value)))))
+
+;;; Defining themes.
 
-;;; Theme Manipulation
+;; deftheme is used at the beginning of the file that records a theme.
+
+(defmacro deftheme (theme &optional doc &rest args)
+  "Declare custom theme THEME.
+The optional argument DOC is a doc string describing the theme.
+The remaining arguments should have the form
+
+   [KEYWORD VALUE]...
+
+The following KEYWORD's are defined:
+
+:short-description
+	VALUE is a short (one line) description of the theme.  If not
+	given, DOC is used.
+:immediate
+	If VALUE is non-nil, variables specified in this theme are set
+	immediately when loading the theme.
+:variable-set-string
+	VALUE is a string used to indicate that a variable takes its
+	setting from this theme.  It is passed to FORMAT with the name
+	of the theme as an additional argument.  If not given, a
+	generic description is used.
+:variable-reset-string
+	VALUE is a string used in the case a variable has been forced
+	to its value in this theme.  It is passed to FORMAT with the
+	name of the theme as an additional argument.  If not given, a
+	generic description is used.
+:face-set-string
+	VALUE is a string used to indicate that a face takes its
+	setting from this theme.  It is passed to FORMAT with the name
+	of the theme as an additional argument.  If not given, a
+	generic description is used.
+:face-reset-string
+	VALUE is a string used in the case a face has been forced to
+	its value in this theme.  It is passed to FORMAT with the name
+	of the theme as an additional argument.  If not given, a
+	generic description is used.
+
+Any theme `foo' should be defined in a file called `foo-theme.el';
+see `custom-make-theme-feature' for more information."
+  (let ((feature (custom-make-theme-feature theme)))
+    ;; It is better not to use backquote in this file,
+    ;; because that makes a bootstrapping problem
+    ;; if you need to recompile all the Lisp files using interpreted code.
+    (nconc (list 'custom-declare-theme
+		 (list 'quote theme)
+		 (list 'quote feature)
+		 doc)
+	   args)))
+
+(defun custom-declare-theme (theme feature &optional doc &rest args)
+  "Like `deftheme', but THEME is evaluated as a normal argument.
+FEATURE is the feature this theme provides.  This symbol is created
+from THEME by `custom-make-theme-feature'."
+  (add-to-list 'custom-known-themes theme)
+  (put theme 'theme-feature feature)
+  (when doc
+    (put theme 'theme-documentation doc))
+  (while args
+    (let ((arg (car args)))
+      (setq args (cdr args))
+      (unless (symbolp arg)
+	(error "Junk in args %S" args))
+      (let ((keyword arg)
+	    (value (car args)))
+	(unless args
+	  (error "Keyword %s is missing an argument" keyword))
+	(setq args (cdr args))
+	(cond ((eq keyword :short-description)
+	       (put theme 'theme-short-description value))
+	      ((eq keyword :immediate)
+	       (put theme 'theme-immediate value))
+	      ((eq keyword :variable-set-string)
+	       (put theme 'theme-variable-set-string value))
+	      ((eq keyword :variable-reset-string)
+	       (put theme 'theme-variable-reset-string value))
+	      ((eq keyword :face-set-string)
+	       (put theme 'theme-face-set-string value))
+	      ((eq keyword :face-reset-string)
+	       (put theme 'theme-face-reset-string value)))))))
+
+(defun custom-make-theme-feature (theme)
+  "Given a symbol THEME, create a new symbol by appending \"-theme\".
+Store this symbol in the `theme-feature' property of THEME.
+Calling `provide-theme' to provide THEME actually puts `THEME-theme'
+into `features'.
+
+This allows for a file-name convention for autoloading themes:
+Every theme X has a property `provide-theme' whose value is \"X-theme\".
+\(require-theme X) then attempts to load the file `X-theme.el'."
+  (intern (concat (symbol-name theme) "-theme")))
+
+;;; Loading themes.
+
+;; The variable and face settings of a theme are recorded in
+;; the `theme-settings' property of the theme name.
+;; This property's value is a list of elements, each of the form
+;; (PROP SYMBOL THEME MODE VALUE), where PROP is `theme-value' or `theme-face'
+;; and SYMBOL is the face or variable name.
+;; THEME is the theme name itself; that's redundant, but simplifies things.
+;; MODE is `set' or `reset'.
+;; If MODE is `set', then VALUE is an expression that specifies the
+;; theme's setting for SYMBOL.
+;; If MODE is `reset', then VALUE is another theme,
+;; and it means to use the value from that theme.
+
+;; Each variable has a `theme-value' property that describes all the
+;; settings of enabled themes that apply to it.
+;; Each face name has a `theme-face' property that describes all the
+;; settings of enabled themes that apply to it.
+;; The property value is a list of settings, each with the form
+;; (THEME MODE VALUE).  THEME, MODE and VALUE are as above.
+;; Each of these lists is ordered by decreasing theme precedence.
+;; Thus, the first element is always the one that is in effect.
+
+;; Disabling a theme removes its settings from the `theme-value' and
+;; `theme-face' properties, but the theme's own `theme-settings'
+;; property remains unchanged.
+
+;; Loading a theme implicitly enables it.  Enabling a theme adds its
+;; settings to the symbols' `theme-value' and `theme-face' properties,
+;; or moves them to the front of those lists if they're already present.
 
 (defvar custom-loaded-themes nil
-  "Themes in the order they are loaded.")
+  "Custom themes that have been loaded.")
 
 (defcustom custom-theme-directory
   (if (eq system-type 'ms-dos)
@@ -942,26 +1006,43 @@
   :version "22.1")
 
 (defun custom-theme-loaded-p (theme)
-  "Return non-nil when THEME has been loaded."
+  "Return non-nil if THEME has been loaded."
   (memq theme custom-loaded-themes))
 
+(defvar custom-enabled-themes '(user)
+  "Custom themes currently enabled, highest precedence first.
+The first one is always `user'.")
+
+(defun custom-theme-enabled-p (theme)
+  "Return non-nil if THEME is enabled."
+  (memq theme custom-enabled-themes))
+
 (defun provide-theme (theme)
   "Indicate that this file provides THEME.
-Add THEME to `custom-loaded-themes' and `provide' whatever
-is stored in THEME's property `theme-feature'.
+Add THEME to `custom-loaded-themes', and `provide' whatever
+feature name is stored in THEME's property `theme-feature'.
 
-Usually the theme-feature property contains a symbol created
+Usually the `theme-feature' property contains a symbol created
 by `custom-make-theme-feature'."
   (custom-check-theme theme)
   (provide (get theme 'theme-feature))
-  (setq custom-loaded-themes (nconc (list theme) custom-loaded-themes)))
+  (push theme custom-loaded-themes)
+  ;; Loading a theme also installs its settings,
+  ;; so mark it as "enabled".
+  (push theme custom-enabled-themes)
+  ;; `user' must always be the highest-precedence enabled theme.
+  ;; Make that remain true.  (This has the effect of making user settings
+  ;; override the ones just loaded, too.)
+  (custom-enable-theme 'user))
 
 (defun require-theme (theme)
-  "Try to load a theme by requiring its feature.
-THEME's feature is stored in THEME's `theme-feature' property.
+  "Try to load a theme's settings from its file.
+This also enables the theme; use `custom-disable-theme' to disable it."
 
-Usually the `theme-feature' property contains a symbol created
-by `custom-make-theme-feature'."
+  ;; THEME's feature is stored in THEME's `theme-feature' property.
+  ;; Usually the `theme-feature' property contains a symbol created
+  ;; by `custom-make-theme-feature'.
+
   ;; Note we do no check for validity of the theme here.
   ;; This allows to pull in themes by a file-name convention
   (let ((load-path (if (file-directory-p custom-theme-directory)
@@ -969,70 +1050,35 @@
 		     load-path)))
     (require (or (get theme 'theme-feature)
 		 (custom-make-theme-feature theme)))))
-
-(defun custom-remove-theme (spec-alist theme)
-  "Delete all elements from SPEC-ALIST whose car is THEME."
-  (let ((elt (assoc theme spec-alist)))
-    (while elt
-	(setq spec-alist (delete elt spec-alist)
-	      elt (assoc theme spec-alist))))
-  spec-alist)
-
-(defun custom-do-theme-reset (theme)
-  "Undo all settings defined by THEME.
-
-A variable remains unchanged if its property `theme-value' does not
-contain a value for THEME.  A face remains unchanged if its property
-`theme-face' does not contain a value for THEME.  In either case, all
-settings for THEME are removed from the property and the variable or
-face is set to the `user' theme.
-
-See `custom-known-themes' for a list of known themes."
-  (let (spec-list)
-    (mapatoms (lambda (symbol)
-		;; This works even if symbol is both a variable and a
-		;; face.
-                (setq spec-list (get symbol 'theme-value))
-                (when spec-list
-                  (put symbol 'theme-value (custom-remove-theme spec-list theme))
-                  (custom-theme-reset-internal symbol 'user))
-                (setq spec-list (get symbol 'theme-face))
-                (when spec-list
-                  (put symbol 'theme-face (custom-remove-theme spec-list theme))
-                  (custom-theme-reset-internal-face symbol 'user))))))
+
+;;; How to load and enable various themes as part of `user'.
 
 (defun custom-theme-load-themes (by-theme &rest body)
   "Load the themes specified by BODY.
-Record them as required by theme BY-THEME.  BODY is a sequence of either
+Record them as required by theme BY-THEME.
+
+BODY is a sequence of either
 
 THEME
-	BY-THEME requires THEME
+        Load THEME and enable it.
 \(reset THEME)
 	Undo all the settings made by THEME
 \(hidden THEME)
-	Require THEME but hide it from the user
+	Load THEME but do not enable it.
 
 All the themes loaded for BY-THEME are recorded in BY-THEME's property
-`theme-loads-themes'.  Any theme loaded with the hidden predicate will
-be given the property `theme-hidden' unless it has been loaded before.
-Whether a theme has been loaded before is determined by the function
-`custom-theme-loaded-p'."
+`theme-loads-themes'."
   (custom-check-theme by-theme)
-  (let ((theme)
-	(themes-loaded (get by-theme 'theme-loads-themes)))
-    (while theme
-      (setq theme (car body)
-	    body (cdr body))
+  (let ((themes-loaded (get by-theme 'theme-loads-themes)))
+    (dolist (theme body)
       (cond ((and (consp theme) (eq (car theme) 'reset))
-	     (custom-do-theme-reset (cadr theme)))
+	     (custom-disable-theme (cadr theme)))
 	    ((and (consp theme) (eq (car theme) 'hidden))
 	     (require-theme (cadr theme))
-	     (unless (custom-theme-loaded-p (cadr theme))
-	       (put (cadr theme) 'theme-hidden t)))
+	     (custom-disable-theme (cadr theme)))
 	    (t
-	     (require-theme theme)
-	     (put theme 'theme-hidden nil)))
-      (setq themes-loaded (nconc (list theme) themes-loaded)))
+	     (require-theme theme)))
+      (push theme themes-loaded))
     (put by-theme 'theme-loads-themes themes-loaded)))
 
 (defun custom-load-themes (&rest body)
@@ -1040,82 +1086,127 @@
 
 See `custom-theme-load-themes' for more information on BODY."
   (apply 'custom-theme-load-themes 'user body))
+
+;;; Enabling and disabling loaded themes.
 
-; (defsubst copy-upto-last (elt list)
-;   "Copy all the elements of the list upto the last occurence of elt"
-;   ;; Is it faster to do more work in C than to do less in elisp?
-;   (nreverse (cdr (member elt (reverse list)))))
+(defun custom-enable-theme (theme)
+  "Reenable all variable and face settings defined by THEME.
+The newly enabled theme gets the highest precedence (after `user').
+If it is already enabled, just give it highest precedence (after `user')."
+  (let ((settings (get theme 'theme-settings)))
+    (dolist (s settings)
+      (let* ((prop (car s))
+	     (symbol (cadr s))
+	     (spec-list (get symbol prop)))
+	(put symbol prop (cons (cddr s) (assq-delete-all theme spec-list)))
+	(if (eq prop 'theme-value)
+	    (custom-theme-recalc-variable symbol)
+	  (custom-theme-recalc-face symbol)))))
+  (setq custom-enabled-themes
+        (cons theme (delq theme custom-enabled-themes)))
+  ;; `user' must always be the highest-precedence enabled theme.
+  (unless (eq theme 'user)
+    (custom-enable-theme 'user)))
 
-(defun custom-theme-value (theme theme-spec-list)
-  "Determine the value for THEME defined by THEME-SPEC-LIST.
-Returns a list with the original value if found; nil otherwise.
+(defun custom-disable-theme (theme)
+  "Disable all variable and face settings defined by THEME.
+See `custom-known-themes' for a list of known themes."
+  (let ((settings (get theme 'theme-settings)))
+    (dolist (s settings)
+      (let* ((prop (car s))
+	     (symbol (cadr s))
+	     (spec-list (get symbol prop)))
+	(put symbol 'theme-value (assq-delete-all theme spec-list))
+	(if (eq prop 'theme-value)
+	    (custom-theme-recalc-variable symbol)
+	  (custom-theme-recalc-face symbol)))))
+  (setq custom-enabled-themes
+	(delq theme custom-enabled-themes)))
 
-THEME-SPEC-LIST is an alist with themes as its key.  As new themes are
-installed, these are added to the front of THEME-SPEC-LIST.
-Each element has the form
+(defun custom-theme-value (theme setting-list)
+  "Determine the value specified for THEME according to SETTING-LIST.
+Returns a list whose car is the specified value, if we
+find one; nil otherwise.
+
+SETTING-LIST is an alist with themes as its key.
+Each element has the form:
 
   \(THEME MODE VALUE)
 
 MODE is either the symbol `set' or the symbol `reset'.  See
 `custom-push-theme' for more information on the format of
-THEME-SPEC-LIST."
+SETTING-LIST."
   ;; Note we do _NOT_ signal an error if the theme is unknown
   ;; it might have gone away without the user knowing.
-  (let ((value (cdr (assoc theme theme-spec-list))))
-    (if value
-        (if (eq (car value) 'set)
-            (cdr value)
-          (custom-theme-value (cadr value) theme-spec-list)))))
+  (let ((elt (cdr (assoc theme setting-list))))
+    (if elt
+        (if (eq (car elt) 'set)
+            (cdr elt)
+	  ;; `reset' means refer to another theme's value in the same alist.
+          (custom-theme-value (cadr elt) setting-list)))))
+
+(defun custom-variable-theme-value (variable)
+  "Return (list VALUE) indicating the custom theme value of VARIABLE.
+That is to say, it specifies what the value should be according to
+currently enabled custom themes.
 
-(defun custom-theme-variable-value (variable theme)
-  "Return (list value) indicating value of VARIABLE in THEME.
-If THEME does not define a value for VARIABLE, return nil.  The value
-definitions per theme are stored in VARIABLE's property `theme-value'.
-The actual work is done by function `custom-theme-value', which see.
-See `custom-push-theme' for more information on how these definitions
-are stored."
-  (custom-theme-value theme (get variable 'theme-value)))
+This function returns nil if no custom theme specifies a value for VARIABLE."
+  (let* ((theme-value (get variable 'theme-value)))
+    (if theme-value
+	(custom-theme-value (car (car theme-value)) theme-value))))
+
+(defun custom-face-theme-value (face)
+  "Return the face spec of FACE according to currently enabled custom themes.
+This function returns nil if no custom theme specifies anything for FACE."
+  (let* ((theme-value (get face 'theme-face)))
+    (if theme-value
+	(custom-theme-value (car (car theme-value)) theme-value))))
 
-(defun custom-theme-reset-internal (symbol to-theme)
-  "Reset SYMBOL to the value defined by TO-THEME.
-If SYMBOL is not defined in TO-THEME, reset SYMBOL to the standard
-value.  See `custom-theme-variable-value'.  The standard value is
-stored in SYMBOL's property `standard-value'."
-  (let ((value (custom-theme-variable-value symbol to-theme))
-        was-in-theme)
-    (setq was-in-theme value)
-    (setq value (or value (get symbol 'standard-value)))
-    (when value
-      (put symbol 'saved-value was-in-theme)
-      (if (or (get 'force-value symbol) (default-boundp symbol))
-          (funcall (or (get symbol 'custom-set) 'set-default) symbol
-                   (eval (car value)))))
-    value))
+(defun custom-theme-recalc-variable (variable)
+  "Set VARIABLE according to currently enabled custom themes."
+  (let ((valspec (custom-variable-theme-value variable)))
+    (when valspec
+      (put variable 'saved-value valspec))
+    (unless valspec
+      (setq valspec (get variable 'standard-value)))
+    (when valspec
+      (if (or (get 'force-value variable) (default-boundp variable))
+          (funcall (or (get variable 'custom-set) 'set-default) variable
+                   (eval (car valspec)))))))
 
+(defun custom-theme-recalc-face (face)
+  "Set FACE according to currently enabled custom themes."
+  (let ((spec (custom-face-theme-value face)))
+    (when spec
+      (put face 'save-face spec))
+    (unless spec
+      (setq spec (get face 'face-defface-spec)))
+    (when spec
+      (when (or (get face 'force-face) (facep face))
+	(unless (facep face)
+	  (make-empty-face face))
+	(face-spec-set face spec)))))
+
 (defun custom-theme-reset-variables (theme &rest args)
-  "Reset the value of the variables to values previously defined.
-Associate this setting with THEME.
-
-ARGS is a list of lists of the form
+  "Reset the specs in THEME of some variables to their values in other themes.
+Each of the arguments ARGS has this form:
 
-    (VARIABLE TO-THEME)
+    (VARIABLE FROM-THEME)
 
-This means reset VARIABLE to its value in TO-THEME."
+This means reset VARIABLE to its value in FROM-THEME."
   (custom-check-theme theme)
-  (mapcar '(lambda (arg)
-	     (apply 'custom-theme-reset-internal arg)
-	     (custom-push-theme 'theme-value (car arg) theme 'reset (cadr arg)))
-	  args))
+  (dolist (arg args)
+    (custom-push-theme 'theme-value (car arg) theme 'reset (cadr arg))))
 
 (defun custom-reset-variables (&rest args)
-    "Reset the value of the variables to values previously saved.
-This is the setting associated the `user' theme.
+  "Reset the specs of some variables to their values in certain themes.
+This creates settings in the `user' theme.
 
-ARGS is a list of lists of the form
+Each of the arguments ARGS has this form:
 
-    (VARIABLE TO-THEME)
+    (VARIABLE FROM-THEME)
 
-This means reset VARIABLE to its value in TO-THEME."
+This means reset VARIABLE to its value in FROM-THEME."
     (apply 'custom-theme-reset-variables 'user args))
 
 ;;; The End.
--- a/lisp/desktop.el	Thu Jul 07 12:43:14 2005 +0000
+++ b/lisp/desktop.el	Thu Jul 14 08:02:00 2005 +0000
@@ -4,7 +4,7 @@
 ;;   Free Software Foundation, Inc.
 
 ;; Author: Morten Welinder <terra@diku.dk>
-;; Maintainter: Lars Hansen <larsh@math.ku.dk>
+;; Maintainter: Lars Hansen <larsh@soem.dk>
 ;; Keywords: convenience
 ;; Favourite-brand-of-beer: None, I hate beer.
 
--- a/lisp/dired-aux.el	Thu Jul 07 12:43:14 2005 +0000
+++ b/lisp/dired-aux.el	Thu Jul 14 08:02:00 2005 +0000
@@ -126,16 +126,21 @@
   (let* ((dir1 (dired-current-directory))
          (file-alist1 (dired-files-attributes dir1))
          (file-alist2 (dired-files-attributes dir2))
-	 (file-list1 (mapcar
+	 file-list1 file-list2)
+    (setq file-alist1 (delq (assoc "." file-alist1) file-alist1))
+    (setq file-alist1 (delq (assoc ".." file-alist1) file-alist1))
+    (setq file-alist2 (delq (assoc "." file-alist2) file-alist2))
+    (setq file-alist2 (delq (assoc ".." file-alist2) file-alist2))
+    (setq file-list1 (mapcar
 		      'cadr
                       (dired-file-set-difference
                        file-alist1 file-alist2
-		       predicate)))
-	 (file-list2 (mapcar
+		       predicate))
+	  file-list2 (mapcar
 		      'cadr
                       (dired-file-set-difference
                        file-alist2 file-alist1
-		       predicate))))
+		       predicate)))
     (dired-fun-in-all-buffers
      dir1 nil
      (lambda ()
--- a/lisp/dired.el	Thu Jul 07 12:43:14 2005 +0000
+++ b/lisp/dired.el	Thu Jul 14 08:02:00 2005 +0000
@@ -224,7 +224,7 @@
   ;; concentric sets or an order for the marked files.
   ;; The code depends on dynamic scoping on the marker char.
   "In Dired, the current mark character.
-This is what the `do' commands look for and what the `mark' commands store.")
+This is what the do-commands look for, and what the mark-commands store.")
 
 (defvar dired-del-marker ?D
   "Character used to flag files for deletion.")
--- a/lisp/ediff-diff.el	Thu Jul 07 12:43:14 2005 +0000
+++ b/lisp/ediff-diff.el	Thu Jul 14 08:02:00 2005 +0000
@@ -459,24 +459,46 @@
 		   c-prev c-end)
 	   ;; else convert lines to points
 	   (ediff-with-current-buffer A-buffer
-	     (forward-line (- a-begin a-prev))
-	     (setq a-begin-pt (point))
-	     (forward-line (- a-end a-begin))
-	     (setq a-end-pt (point)
-		   a-prev a-end))
+	     (let ((longlines-mode-val
+		    (if (and (boundp 'longlines-mode) longlines-mode) 1 0)))
+	       ;; we must disable and then restore longlines-mode
+	       (if (eq longlines-mode-val 1)
+		   (longlines-mode 0))
+	       (forward-line (- a-begin a-prev))
+	       (setq a-begin-pt (point))
+	       (forward-line (- a-end a-begin))
+	       (setq a-end-pt (point)
+		     a-prev a-end)
+	       (if (eq longlines-mode-val 1)
+		   (longlines-mode longlines-mode-val))
+	       ))
 	   (ediff-with-current-buffer B-buffer
-	     (forward-line (- b-begin b-prev))
-	     (setq b-begin-pt (point))
-	     (forward-line (- b-end b-begin))
-	     (setq b-end-pt (point)
-		   b-prev b-end))
+	     (let ((longlines-mode-val
+		    (if (and (boundp 'longlines-mode) longlines-mode) 1 0)))
+	       (if (eq longlines-mode-val 1)
+		   (longlines-mode 0))
+	       (forward-line (- b-begin b-prev))
+	       (setq b-begin-pt (point))
+	       (forward-line (- b-end b-begin))
+	       (setq b-end-pt (point)
+		     b-prev b-end)
+	       (if (eq longlines-mode-val 1)
+		   (longlines-mode longlines-mode-val))
+	       ))
 	   (if (ediff-buffer-live-p C-buffer)
 	       (ediff-with-current-buffer C-buffer
-		 (forward-line (- c-begin c-prev))
-		 (setq c-begin-pt (point))
-		 (forward-line (- c-end c-begin))
-		 (setq c-end-pt (point)
-		       c-prev c-end)))
+		 (let ((longlines-mode-val
+			(if (and (boundp 'longlines-mode) longlines-mode) 1 0)))
+		   (if (eq longlines-mode-val 1)
+		       (longlines-mode 0))
+		   (forward-line (- c-begin c-prev))
+		   (setq c-begin-pt (point))
+		   (forward-line (- c-end c-begin))
+		   (setq c-end-pt (point)
+			 c-prev c-end)
+		   (if (eq longlines-mode-val 1)
+		       (longlines-mode longlines-mode-val))
+		 )))
 	   (setq diff-list
 		 (nconc
 		  diff-list
@@ -1060,30 +1082,59 @@
 			 c-prev c-end)
 		 ;; else convert lines to points
 		 (ediff-with-current-buffer A-buffer
-		   (forward-line (- a-begin a-prev))
-		   (setq a-begin-pt (point))
-		   (forward-line (- a-end a-begin))
-		   (setq a-end-pt (point)
-			 a-prev a-end))
+		   (let ((longlines-mode-val
+			  (if (and (boundp 'longlines-mode) longlines-mode) 1 0)))
+		     ;; we must disable and then restore longlines-mode
+		     (if (eq longlines-mode-val 1)
+			 (longlines-mode 0))
+		     (forward-line (- a-begin a-prev))
+		     (setq a-begin-pt (point))
+		     (forward-line (- a-end a-begin))
+		     (setq a-end-pt (point)
+			   a-prev a-end)
+		     (if (eq longlines-mode-val 1)
+			 (longlines-mode longlines-mode-val))
+		     ))
 		 (ediff-with-current-buffer B-buffer
-		   (forward-line (- b-begin b-prev))
-		   (setq b-begin-pt (point))
-		   (forward-line (- b-end b-begin))
-		   (setq b-end-pt (point)
-			 b-prev b-end))
+		   (let ((longlines-mode-val
+			  (if (and (boundp 'longlines-mode) longlines-mode) 1 0)))
+		     (if (eq longlines-mode-val 1)
+			 (longlines-mode 0))
+		     (forward-line (- b-begin b-prev))
+		     (setq b-begin-pt (point))
+		     (forward-line (- b-end b-begin))
+		     (setq b-end-pt (point)
+			   b-prev b-end)
+		     (if (eq longlines-mode-val 1)
+			 (longlines-mode longlines-mode-val))
+		     ))
 		 (ediff-with-current-buffer C-buffer
-		   (forward-line (- c-begin c-prev))
-		   (setq c-begin-pt (point))
-		   (forward-line (- c-end c-begin))
-		   (setq c-end-pt (point)
-			 c-prev c-end))
+		   (let ((longlines-mode-val
+			  (if (and (boundp 'longlines-mode) longlines-mode) 1 0)))
+		     (if (eq longlines-mode-val 1)
+			 (longlines-mode 0))
+		     (forward-line (- c-begin c-prev))
+		     (setq c-begin-pt (point))
+		     (forward-line (- c-end c-begin))
+		     (setq c-end-pt (point)
+			   c-prev c-end)
+		     (if (eq longlines-mode-val 1)
+			 (longlines-mode longlines-mode-val))
+		     ))
 		 (if (ediff-buffer-live-p anc-buffer)
 		     (ediff-with-current-buffer anc-buffer
-		       (forward-line (- c-or-anc-begin anc-prev))
-		       (setq anc-begin-pt (point))
-		       (forward-line (- c-or-anc-end c-or-anc-begin))
-		       (setq anc-end-pt (point)
-			     anc-prev c-or-anc-end)))
+		       (let ((longlines-mode-val
+			      (if (and (boundp 'longlines-mode) longlines-mode) 1 0)))
+			 (if (eq longlines-mode-val 1)
+			     (longlines-mode 0))
+			 (forward-line (- c-or-anc-begin anc-prev))
+			 (setq anc-begin-pt (point))
+			 (forward-line (- c-or-anc-end c-or-anc-begin))
+			 (setq anc-end-pt (point)
+			       anc-prev c-or-anc-end)
+			 (if (eq longlines-mode-val 1)
+			     (longlines-mode longlines-mode-val))
+			 )))
 		 (setq diff-list
 		       (nconc
 			diff-list
@@ -1425,6 +1476,5 @@
 ;;; eval: (put 'ediff-with-current-buffer 'edebug-form-spec '(form body))
 ;;; End:
 
-
 ;;; arch-tag: a86d448e-58d7-4572-a1d9-fdedfa22f648
 ;;; ediff-diff.el ends here
--- a/lisp/ediff-init.el	Thu Jul 07 12:43:14 2005 +0000
+++ b/lisp/ediff-init.el	Thu Jul 14 08:02:00 2005 +0000
@@ -854,10 +854,10 @@
 
 ;; A-list of current-diff-face-* symbols associated with buf types
 (defconst ediff-current-diff-face-alist
-  '((A . ediff-current-diff-face-A)
-    (B . ediff-current-diff-face-B)
-    (C . ediff-current-diff-face-C)
-    (Ancestor . ediff-current-diff-face-Ancestor)))
+  '((A . ediff-current-diff-A)
+    (B . ediff-current-diff-B)
+    (C . ediff-current-diff-C)
+    (Ancestor . ediff-current-diff-Ancestor)))
 
 
 (defun ediff-set-overlay-face (extent face)
@@ -915,8 +915,6 @@
       (t	     	     (:inverse-video t))))
   "Face for highlighting the selected difference in buffer A."
   :group 'ediff-highlighting)
-;; backward-compatibility alias
-(put 'ediff-current-diff-face-A 'face-alias 'ediff-current-diff-A)
 ;; An internal variable.  Ediff takes the face from here.  When unhighlighting,
 ;; this variable is set to nil, then again to the appropriate face.
 (defvar ediff-current-diff-face-A 'ediff-current-diff-A
@@ -924,13 +922,13 @@
 DO NOT CHANGE this variable.  Instead, use the customization
 widget to customize the actual face object `ediff-current-diff-A'
 this variable represents.")
-(ediff-hide-face 'ediff-current-diff-A)
+(ediff-hide-face ediff-current-diff-face-A)
 ;; Until custom.el for XEmacs starts supporting :inverse-video we do this.
 ;; This means that some user customization may be trashed.
 (if (and ediff-xemacs-p
 	 (ediff-has-face-support-p)
 	 (not (ediff-color-display-p)))
-    (copy-face 'modeline 'ediff-current-diff-A))
+    (copy-face 'modeline ediff-current-diff-face-A))
 
 
 
@@ -948,8 +946,6 @@
       (t	     	     (:inverse-video t))))
   "Face for highlighting the selected difference in buffer B."
   :group 'ediff-highlighting)
-;; backward-compatibility alias
-(put 'ediff-current-diff-face-B 'face-alias 'ediff-current-diff-B)
 ;; An internal variable.  Ediff takes the face from here.  When unhighlighting,
 ;; this variable is set to nil, then again to the appropriate face.
 (defvar ediff-current-diff-face-B 'ediff-current-diff-B
@@ -957,13 +953,13 @@
  this variable.  Instead, use the customization
 widget to customize the actual face `ediff-current-diff-B'
 this variable represents.")
-(ediff-hide-face 'ediff-current-diff-B)
+(ediff-hide-face ediff-current-diff-face-B)
 ;; Until custom.el for XEmacs starts supporting :inverse-video we do this.
 ;; This means that some user customization may be trashed.
 (if (and ediff-xemacs-p
 	 (ediff-has-face-support-p)
 	 (not (ediff-color-display-p)))
-    (copy-face 'modeline 'ediff-current-diff-B))
+    (copy-face 'modeline ediff-current-diff-face-B))
 
 
 (defface ediff-current-diff-C
@@ -978,8 +974,6 @@
       (t	     	     (:inverse-video t))))
   "Face for highlighting the selected difference in buffer C."
   :group 'ediff-highlighting)
-;; backward-compatibility alias
-(put 'ediff-current-diff-face-C 'face-alias 'ediff-current-diff-C)
 ;; An internal variable.  Ediff takes the face from here.  When unhighlighting,
 ;; this variable is set to nil, then again to the appropriate face.
 (defvar ediff-current-diff-face-C 'ediff-current-diff-C
@@ -987,13 +981,13 @@
 DO NOT CHANGE this variable.  Instead, use the customization
 widget to customize the actual face object `ediff-current-diff-C'
 this variable represents.")
-(ediff-hide-face 'ediff-current-diff-C)
+(ediff-hide-face ediff-current-diff-face-C)
 ;; Until custom.el for XEmacs starts supporting :inverse-video we do this.
 ;; This means that some user customization may be trashed.
 (if (and ediff-xemacs-p
 	 (ediff-has-face-support-p)
 	 (not (ediff-color-display-p)))
-    (copy-face 'modeline 'ediff-current-diff-C))
+    (copy-face 'modeline ediff-current-diff-face-C))
 
 
 (defface ediff-current-diff-Ancestor
@@ -1008,8 +1002,6 @@
       (t (:inverse-video t))))
   "Face for highlighting the selected difference in buffer Ancestor."
   :group 'ediff-highlighting)
-;; backward-compatibility alias
-(put 'ediff-current-diff-face-Ancestor 'face-alias 'ediff-current-diff-Ancestor)
 ;; An internal variable.  Ediff takes the face from here.  When unhighlighting,
 ;; this variable is set to nil, then again to the appropriate face.
 (defvar ediff-current-diff-face-Ancestor 'ediff-current-diff-Ancestor
@@ -1017,13 +1009,13 @@
 DO NOT CHANGE this variable.  Instead, use the customization
 widget to customize the actual face object `ediff-current-diff-Ancestor'
 this variable represents.")
-(ediff-hide-face 'ediff-current-diff-Ancestor)
+(ediff-hide-face ediff-current-diff-face-Ancestor)
 ;; Until custom.el for XEmacs starts supporting :inverse-video we do this.
 ;; This means that some user customization may be trashed.
 (if (and ediff-xemacs-p
 	 (ediff-has-face-support-p)
 	 (not (ediff-color-display-p)))
-    (copy-face 'modeline 'ediff-current-diff-Ancestor))
+    (copy-face 'modeline ediff-current-diff-face-Ancestor))
 
 
 (defface ediff-fine-diff-A
@@ -1038,8 +1030,6 @@
       (t (:underline t :stipple "gray3"))))
   "Face for highlighting the refinement of the selected diff in buffer A."
   :group 'ediff-highlighting)
-;; backward-compatibility alias
-(put 'ediff-fine-diff-face-A 'face-alias 'ediff-fine-diff-A)
 ;; An internal variable.  Ediff takes the face from here.  When unhighlighting,
 ;; this variable is set to nil, then again to the appropriate face.
 (defvar ediff-fine-diff-face-A 'ediff-fine-diff-A
@@ -1047,7 +1037,7 @@
 DO NOT CHANGE this variable.  Instead, use the customization
 widget to customize the actual face object `ediff-fine-diff-A'
 this variable represents.")
-(ediff-hide-face 'ediff-fine-diff-A)
+(ediff-hide-face ediff-fine-diff-face-A)
 
 (defface ediff-fine-diff-B
   (if ediff-emacs-p
@@ -1061,8 +1051,6 @@
       (t	     	     (:underline t :stipple "gray3"))))
   "Face for highlighting the refinement of the selected diff in buffer B."
   :group 'ediff-highlighting)
-;; backward-compatibility alias
-(put 'ediff-fine-diff-face-B 'face-alias 'ediff-fine-diff-B)
 ;; An internal variable.  Ediff takes the face from here.  When unhighlighting,
 ;; this variable is set to nil, then again to the appropriate face.
 (defvar ediff-fine-diff-face-B 'ediff-fine-diff-B
@@ -1070,7 +1058,7 @@
 DO NOT CHANGE this variable.  Instead, use the customization
 widget to customize the actual face object `ediff-fine-diff-B'
 this variable represents.")
-(ediff-hide-face 'ediff-fine-diff-B)
+(ediff-hide-face ediff-fine-diff-face-B)
 
 (defface ediff-fine-diff-C
   (if ediff-emacs-p
@@ -1089,8 +1077,6 @@
       (t (:underline t :stipple "gray3"))))
   "Face for highlighting the refinement of the selected diff in buffer C."
   :group 'ediff-highlighting)
-;; backward-compatibility alias
-(put 'ediff-fine-diff-face-C 'face-alias 'ediff-fine-diff-C)
 ;; An internal variable.  Ediff takes the face from here.  When unhighlighting,
 ;; this variable is set to nil, then again to the appropriate face.
 (defvar ediff-fine-diff-face-C 'ediff-fine-diff-C
@@ -1098,7 +1084,7 @@
 DO NOT CHANGE this variable.  Instead, use the customization
 widget to customize the actual face object `ediff-fine-diff-C'
 this variable represents.")
-(ediff-hide-face 'ediff-fine-diff-C)
+(ediff-hide-face ediff-fine-diff-face-C)
 
 (defface ediff-fine-diff-Ancestor
   (if ediff-emacs-p
@@ -1114,8 +1100,6 @@
 At present, this face is not used and no fine differences are computed for the
 ancestor buffer."
   :group 'ediff-highlighting)
-;; backward-compatibility alias
-(put 'ediff-fine-diff-face-Ancestor 'face-alias 'ediff-fine-diff-Ancestor)
 ;; An internal variable.  Ediff takes the face from here.  When unhighlighting,
 ;; this variable is set to nil, then again to the appropriate face.
 (defvar ediff-fine-diff-face-Ancestor 'ediff-fine-diff-Ancestor
@@ -1123,7 +1107,7 @@
 DO NOT CHANGE this variable.  Instead, use the customization
 widget to customize the actual face object `ediff-fine-diff-Ancestor'
 this variable represents.")
-(ediff-hide-face 'ediff-fine-diff-Ancestor)
+(ediff-hide-face ediff-fine-diff-face-Ancestor)
 
 ;; Some installs don't have stipple or Stipple. So, try them in turn.
 (defvar stipple-pixmap
@@ -1151,8 +1135,6 @@
       (t	     	     (:italic t :stipple ,stipple-pixmap))))
   "Face for highlighting even-numbered non-current differences in buffer A."
   :group 'ediff-highlighting)
-;; backward-compatibility alias
-(put 'ediff-even-diff-face-A 'face-alias 'ediff-even-diff-A)
 ;; An internal variable.  Ediff takes the face from here.  When unhighlighting,
 ;; this variable is set to nil, then again to the appropriate face.
 (defvar ediff-even-diff-face-A 'ediff-even-diff-A
@@ -1160,7 +1142,7 @@
 DO NOT CHANGE this variable.  Instead, use the customization
 widget to customize the actual face object `ediff-even-diff-A'
 this variable represents.")
-(ediff-hide-face 'ediff-even-diff-A)
+(ediff-hide-face ediff-even-diff-face-A)
 
 (defface ediff-even-diff-B
   (if ediff-emacs-p
@@ -1174,8 +1156,6 @@
       (t	     	     (:italic t :stipple ,stipple-pixmap))))
   "Face for highlighting even-numbered non-current differences in buffer B."
   :group 'ediff-highlighting)
-;; backward-compatibility alias
-(put 'ediff-even-diff-face-B 'face-alias 'ediff-even-diff-B)
 ;; An internal variable.  Ediff takes the face from here.  When unhighlighting,
 ;; this variable is set to nil, then again to the appropriate face.
 (defvar ediff-even-diff-face-B 'ediff-even-diff-B
@@ -1183,7 +1163,7 @@
 DO NOT CHANGE this variable.  Instead, use the customization
 widget to customize the actual face object `ediff-even-diff-B'
 this variable represents.")
-(ediff-hide-face 'ediff-even-diff-B)
+(ediff-hide-face ediff-even-diff-face-B)
 
 (defface ediff-even-diff-C
   (if ediff-emacs-p
@@ -1202,8 +1182,6 @@
       (t	     	     (:italic t :stipple ,stipple-pixmap))))
   "Face for highlighting even-numbered non-current differences in buffer C."
   :group 'ediff-highlighting)
-;; backward-compatibility alias
-(put 'ediff-even-diff-face-C 'face-alias 'ediff-even-diff-C)
 ;; An internal variable.  Ediff takes the face from here.  When unhighlighting,
 ;; this variable is set to nil, then again to the appropriate face.
 (defvar ediff-even-diff-face-C 'ediff-even-diff-C
@@ -1211,7 +1189,7 @@
 DO NOT CHANGE this variable.  Instead, use the customization
 widget to customize the actual face object `ediff-even-diff-C'
 this variable represents.")
-(ediff-hide-face 'ediff-even-diff-C)
+(ediff-hide-face ediff-even-diff-face-C)
 
 (defface ediff-even-diff-Ancestor
   (if ediff-emacs-p
@@ -1230,8 +1208,6 @@
       (t (:italic t :stipple ,stipple-pixmap))))
   "Face for highlighting even-numbered non-current differences in the ancestor buffer."
   :group 'ediff-highlighting)
-;; backward-compatibility alias
-(put 'ediff-even-diff-face-Ancestor 'face-alias 'ediff-even-diff-Ancestor)
 ;; An internal variable.  Ediff takes the face from here.  When unhighlighting,
 ;; this variable is set to nil, then again to the appropriate face.
 (defvar ediff-even-diff-face-Ancestor 'ediff-even-diff-Ancestor
@@ -1239,7 +1215,7 @@
 DO NOT CHANGE this variable.  Instead, use the customization
 widget to customize the actual face object `ediff-even-diff-Ancestor'
 this variable represents.")
-(ediff-hide-face 'ediff-even-diff-Ancestor)
+(ediff-hide-face ediff-even-diff-face-Ancestor)
 
 ;; Association between buffer types and even-diff-face symbols
 (defconst ediff-even-diff-face-alist
@@ -1263,8 +1239,6 @@
       (t	     	     (:italic t :stipple "gray1"))))
   "Face for highlighting odd-numbered non-current differences in buffer A."
   :group 'ediff-highlighting)
-;; backward-compatibility alias
-(put 'ediff-odd-diff-face-A 'face-alias 'ediff-odd-diff-A)
 ;; An internal variable.  Ediff takes the face from here.  When unhighlighting,
 ;; this variable is set to nil, then again to the appropriate face.
 (defvar ediff-odd-diff-face-A 'ediff-odd-diff-A
@@ -1272,7 +1246,7 @@
 DO NOT CHANGE this variable.  Instead, use the customization
 widget to customize the actual face object `ediff-odd-diff-A'
 this variable represents.")
-(ediff-hide-face 'ediff-odd-diff-A)
+(ediff-hide-face ediff-odd-diff-face-A)
 
 
 (defface ediff-odd-diff-B
@@ -1290,8 +1264,6 @@
       (t	     	     (:italic t :stipple "gray1"))))
   "Face for highlighting odd-numbered non-current differences in buffer B."
   :group 'ediff-highlighting)
-;; backward-compatibility alias
-(put 'ediff-odd-diff-face-B 'face-alias 'ediff-odd-diff-B)
 ;; An internal variable.  Ediff takes the face from here.  When unhighlighting,
 ;; this variable is set to nil, then again to the appropriate face.
 (defvar ediff-odd-diff-face-B 'ediff-odd-diff-B
@@ -1299,7 +1271,7 @@
 DO NOT CHANGE this variable.  Instead, use the customization
 widget to customize the actual face object `ediff-odd-diff-B'
 this variable represents.")
-(ediff-hide-face 'ediff-odd-diff-B)
+(ediff-hide-face ediff-odd-diff-face-B)
 
 (defface ediff-odd-diff-C
   (if ediff-emacs-p
@@ -1316,8 +1288,6 @@
       (t	     	     (:italic t :stipple "gray1"))))
   "Face for highlighting odd-numbered non-current differences in buffer C."
   :group 'ediff-highlighting)
-;; backward-compatibility alias
-(put 'ediff-odd-diff-face-C 'face-alias 'ediff-odd-diff-C)
 ;; An internal variable.  Ediff takes the face from here.  When unhighlighting,
 ;; this variable is set to nil, then again to the appropriate face.
 (defvar ediff-odd-diff-face-C 'ediff-odd-diff-C
@@ -1325,7 +1295,7 @@
 DO NOT CHANGE this variable.  Instead, use the customization
 widget to customize the actual face object `ediff-odd-diff-C'
 this variable represents.")
-(ediff-hide-face 'ediff-odd-diff-C)
+(ediff-hide-face ediff-odd-diff-face-C)
 
 (defface ediff-odd-diff-Ancestor
   (if ediff-emacs-p
@@ -1339,8 +1309,6 @@
       (t	     	     (:italic t :stipple "gray1"))))
   "Face for highlighting odd-numbered non-current differences in the ancestor buffer."
   :group 'ediff-highlighting)
-;; backward-compatibility alias
-(put 'ediff-odd-diff-face-Ancestor 'face-alias 'ediff-odd-diff-Ancestor)
 ;; An internal variable.  Ediff takes the face from here.  When unhighlighting,
 ;; this variable is set to nil, then again to the appropriate face.
 (defvar ediff-odd-diff-face-Ancestor 'ediff-odd-diff-Ancestor
@@ -1348,30 +1316,30 @@
 DO NOT CHANGE this variable.  Instead, use the customization
 widget to customize the actual face object `ediff-odd-diff-Ancestor'
 this variable represents.")
-(ediff-hide-face 'ediff-odd-diff-Ancestor)
+(ediff-hide-face ediff-odd-diff-face-Ancestor)
 
 ;; Association between buffer types and odd-diff-face symbols
 (defconst ediff-odd-diff-face-alist
-  '((A . ediff-odd-diff-face-A)
-    (B . ediff-odd-diff-face-B)
-    (C . ediff-odd-diff-face-C)
-    (Ancestor . ediff-odd-diff-face-Ancestor)))
+  '((A . ediff-odd-diff-A)
+    (B . ediff-odd-diff-B)
+    (C . ediff-odd-diff-C)
+    (Ancestor . ediff-odd-diff-Ancestor)))
 
 ;; A-list of fine-diff face symbols associated with buffer types
 (defconst ediff-fine-diff-face-alist
-  '((A . ediff-fine-diff-face-A)
-    (B . ediff-fine-diff-face-B)
-    (C . ediff-fine-diff-face-C)
-    (Ancestor . ediff-fine-diff-face-Ancestor)))
+  '((A . ediff-fine-diff-A)
+    (B . ediff-fine-diff-B)
+    (C . ediff-fine-diff-C)
+    (Ancestor . ediff-fine-diff-Ancestor)))
 
 ;; Help echo
-(put 'ediff-fine-diff-A 'ediff-help-echo
+(put ediff-fine-diff-face-A 'ediff-help-echo
      "A `refinement' of the current difference region")
-(put 'ediff-fine-diff-B 'ediff-help-echo
+(put ediff-fine-diff-face-B 'ediff-help-echo
      "A `refinement' of the current difference region")
-(put 'ediff-fine-diff-C 'ediff-help-echo
+(put ediff-fine-diff-face-C 'ediff-help-echo
      "A `refinement' of the current difference region")
-(put 'ediff-fine-diff-Ancestor 'ediff-help-echo
+(put ediff-fine-diff-face-Ancestor 'ediff-help-echo
      "A `refinement' of the current difference region")
 
 (add-hook 'ediff-quit-hook 'ediff-cleanup-mess)
@@ -1899,6 +1867,8 @@
 	     (set-buffer ,old-buffer)
 	     (set-syntax-table ,old-table)))))))
 
+(provide 'ediff-init)
+
 
 
 ;;; Local Variables:
@@ -1907,7 +1877,5 @@
 ;;; eval: (put 'ediff-with-current-buffer 'edebug-form-spec '(form body))
 ;;; End:
 
-(provide 'ediff-init)
-
 ;;; arch-tag: fa31d384-1e70-4d4b-82a7-3e96307c46f5
 ;;; ediff-init.el ends here
--- a/lisp/ediff-mult.el	Thu Jul 07 12:43:14 2005 +0000
+++ b/lisp/ediff-mult.el	Thu Jul 14 08:02:00 2005 +0000
@@ -205,6 +205,12 @@
 This can be toggled with `ediff-toggle-filename-truncation'."
   :type 'boolean
   :group 'ediff-mult)
+
+(defcustom ediff-meta-mode-hook nil
+  "*Hooks run just after setting up meta mode."
+  :type 'hook
+  :group 'ediff-mult)
+
 (defcustom ediff-registry-setup-hook nil
   "*Hooks run just after the registry control panel is set up."
   :type 'hook
@@ -411,7 +417,8 @@
   (kill-all-local-variables)
   (setq major-mode 'ediff-meta-mode)
   (setq mode-name "MetaEdiff")
-  (run-mode-hooks 'ediff-meta-mode-hook))
+  ;; don't use run-mode-hooks here!
+  (run-hooks 'ediff-meta-mode-hook))
 
 
 ;; the keymap for the buffer showing directory differences
--- a/lisp/ediff-ptch.el	Thu Jul 07 12:43:14 2005 +0000
+++ b/lisp/ediff-ptch.el	Thu Jul 14 08:02:00 2005 +0000
@@ -163,7 +163,7 @@
 ;; returns /dev/null, if can't strip prefix
 (defsubst ediff-file-name-sans-prefix (filename prefix)
   (save-match-data
-    (if (string-match (concat "^" prefix) filename)
+    (if (string-match (concat "^" (regexp-quote prefix)) filename)
 	(substring filename (match-end 0))
       (concat "/null/" filename))))
 
--- a/lisp/ediff-util.el	Thu Jul 07 12:43:14 2005 +0000
+++ b/lisp/ediff-util.el	Thu Jul 14 08:02:00 2005 +0000
@@ -117,7 +117,13 @@
   (kill-all-local-variables)
   (setq major-mode 'ediff-mode)
   (setq mode-name "Ediff")
-  (run-mode-hooks 'ediff-mode-hook))
+  ;; We use run-hooks instead of run-mode-hooks for two reasons.
+  ;; The ediff control buffer is read-only and it is not supposed to be
+  ;; modified by minor modes and such. So, run-mode-hooks doesn't do anything
+  ;; useful here on top of what run-hooks does.
+  ;; Second, changing run-hooks to run-mode-hooks would require an
+  ;; if-statement, since XEmacs doesn't have this. 
+  (run-hooks 'ediff-mode-hook))
 
 
 
@@ -3788,9 +3794,8 @@
 		      type ediff-current-diff-overlay-alist))
 	    (buffer (ediff-get-buffer type))
 	    (face (face-name
-		   (symbol-value
-		    (ediff-get-symbol-from-alist
-		     type ediff-current-diff-face-alist)))))
+		   (ediff-get-symbol-from-alist
+		    type ediff-current-diff-face-alist))))
 	(set overlay
 	     (ediff-make-bullet-proof-overlay (point-max) (point-max) buffer))
 	(ediff-set-overlay-face (symbol-value overlay) face)
--- a/lisp/ediff-vers.el	Thu Jul 07 12:43:14 2005 +0000
+++ b/lisp/ediff-vers.el	Thu Jul 14 08:02:00 2005 +0000
@@ -304,13 +304,14 @@
     (if (stringp tmp-file) (delete-file tmp-file))
     (if (stringp ancestor-file) (delete-file ancestor-file))))
 
+
+(provide 'ediff-vers)
+
 ;;; Local Variables:
 ;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun)
 ;;; eval: (put 'ediff-with-current-buffer 'lisp-indent-hook 1)
 ;;; eval: (put 'ediff-with-current-buffer 'edebug-form-spec '(form body))
 ;;; End:
 
-(provide 'ediff-vers)
-
 ;;; arch-tag: bbb34f0c-2a90-426a-a77a-c75f479ebbbf
 ;;; ediff-vers.el ends here
--- a/lisp/ediff.el	Thu Jul 07 12:43:14 2005 +0000
+++ b/lisp/ediff.el	Thu Jul 14 08:02:00 2005 +0000
@@ -7,7 +7,7 @@
 ;; Keywords: comparing, merging, patching, tools, unix
 
 (defconst ediff-version "2.80" "The current version of Ediff")
-(defconst ediff-date "June 3, 2005" "Date of last update")
+(defconst ediff-date "July 8, 2005" "Date of last update")
 
 
 ;; This file is part of GNU Emacs.
@@ -1526,15 +1526,15 @@
   (add-to-list 'debug-ignored-errors mess))
 
 
+(require 'ediff-util)
+
+(run-hooks 'ediff-load-hook)
+
 ;;; Local Variables:
 ;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun)
 ;;; eval: (put 'ediff-with-current-buffer 'lisp-indent-hook 1)
 ;;; eval: (put 'ediff-with-current-buffer 'edebug-form-spec '(form body))
 ;;; End:
 
-(require 'ediff-util)
-
-(run-hooks 'ediff-load-hook)
-
 ;;; arch-tag: 97c71396-db02-4f41-8b48-6a51c3348fcc
 ;;; ediff.el ends here
--- a/lisp/elide-head.el	Thu Jul 07 12:43:14 2005 +0000
+++ b/lisp/elide-head.el	Thu Jul 14 08:02:00 2005 +0000
@@ -53,9 +53,9 @@
 
 (defcustom elide-head-headers-to-hide
   '(("is free software; you can redistribute it" . ; GNU boilerplate
-     "Boston, MA 02111-1307, USA\\.")
+     "Boston, MA 0211\\(1-1307\\|0-1301\\), USA\\.")
     ("The Regents of the University of California\\.  All rights reserved\\." .
-     "SUCH DAMAGE\\.")			; BSD
+     "SUCH DAMAGE\\.")				      ; BSD
     ("Permission is hereby granted, free of charge" . ; X11
      "authorization from the X Consortium\\."))
   "Alist of regexps defining start end end of text to elide.
--- a/lisp/emacs-lisp/bytecomp.el	Thu Jul 07 12:43:14 2005 +0000
+++ b/lisp/emacs-lisp/bytecomp.el	Thu Jul 14 08:02:00 2005 +0000
@@ -3353,11 +3353,14 @@
 
 (defmacro byte-compile-maybe-guarded (condition &rest body)
   "Execute forms in BODY, potentially guarded by CONDITION.
-CONDITION is the test in an `if' form or in a `cond' clause.
-BODY is to compile the first arm of the if or the body of the
-cond clause.  If CONDITION is of the form `(foundp 'foo)'
+CONDITION is a variable whose value is a test in an `if' or `cond'.
+BODY is the code to compile  first arm of the if or the body of the
+cond clause.  If CONDITION's value is of the form `(foundp 'foo)'
 or `(boundp 'foo)', the relevant warnings from BODY about foo
-being undefined will be suppressed."
+being undefined will be suppressed.
+
+If CONDITION's value is `(featurep 'xemacs)', that suppresses all
+warnings during execution of BODY."
   (declare (indent 1) (debug t))
   `(let* ((fbound
 	   (if (eq 'fboundp (car-safe ,condition))
@@ -3375,13 +3378,17 @@
 	  (byte-compile-bound-variables
 	   (if bound
 	       (cons bound byte-compile-bound-variables)
-	     byte-compile-bound-variables)))
-     (progn ,@body)
-     ;; Maybe remove the function symbol from the unresolved list.
-     (if fbound
-	 (setq byte-compile-unresolved-functions
-	       (delq (assq fbound byte-compile-unresolved-functions)
-		     byte-compile-unresolved-functions)))))
+	     byte-compile-bound-variables))
+	  (byte-compile-warnings
+	   (if (equal ,condition '(featurep 'xemacs))
+	       nil byte-compile-warnings)))
+     (unwind-protect
+	 (progn ,@body)
+       ;; Maybe remove the function symbol from the unresolved list.
+       (if fbound
+	   (setq byte-compile-unresolved-functions
+		 (delq (assq fbound byte-compile-unresolved-functions)
+		       byte-compile-unresolved-functions))))))
 
 (defun byte-compile-if (form)
   (byte-compile-form (car (cdr form)))
@@ -3422,12 +3429,12 @@
 	     (if (null (cdr clause))
 		 ;; First clause is a singleton.
 		 (byte-compile-goto-if t for-effect donetag)
-		 (setq nexttag (byte-compile-make-tag))
-		 (byte-compile-goto 'byte-goto-if-nil nexttag)
-		 (byte-compile-maybe-guarded (car clause)
-		   (byte-compile-body (cdr clause) for-effect))
-		 (byte-compile-goto 'byte-goto donetag)
-		 (byte-compile-out-tag nexttag)))))
+	       (setq nexttag (byte-compile-make-tag))
+	       (byte-compile-goto 'byte-goto-if-nil nexttag)
+	       (byte-compile-maybe-guarded (car clause)
+		 (byte-compile-body (cdr clause) for-effect))
+	       (byte-compile-goto 'byte-goto donetag)
+	       (byte-compile-out-tag nexttag)))))
     ;; Last clause
     (let ((guard (car clause)))
       (and (cdr clause) (not (eq guard t))
--- a/lisp/emacs-lisp/checkdoc.el	Thu Jul 07 12:43:14 2005 +0000
+++ b/lisp/emacs-lisp/checkdoc.el	Thu Jul 14 08:02:00 2005 +0000
@@ -317,12 +317,12 @@
   "List of words (not capitalized) which should be capitalized.")
 
 (defvar checkdoc-proper-noun-regexp
-  (let ((expr "\\<\\(")
+  (let ((expr "\\_<\\(")
 	(l checkdoc-proper-noun-list))
     (while l
       (setq expr (concat expr (car l) (if (cdr l) "\\|" ""))
 	    l (cdr l)))
-    (concat expr "\\)\\>"))
+    (concat expr "\\)\\_>"))
   "Regular expression derived from `checkdoc-proper-noun-regexp'.")
 
 (defvar checkdoc-common-verbs-regexp nil
@@ -2326,10 +2326,10 @@
 	(save-excursion
 	  (goto-char (point-max))
 	  (if (not (re-search-backward
-		    (concat "^;;;[ \t]+" fn "\\(" (regexp-quote fe)
+		    (concat "^;;;[ \t]+" (regexp-quote fn) "\\(" (regexp-quote fe)
 			    "\\)?[ \t]+ends here[ \t]*$"
 			    "\\|^;;;[ \t]+ End of file[ \t]+"
-			    fn "\\(" (regexp-quote fe) "\\)?")
+			    (regexp-quote fn) "\\(" (regexp-quote fe) "\\)?")
 		    nil t))
 	      (if (checkdoc-y-or-n-p "No identifiable footer!  Add one? ")
 		  (progn
--- a/lisp/emacs-lisp/debug.el	Thu Jul 07 12:43:14 2005 +0000
+++ b/lisp/emacs-lisp/debug.el	Thu Jul 14 08:02:00 2005 +0000
@@ -150,7 +150,8 @@
 	  (debugger-outer-standard-input standard-input)
 	  (debugger-outer-standard-output standard-output)
 	  (debugger-outer-inhibit-redisplay inhibit-redisplay)
-	  (debugger-outer-cursor-in-echo-area cursor-in-echo-area))
+	  (debugger-outer-cursor-in-echo-area cursor-in-echo-area)
+	  (debugger-with-timeout-suspend (with-timeout-suspend)))
       ;; Set this instead of binding it, so that `q'
       ;; will not restore it.
       (setq overriding-terminal-local-map nil)
@@ -235,6 +236,7 @@
                     ;; Drew Adams.  --Stef
                     (quit-window))))
 	    (kill-buffer debugger-buffer))
+	  (with-timeout-unsuspend debugger-with-timeout-suspend)
 	  (set-match-data debugger-outer-match-data)))
       ;; Put into effect the modified values of these variables
       ;; in case the user set them with the `e' command.
@@ -312,11 +314,17 @@
   ;; After any frame that uses eval-buffer,
   ;; insert a line that states the buffer position it's reading at.
   (save-excursion
-    (while (re-search-forward "^  eval-buffer(" nil t)
-      (end-of-line)
-      (insert (format "\n  ;;; Reading at buffer position %d"
-		      (with-current-buffer (nth 2 (backtrace-frame (debugger-frame-number)))
-			(point))))))
+    (let ((tem eval-buffer-list))
+      (while (and tem
+		  (re-search-forward "^  eval-\\(buffer\\|region\\)(" nil t))
+	(end-of-line)
+	(insert (format "  ; Reading at buffer position %d"
+			;; This will get the wrong result
+			;; if there are two nested eval-region calls
+			;; for the same buffer.  That's not a very useful case.
+			(with-current-buffer (car tem)
+			  (point))))
+	(pop tem))))
   (debugger-make-xrefs))
 
 (defun debugger-make-xrefs (&optional buffer)
@@ -591,10 +599,35 @@
     (define-key map "e" 'debugger-eval-expression)
     (define-key map " " 'next-line)
     (define-key map "R" 'debugger-record-expression)
-    (define-key map "\C-m" 'help-follow)
+    (define-key map "\C-m" 'debug-help-follow)
     (define-key map [mouse-2] 'push-button)
     map))
 
+(put 'debugger-mode 'mode-class 'special)
+
+(defun debugger-mode ()
+  "Mode for backtrace buffers, selected in debugger.
+\\<debugger-mode-map>
+A line starts with `*' if exiting that frame will call the debugger.
+Type \\[debugger-frame] or \\[debugger-frame-clear] to set or remove the `*'.
+
+When in debugger due to frame being exited,
+use the \\[debugger-return-value] command to override the value
+being returned from that frame.
+
+Use \\[debug-on-entry] and \\[cancel-debug-on-entry] to control
+which functions will enter the debugger when called.
+
+Complete list of commands:
+\\{debugger-mode-map}"
+  (kill-all-local-variables)
+  (setq major-mode 'debugger-mode)
+  (setq mode-name "Debugger")
+  (setq truncate-lines t)
+  (set-syntax-table emacs-lisp-mode-syntax-table)
+  (use-local-map debugger-mode-map)
+  (run-mode-hooks 'debugger-mode-hook))
+
 (defcustom debugger-record-buffer "*Debugger-record*"
   "*Buffer name for expression values, for \\[debugger-record-expression]."
   :type 'string
@@ -620,30 +653,26 @@
 	     (buffer-substring (line-beginning-position 0)
 			       (line-end-position 0)))))
 
-(put 'debugger-mode 'mode-class 'special)
-
-(defun debugger-mode ()
-  "Mode for backtrace buffers, selected in debugger.
-\\<debugger-mode-map>
-A line starts with `*' if exiting that frame will call the debugger.
-Type \\[debugger-frame] or \\[debugger-frame-clear] to set or remove the `*'.
-
-When in debugger due to frame being exited,
-use the \\[debugger-return-value] command to override the value
-being returned from that frame.
+(defun debug-help-follow (&optional pos)
+  "Follow cross-reference at POS, defaulting to point.
 
-Use \\[debug-on-entry] and \\[cancel-debug-on-entry] to control
-which functions will enter the debugger when called.
-
-Complete list of commands:
-\\{debugger-mode-map}"
-  (kill-all-local-variables)
-  (setq major-mode 'debugger-mode)
-  (setq mode-name "Debugger")
-  (setq truncate-lines t)
-  (set-syntax-table emacs-lisp-mode-syntax-table)
-  (use-local-map debugger-mode-map)
-  (run-mode-hooks 'debugger-mode-hook))
+For the cross-reference format, see `help-make-xrefs'."
+  (interactive "d")
+  (require 'help-mode)
+  (unless pos
+    (setq pos (point)))
+  (unless (push-button pos)
+    ;; check if the symbol under point is a function or variable
+    (let ((sym
+	   (intern
+	    (save-excursion
+	      (goto-char pos) (skip-syntax-backward "w_")
+	      (buffer-substring (point)
+				(progn (skip-syntax-forward "w_")
+				       (point)))))))
+      (when (or (boundp sym) (fboundp sym) (facep sym))
+	(switch-to-buffer-other-window (generate-new-buffer "*Help*"))
+	(help-do-xref pos #'help-xref-interned (list sym))))))
 
 ;; When you change this, you may also need to change the number of
 ;; frames that the debugger skips.
--- a/lisp/emacs-lisp/easy-mmode.el	Thu Jul 07 12:43:14 2005 +0000
+++ b/lisp/emacs-lisp/easy-mmode.el	Thu Jul 14 08:02:00 2005 +0000
@@ -142,6 +142,7 @@
   (let* ((mode-name (symbol-name mode))
 	 (pretty-name (easy-mmode-pretty-mode-name mode lighter))
 	 (globalp nil)
+	 (initialize nil)
 	 (group nil)
 	 (extra-args nil)
 	 (extra-keywords nil)
@@ -159,6 +160,7 @@
 	(:lighter (setq lighter (pop body)))
 	(:global (setq globalp (pop body)))
 	(:extra-args (setq extra-args (pop body)))
+	(:initialize (setq initialize (list :initialize (pop body))))
 	(:group (setq group (nconc group (list :group (pop body)))))
 	(:require (setq require (pop body)))
 	(:keymap (setq keymap (pop body)))
@@ -167,6 +169,10 @@
     (setq keymap-sym (if (and keymap (symbolp keymap)) keymap
 		       (intern (concat mode-name "-map"))))
 
+    (unless initialize
+      (setq initialize
+	    '(:initialize 'custom-initialize-default)))
+
     (unless group
       ;; We might as well provide a best-guess default group.
       (setq group
@@ -196,7 +202,7 @@
 	    `(defcustom ,mode ,init-value
 	       ,(format base-doc-string pretty-name mode mode)
 	       :set 'custom-set-minor-mode
-	       :initialize 'custom-initialize-default
+	       ,@initialize
 	       ,@group
 	       :type 'boolean
 	       ,@(cond
--- a/lisp/emacs-lisp/edebug.el	Thu Jul 07 12:43:14 2005 +0000
+++ b/lisp/emacs-lisp/edebug.el	Thu Jul 14 08:02:00 2005 +0000
@@ -2374,18 +2374,19 @@
 
 
 (defun edebug-slow-before (edebug-before-index)
-  ;; Debug current function given BEFORE position.
-  ;; Called from functions compiled with edebug-eval-top-level-form.
-  ;; Return the before index.
-  (setcar edebug-offset-indices edebug-before-index)
-
-  ;; Increment frequency count
-  (aset edebug-freq-count edebug-before-index
-	(1+ (aref edebug-freq-count edebug-before-index)))
-
-  (if (or (not (memq edebug-execution-mode '(Go-nonstop next)))
-	  (edebug-input-pending-p))
-      (edebug-debugger edebug-before-index 'before nil))
+  (unless edebug-active
+    ;; Debug current function given BEFORE position.
+    ;; Called from functions compiled with edebug-eval-top-level-form.
+    ;; Return the before index.
+    (setcar edebug-offset-indices edebug-before-index)
+
+    ;; Increment frequency count
+    (aset edebug-freq-count edebug-before-index
+	  (1+ (aref edebug-freq-count edebug-before-index)))
+
+    (if (or (not (memq edebug-execution-mode '(Go-nonstop next)))
+	    (edebug-input-pending-p))
+	(edebug-debugger edebug-before-index 'before nil)))
   edebug-before-index)
 
 (defun edebug-fast-before (edebug-before-index)
@@ -2393,22 +2394,24 @@
   )
 
 (defun edebug-slow-after (edebug-before-index edebug-after-index edebug-value)
-  ;; Debug current function given AFTER position and VALUE.
-  ;; Called from functions compiled with edebug-eval-top-level-form.
-  ;; Return VALUE.
-  (setcar edebug-offset-indices edebug-after-index)
-
-  ;; Increment frequency count
-  (aset edebug-freq-count edebug-after-index
-	(1+ (aref edebug-freq-count edebug-after-index)))
-  (if edebug-test-coverage (edebug-update-coverage))
-
-  (if (and (eq edebug-execution-mode 'Go-nonstop)
-	   (not (edebug-input-pending-p)))
-      ;; Just return result.
+  (if edebug-active
       edebug-value
-    (edebug-debugger edebug-after-index 'after edebug-value)
-    ))
+    ;; Debug current function given AFTER position and VALUE.
+    ;; Called from functions compiled with edebug-eval-top-level-form.
+    ;; Return VALUE.
+    (setcar edebug-offset-indices edebug-after-index)
+
+    ;; Increment frequency count
+    (aset edebug-freq-count edebug-after-index
+	  (1+ (aref edebug-freq-count edebug-after-index)))
+    (if edebug-test-coverage (edebug-update-coverage))
+
+    (if (and (eq edebug-execution-mode 'Go-nonstop)
+	     (not (edebug-input-pending-p)))
+	;; Just return result.
+	edebug-value
+      (edebug-debugger edebug-after-index 'after edebug-value)
+      )))
 
 (defun edebug-fast-after (edebug-before-index edebug-after-index edebug-value)
   ;; Do nothing but return the value.
@@ -2533,6 +2536,7 @@
   ;; Uses local variables of edebug-enter, edebug-before, edebug-after
   ;; and edebug-debugger.
   (let ((edebug-active t)		; for minor mode alist
+	(edebug-with-timeout-suspend (with-timeout-suspend))
 	edebug-stop			; should we enter recursive-edit
 	(edebug-point (+ edebug-def-mark
 			 (aref (nth 2 edebug-data) edebug-offset-index)))
@@ -2759,6 +2763,7 @@
 	    (set-buffer current-buffer))
 	  ;; ... nothing more.
 	  )
+      (with-timeout-unsuspend edebug-with-timeout-suspend)
       ;; Reset global variables to outside values in case they were changed.
       (setq
        overlay-arrow-position edebug-outside-o-a-p
--- a/lisp/emacs-lisp/timer.el	Thu Jul 07 12:43:14 2005 +0000
+++ b/lisp/emacs-lisp/timer.el	Thu Jul 14 08:02:00 2005 +0000
@@ -404,6 +404,9 @@
 
 ;;;###autoload (put 'with-timeout 'lisp-indent-function 1)
 
+(defvar with-timeout-timers nil
+  "List of all timers used by currently pending `with-timeout' calls.")
+
 ;;;###autoload
 (defmacro with-timeout (list &rest body)
   "Run BODY, but if it doesn't finish in SECONDS seconds, give up.
@@ -416,19 +419,46 @@
   (let ((seconds (car list))
 	(timeout-forms (cdr list)))
     `(let ((with-timeout-tag (cons nil nil))
-	   with-timeout-value with-timeout-timer)
+	   with-timeout-value with-timeout-timer
+	   (with-timeout-timers with-timeout-timers))
        (if (catch with-timeout-tag
 	     (progn
 	       (setq with-timeout-timer
 		     (run-with-timer ,seconds nil
 				      'with-timeout-handler
 				      with-timeout-tag))
+	       (push with-timeout-timer with-timeout-timers)
 	       (setq with-timeout-value (progn . ,body))
 	       nil))
 	   (progn . ,timeout-forms)
 	 (cancel-timer with-timeout-timer)
 	 with-timeout-value))))
 
+(defun with-timeout-suspend ()
+  "Stop the clock for `with-timeout'.  Used by debuggers.
+The idea is that the time you spend in the debugger should not
+count against these timeouts.
+
+The value is a list that the debugger can pass to `with-timeout-unsuspend'
+when it exits, to make these timers start counting again."
+  (mapcar (lambda (timer)
+	    (cancel-timer timer)
+	    (list timer
+		  (time-subtract
+		   ;; The time that this timer will go off.
+		   (list (aref timer 1) (aref timer 2) (aref timer 3))
+		   (current-time))))
+	  with-timeout-timers))
+
+(defun with-timeout-unsuspend (timer-spec-list)
+  "Restart the clock for `with-timeout'.
+The argument should be a value previously returned by `with-timeout-suspend'."
+  (dolist (elt timer-spec-list)
+    (let ((timer (car elt))
+	  (delay (cadr elt)))
+      (timer-set-time timer (time-add (current-time) delay)) 
+      (timer-activate timer))))
+
 (defun y-or-n-p-with-timeout (prompt seconds default-value)
   "Like (y-or-n-p PROMPT), with a timeout.
 If the user does not answer after SECONDS seconds, return DEFAULT-VALUE."
--- a/lisp/emulation/viper-cmd.el	Thu Jul 07 12:43:14 2005 +0000
+++ b/lisp/emulation/viper-cmd.el	Thu Jul 14 08:02:00 2005 +0000
@@ -36,6 +36,8 @@
 (defvar viper-always)
 (defvar viper-mode-string)
 (defvar viper-custom-file-name)
+(defvar viper--key-maps)
+(defvar viper--intercept-key-maps)
 (defvar iso-accents-mode)
 (defvar quail-mode)
 (defvar quail-current-str)
@@ -92,7 +94,7 @@
 ;; Variables for defining VI commands
 
 ;; Modifying commands that can be prefixes to movement commands
-(defconst viper-prefix-commands '(?c ?d ?y ?! ?= ?# ?< ?> ?\"))
+(defvar viper-prefix-commands '(?c ?d ?y ?! ?= ?# ?< ?> ?\"))
 ;; define viper-prefix-command-p
 (viper-test-com-defun viper-prefix-command)
 
@@ -440,23 +442,24 @@
 ;; This ensures that Viper bindings are in effect, regardless of which minor
 ;; modes were turned on by the user or by other packages.
 (defun viper-normalize-minor-mode-map-alist ()
-  (setq minor-mode-map-alist
-	(viper-append-filter-alist
-	 (list (cons 'viper-vi-intercept-minor-mode viper-vi-intercept-map)
-	       (cons 'viper-vi-minibuffer-minor-mode viper-minibuffer-map)
-	       (cons 'viper-vi-local-user-minor-mode viper-vi-local-user-map)
-	       (cons 'viper-vi-kbd-minor-mode viper-vi-kbd-map)
-	       (cons 'viper-vi-global-user-minor-mode viper-vi-global-user-map)
-	       (cons 'viper-vi-state-modifier-minor-mode
-		     (if (keymapp
-			  (cdr (assoc major-mode
-				      viper-vi-state-modifier-alist)))
-			 (cdr (assoc major-mode viper-vi-state-modifier-alist))
-		       viper-empty-keymap))
-	       (cons 'viper-vi-diehard-minor-mode  viper-vi-diehard-map)
-	       (cons 'viper-vi-basic-minor-mode     viper-vi-basic-map)
-	       (cons 'viper-insert-intercept-minor-mode
-		     viper-insert-intercept-map)
+  (setq viper--intercept-key-maps
+	(list
+	 (cons 'viper-vi-intercept-minor-mode viper-vi-intercept-map)
+	 (cons 'viper-insert-intercept-minor-mode viper-insert-intercept-map)
+	 (cons 'viper-emacs-intercept-minor-mode viper-emacs-intercept-map)
+	 ))
+  (setq viper--key-maps
+	(list (cons 'viper-vi-minibuffer-minor-mode viper-minibuffer-map)
+	      (cons 'viper-vi-local-user-minor-mode viper-vi-local-user-map)
+	      (cons 'viper-vi-kbd-minor-mode viper-vi-kbd-map)
+	      (cons 'viper-vi-global-user-minor-mode viper-vi-global-user-map)
+	      (cons 'viper-vi-state-modifier-minor-mode
+		    (if (keymapp
+			 (cdr (assoc major-mode viper-vi-state-modifier-alist)))
+			(cdr (assoc major-mode viper-vi-state-modifier-alist))
+		      viper-empty-keymap))
+	      (cons 'viper-vi-diehard-minor-mode  viper-vi-diehard-map)
+	      (cons 'viper-vi-basic-minor-mode     viper-vi-basic-map)
 	       (cons 'viper-replace-minor-mode  viper-replace-map)
 	       ;; viper-insert-minibuffer-minor-mode must come after
 	       ;; viper-replace-minor-mode
@@ -476,8 +479,6 @@
 		       viper-empty-keymap))
 	       (cons 'viper-insert-diehard-minor-mode viper-insert-diehard-map)
 	       (cons 'viper-insert-basic-minor-mode viper-insert-basic-map)
-	       (cons 'viper-emacs-intercept-minor-mode
-		     viper-emacs-intercept-map)
 	       (cons 'viper-emacs-local-user-minor-mode
 		     viper-emacs-local-user-map)
 	       (cons 'viper-emacs-kbd-minor-mode viper-emacs-kbd-map)
@@ -490,8 +491,16 @@
 			 (cdr
 			  (assoc major-mode viper-emacs-state-modifier-alist))
 		       viper-empty-keymap))
-	       )
-	 minor-mode-map-alist)))
+	       ))
+	
+  ;; in emacs with emulation-mode-map-alists, nothing needs to be done
+  (unless
+      (and (fboundp 'add-to-ordered-list) (boundp 'emulation-mode-map-alists))
+    (setq minor-mode-map-alist
+	  (viper-append-filter-alist
+	   (append viper--intercept-key-maps viper--key-maps)
+	   minor-mode-map-alist)))
+  )
 
 
 
@@ -1021,7 +1030,7 @@
 			      (not viper-translate-all-ESC-keysequences))
 			 ;; put keys following ESC on the unread list
 			 ;; and return ESC as the key-sequence
-			 (viper-set-unread-command-events (subseq keyseq 1))
+			 (viper-set-unread-command-events (viper-subseq keyseq 1))
 			 (setq last-input-event event
 			       keyseq (if viper-emacs-p
 					  "\e"
@@ -1032,7 +1041,7 @@
 			 (viper-set-unread-command-events
 			  (vconcat (vector
 				    (character-to-event (event-key first-key)))
-				   (subseq keyseq 1)))
+				   (viper-subseq keyseq 1)))
 			 (setq last-input-event event
 			       keyseq (vector (character-to-event ?\e))))
 			((eventp first-key)
@@ -3732,7 +3741,8 @@
   (interactive "P")
   (let ((val (viper-P-val arg))
 	(com (viper-getcom arg))
-	(old-str viper-s-string))
+	(old-str viper-s-string)
+	debug-on-error)
     (setq viper-s-forward t)
     (viper-if-string "/")
     ;; this is not used at present, but may be used later
@@ -3744,7 +3754,8 @@
     (if com
 	(progn
 	  (viper-move-marker-locally 'viper-com-point (mark t))
-	  (viper-execute-com 'viper-search-next val com)))))
+	  (viper-execute-com 'viper-search-next val com)))
+    ))
 
 (defun viper-search-backward (arg)
   "Search a string backward.
@@ -3753,7 +3764,8 @@
   (interactive "P")
   (let ((val (viper-P-val arg))
 	(com (viper-getcom arg))
-	(old-str viper-s-string))
+	(old-str viper-s-string)
+	debug-on-error)
     (setq viper-s-forward nil)
     (viper-if-string "?")
     ;; this is not used at present, but may be used later
@@ -3858,7 +3870,8 @@
   "Repeat previous search."
   (interactive "P")
   (let ((val (viper-p-val arg))
-	(com (viper-getcom arg)))
+	(com (viper-getcom arg))
+	debug-on-error)
     (if (null viper-s-string) (error viper-NoPrevSearch))
     (viper-search viper-s-string viper-s-forward arg)
     (if com
@@ -3870,7 +3883,8 @@
   "Repeat previous search in the reverse direction."
   (interactive "P")
   (let ((val (viper-p-val arg))
-	(com (viper-getcom arg)))
+	(com (viper-getcom arg))
+	debug-on-error)
     (if (null viper-s-string) (error viper-NoPrevSearch))
     (viper-search viper-s-string (not viper-s-forward) arg)
     (if com
--- a/lisp/emulation/viper-init.el	Thu Jul 07 12:43:14 2005 +0000
+++ b/lisp/emulation/viper-init.el	Thu Jul 14 08:02:00 2005 +0000
@@ -855,15 +855,13 @@
     (t (:underline t :stipple "gray3")))
   "*Face used to flash out the search pattern."
   :group 'viper-highlighting)
-;; backward-compatibility alias
-(put 'viper-search-face 'face-alias 'viper-search)
 ;; An internal variable.  Viper takes the face from here.
 (defvar viper-search-face 'viper-search
   "Face used to flash out the search pattern.
 DO NOT CHANGE this variable.  Instead, use the customization widget
-to customize the actual face object `viper-search-face'
+to customize the actual face object `viper-search'
 this variable represents.")
-(viper-hide-face 'viper-search)
+(viper-hide-face viper-search-face)
 
 
 (defface viper-replace-overlay
@@ -871,15 +869,13 @@
     (t (:underline t :stipple "gray3")))
   "*Face for highlighting replace regions on a window display."
   :group 'viper-highlighting)
-;; backward-compatibility alias
-(put 'viper-replace-overlay-face 'face-alias 'viper-replace-overlay)
 ;; An internal variable.  Viper takes the face from here.
 (defvar viper-replace-overlay-face 'viper-replace-overlay
   "Face for highlighting replace regions on a window display.
 DO NOT CHANGE this variable.  Instead, use the customization widget
-to customize the actual face object `viper-replace-overlay-face'
+to customize the actual face object `viper-replace-overlay'
 this variable represents.")
-(viper-hide-face 'viper-replace-overlay)
+(viper-hide-face viper-replace-overlay-face)
 
 
 (defface viper-minibuffer-emacs
@@ -887,15 +883,13 @@
     (t (:weight bold)))
   "Face used in the Minibuffer when it is in Emacs state."
   :group 'viper-highlighting)
-;; backward-compatibility alias
-(put 'viper-minibuffer-emacs-face 'face-alias 'viper-minibuffer-emacs)
 ;; An internal variable.  Viper takes the face from here.
 (defvar viper-minibuffer-emacs-face 'viper-minibuffer-emacs
   "Face used in the Minibuffer when it is in Emacs state.
 DO NOT CHANGE this variable.  Instead, use the customization widget
-to customize the actual face object `viper-minibuffer-emacs-face'
+to customize the actual face object `viper-minibuffer-emacs'
 this variable represents.")
-(viper-hide-face 'viper-minibuffer-emacs)
+(viper-hide-face viper-minibuffer-emacs-face)
 
 
 (defface viper-minibuffer-insert
@@ -903,15 +897,13 @@
     (t (:slant italic)))
   "Face used in the Minibuffer when it is in Insert state."
   :group 'viper-highlighting)
-;; backward-compatibility alias
-(put 'viper-minibuffer-insert-face 'face-alias 'viper-minibuffer-insert)
 ;; An internal variable.  Viper takes the face from here.
 (defvar viper-minibuffer-insert-face 'viper-minibuffer-insert
   "Face used in the Minibuffer when it is in Insert state.
 DO NOT CHANGE this variable.  Instead, use the customization widget
-to customize the actual face object `viper-minibuffer-insert-face'
+to customize the actual face object `viper-minibuffer-insert'
 this variable represents.")
-(viper-hide-face 'viper-minibuffer-insert)
+(viper-hide-face viper-minibuffer-insert-face)
 
 
 (defface viper-minibuffer-vi
@@ -919,15 +911,13 @@
     (t (:inverse-video t)))
   "Face used in the Minibuffer when it is in Vi state."
   :group 'viper-highlighting)
-;; backward-compatibility alias
-(put 'viper-minibuffer-vi-face 'face-alias 'viper-minibuffer-vi)
 ;; An internal variable.  Viper takes the face from here.
 (defvar viper-minibuffer-vi-face 'viper-minibuffer-vi
   "Face used in the Minibuffer when it is in Vi state.
 DO NOT CHANGE this variable.  Instead, use the customization widget
-to customize the actual face object `viper-minibuffer-vi-face'
+to customize the actual face object `viper-minibuffer-vi'
 this variable represents.")
-(viper-hide-face 'viper-minibuffer-vi)
+(viper-hide-face viper-minibuffer-vi-face)
 
 ;; the current face to be used in the minibuffer
 (viper-deflocalvar
--- a/lisp/emulation/viper-keym.el	Thu Jul 07 12:43:14 2005 +0000
+++ b/lisp/emulation/viper-keym.el	Thu Jul 14 08:02:00 2005 +0000
@@ -50,25 +50,6 @@
 
 ;;; Variables
 
-(defcustom viper-toggle-key "\C-z"
-  "The key used to change states from emacs to Vi and back.
-In insert mode, this key also functions as Meta.
-Must be set in .viper file or prior to loading Viper.
-This setting cannot be changed interactively."
-  :type 'string
-  :group 'viper)
-
-(defcustom viper-quoted-insert-key "\C-v"
-  "The key used to quote special characters when inserting them in Insert state."
-  :type 'string
-  :group 'viper)
-
-(defcustom viper-ESC-key "\e"
-  "Key used to ESC.
-Must be set in .viper file or prior to loading Viper.
-This setting cannot be changed interactively."
-  :type 'string
-  :group 'viper)
 
 ;;; Emacs keys in other states.
 
@@ -176,6 +157,78 @@
 ;; and, after .viper is loaded, we add this keymap to viper-vi-basic-map.
 (defvar viper-mode-map (make-sparse-keymap))
 
+;; Some important keys used in viper
+(defcustom viper-toggle-key [(control ?z)]  ; "\C-z"
+  "The key used to change states from emacs to Vi and back.
+In insert mode, this key also functions as Meta.
+
+Enter as a sexp. Examples: \"\\C-z\", [(control ?z)]."
+  :type 'sexp
+  :group 'viper
+  :set (lambda (symbol value)
+	 (let ((old-value (if (boundp 'viper-toggle-key)
+			      viper-toggle-key
+			    [(control ?z)])))
+	   (mapcar
+	    (lambda (buf)
+	      (save-excursion
+		(set-buffer buf)
+		(when (and (boundp 'viper-insert-basic-map)
+			   (keymapp viper-insert-basic-map))
+		  (when old-value
+		    (define-key viper-insert-basic-map old-value nil))
+		  (define-key viper-insert-basic-map value 'viper-escape-to-vi))
+		(when (and (boundp 'viper-vi-intercept-map)
+			   (keymapp viper-vi-intercept-map))
+		  (when old-value
+		    (define-key viper-vi-intercept-map old-value nil))
+		  (define-key
+		    viper-vi-intercept-map value 'viper-toggle-key-action))
+		(when (and (boundp 'viper-emacs-intercept-map)
+			   (keymapp viper-emacs-intercept-map))
+		  (define-key viper-emacs-intercept-map old-value nil)
+		  (define-key
+		    viper-emacs-intercept-map value 'viper-change-state-to-vi))
+		))
+	    (buffer-list))
+	   (set-default symbol value)
+           )))
+
+(defcustom viper-quoted-insert-key "\C-v"
+  "The key used to quote special characters when inserting them in Insert state."
+  :type 'string
+  :group 'viper)
+
+(defcustom viper-ESC-key [(escape)]  ; "\e"
+  "Key used to ESC.
+Enter as a sexp. Examples: \"\\e\", [(escape)]."
+  :type 'sexp
+  :group 'viper
+  :set (lambda (symbol value)
+	 (let ((old-value (if (boundp 'viper-ESC-key)
+			      viper-ESC-key
+			    [(escape)])))
+	   (mapcar
+	    (lambda (buf)
+	      (save-excursion
+		(set-buffer buf)
+		(when (and (boundp 'viper-insert-intercept-map)
+			   (keymapp viper-insert-intercept-map))
+		  (when old-value
+		    (define-key viper-insert-intercept-map old-value nil))
+		  (define-key
+		    viper-insert-intercept-map value 'viper-intercept-ESC-key))
+		(when (and (boundp 'viper-vi-intercept-map)
+			   (keymapp viper-vi-intercept-map))
+		  (when old-value
+		    (define-key viper-vi-intercept-map old-value nil))
+		  (define-key
+		    viper-vi-intercept-map value 'viper-intercept-ESC-key))
+		))
+	    (buffer-list))
+	   (set-default symbol value)
+           )))
+
 
 ;;; Variables used by minor modes
 
@@ -197,6 +250,10 @@
 ;; to its Emacs state in various major modes.
 (defvar viper-emacs-state-modifier-alist nil)
 
+;; The list of viper keymaps. Set by viper-normalize-minor-mode-map-alist
+(viper-deflocalvar viper--key-maps nil)
+(viper-deflocalvar viper--intercept-key-maps nil)
+
 ;; Tells viper-add-local-keys to create a new viper-vi-local-user-map for new
 ;; buffers.  Not a user option.
 (viper-deflocalvar viper-need-new-vi-local-map t "")
@@ -509,7 +566,7 @@
 
 (defun viper-zap-local-keys ()
   "Unconditionally reset Viper viper-*-local-user-map's.
-Rarely useful, but if u made a mistake by switching to a mode that adds
+Rarely useful, but if you made a mistake by switching to a mode that adds
 undesirable local keys, e.g., comint-mode, then this function can restore
 sanity."
   (interactive)
--- a/lisp/emulation/viper-macs.el	Thu Jul 07 12:43:14 2005 +0000
+++ b/lisp/emulation/viper-macs.el	Thu Jul 14 08:02:00 2005 +0000
@@ -178,7 +178,7 @@
 	(if (member
 	     key
 	     '(?\b ?\d '^? '^H (control h) (control \?) backspace delete))
-	    (setq key-seq (subseq key-seq 0 (- (length key-seq) 2))))
+	    (setq key-seq (viper-subseq key-seq 0 (- (length key-seq) 2))))
 	(setq message
 	      (format
 	       ":map%s %s"
@@ -242,9 +242,9 @@
 	(cond ((member
 		key
 		'(?\b ?\d '^? '^H (control h) (control \?) backspace delete))
-	       (setq key-seq (subseq key-seq 0 (- (length key-seq) 2))))
+	       (setq key-seq (viper-subseq key-seq 0 (- (length key-seq) 2))))
 	      ((member key '(tab (control i) ?\t))
-	       (setq key-seq (subseq key-seq 0 (1- (length key-seq))))
+	       (setq key-seq (viper-subseq key-seq 0 (1- (length key-seq))))
 	       (setq message
 		     (format
 		      ":unmap%s %s"
@@ -618,7 +618,7 @@
 
     (if (null macro-alist-elt)
 	(setq macro-alist-elt (car next-best-match)
-	      unmatched-suffix (subseq event-seq (cdr next-best-match))))
+	      unmatched-suffix (viper-subseq event-seq (cdr next-best-match))))
 
     (cond ((null macro-alist-elt))
 	  ((setq macro-body (viper-kbd-buf-definition macro-alist-elt)))
@@ -701,7 +701,7 @@
   (let ((len1 (length seq1))
 	(len2 (length seq2)))
     (if (<= len1 len2)
-	(equal seq1 (subseq seq2 0 len1)))))
+	(equal seq1 (viper-subseq seq2 0 len1)))))
 
 ;; find the longest common prefix
 (defun viper-common-seq-prefix (&rest seqs)
@@ -766,7 +766,7 @@
       (setq macro-def (car lis)
 	    def-len (length (car macro-def)))
       (if (and (>= str-len def-len)
-	       (equal (car macro-def) (subseq str 0 def-len)))
+	       (equal (car macro-def) (viper-subseq str 0 def-len)))
 	  (if (or (viper-kbd-buf-definition macro-def)
 		  (viper-kbd-mode-definition macro-def)
 		  (viper-kbd-global-definition macro-def))
--- a/lisp/emulation/viper-mous.el	Thu Jul 07 12:43:14 2005 +0000
+++ b/lisp/emulation/viper-mous.el	Thu Jul 14 08:02:00 2005 +0000
@@ -65,7 +65,7 @@
 (defvar viper-frame-of-focus nil)
 
 ;; Frame that was selected before the switch-frame event.
-(defconst viper-current-frame-saved (selected-frame))
+(defvar viper-current-frame-saved (selected-frame))
 
 (defcustom viper-surrounding-word-function 'viper-surrounding-word
   "*Function that determines what constitutes a word for clicking events.
--- a/lisp/emulation/viper-util.el	Thu Jul 07 12:43:14 2005 +0000
+++ b/lisp/emulation/viper-util.el	Thu Jul 14 08:02:00 2005 +0000
@@ -41,7 +41,6 @@
 (defvar viper-syntax-preference)
 (defvar viper-saved-mark)
 
-(require 'cl)
 (require 'ring)
 
 (if noninteractive
@@ -1068,7 +1067,7 @@
 		 (t key)))
 
 	  ((listp key)
-	   (setq modifiers (subseq key 0 (1- (length key)))
+	   (setq modifiers (viper-subseq key 0 (1- (length key)))
 		 base-key (viper-seq-last-elt key)
 		 base-key-name (symbol-name base-key)
 		 char-p (= (length base-key-name) 1))
@@ -1503,6 +1502,33 @@
     ))
 
 
+;; this is copied from cl-extra.el
+;; Return the subsequence of SEQ from START to END.
+;; If END is omitted, it defaults to the length of the sequence.
+;; If START or END is negative, it counts from the end.
+(defun viper-subseq (seq start &optional end)
+  (if (stringp seq) (substring seq start end)
+    (let (len)
+      (and end (< end 0) (setq end (+ end (setq len (length seq)))))
+      (if (< start 0) (setq start (+ start (or len (setq len (length seq))))))
+      (cond ((listp seq)
+	     (if (> start 0) (setq seq (nthcdr start seq)))
+	     (if end
+		 (let ((res nil))
+		   (while (>= (setq end (1- end)) start)
+		     (push (pop seq) res))
+		   (nreverse res))
+	       (copy-sequence seq)))
+	    (t
+	     (or end (setq end (or len (length seq))))
+	     (let ((res (make-vector (max (- end start) 0) nil))
+		   (i 0))
+	       (while (< start end)
+		 (aset res i (aref seq start))
+		 (setq i (1+ i) start (1+ start)))
+	       res))))))
+
+
 
 (provide 'viper-util)
 
--- a/lisp/emulation/viper.el	Thu Jul 07 12:43:14 2005 +0000
+++ b/lisp/emulation/viper.el	Thu Jul 14 08:02:00 2005 +0000
@@ -8,7 +8,7 @@
 ;; Author: Michael Kifer <kifer@cs.stonybrook.edu>
 ;; Keywords: emulations
 
-(defconst viper-version "3.11.4 of February 19, 2005"
+(defconst viper-version "3.11.5 of July 8, 2005"
   "The current version of Viper")
 
 ;; This file is part of GNU Emacs.
@@ -320,6 +320,7 @@
 ;; end pacifier
 
 (require 'viper-init)
+(require 'viper-keym)
 
 ;; better be defined before Viper custom group.
 (defvar viper-custom-file-name (convert-standard-filename "~/.viper")
@@ -691,6 +692,12 @@
 
   (setq viper-mode nil)
 
+  (when (and (fboundp 'add-to-ordered-list) (boundp 'emulation-mode-map-alists))
+    (setq emulation-mode-map-alists
+	  (delq 'viper--intercept-key-maps
+		(delq 'viper--key-maps emulation-mode-map-alists))
+	  ))
+
   (viper-delocalize-var 'viper-vi-minibuffer-minor-mode)
   (viper-delocalize-var 'viper-insert-minibuffer-minor-mode)
   (viper-delocalize-var 'viper-vi-intercept-minor-mode)
@@ -874,9 +881,27 @@
       "Switch to emacs state while reading password."
       (viper-change-state-to-emacs)))
 
+  (defadvice self-insert-command (around viper-self-insert-ad activate)
+    "Ignore all self-inserting keys in the vi-state."
+    (if (and (eq viper-current-state 'vi-state) (interactive-p))
+	(beep 1)
+      ad-do-it
+      ))
+
+  (when (and (fboundp 'add-to-ordered-list) (boundp 'emulation-mode-map-alists))
+    ;; needs to be as early as possible
+    (add-to-ordered-list
+     'emulation-mode-map-alists 'viper--intercept-key-maps 100)
+    ;; needs to be after cua-mode
+    (add-to-ordered-list 'emulation-mode-map-alists 'viper--key-maps 500)
+    )
+
   ;; Emacs shell, ange-ftp, and comint-based modes
   (add-hook 'comint-mode-hook 'viper-comint-mode-hook) ; comint
 
+  (add-hook 'eshell-mode-hook
+	    (lambda () (setq viper-auto-indent nil)))
+
   (viper-set-emacs-state-searchstyle-macros nil 'dired-mode) ; dired
   (viper-set-emacs-state-searchstyle-macros nil 'tar-mode) ; tar
   (viper-set-emacs-state-searchstyle-macros nil 'mh-folder-mode) ; mhe
@@ -1058,6 +1083,14 @@
     (define-key viper-insert-intercept-map "\C-x)" nil)
     (define-key viper-emacs-intercept-map "\C-x)" nil))
 
+  (defadvice add-minor-mode (after
+			     viper-advice-add-minor-mode
+			     (toggle name &optional keymap after toggle-fun)
+			     activate)
+  "Run viper-normalize-minor-mode-map-alist after adding a minor mode."
+  (viper-normalize-minor-mode-map-alist)
+  (setq-default minor-mode-map-alist minor-mode-map-alist))
+
   ;; catch frame switching event
   (if (viper-window-display-p)
       (if viper-xemacs-p
--- a/lisp/facemenu.el	Thu Jul 07 12:43:14 2005 +0000
+++ b/lisp/facemenu.el	Thu Jul 14 08:02:00 2005 +0000
@@ -475,10 +475,11 @@
 ;;;###autoload
 (defun facemenu-read-color (&optional prompt)
   "Read a color using the minibuffer."
-  (let ((col (completing-read (or prompt "Color: ")
-			      (or facemenu-color-alist
-				  (defined-colors))
-			      nil t)))
+  (let* ((completion-ignore-case t)
+	 (col (completing-read (or prompt "Color: ")
+			       (or facemenu-color-alist
+				   (defined-colors))
+			       nil t)))
     (if (equal "" col)
 	nil
       col)))
--- a/lisp/files.el	Thu Jul 07 12:43:14 2005 +0000
+++ b/lisp/files.el	Thu Jul 14 08:02:00 2005 +0000
@@ -2544,6 +2544,10 @@
 	  (setq truename (file-truename filename))
 	  (if find-file-visit-truename
 	      (setq filename truename))))
+    (if filename
+	(let ((new-name (file-name-nondirectory filename)))
+	  (if (string= new-name "")
+	      (error "Empty file name"))))
     (let ((buffer (and filename (find-buffer-visiting filename))))
       (and buffer (not (eq buffer (current-buffer)))
 	   (not no-query)
@@ -2557,8 +2561,6 @@
     (setq buffer-file-name filename)
     (if filename			; make buffer name reflect filename.
 	(let ((new-name (file-name-nondirectory buffer-file-name)))
-	  (if (string= new-name "")
-	      (error "Empty file name"))
 	  (if (eq system-type 'vax-vms)
 	      (setq new-name (downcase new-name)))
 	  (setq default-directory (file-name-directory buffer-file-name))
@@ -4004,7 +4006,9 @@
   (while list
     (let* ((buffer (car list))
 	   (name (buffer-name buffer)))
-      (and (not (string-equal name ""))
+      (and name				; Can be nil for an indirect buffer
+					; if we killed the base buffer.
+	   (not (string-equal name ""))
 	   (/= (aref name 0) ? )
 	   (yes-or-no-p
 	    (format "Buffer %s %s.  Kill? "
--- a/lisp/font-lock.el	Thu Jul 07 12:43:14 2005 +0000
+++ b/lisp/font-lock.el	Thu Jul 14 08:02:00 2005 +0000
@@ -1473,7 +1473,11 @@
       (while (and (< (point) end)
 		  (if (stringp matcher)
 		      (re-search-forward matcher end t)
-		    (funcall matcher end)))
+		    (funcall matcher end))
+                  ;; Beware empty string matches since they will
+                  ;; loop indefinitely.
+                  (or (> (point) (match-beginning 0))
+                      (progn (forward-char 1) t)))
 	(when (and font-lock-multiline
 		   (>= (point)
 		       (save-excursion (goto-char (match-beginning 0))
--- a/lisp/frame.el	Thu Jul 07 12:43:14 2005 +0000
+++ b/lisp/frame.el	Thu Jul 14 08:02:00 2005 +0000
@@ -1256,10 +1256,6 @@
 This timer calls `blink-cursor-timer-function' every
 `blink-cursor-interval' seconds.")
 
-;; We do not know the standard _evaluated_ value yet, because the standard
-;; expression uses values that are not yet set.  The correct evaluated
-;; standard value will be installed in startup.el using exactly the same
-;; expression as in the defcustom.
 (define-minor-mode blink-cursor-mode
   "Toggle blinking cursor mode.
 With a numeric argument, turn blinking cursor mode on iff ARG is positive.
@@ -1270,9 +1266,10 @@
 displays through a window system, because then Emacs does its own
 cursor display.  On a text-only terminal, this is not implemented."
   :init-value (not (or noninteractive
-		       (if (boundp 'no-blinking-cursor) no-blinking-cursor)
+		       no-blinking-cursor
 		       (eq system-type 'ms-dos)
 		       (not (memq window-system '(x w32)))))
+  :initialize 'custom-initialize-safe-default
   :group 'cursor
   :global t
   (if blink-cursor-idle-timer (cancel-timer blink-cursor-idle-timer))
--- a/lisp/fringe.el	Thu Jul 07 12:43:14 2005 +0000
+++ b/lisp/fringe.el	Thu Jul 14 08:02:00 2005 +0000
@@ -150,7 +150,7 @@
 it take real effect.
 Setting the variable with a customization buffer also takes effect.
 If you only want to modify the appearance of the fringe in one frame,
-you can use the interactive function `toggle-fringe'"
+you can use the interactive function `set-fringe-style'."
   :type '(choice (const :tag "Default width" nil)
 		 (const :tag "No fringes" 0)
 		 (const :tag "Only right" (0 . nil))
@@ -174,7 +174,10 @@
 Otherwise the negation of the fringe value in the currently selected
 frame parameter is used."
   (let ((mode (intern (completing-read
-		       "Select fringe mode for all frames (type ? for list): "
+		       (concat
+			"Select fringe mode for "
+			(if all-frames "all frames" "selected frame")
+			" (type ? for list): ")
 		       '(("none") ("default") ("left-only")
 			 ("right-only") ("half") ("minimal"))
 		       nil t))))
--- a/lisp/gnus/ChangeLog	Thu Jul 07 12:43:14 2005 +0000
+++ b/lisp/gnus/ChangeLog	Thu Jul 14 08:02:00 2005 +0000
@@ -1,3 +1,16 @@
+2005-07-13  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+	* gnus-salt.el (gnus-pick-mode): Remove the 5th arg of
+	gnus-add-minor-mode.
+	(gnus-binary-mode): Ditto.
+
+	* gnus-topic.el (gnus-topic-mode): Ditto.
+
+2005-07-08  Ralf Angeli  <angeli@iwi.uni-sb.de>  (tiny change)
+
+	* gnus-art.el (gnus-article-next-page, gnus-article-next-page-1)
+	(gnus-article-prev-page): Take scroll-margin into consideration.
+
 2005-07-04  Lute Kamstra  <lute@gnu.org>
 
 	Update FSF's address in GPL notices.
--- a/lisp/gnus/gnus-art.el	Thu Jul 07 12:43:14 2005 +0000
+++ b/lisp/gnus/gnus-art.el	Thu Jul 14 08:02:00 2005 +0000
@@ -5160,7 +5160,7 @@
 If end of article, return non-nil.  Otherwise return nil.
 Argument LINES specifies lines to be scrolled up."
   (interactive "p")
-  (move-to-window-line -1)
+  (move-to-window-line (max (- -1 scroll-margin) (- -1 (window-body-height))))
   (if (save-excursion
 	(end-of-line)
 	(and (pos-visible-in-window-p)	;Not continuation line.
@@ -5189,13 +5189,13 @@
       (end-of-buffer
        ;; Long lines may cause an end-of-buffer error.
        (goto-char (point-max)))))
-  (move-to-window-line 0))
+  (move-to-window-line (min scroll-margin (window-body-height))))
 
 (defun gnus-article-prev-page (&optional lines)
   "Show previous page of current article.
 Argument LINES specifies lines to be scrolled down."
   (interactive "p")
-  (move-to-window-line 0)
+  (move-to-window-line (min scroll-margin (window-body-height)))
   (if (and gnus-page-broken
 	   (bobp)
 	   (not (save-restriction (widen) (bobp)))) ;Real beginning-of-buffer?
@@ -5209,7 +5209,7 @@
 	      (scroll-down lines)
 	    (beginning-of-buffer
 	     (goto-char (point-min))))
-	(move-to-window-line 0)))))
+	(move-to-window-line (min scroll-margin (window-body-height)))))))
 
 (defun gnus-article-only-boring-p ()
   "Decide whether there is only boring text remaining in the article.
--- a/lisp/gnus/gnus-salt.el	Thu Jul 07 12:43:14 2005 +0000
+++ b/lisp/gnus/gnus-salt.el	Thu Jul 14 08:02:00 2005 +0000
@@ -128,8 +128,7 @@
       ;; Set up the menu.
       (when (gnus-visual-p 'pick-menu 'menu)
 	(gnus-pick-make-menu-bar))
-      (gnus-add-minor-mode 'gnus-pick-mode " Pick" gnus-pick-mode-map
-			   nil 'gnus-pick-mode)
+      (gnus-add-minor-mode 'gnus-pick-mode " Pick" gnus-pick-mode-map)
       (gnus-run-hooks 'gnus-pick-mode-hook))))
 
 (defun gnus-pick-setup-message ()
@@ -362,8 +361,7 @@
       ;; Set up the menu.
       (when (gnus-visual-p 'binary-menu 'menu)
 	(gnus-binary-make-menu-bar))
-      (gnus-add-minor-mode 'gnus-binary-mode " Binary"
-			   gnus-binary-mode-map nil 'gnus-binary-mode)
+      (gnus-add-minor-mode 'gnus-binary-mode " Binary" gnus-binary-mode-map)
       (gnus-run-hooks 'gnus-binary-mode-hook))))
 
 (defun gnus-binary-display-article (article &optional all-header)
--- a/lisp/gnus/gnus-topic.el	Thu Jul 07 12:43:14 2005 +0000
+++ b/lisp/gnus/gnus-topic.el	Thu Jul 14 08:02:00 2005 +0000
@@ -1,6 +1,6 @@
 ;;; gnus-topic.el --- a folding minor mode for Gnus group buffers
-;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
-;;        Free Software Foundation, Inc.
+;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
+;; 2005 Free Software Foundation, Inc.
 
 ;; Author: Ilja Weis <kult@uni-paderborn.de>
 ;;	Lars Magne Ingebrigtsen <larsi@gnus.org>
@@ -1136,10 +1136,7 @@
       (when (gnus-visual-p 'topic-menu 'menu)
 	(gnus-topic-make-menu-bar))
       (gnus-set-format 'topic t)
-      (gnus-add-minor-mode 'gnus-topic-mode " Topic"
-			   gnus-topic-mode-map nil (lambda (&rest junk)
-						     (interactive)
-						     (gnus-topic-mode nil t)))
+      (gnus-add-minor-mode 'gnus-topic-mode " Topic" gnus-topic-mode-map)
       (add-hook 'gnus-group-catchup-group-hook 'gnus-topic-update-topic)
       (set (make-local-variable 'gnus-group-prepare-function)
 	   'gnus-group-prepare-topics)
--- a/lisp/ido.el	Thu Jul 07 12:43:14 2005 +0000
+++ b/lisp/ido.el	Thu Jul 14 08:02:00 2005 +0000
@@ -578,8 +578,12 @@
 
 (defcustom ido-use-filename-at-point nil
   "*Non-nil means that ido shall look for a filename at point.
+May use `ffap-guesser' to guess whether text at point is a filename.
 If found, use that as the starting point for filename selection."
-  :type 'boolean
+  :type '(choice
+	  (const :tag "Disabled" nil)
+	  (const :tag "Guess filename" guess)
+	  (other :tag "Use literal filename" t))
   :group 'ido)
 
 
@@ -881,6 +885,12 @@
   :type '(repeat symbol)
   :group 'ido)
 
+(defcustom ido-before-fallback-functions '()
+  "List of functions to call before calling a fallback command.
+The fallback command is passed as an argument to the functions."
+  :type 'hook
+  :group 'ido)
+
 ;;; Internal Variables
 
 ;; Persistent variables
@@ -1918,7 +1928,10 @@
 (defun ido-buffer-internal (method &optional fallback prompt default initial switch-cmd)
   ;; Internal function for ido-switch-buffer and friends
   (if (not ido-mode)
-      (call-interactively (or fallback 'switch-to-buffer))
+      (progn
+	(run-hook-with-args 'ido-before-fallback-functions
+			    (or fallback 'switch-to-buffer))
+	(call-interactively (or fallback 'switch-to-buffer)))
     (let* ((ido-context-switch-command switch-cmd)
 	   (ido-current-directory nil)
 	   (ido-directory-nonreadable nil)
@@ -1937,6 +1950,8 @@
 
        ((eq ido-exit 'fallback)
 	(let ((read-buffer-function nil))
+	  (run-hook-with-args 'ido-before-fallback-functions
+			      (or fallback 'switch-to-buffer))
 	  (call-interactively (or fallback 'switch-to-buffer))))
 
        ;; Check buf is non-nil.
@@ -2040,7 +2055,9 @@
 		filename t))
 
 	 ((and ido-use-filename-at-point
-	       (setq fn (ffap-string-at-point))
+	       (setq fn (if (eq ido-use-filename-at-point 'guess)
+			    (ffap-guesser)
+			  (ffap-string-at-point)))
 	       (not (string-match "^http:/" fn))
 	       (setq d (file-name-directory fn))
 	       (file-directory-p d))
@@ -2068,6 +2085,8 @@
 	;; we don't want to change directory of current buffer.
 	(let ((default-directory ido-current-directory)
 	      (read-file-name-function nil))
+	  (run-hook-with-args 'ido-before-fallback-functions
+			      (or fallback 'find-file))
 	  (call-interactively (or fallback 'find-file))))
 
        ((eq ido-exit 'switch-to-buffer)
@@ -2134,6 +2153,7 @@
 	(setq filename (concat ido-current-directory filename))
 	(ido-record-command fallback filename)
 	(ido-record-work-directory)
+	(run-hook-with-args 'ido-before-fallback-functions fallback)
 	(funcall fallback filename))
 
        ((eq method 'insert)
@@ -4210,6 +4230,7 @@
 	 (buf (ido-read-internal 'buffer prompt 'ido-buffer-history default require-match)))
     (if (eq ido-exit 'fallback)
 	(let ((read-buffer-function nil))
+	  (run-hook-with-args 'ido-before-fallback-functions 'read-buffer)
 	  (read-buffer prompt default require-match))
       buf)))
 
@@ -4256,6 +4277,7 @@
       (setq filename 'fallback)))
     (if (eq filename 'fallback)
 	(let ((read-file-name-function nil))
+	  (run-hook-with-args 'ido-before-fallback-functions 'read-file-name)
 	  (read-file-name prompt dir default-filename mustmatch initial predicate))
       filename)))
 
--- a/lisp/longlines.el	Thu Jul 07 12:43:14 2005 +0000
+++ b/lisp/longlines.el	Thu Jul 14 08:02:00 2005 +0000
@@ -170,20 +170,20 @@
   "Make hard newlines between BEG and END visible."
   (let* ((pmin (min beg end))
          (pmax (max beg end))
-         (pos (text-property-any pmin pmax 'hard t)))
+         (pos (text-property-not-all pmin pmax 'hard nil)))
     (while pos
       (put-text-property pos (1+ pos) 'display
                          (copy-sequence longlines-show-effect))
-      (setq pos (text-property-any (1+ pos) pmax 'hard t)))))
+      (setq pos (text-property-not-all (1+ pos) pmax 'hard nil)))))
 
 (defun longlines-unshow-hard-newlines ()
   "Make hard newlines invisible again."
   (interactive)
   (setq longlines-showing nil)
-  (let ((pos (text-property-any (point-min) (point-max) 'hard t)))
+  (let ((pos (text-property-not-all (point-min) (point-max) 'hard nil)))
     (while pos
       (remove-text-properties pos (1+ pos) '(display))
-      (setq pos (text-property-any (1+ pos) (point-max) 'hard t)))))
+      (setq pos (text-property-not-all (1+ pos) (point-max) 'hard nil)))))
 
 ;; Wrapping the paragraphs.
 
--- a/lisp/mail/rmail.el	Thu Jul 07 12:43:14 2005 +0000
+++ b/lisp/mail/rmail.el	Thu Jul 14 08:02:00 2005 +0000
@@ -3316,10 +3316,10 @@
 	  (narrow-to-region (- (buffer-size) omin) (- (buffer-size) omax)))
       (if (not dont-show)
 	  (rmail-show-message
-	   (if (zerop rmail-current-message) 1 nil)
-	(if rmail-enable-mime
-	    (goto-char (+ (point-min) opoint))
-	  (goto-char (+ (point) opoint))))))))
+	   (if (zerop rmail-current-message) 1 nil)))
+      (if rmail-enable-mime
+	  (goto-char (+ (point-min) opoint))
+	(goto-char (+ (point) opoint))))))
 
 (defun rmail-expunge ()
   "Erase deleted messages from Rmail file and summary buffer."
--- a/lisp/progmodes/compile.el	Thu Jul 07 12:43:14 2005 +0000
+++ b/lisp/progmodes/compile.el	Thu Jul 14 08:02:00 2005 +0000
@@ -78,7 +78,7 @@
 
 ;;;###autoload
 (defcustom compilation-mode-hook nil
-  "*List of hook functions run by `compilation-mode' (see `run-hooks')."
+  "*List of hook functions run by `compilation-mode' (see `run-mode-hooks')."
   :type 'hook
   :group 'compilation)
 
@@ -1213,7 +1213,7 @@
 move point to the error message line and type \\[compile-goto-error].
 To kill the compilation, type \\[kill-compilation].
 
-Runs `compilation-mode-hook' with `run-hooks' (which see).
+Runs `compilation-mode-hook' with `run-mode-hooks' (which see).
 
 \\{compilation-mode-map}"
   (interactive)
--- a/lisp/progmodes/gdb-ui.el	Thu Jul 07 12:43:14 2005 +0000
+++ b/lisp/progmodes/gdb-ui.el	Thu Jul 14 08:02:00 2005 +0000
@@ -50,6 +50,19 @@
 ;; still under development and is part of a process to migrate Emacs from
 ;; annotations to GDB/MI.
 ;;
+;; Windows Platforms:
+;;
+;; If you are using Emacs and GDB on Windows you will need to flush the buffer
+;; explicitly in your program if you want timely display of I/O in Emacs.
+;; Alternatively you can make the output stream unbuffered, for example, by
+;; using a macro:
+;; 
+;;           #ifdef UNBUFFERED
+;;	     setvbuf(stdout,(char *)NULL, _IONBF,0);
+;;	     #endif
+;;
+;; and compiling with -DUNBUFFERED while debugging.
+;;
 ;; Known Bugs:
 ;;
 ;; TODO:
--- a/lisp/progmodes/sh-script.el	Thu Jul 07 12:43:14 2005 +0000
+++ b/lisp/progmodes/sh-script.el	Thu Jul 14 08:02:00 2005 +0000
@@ -2033,11 +2033,20 @@
 	;; Continuation lines are handled specially
 	(if (sh-this-is-a-continuation)
 	    (progn
-	      ;; We assume the line being continued is already
-	      ;; properly indented...
-	      ;; (setq prev-line-end (sh-prev-line))
-	      (setq align-point (sh-prev-line nil))
-	      (setq result (list '(+ sh-indent-for-continuation)))
+              (setq result
+                    (if (save-excursion
+                          (beginning-of-line)
+                          (not (memq (char-before (- (point) 2)) '(?\s ?\t))))
+                        ;; By convention, if the continuation \ is not
+                        ;; preceded by a SPC or a TAB it means that the line
+                        ;; is cut at a place where spaces cannot be freely
+                        ;; added/removed.  I.e. do not indent the line.
+                        (list '(= nil))
+                      ;; We assume the line being continued is already
+                      ;; properly indented...
+                      ;; (setq prev-line-end (sh-prev-line))
+                      (setq align-point (sh-prev-line nil))
+                      (list '(+ sh-indent-for-continuation))))
 	      (setq have-result t))
 	  (beginning-of-line)
 	  (skip-chars-forward " \t")
@@ -2130,10 +2139,9 @@
       (sh-debug "result is now: %s" result)
 
       (or result
-	  (if prev-line-end
-	      (setq result (list (list t prev-line-end)))
-	    (setq result (list (list '= 'sh-first-lines-indent)))
-	    ))
+	  (setq result (list (if prev-line-end
+                                 (list t prev-line-end)
+                               (list '= 'sh-first-lines-indent)))))
 
       (if (eq result t)
 	  (setq result nil))
@@ -2695,11 +2703,9 @@
 
 (defun sh-mark-init (buffer)
   "Initialize a BUFFER to be used by `sh-mark-line'."
-  (save-excursion
-    (set-buffer (get-buffer-create buffer))
+  (with-current-buffer (get-buffer-create buffer)
     (erase-buffer)
-    (occur-mode)
-    ))
+    (occur-mode)))
 
 
 (defun sh-mark-line (message point buffer &optional add-linenum occur-point)
@@ -2972,8 +2978,7 @@
 	  (let ((var (car learned-var)))
 	    (sh-mark-line (format "  %s %s" var (symbol-value var))
 			  (nth 2 learned-var) out-buffer)))
-	(save-excursion
-	  (set-buffer out-buffer)
+	(with-current-buffer out-buffer
 	  (goto-char (point-min))
 	  (insert
 	   (format "Indentation values for buffer %s.\n" name)
@@ -3244,8 +3249,7 @@
 t means to return a list of all possible completions of STRING.
 `lambda' means to return t if STRING is a valid completion as it stands."
   (let ((sh-shell-variables
-	 (save-excursion
-	   (set-buffer sh-add-buffer)
+	 (with-current-buffer sh-add-buffer
 	   (or sh-shell-variables-initialized
 	       (sh-shell-initialize-variables))
 	   (nconc (mapcar (lambda (var)
--- a/lisp/replace.el	Thu Jul 07 12:43:14 2005 +0000
+++ b/lisp/replace.el	Thu Jul 14 08:02:00 2005 +0000
@@ -921,21 +921,22 @@
 	(when current-prefix-arg
 	  (prefix-numeric-value current-prefix-arg))))
 
-(defun occur-rename-buffer (&optional unique-p)
+(defun occur-rename-buffer (&optional unique-p interactive-p)
   "Rename the current *Occur* buffer to *Occur: original-buffer-name*.
-Here `original-buffer-name' is the buffer name were occur was originally run.
-When given the prefix argument, the renaming will not clobber the existing
-buffer(s) of that name, but use `generate-new-buffer-name' instead.
-You can add this to `occur-mode-hook' if you always want a separate *Occur*
-buffer for each buffer where you invoke `occur'."
-  (interactive "P")
+Here `original-buffer-name' is the buffer name were Occur was originally run.
+When given the prefix argument, or called non-interactively, the renaming
+will not clobber the existing buffer(s) of that name, but use
+`generate-new-buffer-name' instead.  You can add this to `occur-hook'
+if you always want a separate *Occur* buffer for each buffer where you
+invoke `occur'."
+  (interactive "P\np")
   (with-current-buffer
       (if (eq major-mode 'occur-mode) (current-buffer) (get-buffer "*Occur*"))
     (rename-buffer (concat "*Occur: "
                            (mapconcat #'buffer-name
                                       (car (cddr occur-revert-arguments)) "/")
                            "*")
-                   unique-p)))
+                   (or unique-p (not interactive-p)))))
 
 (defun occur (regexp &optional nlines)
   "Show all lines in the current buffer containing a match for REGEXP.
--- a/lisp/simple.el	Thu Jul 07 12:43:14 2005 +0000
+++ b/lisp/simple.el	Thu Jul 14 08:02:00 2005 +0000
@@ -110,6 +110,11 @@
   :group 'next-error
   :version "22.1")
 
+(defcustom next-error-hook nil
+  "*List of hook functions run by `next-error' after visiting source file."
+  :type 'hook
+  :group 'next-error)
+
 (defvar next-error-highlight-timer nil)
 
 (defvar next-error-overlay-arrow-position nil)
@@ -240,9 +245,10 @@
 \\[next-error] in that buffer when it is the only one displayed
 in the current frame.
 
-Once \\[next-error] has chosen the buffer for error messages,
-it stays with that buffer until you use it in some other buffer which
-uses Compilation mode or Compilation Minor mode.
+Once \\[next-error] has chosen the buffer for error messages, it
+runs `next-error-hook' with `run-hooks', and stays with that buffer
+until you use it in some other buffer which uses Compilation mode
+or Compilation Minor mode.
 
 See variables `compilation-parse-errors-function' and
 \`compilation-error-regexp-alist' for customization ideas."
@@ -251,7 +257,8 @@
   (when (setq next-error-last-buffer (next-error-find-buffer))
     ;; we know here that next-error-function is a valid symbol we can funcall
     (with-current-buffer next-error-last-buffer
-      (funcall next-error-function (prefix-numeric-value arg) reset))))
+      (funcall next-error-function (prefix-numeric-value arg) reset)
+      (run-hooks 'next-error-hook))))
 
 (defalias 'goto-next-locus 'next-error)
 (defalias 'next-match 'next-error)
@@ -3433,51 +3440,41 @@
 		;; Now move a line.
 		(end-of-line)
 		;; If there's no invisibility here, move over the newline.
-		(let ((pos-before (point))
-		      line-done)
-		  (if (eobp)
-		      (if (not noerror)
-			  (signal 'end-of-buffer nil)
-			(setq done t)))
-		  (when (and (not done)
-			     (not (integerp selective-display))
-			     (not (line-move-invisible-p (point))))
-		    (unless (overlays-in (max (1- pos-before) (point-min))
-					 (min (1+ (point)) (point-max)))
-		      ;; We avoid vertical-motion when possible
-		      ;; because that has to fontify.
-		      (forward-line 1)
-		      (setq line-done t)))
-		  (and (not done) (not line-done)
-		       ;; Otherwise move a more sophisticated way.
-		       (zerop (vertical-motion 1))
-		       (if (not noerror)
-			   (signal 'end-of-buffer nil)
-			 (setq done t))))
+		(cond
+		 ((eobp)
+		  (if (not noerror)
+		      (signal 'end-of-buffer nil)
+		    (setq done t)))
+		 ((and (> arg 1)  ;; Use vertical-motion for last move
+		       (not (integerp selective-display))
+		       (not (line-move-invisible-p (point))))
+		  ;; We avoid vertical-motion when possible
+		  ;; because that has to fontify.
+		  (forward-line 1))
+		 ;; Otherwise move a more sophisticated way.
+		 ((zerop (vertical-motion 1))
+		  (if (not noerror)
+		      (signal 'end-of-buffer nil)
+		    (setq done t))))
 		(unless done
 		  (setq arg (1- arg))))
 	      ;; The logic of this is the same as the loop above,
 	      ;; it just goes in the other direction.
 	      (while (and (< arg 0) (not done))
 		(beginning-of-line)
-		(let ((pos-before (point))
-		      line-done)
-		  (if (bobp)
-		      (if (not noerror)
-			  (signal 'beginning-of-buffer nil)
-			(setq done t)))
-		  (when (and (not done)
-			     (not (integerp selective-display))
-			     (not (line-move-invisible-p (1- (point)))))
-		    (unless (overlays-in (max (1- (point)) (point-min))
-					 (min (1+ pos-before) (point-max)))
-		      (forward-line -1)
-		      (setq line-done t)))
-		  (and (not done) (not line-done)
-		       (zerop (vertical-motion -1))
-		       (if (not noerror)
-			   (signal 'beginning-of-buffer nil)
-			 (setq done t))))
+		(cond
+		 ((bobp)
+		  (if (not noerror)
+		      (signal 'beginning-of-buffer nil)
+		    (setq done t)))
+		 ((and (< arg -1) ;; Use vertical-motion for last move
+		       (not (integerp selective-display))
+		       (not (line-move-invisible-p (1- (point)))))
+		  (forward-line -1))
+		 ((zerop (vertical-motion -1))
+		  (if (not noerror)
+		      (signal 'beginning-of-buffer nil)
+		    (setq done t))))
 		(unless done
 		  (setq arg (1+ arg))
 		  (while (and ;; Don't move over previous invis lines
--- a/lisp/startup.el	Thu Jul 07 12:43:14 2005 +0000
+++ b/lisp/startup.el	Thu Jul 14 08:02:00 2005 +0000
@@ -752,15 +752,7 @@
   ;; are not set.
   (custom-reevaluate-setting 'blink-cursor-mode)
   (custom-reevaluate-setting 'normal-erase-is-backspace)
-
-  ;; If you change the code below, you need to also change the
-  ;; corresponding code in the tooltip-mode defcustom.  The two need
-  ;; to be equivalent under all conditions, or Custom will get confused.
-  (unless (or noninteractive
-	      emacs-basic-display
-              (not (display-graphic-p))
-              (not (fboundp 'x-show-tip)))
-    (tooltip-mode 1))
+  (custom-reevaluate-setting 'tooltip-mode)
 
   ;; Register default TTY colors for the case the terminal hasn't a
   ;; terminal init file.
--- a/lisp/term/mac-win.el	Thu Jul 07 12:43:14 2005 +0000
+++ b/lisp/term/mac-win.el	Thu Jul 14 08:02:00 2005 +0000
@@ -1377,6 +1377,17 @@
   (save-buffer) ; It pops up the save dialog.
   )
 
+(defun mac-services-mail-selection ()
+  (interactive)
+  (compose-mail)
+  (rfc822-goto-eoh)
+  (forward-line 1)
+  (insert (x-selection-value mac-services-selection) "\n"))
+
+(defun mac-services-mail-to ()
+  (interactive)
+  (compose-mail (x-selection-value mac-services-selection)))
+
 (defun mac-services-insert-text ()
   (interactive)
   (let ((text (x-selection-value mac-services-selection)))
@@ -1393,6 +1404,10 @@
   'mac-services-open-file)
 (define-key mac-application-menu-map [services perform open-selection]
   'mac-services-open-selection)
+(define-key mac-application-menu-map [services perform mail-selection]
+  'mac-services-mail-selection)
+(define-key mac-application-menu-map [services perform mail-to]
+  'mac-services-mail-to)
 (define-key mac-application-menu-map [services paste]
   'mac-services-insert-text)
 (define-key mac-application-menu-map [preferences] 'customize)
--- a/lisp/textmodes/ispell.el	Thu Jul 07 12:43:14 2005 +0000
+++ b/lisp/textmodes/ispell.el	Thu Jul 14 08:02:00 2005 +0000
@@ -1629,7 +1629,10 @@
     ;; setup the *Choices* buffer with valid data.
     (save-excursion
       (set-buffer (get-buffer-create ispell-choices-buffer))
-      (setq mode-line-format (concat "--  %b  --  word: " word))
+      (setq mode-line-format
+	    (concat "--  %b  --  word: " word
+		    "  --  dict: " (or ispell-current-dictionary "default")
+		    "  --  prog: " (file-name-nondirectory ispell-program-name)))
       ;; XEmacs: no need for horizontal scrollbar in choices window
       (with-no-warnings
        (and (fboundp 'set-specifier)
@@ -1789,9 +1792,10 @@
 			      (erase-buffer)
 			      (setq count ?0
 				    skipped 0
-				    mode-line-format (concat
-						      "--  %b  --  word: "
-						      new-word)
+				    mode-line-format
+				    (concat "--  %b  --  word: " new-word
+					    "  --  dict: "
+					    ispell-alternate-dictionary)
 				    miss (lookup-words new-word)
 				    choices miss
 				    line ispell-choices-win-default-height)
@@ -2482,9 +2486,10 @@
 	(rstart (make-marker)))
   (unwind-protect
       (save-excursion
-	(message "Spell checking %s using %s dictionary..."
+	(message "Spell checking %s using %s with %s dictionary..."
 		 (if (and (= reg-start (point-min)) (= reg-end (point-max)))
 		     (buffer-name) "region")
+		 (file-name-nondirectory ispell-program-name)
 		 (or ispell-current-dictionary "default"))
 	;; Returns cursor to original location.
 	(save-window-excursion
@@ -2502,7 +2507,8 @@
 		  (set-marker skip-region-start (- (point) (length key)))
 		  (goto-char reg-start)))
 	    (let (message-log-max)
-	      (message "Continuing spelling check using %s dictionary..."
+	      (message "Continuing spelling check using %s with %s dictionary..."
+		       (file-name-nondirectory ispell-program-name)
 		       (or ispell-current-dictionary "default")))
 	    (set-marker rstart reg-start)
 	    (set-marker ispell-region-end reg-end)
@@ -2579,7 +2585,9 @@
       (if (not recheckp) (set-marker ispell-region-end nil))
       ;; Only save if successful exit.
       (ispell-pdict-save ispell-silently-savep)
-      (message "Spell-checking done")))))
+      (message "Spell-checking using %s with %s dictionary done"
+	       (file-name-nondirectory ispell-program-name)
+	       (or ispell-current-dictionary "default"))))))
 
 
 (defun ispell-begin-skip-region-regexp ()
@@ -2930,7 +2938,8 @@
 	      ))
 	    (if (not ispell-quit)
 		(let (message-log-max)
-		  (message "Continuing spelling check using %s dictionary..."
+		  (message "Continuing spelling check using %s with %s dictionary..."
+			   (file-name-nondirectory ispell-program-name)
 			   (or ispell-current-dictionary "default"))))
 	    (sit-for 0)
 	    (setq start (marker-position line-start)
--- a/lisp/timezone.el	Thu Jul 07 12:43:14 2005 +0000
+++ b/lisp/timezone.el	Thu Jul 14 08:02:00 2005 +0000
@@ -149,7 +149,7 @@
 	(time nil)
 	(zone nil))			;This may be nil.
     (cond ((string-match
-	    "\\([0-9]+\\)[ \t]+\\([^ \t,]+\\)[ \t]+\\([0-9]+\\)[ \t]+\\([0-9]+:[0-9:]+\\)[ \t]*\\([-+a-zA-Z0-9]+\\)" date)
+	    "\\([0-9]+\\)[ \t]+\\([^ \t,]+\\)[ \t]+\\([0-9]+\\)[ \t]+\\([0-9]+:[0-9:]+\\)[ \t]+\\([-+a-zA-Z0-9]+\\)" date)
 	   ;; Styles: (1) and (2) with timezone and buggy timezone
 	   ;; This is most common in mail and news,
 	   ;; so it is worth trying first.
--- a/lisp/tooltip.el	Thu Jul 07 12:43:14 2005 +0000
+++ b/lisp/tooltip.el	Thu Jul 14 08:02:00 2005 +0000
@@ -154,18 +154,15 @@
 ;; set-buffer prevents redisplay optimizations, so every mouse motion
 ;; would be accompanied by a full redisplay.
 
-;;;###autoload
 (define-minor-mode tooltip-mode
   "Toggle Tooltip display.
 With ARG, turn tooltip mode on if and only if ARG is positive."
   :global t
-  ;; If you change the :init-value below, you also need to change the
-  ;; corresponding code in startup.el.
   :init-value (not (or noninteractive
-		       (and (boundp 'emacs-quick-startup) emacs-quick-startup)
-		       (not (and (fboundp 'display-graphic-p)
-				 (display-graphic-p)))
+		       emacs-quick-startup
+		       (not (display-graphic-p))
 		       (not (fboundp 'x-show-tip))))
+  :initialize 'custom-initialize-safe-default
   :group 'tooltip
   (unless (or (null tooltip-mode) (fboundp 'x-show-tip))
     (error "Sorry, tooltips are not yet available on this system"))
--- a/lisp/whitespace.el	Thu Jul 07 12:43:14 2005 +0000
+++ b/lisp/whitespace.el	Thu Jul 14 08:02:00 2005 +0000
@@ -109,32 +109,32 @@
 (put 'whitespace-mode-line 'permanent-local nil)
 
 (defvar whitespace-check-buffer-leading nil
-  "Test leading whitespace for file in current buffer if t")
+  "Test leading whitespace for file in current buffer if t.")
 (make-variable-buffer-local 'whitespace-check-buffer-leading)
 (put 'whitespace-check-buffer-leading 'permanent-local nil)
 
 (defvar whitespace-check-buffer-trailing nil
-  "Test trailing whitespace for file in current buffer if t")
+  "Test trailing whitespace for file in current buffer if t.")
 (make-variable-buffer-local 'whitespace-check-buffer-trailing)
 (put 'whitespace-check-buffer-trailing 'permanent-local nil)
 
 (defvar whitespace-check-buffer-indent nil
-  "Test indentation whitespace for file in current buffer if t")
+  "Test indentation whitespace for file in current buffer if t.")
 (make-variable-buffer-local 'whitespace-check-buffer-indent)
 (put 'whitespace-check-buffer-indent 'permanent-local nil)
 
 (defvar whitespace-check-buffer-spacetab nil
-  "Test Space-followed-by-TABS whitespace for file in current buffer if t")
+  "Test Space-followed-by-TABS whitespace for file in current buffer if t.")
 (make-variable-buffer-local 'whitespace-check-buffer-spacetab)
 (put 'whitespace-check-buffer-spacetab 'permanent-local nil)
 
 (defvar whitespace-check-buffer-ateol nil
-  "Test end-of-line whitespace for file in current buffer if t")
+  "Test end-of-line whitespace for file in current buffer if t.")
 (make-variable-buffer-local 'whitespace-check-buffer-ateol)
 (put 'whitespace-check-buffer-ateol 'permanent-local nil)
 
 (defvar whitespace-highlighted-space nil
-  "The variable to store the extent to highlight")
+  "The variable to store the extent to highlight.")
 (make-variable-buffer-local 'whitespace-highlighted-space)
 (put 'whitespace-highlighted-space 'permanent-local nil)
 
@@ -142,13 +142,12 @@
 (eval-when-compile
   (if (not (fboundp 'defgroup))
       (defmacro defgroup (sym memb doc &rest args)
-	"Null macro for defgroup in all versions of Emacs that don't define
-defgroup"
+	"Null macro for `defgroup' in all versions of Emacs that don't define it."
 	t))
   (if (not (fboundp 'defcustom))
       (defmacro defcustom (sym val doc &rest args)
-	"Macro to alias defcustom to defvar in all versions of Emacs that
-don't define defcustom"
+	"Macro to alias `defcustom' to `defvar' in all versions of Emacs that
+don't define it."
 	`(defvar ,sym ,val ,doc))))
 
 (if (fboundp 'make-overlay)
@@ -180,23 +179,23 @@
   :group 'convenience))
 
 (defcustom whitespace-check-leading-whitespace t
-  "Flag to check leading whitespace. This is the global for the system.
+  "Flag to check leading whitespace.  This is the global for the system.
 It can be overriden by setting a buffer local variable
-`whitespace-check-buffer-leading'"
+`whitespace-check-buffer-leading'."
   :type 'boolean
   :group 'whitespace)
 
 (defcustom whitespace-check-trailing-whitespace t
-  "Flag to check trailing whitespace. This is the global for the system.
+  "Flag to check trailing whitespace.  This is the global for the system.
 It can be overriden by setting a buffer local variable
-`whitespace-check-buffer-trailing'"
+`whitespace-check-buffer-trailing'."
   :type 'boolean
   :group 'whitespace)
 
 (defcustom whitespace-check-spacetab-whitespace t
-  "Flag to check space followed by a TAB. This is the global for the system.
+  "Flag to check space followed by a TAB.  This is the global for the system.
 It can be overriden by setting a buffer local variable
-`whitespace-check-buffer-spacetab'"
+`whitespace-check-buffer-spacetab'."
   :type 'boolean
   :group 'whitespace)
 
@@ -206,9 +205,9 @@
   :group 'whitespace)
 
 (defcustom whitespace-check-indent-whitespace indent-tabs-mode
-  "Flag to check indentation whitespace. This is the global for the system.
+  "Flag to check indentation whitespace.  This is the global for the system.
 It can be overriden by setting a buffer local variable
-`whitespace-check-buffer-indent'"
+`whitespace-check-buffer-indent'."
   :type 'boolean
   :group 'whitespace)
 
@@ -218,9 +217,9 @@
   :group 'whitespace)
 
 (defcustom whitespace-check-ateol-whitespace t
-  "Flag to check end-of-line whitespace. This is the global for the system.
+  "Flag to check end-of-line whitespace.  This is the global for the system.
 It can be overriden by setting a buffer local variable
-`whitespace-check-buffer-ateol'"
+`whitespace-check-buffer-ateol'."
   :type 'boolean
   :group 'whitespace)
 
@@ -242,9 +241,9 @@
   :group 'whitespace)
 
 (defcustom whitespace-abort-on-error nil
-  "While writing a file, abort if the file is unclean. If
-`whitespace-auto-cleanup' is set, that takes precedence over this
-variable."
+  "While writing a file, abort if the file is unclean.
+If `whitespace-auto-cleanup' is set, that takes precedence over
+this variable."
   :type  'boolean
   :group 'whitespace)
 
@@ -277,7 +276,7 @@
 				       tcl-mode tex-mode texinfo-mode
 				       vrml-mode xml-mode)
 
-  "Major Modes in which we turn on whitespace checking.
+  "Major modes in which we turn on whitespace checking.
 
 These are mostly programming and documentation modes.  But you may add other
 modes that you want whitespaces checked in by adding something like the
@@ -608,17 +607,9 @@
 (defun whitespace-buffer-leading-cleanup ()
   "Remove any empty lines at the top of the file."
   (save-excursion
-    (let ((pmin nil)
-	  (pmax nil))
-      (goto-char (point-min))
-      (beginning-of-line)
-      (setq pmin (point))
-      (end-of-line)
-      (setq pmax (point))
-      (if (equal pmin pmax)
-	  (progn
-	    (kill-line)
-	    (whitespace-buffer-leading-cleanup))))))
+    (goto-char (point-min))
+    (skip-chars-forward "\n")
+    (delete-region (point-min) (point))))
 
 (defun whitespace-buffer-trailing ()
   "Check to see if are is more than one empty line at the bottom."
@@ -647,26 +638,11 @@
 (defun whitespace-buffer-trailing-cleanup ()
   "Delete all the empty lines at the bottom."
   (save-excursion
-    (let ((pmin nil)
-	  (pmax nil))
-      (goto-char (point-max))
-      (beginning-of-line)
-      (setq pmin (point))
-      (end-of-line)
-      (setq pmax (point))
-      (if (equal pmin pmax)
-	  (progn
-	    (goto-char (1- pmin))
-	    (beginning-of-line)
-	    (setq pmin (point))
-	    (end-of-line)
-	    (setq pmax (point))
-	    (if (equal pmin pmax)
-		(progn
-		  (goto-char (1- (point-max)))
-		  (beginning-of-line)
-		  (kill-line)
-		  (whitespace-buffer-trailing-cleanup))))))))
+    (goto-char (point-max))
+    (skip-chars-backward "\n")
+    (if (not (bolp))
+	(forward-char 1))
+    (delete-region (point) (point-max))))
 
 (defun whitespace-buffer-search (regexp)
   "Search for any given whitespace REGEXP."
--- a/lisp/winner.el	Thu Jul 07 12:43:14 2005 +0000
+++ b/lisp/winner.el	Thu Jul 14 08:02:00 2005 +0000
@@ -78,7 +78,7 @@
 
 ;;;###autoload
 (defcustom winner-mode nil
-  "Toggle winner-mode.
+  "Toggle Winner mode.
 Setting this variable directly does not take effect;
 use either \\[customize] or the function `winner-mode'."
   :set #'(lambda (symbol value) (funcall symbol (or value 0)))
@@ -98,8 +98,7 @@
   :group 'winner)
 
 (defcustom winner-boring-buffers '("*Completions*")
-  "`winner-undo' will not restore windows displaying any of these \
-buffers.
+  "`winner-undo' will not restore windows displaying any of these buffers.
 You may want to include buffer names such as *Help*, *Apropos*,
 *Buffer List*, *info* and *Compile-Log*."
   :type '(repeat string)
@@ -108,7 +107,8 @@
 
 
 
-;;;; Saving old configurations (internal variables and subroutines)
+
+;;;; Saving old configurations (internal variables and subroutines)
 
 
 ;;; Current configuration
@@ -162,13 +162,13 @@
 ;; Find the right ring.  If it does not exist, create one.
 (defsubst winner-ring (frame)
   (or (cdr (assq frame winner-ring-alist))
-      (progn
-	(let ((ring (make-ring winner-ring-size)))
-	  (ring-insert ring (winner-configuration frame))
-	  (push (cons frame ring) winner-ring-alist)
-	  ring))))
+      (let ((ring (make-ring winner-ring-size)))
+        (ring-insert ring (winner-configuration frame))
+        (push (cons frame ring) winner-ring-alist)
+        ring)))
 
-;; If the same command is called several times in a row,
+
+;; If the same command is called several times in a row,
 ;; we only save one window configuration.
 (defvar winner-last-command nil)
 
@@ -176,7 +176,7 @@
 (defvar winner-last-frames nil)
 
 
-(defun winner-equal (a b)
+(defsubst winner-equal (a b)
   "Check whether two Winner configurations (as produced by
 `winner-conf') are equal."
   (equal (cdr a) (cdr b)))
@@ -240,7 +240,8 @@
 
 
 
-;;;; Restoring configurations
+
+;;;; Restoring configurations
 
 ;; Works almost as `set-window-configuration',
 ;; but does not change the contents or the size of the minibuffer,
@@ -301,7 +302,8 @@
 		  winner-point-alist)
 	    (point)))))))
 
-;; Make sure point does not end up in the minibuffer and delete
+
+;; Make sure point does not end up in the minibuffer and delete
 ;; windows displaying dead or boring buffers
 ;; (c.f. `winner-boring-buffers').  Return nil iff all the windows
 ;; should be deleted.  Preserve correct points and marks.
@@ -410,7 +412,7 @@
 (defvar winner-undo-frame nil)
 
 (defvar winner-pending-undo-ring nil
-  "The ring currently used by winner undo.")
+  "The ring currently used by `winner-undo'.")
 (defvar winner-undo-counter nil)
 (defvar winner-undone-data  nil) ; There confs have been passed.
 
@@ -437,7 +439,8 @@
 
 
 
-(defun winner-undo-this ()		; The heart of winner undo.
+
+(defun winner-undo-this ()		; The heart of winner undo.
   (loop
    (cond
     ((>= winner-undo-counter (ring-length winner-pending-undo-ring))
@@ -467,7 +470,7 @@
        (ring-ref winner-pending-undo-ring 0)))
     (unless (eq (selected-window) (minibuffer-window))
       (message "Winner undid undo")))
-   (t (error "Previous command was not a winner-undo"))))
+   (t (error "Previous command was not a `winner-undo'"))))
 
 ;;; To be evaluated when the package is loaded:
 
--- a/lispref/ChangeLog	Thu Jul 07 12:43:14 2005 +0000
+++ b/lispref/ChangeLog	Thu Jul 14 08:02:00 2005 +0000
@@ -1,3 +1,26 @@
+2005-07-13  Luc Teirlinck  <teirllm@auburn.edu>
+
+	* customize.texi (Variable Definitions): Add
+	`custom-initialize-safe-set' and `custom-initialize-safe-default'.
+	`standard-value' is a list too.
+	(Defining New Types): Use @key{RET} instead of @key{ret}.
+
+2005-07-13  Francis Litterio  <franl@world.std.com>  (tiny change)
+
+	* os.texi (Translating Input): Fix typo.
+
+2005-07-08  Richard M. Stallman  <rms@gnu.org>
+
+	* README: Update edition number and size estimate.
+
+	* elisp.texi (VERSION): Set to 2.9.
+
+2005-07-07  Richard M. Stallman  <rms@gnu.org>
+
+	* book-spine.texinfo: Update Emacs version.
+
+	* display.texi (Inverse Video): Delete mode-line-inverse-video.
+
 2005-07-06  Richard M. Stallman  <rms@gnu.org>
 
 	* searching.texi (Regexp Search): Clarify what re-search-forward
--- a/lispref/README	Thu Jul 07 12:43:14 2005 +0000
+++ b/lispref/README	Thu Jul 14 08:02:00 2005 +0000
@@ -1,4 +1,4 @@
-README for Edition 2.8 of the Emacs Lisp Reference Manual.
+README for Edition 2.9 of the Emacs Lisp Reference Manual.
 
 * This directory contains the texinfo source files for the Reference
 Manual, make-permuted-index, and the latest version of texinfo.tex,
@@ -11,7 +11,7 @@
 newsgroup gnu.emacs.help.
 
 * The Emacs Lisp Reference Manual is quite large.  It totals around
-980 pages in smallbook format; the info files total almost
+1100 pages in smallbook format; the info files total over
 2.5 megabytes.
 
 * You can format this manual either for Info or for printing hardcopy
--- a/lispref/book-spine.texinfo	Thu Jul 07 12:43:14 2005 +0000
+++ b/lispref/book-spine.texinfo	Thu Jul 14 08:02:00 2005 +0000
@@ -11,7 +11,7 @@
 @center @titlefont{GNU Emacs Lisp Reference Manual}
 @sp 5
 @center GNU
-@center Emacs Version 19.25
+@center Emacs Version 22.1
 @center for Unix Users
 @sp 5
 
--- a/lispref/customize.texi	Thu Jul 07 12:43:14 2005 +0000
+++ b/lispref/customize.texi	Thu Jul 14 08:02:00 2005 +0000
@@ -12,7 +12,7 @@
 definitions---as well as face definitions (@pxref{Defining Faces}).
 
 @menu
-* Common Keywords::      Common keyword arguments for all kinds of 
+* Common Keywords::      Common keyword arguments for all kinds of
                            customization declarations.
 * Group Definitions::    Writing customization group definitions.
 * Variable Definitions:: Declaring user options.
@@ -270,6 +270,22 @@
 Use the @code{:set} function to initialize the variable, if it is
 already set or has been customized; otherwise, just use
 @code{set-default}.
+
+@item custom-initialize-safe-set
+@itemx custom-initialize-safe-default
+These functions behave like @code{custom-initialize-set}
+(@code{custom-initialize-default}, respectively), but catch errors.
+If an error occurs during initialization, they set the variable to
+@code{nil} using @code{set-default}, and throw no error.
+
+These two functions are only meant for options defined in pre-loaded
+files, where some variables or functions used to compute the option's
+value may not yet be defined.  The option normally gets updated in
+@file{startup.el}, ignoring the previously computed value.  Because of
+this typical usage, the value which these two functions compute
+normally only matters when, after startup, one unsets the option's
+value and then reevaluates the defcustom.  By that time, the necessary
+variables and functions will be defined, so there will not be an error.
 @end table
 
 @item :set-after @var{variables}
@@ -318,8 +334,8 @@
 Internally, @code{defcustom} uses the symbol property
 @code{standard-value} to record the expression for the default value,
 and @code{saved-value} to record the value saved by the user with the
-customization buffer.  The @code{saved-value} property is actually a
-list whose car is an expression which evaluates to the value.
+customization buffer.  Both properties are actually lists whose car is
+an expression which evaluates to the value.
 
 @node Customization Types
 @section Customization Types
@@ -1088,8 +1104,8 @@
 argument with the same syntax as the keyword argument to
 @code{defcustom} with the same name.  The third argument is a
 documentation string for the new widget.  You will be able to see that
-string with the @kbd{M-x widget-browse @key{ret} binary-tree-of-string
-@key{ret}} command.
+string with the @kbd{M-x widget-browse @key{RET} binary-tree-of-string
+@key{RET}} command.
 
 After these mandatory arguments follow the keyword arguments.  The most
 important is @code{:type}, which describes the data type we want to match
--- a/lispref/display.texi	Thu Jul 07 12:43:14 2005 +0000
+++ b/lispref/display.texi	Thu Jul 14 08:02:00 2005 +0000
@@ -1387,6 +1387,10 @@
 length is the number of characters deleted, and the post-change
 beginning and end are equal.)
 
+If these functions modify the buffer, they should bind
+@code{inhibit-modification-hooks} to @code{t} around doing so, to
+avoid confusing the internal mechanism that calls these hooks.
+
 @item insert-in-front-hooks
 @kindex insert-in-front-hooks @r{(overlay property)}
 This property's value is a list of functions to be called before and
@@ -1716,8 +1720,7 @@
 @item mode-line
 @kindex mode-line @r{(face name)}
 This face is used for the mode line of the selected window, and for
-menu bars when toolkit menus are not used---but only if
-@code{mode-line-inverse-video} is non-@code{nil}.
+menu bars when toolkit menus are not used.
 
 @item modeline
 @kindex modeline @r{(face name)}
@@ -4598,13 +4601,6 @@
 default is @code{nil}.
 @end defopt
 
-@defopt mode-line-inverse-video
-This variable controls the use of inverse video for mode lines and
-menu bars.  If it is non-@code{nil}, then these lines are displayed in
-the face @code{mode-line}.  Otherwise, these lines are displayed
-normally, just like other text.  The default is @code{t}.
-@end defopt
-
 @node Usual Display
 @section Usual Display Conventions
 
--- a/lispref/elisp.texi	Thu Jul 07 12:43:14 2005 +0000
+++ b/lispref/elisp.texi	Thu Jul 14 08:02:00 2005 +0000
@@ -6,7 +6,7 @@
 
 @c Version of the manual and of Emacs.
 @c Please remember to update the edition number in README as well.
-@set VERSION  2.7
+@set VERSION  2.9
 @set EMACSVER 22.0.50
 
 @dircategory Emacs
--- a/lispref/os.texi	Thu Jul 07 12:43:14 2005 +0000
+++ b/lispref/os.texi	Thu Jul 14 08:02:00 2005 +0000
@@ -1721,7 +1721,7 @@
 @code{key-translation-map}, even though they are overridden by it.
 Indeed, actual key bindings override @code{function-key-map} and thus
 may alter the key sequence that @code{key-translation-map} receives.
-Clearly, it is better to avoid to avoid this type of situation.
+Clearly, it is better to avoid this type of situation.
 
 The intent of @code{key-translation-map} is for users to map one
 character set to another, including ordinary characters normally bound
--- a/mac/ChangeLog	Thu Jul 07 12:43:14 2005 +0000
+++ b/mac/ChangeLog	Thu Jul 14 08:02:00 2005 +0000
@@ -1,3 +1,8 @@
+2005-07-12  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+	* Emacs.app/Contents/Info.plist (mail-to, mail-selection): New
+	NSServices.
+
 2005-07-04  Lute Kamstra  <lute@gnu.org>
 
 	Update FSF's address in GPL notices.
--- a/mac/Emacs.app/Contents/Info.plist	Thu Jul 07 12:43:14 2005 +0000
+++ b/mac/Emacs.app/Contents/Info.plist	Thu Jul 14 08:02:00 2005 +0000
@@ -75,6 +75,44 @@
 				<string>NSStringPboardType</string>
 			</array>
 		</dict>
+		<dict>
+			<key>NSKeyEquivalent</key>
+			<dict/>
+			<key>NSMenuItem</key>
+			<dict>
+				<key>default</key>
+				<string>Emacs/Send Selection</string>
+			</dict>
+			<key>NSMessage</key>
+			<string>mail-selection</string>
+			<key>NSPortName</key>
+			<string>Emacs</string>
+			<key>NSReturnTypes</key>
+			<array/>
+			<key>NSSendTypes</key>
+			<array>
+				<string>NSStringPboardType</string>
+			</array>
+		</dict>
+		<dict>
+			<key>NSKeyEquivalent</key>
+			<dict/>
+			<key>NSMenuItem</key>
+			<dict>
+				<key>default</key>
+				<string>Emacs/Send To</string>
+			</dict>
+			<key>NSMessage</key>
+			<string>mail-to</string>
+			<key>NSPortName</key>
+			<string>Emacs</string>
+			<key>NSReturnTypes</key>
+			<array/>
+			<key>NSSendTypes</key>
+			<array>
+				<string>NSStringPboardType</string>
+			</array>
+		</dict>
 	</array>
 </dict>
 </plist>
--- a/man/ChangeLog	Thu Jul 07 12:43:14 2005 +0000
+++ b/man/ChangeLog	Thu Jul 14 08:02:00 2005 +0000
@@ -1,3 +1,35 @@
+2005-07-08  Kenichi Handa  <handa@m17n.org>
+
+	* mule.texi (Recognize Coding): Recommend
+	revert-buffer-with-coding-system instead of revert-buffer.
+
+2005-07-07  Richard M. Stallman  <rms@gnu.org>
+
+	* anti.texi (Antinews): Mention mode-line-inverse-video.
+
+	* files.texi (Saving): Minor correction about C-x C-w.
+
+	* display.texi (Display Custom): Don't mention mode-line-inverse-video.
+
+2005-07-07  Luc Teirlinck  <teirllm@auburn.edu>
+
+	* search.texi (Isearch Scroll): Add example of using the
+	`isearch-scroll' property.
+	(Slow Isearch): Reference anchor for `baud-rate' instead of entire
+	`Display Custom' node.
+	(Regexp Replace): Put text that requires Emacs Lisp knowledge last
+	and de-emphasize it.
+	(Other Repeating Search): `occur' currently can not correctly
+	handle multiline matches.  Correct, clarify and update description
+	of `flush-lines' and `keep-lines'.
+
+	* display.texi (Display Custom): Add anchor for `baud-rate'.
+
+2005-07-07  Richard M. Stallman  <rms@gnu.org>
+
+	* gnu.texi: Update where to get GNU status; add refs for how to help.
+	Add footnotes 6 and 7.
+
 2005-07-04  Lute Kamstra  <lute@gnu.org>
 
 	Update FSF's address in GPL notices.
--- a/man/anti.texi	Thu Jul 07 12:43:14 2005 +0000
+++ b/man/anti.texi	Thu Jul 14 08:02:00 2005 +0000
@@ -18,7 +18,10 @@
 
 @item
 The mode line of the selected window is no longer displayed with a
-special face.  All mode lines are created equal.
+special face.  All mode lines are created equal.  Meanwhile, you can
+use the variable @code{mode-line-inverse-video} to control whether
+mode lines are highlighted at all---@code{nil} means don't highlight
+them.
 
 @item
 Clicking on a link with the left mouse button (@kbd{mouse-1}) will
--- a/man/calc.texi	Thu Jul 07 12:43:14 2005 +0000
+++ b/man/calc.texi	Thu Jul 14 08:02:00 2005 +0000
@@ -4314,8 +4314,8 @@
 
 If your system has the GNUPLOT program, you can see graphs of your
 data and your straight line to see how well they match.  (If you have
-GNUPLOT 3.0, the following instructions will work regardless of the
-kind of display you have.  Some GNUPLOT 2.0, non-X-windows systems
+GNUPLOT 3.0 or higher, the following instructions will work regardless
+of the kind of display you have.  Some GNUPLOT 2.0, non-X-windows systems
 may require additional steps to view the graphs.)
 
 Let's start by plotting the original data.  Recall the ``@var{x}'' and ``@var{y}''
@@ -28694,11 +28694,11 @@
 
 @noindent
 The commands for graphing data begin with the @kbd{g} prefix key.  Calc
-uses GNUPLOT 2.0 or 3.0 to do graphics.  These commands will only work
+uses GNUPLOT 2.0 or later to do graphics.  These commands will only work
 if GNUPLOT is available on your system.  (While GNUPLOT sounds like
 a relative of GNU Emacs, it is actually completely unrelated.
-However, it is free software and can be obtained from the Free
-Software Foundation's machine @samp{prep.ai.mit.edu}.)
+However, it is free software.   It can be obtained from
+@samp{http://www.gnuplot.info}.)
 
 @vindex calc-gnuplot-name
 If you have GNUPLOT installed on your system but Calc is unable to
@@ -28707,7 +28707,7 @@
 variables to show Calc how to run GNUPLOT on your system; these
 are described under @kbd{g D} and @kbd{g O} below.  If you are
 using the X window system, Calc will configure GNUPLOT for you
-automatically.  If you have GNUPLOT 3.0 and you are not using X,
+automatically.  If you have GNUPLOT 3.0 or later and you are not using X,
 Calc will configure GNUPLOT to display graphs using simple character
 graphics that will work on any terminal.
 
@@ -28826,7 +28826,7 @@
 at coordinate @expr{(x_i, y_j)} on the surface.  The 3D graph will
 be displayed from a certain default viewpoint; you can change this
 viewpoint by adding a @samp{set view} to the @samp{*Gnuplot Commands*}
-buffer as described later.  See the GNUPLOT 3.0 documentation for a
+buffer as described later.  See the GNUPLOT documentation for a
 description of the @samp{set view} command.
 
 Each point in the matrix will be displayed as a dot in the graph,
@@ -30268,10 +30268,11 @@
 by default.  This notation has the advantage that the @samp{%}
 character begins a comment in @TeX{} and La@TeX{}, so if your formula is 
 embedded in a @TeX{} or La@TeX{} document its plain version will be
-invisible in the final printed copy.  @xref{Customizing
-Embedded Mode}, to see how to change the ``plain'' formula
-delimiters, say to something that @dfn{eqn} or some other
-formatter will treat as a comment.
+invisible in the final printed copy.  Certain major modes have different
+delimiters to ensure that the ``plain'' version will be 
+in a comment for those modes, also.  
+See @ref{Customizing Embedded Mode} to see how to change the ``plain''
+formula delimiters. 
 
 There are several notations which Calc's parser for ``big''
 formatted formulas can't yet recognize.  In particular, it can't
@@ -30696,8 +30697,9 @@
 below).
 
 The scan does not look for the leading @samp{% }, only for the
-square brackets and the text they enclose.  You can edit the mode
-annotations to a style that works better in context if you wish.
+square brackets and the text they enclose.  In fact, the leading
+characters are different for different major modes.  You can edit the
+mode annotations to a style that works better in context if you wish.
 @xref{Customizing Embedded Mode}, to see how to change the style
 that Calc uses when it generates the annotations.  You can write
 mode annotations into the file yourself if you know the syntax;
@@ -30797,14 +30799,11 @@
 variables described here.  These variables are customizable 
 (@pxref{Customizable Variables}), or you can use @kbd{M-x set-variable}
 or @kbd{M-x edit-options} to adjust a variable on the fly.
-(Another possibility would
-be to use a file-local variable annotation at the end of the
-file; @pxref{File Variables, , Local Variables in Files, emacs, the
-Emacs manual}.)
-
-While none of these variables will be buffer-local by default, you
-can make any of them local to any Embedded mode buffer.  (Their
-values in the @samp{*Calculator*} buffer are never used.)
+(Another possibility would be to use a file-local variable annotation at
+the end of the file; 
+@pxref{File Variables, , Local Variables in Files, emacs, the Emacs manual}.)
+Many of the variables given mentioned here can be set to depend on the
+major mode of the editing buffer (@pxref{Customizable Variables}).
 
 @vindex calc-embedded-open-formula
 The @code{calc-embedded-open-formula} variable holds a regular
@@ -30887,11 +30886,13 @@
 formula when @kbd{d p} mode is turned on.  Note that this is an
 actual string, not a regular expression, because Calc must be able
 to write this string into a buffer as well as to recognize it.
-The default string is @code{"%%% "} (note the trailing space).
+The default string is @code{"%%% "} (note the trailing space), but may
+be different for certain major modes.
 
 @vindex calc-embedded-close-plain
 The @code{calc-embedded-close-plain} variable is a string which
-ends a ``plain'' formula.  The default is @code{" %%%\n"}.  Without
+ends a ``plain'' formula.  The default is @code{" %%%\n"}, but may be
+different for different major modes.  Without
 the trailing newline here, the first line of a Big mode formula
 that followed might be shifted over with respect to the other lines.
 
@@ -30921,11 +30922,12 @@
 all, blank lines are considered formula delimiters by default!
 But if your language includes a delimiter which can only occur
 actually in front of a formula, you can take advantage of it here.
-The default pattern is @code{"%Embed\n\\(% .*\n\\)*"}, which
-checks for @samp{%Embed} followed by any number of lines beginning
-with @samp{%} and a space.  This last is important to make Calc
-consider mode annotations part of the pattern, so that the formula's
-opening delimiter really is sure to follow the pattern.
+The default pattern is @code{"%Embed\n\\(% .*\n\\)*"}, but may be
+different for different major modes.
+This pattern will check for @samp{%Embed} followed by any number of
+lines beginning with @samp{%} and a space.  This last is important to
+make Calc consider mode annotations part of the pattern, so that the
+formula's opening delimiter really is sure to follow the pattern.
 
 @vindex calc-embedded-open-mode
 The @code{calc-embedded-open-mode} variable is a string (not a
@@ -30933,14 +30935,15 @@
 Calc never scans for this string; Calc always looks for the
 annotation itself.  But this is the string that is inserted before
 the opening bracket when Calc adds an annotation on its own.
-The default is @code{"% "}.
+The default is @code{"% "}, but may be different for different major
+modes. 
 
 @vindex calc-embedded-close-mode
 The @code{calc-embedded-close-mode} variable is a string which
 follows a mode annotation written by Calc.  Its default value
-is simply a newline, @code{"\n"}.  If you change this, it is a
-good idea still to end with a newline so that mode annotations
-will appear on lines by themselves.
+is simply a newline, @code{"\n"}, but may be different for different
+major modes.  If you change this, it is a good idea still to end with a
+newline so that mode annotations will appear on lines by themselves.
 
 @node Programming, Customizable Variables, Embedded Mode, Top
 @chapter Programming
@@ -34725,6 +34728,20 @@
 must @emph{not} switch into the new window.
 @end defvar
 
+@defvar calc-embedded-mode-hook
+This hook is called the first time that Embedded mode is entered.
+@end defvar
+
+@defvar calc-embedded-new-buffer-hook
+This hook is called each time that Embedded mode is entered in a
+new buffer.
+@end defvar
+
+@defvar calc-embedded-new-formula-hook
+This hook is called each time that Embedded mode is enabled for a
+new formula.
+@end defvar
+
 @defvar calc-edit-mode-hook
 This hook is called by @code{calc-edit} (and the other ``edit''
 commands) when the temporary editing buffer is being created.
@@ -34894,6 +34911,7 @@
 @end defvar
 
 @defvar calc-embedded-announce-formula
+@defvarx calc-embedded-announce-formula-alist
 See @ref{Customizing Embedded Mode}.@*
 The variable @code{calc-embedded-announce-formula} helps determine
 what formulas @kbd{M-# a} will activate in a buffer.  It is a
@@ -34905,10 +34923,33 @@
 The default pattern is @code{"%Embed\n\\(% .*\n\\)*"}, which checks
 for @samp{%Embed} followed by any number of lines beginning with
 @samp{%} and a space.
+
+The variable @code{calc-embedded-announce-formula-alist} is used to
+set @code{calc-embedded-announce-formula} to different regular
+expressions depending on the major mode of the editing buffer.
+It consists of a list of pairs of the form @code{(@var{MAJOR-MODE} .
+@var{REGEXP})}, and its default value is
+@example
+   ((c++-mode     . "//Embed\n\\(// .*\n\\)*")
+    (c-mode       . "/\\*Embed\\*/\n\\(/\\* .*\\*/\n\\)*")
+    (f90-mode     . "!Embed\n\\(! .*\n\\)*")
+    (fortran-mode . "C Embed\n\\(C .*\n\\)*")
+    (html-helper-mode . "<!-- Embed -->\n\\(<!-- .* -->\n\\)*")
+    (html-mode    . "<!-- Embed -->\n\\(<!-- .* -->\n\\)*")
+    (nroff-mode   . "\\\\\"Embed\n\\(\\\\\" .*\n\\)*")
+    (pascal-mode  . "@{Embed@}\n\\(@{.*@}\n\\)*")
+    (sgml-mode    . "<!-- Embed -->\n\\(<!-- .* -->\n\\)*")
+    (xml-mode     . "<!-- Embed -->\n\\(<!-- .* -->\n\\)*")
+    (texinfo-mode . "@@c Embed\n\\(@@c .*\n\\)*"))
+@end example
+Any major modes added to @code{calc-embedded-announce-formula-alist}
+should also be added to @code{calc-embedded-open-close-plain-alist} 
+and @code{calc-embedded-open-close-mode-alist}.
 @end defvar
 
 @defvar  calc-embedded-open-formula
 @defvarx calc-embedded-close-formula
+@defvarx calc-embedded-open-close-formula-alist
 See @ref{Customizing Embedded Mode}.@*
 The variables @code{calc-embedded-open-formula} and
 @code{calc-embedded-open-formula} control the region that Calc will
@@ -34933,10 +34974,20 @@
 @item
 Lines containing a single @samp{%} or @samp{.\"} symbol and nothing else.
 @end enumerate
+
+The variable @code{calc-embedded-open-close-formula-alist} is used to
+set @code{calc-embedded-open-formula} and
+@code{calc-embedded-close-formula} to different regular
+expressions depending on the major mode of the editing buffer.
+It consists of a list of lists of the form 
+@code{(@var{MAJOR-MODE}  @var{OPEN-FORMULA-REGEXP}
+@var{CLOSE-FORMULA-REGEXP})}, and its default value is
+@code{nil}.
 @end defvar
 
 @defvar  calc-embedded-open-word
 @defvarx calc-embedded-close-word
+@defvarx calc-embedded-open-close-word-alist
 See @ref{Customizing Embedded Mode}.@*
 The variables @code{calc-embedded-open-word} and
 @code{calc-embedded-close-word} control the region that Calc will
@@ -34946,10 +34997,20 @@
 The default values of @code{calc-embedded-open-word} and
 @code{calc-embedded-close-word} are @code{"^\\|[^-+0-9.eE]"} and 
 @code{"$\\|[^-+0-9.eE]"} respectively.
+
+The variable @code{calc-embedded-open-close-word-alist} is used to
+set @code{calc-embedded-open-word} and
+@code{calc-embedded-close-word} to different regular
+expressions depending on the major mode of the editing buffer.
+It consists of a list of lists of the form 
+@code{(@var{MAJOR-MODE}  @var{OPEN-WORD-REGEXP}
+@var{CLOSE-WORD-REGEXP})}, and its default value is
+@code{nil}.
 @end defvar
 
 @defvar  calc-embedded-open-plain
 @defvarx calc-embedded-close-plain
+@defvarx calc-embedded-open-close-plain-alist
 See @ref{Customizing Embedded Mode}.@*
 The variables @code{calc-embedded-open-plain} and
 @code{calc-embedded-open-plain} are used to delimit ``plain''
@@ -34962,10 +35023,35 @@
 @code{calc-embedded-close-plain} is @code{" %%%\n"}, without
 the trailing newline here, the first line of a Big mode formula
 that followed might be shifted over with respect to the other lines.
+
+The variable @code{calc-embedded-open-close-plain-alist} is used to
+set @code{calc-embedded-open-plain} and
+@code{calc-embedded-close-plain} to different strings
+depending on the major mode of the editing buffer.
+It consists of a list of lists of the form 
+@code{(@var{MAJOR-MODE}  @var{OPEN-PLAIN-STRING}
+@var{CLOSE-PLAIN-STRING})}, and its default value is
+@example
+   ((c++-mode     "// %% "   " %%\n")
+    (c-mode       "/* %% "   " %% */\n")
+    (f90-mode     "! %% "    " %%\n")
+    (fortran-mode "C %% "    " %%\n")
+    (html-helper-mode "<!-- %% " " %% -->\n")
+    (html-mode "<!-- %% " " %% -->\n")
+    (nroff-mode   "\\\" %% " " %%\n")
+    (pascal-mode  "@{%% "    " %%@}\n")
+    (sgml-mode     "<!-- %% " " %% -->\n")
+    (xml-mode     "<!-- %% " " %% -->\n")
+    (texinfo-mode "@@c %% "   " %%\n"))
+@end example
+Any major modes added to @code{calc-embedded-open-close-plain-alist}
+should also be added to @code{calc-embedded-announce-formula-alist}
+and @code{calc-embedded-open-close-mode-alist}.
 @end defvar
 
 @defvar  calc-embedded-open-new-formula
 @defvarx calc-embedded-close-new-formula
+@defvarx calc-embedded-open-close-new-formula-alist
 See @ref{Customizing Embedded Mode}.@*
 The variables @code{calc-embedded-open-new-formula} and
 @code{calc-embedded-close-new-formula} are strings which are
@@ -34980,10 +35066,20 @@
 if typed at the end of a line.  (It follows that if @kbd{M-# f} is
 typed on a blank line, both a leading opening newline and a trailing
 closing newline are omitted.)
+
+The variable @code{calc-embedded-open-close-new-formula-alist} is used to
+set @code{calc-embedded-open-new-formula} and
+@code{calc-embedded-close-new-formula} to different strings
+depending on the major mode of the editing buffer.
+It consists of a list of lists of the form 
+@code{(@var{MAJOR-MODE}  @var{OPEN-NEW-FORMULA-STRING}
+@var{CLOSE-NEW-FORMULA-STRING})}, and its default value is
+@code{nil}.
 @end defvar
 
 @defvar  calc-embedded-open-mode
 @defvarx calc-embedded-close-mode
+@defvarx calc-embedded-open-close-mode-alist
 See @ref{Customizing Embedded Mode}.@*
 The variables @code{calc-embedded-open-mode} and
 @code{calc-embedded-close-mode} are strings which Calc will place before
@@ -34997,6 +35093,30 @@
 If you change the value of @code{calc-embedded-close-mode}, it is a good
 idea still to end with a newline so that mode annotations will appear on
 lines by themselves.
+
+The variable @code{calc-embedded-open-close-mode-alist} is used to
+set @code{calc-embedded-open-mode} and
+@code{calc-embedded-close-mode} to different strings
+expressions depending on the major mode of the editing buffer.
+It consists of a list of lists of the form 
+@code{(@var{MAJOR-MODE}  @var{OPEN-MODE-STRING}
+@var{CLOSE-MODE-STRING})}, and its default value is
+@example
+   ((c++-mode     "// "   "\n")
+    (c-mode       "/* "   " */\n")
+    (f90-mode     "! "    "\n")
+    (fortran-mode "C "    "\n")
+    (html-helper-mode "<!-- " " -->\n")
+    (html-mode    "<!-- " " -->\n")
+    (nroff-mode   "\\\" " "\n")
+    (pascal-mode  "@{ "    " @}\n")
+    (sgml-mode    "<!-- " " -->\n")
+    (xml-mode     "<!-- " " -->\n")
+    (texinfo-mode "@@c "   "\n"))
+@end example
+Any major modes added to @code{calc-embedded-open-close-mode-alist}
+should also be added to @code{calc-embedded-announce-formula-alist}
+and @code{calc-embedded-open-close-plain-alist}.
 @end defvar
 
 @node Reporting Bugs, Summary, Customizable Variables, Top
--- a/man/display.texi	Thu Jul 07 12:43:14 2005 +0000
+++ b/man/display.texi	Thu Jul 14 08:02:00 2005 +0000
@@ -1004,15 +1004,6 @@
   This section contains information for customization only.  Beginning
 users should skip it.
 
-@vindex mode-line-inverse-video
-  The variable @code{mode-line-inverse-video} is an obsolete way of
-controlling whether the mode line is displayed in inverse video; the
-preferred way of doing this is to change the @code{mode-line} face.
-@xref{Mode Line}.  However, if @code{mode-line-inverse-video} has a
-value of @code{nil}, then the @code{mode-line} face will be ignored,
-and mode-lines will be drawn using the default text face.
-@xref{Faces}.
-
 @vindex inverse-video
   If the variable @code{inverse-video} is non-@code{nil}, Emacs attempts
 to invert all the lines of the display from what they normally are.
@@ -1135,7 +1126,7 @@
 that do not override it.
 
 @vindex baud-rate
-  The variable @code{baud-rate} holds the output speed of the
+  The variable @anchor{baud-rate}@code{baud-rate} holds the output speed of the
 terminal, as far as Emacs knows.  Setting this variable does not
 change the speed of actual data transmission, but the value is used
 for calculations.  On terminals, it affects padding, and decisions
--- a/man/files.texi	Thu Jul 07 12:43:14 2005 +0000
+++ b/man/files.texi	Thu Jul 14 08:02:00 2005 +0000
@@ -464,8 +464,9 @@
 @kindex C-x C-w
 @findex write-file
   If you wish to mark the buffer as visiting a different file and save it
-right away, use @kbd{C-x C-w} (@code{write-file}).  It is precisely
-equivalent to @code{set-visited-file-name} followed by @kbd{C-x C-s}.
+right away, use @kbd{C-x C-w} (@code{write-file}).  It is
+equivalent to @code{set-visited-file-name} followed by @kbd{C-x C-s}
+(except that @kbd{C-x C-w} asks for confirmation if the file exists).
 @kbd{C-x C-s} used on a buffer that is not visiting a file has the
 same effect as @kbd{C-x C-w}; that is, it reads a file name, marks the
 buffer as visiting that file, and saves it there.  The default file name in
--- a/man/gnu.texi	Thu Jul 07 12:43:14 2005 +0000
+++ b/man/gnu.texi	Thu Jul 14 08:02:00 2005 +0000
@@ -39,9 +39,10 @@
 that different wording could help avoid.  Footnotes added in 1993 help
 clarify these points.
 
-For up-to-date information about the available GNU software, please see
-the latest issue of the GNU's Bulletin.  The list is much too long to
-include here.
+For up-to-date information about the available GNU software, please
+see @uref{http://www.gnu.org}.  For software tasks to work on, see
+@uref{http://savannah.gnu.org/projects/tasklist}.  For other ways to
+contribute, see @uref{http://www.gnu.org/help}.
 @end quotation
 
 @unnumberedsec What's GNU?  Gnu's Not Unix!
@@ -380,7 +381,17 @@
 other people's lives; and it is usually used to make their lives more
 difficult.
 
-People who have studied the issue of intellectual property rights carefully
+People who have studied the issue of intellectual property
+rights@footnote{In the 80s I had not yet realized how confusing it was
+to speak of ``the issue'' of ``intellectual property.''  That term is
+obviously biased; more subtle is the fact that it lumps together
+various disparate laws which raise very different issues.  Nowadays I
+urge people to reject the term ``intellectual property'' entirely,
+lest it lead others to suppose that those laws form one coherent
+issue.  The way to be clear is to discuss patents, copyrights, and
+trademarks separately.  See
+@uref{http://www.gnu.org/philosophy/not-ipr.xhtml} for more
+explanation of how this term spreads confusion and bias.} carefully
 (such as lawyers) say that there is no intrinsic right to intellectual
 property.  The kinds of supposed intellectual property rights that the
 government recognizes were created by specific acts of legislation for
@@ -489,9 +500,15 @@
 The sale of teaching, hand-holding and maintenance services could also
 employ programmers.
 
-People with new ideas could distribute programs as freeware, asking for
-donations from satisfied users, or selling hand-holding services.  I have
-met people who are already working this way successfully.
+People with new ideas could distribute programs as
+freeware@footnote{Subsequently we have learned to distinguish between
+"free software" and "freeware".  The term "freeware" means software
+you are free to redistribute, but usually you are not free to study
+and change the source code, so most of it is not free software.  See
+@uref{http://www.gnu.org/philosophy/words-to-avoid.html} for more
+explanation.}, asking for donations from satisfied users, or selling
+hand-holding services.  I have met people who are already working this
+way successfully.
 
 Users with related needs can form users' groups, and pay dues.  A group
 would contract with programming companies to write programs that the
--- a/man/mule.texi	Thu Jul 07 12:43:14 2005 +0000
+++ b/man/mule.texi	Thu Jul 14 08:02:00 2005 +0000
@@ -818,7 +818,7 @@
 
   If Emacs recognizes the encoding of a file incorrectly, you can
 reread the file using the correct coding system by typing @kbd{C-x
-@key{RET} c @var{coding-system} @key{RET} M-x revert-buffer
+@key{RET} r @var{coding-system}
 @key{RET}}.  To see what coding system Emacs actually used to decode
 the file, look at the coding system mnemonic letter near the left edge
 of the mode line (@pxref{Mode Line}), or type @kbd{C-h C @key{RET}}.
--- a/man/search.texi	Thu Jul 07 12:43:14 2005 +0000
+++ b/man/search.texi	Thu Jul 14 08:02:00 2005 +0000
@@ -294,7 +294,7 @@
 @kbd{@key{NEXT}} (@code{scroll-up}) and @kbd{C-l} (@code{recenter})
 within the search, thus letting you see more of the text near the
 current match.  You must run these commands via their key sequences to
-stay in the search---typing M-x @var{comand-name} will always
+stay in the search---typing M-x @var{command-name} will always
 terminate a search.
 
   You can give prefix arguments to these commands in the usual way.
@@ -309,6 +309,16 @@
 
   You can make other commands usable within an incremental search by
 giving the command a non-@code{nil} @code{isearch-scroll} property.
+For example, to make @kbd{C-h l} usable within an incremental search
+in all future Emacs sessions, use @kbd{C-h c} to find what command it
+runs.  (You type @kbd{C-h c C-h l}; it says @code{view-lossage}.)  Then
+you can put the following line in your @file{.emacs} file (@pxref{Init File}):
+
+@example
+(put 'view-lossage 'isearch-scroll t)
+@end example
+
+@noindent
 This works for commands that don't permanently change point, the
 buffer contents, the match data, the current buffer, or the selected
 window and frame.  The command must not delete the current window and
@@ -331,7 +341,8 @@
 @vindex search-slow-speed
   The slow terminal style of display is used when the terminal baud rate is
 less than or equal to the value of the variable @code{search-slow-speed},
-initially 1200.  See @code{baud-rate} in @ref{Display Custom}.
+initially 1200.  See also the discussion of the variable @code{baud-rate}
+(@pxref{baud-rate,, Customization of Display}).
 
 @vindex search-slow-window-lines
   The number of lines to use in slow terminal search display is controlled
@@ -1012,7 +1023,15 @@
 performs the inverse transformation.  To include a @samp{\} in the
 text to replace with, you must enter @samp{\\}.
 
-  You can also use Lisp expressions to calculate parts of the
+  If you want to enter part of the replacement string by hand each
+time, use @samp{\?} in the replacement string.  Each replacement will
+ask you to edit the replacement string in the minibuffer, putting
+point where the @samp{\?} was.
+
+  The remainder of this subsection is intended for specialized tasks
+and requires knowledge of Lisp.  Most readers can skip it.
+
+  You can use Lisp expressions to calculate parts of the
 replacement string.  To do this, write @samp{\,} followed by the
 expression in the replacement string.  Each replacement calculates the
 value of the expression and converts it to text without quoting (if
@@ -1050,22 +1069,6 @@
 \,(format "%-72sABC%05d" \& \#) @key{RET}
 @end example
 
-  If you want to enter part of the replacement string by hand each
-time, use @samp{\?} in the replacement string.  Each replacement will
-ask you to edit the replacement string in the minibuffer, putting
-point where the @samp{\?} was.  For example,
-
-@example
-M-x replace-regexp @key{RET} \\footnote@{ @key{RET}
-\&\\label@{fn:\#\?@} @key{RET}
-@end example
-
-@noindent
-will add labels starting with @samp{\label@{fn:0@}} to occurrences of
-@samp{\footnote@{}, but letting you edit each replacement before
-performing it.  To number the labels starting at 1, use @samp{\,(1+
-\#)} instead of @samp{\#}.
-
 @node Replacement and Case, Query Replace, Regexp Replace, Replace
 @subsection Replace Commands and Case
 
@@ -1257,7 +1260,8 @@
 for @var{regexp}.  To limit the search to part of the buffer, narrow
 to that part (@pxref{Narrowing}).  A numeric argument @var{n}
 specifies that @var{n} lines of context are to be displayed before and
-after each matching line.
+after each matching line.  Currently, @code{occur} can not correctly
+handle multiline matches.
 
 @kindex RET @r{(Occur mode)}
 @kindex o @r{(Occur mode)}
@@ -1271,7 +1275,7 @@
 does not select it.
 
 Occur mode supports the @code{next-error} functionality described in
-in @ref{Compilation Mode}.
+@ref{Compilation Mode}.
 
 @item M-x list-matching-lines
 Synonym for @kbd{M-x occur}.
@@ -1290,19 +1294,31 @@
 command operates on the region instead.
 
 @item M-x flush-lines @key{RET} @var{regexp} @key{RET}
-Delete each line that contains a match for @var{regexp}, operating on
-the text after point.  In Transient Mark mode, if the region is
-active, the command operates on the region instead.
+This command deletes each line that contains a match for @var{regexp},
+operating on the text after point; it deletes the current line
+if it contains a match starting after point.  In Transient Mark mode,
+if the region is active, the command operates on the region instead;
+it deletes a line partially contained in the region if it contains a
+match entirely contained in the region.
+
+If a match is split across lines, @code{flush-lines} deletes all those
+lines.  It deletes the lines before starting to look for the next
+match; hence, it ignores a match starting on the same line at which
+another match ended.
 
 @item M-x keep-lines @key{RET} @var{regexp} @key{RET}
-Delete each line that @emph{does not} contain a match for
-@var{regexp}, operating on the text after point.  In Transient Mark
-mode, if the region is active, the command operates on the region
-instead.
+This command deletes each line that @emph{does not} contain a match for
+@var{regexp}, operating on the text after point; if point is not at the
+beginning of a line, it always keeps the current line.  In Transient
+Mark mode, if the region is active, the command operates on the region
+instead; it never deletes lines that are only partially contained in
+the region (a newline that ends a line counts as part of that line).
+
+If a match is split across lines, this command keeps all those lines.
 @end table
 
   You can also search multiple files under control of a tags table
-(@pxref{Tags Search}) or through Dired @kbd{A} command
+(@pxref{Tags Search}) or through the Dired @kbd{A} command
 (@pxref{Operating on Files}), or ask the @code{grep} program to do it
 (@pxref{Grep Searching}).
 
--- a/man/viper.texi	Thu Jul 07 12:43:14 2005 +0000
+++ b/man/viper.texi	Thu Jul 14 08:02:00 2005 +0000
@@ -4502,6 +4502,7 @@
 kwzh@@gnu.org (Karl Heuer),
 lindstro@@biostat.wisc.edu (Mary Lindstrom),
 lektu@@terra.es (Juanma Barranquero),
+lennart.borgman.073@@student.lu.se (Lennart Borgman),
 minakaji@@osaka.email.ne.jp (Mikio Nakajima),
 Mark.Bordas@@East.Sun.COM (Mark Bordas),
 meyering@@comco.com (Jim Meyering),
@@ -4519,6 +4520,7 @@
 simonb@@prl.philips.co.uk (Simon Blanchard),
 spadgett1@@nc.rr.com (Samuel Padgett),
 stephen@@farrell.org (Stephen Farrell),
+storm@@cua.dk (Kim F. Storm),
 sudish@@MindSpring.COM (Sudish Joseph),
 schwab@@issan.informatik.uni-dortmund.de (Andreas Schwab)
 terra@@diku.dk (Morten Welinder),
--- a/src/ChangeLog	Thu Jul 07 12:43:14 2005 +0000
+++ b/src/ChangeLog	Thu Jul 14 08:02:00 2005 +0000
@@ -1,3 +1,130 @@
+2005-07-13  Kim F. Storm  <storm@cua.dk>
+
+	* xdisp.c (start_display): Don't reseat to next visible line start
+	if current start position is in a string or image.
+	(move_it_vertically_backward): Be sure to move out of strings and
+	images when moving it2 forward.
+	(move_it_by_lines): When moving forward, move to next buffer
+	position if we end up in a string or image.  When moving backward,
+	count rows moved over when moving to start of current row in case
+	row starts in middle of a string or image.  Also move further
+	backward if we end up in a string or image.
+	(try_cursor_movement): if overlay string spans multiple lines,
+	move backward to set cursor on start of an overlay string.
+	(cursor_row_p): Row is ok if cursor is at newline from string, but
+	string starts on this line (so we always position cursor at start
+	of string).
+
+	* indent.c (Fvertical_motion): If start position is on an image,
+	don't move back if we move too far (that's almost certain to happen).
+
+	* xdisp.c (cursor_row_fully_visible_p): Allow partially visible
+	row in minibuffer windows.
+	(try_window): Don't check margins in minibuffer windows.
+
+2005-07-13  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+	* macterm.c: Don't include stdlib.h or composite.h.
+	(x_use_underline_position_properties, last_mouse_press_frame)
+	(x_noop_count, Qvendor_specific_keysyms): Remove unused variables.
+	(syms_of_macterm, mac_initialize): Don't initialize them.
+	(waiting_for_input, initial_argv, initial_argc)
+	(Vcommand_line_args, Vx_no_window_manager, errno, window_scroll)
+	(set_frame_menubar, path_from_vol_dir_name): Remove externs.
+	(extra_keyboard_modifiers): Fix type in extern.
+	(x_window_to_frame, x_window_to_scroll_bar): Remove declarations.
+	(x_scroll_bar_report_motion): Add argument types to declaration.
+	(mac_compute_glyph_string_overhangs): Add declaration.
+	(disable_mouse_highlight): Remove unused variable.
+	[USE_TOOLKIT_SCROLL_BARS] (construct_scroll_bar_click)
+	(x_scroll_bar_handle_press, x_scroll_bar_handle_release)
+	(x_scroll_bar_handle_drag): Remove argument `timestamp'.  All
+	callers changed.
+	[USE_TOOLKIT_SCROLL_BARS] (construct_scroll_bar_click): Don't set
+	timestamp.
+	[USE_CARBON_EVENTS] (mac_handle_mouse_event): Likewise.
+	(x_scroll_bar_create, XTset_vertical_scroll_bar): Show scroll bar
+	only when its width is less than the height.
+	(XTredeem_scroll_bar): Sync with xterm.c.
+	(font_name_table, font_name_table_size, font_name_count): Make
+	static.
+	(drag_and_drop_file_list): Remove variable.  Previous use is now
+	local to function.
+	(do_ae_open_documents): Move DRAG_N_DROP event construction part
+	from XTread_socket.
+	(XTread_socket): Consolidate setting of event timestamp.  Move
+	DRAG_N_DROP event construction part to do_ae_open_documents.
+	Support extra_keyboard_modifiers.
+
+	* xfaces.c (try_font_list) [MAC_OS]: Try font family name
+	beginning with that for ASCII.
+
+2005-07-13  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* alloc.c (gc_cons_combined_threshold, Vgc_cons_percentage): New vars.
+	(Fgarbage_collect, init_alloc_once): Set gc_cons_combined_threshold.
+	(syms_of_alloc): Declare gc-cons-percentage.
+
+	* eval.c (Feval, Ffuncall):
+	* keyboard.c (read_char):
+	* bytecode.c (MAYBE_GC): Use gc_cons_combined_threshold.
+
+	* lisp.h (gc_cons_combined_threshold): Declare.
+
+2005-07-12  Kim F. Storm  <storm@cua.dk>
+
+	* coding.c (Qprocess_argument):
+	* coding.h (Qprocess_argument): Remove unused var.
+
+	* xselect.c (intern): Remove dup. intern and staticpro for QTIMESTAMP.
+
+2005-07-12  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+	* mac.c [!TARGET_API_MAC_CARBON]: Include charset.h, coding.h, and
+	Endian.h.
+	[!MAC_OSX] (fchmod, fchown): New functions.
+	(mac_get_code_from_arg): Don't accept Lisp integer as argument.
+	Use SBYTES and EndianU32_BtoN.
+	(mac_get_object_from_code): Return 4 byte string even if argument
+	is 0.  Use make_unibyte_string and EndianU32_NtoB.
+	(Fmac_get_file_creator, Fmac_get_file_type, Fmac_set_file_creator)
+	(Fmac_set_file_type): Fix documents and argument declarations.
+	Don't specify kFSCatInfoNodeFlags.  Support Mac OS Classic.
+
+2005-07-11  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* window.c (Frecenter): Yet another int/Lisp_Object mixup (YAILOM).
+
+2005-07-11  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>
+
+	* xfaces.c (x_update_menu_appearance): Use fontSet resource for
+	Lucid if X_I18N, font otherwise.
+
+2005-07-10  Steven Tamm  <steventamm@mac.com>
+
+	* mac.c (Fmac_get_file_type, Fmac_get_file_creator): Add.
+	(Fmac_set_file_type, Fmac_set_file_creator): Add.
+	(mac_get_object_from_code, mac_get_code_from_arg): Add.
+
+2005-07-10  Richard M. Stallman  <rms@gnu.org>
+
+	* lread.c (Qeval_buffer_list, Veval_buffer_list): New vars.
+	(syms_of_lread): Set up eval-buffer-list.
+	(Feval_buffer, Feval_region): Bind eval-buffer-list.
+
+2005-07-08  Richard M. Stallman  <rms@gnu.org>
+
+	* eval.c (Fdefvar): Allow defvaring a constant to itself quoted.
+
+2005-07-08  Kim F. Storm  <storm@cua.dk>
+
+	* keyboard.c (menu_bar_items): Don't GCPRO menu_bar_items_vector here.
+	(syms_of_keyboard): Initialize and staticpro menu_bar_items_vector.
+
+2005-07-07  Kim F. Storm  <storm@cua.dk>
+
+	* window.c (Frecenter): Fix last change (set iarg before use).
+
 2005-07-06  Richard M. Stallman  <rms@gnu.org>
 
 	* window.c (Frecenter): When arg is inside the scroll margin,
@@ -7,7 +134,7 @@
 
 	* w32console.c (initialize_w32_display): Detect when the console
 	dimensions are insane, and default to 80x25 instead.
-	(w32_use_full_screen_buffer): default to NIL.
+	(w32_use_full_screen_buffer): Default to NIL.
 
 2005-07-06  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
 
@@ -15,11 +142,11 @@
 	VERTICAL_BORDER_FACE_ID for vertical border line.
 	(mac_encode_char): Call check_ccl_update in advance.
 	(mac_to_x_fontname, x_font_name_to_mac_font_name)
-	(init_font_name_table, mac_do_list_fonts, XLoadQueryFont): Don't
-	assume that font family length is less than 32.
+	(init_font_name_table, mac_do_list_fonts, XLoadQueryFont):
+	Don't assume that font family length is less than 32.
 	(x_compute_min_glyph_bounds): Make static.
 	(x_load_font): Never set fonts_changed_p to zero.
-	
+
 2005-07-04  Lute Kamstra  <lute@gnu.org>
 
 	* Update FSF's address in GPL notices.
@@ -67,8 +194,7 @@
 
 2005-07-01  Masatake YAMATO  <jet@gyve.org>
 
-	* emacs.c (main): Passing ADD_NO_RANDOMIZE to
-	`personality'.
+	* emacs.c (main): Passing ADD_NO_RANDOMIZE to `personality'.
 
 2005-06-30  Juri Linkov  <juri@jurta.org>
 
@@ -196,7 +322,7 @@
 
 2005-06-22  Miles Bader  <miles@gnu.org>
 
-	* xfaces.c (Qvertical_border): Renamed from `Qvertical_divider'.
+	* xfaces.c (Qvertical_border): Rename from `Qvertical_divider'.
 	(realize_basic_faces, syms_of_xfaces): Update references to it.
 	* dispextern.h (enum face_id): Rename `VERTICAL_DIVIDER_FACE_ID'
 	to `VERTICAL_BORDER_FACE_ID'.
@@ -235,8 +361,8 @@
 
 2005-06-17  Richard M. Stallman  <rms@gnu.org>
 
-	* xdisp.c (get_next_display_element): Reverse
-	test of Vshow_nonbreak_escape.
+	* xdisp.c (get_next_display_element):
+	Reverse test of Vshow_nonbreak_escape.
 
 	* term.c (produce_special_glyphs): Use spec_glyph_lookup_face.
 	(Ftty_no_underline): New function.
--- a/src/alloc.c	Thu Jul 07 12:43:14 2005 +0000
+++ b/src/alloc.c	Thu Jul 14 08:02:00 2005 +0000
@@ -174,7 +174,9 @@
 
 /* Number of bytes of consing since GC before another GC should be done. */
 
-EMACS_INT gc_cons_threshold;
+static EMACS_INT gc_cons_threshold;
+EMACS_INT gc_cons_combined_threshold;
+static Lisp_Object Vgc_cons_percentage;
 
 /* Nonzero during GC.  */
 
@@ -4854,6 +4856,26 @@
   if (gc_cons_threshold < 10000)
     gc_cons_threshold = 10000;
 
+  gc_cons_combined_threshold = gc_cons_threshold;
+
+  if (FLOATP (Vgc_cons_percentage))
+    { /* Set gc_cons_combined_threshold.  */
+      EMACS_INT total = 0;
+      EMACS_INT threshold;
+      total += total_conses  * sizeof (struct Lisp_Cons);
+      total += total_symbols * sizeof (struct Lisp_Symbol);
+      total += total_markers * sizeof (union Lisp_Misc);
+      total += total_string_size;
+      total += total_vector_size * sizeof (Lisp_Object);
+      total += total_floats  * sizeof (struct Lisp_Float);
+      total += total_intervals * sizeof (struct interval);
+      total += total_strings * sizeof (struct Lisp_String);
+      
+      threshold = total * XFLOAT_DATA (Vgc_cons_percentage);
+      if (threshold > gc_cons_combined_threshold)
+	gc_cons_combined_threshold = threshold;
+    }
+
   if (garbage_collection_messages)
     {
       if (message_p || minibuf_level > 0)
@@ -5943,6 +5965,7 @@
   staticidx = 0;
   consing_since_gc = 0;
   gc_cons_threshold = 100000 * sizeof (Lisp_Object);
+  gc_cons_combined_threshold = gc_cons_threshold;
 #ifdef VIRT_ADDR_VARIES
   malloc_sbrk_unused = 1<<22;	/* A large number */
   malloc_sbrk_used = 100000;	/* as reasonable as any number */
@@ -5974,7 +5997,15 @@
 Garbage collection happens automatically only when `eval' is called.
 
 By binding this temporarily to a large number, you can effectively
-prevent garbage collection during a part of the program.  */);
+prevent garbage collection during a part of the program.
+See also `gc-cons-percentage'.  */);
+
+  DEFVAR_LISP ("gc-cons-percentage", &Vgc_cons_percentage,
+	       doc: /* *Portion of the heap used for allocation.
+Garbage collection can happen automatically once this portion of the heap
+has been allocated since the last garbage collection.
+If this portion is smaller than `gc-cons-threshold', this is ignored.  */);
+  Vgc_cons_percentage = make_float (0.1);
 
   DEFVAR_INT ("pure-bytes-used", &pure_bytes_used,
 	      doc: /* Number of bytes of sharable Lisp data allocated so far.  */);
--- a/src/bytecode.c	Thu Jul 07 12:43:14 2005 +0000
+++ b/src/bytecode.c	Thu Jul 14 08:02:00 2005 +0000
@@ -355,13 +355,13 @@
 /* Garbage collect if we have consed enough since the last time.
    We do this at every branch, to avoid loops that never GC.  */
 
-#define MAYBE_GC()				\
-  if (consing_since_gc > gc_cons_threshold)	\
-    {						\
-      BEFORE_POTENTIAL_GC ();			\
-      Fgarbage_collect ();			\
-      AFTER_POTENTIAL_GC ();			\
-    }						\
+#define MAYBE_GC()				     \
+  if (consing_since_gc > gc_cons_combined_threshold) \
+    {						     \
+      BEFORE_POTENTIAL_GC ();			     \
+      Fgarbage_collect ();			     \
+      AFTER_POTENTIAL_GC ();			     \
+    }						     \
   else
 
 /* Check for jumping out of range.  */
--- a/src/coding.c	Thu Jul 07 12:43:14 2005 +0000
+++ b/src/coding.c	Thu Jul 14 08:02:00 2005 +0000
@@ -316,7 +316,7 @@
 Lisp_Object QCpost_read_conversion, QCpre_write_conversion;
 
 extern Lisp_Object Qinsert_file_contents, Qwrite_region;
-Lisp_Object Qcall_process, Qcall_process_region, Qprocess_argument;
+Lisp_Object Qcall_process, Qcall_process_region;
 Lisp_Object Qstart_process, Qopen_network_stream;
 Lisp_Object Qtarget_idx;
 
--- a/src/coding.h	Thu Jul 07 12:43:14 2005 +0000
+++ b/src/coding.h	Thu Jul 14 08:02:00 2005 +0000
@@ -704,7 +704,7 @@
 
 #ifdef emacs
 extern Lisp_Object Qfile_coding_system;
-extern Lisp_Object Qcall_process, Qcall_process_region, Qprocess_argument;
+extern Lisp_Object Qcall_process, Qcall_process_region;
 extern Lisp_Object Qstart_process, Qopen_network_stream;
 extern Lisp_Object Qwrite_region;
 
--- a/src/eval.c	Thu Jul 07 12:43:14 2005 +0000
+++ b/src/eval.c	Thu Jul 14 08:02:00 2005 +0000
@@ -807,8 +807,16 @@
 
   sym = Fcar (args);
   if (SYMBOL_CONSTANT_P (sym))
-    error ("Constant symbol `%s' specified in defvar",
-           SDATA (SYMBOL_NAME (sym)));
+    {
+      /* For updward compatibility, allow (defvar :foo (quote :foo)).  */
+      tem = Fcar (Fcdr (args));
+      if (! (CONSP (tem)
+	     && EQ (XCAR (tem), Qquote)
+	     && CONSP (XCDR (tem))
+	     && EQ (XCAR (XCDR (tem)), sym)))
+	error ("Constant symbol `%s' specified in defvar",
+	       SDATA (SYMBOL_NAME (sym)));
+    }
 
   tail = Fcdr (args);
   if (!NILP (Fcdr (Fcdr (tail))))
@@ -2085,7 +2093,7 @@
     return form;
 
   QUIT;
-  if (consing_since_gc > gc_cons_threshold)
+  if (consing_since_gc > gc_cons_combined_threshold)
     {
       GCPRO1 (form);
       Fgarbage_collect ();
@@ -2785,7 +2793,7 @@
   register int i;
 
   QUIT;
-  if (consing_since_gc > gc_cons_threshold)
+  if (consing_since_gc > gc_cons_combined_threshold)
     Fgarbage_collect ();
 
   if (++lisp_eval_depth > max_lisp_eval_depth)
--- a/src/indent.c	Thu Jul 07 12:43:14 2005 +0000
+++ b/src/indent.c	Thu Jul 14 08:02:00 2005 +0000
@@ -2074,6 +2074,7 @@
     {
       int it_start;
       int oselective;
+      int start_on_image_p;
 
       SET_TEXT_POS (pt, PT, PT_BYTE);
       start_display (&it, w, pt);
@@ -2085,6 +2086,7 @@
 	 while the end position is really at some X > 0, the same X that
 	 PT had.  */
       it_start = IT_CHARPOS (it);
+      start_on_image_p = (it.method == GET_FROM_IMAGE);
       reseat_at_previous_visible_line_start (&it);
       it.current_x = it.hpos = 0;
       /* Temporarily disable selective display so we don't move too far */
@@ -2094,8 +2096,10 @@
       it.selective = oselective;
 
       /* Move back if we got too far.  This may happen if
-	 truncate-lines is on and PT is beyond right margin.  */
-      if (IT_CHARPOS (it) > it_start && XINT (lines) > 0)
+	 truncate-lines is on and PT is beyond right margin.
+	 It may also happen if it_start is on an image --
+	 in that case, don't go back.  */
+      if (IT_CHARPOS (it) > it_start && XINT (lines) > 0 && !start_on_image_p)
 	move_it_by_lines (&it, -1, 0);
 
       it.vpos = 0;
--- a/src/keyboard.c	Thu Jul 07 12:43:14 2005 +0000
+++ b/src/keyboard.c	Thu Jul 14 08:02:00 2005 +0000
@@ -2778,7 +2778,7 @@
 		 available, garbage collect if there has been enough
 		 consing going on to make it worthwhile.  */
 	      if (!detect_input_pending_run_timers (0)
-		  && consing_since_gc > gc_cons_threshold / 2)
+		  && consing_since_gc > gc_cons_combined_threshold / 2)
 		Fgarbage_collect ();
 
 	      redisplay ();
@@ -6916,8 +6916,6 @@
 
   int i;
 
-  struct gcpro gcpro1;
-
   /* In order to build the menus, we need to call the keymap
      accessors.  They all call QUIT.  But this function is called
      during redisplay, during which a quit is fatal.  So inhibit
@@ -6933,8 +6931,6 @@
     menu_bar_items_vector = Fmake_vector (make_number (24), Qnil);
   menu_bar_items_index = 0;
 
-  GCPRO1 (menu_bar_items_vector);
-
   /* Build our list of keymaps.
      If we recognize a function key and replace its escape sequence in
      keybuf with its symbol, or if the sequence starts with a mouse
@@ -7038,7 +7034,6 @@
   menu_bar_items_index = i;
 
   Vinhibit_quit = oquit;
-  UNGCPRO;
   return menu_bar_items_vector;
 }
 
@@ -11009,6 +11004,9 @@
   menu_bar_one_keymap_changed_items = Qnil;
   staticpro (&menu_bar_one_keymap_changed_items);
 
+  menu_bar_items_vector = Qnil;
+  staticpro (&menu_bar_items_vector);
+
   defsubr (&Sevent_convert_list);
   defsubr (&Sread_key_sequence);
   defsubr (&Sread_key_sequence_vector);
--- a/src/lisp.h	Thu Jul 07 12:43:14 2005 +0000
+++ b/src/lisp.h	Thu Jul 14 08:02:00 2005 +0000
@@ -1888,7 +1888,7 @@
 
 /* Threshold for doing another gc.  */
 
-extern EMACS_INT gc_cons_threshold;
+extern EMACS_INT gc_cons_combined_threshold;
 
 /* Structure for recording stack slots that need marking.  */
 
--- a/src/lread.c	Thu Jul 07 12:43:14 2005 +0000
+++ b/src/lread.c	Thu Jul 14 08:02:00 2005 +0000
@@ -87,6 +87,7 @@
 Lisp_Object Qascii_character, Qload, Qload_file_name;
 Lisp_Object Qbackquote, Qcomma, Qcomma_at, Qcomma_dot, Qfunction;
 Lisp_Object Qinhibit_file_name_operation;
+Lisp_Object Qeval_buffer_list, Veval_buffer_list;
 
 /* Used instead of Qget_file_char while loading *.elc files compiled
    by Emacs 21 or older.  */
@@ -1643,6 +1644,7 @@
   if (NILP (filename))
     filename = XBUFFER (buf)->filename;
 
+  specbind (Qeval_buffer_list, Fcons (buf, Veval_buffer_list));
   specbind (Qstandard_output, tem);
   record_unwind_protect (save_excursion_restore, save_excursion_save ());
   BUF_SET_PT (XBUFFER (buf), BUF_BEGV (XBUFFER (buf)));
@@ -1678,6 +1680,7 @@
   else
     tem = printflag;
   specbind (Qstandard_output, tem);
+  specbind (Qeval_buffer_list, Fcons (cbuf, Veval_buffer_list));
 
   /* readevalloop calls functions which check the type of start and end.  */
   readevalloop (cbuf, 0, XBUFFER (cbuf)->filename, Feval,
@@ -4099,6 +4102,10 @@
   Vbytecomp_version_regexp
     = build_string ("^;;;.\\(in Emacs version\\|bytecomp version FSF\\)");
 
+  DEFVAR_LISP ("eval-buffer-list", &Veval_buffer_list,
+	       doc: /* List of buffers being read from by calls to `eval-buffer' and `eval-region'.  */);
+  Veval_buffer_list = Qnil;
+
   /* Vsource_directory was initialized in init_lread.  */
 
   load_descriptor_list = Qnil;
@@ -4146,6 +4153,9 @@
   Qload_file_name = intern ("load-file-name");
   staticpro (&Qload_file_name);
 
+  Qeval_buffer_list = intern ("eval-buffer-list");
+  staticpro (&Qeval_buffer_list);
+
   staticpro (&dump_path);
 
   staticpro (&read_objects);
--- a/src/mac.c	Thu Jul 07 12:43:14 2005 +0000
+++ b/src/mac.c	Thu Jul 14 08:02:00 2005 +0000
@@ -34,10 +34,9 @@
 
 #include "macterm.h"
 
-#if TARGET_API_MAC_CARBON
 #include "charset.h"
 #include "coding.h"
-#else  /* not TARGET_API_MAC_CARBON */
+#if !TARGET_API_MAC_CARBON
 #include <Files.h>
 #include <MacTypes.h>
 #include <TextUtils.h>
@@ -53,6 +52,7 @@
 #include <Processes.h>
 #include <EPPC.h>
 #include <MacLocales.h>
+#include <Endian.h>
 #endif	/* not TARGET_API_MAC_CARBON */
 
 #include <utime.h>
@@ -1021,7 +1021,7 @@
   CFTypeID type_id = CFGetTypeID (plist);
 
   if (type_id == CFStringGetTypeID ())
-      return cfstring_to_lisp (plist);
+    return cfstring_to_lisp (plist);
   else if (type_id == CFNumberGetTypeID ())
     {
       CFStringRef string;
@@ -2490,6 +2490,22 @@
 
 
 int
+fchmod (int fd, mode_t mode)
+{
+  /* say it always succeed for now */
+  return 0;
+}
+
+
+int
+fchown (int fd, uid_t owner, gid_t group)
+{
+  /* say it always succeed for now */
+  return 0;
+}
+
+
+int
 dup (int oldd)
 {
 #ifdef __MRC__
@@ -3388,12 +3404,278 @@
 }
 
 
-void terminate_applescript()
+void
+terminate_applescript()
 {
   OSADispose (as_scripting_component, as_script_context);
   CloseComponent (as_scripting_component);
 }
 
+/* Convert a lisp string to the 4 byte character code.  */
+ 
+OSType
+mac_get_code_from_arg(Lisp_Object arg, OSType defCode)
+{
+  OSType result;
+  if (NILP(arg))
+    {
+      result = defCode;
+    } 
+  else
+    {
+      /* check type string */
+      CHECK_STRING(arg);
+      if (SBYTES (arg) != 4)
+	{
+	  error ("Wrong argument: need string of length 4 for code");
+	}
+      result = EndianU32_BtoN (*((UInt32 *) SDATA (arg)));
+    }
+  return result;
+}
+
+/* Convert the 4 byte character code into a 4 byte string.  */
+
+Lisp_Object
+mac_get_object_from_code(OSType defCode)
+{
+  UInt32 code = EndianU32_NtoB (defCode);
+
+  return make_unibyte_string ((char *)&code, 4);
+}
+
+
+DEFUN ("mac-get-file-creator", Fmac_get_file_creator, Smac_get_file_creator, 1, 1, 0,
+       doc: /* Get the creator code of FILENAME as a four character string. */)
+  (filename)
+     Lisp_Object filename;
+{
+  OSErr	status;
+#ifdef MAC_OSX
+  FSRef fref;
+#else
+  FSSpec fss;
+#endif
+  OSType cCode;
+  Lisp_Object result = Qnil;
+  CHECK_STRING (filename);
+
+  if (NILP(Ffile_exists_p(filename)) || !NILP(Ffile_directory_p(filename))) {
+    return Qnil;
+  }
+  filename = Fexpand_file_name (filename, Qnil);
+
+  BLOCK_INPUT;
+#ifdef MAC_OSX
+  status = FSPathMakeRef(SDATA(ENCODE_FILE(filename)), &fref, NULL);
+#else
+  status = posix_pathname_to_fsspec (SDATA (ENCODE_FILE (filename)), &fss);
+#endif
+
+  if (status == noErr)
+    {
+#ifdef MAC_OSX
+      FSCatalogInfo catalogInfo;
+
+      status = FSGetCatalogInfo(&fref, kFSCatInfoFinderInfo,
+				&catalogInfo, NULL, NULL, NULL);
+#else
+      FInfo finder_info;
+
+      status = FSpGetFInfo (&fss, &finder_info);
+#endif
+      if (status == noErr) 
+	{
+#ifdef MAC_OSX
+	  result = mac_get_object_from_code(((FileInfo*)&catalogInfo.finderInfo)->fileCreator);
+#else
+	  result = mac_get_object_from_code (finder_info.fdCreator);
+#endif
+	}
+    }
+  UNBLOCK_INPUT;
+  if (status != noErr) {
+    error ("Error while getting file information.");
+  }
+  return result;
+}
+
+DEFUN ("mac-get-file-type", Fmac_get_file_type, Smac_get_file_type, 1, 1, 0,
+       doc: /* Get the type code of FILENAME as a four character string. */)
+  (filename)
+     Lisp_Object filename;
+{
+  OSErr	status;
+#ifdef MAC_OSX
+  FSRef fref;
+#else
+  FSSpec fss;
+#endif
+  OSType cCode;
+  Lisp_Object result = Qnil;
+  CHECK_STRING (filename);
+
+  if (NILP(Ffile_exists_p(filename)) || !NILP(Ffile_directory_p(filename))) {
+    return Qnil;
+  }
+  filename = Fexpand_file_name (filename, Qnil);
+
+  BLOCK_INPUT;
+#ifdef MAC_OSX
+  status = FSPathMakeRef(SDATA(ENCODE_FILE(filename)), &fref, NULL);
+#else
+  status = posix_pathname_to_fsspec (SDATA (ENCODE_FILE (filename)), &fss);
+#endif
+
+  if (status == noErr)
+    {
+#ifdef MAC_OSX
+      FSCatalogInfo catalogInfo;
+
+      status = FSGetCatalogInfo(&fref, kFSCatInfoFinderInfo,
+				&catalogInfo, NULL, NULL, NULL);
+#else
+      FInfo finder_info;
+
+      status = FSpGetFInfo (&fss, &finder_info);
+#endif
+      if (status == noErr) 
+	{
+#ifdef MAC_OSX
+	  result = mac_get_object_from_code(((FileInfo*)&catalogInfo.finderInfo)->fileType);
+#else
+	  result = mac_get_object_from_code (finder_info.fdType);
+#endif
+	}
+    }
+  UNBLOCK_INPUT;
+  if (status != noErr) {
+    error ("Error while getting file information.");
+  }
+  return result;
+}
+
+DEFUN ("mac-set-file-creator", Fmac_set_file_creator, Smac_set_file_creator, 1, 2, 0,
+       doc: /* Set creator code of file FILENAME to CODE.
+If non-nil, CODE must be a 4-character string.  Otherwise, 'EMAx' is
+assumed. Return non-nil if successful.  */)
+  (filename, code)
+     Lisp_Object filename, code;
+{
+  OSErr	status;
+#ifdef MAC_OSX
+  FSRef fref;
+#else
+  FSSpec fss;
+#endif
+  OSType cCode;
+  CHECK_STRING (filename);
+
+  cCode = mac_get_code_from_arg(code, 'EMAx');
+
+  if (NILP(Ffile_exists_p(filename)) || !NILP(Ffile_directory_p(filename))) {
+    return Qnil;
+  }
+  filename = Fexpand_file_name (filename, Qnil);
+
+  BLOCK_INPUT;
+#ifdef MAC_OSX
+  status = FSPathMakeRef(SDATA(ENCODE_FILE(filename)), &fref, NULL);
+#else
+  status = posix_pathname_to_fsspec (SDATA (ENCODE_FILE (filename)), &fss);
+#endif
+
+  if (status == noErr)
+    {
+#ifdef MAC_OSX
+      FSCatalogInfo catalogInfo;
+      FSRef parentDir;
+      status = FSGetCatalogInfo(&fref, kFSCatInfoFinderInfo,
+				&catalogInfo, NULL, NULL, &parentDir);
+#else
+      FInfo finder_info;
+
+      status = FSpGetFInfo (&fss, &finder_info);
+#endif
+      if (status == noErr) 
+	{
+#ifdef MAC_OSX
+	((FileInfo*)&catalogInfo.finderInfo)->fileCreator = cCode;
+	status = FSSetCatalogInfo(&fref, kFSCatInfoFinderInfo, &catalogInfo);
+	/* TODO: on Mac OS 10.2, we need to touch the parent dir, FNNotify? */
+#else
+	finder_info.fdCreator = cCode;
+	status = FSpSetFInfo (&fss, &finder_info);
+#endif
+	}
+    }
+  UNBLOCK_INPUT;
+  if (status != noErr) {
+    error ("Error while setting creator information.");
+  }
+  return Qt;
+}
+
+DEFUN ("mac-set-file-type", Fmac_set_file_type, Smac_set_file_type, 2, 2, 0,
+       doc: /* Set file code of file FILENAME to CODE.
+CODE must be a 4-character string.  Return non-nil if successful.  */)
+  (filename, code)
+     Lisp_Object filename, code;
+{
+  OSErr	status;
+#ifdef MAC_OSX
+  FSRef fref;
+#else
+  FSSpec fss;
+#endif
+  OSType cCode;
+  CHECK_STRING (filename);
+
+  cCode = mac_get_code_from_arg(code, 0); /* Default to empty code*/
+
+  if (NILP(Ffile_exists_p(filename)) || !NILP(Ffile_directory_p(filename))) {
+    return Qnil;
+  }
+  filename = Fexpand_file_name (filename, Qnil);
+
+  BLOCK_INPUT;
+#ifdef MAC_OSX
+  status = FSPathMakeRef(SDATA(ENCODE_FILE(filename)), &fref, NULL);
+#else
+  status = posix_pathname_to_fsspec (SDATA (ENCODE_FILE (filename)), &fss);
+#endif
+
+  if (status == noErr)
+    {
+#ifdef MAC_OSX
+      FSCatalogInfo catalogInfo;
+      FSRef parentDir;
+      status = FSGetCatalogInfo(&fref, kFSCatInfoFinderInfo,
+				&catalogInfo, NULL, NULL, &parentDir);
+#else
+      FInfo finder_info;
+
+      status = FSpGetFInfo (&fss, &finder_info);
+#endif
+      if (status == noErr) 
+	{
+#ifdef MAC_OSX
+	((FileInfo*)&catalogInfo.finderInfo)->fileType = cCode;
+	status = FSSetCatalogInfo(&fref, kFSCatInfoFinderInfo, &catalogInfo);
+	/* TODO: on Mac OS 10.2, we need to touch the parent dir, FNNotify? */
+#else
+	finder_info.fdType = cCode;
+	status = FSpSetFInfo (&fss, &finder_info);
+#endif
+	}
+    }
+  UNBLOCK_INPUT;
+  if (status != noErr) {
+    error ("Error while setting creator information.");
+  }
+  return Qt;
+}
+
 
 /* Compile and execute the AppleScript SCRIPT and return the error
    status as function value.  A zero is returned if compilation and
@@ -4361,6 +4643,10 @@
 #endif
   defsubr (&Smac_clear_font_name_table);
 
+  defsubr (&Smac_set_file_creator);
+  defsubr (&Smac_set_file_type);
+  defsubr (&Smac_get_file_creator);
+  defsubr (&Smac_get_file_type);
   defsubr (&Sdo_applescript);
   defsubr (&Smac_file_name_to_posix);
   defsubr (&Sposix_file_name_to_mac);
--- a/src/macterm.c	Thu Jul 07 12:43:14 2005 +0000
+++ b/src/macterm.c	Thu Jul 14 08:02:00 2005 +0000
@@ -22,10 +22,10 @@
 
 #include <config.h>
 #include <signal.h>
+
 #include <stdio.h>
-#include <stdlib.h>
+
 #include "lisp.h"
-#include "charset.h"
 #include "blockinput.h"
 
 #include "macterm.h"
@@ -62,8 +62,6 @@
 
 #include "systty.h"
 #include "systime.h"
-#include "atimer.h"
-#include "keymap.h"
 
 #include <ctype.h>
 #include <errno.h>
@@ -71,7 +69,8 @@
 #include <sys/stat.h>
 #include <sys/param.h>
 
-#include "keyboard.h"
+#include "charset.h"
+#include "coding.h"
 #include "frame.h"
 #include "dispextern.h"
 #include "fontset.h"
@@ -82,10 +81,11 @@
 #include "disptab.h"
 #include "buffer.h"
 #include "window.h"
+#include "keyboard.h"
 #include "intervals.h"
-#include "composite.h"
+#include "atimer.h"
+#include "keymap.h"
 #include "character.h"
-#include "coding.h"
 #include "ccl.h"
 
 /* Set of macros that handle mapping of Mac modifier keys to emacs.  */
@@ -116,15 +116,6 @@
 /* Last window where we saw the mouse.  Used by mouse-autoselect-window.  */
 static Lisp_Object last_window;
 
-/* Non-zero means make use of UNDERLINE_POSITION font properties.  */
-
-int x_use_underline_position_properties;
-
-/* Non-zero means draw block and hollow cursor as wide as the glyph
-   under it.  For example, if a block cursor is over a tab, it will be
-   drawn as wide as that tab on the display.  */
-
-
 /* This is a chain of structures for all the X displays currently in
    use.  */
 
@@ -150,8 +141,6 @@
 
 extern struct frame *updating_frame;
 
-extern int waiting_for_input;
-
 /* This is a frame waiting to be auto-raised, within XTread_socket.  */
 
 struct frame *pending_autoraise_frame;
@@ -179,7 +168,6 @@
 /* Where the mouse was last time we reported a mouse event.  */
 
 static Rect last_mouse_glyph;
-static Lisp_Object last_mouse_press_frame;
 
 /* The scroll bar in which the last X motion event occurred.
 
@@ -213,45 +201,24 @@
 static int input_signal_count;
 #endif
 
-/* Used locally within XTread_socket.  */
-
-static int x_noop_count;
-
-/* Initial values of argv and argc.  */
-
-extern char **initial_argv;
-extern int initial_argc;
-
-extern Lisp_Object Vcommand_line_args, Vsystem_name;
-
-/* Tells if a window manager is present or not.  */
-
-extern Lisp_Object Vx_no_window_manager;
-
-extern int errno;
+extern Lisp_Object Vsystem_name;
 
 /* A mask of extra modifier bits to put into every keyboard char.  */
 
-extern int extra_keyboard_modifiers;
+extern EMACS_INT extra_keyboard_modifiers;
 
 /* The keysyms to use for the various modifiers.  */
 
 static Lisp_Object Qalt, Qhyper, Qsuper, Qmodifier_value;
 
-static Lisp_Object Qvendor_specific_keysyms;
-
-#if 0
-extern XrmDatabase x_load_resources P_ ((Display *, char *, char *, char *));
-#endif
-
 extern int inhibit_window_system;
 
 #if __MRC__ && !TARGET_API_MAC_CARBON
 QDGlobals qd;  /* QuickDraw global information structure.  */
 #endif
 
-
-struct frame * x_window_to_frame (struct mac_display_info *, WindowPtr);
+#define mac_window_to_frame(wp) (((mac_output *) GetWRefCon (wp))->mFP)
+
 struct mac_display_info *mac_display_info_for_display (Display *);
 static void x_update_window_end P_ ((struct window *, int, int));
 static int x_io_error_quitter P_ ((Display *));
@@ -291,17 +258,18 @@
 static void x_update_begin P_ ((struct frame *));
 static void x_update_window_begin P_ ((struct window *));
 static void x_after_update_window_line P_ ((struct glyph_row *));
+static void x_scroll_bar_report_motion P_ ((struct frame **, Lisp_Object *,
+					    enum scroll_bar_part *,
+					    Lisp_Object *, Lisp_Object *,
+					    unsigned long *));
 
 static int is_emacs_window (WindowPtr);
 
 int x_bitmap_icon (struct frame *, Lisp_Object);
 void x_make_frame_visible (struct frame *);
 
-extern void window_scroll (Lisp_Object, int, int, int);
-
 /* Defined in macmenu.h.  */
 extern void menubar_selection_callback (FRAME_PTR, int);
-extern void set_frame_menubar (FRAME_PTR, int, int);
 
 /* X display function emulation */
 
@@ -914,24 +882,6 @@
 }
 
 
-#if 0
-/* Convert a pair of local coordinates to global (screen) coordinates.
-   Assume graphic port has been properly set.  */
-static void
-local_to_global_coord (short *h, short *v)
-{
-  Point p;
-
-  p.h = *h;
-  p.v = *v;
-
-  LocalToGlobal (&p);
-
-  *h = p.h;
-  *v = p.v;
-}
-#endif
-
 /* Mac replacement for XCopyArea: used only for scrolling.  */
 
 static void
@@ -955,23 +905,10 @@
   Rect src_r, dest_r;
 
   SetPort (w);
-#if 0
-  mac_set_colors (gc, NULL);
-#endif
 
   SetRect (&src_r, src_x, src_y, src_x + width, src_y + height);
   SetRect (&dest_r, dest_x, dest_y, dest_x + width, dest_y + height);
 
-#if 0
-  /* Need to use global coordinates and screenBits since src and dest
-     areas overlap in general.  */
-  local_to_global_coord (&src_r.left, &src_r.top);
-  local_to_global_coord (&src_r.right, &src_r.bottom);
-  local_to_global_coord (&dest_r.left, &dest_r.top);
-  local_to_global_coord (&dest_r.right, &dest_r.bottom);
-
-  CopyBits (&qd.screenBits, &qd.screenBits, &src_r, &dest_r, srcCopy, 0);
-#else
   /* In Color QuickDraw, set ForeColor and BackColor as follows to avoid
      color mapping in CopyBits.  Otherwise, it will be slow.  */
   ForeColor (blackColor);
@@ -979,7 +916,6 @@
   CopyBits (&(w->portBits), &(w->portBits), &src_r, &dest_r, srcCopy, 0);
 
   mac_set_colors (gc, NULL);
-#endif
 #endif /* not TARGET_API_MAC_CARBON */
 }
 
@@ -1347,7 +1283,6 @@
 	     f->output_data.mac->normal_gc, x, y0, x, y1);
 }
 
-
 /* End update of window W (which is equal to updated_window).
 
    Draw vertical borders between horizontally adjacent windows, and
@@ -1359,7 +1294,7 @@
 
    W may be a menu bar pseudo-window in case we don't have X toolkit
    support.  Such windows don't have a cursor, so don't display it
-   here. */
+   here.  */
 
 static void
 x_update_window_end (w, cursor_on_p, mouse_face_overwritten_p)
@@ -1392,14 +1327,6 @@
       dpyinfo->mouse_face_window = Qnil;
     }
 
-#if 0
-  /* Unhide the caret.  This won't actually show the cursor, unless it
-     was visible before the corresponding call to HideCaret in
-     x_update_window_begin.  */
-  if (w32_use_visible_system_caret)
-    SendMessage (w32_system_caret_hwnd, WM_EMACS_SHOW_CARET, 0, 0);
-#endif
-
   updated_window = NULL;
 }
 
@@ -1485,19 +1412,18 @@
 	  height > 0))
     {
       int y = WINDOW_TO_FRAME_PIXEL_Y (w, max (0, desired_row->y));
+
       /* Internal border is drawn below the tool bar.  */
       if (WINDOWP (f->tool_bar_window)
 	  && w == XWINDOW (f->tool_bar_window))
 	y -= width;
 
       BLOCK_INPUT;
-
       XClearArea (FRAME_MAC_DISPLAY (f), FRAME_MAC_WINDOW (f),
 		  0, y, width, height, 0);
       XClearArea (FRAME_MAC_DISPLAY (f), FRAME_MAC_WINDOW (f),
 		  FRAME_PIXEL_WIDTH (f) - width, y,
 		  width, height, 0);
-
       UNBLOCK_INPUT;
     }
 }
@@ -1583,6 +1509,7 @@
 }
 
 
+
 /* This is called when starting Emacs and when restarting after
    suspend.  When starting Emacs, no window is mapped.  And nothing
    must be done to Emacs's own window if it is suspended (though that
@@ -1601,6 +1528,7 @@
 {
 }
 
+
 
 /***********************************************************************
 			   Display Iterator
@@ -1791,6 +1719,7 @@
  ***********************************************************************/
 
 
+
 static void x_set_glyph_string_clipping P_ ((struct glyph_string *));
 static void x_set_glyph_string_gc P_ ((struct glyph_string *));
 static void x_draw_glyph_string_background P_ ((struct glyph_string *,
@@ -1799,6 +1728,7 @@
 static void x_draw_composite_glyph_string_foreground P_ ((struct glyph_string *));
 static void x_draw_glyph_string_box P_ ((struct glyph_string *));
 static void x_draw_glyph_string  P_ ((struct glyph_string *));
+static void mac_compute_glyph_string_overhangs P_ ((struct glyph_string *));
 static void x_set_cursor_gc P_ ((struct glyph_string *));
 static void x_set_mode_line_face_gc P_ ((struct glyph_string *));
 static void x_set_mouse_face_gc P_ ((struct glyph_string *));
@@ -3402,7 +3332,6 @@
     }
 }
 
-
 
 /* Specify how many text lines, from the top of the window,
    should be affected by insert-lines and delete-lines operations.
@@ -3837,43 +3766,6 @@
 
 
 
-#if 0
-/* Mouse clicks and mouse movement.  Rah.  */
-
-/* Prepare a mouse-event in *RESULT for placement in the input queue.
-
-   If the event is a button press, then note that we have grabbed
-   the mouse.  */
-
-static Lisp_Object
-construct_mouse_click (result, event, f)
-     struct input_event *result;
-     EventRecord *event;
-     struct frame *f;
-{
-  Point mouseLoc;
-
-  result->kind = MOUSE_CLICK_EVENT;
-  result->code = 0;  /* only one mouse button */
-  result->timestamp = event->when;
-  result->modifiers = event->what == mouseDown ? down_modifier : up_modifier;
-
-  mouseLoc = event->where;
-
-  SetPortWindowPort (FRAME_MAC_WINDOW (f));
-
-  GlobalToLocal (&mouseLoc);
-  XSETINT (result->x, mouseLoc.h);
-  XSETINT (result->y, mouseLoc.v);
-
-  XSETFRAME (result->frame_or_window, f);
-
-  result->arg = Qnil;
-  return Qnil;
-}
-#endif
-
-
 /* Function to report a mouse movement to the mainstream Emacs code.
    The input handler calls this.
 
@@ -3929,18 +3821,11 @@
     }
 }
 
-/* This is used for debugging, to turn off note_mouse_highlight.  */
-
-int disable_mouse_highlight;
-
-
 
 /************************************************************************
 			      Mouse Face
  ************************************************************************/
 
-static struct scroll_bar *x_window_to_scroll_bar ();
-static void x_scroll_bar_report_motion ();
 static int glyph_rect P_ ((struct frame *f, int, int, Rect *));
 
 
@@ -4152,20 +4037,16 @@
 static OSStatus set_scroll_bar_timer P_ ((EventTimerInterval));
 static int control_part_code_to_scroll_bar_part P_ ((ControlPartCode));
 static void construct_scroll_bar_click P_ ((struct scroll_bar *, int,
-					    unsigned long,
 					    struct input_event *));
 static OSErr get_control_part_bounds P_ ((ControlHandle, ControlPartCode,
 					  Rect *));
 static void x_scroll_bar_handle_press P_ ((struct scroll_bar *,
 					   ControlPartCode,
-					   unsigned long,
 					   struct input_event *));
 static void x_scroll_bar_handle_release P_ ((struct scroll_bar *,
-					     unsigned long,
 					     struct input_event *));
 static void x_scroll_bar_handle_drag P_ ((WindowPtr, struct scroll_bar *,
-					  Point, unsigned long,
-					  struct input_event *));
+					  Point, struct input_event *));
 static void x_set_toolkit_scroll_bar_thumb P_ ((struct scroll_bar *,
 						int, int, int));
 
@@ -4264,10 +4145,9 @@
 }
 
 static void
-construct_scroll_bar_click (bar, part, timestamp, bufp)
+construct_scroll_bar_click (bar, part, bufp)
      struct scroll_bar *bar;
      int part;
-     unsigned long timestamp;
      struct input_event *bufp;
 {
   bufp->kind = SCROLL_BAR_CLICK_EVENT;
@@ -4275,7 +4155,6 @@
   bufp->arg = Qnil;
   bufp->part = part;
   bufp->code = 0;
-  bufp->timestamp = timestamp;
   XSETINT (bufp->x, 0);
   XSETINT (bufp->y, 0);
   bufp->modifiers = 0;
@@ -4299,10 +4178,9 @@
 }
 
 static void
-x_scroll_bar_handle_press (bar, part_code, timestamp, bufp)
+x_scroll_bar_handle_press (bar, part_code, bufp)
      struct scroll_bar *bar;
      ControlPartCode part_code;
-     unsigned long timestamp;
      struct input_event *bufp;
 {
   int part = control_part_code_to_scroll_bar_part (part_code);
@@ -4312,7 +4190,7 @@
 
   if (part != scroll_bar_handle)
     {
-      construct_scroll_bar_click (bar, part, timestamp, bufp);
+      construct_scroll_bar_click (bar, part, bufp);
       HiliteControl (SCROLL_BAR_CONTROL_HANDLE (bar), part_code);
       set_scroll_bar_timer (SCROLL_BAR_FIRST_DELAY);
     }
@@ -4323,14 +4201,13 @@
 }
 
 static void
-x_scroll_bar_handle_release (bar, timestamp, bufp)
+x_scroll_bar_handle_release (bar, bufp)
      struct scroll_bar *bar;
-     unsigned long timestamp;
      struct input_event *bufp;
 {
   if (last_scroll_bar_part != scroll_bar_handle
       || !GC_NILP (bar->dragging))
-    construct_scroll_bar_click (bar, scroll_bar_end_scroll, timestamp, bufp);
+    construct_scroll_bar_click (bar, scroll_bar_end_scroll, bufp);
 
   HiliteControl (SCROLL_BAR_CONTROL_HANDLE (bar), 0);
   set_scroll_bar_timer (kEventDurationForever);
@@ -4341,11 +4218,10 @@
 }
 
 static void
-x_scroll_bar_handle_drag (win, bar, mouse_pos, timestamp, bufp)
+x_scroll_bar_handle_drag (win, bar, mouse_pos, bufp)
      WindowPtr win;
      struct scroll_bar *bar;
      Point mouse_pos;
-     unsigned long timestamp;
      struct input_event *bufp;
 {
   ControlHandle ch = SCROLL_BAR_CONTROL_HANDLE (bar);
@@ -4365,13 +4241,13 @@
       top_range = (XINT (bar->track_height) - (r.bottom - r.top)) *
 	(1.0 + (float) GetControlViewSize (ch) / GetControl32BitMaximum (ch))
 	+ .5;
-      
+
       if (top < 0)
 	top = 0;
       if (top > top_range)
 	top = top_range;
 
-      construct_scroll_bar_click (bar, scroll_bar_handle, timestamp, bufp);
+      construct_scroll_bar_click (bar, scroll_bar_handle, bufp);
       XSETINT (bufp->x, top);
       XSETINT (bufp->y, top_range);
     }
@@ -4409,7 +4285,7 @@
       else if (part != last_scroll_bar_part
 	       || scroll_bar_timer_event_posted_p)
 	{
-	  construct_scroll_bar_click (bar, part, timestamp, bufp);
+	  construct_scroll_bar_click (bar, part, bufp);
 	  last_scroll_bar_part = part;
 	  HiliteControl (SCROLL_BAR_CONTROL_HANDLE (bar), part_code);
 	  set_scroll_bar_timer (SCROLL_BAR_CONTINUOUS_DELAY);
@@ -4480,11 +4356,11 @@
   r.bottom = disp_top + disp_height;
 
 #if TARGET_API_MAC_CARBON
-  ch = NewControl (FRAME_MAC_WINDOW (f), &r, "\p", 1, 0, 0, 0,
-		   kControlScrollBarProc, (long) bar);
+  ch = NewControl (FRAME_MAC_WINDOW (f), &r, "\p", width < disp_height,
+		   0, 0, 0, kControlScrollBarProc, (long) bar);
 #else
-  ch = NewControl (FRAME_MAC_WINDOW (f), &r, "\p", 1, 0, 0, 0,
-		   scrollBarProc, (long) bar);
+  ch = NewControl (FRAME_MAC_WINDOW (f), &r, "\p", width < disp_height,
+		   0, 0, 0, scrollBarProc, (long) bar);
 #endif
   SET_SCROLL_BAR_CONTROL_HANDLE (bar, ch);
 
@@ -4609,10 +4485,12 @@
   UNBLOCK_INPUT;
 }
 
+
 /* Set the handle of the vertical scroll bar for WINDOW to indicate
    that we are displaying PORTION characters out of a total of WHOLE
    characters, starting at POSITION.  If WINDOW has no scroll bar,
    create one.  */
+
 static void
 XTset_vertical_scroll_bar (w, portion, whole, position)
      struct window *w;
@@ -4707,7 +4585,8 @@
           MoveControl (ch, sb_left + VERTICAL_SCROLL_BAR_WIDTH_TRIM, disp_top);
           SizeControl (ch, sb_width - VERTICAL_SCROLL_BAR_WIDTH_TRIM * 2,
 		       disp_height);
-          ShowControl (ch);
+	  if (sb_width < disp_height)
+	    ShowControl (ch);
 
           /* Remember new settings.  */
           XSETINT (bar->left, sb_left);
@@ -4810,6 +4689,7 @@
      struct window *window;
 {
   struct scroll_bar *bar;
+  struct frame *f;
 
   /* We can't redeem this window's scroll bar if it doesn't have one.  */
   if (NILP (window->vertical_scroll_bar))
@@ -4818,36 +4698,33 @@
   bar = XSCROLL_BAR (window->vertical_scroll_bar);
 
   /* Unlink it from the condemned list.  */
-  {
-    FRAME_PTR f = XFRAME (WINDOW_FRAME (window));
-
-    if (NILP (bar->prev))
-      {
-	/* If the prev pointer is nil, it must be the first in one of
-           the lists.  */
-	if (EQ (FRAME_SCROLL_BARS (f), window->vertical_scroll_bar))
-	  /* It's not condemned.  Everything's fine.  */
-	  return;
-	else if (EQ (FRAME_CONDEMNED_SCROLL_BARS (f),
-		     window->vertical_scroll_bar))
-	  FRAME_CONDEMNED_SCROLL_BARS (f) = bar->next;
-	else
-	  /* If its prev pointer is nil, it must be at the front of
-             one or the other!  */
-	  abort ();
-      }
-    else
-      XSCROLL_BAR (bar->prev)->next = bar->next;
-
-    if (! NILP (bar->next))
-      XSCROLL_BAR (bar->next)->prev = bar->prev;
-
-    bar->next = FRAME_SCROLL_BARS (f);
-    bar->prev = Qnil;
-    XSETVECTOR (FRAME_SCROLL_BARS (f), bar);
-    if (! NILP (bar->next))
-      XSETVECTOR (XSCROLL_BAR (bar->next)->prev, bar);
-  }
+  f = XFRAME (WINDOW_FRAME (window));
+  if (NILP (bar->prev))
+    {
+      /* If the prev pointer is nil, it must be the first in one of
+	 the lists.  */
+      if (EQ (FRAME_SCROLL_BARS (f), window->vertical_scroll_bar))
+	/* It's not condemned.  Everything's fine.  */
+	return;
+      else if (EQ (FRAME_CONDEMNED_SCROLL_BARS (f),
+		   window->vertical_scroll_bar))
+	FRAME_CONDEMNED_SCROLL_BARS (f) = bar->next;
+      else
+	/* If its prev pointer is nil, it must be at the front of
+	   one or the other!  */
+	abort ();
+    }
+  else
+    XSCROLL_BAR (bar->prev)->next = bar->next;
+
+  if (! NILP (bar->next))
+    XSCROLL_BAR (bar->next)->prev = bar->prev;
+
+  bar->next = FRAME_SCROLL_BARS (f);
+  bar->prev = Qnil;
+  XSETVECTOR (FRAME_SCROLL_BARS (f), bar);
+  if (! NILP (bar->next))
+    XSETVECTOR (XSCROLL_BAR (bar->next)->prev, bar);
 }
 
 /* Remove all scroll bars on FRAME that haven't been saved since the
@@ -4986,8 +4863,8 @@
 
 #endif /* !USE_TOOLKIT_SCROLL_BARS */
 
-/* Return information to the user about the current position of the
-   mouse on the scroll bar.  */
+/* Return information to the user about the current position of the mouse
+   on the scroll bar.  */
 
 static void
 x_scroll_bar_report_motion (fp, bar_window, part, x, y, time)
@@ -5516,6 +5393,7 @@
 }
 
 
+
 /* Calculate the absolute position in frame F
    from its current recorded position values and gravity.  */
 
@@ -5747,7 +5625,6 @@
   UNBLOCK_INPUT;
 #endif
 }
-
 
 /* focus shifting, raising and lowering.  */
 
@@ -5774,6 +5651,7 @@
 }
 
 /* Raise frame F.  */
+
 void
 x_raise_frame (f)
      struct frame *f;
@@ -5787,6 +5665,7 @@
 }
 
 /* Lower frame F.  */
+
 void
 x_lower_frame (f)
      struct frame *f;
@@ -6195,9 +6074,9 @@
 }
 
 /* the global font name table */
-char **font_name_table = NULL;
-int font_name_table_size = 0;
-int font_name_count = 0;
+static char **font_name_table = NULL;
+static int font_name_table_size = 0;
+static int font_name_count = 0;
 
 /* Alist linking character set strings to Mac text encoding and Emacs
    coding system. */
@@ -7460,22 +7339,6 @@
 #define MIN_DOC_SIZE 64
 #define MAX_DOC_SIZE 32767
 
-#if 0
-/* sleep time for WaitNextEvent */
-#define WNE_SLEEP_AT_SUSPEND 10
-#define WNE_SLEEP_AT_RESUME  1
-
-/* the flag appl_is_suspended is used both for determining the sleep
-   time to be passed to WaitNextEvent and whether the cursor should be
-   drawn when updating the display.  The cursor is turned off when
-   Emacs is suspended.  Redrawing it is unnecessary and what needs to
-   be done depends on whether the cursor lies inside or outside the
-   redraw region.  So we might as well skip drawing it when Emacs is
-   suspended.  */
-static Boolean app_is_suspended = false;
-static long app_sleep_time = WNE_SLEEP_AT_RESUME;
-#endif
-
 #define EXTRA_STACK_ALLOC (256 * 1024)
 
 #define ARGV_STRING_LIST_ID 129
@@ -7512,8 +7375,8 @@
 Lisp_Object Vmac_pass_control_to_system;
 
 /* Points to the variable `inev' in the function XTread_socket.  It is
-   used for passing an input event to the function back from a Carbon
-   event handler.  */
+   used for passing an input event to the function back from
+   Carbon/Apple event handlers.  */
 static struct input_event *read_socket_inev = NULL;
 #endif
 
@@ -7521,8 +7384,6 @@
    drag and drop events.  */
 Lisp_Object Qmac_ready_for_drag_n_drop;
 
-Lisp_Object drag_and_drop_file_list;
-
 Point saved_menu_event_location;
 
 /* Apple Events */
@@ -7858,20 +7719,12 @@
 do_app_resume ()
 {
   /* Window-activate events will do the job. */
-#if 0
-  app_is_suspended = false;
-  app_sleep_time = WNE_SLEEP_AT_RESUME;
-#endif
 }
 
 static void
 do_app_suspend ()
 {
   /* Window-deactivate events will do the job. */
-#if 0
-  app_is_suspended = true;
-  app_sleep_time = WNE_SLEEP_AT_SUSPEND;
-#endif
 }
 
 
@@ -8425,8 +8278,6 @@
 	XSETINT (read_socket_inev->x, point.h);
 	XSETINT (read_socket_inev->y, point.v);
 	XSETFRAME (read_socket_inev->frame_or_window, f);
-	read_socket_inev->timestamp =
-	  EventTimeToTicks (GetEventTime (event)) * (1000/60);
 
 	return noErr;
       }
@@ -8500,11 +8351,6 @@
 }
 
 
-/* Defined in mac.c.  */
-extern int
-path_from_vol_dir_name (char *, int, short, long, char *);
-
-
 /* Called when we receive an AppleEvent with an ID of
    "kAEOpenDocuments".  This routine gets the direct parameter,
    extracts the FSSpecs in it, and puts their names on a list.  */
@@ -8528,6 +8374,9 @@
   DescType actual_type;
   Size actual_size;
   SelectionRange position;
+  Lisp_Object file_list = Qnil;
+
+  xassert (read_socket_inev);
 
   err = AEGetParamDesc (message, keyDirectObject, typeAEList, &the_desc);
   if (err != noErr)
@@ -8535,10 +8384,10 @@
 
   err = AEGetParamPtr (message, keyAEPosition, typeChar, &actual_type, &position, sizeof(SelectionRange), &actual_size);
   if (err == noErr)
-    drag_and_drop_file_list = Fcons (list3 (make_number (position.lineNum + 1),
-					    make_number (position.startRange + 1),
-					    make_number (position.endRange + 1)),
-				     drag_and_drop_file_list);
+    file_list = Fcons (list3 (make_number (position.lineNum + 1),
+			      make_number (position.startRange + 1),
+			      make_number (position.endRange + 1)),
+		       file_list);
 
   /* Check to see that we got all of the required parameters from the
      event descriptor.  For an 'odoc' event this should just be the
@@ -8592,12 +8441,49 @@
 					  sizeof (unix_path_name) - 1) == noErr)
 #endif
 	      /* x-dnd functions expect undecoded filenames.  */
-	      drag_and_drop_file_list =
-		Fcons (make_unibyte_string (unix_path_name,
-					    strlen (unix_path_name)),
-		       drag_and_drop_file_list);
+	      file_list = Fcons (make_unibyte_string (unix_path_name,
+						      strlen (unix_path_name)),
+				 file_list);
 	  }
       }
+
+    /* Build a DRAG_N_DROP_EVENT type event as is done in
+       constuct_drag_n_drop in w32term.c.  */
+    if (!NILP (file_list))
+      {
+	struct frame *f = mac_focus_frame (&one_mac_display_info);
+	WindowPtr wp;
+	Lisp_Object frame;
+
+	read_socket_inev->kind = DRAG_N_DROP_EVENT;
+	read_socket_inev->code = 0;
+	read_socket_inev->modifiers = 0;
+
+	XSETINT (read_socket_inev->x, 0);
+	XSETINT (read_socket_inev->y, 0);
+
+	XSETFRAME (frame, f);
+	read_socket_inev->frame_or_window = Fcons (frame, file_list);
+
+#if 0
+	/* Regardless of whether Emacs was suspended or in the
+	   foreground, ask it to redraw its entire screen.  Otherwise
+	   parts of the screen can be left in an inconsistent
+	   state.  */
+	wp = FRAME_MAC_WINDOW (f);
+	if (wp)
+#if TARGET_API_MAC_CARBON
+	  {
+	    Rect r;
+
+	    GetWindowPortBounds (wp, &r);
+	    InvalWindowRect (wp, &r);
+	  }
+#else /* not TARGET_API_MAC_CARBON */
+	InvalRect (&(wp->portRect));
+#endif /* not TARGET_API_MAC_CARBON */
+#endif
+      }
   }
 
 error_exit:
@@ -8690,11 +8576,12 @@
   ItemReference theItem;
   HFSFlavor data;
   Size size = sizeof (HFSFlavor);
+  Lisp_Object file_list;
 
   if (GetFrontWindowOfClass (kMovableModalWindowClass, false))
     return dragNotAcceptedErr;
 
-  drag_and_drop_file_list = Qnil;
+  file_list = Qnil;
   GetDragMouse (theDrag, &mouse, 0L);
   CountDragItems (theDrag, &items);
   for (index = 1; index <= items; index++)
@@ -8720,15 +8607,14 @@
 					sizeof (unix_path_name) - 1) == noErr)
 #endif
 	    /* x-dnd functions expect undecoded filenames.  */
-            drag_and_drop_file_list =
-	      Fcons (make_unibyte_string (unix_path_name,
-					  strlen (unix_path_name)),
-		     drag_and_drop_file_list);
+            file_list = Fcons (make_unibyte_string (unix_path_name,
+						    strlen (unix_path_name)),
+			       file_list);
 	}
     }
   /* If there are items in the list, construct an event and post it to
      the queue like an interrupt using kbd_buffer_store_event.  */
-  if (!NILP (drag_and_drop_file_list))
+  if (!NILP (file_list))
     {
       struct input_event event;
       Lisp_Object frame;
@@ -8745,7 +8631,7 @@
       XSETINT (event.x, mouse.h);
       XSETINT (event.y, mouse.v);
       XSETFRAME (frame, f);
-      event.frame_or_window = Fcons (frame, drag_and_drop_file_list);
+      event.frame_or_window = Fcons (frame, file_list);
       event.arg = Qnil;
       /* Post to the interrupt queue */
       kbd_buffer_store_event (&event);
@@ -9004,6 +8890,7 @@
     {
       int do_help = 0;
       struct frame *f;
+      unsigned long timestamp;
 
       /* It is necessary to set this (additional) argument slot of an
 	 event to nil because keyboard.c protects incompletely
@@ -9014,6 +8901,12 @@
       inev.arg = Qnil;
 
 #if USE_CARBON_EVENTS
+      timestamp = GetEventTime (eventRef) / kEventDurationMillisecond;
+#else
+      timestamp = er.when * (1000 / 60); /* ticks to milliseconds */
+#endif
+
+#if USE_CARBON_EVENTS
       /* Handle new events */
       if (!mac_convert_event_ref (eventRef, &er))
 	{
@@ -9114,8 +9007,6 @@
 #endif
 		    XSETINT (inev.x, mouse_loc.h);
 		    XSETINT (inev.y, mouse_loc.v);
-		    inev.timestamp = er.when * (1000 / 60);
-		    /* ticks to milliseconds */
 
 		    if (dpyinfo->grabbed && tracked_scroll_bar
 			|| ch != 0
@@ -9149,10 +9040,9 @@
 						     &er, &inev);
 			else if (er.what == mouseDown)
 			  x_scroll_bar_handle_press (bar, control_part_code,
-						     inev.timestamp, &inev);
+						     &inev);
 			else
-			  x_scroll_bar_handle_release (bar, inev.timestamp,
-						       &inev);
+			  x_scroll_bar_handle_release (bar, &inev);
 #else  /* not USE_TOOLKIT_SCROLL_BARS */
 			x_scroll_bar_handle_click (bar, control_part_code,
 						   &er, &inev);
@@ -9326,8 +9216,7 @@
 		  if (dpyinfo->grabbed && tracked_scroll_bar)
 #ifdef USE_TOOLKIT_SCROLL_BARS
 		    x_scroll_bar_handle_drag (wp, tracked_scroll_bar,
-					      mouse_pos, er.when * (1000 / 60),
-					      &inev);
+					      mouse_pos, &inev);
 #else /* not USE_TOOLKIT_SCROLL_BARS */
 		    x_scroll_bar_note_movement (tracked_scroll_bar,
 						mouse_pos.v
@@ -9415,11 +9304,10 @@
 
 		    EVENT_INIT (event);
 		    event.kind = NO_EVENT;
-		    x_scroll_bar_handle_release (tracked_scroll_bar,
-						 er.when * (1000 / 60),
-						 &event);
+		    x_scroll_bar_handle_release (tracked_scroll_bar, &event);
 		    if (event.kind != NO_EVENT)
 		      {
+			event.timestamp = timestamp;
 			kbd_buffer_store_event_hold (&event, hold_quit);
 			count++;
 		      }
@@ -9495,6 +9383,7 @@
 		  event.kind = LANGUAGE_CHANGE_EVENT;
 		  event.arg = Qnil;
 		  event.code = current_key_script;
+		  event.timestamp = timestamp;
 		  kbd_buffer_store_event (&event);
 		  count++;
 		}
@@ -9559,58 +9448,18 @@
 #else
 	  inev.modifiers = mac_to_emacs_modifiers (er.modifiers);
 #endif
+	  inev.modifiers |= (extra_keyboard_modifiers
+			     & (meta_modifier | alt_modifier
+				| hyper_modifier | super_modifier));
 	  XSETFRAME (inev.frame_or_window, mac_focus_frame (dpyinfo));
-	  inev.timestamp = er.when * (1000 / 60);  /* ticks to milliseconds */
 	  break;
 
 	case kHighLevelEvent:
-	  drag_and_drop_file_list = Qnil;
-
-	  AEProcessAppleEvent(&er);
-
-	  /* Build a DRAG_N_DROP_EVENT type event as is done in
-	     constuct_drag_n_drop in w32term.c.  */
-	  if (!NILP (drag_and_drop_file_list))
-	    {
-	      struct frame *f = mac_focus_frame (dpyinfo);
-	      WindowPtr wp;
-	      Lisp_Object frame;
-
-	      inev.kind = DRAG_N_DROP_EVENT;
-	      inev.code = 0;
-	      inev.timestamp = er.when * (1000 / 60);
-	      /* ticks to milliseconds */
-#if USE_CARBON_EVENTS
-	      inev.modifiers = mac_event_to_emacs_modifiers (eventRef);
-#else
-	      inev.modifiers = mac_to_emacs_modifiers (er.modifiers);
-#endif
-
-	      XSETINT (inev.x, 0);
-	      XSETINT (inev.y, 0);
-
-	      XSETFRAME (frame, f);
-	      inev.frame_or_window = Fcons (frame, drag_and_drop_file_list);
-
-#if 0
-	      /* Regardless of whether Emacs was suspended or in the
-		 foreground, ask it to redraw its entire screen.
-		 Otherwise parts of the screen can be left in an
-		 inconsistent state.  */
-	      wp = FRAME_MAC_WINDOW (f);
-	      if (wp)
-#if TARGET_API_MAC_CARBON
-		{
-		  Rect r;
-
-		  GetWindowPortBounds (wp, &r);
-		  InvalWindowRect (wp, &r);
-		}
-#else /* not TARGET_API_MAC_CARBON */
-                InvalRect (&(wp->portRect));
-#endif /* not TARGET_API_MAC_CARBON */
-#endif
-	    }
+	  read_socket_inev = &inev;
+	  AEProcessAppleEvent (&er);
+	  read_socket_inev = NULL;
+	  break;
+
 	default:
 	  break;
 	}
@@ -9620,6 +9469,7 @@
 
       if (inev.kind != NO_EVENT)
 	{
+	  inev.timestamp = timestamp;
 	  kbd_buffer_store_event_hold (&inev, hold_quit);
 	  count++;
 	}
@@ -10092,7 +9942,7 @@
       kbd_buffer_store_event (&e);
     }
 }
-#endif /* MAC_OSX */
+#endif	/* MAC_OSX */
 
 static void
 init_menu_bar ()
@@ -10195,7 +10045,6 @@
 				   off the bottom */
   baud_rate = 19200;
 
-  x_noop_count = 0;
   last_tool_bar_item = -1;
   any_help_event_p = 0;
 
@@ -10267,12 +10116,6 @@
   staticpro (&last_mouse_scroll_bar);
   last_mouse_scroll_bar = Qnil;
 
-  staticpro (&Qvendor_specific_keysyms);
-  Qvendor_specific_keysyms = intern ("vendor-specific-keysyms");
-
-  staticpro (&last_mouse_press_frame);
-  last_mouse_press_frame = Qnil;
-
   Qmac_ready_for_drag_n_drop = intern ("mac-ready-for-drag-n-drop");
   staticpro (&Qmac_ready_for_drag_n_drop);
 
@@ -10284,14 +10127,6 @@
   Vx_toolkit_scroll_bars = Qnil;
 #endif
 
-  DEFVAR_BOOL ("x-use-underline-position-properties",
-               &x_use_underline_position_properties,
-     doc: /* *Non-nil means make use of UNDERLINE_POSITION font properties.
-nil means ignore them.  If you encounter fonts with bogus
-UNDERLINE_POSITION font properties, for example 7x13 on XFree prior
-to 4.1, set this to nil.  */);
-  x_use_underline_position_properties = 0;
-
   staticpro (&last_mouse_motion_frame);
   last_mouse_motion_frame = Qnil;
 
--- a/src/window.c	Thu Jul 07 12:43:14 2005 +0000
+++ b/src/window.c	Thu Jul 14 08:02:00 2005 +0000
@@ -1472,7 +1472,7 @@
 
   /* Check if we have a v/hchild with a v/hchild.  In that case remove
      one of them.  */
-  
+
   if (! NILP (par->vchild) && ! NILP (XWINDOW (par->vchild)->vchild))
     {
       p = XWINDOW (par->vchild);
@@ -5357,6 +5357,7 @@
     {
       arg = Fprefix_numeric_value (arg);
       CHECK_NUMBER (arg);
+      iarg = XINT (arg);
     }
 
   set_buffer_internal (buf);
@@ -5391,7 +5392,6 @@
 	  int extra_line_spacing;
 	  int h = window_box_height (w);
 
-	  iarg = XINT (arg);
 	  iarg = - max (-iarg, this_scroll_margin);
 
 	  SET_TEXT_POS (pt, PT, PT_BYTE);
@@ -5453,7 +5453,6 @@
 	{
 	  struct position pos;
 
-	  iarg = XINT (arg);
 	  iarg = max (iarg, this_scroll_margin);
 
 	  pos = *vmotion (PT, -iarg, w);
@@ -5467,11 +5466,9 @@
       int ht = window_internal_height (w);
 
       if (center_p)
-	iarg = make_number (ht / 2);
-      else if (XINT (arg) < 0)
-	iarg = XINT (arg) + ht;
-      else
-	iarg = XINT (arg);
+	iarg = ht / 2;
+      else if (iarg < 0)
+	iarg += ht;
 
       /* Don't let it get into the margin at either top or bottom.  */
       iarg = max (iarg, this_scroll_margin);
--- a/src/xdisp.c	Thu Jul 07 12:43:14 2005 +0000
+++ b/src/xdisp.c	Thu Jul 14 08:02:00 2005 +0000
@@ -2411,7 +2411,9 @@
   init_iterator (it, w, CHARPOS (pos), BYTEPOS (pos), row, DEFAULT_FACE_ID);
   it->first_vpos = first_vpos;
 
-  if (!it->truncate_lines_p)
+  /* Don't reseat to previous visible line start if current start
+     position is in a string or image.  */
+  if (it->method == GET_FROM_BUFFER && !it->truncate_lines_p)
     {
       int start_at_line_beg_p;
       int first_y = it->current_y;
@@ -6483,8 +6485,12 @@
      y-distance.  */
   it2 = *it;
   it2.max_ascent = it2.max_descent = 0;
-  move_it_to (&it2, start_pos, -1, -1, it2.vpos + 1,
-	      MOVE_TO_POS | MOVE_TO_VPOS);
+  do
+    {
+      move_it_to (&it2, start_pos, -1, -1, it2.vpos + 1,
+		  MOVE_TO_POS | MOVE_TO_VPOS);
+    }
+  while (it2.method != GET_FROM_BUFFER);
   xassert (IT_CHARPOS (*it) >= BEGV);
   it3 = it2;
 
@@ -6682,21 +6688,45 @@
       last_height = 0;
     }
   else if (dvpos > 0)
-    move_it_to (it, -1, -1, -1, it->vpos + dvpos, MOVE_TO_VPOS);
+    {
+      move_it_to (it, -1, -1, -1, it->vpos + dvpos, MOVE_TO_VPOS);
+      if (it->method != GET_FROM_BUFFER)
+	move_it_to (it, IT_CHARPOS (*it) + 1, -1, -1, -1, MOVE_TO_POS);
+    }
   else
     {
       struct it it2;
       int start_charpos, i;
 
       /* Start at the beginning of the screen line containing IT's
-	 position.  */
+	 position.  This may actually move vertically backwards,
+         in case of overlays, so adjust dvpos accordingly.  */
+      dvpos += it->vpos;
       move_it_vertically_backward (it, 0);
+      dvpos -= it->vpos;
 
       /* Go back -DVPOS visible lines and reseat the iterator there.  */
       start_charpos = IT_CHARPOS (*it);
-      for (i = -dvpos; i && IT_CHARPOS (*it) > BEGV; --i)
+      for (i = -dvpos; i > 0 && IT_CHARPOS (*it) > BEGV; --i)
 	back_to_previous_visible_line_start (it);
       reseat (it, it->current.pos, 1);
+
+      /* Move further back if we end up in a string or an image.  */
+      while (it->method != GET_FROM_BUFFER)
+	{
+	  /* First try to move to start of display line.  */
+	  dvpos += it->vpos;
+	  move_it_vertically_backward (it, 0);
+	  dvpos -= it->vpos;
+	  if (it->method == GET_FROM_BUFFER)
+	    break;
+	  /* If start of line is still in string or image,
+	     move further back.  */
+	  back_to_previous_visible_line_start (it);
+	  reseat (it, it->current.pos, 1);
+	  dvpos--;
+	}
+
       it->current_x = it->hpos = 0;
 
       /* Above call may have moved too far if continuation lines
@@ -11389,7 +11419,7 @@
   window_height = window_box_height (w);
   if (row->height >= window_height)
     {
-      if (!force_p || w->vscroll)
+      if (!force_p || MINI_WINDOW_P (w) || w->vscroll)
 	return 1;
     }
   return 0;
@@ -11919,7 +11949,10 @@
 	      while (!row->mode_line_p
 		     && (MATRIX_ROW_START_CHARPOS (row) > PT
 			 || (MATRIX_ROW_START_CHARPOS (row) == PT
-			     && MATRIX_ROW_STARTS_IN_MIDDLE_OF_CHAR_P (row)))
+			     && (MATRIX_ROW_STARTS_IN_MIDDLE_OF_CHAR_P (row)
+				 || (/* STARTS_IN_MIDDLE_OF_STRING_P (row) */
+				     row > w->current_matrix->rows
+				     && (row-1)->ends_in_newline_from_string_p))))
 		     && (row->y > top_scroll_margin
 			 || CHARPOS (startp) == BEGV))
 		{
@@ -12824,7 +12857,8 @@
     }
 
   /* Don't let the cursor end in the scroll margins.  */
-  if (check_margins)
+  if (check_margins
+      && !MINI_WINDOW_P (w))
     {
       int this_scroll_margin, cursor_height;
 
@@ -15089,10 +15123,12 @@
   if (PT == MATRIX_ROW_END_CHARPOS (row))
     {
       /* If the row ends with a newline from a string, we don't want
-	 the cursor there (if the row is continued it doesn't end in a
-	 newline).  */
+	 the cursor there, but we still want it at the start of the
+	 string if the string starts in this row.
+	 If the row is continued it doesn't end in a newline.  */
       if (CHARPOS (row->end.string_pos) >= 0)
-	cursor_row_p = row->continued_p;
+	cursor_row_p = (row->continued_p
+			|| PT >= MATRIX_ROW_START_CHARPOS (row));
       else if (MATRIX_ROW_ENDS_IN_MIDDLE_OF_CHAR_P (row))
 	{
 	  /* If the row ends in middle of a real character,
--- a/src/xfaces.c	Thu Jul 07 12:43:14 2005 +0000
+++ b/src/xfaces.c	Thu Jul 14 08:02:00 2005 +0000
@@ -4805,7 +4805,12 @@
 	  const char *suffix = "List";
 	  Bool motif = True;
 #else
+#if defined HAVE_X_I18N
+
+	  const char *suffix = "Set";
+#else
 	  const char *suffix = "";
+#endif
 	  Bool motif = False;
 #endif
 #if defined HAVE_X_I18N
--- a/src/xselect.c	Thu Jul 07 12:43:14 2005 +0000
+++ b/src/xselect.c	Thu Jul 14 08:02:00 2005 +0000
@@ -2954,7 +2954,6 @@
   QTEXT      = intern ("TEXT"); 	staticpro (&QTEXT);
   QCOMPOUND_TEXT = intern ("COMPOUND_TEXT"); staticpro (&QCOMPOUND_TEXT);
   QUTF8_STRING = intern ("UTF8_STRING"); staticpro (&QUTF8_STRING);
-  QTIMESTAMP = intern ("TIMESTAMP");	staticpro (&QTIMESTAMP);
   QDELETE    = intern ("DELETE");	staticpro (&QDELETE);
   QMULTIPLE  = intern ("MULTIPLE");	staticpro (&QMULTIPLE);
   QINCR      = intern ("INCR");		staticpro (&QINCR);