changeset 80941:cf532dffa6ef

Merge from emacs--rel--22 Patches applied: * emacs--rel--22 (patch 18) - Update from CVS 2007-05-16 Richard Stallman <rms@gnu.org> * lisp/buff-menu.el (Buffer-menu-sort-column): Doc fix. 2007-05-16 Stefan Monnier <monnier@iro.umontreal.ca> * lisp/files.el (magic-mode-alist, magic-fallback-mode-alist): Move the *ml, Postscript, and XmCD entries to the fallback part. * lisp/files.el (magic-fallback-mode-alist): Rename from file-start-mode-alist. 2007-05-16 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> * src/macterm.c [USE_CARBON_EVENTS] (mac_convert_event_ref): Also convert dead key repeat and up events. Revision: emacs@sv.gnu.org/emacs--devo--0--patch-753
author Miles Bader <miles@gnu.org>
date Thu, 17 May 2007 01:12:58 +0000
parents a624fe7396ce (diff) 9844e2d783f6 (current diff)
children af3248515da1
files admin/FOR-RELEASE etc/NEWS lisp/ChangeLog lisp/dired.el src/ChangeLog
diffstat 53 files changed, 932 insertions(+), 510 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed May 16 19:48:35 2007 +0000
+++ b/ChangeLog	Thu May 17 01:12:58 2007 +0000
@@ -2,6 +2,15 @@
 
 	* configure: Tweak message about the absence of shell functions.
 
+2007-04-27  Andreas Schwab  <schwab@suse.de>
+
+	* Makefile.in (config.status): Depend on
+	${srcdir}/lisp/version.el.
+
+2007-04-26  Glenn Morris  <rgm@gnu.org>
+
+	* README: Increase version to 22.1.50.
+
 2007-04-24  Juanma Barranquero  <lekktu@gmail.com>
 
 	* INSTALL (DETAILED BUILDING AND INSTALLATION): Fix typo.
--- a/MAINTAINERS	Wed May 16 19:48:35 2007 +0000
+++ b/MAINTAINERS	Thu May 17 01:12:58 2007 +0000
@@ -112,6 +112,12 @@
 Thien-Thi Nguyen
 	VMS
 
+Juanma Barranquero
+       lisp/bs.el
+       lisp/server.el
+       lib-src/emacsclient.c
+       lib-src/grep-changelog
+
 ==============================================================================
 3.
 ==============================================================================
@@ -149,13 +155,16 @@
 src/filemode.c
 src/firstfile.c
 src/floatfns.c
+src/fringe.c
 src/fns.c
 src/fontset.c
 src/getloadavg.c
 src/gmalloc.c
+src/gtkutil.c
 src/hftctl.c
 src/indent.c
 src/insdel.c
+src/image.c
 src/lastfile.c
 src/lread.c
 src/m/
--- a/Makefile.in	Wed May 16 19:48:35 2007 +0000
+++ b/Makefile.in	Thu May 17 01:12:58 2007 +0000
@@ -311,7 +311,7 @@
 Makefile: $(srcdir)/Makefile.in config.status
 	./config.status
 
-config.status: ${srcdir}/configure
+config.status: ${srcdir}/configure ${srcdir}/lisp/version.el
 	./config.status --recheck
 
 AUTOCONF_INPUTS = @MAINT@ $(srcdir)/configure.in $(srcdir)/m4/getopt.m4
--- a/README	Wed May 16 19:48:35 2007 +0000
+++ b/README	Thu May 17 01:12:58 2007 +0000
@@ -3,7 +3,7 @@
 See the end of the file for license conditions.
 
 
-This directory tree holds version 22.0.99 of GNU Emacs, the extensible,
+This directory tree holds version 22.1.50 of GNU Emacs, the extensible,
 customizable, self-documenting real-time display editor.
 
 The file INSTALL in this directory says how to build and install GNU
--- a/admin/ChangeLog	Wed May 16 19:48:35 2007 +0000
+++ b/admin/ChangeLog	Thu May 17 01:12:58 2007 +0000
@@ -1,3 +1,7 @@
+2007-04-25  Nick Roberts  <nickrob@snap.net.nz>
+
+	* make-tarball.txt: Add note about cutting the branch.
+
 2007-02-03  Eli Zaretskii  <eliz@gnu.org>
 
 	* nt/makedist.bat: Change EOL format to DOS.  Don't use
--- a/admin/FOR-RELEASE	Wed May 16 19:48:35 2007 +0000
+++ b/admin/FOR-RELEASE	Thu May 17 01:12:58 2007 +0000
@@ -22,6 +22,10 @@
 
 Reminders sent out on 2006-06-08.
 
+** Remove temporary +++/--- lines in NEWS.
+
+** Try to reorder NEWS: most important things first, related items together.
+
 * WINDOWS SUPPORT BUGS.
 
 These don't need to be fixed before a release, but we call the
@@ -36,6 +40,8 @@
 
 * BUGS
 
+See the copy of this file on the EMACS_22_BASE branch.
+
 ** rcyeske@gmail.com, April 22: Failure to build on OpenBSD macppc.
 OpenBSD compilation works on i386.
 http://lists.gnu.org/archive/html/emacs-devel/2007-04/msg00932.html
--- a/admin/make-tarball.txt	Wed May 16 19:48:35 2007 +0000
+++ b/admin/make-tarball.txt	Thu May 17 01:12:58 2007 +0000
@@ -76,7 +76,22 @@
 14. For a pretest, let Richard Stallman <rms@gnu.org> know about the new pretest and
     tell him to announce it using the announcement you prepared.  Remind
     him to set a Reply-to header to <emacs-pretest-bug@gnu.org>.
-    For a release, Richard should prepare the announcement himself,
+
+15. Shortly before the release, cut the branch with the following commands:
+
+    cvs rtag EMACS_`NUMBER'_BASE
+    cvs rtag -b EMACS_`NUMBER'_RC -r EMACS_`NUMBER'_BASE
+
+where `NUMBER' is the major version number of the release.  This makes it
+easier to  see what changes have been applied to the branch with:
+
+    cvs diff -r EMACS_`NUMBER'_BASE -r EMACS_`NUMBER'_RC
+
+or merge changes back to the trunk with "cvs update -j", if necessary.
+
+After doing this, increase the version number on the trunk as per step 4.
+
+16. For a release, Richard should prepare the announcement himself,
     possibly starting from a previous announcment.
 
 # arch-tag: c23c771f-ca26-4584-8a04-50ecf0989390
--- a/etc/DEBUG	Wed May 16 19:48:35 2007 +0000
+++ b/etc/DEBUG	Thu May 17 01:12:58 2007 +0000
@@ -64,10 +64,10 @@
 Put a breakpoint early in `main', or suspend the Emacs,
 to get an opportunity to do the set command.
 
-When Emacs is running in a terminal, it is useful to use a separate terminal
-for the debug session.  This can be done by starting Emacs as usual, then
-attaching to it from gdb with the `attach' command which is explained in the
-node "Attach" of the GDB manual.
+When Emacs is running in a terminal, it is sometimes useful to use a separate
+terminal for the debug session.  This can be done by starting Emacs as usual,
+then attaching to it from gdb with the `attach' command which is explained in
+the node "Attach" of the GDB manual.
 
 ** Examining Lisp object values.
 
--- a/etc/TODO	Wed May 16 19:48:35 2007 +0000
+++ b/etc/TODO	Thu May 17 01:12:58 2007 +0000
@@ -594,6 +594,33 @@
 
 * Other known bugs:
 
+** The \\{...} keymap dump output does not correctly remove shadowed entries:
+From: "Drew Adams" <drew.adams@oracle.com>
+
+(define-key minibuffer-local-map [(control ?=)] 'foo)
+(define-key minibuffer-local-completion-map [(control ?=)] 'foo)
+
+(defun toto () "\\{minibuffer-local-completion-map}"  4)
+
+C-h f toto shows a duplicate entry for C-=:
+
+toto is a Lisp function.
+(toto)
+
+key             binding
+- ---             -------
+
+C-g		abort-recursive-edit
+TAB		minibuffer-complete
+C-j		exit-minibuffer
+RET		exit-minibuffer
+ESC		Prefix Command
+SPC		minibuffer-complete-word
+?		minibuffer-completion-help
+C-=		foo
+C-=		foo
+...
+
 ** a two-char comment-starter whose two chars are symbol constituents will
 not be noticed if it appears within a word.
 
--- a/etc/fr-refcard.ps	Wed May 16 19:48:35 2007 +0000
+++ b/etc/fr-refcard.ps	Thu May 17 01:12:58 2007 +0000
@@ -12,7 +12,7 @@
 %DVIPSCommandLine: dvips -t a4 -t landscape fr-refcard.dvi -o
 %+ fr-refcard.ps
 %DVIPSParameters: dpi=600
-%DVIPSSource:  TeX output 2007.05.15:0316
+%DVIPSSource:  TeX output 2007.05.15:0314
 %%BeginProcSet: tex.pro 0 0
 %!
 /TeXDict 300 dict def TeXDict begin/N{def}def/B{bind def}N/S{exch}N/X{S
--- a/lib-src/ChangeLog	Wed May 16 19:48:35 2007 +0000
+++ b/lib-src/ChangeLog	Thu May 17 01:12:58 2007 +0000
@@ -1,3 +1,7 @@
+2007-04-26  Glenn Morris  <rgm@gnu.org>
+
+	* makefile.w32-in (VERSION): Increase to 22.1.50.
+
 2007-02-26  Francesco Potort,Al(B  <pot@gnu.org>
 
 	* Makefile.in (etags, ctags): Define EMACS_NAME as "GNU Emacs".
@@ -1845,7 +1849,7 @@
 	[WINDOWSNT]: #undef DOS_NT and #define it even if built with
 	HAVE_CONFIG_H.  This change does nothing in Emacs, as DOS_NT is
 	always defined when HAVE_CONFIG_H and WINDOWS are both defined.
-	[!HAVE_UNISTD_H]: use defined(WINDOWSNT) instead of the bare
+	[!HAVE_UNISTD_H]: Use defined(WINDOWSNT) instead of the bare
 	WINDOWSNT, as this is the correct way to use it.
 
 2001-01-28  Francesco Potort,Al(B  <pot@gnu.org>
@@ -2996,7 +3000,7 @@
 
 1997-03-14  Francesco Potort,Al(B  <F.Potorti@cnuce.cnr.it>
 
-	* etags.c (add_regex): reset *putbuf before using it.
+	* etags.c (add_regex): Reset *putbuf before using it.
 
 1997-02-23  Jonathan I. Kamens  <jik@kamens.brookline.ma.us>
 
@@ -3560,7 +3564,7 @@
 
 1995-12-04  Francesco Potort,Al(B  <pot@cnuce.cnr.it>
 
-	* Makefile.in (ctags): depend on etags only for simplicity;
+	* Makefile.in (ctags): Depend on etags only for simplicity;
 	compile with regexp support enabled.
 
 1995-11-24  Richard Stallman  <rms@mole.gnu.ai.mit.edu>
@@ -3685,13 +3689,13 @@
 
 1995-06-27  Francesco Potort,Al(B  (pot@cnuce.cnr.it)
 
-	* etags.c (plain_C_entries): new function.
-	(lowcase): new macro.
-	(tail, Fortran_functions, Pascal_functions): use new macro lowcase.
-	(lang_suffixes): new suffix ".pc" for Pro*C files.
-	(consider_token): don't tag all tokens beginning with DEFUN & Co..
-	(tail): look for the end of the token when comparing.
-	(takeprec): since now tail behaves differently, use strneq.
+	* etags.c (plain_C_entries): New function.
+	(lowcase): New macro.
+	(tail, Fortran_functions, Pascal_functions): Use new macro lowcase.
+	(lang_suffixes): New suffix ".pc" for Pro*C files.
+	(consider_token): Don't tag all tokens beginning with DEFUN & Co..
+	(tail): Look for the end of the token when comparing.
+	(takeprec): Since now tail behaves differently, use strneq.
 
 1995-07-08  Paul Eggert  <eggert@twinsun.com>
 
@@ -3723,13 +3727,13 @@
 
 1995-06-27  Francesco Potort,Al(B  (pot@cnuce.cnr.it)
 
-	* etags.c (plain_C_entries): new function.
-	(lowcase): new macro.
-	(tail, Fortran_functions, Pascal_functions): use new macro lowcase.
-	(lang_suffixes): new suffix ".pc" for Pro*C files.
-	(consider_token): don't tag all tokens beginning with DEFUN & Co..
-	(tail): look for the end of the token when comparing.
-	(takeprec): since now tail behaves differently, use strneq.
+	* etags.c (plain_C_entries): New function.
+	(lowcase): New macro.
+	(tail, Fortran_functions, Pascal_functions): Use new macro lowcase.
+	(lang_suffixes): New suffix ".pc" for Pro*C files.
+	(consider_token): Don't tag all tokens beginning with DEFUN & Co..
+	(tail): Look for the end of the token when comparing.
+	(takeprec): Since now tail behaves differently, use strneq.
 
 1995-06-26  Richard Stallman  <rms@mole.gnu.ai.mit.edu>
 
@@ -3906,7 +3910,7 @@
 
 1995-03-13  Francesco Potort,Al(B  (pot@cnuce.cnr.it)
 
-	* etags.c (process_file): free (filename) after using it.
+	* etags.c (process_file): Free (filename) after using it.
 	(readline_internal): Do not access the char before start of line.
 
 1995-02-22  Francesco Potort,Al(B  (pot@cnuce.cnr.it)
@@ -4039,8 +4043,8 @@
 
 1994-11-22  Francesco Potort,Al(B  (pot@cnuce.cnr.it)
 
-	* etags.c (print_help): print --regex usage for ctags also.
-	(main): use -h in addition to -H as abbreviation for --help.
+	* etags.c (print_help): Print --regex usage for ctags also.
+	(main): Use -h in addition to -H as abbreviation for --help.
 
 1994-11-16  Francesco Potort,Al(B  (pot@cnuce.cnr.it)
 
@@ -4105,9 +4109,9 @@
 
 1994-10-21  Francesco Potort,Al(B  (pot@cnuce.cnr.it)
 
-	* etags.c (prestr, substr): return a logical type.
+	* etags.c (prestr, substr): Return a logical type.
 	(consider_token): Comment out "EXFUN".  Use "DEFUN" instead of "DEF".
-	(consider_token): set funcdef to fignore when a DEFUN is met.
+	(consider_token): Set funcdef to fignore when a DEFUN is met.
 	(C_entries): Now we can use Tom Hageman patch for extern "C".
 
 1994-10-20  Richard Stallman  <rms@mole.gnu.ai.mit.edu>
@@ -4190,8 +4194,8 @@
 
 1994-10-17  Francesco Potort,Al(B  (pot@fly.cnuce.cnr.it)
 
-	* Makefile.in.in (etags): add dependency on regex.o, link with it.
-	(REGEXPOBJ, REGEXPDEPS, regex.o): target and macros added.
+	* Makefile.in.in (etags): Add dependency on regex.o, link with it.
+	(REGEXPOBJ, REGEXPDEPS, regex.o): Target and macros added.
 
 1994-10-12  David J. MacKenzie  (djm@duality.gnu.ai.mit.edu)
 
@@ -4341,7 +4345,7 @@
 
 1994-07-08  Dave Love  (d.love@dl.ac.uk)
 
-	* etags.c (takeprec): recognise `character*(*) function'
+	* etags.c (takeprec): Recognise `character*(*) function'.
 
 1994-07-08  Francesco Potort,Al(B  (pot@cnuce.cnr.it)
 
@@ -4489,11 +4493,11 @@
 
 1994-04-18  Francesco Potort,Al(B  (pot@fly.cnuce.cnr.it)
 
-	* etags.c (main, print_help): eliminate the -F option.
+	* etags.c (main, print_help): Eliminate the -F option.
 
 1994-04-18  Francesco Potort,Al(B  (pot@fly.cnuce.cnr.it)
 
-	* etags.c (absolute_filename): compare against '\0' instead of NULL.
+	* etags.c (absolute_filename): Compare against '\0' instead of NULL.
 
 1994-04-16  Richard Stallman  (rms@mole.gnu.ai.mit.edu)
 
@@ -4527,21 +4531,21 @@
 
 1994-04-08  Francesco Potort,Al(B  (pot@fly.cnuce.cnr.it)
 
-	* etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
-	(PF_funcs, Asm_funcs, L_funcs, PAS_funcs, TEX_funcs,
-	Scheme_funcs, prolog_funcs): renamed to Fortran_functions,
+	* etags.c (outf, outfiledir): Renamed to tagf, tagfiledir.
+	(PF_funcs, Asm_funcs, L_funcs, PAS_funcs, TEX_funcs)
+	(Scheme_funcs, prolog_funcs): Renamed to Fortran_functions,
 	Asm_labels, Lisp_functions, Pascal_functions, Scheme_functions,
 	TeX_functions, Prolog_functions.
-	(inf): no more a global variable.
-	(C_entries): take 2nd parameter `inf' instead of using the global one.
-	(find_entries): added the cp1 var for optimisation.
-	(find_entries): added more suffixes for assembler files.
+	(inf): No more a global variable.
+	(C_entries): Take 2nd parameter `inf' instead of using the global one.
+	(find_entries): Added the cp1 var for optimisation.
+	(find_entries): Added more suffixes for assembler files.
 	(Asm_funcs): Now finds labels even without an ending colon.
 
 1994-03-30  Francesco Potort,Al(B  (pot@fly.cnuce.cnr.it)
 
-	* etags.c (main): use etags_getcwd for compatibility.
-	(etags_getcwd): new function.
+	* etags.c (main): Use etags_getcwd for compatibility.
+	(etags_getcwd): New function.
 
 1994-03-25  Richard Stallman  (rms@mole.gnu.ai.mit.edu)
 
@@ -4549,22 +4553,22 @@
 
 1994-03-25  Francesco Potort,Al(B  (pot@cnuce.cnr.it)
 
-	* etags.c (emacs_tags_format, ETAGS): removed.  Use CTAGS instead.
-	(main): don't allow the use of -t and -T in etags mode.
-	(print_help): don't show options enabled by default.
-	(print_version): show the emacs version number if VERSION is #defined.
-	(find_entries): add "ss" as suffix for Chez Scheme.
+	* etags.c (emacs_tags_format, ETAGS): Removed.  Use CTAGS instead.
+	(main): Don't allow the use of -t and -T in etags mode.
+	(print_help): Don't show options enabled by default.
+	(print_version): Show the emacs version number if VERSION is #defined.
+	(find_entries): Add "ss" as suffix for Chez Scheme.
 
 1994-03-23  Francesco Potort,Al(B  (pot@cnuce.cnr.it)
 
-	* etags.c (cwd, outfiledir): vars added.
+	* etags.c (cwd, outfiledir): Vars added.
 	(relative_filename, absolute_filename, absolute_dirname):
 	functions added to compute filenames in tags files.
-	(process_file): filenames in tags file are relative to the
+	(process_file): Filenames in tags file are relative to the
 	directory where the tags file is (useful with the -o option).
-	(main): initialise the outfiledir var.
-	(TYPEDST): added the `tignore' value.
-	(C_entries): corrected various small bugs.
+	(main): Initialise the outfiledir var.
+	(TYPEDST): Added the `tignore' value.
+	(C_entries): Corrected various small bugs.
 
 1994-03-19  Richard Stallman  (rms@mole.gnu.ai.mit.edu)
 
@@ -4579,8 +4583,8 @@
 
 1994-03-14  Francesco Potort,Al(B  (pot@cnuce.cnr.it)
 
-	* etags.c (TYPEDST): added the `tignore' value.
-	(C_entries): corrected various bugs, now correctly parses the
+	* etags.c (TYPEDST): Added the `tignore' value.
+	(C_entries): Corrected various bugs, now correctly parses the
 	`extern "C" {' construction (patch by Tom R.Hageman).
 
 1994-03-05  Richard Stallman  (rms@mole.gnu.ai.mit.edu)
@@ -4621,7 +4625,7 @@
 1994-02-22  Karl Heuer  (kwzh@gnu.ai.mit.edu)
 
 	* profile.c (get_time): Simplify; avoid calling index.
-	(main): exit on EOF.
+	(main): Exit on EOF.
 
 1994-02-17  Francesco Potort,Al(B  (pot@cnuce.cnr.it)
 
@@ -4633,11 +4637,11 @@
 
 1994-02-14  Francesco Potort,Al(B  (pot@fly)
 
-	* etags.c (absolute_pathnames, cwd): added global vars.
-	(longopts, print_help, main, process_file): put absolute filenames
+	* etags.c (absolute_pathnames, cwd): Added global vars.
+	(longopts, print_help, main, process_file): Put absolute filenames
 	in the tag file if the -A --absolute-pathnames option is used.
-	(print_help): alfabetically order the options.
-	(malloc, realloc, strcpy, strncpy, strcmp): remove extern declar.
+	(print_help): Alfabetically order the options.
+	(malloc, realloc, strcpy, strncpy, strcmp): Remove extern declar.
 
 1994-02-09  Richard Stallman  (rms@mole.gnu.ai.mit.edu)
 
@@ -4666,15 +4670,15 @@
 1994-01-14  Francesco Potort,Al(B  (pot@cnuce.cnr.it)
 
 	* etags.c (stab_entry, stab_create, stab_find, stab_search,
-	stab_type, add_keyword, C_reate_stab, C_create_stabs): deleted.
+	stab_type, add_keyword, C_reate_stab, C_create_stabs): Deleted.
 	Use gperf generated hash table instead of linked list.
-	(C_stab_entry, hash, in_word_set, get_C_stab, C_symtype): added.
+	(C_stab_entry, hash, in_word_set, get_C_stab, C_symtype): Added.
 	Mostly code generated by gperf.
-	(consider_token): removed unused parameter `lp'.
-	(PF_funcs, getit): allow subroutine and similar declarations
+	(consider_token): Removed unused parameter `lp'.
+	(PF_funcs, getit): Allow subroutine and similar declarations
 	to span multiple lines.
-	(C_entries): check for newline if inchar to avoid bus errors.
-	(process_file, find_entries): distinguish among nonexistent
+	(C_entries): Check for newline if inchar to avoid bus errors.
+	(process_file, find_entries): Distinguish among nonexistent
 	and not regular file.
 
 1994-01-14  Richard Stallman  (rms@mole.gnu.ai.mit.edu)
@@ -4811,14 +4815,14 @@
 	functions returning a pointer to a function, a la `signal', can be
 	parsed.  This also required new state `fstartlist' to `FUNCST'.
 	(SAVE_TOKEN, RESTORE_TOKEN, TOKEN_SAVED_P): 1-deep token save stack.
-	(C_entries, CNL): use it to isolate preprocessor directive processing
+	(C_entries, CNL): Use it to isolate preprocessor directive processing
 	from the other state engines.
-	(begtk): add '~', for C++ class destructors.
+	(begtk): Add '~', for C++ class destructors.
 
 1993-11-02  Francesco Potort,Al(B  (pot@cnuce.cnr.it)
 
-	* etags.c (consider_token): removed unused variable firsttok.
-	(prolog_getit): call pfnote with the right number of arguments.
+	* etags.c (consider_token): Removed unused variable firsttok.
+	(prolog_getit): Call pfnote with the right number of arguments.
 
 1993-10-19  Paul Eggert  (eggert@twinsun.com)
 
@@ -4837,9 +4841,9 @@
 
 1993-10-01  Francesco Potort,Al(B  (pot@cnuce.cnr.it)
 
-	* etags.c (process_file): dead code removed.
+	* etags.c (process_file): Dead code removed.
 	(S_ISREG): #define it using S_IFREG if not defined.
-	(process_file): regular files have nothing to do with symlinks.
+	(process_file): Regular files have nothing to do with symlinks.
 
 1993-09-28  Brian Fox  (bfox@ai.mit.edu)
 
@@ -4922,10 +4926,10 @@
 
 1993-08-04  Francesco Potort,Al(B  (pot@spiff.gnu.ai.mit.edu)
 
-	* etags.c (L_isdef, L_isquote, L_getit): small optimisations.
-	(L_funcs): the (foo::defmumble stuff now should work.
-	(consider_token): function returned random value--corrected.
-	(C_entries): corrected == versus = typo.
+	* etags.c (L_isdef, L_isquote, L_getit): Small optimisations.
+	(L_funcs): The (foo::defmumble stuff now should work.
+	(consider_token): Function returned random value--corrected.
+	(C_entries): Corrected == versus = typo.
 
 1993-08-01  Roland McGrath  (roland@churchy.gnu.ai.mit.edu)
 
@@ -4941,11 +4945,11 @@
 	* etags.c (FINCST): Added the fignore status.  Means we are
 	after the parameter list and before the open curly brace.
 	Allows correct parsing of C++ constructors.
-	(C_entries, consider_token): make use of fignore.
-	(consider_token): reset funcdef when next_token_is_func: when in
+	(C_entries, consider_token): Make use of fignore.
+	(consider_token): Reset funcdef when next_token_is_func: when in
 	ctags mode makes DEFVAR and others work better.
-	(L_isquote): function that recognises the "(quote" string.
-	(L_getit): ignore quoting via "'" or "(quote".  Useful for defalias.
+	(L_isquote): Function that recognises the "(quote" string.
+	(L_getit): Ignore quoting via "'" or "(quote".  Useful for defalias.
 
 1993-07-29  Paul Eggert  (eggert@twinsun.com)
 
@@ -4977,20 +4981,20 @@
 
 1993-07-08  Francesco Potort,Al(B  (pot@cnuce.cnr.it)
 
-	* etags.c (alloca): removed all references to it.
-	(main): now calls xnew instead of alloca for portability.
-	(../src/config.h): included only if HAVE_CONFIG_H.
-	(const): void definition removed--config.h takes care of it.
+	* etags.c (alloca): Removed all references to it.
+	(main): Now calls xnew instead of alloca for portability.
+	(../src/config.h): Included only if HAVE_CONFIG_H.
+	(const): Void definition removed--config.h takes care of it.
 
 1993-07-08  Francesco Potort,Al(B  (pot@cnuce.cnr.it)
 
-	* etags.c (consider_token): was `==', now is `='.
+	* etags.c (consider_token): Was `==', now is `='.
 	(consider_token): DEFUNs now treated like funcs in ctags mode.
 
-	* etags.c (LEVEL_OK_FOR_FUNCDEF): removed.
-	(C_entries): optimized the test that used LEVEL_OK_FOR_FUNCDEF.
-	(C_entries): removed a piece of useless code.
-	(C_entries): making typedef tags is delayed until a semicolon
+	* etags.c (LEVEL_OK_FOR_FUNCDEF): Removed.
+	(C_entries): Optimized the test that used LEVEL_OK_FOR_FUNCDEF.
+	(C_entries): Removed a piece of useless code.
+	(C_entries): Making typedef tags is delayed until a semicolon
 	is met.  This handles "typedef int X, Y, Z;" correctly.
 
 1993-07-06  Jim Blandy  (jimb@geech.gnu.ai.mit.edu)
@@ -5266,38 +5270,38 @@
 
 1993-03-22  Francesco Potort,Al(B  (pot@cnuce.cnr.it)
 
-	* etags.c (YACC): flag added to c_ext.
-	(c_ext): no more a synonim for c_ext&C_PLPL because of YACC.
-	(find_entries): consistently use streq when reasonable.
-	(find_entries): a .y file is a yacc file.
+	* etags.c (YACC): Flag added to c_ext.
+	(c_ext): No more a synonim for c_ext&C_PLPL because of YACC.
+	(find_entries): Consistently use streq when reasonable.
+	(find_entries): A .y file is a yacc file.
 	(get_C_stab): c_ext becomes c_ext&C_PLPL.
-	(C_entries): logical cplpl means c_ext&C_PLPL.
-	(C_entries): logical yacc_rules means we are after the first %%.
-	(C_entries): added logic for yacc files.
+	(C_entries): Logical cplpl means c_ext&C_PLPL.
+	(C_entries): Logical yacc_rules means we are after the first %%.
+	(C_entries): Added logic for yacc files.
 
 1993-03-16  Francesco Potort,Al(B  (pot@cnuce.cnr.it)
 
 	* etags.c (C_entries): ':' case moved to the second switch.
-	(C_entries): do not examine token if structdef==scolonseen.
+	(C_entries): Do not examine token if structdef==scolonseen.
 	(consider_token): structtag set to null string for enum.
 
 1993-03-12  Francesco Potort,Al(B  (pot@cnuce.cnr.it)
 
-	* etags.c (GET_COOKIE): and related macros removed.
-	(logical): is now int, no more a char.
-	(reg): define deleted.
-	(isgood, _gd, notgd): deleted.
-	(gotone): deleted.
-	(TOKEN): member linestart removed.
-	(linepos, prev_linepos, lb1): deleted.
-	(main): call initbuffer on lbs array instead of lb1.
-	(init): removed the initialisation of the logical _gd array;
-	(find_entries): a .sa suffix means assembler file.
+	* etags.c (GET_COOKIE): And related macros removed.
+	(logical): Is now int, no more a char.
+	(reg): Define deleted.
+	(isgood, _gd, notgd): Deleted.
+	(gotone): Deleted.
+	(TOKEN): Member linestart removed.
+	(linepos, prev_linepos, lb1): Deleted.
+	(main): Call initbuffer on lbs array instead of lb1.
+	(init): Removed the initialisation of the logical _gd array;
+	(find_entries): A .sa suffix means assembler file.
 	(C_create_stab): "auto", "void", "extern", "static" are st_C_typespec.
 	All C state machines rewritten.
-	(C_entries): complete rewrite.
-	(condider_token): complete rewrite.
-	(getline): deleted.
+	(C_entries): Complete rewrite.
+	(condider_token): Complete rewrite.
+	(getline): Deleted.
 
 1993-03-01  Francesco Potort,Al(B  (pot@fly.CNUCE.CNR.IT)
 
@@ -5311,7 +5315,7 @@
 
 1993-03-19  Eric S. Raymond  (eric@geech.gnu.ai.mit.edu)
 
-	* Makefile.in (EXECUTABLES): added rcs-checkin.
+	* Makefile.in (EXECUTABLES): Added rcs-checkin.
 
 	* Makefile.in (unlock, relock): New productions.
 
@@ -5594,7 +5598,7 @@
 
 1992-05-04  Jim Blandy  (jimb@pogo.cs.oberlin.edu)
 
-	* Makefile.in: flags in CC invocations rearranged for no reason.
+	* Makefile.in: Flags in CC invocations rearranged for no reason.
 
 1992-04-20  Jim Blandy  (jimb@pogo.cs.oberlin.edu)
 
@@ -6007,13 +6011,13 @@
 
 1989-04-18  Richard Stallman  (rms@sugar-bombs.ai.mit.edu)
 
-	* loadst.c: on bsd4.3, use gettimeofday instead of CPUSTATES.
+	* loadst.c: On bsd4.3, use gettimeofday instead of CPUSTATES.
 
 1989-03-15  Jeff Peck  (rms@sugar-bombs.ai.mit.edu)
 
 	* emacstool.c: setenv IN_EMACSTOOL=t, TERM=sun, TERMCAP=.
 
-	* emacsstool.1: update to document environment variables.
+	* emacsstool.1: Update to document environment variables.
 
 1989-02-21  Richard Stallman  (rms@sugar-bombs.ai.mit.edu)
 
@@ -6114,7 +6118,7 @@
 
 1988-09-24  Richard Stallman  (rms@gluteus.ai.mit.edu)
 
-	* etags.c (main): default setting of eflag was backwards.
+	* etags.c (main): Default setting of eflag was backwards.
 
 1988-09-23  Richard Stallman  (rms@sugar-bombs.ai.mit.edu)
 
@@ -6197,7 +6201,7 @@
 1988-04-28  Richard Stallman  (rms@frosted-flakes.ai.mit.edu)
 
 	* movemail.c: #undef close, since config can #define it on V.3.
-	* emacsclient.c, fakemail.c, loadst.c, server.c: likewise.
+	* emacsclient.c, fakemail.c, loadst.c, server.c: Likewise.
 
 1988-04-26  Richard Stallman  (rms@lucky-charms.ai.mit.edu)
 
@@ -6208,9 +6212,9 @@
 
 1988-03-20  Richard M. Stallman  (rms@wilson)
 
-	* server.c [not BSD and not HAVE_SYSVIPC]: fix error message.
-
-	* loadst.c (main) [XENIX]: use /usr/spool/mail, not /usr/mail.
+	* server.c [not BSD and not HAVE_SYSVIPC]: Fix error message.
+
+	* loadst.c (main) [XENIX]: Use /usr/spool/mail, not /usr/mail.
 
 ;; Local Variables:
 ;; coding: iso-2022-7bit
--- a/lib-src/makefile.w32-in	Wed May 16 19:48:35 2007 +0000
+++ b/lib-src/makefile.w32-in	Thu May 17 01:12:58 2007 +0000
@@ -24,7 +24,7 @@
 
 .PHONY: $(ALL)
 
-VERSION		= 22.0.99
+VERSION		= 22.1.50
 
 LOCAL_FLAGS	= -DWINDOWSNT -DDOS_NT -DSTDC_HEADERS=1 -DNO_LDAV=1 \
 		  -DNO_ARCHIVES=1 -DHAVE_CONFIG_H=1 -I../nt/inc \
--- a/lisp/ChangeLog	Wed May 16 19:48:35 2007 +0000
+++ b/lisp/ChangeLog	Thu May 17 01:12:58 2007 +0000
@@ -34,22 +34,43 @@
 	* view.el (view-inhibit-help-message): Fix typo in docstring.
 	(view-scroll-auto-exit, view-try-extend-at-buffer-end): Doc fixes.
 
+2007-05-16  Martin Rudalics  <rudalics@gmx.at>
+
+	* textmodes/ispell.el (ispell-start-process): Defend against bad
+	default-directory.
+
 2007-05-14  Eli Zaretskii  <eliz@gnu.org>
 
 	* mail/rmail.el (rmail-convert-to-babyl-format): Check
-	content-transfer-encoding _last_, because we need its position in
-	base64-header-field-end.
+	content-transfer-encoding _last_, because it's its position that
+	we need as value of base64-header-field-end.
 
 2007-05-14  Juanma Barranquero  <lekktu@gmail.com>
 
 	* files.el (mode-require-final-newline, require-final-newline)
 	(enable-local-variables, enable-local-eval): Doc fixes.
 
-2007-05-10  Edward O'Connor  <hober0@gmail.com>  (tiny change)
-
-	* progmodes/python.el (python-font-lock-keywords)
-	(python-open-block-statement-p, python-mode): Add support for the new
-	"with" keyword.
+2007-05-13  Vinicius Jose Latorre  <viniciusjl@ig.com.br>
+
+	* ps-print.el: Use default color when foreground or background color
+	are unspecified.  Reported by Leo <sdl.web@gmail.com>.
+	(ps-print-version): New version 6.7.4.
+	(ps-rgb-color): New argument.  Use default color when color is
+	unspecified.
+	(ps-begin-job): Fix code.
+
+2007-05-12  Chong Yidong  <cyd@stupidchicken.com>
+
+	* longlines.el (longlines-mode): Make longlines-auto-wrap
+	buffer-local.  Add hooks unconditionally.
+	(longlines-auto-wrap): Toggle wrapping.
+	(longlines-after-change-function)
+	(longlines-post-command-function): Check longlines-auto-wrap.
+
+2007-05-12  Nick Roberts  <nickrob@snap.net.nz>
+
+	* xt-mouse.el (xterm-mouse-debug-buffer): New variable.
+	(xterm-mouse-translate): Use it.
 
 2007-05-10  Richard Stallman  <rms@gnu.org>
 
@@ -70,11 +91,60 @@
 	(set-auto-mode): Handle file-start-mode-alist.
 	A little cleanup of structure.
 
-2007-05-10  Davis Herring  <herring@lanl.gov>
-
-	* calendar/timeclock.el (timeclock-in): Fix non-interactive
-	workday specifications.
-	(timeclock-log): Don't kill the log buffer if it already existed.
+2007-05-10  Micha,Ak(Bl Cadilhac  <michael@cadilhac.name>
+
+	* man.el (Man-next-section): Don't consider the last line of the page
+	as being part of any section.
+
+2007-05-10  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* textmodes/sgml-mode.el (sgml-value): Fix handling of attributes which
+	can take any number of values.
+
+2007-05-09  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* textmodes/tex-mode.el (tex-font-lock-keywords-2): Add citet and citep
+	to the list of citation commands.
+
+2007-05-09  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* vc-hooks.el (vc-find-root): Stop searching when the user changes.
+
+2007-05-09  Edward O'Connor  <hober0@gmail.com>  (tiny change)
+
+	* progmodes/python.el (python-font-lock-keywords)
+	(python-open-block-statement-p, python-mode): Add support for the new
+	"with" keyword.
+
+2007-05-08  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* diff-mode.el (diff-apply-hunk, diff-test-hunk): Don't do by default
+	the exact opposite of diff-goto-source.
+
+	* emacs-lisp/advice.el (ad-special-forms): Remove.
+	(ad-special-form-p): Use subr-arity.
+
+	* newcomment.el (comment-search-forward): Make sure we search forward.
+	(comment-enter-backward): Try and distinguish the non-matching case at
+	EOB from the non-matching case with a missing comment-end-skip for
+	a 2-char comment ender.
+	(comment-choose-indent): New function extracted from comment-indent.
+	Improve the alignment algorithm.
+	(comment-indent): Use it.
+
+	* textmodes/sgml-mode.el (sgml-lexical-context): Add handling of
+	XML style Processing Instructions.
+	(sgml-parse-tag-backward): Handle XML-style PIs.  Also ensure progress.
+	(sgml-calculate-indent): Handle `pi' context.
+
+	* vc.el: Ensure that update-changelog issues an error when used with
+	a backend that does not implement it.
+	(vc-update-changelog-rcs2log): Rename from vc-default-update-changelog.
+	Remove `backend' argument.  Use expand-file-name.
+	(vc-cvs-update-changelog, vc-rcs-update-changelog): New aliases.
+
+	* progmodes/python.el (python-end-of-block): Revert last change.
+	(python-end-of-statement): Make sure we move *forward*.
 
 2007-05-08  Richard Stallman  <rms@gnu.org>
 
@@ -95,6 +165,29 @@
 
 	* emacs-lisp/eldoc.el (turn-on-eldoc-mode): Doc fix.
 
+2007-05-05  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* diff.el (diff): Use buffer-local vars diff-old-file and diff-new-file
+	rather than storing their value in the revert-buffer function.
+
+2007-05-04  Nick Roberts  <nickrob@snap.net.nz>
+
+	* t-mouse.el (t-mouse-mode): Do nothing on a graphical display
+	when disabling t-mouse-mode.
+
+2007-05-01  Davis Herring  <herring@lanl.gov>
+
+	* calendar/timeclock.el: Update version number.
+	(timeclock-modeline-display): Mention timeclock-use-display-time
+	in explanatory message.
+	(timeclock-in): Fix non-interactive workday specifications.
+	(timeclock-log): Don't kill the log buffer if it already existed.
+	Suppress warnings when finding the log.  Don't check for a nil
+	project twice.  Run hooks after killing the buffer (if applicable).
+	(timeclock-geometric-mean): Rename to `timeclock-mean' (it never
+	was geometric).  All uses changed.
+	(timeclock-generate-report): Support prefix argument.
+
 2007-05-03  Ryan Yeske  <rcyeske@gmail.com>
 
 	* net/rcirc.el (rcirc-timeout-seconds): Increase to prevent unwanted
@@ -104,11 +197,6 @@
 
 	* dired-x.el: Revert 2007-04-06 change.
 
-2007-04-30  Nick Roberts  <nickrob@snap.net.nz>
-
-	* progmodes/gud.el (gud-menu-map): Pdb can't handle SIGINT so
-	don't put stop on toolbar.
-
 2007-04-29  Stephen Berman  <Stephen.Berman@gmx.net>
 
 	* find-dired.el (find-dired-filter): Propertize all text down to eob.
@@ -126,6 +214,11 @@
 
 	* progmodes/sh-script.el (sh-mode): Recognize .profile as sh style.
 
+2007-04-28  Nick Roberts  <nickrob@snap.net.nz>
+
+	* progmodes/gud.el (gud-menu-map): Pdb can't handle SIGINT so
+	don't put stop on toolbar.
+
 2007-04-28  Stefan Monnier  <monnier@iro.umontreal.ca>
 
 	* vc-hooks.el (vc-ignore-dir-regexp): Add /.../ for the DFS filesystem.
@@ -135,8 +228,6 @@
 	* makefile.w32-in ($(lisp)/mh-e/mh-loaddefs.el): Use ./mh-e
 	instead of $(lisp)/mh-e.
 
-	* textmodes/fill.el (fill-paragraph): Doc fix.
-
 2007-04-28  Glenn Morris  <rgm@gnu.org>
 
 	* image-dired.el (image-dired-cmd-create-thumbnail-options)
@@ -148,10 +239,13 @@
 	* textmodes/flyspell.el (flyspell-auto-correct-previous-word):
 	Use window-start and window-end.
 
-2007-04-26  Glenn Morris  <rgm@gnu.org>
-
-	* progmodes/python.el: Restore file pending consideration of legal
-	status.
+2007-04-27  Andreas Schwab  <schwab@suse.de>
+
+	* emacs-lisp/sregex.el (sregexq): Fix doc string quoting.
+
+2007-04-27  Eli Zaretskii  <eliz@gnu.org>
+
+	* textmodes/fill.el (fill-paragraph): Doc fix.
 
 2007-04-26  Luc Teirlinck  <teirllm@dms.auburn.edu>
 
@@ -162,6 +256,8 @@
 	* button.el (button): Use underline if supported, else fall back
 	to color.
 
+	* version.el (emacs-version): Increase to 22.1.50.
+
 2007-04-25  Richard Stallman  <rms@gnu.org>
 
 	* hi-lock.el (hi-lock-file-patterns-policy): Default to `ask'.
@@ -182,10 +278,6 @@
 
 	* custom.el (defface): Doc fix.
 
-2007-04-24  Chong Yidong  <cyd@stupidchicken.com>
-
-	* progmodes/python.el: Remove due to unclear legal issues.
-
 2007-04-24  J.D. Smith  <jdsmith@as.arizona.edu>
 
 	* progmodes/idlw-shell.el (idlwave-shell-clear-all-bp):
@@ -13729,8 +13821,8 @@
 
 2006-01-29  Edward O'Connor  <ted@oconnor.cx>
 
-	* emulation/viper.el (viper-major-mode-modifier-list): Add
-	insert-state and vi-state entries for erc-mode.
+	* emulation/viper.el (viper-major-mode-modifier-list):
+	Add insert-state and vi-state entries for erc-mode.
 	(viper-go-away, viper-set-hooks): Add and remove
 	viper-comint-mode-hook from erc-mode-hook as appropriate.
 
--- a/lisp/calendar/timeclock.el	Wed May 16 19:48:35 2007 +0000
+++ b/lisp/calendar/timeclock.el	Thu May 17 01:12:58 2007 +0000
@@ -5,7 +5,7 @@
 
 ;; Author: John Wiegley <johnw@gnu.org>
 ;; Created: 25 Mar 1999
-;; Version: 2.6
+;; Version: 2.6.1
 ;; Keywords: calendar data
 
 ;; This file is part of GNU Emacs.
@@ -304,8 +304,8 @@
                 ;; Update immediately so there is a visible change
                 ;; on calling this function.
                 (if display-time-mode (timeclock-update-modeline)
-                  (message "Activate `display-time-mode' to see \
-timeclock information"))
+                  (message "Activate `display-time-mode' or turn off \
+`timeclock-use-display-time' to see timeclock information"))
                 (add-hook 'display-time-hook 'timeclock-update-modeline))
 	    (setq timeclock-update-timer
 		  (run-at-time nil 60 'timeclock-update-modeline))))
@@ -589,6 +589,38 @@
 	(message "%s" string)
       string)))
 
+(defun timeclock-make-hours-explicit (old-default)
+  "Specify all workday lengths in `timeclock-file'.
+OLD-DEFAULT hours are set for every day that has no number indicated."
+  (interactive "P")
+  (if old-default (setq old-default (prefix-numeric-value old-default))
+    (error "timelog-make-hours-explicit requires an explicit argument"))
+  (let ((extant-timelog (find-buffer-visiting timeclock-file))
+	current-date)
+    (with-current-buffer (find-file-noselect timeclock-file t)
+      (unwind-protect
+	  (save-excursion
+	    (save-restriction
+	      (widen)
+	      (goto-char (point-min))
+	      (while (progn (skip-chars-forward "\n") (not (eobp)))
+		;; This is just a variant of `timeclock-moment-regexp'.
+		(unless (looking-at
+			 (concat "^\\([bhioO]\\) \\([0-9]+/[0-9]+/[0-9]+\\) "
+				 "\\([0-9]+:[0-9]+:[0-9]+\\)"))
+		  (error "Can't parse `%s'" timeclock-file))
+		(let ((this-date (match-string 2)))
+		  (unless (or (and current-date
+				   (string= this-date current-date))
+			      (string= (match-string 1) "h"))
+		    (insert (format "h %s %s %s\n" (match-string 2)
+				    (match-string 3) old-default)))
+		  (if (string-match "^[ih]" (match-string 1)) ; ignore logouts
+		      (setq current-date this-date)))
+		(forward-line))
+	      (save-buffer)))
+	(unless extant-timelog (kill-buffer (current-buffer)))))))
+
 ;;; Internal Functions:
 
 (defvar timeclock-project-list nil)
@@ -653,7 +685,7 @@
 If PROJECT is a string, it represents the project which the event is
 being logged for.  Normally only \"in\" events specify a project."
   (let ((extant-timelog (find-buffer-visiting timeclock-file)))
-    (with-current-buffer (find-file-noselect timeclock-file)
+    (with-current-buffer (find-file-noselect timeclock-file t)
       (save-excursion
 	(save-restriction
 	  (widen)
@@ -663,8 +695,7 @@
 	  (let ((now (current-time)))
 	    (insert code " "
 		    (format-time-string "%Y/%m/%d %H:%M:%S" now)
-		    (or (and project
-			     (stringp project)
+		    (or (and (stringp project)
 			     (> (length project) 0)
 			     (concat " " project))
 			"")
@@ -679,8 +710,8 @@
 			 timeclock-last-period)))
 	    (setq timeclock-last-event (list code now project)))))
       (save-buffer)
-      (run-hooks 'timeclock-event-hook)
-      (unless extant-timelog (kill-buffer (current-buffer))))))
+      (unless extant-timelog (kill-buffer (current-buffer)))))
+  (run-hooks 'timeclock-event-hook))
 
 (defvar timeclock-moment-regexp
   (concat "\\([bhioO]\\)\\s-+"
@@ -1152,8 +1183,8 @@
     (setcar (nthcdr 2 decoded) 0)
     (apply 'encode-time decoded)))
 
-(defun timeclock-geometric-mean (l)
-  "Compute the geometric mean of the values in the list L."
+(defun timeclock-mean (l)
+  "Compute the arithmetic mean of the values in the list L."
   (let ((total 0)
 	(count 0))
     (while l
@@ -1168,7 +1199,7 @@
   "Generate a summary report based on the current timelog file.
 By default, the report is in plain text, but if the optional argument
 HTML-P is non-nil, HTML markup is added."
-  (interactive)
+  (interactive "P")
   (let ((log (timeclock-log-data))
 	(today (timeclock-day-base)))
     (if html-p (insert "<p>"))
@@ -1300,14 +1331,10 @@
 	  ;; average statistics
 	  (let ((i 0) (l 5))
 	    (while (< i l)
-	      (aset time-in i (timeclock-geometric-mean
-			       (cdr (aref time-in i))))
-	      (aset time-out i (timeclock-geometric-mean
-				(cdr (aref time-out i))))
-	      (aset breaks i (timeclock-geometric-mean
-			      (cdr (aref breaks i))))
-	      (aset workday i (timeclock-geometric-mean
-			       (cdr (aref workday i))))
+	      (aset time-in i (timeclock-mean (cdr (aref time-in i))))
+	      (aset time-out i (timeclock-mean (cdr (aref time-out i))))
+	      (aset breaks i (timeclock-mean (cdr (aref breaks i))))
+	      (aset workday i (timeclock-mean (cdr (aref workday i))))
 	      (setq i (1+ i))))
 	  ;; Output the HTML table
 	  (insert "<tr>\n")
--- a/lisp/dabbrev.el	Wed May 16 19:48:35 2007 +0000
+++ b/lisp/dabbrev.el	Thu May 17 01:12:58 2007 +0000
@@ -128,7 +128,7 @@
 		 (const :tag "off" nil))
   :group 'dabbrev)
 
-(defcustom dabbrev--eliminate-newlines t
+(defcustom dabbrev-eliminate-newlines t
   "*Non-nil means dabbrev should not insert newlines.
 Instead it converts them to spaces."
   :type 'boolean
@@ -913,10 +913,12 @@
 			  ((equal abbrev (downcase abbrev)) 'downcase)))))
 
     ;; Convert whitespace to single spaces.
-    (if dabbrev--eliminate-newlines
-	;; Start searching at end of ABBREV so that any whitespace
-	;; carried over from the existing text is not changed.
-	(let ((pos (length abbrev)))
+    (if dabbrev-eliminate-newlines
+	(let ((pos
+	       (if (equal abbrev " ") 0 (length abbrev))))
+	  ;; If ABBREV is real, search after the end of it.
+	  ;; If ABBREV is space and we are copying successive words,
+	  ;; search starting at the front.
 	  (while (string-match "[\n \t]+" expansion pos)
 	    (setq pos (1+ (match-beginning 0)))
 	    (setq expansion (replace-match " " nil nil expansion)))))
--- a/lisp/diff-mode.el	Wed May 16 19:48:35 2007 +0000
+++ b/lisp/diff-mode.el	Thu May 17 01:12:58 2007 +0000
@@ -72,7 +72,7 @@
   :group 'diff-mode)
 
 (defcustom diff-jump-to-old-file nil
-  "*Non-nil means `diff-goto-source' jumps to the old file.
+  "Non-nil means `diff-goto-source' jumps to the old file.
 Else, it jumps to the new file."
   :type 'boolean
   :group 'diff-mode)
@@ -1276,7 +1276,7 @@
 	(if (> (- (car forw) orig) (- orig (car back))) back forw)
       (or back forw))))
 
-(defsubst diff-xor (a b) (if a (not b) b))
+(defsubst diff-xor (a b) (if a (if (not b) a) b))
 
 (defun diff-find-source-location (&optional other-file reverse)
   "Find out (BUF LINE-OFFSET POS SRC DST SWITCHED).
@@ -1358,8 +1358,15 @@
 With a prefix argument, REVERSE the hunk."
   (interactive "P")
   (destructuring-bind (buf line-offset pos old new &optional switched)
-      ;; If REVERSE go to the new file, otherwise go to the old.
-      (diff-find-source-location (not reverse) reverse)
+      ;; Sometimes we'd like to have the following behavior: if REVERSE go
+      ;; to the new file, otherwise go to the old.  But that means that by
+      ;; default we use the old file, which is the opposite of the default
+      ;; for diff-goto-source, and is thus confusing.  Also when you don't
+      ;; know about it it's pretty surprising.
+      ;; TODO: make it possible to ask explicitly for this behavior.
+      ;; 
+      ;; This is duplicated in diff-test-hunk.
+      (diff-find-source-location nil reverse)
     (cond
      ((null line-offset)
       (error "Can't find the text to patch"))
@@ -1403,8 +1410,7 @@
 With a prefix argument, try to REVERSE the hunk."
   (interactive "P")
   (destructuring-bind (buf line-offset pos src dst &optional switched)
-      ;; If REVERSE go to the new file, otherwise go to the old.
-      (diff-find-source-location (not reverse) reverse)
+      (diff-find-source-location nil reverse)
     (set-window-point (display-buffer buf) (+ (car pos) (cdr src)))
     (diff-hunk-status-msg line-offset (diff-xor reverse switched) t)))
 
--- a/lisp/diff.el	Wed May 16 19:48:35 2007 +0000
+++ b/lisp/diff.el	Thu May 17 01:12:58 2007 +0000
@@ -124,9 +124,13 @@
 	(erase-buffer))
       (buffer-enable-undo (current-buffer))
       (diff-mode)
+      ;; Use below 2 vars for backward-compatibility.
+      (set (make-local-variable 'diff-old-file) old)
+      (set (make-local-variable 'diff-new-file) new)
+      (set (make-local-variable 'diff-extra-args) (list switches no-async))
       (set (make-local-variable 'revert-buffer-function)
-	   `(lambda (ignore-auto noconfirm)
-	      (diff ',old ',new ',switches ',no-async)))
+	   (lambda (ignore-auto noconfirm)
+             (apply 'diff diff-old-file diff-new-file diff-extra-args)))
       (set (make-local-variable 'diff-old-temp-file) old-alt)
       (set (make-local-variable 'diff-new-temp-file) new-alt)
       (setq default-directory thisdir)
@@ -186,5 +190,5 @@
 
 (provide 'diff)
 
-;;; arch-tag: 7de2c29b-7ea5-4b85-9b9d-72dd860de2bd
+;; arch-tag: 7de2c29b-7ea5-4b85-9b9d-72dd860de2bd
 ;;; diff.el ends here
--- a/lisp/emacs-lisp/advice.el	Wed May 16 19:48:35 2007 +0000
+++ b/lisp/emacs-lisp/advice.el	Thu May 17 01:12:58 2007 +0000
@@ -2467,23 +2467,11 @@
   "Take a macro function DEFINITION and make a lambda out of it."
   `(cdr ,definition))
 
-;; There is no way to determine whether some subr is a special form or not,
-;; hence we need this list (which is probably out of date):
-(defvar ad-special-forms
-  (let ((tem '(and catch cond condition-case defconst defmacro
-		   defun defvar function if interactive let let*
-		   or prog1 prog2 progn quote save-current-buffer
-		   save-excursion save-restriction save-window-excursion
-		   setq setq-default unwind-protect while
-		   with-output-to-temp-buffer)))
-    ;; track-mouse could be void in some configurations.
-    (if (fboundp 'track-mouse)
-	(push 'track-mouse tem))
-    (mapcar 'symbol-function tem)))
-
-(defmacro ad-special-form-p (definition)
-  ;;"non-nil if DEFINITION is a special form."
-  (list 'memq definition 'ad-special-forms))
+(defun ad-special-form-p (definition)
+  "Non-nil iff DEFINITION is a special form."
+  (if (and (symbolp definition) (fboundp definition))
+      (setq definition (indirect-function definition)))
+  (and (subrp definition) (eq (cdr (subr-arity definition)) 'unevalled)))
 
 (defmacro ad-interactive-p (definition)
   ;;"non-nil if DEFINITION can be called interactively."
--- a/lisp/emacs-lisp/sregex.el	Wed May 16 19:48:35 2007 +0000
+++ b/lisp/emacs-lisp/sregex.el	Thu May 17 01:12:58 2007 +0000
@@ -436,11 +436,11 @@
   or end of a word.
 
 - the symbol `bow'
-  Stands for \"\\\\\\=<\", matching the empty string at the beginning of a
+  Stands for \"\\\\=\\<\", matching the empty string at the beginning of a
   word.
 
 - the symbol `eow'
-  Stands for \"\\\\\\=>\", matching the empty string at the end of a word.
+  Stands for \"\\\\=\\>\", matching the empty string at the end of a word.
 
 - the symbol `wordchar'
   Stands for the regex \"\\\\w\", matching a word-constituent character
--- a/lisp/gnus/ChangeLog	Wed May 16 19:48:35 2007 +0000
+++ b/lisp/gnus/ChangeLog	Thu May 17 01:12:58 2007 +0000
@@ -1,3 +1,8 @@
+2007-05-10  Reiner Steib  <Reiner.Steib@gmx.de>
+
+	* gnus-art.el (gnus-article-mode): Fix comment about displaying
+	non-break space.
+
 2007-05-09  Didier Verna  <didier@xemacs.org>
 
 	* gnus-diary.el, nndiary.el: Remove the description comment (nndiary is
--- a/lisp/gnus/gnus-art.el	Wed May 16 19:48:35 2007 +0000
+++ b/lisp/gnus/gnus-art.el	Thu May 17 01:12:58 2007 +0000
@@ -3925,7 +3925,8 @@
   (make-local-variable 'gnus-article-image-alist)
   (make-local-variable 'gnus-article-charset)
   (make-local-variable 'gnus-article-ignored-charsets)
-  ;; Prevent recent Emacsen from displaying non-break space as "\ ".
+  ;; Prevent Emacs 22 from displaying non-break space with `nobreak-space'
+  ;; face.
   (set (make-local-variable 'nobreak-char-display) nil)
   (setq cursor-in-non-selected-windows nil)
   (gnus-set-default-directory)
--- a/lisp/longlines.el	Wed May 16 19:48:35 2007 +0000
+++ b/lisp/longlines.el	Thu May 17 01:12:58 2007 +0000
@@ -110,6 +110,7 @@
         (add-hook 'change-major-mode-hook 'longlines-mode-off nil t)
 	(add-hook 'before-revert-hook 'longlines-before-revert-hook nil t)
         (make-local-variable 'buffer-substring-filters)
+        (make-local-variable 'longlines-auto-wrap)
 	(set (make-local-variable 'isearch-search-fun-function)
 	     'longlines-search-function)
         (add-to-list 'buffer-substring-filters 'longlines-encode-string)
@@ -149,12 +150,10 @@
 	       (add-to-list 'message-indent-citation-function
 			    'longlines-decode-region t)))
 
+	(add-hook 'after-change-functions 'longlines-after-change-function nil t)
+	(add-hook 'post-command-hook 'longlines-post-command-function nil t)
         (when longlines-auto-wrap
-          (auto-fill-mode 0)
-          (add-hook 'after-change-functions
-                    'longlines-after-change-function nil t)
-          (add-hook 'post-command-hook
-                    'longlines-post-command-function nil t)))
+          (auto-fill-mode 0)))
     ;; Turn off longlines mode
     (setq buffer-file-format (delete 'longlines buffer-file-format))
     (if longlines-showing
@@ -365,29 +364,27 @@
 ;; Auto wrap
 
 (defun longlines-auto-wrap (&optional arg)
-  "Turn on automatic line wrapping, and wrap the entire buffer.
-With optional argument ARG, turn off line wrapping."
+  "Toggle automatic line wrapping.
+With optional argument ARG, turn on line wrapping if and only if ARG is positive.
+If automatic line wrapping is turned on, wrap the entire buffer."
   (interactive "P")
-  (remove-hook 'after-change-functions 'longlines-after-change-function t)
-  (remove-hook 'post-command-hook 'longlines-post-command-function t)
-  (if arg
-      (progn (setq longlines-auto-wrap nil)
-             (message "Auto wrap disabled."))
-    (setq longlines-auto-wrap t)
-    (add-hook 'after-change-functions
-              'longlines-after-change-function nil t)
-    (add-hook 'post-command-hook
-              'longlines-post-command-function nil t)
-    (let ((mod (buffer-modified-p)))
-      (longlines-wrap-region (point-min) (point-max))
-      (set-buffer-modified-p mod))
-    (message "Auto wrap enabled.")))
+  (and (null arg)
+       (null longlines-auto-wrap)
+       (setq arg 1))
+  (if (> (prefix-numeric-value arg) 0)
+      (let ((mod (buffer-modified-p)))
+	(setq longlines-auto-wrap t)
+	(longlines-wrap-region (point-min) (point-max))
+	(set-buffer-modified-p mod)
+	(message "Auto wrap enabled."))
+    (setq longlines-auto-wrap nil)
+    (message "Auto wrap disabled.")))
 
 (defun longlines-after-change-function (beg end len)
   "Update `longlines-wrap-beg' and `longlines-wrap-end'.
 This is called by `after-change-functions' to keep track of the region
 that has changed."
-  (unless undo-in-progress
+  (when (and longlines-auto-wrap (not undo-in-progress))
     (setq longlines-wrap-beg
           (if longlines-wrap-beg (min longlines-wrap-beg beg) beg))
     (setq longlines-wrap-end
@@ -396,7 +393,7 @@
 (defun longlines-post-command-function ()
   "Perform line wrapping on the parts of the buffer that have changed.
 This is called by `post-command-hook' after each command."
-  (when longlines-wrap-beg
+  (when (and longlines-auto-wrap longlines-wrap-beg)
     (if (or (eq this-command 'yank)
 	    (eq this-command 'yank-pop))
 	(longlines-decode-region (point) (mark t)))
--- a/lisp/man.el	Wed May 16 19:48:35 2007 +0000
+++ b/lisp/man.el	Thu May 17 01:12:58 2007 +0000
@@ -1296,7 +1296,9 @@
 	(forward-line 1))
     (if (re-search-forward Man-heading-regexp (point-max) t n)
 	(beginning-of-line)
-      (goto-char (point-max)))))
+      (goto-char (point-max))
+      ;; The last line doesn't belong to any section.
+      (forward-line -1))))
 
 (defun Man-previous-section (n)
   "Move point to Nth previous section (default 1)."
--- a/lisp/newcomment.el	Wed May 16 19:48:35 2007 +0000
+++ b/lisp/newcomment.el	Thu May 17 01:12:58 2007 +0000
@@ -97,10 +97,10 @@
 ;;;###autoload
 (defcustom comment-column 32
   "Column to indent right-margin comments to.
-Each mode establishes a different default value for this variable; you
+Each mode may establish a different default value for this variable; you
 can set the value for a particular mode using that mode's hook.
-Comments might be indented to a value smaller than this in order
-not to go beyond `comment-fill-column'."
+Comments might be indented to a different value in order not to go beyond
+`comment-fill-column' or in order to align them with surrounding comments."
   :type 'integer
   :group 'comment)
 (make-variable-buffer-local 'comment-column)
@@ -491,16 +491,24 @@
         (goto-char (point-min))
         (re-search-forward (concat comment-end-skip "\\'") nil t))
       (goto-char (match-beginning 0)))
-     ;; comment-end-skip not found.  Maybe we're at EOB which implicitly
-     ;; closes the comment.
-     ((eobp) (skip-syntax-backward " "))
-     (t
-      ;; else comment-end-skip was not found probably because it was not
-      ;; set right.  Since \\s> should catch the single-char case, we'll
-      ;; blindly assume we're at the end of a two-char comment-end.
+     ;; comment-end-skip not found probably because it was not set
+     ;; right.  Since \\s> should catch the single-char case, let's
+     ;; check that we're looking at a two-char comment ender.
+     ((not (or (<= (- (point-max) (line-beginning-position)) 1)
+               (zerop (logand (car (syntax-after (- (point) 1)))
+                              ;; Here we take advantage of the fact that
+                              ;; the syntax class " " is encoded to 0,
+                              ;; so "  4" gives us just the 4 bit.
+                              (car (string-to-syntax "  4"))))
+               (zerop (logand (car (syntax-after (- (point) 2)))
+                              (car (string-to-syntax "  3"))))))
       (backward-char 2)
       (skip-chars-backward (string (char-after)))
-      (skip-syntax-backward " ")))))
+      (skip-syntax-backward " "))
+     ;; No clue what's going on: maybe we're really not right after the
+     ;; end of a comment.  Maybe we're at the "end" because of EOB rather
+     ;; than because of a marker.
+     (t (skip-syntax-backward " ")))))
 
 ;;;;
 ;;;; Commands
@@ -516,6 +524,58 @@
 	      (and (> comment-add 0) (looking-at "\\s<\\(\\S<\\|\\'\\)")))
       comment-column)))
 
+(defun comment-choose-indent (&optional indent)
+  "Choose the indentation to use for a right-hand-side comment.
+The criteria are (in this order):
+- try to keep the comment's text within `comment-fill-column'.
+- try to align with surrounding comments.
+- prefer INDENT (or `comment-column' if nil).
+Point is expected to be at the start of the comment."
+  (unless indent (setq indent comment-column))
+  ;; Avoid moving comments past the fill-column.
+  (let ((max (+ (current-column)
+                (- (or comment-fill-column fill-column)
+                   (save-excursion (end-of-line) (current-column)))))
+        (other nil)
+        (min (save-excursion (skip-chars-backward " \t")
+                             (1+ (current-column)))))
+    ;; Fix up the range.
+    (if (< max min) (setq max min))
+    ;; Don't move past the fill column.
+    (if (<= max indent) (setq indent max))
+    ;; We can choose anywhere between min..max.
+    ;; Let's try to align to a comment on the previous line.
+    (save-excursion
+      (when (and (zerop (forward-line -1))
+                 (setq other (comment-search-forward
+                              (line-end-position) t)))
+        (goto-char other) (setq other (current-column))))
+    (if (and other (<= other max) (>= other min))
+        ;; There is a comment and it's in the range: bingo!
+        other
+      ;; Can't align to a previous comment: let's try to align to comments
+      ;; on the following lines, then.  These have not been re-indented yet,
+      ;; so we can't directly align ourselves with them.  All we do is to try
+      ;; and choose an indentation point with which they will be able to
+      ;; align themselves.
+      (save-excursion
+        (while (and (zerop (forward-line 1))
+                    (setq other (comment-search-forward
+                                 (line-end-position) t)))
+          (goto-char other)
+          (let ((omax (+ (current-column)
+                         (- (or comment-fill-column fill-column)
+                            (save-excursion (end-of-line) (current-column)))))
+                (omin (save-excursion (skip-chars-backward " \t")
+                                      (1+ (current-column)))))
+            (if (and (>= omax min) (<= omin max))
+                (progn (setq min (max omin min))
+                       (setq max (min omax max)))
+              ;; Can't align with this anyway, so exit the loop.
+              (goto-char (point-max))))))
+      ;; Return the closest point to indent within min..max.
+      (max min (min max indent)))))
+
 ;;;###autoload
 (defun comment-indent (&optional continue)
   "Indent this line's comment to `comment-column', or insert an empty comment.
@@ -569,38 +629,9 @@
       (if (not indent)
 	  ;; comment-indent-function refuses: delegate to line-indent.
 	  (indent-according-to-mode)
-	;; If the comment is at the left of code, adjust the indentation.
+	;; If the comment is at the right of code, adjust the indentation.
 	(unless (save-excursion (skip-chars-backward " \t") (bolp))
-	  ;; Avoid moving comments past the fill-column.
-	  (let ((max (+ (current-column)
-			(- (or comment-fill-column fill-column)
-			   (save-excursion (end-of-line) (current-column))))))
-	    (if (<= max indent)
-		(setq indent max)	;Don't move past the fill column.
-	      ;; We can choose anywhere between indent..max.
-	      ;; Let's try to align to a comment on the previous line.
-	      (let ((other nil)
-		    (min (max indent
-			      (save-excursion (skip-chars-backward " \t")
-					      (1+ (current-column))))))
-		(save-excursion
-		  (when (and (zerop (forward-line -1))
-			     (setq other (comment-search-forward
-					 (line-end-position) t)))
-		    (goto-char other) (setq other (current-column))))
-		(if (and other (<= other max) (>= other min))
-		    ;; There is a comment and it's in the range: bingo.
-		    (setq indent other)
-		  ;; Let's try to align to a comment on the next line, then.
-		  (let ((other nil))
-		    (save-excursion
-		      (when (and (zerop (forward-line 1))
-				 (setq other (comment-search-forward
-					     (line-end-position) t)))
-			(goto-char other) (setq other (current-column))))
-		    (if (and other (<= other max) (> other min))
-			;; There is a comment and it's in the range: bingo.
-			(setq indent other))))))))
+          (setq indent (comment-choose-indent indent)))
 	;; Update INDENT to leave at least one space
 	;; after other nonwhite text on the line.
 	(save-excursion
--- a/lisp/progmodes/compile.el	Wed May 16 19:48:35 2007 +0000
+++ b/lisp/progmodes/compile.el	Thu May 17 01:12:58 2007 +0000
@@ -1860,7 +1860,24 @@
           (let* ((name (read-file-name
                         (format "Find this %s in (default %s): "
                                 compilation-error filename)
-                        spec-dir filename t nil))
+                        spec-dir filename t nil
+                        ;; The predicate below is fine when called from
+                        ;; minibuffer-complete-and-exit, but it's too
+                        ;; restrictive otherwise, since it also prevents the
+                        ;; user from completing "fo" to "foo/" when she
+                        ;; wants to enter "foo/bar".
+                        ;; 
+                        ;; Try to make sure the user can only select
+                        ;; a valid answer.  This predicate may be ignored,
+                        ;; tho, so we still have to double-check afterwards.
+                        ;; TODO: We should probably fix read-file-name so
+                        ;; that it never ignores this predicate, even when
+                        ;; using popup dialog boxes.
+                        ;; (lambda (name)
+                        ;;   (if (file-directory-p name)
+                        ;;       (setq name (expand-file-name filename name)))
+                        ;;   (file-exists-p name))
+                        ))
                  (origname name))
             (cond
              ((not (file-exists-p name))
--- a/lisp/progmodes/python.el	Wed May 16 19:48:35 2007 +0000
+++ b/lisp/progmodes/python.el	Thu May 17 01:12:58 2007 +0000
@@ -883,10 +883,13 @@
 			   nil)
 			  ((eq 'string (syntax-ppss-context s))
 			   ;; Go to start of string and skip it.
-			   (goto-char (nth 8 s))
-			   (condition-case () ; beware invalid syntax
-			       (progn (forward-sexp) t)
-			     (error (end-of-line))))
+                           (let ((pos (point)))
+                             (goto-char (nth 8 s))
+                             (condition-case () ; beware invalid syntax
+                                 (progn (forward-sexp) t)
+                               ;; If there's a mismatched string, make sure
+                               ;; we still overall move *forward*.
+                               (error (goto-char pos) (end-of-line)))))
 			  ((python-skip-out t s))))
 	     (end-of-line))
 	   (unless comment
@@ -981,15 +984,11 @@
 		       (_ (if (python-comment-line-p)
 			      (python-skip-comments/blanks t)))
 		       (ci (current-indentation))
-		       (open (python-open-block-statement-p))
-		       opoint)
+		       (open (python-open-block-statement-p)))
 		  (if (and (zerop ci) (not open))
 		      (not (goto-char point))
 		    (catch 'done
-		      (setq opoint (point))
-		      (while (and (zerop (python-next-statement))
-		      		  (not (= opoint (point))))
-			(setq opoint (point))
+                      (while (zerop (python-next-statement))
 			(when (or (and open (<= (current-indentation) ci))
 				  (< (current-indentation) ci))
 			  (python-skip-comments/blanks t)
--- a/lisp/ps-print.el	Wed May 16 19:48:35 2007 +0000
+++ b/lisp/ps-print.el	Thu May 17 01:12:58 2007 +0000
@@ -10,11 +10,11 @@
 ;; Maintainer: Kenichi Handa <handa@m17n.org> (multi-byte characters)
 ;;	Vinicius Jose Latorre <viniciusjl@ig.com.br>
 ;; Keywords: wp, print, PostScript
-;; Version: 6.7.3
+;; Version: 6.7.4
 ;; X-URL: http://www.emacswiki.org/cgi-bin/wiki/ViniciusJoseLatorre
 
-(defconst ps-print-version "6.7.3"
-  "ps-print.el, v 6.7.3 <2007/02/06 vinicius>
+(defconst ps-print-version "6.7.4"
+  "ps-print.el, v 6.7.4 <2007/05/13 vinicius>
 
 Vinicius's last change version -- this file may have been edited as part of
 Emacs without changes to the version number.  When reporting bugs, please also
@@ -5817,21 +5817,27 @@
   (ps-get-size (symbol-value font-sym) "font size" font-sym))
 
 
-(defun ps-rgb-color (color default)
-  (cond ((and color (listp color) (= (length color) 3)
-	      (let ((cl color)
-		    (ok t) e)
-		(while (and ok cl)
-		  (setq e  (car cl)
-			cl (cdr cl)
-			ok (and (floatp e) (<= 0.0 e) (<= e 1.0))))
-		ok))
-	 color)
-	((and (floatp color) (<= 0.0 color) (<= color 1.0))
-	 (list color color color))
-	((stringp color) (ps-color-scale color))
-	(t (list default default default))
-	))
+(defun ps-rgb-color (color unspecified default)
+  (cond
+   ;; (float float float) ==> (R G B)
+   ((and color (listp color) (= (length color) 3)
+	 (let ((cl color)
+	       (ok t) e)
+	   (while (and ok cl)
+	     (setq e  (car cl)
+		   cl (cdr cl)
+		   ok (and (floatp e) (<= 0.0 e) (<= e 1.0))))
+	   ok))
+    color)
+   ;; float ==> 0.0 = black .. 1.0 = white
+   ((and (floatp color) (<= 0.0 color) (<= color 1.0))
+    (list color color color))
+   ;; "colorName" but different from "unspecified-[bf]g"
+   ((and (stringp color) (not (string= color unspecified)))
+    (ps-color-scale color))
+   ;; ok, use the default
+   (t
+    (list default default default))))
 
 
 (defun ps-begin-job (genfunc)
@@ -5913,6 +5919,7 @@
 				 (ps-face-background-name 'default))
 				(t
 				 ps-default-bg))
+			       "unspecified-bg"
 			       1.0)
 	ps-default-foreground (ps-rgb-color
 			       (cond
@@ -5924,6 +5931,7 @@
 				 (ps-face-foreground-name 'default))
 				(t
 				 ps-default-fg))
+			       "unspecified-fg"
 			       0.0)
 	ps-default-color (and (eq ps-print-color-p t) ps-default-foreground)
 	ps-current-color ps-default-color
--- a/lisp/t-mouse.el	Wed May 16 19:48:35 2007 +0000
+++ b/lisp/t-mouse.el	Thu May 17 01:12:58 2007 +0000
@@ -275,32 +275,32 @@
 
 Turn it on to use Emacs mouse commands, and off to use t-mouse commands."
   nil " Mouse" nil :global t
-  (if t-mouse-mode
-      ;; Turn it on
-      (unless window-system
-        ;; Starts getting a stream of mouse events from an asynchronous process.
-        ;; Only works if Emacs is running on a virtual terminal without a window system.
+  (unless window-system
+    (if t-mouse-mode
+	;; Turn it on.  Starts getting a stream of mouse events from an
+        ;; asynchronous process.  Only works if Emacs is running on a virtual
+        ;; terminal without a window system.
 	(progn
-	 (setq mouse-position-function #'t-mouse-mouse-position-function)
-	 (let ((tty (t-mouse-tty))
-	       (process-connection-type t))
-	   (if (not (stringp tty))
-	       (error "Cannot find a virtual terminal"))
-	   (setq t-mouse-process
-		 (start-process "t-mouse" nil
-				"mev" "-i" "-E" "-C" tty
-				(if t-mouse-swap-alt-keys
-				    "-M-leftAlt" "-M-rightAlt")
-				"-e-move"
-				"-dall" "-d-hard"
-				"-f")))
-	 (setq t-mouse-filter-accumulator "")
-	 (set-process-filter t-mouse-process 't-mouse-process-filter)
-	 (set-process-query-on-exit-flag t-mouse-process nil)))
+	  (setq mouse-position-function #'t-mouse-mouse-position-function)
+	  (let ((tty (t-mouse-tty))
+		(process-connection-type t))
+	    (if (not (stringp tty))
+		(error "Cannot find a virtual terminal"))
+	    (setq t-mouse-process
+		  (start-process "t-mouse" nil
+				 "mev" "-i" "-E" "-C" tty
+				 (if t-mouse-swap-alt-keys
+				     "-M-leftAlt" "-M-rightAlt")
+				 "-e-move"
+				 "-dall" "-d-hard"
+				 "-f")))
+	  (setq t-mouse-filter-accumulator "")
+	  (set-process-filter t-mouse-process 't-mouse-process-filter)
+	  (set-process-query-on-exit-flag t-mouse-process nil))
     ;; Turn it off
-    (setq mouse-position-function nil)
-    (delete-process t-mouse-process)
-    (setq t-mouse-process nil)))
+      (setq mouse-position-function nil)
+      (delete-process t-mouse-process)
+      (setq t-mouse-process nil))))
 
 (provide 't-mouse)
 
--- a/lisp/textmodes/ispell.el	Wed May 16 19:48:35 2007 +0000
+++ b/lisp/textmodes/ispell.el	Thu May 17 01:12:58 2007 +0000
@@ -2483,7 +2483,12 @@
 (defun ispell-start-process ()
   "Start the ispell process, with support for no asynchronous processes.
 Keeps argument list for future ispell invocations for no async support."
-  (let (args)
+  (let ((default-directory default-directory)
+	args)
+    (unless (and (file-directory-p default-directory)
+		 (file-readable-p default-directory))
+      ;; Defend against bad `default-directory'.
+      (setq default-directory (expand-file-name "~/")))
     ;; Local dictionary becomes the global dictionary in use.
     (setq ispell-current-dictionary
 	  (or ispell-local-dictionary ispell-dictionary))
--- a/lisp/textmodes/sgml-mode.el	Wed May 16 19:48:35 2007 +0000
+++ b/lisp/textmodes/sgml-mode.el	Thu May 17 01:12:58 2007 +0000
@@ -45,12 +45,12 @@
   :group 'languages)
 
 (defcustom sgml-basic-offset 2
-  "*Specifies the basic indentation level for `sgml-indent-line'."
+  "Specifies the basic indentation level for `sgml-indent-line'."
   :type 'integer
   :group 'sgml)
 
 (defcustom sgml-transformation-function 'identity
-  "*Default value for `skeleton-transformation-function' in SGML mode."
+  "Default value for `skeleton-transformation-function' in SGML mode."
   :type 'function
   :group 'sgml)
 
@@ -166,7 +166,7 @@
   "Syntax table used to parse SGML tags.")
 
 (defcustom sgml-name-8bit-mode nil
-  "*When non-nil, insert non-ASCII characters as named entities."
+  "When non-nil, insert non-ASCII characters as named entities."
   :type 'boolean
   :group 'sgml)
 
@@ -225,7 +225,7 @@
 ;; The -s option suppresses output.
 
 (defcustom sgml-validate-command "nsgmls -s" ; replaced old `sgmls'
-  "*The command to validate an SGML document.
+  "The command to validate an SGML document.
 The file name of current buffer file name will be appended to this,
 separated by a space."
   :type 'string
@@ -238,7 +238,7 @@
 ;; I doubt that null end tags are used much for large elements,
 ;; so use a small distance here.
 (defcustom sgml-slash-distance 1000
-  "*If non-nil, is the maximum distance to search for matching `/'."
+  "If non-nil, is the maximum distance to search for matching `/'."
   :type '(choice (const nil) integer)
   :group 'sgml)
 
@@ -318,7 +318,7 @@
     ("!doctype")
     ("!element")
     ("!entity"))
-  "*Alist of tag names for completing read and insertion rules.
+  "Alist of tag names for completing read and insertion rules.
 This alist is made up as
 
   ((\"tag\" . TAGRULE)
@@ -348,15 +348,14 @@
     ("!doctype" . "Document type (DTD) declaration")
     ("!element" . "Tag declaration")
     ("!entity" . "Entity (macro) declaration"))
-  "*Alist of tag name and short description."
+  "Alist of tag name and short description."
   :type '(repeat (cons (string :tag "Tag Name")
 		       (string :tag "Description")))
   :group 'sgml)
 
 (defcustom sgml-xml-mode nil
-  "*When non-nil, tag insertion functions will be XML-compliant.
-If this variable is customized, the custom value is used always.
-Otherwise, it is set to be buffer-local when the file has
+  "When non-nil, tag insertion functions will be XML-compliant.
+It is set to be buffer-local when the file has
 a DOCTYPE or an XML declaration."
   :type 'boolean
   :version "22.1"
@@ -937,7 +936,7 @@
 (defun sgml-lexical-context (&optional limit)
   "Return the lexical context at point as (TYPE . START).
 START is the location of the start of the lexical element.
-TYPE is one of `string', `comment', `tag', `cdata', or `text'.
+TYPE is one of `string', `comment', `tag', `cdata', `pi', or `text'.
 
 Optional argument LIMIT is the position to start parsing from.
 If nil, start from a preceding tag at indentation."
@@ -964,12 +963,19 @@
                   (let ((cdata-start (point)))
                     (unless (search-forward "]]>" pos 'move)
                       (list 0 nil nil 'cdata nil nil nil nil cdata-start))))
+                 ((and sgml-xml-mode (looking-at "<\\?"))
+                  ;; Processing Instructions.
+                  ;; In SGML, it's basically a normal tag of the form
+                  ;; <?NAME ...> but in XML, it takes the form <? ... ?>.
+                  (let ((pi-start (point)))
+                    (unless (search-forward "?>" pos 'move)
+                      (list 0 nil nil 'pi nil nil nil nil pi-start))))
                  (t
                   ;; We've reached a tag.  Parse it.
                   ;; FIXME: Handle net-enabling start-tags
                   (parse-partial-sexp (point) pos 0))))))
       (cond
-       ((eq (nth 3 state) 'cdata) (cons 'cdata (nth 8 state)))
+       ((memq (nth 3 state) '(cdata pi)) (cons (nth 3 state) (nth 8 state)))
        ((nth 3 state) (cons 'string (nth 8 state)))
        ((nth 4 state) (cons 'comment (nth 8 state)))
        ((and state (> (nth 0 state) 0)) (cons 'tag (nth 1 state)))
@@ -1003,8 +1009,10 @@
 	      (insert alist ?\")
 	    (delete-backward-char 2)))
       (insert "=\"")
-      (when alist
-        (insert (skeleton-read '(completing-read "Value: " alist))))
+      (if (cdr alist)
+          (insert (skeleton-read '(completing-read "Value: " alist)))
+        (when (null alist)
+          (insert (skeleton-read '(read-string "Value: ")))))
       (insert ?\"))))
 
 (defun sgml-quote (start end &optional unquotep)
@@ -1093,9 +1101,15 @@
       (when (eq (char-after) ?<)
 	;; Oops!! Looks like we were not in a textual context after all!.
 	;; Let's try to recover.
+        ;; Remember the tag-start so we don't need to look for it later.
+	;; This is not just an optimization but also makes sure we don't get
+	;; stuck in infloops in cases where "looking back for <" would not go
+	;; back far enough.
+        (setq tag-start (point))
 	(with-syntax-table sgml-tag-syntax-table
 	  (let ((pos (point)))
 	    (condition-case nil
+                ;; FIXME: This does not correctly skip over PI an CDATA tags.
 		(forward-sexp)
 	      (scan-error
 	       ;; This < seems to be just a spurious one, let's ignore it.
@@ -1110,33 +1124,41 @@
       (cond
        ((sgml-looking-back-at "--")	; comment
 	(setq tag-type 'comment
-	      tag-start (search-backward "<!--" nil t)))
+	      tag-start (or tag-start (search-backward "<!--" nil t))))
        ((sgml-looking-back-at "]]")	; cdata
 	(setq tag-type 'cdata
-	      tag-start (re-search-backward "<!\\[[A-Z]+\\[" nil t)))
+	      tag-start (or tag-start
+                            (re-search-backward "<!\\[[A-Z]+\\[" nil t))))
+       ((sgml-looking-back-at "?")      ; XML processing-instruction
+        (setq tag-type 'pi
+              ;; IIUC: SGML processing instructions take the form <?foo ...>
+              ;; i.e. a "normal" tag, handled below.  In XML this is changed
+              ;; to <?foo ... ?> where "..." can contain < and > and even <?
+              ;; but not ?>.  This means that when parsing backward, there's
+              ;; no easy way to make sure that we find the real beginning of
+              ;; the PI.
+	      tag-start (or tag-start (search-backward "<?" nil t))))
        (t
-	(setq tag-start
-	      (with-syntax-table sgml-tag-syntax-table
-		(goto-char tag-end)
-		(condition-case nil
-		    (backward-sexp)
-		  (scan-error
-		   ;; This > isn't really the end of a tag. Skip it.
-		   (goto-char (1- tag-end))
-		   (throw 'found (sgml-parse-tag-backward limit))))
-		(point)))
+        (unless tag-start
+          (setq tag-start
+                (with-syntax-table sgml-tag-syntax-table
+                  (goto-char tag-end)
+                  (condition-case nil
+                      (backward-sexp)
+                    (scan-error
+                     ;; This > isn't really the end of a tag. Skip it.
+                     (goto-char (1- tag-end))
+                     (throw 'found (sgml-parse-tag-backward limit))))
+                  (point))))
 	(goto-char (1+ tag-start))
 	(case (char-after)
-	  (?!				; declaration
-	   (setq tag-type 'decl))
-	  (??				; processing-instruction
-	   (setq tag-type 'pi))
+	  (?! (setq tag-type 'decl))    ; declaration
+	  (?? (setq tag-type 'pi))      ; processing-instruction
+	  (?% (setq tag-type 'jsp))	; JSP tags
 	  (?/				; close-tag
 	   (forward-char 1)
 	   (setq tag-type 'close
 		 name (sgml-parse-tag-name)))
-	  (?%				; JSP tags
-	   (setq tag-type 'jsp))
 	  (t				; open or empty tag
 	   (setq tag-type 'open
 		 name (sgml-parse-tag-name))
@@ -1331,6 +1353,8 @@
 
     ;; We don't know how to indent it.  Let's be honest about it.
     (cdata nil)
+    ;; We don't know how to indent it.  Let's be honest about it.
+    (pi nil)
 
     (tag
      (goto-char (1+ (cdr lcon)))
--- a/lisp/textmodes/tex-mode.el	Wed May 16 19:48:35 2007 +0000
+++ b/lisp/textmodes/tex-mode.el	Thu May 17 01:12:58 2007 +0000
@@ -527,6 +527,8 @@
 	    (citations (regexp-opt
 			'("label" "ref" "pageref" "vref" "eqref"
 			  "cite" "nocite" "index" "glossary" "bibitem"
+                          ;; natbib's two variants of \cite:
+                          "citep" "citet"
 			  ;; These are text, rather than citations.
 			  ;; "caption" "footnote" "footnotemark" "footnotetext"
 			  )
--- a/lisp/vc-hooks.el	Wed May 16 19:48:35 2007 +0000
+++ b/lisp/vc-hooks.el	Thu May 17 01:12:58 2007 +0000
@@ -315,10 +315,17 @@
   ;; Represent /home/luser/foo as ~/foo so that we don't try to look for
   ;; witnesses in /home or in /.
   (setq file (abbreviate-file-name file))
-  (let ((root nil))
+  (let ((root nil)
+        (user (nth 2 (file-attributes file))))
     (while (not (or root
                    (equal file (setq file (file-name-directory file)))
                    (null file)
+                   ;; As a heuristic, we stop looking up the hierarchy of
+                   ;; directories as soon as we find a directory belonging
+                   ;; to another user.  This should save us from looking in
+                   ;; things like /net and /afs.  This assumes that all the
+                   ;; files inside a project belong to the same user.
+                   (not (equal user (file-attributes file)))
                    (string-match vc-ignore-dir-regexp file)))
       (if (file-exists-p (expand-file-name witness file))
          (setq root file)
--- a/lisp/vc.el	Wed May 16 19:48:35 2007 +0000
+++ b/lisp/vc.el	Thu May 17 01:12:58 2007 +0000
@@ -2909,7 +2909,11 @@
   (vc-call-backend (vc-responsible-backend default-directory)
                    'update-changelog args))
 
-(defun vc-default-update-changelog (backend files)
+(defalias 'vc-cvs-update-changelog 'vc-update-changelog-rcs2log)
+(defalias 'vc-rcs-update-changelog 'vc-update-changelog-rcs2log)
+;; FIXME: This should probably be moved to vc-rcs.el and replaced in
+;; vc-cvs.el by code using cvs2cl.
+(defun vc-update-changelog-rcs2log (files)
   "Default implementation of update-changelog.
 Uses `rcs2log' which only works for RCS and CVS."
   ;; FIXME: We (c|sh)ould add support for cvs2cl
@@ -2950,9 +2954,7 @@
                                     (mapcar
                                      (lambda (f)
                                        (file-relative-name
-                                        (if (file-name-absolute-p f)
-                                            f
-                                          (concat odefault f))))
+                                        (expand-file-name f odefault)))
                                      files)))
                        "done"
 		     (pop-to-buffer (get-buffer-create "*vc*"))
--- a/lisp/version.el	Wed May 16 19:48:35 2007 +0000
+++ b/lisp/version.el	Thu May 17 01:12:58 2007 +0000
@@ -27,7 +27,7 @@
 
 ;;; Code:
 
-(defconst emacs-version "22.0.99" "\
+(defconst emacs-version "22.1.50" "\
 Version numbers of this version of Emacs.")
 
 (defconst emacs-major-version
--- a/lisp/xt-mouse.el	Wed May 16 19:48:35 2007 +0000
+++ b/lisp/xt-mouse.el	Thu May 17 01:12:58 2007 +0000
@@ -43,6 +43,8 @@
 
 ;;; Code:
 
+(defvar xterm-mouse-debug-buffer nil)
+
 (define-key function-key-map "\e[M" 'xterm-mouse-translate)
 
 (defvar xterm-mouse-last)
@@ -95,6 +97,8 @@
 		       (list (intern (format "drag-mouse-%d"
 					     (+ 1 xterm-mouse-last)))
 			     down-data click-data)))))
+	    (if xterm-mouse-debug-buffer
+		(print unread-command-events xterm-mouse-debug-buffer))
 	    (if (and (symbolp down-where)
 		     (consp down-where))
 		(vector (list down-where down-data) down)
--- a/lispref/ChangeLog	Wed May 16 19:48:35 2007 +0000
+++ b/lispref/ChangeLog	Thu May 17 01:12:58 2007 +0000
@@ -18,6 +18,20 @@
 
 	* modes.texi (Auto Major Mode): Document file-start-mode-alist.
 
+2007-05-10  Thien-Thi Nguyen  <ttn@gnuvola.org>
+
+	* elisp.texi (Top): Remove "Saving Properties" from detailed menu.
+	* files.texi (Format Conversion): Expand intro; add menu.
+	(Format Conversion Overview, Format Conversion Round-Trip)
+	(Format Conversion Piecemeal): New nodes/subsections.
+	* hooks.texi: Xref "Format Conversion" , not "Saving Properties".
+	* text.texi (Text Properties): Remove "Saving Properties" from menu.
+	(Saving Properties): Delete node/subsection.
+
+2007-05-07  Karl Berry  <karl@gnu.org>
+
+	* elisp.texi (EMACSVER): back to 22.
+
 2007-05-06  Richard Stallman  <rms@gnu.org>
 
 	* processes.texi (Accepting Output): Revert most of previous change.
@@ -36,7 +50,7 @@
 	* tips.texi (Documentation Tips): Rearrange items to place the
 	more important ones first.  Add an index entry for hyperlinks.
 
-2007-05-03  Karl Berry  <karl@tug.org>
+2007-05-03  Karl Berry  <karl@gnu.org>
 
 	* elisp.texi (\urlcolor, \linkcolor) [smallbook]: \Black for printing.
 	 (EMACSVER) [smallbook]: 22 for printed version.
@@ -44,6 +58,10 @@
 	* control.texi (Signaling Errors) <signal>: texinfo.tex is fixed,
 	so restore anchor to normal position after defun.  Found by Kevin Ryde.
 
+2007-04-26  Glenn Morris  <rgm@gnu.org>
+
+	* elisp.texi (EMACSVER): Increase to 22.1.50.
+
 2007-04-28  Karl Berry  <karl@gnu.org>
 
 	* elisp.texi: Improve line breaks on copyright page,
@@ -397,7 +415,7 @@
 
 	* loading.texi (How Programs Do Loading): Fix anchor position at
 	load-read-function definition doc. (tiny change)
-	
+
 2007-02-21  Kim F. Storm  <storm@cua.dk>
 
 	* strings.texi (Text Comparison): Mention that assoc-string
--- a/lispref/elisp.texi	Wed May 16 19:48:35 2007 +0000
+++ b/lispref/elisp.texi	Thu May 17 01:12:58 2007 +0000
@@ -29,11 +29,13 @@
 @tex
 @ifset smallbook
 @fonttextsize 10
-@set EMACSVER 22.1
+@set EMACSVER 22
 \global\let\urlcolor=\Black % don't print links in grayscale
 \global\let\linkcolor=\Black
 @end ifset
 \global\hbadness=6666 % don't worry about not-too-underfull boxes
+\global\let\urlcolor=\Black % don't print links in grayscale
+\global\let\linkcolor=\Black
 @end tex
 
 @c Combine indices.
@@ -1064,8 +1066,6 @@
 * Format Properties::       Properties for representing formatting of text.
 * Sticky Properties::       How inserted text gets properties from
                               neighboring text.
-* Saving Properties::       Saving text properties in files, and reading
-                              them back.
 * Lazy Properties::         Computing text properties in a lazy fashion
                               only when text is examined.
 * Clickable Text::          Using text properties to make regions of text
--- a/lispref/files.texi	Wed May 16 19:48:35 2007 +0000
+++ b/lispref/files.texi	Thu May 17 01:12:58 2007 +0000
@@ -374,8 +374,7 @@
 @end deffn
 
   Saving a buffer runs several hooks.  It also performs format
-conversion (@pxref{Format Conversion}), and may save text properties in
-``annotations'' (@pxref{Saving Properties}).
+conversion (@pxref{Format Conversion}).
 
 @defvar write-file-functions
 The value of this variable is a list of functions to be called before
@@ -496,9 +495,9 @@
 
 The function @code{insert-file-contents} checks the file contents
 against the defined file formats, and converts the file contents if
-appropriate.  @xref{Format Conversion}.  It also calls the functions in
-the list @code{after-insert-file-functions}; see @ref{Saving
-Properties}.  Normally, one of the functions in the
+appropriate and also calls the functions in
+the list @code{after-insert-file-functions}.  @xref{Format Conversion}.
+Normally, one of the functions in the
 @code{after-insert-file-functions} list determines the coding system
 (@pxref{Coding Systems}) used for decoding the file's contents,
 including end-of-line conversion.
@@ -620,9 +619,10 @@
 @var{filename} and @var{visit} for that purpose.
 
 The function @code{write-region} converts the data which it writes to
-the appropriate file formats specified by @code{buffer-file-format}.
-@xref{Format Conversion}.  It also calls the functions in the list
-@code{write-region-annotate-functions}; see @ref{Saving Properties}.
+the appropriate file formats specified by @code{buffer-file-format}
+and also calls the functions in the list
+@code{write-region-annotate-functions}.
+@xref{Format Conversion}.
 
 Normally, @code{write-region} displays the message @samp{Wrote
 @var{filename}} in the echo area.  If @var{visit} is neither @code{t}
@@ -2802,23 +2802,70 @@
 @cindex file format conversion
 @cindex encoding file formats
 @cindex decoding file formats
-  The variable @code{format-alist} defines a list of @dfn{file formats},
-which describe textual representations used in files for the data (text,
-text-properties, and possibly other information) in an Emacs buffer.
-Emacs performs format conversion if appropriate when reading and writing
-files.
+@cindex text properties in files
+@cindex saving text properties
+  Emacs performs several steps to convert the data in a buffer (text,
+text properties, and possibly other information) to and from a
+representation suitable for storing into a file.  This section describes
+the fundamental functions that perform this @dfn{format conversion},
+namely @code{insert-file-contents} for reading a file into a buffer,
+and @code{write-region} for writing a buffer into a file.
+
+@menu
+* Overview: Format Conversion Overview.     @code{insert-file-contents} and @code{write-region}
+* Round-Trip: Format Conversion Round-Trip. Using @code{format-alist}.
+* Piecemeal: Format Conversion Piecemeal.   Specifying non-paired conversion.
+@end menu
+
+@node Format Conversion Overview
+@subsection Overview
+@noindent
+The function @code{insert-file-contents}:
+
+@itemize
+@item initially, inserts bytes from the file into the buffer;
+@item decodes bytes to characters as appropriate;
+@item processes formats as defined by entries in @code{format-alist}; and
+@item calls functions in @code{after-insert-file-functions}.
+@end itemize
+
+@noindent
+The function @code{write-region}:
+
+@itemize
+@item initially, calls functions in @code{write-region-annotate-functions};
+@item processes formats as defined by entries in @code{format-alist};
+@item encodes characters to bytes as appropriate; and
+@item modifies the file with the bytes.
+@end itemize
+
+  This shows the symmetry of the lowest-level operations; reading and
+writing handle things in opposite order.  The rest of this section
+describes the two facilities surrounding the three variables named
+above, as well as some related functions.  @ref{Coding Systems}, for
+details on character encoding and decoding.
+
+@node Format Conversion Round-Trip
+@subsection Round-Trip Specification
+
+  The most general of the two facilities is controlled by the variable
+@code{format-alist}, a list of @dfn{file format} specifications, which
+describe textual representations used in files for the data in an Emacs
+buffer.  The descriptions for reading and writing are paired, which is
+why we call this ``round-trip'' specification
+(@pxref{Format Conversion Piecemeal}, for non-paired specification).
 
 @defvar format-alist
 This list contains one format definition for each defined file format.
-@end defvar
-
-@cindex format definition
 Each format definition is a list of this form:
 
 @example
 (@var{name} @var{doc-string} @var{regexp} @var{from-fn} @var{to-fn} @var{modify} @var{mode-fn})
 @end example
-
+@end defvar
+
+@cindex format definition
+@noindent
 Here is what the elements in a format definition mean:
 
 @table @var
@@ -2957,6 +3004,89 @@
 in all buffers.
 @end defvar
 
+@node Format Conversion Piecemeal
+@subsection Piecemeal Specification
+
+  In contrast to the round-trip specification described in the previous
+subsection (@pxref{Format Conversion Round-Trip}), you can use the variables
+@code{after-insert-file-functions} and @code{write-region-annotate-functions}
+to separately control the respective reading and writing conversions.
+
+  Conversion starts with one representation and produces another
+representation.  When there is only one conversion to do, there is no
+conflict about what to start with.  However, when there are multiple
+conversions involved, conflict may arise when two conversions need to
+start with the same data.
+
+  This situation is best understood in the context of converting text
+properties during @code{write-region}.  For example, the character at
+position 42 in a buffer is @samp{X} with a text property @code{foo}.  If
+the conversion for @code{foo} is done by inserting into the buffer, say,
+@samp{FOO:}, then that changes the character at position 42 from
+@samp{X} to @samp{F}.  The next conversion will start with the wrong
+data straight away.
+
+  To avoid conflict, cooperative conversions do not modify the buffer,
+but instead specify @dfn{annotations}, a list of elements of the form
+@code{(@var{position} . @var{string})}, sorted in order of increasing
+@var{position}.
+
+  If there is more than one conversion, @code{write-region} merges their
+annotations destructively into one sorted list.  Later, when the text
+from the buffer is actually written to the file, it intermixes the
+specified annotations at the corresponding positions.  All this takes
+place without modifying the buffer.
+
+@c ??? What about ``overriding'' conversions like those allowed
+@c ??? for `write-region-annotate-functions', below?  --ttn
+
+  In contrast, when reading, the annotations intermixed with the text
+are handled immediately.  @code{insert-file-contents} sets point to the
+beginning of some text to be converted, then calls the conversion
+functions with the length of that text.  These functions should always
+return with point at the beginning of the inserted text.  This approach
+makes sense for reading because annotations removed by the first
+converter can't be mistakenly processed by a later converter.
+
+  Each conversion function should scan for the annotations it
+recognizes, remove the annotation, modify the buffer text (to set a text
+property, for example), and return the updated length of the text, as it
+stands after those changes.  The value returned by one function becomes
+the argument to the next function.
+
+@defvar write-region-annotate-functions
+A list of functions for @code{write-region} to call.  Each function in
+the list is called with two arguments: the start and end of the region
+to be written.  These functions should not alter the contents of the
+buffer.  Instead, they should return annotations.
+
+@c ??? Following adapted from comment in `build_annotations' (fileio.c).
+@c ??? Perhaps this is intended for internal use only?
+@c ??? Someone who understands this, please reword it. --ttn
+As a special case, if a function returns with a different buffer
+current, Emacs takes it to mean the current buffer contains altered text
+to be output, and discards all previous annotations because they should
+have been dealt with by this function.
+@end defvar
+
+@defvar after-insert-file-functions
+Each function in this list is called by @code{insert-file-contents}
+with one argument, the number of characters inserted, and should
+return the new character count, leaving point the same.
+@c ??? The docstring mentions a handler from `file-name-handler-alist'
+@c     "intercepting" `insert-file-contents'.  Hmmm.  --ttn
+@end defvar
+
+  We invite users to write Lisp programs to store and retrieve text
+properties in files, using these hooks, and thus to experiment with
+various data formats and find good ones.  Eventually we hope users
+will produce good, general extensions we can install in Emacs.
+
+  We suggest not trying to handle arbitrary Lisp objects as text property
+names or values---because a program that general is probably difficult
+to write, and slow.  Instead, choose a set of possible data types that
+are reasonably flexible, and not too hard to encode.
+
 @ignore
    arch-tag: 141f74ce-6ae3-40dc-a6c4-ef83fc4ec35c
 @end ignore
--- a/lispref/hooks.texi	Wed May 16 19:48:35 2007 +0000
+++ b/lispref/hooks.texi	Thu May 17 01:12:58 2007 +0000
@@ -48,7 +48,7 @@
 @xref{Init File}.
 
 @item after-insert-file-functions
-@xref{Saving Properties}.
+@xref{Format Conversion}.
 
 @item after-make-frame-functions
 @xref{Creating Frames}.
@@ -330,7 +330,7 @@
 @xref{Saving Buffers}.
 
 @item write-region-annotate-functions
-@xref{Saving Properties}.
+@xref{Format Conversion}.
 @end table
 
 @ignore
--- a/lispref/text.texi	Wed May 16 19:48:35 2007 +0000
+++ b/lispref/text.texi	Thu May 17 01:12:58 2007 +0000
@@ -2574,8 +2574,6 @@
 * Format Properties::      Properties for representing formatting of text.
 * Sticky Properties::      How inserted text gets properties from
                              neighboring text.
-* Saving Properties::      Saving text properties in files, and reading
-                             them back.
 * Lazy Properties::        Computing text properties in a lazy fashion
                              only when text is examined.
 * Clickable Text::         Using text properties to make regions of text
@@ -3396,75 +3394,6 @@
   @xref{Insertion}, for the ordinary insertion functions which do not
 inherit.
 
-@node Saving Properties
-@subsection Saving Text Properties in Files
-@cindex text properties in files
-@cindex saving text properties
-
-  You can save text properties in files (along with the text itself),
-and restore the same text properties when visiting or inserting the
-files, using these two hooks:
-
-@defvar write-region-annotate-functions
-This variable's value is a list of functions for @code{write-region} to
-run to encode text properties in some fashion as annotations to the text
-being written in the file.  @xref{Writing to Files}.
-
-Each function in the list is called with two arguments: the start and
-end of the region to be written.  These functions should not alter the
-contents of the buffer.  Instead, they should return lists indicating
-annotations to write in the file in addition to the text in the
-buffer.
-
-Each function should return a list of elements of the form
-@code{(@var{position} . @var{string})}, where @var{position} is an
-integer specifying the relative position within the text to be written,
-and @var{string} is the annotation to add there.
-
-Each list returned by one of these functions must be already sorted in
-increasing order by @var{position}.  If there is more than one function,
-@code{write-region} merges the lists destructively into one sorted list.
-
-When @code{write-region} actually writes the text from the buffer to the
-file, it intermixes the specified annotations at the corresponding
-positions.  All this takes place without modifying the buffer.
-@end defvar
-
-@defvar after-insert-file-functions
-This variable holds a list of functions for @code{insert-file-contents}
-to call after inserting a file's contents.  These functions should scan
-the inserted text for annotations, and convert them to the text
-properties they stand for.
-
-Each function receives one argument, the length of the inserted text;
-point indicates the start of that text.  The function should scan that
-text for annotations, delete them, and create the text properties that
-the annotations specify.  The function should return the updated length
-of the inserted text, as it stands after those changes.  The value
-returned by one function becomes the argument to the next function.
-
-These functions should always return with point at the beginning of
-the inserted text.
-
-The intended use of @code{after-insert-file-functions} is for converting
-some sort of textual annotations into actual text properties.  But other
-uses may be possible.
-@end defvar
-
-We invite users to write Lisp programs to store and retrieve text
-properties in files, using these hooks, and thus to experiment with
-various data formats and find good ones.  Eventually we hope users
-will produce good, general extensions we can install in Emacs.
-
-We suggest not trying to handle arbitrary Lisp objects as text property
-names or values---because a program that general is probably difficult
-to write, and slow.  Instead, choose a set of possible data types that
-are reasonably flexible, and not too hard to encode.
-
-@xref{Format Conversion}, for a related feature.
-
-@c ??? In next edition, merge this info Format Conversion.
-
 @node Lazy Properties
 @subsection Lazy Computation of Text Properties
 
--- a/mac/ChangeLog	Wed May 16 19:48:35 2007 +0000
+++ b/mac/ChangeLog	Thu May 17 01:12:58 2007 +0000
@@ -3,6 +3,11 @@
 	* INSTALL: Fix description about using colors in terminal.
 	Fix typos (/Application -> /Applications).
 
+2007-04-26  Glenn Morris  <rgm@gnu.org>
+
+	* Emacs.app/Contents/Resources/English.lproj/InfoPlist.strings:
+	* src/Emacs.r: Increase version to 22.1.50.
+
 2007-04-09  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
 
 	* make-package (compver): Don't hardcode processor type.
--- a/mac/Emacs.app/Contents/Resources/English.lproj/InfoPlist.strings	Wed May 16 19:48:35 2007 +0000
+++ b/mac/Emacs.app/Contents/Resources/English.lproj/InfoPlist.strings	Thu May 17 01:12:58 2007 +0000
@@ -1,5 +1,5 @@
 /* Localized versions of Info.plist keys */
 
 CFBundleName = "Emacs";
-CFBundleShortVersionString = "22.0.99";
-CFBundleGetInfoString = "22.0.99, Copyright (C) 2007 Free Software Foundation, Inc.";
+CFBundleShortVersionString = "22.1.50";
+CFBundleGetInfoString = "22.1.50, Copyright (C) 2007 Free Software Foundation, Inc.";
--- a/mac/src/Emacs.r	Wed May 16 19:48:35 2007 +0000
+++ b/mac/src/Emacs.r	Thu May 17 01:12:58 2007 +0000
@@ -219,12 +219,12 @@
 
 resource 'vers' (1) {
 	0x22,		/* Major revision in BCD */
-	0x0,		/* Minor revision in BCD */
-	alpha,	/* development, alpha, beta, or final (release) */
-	99,		/* Non-final release # */
+	0x1,		/* Minor revision in BCD */
+	development,	/* development, alpha, beta, or final (release) */
+	50,		/* Non-final release # */
 	0,		/* Region code */
-	"22.0.99",	/* Short version number */
-	"22.0.99, Copyright \0xa9 2007 "
+	"22.1.50",	/* Short version number */
+	"22.1.50, Copyright \0xa9 2007 "
 	"Free Software Foundation, Inc." /* Long version number */
 };
 
--- a/man/ChangeLog	Wed May 16 19:48:35 2007 +0000
+++ b/man/ChangeLog	Thu May 17 01:12:58 2007 +0000
@@ -1,22 +1,30 @@
-2007-05-10  Reiner Steib  <Reiner.Steib@gmx.de>
+2007-05-09  Reiner Steib  <Reiner.Steib@gmx.de>
 
 	* gnus.texi (Running NNDiary): Use ~/.gnus.el instead of gnusrc.
 
-2007-05-10  Didier Verna  <didier@xemacs.org>
+2007-05-09  Didier Verna  <didier@xemacs.org>
 
 	* gnus.texi (Email Based Diary): New. Proper documentation for the
 	nndiary back end and the gnus-diary library.
 
+2007-05-07  Karl Berry  <karl@gnu.org>
+
+	* emacs.texi (EMACSVER): back to 22.
+
+2007-05-06  Richard Stallman  <rms@gnu.org>
+
+	* maintaining.texi (Create Tags Table): Clean up previous change.
+
 2007-05-05  Francesco Potort,Al(B  <pot@gnu.org>
 
 	* maintaining.texi (Create Tags Table): Add text about the dangers of
-	making symbolic links to tags files.  (Clarified by RMS.)
-
-2007-05-04  Karl Berry  <karl@tug.org>
+	making symbolic links to tags files.
+
+2007-05-04  Karl Berry  <karl@gnu.org>
 
 	* emacs.texi (EMACSVER) [smallbook]: 22.1 for printed version, not 22.
 
-2007-05-03  Karl Berry  <karl@tug.org>
+2007-05-03  Karl Berry  <karl@gnu.org>
 
 	* emacs.texi (EMACSVER) [smallbook]: 22 for printed version.
 
@@ -31,6 +39,10 @@
 
 	* cmdargs.texi (Initial Options): Under --batch, mention --eval.
 
+2007-04-30  Reiner Steib  <Reiner.Steib@gmx.de>
+
+	* gnus.texi (Article Highlighting): Clarify gnus-cite-parse-max-size.
+
 2007-04-28  Glenn Morris  <rgm@gnu.org>
 
 	* ack.texi (Acknowledgments):
@@ -43,17 +55,21 @@
 
 	* files.texi (File Names): Fixes to ~ description on MS systems.
 
-2007-04-28  Karl Berry  <karl@gnu.org>
+2007-04-27  J.D. Smith  <jdsmith@as.arizona.edu>
+
+	* idlwave.texi: Minor updates for IDLWAVE 6.1.
+
+2007-04-26  Glenn Morris  <rgm@gnu.org>
+
+	* emacs.texi (EMACSVER): Increase to 22.1.50.
+
+2007-04-25  Karl Berry  <karl@gnu.org>
 
 	* emacs.texi: Improve line breaks on copyright page,
 	similar layout to lispref, 8.5x11 by default.
 
 	* dired.texi (Image-Dired): Improve line break, fix typo.
 
-2007-04-27  J.D. Smith  <jdsmith@as.arizona.edu>
-
-	* idlwave.texi: Minor updates for IDLWAVE 6.1.
-
 2007-04-24  Chong Yidong  <cyd@stupidchicken.com>
 
 	* programs.texi (Program Modes):
@@ -83,8 +99,8 @@
 	* misc.texi (Thumbnails): Node deleted.
 	* emacs.texi (Top): Update node listing.
 
-	* files.texi (File Conveniences): 
-	* ack.texi (Acknowledgments): 
+	* files.texi (File Conveniences):
+	* ack.texi (Acknowledgments):
 	* faq.texi (New in Emacs 22): Rename "tumme" to "image-dired".
 
 2007-04-21  Richard Stallman  <rms@gnu.org>
--- a/man/emacs.texi	Wed May 16 19:48:35 2007 +0000
+++ b/man/emacs.texi	Thu May 17 01:12:58 2007 +0000
@@ -5,7 +5,7 @@
 
 @c The edition number appears in several places in this file
 @set EDITION   Sixteenth
-@set EMACSVER  22.0.99
+@set EMACSVER  22.1.50
 
 @copying
 This is the @value{EDITION} edition of the @cite{GNU Emacs Manual},@*
@@ -51,7 +51,7 @@
 @tex
 @ifset smallbook
 @fonttextsize 10
-@set EMACSVER 22.1
+@set EMACSVER 22
 \global\let\urlcolor=\Black % don't print links in grayscale
 \global\let\linkcolor=\Black
 @end ifset
--- a/man/texinfo.tex	Wed May 16 19:48:35 2007 +0000
+++ b/man/texinfo.tex	Thu May 17 01:12:58 2007 +0000
@@ -3,7 +3,7 @@
 % Load plain if necessary, i.e., if running under initex.
 \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
 %
-\def\texinfoversion{2007-05-03.09}
+\def\texinfoversion{2007-05-04.09}
 %
 % Copyright (C) 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
 % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
@@ -1435,7 +1435,7 @@
       \indexnofonts
       \setupdatafile
       \catcode`\\=\active \otherbackslash
-      \input \jobname.toc
+      \input \tocreadfilename
     \endgroup
   }
   %
@@ -4301,11 +4301,8 @@
     % The following is kludged to not output a line of dots in the index if
     % there are no page numbers.  The next person who breaks this will be
     % cursed by a Unix daemon.
-    \def\tempa{{\rm }}%
-    \def\tempb{#1}%
-    \edef\tempc{\tempa}%
-    \edef\tempd{\tempb}%
-    \ifx\tempc\tempd
+    \setbox\boxA = \hbox{#1}%
+    \ifdim\wd\boxA = 0pt
       \ %
     \else
       %
@@ -5177,7 +5174,7 @@
 \def\readtocfile{%
   \setupdatafile
   \activecatcodes
-  \input \jobname.toc
+  \input \tocreadfilename
 }
 
 \newskip\contentsrightmargin \contentsrightmargin=1in
@@ -5208,11 +5205,16 @@
     \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi
 }
 
+% redefined for the two-volume lispref.  We always output on
+% \jobname.toc even if this is redefined.
+% 
+\def\tocreadfilename{\jobname.toc}
 
 % Normal (long) toc.
+%
 \def\contents{%
   \startcontents{\putwordTOC}%
-    \openin 1 \jobname.toc
+    \openin 1 \tocreadfilename\space
     \ifeof 1 \else
       \readtocfile
     \fi
@@ -5250,7 +5252,7 @@
     \let\numsubsubsecentry = \numsecentry
     \let\appsubsubsecentry = \numsecentry
     \let\unnsubsubsecentry = \numsecentry
-    \openin 1 \jobname.toc
+    \openin 1 \tocreadfilename\space
     \ifeof 1 \else
       \readtocfile
     \fi
@@ -8340,7 +8342,7 @@
   \textleading = 12pt
   %
   \internalpagesizes{7.5in}{5in}%
-                    {\voffset}{.25in}%
+                    {-.2in}{0in}%
                     {\bindingoffset}{16pt}%
                     {9.25in}{7in}%
   %
--- a/nt/ChangeLog	Wed May 16 19:48:35 2007 +0000
+++ b/nt/ChangeLog	Thu May 17 01:12:58 2007 +0000
@@ -1,3 +1,7 @@
+2007-04-26  Glenn Morris  <rgm@gnu.org>
+
+	* emacs.rc: Increase version to 22.1.50.
+
 2007-03-31  Eli Zaretskii  <eliz@gnu.org>
 
 	* INSTALL: Mention the VCVARS32.BAT batch file for VS.NET users.
--- a/nt/emacs.rc	Wed May 16 19:48:35 2007 +0000
+++ b/nt/emacs.rc	Thu May 17 01:12:58 2007 +0000
@@ -6,8 +6,8 @@
 #endif
 
 VS_VERSION_INFO VERSIONINFO
- FILEVERSION 22,0,99,0
- PRODUCTVERSION 22,0,99,0
+ FILEVERSION 22,1,50,0
+ PRODUCTVERSION 22,1,50,0
  FILEFLAGSMASK 0x3FL
 #ifdef EMACSDEBUG
  FILEFLAGS 0x1L
@@ -24,12 +24,12 @@
 	BEGIN
 	    VALUE "CompanyName", "Free Software Foundation\0"
 	    VALUE "FileDescription", "GNU Emacs for Windows NT/95/98/2000/ME/XP\0"
-	    VALUE "FileVersion", "22, 0, 99, 0\0"
+	    VALUE "FileVersion", "22, 1, 50, 0\0"
 	    VALUE "InternalName", "Emacs\0"
 	    VALUE "LegalCopyright", "Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007\0"
 	    VALUE "OriginalFilename", "emacs.exe"
 	    VALUE "ProductName", "Emacs: The extensible self-documenting text editor\0"
-	    VALUE "ProductVersion", "22, 0, 99, 0\0"
+	    VALUE "ProductVersion", "22, 1, 50, 0\0"
 	    VALUE "OLESelfRegister", "\0"
 	 END
      END
--- a/src/ChangeLog	Wed May 16 19:48:35 2007 +0000
+++ b/src/ChangeLog	Thu May 17 01:12:58 2007 +0000
@@ -3,6 +3,10 @@
 	* macterm.c [USE_CARBON_EVENTS] (mac_convert_event_ref): Also convert
 	dead key repeat and up events.
 
+2007-05-14  Chong Yidong  <cyd@stupidchicken.com>
+
+	* image.c (pbm_load): Check image size for monochrome pbm.
+
 2007-05-13  Chong Yidong  <cyd@stupidchicken.com>
 
 	* xterm.c (XTread_socket): Revert last change.
@@ -17,16 +21,14 @@
 
 	* editfns.c (Ftranspose_regions): Yet another int/Lisp_Object mixup (YAILOM)
 
-2007-05-06  Richard Stallman  <rms@gnu.org>
-
-	* process.c: Undo May 3 change.
-
-2007-05-03  Per Cederqvist  <ceder@lysator.liu.se>  (tiny change)
-
-	* process.c (Faccept_process_output): Revert 2006-03-22 change so
-	that the third argument once again is in microseconds (not
-	milliseconds).  This makes it compatible with Emacs 21 and
-	earlier.  Problem found by Henrik Rindl,Av(Bw.
+2007-05-07  Andreas Schwab  <schwab@suse.de>
+
+	* keymap.c (Flookup_key): Fix typo in last change. 
+
+2007-05-07  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* keymap.c (Fdefine_key, Flookup_key): Only do the 0x80->meta_modifier
+	mapping for unibyte strings.
 
 2007-05-01  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
 
@@ -37,11 +39,19 @@
 
 	* insdel.c (replace_range): For undo, record insertion first.
 
+2007-04-29  Andreas Schwab  <schwab@suse.de>
+
+	* lisp.h (VECSIZE): Use OFFSETOF.
+
 2007-04-29  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
 
 	* xdisp.c (try_window_reusing_current_matrix): Fix number of
 	disabled lines.
 
+2007-04-28  Richard Stallman  <rms@gnu.org>
+
+	* lread.c (read_escape): In a string, \s is always space.
+
 2007-04-27  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>
 
 	* xmenu.c (xdialog_show): Call Fredisplay before showing the dialog.
--- a/src/image.c	Wed May 16 19:48:35 2007 +0000
+++ b/src/image.c	Thu May 17 01:12:58 2007 +0000
@@ -5730,7 +5730,17 @@
 	    if (raw_p)
 	      {
 		if ((x & 7) == 0)
-		  c = *p++;
+		  {
+		    if (p >= end)
+		      {
+			x_destroy_x_image (ximg);
+			x_clear_image (f, img);
+			image_error ("Invalid image size in image `%s'",
+				     img->spec, Qnil);
+			goto error;
+		      }
+		    c = *p++;
+		  }
 		g = c & 0x80;
 		c <<= 1;
 	      }
--- a/src/keymap.c	Wed May 16 19:48:35 2007 +0000
+++ b/src/keymap.c	Thu May 17 01:12:58 2007 +0000
@@ -1156,7 +1156,8 @@
   if (SYMBOLP (def) && !EQ (Vdefine_key_rebound_commands, Qt))
     Vdefine_key_rebound_commands = Fcons (def, Vdefine_key_rebound_commands);
 
-  meta_bit = VECTORP (key) ? meta_modifier : 0x80;
+  meta_bit = (VECTORP (key) || STRINGP (key) && STRING_MULTIBYTE (key)
+	      ? meta_modifier : 0x80);
 
   if (VECTORP (def) && ASIZE (def) > 0 && CONSP (AREF (def, 0)))
     { /* DEF is apparently an XEmacs-style keyboard macro.  */
@@ -1312,7 +1313,7 @@
 	c = Fevent_convert_list (c);
 
       /* Turn the 8th bit of string chars into a meta modifier.  */
-      if (INTEGERP (c) && XINT (c) & 0x80 && STRINGP (key))
+      if (STRINGP (key) && XINT (c) & 0x80 && !STRING_MULTIBYTE (key))
 	XSETINT (c, (XINT (c) | meta_modifier) & ~0x80);
 
       /* Allow string since binding for `menu-bar-select-buffer'
--- a/src/lisp.h	Wed May 16 19:48:35 2007 +0000
+++ b/src/lisp.h	Thu May 17 01:12:58 2007 +0000
@@ -735,9 +735,9 @@
 
 /* If a struct is made to look like a vector, this macro returns the length
    of the shortest vector that would hold that struct.  */
-#define VECSIZE(type) ((sizeof (type) - (sizeof (struct Lisp_Vector)  \
-                                         - sizeof (Lisp_Object))      \
-                        + sizeof(Lisp_Object) - 1) /* round up */     \
+#define VECSIZE(type) ((sizeof (type)					  \
+			- OFFSETOF (struct Lisp_Vector, contents[0])      \
+                        + sizeof(Lisp_Object) - 1) /* round up */	  \
 		       / sizeof (Lisp_Object))
 
 /* Like VECSIZE, but used when the pseudo-vector has non-Lisp_Object fields
--- a/src/lread.c	Wed May 16 19:48:35 2007 +0000
+++ b/src/lread.c	Thu May 17 01:12:58 2007 +0000
@@ -1894,7 +1894,7 @@
 
     case 's':
       c = READCHAR;
-      if (c != '-')
+      if (stringp || c != '-')
 	{
 	  UNREAD (c);
 	  return ' ';