changeset 83202:42acc7fa8a4f

Merged in changes from CVS trunk. Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-529 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-530 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-531 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-532 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-533 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-534 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-535 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-536 sync-tree with gnus--rel--5.10 * miles@gnu.org--gnu-2004/gnus--devo--0--patch-2 Add {arch}/=cvs-sync-make-log * miles@gnu.org--gnu-2004/gnus--rel--5.8--base-0 Import from Gnus CVS branch V5-8 * miles@gnu.org--gnu-2004/gnus--rel--5.8--patch-1 {arch}/=tagging-method: Add CVS and autoconf grot to junk regexp * miles@gnu.org--gnu-2004/gnus--rel--5.8--patch-2 Use explicit tags for autoconf input files * miles@gnu.org--gnu-2004/gnus--rel--5.8--patch-3 Remove RCS keywords * miles@gnu.org--gnu-2004/gnus--rel--5.8--patch-4 Fix copied explicit id-tags * miles@gnu.org--gnu-2004/gnus--rel--5.8--patch-5 Add {arch}/=cvs-sync-make-log * miles@gnu.org--gnu-2004/gnus--rel--5.8--patch-6 configure.in: Use ifelse instead of m4_if for arch-tag: comment * miles@gnu.org--gnu-2004/gnus--rel--5.10--base-0 tag of miles@gnu.org--gnu-2004/gnus--rel--5.8--base-0 * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-1 Gnus 5.10, from CVS branch v5-10 * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-2 Merge from gnus--rel--5.8 * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-3 Use explicit tags for autoconf input files * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-4 sync-tree with gnus--rel--5.8 * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-5 Update from CVS * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-6 Merge from gnus--rel--5.8 * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-7 Remove RCS keywords * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-8 Merge from gnus--rel--5.8 * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-9 Update from CVS * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-10 Add {arch}/=cvs-sync-make-log * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-11 Merge from gnus--rel--5.8 * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-12 Update from CVS: make.bat: Fix line endings around arch-tag. * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-13 Update from CVS * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-14 Update from CVS * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-15 Update from CVS * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-16 Update from CVS * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-17 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-242
author Karoly Lorentey <lorentey@elte.hu>
date Fri, 10 Sep 2004 13:06:10 +0000
parents 8a6fd1c164cd (current diff) cb013e5835b8 (diff)
children bc89b722d36f
files etc/TODO lisp/ChangeLog lisp/emacs-lisp/bytecomp.el lisp/simple.el lisp/startup.el lisp/subr.el lisp/term/xterm.el lisp/vc-rcs.el lisp/vc-sccs.el lisp/vc.el man/ChangeLog man/kmacro.texi src/buffer.c src/fileio.c src/minibuf.c src/w32term.h src/window.c src/xdisp.c src/xmenu.c
diffstat 73 files changed, 1089 insertions(+), 595 deletions(-) [+]
line wrap: on
line diff
--- a/etc/ChangeLog	Mon Sep 06 07:53:44 2004 +0000
+++ b/etc/ChangeLog	Fri Sep 10 13:06:10 2004 +0000
@@ -1,3 +1,12 @@
+2004-09-09  Thien-Thi Nguyen  <ttn@gnu.org>
+
+	* MORE.STUFF (EDB): Update entry.
+
+2004-09-07  Dan Nicolaescu  <dann@ics.uci.edu>
+
+	* e/eterm.ti: Add `op' entry to enable colors in term.
+        * e/eterm: Regenerate.
+
 2004-09-04  Eric S. Raymond  <esr@thyrsus.com>
 
 	* PROBLEMS: More reorganization to exile old stuff to the
--- a/etc/MORE.STUFF	Mon Sep 06 07:53:44 2004 +0000
+++ b/etc/MORE.STUFF	Fri Sep 10 13:06:10 2004 +0000
@@ -140,9 +140,7 @@
  * Dismal: spreadsheet:
    <URL:http://acs.ist.psu.edu/dismal/dismal.html>
 
- * EDB: database:
-   <URL:http://sdg.lcs.mit.edu/%7Emernst/software/edb-mrp.tar.gz>
-   Not maintained?
+ * EDB: database: <URL:http://www.glug.org/people/ttn/software/edb/>
 
  * Ee: categorizing information manager:
    <URL:http://www.jurta.org/emacs/ee/>
--- a/etc/NEWS	Mon Sep 06 07:53:44 2004 +0000
+++ b/etc/NEWS	Fri Sep 10 13:06:10 2004 +0000
@@ -242,11 +242,47 @@
 
 The new file etc/compilation.txt gives examples of each type of message.
 
-** M-x grep has been adapted to new compile
+** Compilation mode enhancements:
+
+*** New user option `compilation-environment'.
+This option allows you to specify environment variables for inferior
+compilation processes without affecting the environment that all
+subprocesses inherit.
+
+** Grep has been decoupled from compilation mode setup.
+
+*** There's a new separate package grep.el.
+
+*** M-x grep has been adapted to new compile
 
 Hits are fontified in green, and hits in binary files in orange.  Grep buffers
 can be saved and automatically revisited with the new Grep mode.
 
+*** Grep commands now have their own submenu and customization group.
+
+*** The new variables `grep-window-height', `grep-auto-highlight', and
+`grep-scroll-output' can be used to override the corresponding
+compilation mode settings for grep commands.
+
+*** New option `grep-highlight-matches' highlightes matches in *grep*
+buffer.  It uses a special feature of some grep programs which accept
+--color option to output markers around matches.  When going to the next
+match with `next-error' the exact match is highlighted in the source
+buffer.  Otherwise, if `grep-highlight-matches' is nil, the whole
+source line is highlighted.
+
+*** New key bindings in grep output window:
+SPC and DEL scrolls window up and down.  C-n and C-p moves to next and
+previous match in the grep window.  RET jumps to the source line of
+the current match.  `n' and `p' shows next and previous match in
+other window, but does not switch buffer.  `{' and `}' jumps to the
+previous or next file in the grep output.  TAB also jumps to the next
+file.
+
+** New options `next-error-highlight' and `next-error-highlight-no-select'
+specify the method of highlighting of the corresponding source line
+in new face `next-error'.
+
 ** A new minor mode `next-error-follow-minor-mode' can be used in
 compilation-mode, grep-mode, occur-mode, and diff-mode (i.e. all the
 modes that can use `next-error').  In this mode, cursor motion in the
@@ -1136,6 +1172,16 @@
 search string used as the string to replace.
 
 +++
+** New user option `isearch-resume-enabled'.
+This option can be disabled, to avoid the normal behavior of isearch
+which puts calls to `isearch-resume' in the command history.
+
++++
+** New user option `history-delete-duplicates'.
+If set to t when adding a new history element, all previous identical
+elements are deleted.
+
++++
 ** Yanking text now discards certain text properties that can
 be inconvenient when you did not expect them.  The variable
 `yank-excluded-properties' specifies which ones.  Insertion
@@ -1803,11 +1849,6 @@
 +++
 ** `xml-mode' is now an alias for `sgml-mode', which has XML support.
 
-+++
-** New user option `isearch-resume-enabled'.
-This option can be disabled, to avoid the normal behavior of isearch
-which puts calls to `isearch-resume' in the command history.
-
 ---
 ** Lisp mode now uses font-lock-doc-face for the docstrings.
 
@@ -1873,42 +1914,6 @@
 When loading many files, for instance with `emacs *', Emacs normally
 displays a buffer menu.  This option turns the buffer menu off.
 
-** Compilation mode enhancements:
-
-*** New user option `compilation-environment'.
-This option allows you to specify environment variables for inferior
-compilation processes without affecting the environment that all
-subprocesses inherit.
-
-*** New options `next-error-highlight' and `next-error-highlight-no-select'
-specify the method of highlighting of the corresponding source line
-in new face `next-error'.
-
-** Grep has been decoupled from compilation mode setup.
-
-*** There's a new separate package grep.el.
-
-*** Grep commands now have their own submenu and customization group.
-
-*** The new variables `grep-window-height', `grep-auto-highlight', and
-`grep-scroll-output' can be used to override the corresponding
-compilation mode settings for grep commands.
-
-*** New option `grep-highlight-matches' highlightes matches in *grep*
-buffer.  It uses a special feature of some grep programs which accept
---color option to output markers around matches.  When going to the next
-match with `next-error' the exact match is highlighted in the source
-buffer.  Otherwise, if `grep-highlight-matches' is nil, the whole
-source line is highlighted.
-
-*** New key bindings in grep output window:
-SPC and DEL scrolls window up and down.  C-n and C-p moves to next and
-previous match in the grep window.  RET jumps to the source line of
-the current match.  `n' and `p' shows next and previous match in
-other window, but does not switch buffer.  `{' and `}' jumps to the
-previous or next file in the grep output.  TAB also jumps to the next
-file.
-
 ---
 ** Rmail now displays 5-digit message ids in its summary buffer.
 
@@ -2227,6 +2232,10 @@
 * Lisp Changes in Emacs 21.4
 
 +++
+** `auto-save-file-format' has been renamed to
+`buffer-auto-save-file-format' and made into a permanent local.
+
++++
 ** Both the variable and the function `disabled-command-hook' have
 been renamed to `disabled-command-function'.  The variable
 `disabled-command-hook' has been kept as an obsolete alias.
@@ -2402,6 +2411,11 @@
 The form `(+ EXPR ...)' adds up the value of the expressions.
 The form `(- EXPR ...)' negates or subtracts the value of the expressions.
 
+** Normally, the cursor is displayed at the end of any overlay and
+text property string that may be present at the current window
+position.  The cursor may now be placed on any character of such
+strings by giving that character a non-nil `cursor' text property.
+
 ** New macro with-local-quit temporarily sets inhibit-quit to nil for use
 around potentially blocking or long-running code in timers
 and post-command-hooks.
@@ -2877,6 +2891,15 @@
 
    #!/usr/bin/emacs --script
 
+** The option --directory DIR now modifies `load-path' immediately.
+Directories are added to the front of `load-path' in the order they
+appear on the command line.  For example, with this command line:
+
+  emacs -batch -L .. -L /tmp --eval "(require 'foo)"
+
+Emacs looks for library `foo' in the parent directory, then in /tmp, then
+in the other directories in `load-path'.  (-L is short for --directory.)
+
 +++
 ** A function's docstring can now hold the function's usage info on
 its last line.  It should match the regexp "\n\n(fn.*)\\'".
--- a/etc/TODO	Mon Sep 06 07:53:44 2004 +0000
+++ b/etc/TODO	Fri Sep 10 13:06:10 2004 +0000
@@ -270,8 +270,6 @@
   list in a menu, let you select one of the values, and put it into some
   other variable, without changing the value of `values'.
 
-** Fix skip-chars-{for,back}ward to allow character classes.
-
 ** (Controlled by a flag) make open and close syntax match exactly,
   i.e. `(' doesn't match `]'.
 
Binary file etc/e/eterm has changed
--- a/etc/e/eterm.ti	Mon Sep 06 07:53:44 2004 +0000
+++ b/etc/e/eterm.ti	Fri Sep 10 13:06:10 2004 +0000
@@ -15,7 +15,7 @@
 	smso=\E[7m,rmso=\E[m,
 	smul=\E[4m,rmul=\E[m,
 	rev=\E[7m,bold=\E[1m,sgr0=\E[m,
-	invis=\E[8m,
+	invis=\E[8m,op=\E[39;49m,
 	setab=\E[%p1%{40}%+%dm, setaf=\E[%p1%{30}%+%dm,
 	bel=^G,xenl,am,
 
--- a/etc/etags.1	Mon Sep 06 07:53:44 2004 +0000
+++ b/etc/etags.1	Fri Sep 10 13:06:10 2004 +0000
@@ -266,7 +266,8 @@
 \fBcxref\fP format) to standard output.  Only \fBctags\fP accepts this option.
 .TP
 .B \-h, \-H, \-\-help
-Print usage information.
+Print usage information.  Followed by one or more \-\-language=LANG
+prints detailed information about how tags are created for LANG.
 .TP
 .B \-V, \-\-version
 Print the current version of the program (same as the version of the
--- a/lib-src/ChangeLog	Mon Sep 06 07:53:44 2004 +0000
+++ b/lib-src/ChangeLog	Fri Sep 10 13:06:10 2004 +0000
@@ -1,3 +1,8 @@
+2004-09-08  Francesco Potort,Al(B  <pot@gnu.org>
+
+	* etags.c: [LONG_OPTIONS]: make it TRUE (ifdef) or FALSE (ifndef)
+	for ease of use.
+
 2004-07-17  Richard M. Stallman  <rms@gnu.org>
 
 	* emacsclient.c (quote_file_name): Pass COPY thru %s to output it.
--- a/lib-src/etags.c	Mon Sep 06 07:53:44 2004 +0000
+++ b/lib-src/etags.c	Fri Sep 10 13:06:10 2004 +0000
@@ -35,7 +35,7 @@
  *
  */
 
-char pot_etags_version[] = "@(#) pot revision number is 16.56";
+char pot_etags_version[] = "@(#) pot revision number is 16.58";
 
 #define	TRUE	1
 #define	FALSE	0
@@ -76,6 +76,13 @@
 # define _GNU_SOURCE 1		/* enables some compiler checks on GNU */
 #endif
 
+#ifdef LONG_OPTIONS
+#  undef LONG_OPTIONS
+#  define LONG_OPTIONS TRUE
+#else
+#  define LONG_OPTIONS  FALSE
+#endif
+
 /* WIN32_NATIVE is for Xemacs.
    MSDOS, WINDOWSNT, DOS_NT are for Emacs. */
 #ifdef WIN32_NATIVE
@@ -147,7 +154,7 @@
 # define S_ISREG(m)	(((m) & S_IFMT) == S_IFREG)
 #endif
 
-#ifdef LONG_OPTIONS
+#if LONG_OPTIONS
 # include <getopt.h>
 #else
 # define getopt_long(argc,argv,optstr,lopts,lind) getopt (argc, argv, optstr)
@@ -465,7 +472,7 @@
 # define need_filebuf FALSE
 #endif /* ETAGS_REGEXPS */
 
-#ifdef LONG_OPTIONS
+#if LONG_OPTIONS
 static struct option longopts[] =
 {
   { "packages-only",      no_argument,	     &packages_only, 	 TRUE  },
@@ -845,12 +852,11 @@
   printf ("Usage: %s [options] [[regex-option ...] file-name] ...\n\
 \n\
 These are the options accepted by %s.\n", progname, progname);
-#ifdef LONG_OPTIONS
-  puts ("You may use unambiguous abbreviations for the long option names.");
-#else
-  puts ("Long option names do not work with this executable, as it is not\n\
+  if (LONG_OPTIONS)
+    puts ("You may use unambiguous abbreviations for the long option names.");
+  else
+    puts ("Long option names do not work with this executable, as it is not\n\
 linked with GNU getopt.");
-#endif /* LONG_OPTIONS */
   puts ("  A - as file name means read names from stdin (one per line).\n\
 Absolute names are stored in the output file as they are.\n\
 Relative ones are stored relative to the output file's directory.\n");
@@ -1158,9 +1164,8 @@
 #ifdef ETAGS_REGEXPS
   optstring = "-r:Rc:";
 #endif /* ETAGS_REGEXPS */
-#ifndef LONG_OPTIONS
-  optstring = optstring + 1;
-#endif /* LONG_OPTIONS */
+  if (LONG_OPTIONS)
+    optstring += 1;
   optstring = concat (optstring,
 		      "Cf:Il:o:SVhH",
 		      (CTAGS) ? "BxdtTuvw" : "aDi:");
@@ -6475,14 +6480,8 @@
 static void
 suggest_asking_for_help ()
 {
-
-#ifdef LONG_OPTIONS
-fprintf (stderr, "\tTry `%s %s' for a complete list of options.\n",
-	 progname, "--help");
-#else
-fprintf (stderr, "\tTry `%s %s' for a complete list of options.\n",
-	 progname, "-h");
-#endif
+  fprintf (stderr, "\tTry `%s %s' for a complete list of options.\n",
+	   progname, LONG_OPTIONS ? "--help" : "-h");
   exit (EXIT_FAILURE);
 }
 
--- a/lisp/ChangeLog	Mon Sep 06 07:53:44 2004 +0000
+++ b/lisp/ChangeLog	Fri Sep 10 13:06:10 2004 +0000
@@ -1,3 +1,151 @@
+2004-09-09  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* progmodes/grep.el (grep-mode): Remove unnecessary autoload.
+
+2004-09-09  Kim F. Storm  <storm@cua.dk>
+
+	* kmacro.el (kmacro-bind-to-key): Associate dedicated macro
+	counter and format with binding.
+	(kmacro-name-last-macro): New defun.  Like name-last-kbd-macro, but
+	the declared macro uses own macro counter and format.  Give symbol
+	kmacro property.
+	(kmacro-keymap): Bind kmacro-name-last-macro to n.
+	(kmacro-start-macro, kmacro-end-macro, kmacro-call-macro)
+	(kmacro-end-and-call-macro): Doc fix.
+
+2004-09-09  Lars Hansen  <larsh@math.ku.dk>
+
+	* desktop.el (desktop-clear-preserve-buffers):
+	Remove make-obsolete-variable.
+
+2004-09-08  Stefan  <monnier@iro.umontreal.ca>
+
+	* vc-arch.el (vc-arch-state): Fix parsing for `names' method.
+
+2004-09-08  Juri Linkov  <juri@jurta.org>
+
+	* replace.el (perform-replace): Use `query-replace-descr'.
+
+	* cus-start.el (history-delete-duplicates): Specify customization.
+
+	* diff-mode.el (diff-mode-map):
+	* progmodes/compile.el (compilation-mode-map):
+	* progmodes/grep.el (grep-mode-map):
+	* replace.el (occur-mode-map): Rename `next-error-follow-mode'
+	to `next-error-follow-minor-mode'.
+
+2004-09-08  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+	* isearch.el (isearch-lazy-highlight-update): Take into account
+	the case of zero-length match at the search bound.
+
+2004-09-08  Kim F. Storm  <storm@cua.dk>
+
+	* emulation/cua-rect.el (cua--highlight-rectangle): Fix last
+	change.  Use zero width overlays when necessary.
+
+2004-09-08  Thien-Thi Nguyen  <ttn@gnu.org>
+
+	* subr.el (split-string): Docfix.
+
+2004-09-08  Thien-Thi Nguyen  <ttn@gnu.org>
+
+	* emacs-lisp/bytecomp.el (byte-compile-generate-call-tree): Doc fix.
+	(display-call-tree): Ensure newline after caller/calls blocks.
+
+2004-09-08  Thien-Thi Nguyen  <ttn@gnu.org>
+
+	* startup.el (command-line-1): Make option
+	--directory/-L modify `load-path' straight away.
+
+2004-09-08  Thien-Thi Nguyen  <ttn@gnu.org>
+
+	* progmodes/grep.el (grep-mode): Use normal autoload cookie.
+
+2004-09-08  Thien-Thi Nguyen  <ttn@gnu.org>
+
+	* emacs-lisp/autoload.el (make-autoload):
+	Handle `define-compilation-mode'.
+
+	* emacs-lisp/lisp-mode.el (define-compilation-mode):
+	Specify `doc-string-elt' property.
+
+2004-09-08  Thien-Thi Nguyen  <ttn@gnu.org>
+
+	* bs.el (bs-mode): Doc fix.
+
+2004-09-08  Thien-Thi Nguyen  <ttn@gnu.org>
+
+	* info.el (Info-insert-dir): Fix temp buffer leak bug.
+
+2004-09-08  Thien-Thi Nguyen  <ttn@gnu.org>
+
+	* play/blackbox.el (bb-trace-ray): Avoid double tracing.
+
+2004-09-08  Kenichi Handa  <handa@m17n.org>
+
+	* ps-mule.el: Fix old function calls (ps-mule-chars-in-string ->
+	length, ps-mule-string-char -> aref, ps-mule-next-index -> 1+,
+	ps-mule-next-point -> 1+).
+
+	* composite.el (encode-composition-rule): Add autoload cooky.
+
+2004-09-07  Luc Teirlinck  <teirllm@auburn.edu>
+
+	* format.el (buffer-auto-save-file-format): Make it permanent local.
+
+2004-09-07  Kim F. Storm  <storm@cua.dk>
+
+	* emacs-lisp/authors.el (authors-aliases): Add more aliases.
+	(authors-fixed-entries): Fix typo.
+	(authors-canonical-author-name): Compact multiple spaces.
+	Ignore trivial names (e.g. only first name).
+
+	* term.el (term-window-width): Only use full window width on
+	window system if overflow-newline-into-fringe is enabled.
+	(term-mode): Don't disable overflow-newline-into-fringe.
+
+2004-09-07  Stefan  <monnier@iro.umontreal.ca>
+
+	* term/xterm.el (function-key-map): Add bindings for C- and S- cursor
+	motion as seen on my Mac OS X xterms.
+
+	* newcomment.el (uncomment-region-default, comment-region-default):
+	New functions extracted from uncomment-region and comment-region.
+	(comment-region, comment-region-function, uncomment-region)
+	(uncomment-region-function): Use them.
+
+	* pcvs-util.el (cvs-string-prefix-p): Use compare-strings.
+
+	* pcvs-info.el (cvs-states): Allow `ignore' on NEED-UPDATE.
+	It's not crucial but can make sense at times.
+
+	* vc-arch.el (vc-arch-workfile-version): Handle the special case before
+	the first commit.
+
+	* vc.el (vc-buffer-context, vc-restore-buffer-context):
+	Disable obsolete code.
+
+2004-09-07  Juri Linkov  <juri@jurta.org>
+
+	* progmodes/grep.el (grep-highlight-matches): Change default from
+	`t' to `auto-detect', and type from `boolean' to `choice'.  Doc fix.
+	(grep-compute-defaults): Set `grep-highlight-matches' to `t'
+	if grep option `--color' is available, or to `nil' otherwise.
+	(grep-process-setup): Call `grep-compute-defaults' if
+	`grep-highlight-matches' is not computed.  Set env-vars only
+	if `grep-highlight-matches' is `t'.
+	(grep-use-null-device): Remove redundant type `boolean' (`choice'
+	is already defined).
+
+	* progmodes/compile.el (compilation-start): Use copy of
+	`process-environment' created by `copy-sequence' to not
+	modify env-vars in the global `process-environment'.
+
+2004-09-06  Eli Zaretskii  <eliz@gnu.org>
+
+	* simple.el (next-error-follow-minor-mode): Fix last change.
+
 2004-09-05  Luc Teirlinck  <teirllm@auburn.edu>
 
 	* textmodes/paragraphs.el (use-hard-newlines): Make it into a
@@ -45,8 +193,7 @@
 	(next-error-follow-mode-post-command-hook): New functions.
 	(next-error-follow-last-line): New defvar.
 
-	* diff-mode.el (diff-mode-map): Bind
-	toggle-next-error-follow-mode.
+	* diff-mode.el (diff-mode-map): Bind next-error-follow-mode.
 	* progmodes/compile.el (compilation-mode-map): Likewise.
 	* progmodes/grep.el (grep-mode-map): Likewise.
 	* replace.el (occur-mode-map): Likewise.
--- a/lisp/bs.el	Mon Sep 06 07:53:44 2004 +0000
+++ b/lisp/bs.el	Fri Sep 10 13:06:10 2004 +0000
@@ -628,8 +628,8 @@
 \\[bs-tmp-select-other-window] -- make another window display that buffer and
     remain in Buffer Selection Menu.
 \\[bs-mouse-select] -- select current line's buffer and other marked buffers.
-\\[bs-save] -- save current line's buffer immediatly.
-\\[bs-delete] -- kill current line's buffer immediatly.
+\\[bs-save] -- save current line's buffer immediately.
+\\[bs-delete] -- kill current line's buffer immediately.
 \\[bs-toggle-readonly] -- toggle read-only status of current line's buffer.
 \\[bs-clear-modified] -- clear modified-flag on that buffer.
 \\[bs-mark-current] -- mark current line's buffer to be displayed.
--- a/lisp/buff-menu.el	Mon Sep 06 07:53:44 2004 +0000
+++ b/lisp/buff-menu.el	Fri Sep 10 13:06:10 2004 +0000
@@ -638,14 +638,11 @@
 		  (mapcar
 		   (lambda (buffer)
 		     (with-current-buffer buffer
-		       (save-window-excursion
-			 (setq name (buffer-name)
-			       mode (progn
-				      (set-window-buffer (selected-window) buffer)
-				      (concat (format-mode-line mode-name)
-					      (if mode-line-process
-						  (format-mode-line mode-line-process))))
-			       file (buffer-file-name)))
+		       (setq name (buffer-name)
+			     mode (concat (format-mode-line mode-name nil nil buffer)
+					  (if mode-line-process
+					      (format-mode-line mode-line-process nil nil buffer)))
+			     file (buffer-file-name))
 		       (cond
 			;; Don't mention internal buffers.
 			((and (string= (substring name 0 1) " ") (null file)))
--- a/lisp/composite.el	Mon Sep 06 07:53:44 2004 +0000
+++ b/lisp/composite.el	Fri Sep 10 13:06:10 2004 +0000
@@ -77,12 +77,16 @@
     +----+-----+ <--- new descent
 ")
 
-;; Encode composition rule RULE into an integer value.  RULE is a cons
-;; of global and new reference point symbols.
-;; This must be compatible with C macro COMPOSITION_ENCODE_RULE
-;; defined in composite.h.
 
+;;;###autoload
 (defun encode-composition-rule (rule)
+  "Encode composition rule RULE into an integer value.
+RULE is a cons of global and new reference point symbols
+\(see reference-point-alist)."
+
+  ;; This must be compatible with C macro COMPOSITION_ENCODE_RULE
+  ;; defined in composite.h.
+
   (if (and (integerp rule) (< rule 144))
       ;; Already encoded.
       rule
--- a/lisp/cus-start.el	Mon Sep 06 07:53:44 2004 +0000
+++ b/lisp/cus-start.el	Fri Sep 10 13:06:10 2004 +0000
@@ -168,6 +168,7 @@
 	     (history-length minibuffer
 			     (choice (const :tag "Infinite" t)
 				     integer))
+	     (history-delete-duplicates minibuffer boolean)
 	     (minibuffer-prompt-properties
 	      minibuffer
 	      (list
--- a/lisp/desktop.el	Mon Sep 06 07:53:44 2004 +0000
+++ b/lisp/desktop.el	Fri Sep 10 13:06:10 2004 +0000
@@ -171,13 +171,13 @@
   :type 'hook
   :group 'desktop)
 
-(defcustom desktop-globals-to-save '(
-  desktop-missing-file-warning
-  tags-file-name
-  tags-table-list
-  search-ring
-  regexp-search-ring
-  register-alist)
+(defcustom desktop-globals-to-save
+  '(desktop-missing-file-warning
+    tags-file-name
+    tags-table-list
+    search-ring
+    regexp-search-ring
+    register-alist)
   "List of global variables saved by `desktop-save'.
 An element may be variable name (a symbol) or a cons cell of the form
 \(VAR . MAX-SIZE), which means to truncate VAR's value to at most
@@ -186,13 +186,13 @@
   :type '(repeat (restricted-sexp :match-alternatives (symbolp consp)))
   :group 'desktop)
 
-(defcustom desktop-globals-to-clear '(
-  kill-ring
-  kill-ring-yank-pointer
-  search-ring
-  search-ring-yank-pointer
-  regexp-search-ring
-  regexp-search-ring-yank-pointer)
+(defcustom desktop-globals-to-clear
+  '(kill-ring
+    kill-ring-yank-pointer
+    search-ring
+    search-ring-yank-pointer
+    regexp-search-ring
+    regexp-search-ring-yank-pointer)
   "List of global variables to clear by `desktop-clear'.
 An element may be variable name (a symbol) or a cons cell of the form
 \(VAR . FORM). Symbols are set to nil and for cons cells VAR is set
@@ -202,29 +202,27 @@
 
 (defcustom desktop-clear-preserve-buffers-regexp
   "^\\(\\*scratch\\*\\|\\*Messages\\*\\|\\*tramp/.+\\*\\)$"
-  "Regexp identifying buffers that `desktop-clear' should not delete."
+  "Regexp identifying buffers that `desktop-clear' should not delete.
+See also `desktop-clear-preserve-buffers'."
   :type 'regexp
   :group 'desktop)
 
-;; Maintained for backward compatibility
 (defcustom desktop-clear-preserve-buffers nil
   "*List of buffer names that `desktop-clear' should not delete.
-This variable is maintained for backward compatibility only."
+See also `desktop-clear-preserve-buffers-regexp'."
   :type '(repeat string)
   :group 'desktop)
-(make-obsolete-variable 'desktop-clear-preserve-buffers
-                        'desktop-clear-preserve-buffers-regexp)
 
-(defcustom desktop-locals-to-save '(
-  desktop-locals-to-save  ; Itself!  Think it over.
-  truncate-lines
-  case-fold-search
-  case-replace
-  fill-column
-  overwrite-mode
-  change-log-default-name
-  line-number-mode
-  buffer-file-coding-system)
+(defcustom desktop-locals-to-save
+  '(desktop-locals-to-save  ; Itself!  Think it over.
+    truncate-lines
+    case-fold-search
+    case-replace
+    fill-column
+    overwrite-mode
+    change-log-default-name
+    line-number-mode
+    buffer-file-coding-system)
   "List of local variables to save for each buffer.
 The variables are saved only when they really are local."
   :type '(repeat symbol)
@@ -282,11 +280,11 @@
 (make-obsolete-variable 'desktop-buffer-misc-functions
                         'desktop-save-buffer)
 
-(defcustom desktop-buffer-mode-handlers '(
-  (dired-mode . dired-restore-desktop-buffer)
-  (rmail-mode . rmail-restore-desktop-buffer)
-  (mh-folder-mode . mh-restore-desktop-buffer)
-  (Info-mode . Info-restore-desktop-buffer))
+(defcustom desktop-buffer-mode-handlers
+  '((dired-mode . dired-restore-desktop-buffer)
+    (rmail-mode . rmail-restore-desktop-buffer)
+    (mh-folder-mode . mh-restore-desktop-buffer)
+    (Info-mode . Info-restore-desktop-buffer))
   "Alist of major mode specific functions to restore a desktop buffer.
 Functions are called by `desktop-read'. List elements must have the form
 \(MAJOR-MODE . RESTORE-BUFFER-FUNCTION).
@@ -580,8 +578,7 @@
     (let ((filename (expand-file-name desktop-base-file-name dirname))
           (info
             (mapcar
-              (function
-                (lambda (b)
+              #'(lambda (b)
                   (set-buffer b)
                   (list
                     (desktop-file-name (buffer-file-name) dirname)
@@ -618,7 +615,7 @@
                             (when (member (car locals) loclist)
                               (setq ll (cons (car locals) ll)))))
                         (setq locals (cdr locals)))
-                      ll))))
+                      ll)))
               (buffer-list)))
           (buf (get-buffer-create "*desktop*")))
       (set-buffer buf)
@@ -639,19 +636,15 @@
           " kill-ring))\n"))
 
       (insert "\n;; Buffer section -- buffers listed in same order as in buffer list:\n")
-      (mapcar
-        (function
-          (lambda (l)
-            (if (apply 'desktop-save-buffer-p l)
-              (progn
-                (insert "(desktop-create-buffer " desktop-file-version)
-                (mapcar
-                  (function
-                    (lambda (e)
-                      (insert "\n  " (desktop-value-to-string e))))
-                  l)
-                (insert ")\n\n")))))
-        info)
+      (mapcar #'(lambda (l)
+                  (if (apply 'desktop-save-buffer-p l)
+                      (progn
+                        (insert "(desktop-create-buffer " desktop-file-version)
+                        (mapcar #'(lambda (e)
+                                    (insert "\n  " (desktop-value-to-string e)))
+                                l)
+                        (insert ")\n\n"))))
+              info)
       (setq default-directory dirname)
       (when (file-exists-p filename) (delete-file filename))
       (let ((coding-system-for-write 'emacs-mule))
@@ -816,18 +809,18 @@
    (defvar desktop-first-buffer) ;; Dynamically bound in `desktop-read'
 )
 
-(defun desktop-create-buffer (
-  desktop-file-version
-  desktop-buffer-file-name
-  desktop-buffer-name
-  desktop-buffer-major-mode
-  desktop-buffer-minor-modes
-  desktop-buffer-point
-  desktop-buffer-mark
-  desktop-buffer-read-only
-  desktop-buffer-misc
-  &optional
-  desktop-buffer-locals)
+(defun desktop-create-buffer
+  (desktop-file-version
+   desktop-buffer-file-name
+   desktop-buffer-name
+   desktop-buffer-major-mode
+   desktop-buffer-minor-modes
+   desktop-buffer-point
+   desktop-buffer-mark
+   desktop-buffer-read-only
+   desktop-buffer-misc
+   &optional
+   desktop-buffer-locals)
   ;; Just to silence the byte compiler. Bound locally in `desktop-read'.
   (eval-when-compile
     (defvar desktop-buffer-ok-count)
@@ -835,21 +828,21 @@
   ;; To make desktop files with relative file names possible, we cannot
   ;; allow `default-directory' to change. Therefore we save current buffer.
   (save-current-buffer
-    (let (
-      (buffer-list (buffer-list))
-      (result
-         (condition-case err
-             (funcall (or (cdr (assq desktop-buffer-major-mode desktop-buffer-mode-handlers))
-                          'desktop-restore-file-buffer)
-                      desktop-buffer-file-name
-                      desktop-buffer-name
-                      desktop-buffer-misc)
-           (error
-             (message "Desktop: Can't load buffer %s: %s"
-                      desktop-buffer-name (error-message-string err))
-             (when desktop-missing-file-warning (sit-for 1))
-             nil)))
-    )
+    (let ((buffer-list (buffer-list))
+          (result
+           (condition-case err
+               (funcall (or (cdr (assq desktop-buffer-major-mode
+                                       desktop-buffer-mode-handlers))
+                            'desktop-restore-file-buffer)
+                        desktop-buffer-file-name
+                        desktop-buffer-name
+                        desktop-buffer-misc)
+             (error
+              (message "Desktop: Can't load buffer %s: %s"
+                       desktop-buffer-name
+                       (error-message-string err))
+              (when desktop-missing-file-warning (sit-for 1))
+              nil))))
       (if (bufferp result)
           (setq desktop-buffer-ok-count (1+ desktop-buffer-ok-count))
         (setq desktop-buffer-fail-count (1+ desktop-buffer-fail-count))
@@ -867,17 +860,14 @@
         (unless (equal (buffer-name) desktop-buffer-name)
           (rename-buffer desktop-buffer-name))
         ;; minor modes
-        (cond (
-          ;; backwards compatible
-          (equal '(t) desktop-buffer-minor-modes)
-          (auto-fill-mode 1))(
-          (equal '(nil) desktop-buffer-minor-modes)
-          (auto-fill-mode 0))(
-          t
-          (mapcar
-            #'(lambda (minor-mode)
-              (when (functionp minor-mode) (funcall minor-mode 1)))
-            desktop-buffer-minor-modes)))
+        (cond ((equal '(t) desktop-buffer-minor-modes) ; backwards compatible
+               (auto-fill-mode 1))
+              ((equal '(nil) desktop-buffer-minor-modes) ; backwards compatible
+               (auto-fill-mode 0))
+              (t
+               (mapcar #'(lambda (minor-mode)
+                           (when (functionp minor-mode) (funcall minor-mode 1)))
+                       desktop-buffer-minor-modes)))
         ;; Even though point and mark are non-nil when written by `desktop-save'
         ;; they may be modified by handlers wanting to set point or mark themselves.
         (when desktop-buffer-point
--- a/lisp/diff-mode.el	Mon Sep 06 07:53:44 2004 +0000
+++ b/lisp/diff-mode.el	Fri Sep 10 13:06:10 2004 +0000
@@ -140,7 +140,7 @@
     ("\C-c\C-s" . diff-split-hunk)
     ("\C-c\C-a" . diff-apply-hunk)
     ("\C-c\C-t" . diff-test-hunk)
-    ("\C-c\C-f" . next-error-follow-mode))
+    ("\C-c\C-f" . next-error-follow-minor-mode))
   "Keymap for `diff-mode'.  See also `diff-mode-shared-map'.")
 
 (easy-menu-define diff-mode-menu diff-mode-map
--- a/lisp/emacs-lisp/authors.el	Mon Sep 06 07:53:44 2004 +0000
+++ b/lisp/emacs-lisp/authors.el	Fri Sep 10 13:06:10 2004 +0000
@@ -52,18 +52,23 @@
     ("David Gillespie" "Dave Gillespie")
     ("David K,Ae(Bgedal" "David K..edal")
     ("David M. Koppelman" "David M. Koppelman, Koppel@Ee.Lsu.Edu")
-    ("David M. Smith" "David Smith")
+    ("David M. Smith" "David Smith" "David M Smith")
+    ("Ed L. Cashin" "Ed L Cashin")
     ("Edward M. Reingold" "Ed Reingold" "Edward M Reingold"
      "Reingold Edward M")
     ("Eli Zaretskii" "eliz")
+;    ("Emilio C. Lopes" "Emilio Lopes")
+    ("Era Eriksson" "Era@Iki.Fi")
     ("Eric M. Ludlam" "Eric Ludlam")
     ("Eric S. Raymond" "Eric Raymond")
     ("Eric Youngdale" "(Eric Youngdale at youngdale@v6550c.nrl.navy.mil)")
+    ("Francis J. Wright" "Dr Francis J. Wright" "Francis Wright")
     ("Fran,Ag(Bois Pinard" "Francois Pinard")
     ("Francesco Potort,Al(B" "Francesco Potorti" "Francesco Potorti`")
     ("Frederic Pierresteguy" "Fred Pierresteguy")
     ("Geoff Voelker" "voelker")
     ("Hallvard B. Furuseth" "Hallvard B Furuseth")
+    ("Hrvoje Nik,B9(Bi,Bf(B" "Hrvoje Niksic")
     (nil "(afs@hplb.hpl.hp.com)")
     (nil "<Use-Author-Address-Header@\\[127.1\\]>")
     (nil "Code Extracted")
@@ -71,25 +76,33 @@
     (nil "ISO-2022-JP")
     ("Jaeyoun Chung" "Jae-youn Chung" "Jae-you Chung" "Chung Jae-youn")
     ("Jan Dj,Ad(Brv" "Jan D." "Jan Djarv")
-    ("Jay K. Adams" "jka@ece.cmu.edu")
-    ("Jay R. Adams" "Jay Adams")
+    ("Jay K. Adams" "jka@ece.cmu.edu" "Jay Adams")
+    ("J,Ai(Br,At(Bme Marant" "J,bi(Br,bt(Bme Marant" "Jerome Marant")
     ("Jens-Ulrik Holger Petersen" "Jens-Ulrik Petersen")
     ("Jonathan I. Kamens" "Jonathan Kamens")
     ("Joseph Arceneaux" "Joe Arceneaux")
     ("K. Shane Hartman" "Shane Hartman")
     ("Kai Gro,A_(Bjohann" "Kai Grossjohann" "Kai Gro,b_(Bjohann"
-     "Kai.Grossjohann@Cs.Uni-Dortmund.De")
+     "Kai.Grossjohann@Cs.Uni-Dortmund.De"
+     "Kai.Grossjohann@Gmx.Net")
     ("Karl Berry" "K. Berry")
+    ("Kazushi Marukawa" "Kazushi")
     ("Ken Manheimer" "Kenneth Manheimer")
     ("Kenichi Handa" "Ken'ichi Handa" "Kenichi HANDA")
     ("Kim F. Storm" "Kim Storm")
+    ("Kyle Jones" "Kyle E. Jones")
     ("Marcus G. Daniels" "Marcus Daniels")
+    ("Mark D. Baushke" "Mark D Baushke")
+    ("Martin Lorentzon" "Martin Lorentzson")
+    ("Matt Swift" "Matthew Swift")
     ("Michael D. Ernst" "Michael Ernst")
     ("Michael I. Bushnell" "Michael I Bushnell" "Michael I. Bushnell, P/Bsg")
     ("Paul Eggert" "eggert")
     ("Paul Reilly" "(pmr@legacy.pajato.com)")
-    ("Pavel Jan,Bm(Bk" "Pavel Jan,Am(Bk Ml.")
+    ("Pavel Jan,Bm(Bk" "Pavel Jan,Am(Bk Ml." "Pavel Jan,Am(Bk" "Pavel@Janik.Cz")
     ("Per Abrahamsen" "Per Abhiddenware")
+    ("Peter S. Galbraith" "Peter Galbraith")
+    ("Peter Runestig" "Peter 'luna' Runestig")
     ("Peter S. Galbraith" "Peter S Galbraith")
     ("Richard M. Stallman" "Richard M. Stallman,,," "Richard Stallman"
      "rms" "rms@gnu.org")
@@ -97,9 +110,11 @@
     ("Roland B. Roberts" "Roland B Roberts" "Roland Roberts")
     ("Rui-Tao Dong" "Rui-Tao Dong ~{6-Hpln~}")
     ("Sam Steingold" "Sam Shteingold")
+    ("Stefan Monnier" "Stefan")
     ("Stephen A. Wood" "(saw@cebaf.gov)")
     ("Steven L. Baur" "SL Baur" "Steven L Baur")
     ("Takaaki Ota" "Tak Ota")
+    ("Teodor Zlatanov" "Ted Zlatanov")
     ("Torbj,Av(Brn Axelsson" "Torbjvrn Axelsson")
     ("Torbj,Av(Brn Einarsson" "Torbj.*rn Einarsson")
     ("Toru Tomabechi" "Toru Tomabechi,")
@@ -207,7 +222,7 @@
     ("Frederic Pierresteguy" :wrote "widget.c")
     ("Michael D. Prange" :changed "tex-mode.el")
     ("Paul Reilly" :wrote "gux5-4r2.h" "dgux5-4r3.h")
-    ("Roland B Roberts" :changed "files.el" "sort.el" "vmsproc.el"
+    ("Roland B. Roberts" :changed "files.el" "sort.el" "vmsproc.el"
      "buffer.h" "callproc.c" "dired.c" "process.c" "sysdep.c" "systty.h"
      "vmspaths.h" "build.com" "compile.com" "kepteditor.com" "precomp.com"
      :wrote "logout.com" "mailemacs.com")
@@ -405,11 +420,13 @@
 	  (setq regexps (cdr regexps))))))
   (when author
     (setq author (replace-regexp-in-string "[ \t]*[(<].*$" "" author))
-    (setq author (replace-regexp-in-string "^[ \t]+" "" author))
+    (setq author (replace-regexp-in-string "\`[ \t]+" "" author))
     (setq author (replace-regexp-in-string "[ \t]+$" "" author))
+    (setq author (replace-regexp-in-string "[ \t]+" " " author))
+    (unless (string-match "[-, \t]" author)
+      (setq author ""))
     (capitalize author)))
 
-
 (defun authors-scan-change-log (log-file table)
   "Scan change log LOG-FILE for author information.
 
--- a/lisp/emacs-lisp/autoload.el	Mon Sep 06 07:53:44 2004 +0000
+++ b/lisp/emacs-lisp/autoload.el	Fri Sep 10 13:06:10 2004 +0000
@@ -86,6 +86,7 @@
 
      ;; For special function-like operators, use the `autoload' function.
      ((memq car '(defun define-skeleton defmacro define-derived-mode
+                   define-compilation-mode
 		   define-generic-mode easy-mmode-define-minor-mode
 		   easy-mmode-define-global-mode
 		   define-minor-mode defun* defmacro*))
@@ -94,7 +95,8 @@
 	     (args (case car
 		    ((defun defmacro defun* defmacro*) (nth 2 form))
 		    ((define-skeleton) '(&optional str arg))
-		    ((define-generic-mode define-derived-mode) nil)
+		    ((define-generic-mode define-derived-mode
+                       define-compilation-mode) nil)
 		    (t)))
 	     (body (nthcdr (get car 'doc-string-elt) form))
 	     (doc (if (stringp (car body)) (pop body))))
--- a/lisp/emacs-lisp/bytecomp.el	Mon Sep 06 07:53:44 2004 +0000
+++ b/lisp/emacs-lisp/bytecomp.el	Fri Sep 10 13:06:10 2004 +0000
@@ -354,7 +354,7 @@
 
 (defcustom byte-compile-generate-call-tree nil
   "*Non-nil means collect call-graph information when compiling.
-This records functions were called and from where.
+This records which functions were called and from where.
 If the value is t, compilation displays the call graph when it finishes.
 If the value is neither t nor nil, compilation asks you whether to display
 the graph.
@@ -3878,15 +3878,18 @@
 				 (mapconcat 'symbol-name callers ", ")
 			       "<top level>"))
 	      (let ((fill-prefix "    "))
-		(fill-region-as-paragraph p (point)))))
+		(fill-region-as-paragraph p (point)))
+              (unless (= 0 (current-column))
+                (insert "\n"))))
 	(if calls
 	    (progn
 	      (insert "  calls:\n")
 	      (setq p (point))
 	      (insert "    " (mapconcat 'symbol-name calls ", "))
 	      (let ((fill-prefix "    "))
-		(fill-region-as-paragraph p (point)))))
-	(insert "\n")
+		(fill-region-as-paragraph p (point)))
+              (unless (= 0 (current-column))
+                (insert "\n"))))
 	(setq rest (cdr rest)))
 
       (message "Generating call tree...(finding uncalled functions...)")
--- a/lisp/emacs-lisp/lisp-mode.el	Mon Sep 06 07:53:44 2004 +0000
+++ b/lisp/emacs-lisp/lisp-mode.el	Fri Sep 10 13:06:10 2004 +0000
@@ -129,6 +129,7 @@
 (put 'defsubst 'doc-string-elt 3)
 (put 'define-skeleton 'doc-string-elt 2)
 (put 'define-derived-mode 'doc-string-elt 4)
+(put 'define-compilation-mode 'doc-string-elt 3)
 (put 'easy-mmode-define-minor-mode 'doc-string-elt 2)
 (put 'define-minor-mode 'doc-string-elt 2)
 (put 'define-generic-mode 'doc-string-elt 7)
@@ -489,7 +490,7 @@
 	 (and string
 	      (= (car (read-from-string string)) char)
 	      string))))
-	 
+
 
 (defun eval-last-sexp-1 (eval-last-sexp-arg-internal)
   "Evaluate sexp before point; print value in minibuffer.
--- a/lisp/emulation/cua-rect.el	Mon Sep 06 07:53:44 2004 +0000
+++ b/lisp/emulation/cua-rect.el	Fri Sep 10 13:06:10 2004 +0000
@@ -778,7 +778,6 @@
         '(lambda (s e l r v)
            (let ((rface (if v 'cua-rectangle-face 'cua-rectangle-noselect-face))
                  overlay bs ms as)
-	     (if (= s e) (setq e (1+ e)))
 	     (when (cua--rectangle-virtual-edges)
 	       (let ((lb (line-beginning-position))
 		     (le (line-end-position))
--- a/lisp/format.el	Mon Sep 06 07:53:44 2004 +0000
+++ b/lisp/format.el	Fri Sep 10 13:06:10 2004 +0000
@@ -37,7 +37,7 @@
 ;; change this variable, or use `format-write-file'.
 ;;
 ;; Auto-save files are normally created in the same format as the visited
-;; file, but the variable `auto-save-file-format' can be set to a
+;; file, but the variable `buffer-auto-save-file-format' can be set to a
 ;; particularly fast or otherwise preferred format to be used for
 ;; auto-saving (or nil to do no encoding on auto-save files, but then you
 ;; risk losing any text-properties in the buffer).
@@ -62,6 +62,7 @@
 ;;; Code:
 
 (put 'buffer-file-format 'permanent-local t)
+(put 'buffer-auto-save-file-format 'permanent-local t)
 
 (defvar format-alist
   '((text/enriched "Extended MIME text/enriched format."
--- a/lisp/gnus/ChangeLog	Mon Sep 06 07:53:44 2004 +0000
+++ b/lisp/gnus/ChangeLog	Fri Sep 10 13:06:10 2004 +0000
@@ -1,7 +1,35 @@
+2004-09-08  Reiner Steib  <Reiner.Steib@gmx.de>
+
+	* nntp.el (nntp): New customization group.
+	(nntp-authinfo-file): Added customization group.
+
+	* mml2015.el (mml2015-unabbrev-trust-alist): Added customization
+	group.
+
+	* mml-sec.el (mml-signencrypt-style-alist): Ditto.
+
+	* gnus.el (to-address, to-list, subscribed)
+	(large-newsgroup-initial): Ditto.
+
+	* flow-fill.el (fill-flowed-display-column)
+	(fill-flowed-encode-column): Ditto.
+
+2004-09-06  Stefan  <monnier@iro.umontreal.ca>
+
+	* message.el (message-tokenize-header, message-send-mail-with-qmail):
+	Use point-min rather than 1.
+	(message-send-mail): Use buffer-size rather than point-max.
+
+	* gnus-sum.el (gnus-summary-search-article-forward):
+	Signal a specific `search-failed' rather than a generic `error'.
+
+	* gnus-salt.el (gnus-pick-mouse-pick-region): Switch 1 => point-min.
+	(gnus-generate-vertical-tree): Usue `bobp' rather than compare to 1.
+	(gnus-highlight-selected-tree): Use point-min rather than 1 and 2.
+
 2004-09-03  Katsumi Yamaoka  <yamaoka@jpl.org>
 
-	* gnus-sum.el (gnus-summary-insert-subject): Remove list
-	identifiers.
+	* gnus-sum.el (gnus-summary-insert-subject): Remove list identifiers.
 
 	From Hiroshi Fujishima <pooh@nature.tsukuba.ac.jp> (tiny change).
 	* spam-stat.el (spam-stat-reduce-size): Set spam-stat-dirty.
--- a/lisp/gnus/flow-fill.el	Mon Sep 06 07:53:44 2004 +0000
+++ b/lisp/gnus/flow-fill.el	Fri Sep 10 13:06:10 2004 +0000
@@ -56,6 +56,7 @@
 (defcustom fill-flowed-display-column 'fill-column
   "Column beyond which format=flowed lines are wrapped, when displayed.
 This can be a Lisp expression or an integer."
+  :group 'mime-display
   :type '(choice (const :tag "Standard `fill-column'" fill-column)
 		 (const :tag "Fit Window" (- (window-width) 5))
 		 (sexp)
@@ -65,6 +66,7 @@
   "Column beyond which format=flowed lines are wrapped, in outgoing messages.
 This can be a Lisp expression or an integer.
 RFC 2646 suggests 66 characters for readability."
+  :group 'mime-display
   :type '(choice (const :tag "Standard fill-column" fill-column)
 		 (const :tag "RFC 2646 default (66)" 66)
 		 (sexp)
--- a/lisp/gnus/gnus-salt.el	Mon Sep 06 07:53:44 2004 +0000
+++ b/lisp/gnus/gnus-salt.el	Fri Sep 10 13:06:10 2004 +0000
@@ -230,7 +230,7 @@
   (let* ((echo-keystrokes 0)
 	 (start-posn (event-start start-event))
 	 (start-point (posn-point start-posn))
-	 (start-line (1+ (count-lines 1 start-point)))
+         (start-line (1+ (count-lines (point-min) start-point)))
 	 (start-window (posn-window start-posn))
 	 (bounds (gnus-window-edges start-window))
 	 (top (nth 1 bounds))
@@ -266,17 +266,18 @@
 	     ;; Are we moving within the original window?
 	     ((and (eq (posn-window end) start-window)
 		   (integer-or-marker-p end-point))
-	;; Go to START-POINT first, so that when we move to END-POINT,
+	      ;; Go to START-POINT first, so that when we move to END-POINT,
 	      ;; if it's in the middle of intangible text,
 	      ;; point jumps in the direction away from START-POINT.
 	      (goto-char start-point)
 	      (goto-char end-point)
 	      (gnus-pick-article)
 	      ;; In case the user moved his mouse really fast, pick
-	    ;; articles on the line between this one and the last one.
-	      (let* ((this-line (1+ (count-lines 1 end-point)))
+	      ;; articles on the line between this one and the last one.
+	      (let* ((this-line (1+ (count-lines (point-min) end-point)))
 		     (min-line (min this-line start-line))
 		     (max-line (max this-line start-line)))
+		;; Why not use `forward-line'?  --Stef
 		(while (< min-line max-line)
 		  (goto-line min-line)
 		  (gnus-pick-article)
@@ -787,7 +788,7 @@
 	  (setq beg (point))
 	  (forward-char -1)
 	  ;; Draw "-" lines leftwards.
-	  (while (and (> (point) 1)
+	  (while (and (not (bobp))
 		      (eq (char-after (1- (point))) ? ))
 	    (delete-char -1)
 	    (insert (car gnus-tree-parent-child-edges))
@@ -858,7 +859,8 @@
 		(gnus-extent-detached-p gnus-selected-tree-overlay))
 	;; Create a new overlay.
 	(gnus-overlay-put
-	 (setq gnus-selected-tree-overlay (gnus-make-overlay 1 2))
+	 (setq gnus-selected-tree-overlay
+	       (gnus-make-overlay (point-min) (1+ (point-min))))
 	 'face gnus-selected-tree-face))
       ;; Move the overlay to the article.
       (gnus-move-overlay
@@ -1062,5 +1064,5 @@
 
 (provide 'gnus-salt)
 
-;;; arch-tag: 35449164-77b3-4398-bcbd-a2e3e998f810
+;; arch-tag: 35449164-77b3-4398-bcbd-a2e3e998f810
 ;;; gnus-salt.el ends here
--- a/lisp/gnus/gnus-sum.el	Mon Sep 06 07:53:44 2004 +0000
+++ b/lisp/gnus/gnus-sum.el	Fri Sep 10 13:06:10 2004 +0000
@@ -8341,7 +8341,7 @@
   (let ((gnus-last-article gnus-last-article))
     (if (gnus-summary-search-article regexp backward)
 	(gnus-summary-show-thread)
-      (error "Search failed: \"%s\"" regexp))))
+      (signal 'search-failed (list regexp)))))
 
 (defun gnus-summary-search-article-backward (regexp)
   "Search for an article containing REGEXP backward."
--- a/lisp/gnus/gnus.el	Mon Sep 06 07:53:44 2004 +0000
+++ b/lisp/gnus/gnus.el	Fri Sep 10 13:06:10 2004 +0000
@@ -1599,6 +1599,7 @@
  "Return GROUP's to-address."
  :variable-document
  "*Alist of group regexps and correspondent to-addresses."
+ :variable-group gnus-group-parameter
  :parameter-type '(gnus-email-address :tag "To Address")
  :parameter-document "\
 This will be used when doing followups and posts.
@@ -1625,6 +1626,7 @@
  "Return GROUP's to-list."
  :variable-document
  "*Alist of group regexps and correspondent to-lists."
+ :variable-group gnus-group-parameter
  :parameter-type '(gnus-email-address :tag "To List")
  :parameter-document "\
 This address will be used when doing a `a' in the group.
@@ -1643,6 +1645,7 @@
  "Return GROUP's subscription status."
  :variable-document
  "*Groups which are automatically considered subscribed."
+ :variable-group gnus-group-parameter
  :parameter-type '(const :tag "Subscribed" t)
  :parameter-document "\
 Gnus assumed that you are subscribed to the To/List address.
@@ -1749,6 +1752,7 @@
  "Return GROUP's initial input of the number of articles."
  :variable-document
  "*Alist of group regexps and its initial input of the number of articles."
+ :variable-group gnus-group-parameter
  :parameter-type '(choice :tag "Initial Input for Large Newsgroup"
 			  (const :tag "All" nil)
 			  (integer))
--- a/lisp/gnus/message.el	Mon Sep 06 07:53:44 2004 +0000
+++ b/lisp/gnus/message.el	Fri Sep 10 13:06:10 2004 +0000
@@ -1588,7 +1588,7 @@
   (if (not header)
       nil
     (let ((regexp (format "[%s]+" (or separator ",")))
-	  (beg 1)
+	  (beg (point-min))
 	  (first t)
 	  quoted elems paren)
       (with-temp-buffer
@@ -3722,13 +3722,13 @@
 				   "content-transfer-encoding")))))))
 	    (message-insert-courtesy-copy))
 	  (if (or (not message-send-mail-partially-limit)
-		  (< (point-max) message-send-mail-partially-limit)
+		  (< (buffer-size) message-send-mail-partially-limit)
 		  (not (message-y-or-n-p
 			"The message size is too large, split? "
 			t
 			"\
 The message size, "
-			(/ (point-max) 1000) "KB, is too large.
+			(/ (buffer-size) 1000) "KB, is too large.
 
 Some mail gateways (MTA's) bounce large messages.  To avoid the
 problem, answer `y', and the message will be split into several
@@ -3839,8 +3839,8 @@
   (case
       (let ((coding-system-for-write message-send-coding-system))
 	(apply
-	 'call-process-region 1 (point-max) message-qmail-inject-program
-	 nil nil nil
+	 'call-process-region (point-min) (point-max)
+	 message-qmail-inject-program nil nil nil
 	 ;; qmail-inject's default behaviour is to look for addresses on the
 	 ;; command line; if there're none, it scans the headers.
 	 ;; yes, it does The Right Thing w.r.t. Resent-To and it's kin.
--- a/lisp/gnus/mml-sec.el	Mon Sep 06 07:53:44 2004 +0000
+++ b/lisp/gnus/mml-sec.el	Fri Sep 10 13:06:10 2004 +0000
@@ -83,6 +83,7 @@
 understood by all PGP implementations, in particular PGP version
 2 does not support it!  See Info node `(message)Security' for
 details."
+  :group 'message
   :type '(repeat (list (choice (const :tag "S/MIME" "smime")
 			       (const :tag "PGP" "pgp")
 			       (const :tag "PGP/MIME" "pgpmime")
--- a/lisp/gnus/mml2015.el	Mon Sep 06 07:53:44 2004 +0000
+++ b/lisp/gnus/mml2015.el	Fri Sep 10 13:06:10 2004 +0000
@@ -83,6 +83,7 @@
     ("TRUST_FULLY"     . t)
     ("TRUST_ULTIMATE"  . t))
   "Map GnuPG trust output values to a boolean saying if you trust the key."
+  :group 'mime-security
   :type '(repeat (cons (regexp :tag "GnuPG output regexp")
 		       (boolean :tag "Trust key"))))
 
--- a/lisp/gnus/nntp.el	Mon Sep 06 07:53:44 2004 +0000
+++ b/lisp/gnus/nntp.el	Fri Sep 10 13:06:10 2004 +0000
@@ -34,6 +34,10 @@
 
 (eval-when-compile (require 'cl))
 
+(defgroup nntp nil
+  "NNTP access for Gnus."
+  :group 'gnus)
+
 (defvoo nntp-address nil
   "Address of the physical nntp server.")
 
@@ -182,6 +186,7 @@
 
 (defcustom nntp-authinfo-file "~/.authinfo"
   ".netrc-like file that holds nntp authinfo passwords."
+  :group 'nntp
   :type
   '(choice file
 	   (repeat :tag "Entries"
--- a/lisp/info.el	Mon Sep 06 07:53:44 2004 +0000
+++ b/lisp/info.el	Fri Sep 10 13:06:10 2004 +0000
@@ -1062,8 +1062,8 @@
 	  ;; into the menu in the like-named node in the main buffer.
 	  (apply 'insert-buffer-substring (cdr node))))
       (Info-dir-remove-duplicates)
-      ;; Kill all the buffers we just made.
-      (mapc 'kill-buffer buffers)
+      ;; Kill all the buffers we just made, including the special one excised.
+      (mapc 'kill-buffer (cons buffer buffers))
       (goto-char (point-min))
       (if problems
 	  (message "Composing main Info directory...problems encountered, see `*Messages*'")
--- a/lisp/isearch.el	Mon Sep 06 07:53:44 2004 +0000
+++ b/lisp/isearch.el	Fri Sep 10 13:06:10 2004 +0000
@@ -2402,7 +2402,17 @@
                 (let ((mb (match-beginning 0))
                       (me (match-end 0)))
                   (if (= mb me)      ;zero-length match
-                      (forward-char 1)
+		      (if isearch-forward
+			  (if (= mb (if isearch-lazy-highlight-wrapped
+					isearch-lazy-highlight-start
+				      (window-end)))
+			      (setq found nil)
+			    (forward-char 1))
+			(if (= mb (if isearch-lazy-highlight-wrapped
+				      isearch-lazy-highlight-end
+				    (window-start)))
+			    (setq found nil)
+			  (forward-char -1)))
 
                     ;; non-zero-length match
                     (let ((ov (make-overlay mb me)))
@@ -2412,19 +2422,20 @@
                       (push ov isearch-lazy-highlight-overlays)))
                   (if isearch-forward
                       (setq isearch-lazy-highlight-end (point))
-                    (setq isearch-lazy-highlight-start (point))))
+                    (setq isearch-lazy-highlight-start (point)))))
 
-              ;; not found
-              (if isearch-lazy-highlight-wrapped
-                  (setq looping nil
-                        nomore  t)
-                (setq isearch-lazy-highlight-wrapped t)
-                (if isearch-forward
-                    (progn
-                      (setq isearch-lazy-highlight-end (window-start))
-                      (goto-char (window-start)))
-                  (setq isearch-lazy-highlight-start (window-end))
-                  (goto-char (window-end)))))))
+	    ;; not found or zero-length match at the search bound
+	    (if (not found)
+		(if isearch-lazy-highlight-wrapped
+		    (setq looping nil
+			  nomore  t)
+		  (setq isearch-lazy-highlight-wrapped t)
+		  (if isearch-forward
+		      (progn
+			(setq isearch-lazy-highlight-end (window-start))
+			(goto-char (window-start)))
+		    (setq isearch-lazy-highlight-start (window-end))
+		    (goto-char (window-end)))))))
         (unless nomore
           (setq isearch-lazy-highlight-timer
                 (run-at-time isearch-lazy-highlight-interval nil
--- a/lisp/kmacro.el	Mon Sep 06 07:53:44 2004 +0000
+++ b/lisp/kmacro.el	Fri Sep 10 13:06:10 2004 +0000
@@ -204,7 +204,7 @@
 
     ;; naming and binding
     (define-key map "b"    'kmacro-bind-to-key)
-    (define-key map "n"    'name-last-kbd-macro)
+    (define-key map "n"    'kmacro-name-last-macro)
     map)
   "Keymap for keyboard macro commands.")
 (defalias 'kmacro-keymap kmacro-keymap)
@@ -539,8 +539,8 @@
 The commands are recorded even as they are executed.
 Use \\[kmacro-end-macro] to finish recording and make the macro available.
 Use \\[kmacro-end-and-call-macro] to execute the macro.
-Use \\[name-last-kbd-macro] to give it a permanent name.
-Non-nil arg (prefix arg) means append to last macro defined;
+
+Non-nil arg (prefix arg) means append to last macro defined.
 
 With \\[universal-argument] prefix, append to last keyboard macro
 defined.  Depending on `kmacro-execute-before-append', this may begin
@@ -551,7 +551,10 @@
 
 Use \\[kmacro-insert-counter] to insert (and increment) the macro counter.
 The counter value can be set or modified via \\[kmacro-set-counter] and \\[kmacro-add-counter].
-The format of the counter can be modified via \\[kmacro-set-format]."
+The format of the counter can be modified via \\[kmacro-set-format].
+
+Use \\[kmacro-name-last-macro] to give it a permanent name.
+Use \\[kmacro-bind-to-key] to bind it to a key sequence."
   (interactive "P")
   (if (or defining-kbd-macro executing-kbd-macro)
       (message "Already defining keyboard macro.")
@@ -585,7 +588,7 @@
   "Finish defining a keyboard macro.
 The definition was started by \\[kmacro-start-macro].
 The macro is now available for use via \\[kmacro-call-macro],
-or it can be given a name with \\[name-last-kbd-macro] and then invoked
+or it can be given a name with \\[kmacro-name-last-macro] and then invoked
 under that name.
 
 With numeric arg, repeat macro now that many times,
@@ -609,7 +612,7 @@
 for details on how to adjust or disable this behaviour.
 
 To make a macro permanent so you can call it even after defining
-others, use \\[name-last-kbd-macro]."
+others, use \\[kmacro-name-last-macro]."
   (interactive "p")
   (let ((repeat-key (and (null no-repeat)
 			 (> (length (this-single-command-keys)) 1)
@@ -707,7 +710,7 @@
 Zero argument means repeat until there is an error.
 
 To give a macro a permanent name, so you can call it
-even after defining other macros, use \\[name-last-kbd-macro]."
+even after defining other macros, use \\[kmacro-name-last-macro]."
   (interactive "P")
   (if defining-kbd-macro
       (kmacro-end-macro nil))
@@ -771,10 +774,38 @@
 		     (yes-or-no-p (format "%s runs command %S.  Bind anyway? "
 					  (format-kbd-macro key-seq)
 					  cmd))))
-	(define-key global-map key-seq last-kbd-macro)
+	(define-key global-map key-seq
+	  `(lambda (&optional arg)
+	     "Keyboard macro."
+	     (interactive "p")
+	     (kmacro-exec-ring-item ',(kmacro-ring-head) arg)))
 	(message "Keyboard macro bound to %s" (format-kbd-macro key-seq))))))
 
 
+(defun kmacro-name-last-macro (symbol)
+  "Assign a name to the last keyboard macro defined.
+Argument SYMBOL is the name to define.
+The symbol's function definition becomes the keyboard macro string.
+Such a \"function\" cannot be called from Lisp, but it is a valid editor command."
+  (interactive "SName for last kbd macro: ")
+  (or last-kbd-macro
+      (error "No keyboard macro defined"))
+  (and (fboundp symbol)
+       (not (get symbol 'kmacro))
+       (not (stringp (symbol-function symbol)))
+       (not (vectorp (symbol-function symbol)))
+       (error "Function %s is already defined and not a keyboard macro"
+	      symbol))
+  (if (string-equal symbol "")
+      (error "No command name given"))
+  (fset symbol
+	`(lambda (&optional arg)
+	   "Keyboard macro."
+	   (interactive "p")
+	   (kmacro-exec-ring-item ',(kmacro-ring-head) arg)))
+  (put symbol 'kmacro t))
+
+
 (defun kmacro-view-macro (&optional arg)
   "Display the last keyboard macro.
 If repeated, it shows previous elements in the macro ring."
--- a/lisp/mh-e/ChangeLog	Mon Sep 06 07:53:44 2004 +0000
+++ b/lisp/mh-e/ChangeLog	Fri Sep 10 13:06:10 2004 +0000
@@ -1,16 +1,20 @@
+2004-09-07  Stefan  <monnier@iro.umontreal.ca>
+
+	* mh-inc.el (mh-inc-spool-list): Correctly declare the external var.
+
 2004-08-21  Bill Wohler  <wohler@newt.com>
 
 	* Released MH-E version 7.82.
-     
+
 	* MH-E-NEWS, README: Updated for release 7.82.
-     
-	* mh-e.el (Version, mh-version): Updated for release 7.82.
+
+	* mh-e.el (Version, mh-version): Update for release 7.82.
 
 2004-08-24  Bill Wohler  <wohler@newt.com>
 
-	* mh-init.el (mh-variant-set): Changed MH to mh as that's what is
+	* mh-init.el (mh-variant-set): Change MH to mh as that's what is
 	emitted by `mh-variant-mh-info' (closes SF #1014781).
-	(mh-variant-p): Added mu-mh to docstring.
+	(mh-variant-p): Add mu-mh to docstring.
 
 2004-08-23  Satyaki Das  <satyaki@theforce.stanford.edu>
 
@@ -31,21 +35,21 @@
 
 2004-08-21  Bill Wohler  <wohler@newt.com>
 
-	* mh-e.el (Version, mh-version): Added +cvs to release number.
+	* mh-e.el (Version, mh-version): Add +cvs to release number.
 
 2004-08-21  Bill Wohler  <wohler@newt.com>
 
 	* Released MH-E version 7.81.
-     
+
 	* MH-E-NEWS, README: Updated for release 7.81.
-     
-	* mh-e.el (Version, mh-version): Updated for release 7.81.
+
+	* mh-e.el (Version, mh-version): Update for release 7.81.
 
 2004-08-21  Bill Wohler  <wohler@newt.com>
 
 	* release-utils (variable_changes): Check for checked-out
-	directory before proceeding. Remove temporary files. Renamed
-	--variable-update flag to --variable-changes.
+	directory before proceeding.  Remove temporary files.
+	Rename --variable-update flag to --variable-changes.
 
 2004-08-16  Mark D. Baushke  <mdb@gnu.org>
 
--- a/lisp/mh-e/mh-inc.el	Mon Sep 06 07:53:44 2004 +0000
+++ b/lisp/mh-e/mh-inc.el	Fri Sep 10 13:06:10 2004 +0000
@@ -74,7 +74,7 @@
                                         "] inc " folder " folder\n"))))
 
 ;; Avoid compiler warning
-(eval-when-compile (defvar mh-inc-spool-list))
+(defvar mh-inc-spool-list)
 
 (defun mh-inc-spool-make ()
   "Make all commands and defines keys for contents of `mh-inc-spool-list'."
@@ -98,10 +98,10 @@
 
 (provide 'mh-inc)
 
-;;; Local Variables:
-;;; indent-tabs-mode: nil
-;;; sentence-end-double-space: nil
-;;; End:
+;; Local Variables:
+;; indent-tabs-mode: nil
+;; sentence-end-double-space: nil
+;; End:
 
-;;; arch-tag: 3713cf2a-6082-4cb4-8ce2-99d9acaba835
+;; arch-tag: 3713cf2a-6082-4cb4-8ce2-99d9acaba835
 ;;; mh-inc.el ends here
--- a/lisp/newcomment.el	Mon Sep 06 07:53:44 2004 +0000
+++ b/lisp/newcomment.el	Fri Sep 10 13:06:10 2004 +0000
@@ -1,6 +1,6 @@
 ;;; newcomment.el --- (un)comment regions of buffers
 
-;; Copyright (C) 1999,2000,2003,2004  Free Software Foundation Inc.
+;; Copyright (C) 1999, 2000, 2003, 2004  Free Software Foundation Inc.
 
 ;; Author: code extracted from Emacs-20's simple.el
 ;; Maintainer: Stefan Monnier <monnier@cs.yale.edu>
@@ -137,7 +137,7 @@
 Applicable at least in modes for languages like fixed-format Fortran where
 comments always start in column zero.")
 
-(defvar comment-region-function nil
+(defvar comment-region-function 'comment-region-default
   "Function to comment a region.
 Its args are the same as those of `comment-region', but BEG and END are
 guaranteed to be correctly ordered.  It is called within `save-excursion'.
@@ -145,7 +145,7 @@
 Applicable at least in modes for languages like fixed-format Fortran where
 comments always start in column zero.")
 
-(defvar uncomment-region-function nil
+(defvar uncomment-region-function 'uncomment-region-default
   "Function to uncomment a region.
 Its args are the same as those of `uncomment-region', but BEG and END are
 guaranteed to be correctly ordered.  It is called within `save-excursion'.
@@ -368,12 +368,12 @@
 				  (if comment-use-global-state (syntax-ppss pt))
 				  t)))
       (when (and (nth 8 s) (nth 3 s) (not comment-use-global-state))
-	  ;; The search ended inside a string.  Try to see if it
-	  ;; works better when we assume that pt is inside a string.
-	  (setq s (parse-partial-sexp
-		   pt (or limit (point-max)) nil nil
-		   (list nil nil nil (nth 3 s) nil nil nil nil)
-		   t)))
+	;; The search ended at eol inside a string.  Try to see if it
+	;; works better when we assume that pt is inside a string.
+	(setq s (parse-partial-sexp
+		 pt (or limit (point-max)) nil nil
+		 (list nil nil nil (nth 3 s) nil nil nil nil)
+		 t)))
       (if (not (and (nth 8 s) (not (nth 3 s))))
 	  (unless noerror (error "No comment"))
 	;; We found the comment.
@@ -710,105 +710,108 @@
   (interactive "*r\nP")
   (comment-normalize-vars)
   (when (> beg end) (setq beg (prog1 end (setq end beg))))
-
-  ;; Bind `comment-use-global-state' to nil. While uncommenting a
-  ;; (which works a line at a time) region a comment can appear to be
+  ;; Bind `comment-use-global-state' to nil.  While uncommenting a region
+  ;; (which works a line at a time), a comment can appear to be
   ;; included in a mult-line string, but it is actually not.
   (let ((comment-use-global-state nil))
     (save-excursion
-      (if uncomment-region-function
-	  (funcall uncomment-region-function beg end arg)
-	(goto-char beg)
-	(setq end (copy-marker end))
-	(let* ((numarg (prefix-numeric-value arg))
-	       (ccs comment-continue)
-	       (srei (comment-padright ccs 're))
-	       (csre (comment-padright comment-start 're))
-	       (sre (and srei (concat "^\\s-*?\\(" srei "\\)")))
-	       spt)
-	  (while (and (< (point) end)
-		      (setq spt (comment-search-forward end t)))
-	    (let ((ipt (point))
-		  ;; Find the end of the comment.
-		  (ept (progn
-			 (goto-char spt)
-			 (unless (or (comment-forward)
-				     ;; Allow non-terminated comments.
-				     (eobp))
-			   (error "Can't find the comment end"))
-			 (point)))
-		  (box nil)
-		  (box-equal nil)) ;Whether we might be using `=' for boxes.
-	      (save-restriction
-		(narrow-to-region spt ept)
+      (funcall uncomment-region-function beg end arg))))
+
+(defun uncomment-region-default (beg end &optional arg)
+  "Uncomment each line in the BEG .. END region.
+The numeric prefix ARG can specify a number of chars to remove from the
+comment markers."
+  (goto-char beg)
+  (setq end (copy-marker end))
+  (let* ((numarg (prefix-numeric-value arg))
+	 (ccs comment-continue)
+	 (srei (comment-padright ccs 're))
+	 (csre (comment-padright comment-start 're))
+	 (sre (and srei (concat "^\\s-*?\\(" srei "\\)")))
+	 spt)
+    (while (and (< (point) end)
+		(setq spt (comment-search-forward end t)))
+      (let ((ipt (point))
+	    ;; Find the end of the comment.
+	    (ept (progn
+		   (goto-char spt)
+		   (unless (or (comment-forward)
+			       ;; Allow non-terminated comments.
+			       (eobp))
+		     (error "Can't find the comment end"))
+		   (point)))
+	    (box nil)
+	    (box-equal nil))	   ;Whether we might be using `=' for boxes.
+	(save-restriction
+	  (narrow-to-region spt ept)
 		
-		;; Remove the comment-start.
-		(goto-char ipt)
-		(skip-syntax-backward " ")
-		;; A box-comment starts with a looong comment-start marker.
-		(when (and (or (and (= (- (point) (point-min)) 1)
-				    (setq box-equal t)
-				    (looking-at "=\\{7\\}")
-				    (not (eq (char-before (point-max)) ?\n))
-				    (skip-chars-forward "="))
-			       (> (- (point) (point-min) (length comment-start)) 7))
-			   (> (count-lines (point-min) (point-max)) 2))
-		  (setq box t))
-		;; Skip the padding.  Padding can come from comment-padding and/or
-		;; from comment-start, so we first check comment-start.
-		(if (or (save-excursion (goto-char (point-min)) (looking-at csre))
-			(looking-at (regexp-quote comment-padding)))
-		    (goto-char (match-end 0)))
-		(when (and sre (looking-at (concat "\\s-*\n\\s-*" srei)))
-		  (goto-char (match-end 0)))
-		(if (null arg) (delete-region (point-min) (point))
-		  (skip-syntax-backward " ")
-		  (delete-char (- numarg))
-		  (unless (or (bobp)
-			      (save-excursion (goto-char (point-min))
-					      (looking-at comment-start-skip)))
-		    ;; If there's something left but it doesn't look like
-		    ;; a comment-start any more, just remove it.
-		    (delete-region (point-min) (point))))
+	  ;; Remove the comment-start.
+	  (goto-char ipt)
+	  (skip-syntax-backward " ")
+	  ;; A box-comment starts with a looong comment-start marker.
+	  (when (and (or (and (= (- (point) (point-min)) 1)
+			      (setq box-equal t)
+			      (looking-at "=\\{7\\}")
+			      (not (eq (char-before (point-max)) ?\n))
+			      (skip-chars-forward "="))
+			 (> (- (point) (point-min) (length comment-start)) 7))
+		     (> (count-lines (point-min) (point-max)) 2))
+	    (setq box t))
+	  ;; Skip the padding.  Padding can come from comment-padding and/or
+	  ;; from comment-start, so we first check comment-start.
+	  (if (or (save-excursion (goto-char (point-min)) (looking-at csre))
+		  (looking-at (regexp-quote comment-padding)))
+	      (goto-char (match-end 0)))
+	  (when (and sre (looking-at (concat "\\s-*\n\\s-*" srei)))
+	    (goto-char (match-end 0)))
+	  (if (null arg) (delete-region (point-min) (point))
+	    (skip-syntax-backward " ")
+	    (delete-char (- numarg))
+	    (unless (or (bobp)
+			(save-excursion (goto-char (point-min))
+					(looking-at comment-start-skip)))
+	      ;; If there's something left but it doesn't look like
+	      ;; a comment-start any more, just remove it.
+	      (delete-region (point-min) (point))))
 		
-		;; Remove the end-comment (and leading padding and such).
-		(goto-char (point-max)) (comment-enter-backward)
-		;; Check for special `=' used sometimes in comment-box.
-		(when (and box-equal (not (eq (char-before (point-max)) ?\n)))
-		  (let ((pos (point)))
-		    ;; skip `=' but only if there are at least 7.
-		    (when (> (skip-chars-backward "=") -7) (goto-char pos))))
-		(unless (looking-at "\\(\n\\|\\s-\\)*\\'")
-		  (when (and (bolp) (not (bobp))) (backward-char))
-		  (if (null arg) (delete-region (point) (point-max))
-		    (skip-syntax-forward " ")
-		    (delete-char numarg)
-		    (unless (or (eobp) (looking-at comment-end-skip))
-		      ;; If there's something left but it doesn't look like
-		      ;; a comment-end any more, just remove it.
-		      (delete-region (point) (point-max)))))
+	  ;; Remove the end-comment (and leading padding and such).
+	  (goto-char (point-max)) (comment-enter-backward)
+	  ;; Check for special `=' used sometimes in comment-box.
+	  (when (and box-equal (not (eq (char-before (point-max)) ?\n)))
+	    (let ((pos (point)))
+	      ;; skip `=' but only if there are at least 7.
+	      (when (> (skip-chars-backward "=") -7) (goto-char pos))))
+	  (unless (looking-at "\\(\n\\|\\s-\\)*\\'")
+	    (when (and (bolp) (not (bobp))) (backward-char))
+	    (if (null arg) (delete-region (point) (point-max))
+	      (skip-syntax-forward " ")
+	      (delete-char numarg)
+	      (unless (or (eobp) (looking-at comment-end-skip))
+		;; If there's something left but it doesn't look like
+		;; a comment-end any more, just remove it.
+		(delete-region (point) (point-max)))))
 
-		;; Unquote any nested end-comment.
-		(comment-quote-nested comment-start comment-end t)
+	  ;; Unquote any nested end-comment.
+	  (comment-quote-nested comment-start comment-end t)
 
-		;; Eliminate continuation markers as well.
-		(when sre
-		  (let* ((cce (comment-string-reverse (or comment-continue
-							  comment-start)))
-			 (erei (and box (comment-padleft cce 're)))
-			 (ere (and erei (concat "\\(" erei "\\)\\s-*$"))))
-		    (goto-char (point-min))
-		    (while (progn
-			     (if (and ere (re-search-forward
-					   ere (line-end-position) t))
-				 (replace-match "" t t nil (if (match-end 2) 2 1))
-			       (setq ere nil))
-			     (forward-line 1)
-			     (re-search-forward sre (line-end-position) t))
-		      (replace-match "" t t nil (if (match-end 2) 2 1)))))
-		;; Go to the end for the next comment.
-		(goto-char (point-max)))))))
-      (set-marker end nil))))
+	  ;; Eliminate continuation markers as well.
+	  (when sre
+	    (let* ((cce (comment-string-reverse (or comment-continue
+						    comment-start)))
+		   (erei (and box (comment-padleft cce 're)))
+		   (ere (and erei (concat "\\(" erei "\\)\\s-*$"))))
+	      (goto-char (point-min))
+	      (while (progn
+		       (if (and ere (re-search-forward
+				     ere (line-end-position) t))
+			   (replace-match "" t t nil (if (match-end 2) 2 1))
+			 (setq ere nil))
+		       (forward-line 1)
+		       (re-search-forward sre (line-end-position) t))
+		(replace-match "" t t nil (if (match-end 2) 2 1)))))
+	  ;; Go to the end for the next comment.
+	  (goto-char (point-max))))))
+  (set-marker end nil))
 
 (defun comment-make-extra-lines (cs ce ccs cce min-indent max-indent &optional block)
   "Make the leading and trailing extra lines.
@@ -971,59 +974,61 @@
   (interactive "*r\nP")
   (comment-normalize-vars)
   (if (> beg end) (let (mid) (setq mid beg beg end end mid)))
+  (save-excursion
+    ;; FIXME: maybe we should call uncomment depending on ARG.
+    (funcall comment-region-function beg end arg)))
+
+(defun comment-region-default (beg end &optional arg)
   (let* ((numarg (prefix-numeric-value arg))
 	 (add comment-add)
 	 (style (cdr (assoc comment-style comment-styles)))
 	 (lines (nth 2 style))
 	 (block (nth 1 style))
 	 (multi (nth 0 style)))
-    (save-excursion
-      (if comment-region-function
-	  (funcall comment-region-function beg end arg)
-	;; we use `chars' instead of `syntax' because `\n' might be
-	;; of end-comment syntax rather than of whitespace syntax.
-	;; sanitize BEG and END
-	(goto-char beg) (skip-chars-forward " \t\n\r") (beginning-of-line)
-	(setq beg (max beg (point)))
-	(goto-char end) (skip-chars-backward " \t\n\r") (end-of-line)
-	(setq end (min end (point)))
-	(if (>= beg end) (error "Nothing to comment"))
+    ;; we use `chars' instead of `syntax' because `\n' might be
+    ;; of end-comment syntax rather than of whitespace syntax.
+    ;; sanitize BEG and END
+    (goto-char beg) (skip-chars-forward " \t\n\r") (beginning-of-line)
+    (setq beg (max beg (point)))
+    (goto-char end) (skip-chars-backward " \t\n\r") (end-of-line)
+    (setq end (min end (point)))
+    (if (>= beg end) (error "Nothing to comment"))
 
-	;; sanitize LINES
-	(setq lines
-	      (and
-	       lines ;; multi
-	       (progn (goto-char beg) (beginning-of-line)
-		      (skip-syntax-forward " ")
-		      (>= (point) beg))
-	       (progn (goto-char end) (end-of-line) (skip-syntax-backward " ")
-		      (<= (point) end))
-	       (or block (not (string= "" comment-end)))
-	       (or block (progn (goto-char beg) (search-forward "\n" end t))))))
+    ;; sanitize LINES
+    (setq lines
+	  (and
+	   lines ;; multi
+	   (progn (goto-char beg) (beginning-of-line)
+		  (skip-syntax-forward " ")
+		  (>= (point) beg))
+	   (progn (goto-char end) (end-of-line) (skip-syntax-backward " ")
+		  (<= (point) end))
+	   (or block (not (string= "" comment-end)))
+	   (or block (progn (goto-char beg) (search-forward "\n" end t)))))
 
-      ;; don't add end-markers just because the user asked for `block'
-      (unless (or lines (string= "" comment-end)) (setq block nil))
+    ;; don't add end-markers just because the user asked for `block'
+    (unless (or lines (string= "" comment-end)) (setq block nil))
 
-      (cond
-       ((consp arg) (uncomment-region beg end))
-       ((< numarg 0) (uncomment-region beg end (- numarg)))
-       (t
-	(setq numarg (if (and (null arg) (= (length comment-start) 1))
-			 add (1- numarg)))
-	(comment-region-internal
-	 beg end
-	 (let ((s (comment-padright comment-start numarg)))
-	   (if (string-match comment-start-skip s) s
-	     (comment-padright comment-start)))
-	 (let ((s (comment-padleft comment-end numarg)))
-	   (and s (if (string-match comment-end-skip s) s
-		    (comment-padright comment-end))))
-	 (if multi (comment-padright comment-continue numarg))
-	 (if multi
-	     (comment-padleft (comment-string-reverse comment-continue) numarg))
-	 block
-	 lines
-	 (nth 3 style)))))))
+    (cond
+     ((consp arg) (uncomment-region beg end))
+     ((< numarg 0) (uncomment-region beg end (- numarg)))
+     (t
+      (setq numarg (if (and (null arg) (= (length comment-start) 1))
+		       add (1- numarg)))
+      (comment-region-internal
+       beg end
+       (let ((s (comment-padright comment-start numarg)))
+	 (if (string-match comment-start-skip s) s
+	   (comment-padright comment-start)))
+       (let ((s (comment-padleft comment-end numarg)))
+	 (and s (if (string-match comment-end-skip s) s
+		  (comment-padright comment-end))))
+       (if multi (comment-padright comment-continue numarg))
+       (if multi
+	   (comment-padleft (comment-string-reverse comment-continue) numarg))
+       block
+       lines
+       (nth 3 style))))))
 
 (defun comment-box (beg end &optional arg)
   "Comment out the BEG .. END region, putting it inside a box.
@@ -1198,5 +1203,5 @@
 
 (provide 'newcomment)
 
-;;; arch-tag: 01e3320a-00c8-44ea-a696-8f8e7354c858
+;; arch-tag: 01e3320a-00c8-44ea-a696-8f8e7354c858
 ;;; newcomment.el ends here
--- a/lisp/pcvs-info.el	Mon Sep 06 07:53:44 2004 +0000
+++ b/lisp/pcvs-info.el	Fri Sep 10 13:06:10 2004 +0000
@@ -1,7 +1,7 @@
 ;;; pcvs-info.el --- internal representation of a fileinfo entry
 
-;; Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2004
-;;           Free Software Foundation, Inc.
+;; Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+;;   2000, 2004  Free Software Foundation, Inc.
 
 ;; Author: Stefan Monnier <monnier@cs.yale.edu>
 ;; Keywords: pcl-cvs
@@ -274,7 +274,7 @@
 ;;;;
 
 (defconst cvs-states
-  `((NEED-UPDATE	update diff)
+  `((NEED-UPDATE	update diff ignore)
     (UP-TO-DATE		update nil remove diff safe-rm revert)
     (MODIFIED		update commit undo remove diff merge diff-base)
     (ADDED		update commit remove)
@@ -471,5 +471,5 @@
 
 (provide 'pcvs-info)
 
-;;; arch-tag: d85dde07-bdc2-400a-882f-92f398c7b0ba
+;; arch-tag: d85dde07-bdc2-400a-882f-92f398c7b0ba
 ;;; pcvs-info.el ends here
--- a/lisp/pcvs-util.el	Mon Sep 06 07:53:44 2004 +0000
+++ b/lisp/pcvs-util.el	Fri Sep 10 13:06:10 2004 +0000
@@ -1,7 +1,7 @@
 ;;; pcvs-util.el --- utility functions for PCL-CVS  -*- byte-compile-dynamic: t -*-
 
-;; Copyright (C) 1991,92,93,94,95,96,97,98,99, 2000,01,04
-;;  Free Software Foundation, Inc.
+;; Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+;;   2000, 2001, 2004  Free Software Foundation, Inc.
 
 ;; Author: Stefan Monnier <monnier@cs.yale.edu>
 ;; Keywords: pcl-cvs
@@ -180,9 +180,7 @@
 
 (defun cvs-string-prefix-p (str1 str2)
   "Tell whether STR1 is a prefix of STR2."
-  (let ((length1 (length str1)))
-    (and (>= (length str2) length1)
-	 (string= str1 (substring str2 0 length1)))))
+  (eq t (compare-strings str2 nil (length str1) str1 nil nil)))
 
 ;; (string->strings (strings->string X)) == X
 (defun cvs-strings->string (strings &optional separator)
@@ -392,5 +390,5 @@
 
 (provide 'pcvs-util)
 
-;;; arch-tag: 3b2588bb-2ae3-4f1f-bf5b-dea91b1f8a59
+;; arch-tag: 3b2588bb-2ae3-4f1f-bf5b-dea91b1f8a59
 ;;; pcvs-util.el ends here
--- a/lisp/play/blackbox.el	Mon Sep 06 07:53:44 2004 +0000
+++ b/lisp/play/blackbox.el	Fri Sep 10 13:06:10 2004 +0000
@@ -335,34 +335,35 @@
       (bb-update-board (propertize "O" 'help-echo "Placed ball"))))))
 
 (defun bb-trace-ray (x y)
-  (let ((result (bb-trace-ray-2
-		 t
-		 x
-		 (cond
-		  ((= x -1) 1)
-		  ((= x 8) -1)
-		  (t 0))
-		 y
-		 (cond
-		  ((= y -1) 1)
-		  ((= y 8) -1)
-		  (t 0)))))
-    (cond
-     ((eq result 'hit)
-      (bb-update-board (propertize "H" 'help-echo "Hit"))
-      (setq bb-score (1+ bb-score)))
-     ((equal result (cons x y))
-      (bb-update-board (propertize "R" 'help-echo "Reflection"))
-      (setq bb-score (1+ bb-score)))
-     (t
-      (setq bb-detour-count (1+ bb-detour-count))
-      (bb-update-board (propertize (format "%d" bb-detour-count)
-				   'help-echo "Detour"))
-      (save-excursion
-	(bb-goto result)
-	(bb-update-board (propertize (format "%d" bb-detour-count)
-				     'help-echo "Detour")))
-      (setq bb-score (+ bb-score 2))))))
+  (when (= (following-char) 32)
+    (let ((result (bb-trace-ray-2
+                   t
+                   x
+                   (cond
+                    ((= x -1) 1)
+                    ((= x 8) -1)
+                    (t 0))
+                   y
+                   (cond
+                    ((= y -1) 1)
+                    ((= y 8) -1)
+                    (t 0)))))
+      (cond
+       ((eq result 'hit)
+        (bb-update-board (propertize "H" 'help-echo "Hit"))
+        (setq bb-score (1+ bb-score)))
+       ((equal result (cons x y))
+        (bb-update-board (propertize "R" 'help-echo "Reflection"))
+        (setq bb-score (1+ bb-score)))
+       (t
+        (setq bb-detour-count (1+ bb-detour-count))
+        (bb-update-board (propertize (format "%d" bb-detour-count)
+                                     'help-echo "Detour"))
+        (save-excursion
+          (bb-goto result)
+          (bb-update-board (propertize (format "%d" bb-detour-count)
+                                       'help-echo "Detour")))
+        (setq bb-score (+ bb-score 2)))))))
 
 (defun bb-trace-ray-2 (first x dx y dy)
   (cond
--- a/lisp/progmodes/compile.el	Mon Sep 06 07:53:44 2004 +0000
+++ b/lisp/progmodes/compile.el	Fri Sep 10 13:06:10 2004 +0000
@@ -878,7 +878,7 @@
 	  ;; Set the EMACS variable, but
 	  ;; don't override users' setting of $EMACS.
 	  (unless (getenv "EMACS") '("EMACS=t"))
-	  process-environment))
+	  (copy-sequence process-environment)))
 	(thisdir default-directory)
 	outwin outbuf)
     (with-current-buffer
@@ -1059,7 +1059,7 @@
     (set-keymap-parent map compilation-minor-mode-map)
     (define-key map " " 'scroll-up)
     (define-key map "\^?" 'scroll-down)
-    (define-key map "\C-c\C-f" 'next-error-follow-mode)
+    (define-key map "\C-c\C-f" 'next-error-follow-minor-mode)
 
     ;; Set up the menu-bar
     (define-key map [menu-bar compilation]
--- a/lisp/progmodes/grep.el	Mon Sep 06 07:53:44 2004 +0000
+++ b/lisp/progmodes/grep.el	Fri Sep 10 13:06:10 2004 +0000
@@ -64,8 +64,8 @@
   :version "21.4"
   :group 'grep)
 
-(defcustom grep-highlight-matches t
-  "*Non-nil to use special markers to highlight grep matches.
+(defcustom grep-highlight-matches 'auto-detect
+  "If t, use special markers to highlight grep matches.
 
 Some grep programs are able to surround matches with special
 markers in grep output.  Such markers can be used to highlight
@@ -74,8 +74,13 @@
 This option sets the environment variable GREP_COLOR to specify
 markers for highlighting and GREP_OPTIONS to add the --color
 option in front of any explicit grep options before starting
-the grep."
-  :type 'boolean
+the grep.
+
+The default value of this variable is set up by `grep-compute-defaults';
+call that function before using this variable in your program."
+  :type '(choice (const :tag "Do not highlight matches with grep markers" nil)
+		 (const :tag "Highlight matches with grep markers" t)
+		 (other :tag "Not Set" auto-detect))
   :version "21.4"
   :group 'grep)
 
@@ -110,7 +115,6 @@
 
 The default value of this variable is set up by `grep-compute-defaults';
 call that function before using this variable in your program."
-  :type 'boolean
   :type '(choice (const :tag "Do Not Append Null Device" nil)
 		 (const :tag "Append Null Device" t)
 		 (other :tag "Not Set" auto-detect))
@@ -181,7 +185,7 @@
   (let ((map (cons 'keymap compilation-minor-mode-map)))
     (define-key map " " 'scroll-up)
     (define-key map "\^?" 'scroll-down)
-    (define-key map "\C-c\C-f" 'next-error-follow-mode)
+    (define-key map "\C-c\C-f" 'next-error-follow-minor-mode)
 
     ;; This is intolerable -- rms
 ;;;    (define-key map [remap next-line] 'compilation-next-error)
@@ -333,7 +337,9 @@
 (defun grep-process-setup ()
   "Setup compilation variables and buffer for `grep'.
 Set up `compilation-exit-message-function' and run `grep-setup-hook'."
-  (when grep-highlight-matches
+  (unless (or (not grep-highlight-matches) (eq grep-highlight-matches t))
+    (grep-compute-defaults))
+  (when (eq grep-highlight-matches t)
     ;; Modify `process-environment' locally bound in `compilation-start'
     (setenv "GREP_OPTIONS" (concat (getenv "GREP_OPTIONS") " --color=always"))
     (setenv "GREP_COLOR" "01;41"))
@@ -415,7 +421,18 @@
 		   (format "%s <D> <X> -type f <F> -print | xargs %s <R>"
 			   find-program gcmd))
 		  (t (format "%s <D> <X> -type f <F> -exec %s <R> {} %s \\;"
-			     find-program gcmd null-device)))))))
+			     find-program gcmd null-device))))))
+  (unless (or (not grep-highlight-matches) (eq grep-highlight-matches t))
+    (setq grep-highlight-matches
+	  (with-temp-buffer
+	    (and (equal (condition-case nil
+			    (call-process grep-program nil t nil "--help")
+			  (error nil))
+			0)
+		 (progn
+		   (goto-char (point-min))
+		   (search-forward "--color" nil t))
+		 t)))))
 
 (defun grep-default-command ()
   (let ((tag-default
@@ -483,7 +500,6 @@
 			 command-args)
 		       'grep-mode nil highlight-regexp)))
 
-;;;###autoload (autoload 'grep-mode "grep" nil t)
 (define-compilation-mode grep-mode "Grep"
   "Sets `grep-last-buffer' and `compilation-window-height'."
   (setq grep-last-buffer (current-buffer))
@@ -599,5 +615,5 @@
 
 (provide 'grep)
 
-;;; arch-tag: 5a5b9169-a79d-4f38-9c38-f69615f39c4d
+;; arch-tag: 5a5b9169-a79d-4f38-9c38-f69615f39c4d
 ;;; grep.el ends here
--- a/lisp/ps-mule.el	Mon Sep 06 07:53:44 2004 +0000
+++ b/lisp/ps-mule.el	Fri Sep 10 13:06:10 2004 +0000
@@ -418,21 +418,21 @@
 
 (defun ps-mule-encode-bit (string delta)
   (let* ((dim (charset-dimension (char-charset (string-to-char string))))
-	 (len (* (ps-mule-chars-in-string string) dim))
+	 (len (* (length string) dim))
 	 (str (make-string len 0))
 	 (i 0)
 	 (j 0))
     (if (= dim 1)
 	(while (< j len)
 	  (aset str j
-		(+ (nth 1 (split-char (ps-mule-string-char string i))) delta))
-	  (setq i (ps-mule-next-index string i)
+		(+ (nth 1 (split-char (aref string i))) delta))
+	  (setq i (1+ i)
 		j (1+ j)))
       (while (< j len)
-	(let ((split (split-char (ps-mule-string-char string i))))
+	(let ((split (split-char (aref string i))))
 	  (aset str j (+ (nth 1 split) delta))
 	  (aset str (1+ j) (+ (nth 2 split) delta))
-	  (setq i (ps-mule-next-index string i)
+	  (setq i (1+ i)
 		j (+ j 2)))))
     str))
 
@@ -468,13 +468,13 @@
 
 ;; Special encoding for mule-unicode-* characters.
 (defun ps-mule-encode-ucs2 (string)
-  (let* ((len (ps-mule-chars-in-string string))
+  (let* ((len (length string))
 	 (str (make-string (* 2 len) 0))
 	 (i 0)
 	 (j 0)
 	 ch hi lo)
     (while (< i len)
-      (setq ch (encode-char (ps-mule-string-char string i) 'ucs)
+      (setq ch (encode-char (aref string i) 'ucs)
 	    hi (lsh ch -8)
 	    lo (logand ch 255))
       (aset str j hi)
@@ -796,7 +796,7 @@
 	    (cons from ps-width-remaining)
 	  (cons (if composition
 		    (nth 1 composition)
-		  (ps-mule-next-point from))
+		  (1+ from))
 		run-width)))
     ;; We assume that all characters in this range have the same width.
     (setq char-width (* char-width (charset-width ps-mule-current-charset)))
@@ -849,7 +849,7 @@
 
      ;; This case is obsolete for Emacs 21.
      ((eq ps-mule-current-charset 'composition)
-      (ps-mule-plot-composition from (ps-mule-next-point from) bg-color))
+      (ps-mule-plot-composition from (1+ from) bg-color))
 
      (t
       ;; No way to print this charset.  Just show a vacant box of an
--- a/lisp/replace.el	Mon Sep 06 07:53:44 2004 +0000
+++ b/lisp/replace.el	Fri Sep 10 13:06:10 2004 +0000
@@ -618,7 +618,7 @@
     (define-key map "g" 'revert-buffer)
     (define-key map "q" 'quit-window)
     (define-key map "z" 'kill-this-buffer)
-    (define-key map "\C-c\C-f" 'next-error-follow-mode)
+    (define-key map "\C-c\C-f" 'next-error-follow-minor-mode)
     map)
   "Keymap for `occur-mode'.")
 
@@ -1393,7 +1393,9 @@
 		  ;; Bind message-log-max so we don't fill up the message log
 		  ;; with a bunch of identical messages.
 		  (let ((message-log-max nil))
-		    (message message from-string next-replacement))
+		    (message message
+                             (query-replace-descr from-string)
+                             (query-replace-descr next-replacement)))
 		  (setq key (read-event))
 		  ;; Necessary in case something happens during read-event
 		  ;; that clobbers the match data.
--- a/lisp/simple.el	Mon Sep 06 07:53:44 2004 +0000
+++ b/lisp/simple.el	Fri Sep 10 13:06:10 2004 +0000
@@ -259,7 +259,7 @@
 buffer causes automatic display of the corresponding source code
 location."
   nil " Fol" nil
-  (if (not next-error-follow-mode)
+  (if (not next-error-follow-minor-mode)
       (remove-hook 'post-command-hook 'next-error-follow-mode-post-command-hook t)
     (add-hook 'post-command-hook 'next-error-follow-mode-post-command-hook nil t)
     (make-variable-buffer-local 'next-error-follow-last-line)))
--- a/lisp/startup.el	Mon Sep 06 07:53:44 2004 +0000
+++ b/lisp/startup.el	Fri Sep 10 13:06:10 2004 +0000
@@ -1485,12 +1485,19 @@
           (file-count 0)
           first-file-buffer
           tem
-          ;; The directories listed in --directory/-L options will *appear*
-          ;; at the front of `load-path' in the order they appear on the
-          ;; command-line.  We cannot do this by *placing* them at the front
-          ;; in the order they appear, so we need this variable to hold them,
-          ;; temporarily.
-          extra-load-path
+          ;; This approach loses for "-batch -L DIR --eval "(require foo)",
+          ;; if foo is intended to be found in DIR.
+          ;;
+          ;; ;; The directories listed in --directory/-L options will *appear*
+          ;; ;; at the front of `load-path' in the order they appear on the
+          ;; ;; command-line.  We cannot do this by *placing* them at the front
+          ;; ;; in the order they appear, so we need this variable to hold them,
+          ;; ;; temporarily.
+          ;; extra-load-path
+          ;;
+          ;; To DTRT we keep track of the splice point and modify `load-path'
+          ;; straight away upon any --directory/-L option.
+          splice
           just-files ;; t if this follows the magic -- option.
           ;; This includes our standard options' long versions
           ;; and long versions of what's on command-switch-alist.
@@ -1559,15 +1566,15 @@
 
                 ((member argi '("-eval" "-execute"))
                  (eval (read (or argval (pop command-line-args-left)))))
-                ;; Set the default directory as specified in -L.
 
                 ((member argi '("-L" "-directory"))
-                 (setq tem (or argval (pop command-line-args-left)))
-                 ;; We will reverse `extra-load-path' and prepend it to
-                 ;; `load-path' after all the arguments have been processed.
-                 (push
-                  (expand-file-name (command-line-normalize-file-name tem))
-                  extra-load-path))
+                 (setq tem (expand-file-name
+                            (command-line-normalize-file-name
+                             (or argval (pop command-line-args-left)))))
+                 (cond (splice (setcdr splice (cons tem (cdr splice)))
+                               (setq splice (cdr splice)))
+                       (t (setq load-path (cons tem load-path)
+                                splice load-path))))
 
                 ((member argi '("-l" "-load"))
                  (let* ((file (command-line-normalize-file-name
@@ -1648,10 +1655,6 @@
                            (move-to-column (1- column)))
                          (setq column 0))))))))
 
-      ;; See --directory/-L option above.
-      (when extra-load-path
-        (setq load-path (append (nreverse extra-load-path) load-path)))
-
       ;; If 3 or more files visited, and not all visible,
       ;; show user what they all are.  But leave the last one current.
       (and (> file-count 2)
--- a/lisp/subr.el	Mon Sep 06 07:53:44 2004 +0000
+++ b/lisp/subr.el	Fri Sep 10 13:06:10 2004 +0000
@@ -2127,7 +2127,7 @@
 ;; expression leads to the equivalent implementation that if SEPARATORS
 ;; is defaulted, OMIT-NULLS is treated as t.
 (defun split-string (string &optional separators omit-nulls)
-  "Splits STRING into substrings bounded by matches for SEPARATORS.
+  "Split STRING into substrings bounded by matches for SEPARATORS.
 
 The beginning and end of STRING, and each match for SEPARATORS, are
 splitting points.  The substrings matching SEPARATORS are removed, and
--- a/lisp/term.el	Mon Sep 06 07:53:44 2004 +0000
+++ b/lisp/term.el	Fri Sep 10 13:06:10 2004 +0000
@@ -925,7 +925,7 @@
 (defun term-window-width ()
   (if (featurep 'xemacs)
       (1- (window-width))
-    (if window-system
+    (if (and window-system overflow-newline-into-fringe)
 	(window-width)
       (1- (window-width)))))
 
@@ -988,8 +988,6 @@
   (make-local-variable 'term-width)
   (setq term-width (term-window-width))
   (setq term-height (1- (window-height)))
-  (term-ifnot-xemacs
-   (set (make-local-variable 'overflow-newline-into-fringe) nil))
   (make-local-variable 'term-terminal-parameter)
   (make-local-variable 'term-saved-cursor)
   (make-local-variable 'term-last-input-start)
--- a/lisp/term/xterm.el	Mon Sep 06 07:53:44 2004 +0000
+++ b/lisp/term/xterm.el	Fri Sep 10 13:06:10 2004 +0000
@@ -1,6 +1,6 @@
 ;;; xterm.el --- define function key sequences and standard colors for xterm
 
-;; Copyright (C) 1995, 2002 Free Software Foundation, Inc.
+;; Copyright (C) 1995, 2002, 2004  Free Software Foundation, Inc.
 
 ;; Author: FSF
 ;; Keywords: terminals
@@ -53,6 +53,16 @@
   (define-key map "\e[24~" [f12])
   (define-key map "\e[29~" [print])
 
+  (define-key map "\e[1;2A" [S-up])
+  (define-key map "\e[1;2B" [S-down])
+  (define-key map "\e[1;2C" [S-right])
+  (define-key map "\e[1;2D" [S-left])
+
+  (define-key map "\e[1;5A" [C-up])
+  (define-key map "\e[1;5B" [C-down])
+  (define-key map "\e[1;5C" [C-right])
+  (define-key map "\e[1;5D" [C-left])
+
   (define-key map "\e[2;2~" [S-insert])
   (define-key map "\e[3;2~" [S-delete])
   (define-key map "\e[5;2~" [S-prior])
@@ -238,5 +248,5 @@
 ;; This recomputes all the default faces given the colors we've just set up.
 (tty-set-up-initial-frame-faces)
 
-;;; arch-tag: 12e7ebdd-1e6c-4b25-b0f9-35ace25e855a
+;; arch-tag: 12e7ebdd-1e6c-4b25-b0f9-35ace25e855a
 ;;; xterm.el ends here
--- a/lisp/vc-arch.el	Mon Sep 06 07:53:44 2004 +0000
+++ b/lisp/vc-arch.el	Fri Sep 10 13:06:10 2004 +0000
@@ -1,6 +1,7 @@
 ;;; vc-arch.el --- VC backend for the Arch version-control system
 
-;; Copyright (C) 1995,98,99,2000,01,02,03,2004  Free Software Foundation, Inc.
+;; Copyright (C) 1995, 1998, 1999, 2000, 2001, 2002, 2003, 2004
+;;           Free Software Foundation, Inc.
 
 ;; Author:      FSF (see vc.el for full credits)
 ;; Maintainer:  Stefan Monnier <monnier@gnu.org>
@@ -253,9 +254,13 @@
 	(with-current-buffer (find-file-noselect sigfile)
 	  (goto-char (point-min))
 	  (while (and (search-forward id nil 'move)
-		      (progn (goto-char (- (match-beginning 0) 2))
-			     ;; Ignore E_ entries used for foo.id files.
-			     (or (not (bolp)) (looking-at "E_")))))
+		      (save-excursion
+			(goto-char (- (match-beginning 0) 2))
+			;; For `names', the lines start with `?./foo/bar'.
+			;; For others there's 2 chars before the ./foo/bar.
+			(or (not (or (bolp) (looking-at "\n?")))
+			    ;; Ignore E_ entries used for foo.id files.
+			    (looking-at "E_")))))
 	  (if (eobp)
 	      ;; ID not found.
 	      (if (equal (file-name-nondirectory sigfile)
@@ -303,7 +308,9 @@
 		   (or (not sealed) (eq (aref file 0) ?v))
 		   (>= tmp rev-nb))
 	      (setq rev-nb tmp rev file)))
-	(concat defbranch "--" rev)))))
+	;; Use "none-000" if the tree hasn't yet been committed on the
+	;; default branch.  We'll then get "Arch:000[branch]" on the mode-line.
+	(concat defbranch "--" (or rev "none-000"))))))
 
 
 (defcustom vc-arch-mode-line-rewrite
@@ -418,5 +425,5 @@
 
 (provide 'vc-arch)
 
-;;; arch-tag: a35c7c1c-5237-429d-88ef-3d718fd2e704
+;; arch-tag: a35c7c1c-5237-429d-88ef-3d718fd2e704
 ;;; vc-arch.el ends here
--- a/lisp/vc-rcs.el	Mon Sep 06 07:53:44 2004 +0000
+++ b/lisp/vc-rcs.el	Fri Sep 10 13:06:10 2004 +0000
@@ -1,6 +1,7 @@
 ;;; vc-rcs.el --- support for RCS version-control
 
-;; Copyright (C) 1992,93,94,95,96,97,98,99,2000,2001  Free Software Foundation, Inc.
+;; Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+;;   2000, 2001, 2004  Free Software Foundation, Inc.
 
 ;; Author:     FSF (see vc.el for full credits)
 ;; Maintainer: Andre Spiegel <spiegel@gnu.org>
@@ -208,7 +209,7 @@
                (vc-file-getprop file 'vc-checkout-model)))))
 
 (defun vc-rcs-workfile-unchanged-p (file)
-  "RCS-specific implementation of vc-workfile-unchanged-p."
+  "RCS-specific implementation of `vc-workfile-unchanged-p'."
   ;; Try to use rcsdiff --brief.  If rcsdiff does not understand that,
   ;; do a double take and remember the fact for the future
   (let* ((version (concat "-r" (vc-workfile-version file)))
@@ -786,5 +787,5 @@
 
 (provide 'vc-rcs)
 
-;;; arch-tag: 759b4916-5b0d-431d-b647-b185b8c652cf
+;; arch-tag: 759b4916-5b0d-431d-b647-b185b8c652cf
 ;;; vc-rcs.el ends here
--- a/lisp/vc-sccs.el	Mon Sep 06 07:53:44 2004 +0000
+++ b/lisp/vc-sccs.el	Fri Sep 10 13:06:10 2004 +0000
@@ -1,6 +1,7 @@
 ;;; vc-sccs.el --- support for SCCS version-control
 
-;; Copyright (C) 1992,93,94,95,96,97,98,99,2000,2001 Free Software Foundation, Inc.
+;; Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+;;   2000, 2001, 2004  Free Software Foundation, Inc.
 
 ;; Author:     FSF (see vc.el for full credits)
 ;; Maintainer: Andre Spiegel <spiegel@gnu.org>
@@ -150,7 +151,7 @@
   'locking)
 
 (defun vc-sccs-workfile-unchanged-p (file)
-  "SCCS-specific implementation of vc-workfile-unchanged-p."
+  "SCCS-specific implementation of `vc-workfile-unchanged-p'."
   (zerop (apply 'vc-do-command nil 1 "vcdiff" (vc-name file)
                 (list "--brief" "-q"
                       (concat "-r" (vc-workfile-version file))))))
@@ -397,5 +398,5 @@
 
 (provide 'vc-sccs)
 
-;;; arch-tag: d751dee3-d7b3-47e1-95e3-7ae98c052041
+;; arch-tag: d751dee3-d7b3-47e1-95e3-7ae98c052041
 ;;; vc-sccs.el ends here
--- a/lisp/vc.el	Mon Sep 06 07:53:44 2004 +0000
+++ b/lisp/vc.el	Fri Sep 10 13:06:10 2004 +0000
@@ -1,7 +1,7 @@
 ;;; vc.el --- drive a version-control system from within Emacs
 
-;; Copyright (C) 1992,93,94,95,96,97,98,2000,01,2003,2004
-;;           Free Software Foundation, Inc.
+;; Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998,
+;;   2000, 2001, 2003, 2004  Free Software Foundation, Inc.
 
 ;; Author:     FSF (see below for full credits)
 ;; Maintainer: Andre Spiegel <spiegel@gnu.org>
@@ -394,7 +394,7 @@
 ;;
 ;;   Return the hostname that the backend will have to contact
 ;;   in order to operate on a file in DIRNAME.  If the return value
-;;   is nil, it is means that the repository is local.
+;;   is nil, it means that the repository is local.
 ;;   This function is used in `vc-stay-local-p' which backends can use
 ;;   for their convenience.
 ;;
@@ -1017,28 +1017,32 @@
 			   (vc-position-context (mark-marker))))
 	;; Make the right thing happen in transient-mark-mode.
 	(mark-active nil)
-	;; We may want to reparse the compilation buffer after revert
-	(reparse (and (boundp 'compilation-error-list) ;compile loaded
-		      ;; Construct a list; each elt is nil or a buffer
-		      ;; iff that buffer is a compilation output buffer
-		      ;; that contains markers into the current buffer.
-		      (save-current-buffer
-			(mapcar (lambda (buffer)
-				  (set-buffer buffer)
-				  (let ((errors (or
-						 compilation-old-error-list
-						 compilation-error-list))
-					(buffer-error-marked-p nil))
-				    (while (and (consp errors)
-						(not buffer-error-marked-p))
-				      (and (markerp (cdr (car errors)))
-					   (eq buffer
-					       (marker-buffer
-						(cdr (car errors))))
-					   (setq buffer-error-marked-p t))
-				      (setq errors (cdr errors)))
-				    (if buffer-error-marked-p buffer)))
-				(buffer-list))))))
+	;; The new compilation code does not use compilation-error-list any
+	;; more, so the code below is now ineffective and might as well
+	;; be disabled.  -- Stef
+	;; ;; We may want to reparse the compilation buffer after revert
+	;; (reparse (and (boundp 'compilation-error-list) ;compile loaded
+	;; 	      ;; Construct a list; each elt is nil or a buffer
+	;; 	      ;; iff that buffer is a compilation output buffer
+	;; 	      ;; that contains markers into the current buffer.
+	;; 	      (save-current-buffer
+	;; 		(mapcar (lambda (buffer)
+	;; 			  (set-buffer buffer)
+	;; 			  (let ((errors (or
+	;; 					 compilation-old-error-list
+	;; 					 compilation-error-list))
+	;; 				(buffer-error-marked-p nil))
+	;; 			    (while (and (consp errors)
+	;; 					(not buffer-error-marked-p))
+	;; 			      (and (markerp (cdr (car errors)))
+	;; 				   (eq buffer
+	;; 				       (marker-buffer
+	;; 					(cdr (car errors))))
+	;; 				   (setq buffer-error-marked-p t))
+	;; 			      (setq errors (cdr errors)))
+	;; 			    (if buffer-error-marked-p buffer)))
+	;; 			(buffer-list)))))
+	(reparse nil))
     (list point-context mark-context reparse)))
 
 (defun vc-restore-buffer-context (context)
@@ -1047,23 +1051,26 @@
   (let ((point-context (nth 0 context))
 	(mark-context (nth 1 context))
 	(reparse (nth 2 context)))
-    ;; Reparse affected compilation buffers.
-    (while reparse
-      (if (car reparse)
-	  (with-current-buffer (car reparse)
-	    (let ((compilation-last-buffer (current-buffer)) ;select buffer
-		  ;; Record the position in the compilation buffer of
-		  ;; the last error next-error went to.
-		  (error-pos (marker-position
-			      (car (car-safe compilation-error-list)))))
-	      ;; Reparse the error messages as far as they were parsed before.
-	      (compile-reinitialize-errors '(4) compilation-parsing-end)
-	      ;; Move the pointer up to find the error we were at before
-	      ;; reparsing.  Now next-error should properly go to the next one.
-	      (while (and compilation-error-list
-			  (/= error-pos (car (car compilation-error-list))))
-		(setq compilation-error-list (cdr compilation-error-list))))))
-      (setq reparse (cdr reparse)))
+    ;; The new compilation code does not use compilation-error-list any
+    ;; more, so the code below is now ineffective and might as well
+    ;; be disabled.  -- Stef
+    ;; ;; Reparse affected compilation buffers.
+    ;; (while reparse
+    ;;   (if (car reparse)
+    ;; 	  (with-current-buffer (car reparse)
+    ;; 	    (let ((compilation-last-buffer (current-buffer)) ;select buffer
+    ;; 		  ;; Record the position in the compilation buffer of
+    ;; 		  ;; the last error next-error went to.
+    ;; 		  (error-pos (marker-position
+    ;; 			      (car (car-safe compilation-error-list)))))
+    ;; 	      ;; Reparse the error messages as far as they were parsed before.
+    ;; 	      (compile-reinitialize-errors '(4) compilation-parsing-end)
+    ;; 	      ;; Move the pointer up to find the error we were at before
+    ;; 	      ;; reparsing.  Now next-error should properly go to the next one.
+    ;; 	      (while (and compilation-error-list
+    ;; 			  (/= error-pos (car (car compilation-error-list))))
+    ;; 		(setq compilation-error-list (cdr compilation-error-list))))))
+    ;;   (setq reparse (cdr reparse)))
 
     ;; if necessary, restore point and mark
     (if (not (vc-context-matches-p (point) point-context))
@@ -3705,5 +3712,5 @@
 ;;
 ;;    Thus, there is no explicit recovery code.
 
-;;; arch-tag: ca82c1de-3091-4e26-af92-460abc6213a6
+;; arch-tag: ca82c1de-3091-4e26-af92-460abc6213a6
 ;;; vc.el ends here
--- a/lispref/ChangeLog	Mon Sep 06 07:53:44 2004 +0000
+++ b/lispref/ChangeLog	Fri Sep 10 13:06:10 2004 +0000
@@ -1,3 +1,16 @@
+2004-09-08  Juri Linkov  <juri@jurta.org>
+
+	* minibuf.texi (Minibuffer History): Add `history-delete-duplicates'.
+
+2004-09-07  Luc Teirlinck  <teirllm@auburn.edu>
+
+	* locals.texi (Standard Buffer-Local Variables): Add
+	`buffer-auto-save-file-format'.
+	* internals.texi (Buffer Internals): Describe new
+	auto_save_file_format field of the buffer structure.
+	* files.texi (Format Conversion): `auto-save-file-format' has been
+	renamed `buffer-auto-save-file-format'.
+
 2004-08-27  Luc Teirlinck  <teirllm@auburn.edu>
 
 	* abbrevs.texi (Abbrev Expansion): `abbrev-start-location' can be
--- a/lispref/files.texi	Mon Sep 06 07:53:44 2004 +0000
+++ b/lispref/files.texi	Fri Sep 10 13:06:10 2004 +0000
@@ -2825,7 +2825,7 @@
 @key{RET} for @var{format} specifies @code{nil}.
 @end deffn
 
-@defvar auto-save-file-format
+@defvar buffer-auto-save-file-format
 This variable specifies the format to use for auto-saving.  Its value is
 a list of format names, just like the value of
 @code{buffer-file-format}; however, it is used instead of
--- a/lispref/internals.texi	Mon Sep 06 07:53:44 2004 +0000
+++ b/lispref/internals.texi	Fri Sep 10 13:06:10 2004 +0000
@@ -1094,6 +1094,9 @@
 @item file_format
 The value of @code{buffer-file-format} in this buffer.
 
+@item auto_save_file_format
+The value of @code{buffer-auto-save-file-format} in this buffer.
+
 @item pt_marker
 In an indirect buffer, or a buffer that is the base of an indirect
 buffer, this holds a marker that records point for this buffer when the
--- a/lispref/locals.texi	Mon Sep 06 07:53:44 2004 +0000
+++ b/lispref/locals.texi	Fri Sep 10 13:06:10 2004 +0000
@@ -21,6 +21,9 @@
 @item auto-fill-function
 @xref{Auto Filling}.
 
+@item buffer-auto-save-file-format
+@xref{Format Conversion}.
+
 @item buffer-auto-save-file-name
 @xref{Auto-Saving}.
 
--- a/lispref/minibuf.texi	Mon Sep 06 07:53:44 2004 +0000
+++ b/lispref/minibuf.texi	Fri Sep 10 13:06:10 2004 +0000
@@ -450,7 +450,8 @@
 @code{history-length} specifies the maximum length for most history
 lists.  To specify a different maximum length for a particular history
 list, put the length in the @code{history-length} property of the
-history list symbol.
+history list symbol.  The variable @code{history-delete-duplicates}
+specifies whether to delete duplicates in history.
 
 @defvar history-length
 The value of this variable specifies the maximum length for all
@@ -459,6 +460,11 @@
 elements).
 @end defvar
 
+@defvar history-delete-duplicates
+If the value of this variable is @code{t}, that means when adding a
+new history element, all previous identical elements are deleted.
+@end defvar
+
   Here are some of the standard minibuffer history list variables:
 
 @defvar minibuffer-history
--- a/man/ChangeLog	Mon Sep 06 07:53:44 2004 +0000
+++ b/man/ChangeLog	Fri Sep 10 13:06:10 2004 +0000
@@ -1,3 +1,20 @@
+2004-09-09  Kim F. Storm  <storm@cua.dk>
+
+	* kmacro.texi (Save Keyboard Macro): Replace `name-last-kbd-macro'
+	with new `kmacro-name-last-macro'.
+
+2004-09-09  Reiner Steib  <Reiner.Steib@gmx.de>
+
+	* makefile.w32-in (sieve, pgg): Use $(infodir).
+
+2004-09-08  Juri Linkov  <juri@jurta.org>
+
+	* mini.texi (Minibuffer History): Add `history-delete-duplicates'.
+
+2004-09-08  Dhruva Krishnamurthy  <dhruva.krishnamurthy@gmail.com>  (tiny change)
+
+	* makefile.w32-in: Fix PGG and Sieve entries.
+
 2004-09-03  Juri Linkov  <juri@jurta.org>
 
 	* search.texi (Incremental Search): Update wording for M-%.
--- a/man/kmacro.texi	Mon Sep 06 07:53:44 2004 +0000
+++ b/man/kmacro.texi	Fri Sep 10 13:06:10 2004 +0000
@@ -62,7 +62,7 @@
 (@code{kbd-macro-query}).
 @item C-x C-k n
 Give a command name (for the duration of the session) to the most
-recently defined keyboard macro (@code{name-last-kbd-macro}).
+recently defined keyboard macro (@code{kmacro-name-last-macro}).
 @item C-x C-k b
 Bind the most recently defined keyboard macro to a key sequence (for
 the duration of the session) (@code{kmacro-bind-to-key}).
@@ -361,10 +361,10 @@
 @section Naming and Saving Keyboard Macros
 
 @cindex saving keyboard macros
-@findex name-last-kbd-macro
+@findex kmacro-name-last-macro
 @kindex C-x C-k n
   If you wish to save a keyboard macro for later use, you can give it
-a name using @kbd{C-x C-k n} (@code{name-last-kbd-macro}).
+a name using @kbd{C-x C-k n} (@code{kmacro-name-last-macro}).
 This reads a name as an argument using the minibuffer and defines that
 name to execute the last keyboard macro, in its current form.  (If you
 later add to the definition of this macro, that does not alter the
--- a/man/makefile.w32-in	Mon Sep 06 07:53:44 2004 +0000
+++ b/man/makefile.w32-in	Fri Sep 10 13:06:10 2004 +0000
@@ -198,22 +198,26 @@
 	$(ENVADD) $(TEXI2DVI) gnustmp.texi
 	cp gnustmp.dvi $*.dvi
 	rm gnustmp.*
+#
 $(infodir)/message: message.texi
 	$(MAKEINFO) message.texi
 message.dvi: message.texi
 	$(ENVADD) $(TEXI2DVI) $(srcdir)/message.texi
+#
 $(infodir)/emacs-mime: emacs-mime.texi
 	$(MAKEINFO) emacs-mime.texi
 emacs-mime.dvi: emacs-mime.texi
 	$(ENVADD) $(TEXI2DVI) $(srcdir)/emacs-mime.texi
-../info/sieve: sieve.texi
-	cd $(srcdir); $(MAKEINFO) sieve.texi
+#
+$(infodir)/sieve: sieve.texi
+	$(MAKEINFO) sieve.texi
 sieve.dvi: sieve.texi
-	$(ENVADD) $(TEXI2DVI) ${srcdir}/sieve.texi
-../info/pgg: pgg.texi
-	cd $(srcdir); $(MAKEINFO) pgg.texi
+	$(ENVADD) $(TEXI2DVI) $(srcdir)/sieve.texi
+#
+$(infodir)/pgg: pgg.texi
+	$(MAKEINFO) pgg.texi
 pgg.dvi: pgg.texi
-	$(ENVADD) $(TEXI2DVI) ${srcdir}/pgg.texi
+	$(ENVADD) $(TEXI2DVI) $(srcdir)/pgg.texi
 
 $(infodir)/mh-e: mh-e.texi
 	$(MAKEINFO) mh-e.texi
--- a/man/mini.texi	Mon Sep 06 07:53:44 2004 +0000
+++ b/man/mini.texi	Fri Sep 10 13:06:10 2004 +0000
@@ -511,6 +511,12 @@
 @code{history-length} is @code{t}, though, there is no maximum length
 and elements are never deleted.
 
+@vindex history-delete-duplicates
+  The variable @code{history-delete-duplicates} specifies whether to
+delete duplicates in history.  If the value of @code{history-delete-duplicates}
+is @code{t}, that means when adding a new history element, all
+previous identical elements are deleted.
+
 @node Repetition
 @section Repeating Minibuffer Commands
 @cindex command history
--- a/src/ChangeLog	Mon Sep 06 07:53:44 2004 +0000
+++ b/src/ChangeLog	Fri Sep 10 13:06:10 2004 +0000
@@ -1,6 +1,57 @@
+2004-09-09  Richard M. Stallman  <rms@gnu.org>
+
+	* xdisp.c (decode_mode_spec): Use current buffer for most purposes.
+
+2004-09-08  Richard M. Stallman  <rms@gnu.org>
+
+	* window.c (Fset_window_buffer): Doc fix.
+
+	* xdisp.c (Fformat_mode_line): New arg BUFFER says which buffer to use.
+
+2004-09-08  Dan Nicolaescu  <dann@ics.uci.edu>
+
+	* minibuf.c (history_delete_duplicates): New variable.
+	(read_minibuf): Use it.
+	(syms_of_minibuf): Create the corresponding lisp variable.
+
+2004-09-08  Kim F. Storm  <storm@cua.dk>
+
+	* xdisp.c (set_cursor_from_row): Also look at 'cursor' property in
+	overlay just before point.
+
+2004-09-07  Luc Teirlinck  <teirllm@auburn.edu>
+
+	* buffer.h (struct buffer): Add auto_save_file_format field.
+	* buffer.c (reset_buffer, init_buffer_once): Handle
+	auto_save_file_format field.
+	(syms_of_buffer): Add DEFVAR_PER_BUFFER for
+	`buffer-auto-save-file-format'.
+	* fileio.c: Delete declaration for removed Vauto_save_file_format.
+	(build_annotations): Adapt to replacement of
+	`auto-save-file-format' with the new buffer-local variable
+	`buffer-auto-save-file-format'.
+	(syms_of_fileio): Delete DEFVAR_LISP for auto-save-file-format.
+
+2004-09-07  Jason Rumney  <jasonr@gnu.org>
+
+	* w32term.h (AppendMenuW_Proc): Move declaration from w32menu.c.
+
+	* w32fns.c (w32_wnd_proc) [WM_MEASUREITEM, WM_DRAWITEM]: Handle
+	Unicode menu titles.
+
+2004-09-07  Kim F. Storm  <storm@cua.dk>
+
+	* xdisp.c (set_cursor_from_row): Fix last change.  Only use 'cursor'
+	property from text property or overlay strings at point.
+
+2004-09-07  Stefan  <monnier@iro.umontreal.ca>
+
+	* xmenu.c (update_submenu_strings): YAILOM.
+	(set_frame_menubar): Make sure last_i is initialized.
+
 2004-09-03  Jason Rumney  <jasonr@gnu.org>
 
-	* w32menu.c (_widget_value): Added lname and lkey.
+	* w32menu.c (_widget_value): Add lname and lkey.
 	(digest_single_submenu): Set lname and lkey in widget_value
 	instead of name and key.
 	(update_submenu_strings): New function.
@@ -12,7 +63,7 @@
 	UTF-8 if Unicode API is available.
 	(utf8to16): New function.
 	(add_menu_item): Use it when calling Unicode API.
-	
+
 2004-09-03  Kim F. Storm  <storm@cua.dk>
 
 	* xdisp.c (set_cursor_from_row): Look for non-nil `cursor' property
@@ -22,14 +73,14 @@
 2004-09-02  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
 
 	* macfns.c (x_real_positions): Save the current window port and
-	set a new one before obtaining the global coordinate.  Use
-	FRAME_MAC_WINDOW.
-	(x_set_name, x_set_title): Encode title to UTF8.  Use
-	SetWindowTitleWithCFString.
+	set a new one before obtaining the global coordinate.
+	Use FRAME_MAC_WINDOW.
+	(x_set_name, x_set_title): Encode title to UTF8.
+	Use SetWindowTitleWithCFString.
 	(Fx_server_version): Get correct OS version.
 
-	* macmenu.c (add_menu_item): Remove unused variable `i'.  Don't
-	let separator items destroy refence constants of other menu items.
+	* macmenu.c (add_menu_item): Remove unused variable `i'.
+	Don't let separator items destroy refence constants of other menu items.
 
 	* macterm.c (x_update_end): Move SetPortWindowPort to inside
 	BLOCK_INPUT.
@@ -40,8 +91,8 @@
 
 	* s/darwin.h (LIBS_CARBON): New define to specify libraries for
 	Carbon support.
-	(LD_SWITCH_SYSTEM_TEMACS): Don't link with unused libstdc++.  Use
-	LIBS_CARBON.
+	(LD_SWITCH_SYSTEM_TEMACS): Don't link with unused libstdc++.
+	Use LIBS_CARBON.
 
 2004-09-02  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>
 
@@ -56,7 +107,7 @@
 
 2004-08-30  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>
 
-	* macmenu.c (_widget_value): Added lname and lkey.
+	* macmenu.c (_widget_value): Add lname and lkey.
 	(single_submenu): Set lname and lkey in widget_value
 	instead of name and key.
 	(update_submenu_strings): New function.
--- a/src/buffer.c	Mon Sep 06 07:53:44 2004 +0000
+++ b/src/buffer.c	Fri Sep 10 13:06:10 2004 +0000
@@ -694,6 +694,7 @@
   b->mark_active = Qnil;
   b->point_before_scroll = Qnil;
   b->file_format = Qnil;
+  b->auto_save_file_format = Qt;
   b->last_selected_window = Qnil;
   XSETINT (b->display_count, 0);
   b->display_time = Qnil;
@@ -4962,6 +4963,7 @@
   buffer_defaults.undo_list = Qnil;
   buffer_defaults.mark_active = Qnil;
   buffer_defaults.file_format = Qnil;
+  buffer_defaults.auto_save_file_format = Qt;
   buffer_defaults.overlays_before = NULL;
   buffer_defaults.overlays_after = NULL;
   buffer_defaults.overlay_center = BEG;
@@ -5020,6 +5022,7 @@
   XSETINT (buffer_local_flags.file_truename, -1);
   XSETINT (buffer_local_flags.invisibility_spec, -1);
   XSETINT (buffer_local_flags.file_format, -1);
+  XSETINT (buffer_local_flags.auto_save_file_format, -1);
   XSETINT (buffer_local_flags.display_count, -1);
   XSETINT (buffer_local_flags.display_time, -1);
   XSETINT (buffer_local_flags.enable_multibyte_characters, -1);
@@ -5830,6 +5833,13 @@
 Formats are defined by `format-alist'.  This variable is
 set when a file is visited.  */);
 
+  DEFVAR_PER_BUFFER ("buffer-auto-save-file-format",
+		     &current_buffer->auto_save_file_format, Qnil,
+		     doc: /* *Format in which to write auto-save files.
+Should be a list of symbols naming formats that are defined in `format-alist'.
+If it is t, which is the default, auto-save files are written in the
+same format as a regular save would use.  */);
+
   DEFVAR_PER_BUFFER ("buffer-invisibility-spec",
 		     &current_buffer->invisibility_spec, Qnil,
 		     doc: /* Invisibility spec of this buffer.
--- a/src/buffer.h	Mon Sep 06 07:53:44 2004 +0000
+++ b/src/buffer.h	Fri Sep 10 13:06:10 2004 +0000
@@ -666,6 +666,9 @@
   /* List of symbols naming the file format used for visited file.  */
   Lisp_Object file_format;
 
+  /* List of symbols naming the file format used for auto-save file.  */
+  Lisp_Object auto_save_file_format;
+
   /* True if the newline position cache and width run cache are
      enabled.  See search.c and indent.c.  */
   Lisp_Object cache_long_line_scans;
--- a/src/fileio.c	Mon Sep 06 07:53:44 2004 +0000
+++ b/src/fileio.c	Fri Sep 10 13:06:10 2004 +0000
@@ -175,9 +175,6 @@
    whose I/O is done with a special handler.  */
 Lisp_Object Vfile_name_handler_alist;
 
-/* Format for auto-save files */
-Lisp_Object Vauto_save_file_format;
-
 /* Lisp functions for translating file formats */
 Lisp_Object Qformat_decode, Qformat_annotate_function;
 
@@ -5374,8 +5371,8 @@
     }
 
   /* Now do the same for annotation functions implied by the file-format */
-  if (auto_saving && (!EQ (Vauto_save_file_format, Qt)))
-    p = Vauto_save_file_format;
+  if (auto_saving && (!EQ (current_buffer->auto_save_file_format, Qt)))
+    p = current_buffer->auto_save_file_format;
   else
     p = current_buffer->file_format;
   for (i = 0; CONSP (p); p = XCDR (p), ++i)
@@ -6493,13 +6490,6 @@
 of file names regardless of the current language environment.  */);
   Vdefault_file_name_coding_system = Qnil;
 
-  DEFVAR_LISP ("auto-save-file-format", &Vauto_save_file_format,
-    doc: /* *Format in which to write auto-save files.
-Should be a list of symbols naming formats that are defined in `format-alist'.
-If it is t, which is the default, auto-save files are written in the
-same format as a regular save would use.  */);
-  Vauto_save_file_format = Qt;
-
   Qformat_decode = intern ("format-decode");
   staticpro (&Qformat_decode);
   Qformat_annotate_function = intern ("format-annotate-function");
--- a/src/minibuf.c	Mon Sep 06 07:53:44 2004 +0000
+++ b/src/minibuf.c	Fri Sep 10 13:06:10 2004 +0000
@@ -62,6 +62,10 @@
 
 Lisp_Object Qhistory_length, Vhistory_length;
 
+/* No duplicates in history.  */
+
+int history_delete_duplicates;
+
 /* Fread_minibuffer leaves the input here as a string. */
 
 Lisp_Object last_minibuf_string;
@@ -754,6 +758,7 @@
 	{
 	  Lisp_Object length;
 
+	  if (history_delete_duplicates) Fdelete (histstring, histval);
 	  histval = Fcons (histstring, histval);
 	  Fset (Vminibuffer_history_variable, histval);
 
@@ -2673,6 +2678,12 @@
 property of a history variable overrides this default.  */);
   XSETFASTINT (Vhistory_length, 30);
 
+  DEFVAR_BOOL ("history-delete-duplicates", &history_delete_duplicates,
+	       doc: /* *Non-nil means to delete duplicates in history.
+If set to t when adding a new history element, all previous identical
+elements are deleted.  */);
+  history_delete_duplicates = 0;
+
   DEFVAR_LISP ("completion-auto-help", &Vcompletion_auto_help,
 	       doc: /* *Non-nil means automatically provide help for invalid completion input.  */);
   Vcompletion_auto_help = Qt;
--- a/src/w32fns.c	Mon Sep 06 07:53:44 2004 +0000
+++ b/src/w32fns.c	Fri Sep 10 13:06:10 2004 +0000
@@ -260,6 +260,7 @@
 
 TrackMouseEvent_Proc track_mouse_event_fn = NULL;
 ClipboardSequence_Proc clipboard_sequence_fn = NULL;
+extern AppendMenuW_Proc unicode_append_menu;
 
 /* W95 mousewheel handler */
 unsigned int msh_mousewheel = 0;
@@ -3457,7 +3458,13 @@
               pMis->itemHeight = GetSystemMetrics (SM_CYMENUSIZE);
               if (title)
                 {
-                  GetTextExtentPoint32 (hdc, title, strlen (title), &size);
+		  if (unicode_append_menu)
+		    GetTextExtentPoint32W (hdc, (WCHAR *) title,
+					   wcslen ((WCHAR *) title),
+					   &size);
+		  else
+		    GetTextExtentPoint32 (hdc, title, strlen (title), &size);
+
                   pMis->itemWidth = size.cx;
                   if (pMis->itemHeight < size.cy)
                     pMis->itemHeight = size.cy;
@@ -3495,13 +3502,22 @@
                   menu_font = CreateFontIndirect (&menu_logfont);
                   old_font = SelectObject (hdc, menu_font);
 
-                  /* Always draw title as if not selected.  */
-                  ExtTextOut (hdc,
-                              pDis->rcItem.left
-                              + GetSystemMetrics (SM_CXMENUCHECK),
-                              pDis->rcItem.top,
-                              ETO_OPAQUE, &pDis->rcItem,
-                              title, strlen (title), NULL);
+		  /* Always draw title as if not selected.  */
+		  if (unicode_append_menu)
+		    ExtTextOutW (hdc,
+				 pDis->rcItem.left
+				 + GetSystemMetrics (SM_CXMENUCHECK),
+				 pDis->rcItem.top,
+				 ETO_OPAQUE, &pDis->rcItem,
+				 (WCHAR *) title,
+				 wcslen ((WCHAR *) title), NULL);
+		  else
+		    ExtTextOut (hdc,
+				pDis->rcItem.left
+				+ GetSystemMetrics (SM_CXMENUCHECK),
+				pDis->rcItem.top,
+				ETO_OPAQUE, &pDis->rcItem,
+				title, strlen (title), NULL);
 
                   SelectObject (hdc, old_font);
                   DeleteObject (menu_font);
--- a/src/w32menu.c	Mon Sep 06 07:53:44 2004 +0000
+++ b/src/w32menu.c	Fri Sep 10 13:06:10 2004 +0000
@@ -143,11 +143,6 @@
     IN UINT,
     IN BOOL,
     IN LPCMENUITEMINFOA);
-typedef BOOL (WINAPI * AppendMenuW_Proc) (
-    IN HMENU,
-    IN UINT,
-    IN UINT_PTR,
-    IN LPCWSTR);
 
 GetMenuItemInfoA_Proc get_menu_item_info = NULL;
 SetMenuItemInfoA_Proc set_menu_item_info = NULL;
--- a/src/w32term.h	Mon Sep 06 07:53:44 2004 +0000
+++ b/src/w32term.h	Fri Sep 10 13:06:10 2004 +0000
@@ -736,6 +736,11 @@
       ? BDF_1D_FONT : BDF_2D_FONT))
 
 typedef DWORD (WINAPI * ClipboardSequence_Proc) ();
+typedef BOOL (WINAPI * AppendMenuW_Proc) (
+    IN HMENU,
+    IN UINT,
+    IN UINT_PTR,
+    IN LPCWSTR);
 
 /* arch-tag: f201d05a-1240-4fc5-8ea4-ca24d4ee5671
    (do not change this comment) */
--- a/src/window.c	Mon Sep 06 07:53:44 2004 +0000
+++ b/src/window.c	Fri Sep 10 13:06:10 2004 +0000
@@ -3059,7 +3059,9 @@
 Optional third arg KEEP-MARGINS non-nil means that WINDOW's current
 display margins, fringe widths, and scroll bar settings are maintained;
 the default is to reset these from BUFFER's local settings or the frame
-defaults.  */)
+defaults.
+
+This function runs the hook `window-scroll-functions'.  */)
      (window, buffer, keep_margins)
      register Lisp_Object window, buffer, keep_margins;
 {
--- a/src/xdisp.c	Mon Sep 06 07:53:44 2004 +0000
+++ b/src/xdisp.c	Fri Sep 10 13:06:10 2004 +0000
@@ -10655,6 +10655,7 @@
   int string_before_pos;
   int x = row->x;
   int cursor_x = x;
+  int cursor_from_overlay_pos = 0;
   int pt_old = PT - delta;
 
   /* Skip over glyphs not having an object at the start of the row.
@@ -10680,6 +10681,12 @@
 	  string_start = NULL;
 	  x += glyph->pixel_width;
 	  ++glyph;
+	  if (cursor_from_overlay_pos
+	      && last_pos > cursor_from_overlay_pos)
+	    {
+	      cursor_from_overlay_pos = 0;
+	      cursor = 0;
+	    }
 	}
       else
 	{
@@ -10689,10 +10696,21 @@
 	  /* Skip all glyphs from string.  */
 	  do
 	    {
+	      int pos;
 	      if ((cursor == NULL || glyph > cursor)
 		  && !NILP (Fget_char_property (make_number ((glyph)->charpos),
-						Qcursor, (glyph)->object)))
-		{
+						Qcursor, (glyph)->object))
+		  && (pos = string_buffer_position (w, glyph->object,
+						    string_before_pos),
+		      (pos == 0	  /* From overlay */
+		       || pos == pt_old)))
+		{
+		  /* Estimate overlay buffer position from the buffer
+		     positions of the glyphs before and after the overlay.
+		     Add 1 to last_pos so that if point corresponds to the
+		     glyph right after the overlay, we still use a 'cursor'
+		     property found in that overlay.  */
+		  cursor_from_overlay_pos = pos == 0 ? last_pos+1 : 0;
 		  cursor = glyph;
 		  cursor_x = x;
 		}
@@ -15775,15 +15793,16 @@
 
 
 DEFUN ("format-mode-line", Fformat_mode_line, Sformat_mode_line,
-       0, 3, 0,
+       0, 4, 0,
        doc: /* Return the mode-line of selected window as a string.
 First optional arg FORMAT specifies a different format string (see
 `mode-line-format' for details) to use.  If FORMAT is t, return
 the buffer's header-line.  Second optional arg WINDOW specifies a
 different window to use as the context for the formatting.
-If third optional arg NO-PROPS is non-nil, string is not propertized.  */)
-     (format, window, no_props)
-     Lisp_Object format, window, no_props;
+If third optional arg NO-PROPS is non-nil, string is not propertized.
+Fourth optional arg BUFFER specifies which buffer to use.  */)
+  (format, window, no_props, buffer)
+     Lisp_Object format, window, no_props, buffer;
 {
   struct it it;
   int len;
@@ -15795,12 +15814,16 @@
     window = selected_window;
   CHECK_WINDOW (window);
   w = XWINDOW (window);
-  CHECK_BUFFER (w->buffer);
-
-  if (XBUFFER (w->buffer) != current_buffer)
+
+  if (NILP (buffer))
+    buffer = w->buffer;
+
+  CHECK_BUFFER (buffer);
+
+  if (XBUFFER (buffer) != current_buffer)
     {
       old_buffer = current_buffer;
-      set_buffer_internal_1 (XBUFFER (w->buffer));
+      set_buffer_internal_1 (XBUFFER (buffer));
     }
 
   if (NILP (format) || EQ (format, Qt))
@@ -16103,7 +16126,10 @@
    generated by character C.  PRECISION >= 0 means don't return a
    string longer than that value.  FIELD_WIDTH > 0 means pad the
    string returned with spaces to that value.  Return 1 in *MULTIBYTE
-   if the result is multibyte text.  */
+   if the result is multibyte text.
+
+   Note we operate on the current buffer for most purposes,
+   the exception being w->base_line_pos.  */
 
 static char lots_of_dashes[] = "--------------------------------------------------------------------------------------------------------------------------------------------";
 
@@ -16117,7 +16143,7 @@
   Lisp_Object obj;
   struct frame *f = XFRAME (WINDOW_FRAME (w));
   char *decode_mode_spec_buf = f->decode_mode_spec_buffer;
-  struct buffer *b = XBUFFER (w->buffer);
+  struct buffer *b = current_buffer;
 
   obj = Qnil;
   *multibyte = 0;
@@ -16419,7 +16445,7 @@
 
     case 's':
       /* status of process */
-      obj = Fget_buffer_process (w->buffer);
+      obj = Fget_buffer_process (Fcurrent_buffer ());
       if (NILP (obj))
 	return "no process";
 #ifdef subprocesses
--- a/src/xmenu.c	Mon Sep 06 07:53:44 2004 +0000
+++ b/src/xmenu.c	Fri Sep 10 13:06:10 2004 +0000
@@ -1,5 +1,5 @@
 /* X Communication module for terminals which understand the X protocol.
-   Copyright (C) 1986, 88, 93, 94, 96, 99, 2000, 2001, 2003
+   Copyright (C) 1986, 1988, 1993, 1994, 1996, 1999, 2000, 2001, 2003, 2004
    Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
@@ -1801,7 +1801,7 @@
 
   for (wv = first_wv; wv; wv = wv->next)
     {
-      if (wv->lname && ! NILP (wv->lname))
+      if (STRINGP (wv->lname))
         {
           wv->name = SDATA (wv->lname);
 
@@ -1815,7 +1815,7 @@
             }
         }
 
-      if (wv->lkey && ! NILP (wv->lkey))
+      if (STRINGP (wv->lkey))
         wv->key = SDATA (wv->lkey);
 
       if (wv->contents)
@@ -1888,7 +1888,7 @@
 #endif
   Lisp_Object items;
   widget_value *wv, *first_wv, *prev_wv = 0;
-  int i, last_i;
+  int i, last_i = 0;
   int *submenu_start, *submenu_end;
   int *submenu_top_level_items, *submenu_n_panes;