changeset 89956:b9eee0a7bef5

Revision: miles@gnu.org--gnu-2004/emacs--unicode--0--patch-25 Merge from emacs--cvs-trunk--0 Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-459 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-463 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-464 Update from CVS: lisp/progmodes/make-mode.el: Fix comments. * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-465 Update from CVS
author Miles Bader <miles@gnu.org>
date Fri, 23 Jul 2004 04:30:44 +0000
parents 7f8b53f94713 (current diff) 8d030ffc0866 (diff)
children c08afac24467
files etc/NEWS etc/TODO lib-src/ChangeLog lib-src/emacsclient.c lisp/ChangeLog lisp/autorevert.el lisp/dired-aux.el lisp/emacs-lisp/testcover.el lisp/font-lock.el lisp/frame.el lisp/mail/footnote.el lisp/net/tramp-smb.el lisp/net/tramp-vc.el lisp/net/tramp.el lisp/printing.el lisp/progmodes/make-mode.el lisp/progmodes/which-func.el lisp/ps-print.el lisp/replace.el lisp/textmodes/fill.el lispref/ChangeLog lispref/abbrevs.texi lispref/display.texi lispref/minibuf.texi lispref/positions.texi lispref/windows.texi man/ChangeLog man/dired.texi man/search.texi man/trampver.texi src/ChangeLog src/atimer.c src/buffer.c src/dispnew.c src/eval.c src/frame.c src/keyboard.c src/mac.c src/macterm.c src/print.c src/process.c src/s/gnu-linux.h src/sysdep.c src/w32fns.c src/widget.c src/window.c src/window.h src/xdisp.c
diffstat 49 files changed, 1044 insertions(+), 464 deletions(-) [+]
line wrap: on
line diff
--- a/etc/NEWS	Sat Jul 17 05:09:07 2004 +0000
+++ b/etc/NEWS	Fri Jul 23 04:30:44 2004 +0000
@@ -225,7 +225,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
@@ -239,7 +239,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.
@@ -258,9 +258,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.
 
@@ -268,7 +268,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
@@ -306,7 +306,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.
 
@@ -508,7 +508,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.
@@ -687,7 +687,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'.
 
@@ -764,8 +764,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.
@@ -787,7 +787,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.
 
@@ -866,7 +866,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.
@@ -944,7 +944,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
@@ -1192,8 +1192,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.
@@ -1257,7 +1257,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).
 
@@ -1292,10 +1292,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
@@ -1317,7 +1317,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.
 
 +++
@@ -1524,7 +1524,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.
 
 +++
@@ -1832,8 +1832,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.
@@ -1985,13 +1985,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).
@@ -2159,7 +2159,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.
 
 ---
@@ -3652,9 +3652,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	Sat Jul 17 05:09:07 2004 +0000
+++ b/etc/TODO	Fri Jul 23 04:30:44 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.
--- a/lib-src/ChangeLog	Sat Jul 17 05:09:07 2004 +0000
+++ b/lib-src/ChangeLog	Fri Jul 23 04:30:44 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/lib-src/emacsclient.c	Sat Jul 17 05:09:07 2004 +0000
+++ b/lib-src/emacsclient.c	Fri Jul 23 04:30:44 2004 +0000
@@ -203,7 +203,7 @@
     }
   *q++ = 0;
 
-  fprintf (stream, copy);
+  fprintf (stream, "%s", copy);
 
   free (copy);
 }
--- a/lisp/ChangeLog	Sat Jul 17 05:09:07 2004 +0000
+++ b/lisp/ChangeLog	Fri Jul 23 04:30:44 2004 +0000
@@ -1,3 +1,119 @@
+2004-07-22  Vinicius Jose Latorre  <viniciusjl@ig.com.br>
+
+	* ps-print.el: Doc fix.  Improve the DSC compliance of the generated
+	PostScript.  Suggested by Michael Piotrowski <mxp@dynalabs.de>.
+	(ps-print-version): New version 6.6.5.
+	(ps-printing-region): Doc fix.
+	(ps-generate-string-list): Comment fix.
+	(ps-message-log-max, ps-begin-file): Code fix.
+
+2004-07-22  Kim F. Storm  <storm@cua.dk>
+
+	* progmodes/make-mode.el: Fix comments.
+
+2004-07-21  Vinicius Jose Latorre  <viniciusjl@ig.com.br>
+
+	* printing.el: Doc fix.
+
+2004-07-20  Luc Teirlinck  <teirllm@auburn.edu>
+
+	* frame.el (modify-all-frames-parameters): Minor doc fix.
+
+2004-07-20  Richard M. Stallman  <rms@gnu.org>
+
+	* textmodes/fill.el (fill-comment-paragraph): Handle indent-tabs-mode.
+	(fill-delete-newlines): Call sentence-end as function.
+	(fill-nobreak-p, canonically-space-region): Likewise.
+	(fill-nobreak-p): If this break point is at the end of the line,
+	don't consider the newline which follows as a reason to return t.
+
+2004-07-19  John Paul Wallington  <jpw@gnu.org>
+
+	* dired-aux.el (dired-file-set-difference): Don't use `caddr'.
+
+2004-07-18  Luc Teirlinck  <teirllm@auburn.edu>
+
+	* dired-aux.el (dired-do-kill-lines): Expand docstring.
+	Delete irrelevant code.
+
+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
--- a/lisp/autorevert.el	Sat Jul 17 05:09:07 2004 +0000
+++ b/lisp/autorevert.el	Fri Jul 23 04:30:44 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,6 +60,13 @@
 ;; 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:
 ;;
@@ -389,7 +397,7 @@
 		     (not (file-remote-p buffer-file-name))
 		     (file-readable-p buffer-file-name)
 		     (not (verify-visited-file-modtime buffer)))
-		(and (or auto-revert-mode auto-revert-tail-mode
+		(and (or auto-revert-mode
 			 global-auto-revert-non-file-buffers)
 		     revert-buffer-function
 		     (boundp 'buffer-stale-function)
--- a/lisp/dired-aux.el	Sat Jul 17 05:09:07 2004 +0000
+++ b/lisp/dired-aux.el	Fri Jul 23 04:30:44 2004 +0000
@@ -163,8 +163,8 @@
 	(unless (let ((list list2))
 		  (while (and list
 			      (not (let* ((file2 (car list))
-					  (fa1 (caddr file1))
-					  (fa2 (caddr file2))
+					  (fa1 (car (cddr file1)))
+					  (fa2 (car (cddr file2)))
 					  (size1 (nth 7 fa1))
 					  (size2 (nth 7 fa2))
 					  (mtime1 (float-time (nth 5 fa1)))
@@ -627,9 +627,14 @@
 (defun dired-do-kill-lines (&optional arg fmt)
   "Kill all marked lines (not the files).
 With a prefix argument, kill that many lines starting with the current line.
-\(A negative argument kills lines before the current line.)
-To kill an entire subdirectory, go to its directory header line
-and use this command with a prefix argument (the value does not matter)."
+\(A negative argument kills backward.)
+If you use this command with a prefix argument to kill the line
+for a file that is a directory, which you have inserted in the
+Dired buffer as a subdirectory, then it deletes that subdirectory
+from the buffer as well.
+To kill an entire subdirectory \(without killing its line in the
+parent directory), go to its directory header line and use this
+command with a prefix argument (the value does not matter)."
   ;; Returns count of killed lines.  FMT="" suppresses message.
   (interactive "P")
   (if arg
@@ -638,23 +643,14 @@
 	(dired-kill-line arg))
     (save-excursion
       (goto-char (point-min))
-      (let (buffer-read-only (count 0))
-	(if (not arg)			; kill marked lines
-	    (let ((regexp (dired-marker-regexp)))
-	      (while (and (not (eobp))
-			  (re-search-forward regexp nil t))
-		(setq count (1+ count))
-		(delete-region (progn (beginning-of-line) (point))
-			       (progn (forward-line 1) (point)))))
-	  ;; else kill unmarked lines
-	  (while (not (eobp))
-	    (if (or (dired-between-files)
-		    (not (looking-at "^  ")))
-		(forward-line 1)
-	      (setq count (1+ count))
-	      (delete-region (point) (save-excursion
-				       (forward-line 1)
-				       (point))))))
+      (let (buffer-read-only
+	    (count 0)
+	    (regexp (dired-marker-regexp)))
+	(while (and (not (eobp))
+		    (re-search-forward regexp nil t))
+	  (setq count (1+ count))
+	  (delete-region (progn (beginning-of-line) (point))
+			 (progn (forward-line 1) (point))))
 	(or (equal "" fmt)
 	    (message (or fmt "Killed %d line%s.") count (dired-plural-s count)))
 	count))))
--- a/lisp/emacs-lisp/testcover.el	Sat Jul 17 05:09:07 2004 +0000
+++ b/lisp/emacs-lisp/testcover.el	Fri Jul 23 04:30:44 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/font-lock.el	Sat Jul 17 05:09:07 2004 +0000
+++ b/lisp/font-lock.el	Fri Jul 23 04:30:44 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.
 
@@ -1945,12 +1945,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"
@@ -1968,7 +1968,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/frame.el	Sat Jul 17 05:09:07 2004 +0000
+++ b/lisp/frame.el	Fri Jul 23 04:30:44 2004 +0000
@@ -520,7 +520,7 @@
 ;;;; Creation of additional frames, and other frame miscellanea
 
 (defun modify-all-frames-parameters (alist)
-  "modify all current and future frames parameters according to ALIST.
+  "Modify all current and future frames parameters according to ALIST.
 This changes `default-frame-alist' and possibly `initial-frame-alist'.
 See help of `modify-frame-parameters' for more information."
   (let (element)			;; temp
--- a/lisp/mail/footnote.el	Sat Jul 17 05:09:07 2004 +0000
+++ b/lisp/mail/footnote.el	Fri Jul 23 04:30:44 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/net/tramp-smb.el	Sat Jul 17 05:09:07 2004 +0000
+++ b/lisp/net/tramp-smb.el	Fri Jul 23 04:30:44 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	Sat Jul 17 05:09:07 2004 +0000
+++ b/lisp/net/tramp-vc.el	Fri Jul 23 04:30:44 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	Sat Jul 17 05:09:07 2004 +0000
+++ b/lisp/net/tramp.el	Fri Jul 23 04:30:44 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
@@ -2509,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)))))
 
@@ -3064,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)))
@@ -3075,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)
@@ -3607,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
@@ -3689,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.
@@ -3972,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)
@@ -4062,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
@@ -4073,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?
@@ -4824,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."))))
     
 
@@ -4896,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)
@@ -4956,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."
@@ -5034,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."
@@ -5049,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)
@@ -5246,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
@@ -5262,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)
 
@@ -5547,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
@@ -6717,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/printing.el	Sat Jul 17 05:09:07 2004 +0000
+++ b/lisp/printing.el	Fri Jul 23 04:30:44 2004 +0000
@@ -5,7 +5,7 @@
 
 ;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br>
 ;; Maintainer: Vinicius Jose Latorre <viniciusjl@ig.com.br>
-;; Time-stamp: <2004/07/12 21:10:35 vinicius>
+;; Time-stamp: <2004/07/20 21:44:43 vinicius>
 ;; Keywords: wp, print, PostScript
 ;; Version: 6.8
 ;; X-URL: http://www.cpqd.com.br/~vinicius/emacs/
@@ -40,23 +40,36 @@
 ;; Introduction
 ;; ------------
 ;;
-;; This package provides an user interface to some printing utilities that
-;; includes previewing/printing a PostScript file, printing a text file and
-;; previewing/printing some major modes (like mh-folder-mode,
-;; rmail-summary-mode, gnus-summary-mode, etc).  It also includes a
-;; PostScript/text printer database.
-;;
-;; Indeed, there are two user interfaces:
+;; With `printing' you can preview or print a PostScript file.  You can also
+;; print a text file using PostScript, and preview or print buffers that use
+;; certain special modes like mh-folder-mode, rmail-summary-mode,
+;; gnus-summary-mode, etc.  This package also includes a PostScript/text
+;; printer database.
+;;
+;; There are two user interfaces:
 ;;
 ;;    * Menu interface:
-;;      When `printing' is loaded, the menubar is modified to use `printing'
-;;      menu instead of the print options in menubar.
+;;      The `printing' menu replaces the usual print options in the menu bar.
 ;;      This is the default user interface.
 ;;
 ;;    * Buffer interface:
-;;      It is an option of `printing' menu, but it can be binded into another
-;;      key, so user can activate the buffer interface directly without using
-;;      a menu.  See `pr-interface' command.
+;;      You can use a buffer interface instead of menus.  It looks like a
+;;      customization buffer.  Basically, it has the same options found in the
+;;      menu and some extra options, all this on a buffer.
+;;
+;; `printing' is prepared to run on GNU, Unix and NT systems.
+;; On GNU or Unix system, `printing' depends on gs and gv utilities.
+;; On NT system, `printing' depends on gstools (gswin32.exe and gsview32.exe).
+;; To obtain ghostscript, ghostview and GSview see the URL
+;; `http://www.gnu.org/software/ghostscript/ghostscript.html'.
+;;
+;; `printing' depends on ps-print package to generate PostScript files, to
+;; spool and to despool PostScript buffer.  So, `printing' provides an
+;; interface to ps-print package and it also provides some extra stuff.
+;;
+;; To download the latest ps-print package see
+;; `http://www.cpqd.com.br/~vinicius/emacs/ps-print.tar.gz'.
+;; Please, see README file for ps-print installation instructions.
 ;;
 ;; `printing' was inspired on:
 ;;
@@ -72,20 +85,6 @@
 ;;    ps-print-interface.el   Volker Franz <volker.franz@tuebingen.mpg.de>
 ;;	 Graphical front end for ps-print and previewing
 ;;
-;; `printing' is prepared to run on GNU, Unix and NT systems.
-;; On GNU or Unix system, `printing' depends on gs and gv utilities.
-;; On NT system, `printing' depends on gstools (gswin32.exe and gsview32.exe).
-;; To obtain ghostscript, ghostview and GSview see the URL
-;; `http://www.gnu.org/software/ghostscript/ghostscript.html'.
-;;
-;; `printing' depends on ps-print package to generate PostScript files, to
-;; spool and to despool PostScript buffer.  So, `printing' provides an
-;; interface to ps-print package and it also provides some extra stuff.
-;;
-;; To download the latest ps-print package see
-;; `http://www.cpqd.com.br/~vinicius/emacs/ps-print.tar.gz'.
-;; Please, see README file for ps-print installation instructions.
-;;
 ;;
 ;; Log Messages
 ;; ------------
--- a/lisp/progmodes/make-mode.el	Sat Jul 17 05:09:07 2004 +0000
+++ b/lisp/progmodes/make-mode.el	Fri Jul 23 04:30:44 2004 +0000
@@ -8,11 +8,6 @@
 ;; Adapted-By: ESR
 ;; Keywords: unix, tools
 
-;; RMS:
-;; This needs work.
-;; Also, the doc strings need fixing: the first line doesn't stand alone,
-;; and other usage is not high quality.  Symbol names don't have `...'.
-
 ;; This file is part of GNU Emacs.
 
 ;; GNU Emacs is free software; you can redistribute it and/or modify
@@ -63,6 +58,7 @@
 ;;
 ;; To Do:
 ;;
+;; * Add missing doc strings, improve terse doc strings.
 ;; * Eliminate electric stuff entirely.
 ;; * It might be nice to highlight targets differently depending on
 ;;   whether they are up-to-date or not.  Not sure how this would
--- a/lisp/progmodes/which-func.el	Sat Jul 17 05:09:07 2004 +0000
+++ b/lisp/progmodes/which-func.el	Fri Jul 23 04:30:44 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/ps-print.el	Sat Jul 17 05:09:07 2004 +0000
+++ b/lisp/ps-print.el	Fri Jul 23 04:30:44 2004 +0000
@@ -10,12 +10,12 @@
 ;; Maintainer: Kenichi Handa <handa@etl.go.jp> (multi-byte characters)
 ;;	Vinicius Jose Latorre <viniciusjl@ig.com.br>
 ;; Keywords: wp, print, PostScript
-;; Time-stamp: <2004/03/10 18:57:00 vinicius>
-;; Version: 6.6.4
+;; Time-stamp: <2004/07/21 23:12:05 vinicius>
+;; Version: 6.6.5
 ;; X-URL: http://www.cpqd.com.br/~vinicius/emacs/
 
-(defconst ps-print-version "6.6.4"
-  "ps-print.el, v 6.6.4 <2004/03/10 vinicius>
+(defconst ps-print-version "6.6.5"
+  "ps-print.el, v 6.6.5 <2004/07/21 vinicius>
 
 Vinicius's last change version -- this file may have been edited as part of
 Emacs without changes to the version number.  When reporting bugs, please also
@@ -1353,6 +1353,9 @@
 ;; Acknowledgments
 ;; ---------------
 ;;
+;; Thanks to Michael Piotrowski <mxp@dynalabs.de> for improving the DSC
+;; compliance of the generated PostScript.
+;;
 ;; Thanks to Adam Doppelt <adoppelt@avogadro.com> for face mapping suggestion
 ;; for black/white PostScript printers.
 ;;
@@ -1424,7 +1427,7 @@
 ;; initial port to Emacs 19.  His code is no longer part of ps-print, but his
 ;; work is still appreciated.
 ;;
-;; Thanks to Remi Houdaille and Michel Train, michel@metasoft.fdn.org, for
+;; Thanks to Remi Houdaille and Michel Train <michel@metasoft.fdn.org> for
 ;; adding underline support.  Their code also is no longer part of ps-print,
 ;; but their efforts are not forgotten.
 ;;
@@ -4162,6 +4165,7 @@
 
 (defun ps-message-log-max ()
   (and (not (string= (buffer-name) "*Messages*"))
+       (boundp 'message-log-max)
        message-log-max))
 
 
@@ -4210,7 +4214,7 @@
 
 
 (defvar ps-printing-region nil
-  "Variable used to indicate if the region that ps-print is printing.
+  "Variable used to indicate the region that ps-print is printing.
 It is a cons, the car of which is the line number where the region begins, and
 its cdr is the total number of lines in the buffer.  Formatting functions can
 use this information to print the original line number (and not the number of
@@ -5396,9 +5400,9 @@
      ps-adobe-tag
      "%%Title: " (buffer-name)		; Take job name from name of
 					; first buffer printed
-     "\n%%Creator: " (user-full-name)
-     " (using ps-print v" ps-print-version
-     ")\n%%CreationDate: " (format-time-string "%T %b %d %Y")
+     "\n%%Creator: ps-print v" ps-print-version
+     "\n%%For: " (user-full-name)
+     "\n%%CreationDate: " (format-time-string "%T %b %d %Y")
      "\n%%Orientation: "
      (if ps-landscape-mode "Landscape" "Portrait")
      "\n%%DocumentNeededResources: font Times-Roman Times-Italic\n%%+ font "
@@ -5406,8 +5410,11 @@
 		(ps-remove-duplicates
 		 (append (ps-fonts 'ps-font-for-text)
 			 (list (ps-font 'ps-font-for-header 'normal)
-			       (ps-font 'ps-font-for-header 'bold))))
+			       (ps-font 'ps-font-for-header 'bold)
+			       (ps-font 'ps-font-for-footer 'normal)
+			       (ps-font 'ps-font-for-footer 'bold))))
 		"\n%%+ font ")
+     "\n%%DocumentSuppliedResources: procset PSPrintUserDefinedPrologue-" (user-login-name) " 0 0"
      "\n%%DocumentMedia: " (ps-page-dimensions-get-media dimensions)
      (format " %d" (round (ps-page-dimensions-get-width dimensions)))
      (format " %d" (round (ps-page-dimensions-get-height dimensions)))
@@ -5427,11 +5434,11 @@
 				       ps-error-handler-alist))
 			   1))		; send to paper
 	       ps-print-prologue-0
-	       "\n%%BeginProcSet: UserDefinedPrologue\n\n")
+	       "\n%%BeginResource: procset PSPrintUserDefinedPrologue-" (user-login-name) " 0 0\n\n")
 
     (ps-insert-string ps-user-defined-prologue)
 
-    (ps-output "\n%%EndProcSet\n\n")
+    (ps-output "\n%%EndResource\n\n")
 
     (ps-output-boolean "LandscapeMode      "
 		       (or ps-landscape-mode
@@ -5543,6 +5550,21 @@
     (mapcar 'ps-output ps-background-all-pages)
     (ps-output "}def\n/printLocalBackground{\n}def\n")
 
+    (ps-output "\n%%EndProlog\n\n%%BeginSetup\n")
+
+    (ps-output
+     "\n%%IncludeResource: font Times-Roman"
+     "\n%%IncludeResource: font Times-Italic\n%%IncludeResource: font "
+     (mapconcat 'identity
+		(ps-remove-duplicates
+		 (append (ps-fonts 'ps-font-for-text)
+			 (list (ps-font 'ps-font-for-header 'normal)
+			       (ps-font 'ps-font-for-header 'bold)
+			       (ps-font 'ps-font-for-footer 'normal)
+			       (ps-font 'ps-font-for-footer 'bold))))
+		"\n%%IncludeResource: font ")
+     "\n")
+
     ;; Header/line number fonts
     (ps-output (format "/h0 %s(%s)cvn DefFont\n" ; /h0 14/Helvetica-Bold DefFont
 		       ps-header-title-font-size-internal
@@ -5586,7 +5608,6 @@
       (ps-output (format "/SpaceWidthRatio %f def\n"
 			 (/ (ps-lookup 'space-width) (ps-lookup 'size)))))
 
-    (ps-output "\n%%EndProlog\n\n%%BeginSetup\n")
     (unless (eq ps-spool-config 'lpr-switches)
       (ps-output "\n%%BeginFeature: *Duplex "
 		 (ps-boolean-capitalized ps-spool-duplex)
--- a/lisp/replace.el	Sat Jul 17 05:09:07 2004 +0000
+++ b/lisp/replace.el	Fri Jul 23 04:30:44 2004 +0000
@@ -786,7 +786,8 @@
 		 nil
 		 nil
 		 nil
-		 'regexp-history)))
+		 'regexp-history
+		 default)))
 	  (if (equal input "")
 	      default
 	    input))
--- a/lisp/textmodes/fill.el	Sat Jul 17 05:09:07 2004 +0000
+++ b/lisp/textmodes/fill.el	Fri Jul 23 04:30:44 2004 +0000
@@ -353,7 +353,12 @@
      ;; Don't split a line if the rest would look like a new paragraph.
      (unless use-hard-newlines
        (save-excursion
-	 (skip-chars-forward " \t") (looking-at paragraph-start)))
+	 (skip-chars-forward " \t")
+	 ;; If this break point is at the end of the line,
+	 ;; which can occur for auto-fill, don't consider the newline
+	 ;; which follows as a reason to return t.
+	 (and (not (eolp))
+	      (looking-at paragraph-start))))
      (run-hook-with-args-until-success 'fill-nobreak-predicate)))))
 
 ;; Put `fill-find-break-point-function' property to charsets which
--- a/lispref/ChangeLog	Sat Jul 17 05:09:07 2004 +0000
+++ b/lispref/ChangeLog	Fri Jul 23 04:30:44 2004 +0000
@@ -1,3 +1,32 @@
+2004-07-19  Luc Teirlinck  <teirllm@auburn.edu>
+
+	* windows.texi: Various small changes in addition to:
+	(Window Point): Mention return value of `set-window-point'.
+	(Window Start): `pos-visible-in-window-p' disregards horizontal
+	scrolling.  Explain return value if PARTIALLY is non-nil.
+	(Vertical Scrolling): Mention PIXELS-P argument to `window-vscroll'
+	and `set-window-vscroll'.
+	(Size of Window): The argument WINDOW to `window-inside-edges',
+	`window-pixel-edges' and `window-inside-pixel-edges' is optional.
+	(Resizing Windows): Explain return value of
+	`shrink-window-if-larger-than-buffer'.
+	`window-size-fixed' automatically becomes buffer local when set.
+	(Window Configurations): Explain return value of
+	`set-window-configuration'.
+
+	* minibuf.texi (Minibuffer Misc): Add anchor for
+	`minibuffer-scroll-window'.
+
+	* positions.texi (Text Lines): Add anchor for `count-lines'.
+
+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 \_>
--- a/lispref/abbrevs.texi	Sat Jul 17 05:09:07 2004 +0000
+++ b/lispref/abbrevs.texi	Fri Jul 23 04:30:44 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/display.texi	Sat Jul 17 05:09:07 2004 +0000
+++ b/lispref/display.texi	Fri Jul 23 04:30:44 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)
--- a/lispref/minibuf.texi	Sat Jul 17 05:09:07 2004 +0000
+++ b/lispref/minibuf.texi	Fri Jul 23 04:30:44 2004 +0000
@@ -1806,6 +1806,7 @@
 @end defun
 
 @defvar minibuffer-scroll-window
+@anchor{Definition of minibuffer-scroll-window}
 If the value of this variable is non-@code{nil}, it should be a window
 object.  When the function @code{scroll-other-window} is called in the
 minibuffer, it scrolls this window.
--- a/lispref/positions.texi	Sat Jul 17 05:09:07 2004 +0000
+++ b/lispref/positions.texi	Fri Jul 23 04:30:44 2004 +0000
@@ -389,6 +389,7 @@
 
 @defun count-lines start end
 @cindex lines in region
+@anchor{Definition of count-lines}
 This function returns the number of lines between the positions
 @var{start} and @var{end} in the current buffer.  If @var{start} and
 @var{end} are equal, then it returns 0.  Otherwise it returns at least
--- a/lispref/windows.texi	Sat Jul 17 05:09:07 2004 +0000
+++ b/lispref/windows.texi	Fri Jul 23 04:30:44 2004 +0000
@@ -1195,7 +1195,7 @@
 
 @defun set-window-point window position
 This function positions point in @var{window} at position
-@var{position} in @var{window}'s buffer.
+@var{position} in @var{window}'s buffer.  It returns @var{position}.
 @end defun
 
 @node Window Start
@@ -1233,7 +1233,7 @@
 redisplay.
 
 For a realistic example of using @code{window-start}, see the
-description of @code{count-lines} in @ref{Text Lines}.
+description of @code{count-lines}.  @xref{Definition of count-lines}.
 @end defun
 
 @defun window-end &optional window update
@@ -1324,14 +1324,27 @@
 @end defun
 
 @defun pos-visible-in-window-p &optional position window partially
-This function returns @code{t} if @var{position} is within the range of
-text currently visible on the screen in @var{window}.  It returns
-@code{nil} if @var{position} is scrolled vertically or horizontally out
-of view.  Locations that are partially obscured are not considered
+This function returns non-@code{nil} if @var{position} is within the
+range of text currently visible on the screen in @var{window}.  It
+returns @code{nil} if @var{position} is scrolled vertically out of
+view.  Locations that are partially obscured are not considered
 visible unless @var{partially} is non-@code{nil}.  The argument
 @var{position} defaults to the current position of point in
 @var{window}; @var{window}, to the selected window.
 
+The @code{pos-visible-in-window-p} function considers only vertical
+scrolling.  If @var{position} is out of view only because @var{window}
+has been scrolled horizontally, @code{pos-visible-in-window-p} returns
+non-@code{nil} anyway.  @xref{Horizontal Scrolling}.
+
+If @var{position} is visible, @code{pos-visible-in-window-p} returns
+@code{t} if @var{partially} is @code{nil}; if @var{partially} is
+non-@code{nil}, it returns a list of the form @code{(@var{x} @var{y}
+@var{fully})}, where @var{x} and @var{y} are the pixel coordinates
+relative to the top left corner of the window, and @var{fully} is
+@code{t} if the character after @var{position} is fully visible and
+@code{nil} otherwise.
+
 Here is an example:
 
 @example
@@ -1348,7 +1361,7 @@
 @cindex textual scrolling
 @cindex scrolling textually
 
-  @dfn{Textual scrolling} means moving the text up or down though a
+  @dfn{Textual scrolling} means moving the text up or down through a
 window.  It works by changing the value of the window's display-start
 location.  It may also change the value of @code{window-point} to keep
 point on the screen.
@@ -1419,7 +1432,10 @@
 the one at the top left corner.  You can specify a different window to
 scroll, when the minibuffer is selected, by setting the variable
 @code{minibuffer-scroll-window}.  This variable has no effect when any
-other window is selected.  @xref{Minibuffer Misc}.
+other window is selected.  When it is non-@code{nil} and the
+minibuffer is selected, it takes precedence over
+@code{other-window-scroll-buffer}.  @xref{Definition of
+minibuffer-scroll-window}.
 
 When the minibuffer is active, it is the next window if the selected
 window is the one at the bottom right corner.  In this case,
@@ -1563,10 +1579,11 @@
 line whose height is very short off the screen, while a value of 3.3
 could scroll just part of the way through a tall line or an image.
 
-@defun window-vscroll &optional window
+@defun window-vscroll &optional window pixels-p
 This function returns the current vertical scroll position of
-@var{window}, If @var{window} is @code{nil}, the selected window is
-used.
+@var{window}.  If @var{window} is @code{nil}, the selected window is
+used.  If @var{pixels-p} is non-@code{nil}, the return value is
+measured in pixels, rather than in units of the normal line height.
 
 @example
 @group
@@ -1576,7 +1593,7 @@
 @end example
 @end defun
 
-@defun set-window-vscroll window lines
+@defun set-window-vscroll window lines &optional pixels-p
 This function sets @var{window}'s vertical scroll position to
 @var{lines}.  The argument @var{lines} should be zero or positive; if
 not, it is taken as zero.
@@ -1595,6 +1612,9 @@
      @result{} 1.13
 @end group
 @end example
+
+If @var{pixels-p} is non-@code{nil}, @var{lines} specifies a number of
+pixels.  In this case, the return value is @var{lines}.
 @end defun
 
 @node Horizontal Scrolling
@@ -1803,15 +1823,16 @@
 rightmost column used by @var{window}, and @var{bottom} is one more than
 the bottommost row used by @var{window} and its mode-line.
 
-If a window has a scroll bar, the right edge value includes the width of
-the scroll bar.  Otherwise, if the window has a neighbor on the right,
-its right edge value includes the width of the separator line between
-the window and that neighbor.  Since the width of the window does not
-include this separator, the width does not usually equal the difference
-between the right and left edges.
+The edges include the space used by the window's scroll bar, display
+margins, fringes, header line, and mode line, if it has them.  Also,
+if the window has a neighbor on the right, its right edge value
+includes the width of the separator line between the window and that
+neighbor.  Since the width of the window does not include this
+separator, the width does not usually equal the difference between the
+right and left edges.
 @end defun
 
-@defun window-inside-edges window
+@defun window-inside-edges &optional window
 This is similar to @code{window-edges}, but the edge values
 it returns include only the text area of the window.  They
 do not include the header line, mode line, scroll bar or
@@ -1877,13 +1898,13 @@
 @end group
 @end example
 
-@defun window-pixel-edges window
+@defun window-pixel-edges &optional window
 This function is like @code{window-edges} except that, on a graphical
 display, the edge values are measured in pixels instead of in
 character lines and columns.
 @end defun
 
-@defun window-inside-pixel-edges window
+@defun window-inside-pixel-edges &optional window
 This function is like @code{window-inside-edges} except that, on a
 graphical display, the edge values are measured in pixels instead of
 in character lines and columns.
@@ -1975,6 +1996,9 @@
 display the whole text of the buffer, or if part of the contents are
 currently scrolled off screen, or if the window is not the full width of
 its frame, or if the window is the only window in its frame.
+
+This command returns non-@code{nil} if it actually shrank the window
+and @code{nil} otherwise.
 @end deffn
 
 @tindex window-size-fixed
@@ -1988,9 +2012,7 @@
 if the value is @code{width}, then only the window's width is fixed.
 Any other non-@code{nil} value fixes both the width and the height.
 
-The usual way to use this variable is to give it a buffer-local value in
-a particular buffer.  That way, the windows (but usually there is only
-one) displaying that buffer have fixed size.
+This variable automatically becomes buffer-local when set.
 
 Explicit size-change functions such as @code{enlarge-window}
 get an error if they would have to change a window size which is fixed.
@@ -2132,7 +2154,8 @@
 
 If the frame which @var{configuration} was saved from is dead, all this
 function does is restore the three variables @code{window-min-height},
-@code{window-min-width} and @code{minibuffer-scroll-window}.
+@code{window-min-width} and @code{minibuffer-scroll-window}. In this
+case, the function returns @code{nil}.  Otherwise, it returns @code{t}.
 
 Here is a way of using this function to get the same effect
 as @code{save-window-excursion}:
@@ -2151,10 +2174,11 @@
 @defspec save-window-excursion forms@dots{}
 This special form records the window configuration, executes @var{forms}
 in sequence, then restores the earlier window configuration.  The window
-configuration includes the value of point and the portion of the buffer
-that is visible.  It also includes the choice of selected window.
-However, it does not include the value of point in the current buffer;
-use @code{save-excursion} also, if you wish to preserve that.
+configuration includes, for each window, the value of point and the
+portion of the buffer that is visible.  It also includes the choice of
+selected window.  However, it does not include the value of point in
+the current buffer; use @code{save-excursion} also, if you wish to
+preserve that.
 
 Don't use this construct when @code{save-selected-window} is sufficient.
 
@@ -2275,6 +2299,7 @@
 
 @defun window-redisplay-end-trigger &optional window
 This function returns @var{window}'s current end trigger position.
+If @var{window} is @code{nil} or omitted, it uses the selected window.
 @end defun
 
 @defvar window-configuration-change-hook
--- a/man/ChangeLog	Sat Jul 17 05:09:07 2004 +0000
+++ b/man/ChangeLog	Fri Jul 23 04:30:44 2004 +0000
@@ -1,3 +1,14 @@
+2004-07-18  Luc Teirlinck  <teirllm@auburn.edu>
+
+	* emacs-xtra.texi (Subdir switches): Dired does not remember the
+	`R' switch.
+
+	* dired.texi (Dired Updating): `k' only deletes inserted
+	subdirectories from the Dired buffer if a prefix argument was given.
+
+	* search.texi (Regexps): Delete redundant definition of `symbol' in
+	description of `\_>'.  It already occurs in the description of `\_<'.
+
 2004-07-02  Juri Linkov  <juri@jurta.org>
 
 	* pcl-cvs.texi (Viewing differences): Add `d r'.
--- a/man/dired.texi	Sat Jul 17 05:09:07 2004 +0000
+++ b/man/dired.texi	Fri Jul 23 04:30:44 2004 +0000
@@ -1030,10 +1030,11 @@
 files, or on the marked files if any; but it does not operate on the
 current file as a last resort.
 
-  If you kill the line for a file that is a directory, the directory's
-contents are also deleted from the buffer.  Typing @kbd{C-u k} on the
-header line for a subdirectory is another way to delete a subdirectory
-from the Dired buffer.
+  If you use @kbd{k} with a numeric prefix argument to kill the line
+for a file that is a directory, which you have inserted in the Dired
+buffer as a subdirectory, then this deletes that subdirectory from the
+buffer as well.  Typing @kbd{C-u k} on the header line for a subdirectory
+is another way to delete a subdirectory from the Dired buffer.
 
   The @kbd{g} command brings back any individual lines that you have
 killed in this way, but not subdirectories---you must use @kbd{i} to
--- a/man/emacs-xtra.texi	Sat Jul 17 05:09:07 2004 +0000
+++ b/man/emacs-xtra.texi	Fri Jul 23 04:30:44 2004 +0000
@@ -291,6 +291,12 @@
 the buffer's default switches.  If any of this yields problems, you
 can easily correct the situation using @kbd{C-u i} or @kbd{C-u l}.
 
+Dired does not remember the @code{R} switch.  Inserting a subdirectory
+with switches that include the @code{R} switch is equivalent with
+inserting each of its subdirectories using all remaining switches.
+For instance, updating or killing a subdirectory that was inserted
+with the @code{R} switch will not update or kill its subdirectories.
+
 The buffer's default switches do not affect subdirectories that were
 inserted using explicitly specified switches.  In particular,
 commands such as @kbd{s}, that change the buffer's switches do not
--- a/man/search.texi	Sat Jul 17 05:09:07 2004 +0000
+++ b/man/search.texi	Fri Jul 23 04:30:44 2004 +0000
@@ -748,10 +748,9 @@
 a symbol-constituent character follows.
 
 @item \_>
-matches the empty string, but only at the end of a symbol.  A symbol
-is a sequence of one or more word or symbol constituent characters.
-@samp{\_>} matches at the end of the buffer only if the contents end
-with a symbol-constituent character.
+matches the empty string, but only at the end of a symbol.  @samp{\_>}
+matches at the end of the buffer only if the contents end with a
+symbol-constituent character.
 
 @item \s@var{c}
 matches any character whose syntax is @var{c}.  Here @var{c} is a
--- a/man/trampver.texi	Sat Jul 17 05:09:07 2004 +0000
+++ b/man/trampver.texi	Fri Jul 23 04:30:44 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	Sat Jul 17 05:09:07 2004 +0000
+++ b/src/ChangeLog	Fri Jul 23 04:30:44 2004 +0000
@@ -1,3 +1,98 @@
+2004-07-22  Barry Fishman <barry_fishman@att.net>  (tiny change)
+
+	* s/gnu-linux.h: Use GC_MARK_STACK if __amd64__ is defined.
+
+2004-07-21  Kim F. Storm  <storm@cua.dk>
+
+	* window.h (struct glyph_matrix): New members nrows_scale_factor
+	and ncols_scale_factor.
+
+	* window.c (make_window): Initialize nrows_scale_factor and
+	ncols_scale_factor members.
+
+	* dispnew.c (margin_glyphs_to_reserve): Apply ncols_scale_factor.
+	(allocate_matrices_for_frame_redisplay): Fix left/right margin mix-up.
+	(required_matrix_height): Apply nrows_scale_factor.
+	(required_matrix_width): Apply ncols_scale_factor.
+
+	* xdisp.c (display_line): Increment nrows_scale_factor and set
+	fonts_changed_p if past last allocated row.
+	(append_glyph, append_composite_glyph, produce_image_glyph)
+	(append_stretch_glyph): Increment ncols_scale_factor and set
+	fonts_changed_p if current area is full.
+
+2004-07-21  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>
+
+	* widget.c (EmacsFrameDestroy): Don't abort if normal_gc is 0.
+
+2004-07-19  Luc Teirlinck  <teirllm@auburn.edu>
+
+	* window.c (Fpos_visible_in_window_p, Fset_window_hscroll)
+	(Fwindow_inside_pixel_edges, Fwindow_end, Fset_window_point)
+	(Fset_window_start, Fscroll_up, Fscroll_down)
+	(Fother_window_for_scrolling, Fscroll_other_window)
+	(Fsave_window_excursion, Fset_window_vscroll)
+	(syms_of_window) <window-size-fixed>: Doc fixes.
+
+2004-07-19  KOBAYASHI Yasuhiro  <kobayays@otsukakj.co.jp>  (tiny change)
+
+	* w32fns.c (Fx_file_dialog): Use ENCODE_FILE instead of
+	ENCODE_SYSTEM for filenames.
+
+2004-07-18  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+	* mac.c (sys_select): Block input around call to
+	ReceiveNextEvent to prevent breakage.  Correctly handle
+	blocking on event queue only by calling ReceiveNextEvent
+	instead of select (since GUI events aren't on an fd).
+	(sys_read): Remove function
+	* sysdep.c: Remove redefine of read to sys_read if HAVE_CARBON
+
+2004-07-18  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+	* mac.c (sys_select): Redo sys_select to use alarm-based
+	polling instead of 1 sec timeouts (like solaris).
+
+	* macterm.c (x_make_frame_visible): Comment in polling on
+	frame creation.
+
+	* keyboard.c: Undef SIGIO on Carbon
+
+	* atimer.c (alarm_signal_handler): Call alarm handlers after
+	scheduling.
+
+	* eval.c (Feval): Remove quit_char test
+
+	* process.c (wait_reading_process_input): Remove clearing
+	stdin for select call on process input.
+
+2004-07-18  Luc Teirlinck  <teirllm@auburn.edu>
+
+	* xdisp.c (syms_of_xdisp) <window-scroll-functions>: Correct
+	capitalization error in docstring.
+
+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
--- a/src/atimer.c	Sat Jul 17 05:09:07 2004 +0000
+++ b/src/atimer.c	Fri Jul 23 04:30:44 2004 +0000
@@ -375,7 +375,9 @@
 
       t = atimers;
       atimers = atimers->next;
+#ifndef MAC_OSX
       t->fn (t);
+#endif
 
       if (t->type == ATIMER_CONTINUOUS)
 	{
@@ -387,6 +389,10 @@
 	  t->next = free_atimers;
 	  free_atimers = t;
 	}
+#ifdef MAC_OSX
+      /* Fix for Ctrl-G.  Perhaps this should apply to all platforms. */
+      t->fn (t); 
+#endif
 
       EMACS_GET_TIME (now);
     }
--- a/src/buffer.c	Sat Jul 17 05:09:07 2004 +0000
+++ b/src/buffer.c	Fri Jul 23 04:30:44 2004 +0000
@@ -5877,7 +5877,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/dispnew.c	Sat Jul 17 05:09:07 2004 +0000
+++ b/src/dispnew.c	Fri Jul 23 04:30:44 2004 +0000
@@ -579,7 +579,7 @@
       int width = XFASTINT (w->total_cols);
       double d = max (0, XFLOATINT (margin));
       d = min (width / 2 - 1, d);
-      n = (int) ((double) total_glyphs / width * d);
+      n = (int) ((double) total_glyphs / width * d) * w->ncols_scale_factor;
     }
   else
     n = 0;
@@ -1911,10 +1911,10 @@
 	      || dim.width != w->desired_matrix->matrix_w
 	      || dim.height != w->desired_matrix->matrix_h
 	      || (margin_glyphs_to_reserve (w, dim.width,
-					    w->right_margin_cols)
+					    w->left_margin_cols)
 		  != w->desired_matrix->left_margin_glyphs)
 	      || (margin_glyphs_to_reserve (w, dim.width,
-					    w->left_margin_cols)
+					    w->right_margin_cols)
 		  != w->desired_matrix->right_margin_glyphs))
 	    *window_change_flags |= CHANGED_LEAF_MATRIX;
 
@@ -1982,7 +1982,7 @@
       int ch_height = FRAME_SMALLEST_FONT_HEIGHT (f);
       int window_pixel_height = window_box_height (w) + abs (w->vscroll);
       return (((window_pixel_height + ch_height - 1)
-	       / ch_height)
+	       / ch_height) * w->nrows_scale_factor
 	      /* One partially visible line at the top and
 		 bottom of the window.  */
 	      + 2
@@ -2010,7 +2010,7 @@
 
       /* Compute number of glyphs needed in a glyph row.  */
       return (((window_pixel_width + ch_width - 1)
-	       / ch_width)
+	       / ch_width) * w->ncols_scale_factor
 	      /* 2 partially visible columns in the text area.  */
 	      + 2
 	      /* One partially visible column at the right
--- a/src/eval.c	Sat Jul 17 05:09:07 2004 +0000
+++ b/src/eval.c	Fri Jul 23 04:30:44 2004 +0000
@@ -2145,9 +2145,6 @@
     val = call_debugger (Fcons (Qexit, Fcons (val, Qnil)));
   backtrace_list = backtrace.next;
 
-#ifdef HAVE_CARBON
-  mac_check_for_quit_char();
-#endif
   return val;
 }
 
--- a/src/frame.c	Sat Jul 17 05:09:07 2004 +0000
+++ b/src/frame.c	Fri Jul 23 04:30:44 2004 +0000
@@ -1327,6 +1327,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	Sat Jul 17 05:09:07 2004 +0000
+++ b/src/keyboard.c	Fri Jul 23 04:30:44 2004 +0000
@@ -607,7 +607,7 @@
 
 /* We are unable to use interrupts if FIONREAD is not available,
    so flush SIGIO so we won't try.  */
-#ifndef FIONREAD
+#if !defined (FIONREAD) || defined(HAVE_CARBON)
 #ifdef SIGIO
 #undef SIGIO
 #endif
@@ -1089,6 +1089,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.  */
@@ -10173,9 +10186,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))
@@ -10191,7 +10202,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++)
     {
 
@@ -10204,8 +10218,7 @@
     }
 
   input_pending = 0;
-#endif
-#endif /* BSD_SYSTEM and not BSD4_1 */
+#endif /* SIGTSTP */
 }
 
 void
--- a/src/mac.c	Sat Jul 17 05:09:07 2004 +0000
+++ b/src/mac.c	Fri Jul 23 04:30:44 2004 +0000
@@ -2769,6 +2769,8 @@
 extern int inhibit_window_system;
 extern int noninteractive;
 
+#include "blockinput.h"
+
 /* When Emacs is started from the Finder, SELECT always immediately
    returns as if input is present when file descriptor 0 is polled for
    input.  Strangely, when Emacs is run as a GUI application from the
@@ -2776,85 +2778,100 @@
    the system call SELECT corrects this discrepancy.  */
 int
 sys_select (n, rfds, wfds, efds, timeout)
-  int n;
-  SELECT_TYPE *rfds;
-  SELECT_TYPE *wfds;
-  SELECT_TYPE *efds;
-  struct timeval *timeout;
+     int n;
+     SELECT_TYPE *rfds;
+     SELECT_TYPE *wfds;
+     SELECT_TYPE *efds;
+     struct timeval *timeout;
 {
-  if (!inhibit_window_system && rfds && FD_ISSET (0, rfds))
-    return 1;
-  else if (inhibit_window_system || noninteractive ||
-	   (timeout && (EMACS_SECS(*timeout)==0) &&
-	    (EMACS_USECS(*timeout)==0)))
-    return select(n, rfds, wfds, efds, timeout);
-  else
+  OSErr err;
+  EMACS_TIME end_time, now, remaining_time;
+ 
+  if (inhibit_window_system || noninteractive
+      || rfds == NULL || !FD_ISSET (0, rfds))
+    return select (n, rfds, wfds, efds, timeout);
+  
+  if (wfds == NULL && efds == NULL)
     {
-      EMACS_TIME end_time, now;
-
-      EMACS_GET_TIME (end_time);
-      if (timeout)
-	EMACS_ADD_TIME (end_time, end_time, *timeout);
-
-      do
-	{
-	  int r;
-	  EMACS_TIME one_second;
-	  SELECT_TYPE orfds;
-
-	  FD_ZERO (&orfds);
-	  if (rfds)
+      int i;
+
+      for (i = 1; i < n; i++)
+	if (FD_ISSET (i, rfds))
+	  break;
+      if (i == n)
+  	{
+	  EventTimeout timeout_sec =
+	    (timeout
+	     ? (EMACS_SECS (*timeout) * kEventDurationSecond
+		+ EMACS_USECS (*timeout) * kEventDurationMicrosecond)
+	     : kEventDurationForever);
+
+	  BLOCK_INPUT;
+	  err = ReceiveNextEvent (0, NULL, timeout_sec,
+				  kEventLeaveInQueue, NULL);
+	  UNBLOCK_INPUT;
+	  if (err == noErr)
 	    {
-	      orfds = *rfds;
+	      FD_ZERO (rfds);
+	      FD_SET (0, rfds);
+	      return 1;
 	    }
-
-	  EMACS_SET_SECS (one_second, 1);
-	  EMACS_SET_USECS (one_second, 0);
-
-	  if (timeout && EMACS_TIME_LT(*timeout, one_second))
-	    one_second = *timeout;
-
-	  if ((r = select (n, &orfds, wfds, efds, &one_second)) > 0)
+	  else
+	    return 0;
+	}
+    }
+
+  if (timeout)
+    {
+      remaining_time = *timeout;
+      EMACS_GET_TIME (now);
+      EMACS_ADD_TIME (end_time, now, remaining_time);
+    }
+  FD_CLR (0, rfds);
+  do
+    {
+      EMACS_TIME select_timeout;
+      SELECT_TYPE orfds = *rfds;
+      int r;
+
+      EMACS_SET_SECS_USECS (select_timeout, 0, 20000);
+
+      if (timeout && EMACS_TIME_LT (remaining_time, select_timeout))
+	select_timeout = remaining_time;
+
+      r = select (n, &orfds, wfds, efds, &select_timeout);
+      BLOCK_INPUT;
+      err = ReceiveNextEvent (0, NULL, kEventDurationNoWait,
+			      kEventLeaveInQueue, NULL);
+      UNBLOCK_INPUT;
+      if (r > 0)
+	{
+	  *rfds = orfds;
+	  if (err == noErr)
 	    {
-	      *rfds = orfds;
-	      return r;
+	      FD_SET (0, rfds);
+	      r++;
 	    }
-
-	  mac_check_for_quit_char();
-
+	  return r;
+	}
+      else if (err == noErr)
+	{
+	  FD_ZERO (rfds);
+	  FD_SET (0, rfds);
+	  return 1;
+	}
+
+      if (timeout)
+	{
 	  EMACS_GET_TIME (now);
-	  EMACS_SUB_TIME (now, end_time, now);
+	  EMACS_SUB_TIME (remaining_time, end_time, now);
 	}
-      while (!timeout || !EMACS_TIME_NEG_P (now));
-
-      return 0;
     }
+  while (!timeout || EMACS_TIME_LT (now, end_time));
+
+  return 0;
 }
 
-#undef read
-int sys_read (fds, buf, nbyte)
-     int fds;
-     char *buf;
-     unsigned int nbyte;
-{
-  SELECT_TYPE rfds;
-  EMACS_TIME one_second;
-  int r;
-
-  /* Use select to block on IO while still checking for quit_char */
-  if (!inhibit_window_system && !noninteractive &&
-      ! (fcntl(fds, F_GETFL, 0) & O_NONBLOCK))
-    {
-      FD_ZERO (&rfds);
-      FD_SET (fds, &rfds);
-      if (sys_select (fds+1, &rfds, 0, 0, NULL) < 0)
-	return -1;
-    }
-
-  return read (fds, buf, nbyte);
-}
-
-
 /* Set up environment variables so that Emacs can correctly find its
    support files when packaged as an application bundle.  Directories
    placed in /usr/local/share/emacs/<emacs-version>/, /usr/local/bin,
--- a/src/macterm.c	Sat Jul 17 05:09:07 2004 +0000
+++ b/src/macterm.c	Fri Jul 23 04:30:44 2004 +0000
@@ -5321,7 +5321,6 @@
 
   XFlush (FRAME_MAC_DISPLAY (f));
 
-#if 0 /* MAC_TODO */
   /* Synchronize to ensure Emacs knows the frame is visible
      before we do anything else.  We do this loop with input not blocked
      so that incoming events are handled.  */
@@ -5365,9 +5364,6 @@
 	FRAME_SAMPLE_VISIBILITY (f);
       }
   }
-#else
-  UNBLOCK_INPUT;
-#endif /* MAC_TODO */
 }
 
 /* Change from mapped state to withdrawn state.  */
--- a/src/print.c	Sat Jul 17 05:09:07 2004 +0000
+++ b/src/print.c	Fri Jul 23 04:30:44 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/process.c	Sat Jul 17 05:09:07 2004 +0000
+++ b/src/process.c	Fri Jul 23 04:30:44 2004 +0000
@@ -4191,12 +4191,13 @@
 	  SELECT_TYPE Atemp, Ctemp;
 
 	  Atemp = input_wait_mask;
-#ifdef MAC_OSX
-          /* On Mac OS X, the SELECT system call always says input is
+#if 0
+          /* On Mac OS X 10.0, the SELECT system call always says input is
              present (for reading) at stdin, even when none is.  This
              causes the call to SELECT below to return 1 and
              status_notify not to be called.  As a result output of
-             subprocesses are incorrectly discarded.  */
+             subprocesses are incorrectly discarded.  
+	  */
           FD_CLR (0, &Atemp);
 #endif
 	  Ctemp = connect_wait_mask;
--- a/src/s/gnu-linux.h	Sat Jul 17 05:09:07 2004 +0000
+++ b/src/s/gnu-linux.h	Fri Jul 23 04:30:44 2004 +0000
@@ -355,7 +355,7 @@
 
 #if defined __i386__ || defined __sparc__ || defined __mc68000__ \
     || defined __alpha__ || defined __mips__ || defined __s390__ \
-    || defined __arm__ || defined __powerpc__
+    || defined __arm__ || defined __powerpc__ || defined __amd64__
 #define GC_SETJMP_WORKS 1
 #define GC_MARK_STACK GC_MAKE_GCPROS_NOOPS
 #ifdef __mc68000__
--- a/src/sysdep.c	Sat Jul 17 05:09:07 2004 +0000
+++ b/src/sysdep.c	Fri Jul 23 04:30:44 2004 +0000
@@ -70,10 +70,6 @@
 #endif
 #endif /* not WINDOWSNT */
 
-#ifdef HAVE_CARBON
-#define read sys_read
-#endif
-
 /* Does anyone other than VMS need this? */
 #ifndef fwrite
 #define sys_fwrite fwrite
--- a/src/w32fns.c	Sat Jul 17 05:09:07 2004 +0000
+++ b/src/w32fns.c	Fri Jul 23 04:30:44 2004 +0000
@@ -7798,14 +7798,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 (ENCODE_SYSTEM (dir)), MAX_PATH);
+  strncpy (init_dir, SDATA (ENCODE_FILE (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 (ENCODE_SYSTEM (default_filename));
+      char *full_path_name = SDATA (ENCODE_FILE (default_filename));
 
       unixtodos_filename (full_path_name);
 
--- a/src/widget.c	Sat Jul 17 05:09:07 2004 +0000
+++ b/src/widget.c	Fri Jul 23 04:30:44 2004 +0000
@@ -758,7 +758,6 @@
 
   if (! s) abort ();
   if (! s->output_data.x) abort ();
-  if (! s->output_data.x->normal_gc) abort ();
 
   BLOCK_INPUT;
   x_free_gcs (s);
--- a/src/window.c	Sat Jul 17 05:09:07 2004 +0000
+++ b/src/window.c	Fri Jul 23 04:30:44 2004 +0000
@@ -260,6 +260,7 @@
   bzero (&p->last_cursor, sizeof (p->last_cursor));
   bzero (&p->phys_cursor, sizeof (p->phys_cursor));
   p->desired_matrix = p->current_matrix = 0;
+  p->nrows_scale_factor = p->ncols_scale_factor = 1;
   p->phys_cursor_type = -1;
   p->phys_cursor_width = -1;
   p->must_be_updated_p = 0;
@@ -318,15 +319,17 @@
 
 DEFUN ("pos-visible-in-window-p", Fpos_visible_in_window_p,
        Spos_visible_in_window_p, 0, 3, 0,
-       doc: /* Return t if position POS is currently on the frame in WINDOW.
+       doc: /* Return non-nil if position POS is currently on the frame in WINDOW.
 Return nil if that position is scrolled vertically out of view.
 If a character is only partially visible, nil is returned, unless the
 optional argument PARTIALLY is non-nil.
+If POS is only out of view because of horizontal scrolling, return non-nil.
 POS defaults to point in WINDOW; WINDOW defaults to the selected window.
 
 If POS is visible, return t if PARTIALLY is nil; if PARTIALLY is non-nil,
-return value is a list (X Y PARTIAL) where X and Y are the pixel relative
-coordinate  */)
+return value is a list (X Y FULLY) where X and Y are the pixel coordinates
+relative to the top left corner of the window, and FULLY is t if the
+character after POS is fully visible and nil otherwise.  */)
      (pos, window, partially)
      Lisp_Object pos, window, partially;
 {
@@ -430,7 +433,7 @@
 
 DEFUN ("set-window-hscroll", Fset_window_hscroll, Sset_window_hscroll, 2, 2, 0,
        doc: /* Set number of columns WINDOW is scrolled from left margin to NCOL.
-NCOL should be zero or positive.
+Return NCOL.  NCOL should be zero or positive.
 
 Note that if `automatic-hscrolling' is non-nil, you cannot scroll the
 window so that the location of point becomes invisible.  */)
@@ -544,7 +547,7 @@
 }
 
 DEFUN ("window-inside-pixel-edges", Fwindow_inside_pixel_edges, Swindow_inside_pixel_edges, 0, 1, 0,
-       doc: /* Return a list of the edge coordinates of WINDOW.
+       doc: /* Return a list of the edge pixel coordinates of WINDOW.
 \(LEFT TOP RIGHT BOTTOM), all relative to 0, 0 at top left corner of frame.
 RIGHT is one more than the rightmost x position used by text in WINDOW,
 and BOTTOM is one more than the bottommost y position used by text in WINDOW.
@@ -670,7 +673,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);
@@ -986,6 +989,8 @@
 This is updated by redisplay, when it runs to completion.
 Simply changing the buffer text or setting `window-start'
 does not update this value.
+Return nil if there is no recorded value.  \(This can happen if the
+last redisplay of WINDOW was preempted, and did not finish.)
 If UPDATE is non-nil, compute the up-to-date position
 if it isn't already recorded.  */)
      (window, update)
@@ -1051,7 +1056,8 @@
 }
 
 DEFUN ("set-window-point", Fset_window_point, Sset_window_point, 2, 2, 0,
-       doc: /* Make point value in WINDOW be at position POS in WINDOW's buffer.  */)
+       doc: /* Make point value in WINDOW be at position POS in WINDOW's buffer.
+Return POS.  */)
      (window, pos)
      Lisp_Object window, pos;
 {
@@ -1074,6 +1080,7 @@
 
 DEFUN ("set-window-start", Fset_window_start, Sset_window_start, 2, 3, 0,
        doc: /* Make display in WINDOW start at position POS in WINDOW's buffer.
+Return POS.
 Optional third arg NOFORCE non-nil inhibits next redisplay
 from overriding motion of point in order to display at this exact start.  */)
      (window, pos, noforce)
@@ -1799,7 +1806,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;
@@ -1808,7 +1815,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;
 }
 
 
@@ -4838,7 +4855,8 @@
 }
 
 DEFUN ("scroll-up", Fscroll_up, Sscroll_up, 0, 1, "P",
-       doc: /* Scroll text of current window upward ARG lines; or near full screen if no ARG.
+       doc: /* Scroll text of current window upward ARG lines.
+If ARG is omitted or nil, scroll upward by a near full screen.
 A near full screen is `next-screen-context-lines' less than a full screen.
 Negative ARG means scroll downward.
 If ARG is the atom `-', scroll downward by nearly full screen.
@@ -4851,7 +4869,8 @@
 }
 
 DEFUN ("scroll-down", Fscroll_down, Sscroll_down, 0, 1, "P",
-       doc: /* Scroll text of current window down ARG lines; or near full screen if no ARG.
+       doc: /* Scroll text of current window down ARG lines.
+If ARG is omitted or nil, scroll down by a near full screen.
 A near full screen is `next-screen-context-lines' less than a full screen.
 Negative ARG means scroll upward.
 If ARG is the atom `-', scroll upward by nearly full screen.
@@ -4865,10 +4884,11 @@
 
 DEFUN ("other-window-for-scrolling", Fother_window_for_scrolling, Sother_window_for_scrolling, 0, 0, 0,
        doc: /* Return the other window for \"other window scroll\" commands.
+If `other-window-scroll-buffer' is non-nil, a window
+showing that buffer is used.
 If in the minibuffer, `minibuffer-scroll-window' if non-nil
-specifies the window.
-If `other-window-scroll-buffer' is non-nil, a window
-showing that buffer is used.  */)
+specifies the window.  This takes precedence over
+`other-window-scroll-buffer'.  */)
      ()
 {
   Lisp_Object window;
@@ -4914,10 +4934,11 @@
 If ARG is the atom `-', scroll downward by nearly full screen.
 When calling from a program, supply as argument a number, nil, or `-'.
 
+If `other-window-scroll-buffer' is non-nil, scroll the window
+showing that buffer, popping the buffer up if necessary.
 If in the minibuffer, `minibuffer-scroll-window' if non-nil
-specifies the window to scroll.
-If `other-window-scroll-buffer' is non-nil, scroll the window
-showing that buffer, popping the buffer up if necessary.  */)
+specifies the window to scroll.  This takes precedence over
+`other-window-scroll-buffer'.  */)
      (arg)
      Lisp_Object arg;
 {
@@ -5893,7 +5914,8 @@
 
 DEFUN ("save-window-excursion", Fsave_window_excursion, Ssave_window_excursion,
        0, UNEVALLED, 0,
-       doc: /* Execute body, preserving window sizes and contents.
+       doc: /* Execute BODY, preserving window sizes and contents.
+Return the value of the last form in BODY.
 Restore which buffer appears in which window, where display starts,
 and the value of point and mark for each window.
 Also restore the choice of selected window.
@@ -6153,7 +6175,11 @@
        doc: /* Set amount by which WINDOW should be scrolled vertically to VSCROLL.
 WINDOW nil means use the selected window.  Normally, VSCROLL is a
 non-negative multiple of the canonical character height of WINDOW;
-optional third arg PIXELS_P non-nil means that VSCROLL is in pixels.  */)
+optional third arg PIXELS_P non-nil means that VSCROLL is in pixels.
+If PIXELS-P is nil, VSCROLL may have to be rounded so that it
+corresponds to an integral number of pixels.  The return value is the
+result of this rounding.
+If PIXELS-P is non-nil, the return value is VSCROLL.  */)
   (window, vscroll, pixels_p)
      Lisp_Object window, vscroll, pixels_p;
 {
@@ -6637,9 +6663,11 @@
 
   DEFVAR_BOOL ("window-size-fixed", &window_size_fixed,
 	       doc: /* Non-nil in a buffer means windows displaying the buffer are fixed-size.
+If the value is`height', then only the window's height is fixed.
+If the value is `width', then only the window's width is fixed.
+Any other non-nil value fixes both the width and the height.
 Emacs won't change the size of any window displaying that buffer,
-unless you explicitly change the size, or Emacs has no other choice.
-This variable automatically becomes buffer-local when set.  */);
+unless you explicitly change the size, or Emacs has no other choice.  */);
   Fmake_variable_buffer_local (Qwindow_size_fixed);
   window_size_fixed = 0;
 
--- a/src/window.h	Sat Jul 17 05:09:07 2004 +0000
+++ b/src/window.h	Fri Jul 23 04:30:44 2004 +0000
@@ -236,6 +236,11 @@
     struct glyph_matrix *current_matrix;
     struct glyph_matrix *desired_matrix;
 
+    /* Scaling factor for the glyph_matrix size calculation in this window.
+       Used if window contains many small images or uses proportional fonts,
+       as the normal  may yield a matrix which is too small.  */
+    int nrows_scale_factor, ncols_scale_factor;
+
     /* Cursor position as of last update that completed without
        pause.  This is the position of last_point.  */
     struct cursor_pos last_cursor;
--- a/src/xdisp.c	Sat Jul 17 05:09:07 2004 +0000
+++ b/src/xdisp.c	Fri Jul 23 04:30:44 2004 +0000
@@ -14562,9 +14562,13 @@
   /* We always start displaying at hpos zero even if hscrolled.  */
   xassert (it->hpos == 0 && it->current_x == 0);
 
-  /* We must not display in a row that's not a text row.  */
-  xassert (MATRIX_ROW_VPOS (row, it->w->desired_matrix)
-	   < it->w->desired_matrix->nrows);
+  if (MATRIX_ROW_VPOS (row, it->w->desired_matrix)
+      >= it->w->desired_matrix->nrows)
+    {
+      it->w->nrows_scale_factor++;
+      fonts_changed_p = 1;
+      return 0;
+    }
 
   /* Is IT->w showing the region?  */
   it->w->region_showing = it->region_beg_charpos > 0 ? Qt : Qnil;
@@ -18241,6 +18245,11 @@
       glyph->font_type = FONT_TYPE_UNKNOWN;
       ++it->glyph_row->used[area];
     }
+  else if (!fonts_changed_p)
+    {
+      it->w->ncols_scale_factor++;
+      fonts_changed_p = 1;
+    }
 }
 
 /* Store one glyph for the composition IT->cmp_id in IT->glyph_row.
@@ -18278,6 +18287,11 @@
       glyph->font_type = FONT_TYPE_UNKNOWN;
       ++it->glyph_row->used[area];
     }
+  else if (!fonts_changed_p)
+    {
+      it->w->ncols_scale_factor++;
+      fonts_changed_p = 1;
+    }
 }
 
 
@@ -18447,6 +18461,11 @@
 	  glyph->font_type = FONT_TYPE_UNKNOWN;
 	  ++it->glyph_row->used[area];
 	}
+      else if (!fonts_changed_p)
+	{
+	  it->w->ncols_scale_factor++;
+	  fonts_changed_p = 1;
+	}
     }
 }
 
@@ -18490,6 +18509,11 @@
       glyph->font_type = FONT_TYPE_UNKNOWN;
       ++it->glyph_row->used[area];
     }
+  else if (!fonts_changed_p)
+    {
+      it->w->ncols_scale_factor++;
+      fonts_changed_p = 1;
+    }
 }
 
 
@@ -22324,7 +22348,7 @@
   Vwindow_size_change_functions = Qnil;
 
   DEFVAR_LISP ("window-scroll-functions", &Vwindow_scroll_functions,
-    doc: /* List of Functions to call before redisplaying a window with scrolling.
+    doc: /* List of functions to call before redisplaying a window with scrolling.
 Each function is called with two arguments, the window
 and its new display-start position.  Note that the value of `window-end'
 is not valid when these functions are called.  */);