changeset 83179:3864ee1088e9

Merged in changes from CVS trunk. Patches applied: * lorentey@elte.hu--2004/emacs--hacks--0--patch-2 Prevent special events from appending dashes to the echo string. * lorentey@elte.hu--2004/emacs--hacks--0--patch-4 Added ChangeLog entry. * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-454 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-455 Bash the dashes * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-456 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-457 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-458 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-459 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-460 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-219
author Karoly Lorentey <lorentey@elte.hu>
date Sun, 18 Jul 2004 21:49:24 +0000
parents a79c4db19c4f (current diff) 6b42a91e3595 (diff)
children e657dca8261e
files etc/TODO lisp/ChangeLog lisp/bindings.el lisp/font-lock.el lisp/mh-e/mh-loaddefs.el lisp/simple.el src/buffer.c src/fileio.c src/frame.c src/keyboard.c src/print.c src/window.c
diffstat 40 files changed, 996 insertions(+), 347 deletions(-) [+]
line wrap: on
line diff
--- a/etc/ChangeLog	Tue Jul 13 15:45:15 2004 +0000
+++ b/etc/ChangeLog	Sun Jul 18 21:49:24 2004 +0000
@@ -1,3 +1,7 @@
+2004-07-14  Luc Teirlinck  <teirllm@auburn.edu>
+
+	* MORE.STUFF: Tramp is now distributed with Emacs.
+
 2004-07-12  Bill Wohler  <wohler@newt.com>
 
 	* NEWS, MH-E-NEWS: Upgraded to MH-E version 7.4.4.
--- a/etc/MORE.STUFF	Tue Jul 13 15:45:15 2004 +0000
+++ b/etc/MORE.STUFF	Sun Jul 18 21:49:24 2004 +0000
@@ -96,6 +96,9 @@
 
  * Sregex: <URL:http://www.zanshin.com/%7Ebobg/sregex.html>
 
+ * Tramp: Remote file access via rsh/ssh
+   <URL:http://savannah.gnu.org/projects/tramp/>
+
  * Webjump: <URL:http://www.neilvandyke.org/webjump>
 
  * Whitespace: <URL:http://www.dsmit.com/lisp/>
@@ -215,9 +218,6 @@
 	Wnn6,
 	SJ3 Ver.2
 
- * Tramp: Remote file access via rsh/ssh
-   <URL:http://savannah.gnu.org/projects/tramp/>
-
  * VM (View Mail): <URL:http://www.wonderworks.com/vm/> Alternative
    mail reader.  There is a VM newsgroup: <URL:news:gnu.emacs.vm.info>
 
--- a/etc/NEWS	Tue Jul 13 15:45:15 2004 +0000
+++ b/etc/NEWS	Sun Jul 18 21:49:24 2004 +0000
@@ -95,6 +95,12 @@
 
 * Changes in Emacs 21.4
 
++++
+** There are now two new regular expression operators, \_< and \_>,
+for matching the beginning and end of a symbol.  A symbol is a
+non-empty sequence of either word or symbol constituent characters, as
+specified by the syntax table.
+
 ** Passing resources on the command line now works on MS Windows.
 You can use --xrm to pass resource settings to Emacs, overriding any
 existing values.  For example:
@@ -144,7 +150,7 @@
 support editing comint buffers with read-only prompts.
 
 `comint-kill-whole-line' is like `kill-whole-line', but ignores both
-read-only and field properties.  Hence, it will always kill entire
+read-only and field properties.  Hence, it always kill entire
 lines, including any prompts.
 
 `comint-kill-region' is like `kill-region', except that it ignores
@@ -158,7 +164,7 @@
 ** You can now use next-error (C-x `) and previous-error to advance to
 the next/previous matching line found by M-x occur.
 
-** Telnet will now prompt you for a port number with C-u M-x telnet.
+** Telnet now prompts you for a port number with C-u M-x telnet.
 
 +++
 ** New command line option -Q.
@@ -177,9 +183,9 @@
 ** You can now use Auto Revert mode to `tail' a file.
 If point is at the end of a file buffer before reverting, Auto Revert
 mode keeps it at the end after reverting.  Similarly if point is
-displayed at the end of a file buffer in any window, it will stay at
+displayed at the end of a file buffer in any window, it stays at
 the end of the buffer in that window.  This allows to tail a file:
-just put point at the end of the buffer and it will stay there.  This
+just put point at the end of the buffer and it stays there.  This
 rule applies to file buffers.  For non-file buffers, the behavior may
 be mode dependent.
 
@@ -187,7 +193,7 @@
 other potential problems when deciding which non-file buffers to
 revert.  This matters especially if Global Auto Revert mode is enabled
 and `global-auto-revert-non-file-buffers' is non-nil.  Auto Revert
-mode will only revert a non-file buffer if the buffer has a non-nil
+mode only reverts a non-file buffer if the buffer has a non-nil
 `revert-buffer-function' and a non-nil `buffer-stale-function', which
 decides whether the buffer should be reverted.  Currently, this means
 that auto reverting works for Dired buffers (although this may not
@@ -225,7 +231,7 @@
 ** 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 will again be loaded with the new `grep-mode'.
+can be saved and automatically revisited with the new Grep mode.
 
 ** M-x diff uses diff-mode instead of compilation-mode.
 
@@ -427,7 +433,7 @@
 
 ** Enhancements to apropos commands:
 
-*** The apropos commands will now accept a list of words to match.
+*** The apropos commands now accept a list of words to match.
 When more than one word is specified, at least two of those words must
 be present for an item to match.  Regular expression matching is still
 available.
@@ -606,7 +612,7 @@
 `file|dir1' and `file|dir2' to `file|dir1/subdir' and `file|dir2/subdir'.
 
 ** If the user visits a file larger than `large-file-warning-threshold',
-Emacs will prompt her for confirmation.
+Emacs prompts her for confirmation.
 
 ** A UTF-7 coding system is available in the library `utf-7'.
 
@@ -683,8 +689,8 @@
 +++
 ** When you are root, and you visit a file whose modes specify
 read-only, the Emacs buffer is now read-only too.  Type C-x C-q if you
-want to make the buffer writable.  (As root, you will in fact be able
-to alter the file.)
+want to make the buffer writable.  (As root, you can in fact alter the
+file.)
 
 ** The new command `revert-buffer-with-coding-system' (C-x RET r)
 revisits the current file using a coding system that you specify.
@@ -706,7 +712,7 @@
 
 `buffers-menu-show-directories' controls whether the menu displays
 leading directories as part of the file name visited by the buffer.
-If its value is `unless-uniquify', the default, directories will be
+If its value is `unless-uniquify', the default, directories are
 shown unless uniquify-buffer-name-style' is non-nil.  The value of nil
 and t turn the display of directories off and on, respectively.
 
@@ -785,7 +791,7 @@
 translation works amongst the Emacs ...-iso8859-... charsets and the
 mule-unicode-... ones.
 
-By default this translation will happen automatically on encoding.
+By default this translation happens automatically on encoding.
 Self-inserting characters are translated to make the input conformant
 with the encoding of the buffer in which it's being used, where
 possible.
@@ -863,7 +869,7 @@
 will horizontally scroll the window.  The default value is 5.
 
 The variable `hscroll-step' determines how many columns automatic
-hscrolling will scroll the window when point gets too close to the
+hscrolling scrolls the window when point gets too close to the
 window edge.  If its value is zero, the default, Emacs scrolls the
 window so as to center point.  If its value is an integer, it says how
 many columns to scroll.  If the value is a floating-point number, it
@@ -1111,8 +1117,8 @@
 
 +++
 ** M-x grep now tries to avoid appending `/dev/null' to the command line
-by using GNU grep `-H' option instead.  M-x grep will automatically
-detect whether this is possible or not the first time it is invoked.
+by using GNU grep `-H' option instead.  M-x grep automatically
+detects whether this is possible or not the first time it is invoked.
 When `-H' is used, the grep command line supplied by the user is passed
 unchanged to the system to execute, which allows more complicated
 command lines to be used than was possible before.
@@ -1176,7 +1182,7 @@
 
 *** The STARTTLS elisp wrapper (starttls.el) can now use GNUTLS
 instead of the OpenSSL based "starttls" tool.  For backwards
-compatibility, it will prefer "starttls", but you can toggle
+compatibility, it prefers "starttls", but you can toggle
 `starttls-use-gnutls' to switch to GNUTLS (or simply remove the
 "starttls" tool).
 
@@ -1211,10 +1217,10 @@
 +++
 ** Marking commands extend the region when invoked multiple times.  If
 you hit M-C-SPC (mark-sexp), M-@ (mark-word), M-h (mark-paragraph), or
-C-M-h (mark-defun) repeatedly, the marked region will now be extended
-each time, so you can mark the next two sexps with M-C-SPC M-C-SPC,
-for example.  This feature also works for mark-end-of-sentence, if you
-bind that to a key.
+C-M-h (mark-defun) repeatedly, the marked region extends each time, so
+you can mark the next two sexps with M-C-SPC M-C-SPC, for example.
+This feature also works for mark-end-of-sentence, if you bind that to
+a key.
 
 +++
 ** Some commands do something special in Transient Mark mode when the
@@ -1236,7 +1242,7 @@
 
 +++
 ** A prefix argument is no longer required to repeat a jump to a
-previous mark, i.e. C-u C-SPC C-SPC C-SPC ... will cycle through the
+previous mark, i.e. C-u C-SPC C-SPC C-SPC ... cycles through the
 mark ring.  Use C-u C-u C-SPC to set the mark immediately after a jump.
 
 +++
@@ -1443,7 +1449,7 @@
 *** New option --parse-stdin=FILE.
 This option is mostly useful when calling etags from programs.  It can
 be used (only once) in place of a file name on the command line.  Etags
-will read from standard input and mark the produced tags as belonging to
+reads from standard input and mark the produced tags as belonging to
 the file FILE.
 
 +++
@@ -1751,8 +1757,8 @@
 
 +++
 ** New user option `add-log-always-start-new-record'.
-When this option is enabled, M-x add-change-log-entry will always
-start a new record regardless of when the last record is.
+When this option is enabled, M-x add-change-log-entry always
+starts a new record regardless of when the last record is.
 
 +++
 ** SGML mode has indentation and supports XML syntax.
@@ -1904,13 +1910,13 @@
 
 ---
 ** Emacs takes note of colors defined in Control Panel on MS-Windows.
-The Control Panel defines some default colors for applications in
-much the same way as wildcard X Resources do on X.  Emacs now
-adds these colors to the colormap prefixed by System (eg SystemMenu
-for the default Menu background, SystemMenuText for the foreground),
-and uses some of them to initialize some of the default faces.
-`list-colors-display' will show the list of System color names if you
-wish to use them in other faces.
+The Control Panel defines some default colors for applications in much
+the same way as wildcard X Resources do on X.  Emacs now adds these
+colors to the colormap prefixed by System (eg SystemMenu for the
+default Menu background, SystemMenuText for the foreground), and uses
+some of them to initialize some of the default faces.
+`list-colors-display' shows the list of System color names, in case
+you wish to use them in other faces.
 
 +++
 ** Under X11, it is possible to swap Alt and Meta (and Super and Hyper).
@@ -2078,7 +2084,7 @@
 kmacro-call-repeat-with-arg.
 
 Keyboard macros can now be debugged and edited interactively.
-C-x C-k SPC will step through the last keyboard macro one key sequence
+C-x C-k SPC steps through the last keyboard macro one key sequence
 at a time, prompting for the actions to take.
 
 ---
@@ -2178,7 +2184,11 @@
 
 * Lisp Changes in Emacs 21.4
 
-** If a command sets transient-mark-mode to `only', that 
++++
+** `visited-file-modtime' and `calendar-time-from-absolute' now return
+a list of two integers, instead of a cons.
+
+** If a command sets transient-mark-mode to `only', that
 enables Transient Mark mode for the following command only.
 During that following command, the value of transient-mark-mode
 is `identity'.  If it is still `identity' at the end of the command,
@@ -3567,9 +3577,9 @@
 properties from surrounding text.
 
 +++
-** `(match-data t)' will append the buffer as a final element of the
-match data if the last match was on a buffer.  `set-match-data' will
-accept this for restoring the match state.
+** The list returned by `(match-data t)' now has the buffer as a final
+element, if the last match was on a buffer.  `set-match-data'
+accepts such a list for restoring the match state.
 
 +++
 ** New function `buffer-local-value'.
--- a/etc/TODO	Tue Jul 13 15:45:15 2004 +0000
+++ b/etc/TODO	Sun Jul 18 21:49:24 2004 +0000
@@ -87,7 +87,9 @@
   latin-1-prefix and latin-1-postfix.
 
 ** Implement a clean way to use different major modes for
-  different parts of a buffer.
+  different parts of a buffer.  This could be useful in editing
+  Bison input files, for instance, or other kinds of text
+  where one language is embedded in another language.
 
 ** Give start-process the ability to direct standard-error
   output to a different filter.
@@ -107,8 +109,8 @@
   See the Gnus development sources for assigned code concerning GPG
   use with mail, which is probably a good start.]
 
-** Save undo information in files, and reload it when needed
-  for undoing.
+** Save undo information in special temporary files, and reload it
+  when needed for undoing.  This could extend undo capacity.
 
 ** Merge the Emacs regex.c with the Glibc regex.c.
   They split off a few years ago through negligence.
@@ -276,8 +278,14 @@
   the definition of `file-attributes' and `directory-files-and-attributes'
   and from the calls.
 
-** Re-design language environment handling so that Emacs can fit
-  better to a users locale (e.g. ja_JP.UTF-8).
+** Make language-info-alist customizable.  Currently a user can customize
+  only the variable `current-language-environment'.
+
+** Improve language environment handling so that Emacs can fit
+  better to a users locale.  Currently Emacs uses utf-8 language
+  environment for all utf-8 locales, thus a user in ja_JP.UTF-8 locale
+  are also put in utf-8 lang. env.  In such a case, it is
+  better to use Japanese lang. env. but prefer utf-8 coding system.
 
 ** Eliminate the current restriction on header printing by ps-print.
   Currently, a header can contain only single 1-byte charset in
@@ -294,9 +302,10 @@
 ** Enhance word boundary detection for such a script that doesn't use
   space at word boundary (e.g. Thai).
 
-** Include a better Japanese input method in the distribution.
-  Currently, most Japanese users are using external packages
-  (e.g. tamago, anthy) or an input method via XIM.
+** Implement interface programs with major Japanese conversion server
+  in lib-src so that they can be used from the input method
+  "japanese".  Currently, most Japanese users are using external
+  packages (e.g. tamago, anthy) or an input method via XIM.
 
 * Internal changes
 
--- a/leim/Makefile.in	Tue Jul 13 15:45:15 2004 +0000
+++ b/leim/Makefile.in	Sun Jul 18 21:49:24 2004 +0000
@@ -1,6 +1,11 @@
 # Makefile for leim subdirectory in GNU Emacs.
-# Copyright (C) 1997, 2004 Electrotechnical Laboratory, JAPAN.
-# Licensed to the Free Software Foundation.
+# Copyright (C) 1997,98,1999,2000,2001 Electrotechnical Laboratory, JAPAN.
+#   Licensed to the Free Software Foundation.
+# Copyright (C) 1997,98,1999,2000,01,02,03,2004
+#   Free Software Foundation, Inc.
+# Copyright (C) 2001,02,03,2004
+#   National Institute of Advanced Industrial Science and Technology (AIST)
+#   Registration Number H14PRO021
 
 # This file is part of GNU Emacs.
 
--- a/lib-src/ChangeLog	Tue Jul 13 15:45:15 2004 +0000
+++ b/lib-src/ChangeLog	Sun Jul 18 21:49:24 2004 +0000
@@ -1,3 +1,7 @@
+2004-07-17  Richard M. Stallman  <rms@gnu.org>
+
+	* emacsclient.c (quote_file_name): Pass COPY thru %s to output it.
+
 2004-06-01  Juanma Barranquero  <lektu@terra.es>
 
 	* makefile.w32-in (obj): Add image.c.
--- a/lisp/ChangeLog	Tue Jul 13 15:45:15 2004 +0000
+++ b/lisp/ChangeLog	Sun Jul 18 21:49:24 2004 +0000
@@ -1,3 +1,126 @@
+2004-07-17  Kai Grossjohann  <kai.grossjohann@gmx.net>
+
+	* net/tramp.el (tramp-handle-verify-visited-file-modtime): New
+	docstring.  From Luc Teirlinck.
+
+2004-07-17  Luc Teirlinck  <teirllm@auburn.edu>
+
+	* autorevert.el: Describe `Auto Revert Tail Mode' in `Commentary'
+	section.
+	(auto-revert-handler): Do not check `auto-revert-tail-mode' for
+	non-file buffers.  We know it is nil.
+
+2004-07-17  Kai Grossjohann  <kai.grossjohann@gmx.net>
+
+	Sync with Tramp 2.0.43.
+
+	* net/tramp.el (tramp-handle-verify-visited-file-modtime): Remove
+	outdated comment.
+	(tramp-locked, tramp-locker): New variables for implementing a
+	global lock.
+	(tramp-sh-file-name-handler): Use them to implement the global
+	lock.
+
+2004-07-13  Michael Albinus  <michael.albinus@gmx.de>
+
+	* net/tramp.el (all): Code cleanup.  Change all `tramp-handle-xxx'
+	calls to respective `xxx` calls.
+	(tramp-process-alive-regexp): Precise doc string.
+	(tramp-multi-action-process-alive): New defun.
+	(tramp-multi-actions): Use it.
+	(tramp-handle-find-backup-file-name): `copy-tree' is available
+	since Emacs 21.4 only (XEmacs has it).  Implementation rewritten
+	in order to avoid this function.
+	(tramp-handle-write-region): Set current buffer.  If connection
+	wasn't open, `file-modes' has changed it accidently.  Reported by
+	David Kastrup <dak@gnu.org>.
+	(tramp-enter-password, tramp-read-passwd): New arguments USER and
+	HOST.
+	(tramp-action-password, tramp-multi-action-password): Apply it.
+	(tramp-open-connection-rsh): If a port is given, the Tramp buffer
+	name must still contain the port number.  Otherwise, we have two
+	Tramp buffers, with all the confusion.  Reported by Myron Selby
+	<myron@xytech.com> and Rolf Dubitzky
+	<Dubitzky@physi.uni-heidelberg.de>.
+
+	* net/tramp-smb.el (tramp-smb-open-connection): Apply USER and
+	HOST to `tramp-enter-passwd'.
+
+	* net/tramp-vc.el (all): Code cleanup.  Change all
+	`tramp-handle-xxx' calls to respective `xxx` calls.
+
+2004-07-17  Jonathan Yavner  <jyavner@member.fsf.org>
+
+	* emacs-lisp/testcover.el: New category "potentially-1valued" for
+	functions that are not erroneous if either 1-valued or
+	multi-valued.  Detect functions in this class.
+	(testcover-1value-functions, testcover-compose-functions,
+	testcover-progn-functions) Added some additional functions to lists.
+	(testcover-mark): Bugfix when marking up the definition for an
+	empty function.
+
+2004-07-17  Richard M. Stallman  <rms@gnu.org>
+
+	* replace.el (occur-read-primary-args): Pass default to read-from-minibuffer.
+
+	* mail/footnote.el (footnote-section-tag): Use defcustom.
+
+	* font-lock.el (font-lock-add-keywords, font-lock-remove-keywords):
+	Compile font-lock-keywords, not KEYWORDS.
+	(lisp-font-lock-keywords-2): Add multiple-value-prog1, go.
+	Add warn, check-type.  Handle cerror like error.
+
+2004-07-14  Daniel Pfeiffer  <occitan@esperanto.org>
+
+	* progmodes/which-func.el (which-func-keymap): New var.
+	(which-func-face): New face.
+	(which-func-format): Use them.
+
+2004-07-16  Stephan Stahl  <stahl@eos.franken.de>  (tiny change)
+
+	* buff-menu.el (list-buffers-noselect): Append the buffer's
+	process status to its mode name.
+
+2004-07-16  Kim F. Storm  <storm@cua.dk>
+
+	* simple.el (inhibit-mark-movement): New defvar.
+	(beginning-of-buffer, end-of-buffer): Do not push mark if
+	inhibit-mark-movement is non-nil or C-u prefix is given.
+
+	* emulation/cua-base.el (cua--preserve-mark-commands): New defvar.
+	Init to beginning-of-buffer and end-of-buffer.
+	(cua--undo-push-mark): New defvar.
+	(cua--pre-command-handler): Set inhibit-mark-movement if mark is
+	already active and command is in cua--preserve-mark-commands.
+	Also fix check for shift modifier on non-window systems.
+	(cua--post-command-handler): Clear inhibit-mark-movement if set.
+
+2004-07-14  Luc Teirlinck  <teirllm@auburn.edu>
+
+	* calendar/cal-dst.el (calendar-time-from-absolute): Return a list
+	of two integers, instead of a cons.
+
+	* net/tramp.el (tramp-handle-verify-visited-file-modtime):
+	`visited-file-modtime' now returns a list of two integers, instead
+	of a cons.
+
+	* dired.el (dired-directory-changed-p): Ditto.
+
+	* progmodes/grep.el (grep): Doc fix.
+
+2004-07-14  Daniel Pfeiffer  <occitan@esperanto.org>
+
+	* autorevert.el (auto-revert-tail-mode)
+	(auto-revert-tail-mode-text, auto-revert-tail-pos): New vars.
+	(auto-revert-mode): Turn off auto-revert-tail-mode, so we're not
+	in both at the same time.
+	(auto-revert-tail-mode): New command.
+	(turn-on-auto-revert-tail-mode, auto-revert-tail-handler): New funs.
+	(auto-revert-handler): Revert only either tail or whole file.
+
+	* bindings.el (mode-line-mode-menu): Fix alphabetical ordering and
+	add auto-revert-tail-mode.
+
 2004-07-12  Vinicius Jose Latorre  <viniciusjl@ig.com.br>
 
 	* printing.el: Doc fix.  Change name of some funs.
@@ -1475,6 +1598,14 @@
 	(timer-event-handler): Set triggered-p element non-nil while running
 	the timer function.
 
+2004-05-14  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* descr-text.el (describe-char-unicode-data)
+	(describe-char-unicodedata-file): Re-enable the unicode code now that
+	the licensing issues have been cleared in the unicode-4 license.
+	(describe-text-properties-1): Remove unused `overlay' var.
+	(describe-char): Remove unused var `buffer'.
+
 2004-05-14  David Ponce  <david@dponce.com>
 
 	* tree-widget.el: New file.
--- a/lisp/autorevert.el	Tue Jul 13 15:45:15 2004 +0000
+++ b/lisp/autorevert.el	Sun Jul 18 21:49:24 2004 +0000
@@ -34,7 +34,8 @@
 ;;
 ;; This package contains two minor modes: Global Auto-Revert Mode and
 ;; Auto-Revert Mode.  Both modes automatically revert buffers
-;; whenever the corresponding files have been changed on disk.
+;; whenever the corresponding files have been changed on disk and the
+;; buffer contains no unsaved changes.
 ;;
 ;; Auto-Revert Mode can be activated for individual buffers.  Global
 ;; Auto-Revert Mode applies to all file buffers. (If the user option
@@ -59,11 +60,19 @@
 ;; Just put point at the end of the buffer and it will stay there.
 ;; These rules apply to file buffers. For non-file buffers, the
 ;; behavior may be mode dependent.
+;;
+;; While you can use Auto Revert Mode to tail a file, this package
+;; contains a third minor mode, Auto Revert Tail Mode, which does so
+;; more efficiently, as long as you are sure that the file will only
+;; change by growing at the end.  It only appends the new output,
+;; instead of reverting the entire buffer.  It does so even if the
+;; buffer contains unsaved changes.  (Because they will not be lost.)
 
 ;; Usage:
 ;;
-;; Go to the appropriate buffer and press:
+;; Go to the appropriate buffer and press either of:
 ;;   M-x auto-revert-mode RET
+;;   M-x auto-revert-tail-mode RET
 ;;
 ;; To activate Global Auto-Revert Mode, press:
 ;;   M-x global-auto-revert-mode RET
@@ -105,13 +114,18 @@
 
 ;; Variables:
 
-;; Autoload for the benefit of `make-mode-line-mouse-sensitive'.
-;;;###autoload
+;;; What's this?: ;; Autoload for the benefit of `make-mode-line-mouse-sensitive'.
+;;; What's this?: ;;;###autoload
 (defvar auto-revert-mode nil
   "*Non-nil when Auto-Revert Mode is active.
 Never set this variable directly, use the command `auto-revert-mode' instead.")
 (put 'auto-revert-mode 'permanent-local t)
 
+(defvar auto-revert-tail-mode nil
+  "*Non-nil when Auto-Revert Tail Mode is active.
+Never set this variable directly, use the command `auto-revert-mode' instead.")
+(put 'auto-revert-tail-mode 'permanent-local t)
+
 (defvar auto-revert-timer nil
   "Timer used by Auto-Revert Mode.")
 
@@ -153,6 +167,13 @@
   :group 'auto-revert
   :type 'string)
 
+(defcustom auto-revert-tail-mode-text " Tail"
+  "String to display in the mode line when Auto-Revert Tail Mode is active.
+
+\(When the string is not empty, make sure that it has a leading space.)"
+  :group 'auto-revert
+  :type 'string)
+
 (defcustom auto-revert-mode-hook nil
   "Functions to run when Auto-Revert Mode is activated."
   :tag "Auto Revert Mode Hook"		; To separate it from `global-...'
@@ -190,7 +211,7 @@
   :type 'boolean
   :link '(info-link "(emacs-xtra)Autorevert"))
 
-(defcustom global-auto-revert-ignore-modes '()
+(defcustom global-auto-revert-ignore-modes ()
   "List of major modes Global Auto-Revert Mode should not check."
   :group 'auto-revert
   :type '(repeat sexp))
@@ -230,7 +251,7 @@
 
 ;; Internal variables:
 
-(defvar auto-revert-buffer-list '()
+(defvar auto-revert-buffer-list ()
   "List of buffers in Auto-Revert Mode.
 
 Note that only Auto-Revert Mode, never Global Auto-Revert Mode, adds
@@ -239,9 +260,16 @@
 The timer function `auto-revert-buffers' is responsible for purging
 the list of old buffers.")
 
-(defvar auto-revert-remaining-buffers '()
+(defvar auto-revert-remaining-buffers ()
   "Buffers not checked when user input stopped execution.")
 
+(defvar auto-revert-tail-pos 0
+  "Position of last known end of file.")
+
+(add-hook 'find-file-hook
+	  (lambda ()
+	    (set (make-local-variable 'auto-revert-tail-pos)
+		 (save-restriction (widen) (1- (point-max))))))
 
 ;; Functions:
 
@@ -251,7 +279,9 @@
 
 With arg, turn Auto Revert mode on if and only if arg is positive.
 This is a minor mode that affects only the current buffer.
-Use `global-auto-revert-mode' to automatically revert all buffers."
+Use `global-auto-revert-mode' to automatically revert all buffers.
+Use `auto-revert-tail-mode' if you know that the file will only grow
+without being changed in the part that is already in the buffer."
   nil auto-revert-mode-text nil
   (if auto-revert-mode
       (if (not (memq (current-buffer) auto-revert-buffer-list))
@@ -260,7 +290,8 @@
 	  (delq (current-buffer) auto-revert-buffer-list)))
   (auto-revert-set-timer)
   (when auto-revert-mode
-    (auto-revert-buffers)))
+    (auto-revert-buffers)
+    (setq auto-revert-tail-mode nil)))
 
 
 ;;;###autoload
@@ -273,6 +304,52 @@
 
 
 ;;;###autoload
+(define-minor-mode auto-revert-tail-mode
+  "Toggle reverting tail of buffer when file on disk grows.
+With arg, turn Tail mode on iff arg is positive.
+
+When Tail mode is enabled, the tail of the file is constantly
+followed, as with the shell command `tail -f'.  This means that
+whenever the file grows on disk (presumably because some
+background process is appending to it from time to time), this is
+reflected in the current buffer.
+
+You can edit the buffer and turn this mode off and on again as
+you please.  But make sure the background process has stopped
+writing before you save the file!
+
+Use `auto-revert-mode' for changes other than appends!"
+  :group 'find-file :lighter auto-revert-tail-mode-text
+  (when auto-revert-tail-mode
+    (unless buffer-file-name
+      (auto-revert-tail-mode 0)
+      (error "This buffer is not visiting a file"))
+    (if (and (buffer-modified-p)
+	     (not auto-revert-tail-pos) ; library was loaded only after finding file
+	     (not (y-or-n-p "Buffer is modified, so tail offset may be wrong.  Proceed? ")))
+	(auto-revert-tail-mode 0)
+      ;; else we might reappend our own end when we save
+      (add-hook 'before-save-hook (lambda () (auto-revert-tail-mode 0)) nil t)
+      (or (local-variable-p 'auto-revert-tail-pos) ; don't lose prior position
+	  (set (make-variable-buffer-local 'auto-revert-tail-pos)
+	       (save-restriction (widen) (1- (point-max)))))
+      ;; let auto-revert-mode set up the mechanism for us if it isn't already
+      (or auto-revert-mode
+	  (let ((auto-revert-tail-mode t))
+	    (auto-revert-mode 1)))
+      (setq auto-revert-mode nil))))
+
+
+;;;###autoload
+(defun turn-on-auto-revert-tail-mode ()
+  "Turn on Auto-Revert Tail Mode.
+
+This function is designed to be added to hooks, for example:
+  (add-hook 'my-logfile-mode-hook 'turn-on-auto-revert-tail-mode)"
+  (auto-revert-tail-mode 1))
+
+
+;;;###autoload
 (define-minor-mode global-auto-revert-mode
   "Revert any buffer when file on disk changes.
 
@@ -298,12 +375,12 @@
 	(if (or global-auto-revert-mode auto-revert-buffer-list)
 	    (run-with-timer auto-revert-interval
 			    auto-revert-interval
-			    'auto-revert-buffers)
-	  nil)))
+			    'auto-revert-buffers))))
 
 (defun auto-revert-active-p ()
   "Check if auto-revert is active (in current buffer or globally)."
   (or auto-revert-mode
+      auto-revert-tail-mode
       (and
        global-auto-revert-mode
        (not global-auto-revert-ignore-buffer)
@@ -313,18 +390,20 @@
 (defun auto-revert-handler ()
   "Revert current buffer, if appropriate.
 This is an internal function used by Auto-Revert Mode."
-  (unless (buffer-modified-p)
-    (let ((buffer (current-buffer)) revert eob eoblist)
-      (or (and buffer-file-name
-	       (not (file-remote-p buffer-file-name))
-	       (file-readable-p buffer-file-name)
-	       (not (verify-visited-file-modtime buffer))
-	       (setq revert t))
-	  (and (or auto-revert-mode global-auto-revert-non-file-buffers)
-	       revert-buffer-function
-	       (boundp 'buffer-stale-function)
-	       (functionp buffer-stale-function)
-	       (setq revert (funcall buffer-stale-function t))))
+  (when (or auto-revert-tail-mode (not (buffer-modified-p)))
+    (let* ((buffer (current-buffer))
+	   (revert
+	    (or (and buffer-file-name
+		     (not (file-remote-p buffer-file-name))
+		     (file-readable-p buffer-file-name)
+		     (not (verify-visited-file-modtime buffer)))
+		(and (or auto-revert-mode
+			 global-auto-revert-non-file-buffers)
+		     revert-buffer-function
+		     (boundp 'buffer-stale-function)
+		     (functionp buffer-stale-function)
+		     (funcall buffer-stale-function t))))
+	   eob eoblist)
       (when revert
 	(when (and auto-revert-verbose
 		   (not (eq revert 'fast)))
@@ -340,7 +419,9 @@
 		    (= (window-point window) (point-max))
 		    (push window eoblist)))
 	   'no-mini t))
-	(revert-buffer 'ignore-auto 'dont-ask 'preserve-modes)
+	(if auto-revert-tail-mode
+	    (auto-revert-tail-handler)
+	  (revert-buffer 'ignore-auto 'dont-ask 'preserve-modes))
 	(when buffer-file-name
 	  (when eob (goto-char (point-max)))
 	  (dolist (window eoblist)
@@ -350,6 +431,22 @@
       (when (or revert auto-revert-check-vc-info)
 	(vc-find-file-hook)))))
 
+(defun auto-revert-tail-handler ()
+  (let ((size (nth 7 (file-attributes buffer-file-name)))
+	(modified (buffer-modified-p))
+	buffer-read-only		; ignore
+	(file buffer-file-name)
+	buffer-file-name)		; ignore that file has changed
+    (when (> size auto-revert-tail-pos)
+      (save-restriction
+	(widen)
+	(save-excursion
+	  (goto-char (point-max))
+	  (insert-file-contents file nil auto-revert-tail-pos size)))
+      (setq auto-revert-tail-pos size)
+      (set-buffer-modified-p modified)))
+  (set-visited-file-modtime))
+
 (defun auto-revert-buffers ()
   "Revert buffers as specified by Auto-Revert and Global Auto-Revert Mode.
 
@@ -376,8 +473,8 @@
   (let ((bufs (if global-auto-revert-mode
 		  (buffer-list)
 		auto-revert-buffer-list))
-	(remaining '())
-	(new '()))
+	(remaining ())
+	(new ()))
     ;; Partition `bufs' into two halves depending on whether or not
     ;; the buffers are in `auto-revert-remaining-buffers'.  The two
     ;; halves are then re-joined with the "remaining" buffers at the
@@ -398,6 +495,7 @@
 	      ;; Test if someone has turned off Auto-Revert Mode in a
 	      ;; non-standard way, for example by changing major mode.
 	      (if (and (not auto-revert-mode)
+		       (not auto-revert-tail-mode)
 		       (memq buf auto-revert-buffer-list))
 		  (setq auto-revert-buffer-list
 			(delq buf auto-revert-buffer-list)))
--- a/lisp/bindings.el	Tue Jul 13 15:45:15 2004 +0000
+++ b/lisp/bindings.el	Sun Jul 18 21:49:24 2004 +0000
@@ -404,12 +404,12 @@
 (define-key mode-line-mode-menu [highlight-changes-mode]
   `(menu-item ,(purecopy "Highlight changes (Chg)") highlight-changes-mode
 	      :button (:toggle . highlight-changes-mode)))
+(define-key mode-line-mode-menu [hide-ifdef-mode]
+  `(menu-item ,(purecopy "Hide ifdef (Ifdef)") hide-ifdef-mode
+	      :button (:toggle . (bound-and-true-p hide-ifdef-mode))))
 (define-key mode-line-mode-menu [glasses-mode]
   `(menu-item ,(purecopy "Glasses (o^o)") glasses-mode
 	      :button (:toggle . (bound-and-true-p glasses-mode))))
-(define-key mode-line-mode-menu [hide-ifdef-mode]
-  `(menu-item ,(purecopy "Hide ifdef (Ifdef)") hide-ifdef-mode
-	      :button (:toggle . (bound-and-true-p hide-ifdef-mode))))
 (define-key mode-line-mode-menu [font-lock-mode]
   `(menu-item ,(purecopy "Font Lock") font-lock-mode
 	      :button (:toggle . font-lock-mode)))
@@ -419,12 +419,15 @@
 (define-key mode-line-mode-menu [column-number-mode]
   `(menu-item ,(purecopy "Column number") column-number-mode
 	      :button (:toggle . column-number-mode)))
-(define-key mode-line-mode-menu [auto-fill-mode]
-  `(menu-item ,(purecopy "Auto Fill (Fill)") auto-fill-mode
-	      :button (:toggle . auto-fill-function)))
+(define-key mode-line-mode-menu [auto-revert-tail-mode]
+  `(menu-item ,(purecopy "Auto revert tail (Tail)") auto-revert-tail-mode
+	      :button (:toggle . auto-revert-tail-mode)))
 (define-key mode-line-mode-menu [auto-revert-mode]
   `(menu-item ,(purecopy "Auto revert (ARev)") auto-revert-mode
 	      :button (:toggle . auto-revert-mode)))
+(define-key mode-line-mode-menu [auto-fill-mode]
+  `(menu-item ,(purecopy "Auto fill (Fill)") auto-fill-mode
+	      :button (:toggle . auto-fill-function)))
 (define-key mode-line-mode-menu [abbrev-mode]
   `(menu-item ,(purecopy "Abbrev (Abbrev)") abbrev-mode
 	      :button (:toggle . abbrev-mode)))
--- a/lisp/buff-menu.el	Tue Jul 13 15:45:15 2004 +0000
+++ b/lisp/buff-menu.el	Sun Jul 18 21:49:24 2004 +0000
@@ -613,7 +613,7 @@
 			 "  "
 			 (Buffer-menu-make-sort-button "Mode" 4) mode-end
 			 (Buffer-menu-make-sort-button "File" 5) "\n"))
-	 list desired-point name file)
+	 list desired-point name mode file)
     (when Buffer-menu-use-header-line
       (let ((pos 0))
 	;; Turn spaces in the header into stretch specs so they work
@@ -638,8 +638,14 @@
 		  (mapcar
 		   (lambda (buffer)
 		     (with-current-buffer buffer
-		       (setq name (buffer-name)
-			     file (buffer-file-name))
+		       (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)))
 		       (cond
 			;; Don't mention internal buffers.
 			((and (string= (substring name 0 1) " ") (null file)))
@@ -665,7 +671,7 @@
 					   ?% ? )
 				       ;; Identify modified buffers.
 				       (if (buffer-modified-p) ?* ? ))
-			       name (buffer-size) mode-name file)))))
+			       name (buffer-size) mode file)))))
 		   (buffer-list))))
       (dolist (buffer
 	       (if Buffer-menu-sort-column
--- a/lisp/calendar/cal-dst.el	Tue Jul 13 15:45:15 2004 +0000
+++ b/lisp/calendar/cal-dst.el	Sun Jul 18 21:49:24 2004 +0000
@@ -70,14 +70,14 @@
 (defun calendar-time-from-absolute (abs-date s)
   "Time of absolute date ABS-DATE, S seconds after midnight.
 
-Returns the pair (HIGH . LOW) where HIGH and LOW are the high and low
+Returns the list (HIGH LOW) where HIGH and LOW are the high and low
 16 bits, respectively, of the number of seconds 1970-01-01 00:00:00 UTC,
 ignoring leap seconds, that is the equivalent moment to S seconds after
 midnight UTC on absolute date ABS-DATE."
   (let* ((a (- abs-date calendar-system-time-basis))
          (u (+ (* 163 (mod a 512)) (floor s 128))))
     ;; Overflow is a terrible thing!
-    (cons
+    (list
      ;; floor((60*60*24*a + s) / 2^16)
      (+ a (* 163 (floor a 512)) (floor u 512))
      ;; (60*60*24*a + s) mod 2^16
--- a/lisp/dired.el	Tue Jul 13 15:45:15 2004 +0000
+++ b/lisp/dired.el	Sun Jul 18 21:49:24 2004 +0000
@@ -620,8 +620,7 @@
 	     (modtime (visited-file-modtime)))
 	 (or (eq modtime 0)
 	     (not (eq (car attributes) t))
-	     (and (= (car (nth 5 attributes)) (car modtime))
-		  (= (nth 1 (nth 5 attributes)) (cdr modtime)))))))
+	     (equal (nth 5 attributes) modtime)))))
 
 (defun dired-buffer-stale-p (&optional noconfirm)
   "Return non-nil if current dired buffer needs updating.
--- a/lisp/emacs-lisp/testcover.el	Tue Jul 13 15:45:15 2004 +0000
+++ b/lisp/emacs-lisp/testcover.el	Sun Jul 18 21:49:24 2004 +0000
@@ -38,9 +38,9 @@
 ;;   instrumentation callbacks, then replace edebug's callbacks with ours.
 ;; * To show good coverage, we want to see two values for every form, except
 ;;   functions that always return the same value and `defconst' variables
-;;   need show only value for good coverage.  To avoid the brown splotch, the
-;;   definitions for constants and 1-valued functions must precede the
-;;   references.
+;;   need show only one value for good coverage.  To avoid the brown
+;;   splotch, the definitions for constants and 1-valued functions must
+;;   precede the references.
 ;; * Use the macro `1value' in your Lisp code to mark spots where the local
 ;;   code environment causes a function or variable to always have the same
 ;;   value, but the function or variable is not intrinsically 1-valued.
@@ -55,12 +55,14 @@
 ;;   call has the same value!  Also, equal thinks two strings are the same
 ;;   if they differ only in properties.
 ;; * Because we have only a "1value" class and no "always nil" class, we have
-;;   to treat as 1-valued any `and' whose last term is 1-valued, in case the
-;;   last term is always nil.  Example:
+;;   to treat as potentially 1-valued any `and' whose last term is 1-valued,
+;;   in case the last term is always nil.  Example:
 ;;     (and (< (point) 1000) (forward-char 10))
-;;   This form always returns nil.  Similarly, `if' and `cond' are
-;;   treated as 1-valued if all clauses are, in case those values are
-;;   always nil.
+;;   This form always returns nil.  Similarly, `or', `if', and `cond' are
+;;   treated as potentially 1-valued if all clauses are, in case those
+;;   values are always nil.  Unlike truly 1-valued functions, it is not an
+;;   error if these "potentially" 1-valued forms actually return differing
+;;   values.
 
 (require 'edebug)
 (provide 'testcover)
@@ -86,12 +88,14 @@
 
 (defcustom testcover-1value-functions
   '(backward-char barf-if-buffer-read-only beginning-of-line
-    buffer-disable-undo buffer-enable-undo current-global-map deactivate-mark
-    delete-char delete-region ding error forward-char function* insert
-    insert-and-inherit kill-all-local-variables lambda mapc narrow-to-region
-    noreturn push-mark put-text-property run-hooks set-text-properties signal
-    substitute-key-definition suppress-keymap throw undo use-local-map while
-    widen yank)
+    buffer-disable-undo buffer-enable-undo current-global-map
+    deactivate-mark delete-backward-char delete-char delete-region ding
+    forward-char function* insert insert-and-inherit kill-all-local-variables
+    kill-line kill-paragraph kill-region kill-sexp lambda
+    minibuffer-complete-and-exit narrow-to-region next-line push-mark
+    put-text-property run-hooks set-match-data signal
+    substitute-key-definition suppress-keymap undo use-local-map while widen
+    yank)
   "Functions that always return the same value.  No brown splotch is shown
 for these.  This list is quite incomplete!  Notes: Nobody ever changes the
 current global map.  The macro `lambda' is self-evaluating, hence always
@@ -108,9 +112,9 @@
   :type 'hook)
 
 (defcustom testcover-compose-functions
-  '(+ - * / length list make-keymap make-sparse-keymap message propertize
-    replace-regexp-in-string run-with-idle-timer
-    set-buffer-modified-p)
+  '(+ - * / = append length list make-keymap make-sparse-keymap
+    mapcar message propertize replace-regexp-in-string
+    run-with-idle-timer set-buffer-modified-p)
   "Functions that are 1-valued if all their args are either constants or
 calls to one of the `testcover-1value-functions', so if that's true then no
 brown splotch is shown for these.  This list is quite incomplete!  Most
@@ -119,16 +123,16 @@
   :type 'hook)
 
 (defcustom testcover-progn-functions
-  '(define-key fset function goto-char or overlay-put progn save-current-buffer
-    save-excursion save-match-data save-restriction save-selected-window
-    save-window-excursion set set-default setq setq-default
-    with-output-to-temp-buffer with-syntax-table with-temp-buffer
-    with-temp-file with-temp-message with-timeout)
+  '(define-key fset function goto-char mapc overlay-put progn
+    save-current-buffer save-excursion save-match-data
+    save-restriction save-selected-window save-window-excursion
+    set set-default set-marker-insertion-type setq setq-default
+    with-current-buffer with-output-to-temp-buffer with-syntax-table
+    with-temp-buffer with-temp-file with-temp-message with-timeout)
   "Functions whose return value is the same as their last argument.  No
 brown splotch is shown for these if the last argument is a constant or a
 call to one of the `testcover-1value-functions'.  This list is probably
-incomplete!  Note: `or' is here in case the last argument is a function that
-always returns nil."
+incomplete!"
   :group 'testcover
   :type 'hook)
 
@@ -140,6 +144,11 @@
   :group 'testcover
   :type 'hook)
 
+(defcustom testcover-potentially-1value-functions
+  '(add-hook and beep or remove-hook unless when)
+  "Functions that are potentially 1-valued.  No brown splotch if actually
+1-valued, no error if actually multi-valued.")
+
 (defface testcover-nohits-face
   '((t (:background "DeepPink2")))
   "Face for forms that had no hits during coverage test"
@@ -161,7 +170,11 @@
 
 (defvar testcover-module-1value-functions nil
   "Symbols declared with defun in the last file processed by
-`testcover-start', whose functions always return the same value.")
+`testcover-start', whose functions should always return the same value.")
+
+(defvar testcover-module-potentially-1value-functions nil
+  "Symbols declared with defun in the last file processed by
+`testcover-start', whose functions might always return the same value.")
 
 (defvar testcover-vector nil
   "Locally bound to coverage vector for function in progress.")
@@ -206,25 +219,32 @@
     x))
 
 (defun testcover-reinstrument (form)
-  "Reinstruments FORM to use testcover instead of edebug.  This function
-modifies the list that FORM points to.  Result is non-nil if FORM will
-always return the same value."
+  "Reinstruments FORM to use testcover instead of edebug.  This
+function modifies the list that FORM points to.  Result is nil if
+FORM should return multiple vlues, t if should always return same
+value, 'maybe if either is acceptable."
   (let ((fun (car-safe form))
-	id)
+	id val)
     (cond
-     ((not fun) ;Atom
-      (or (not (symbolp form))
-	  (memq form testcover-constants)
-	  (memq form testcover-module-constants)))
-     ((consp fun) ;Embedded list
+     ((not fun)				;Atom
+      (when (or (not (symbolp form))
+		(memq form testcover-constants)
+		(memq form testcover-module-constants))
+	t))
+     ((consp fun)			;Embedded list
       (testcover-reinstrument fun)
       (testcover-reinstrument-list (cdr form))
       nil)
      ((or (memq fun testcover-1value-functions)
 	  (memq fun testcover-module-1value-functions))
-      ;;Always return same value
+      ;;Should always return same value
       (testcover-reinstrument-list (cdr form))
       t)
+     ((or (memq fun testcover-potentially-1value-functions)
+	  (memq fun testcover-module-potentially-1value-functions))
+      ;;Might always return same value
+      (testcover-reinstrument-list (cdr form))
+      'maybe)
      ((memq fun testcover-progn-functions)
       ;;1-valued if last argument is
       (testcover-reinstrument-list (cdr form)))
@@ -233,11 +253,9 @@
       (testcover-reinstrument-list (cddr form))
       (testcover-reinstrument (cadr form)))
      ((memq fun testcover-compose-functions)
-      ;;1-valued if all arguments are
-      (setq id t)
-      (mapc #'(lambda (x) (setq id (or (testcover-reinstrument x) id)))
-	    (cdr form))
-      id)
+      ;;1-valued if all arguments are.  Potentially 1-valued if all
+      ;;arguments are either definitely or potentially.
+      (testcover-reinstrument-compose (cdr form) 'testcover-reinstrument))
      ((eq fun 'edebug-enter)
       ;;(edebug-enter 'SYM ARGS #'(lambda nil FORMS))
       ;;  => (testcover-enter 'SYM #'(lambda nil FORMS))
@@ -252,33 +270,44 @@
 	(aset testcover-vector (cadr (cadr form)) 'ok-coverage))
       (setq id (nth 2 form))
       (setcdr form (nthcdr 2 form))
+      (setq val (testcover-reinstrument (nth 2 form)))
+      (if (eq val t)
+	  (setcar form 'testcover-1value)
+	(setcar form 'testcover-after))
+      (when val
+	;;1-valued or potentially 1-valued
+	(aset testcover-vector id '1value))
       (cond
        ((memq (car-safe (nth 2 form)) testcover-noreturn-functions)
 	;;This function won't return, so set the value in advance
 	;;(edebug-after (edebug-before XXX) YYY FORM)
 	;;  => (progn (edebug-after YYY nil) FORM)
+	(setcar (cdr form) `(,(car form) ,id nil))
 	(setcar form 'progn)
-	(setcar (cdr form) `(testcover-after ,id nil)))
+	(aset testcover-vector id '1value)
+	(setq val t))
        ((eq (car-safe (nth 2 form)) '1value)
 	;;This function is always supposed to return the same value
-	(setcar form 'testcover-1value))
-       (t
-	(setcar form 'testcover-after)))
-      (when (testcover-reinstrument (nth 2 form))
-	(aset testcover-vector id '1value)))
+	(setq val t)
+	(aset testcover-vector id '1value)
+	(setcar form 'testcover-1value)))
+      val)
      ((eq fun 'defun)
-      (if (testcover-reinstrument-list (nthcdr 3 form))
-	  (push (cadr form) testcover-module-1value-functions)))
-     ((eq fun 'defconst)
+      (setq val (testcover-reinstrument-list (nthcdr 3 form)))
+      (when (eq val t)
+	(push (cadr form) testcover-module-1value-functions))
+      (when (eq val 'maybe)
+	(push (cadr form) testcover-module-potentially-1value-functions)))
+     ((memq fun '(defconst defcustom))
       ;;Define this symbol as 1-valued
       (push (cadr form) testcover-module-constants)
       (testcover-reinstrument-list (cddr form)))
      ((memq fun '(dotimes dolist))
       ;;Always returns third value from SPEC
       (testcover-reinstrument-list (cddr form))
-      (setq fun (testcover-reinstrument-list (cadr form)))
+      (setq val (testcover-reinstrument-list (cadr form)))
       (if (nth 2 (cadr form))
-	  fun
+	  val
 	;;No third value, always returns nil
 	t))
      ((memq fun '(let let*))
@@ -286,23 +315,23 @@
       (mapc 'testcover-reinstrument-list (cadr form))
       (testcover-reinstrument-list (cddr form)))
      ((eq fun 'if)
-      ;;1-valued if both THEN and ELSE clauses are
+      ;;Potentially 1-valued if both THEN and ELSE clauses are
       (testcover-reinstrument (cadr form))
       (let ((then (testcover-reinstrument (nth 2 form)))
 	    (else (testcover-reinstrument-list (nthcdr 3 form))))
-	(and then else)))
-     ((memq fun '(when unless and))
-      ;;1-valued if last clause of BODY is
-      (testcover-reinstrument-list (cdr form)))
+	(and then else 'maybe)))
      ((eq fun 'cond)
-      ;;1-valued if all clauses are
-      (testcover-reinstrument-clauses (cdr form)))
+      ;;Potentially 1-valued if all clauses are
+      (when (testcover-reinstrument-compose (cdr form)
+					    'testcover-reinstrument-list)
+	'maybe))
      ((eq fun 'condition-case)
-      ;;1-valued if BODYFORM is and all HANDLERS are
+      ;;Potentially 1-valued if BODYFORM is and all HANDLERS are
       (let ((body (testcover-reinstrument (nth 2 form)))
-	    (errs (testcover-reinstrument-clauses (mapcar #'cdr
-							  (nthcdr 3 form)))))
-	(and body errs)))
+	    (errs (testcover-reinstrument-compose
+		   (mapcar #'cdr (nthcdr 3 form))
+		   'testcover-reinstrument-list)))
+	(and body errs 'maybe)))
      ((eq fun 'quote)
       ;;Don't reinstrument what's inside!
       ;;This doesn't apply within a backquote
@@ -317,16 +346,55 @@
       (let ((testcover-1value-functions
 	     (remq 'quote testcover-1value-functions)))
 	(testcover-reinstrument (cadr form))))
-     ((memq fun '(1value noreturn))
+     ((eq fun '1value)
       ;;Hack - pretend the arg is 1-valued here
-      (if (symbolp (cadr form)) ;A pseudoconstant variable
-	  t
+      (cond
+       ((symbolp (cadr form))
+	;;A pseudoconstant variable
+	t)
+       ((and (eq (car (cadr form)) 'edebug-after)
+	     (symbolp (nth 3 (cadr form))))
+	;;Reference to pseudoconstant
+	(aset testcover-vector (nth 2 (cadr form)) '1value)
+	(setcar (cdr form) `(testcover-1value ,(nth 2 (cadr form))
+					      ,(nth 3 (cadr form))))
+	t)
+       (t
 	(if (eq (car (cadr form)) 'edebug-after)
 	    (setq id (car (nth 3 (cadr form))))
 	  (setq id (car (cadr form))))
 	(let ((testcover-1value-functions
 	       (cons id testcover-1value-functions)))
-	  (testcover-reinstrument (cadr form)))))
+	  (testcover-reinstrument (cadr form))))))
+     ((eq fun 'noreturn)
+      ;;Hack - pretend the arg has no return
+      (cond
+       ((symbolp (cadr form))
+	;;A pseudoconstant variable
+	'maybe)
+       ((and (eq (car (cadr form)) 'edebug-after)
+	     (symbolp (nth 3 (cadr form))))
+	;;Reference to pseudoconstant
+	(aset testcover-vector (nth 2 (cadr form)) '1value)
+	(setcar (cdr form) `(progn (testcover-after ,(nth 2 (cadr form)) nil)
+				   ,(nth 3 (cadr form))))
+	'maybe)
+       (t
+	(if (eq (car (cadr form)) 'edebug-after)
+	    (setq id (car (nth 3 (cadr form))))
+	  (setq id (car (cadr form))))
+	(let ((testcover-noreturn-functions
+	       (cons id testcover-noreturn-functions)))
+	  (testcover-reinstrument (cadr form))))))
+     ((and (eq fun 'apply)
+	   (eq (car-safe (cadr form)) 'quote)
+	   (symbolp (cadr (cadr form))))
+      ;;Apply of a constant symbol.  Process as 1value or noreturn
+      ;;depending on symbol.
+      (setq fun (cons (cadr (cadr form)) (cddr form))
+	    val (testcover-reinstrument fun))
+      (setcdr (cdr form) (cdr fun))
+      val)
      (t ;Some other function or weird thing
       (testcover-reinstrument-list (cdr form))
       nil))))
@@ -341,13 +409,22 @@
       (setq result (testcover-reinstrument (pop list))))
     result))
 
-(defun testcover-reinstrument-clauses (clauselist)
-  "Reinstrument each list in CLAUSELIST.
-Result is t if every clause is 1-valued."
+(defun testcover-reinstrument-compose (list fun)
+  "For a compositional function, the result is 1-valued if all
+arguments are, potentially 1-valued if all arguments are either
+definitely or potentially 1-valued, and multi-valued otherwise.
+FUN should be `testcover-reinstrument' for compositional functions,
+  `testcover-reinstrument-list' for clauses in a `cond'."
   (let ((result t))
     (mapc #'(lambda (x)
-	      (setq result (and (testcover-reinstrument-list x) result)))
-	  clauselist)
+	      (setq x (funcall fun x))
+	      (cond
+	       ((eq result t)
+		(setq result x))
+	       ((eq result 'maybe)
+		(when (not x)
+		  (setq result nil)))))
+	  list)
     result))
 
 (defun testcover-end (buffer)
@@ -387,7 +464,7 @@
     (aset testcover-vector idx (cons '1value val)))
    ((not (and (eq (car-safe (aref testcover-vector idx)) '1value)
 	      (equal (cdr (aref testcover-vector idx)) val)))
-    (error "Value of form marked with `1value' does vary.")))
+    (error "Value of form marked with `1value' does vary: %s" val)))
   val)
 
 
@@ -415,7 +492,7 @@
 	 ov j item)
     (or (and def-mark points coverage)
 	(error "Missing edebug data for function %s" def))
-    (when len
+    (when (> len 0)
       (set-buffer (marker-buffer def-mark))
       (mapc 'delete-overlay
 	    (overlays-in def-mark (+ def-mark (aref points (1- len)) 1)))
--- a/lisp/emulation/cua-base.el	Tue Jul 13 15:45:15 2004 +0000
+++ b/lisp/emulation/cua-base.el	Sun Jul 18 21:49:24 2004 +0000
@@ -974,6 +974,13 @@
 (defvar cua-movement-commands nil
   "User may add additional movement commands to this list.")
 
+(defvar cua--preserve-mark-commands
+  '(end-of-buffer beginning-of-buffer)
+  "List of movement commands that move the mark.
+CUA will preserve the previous mark position if a mark is already
+active before one of these commands is executed.")
+
+(defvar cua--undo-push-mark nil)
 
 ;;; Scrolling commands which does not signal errors at top/bottom
 ;;; of buffer at first key-press (instead moves to top/bottom
@@ -1062,8 +1069,15 @@
 	;; If rectangle is active, expand rectangle in specified direction and ignore the movement.
 	(if movement
 	    (cond
-	     ((memq 'shift (event-modifiers (aref (this-single-command-raw-keys) 0)))
-	      (unless mark-active
+	     ((memq 'shift (event-modifiers
+			    (aref (if window-system
+				      (this-single-command-raw-keys)
+				    (this-single-command-keys)) 0)))
+	      (if mark-active
+		  (if (and (memq this-command cua--preserve-mark-commands)
+			   (not inhibit-mark-movement))
+		      (setq cua--undo-push-mark t
+			    inhibit-mark-movement t))
 		(push-mark-command nil t))
 	      (setq cua--last-region-shifted t)
 	      (setq cua--explicit-region-start nil))
@@ -1110,6 +1124,9 @@
 (defun cua--post-command-handler ()
   (condition-case nil
       (progn
+	(when cua--undo-push-mark
+	  (setq cua--undo-push-mark nil
+		inhibit-mark-movement nil))
 	(when cua--global-mark-active
 	  (cua--global-mark-post-command))
 	(when (fboundp 'cua--rectangle-post-command)
--- a/lisp/font-lock.el	Tue Jul 13 15:45:15 2004 +0000
+++ b/lisp/font-lock.el	Sun Jul 18 21:49:24 2004 +0000
@@ -693,7 +693,7 @@
 	   ;; If the keywords were compiled before, compile them again.
 	   (if was-compiled
 	       (set (make-local-variable 'font-lock-keywords)
-		    (font-lock-compile-keywords keywords t)))))))
+		    (font-lock-compile-keywords font-lock-keywords t)))))))
 
 (defun font-lock-update-removed-keyword-alist (mode keywords append)
   ;; Update `font-lock-removed-keywords-alist' when adding new
@@ -801,7 +801,7 @@
 	   ;; If the keywords were compiled before, compile them again.
 	   (if was-compiled
 	       (set (make-local-variable 'font-lock-keywords)
-		    (font-lock-compile-keywords keywords t)))))))
+		    (font-lock-compile-keywords font-lock-keywords t)))))))
 
 ;;; Font Lock Support mode.
 
@@ -1944,12 +1944,12 @@
 		  '("when" "unless" "case" "ecase" "typecase" "etypecase"
 		    "ccase" "ctypecase" "handler-case" "handler-bind"
 		    "restart-bind" "restart-case" "in-package"
-		    "cerror" "break" "ignore-errors"
+		    "break" "ignore-errors"
 		    "loop" "do" "do*" "dotimes" "dolist" "the" "locally"
 		    "proclaim" "declaim" "declare" "symbol-macrolet"
 		    "lexical-let" "lexical-let*" "flet" "labels" "compiler-let"
-		    "destructuring-bind" "macrolet" "tagbody" "block"
-		    "multiple-value-bind"
+		    "destructuring-bind" "macrolet" "tagbody" "block" "go"
+		    "multiple-value-bind" "multiple-value-prog1"
 		    "return" "return-from"
 		    "with-accessors" "with-compilation-unit"
 		    "with-condition-restarts" "with-hash-table-iterator"
@@ -1967,7 +1967,7 @@
 	    '(2 font-lock-constant-face nil t))
       ;;
       ;; Erroneous structures.
-      '("(\\(abort\\|assert\\|error\\|signal\\)\\>" 1 font-lock-warning-face)
+      '("(\\(abort\\|assert\\|warn\\|check-type\\|cerror\\|error\\|signal\\)\\>" 1 font-lock-warning-face)
       ;;
       ;; Words inside \\[] tend to be for `substitute-command-keys'.
       '("\\\\\\\\\\[\\(\\sw+\\)]" 1 font-lock-constant-face prepend)
--- a/lisp/mail/footnote.el	Tue Jul 13 15:45:15 2004 +0000
+++ b/lisp/mail/footnote.el	Sun Jul 18 21:49:24 2004 +0000
@@ -87,8 +87,11 @@
 
 ;;; Interface variables that probably shouldn't be changed
 
-(defconst footnote-section-tag "Footnotes: "
-  "*Tag inserted at beginning of footnote section.")
+(defcustom footnote-section-tag "Footnotes: "
+  "*Tag inserted at beginning of footnote section."
+  :version "21.4"
+  :type 'string
+  :group 'footnote)
 
 (defcustom footnote-section-tag-regexp "Footnotes\\(\\[.\\]\\)?: "
   "*Regexp which indicates the start of a footnote section.
--- a/lisp/mh-e/mh-loaddefs.el	Tue Jul 13 15:45:15 2004 +0000
+++ b/lisp/mh-e/mh-loaddefs.el	Sun Jul 18 21:49:24 2004 +0000
@@ -180,7 +180,7 @@
 ;;;***
 
 ;;;### (autoloads (mh-goto-cur-msg mh-update-sequences mh-folder-line-matches-show-buffer-p)
-;;;;;;  "mh-e" "mh-e.el" (16627 18152))
+;;;;;;  "mh-e" "mh-e.el" (16627 22341))
 ;;; Generated autoloads from mh-e.el
 
 (autoload (quote mh-folder-line-matches-show-buffer-p) "mh-e" "\
--- a/lisp/net/tramp-smb.el	Tue Jul 13 15:45:15 2004 +0000
+++ b/lisp/net/tramp-smb.el	Sun Jul 18 21:49:24 2004 +0000
@@ -1012,7 +1012,7 @@
 	(when real-user
 	  (let ((pw-prompt "Password:"))
 	    (tramp-message 9 "Sending password")
-	    (tramp-enter-password p pw-prompt)))
+	    (tramp-enter-password p pw-prompt user host)))
 
 	(unless (tramp-smb-wait-for-output user host)
 	  (tramp-clear-passwd user host)
--- a/lisp/net/tramp-vc.el	Tue Jul 13 15:45:15 2004 +0000
+++ b/lisp/net/tramp-vc.el	Sun Jul 18 21:49:24 2004 +0000
@@ -77,7 +77,7 @@
   "Like `vc-do-command' but invoked for tramp files.
 See `vc-do-command' for more information."
   (save-match-data
-    (and file (setq file (tramp-handle-expand-file-name file)))
+    (and file (setq file (expand-file-name file)))
     (if (not buffer) (setq buffer "*vc*"))
     (if vc-command-messages
 	(message "Running `%s' on `%s'..." command file))
@@ -85,7 +85,7 @@
 	  (squeezed nil)
 	  (olddir default-directory)
 	  vc-file status)
-      (let* ((v (tramp-dissect-file-name (tramp-handle-expand-file-name file)))
+      (let* ((v (tramp-dissect-file-name (expand-file-name file)))
 	     (multi-method (tramp-file-name-multi-method v))
 	     (method (tramp-file-name-method v))
 	     (user (tramp-file-name-user v))
@@ -130,7 +130,7 @@
 	(save-excursion
 	  (save-window-excursion
 	    ;; Actually execute remote command
-	    (tramp-handle-shell-command
+	    (shell-command
 	     (mapconcat 'tramp-shell-quote-argument
 			(cons command squeezed) " ") t)
 	    ;;(tramp-wait-for-output)
@@ -190,7 +190,7 @@
       (let ((w32-quote-process-args t))
         (when (eq okstatus 'async)
           (message "Tramp doesn't do async commands, running synchronously."))
-        (setq status (tramp-handle-shell-command
+        (setq status (shell-command
                       (mapconcat 'tramp-shell-quote-argument
                                  (cons command squeezed) " ") t))
         (when (or (not (integerp status))
@@ -257,7 +257,7 @@
   ;; Don't switch to the *vc-info* buffer before running the
   ;; command, because that would change its default directory
   (save-match-data
-    (let* ((v (tramp-dissect-file-name (tramp-handle-expand-file-name file)))
+    (let* ((v (tramp-dissect-file-name (expand-file-name file)))
 	   (multi-method (tramp-file-name-multi-method v))
 	   (method (tramp-file-name-method v))
 	   (user (tramp-file-name-user v))
@@ -284,7 +284,7 @@
 	(save-excursion
 	  (save-window-excursion
 	    ;; Actually execute remote command
-	    (tramp-handle-shell-command
+	    (shell-command
 	     (mapconcat 'tramp-shell-quote-argument
 			(append (list command) args (list localname)) " ")
 	     (get-buffer-create"*vc-info*"))
@@ -414,7 +414,7 @@
 	    (nth 2 (file-attributes file)))))
     (if (and uid (/= uid remote-uid))
 	(error "tramp-handle-vc-user-login-name cannot map a uid to a name")
-      (let* ((v (tramp-dissect-file-name (tramp-handle-expand-file-name file)))
+      (let* ((v (tramp-dissect-file-name (expand-file-name file)))
 	     (u (tramp-file-name-user v)))
 	(cond ((stringp u) u)
 	      ((vectorp u) (elt u (1- (length u))))
@@ -445,8 +445,8 @@
 (defun tramp-file-owner (filename)
   "Return who owns FILE (user name, as a string)."
   (let ((v (tramp-dissect-file-name 
-	    (tramp-handle-expand-file-name filename))))
-    (if (not (tramp-handle-file-exists-p filename))
+	    (expand-file-name filename))))
+    (if (not (file-exists-p filename))
         nil                             ; file cannot be opened
       ;; file exists, find out stuff
       (save-excursion
--- a/lisp/net/tramp.el	Tue Jul 13 15:45:15 2004 +0000
+++ b/lisp/net/tramp.el	Sun Jul 18 21:49:24 2004 +0000
@@ -916,8 +916,8 @@
   "Regular expression indicating a process has finished.
 In fact this expression is empty by intention, it will be used only to
 check regularly the status of the associated process.
-The answer will be provided by `tramp-action-process-alive' and
-`tramp-action-out-of-band', which see."
+The answer will be provided by `tramp-action-process-alive',
+`tramp-multi-action-process-alive' and`tramp-action-out-of-band', which see."
   :group 'tramp
   :type 'regexp)
 
@@ -1321,7 +1321,7 @@
     (shell-prompt-pattern tramp-multi-action-succeed)
     (tramp-shell-prompt-pattern tramp-multi-action-succeed)
     (tramp-wrong-passwd-regexp tramp-multi-action-permission-denied)
-    (tramp-process-alive-regexp tramp-action-process-alive))
+    (tramp-process-alive-regexp tramp-multi-action-process-alive))
   "List of pattern/action pairs.
 This list is used for each hop in multi-hop connections.
 See `tramp-actions-before-shell' for more info."
@@ -2165,7 +2165,7 @@
   (let ((nonnumeric (and id-format (equal id-format 'string)))
 	result)
     (with-parsed-tramp-file-name filename nil
-      (when (tramp-handle-file-exists-p filename)
+      (when (file-exists-p filename)
 	;; file exists, find out stuff
 	(save-excursion
 	  (if (tramp-get-remote-perl multi-method method user host)
@@ -2331,7 +2331,12 @@
 ;; This function makes the same assumption as
 ;; `tramp-handle-set-visited-file-modtime'.
 (defun tramp-handle-verify-visited-file-modtime (buf)
-  "Like `verify-visited-file-modtime' for tramp files."
+  "Like `verify-visited-file-modtime' for tramp files.
+At the time `verify-visited-file-modtime' calls this function, we
+already know that the buffer is visiting a file and that
+`visited-file-modtime' does not return 0.  Do not call this
+function directly, unless those two cases are already taken care
+of."
   (with-current-buffer buf
     (let ((f (buffer-file-name)))
       (with-parsed-tramp-file-name f nil
@@ -2343,7 +2348,14 @@
 		 ;; (HIGH . LOW)?
 		 (let ((mt (visited-file-modtime)))
 		   (< (abs (tramp-time-diff
-			    modtime (list (car mt) (cdr mt)))) 2)))
+			    modtime
+			    ;; For compatibility, deal with both the old
+			    ;; (HIGH . LOW) and the new (HIGH LOW)
+			    ;; return values of `visited-file-modtime'.
+			    (if (atom (cdr mt))
+				(list (car mt) (cdr mt))
+			      mt)))
+		      2)))
 		(attr
 		 (save-excursion
 		   (tramp-send-command
@@ -2502,19 +2514,19 @@
 (defun tramp-handle-file-writable-p (filename)
   "Like `file-writable-p' for tramp files."
   (with-parsed-tramp-file-name filename nil
-    (if (tramp-handle-file-exists-p filename)
+    (if (file-exists-p filename)
 	;; Existing files must be writable.
 	(zerop (tramp-run-test "-w" filename))
       ;; If file doesn't exist, check if directory is writable.
       (and (zerop (tramp-run-test
-		   "-d" (tramp-handle-file-name-directory filename)))
+		   "-d" (file-name-directory filename)))
 	   (zerop (tramp-run-test
-		   "-w" (tramp-handle-file-name-directory filename)))))))
+		   "-w" (file-name-directory filename)))))))
 
 (defun tramp-handle-file-ownership-preserved-p (filename)
   "Like `file-ownership-preserved-p' for tramp files."
   (with-parsed-tramp-file-name filename nil
-    (or (not (tramp-handle-file-exists-p filename))
+    (or (not (file-exists-p filename))
 	;; Existing files must be writable.
 	(zerop (tramp-run-test "-O" filename)))))
 
@@ -3057,7 +3069,7 @@
   (with-parsed-tramp-file-name filename nil
     ;; run a shell command 'rm -r <localname>'
     ;; Code shamelessly stolen for the dired implementation and, um, hacked :)
-    (or (tramp-handle-file-exists-p filename)
+    (or (file-exists-p filename)
 	(signal
 	 'file-error
 	 (list "Removing old file name" "no such directory" filename)))
@@ -3068,7 +3080,7 @@
     ;; This might take a while, allow it plenty of time.
     (tramp-wait-for-output 120)
     ;; Make sure that it worked...
-    (and (tramp-handle-file-exists-p filename)
+    (and (file-exists-p filename)
 	 (error "Failed to recusively delete %s" filename))))
 	 
 (defun tramp-handle-dired-call-process (program discard &rest arguments)
@@ -3600,45 +3612,47 @@
 
 (defun tramp-handle-find-backup-file-name (filename)
   "Like `find-backup-file-name' for tramp files."
-
-  (if (or (and (not (featurep 'xemacs))
-	       (not (boundp 'tramp-backup-directory-alist)))
-	  (and (featurep 'xemacs)
-	       (not (boundp 'tramp-bkup-backup-directory-info))))
-
-      ;; No tramp backup directory alist defined, or nil
-      (tramp-run-real-handler 'find-backup-file-name (list filename))
-
-    (with-parsed-tramp-file-name filename nil
-      (let* ((backup-var
-	      (copy-tree
-	       (if (featurep 'xemacs)
-		   ;; XEmacs case
-		   (symbol-value 'tramp-bkup-backup-directory-info)
-		 ;; Emacs case
-		 (symbol-value 'tramp-backup-directory-alist))))
-
-	     ;; We set both variables. It doesn't matter whether it is
-	     ;; Emacs or XEmacs
-	     (backup-directory-alist backup-var)
-	     (bkup-backup-directory-info backup-var))
-
-	(mapcar
-	 '(lambda (x)
-	    (let ((dir (if (consp (cdr x)) (car (cdr x)) (cdr x))))
-	      (when (and (stringp dir)
-			 (file-name-absolute-p dir)
-			 (not (tramp-file-name-p dir)))
-		;; Prepend absolute directory names with tramp prefix
-		(if (consp (cdr x))
-		    (setcar (cdr x)
-			    (tramp-make-tramp-file-name
-			     multi-method method user host dir))
-		  (setcdr x (tramp-make-tramp-file-name
-			     multi-method method user host dir))))))
-	 backup-var)
-
-	(tramp-run-real-handler 'find-backup-file-name (list filename))))))
+  (with-parsed-tramp-file-name filename nil
+    ;; We set both variables. It doesn't matter whether it is
+    ;; Emacs or XEmacs
+    (let ((backup-directory-alist
+	   ;; Emacs case
+	   (when (boundp 'backup-directory-alist)
+	     (if (boundp 'tramp-backup-directory-alist)
+		 (mapcar
+		  '(lambda (x)
+		     (cons
+		      (car x)
+		      (if (and (stringp (cdr x))
+			       (file-name-absolute-p (cdr x))
+			       (not (tramp-file-name-p (cdr x))))
+			  (tramp-make-tramp-file-name
+			   multi-method method user host (cdr x))
+			(cdr x))))
+		  (symbol-value 'tramp-backup-directory-alist))
+	       (symbol-value 'backup-directory-alist))))
+
+	  (bkup-backup-directory-info
+	   ;; XEmacs case
+	   (when (boundp 'bkup-backup-directory-info)
+	     (if (boundp 'tramp-bkup-backup-directory-info)
+		 (mapcar
+		  '(lambda (x)
+		     (nconc
+		      (list (car x))
+		      (list
+		       (if (and (stringp (car (cdr x)))
+				(file-name-absolute-p (car (cdr x)))
+				(not (tramp-file-name-p (car (cdr x)))))
+			   (tramp-make-tramp-file-name
+			    multi-method method user host (car (cdr x)))
+			 (car (cdr x))))
+		      (cdr (cdr x))))
+		  (symbol-value 'tramp-bkup-backup-directory-info))
+	       (symbol-value 'bkup-backup-directory-info)))))
+
+      (tramp-run-real-handler 'find-backup-file-name (list filename)))))
+
 
 ;; CCC grok APPEND, LOCKNAME, CONFIRM
 (defun tramp-handle-write-region
@@ -3682,6 +3696,9 @@
       ;; use an encoding function, but currently we use it always
       ;; because this makes the logic simpler.
       (setq tmpfil (tramp-make-temp-file))
+      ;; Set current buffer.  If connection wasn't open, `file-modes' has
+      ;; changed it accidently.
+      (set-buffer curbuf)
       ;; We say `no-message' here because we don't want the visited file
       ;; modtime data to be clobbered from the temp file.  We call
       ;; `set-visited-file-modtime' ourselves later on.
@@ -3965,14 +3982,50 @@
        (foreign (apply foreign operation args))
        (t (tramp-run-real-handler operation args))))))
 
+
+;; In Emacs, there is some concurrency due to timers.  If a timer
+;; interrupts Tramp and wishes to use the same connection buffer as
+;; the "main" Emacs, then garbage might occur in the connection
+;; buffer.  Therefore, we need to make sure that a timer does not use
+;; the same connection buffer as the "main" Emacs.  We implement a
+;; cheap global lock, instead of locking each connection buffer
+;; separately.  The global lock is based on two variables,
+;; `tramp-locked' and `tramp-locker'.  `tramp-locked' is set to true
+;; (with setq) to indicate a lock.  But Tramp also calls itself during
+;; processing of a single file operation, so we need to allow
+;; recursive calls.  That's where the `tramp-locker' variable comes in
+;; -- it is let-bound to t during the execution of the current
+;; handler.  So if `tramp-locked' is t and `tramp-locker' is also t,
+;; then we should just proceed because we have been called
+;; recursively.  But if `tramp-locker' is nil, then we are a timer
+;; interrupting the "main" Emacs, and then we signal an error.
+
+(defvar tramp-locked nil
+  "If non-nil, then Tramp is currently busy.
+Together with `tramp-locker', this implements a locking mechanism
+preventing reentrant calls of Tramp.")
+
+(defvar tramp-locker nil
+  "If non-nil, then a caller has locked Tramp.
+Together with `tramp-locked', this implements a locking mechanism
+preventing reentrant calls of Tramp.")
+
 (defun tramp-sh-file-name-handler (operation &rest args)
   "Invoke remote-shell Tramp file name handler.
 Fall back to normal file name handler if no Tramp handler exists."
-  (save-match-data
-    (let ((fn (assoc operation tramp-file-name-handler-alist)))
-      (if fn
-	  (apply (cdr fn) args)
-	(tramp-run-real-handler operation args)))))
+  (when (and tramp-locked (not tramp-locker))
+    (signal 'file-error "Forbidden reentrant call of Tramp"))
+  (let ((tl tramp-locked))
+    (unwind-protect
+	(progn
+	  (setq tramp-locked t)
+	  (let ((tramp-locker t))
+	    (save-match-data
+	      (let ((fn (assoc operation tramp-file-name-handler-alist)))
+		(if fn
+		    (apply (cdr fn) args)
+		  (tramp-run-real-handler operation args))))))
+      (setq tramp-locked tl))))
 
 ;;;###autoload
 (defun tramp-completion-file-name-handler (operation &rest args)
@@ -4055,7 +4108,7 @@
 			     (tramp-make-tramp-file-name multi-method method
 							 user host x)))
 		 (read (current-buffer))))))
-	(list (tramp-handle-expand-file-name name))))))
+	(list (expand-file-name name))))))
 
 ;; Check for complete.el and override PC-expand-many-files if appropriate.
 (eval-and-compile
@@ -4066,7 +4119,7 @@
         (symbol-function 'PC-expand-many-files))
   (defun PC-expand-many-files (name)
     (if (tramp-tramp-file-p name)
-        (tramp-handle-expand-many-files name)
+        (expand-many-files name)
       (tramp-save-PC-expand-many-files name))))
 
 ;; Why isn't eval-after-load sufficient?
@@ -4817,17 +4870,17 @@
     ;; `/usr/bin/test -e'       In case `/bin/test' does not exist.
     (unless (or
              (and (setq tramp-file-exists-command "test -e %s")
-                  (tramp-handle-file-exists-p existing)
-                  (not (tramp-handle-file-exists-p nonexisting)))
+                  (file-exists-p existing)
+                  (not (file-exists-p nonexisting)))
              (and (setq tramp-file-exists-command "/bin/test -e %s")
-                  (tramp-handle-file-exists-p existing)
-                  (not (tramp-handle-file-exists-p nonexisting)))
+                  (file-exists-p existing)
+                  (not (file-exists-p nonexisting)))
              (and (setq tramp-file-exists-command "/usr/bin/test -e %s")
-                  (tramp-handle-file-exists-p existing)
-                  (not (tramp-handle-file-exists-p nonexisting)))
+                  (file-exists-p existing)
+                  (not (file-exists-p nonexisting)))
              (and (setq tramp-file-exists-command "ls -d %s")
-                  (tramp-handle-file-exists-p existing)
-                  (not (tramp-handle-file-exists-p nonexisting))))
+                  (file-exists-p existing)
+                  (not (file-exists-p nonexisting))))
       (error "Couldn't find command to check if file exists."))))
     
 
@@ -4889,9 +4942,8 @@
 METHOD, USER and HOST specify the connection, CMD (the absolute file name of)
 the `ls' executable.  Returns t if CMD supports the `-n' option, nil
 otherwise."
-  (tramp-message 9 "Checking remote `%s' command for `-n' option"
-               cmd)
-  (when (tramp-handle-file-executable-p
+  (tramp-message 9 "Checking remote `%s' command for `-n' option" cmd)
+  (when (file-executable-p
          (tramp-make-tramp-file-name multi-method method user host cmd))
     (let ((result nil))
       (tramp-message 7 "Testing remote command `%s' for -n..." cmd)
@@ -4949,7 +5001,7 @@
   "Query the user for a password."
   (let ((pw-prompt (match-string 0)))
     (tramp-message 9 "Sending password")
-    (tramp-enter-password p pw-prompt)))
+    (tramp-enter-password p pw-prompt user host)))
 
 (defun tramp-action-succeed (p multi-method method user host)
   "Signal success in finding shell prompt."
@@ -5027,7 +5079,7 @@
 (defun tramp-multi-action-password (p method user host)
   "Query the user for a password."
   (tramp-message 9 "Sending password")
-  (tramp-enter-password p (match-string 0)))
+  (tramp-enter-password p (match-string 0) user host))
 
 (defun tramp-multi-action-succeed (p method user host)
   "Signal success in finding shell prompt."
@@ -5042,6 +5094,11 @@
   (erase-buffer)
   (throw 'tramp-action 'permission-denied))
 
+(defun tramp-multi-action-process-alive (p method user host)
+  "Check whether a process has finished."
+  (unless (memq (process-status p) '(run open))
+    (throw 'tramp-action 'process-died)))
+
 ;; Functions for processing the actions.
 
 (defun tramp-process-one-action (p multi-method method user host actions)
@@ -5239,12 +5296,13 @@
 	  (login-args (tramp-get-method-parameter
 		     multi-method
 		     (tramp-find-method multi-method method user host)
-		     user host 'tramp-login-args)))
+		     user host 'tramp-login-args))
+	  (real-host host))
       ;; The following should be changed.  We need a more general
       ;; mechanism to parse extra host args.
       (when (string-match "\\([^#]*\\)#\\(.*\\)" host)
 	(setq login-args (cons "-p" (cons (match-string 2 host) login-args)))
-	(setq host (match-string 1 host)))
+	(setq real-host (match-string 1 host)))
       (setenv "TERM" tramp-terminal-type)
       (let* ((default-directory (tramp-temporary-file-directory))
 	     ;; If we omit the conditional, we would use
@@ -5255,9 +5313,9 @@
                                        tramp-dos-coding-system))
              (p (if (and user (not (string= user "")))
                     (apply #'start-process bufnam buf login-program  
-                           host "-l" user login-args)
+                           real-host "-l" user login-args)
                   (apply #'start-process bufnam buf login-program 
-                         host login-args)))
+                         real-host login-args)))
              (found nil))
         (tramp-set-process-query-on-exit-flag p nil)
 
@@ -5540,10 +5598,10 @@
     (pop-to-buffer (buffer-name))
     (apply 'error error-args)))
 
-(defun tramp-enter-password (p prompt)
+(defun tramp-enter-password (p prompt user host)
   "Prompt for a password and send it to the remote end.
 Uses PROMPT as a prompt and sends the password to process P."
-  (let ((pw (tramp-read-passwd prompt)))
+  (let ((pw (tramp-read-passwd user host prompt)))
     (erase-buffer)
     (process-send-string
      p (concat pw
@@ -6710,16 +6768,11 @@
                             "`temp-directory' is defined -- using /tmp."))
            (file-name-as-directory "/tmp"))))
 
-(defun tramp-read-passwd (prompt)
+(defun tramp-read-passwd (user host prompt)
   "Read a password from user (compat function).
 Invokes `password-read' if available, `read-passwd' else."
   (if (functionp 'password-read)
-      (let* ((user (or tramp-current-user (user-login-name)))
-	     (host (or tramp-current-host (system-name)))
-	     (key (if (and (stringp user) (stringp host))
-		      (concat user "@" host)
-		    (concat "[" (mapconcat 'identity user "/") "]@["
-			    (mapconcat 'identity host "/") "]")))
+      (let* ((key (concat (or user (user-login-name)) "@" host))
 	     (password (apply #'password-read (list prompt key))))
 	(apply #'password-cache-add (list key password))
 	password)
--- a/lisp/progmodes/grep.el	Tue Jul 13 15:45:15 2004 +0000
+++ b/lisp/progmodes/grep.el	Sun Jul 18 21:49:24 2004 +0000
@@ -414,7 +414,7 @@
 (defun grep (command-args &optional highlight-regexp)
   "Run grep, with user-specified args, and collect output in a buffer.
 While grep runs asynchronously, you can use \\[next-error] (M-x next-error),
-or \\<grep-minor-mode-map>\\[compile-goto-error] in the grep \
+or \\<grep-mode-map>\\[compile-goto-error] in the grep \
 output buffer, to go to the lines
 where grep found matches.
 
--- a/lisp/progmodes/which-func.el	Tue Jul 13 15:45:15 2004 +0000
+++ b/lisp/progmodes/which-func.el	Sun Jul 18 21:49:24 2004 +0000
@@ -99,7 +99,33 @@
   :group 'which-func
   :type 'integer)
 
-(defcustom which-func-format '("[" which-func-current "]")
+(defvar which-func-keymap
+  (let ((map (make-sparse-keymap)))
+    (define-key map [mode-line mouse-1] 'beginning-of-defun)
+    (define-key map [mode-line mouse-2]
+      (lambda ()
+	(interactive)
+	(if (eq (point-min) 1)
+	    (narrow-to-defun)
+	  (widen))))
+    (define-key map [mode-line mouse-3] 'end-of-defun)
+    map)
+  "Keymap to display on mode line which-func.")
+
+(defface which-func-face
+  '((t (:inherit font-lock-function-name-face)))
+  "Face used to highlight mode line function names.
+Defaults to `font-lock-function-name-face' if font-lock is loaded."
+  :group 'which-func)
+
+(defcustom which-func-format
+  `("["
+    (:propertize which-func-current
+		 local-map ,which-func-keymap
+		 face which-func-face
+		 ;;mouse-face highlight	; currently not evaluated :-(
+		 help-echo "mouse-1: go to beginning, mouse-2: toggle rest visibility, mouse-3: go to end")
+    "]")
   "Format for displaying the function in the mode line."
   :group 'which-func
   :type 'sexp)
--- a/lisp/replace.el	Tue Jul 13 15:45:15 2004 +0000
+++ b/lisp/replace.el	Sun Jul 18 21:49:24 2004 +0000
@@ -786,7 +786,8 @@
 		 nil
 		 nil
 		 nil
-		 'regexp-history)))
+		 'regexp-history
+		 default)))
 	  (if (equal input "")
 	      default
 	    input))
--- a/lisp/simple.el	Tue Jul 13 15:45:15 2004 +0000
+++ b/lisp/simple.el	Sun Jul 18 21:49:24 2004 +0000
@@ -562,9 +562,13 @@
        (skip-chars-forward " \t")
        (constrain-to-field nil orig-pos t)))))
 
+(defvar inhibit-mark-movement nil
+  "If non-nil, \\[beginning-of-buffer] and \\[end-of-buffer] does not set the mark.")
+
 (defun beginning-of-buffer (&optional arg)
   "Move point to the beginning of the buffer; leave mark at previous position.
-With arg N, put point N/10 of the way from the beginning.
+With \\[universal-argument] prefix, do not set mark at previous position.
+With numeric arg N, put point N/10 of the way from the beginning.
 
 If the buffer is narrowed, this command uses the beginning and size
 of the accessible part of the buffer.
@@ -572,9 +576,10 @@
 Don't use this command in Lisp programs!
 \(goto-char (point-min)) is faster and avoids clobbering the mark."
   (interactive "P")
-  (push-mark)
+  (unless (or inhibit-mark-movement (consp arg))
+    (push-mark))
   (let ((size (- (point-max) (point-min))))
-    (goto-char (if arg
+    (goto-char (if (and arg (not (consp arg)))
 		   (+ (point-min)
 		      (if (> size 10000)
 			  ;; Avoid overflow for large buffer sizes!
@@ -586,7 +591,8 @@
 
 (defun end-of-buffer (&optional arg)
   "Move point to the end of the buffer; leave mark at previous position.
-With arg N, put point N/10 of the way from the end.
+With \\[universal-argument] prefix, do not set mark at previous position.
+With numeric arg N, put point N/10 of the way from the end.
 
 If the buffer is narrowed, this command uses the beginning and size
 of the accessible part of the buffer.
@@ -594,9 +600,10 @@
 Don't use this command in Lisp programs!
 \(goto-char (point-max)) is faster and avoids clobbering the mark."
   (interactive "P")
-  (push-mark)
+  (unless (or inhibit-mark-movement (consp arg))
+    (push-mark))
   (let ((size (- (point-max) (point-min))))
-    (goto-char (if arg
+    (goto-char (if (and arg (not (consp arg)))
 		   (- (point-max)
 		      (if (> size 10000)
 			  ;; Avoid overflow for large buffer sizes!
--- a/lispref/ChangeLog	Tue Jul 13 15:45:15 2004 +0000
+++ b/lispref/ChangeLog	Sun Jul 18 21:49:24 2004 +0000
@@ -1,3 +1,30 @@
+2004-07-17  Richard M. Stallman  <rms@gnu.org>
+
+	* display.texi (Overlay Properties): Adding `evaporate' prop
+	deletes empty overlay immediately.
+
+	* abbrevs.texi (Abbrev Expansion): Clarify pre-abbrev-expand-hook,
+	fix example.
+
+2004-07-16  Jim Blandy  <jimb@redhat.com>
+
+	* searching.texi (Regexp Backslash): Document new \_< and \_>
+	operators.
+
+2004-07-16  Juanma Barranquero  <lektu@terra.es>
+
+	* display.texi (Images): Fix Texinfo usage.
+
+2004-07-14  Luc Teirlinck  <teirllm@auburn.edu>
+
+	* buffers.texi (Modification Time): `visited-file-modtime' now
+	returns a list of two integers, instead of a cons.
+
+2004-07-13  Luc Teirlinck  <teirllm@auburn.edu>
+
+	* windows.texi: Various changes in addition to:
+	(Splitting Windows): Add `split-window-keep-point'.
+
 2004-07-09  Richard M. Stallman  <rms@gnu.org>
 
 	* frames.texi (Input Focus): Minor fix.
--- a/lispref/abbrevs.texi	Tue Jul 13 15:45:15 2004 +0000
+++ b/lispref/abbrevs.texi	Sun Jul 18 21:49:24 2004 +0000
@@ -335,10 +335,9 @@
 @end defvar
 
   The following sample code shows a simple use of
-@code{pre-abbrev-expand-hook}.  If the user terminates an abbrev with a
-punctuation character, the hook function asks for confirmation.  Thus,
-this hook allows the user to decide whether to expand the abbrev, and
-aborts expansion if it is not confirmed.
+@code{pre-abbrev-expand-hook}.  If the user terminates an abbrev with
+a punctuation character, the hook function asks for confirmation.  It
+aborts expansion if the user does not confirm.
 
 @smallexample
 (add-hook 'pre-abbrev-expand-hook 'query-if-not-space)
@@ -350,12 +349,10 @@
 ;; @r{user entered some other character, this function asks whether}
 ;; @r{expansion should continue.}
 
-;; @r{If the user answers the prompt with @kbd{y}, the function returns}
-;; @r{@code{nil} (because of the @code{not} function), but that is}
-;; @r{acceptable; the return value has no effect on expansion.}
+;; @r{The function's return value makes no difference.}
 
 (defun query-if-not-space ()
-  (if (/= ?\s  (preceding-char))
+  (if (/= ?\s last-command-char)
       (if (not (y-or-n-p "Do you want to expand this abbrev? "))
           (error "Not expanding this abbrev"))))
 @end smallexample
--- a/lispref/buffers.texi	Tue Jul 13 15:45:15 2004 +0000
+++ b/lispref/buffers.texi	Sun Jul 18 21:49:24 2004 +0000
@@ -625,9 +625,9 @@
 @c Emacs 19 feature
 @defun visited-file-modtime
 This function returns the current buffer's recorded last file
-modification time, as a list of the form @code{(@var{high} .
-@var{low})}.  (This is the same format that @code{file-attributes}
-uses to return time values; see @ref{File Attributes}.)
+modification time, as a list of the form @code{(@var{high} @var{low})}.
+(This is the same format that @code{file-attributes} uses to return
+time values; see @ref{File Attributes}.)
 
 The function returns zero if the buffer has no recorded last
 modification time, which can happen, for instance, if the record has
--- a/lispref/display.texi	Tue Jul 13 15:45:15 2004 +0000
+++ b/lispref/display.texi	Sun Jul 18 21:49:24 2004 +0000
@@ -1165,9 +1165,9 @@
 @item evaporate
 @kindex evaporate @r{(overlay property)}
 If this property is non-@code{nil}, the overlay is deleted automatically
-if it becomes empty (i.e., if its length becomes zero).  However,
-if the overlay is @emph{already} empty, @code{evaporate} does not
-delete it.
+if it becomes empty (i.e., if its length becomes zero).  If you give
+an empty overlay a non-@code{nil} @code{evaporate} property, that deletes
+it immediately.
 
 @item local-map
 @cindex keymap of character (and overlays)
@@ -2907,7 +2907,7 @@
 This in an alist of image types vs external libraries needed to
 display them.
 
-Each element is a list @code{(@var{IMAGE-TYPE} @var{LIBRARY}...)},
+Each element is a list @code{(@var{image-type} @var{library}...)},
 where the car is a supported image format from @code{image-types}, and
 the rest are strings giving alternate filenames for the corresponding
 external libraries to load.
@@ -2924,9 +2924,10 @@
 @defun  image-type-available-p type
 @findex image-type-available-p
 
-This function returns non-nil if image type @var{TYPE} is available,
-i.e., if images of this type can be loaded and displayed in Emacs.
-@var{TYPE} should be one of the types contained in @code{image-types}.
+This function returns non-@code{nil} if image type @var{type} is
+available, i.e., if images of this type can be loaded and displayed in
+Emacs.  @var{type} should be one of the types contained in
+@code{image-types}.
 
 For image types whose support libraries are statically linked, this
 function always returns @code{t}; for other image types, it returns
--- a/lispref/searching.texi	Tue Jul 13 15:45:15 2004 +0000
+++ b/lispref/searching.texi	Sun Jul 18 21:49:24 2004 +0000
@@ -666,6 +666,19 @@
 matches the empty string, but only at the end of a word.  @samp{\>}
 matches at the end of the buffer (or string) only if the contents end
 with a word-constituent character.
+
+@item \_<
+@cindex @samp{\_<} in regexp
+matches the empty string, but only at the beginning of a symbol.  A
+symbol is a sequence of one or more word or symbol constituent
+characters.  @samp{\_<} matches at the beginning of the buffer (or
+string) only if a symbol-constituent character follows.
+
+@item \_>
+@cindex @samp{\_>} in regexp
+matches the empty string, but only at the end of a symbol.  @samp{\_>}
+matches at the end of the buffer (or string) only if the contents end
+with a symbol-constituent character.
 @end table
 
 @kindex invalid-regexp
--- a/lispref/windows.texi	Tue Jul 13 15:45:15 2004 +0000
+++ b/lispref/windows.texi	Sun Jul 18 21:49:24 2004 +0000
@@ -158,7 +158,6 @@
 window @var{window} remains the selected window, but occupies only
 part of its former screen area.  The rest is occupied by a newly created
 window which is returned as the value of this function.
-This function returns the newly created window.
 
 If @var{horizontal} is non-@code{nil}, then @var{window} splits into
 two side by side windows.  The original window @var{window} keeps the
@@ -272,12 +271,34 @@
 other, leaving the upper of the two windows selected, with @var{size}
 lines.  (If @var{size} is negative, then the lower of the two windows
 gets @minus{} @var{size} lines and the upper window gets the rest, but
-the upper window is still the one selected.)
+the upper window is still the one selected.)  However, if
+@code{split-window-keep-point} (see below) is @code{nil}, then either
+window can be selected.
+
+In other respects, this function is similar to @code{split-window}.
+In particular, the upper window is the original one and the return
+value is the new, lower window.
 @end deffn
 
+@defopt split-window-keep-point
+If this variable is non-@code{nil} (the default), then
+@code{split-window-vertically} behaves as described above.
+
+If it is @code{nil}, then @code{split-window-vertically} adjusts point
+in each of the two windows to avoid scrolling.  (This is useful on
+slow terminals.)  It selects whichever window contains the screen line
+that point was previously on.
+
+This variable only affects the behavior of @code{split-window-vertically}.
+It has no effect on the other functions described here.
+@end defopt
+
 @deffn Command split-window-horizontally &optional size
 This function splits the selected window into two windows
-side-by-side, leaving the selected window with @var{size} columns.
+side-by-side, leaving the selected window on the left with @var{size}
+columns.  If @var{size} is negative, the rightmost window gets
+@minus{} @var{size} columns, but the leftmost window still remains
+selected.
 
 This function is basically an interface to @code{split-window}.
 You could define a simplified version of the function like this:
@@ -364,17 +385,19 @@
 The return value is @code{nil}.
 @end deffn
 
-@deffn Command delete-windows-on buffer &optional frame
-This function deletes all windows showing @var{buffer}.  If there are
-no windows showing @var{buffer}, it does nothing.
+@deffn Command delete-windows-on buffer-or-name &optional frame
+This function deletes all windows showing @var{buffer-or-name}.  If
+there are no windows showing @var{buffer-or-name}, it does nothing.
+@var{buffer-or-name} must be a buffer or the name of an existing
+buffer.
 
 @code{delete-windows-on} operates frame by frame.  If a frame has
 several windows showing different buffers, then those showing
-@var{buffer} are removed, and the others expand to fill the space.  If
-all windows in some frame are showing @var{buffer} (including the case
-where there is only one window), then the frame reverts to having a
-single window showing another buffer chosen with @code{other-buffer}.
-@xref{The Buffer List}.
+@var{buffer-or-name} are removed, and the others expand to fill the
+space.  If all windows in some frame are showing @var{buffer-or-name}
+(including the case where there is only one window), then the frame
+winds up with a single window showing another buffer chosen with
+@code{other-buffer}.  @xref{The Buffer List}.
 
 The argument @var{frame} controls which frames to operate on.  This
 function does not use it in quite the same way as the other functions
@@ -412,8 +435,9 @@
 
 @defun select-window window &optional norecord
 This function makes @var{window} the selected window.  The cursor then
-appears in @var{window} (on redisplay).  The buffer being displayed in
-@var{window} is immediately designated the current buffer.
+appears in @var{window} (on redisplay).  Unless @var{window} was
+already selected, @code{select-window} makes @var{window}'s buffer the
+current buffer.
 
 Normally @var{window}'s selected buffer is moved to the front of the
 buffer list, but if @var{norecord} is non-@code{nil}, the buffer list
@@ -431,14 +455,18 @@
 @end defun
 
 @defmac save-selected-window forms@dots{}
-This macro records the selected window of each frame, executes
-@var{forms} in sequence, then restores the earlier selected windows.
+This macro records the selected window, as well as the selected window
+of each frame, executes @var{forms} in sequence, then restores the
+earlier selected windows.  It returns the value of the last form in
+@var{forms}.
 
 This macro does not save or restore anything about the sizes,
 arrangement or contents of windows; therefore, if the @var{forms}
 change them, the change persists.  If the previously selected window
-of some frame is no longer live at the time of exit from this form,
-that frame's selected window is left alone.
+of some frame is no longer live at the time of exit from @var{forms},
+that frame's selected window is left alone.  If the previously
+selected window is no longer live, then whatever window is selected at
+the end of @var{forms} remains selected.
 @end defmac
 
 @defmac with-selected-window window forms@dots{}
@@ -446,7 +474,7 @@
 executes @var{forms} in sequence, then restores the previously
 selected window (unless that window is no longer alive).  It is similar
 to @code{save-selected-window} except that it explicitly selects
-@var{window} and that it does not alter the buffer list sequence.
+@var{window}, without altering the buffer list sequence.
 @end defmac
 
 @cindex finding windows
@@ -556,7 +584,9 @@
 @table @asis
 @item @code{nil}
 Consider all the windows in @var{window}'s frame, plus the minibuffer
-used by that frame even if it lies in some other frame.
+used by that frame even if it lies in some other frame.  If the
+minibuffer counts (as determined by @var{minibuf}), then all windows on
+all frames that share that minibuffer count too.
 
 @item @code{t}
 Consider all windows in all existing frames.
@@ -658,9 +688,10 @@
 
 @defun set-window-buffer window buffer-or-name &optional keep-margins
 This function makes @var{window} display @var{buffer-or-name} as its
-contents.  It returns @code{nil}.  This is the fundamental primitive
-for changing which buffer is displayed in a window, and all ways
-of doing that call this function.
+contents.  It returns @code{nil}.  @var{buffer-or-name} must be a
+buffer, or the name of an existing buffer.  This is the fundamental
+primitive for changing which buffer is displayed in a window, and all
+ways of doing that call this function.
 
 @example
 @group
@@ -770,7 +801,8 @@
 If @var{buffer-or-name} does not identify an existing buffer, then a new
 buffer by that name is created.  The major mode for the new buffer is
 set according to the variable @code{default-major-mode}.  @xref{Auto
-Major Mode}.
+Major Mode}.  If @var{buffer-or-name} is @code{nil},
+@code{switch-to-buffer} chooses a buffer using @code{other-buffer}.
 
 Normally the specified buffer is put at the front of the buffer list
 (both the selected frame's buffer list and the frame-independent buffer
@@ -783,6 +815,9 @@
 returns the buffer that it switched to.
 @end deffn
 
+The next two functions are similar to @code{switch-to-buffer}, except
+for the described features.
+
 @deffn Command switch-to-buffer-other-window buffer-or-name &optional norecord
 This function makes @var{buffer-or-name} the current buffer and
 displays it in a window not currently selected.  It then selects that
@@ -842,12 +877,12 @@
 unless @var{norecord} is non-@code{nil}.
 @end defun
 
-@deffn Command replace-buffer-in-windows buffer
-This function replaces @var{buffer} with some other buffer in all
-windows displaying it.  The other buffer used is chosen with
+@deffn Command replace-buffer-in-windows buffer-or-name
+This function replaces @var{buffer-or-name} with some other buffer in all
+windows displaying it.  It chooses the other buffer with
 @code{other-buffer}.  In the usual applications of this function, you
 don't care which other buffer is used; you just want to make sure that
-@var{buffer} is no longer displayed.
+@var{buffer-or-name} is no longer displayed.
 
 This function returns @code{nil}.
 @end deffn
@@ -864,7 +899,8 @@
 This command makes @var{buffer-or-name} appear in some window, like
 @code{pop-to-buffer}, but it does not select that window and does not
 make the buffer current.  The identity of the selected window is
-unaltered by this function.
+unaltered by this function.  @var{buffer-or-name} must be a buffer, or
+the name of an existing buffer.
 
 If @var{not-this-window} is non-@code{nil}, it means to display the
 specified buffer in a window other than the selected one, even if it is
@@ -885,6 +921,7 @@
 @itemize @bullet
 @item
 If it is @code{nil}, consider windows on the selected frame.
+(Actually, the last non-minibuffer frame.)
 @item
 If it is @code{t}, consider windows on all frames.
 @item
@@ -1017,7 +1054,7 @@
 This function returns non-@code{nil} if displaying a buffer
 named @var{buffer-name} with @code{display-buffer} would
 create a special frame.  The value is @code{t} if it would
-use the default frame paramaters, or else the specified list
+use the default frame parameters, or else the specified list
 of frame parameters.
 @end defun
 
@@ -1030,11 +1067,12 @@
 @code{special-display-popup-frame}.
 @end defvar
 
-@defun special-display-popup-frame buffer &rest args
+@defun special-display-popup-frame buffer &optional args
 This function makes @var{buffer} visible in a frame of its own.  If
 @var{buffer} is already displayed in a window in some frame, it makes
 the frame visible and raises it, to use that window.  Otherwise, it
-creates a frame that will be dedicated to @var{buffer}.
+creates a frame that will be dedicated to @var{buffer}.  This
+function returns the window it used.
 
 If @var{args} is an alist, it specifies frame parameters for the new
 frame.
@@ -1080,9 +1118,9 @@
 This variable is the most flexible way to customize the behavior of
 @code{display-buffer}.  If it is non-@code{nil}, it should be a function
 that @code{display-buffer} calls to do the work.  The function should
-accept two arguments, the same two arguments that @code{display-buffer}
+accept two arguments, the first two arguments that @code{display-buffer}
 received.  It should choose or create a window, display the specified
-buffer, and then return the window.
+buffer in it, and then return the window.
 
 This hook takes precedence over all the other options and hooks
 described above.
--- a/man/trampver.texi	Tue Jul 13 15:45:15 2004 +0000
+++ b/man/trampver.texi	Sun Jul 18 21:49:24 2004 +0000
@@ -4,7 +4,7 @@
 @c In the Tramp CVS, the version number is auto-frobbed from
 @c configure.ac, so you should edit that file and run
 @c "autoconf && ./configure" to change the version number.
-@set trampver 2.0.42
+@set trampver 2.0.43
 
 @c Other flags from configuration
 @set prefix /usr/local
--- a/src/ChangeLog	Tue Jul 13 15:45:15 2004 +0000
+++ b/src/ChangeLog	Sun Jul 18 21:49:24 2004 +0000
@@ -1,3 +1,45 @@
+2004-07-17  Juanma Barranquero  <lektu@terra.es>
+
+	* keyboard.c (not_single_kboard_state): Do nothing unless
+	MULTI_KBOARD is defined.
+
+2004-07-17  Richard M. Stallman  <rms@gnu.org>
+
+	* window.c (coordinates_in_window): Inside the window but outside
+	its box to the L or R, return ON_VERTICAL_BORDER.
+	(window_list_1): Rotate the list to start with WINDOW.
+
+	* print.c (print_preprocess): Test for print_depth at limit
+	before entering in being_printed.
+
+	* keyboard.c (not_single_kboard_state): New function.
+	(stuff_buffered_input): Now no-op only if no SIGTSTP.
+
+	* frame.c (Fdelete_frame): If we're in single_bboard_state on
+	this kboard, and we delete its last frame, go to any_kboard_state.
+
+	* buffer.c (syms_of_buffer) <transient-mark-mode>: Doc fix.
+
+2004-07-15  KOBAYASHI Yasuhiro  <kobayays@otsukakj.co.jp>  (tiny change)
+
+	* w32fns.c (Fx_file_dialog): Encode strings in system coding
+	system before passing them to OS functions for display.
+
+2004-07-15  David Kastrup  <dak@gnu.org>
+
+	* search.c (syms_of_search): Staticpro `saved_last_thing_searched'.
+	Apparently fixes an abort condition.
+
+2004-07-14  Luc Teirlinck  <teirllm@auburn.edu>
+
+	* fileio.c (Fvisited_file_modtime): Return a list of two integers,
+	instead of a cons.
+
+2004-07-14  K,Ba(Broly L,Bu(Brentey  <lorentey@elte.hu>
+
+	* keyboard.c (echo_dash): Do nothing if there already is a dash
+	at the end of the echo string.
+
 2004-07-12  Kim F. Storm  <storm@cua.dk>
 
 	* alloc.c (mark_object): Only look at Lisp_Misc_Save_Value
--- a/src/buffer.c	Tue Jul 13 15:45:15 2004 +0000
+++ b/src/buffer.c	Sun Jul 18 21:49:24 2004 +0000
@@ -5861,7 +5861,10 @@
 
 If the value is `lambda', that enables Transient Mark mode temporarily
 until the next buffer modification.  If a command sets the value to `only',
-that enables Transient Mark mode for the following command only.  */);
+that enables Transient Mark mode for the following command only.
+During that following command, the value of `transient-mark-mode'
+is `identity'.  If it is still `identity' at the end of that command,
+it changes to nil.  */);
   Vtransient_mark_mode = Qnil;
 
   DEFVAR_LISP ("inhibit-read-only", &Vinhibit_read_only,
--- a/src/fileio.c	Tue Jul 13 15:45:15 2004 +0000
+++ b/src/fileio.c	Sun Jul 18 21:49:24 2004 +0000
@@ -5630,13 +5630,17 @@
 DEFUN ("visited-file-modtime", Fvisited_file_modtime,
        Svisited_file_modtime, 0, 0, 0,
        doc: /* Return the current buffer's recorded visited file modification time.
-The value is a list of the form (HIGH . LOW), like the time values
+The value is a list of the form (HIGH LOW), like the time values
 that `file-attributes' returns.  If the current buffer has no recorded
 file modification time, this function returns 0.
 See Info node `(elisp)Modification Time' for more details.  */)
      ()
 {
-  return long_to_cons ((unsigned long) current_buffer->modtime);
+  Lisp_Object tcons;
+  tcons = long_to_cons ((unsigned long) current_buffer->modtime);
+  if (CONSP (tcons))
+    return list2 (XCAR (tcons), XCDR (tcons));
+  return tcons;
 }
 
 DEFUN ("set-visited-file-modtime", Fset_visited_file_modtime,
--- a/src/frame.c	Tue Jul 13 15:45:15 2004 +0000
+++ b/src/frame.c	Sun Jul 18 21:49:24 2004 +0000
@@ -1553,6 +1553,36 @@
 	}
     }
 
+  /* If there's no other frame on the same kboard, get out of
+     single-kboard state if we're in it for this kboard.  */
+  {
+    Lisp_Object frames;
+    /* Some frame we found on the same kboard, or nil if there are none.  */
+    Lisp_Object frame_on_same_kboard;
+
+    frame_on_same_kboard = Qnil;
+
+    for (frames = Vframe_list;
+	 CONSP (frames);
+	 frames = XCDR (frames))
+      {
+	Lisp_Object this;
+	struct frame *f1;
+
+	this = XCAR (frames);
+	if (!FRAMEP (this))
+	  abort ();
+	f1 = XFRAME (this);
+
+	if (FRAME_KBOARD (f) == FRAME_KBOARD (f1))
+	  frame_on_same_kboard = this;
+      }
+
+    if (NILP (frame_on_same_kboard))
+      not_single_kboard_state (FRAME_KBOARD (f));
+  }
+
+
   /* If we've deleted this keyboard's default_minibuffer_frame, try to
      find another one.  Prefer minibuffer-only frames, but also notice
      frames with other windows.  */
--- a/src/keyboard.c	Tue Jul 13 15:45:15 2004 +0000
+++ b/src/keyboard.c	Sun Jul 18 21:49:24 2004 +0000
@@ -791,6 +791,21 @@
       == SCHARS (current_kboard->echo_string))
     return;
 
+  /* Do nothing if we have already put a dash at the end.  */
+  if (SCHARS (current_kboard->echo_string) > 1)
+    {
+	  Lisp_Object last_char, prev_char, idx;
+
+	  idx = make_number (SCHARS (current_kboard->echo_string) - 2);
+	  prev_char = Faref (current_kboard->echo_string, idx);
+
+	  idx = make_number (SCHARS (current_kboard->echo_string) - 1);
+	  last_char = Faref (current_kboard->echo_string, idx);
+
+	  if (XINT (last_char) == '-' && XINT (prev_char) != ' ')
+	    return;
+    }
+
   /* Put a dash at the end of the buffer temporarily,
      but make it go away when the next character is added.  */
   current_kboard->echo_string = concat2 (current_kboard->echo_string,
@@ -1063,6 +1078,19 @@
 #endif
 }
 
+/* If we're in single_kboard state for kboard KBOARD,
+   get out of it.  */
+
+void
+not_single_kboard_state (kboard)
+     KBOARD *kboard;
+{
+#ifdef MULTI_KBOARD
+  if (kboard == current_kboard)
+    single_kboard = 0;
+#endif
+}
+
 /* Maintain a stack of kboards, so other parts of Emacs
    can switch temporarily to the kboard of a given frame
    and then revert to the previous status.  */
@@ -10238,9 +10266,7 @@
 stuff_buffered_input (stuffstring)
      Lisp_Object stuffstring;
 {
-/* stuff_char works only in BSD, versions 4.2 and up.  */
-#ifdef BSD_SYSTEM
-#ifndef BSD4_1
+#ifdef SIGTSTP  /* stuff_char is defined if SIGTSTP.  */
   register unsigned char *p;
 
   if (STRINGP (stuffstring))
@@ -10256,7 +10282,10 @@
 
   /* Anything we have read ahead, put back for the shell to read.  */
   /* ?? What should this do when we have multiple keyboards??
-     Should we ignore anything that was typed in at the "wrong" kboard?  */
+     Should we ignore anything that was typed in at the "wrong" kboard?
+
+     rms: we should stuff everything back into the kboard
+     it came from.  */
   for (; kbd_fetch_ptr != kbd_store_ptr; kbd_fetch_ptr++)
     {
 
@@ -10269,8 +10298,7 @@
     }
 
   input_pending = 0;
-#endif
-#endif /* BSD_SYSTEM and not BSD4_1 */
+#endif /* SIGTSTP */
 }
 
 void
--- a/src/print.c	Tue Jul 13 15:45:15 2004 +0000
+++ b/src/print.c	Sun Jul 18 21:49:24 2004 +0000
@@ -1284,6 +1284,11 @@
   int loop_count = 0;
   Lisp_Object halftail;
 
+  /* Give up if we go so deep that print_object will get an error.  */
+  /* See similar code in print_object.  */
+  if (print_depth >= PRINT_CIRCLE)
+    return;
+
   /* Avoid infinite recursion for circular nested structure
      in the case where Vprint_circle is nil.  */
   if (NILP (Vprint_circle))
@@ -1294,11 +1299,6 @@
       being_printed[print_depth] = obj;
     }
 
-  /* Give up if we go so deep that print_object will get an error.  */
-  /* See similar code in print_object.  */
-  if (print_depth >= PRINT_CIRCLE)
-    return;
-
   print_depth++;
   halftail = obj;
 
--- a/src/search.c	Tue Jul 13 15:45:15 2004 +0000
+++ b/src/search.c	Sun Jul 18 21:49:24 2004 +0000
@@ -2974,6 +2974,9 @@
   last_thing_searched = Qnil;
   staticpro (&last_thing_searched);
 
+  saved_last_thing_searched = Qnil;
+  staticpro (&saved_last_thing_searched);
+
   defsubr (&Slooking_at);
   defsubr (&Sposix_looking_at);
   defsubr (&Sstring_match);
--- a/src/w32fns.c	Tue Jul 13 15:45:15 2004 +0000
+++ b/src/w32fns.c	Sun Jul 18 21:49:24 2004 +0000
@@ -7735,14 +7735,14 @@
   /* Create the dialog with PROMPT as title, using DIR as initial
      directory and using "*" as pattern.  */
   dir = Fexpand_file_name (dir, Qnil);
-  strncpy (init_dir, SDATA (dir), MAX_PATH);
+  strncpy (init_dir, SDATA (ENCODE_SYSTEM (dir)), MAX_PATH);
   init_dir[MAX_PATH] = '\0';
   unixtodos_filename (init_dir);
 
   if (STRINGP (default_filename))
     {
       char *file_name_only;
-      char *full_path_name = SDATA (default_filename);
+      char *full_path_name = SDATA (ENCODE_SYSTEM (default_filename));
 
       unixtodos_filename (full_path_name);
 
--- a/src/window.c	Tue Jul 13 15:45:15 2004 +0000
+++ b/src/window.c	Sun Jul 18 21:49:24 2004 +0000
@@ -672,7 +672,7 @@
 
   /* Outside any interesting column?  */
   if (*x < left_x || *x > right_x)
-    return ON_NOTHING;
+    return ON_VERTICAL_BORDER;
 
   lmargin_width = window_box_width (w, LEFT_MARGIN_AREA);
   rmargin_width = window_box_width (w, RIGHT_MARGIN_AREA);
@@ -1801,7 +1801,7 @@
 window_list_1 (window, minibuf, all_frames)
      Lisp_Object window, minibuf, all_frames;
 {
-  Lisp_Object tail, list;
+  Lisp_Object tail, list, rest;
 
   decode_next_window_args (&window, &minibuf, &all_frames);
   list = Qnil;
@@ -1810,7 +1810,17 @@
     if (candidate_window_p (XCAR (tail), window, minibuf, all_frames))
       list = Fcons (XCAR (tail), list);
 
-  return Fnreverse (list);
+  /* Rotate the list to start with WINDOW.  */
+  list = Fnreverse (list);
+  rest = Fmemq (window, list);
+  if (!NILP (rest) && !EQ (rest, list))
+    {
+      for (tail = list; XCDR (tail) != rest; tail = XCDR (tail))
+	;
+      XSETCDR (tail, Qnil);
+      list = nconc2 (rest, list);
+    }
+  return list;
 }