changeset 90599:c358d0861b16

Merge from emacs--devo--0 Patches applied: * emacs--devo--0 (patch 414-422) - Update from CVS - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 128-130) - Update from CVS - Merge from emacs--devo--0 Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-108
author Miles Bader <miles@gnu.org>
date Tue, 05 Sep 2006 02:54:22 +0000
parents 4a8681a3d827 (current diff) dccec68de80c (diff)
children 84dd84b43e1b
files etc/ChangeLog etc/HELLO etc/NEWS lisp/ChangeLog lisp/cus-edit.el lisp/cus-start.el lisp/custom.el lisp/dired-x.el lisp/emacs-lisp/checkdoc.el lisp/emacs-lisp/easy-mmode.el lisp/emacs-lisp/trace.el lisp/emulation/viper-cmd.el lisp/find-dired.el lisp/gnus/ChangeLog lisp/gnus/gnus-art.el lisp/gnus/gnus-sum.el lisp/gnus/mail-parse.el lisp/gnus/message.el lisp/gnus/rfc2047.el lisp/hl-line.el lisp/ibuffer.el lisp/imenu.el lisp/international/quail.el lisp/mail/feedmail.el lisp/mail/rmail-spam-filter.el lisp/mail/sendmail.el lisp/man.el lisp/net/rcirc.el lisp/net/tramp.el lisp/net/trampver.el lisp/paths.el lisp/progmodes/python.el lisp/shell.el lisp/simple.el lisp/startup.el lisp/term/mac-win.el lisp/term/xterm.el lisp/woman.el lispref/ChangeLog lispref/buffers.texi lispref/display.texi lispref/modes.texi lispref/nonascii.texi lispref/os.texi lispref/processes.texi man/ChangeLog man/basic.texi man/cc-mode.texi man/display.texi man/emacs.texi man/indent.texi man/tramp.texi man/trampver.texi man/windows.texi src/ChangeLog src/Makefile.in src/buffer.c src/buffer.h src/casefiddle.c src/coding.c src/editfns.c src/eval.c src/fns.c src/gtkutil.c src/indent.c src/insdel.c src/lisp.h src/macterm.c src/marker.c src/minibuf.c src/textprop.c src/w32.c src/window.c src/xdisp.c
diffstat 83 files changed, 1676 insertions(+), 641 deletions(-) [+]
line wrap: on
line diff
--- a/CONTRIBUTE	Thu Aug 31 07:43:01 2006 +0000
+++ b/CONTRIBUTE	Tue Sep 05 02:54:22 2006 +0000
@@ -147,13 +147,13 @@
 
 Discussion about Emacs development takes place on emacs-devel@gnu.org.
 
-Bug reports for released versions are sent to emacs-bugs@gnu.org.
+Bug reports for released versions are sent to bug-gnu-emacs@gnu.org.
 
 Bug reports for development versions are sent to emacs-pretest-bug@gnu.org.
 
 You can subscribe to the mailing lists at savannah.gnu.org/projects/emacs.
 
-You can find the mailing lists archives at mail.gnu.org or gmane.org.
+You can find the mailing lists archives at lists.gnu.org or gmane.org.
 
 
 ** Document your changes.
@@ -189,7 +189,7 @@
 It's sufficient that *Emacs* was changed in those years (and it was!).
 
 ** For those files that have been added since then, we should add
-the year it was added to Emacs, and all subsequent years."
+the year it was added to Emacs, and all subsequent years.
 
 ** For the refcards under etc/, it's ok to simply use the latest year
 (typically in a `\def\year{YEAR}' expression) for the rendered copyright
--- a/etc/ChangeLog	Thu Aug 31 07:43:01 2006 +0000
+++ b/etc/ChangeLog	Tue Sep 05 02:54:22 2006 +0000
@@ -1,3 +1,7 @@
+2006-09-02  Juri Linkov  <juri@jurta.org>
+
+	* HELLO: Regroup Europe Non-ASCII examples by similar scripts.
+
 2006-08-25  Richard Stallman  <rms@gnu.org>
 
 	* TUTORIAL: Give priority to graphical terminals over text terminals
--- a/etc/HELLO	Thu Aug 31 07:43:01 2006 +0000
+++ b/etc/HELLO	Tue Sep 05 02:54:22 2006 +0000
@@ -1,8 +1,8 @@
 This is a list of ways to say hello in various languages.
 
 Non-ASCII examples:
-  Europe: ,A!(BHola!, Hyv,Add(B p,Ad(Biv,Add(B, Gr,A|_(B Gott, Bon,Cu(Bu, Dobr,B}(B den, Tere p,Ad(Bevast
-          Cze,B6f(B!, ,FCei\(B ,Fsar(B, ,L7T`PRabRcYbU(B!, $,1J2J0J;J0J@JOJ=J1J0(B
+  Europe: ,A!(BHola!, Gr,A|_(B Gott, Hyv,Add(B p,Ad(Biv,Add(B, Tere ,Au(Bhtust, Bon,Cu(Bu
+          Cze,B6f(B!, Dobr,B}(B den, ,L7T`PRabRcYbU(B!, ,FCei\(B ,Fsar(B, $,1J2J0J;J0J@JOJ=J1J0(B
   Africa: $(3!A!,!>(B
   Middle/Near East: ,Hylem(B, (38R(47d(3T!JSa(4W(3W(B
   South Asia: $,15h5n5x6-5d6'(B, $,1?(?.?8?M>u?>?0(B, $,1@H@N@X@m@5@^@P@"(B, $,1<U<C<5<m<5<N<m(B, $(7"7"!#C"Q!;"E"S"G!;"7"2"[!;"D"["#"G!>(B
--- a/etc/NEWS	Thu Aug 31 07:43:01 2006 +0000
+++ b/etc/NEWS	Tue Sep 05 02:54:22 2006 +0000
@@ -4158,6 +4158,13 @@
 ** Text modification:
 
 +++
+*** The new function `buffer-chars-modified-tick' returns a buffer's
+tick counter for changes to characters.  Each time text in that buffer
+is inserted or deleted, the character-change counter is updated to the
+tick counter (`buffer-modified-tick').  Text property changes leave it
+unchanged.
+
++++
 *** The new function `insert-for-yank' normally works like `insert', but
 removes the text properties in the `yank-excluded-properties' list
 and handles the `yank-handler' text property.
--- a/lisp/ChangeLog	Thu Aug 31 07:43:01 2006 +0000
+++ b/lisp/ChangeLog	Tue Sep 05 02:54:22 2006 +0000
@@ -1,3 +1,207 @@
+2006-09-04  John Paul Wallington  <jpw@pobox.com>
+
+	* simple.el (completion-show-help): New defcustom.
+	(completion-setup-function): Heed it.
+
+2006-09-04  Dan Nicolaescu  <dann@ics.uci.edu>
+
+	* term/xterm.el (terminal-init-xterm): Add C-M- bindings.
+
+2006-09-04  Richard Stallman  <rms@gnu.org>
+
+	* mail/rmail-spam-filter.el (rsf-scanning-messages-now): Doc fix.
+	(rsf-min-region-to-spam-list): Doc fix.
+	(rsf-add-content-type-field): Doc fix.
+
+	* simple.el (kill-region): Explicitly test there is a region.
+
+2006-09-04  Chong Yidong  <cyd@stupidchicken.com>
+
+	* mail/feedmail.el (feedmail-buffer-to-sendmail): Look for
+	sendmail in several common directories.
+
+	* mail/sendmail.el (sendmail-program): Moved here from pathe.el.
+
+	* paths.el (sendmail-program): Removed.
+
+2006-09-04  Daiki Ueno  <ueno@unixuser.org>
+
+	* pgg-gpg.el (pgg-gpg-process-region): Revert two patches from Satyaki
+	Das.  http://article.gmane.org/gmane.emacs.gnus.general/49947
+	http://article.gmane.org/gmane.emacs.gnus.general/50457
+
+2006-09-03  Chong Yidong  <cyd@stupidchicken.com>
+
+	* cus-edit.el (custom-group-menu-create): Avoid deactivating the
+	mark after running the menu filter.
+
+2006-09-03  Juri Linkov  <juri@jurta.org>
+
+	* international/quail.el (quail-defrule-internal): Add a check
+	if a key is a vector.
+
+2006-09-02  Juri Linkov  <juri@jurta.org>
+
+	* man.el (Man-topic-history): New variable.
+	(man): Use it.
+
+	* woman.el (woman-topic-history): Change defvar to defvaralias
+	for symbol `Man-topic-history'.
+
+	* shell.el (shell-filter-ctrl-a-ctrl-b): Check if
+	`comint-last-output-start' is a marker by using `markerp' and
+	check if it has a position by using `marker-position', and use
+	this position for `goto-char'.
+
+	* international/quail.el (quail-defrule-internal): Add missing
+	`error' call for null key.
+
+2006-09-02  Ryan Yeske  <rcyeske@gmail.com>
+
+	* rcirc.el (rcirc-keywords): New variable.
+	(rcirc-bright-nicks, rcirc-dim-nicks): New variables.
+	(rcirc-bright-nick-regexp, rcirc-dim-nick-regexp): Remove
+	variables.
+	(rcirc-responses-no-activity): New function.
+	(rcirc-handler-generic): Check for responses in above.
+	(rcirc-process-command): Add ?: character to arguments of raw
+	server commands.
+	(rcirc-format-response-string): Use `rcirc-bright-nicks' and
+	`rcirc-dim-nicks'.
+	(rcirc-gray-toggle): Remove unused variable.
+	(rcirc-print): Remove some tracking logic, which is moved into
+	markup functions.
+	(rcirc-activity-types): Was `rcirc-activity-type', now a list of
+	types.
+	(rcirc-activity-string): Look for 'keyword in activity-types.
+	(rcirc-window-configuration-change): Don't erase overlay-arrow
+	unnecessarily.
+	(rcirc-add-or-remove): New function.
+	(rcirc-cmd-ignore): Use it.
+	(rcirc-message-leader): Remove unused function.
+	(rcicr-cmd-bright, rcirc-cmd-dim, rcirc-cmd-keyword): New commands.
+	(rcirc-add-face): New function.
+	(rcirc-facify): Use rcirc-add-face.
+	(rcirc-url-regexp): Add parens.
+	(rcirc-map-regexp): Remove function.
+	(rcirc-mangle-regexp): Remove function.
+	(rcirc-markup-text-functions): New variable.
+	(rcirc-markup-text): New function (replaces `rcirc-mangle-text').
+	(rcirc-markup-body-text, rcirc-markup-attributes)
+	(rcirc-markup-my-nick, rcirc-markup-urls, rcirc-markup-keywords)
+	(rcirc-markup-bright-nicks): New markup handler functions.
+	(rcirc-nick-in-message-full-line): New face.
+	(rcirc-track-nick): Rename from `rcirc-mode-line-nick'.
+	(rcirc-track-keyword, rcirc-url, rcirc-keyword): New faces.
+
+2006-09-02  Martin Rudalics  <rudalics@gmx.at>
+
+	* cus-start.el (hscroll-margin, hscroll-step)
+	(mode-line-in-non-selected-windows, mouse-autoselect-window)
+	(x-use-underline-position-properties): Change version to "22.1"
+	since they will appear there for the first time.
+
+2006-09-01  Chong Yidong  <cyd@stupidchicken.com>
+
+	* imenu.el (imenu-update-menubar): Use buffer-chars-modified-tick.
+
+2006-08-31  Richard Stallman  <rms@gnu.org>
+
+	* cus-edit.el (custom-save-variables): Slight cleanup.
+	(Custom-no-edit): Renamed from custom-no-edit.
+	(Custom-newline): Renamed from custom-newline.
+	(custom-mode-map): Use new names.
+
+	* emacs-lisp/easy-mmode.el (define-minor-mode): Reference manual
+	about customization, rather than M-x customize, in the doc string
+	made for the defcustom.
+
+	* emacs-lisp/trace.el (trace-function-background): Doc fix.
+
+2006-08-31  Romain Francoise  <romain@orebokech.com>
+
+	* dired-x.el (dired-guess-shell-alist-default): Update.
+
+2006-08-31  Michael Mauger  <mmaug@yahoo.com>
+
+	* custom.el (custom-theme-set-variables): Autoload packages before
+	sorting the variables.
+
+2006-08-30  Michael Kifer  <kifer@cs.stonybrook.edu>
+
+	* viper-cmd.el (viper-special-read-and-insert-char): Convert events to
+	chars if XEmacs.
+	(viper-after-change-undo-hook): Check if undo-in-progress is bound.
+
+2006-08-30  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* progmodes/python.el (python-eldoc-function): Re-enable quit while
+	waiting for process.
+
+2006-08-30  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+	* term/mac-win.el (mac-string-to-utxt): If adjustment for MacJapanese
+	results in ASCII-only string, encode original one directly.
+
+2006-08-29  Romain Francoise  <romain@orebokech.com>
+
+	* startup.el (normal-splash-screen, fancy-splash-screens):
+	Make buffer read-only and arrange to enter view mode if necessary.
+
+2006-08-29  Chong Yidong  <cyd@stupidchicken.com>
+
+	* hl-line.el (hl-line): New face.
+	(hl-line-face): Use it.
+
+	* image-mode.el (image-mode): Fix last fix.
+	Suggested by Kim F. Storm.
+
+2006-08-29  Michael Albinus  <michael.albinus@gmx.de>
+
+	Sync with Tramp 2.0.54.
+
+	* net/tramp.el (tramp-convert-file-attributes): Call `eql' instead
+	of `=', because `tramp-get-remote-gid' might not always return an
+	integer when expected.
+	(tramp-register-file-name-handlers): `partial-completion-mode' is
+	unknown to XEmacs.
+	(tramp-time-diff): Don't use `floor', it might fail for large
+	differences.
+	(tramp-handle-make-auto-save-file-name): For Emacs 21, set
+	`tramp-auto-save-directory' if unset in order to guarantee unique
+	auto-save file names.
+
+2006-08-28  Chong Yidong  <cyd@stupidchicken.com>
+
+	* image-mode.el (image-mode): Display image as text on a terminal.
+
+2006-08-28  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* progmodes/python.el (python-send-command): Simplify.
+	(run-python): Don't generate a new buffer unless `new' was specified.
+	Make sure we send `import emacs' to the proper process.
+
+	* progmodes/python.el (python-send-command): Don't wait for the command
+	to terminate.  Don't fiddle with compilation-parsing-end.
+
+2006-08-28  Chong Yidong  <cyd@stupidchicken.com>
+
+	* emacs-lisp/checkdoc.el (checkdoc-file-comments-engine):
+	Insert commentary after first line summary.
+
+	* woman.el (woman-follow): New function, based on `man-follow'.
+	(woman-mode-map): Use it.
+
+	* ibuffer.el (ibuffer-do-sort-by-recency): Perform full update
+	since ibuffer-do-sort-by-recency does not define a sorter.
+
+2006-08-28  Kim F. Storm  <storm@cua.dk>
+
+	* find-dired.el (find-dired): Use shell-quote-argument to properly
+	escape ( and ) args.  Also use it on {} and ; args in default
+	value of find-ls-option string.
+	(find-grep-dired): Use shell-quote-argument on {} and ; args.
+
 2006-08-27  Michael Olson  <mwolson@gnu.org>
 
 	* emacs-lisp/tq.el: Small grammar fix in comments.
--- a/lisp/cus-edit.el	Thu Aug 31 07:43:01 2006 +0000
+++ b/lisp/cus-edit.el	Tue Sep 05 02:54:22 2006 +0000
@@ -4255,19 +4255,31 @@
 	(let ((spec (car-safe (get symbol 'theme-value)))
 	      (value (get symbol 'saved-value))
 	      (requests (get symbol 'custom-requests))
-	      (now (not (or (custom-variable-p symbol)
-			    (and (not (boundp symbol))
-				 (not (eq (get symbol 'force-value)
-					  'rogue))))))
+	      (now (and (not (custom-variable-p symbol))
+			(or (boundp symbol)
+			    (eq (get symbol 'force-value)
+				'rogue))))
 	      (comment (get symbol 'saved-variable-comment)))
-	  ;; Check `requests'.
+	  ;; Check REQUESTS for validity. 
 	  (dolist (request requests)
 	    (when (and (symbolp request) (not (featurep request)))
 	      (message "Unknown requested feature: %s" request)
 	      (setq requests (delq request requests))))
+	  ;; Is there anything customized about this variable?
 	  (when (or (and spec (eq (car spec) 'user))
 		    comment
 		    (and (null spec) (get symbol 'saved-value)))
+	    ;; Output an element for this variable.
+	    ;; It has the form (SYMBOL VALUE-FORM NOW REQUESTS COMMENT).
+	    ;; SYMBOL is the variable name.
+	    ;; VALUE-FORM is an expression to return the customized value.
+	    ;; NOW if non-nil means always set the variable immediately
+	    ;; when the customizations are reloaded.  This is used
+	    ;; for rogue variables
+	    ;; REQUESTS is a list of packages to load before setting the
+	    ;; variable.  Each element of it will be passed to `require'.
+	    ;; COMMENT is whatever comment the user has specified
+	    ;; with the customize facility.
 	    (unless (bolp)
 	      (princ "\n"))
 	    (princ " '(")
@@ -4383,7 +4395,8 @@
   "Ignoring WIDGET, create a menu entry for customization group SYMBOL."
   `( ,(custom-unlispify-menu-entry symbol t)
      :filter (lambda (&rest junk)
-	       (let ((menu (custom-menu-create ',symbol)))
+	       (let* ((deactivate-mark nil)
+		      (menu (custom-menu-create ',symbol)))
 		 (if (consp menu) (cdr menu) menu)))))
 
 ;;;###autoload
@@ -4435,8 +4448,8 @@
   ;; Actually, this misfeature of dense keymaps was fixed on 2001-11-26.
   (let ((map (make-keymap)))
     (set-keymap-parent map widget-keymap)
-    (define-key map [remap self-insert-command] 'custom-no-edit)
-    (define-key map "\^m" 'custom-newline)
+    (define-key map [remap self-insert-command] 'Custom-no-edit)
+    (define-key map "\^m" 'Custom-newline)
     (define-key map " " 'scroll-up)
     (define-key map "\177" 'scroll-down)
     (define-key map "\C-c\C-c" 'Custom-set)
@@ -4448,12 +4461,12 @@
     map)
   "Keymap for `custom-mode'.")
 
-(defun custom-no-edit (pos &optional event)
+(defun Custom-no-edit (pos &optional event)
   "Invoke button at POS, or refuse to allow editing of Custom buffer."
   (interactive "@d")
   (error "You can't edit this part of the Custom buffer"))
 
-(defun custom-newline (pos &optional event)
+(defun Custom-newline (pos &optional event)
   "Invoke button at POS, or refuse to allow editing of Custom buffer."
   (interactive "@d")
   (let ((button (get-char-property pos 'button)))
--- a/lisp/cus-start.el	Thu Aug 31 07:43:01 2006 +0000
+++ b/lisp/cus-start.el	Tue Sep 05 02:54:22 2006 +0000
@@ -347,11 +347,11 @@
 	     (scroll-step windows integer)
 	     (scroll-conservatively windows integer)
 	     (scroll-margin windows integer)
-	     (hscroll-margin windows integer "21.3")
-	     (hscroll-step windows number "21.3")
+	     (hscroll-margin windows integer "22.1")
+	     (hscroll-step windows number "22.1")
 	     (truncate-partial-width-windows display boolean)
 	     (mode-line-inverse-video modeline boolean)
-	     (mode-line-in-non-selected-windows modeline boolean "21.3")
+	     (mode-line-in-non-selected-windows modeline boolean "22.1")
 	     (line-number-display-limit display
 					(choice integer
 						(const :tag "No limit" nil)))
@@ -373,8 +373,8 @@
 	     (x-gtk-show-hidden-files menu boolean "22.1")
 	     (x-gtk-whole-detached-tool-bar x boolean "22.1")
 	     ;; xterm.c
-             (mouse-autoselect-window display boolean "21.3")
-	     (x-use-underline-position-properties display boolean "21.3")
+	     (mouse-autoselect-window display boolean "22.1")
+	     (x-use-underline-position-properties display boolean "22.1")
 	     (x-underline-at-descent-line display boolean "22.1")
 	     (x-stretch-cursor display boolean "21.1")))
       this symbol group type standard version native-p
--- a/lisp/custom.el	Thu Aug 31 07:43:01 2006 +0000
+++ b/lisp/custom.el	Tue Sep 05 02:54:22 2006 +0000
@@ -874,6 +874,18 @@
 EXP itself is saved unevaluated as SYMBOL property `saved-value' and
 in SYMBOL's list property `theme-value' \(using `custom-push-theme')."
   (custom-check-theme theme)
+ 
+  ;; Process all the needed autoloads before anything else, so that the
+  ;; subsequent code has all the info it needs (e.g. which var corresponds
+  ;; to a minor mode), regardless of the ordering of the variables.
+  (dolist (entry args)
+    (let* ((symbol (indirect-variable (nth 0 entry))))
+      (unless (or (get symbol 'standard-value)
+                  (memq (get symbol 'custom-autoload) '(nil noset)))
+        ;; This symbol needs to be autoloaded, even just for a `set'.
+        (custom-load-symbol symbol))))
+ 
+  ;; Move minor modes and variables with explicit requires to the end.
   (setq args
 	(sort args
 	      (lambda (a1 a2)
@@ -904,10 +916,6 @@
 	    (when requests
 	      (put symbol 'custom-requests requests)
 	      (mapc 'require requests))
-            (unless (or (get symbol 'standard-value)
-                        (memq (get symbol 'custom-autoload) '(nil noset)))
-              ;; This symbol needs to be autoloaded, even just for a `set'.
-              (custom-load-symbol symbol))
 	    (setq set (or (get symbol 'custom-set) 'custom-set-default))
 	    (put symbol 'saved-value (list value))
 	    (put symbol 'saved-variable-comment comment)
--- a/lisp/dired-x.el	Thu Aug 31 07:43:01 2006 +0000
+++ b/lisp/dired-x.el	Tue Sep 05 02:54:22 2006 +0000
@@ -958,119 +958,132 @@
 (defvar dired-guess-shell-alist-default
   (list
    (list "\\.tar$"
-         '(if dired-guess-shell-gnutar
-              (concat dired-guess-shell-gnutar " xvf")
-            "tar xvf")
-         ;; Extract files into a separate subdirectory
-         '(if dired-guess-shell-gnutar
-              (concat "mkdir " (file-name-sans-extension file)
-                      "; " dired-guess-shell-gnutar " -C "
-                      (file-name-sans-extension file) " -xvf")
-            (concat "mkdir " (file-name-sans-extension file)
-                    "; tar -C " (file-name-sans-extension file) " -xvf")))
+	 '(if dired-guess-shell-gnutar
+	      (concat dired-guess-shell-gnutar " xvf")
+	    "tar xvf")
+	 ;; Extract files into a separate subdirectory
+	 '(if dired-guess-shell-gnutar
+	      (concat "mkdir " (file-name-sans-extension file)
+		      "; " dired-guess-shell-gnutar " -C "
+		      (file-name-sans-extension file) " -xvf")
+	    (concat "mkdir " (file-name-sans-extension file)
+		    "; tar -C " (file-name-sans-extension file) " -xvf"))
+	 ;; List archive contents.
+	 '(if dired-guess-shell-gnutar
+	      (concat dired-guess-shell-gnutar " tvf")
+	    "tar tvf"))
 
    ;; REGEXPS for compressed archives must come before the .Z rule to
    ;; be recognized:
    (list "\\.tar\\.Z$"
-         ;; Untar it.
-         '(if dired-guess-shell-gnutar
-              (concat dired-guess-shell-gnutar " zxvf")
-            (concat "zcat * | tar xvf -"))
-         ;; Optional conversion to gzip format.
-         '(concat "znew" (if dired-guess-shell-gzip-quiet " -q")
-                  " " dired-guess-shell-znew-switches))
+	 ;; Untar it.
+	 '(if dired-guess-shell-gnutar
+	      (concat dired-guess-shell-gnutar " zxvf")
+	    (concat "zcat * | tar xvf -"))
+	 ;; Optional conversion to gzip format.
+	 '(concat "znew" (if dired-guess-shell-gzip-quiet " -q")
+		  " " dired-guess-shell-znew-switches))
 
    ;; gzip'ed archives
    (list "\\.t\\(ar\\.\\)?gz$"
-         '(if dired-guess-shell-gnutar
-              (concat dired-guess-shell-gnutar " zxvf")
-            (concat "gunzip -qc * | tar xvf -"))
-         ;; Extract files into a separate subdirectory
-         '(if dired-guess-shell-gnutar
-              (concat "mkdir " (file-name-sans-extension file)
-                      "; " dired-guess-shell-gnutar " -C "
-                      (file-name-sans-extension file) " -zxvf")
-            (concat "mkdir " (file-name-sans-extension file)
-                    "; gunzip -qc * | tar -C "
-                    (file-name-sans-extension file) " -xvf -"))
-         ;; Optional decompression.
-         '(concat "gunzip" (if dired-guess-shell-gzip-quiet " -q" "")))
+	 '(if dired-guess-shell-gnutar
+	      (concat dired-guess-shell-gnutar " zxvf")
+	    (concat "gunzip -qc * | tar xvf -"))
+	 ;; Extract files into a separate subdirectory
+	 '(if dired-guess-shell-gnutar
+	      (concat "mkdir " (file-name-sans-extension file)
+		      "; " dired-guess-shell-gnutar " -C "
+		      (file-name-sans-extension file) " -zxvf")
+	    (concat "mkdir " (file-name-sans-extension file)
+		    "; gunzip -qc * | tar -C "
+		    (file-name-sans-extension file) " -xvf -"))
+	 ;; Optional decompression.
+	 '(concat "gunzip" (if dired-guess-shell-gzip-quiet " -q" ""))
+	 ;; List archive contents.
+	 '(if dired-guess-shell-gnutar
+	      (concat dired-guess-shell-gnutar " ztvf")
+	    (concat "gunzip -qc * | tar tvf -")))
 
    ;; bzip2'ed archives
    (list "\\.t\\(ar\\.bz2\\|bz\\)$"
 	 "bunzip2 -c * | tar xvf -"
-         ;; Extract files into a separate subdirectory
-         '(concat "mkdir " (file-name-sans-extension file)
-                  "; bunzip2 -c * | tar -C "
-                  (file-name-sans-extension file) " -xvf -")
+	 ;; Extract files into a separate subdirectory
+	 '(concat "mkdir " (file-name-sans-extension file)
+		  "; bunzip2 -c * | tar -C "
+		  (file-name-sans-extension file) " -xvf -")
 	 ;; Optional decompression.
-         "bunzip2")
+	 "bunzip2")
 
    '("\\.shar\\.Z$" "zcat * | unshar")
    '("\\.shar\\.g?z$" "gunzip -qc * | unshar")
 
    '("\\.e?ps$" "ghostview" "xloadimage" "lpr")
    (list "\\.e?ps\\.g?z$" "gunzip -qc * | ghostview -"
-         ;; Optional decompression.
-         '(concat "gunzip" (if dired-guess-shell-gzip-quiet " -q")))
+	 ;; Optional decompression.
+	 '(concat "gunzip" (if dired-guess-shell-gzip-quiet " -q")))
    (list "\\.e?ps\\.Z$" "zcat * | ghostview -"
-         ;; Optional conversion to gzip format.
-         '(concat "znew" (if dired-guess-shell-gzip-quiet " -q")
-                  " " dired-guess-shell-znew-switches))
+	 ;; Optional conversion to gzip format.
+	 '(concat "znew" (if dired-guess-shell-gzip-quiet " -q")
+		  " " dired-guess-shell-znew-switches))
 
    '("\\.patch$" "cat * | patch")
    (list "\\.patch\\.g?z$" "gunzip -qc * | patch"
-         ;; Optional decompression.
-         '(concat "gunzip" (if dired-guess-shell-gzip-quiet " -q")))
+	 ;; Optional decompression.
+	 '(concat "gunzip" (if dired-guess-shell-gzip-quiet " -q")))
    (list "\\.patch\\.Z$" "zcat * | patch"
-         ;; Optional conversion to gzip format.
-         '(concat "znew" (if dired-guess-shell-gzip-quiet " -q")
-                  " " dired-guess-shell-znew-switches))
+	 ;; Optional conversion to gzip format.
+	 '(concat "znew" (if dired-guess-shell-gzip-quiet " -q")
+		  " " dired-guess-shell-znew-switches))
 
    ;; The following four extensions are useful with dired-man ("N" key)
    (list "\\.\\(?:[0-9]\\|man\\)$" '(progn (require 'man)
-                             (if (Man-support-local-filenames)
-                                 "man -l"
-                               "cat * | tbl | nroff -man -h")))
+					   (if (Man-support-local-filenames)
+					       "man -l"
+					     "cat * | tbl | nroff -man -h")))
    (list "\\.\\(?:[0-9]\\|man\\)\\.g?z$" '(progn (require 'man)
-                                   (if (Man-support-local-filenames)
-                                       "man -l"
-                                     "gunzip -qc * | tbl | nroff -man -h"))
-         ;; Optional decompression.
-         '(concat "gunzip" (if dired-guess-shell-gzip-quiet " -q")))
+						 (if (Man-support-local-filenames)
+						     "man -l"
+						   "gunzip -qc * | tbl | nroff -man -h"))
+	 ;; Optional decompression.
+	 '(concat "gunzip" (if dired-guess-shell-gzip-quiet " -q")))
    (list "\\.[0-9]\\.Z$" '(progn (require 'man)
-                                 (if (Man-support-local-filenames)
-                                     "man -l"
-                                   "zcat * | tbl | nroff -man -h"))
-         ;; Optional conversion to gzip format.
-         '(concat "znew" (if dired-guess-shell-gzip-quiet " -q")
-                  " " dired-guess-shell-znew-switches))
+				 (if (Man-support-local-filenames)
+				     "man -l"
+				   "zcat * | tbl | nroff -man -h"))
+	 ;; Optional conversion to gzip format.
+	 '(concat "znew" (if dired-guess-shell-gzip-quiet " -q")
+		  " " dired-guess-shell-znew-switches))
    '("\\.pod$" "perldoc" "pod2man * | nroff -man")
 
-   '("\\.dvi$" "xdvi" "dvips")          ; preview and printing
-   '("\\.au$" "play")                   ; play Sun audiofiles
-   '("\\.mpg$" "mpeg_play")
-   '("\\.uu$" "uudecode")               ; for uudecoded files
+   '("\\.dvi$" "xdvi" "dvips")		; preview and printing
+   '("\\.au$" "play")			; play Sun audiofiles
+   '("\\.mpe?g$\\|\\.avi$" "xine -p")
+   '("\\.wav$" "play")
+   '("\\.uu$" "uudecode")		; for uudecoded files
    '("\\.hqx$" "mcvert")
-   '("\\.sh$" "sh")                     ; execute shell scripts
-   '("\\.xbm$" "bitmap")                ; view X11 bitmaps
+   '("\\.sh$" "sh")			; execute shell scripts
+   '("\\.xbm$" "bitmap")		; view X11 bitmaps
    '("\\.gp$" "gnuplot")
    '("\\.p[bgpn]m$" "xloadimage")
-   '("\\.gif$" "xloadimage")                    ; view gif pictures
+   '("\\.gif$" "xloadimage")		; view gif pictures
    '("\\.tif$" "xloadimage")
    '("\\.png$" "display")		; xloadimage 4.1 doesn't grok PNG
    '("\\.jpe?g$" "xloadimage")
-   '("\\.fig$" "xfig")                  ; edit fig pictures
-   '("\\.out$" "xgraph")                ; for plotting purposes.
+   '("\\.fig$" "xfig")			; edit fig pictures
+   '("\\.out$" "xgraph")		; for plotting purposes.
    '("\\.tex$" "latex" "tex")
    '("\\.texi\\(nfo\\)?$" "makeinfo" "texi2dvi")
-   '("\\.pdf$" "xpdf")              ; edit PDF files
+   '("\\.pdf$" "xpdf")
+   '("\\.doc$" "antiword" "strings")
+   '("\\.rpm$" "rpm -qilp" "rpm -ivh")
+   '("\\.dia$" "dia")
+   '("\\.mgp$" "mgp")
 
    ;; Some other popular archivers.
-   (list "\\.zip$" "unzip"
-         ;; Extract files into a separate subdirectory
-         '(concat "unzip" (if dired-guess-shell-gzip-quiet " -q")
-                  " -d " (file-name-sans-extension file)))
+   (list "\\.zip$" "unzip" "unzip -l"
+	 ;; Extract files into a separate subdirectory
+	 '(concat "unzip" (if dired-guess-shell-gzip-quiet " -q")
+		  " -d " (file-name-sans-extension file)))
    '("\\.zoo$" "zoo x//")
    '("\\.lzh$" "lharc x")
    '("\\.arc$" "arc x")
@@ -1081,10 +1094,11 @@
    (list "\\.dz$" "dictunzip")
    (list "\\.bz2$" "bunzip2")
    (list "\\.Z$" "uncompress"
-         ;; Optional conversion to gzip format.
-         '(concat "znew" (if dired-guess-shell-gzip-quiet " -q")
-                  " " dired-guess-shell-znew-switches))
-   )
+	 ;; Optional conversion to gzip format.
+	 '(concat "znew" (if dired-guess-shell-gzip-quiet " -q")
+		  " " dired-guess-shell-znew-switches))
+
+   '("\\.sign?$" "gpg --verify"))
 
   "Default alist used for shell command guessing.
 See `dired-guess-shell-alist-user'.")
--- a/lisp/emacs-lisp/checkdoc.el	Thu Aug 31 07:43:01 2006 +0000
+++ b/lisp/emacs-lisp/checkdoc.el	Tue Sep 05 02:54:22 2006 +0000
@@ -2261,7 +2261,8 @@
 		    (re-search-forward "^;;; Code" nil t)
 		    (re-search-forward "^(require" nil t)
 		    (re-search-forward "^(" nil t))
-		(beginning-of-line)))
+		(beginning-of-line))
+	       (t (re-search-forward ";;; .* --- .*\n")))
 	      (if (checkdoc-y-or-n-p
 		   "You should have a \";;; Commentary:\", add one? ")
 		  (insert "\n;;; Commentary:\n;; \n\n")
--- a/lisp/emacs-lisp/easy-mmode.el	Thu Aug 31 07:43:01 2006 +0000
+++ b/lisp/emacs-lisp/easy-mmode.el	Tue Sep 05 02:54:22 2006 +0000
@@ -200,7 +200,8 @@
 See the command `%s' for a description of this minor-mode."
                          (if body "
 Setting this variable directly does not take effect;
-use either \\[customize] or the function `%s'."))))
+either customize it (see the info node `Easy Customization')
+or call the function `%s'."))))
 	    `(defcustom ,mode ,init-value
 	       ,(format base-doc-string pretty-name mode mode)
 	       ,@set
--- a/lisp/emacs-lisp/trace.el	Thu Aug 31 07:43:01 2006 +0000
+++ b/lisp/emacs-lisp/trace.el	Tue Sep 05 02:54:22 2006 +0000
@@ -265,11 +265,14 @@
 ;;;###autoload
 (defun trace-function-background (function &optional buffer)
   "Traces FUNCTION with trace output going quietly to BUFFER.
-For every call of FUNCTION Lisp-style trace messages that display argument
-and return values will be inserted into BUFFER.  This function generates the
-trace advice for FUNCTION and activates it together with any other advice
-there might be!! Trace output will quietly go to BUFFER without changing
-the window or buffer configuration at all."
+When this tracing is enabled, every call to FUNCTION writes
+a Lisp-style trace message (showing the arguments and return value)
+into BUFFER.  This function generates advice to trace FUNCTION
+and activates it together with any other advice there might be.
+The trace output goes to BUFFER quietly, without changing
+the window or buffer configuration.
+
+BUFFER defaults to `trace-buffer'."
   (interactive
    (list
     (intern
--- a/lisp/emulation/viper-cmd.el	Thu Aug 31 07:43:01 2006 +0000
+++ b/lisp/emulation/viper-cmd.el	Tue Sep 05 02:54:22 2006 +0000
@@ -892,12 +892,17 @@
 	      (t
 	       ;;(setq ch (read-char-exclusive))
 	       (setq ch (aref (read-key-sequence nil) 0))
+	       (if viper-xemacs-p
+		   (setq ch (event-to-character ch)))
 	       ;; replace ^M with the newline
 	       (if (eq ch ?\C-m) (setq ch ?\n))
 	       ;; Make sure ^V and ^Q work as quotation chars
 	       (if (memq ch '(?\C-v ?\C-q))
-		   ;;(setq ch (read-char-exclusive))
-		   (setq ch (aref (read-key-sequence nil) 0))
+		   (progn
+		     ;;(setq ch (read-char-exclusive))
+		     (setq ch (aref (read-key-sequence nil) 0))
+		     (if viper-xemacs-p
+			 (setq ch (event-to-character ch))))
 		 )
 	       (insert ch))
 	      )
@@ -1750,7 +1755,7 @@
 
 ;; Hook used in viper-undo
 (defun viper-after-change-undo-hook (beg end len)
-  (if undo-in-progress
+  (if (and (boundp 'undo-in-progress) undo-in-progress)
       (setq undo-beg-posn beg
 	    undo-end-posn (or end beg))
     ;; some other hooks may be changing various text properties in
--- a/lisp/find-dired.el	Thu Aug 31 07:43:01 2006 +0000
+++ b/lisp/find-dired.el	Tue Sep 05 02:54:22 2006 +0000
@@ -129,8 +129,17 @@
 	  args (concat find-dired-find-program " . "
 		       (if (string= args "")
 			   ""
-			 (concat "\\( " args " \\) "))
-		       (car find-ls-option)))
+			 (concat
+			  (shell-quote-argument "(")
+			  " " args " "
+			  (shell-quote-argument ")")
+			  " "))
+		       (if (equal (car find-ls-option) "-exec ls -ld {} \\;")
+			   (concat "-exec ls -ld "
+				   (shell-quote-argument "{}")
+				   " "
+				   (shell-quote-argument ";"))
+			 (car find-ls-option))))
     ;; Start the find process.
     (shell-command (concat args "&") (current-buffer))
     ;; The next statement will bomb in classic dired (no optional arg allowed)
@@ -215,7 +224,10 @@
   (find-dired dir
 	      (concat "-type f -exec grep " find-grep-options " -e "
 		      (shell-quote-argument regexp)
-		      " {} \\\; ")))
+		      " "
+		      (shell-quote-argument "{}")
+		      " "
+		      (shell-quote-argument ";"))))
 
 (defun find-dired-filter (proc string)
   ;; Filter for \\[find-dired] processes.
--- a/lisp/gnus/ChangeLog	Thu Aug 31 07:43:01 2006 +0000
+++ b/lisp/gnus/ChangeLog	Tue Sep 05 02:54:22 2006 +0000
@@ -1,3 +1,43 @@
+2006-09-04  Chong Yidong  <cyd@stupidchicken.com>
+
+	* message.el (message-send-mail-with-sendmail): Look for sendmail in
+	several common directories.
+
+2006-09-04  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+	* rfc2047.el (rfc2047-strip-backslashes-in-quoted-strings): Decode `\\'
+	in quoted string into `\'.
+
+2006-09-01  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+	* rfc2047.el (rfc2047-quote-special-characters-in-quoted-strings):
+	Use standard-syntax-table.
+
+2006-09-01  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+	* gnus-art.el (gnus-decode-address-function): New variable.
+	(article-decode-encoded-words): Use it to decode headers which are
+	assumed to contain addresses.
+	(gnus-mime-delete-part): Remove useless `or'.
+
+	* gnus-sum.el (gnus-decode-encoded-address-function): New variable.
+	(gnus-summary-from-or-to-or-newsgroups): Use it to decode To header.
+	(gnus-nov-parse-line): Use it to decode From header.
+	(gnus-get-newsgroup-headers): Ditto.
+	(gnus-summary-enter-digest-group): Use it to decode `to-address'.
+
+	* mail-parse.el (mail-decode-encoded-address-region): New alias.
+	(mail-decode-encoded-address-string): New alias.
+
+	* rfc2047.el (rfc2047-quote-special-characters-in-quoted-strings):
+	New function.
+	(rfc2047-encode-message-header, rfc2047-encode-region): Use it.
+	(rfc2047-strip-backslashes-in-quoted-strings): New fnction.
+	(rfc2047-decode-region): Use it; add optional argument `address-mime'.
+	(rfc2047-decode-string): Ditto.
+	(rfc2047-decode-address-region): New function.
+	(rfc2047-decode-address-string): New function.
+
 2006-08-23  Andreas Seltenreich  <uwi7@rz.uni-karlsruhe.de>
 
 	[ Backported bug fix from No Gnus. ]
@@ -389,10 +429,6 @@
 	* gnus-sum.el (gnus-get-newsgroup-headers-xover): Group is an
 	optional parameter.
 
-2006-04-07  Reiner Steib  <Reiner.Steib@gmx.de>
-
-	* pgg-gpg.el: Revert to revision 7.15 to allow the use of gpg-agent.
-
 2006-04-06  Reiner Steib  <Reiner.Steib@gmx.de>
 
 	* gnus-fun.el (gnus): Require it for gnus-directory.
--- a/lisp/gnus/gnus-art.el	Thu Aug 31 07:43:01 2006 +0000
+++ b/lisp/gnus/gnus-art.el	Tue Sep 05 02:54:22 2006 +0000
@@ -853,6 +853,9 @@
 (defvar gnus-decode-header-function 'mail-decode-encoded-word-region
   "Function used to decode headers.")
 
+(defvar gnus-decode-address-function 'mail-decode-encoded-address-region
+  "Function used to decode addresses.")
+
 (defvar gnus-article-dumbquotes-map
   '(("\200" "EUR")
     ("\202" ",")
@@ -2377,10 +2380,23 @@
 			     (set-buffer gnus-summary-buffer)
 			   (error))
 			 gnus-newsgroup-ignored-charsets))
-	(inhibit-read-only t))
+	(inhibit-read-only t)
+	start)
     (save-restriction
       (article-narrow-to-head)
-      (funcall gnus-decode-header-function (point-min) (point-max)))))
+      (while (not (eobp))
+	(setq start (point))
+	(if (prog1
+		(looking-at "\
+\\(?:Resent-\\)?\\(?:From\\|Cc\\|To\\|Bcc\\|\\(?:In-\\)?Reply-To\\|Sender\
+\\|Mail-Followup-To\\|Mail-Copies-To\\|Approved\\):")
+	      (while (progn
+		       (forward-line)
+		       (if (eobp)
+			   nil
+			 (memq (char-after) '(?\t ? ))))))
+	    (funcall gnus-decode-address-function start (point))
+	  (funcall gnus-decode-header-function start (point)))))))
 
 (defun article-decode-group-name ()
   "Decode group names in `Newsgroups:'."
@@ -4324,9 +4340,8 @@
 	   (handles gnus-article-mime-handles)
 	   (none "(none)")
 	   (description
-	    (or
-	     (mail-decode-encoded-word-string (or (mm-handle-description data)
-						  none))))
+	    (mail-decode-encoded-word-string (or (mm-handle-description data)
+						 none)))
 	   (filename
 	    (or (mail-content-type-get (mm-handle-disposition data) 'filename)
 		none))
--- a/lisp/gnus/gnus-sum.el	Thu Aug 31 07:43:01 2006 +0000
+++ b/lisp/gnus/gnus-sum.el	Tue Sep 05 02:54:22 2006 +0000
@@ -992,7 +992,11 @@
   :group 'gnus-summary)
 
 (defvar gnus-decode-encoded-word-function 'mail-decode-encoded-word-string
-  "Variable that says which function should be used to decode a string with encoded words.")
+  "Function used to decode a string with encoded words.")
+
+(defvar gnus-decode-encoded-address-function
+  'mail-decode-encoded-address-string
+  "Function used to decode addresses with encoded words.")
 
 (defcustom gnus-extra-headers '(To Newsgroups)
   "*Extra headers to parse."
@@ -1001,7 +1005,7 @@
   :type '(repeat symbol))
 
 (defcustom gnus-ignored-from-addresses
-  (and user-mail-address  
+  (and user-mail-address
        (not (string= user-mail-address ""))
        (regexp-quote user-mail-address))
   "*Regexp of From headers that may be suppressed in favor of To headers."
@@ -3436,7 +3440,7 @@
 	      (concat "-> "
 		      (inline
 			(gnus-summary-extract-address-component
-			 (funcall gnus-decode-encoded-word-function to)))))
+			 (funcall gnus-decode-encoded-address-function to)))))
 	     ((setq newsgroups (cdr (assq 'Newsgroups extra-headers)))
 	      (concat "=> " newsgroups)))))
      (inline (gnus-summary-extract-address-component gnus-tmp-from)))))
@@ -4182,7 +4186,7 @@
 		   (error x))
 		 (condition-case ()	; from
 		     (gnus-remove-odd-characters
-		      (funcall gnus-decode-encoded-word-function
+		      (funcall gnus-decode-encoded-address-function
 			       (setq x (nnheader-nov-field))))
 		   (error x))
 		 (nnheader-nov-field)	; date
@@ -5956,7 +5960,7 @@
 	    (progn
 	      (goto-char p)
 	      (if (search-forward "\nfrom:" nil t)
-		  (funcall gnus-decode-encoded-word-function
+		  (funcall gnus-decode-encoded-address-function
 			   (nnheader-header-value))
 		"(nobody)"))
 	    ;; Date.
@@ -8449,10 +8453,11 @@
 	;; the parent article.
 	(when (setq to-address (or (gnus-fetch-field "reply-to")
 				   (gnus-fetch-field "from")))
-	  (setq params (append
-			(list (cons 'to-address
-				    (funcall gnus-decode-encoded-word-function
-					     to-address))))))
+	  (setq params
+		(append
+		 (list (cons 'to-address
+			     (funcall gnus-decode-encoded-address-function
+				      to-address))))))
 	(setq dig (nnheader-set-temp-buffer " *gnus digest buffer*"))
 	(insert-buffer-substring gnus-original-article-buffer)
 	;; Remove lines that may lead nndoc to misinterpret the
--- a/lisp/gnus/mail-parse.el	Thu Aug 31 07:43:01 2006 +0000
+++ b/lisp/gnus/mail-parse.el	Tue Sep 05 02:54:22 2006 +0000
@@ -70,6 +70,8 @@
 (defalias 'mail-encode-encoded-word-string 'rfc2047-encode-string)
 (defalias 'mail-decode-encoded-word-region 'rfc2047-decode-region)
 (defalias 'mail-decode-encoded-word-string 'rfc2047-decode-string)
+(defalias 'mail-decode-encoded-address-region 'rfc2047-decode-address-region)
+(defalias 'mail-decode-encoded-address-string 'rfc2047-decode-address-string)
 
 (provide 'mail-parse)
 
--- a/lisp/gnus/message.el	Thu Aug 31 07:43:01 2006 +0000
+++ b/lisp/gnus/message.el	Tue Sep 05 02:54:22 2006 +0000
@@ -3897,9 +3897,15 @@
 		       'call-process-region
 		       (append
 			(list (point-min) (point-max)
-			      (if (boundp 'sendmail-program)
-				  sendmail-program
-				"/usr/lib/sendmail")
+			      (cond ((boundp 'sendmail-program)
+				     sendmail-program)
+				    ((file-exists-p "/usr/sbin/sendmail")
+				     "/usr/sbin/sendmail")
+				    ((file-exists-p "/usr/lib/sendmail")
+				     "/usr/lib/sendmail")
+				    ((file-exists-p "/usr/ucblib/sendmail")
+				     "/usr/ucblib/sendmail")
+				    (t "fakemail"))
 			      nil errbuf nil "-oi")
 			;; Always specify who from,
 			;; since some systems have broken sendmails.
--- a/lisp/gnus/rfc2047.el	Thu Aug 31 07:43:01 2006 +0000
+++ b/lisp/gnus/rfc2047.el	Tue Sep 05 02:54:22 2006 +0000
@@ -171,6 +171,40 @@
       (re-search-forward ":[ \t\n]*" nil t)
       (buffer-substring-no-properties (point) (point-max)))))
 
+(defun rfc2047-quote-special-characters-in-quoted-strings (&optional
+							   encodable-regexp)
+  "Quote special characters with `\\'s in quoted strings.
+Quoting will not be done in a quoted string if it contains characters
+matching ENCODABLE-REGEXP."
+  (goto-char (point-min))
+  (let ((tspecials (concat "[" ietf-drums-tspecials "]"))
+	beg)
+    (with-syntax-table (standard-syntax-table)
+      (while (search-forward "\"" nil t)
+	(unless (eq (char-before) ?\\)
+	  (setq beg (match-end 0))
+	  (goto-char (match-beginning 0))
+	  (condition-case nil
+	      (progn
+		(forward-sexp)
+		(save-restriction
+		  (narrow-to-region beg (1- (point)))
+		  (goto-char beg)
+		  (unless (and encodable-regexp
+			       (re-search-forward encodable-regexp nil t))
+		    (while (re-search-forward tspecials nil 'move)
+		      (unless (and (eq (char-before) ?\\) ;; Already quoted.
+				   (looking-at tspecials))
+			(goto-char (match-beginning 0))
+			(unless (or (eq (char-before) ?\\)
+				    (and rfc2047-encode-encoded-words
+					 (eq (char-after) ??)
+					 (eq (char-before) ?=)))
+			  (insert "\\")))
+		      (forward-char)))))
+	    (error
+	     (goto-char beg))))))))
+
 (defvar rfc2047-encoding-type 'address-mime
   "The type of encoding done by `rfc2047-encode-region'.
 This should be dynamically bound around calls to
@@ -187,8 +221,18 @@
       (while (not (eobp))
 	(save-restriction
 	  (rfc2047-narrow-to-field)
+	  (setq method nil
+		alist rfc2047-header-encoding-alist)
+	  (while (setq elem (pop alist))
+	    (when (or (and (stringp (car elem))
+			   (looking-at (car elem)))
+		      (eq (car elem) t))
+	      (setq alist nil
+		    method (cdr elem))))
 	  (if (not (rfc2047-encodable-p))
-	      (prog1
+	      (prog2
+		  (when (eq method 'address-mime)
+		    (rfc2047-quote-special-characters-in-quoted-strings))
 		  (if (and (eq (mm-body-7-or-8) '8bit)
 			   (mm-multibyte-p)
 			   (mm-coding-system-p
@@ -209,14 +253,6 @@
 		     (point))
 		   (point-max))))
 	    ;; We found something that may perhaps be encoded.
-	    (setq method nil
-		  alist rfc2047-header-encoding-alist)
-	    (while (setq elem (pop alist))
-	      (when (or (and (stringp (car elem))
-			     (looking-at (car elem)))
-			(eq (car elem) t))
-		(setq alist nil
-		      method (cdr elem))))
 	    (re-search-forward "^[^:]+: *" nil t)
 	    (cond
 	     ((eq method 'address-mime)
@@ -347,6 +383,7 @@
 		  (rfc2047-encode start (point))
 		(goto-char end))))
 	;; `address-mime' case -- take care of quoted words, comments.
+	(rfc2047-quote-special-characters-in-quoted-strings encodable-regexp)
 	(with-syntax-table rfc2047-syntax-table
 	  (goto-char (point-min))
 	  (condition-case err		; in case of unbalanced quotes
@@ -821,6 +858,29 @@
 the decoder will fully decode each encoded-word before concatenating
 them.")
 
+(defun rfc2047-strip-backslashes-in-quoted-strings ()
+  "Strip backslashes in quoted strings.  `\\\"' remains."
+  (goto-char (point-min))
+  (let (beg)
+    (with-syntax-table (standard-syntax-table)
+      (while (search-forward "\"" nil t)
+	(unless (eq (char-before) ?\\)
+	  (setq beg (match-end 0))
+	  (goto-char (match-beginning 0))
+	  (condition-case nil
+	      (progn
+		(forward-sexp)
+		(save-restriction
+		  (narrow-to-region beg (1- (point)))
+		  (goto-char beg)
+		  (while (search-forward "\\" nil 'move)
+		    (unless (memq (char-after) '(?\"))
+		      (delete-backward-char 1))
+		    (forward-char)))
+		(forward-char))
+	    (error
+	     (goto-char beg))))))))
+
 (defun rfc2047-charset-to-coding-system (charset)
   "Return coding-system corresponding to MIME CHARSET.
 If your Emacs implementation can't decode CHARSET, return nil."
@@ -898,8 +958,10 @@
 ;; and worthwhile (is it more correct or not?), e.g. something like
 ;; `=?iso-8859-1?q?foo?=@'.
 
-(defun rfc2047-decode-region (start end)
-  "Decode MIME-encoded words in region between START and END."
+(defun rfc2047-decode-region (start end &optional address-mime)
+  "Decode MIME-encoded words in region between START and END.
+If ADDRESS-MIME is non-nil, strip backslashes which precede characters
+other than `\"' and `\\' in quoted strings."
   (interactive "r")
   (let ((case-fold-search t)
 	(eword-regexp (eval-when-compile
@@ -910,6 +972,8 @@
     (save-excursion
       (save-restriction
 	(narrow-to-region start end)
+	(when address-mime
+	  (rfc2047-strip-backslashes-in-quoted-strings))
 	(goto-char (setq b start))
 	;; Look for the encoded-words.
 	(while (setq match (re-search-forward eword-regexp nil t))
@@ -995,8 +1059,16 @@
 		   (not (eq mail-parse-charset 'gnus-decoded)))
 	  (mm-decode-coding-region b (point-max) mail-parse-charset))))))
 
-(defun rfc2047-decode-string (string)
-  "Decode the quoted-printable-encoded STRING and return the results."
+(defun rfc2047-decode-address-region (start end)
+  "Decode MIME-encoded words in region between START and END.
+Backslashes which precede characters other than `\"' and `\\' in quoted
+strings are stripped."
+  (rfc2047-decode-region start end t))
+
+(defun rfc2047-decode-string (string &optional address-mime)
+  "Decode MIME-encoded STRING and return the result.
+If ADDRESS-MIME is non-nil, strip backslashes which precede characters
+other than `\"' and `\\' in quoted strings."
   (let ((m (mm-multibyte-p)))
     (if (string-match "=\\?" string)
 	(with-temp-buffer
@@ -1010,8 +1082,16 @@
 	    (mm-enable-multibyte))
 	  (insert string)
 	  (inline
-	    (rfc2047-decode-region (point-min) (point-max)))
+	    (rfc2047-decode-region (point-min) (point-max) address-mime))
 	  (buffer-string))
+      (when address-mime
+	(setq string
+	      (with-temp-buffer
+		(when (mm-multibyte-string-p string)
+		  (mm-enable-multibyte))
+		(insert string)
+		(rfc2047-strip-backslashes-in-quoted-strings)
+		(buffer-string))))
       ;; Fixme: As above, `m' here is inappropriate.
       (if (and m
 	       mail-parse-charset
@@ -1033,6 +1113,12 @@
 	    (mm-decode-coding-string string mail-parse-charset))
 	(mm-string-as-multibyte string)))))
 
+(defun rfc2047-decode-address-string (string)
+  "Decode MIME-encoded STRING and return the result.
+Backslashes which precede characters other than `\"' and `\\' in quoted
+strings are stripped."
+  (rfc2047-decode-string string t))
+
 (defun rfc2047-pad-base64 (string)
   "Pad STRING to quartets."
   ;; Be more liberal to accept buggy base64 strings. If
--- a/lisp/hl-line.el	Thu Aug 31 07:43:01 2006 +0000
+++ b/lisp/hl-line.el	Tue Sep 05 02:54:22 2006 +0000
@@ -64,15 +64,36 @@
 
 ;;; Code:
 
+(defvar hl-line-overlay nil
+  "Overlay used by Hl-Line mode to highlight the current line.")
+(make-variable-buffer-local 'hl-line-overlay)
+
+(defvar global-hl-line-overlay nil
+  "Overlay used by Global-Hl-Line mode to highlight the current line.")
+
 (defgroup hl-line nil
   "Highlight the current line."
   :version "21.1"
   :group 'editing)
 
-(defcustom hl-line-face 'highlight
-  "Face with which to highlight the current line."
+(defface hl-line
+  '((t :inherit highlight))
+  "Default face for highlighting the current line in Hl-Line mode."
+  :version "22.1"
+  :group 'hl-line)
+
+(defcustom hl-line-face 'hl-line
+  "Face with which to highlight the current line in Hl-Line mode."
   :type 'face
-  :group 'hl-line)
+  :group 'hl-line
+  :set (lambda (symbol value)
+	 (set symbol value)
+	 (dolist (buffer (buffer-list))
+	   (with-current-buffer buffer
+	     (when hl-line-overlay
+	       (overlay-put hl-line-overlay 'face hl-line-face))))
+	 (when global-hl-line-overlay
+	   (overlay-put global-hl-line-overlay 'face hl-line-face))))
 
 (defcustom hl-line-sticky-flag t
   "*Non-nil means highlight the current line in all windows.
@@ -92,13 +113,6 @@
 
 This variable is expected to be made buffer-local by modes.")
 
-(defvar hl-line-overlay nil
-  "Overlay used by Hl-Line mode to highlight the current line.")
-(make-variable-buffer-local 'hl-line-overlay)
-
-(defvar global-hl-line-overlay nil
-  "Overlay used by Global-Hl-Line mode to highlight the current line.")
-
 ;;;###autoload
 (define-minor-mode hl-line-mode
   "Buffer-local minor mode to highlight the line about point.
--- a/lisp/ibuffer.el	Thu Aug 31 07:43:01 2006 +0000
+++ b/lisp/ibuffer.el	Tue Sep 05 02:54:22 2006 +0000
@@ -1972,12 +1972,12 @@
 		(not (eq ibuffer-buf buf))))))
 
 ;; This function is a special case; it's not defined by
-;; `ibuffer-define-sorter'.
+;; `define-ibuffer-sorter'.
 (defun ibuffer-do-sort-by-recency ()
   "Sort the buffers by last view time."
   (interactive)
   (setq ibuffer-sorting-mode 'recency)
-  (ibuffer-redisplay t))
+  (ibuffer-update nil t))
 
 (defun ibuffer-update-format ()
   (when (null ibuffer-current-format)
--- a/lisp/image-mode.el	Thu Aug 31 07:43:01 2006 +0000
+++ b/lisp/image-mode.el	Tue Sep 05 02:54:22 2006 +0000
@@ -60,16 +60,19 @@
   (setq major-mode 'image-mode)
   (use-local-map image-mode-map)
   (add-hook 'change-major-mode-hook 'image-toggle-display-text nil t)
-  (if (not (get-text-property (point-min) 'display))
+  (if (and (display-images-p)
+	   (not (get-text-property (point-min) 'display)))
       (image-toggle-display)
     ;; Set next vars when image is already displayed but local
     ;; variables were cleared by kill-all-local-variables
     (setq cursor-type nil truncate-lines t))
   (run-mode-hooks 'image-mode-hook)
-  (message "%s" (concat (substitute-command-keys
-		    "Type \\[image-toggle-display] to view the image as ")
-		   (if (get-text-property (point-min) 'display)
-		       "text" "an image") ".")))
+  (if (display-images-p)
+      (message "%s" (concat
+		     (substitute-command-keys
+		      "Type \\[image-toggle-display] to view the image as ")
+		     (if (get-text-property (point-min) 'display)
+			 "text" "an image") "."))))
 
 ;;;###autoload
 (define-minor-mode image-minor-mode
--- a/lisp/imenu.el	Thu Aug 31 07:43:01 2006 +0000
+++ b/lisp/imenu.el	Tue Sep 05 02:54:22 2006 +0000
@@ -967,15 +967,15 @@
 (defvar imenu-buffer-menubar nil)
 
 (defvar imenu-menubar-modified-tick 0
-  "The value of (buffer-modified-tick) as of last call to `imenu-update-menubar'.")
+  "The value of (buffer-chars-modified-tick) as of the last call
+to `imenu-update-menubar'.")
 (make-variable-buffer-local 'imenu-menubar-modified-tick)
 
 (defun imenu-update-menubar ()
   (when (and (current-local-map)
 	     (keymapp (lookup-key (current-local-map) [menu-bar index]))
-	     (not (eq (buffer-modified-tick)
-		      imenu-menubar-modified-tick)))
-    (setq imenu-menubar-modified-tick (buffer-modified-tick))
+	     (/= (buffer-chars-modified-tick) imenu-menubar-modified-tick))
+    (setq imenu-menubar-modified-tick (buffer-chars-modified-tick))
     (let ((index-alist (imenu--make-index-alist t)))
       ;; Don't bother updating if the index-alist has not changed
       ;; since the last time we did it.
--- a/lisp/international/quail.el	Thu Aug 31 07:43:01 2006 +0000
+++ b/lisp/international/quail.el	Tue Sep 05 02:54:22 2006 +0000
@@ -1095,8 +1095,8 @@
 
 Optional 6th arg PROPS is a property list annotating TRANS.  See the
 function `quail-define-rules' for the detail."
-  (if (null (stringp key))
-      "Invalid Quail key `%s'" key)
+  (if (not (or (stringp key) (vectorp key)))
+      (error "Invalid Quail key `%s'" key))
   (if (not (or (numberp trans) (stringp trans) (vectorp trans)
 	       (consp trans)
 	       (symbolp trans)
--- a/lisp/mail/feedmail.el	Thu Aug 31 07:43:01 2006 +0000
+++ b/lisp/mail/feedmail.el	Tue Sep 05 02:54:22 2006 +0000
@@ -1340,7 +1340,15 @@
   (set-buffer prepped)
   (apply 'call-process-region
 	 (append (list (point-min) (point-max)
-		       (if (boundp 'sendmail-program) sendmail-program "/usr/lib/sendmail")
+		       (cond ((boundp 'sendmail-program)
+			      sendmail-program)
+			     ((file-exists-p "/usr/sbin/sendmail")
+			      "/usr/sbin/sendmail")
+			     ((file-exists-p "/usr/lib/sendmail")
+			      "/usr/lib/sendmail")
+			     ((file-exists-p "/usr/ucblib/sendmail")
+			      "/usr/ucblib/sendmail")
+			     (t "fakemail"))
 		       nil errors-to nil "-oi" "-t")
 		 ;; provide envelope "from" to sendmail; results will vary
 		 (list "-f" user-mail-address)
--- a/lisp/mail/rmail-spam-filter.el	Thu Aug 31 07:43:01 2006 +0000
+++ b/lisp/mail/rmail-spam-filter.el	Tue Sep 05 02:54:22 2006 +0000
@@ -134,12 +134,11 @@
   :group 'rmail-spam-filter )
 
 (defcustom rsf-min-region-to-spam-list 7
-  "*User may highlight a region in an incomming message and use
-  the menubar to add this region to the spam definitions.  This
-  variable specifies the minimum size of region that may be added
-  to spam list, to avoid accidentally adding a too short region
-  which would result in false positive identification of spam
-  messages."
+  "*Minimum size of region that you can add to the spam list.
+This is a size limit on text that you can specify as
+indicating a message is spam.  The aim is to avoid
+accidentally adding a too short region, which would result
+in false positive identification of spam."
   :type 'integer
   :group 'rmail-spam-filter )
 
@@ -212,8 +211,8 @@
   :group 'rmail-spam-filter)
 
 (defvar rsf-scanning-messages-now nil
-  "Non nil when rmail-spam-filter scans messages,
-for interaction with `rsf-bbdb-auto-delete-spam-entries'")
+  "Non nil when `rmail-spam-filter' scans messages.
+This is for interaction with `rsf-bbdb-auto-delete-spam-entries'.")
 
 ;; the advantage over the automatic filter definitions is the AND conjunction
 ;; of in-one-definition-elements
@@ -596,8 +595,8 @@
 (define-key rmail-mode-map "\C-cSt" 'rsf-add-subject-to-spam-list)
 
 (defun rsf-add-content-type-field ()
-  "Maintain backward compatibility with previous versions of rmail-spam-filter.
-The most recent version of rmai-spam-filter checks the contents
+  "Maintain backward compatibility for `rmail-spam-filter'.
+The most recent version of `rmail-spam-filter' checks the contents
 field of the incoming mail to see if it spam.  The format of
 `rsf-definitions-alist' has therefore changed.  This function
 checks to see if old format is used, and if it is, it converts
--- a/lisp/mail/sendmail.el	Thu Aug 31 07:43:01 2006 +0000
+++ b/lisp/mail/sendmail.el	Tue Sep 05 02:54:22 2006 +0000
@@ -48,6 +48,16 @@
   :group 'sendmail
   :version "22.1")
 
+(defcustom sendmail-program
+  (cond
+    ((file-exists-p "/usr/sbin/sendmail") "/usr/sbin/sendmail")
+    ((file-exists-p "/usr/lib/sendmail") "/usr/lib/sendmail")
+    ((file-exists-p "/usr/ucblib/sendmail") "/usr/ucblib/sendmail")
+    (t "fakemail"))			;In ../etc, to interface to /bin/mail.
+  "Program used to send messages."
+  :group 'mail
+  :type 'file)
+
 ;;;###autoload
 (defcustom mail-from-style 'angles
   "Specifies how \"From:\" fields look.
--- a/lisp/man.el	Thu Aug 31 07:43:01 2006 +0000
+++ b/lisp/man.el	Tue Sep 05 02:54:22 2006 +0000
@@ -388,6 +388,8 @@
 /\e\\[[0-9][0-9]*m/ s///g"
   "Script for berkeley-like sed to nuke backspaces and ANSI codes from manpages.")
 
+(defvar Man-topic-history nil "Topic read history.")
+
 (defvar man-mode-syntax-table
   (let ((table (copy-syntax-table (standard-syntax-table))))
     (modify-syntax-entry ?. "w" table)
@@ -686,7 +688,7 @@
 				(if (string= default-entry "")
 				    ": "
 				  (format " (default %s): " default-entry)))
-			nil nil default-entry)))
+			nil 'Man-topic-history default-entry)))
 	   (if (string= input "")
 	       (error "No man args given")
 	     input))))
--- a/lisp/net/rcirc.el	Thu Aug 31 07:43:01 2006 +0000
+++ b/lisp/net/rcirc.el	Tue Sep 05 02:54:22 2006 +0000
@@ -144,7 +144,9 @@
 
 (defcustom rcirc-show-maximum-output t
   "*If non-nil, scroll buffer to keep the point at the bottom of
-the window.")
+the window."
+  :type 'boolean
+  :group 'rcirc)
 
 (defcustom rcirc-authinfo nil
   "List of authentication passwords.
@@ -200,6 +202,11 @@
   :initialize 'custom-initialize-default
   :group 'rcirc)
 
+(defcustom rcirc-keywords nil
+  "List of keywords to highlight in message text."
+  :type '(repeat string)
+  :group 'rcirc)
+
 (defcustom rcirc-ignore-list ()
   "List of ignored nicks.
 Use /ignore to list them, use /ignore NICK to add or remove a nick."
@@ -212,16 +219,16 @@
 Nicks will be removed from the automatic list on follow-up renamings or
 parts.")
 
-(defcustom rcirc-bright-nick-regexp nil
-  "Regexp matching nicks to be emphasized.
+(defcustom rcirc-bright-nicks nil
+  "List of nicks to be emphasized.
 See `rcirc-bright-nick' face."
-  :type 'regexp
+  :type '(repeat string)
   :group 'rcirc)
 
-(defcustom rcirc-dim-nick-regexp nil
-  "Regexp matching nicks to be deemphasized.
+(defcustom rcirc-dim-nicks nil
+  "List of nicks to be deemphasized.
 See `rcirc-dim-nick' face."
-  :type 'regexp
+  :type '(repeat string)
   :group 'rcirc)
 
 (defcustom rcirc-print-hooks nil
@@ -246,7 +253,7 @@
   :group 'rcirc)
 
 (defcustom rcirc-coding-system-alist nil
-  "Alist to decide a coding system to use for a file I/O operation.
+  "Alist to decide a coding system to use for a channel I/O operation.
 The format is ((PATTERN . VAL) ...).
 PATTERN is either a string or a cons of strings.
 If PATTERN is a string, it is used to match a target.
@@ -528,10 +535,14 @@
                             process cmd sender args text)))
     (message "UNHANDLED: %s" text)))
 
-(defun rcirc-handler-generic (process command sender args text)
+(defvar rcirc-responses-no-activity '("305" "306")
+  "Responses that don't trigger activity in the mode-line indicator.")
+
+(defun rcirc-handler-generic (process response sender args text)
   "Generic server response handler."
-  (rcirc-print process sender command nil
-               (mapconcat 'identity (cdr args) " ") t))
+  (rcirc-print process sender response nil
+               (mapconcat 'identity (cdr args) " ")
+	       (not (member response rcirc-responses-no-activity))))
 
 (defun rcirc-send-string (process string)
   "Send PROCESS a STRING plus a newline."
@@ -748,13 +759,10 @@
 
   ;; if the user changes the major mode or kills the buffer, there is
   ;; cleanup work to do
-  (make-local-variable 'change-major-mode-hook)
-  (add-hook 'change-major-mode-hook 'rcirc-change-major-mode-hook)
-  (make-local-variable 'kill-buffer-hook)
-  (add-hook 'kill-buffer-hook 'rcirc-kill-buffer-hook)
+  (add-hook 'change-major-mode-hook 'rcirc-change-major-mode-hook nil t)
+  (add-hook 'kill-buffer-hook 'rcirc-kill-buffer-hook nil t)
 
-  (make-local-variable 'window-scroll-functions)
-  (add-hook 'window-scroll-functions 'rcirc-scroll-to-bottom)
+  (add-hook 'window-scroll-functions 'rcirc-scroll-to-bottom nil t)
 
   ;; add to buffer list, and update buffer abbrevs
   (when target				; skip server buffer
@@ -941,7 +949,7 @@
 	(if (fboundp fun)
 	    (funcall fun args process rcirc-target)
 	  (rcirc-send-string process
-			     (concat command " " args)))))))
+			     (concat command " :" args)))))))
 
 (defvar rcirc-parent-buffer nil)
 (defvar rcirc-window-configuration nil)
@@ -1073,7 +1081,8 @@
 		   "%")
 		  ((or (eq key ?n) (eq key ?N))
 		   ;; %n/%N -- nick
-		   (let ((nick (concat (if (string= (with-rcirc-process-buffer process
+		   (let ((nick (concat (if (string= (with-rcirc-process-buffer 
+							process
 						      rcirc-server)
 						    sender)
 					   ""
@@ -1084,26 +1093,26 @@
 				       face
 				     (cond ((string= sender (rcirc-nick process))
 					    'rcirc-my-nick)
-					   ((and rcirc-bright-nick-regexp
-						 (string-match rcirc-bright-nick-regexp sender))
+					   ((and rcirc-bright-nicks
+						 (string-match 
+						  (regexp-opt rcirc-bright-nicks)
+						  sender))
 					    'rcirc-bright-nick)
-					   ((and rcirc-dim-nick-regexp
-						 (string-match rcirc-dim-nick-regexp sender))
+					   ((and rcirc-dim-nicks
+						 (string-match
+						  (regexp-opt rcirc-dim-nicks)
+						  sender))
 					    'rcirc-dim-nick)
 					   (t
 					    'rcirc-other-nick))))))
-		  ((eq key ?T)
+		   ((eq key ?T)
 		   ;; %T -- timestamp
 		   (rcirc-facify
 		    (format-time-string rcirc-time-format (current-time))
 		    'rcirc-timestamp))
 		  ((eq key ?m)
 		   ;; %m -- message text
-		   ;; We add the text property `rcirc-text' to identify this
-		   ;; as the body text.
-		   (propertize
-		    (rcirc-mangle-text process (rcirc-facify text face))
-		    'rcirc-text text))
+		   (rcirc-markup-text process sender response (rcirc-facify text face)))
 		  ((eq key ?t)
 		   ;; %t -- target
 		   (rcirc-facify (or rcirc-target "") face))
@@ -1152,12 +1161,10 @@
 	  ((or (rcirc-get-buffer process target)
 	       (rcirc-any-buffer process))))))
 
-(defvar rcirc-activity-type nil)
-(make-variable-buffer-local 'rcirc-activity-type)
+(defvar rcirc-activity-types nil)
+(make-variable-buffer-local 'rcirc-activity-types)
 (defvar rcirc-last-sender nil)
 (make-variable-buffer-local 'rcirc-last-sender)
-(defvar rcirc-gray-toggle nil)
-(make-variable-buffer-local 'rcirc-gray-toggle)
 
 (defun rcirc-scroll-to-bottom (window display-start)
   "Scroll window to show maximum output if `rcirc-show-maximum-output' is
@@ -1261,26 +1268,13 @@
 	  (buffer-enable-undo))
 
 	;; record modeline activity
-	(when activity
-	  (let ((nick-match
-		 (with-syntax-table rcirc-nick-syntax-table		 
-		   (string-match (concat "\\b"
-					 (regexp-quote (rcirc-nick process))
-					 "\\b")
-				 text))))
-	    (when (if rcirc-ignore-buffer-activity-flag
-		      ;; - Always notice when our nick is mentioned
-		      nick-match
-		    ;; - unless our nick is mentioned, don't bother us
-		    ;; - with dim-nicks
-		    (or nick-match
-			(not (and rcirc-dim-nick-regexp sender
-				  (string-match rcirc-dim-nick-regexp sender)))))
-	      (rcirc-record-activity
-	       (current-buffer)
-	       (when (or nick-match (and (not (rcirc-channel-p rcirc-target))
-					 (not rcirc-low-priority-flag)))
-		 'nick)))))
+	(when (and activity
+		   (not rcirc-ignore-buffer-activity-flag)
+		   (not (and rcirc-dim-nicks sender
+			     (string-match (regexp-opt rcirc-dim-nicks) sender))))
+	      (rcirc-record-activity (current-buffer)
+				     (when (not (rcirc-channel-p rcirc-target))
+				       'nick)))
 
 	(sit-for 0)			; displayed text before hook
 	(run-hook-with-args 'rcirc-print-hooks
@@ -1501,8 +1495,7 @@
 		    (let ((t1 (with-current-buffer b1 rcirc-last-post-time))
 			  (t2 (with-current-buffer b2 rcirc-last-post-time)))
 		      (time-less-p t2 t1)))))
-      (if (not rcirc-activity-type)
-	  (setq rcirc-activity-type type))
+      (pushnew type rcirc-activity-types)
       (rcirc-update-activity-string)))
   (run-hook-with-args 'rcirc-activity-hooks buffer))
 
@@ -1510,7 +1503,7 @@
   "Clear the BUFFER activity."
   (setq rcirc-activity (delete buffer rcirc-activity))
   (with-current-buffer buffer
-    (setq rcirc-activity-type nil)))
+    (setq rcirc-activity-types nil)))
 
 (defun rcirc-split-activity (activity)
   "Return a cons cell with ACTIVITY split into (lopri . hipri)."
@@ -1518,7 +1511,7 @@
     (dolist (buf rcirc-activity)
       (with-current-buffer buf
 	(if (and rcirc-low-priority-flag
-		 (not (eq rcirc-activity-type 'nick)))
+		 (not (member 'nick rcirc-activity-types)))
 	    (add-to-list 'lopri buf t)
 	  (add-to-list 'hipri buf t))))
     (cons lopri hipri)))
@@ -1547,11 +1540,15 @@
 
 (defun rcirc-activity-string (buffers)
   (mapconcat (lambda (b)
-	       (let ((s (rcirc-short-buffer-name b)))
+	       (let ((s (substring-no-properties (rcirc-short-buffer-name b))))
 		 (with-current-buffer b
-		   (if (not (eq rcirc-activity-type 'nick))
-		       s
-		     (rcirc-facify s 'rcirc-mode-line-nick)))))
+		   (dolist (type rcirc-activity-types)
+		     (rcirc-add-face 0 (length s)
+				     (case type
+				       ('nick 'rcirc-track-nick)
+				       ('keyword 'rcirc-track-keyword))
+				     s)))
+		 s))
 	     buffers ","))
 
 (defun rcirc-short-buffer-name (buffer)
@@ -1566,15 +1563,18 @@
   (let ((current-now-hidden t))
     (walk-windows (lambda (w)
 		    (let ((buf (window-buffer w)))
-		      (when (eq major-mode 'rcirc-mode)
-			(rcirc-clear-activity buf)
+		      (with-current-buffer buf
+			(when (eq major-mode 'rcirc-mode)
+			  (rcirc-clear-activity buf)))
 			(when (eq buf rcirc-current-buffer)
-			  (setq current-now-hidden nil))))))
+			  (setq current-now-hidden nil)))))
     ;; add overlay arrow if the buffer isn't displayed
-    (when (and rcirc-current-buffer current-now-hidden)
+    (when (and current-now-hidden
+	       rcirc-current-buffer
+	       (buffer-live-p rcirc-current-buffer))
       (with-current-buffer rcirc-current-buffer
-	(when (eq major-mode 'rcirc-mode)
-	  (marker-position overlay-arrow-position)
+	(when (and (eq major-mode 'rcirc-mode)
+		   (marker-position overlay-arrow-position))
 	  (set-marker overlay-arrow-position nil)))))
 
   ;; remove any killed buffers from list
@@ -1792,17 +1792,21 @@
   (rcirc-send-string process (format "PRIVMSG %s :\C-aACTION %s\C-a"
                                      target args)))
 
+(defun rcirc-add-or-remove (set &optional elt)
+  (if (and elt (not (string= "" elt)))
+      (if (member-ignore-case elt set)
+	  (delete elt set)
+	(cons elt set))
+    set))
+
 (defun-rcirc-command ignore (nick)
   "Manage the ignore list.
 Ignore NICK, unignore NICK if already ignored, or list ignored
 nicks when no NICK is given.  When listing ignored nicks, the
 ones added to the list automatically are marked with an asterisk."
   (interactive "sToggle ignoring of nick: ")
-  (when (not (string= "" nick))
-    (if (member-ignore-case nick rcirc-ignore-list)
-	(setq rcirc-ignore-list (delete nick rcirc-ignore-list))
-      (setq rcirc-ignore-list (cons nick rcirc-ignore-list))))
-  (rcirc-print process (rcirc-nick process) "IGNORE" target 
+  (setq rcirc-ignore-list (rcirc-add-or-remove rcirc-ignore-list nick))
+  (rcirc-print process nil "IGNORE" target 
 	       (mapconcat
 		(lambda (nick)
 		  (concat nick
@@ -1810,14 +1814,47 @@
 			      "*" "")))
 		rcirc-ignore-list " ")))
 
+(defun-rcirc-command bright (nick)
+  "Manage the bright nick list."
+  (interactive "sToggle emphasis of nick: ")
+  (setq rcirc-bright-nicks (rcirc-add-or-remove rcirc-bright-nicks nick))
+  (rcirc-print process nil "BRIGHT" target 
+	       (mapconcat 'identity rcirc-bright-nicks " ")))
+
+(defun-rcirc-command dim (nick)
+  "Manage the dim nick list."
+  (interactive "sToggle deemphasis of nick: ")
+  (setq rcirc-dim-nicks (rcirc-add-or-remove rcirc-dim-nicks nick))
+  (rcirc-print process nil "DIM" target 
+	       (mapconcat 'identity rcirc-dim-nicks " ")))
+
+(defun-rcirc-command keyword (keyword)
+  "Manage the keyword list.
+Mark KEYWORD, unmark KEYWORD if already marked, or list marked
+keywords when no KEYWORD is given."
+  (interactive "sToggle highlighting of keyword: ")
+  (setq rcirc-keywords (rcirc-add-or-remove rcirc-keywords keyword))
+  (rcirc-print process nil "KEYWORD" target 
+	       (mapconcat 'identity rcirc-keywords " ")))
+
 
-(defun rcirc-message-leader (sender face)
-  "Return a string with SENDER propertized with FACE."
-  (rcirc-facify (concat "<" sender "> ") face))
+(defun rcirc-add-face (start end name &optional object)
+  "Add face NAME to the face text property of the text from START to END."
+  (when name
+    (let ((pos start)
+	  next prop)
+      (while (< pos end)
+	(setq prop (get-text-property pos 'face object)
+	      next (next-single-property-change pos 'face object end))
+	(unless (member name (get-text-property pos 'face object))
+	  (add-text-properties pos next (list 'face (cons name prop)) object))
+	(setq pos next)))))
 
 (defun rcirc-facify (string face)
   "Return a copy of STRING with FACE property added."
-  (propertize (or string "") 'face face 'rear-nonsticky t))
+  (let ((string (or string "")))
+    (rcirc-add-face 0 (length string) face string)
+    string))
 
 (defvar rcirc-url-regexp
   (rx-to-string
@@ -1835,8 +1872,8 @@
 		  word-boundary))
 	 (optional 
 	  (and "/"
-	       (1+ (char "-a-zA-Z0-9_=!?#$\@~`%&*+|\\/:;.,{}[]"))
-	       (char "-a-zA-Z0-9_=#$\@~`%&*+|\\/:;{}[]")))))
+	       (1+ (char "-a-zA-Z0-9_=!?#$\@~`%&*+|\\/:;.,{}[]()"))
+	       (char "-a-zA-Z0-9_=#$\@~`%&*+|\\/:;{}[]()")))))
   "Regexp matching URLs.  Set to nil to disable URL features in rcirc.")
 
 (defun rcirc-browse-url (&optional arg)
@@ -1863,68 +1900,99 @@
     (with-current-buffer (window-buffer (posn-window position))
       (rcirc-browse-url-at-point (posn-point position)))))
 
-(defun rcirc-map-regexp (function regexp string)
-  "Return a copy of STRING after calling FUNCTION for each REGEXP match.
-FUNCTION takes 3 arguments, MATCH-START, MATCH-END, and STRING."
-  (let ((start 0))
-    (while (string-match regexp string start)
-      (setq start (match-end 0))
-      (funcall function (match-beginning 0) (match-end 0) string)))
-  string)
+
+(defvar rcirc-markup-text-functions
+  '(rcirc-markup-body-text
+    rcirc-markup-attributes
+    rcirc-markup-my-nick
+    rcirc-markup-urls
+    rcirc-markup-keywords
+    rcirc-markup-bright-nicks)
+  "List of functions used to manipulate text before it is printed.
 
-(defun rcirc-mangle-text (process text)
+Each function takes three arguments, PROCESS, SENDER, RESPONSE
+and CHANNEL-BUFFER.  The current buffer is temporary buffer that
+contains the text to manipulate.  Each function works on the text
+in this buffer.")
+
+(defun rcirc-markup-text (process sender response text)
   "Return TEXT with properties added based on various patterns."
-  ;; ^B
-  (setq text
-        (rcirc-map-regexp
-	 (lambda (start end string)
-	   (let ((orig-face (get-text-property start 'face string)))
-	       (add-text-properties
-		start end
-		(list 'face (if (listp orig-face)
-				(append orig-face
-					(list 'bold))
-			      (list orig-face 'bold))
-		      'rear-nonsticky t)
-		string)))
-	   ".*?"
-	   text))
-  ;; TODO: deal with ^_ and ^C colors sequences
-  (while (string-match "\\(.*\\)[]\\(.*\\)" text)
-    (setq text (concat (match-string 1 text)
-                       (match-string 2 text))))
-  ;; my nick
-  (setq text
-        (with-syntax-table rcirc-nick-syntax-table
-          (rcirc-map-regexp (lambda (start end string)
-                              (add-text-properties
-                               start end
-                               (list 'face 'rcirc-nick-in-message
-                                     'rear-nonsticky t)
-                               string))
-                            (concat "\\b"
-                                    (regexp-quote (rcirc-nick process))
-                                    "\\b")
-                            text)))
-  ;; urls
-  (setq text
-        (rcirc-map-regexp
-	 (lambda (start end string)
-	   (let ((orig-face (get-text-property start 'face string)))
-	     (add-text-properties start end
-				  (list 'face (if (listp orig-face)
-						  (append orig-face
-							  (list 'bold))
-						(list orig-face 'bold))
-					'rear-nonsticky t
-					'mouse-face 'highlight
-					'keymap rcirc-browse-url-map)
-				  string))
-	     (push (substring-no-properties string start end) rcirc-urls))
-	   rcirc-url-regexp
-	   text))
-  text)
+  (let ((channel-buffer (current-buffer)))
+    (with-temp-buffer
+      (insert text)
+      (goto-char (point-min))
+      (dolist (fn rcirc-markup-text-functions)
+	(save-excursion
+	  (funcall fn process sender response channel-buffer)))
+      (buffer-substring (point-min) (point-max)))))
+
+(defun rcirc-markup-body-text (process sender response channel-buffer)
+  ;; We add the text property `rcirc-text' to identify this as the
+  ;; body text.
+  (add-text-properties (point-min) (point-max)
+		       (list 'rcirc-text (buffer-substring-no-properties
+					  (point-min) (point-max)))))
+
+(defun rcirc-markup-attributes (process sender response channel-buffer)
+  (while (re-search-forward "\\([\C-b\C-_\C-v]\\).*?\\(\\1\\|\C-o\\)" nil t)
+    (rcirc-add-face (match-beginning 0) (match-end 0)
+		    (case (char-after (match-beginning 1))
+		      (?\C-b 'bold)
+		      (?\C-v 'italic)
+		      (?\C-_ 'underline)))
+    ;; keep the ^O since it could terminate other attributes
+    (when (not (eq ?\C-o (char-before (match-end 2))))
+      (delete-region (match-beginning 2) (match-end 2)))
+    (delete-region (match-beginning 1) (match-end 1))
+    (goto-char (1+ (match-beginning 1))))
+  ;; remove the ^O characters now
+  (while (re-search-forward "\C-o+" nil t)
+    (delete-region (match-beginning 0) (match-end 0))))
 
+(defun rcirc-markup-my-nick (process sender response channel-buffer)
+  (with-syntax-table rcirc-nick-syntax-table
+    (while (re-search-forward (concat "\\b" 
+				      (regexp-quote (rcirc-nick process))
+				      "\\b")
+			      nil t)
+      (rcirc-add-face (match-beginning 0) (match-end 0) 
+		      'rcirc-nick-in-message)
+      (when (string= response "PRIVMSG")
+	(rcirc-add-face (point-min) (point-max) 'rcirc-nick-in-message-full-line)
+	(rcirc-record-activity channel-buffer 'nick)))))
+
+(defun rcirc-markup-urls (process sender response channel-buffer)
+  (while (re-search-forward rcirc-url-regexp nil t)
+    (let ((start (match-beginning 0))
+	  (end (match-end 0)))
+      (rcirc-add-face start end 'rcirc-url)
+      (add-text-properties start end (list 'mouse-face 'highlight
+					   'keymap rcirc-browse-url-map))
+      ;; record the url
+      (let ((url (buffer-substring-no-properties start end)))
+	(with-current-buffer channel-buffer
+	  (push url rcirc-urls))))))
+
+(defun rcirc-markup-keywords (process sender response channel-buffer)
+  (let* ((target (with-current-buffer channel-buffer (or rcirc-target "")))
+	 (keywords (delq nil (mapcar (lambda (keyword)
+				      (when (not (string-match keyword target))
+					keyword))
+				    rcirc-keywords))))
+    (when keywords
+      (while (re-search-forward (regexp-opt keywords 'words) nil t)
+	(rcirc-add-face (match-beginning 0) (match-end 0) 'rcirc-keyword)
+	(when (and (string= response "PRIVMSG")
+		   (not (string= sender (rcirc-nick process))))
+	  (rcirc-record-activity channel-buffer 'keyword))))))
+
+(defun rcirc-markup-bright-nicks (process sender response channel-buffer)
+  (when (and rcirc-bright-nicks
+	     (string= response "NAMES"))
+    (with-syntax-table rcirc-nick-syntax-table
+      (while (re-search-forward (regexp-opt rcirc-bright-nicks 'words) nil t)
+	(rcirc-add-face (match-beginning 0) (match-end 0)
+			'rcirc-bright-nick)))))
 
 ;;; handlers
 ;; these are called with the server PROCESS, the SENDER, which is a
@@ -2275,12 +2343,12 @@
     (((class color) (min-colors 16) (background dark)) (:foreground "Aquamarine"))
     (((class color) (min-colors 8)) (:foreground "magenta"))
     (t (:weight bold :underline t)))
-  "Face used for nicks matched by `rcirc-bright-nick-regexp'."
+  "Face used for nicks matched by `rcirc-bright-nicks'."
   :group 'rcirc-faces)
 
 (defface rcirc-dim-nick
   '((t :inherit default))
-  "Face used for nicks matched by `rcirc-dim-nick-regexp'."
+  "Face used for nicks in `rcirc-dim-nicks'."
   :group 'rcirc-faces)
 
 (defface rcirc-server			; font-lock-comment-face
@@ -2329,9 +2397,14 @@
     (((class color) (min-colors 16) (background dark)) (:foreground "Cyan"))
     (((class color) (min-colors 8)) (:foreground "cyan" :weight bold))
     (t (:weight bold)))
-  "The face used to highlight instances of nick within messages."
+  "The face used to highlight instances of your nick within messages."
   :group 'rcirc-faces)
 
+(defface rcirc-nick-in-message-full-line
+  '((t (:bold t)))
+  "The face used emphasize the entire message when your nick is mentioned."
+  :group 'rcirc-faces)  
+
 (defface rcirc-prompt			; comint-highlight-prompt
   '((((min-colors 88) (background dark)) (:foreground "cyan1"))
     (((background dark)) (:foreground "cyan"))
@@ -2339,9 +2412,24 @@
   "The face used to highlight prompts."
   :group 'rcirc-faces)
 
-(defface rcirc-mode-line-nick
+(defface rcirc-track-nick
+  '((t (:inverse-video t)))
+  "The face used in the mode-line when your nick is mentioned."
+  :group 'rcirc-faces)
+
+(defface rcirc-track-keyword
+  '((t (:bold t )))
+  "The face used in the mode-line when keywords are mentioned."
+  :group 'rcirc-faces)
+
+(defface rcirc-url
   '((t (:bold t)))
-  "The face used indicate activity directed at you."
+  "The face used to highlight urls."
+  :group 'rcirc-faces)
+
+(defface rcirc-keyword
+  '((t (:inherit highlight)))
+  "The face used to highlight keywords."
   :group 'rcirc-faces)
 
 
--- a/lisp/net/tramp.el	Thu Aug 31 07:43:01 2006 +0000
+++ b/lisp/net/tramp.el	Tue Sep 05 02:54:22 2006 +0000
@@ -3888,37 +3888,50 @@
 (defun tramp-handle-make-auto-save-file-name ()
   "Like `make-auto-save-file-name' for tramp files.
 Returns a file name in `tramp-auto-save-directory' for autosaving this file."
-  (when tramp-auto-save-directory
-    (unless (file-exists-p tramp-auto-save-directory)
-      (make-directory tramp-auto-save-directory t)))
-  ;; jka-compr doesn't like auto-saving, so by appending "~" to the
-  ;; file name we make sure that jka-compr isn't used for the
-  ;; auto-save file.
-  (let ((buffer-file-name
-	 (if tramp-auto-save-directory
-	     (expand-file-name
-	      (tramp-subst-strs-in-string
-	       '(("_" . "|")
-		 ("/" . "_a")
-		 (":" . "_b")
-		 ("|" . "__")
-		 ("[" . "_l")
-		 ("]" . "_r"))
-	       (buffer-file-name))
-	      tramp-auto-save-directory)
-	   (buffer-file-name))))
-    ;; Run plain `make-auto-save-file-name'.  There might be an advice when
-    ;; it is not a magic file name operation (since Emacs 22).
-    ;; We must deactivate it temporarily.
-    (if (not (ad-is-active 'make-auto-save-file-name))
-	(tramp-run-real-handler
-	 'make-auto-save-file-name nil)
-      ;; else
-      (ad-deactivate 'make-auto-save-file-name)
-      (prog1
-       (tramp-run-real-handler
-	'make-auto-save-file-name nil)
-       (ad-activate 'make-auto-save-file-name)))))
+  (let ((tramp-auto-save-directory tramp-auto-save-directory))
+    ;; File name must be unique.  This is ensured with Emacs 22 (see
+    ;; UNIQUIFY element of `auto-save-file-name-transforms'); but for
+    ;; all other cases we must do it ourselves.
+    (when (boundp 'auto-save-file-name-transforms)
+      (mapcar
+       '(lambda (x)
+	  (when (and (string-match (car x) buffer-file-name)
+		     (not (car (cddr x))))
+	    (setq tramp-auto-save-directory
+		  (or tramp-auto-save-directory temporary-file-directory))))
+       (symbol-value 'auto-save-file-name-transforms)))
+    ;; Create directory.
+    (when tramp-auto-save-directory
+      (unless (file-exists-p tramp-auto-save-directory)
+	(make-directory tramp-auto-save-directory t)))
+    ;; jka-compr doesn't like auto-saving, so by appending "~" to the
+    ;; file name we make sure that jka-compr isn't used for the
+    ;; auto-save file.
+    (let ((buffer-file-name
+	   (if tramp-auto-save-directory
+	       (expand-file-name
+		(tramp-subst-strs-in-string
+		 '(("_" . "|")
+		   ("/" . "_a")
+		   (":" . "_b")
+		   ("|" . "__")
+		   ("[" . "_l")
+		   ("]" . "_r"))
+		 (buffer-file-name))
+		tramp-auto-save-directory)
+	     (buffer-file-name))))
+      ;; Run plain `make-auto-save-file-name'.  There might be an advice when
+      ;; it is not a magic file name operation (since Emacs 22).
+      ;; We must deactivate it temporarily.
+      (if (not (ad-is-active 'make-auto-save-file-name))
+	  (tramp-run-real-handler
+	   'make-auto-save-file-name nil)
+	;; else
+	(ad-deactivate 'make-auto-save-file-name)
+	(prog1
+	    (tramp-run-real-handler
+	     'make-auto-save-file-name nil)
+	  (ad-activate 'make-auto-save-file-name))))))
 
 
 ;; CCC grok APPEND, LOCKNAME, CONFIRM
@@ -4333,7 +4346,12 @@
   "Add tramp file name handlers to `file-name-handler-alist'."
   (add-to-list 'file-name-handler-alist
 	       (cons tramp-file-name-regexp 'tramp-file-name-handler))
-  (when (or partial-completion-mode (featurep 'ido))
+  ;; `partial-completion-mode' is unknown in XEmacs.  So we should
+  ;; load it unconditionally there.  In the GNU Emacs case, method/
+  ;; user/host name completion shall be bound to `partial-completion-mode'.
+  (when (or (not (boundp 'partial-completion-mode))
+	    (symbol-value 'partial-completion-mode)
+	    (featurep 'ido))
     (add-to-list 'file-name-handler-alist
 		 (cons tramp-completion-file-name-regexp
 		       'tramp-completion-file-name-handler))
@@ -6749,8 +6767,8 @@
   ;; Set file's gid change bit.  Possible only when id-format is 'integer.
   (when (numberp (nth 3 attr))
     (setcar (nthcdr 9 attr)
-	    (not (= (nth 3 attr)
-		    (tramp-get-remote-gid multi-method method user host)))))
+	    (not (eql (nth 3 attr)
+		      (tramp-get-remote-gid multi-method method user host)))))
   ;; Set virtual device number.
   (setcar (nthcdr 11 attr)
           (tramp-get-device multi-method method user host))
@@ -7200,10 +7218,7 @@
 
 (defun tramp-time-diff (t1 t2)
   "Return the difference between the two times, in seconds.
-T1 and T2 are time values (as returned by `current-time' for example).
-
-NOTE: This function will fail if the time difference is too large to
-fit in an integer."
+T1 and T2 are time values (as returned by `current-time' for example)."
   ;; Pacify byte-compiler with `symbol-function'.
   (cond ((and (fboundp 'subtract-time)
 	      (fboundp 'float-time))
@@ -7214,10 +7229,9 @@
          (funcall (symbol-function 'time-to-seconds)
 		  (funcall (symbol-function 'subtract-time) t1 t2)))
         ((fboundp 'itimer-time-difference)
-         (floor (funcall
-		 (symbol-function 'itimer-time-difference)
-		 (if (< (length t1) 3) (append t1 '(0)) t1)
-		 (if (< (length t2) 3) (append t2 '(0)) t2))))
+	 (funcall (symbol-function 'itimer-time-difference)
+		  (if (< (length t1) 3) (append t1 '(0)) t1)
+		  (if (< (length t2) 3) (append t2 '(0)) t2)))
         (t
          ;; snarfed from Emacs 21 time-date.el; combining
 	 ;; time-to-seconds and subtract-time
--- a/lisp/net/trampver.el	Thu Aug 31 07:43:01 2006 +0000
+++ b/lisp/net/trampver.el	Tue Sep 05 02:54:22 2006 +0000
@@ -30,7 +30,7 @@
 ;; are auto-frobbed from configure.ac, so you should edit that file and run
 ;; "autoconf && ./configure" to change them.
 
-(defconst tramp-version "2.0.53"
+(defconst tramp-version "2.0.54"
   "This version of Tramp.")
 
 (defconst tramp-bug-report-address "tramp-devel@gnu.org"
--- a/lisp/paths.el	Thu Aug 31 07:43:01 2006 +0000
+++ b/lisp/paths.el	Tue Sep 05 02:54:22 2006 +0000
@@ -159,16 +159,6 @@
   "Name of directory used by system mailer for delivering new mail.
 Its name should end with a slash.")
 
-(defcustom sendmail-program
-  (cond
-    ((file-exists-p "/usr/sbin/sendmail") "/usr/sbin/sendmail")
-    ((file-exists-p "/usr/lib/sendmail") "/usr/lib/sendmail")
-    ((file-exists-p "/usr/ucblib/sendmail") "/usr/ucblib/sendmail")
-    (t "fakemail"))			;In ../etc, to interface to /bin/mail.
-  "Program used to send messages."
-  :group 'mail
-  :type 'file)
-
 (defcustom remote-shell-program
   (cond
    ;; Some systems use rsh for the remote shell; others use that name for the
--- a/lisp/pgg-gpg.el	Thu Aug 31 07:43:01 2006 +0000
+++ b/lisp/pgg-gpg.el	Tue Sep 05 02:54:22 2006 +0000
@@ -74,23 +74,27 @@
 	 (errors-buffer pgg-errors-buffer)
 	 (orig-mode (default-file-modes))
 	 (process-connection-type nil)
-	 exit-status)
+	 process status exit-status)
     (with-current-buffer (get-buffer-create errors-buffer)
       (buffer-disable-undo)
       (erase-buffer))
     (unwind-protect
 	(progn
 	  (set-default-file-modes 448)
-	  (let ((coding-system-for-write 'binary)
-		(input (buffer-substring-no-properties start end))
-		(default-enable-multibyte-characters nil))
-	    (with-temp-buffer
-	      (when passphrase
-		(insert passphrase "\n"))
-	      (insert input)
-	      (setq exit-status
-		    (apply #'call-process-region (point-min) (point-max) program
-			   nil errors-buffer nil args))))
+	  (let ((coding-system-for-write 'binary))
+	    (setq process
+		  (apply #'start-process "*GnuPG*" errors-buffer
+			 program args)))
+	  (set-process-sentinel process #'ignore)
+	  (when passphrase
+	    (process-send-string process (concat passphrase "\n")))
+	  (process-send-region process start end)
+	  (process-send-eof process)
+	  (while (eq 'run (process-status process))
+	    (accept-process-output process 5))
+	  (setq status (process-status process)
+		exit-status (process-exit-status process))
+	  (delete-process process)
 	  (with-current-buffer (get-buffer-create output-buffer)
 	    (buffer-disable-undo)
 	    (erase-buffer)
@@ -100,9 +104,12 @@
 						'binary)))
 		  (insert-file-contents output-file-name)))
 	    (set-buffer errors-buffer)
-	    (if (not (equal exit-status 0))
-		(insert (format "\n%s exited abnormally: '%s'\n"
-				program exit-status)))))
+	    (if (memq status '(stop signal))
+		(error "%s exited abnormally: '%s'" program exit-status))
+	    (if (= 127 exit-status)
+		(error "%s could not be found" program))))
+      (if (and process (eq 'run (process-status process)))
+	  (interrupt-process process))
       (if (file-exists-p output-file-name)
 	  (delete-file output-file-name))
       (set-default-file-modes orig-mode))))
--- a/lisp/progmodes/python.el	Thu Aug 31 07:43:01 2006 +0000
+++ b/lisp/progmodes/python.el	Tue Sep 05 02:54:22 2006 +0000
@@ -1330,30 +1330,30 @@
   ;; (not a name) in Python buffers from which `run-python' &c is
   ;; invoked.  Would support multiple processes better.
   (when (or new (not (comint-check-proc python-buffer)))
-    (save-current-buffer
-      (let* ((cmdlist (append (python-args-to-list cmd) '("-i")))
-	     (path (getenv "PYTHONPATH"))
-	     (process-environment	; to import emacs.py
-	      (cons (concat "PYTHONPATH=" data-directory
-			    (if path (concat ":" path)))
-		    process-environment)))
-	(set-buffer (apply 'make-comint-in-buffer "Python"
-			   (generate-new-buffer "*Python*")
-			   (car cmdlist) nil (cdr cmdlist)))
-	(setq-default python-buffer (current-buffer))
-	(setq python-buffer (current-buffer)))
+    (with-current-buffer
+        (let* ((cmdlist (append (python-args-to-list cmd) '("-i")))
+               (path (getenv "PYTHONPATH"))
+               (process-environment	; to import emacs.py
+                (cons (concat "PYTHONPATH=" data-directory
+                              (if path (concat ":" path)))
+                      process-environment)))
+          (apply 'make-comint-in-buffer "Python"
+                 (if new (generate-new-buffer "*Python*") "*Python*")
+                 (car cmdlist) nil (cdr cmdlist)))
+      (setq-default python-buffer (current-buffer))
+      (setq python-buffer (current-buffer))
       (accept-process-output (get-buffer-process python-buffer) 5)
-      (inferior-python-mode)))
+      (inferior-python-mode)
+      ;; Load function definitions we need.
+      ;; Before the preoutput function was used, this was done via -c in
+      ;; cmdlist, but that loses the banner and doesn't run the startup
+      ;; file.  The code might be inline here, but there's enough that it
+      ;; seems worth putting in a separate file, and it's probably cleaner
+      ;; to put it in a module.
+      ;; Ensure we're at a prompt before doing anything else.
+      (python-send-receive "import emacs; print '_emacs_out ()'")))
   (if (derived-mode-p 'python-mode)
       (setq python-buffer (default-value 'python-buffer))) ; buffer-local
-  ;; Load function definitions we need.
-  ;; Before the preoutput function was used, this was done via -c in
-  ;; cmdlist, but that loses the banner and doesn't run the startup
-  ;; file.  The code might be inline here, but there's enough that it
-  ;; seems worth putting in a separate file, and it's probably cleaner
-  ;; to put it in a module.
-  ;; Ensure we're at a prompt before doing anything else.
-  (python-send-receive "import emacs; print '_emacs_out ()'")
   ;; Without this, help output goes into the inferior python buffer if
   ;; the process isn't already running.
   (sit-for 1 t)        ;Should we use accept-process-output instead?  --Stef
@@ -1369,15 +1369,20 @@
 (defun python-send-command (command)
   "Like `python-send-string' but resets `compilation-shell-minor-mode'.
 COMMAND should be a single statement."
-  (assert (not (string-match "\n" command)))
-  (let ((end (marker-position (process-mark (python-proc)))))
+  ;; (assert (not (string-match "\n" command)))
+  ;; (let ((end (marker-position (process-mark (python-proc)))))
     (with-current-buffer python-buffer (goto-char (point-max)))
     (compilation-forget-errors)
-    ;; Must wait until this has completed before re-setting variables below.
-    (python-send-receive (concat command "; print '_emacs_out ()'"))
+    (python-send-string command)
     (with-current-buffer python-buffer
-      (set-marker compilation-parsing-end end)
-      (setq compilation-last-buffer (current-buffer)))))
+      (setq compilation-last-buffer (current-buffer)))
+    ;; No idea what this is for but it breaks the call to
+    ;; compilation-fake-loc in python-send-region.  -- Stef
+    ;; Must wait until this has completed before re-setting variables below.
+    ;; (python-send-receive "print '_emacs_out ()'")
+    ;; (with-current-buffer python-buffer
+    ;;   (set-marker compilation-parsing-end end))
+    ) ;;)
 
 (defun python-send-region (start end)
   "Send the region to the inferior Python process."
@@ -1594,24 +1599,26 @@
 instance.  Assumes an inferior Python is running."
   (let ((symbol (with-syntax-table python-dotty-syntax-table
 		  (current-word))))
-    ;; First try the symbol we're on.
-    (or (and symbol
-	     (python-send-receive (format "emacs.eargs(%S, %s)"
-					  symbol python-imports)))
-	;; Try moving to symbol before enclosing parens.
-	(let ((s (syntax-ppss)))
-	  (unless (zerop (car s))
-	    (when (eq ?\( (char-after (nth 1 s)))
-	      (save-excursion
-		(goto-char (nth 1 s))
-		(skip-syntax-backward "-")
-		(let ((point (point)))
-		  (skip-chars-backward "a-zA-Z._")
-		  (if (< (point) point)
-		      (python-send-receive
-		       (format "emacs.eargs(%S, %s)"
-			       (buffer-substring-no-properties (point) point)
-			       python-imports)))))))))))
+    ;; This is run from timers, so inhibit-quit tends to be set.
+    (with-local-quit
+      ;; First try the symbol we're on.
+      (or (and symbol
+               (python-send-receive (format "emacs.eargs(%S, %s)"
+                                            symbol python-imports)))
+          ;; Try moving to symbol before enclosing parens.
+          (let ((s (syntax-ppss)))
+            (unless (zerop (car s))
+              (when (eq ?\( (char-after (nth 1 s)))
+                (save-excursion
+                  (goto-char (nth 1 s))
+                  (skip-syntax-backward "-")
+                  (let ((point (point)))
+                    (skip-chars-backward "a-zA-Z._")
+                    (if (< (point) point)
+                        (python-send-receive
+                         (format "emacs.eargs(%S, %s)"
+                                 (buffer-substring-no-properties (point) point)
+                                 python-imports))))))))))))
 
 ;;;; Info-look functionality.
 
--- a/lisp/shell.el	Thu Aug 31 07:43:01 2006 +0000
+++ b/lisp/shell.el	Tue Sep 05 02:54:22 2006 +0000
@@ -483,7 +483,9 @@
 The argument STRING is ignored."
   (let ((pmark (process-mark (get-buffer-process (current-buffer)))))
     (save-excursion
-      (goto-char (or comint-last-output-start (point-min)))
+      (goto-char (or (and (markerp comint-last-output-start)
+			  (marker-position comint-last-output-start))
+		     (point-min)))
       (while (re-search-forward "[\C-a\C-b]" pmark t)
         (replace-match "")))))
 
--- a/lisp/simple.el	Thu Aug 31 07:43:01 2006 +0000
+++ b/lisp/simple.el	Tue Sep 05 02:54:22 2006 +0000
@@ -2554,6 +2554,8 @@
   ;; Pass point first, then mark, because the order matters
   ;; when calling kill-append.
   (interactive (list (point) (mark)))
+  (unless (and beg end)
+    (error "The mark is not set now, so there is no region"))
   (condition-case nil
       (let ((string (filter-buffer-substring beg end t)))
 	(when string			;STRING is nil if BEG = END
@@ -4982,6 +4984,12 @@
 
 ;; Variables and faces used in `completion-setup-function'.
 
+(defcustom completion-show-help t
+  "Non-nil means show help message in *Completions* buffer."
+  :type 'boolean
+  :version "22.1"
+  :group 'completion)
+
 (defface completions-first-difference
   '((t (:inherit bold)))
   "Face put on the first uncommon character in completions in *Completions* buffer."
@@ -5068,14 +5076,15 @@
 	      (if (get-char-property element-common-end 'mouse-face)
 		  (put-text-property element-common-end (1+ element-common-end)
 				     'font-lock-face 'completions-first-difference))))))
-      ;; Insert help string.
-      (goto-char (point-min))
-      (if (display-mouse-p)
-	  (insert (substitute-command-keys
-		   "Click \\[mouse-choose-completion] on a completion to select it.\n")))
-      (insert (substitute-command-keys
-	       "In this buffer, type \\[choose-completion] to \
-select the completion near point.\n\n")))))
+      ;; Maybe insert help string.
+      (when completion-show-help
+	(goto-char (point-min))
+	(if (display-mouse-p)
+	    (insert (substitute-command-keys
+		     "Click \\[mouse-choose-completion] on a completion to select it.\n")))
+	(insert (substitute-command-keys
+		 "In this buffer, type \\[choose-completion] to \
+select the completion near point.\n\n"))))))
 
 (add-hook 'completion-setup-hook 'completion-setup-function)
 
--- a/lisp/startup.el	Thu Aug 31 07:43:01 2006 +0000
+++ b/lisp/startup.el	Tue Sep 05 02:54:22 2006 +0000
@@ -1395,6 +1395,7 @@
 	    (window-dedicated-p (selected-window)))
 	(pop-to-buffer (current-buffer))
       (switch-to-buffer "GNU Emacs"))
+    (setq buffer-read-only nil)
     (erase-buffer)
     (if pure-space-overflow
 	(insert "\
@@ -1406,6 +1407,9 @@
 	(apply #'fancy-splash-insert text))
       (fancy-splash-tail)
       (set-buffer-modified-p nil)
+      (setq buffer-read-only t)
+      (if (and view-read-only (not view-mode))
+	  (view-mode-enter nil 'kill-buffer))
       (goto-char (point-min)))))
 
 (defun fancy-splash-frame ()
@@ -1442,6 +1446,7 @@
   (let ((prev-buffer (current-buffer)))
     (unwind-protect
 	(with-current-buffer (get-buffer-create "GNU Emacs")
+	  (setq buffer-read-only nil)
 	  (erase-buffer)
 	  (set (make-local-variable 'tab-width) 8)
 	  (if hide-on-input
@@ -1581,6 +1586,9 @@
 
           ;; Display the input that we set up in the buffer.
           (set-buffer-modified-p nil)
+	  (setq buffer-read-only t)
+	  (if (and view-read-only (not view-mode))
+	      (view-mode-enter nil 'kill-buffer))
           (goto-char (point-min))
 	  (if (or (window-minibuffer-p)
 		  (window-dedicated-p (selected-window)))
--- a/lisp/term/mac-win.el	Thu Aug 31 07:43:01 2006 +0000
+++ b/lisp/term/mac-win.el	Tue Sep 05 02:54:22 2006 +0000
@@ -1337,14 +1337,19 @@
 		     (find-coding-systems-string string)))
       (setq coding-system
 	    (coding-system-change-eol-conversion coding-system 'mac))
-      (when (and (eq system-type 'darwin)
-		 (eq coding-system 'japanese-shift-jis-mac))
-	(setq encoding mac-text-encoding-mac-japanese-basic-variant)
-	(setq string (subst-char-in-string ?\\ ?\x80 string))
-	(subst-char-in-string ?\Â¥ ?\x5c string t))
-      (setq data (mac-code-convert-string
-		  (encode-coding-string string coding-system)
-		  (or encoding coding-system) nil)))
+      (let ((str string))
+	(when (and (eq system-type 'darwin)
+		   (eq coding-system 'japanese-shift-jis-mac))
+	  (setq encoding mac-text-encoding-mac-japanese-basic-variant)
+	  (setq str (subst-char-in-string ?\\ ?\x80 str))
+	  (subst-char-in-string ?\Â¥ ?\x5c str t)
+	  ;; ASCII-only?
+	  (if (string-match "\\`[\x00-\x7f]*\\'" str)
+	      (setq str nil)))
+	(and str
+	     (setq data (mac-code-convert-string
+			 (encode-coding-string str coding-system)
+			 (or encoding coding-system) nil)))))
     (or data (encode-coding-string string (if (eq (byteorder) ?B)
 					      'utf-16be-mac
 					    'utf-16le-mac)))))
--- a/lisp/term/xterm.el	Thu Aug 31 07:43:01 2006 +0000
+++ b/lisp/term/xterm.el	Tue Sep 05 02:54:22 2006 +0000
@@ -231,17 +231,20 @@
       ;; These keys are available in xterm starting from version 216
       ;; if the modifyOtherKeys resource is set to 1.
 
+      (define-key map "\e[27;5;9~"   [C-tab])
+      (define-key map "\e[27;5;13~"  [C-return])
       (define-key map "\e[27;5;39~"  [?\C-\'])
+      (define-key map "\e[27;5;44~"  [?\C-,])
       (define-key map "\e[27;5;45~"  [?\C--])
-      
+      (define-key map "\e[27;5;46~"  [?\C-.])
+      (define-key map "\e[27;5;47~"  [?\C-/])
       (define-key map "\e[27;5;48~"  [?\C-0])
       (define-key map "\e[27;5;49~"  [?\C-1])
       ;; Not all C-DIGIT keys have a distinct binding.
       (define-key map "\e[27;5;57~"  [?\C-9])
-
-      (define-key map "\e[27;5;59~"  [?\C-\;])
+      (define-key map "\e[27;5;59~"  [(C-\;)])
       (define-key map "\e[27;5;61~"  [?\C-=])
-
+      (define-key map "\e[27;5;92~"  [?\C-\\])
 
       (define-key map "\e[27;6;33~"  [?\C-!])
       (define-key map "\e[27;6;34~"  [?\C-\"])
@@ -253,26 +256,53 @@
       (define-key map "\e[27;6;41~"  [?\C-)])
       (define-key map "\e[27;6;42~"  [?\C-*])
       (define-key map "\e[27;6;43~"  [?\C-+])
-
       (define-key map "\e[27;6;58~"  [?\C-:])
       (define-key map "\e[27;6;60~"  [?\C-<])
       (define-key map "\e[27;6;62~"  [?\C->])
       (define-key map "\e[27;6;63~"  [(C-\?)])
 
-      (define-key map "\e[27;5;9~"  [C-tab])
-      (define-key map "\e[27;5;13~" [C-return])
-      (define-key map "\e[27;5;44~" [?\C-,])
-      (define-key map "\e[27;5;46~" [?\C-.])
-      (define-key map "\e[27;5;47~" [?\C-/])
-      (define-key map "\e[27;5;92~" [?\C-\\])
+      (define-key map "\e[27;13;9~"  [(C-M-tab)])
+      (define-key map "\e[27;13;13~" [(C-M-return)])
 
-      (define-key map "\e[27;2;9~"  [S-tab])
-      (define-key map "\e[27;2;13~" [S-return])
+      (define-key map "\e[27;13;39~" [?\C-\M-\'])
+      (define-key map "\e[27;13;44~" [?\C-\M-,])
+      (define-key map "\e[27;13;45~" [?\C-\M--])
+      (define-key map "\e[27;13;46~" [?\C-\M-.])
+      (define-key map "\e[27;13;47~" [?\C-\M-/])
+      (define-key map "\e[27;13;48~" [?\C-\M-0])
+      (define-key map "\e[27;13;49~" [?\C-\M-1])
+      (define-key map "\e[27;13;50~" [?\C-\M-2])
+      (define-key map "\e[27;13;51~" [?\C-\M-3])
+      (define-key map "\e[27;13;52~" [?\C-\M-4])
+      (define-key map "\e[27;13;53~" [?\C-\M-5])
+      (define-key map "\e[27;13;54~" [?\C-\M-6])
+      (define-key map "\e[27;13;55~" [?\C-\M-7])
+      (define-key map "\e[27;13;56~" [?\C-\M-8])
+      (define-key map "\e[27;13;57~" [?\C-\M-9])
+      (define-key map "\e[27;13;59~" [?\C-\M-\;])
+      (define-key map "\e[27;13;61~" [?\C-\M-=])
+      (define-key map "\e[27;13;92~" [?\C-\M-\\])
 
-      (define-key map "\e[27;6;9~"  [(C-S-tab)])
+      (define-key map "\e[27;14;33~"  [?\C-\M-!])
+      (define-key map "\e[27;14;34~"  [?\C-\M-\"])
+      (define-key map "\e[27;14;35~"  [?\C-\M-#])
+      (define-key map "\e[27;14;36~"  [?\C-\M-$])
+      (define-key map "\e[27;14;37~"  [?\C-\M-%])
+      (define-key map "\e[27;14;38~"  [(C-M-&)])
+      (define-key map "\e[27;14;40~"  [?\C-\M-(])
+      (define-key map "\e[27;14;41~"  [?\C-\M-)])
+      (define-key map "\e[27;14;42~"  [?\C-\M-*])
+      (define-key map "\e[27;14;43~"  [?\C-\M-+])
+      (define-key map "\e[27;14;58~"  [?\C-\M-:])
+      (define-key map "\e[27;14;60~"  [?\C-\M-<])
+      (define-key map "\e[27;14;62~"  [?\C-\M->])
+      (define-key map "\e[27;14;63~"  [(C-M-\?)])
 
-      (define-key map "\e[27;13;46~" [?\C-\M-.])
+      (define-key map "\e[27;2;9~"   [S-tab])
+      (define-key map "\e[27;2;13~"  [S-return])
 
+      (define-key map "\e[27;6;9~"   [(C-S-tab)])
+      (define-key map "\e[27;6;13~"  [(C-S-return)])
 
       ;; Other versions of xterm might emit these.
       (define-key map "\e[A" [up])
--- a/lisp/url/ChangeLog	Thu Aug 31 07:43:01 2006 +0000
+++ b/lisp/url/ChangeLog	Tue Sep 05 02:54:22 2006 +0000
@@ -1,3 +1,18 @@
+2006-08-31  Diane Murray  <disumu@x3y2z1.net>
+
+	* url-parse.el (url-recreate-url-attributes): New function, code
+	simply moved from `url-recreate-url'.
+	(url-recreate-url): Use it.
+	Put the `url-target' at the end of the URL after the attributes.
+
+	* url-http.el (url-http-create-request):
+	Use `url-recreate-url-attributes' when setting real-fname.
+
+2006-08-29  Diane Murray  <disumu@x3y2z1.net>
+
+	* url-cookie.el (url-cookie-write-file): Really don't use versioned
+	backups.
+
 2006-08-25  Stefan Monnier  <monnier@iro.umontreal.ca>
 
 	* url-handlers.el (url-file-local-copy): Tell url-copy-file that the
--- a/lisp/url/url-cookie.el	Thu Aug 31 07:43:01 2006 +0000
+++ b/lisp/url/url-cookie.el	Tue Sep 05 02:54:22 2006 +0000
@@ -168,11 +168,11 @@
       (insert ")\n(setq url-cookie-secure-storage\n '")
       (pp url-cookie-secure-storage (current-buffer))
       (insert ")\n")
-      (insert ";; Local Variables:\n"
+      (insert "\n;; Local Variables:\n"
               ";; version-control: never\n"
               ";; no-byte-compile: t\n"
               ";; End:\n")
-      (set (make-local-variable 'version-control) t)
+      (set (make-local-variable 'version-control) 'never)
       (write-file fname)
       (setq url-cookies-changed-since-last-save nil)
       (kill-buffer (current-buffer))))))
--- a/lisp/url/url-http.el	Thu Aug 31 07:43:01 2006 +0000
+++ b/lisp/url/url-http.el	Tue Sep 05 02:54:22 2006 +0000
@@ -160,7 +160,8 @@
 		       (let ((url-basic-auth-storage
 			      'url-http-proxy-basic-auth-storage))
 			 (url-get-authentication url nil 'any nil))))
-	 (real-fname (url-filename (or proxy-obj url)))
+	 (real-fname (concat (url-filename (or proxy-obj url))
+			     (url-recreate-url-attributes (or proxy-obj url))))
 	 (host (url-host (or proxy-obj url)))
 	 (auth (if (cdr-safe (assoc "Authorization" url-request-extra-headers))
 		   nil
--- a/lisp/url/url-parse.el	Thu Aug 31 07:43:01 2006 +0000
+++ b/lisp/url/url-parse.el	Tue Sep 05 02:54:22 2006 +0000
@@ -100,17 +100,20 @@
 		   (not (equal (url-port urlobj)
 			       (url-scheme-get-property (url-type urlobj) 'default-port))))
 	      (format ":%d" (url-port urlobj)))
-	  (or (url-filename urlobj) "/")
+	  (or (url-filename urlobj) "/")          
+	  (url-recreate-url-attributes urlobj)
 	  (if (url-target urlobj)
-	      (concat "#" (url-target urlobj)))
-	  (if (url-attributes urlobj)
-	      (concat ";"
-		      (mapconcat
-		       (function
-			(lambda (x)
-			  (if (cdr x)
-			      (concat (car x) "=" (cdr x))
-			    (car x)))) (url-attributes urlobj) ";")))))
+	      (concat "#" (url-target urlobj)))))
+
+(defun url-recreate-url-attributes (urlobj)
+  "Recreate the attributes of an URL string from the parsed URLOBJ."
+  (when (url-attributes urlobj)
+    (concat ";"
+	    (mapconcat (lambda (x)
+                         (if (cdr x)
+                             (concat (car x) "=" (cdr x))
+                           (car x)))
+                       (url-attributes urlobj) ";"))))
 
 ;;;###autoload
 (defun url-generic-parse-url (url)
--- a/lisp/woman.el	Thu Aug 31 07:43:01 2006 +0000
+++ b/lisp/woman.el	Tue Sep 05 02:54:22 2006 +0000
@@ -1196,7 +1196,7 @@
 	  (kill-buffer standard-output)
 	  ))))
 
-(defvar woman-topic-history nil "Topic read history.")
+(defvaralias 'woman-topic-history 'Man-topic-history)
 (defvar woman-file-history nil "File-name read history.")
 
 (defun woman-file-name (topic &optional re-cache)
@@ -1750,7 +1750,18 @@
   (define-key woman-mode-map [M-mouse-2] 'woman-follow-word)
 
   ;; We don't need to call `man' when we are in `woman-mode'.
-  (define-key woman-mode-map [remap man] 'woman))
+  (define-key woman-mode-map [remap man] 'woman)
+  (define-key woman-mode-map [remap man-follow] 'woman-follow))
+
+(defun woman-follow (topic)
+  "Get a Un*x manual page of the item under point and put it in a buffer."
+  (interactive (list (Man-default-man-entry)))
+  (if (or (not topic)
+	  (string= topic ""))
+      (error "No item under point")
+    (woman (if (string-match Man-reference-regexp topic)
+	       (substring topic 0 (match-end 1))
+	     topic))))
 
 (defun woman-follow-word (event)
   "Run WoMan with word under mouse as topic.
--- a/lispref/ChangeLog	Thu Aug 31 07:43:01 2006 +0000
+++ b/lispref/ChangeLog	Tue Sep 05 02:54:22 2006 +0000
@@ -1,3 +1,44 @@
+2006-09-04  Richard Stallman  <rms@gnu.org>
+
+	* processes.texi (Accepting Output): Explain SECONDS=0 for
+	accept-process-output.
+
+	* os.texi (Idle Timers): Explain why timer functions should not
+	loop until (input-pending-p).
+
+2006-09-02  Eli Zaretskii  <eliz@gnu.org>
+
+	* makefile.w32-in (usermanualdir): New variable.
+	(elisp.dvi): Use it.
+
+2006-09-01  Eli Zaretskii  <eliz@gnu.org>
+
+	* buffers.texi (Buffer Modification): Fix last change.
+
+2006-09-01  Chong Yidong  <cyd@stupidchicken.com>
+
+	* buffers.texi (Buffer Modification): Document
+	buffer-chars-modified-tick.
+
+2006-08-31  Richard Stallman  <rms@gnu.org>
+
+	* modes.texi (Syntactic Font Lock): Mention specific faces once again.
+
+2006-08-31  Richard Bielawski  <RBielawski@moneygram.com>  (tiny change)
+
+	* modes.texi (Syntactic Font Lock):
+	Mention font-lock-syntactic-face-function
+	instead of specific faces.
+
+2006-08-29  Chong Yidong  <cyd@stupidchicken.com>
+
+	* display.texi (Images): Add xrref to display-images-p.
+
+2006-08-28  Kenichi Handa  <handa@m17n.org>
+
+	* nonascii.texi (Lisp and Coding Systems): Fix description of
+	detect-coding-region.
+
 2006-08-27  Michael Olson  <mwolson@gnu.org>
 
 	* processes.texi (Transaction Queues): Remove stray quote
--- a/lispref/buffers.texi	Thu Aug 31 07:43:01 2006 +0000
+++ b/lispref/buffers.texi	Tue Sep 05 02:54:22 2006 +0000
@@ -573,7 +573,6 @@
 echo area; use @code{set-buffer-modified-p} (above) instead.
 @end deffn
 
-@c Emacs 19 feature
 @defun buffer-modified-tick &optional buffer
 This function returns @var{buffer}'s modification-count.  This is a
 counter that increments every time the buffer is modified.  If
@@ -581,6 +580,17 @@
 The counter can wrap around occasionally.
 @end defun
 
+@defun buffer-chars-modified-tick &optional buffer
+This function returns @var{buffer}'s character-change modification-count.
+Changes to text properties leave this counter unchanged; however, each
+time text is inserted or removed from the buffer, the counter is reset
+to the value that would be returned @code{buffer-modified-tick}.
+By comparing the values returned by two @code{buffer-chars-modified-tick}
+calls, you can tell whether a character change occurred in that buffer
+in between the calls.  If @var{buffer} is @code{nil} (or omitted), the
+current buffer is used.
+@end defun
+
 @node Modification Time
 @comment  node-name,  next,  previous,  up
 @section Comparison of Modification Time
--- a/lispref/display.texi	Thu Aug 31 07:43:01 2006 +0000
+++ b/lispref/display.texi	Tue Sep 05 02:54:22 2006 +0000
@@ -3564,6 +3564,13 @@
 descriptor, then use it as a display specifier in the @code{display}
 property of text that is displayed (@pxref{Display Property}).
 
+  Emacs is usually able to display images when it is run on a
+graphical terminal.  Images cannot be displayed in a text terminal, on
+certain graphical terminals that lack the support for this, or if
+Emacs is compiled without image support.  You can use the function
+@code{display-images-p} to determine if images can in principle be
+displayed (@pxref{Display Feature Testing}).
+
   Emacs can display a number of different image formats; some of them
 are supported only if particular support libraries are installed on
 your machine.  In some environments, Emacs can load image
--- a/lispref/makefile.w32-in	Thu Aug 31 07:43:01 2006 +0000
+++ b/lispref/makefile.w32-in	Tue Sep 05 02:54:22 2006 +0000
@@ -23,6 +23,7 @@
 srcdir = .
 
 infodir = $(srcdir)/../info
+usermanualdir = $(srcdir)/../man
 
 # Redefine `TEX' if `tex' does not invoke plain TeX.  For example:
 # TEX=platex
@@ -108,7 +109,7 @@
 	$(MAKEINFO) -I. -I$(srcdir) -o $(infodir)/elisp $(srcdir)/elisp.texi
 
 elisp.dvi: $(srcs)
-	$(texinputdir) $(TEX) $(srcdir)/elisp.texi
+	$(texinputdir) $(TEX) -I $(usermanualdir) $(srcdir)/elisp.texi
 
 clean:
 	- $(DEL) *.toc *.aux *.log *.cp *.cps *.fn *.fns *.tp *.tps \
--- a/lispref/modes.texi	Thu Aug 31 07:43:01 2006 +0000
+++ b/lispref/modes.texi	Tue Sep 05 02:54:22 2006 +0000
@@ -2897,9 +2897,10 @@
 Syntactic fontification uses the syntax table to find comments and
 string constants (@pxref{Syntax Tables}).  It highlights them using
 @code{font-lock-comment-face} and @code{font-lock-string-face}
-(@pxref{Faces for Font Lock}).  There are several variables that
-affect syntactic fontification; you should set them by means of
-@code{font-lock-defaults} (@pxref{Font Lock Basics}).
+(@pxref{Faces for Font Lock}), or whatever
+@code{font-lock-syntactic-face-function} chooses.  There are several
+variables that affect syntactic fontification; you should set them by
+means of @code{font-lock-defaults} (@pxref{Font Lock Basics}).
 
 @defvar font-lock-keywords-only
 Non-@code{nil} means Font Lock should not do syntactic fontification;
--- a/lispref/nonascii.texi	Thu Aug 31 07:43:01 2006 +0000
+++ b/lispref/nonascii.texi	Tue Sep 05 02:54:22 2006 +0000
@@ -882,8 +882,9 @@
 return value is just one coding system, the one that is highest in
 priority.
 
-If the region contains only @acronym{ASCII} characters, the value
-is @code{undecided} or @code{(undecided)}, or a variant specifying
+If the region contains only @acronym{ASCII} characters except for such
+ISO-2022 control characters ISO-2022 as @code{ESC}, the value is
+@code{undecided} or @code{(undecided)}, or a variant specifying
 end-of-line conversion, if that can be deduced from the text.
 @end defun
 
--- a/lispref/os.texi	Thu Aug 31 07:43:01 2006 +0000
+++ b/lispref/os.texi	Tue Sep 05 02:54:22 2006 +0000
@@ -1578,6 +1578,25 @@
 @end smallexample
 @end defun
 
+  Some idle timer functions in user Lisp packages have a loop that
+does a certain amount of processing each time around, and exits when
+@code{(input-pending-p)} is non-@code{nil}.  That approach seems very
+natural but has two problems:
+
+@itemize
+@item
+It blocks out all process output (since Emacs accepts process output
+only while waiting).
+
+@item
+It blocks out any idle timers that ought to run during that time.
+@end itemize
+
+@noindent
+To avoid these problems, don't use that technique.  Instead, write
+such idle timers to reschedule themselves after a brief pause, using
+the method in the @code{timer-function} example above.
+
 @node Terminal Input
 @section Terminal Input
 @cindex terminal input
--- a/lispref/processes.texi	Thu Aug 31 07:43:01 2006 +0000
+++ b/lispref/processes.texi	Tue Sep 05 02:54:22 2006 +0000
@@ -1308,6 +1308,8 @@
 
 The argument @var{seconds} need not be an integer.  If it is a floating
 point number, this function waits for a fractional number of seconds.
+If @var{seconds} is 0, the function accepts whatever output is
+pending but does not wait.
 
 @c Emacs 22.1 feature
 If @var{process} is a process, and the argument @var{just-this-one} is
--- a/man/ChangeLog	Thu Aug 31 07:43:01 2006 +0000
+++ b/man/ChangeLog	Tue Sep 05 02:54:22 2006 +0000
@@ -1,3 +1,31 @@
+2006-09-01  Eli Zaretskii  <eliz@gnu.org>
+
+	* rcirc.texi (Internet Relay Chat, Useful IRC commands): Don't use
+	@indicateurl.
+
+	* cc-mode.texi (Subword Movement): Don't use @headitem.
+	(Custom Braces, Clean-ups): Don't use @tie.
+
+2006-08-29  Michael Albinus  <michael.albinus@gmx.de>
+
+	Sync with Tramp 2.0.54.
+
+	* tramp.texi (Bug Reports): The Tramp mailing list is moderated
+	now.  Suggested by Adrian Phillips <a.phillips@met.no>.
+
+2006-08-28  Richard Stallman  <rms@gnu.org>
+
+	* windows.texi (Split Window): Update xref.
+
+	* basic.texi (Continuation Lines): Update xref.
+
+	* indent.texi (Tab Stops): Update xref.
+
+	* emacs.texi (Top): Update subnode menu.
+
+	* display.texi (Line Truncation, Displaying Boundaries): New nodes,
+	split out of Display Custom.
+
 2006-08-25  Kim F. Storm  <storm@cua.dk>
 
 	* display.texi (Display Custom): Add variables overline-margin
--- a/man/basic.texi	Thu Aug 31 07:43:01 2006 +0000
+++ b/man/basic.texi	Tue Sep 05 02:54:22 2006 +0000
@@ -480,7 +480,7 @@
 straight arrow in the window's right fringe indicates a truncated
 line.
 
-  @xref{Display Custom}, for more about line truncation,
+  @xref{Line Truncation}, for more about line truncation,
 and other variables that control how text is displayed.
 
 @node Position Info
--- a/man/cc-mode.texi	Thu Aug 31 07:43:01 2006 +0000
+++ b/man/cc-mode.texi	Tue Sep 05 02:54:22 2006 +0000
@@ -1624,8 +1624,16 @@
 @dfn{subword}.  Here are some examples:
 
 @multitable {@samp{NSGraphicsContext}} {@samp{NS}, @samp{Graphics}, and @samp{Context}}
-@headitem Nomenclature
+@c This could be converted to @headitem when we require Texinfo 4.7
+@iftex
+@item @b{Nomenclature}
+  @tab @b{Subwords}
+@end iftex
+@ifnottex
+@item Nomenclature
   @tab Subwords
+@item ---------------------------------------------------------
+@end ifnottex
 @item @samp{GtkWindow}
   @tab @samp{Gtk} and @samp{Window}
 @item @samp{EmacsFrameClass}
@@ -1657,7 +1665,14 @@
 @findex c-downcase-subword
 @findex downcase-subword (c-)
 @multitable @columnfractions .20 .40 .40
-@headitem Key         @tab Word oriented command     @tab Subword oriented command
+@c This could be converted to @headitem when we require Texinfo 4.7
+@iftex
+@item     @b{Key}     @tab @b{Word oriented command} @tab @b{Subword oriented command}
+@end iftex
+@ifnottex
+@item     Key         @tab Word oriented command     @tab Subword oriented command
+@item ----------------------------------------------------------------------------
+@end ifnottex
 @item     @kbd{M-f}   @tab @code{forward-word}       @tab @code{c-forward-subword}
 @item     @kbd{M-b}   @tab @code{backward-word}      @tab @code{c-backward-subword}
 @item     @kbd{M-@@}  @tab @code{mark-word}          @tab @code{c-mark-subword}
@@ -3231,9 +3246,9 @@
 the proper functioning of @ccmode{}.
 
 This variable is also bound in three other circumstances:
-(i)@tie{}when calling a c-hanging-semi&comma-criteria function
-(@pxref{Hanging Semicolons and Commas}; (ii)@tie{}when calling a
-line-up function (@pxref{Custom Line-Up}; (iii)@tie{}when calling a
+(i)@w{ }when calling a c-hanging-semi&comma-criteria function
+(@pxref{Hanging Semicolons and Commas}; (ii)@w{ }when calling a
+line-up function (@pxref{Custom Line-Up}; (iii)@w{ }when calling a
 c-special-indent-hook function (@pxref{Other Indentation}).
 @end defvar
 
@@ -3630,8 +3645,8 @@
 @item space-before-funcall
 Insert a space between the function name and the opening parenthesis
 of a function call.  This produces function calls in the style
-mandated by the GNU coding standards, e.g. @samp{signal@tie{}(SIGINT,
-SIG_IGN)} and @samp{abort@tie{}()}.  Clean up occurs when the opening
+mandated by the GNU coding standards, e.g. @samp{signal@w{ }(SIGINT,
+SIG_IGN)} and @samp{abort@w{ }()}.  Clean up occurs when the opening
 parenthesis is typed.  This clean-up should never be active in AWK
 Mode, since such a space is syntactically invalid for user defined
 functions.
--- a/man/display.texi	Thu Aug 31 07:43:01 2006 +0000
+++ b/man/display.texi	Tue Sep 05 02:54:22 2006 +0000
@@ -23,11 +23,14 @@
 * Font Lock::              Minor mode for syntactic highlighting using faces.
 * Highlight Interactively:: Tell Emacs what text to highlight.
 * Fringes::                Enabling or disabling window fringes.
+* Displaying Boundaries::  Displaying top and bottom of the buffer.
 * Useless Whitespace::     Showing possibly-spurious trailing whitespace.
 * Selective Display::      Hiding lines with lots of indentation.
 * Optional Mode Line::     Optional mode line display features.
 * Text Display::           How text characters are normally displayed.
 * Cursor Display::         Features for displaying the cursor.
+* Line Truncation::        Truncating lines to fit the screen width instead
+                             of continuing them to multiple screen lines.
 * Display Custom::         Information on variables for customizing display.
 @end menu
 
@@ -202,8 +205,8 @@
   @dfn{Horizontal scrolling} means shifting all the lines sideways
 within a window---so that some of the text near the left margin is not
 displayed at all.  When the text in a window is scrolled horizontally,
-text lines are truncated rather than continued (@pxref{Display
-Custom}).  Whenever a window shows truncated lines, Emacs
+text lines are truncated rather than continued (@pxref{Line
+Truncation}).  Whenever a window shows truncated lines, Emacs
 automatically updates its horizontal scrolling whenever point moves
 off the left or right edge of the screen.  You can also use these
 commands to do explicit horizontal scrolling.
@@ -751,6 +754,40 @@
 @kbd{M-x fringe-mode}.  To enable and disable the fringes
 for the selected frame, use @kbd{M-x set-fringe-style}.
 
+@node Displaying Boundaries
+@section Displaying Boundaries
+
+@vindex indicate-buffer-boundaries
+  On a graphical display, Emacs can indicate the buffer boundaries in
+the fringes.  It indicates the first line and the last line with
+angle images in the fringes.  This can be combined with up and down
+arrow images which say whether it is possible to scroll the window up
+and down.
+
+  The buffer-local variable @code{indicate-buffer-boundaries} controls
+how the buffer boundaries and window scrolling is indicated in the
+fringes.  If the value is @code{left} or @code{right}, both angle and
+arrow bitmaps are displayed in the left or right fringe, respectively.
+
+  If value is an alist, each element @code{(@var{indicator} .
+@var{position})} specifies the position of one of the indicators.
+The @var{indicator} must be one of @code{top}, @code{bottom},
+@code{up}, @code{down}, or @code{t} which specifies the default
+position for the indicators not present in the alist.
+The @var{position} is one of @code{left}, @code{right}, or @code{nil}
+which specifies not to show this indicator.
+
+  For example, @code{((top . left) (t . right))} places the top angle
+bitmap in left fringe, the bottom angle bitmap in right fringe, and
+both arrow bitmaps in right fringe.  To show just the angle bitmaps in
+the left fringe, but no arrow bitmaps, use @code{((top .  left)
+(bottom . left))}.
+
+@vindex default-indicate-buffer-boundaries
+  The value of the variable @code{default-indicate-buffer-boundaries}
+is the default value for @code{indicate-buffer-boundaries} in buffers
+that do not override it.
+
 @node Useless Whitespace
 @section Useless Whitespace
 
@@ -1083,30 +1120,8 @@
 hl-line-mode} to enable or disable it in the current buffer.  @kbd{M-x
 global-hl-line-mode} enables or disables the same mode globally.
 
-@node Display Custom
-@section Customization of Display
-
-  This section describes variables (@pxref{Variables}) that you can
-change to customize how Emacs displays.  Beginning users can skip
-it.
-@c the reason for that pxref is because an xref early in the
-@c ``echo area'' section leads here.
-
-@vindex inverse-video
-  If the variable @code{inverse-video} is non-@code{nil}, Emacs attempts
-to invert all the lines of the display from what they normally are.
-
-@vindex visible-bell
-  If the variable @code{visible-bell} is non-@code{nil}, Emacs attempts
-to make the whole screen blink when it would normally make an audible bell
-sound.  This variable has no effect if your terminal does not have a way
-to make the screen blink.
-
-@vindex echo-keystrokes
-  The variable @code{echo-keystrokes} controls the echoing of multi-character
-keys; its value is the number of seconds of pause required to cause echoing
-to start, or zero, meaning don't echo at all.  The value takes effect when
-there is someting to echo.  @xref{Echo Area}.
+@node Line Truncation
+@section Truncation of Lines
 
 @cindex truncation
 @cindex line truncation, and fringes
@@ -1145,36 +1160,30 @@
 newline overflows into the right fringe, and the cursor appears in the
 fringe when positioned on that newline.
 
-@vindex indicate-buffer-boundaries
-  On a graphical display, Emacs can indicate the buffer boundaries in
-the fringes.  It indicates the first line and the last line with
-angle images in the fringes.  This can be combined with up and down
-arrow images which say whether it is possible to scroll the window up
-and down.
+@node Display Custom
+@section Customization of Display
 
-  The buffer-local variable @code{indicate-buffer-boundaries} controls
-how the buffer boundaries and window scrolling is indicated in the
-fringes.  If the value is @code{left} or @code{right}, both angle and
-arrow bitmaps are displayed in the left or right fringe, respectively.
+  This section describes variables (@pxref{Variables}) that you can
+change to customize how Emacs displays.  Beginning users can skip
+it.
+@c the reason for that pxref is because an xref early in the
+@c ``echo area'' section leads here.
 
-  If value is an alist, each element @code{(@var{indicator} .
-@var{position})} specifies the position of one of the indicators.
-The @var{indicator} must be one of @code{top}, @code{bottom},
-@code{up}, @code{down}, or @code{t} which specifies the default
-position for the indicators not present in the alist.
-The @var{position} is one of @code{left}, @code{right}, or @code{nil}
-which specifies not to show this indicator.
+@vindex inverse-video
+  If the variable @code{inverse-video} is non-@code{nil}, Emacs attempts
+to invert all the lines of the display from what they normally are.
 
-  For example, @code{((top . left) (t . right))} places the top angle
-bitmap in left fringe, the bottom angle bitmap in right fringe, and
-both arrow bitmaps in right fringe.  To show just the angle bitmaps in
-the left fringe, but no arrow bitmaps, use @code{((top .  left)
-(bottom . left))}.
+@vindex visible-bell
+  If the variable @code{visible-bell} is non-@code{nil}, Emacs attempts
+to make the whole screen blink when it would normally make an audible bell
+sound.  This variable has no effect if your terminal does not have a way
+to make the screen blink.
 
-@vindex default-indicate-buffer-boundaries
-  The value of the variable @code{default-indicate-buffer-boundaries}
-is the default value for @code{indicate-buffer-boundaries} in buffers
-that do not override it.
+@vindex echo-keystrokes
+  The variable @code{echo-keystrokes} controls the echoing of multi-character
+keys; its value is the number of seconds of pause required to cause echoing
+to start, or zero, meaning don't echo at all.  The value takes effect when
+there is someting to echo.  @xref{Echo Area}.
 
 @vindex baud-rate
   The variable @anchor{baud-rate}@code{baud-rate} holds the output
@@ -1197,6 +1206,17 @@
 amount of time Emacs must remain busy before the busy indicator is
 displayed, by setting the variable @code{hourglass-delay}.
 
+@vindex overline-margin
+  On graphical display, this variables specifies the vertical position
+of an overline above the text, including the height of the overline
+itself (1 pixel).  The default value is 2 pixels.
+
+@vindex x-underline-at-descent-line
+  On graphical display, Emacs normally draws an underline at the
+baseline level of the font.  If @code{x-underline-at-descent-line} is
+non-@code{nil}, Emacs draws the underline at the same height as the
+font's descent line.
+
 @findex tty-suppress-bold-inverse-default-colors
   On some text-only terminals, bold face and inverse video together
 result in text that is hard to read.  Call the function
@@ -1215,17 +1235,6 @@
 assume, when resumed, that the screen page it is using still contains
 what Emacs last wrote there.
 
-@vindex overline-margin
-  On graphical display, this variables specifies the number of pixes
-the overline is shown above the text.  The value includes the height of
-the overline itself (1 pixel).  The default value is 2 pixels.
-
-@vindex x-underline-at-descent-line
-  On graphical display, the underline is normally drawn at the
-baseline level of the font.  If @code{x-underline-at-descent-line} is
-non-@code{nil}, the underline is drawn at the same position as the
-font's decent line.
-
 @ignore
    arch-tag: 2219f910-2ff0-4521-b059-1bd231a536c4
 @end ignore
--- a/man/emacs.texi	Thu Aug 31 07:43:01 2006 +0000
+++ b/man/emacs.texi	Tue Sep 05 02:54:22 2006 +0000
@@ -329,11 +329,14 @@
 * Font Lock::              Minor mode for syntactic highlighting using faces.
 * Highlight Interactively:: Tell Emacs what text to highlight.
 * Fringes::                Enabling or disabling window fringes.
+* Displaying Boundaries::  Displaying top and bottom of the buffer.
 * Useless Whitespace::     Showing possibly-spurious trailing whitespace.
 * Selective Display::      Hiding lines with lots of indentation.
 * Optional Mode Line::     Optional mode line display features.
 * Text Display::           How text characters are normally displayed.
 * Cursor Display::         Features for displaying the cursor.
+* Line Truncation::        Truncating lines to fit the screen width instead
+                             of continuing them to multiple screen lines.
 * Display Custom::         Information on variables for customizing display.
 
 Searching and Replacement
--- a/man/indent.texi	Thu Aug 31 07:43:01 2006 +0000
+++ b/man/indent.texi	Tue Sep 05 02:54:22 2006 +0000
@@ -212,7 +212,7 @@
 are present just to help you see where the colons are and know what to do.
 
   Note that the tab stops that control @code{tab-to-tab-stop} have nothing
-to do with displaying tab characters in the buffer.  @xref{Display Custom},
+to do with displaying tab characters in the buffer.  @xref{Text Display},
 for more information on that.
 
 @node Just Spaces,, Tab Stops, Indentation
--- a/man/rcirc.texi	Thu Aug 31 07:43:01 2006 +0000
+++ b/man/rcirc.texi	Tue Sep 05 02:54:22 2006 +0000
@@ -118,7 +118,7 @@
 
 @cindex redirection to random servers
 When you connect to the Freenode network
-(@indicateurl{http://freenode.net/}), you point your IRC client at the
+(@code{http://freenode.net/}), you point your IRC client at the
 server @code{irc.freenode.net}.  That server will redirect your client
 to a random server on the network, such as @code{zelazny.freenode.net}.
 
@@ -424,8 +424,8 @@
 @cindex help about irc
 Typical IRC servers implement many more commands.  You can read more
 about the fantastic world of IRC online at
-@indicateurl{http://www.irchelp.org/}, the Internet Relay Chat (IRC)
-help archive.
+@uref{http://www.irchelp.org/, the Internet Relay Chat (IRC) help
+archive}.
 
 @node Configuration, , Useful IRC commands, Reference
 @section Configuration
--- a/man/tramp.texi	Thu Aug 31 07:43:01 2006 +0000
+++ b/man/tramp.texi	Tue Sep 05 02:54:22 2006 +0000
@@ -1931,12 +1931,16 @@
 @chapter Reporting Bugs and Problems
 @cindex bug reports
 
-Bugs and problems with @value{tramp} are actively worked on by the development
-team. Feature requests and suggestions are also more than welcome.
-
-The @value{tramp} mailing list is a great place to get information on working
-with @value{tramp}, solving problems and general discussion and advice on topics
-relating to the package.
+Bugs and problems with @value{tramp} are actively worked on by the
+development team. Feature requests and suggestions are also more than
+welcome.
+
+The @value{tramp} mailing list is a great place to get information on
+working with @value{tramp}, solving problems and general discussion
+and advice on topics relating to the package.  It is moderated so
+non-subscribers can post but messages will be delayed, possibly up to
+48 hours (or longer in case of holidays), until the moderator approves
+your message.
 
 The mailing list is at @email{tramp-devel@@gnu.org}.  Messages sent to
 this address go to all the subscribers. This is @emph{not} the address
--- a/man/trampver.texi	Thu Aug 31 07:43:01 2006 +0000
+++ b/man/trampver.texi	Tue Sep 05 02:54:22 2006 +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.53
+@set trampver 2.0.54
 
 @c Other flags from configuration
 @set prefix /usr/local
--- a/man/windows.texi	Thu Aug 31 07:43:01 2006 +0000
+++ b/man/windows.texi	Tue Sep 05 02:54:22 2006 +0000
@@ -116,7 +116,7 @@
 if the variable @code{truncate-partial-width-windows} is
 non-@code{nil}, that forces truncation in all windows less than the
 full width of the screen, independent of the buffer being displayed
-and its value for @code{truncate-lines}.  @xref{Display Custom}.
+and its value for @code{truncate-lines}.  @xref{Line Truncation}.
 
   Horizontal scrolling is often used in side-by-side windows.
 @xref{Horizontal Scrolling}.
--- a/src/ChangeLog	Thu Aug 31 07:43:01 2006 +0000
+++ b/src/ChangeLog	Tue Sep 05 02:54:22 2006 +0000
@@ -1,3 +1,99 @@
+2006-09-05  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+	* macterm.c (install_window_handler, mac_handle_window_event)
+	[USE_CARBON_EVENTS]: Handle kEventWindowClose.
+	[USE_MAC_TSM] (mac_handle_text_input_event): Set modifiers for
+	ASCII keystroke event.
+
+2006-09-04  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>
+
+	* gtkutil.c (xg_get_file_with_chooser): Don't mention specific keys in
+	the file chooser message.  Only call gtk_file_chooser_set_current_name
+	when action is SAVE.
+
+2006-09-04  Andreas Schwab  <schwab@suse.de>
+
+	* Makefile.in: Double all single and back quotes in C-style
+	comments to help fontifier.
+
+2006-09-03  Jason Rumney  <jasonr@gnu.org>
+
+	* w32.c (shutdown_handler): New function to exit cleanly on shutdown.
+	(globals_of_w32): Register it as a signal handler.
+
+2006-09-02  Juri Linkov  <juri@jurta.org>
+
+	* marker.c (Fmarker_position): Doc fix.
+
+2006-09-03  Eli Zaretskii  <eliz@gnu.org>
+
+	* window.c (syms_of_window) <split-height-threshold>:
+	<window-min-height, window-min-width>: Doc fix.
+
+2006-09-02  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>
+
+	* gtkutil.c (xg_get_file_with_chooser): Change file chooser message
+	for writing files.  Call gtk_file_chooser_set_current_name to keep
+	default filename.
+
+	* minibuf.c (Finternal_complete_buffer): Move after DEFUN:s it calls
+
+2006-09-02  Jindrich Makovicka  <makovick@gmail.com>  (tiny change)
+
+	* fns.c (concat) [__GNUC__]: Declare with
+	`__attribute__((noinline))'.
+
+	* eval.c (apply1, call2) [__GNUC__]: Declare with
+	`__attribute__((noinline))'.
+
+2006-09-02  Stuart D. Herring  <herring@lanl.gov>
+
+	* minibuf.c (Finternal_complete_buffer): New function.
+	(syms_of_minibuf): Defsubr it.
+	(Fread_buffer): Use it, instead of Vbuffer_alist.
+
+2006-09-01  Martin Rudalics  <rudalics@gmx.at>
+
+	* buffer.h (struct buffer_text): New field chars_modiff.
+	(CHARS_MODIFF, BUF_CHARS_MODIFF): New macros.
+	* buffer.c (Fbuffer_chars_modified_tick): New function returning
+	value of BUF_CHARS_MODIFF.
+	(syms_of_buffer): Defsubr it.
+	(Fget_buffer_create): Initialize BUF_CHARS_MODIFF.
+	* insdel.c (modify_region): New argument preserve_chars_modiff.
+	Set CHARS_MODIFF to MODIFF provided preserve_chars_modiff is zero.
+	(insert_1_both, insert_from_string_1, insert_from_buffer_1)
+	(adjust_after_replace, adjust_after_replace_noundo)
+	(replace_range, replace_range_2, del_range_2): Reset CHARS_MODIFF.
+	* lisp.h (modify_region): Add fourth argument in extern.
+	* casefiddle.c (casify_region): Call modify_region with fourth
+	argument zero to assert that CHARS_MODIFF is updated.
+	* editfns.c (Fsubst_char_in_region, Ftranslate_region_internal)
+	(Ftranspose_regions): Likewise.
+	* textprop.c (Fadd_text_properties, Fset_text_properties)
+	(Fremove_text_properties, Fremove_list_of_text_properties):
+	Call modify_region with fourth argument 1 to avoid that
+	CHARS_MODIFF is updated.
+
+2006-08-31  Richard Stallman  <rms@gnu.org>
+
+	* editfns.c (Fformat): Don't sign-extend for %o or %x.
+
+2006-08-29  Chong Yidong  <cyd@stupidchicken.com>
+
+	* indent.c (Fvertical_motion): Don't move back if we were
+	displaying a Lisp string, either.
+
+2006-08-28  Kim F. Storm  <storm@cua.dk>
+
+	* xdisp.c (get_window_cursor_type) [!HAVE_WINDOW_SYSTEM]:
+	Don't attempt to replace cursor on image glyphs.
+
+2006-08-28  Kenichi Handa  <handa@m17n.org>
+
+	* coding.c (Fdetect_coding_region, Fdetect_coding_string): Fix
+	docstring about ISO-2022 control characters.
+
 2006-08-28  Kim F. Storm  <storm@cua.dk>
 
 	* xdisp.c (get_window_cursor_type): Replace BOX cursor on images
@@ -68,6 +164,10 @@
 	(Frename_file, Fadd_name_to_file, Fmake_symbolic_link):
 	Simplify; remove NO_ARG_ARRAY stuff, use list2.
 
+2006-08-25  Richard Stallman  <rms@gnu.org>
+
+	* buffer.c (Fswitch_to_buffer): Fix previous change.
+
 2006-08-25  Kim F. Storm  <storm@cua.dk>
 
 	* keyboard.c (Fcurrent_idle_time): Simplify.
--- a/src/Makefile.in	Thu Aug 31 07:43:01 2006 +0000
+++ b/src/Makefile.in	Tue Sep 05 02:54:22 2006 +0000
@@ -75,13 +75,13 @@
 #define NOT_C_CODE
 #include "config.h"
 
-/* We won't really call alloca;
-   don't let the file name alloca.c get messed up.  */
+/* We won''t really call alloca;
+   don''t let the file name alloca.c get messed up.  */
 #ifdef alloca
 #undef alloca
 #endif
 
-/* Don't let the file name mktime.c get messed up.  */
+/* Don''t let the file name mktime.c get messed up.  */
 #ifdef mktime
 #undef mktime
 #endif
@@ -96,7 +96,7 @@
 #endif
 
 /* On some machines #define register is done in config;
-   don't let it interfere with this file.  */
+   don''t let it interfere with this file.  */
 #undef register
 
 /* On some systems we may not be able to use the system make command. */
@@ -116,7 +116,7 @@
 #endif
 #endif
 
-/* Some machines don't find the standard C libraries in the usual place.  */
+/* Some machines don''t find the standard C libraries in the usual place.  */
 #ifndef ORDINARY_LINK
 #ifndef LIB_STANDARD
 #define LIB_STANDARD -lc
@@ -248,7 +248,7 @@
 #endif /* not ORDINARY_LINK */
 
 
-/* cc switches needed to make `asm' keyword work.
+/* cc switches needed to make ``asm'' keyword work.
    Nothing special needed on most machines.  */
 #ifndef C_SWITCH_ASM
 #define C_SWITCH_ASM
@@ -277,7 +277,7 @@
    for use in Emacs.
 
    -DHAVE_CONFIG_H is needed for some other files to take advantage of
-   the information in `config.h'.  */
+   the information in ``config.h''.  */
 
 /* C_SWITCH_X_SITE must come before C_SWITCH_X_MACHINE and C_SWITCH_X_SYSTEM
    since it may have -I options that should override those two.  */
@@ -337,7 +337,7 @@
 
 #else /* not HAVE_MENUS */
 
-/* Otherwise, don't worry about the menu library at all.  */
+/* Otherwise, don''t worry about the menu library at all.  */
 LIBXMENU=
 #endif /* not HAVE_MENUS */
 
@@ -381,7 +381,7 @@
 #ifdef LIBXT_STATIC
 /* We assume the config files have defined STATIC_OPTION
    since that might depend on the operating system.
-   (Don't forget you need different definitions with and without __GNUC__.)  */
+   (Don''t forget you need different definitions with and without __GNUC__.)  */
 LIBXT= STATIC_OPTION $(LIBW) LIBXMU -lXt $(LIBXTR6) -lXext DYNAMIC_OPTION
 #else /* not LIBXT_STATIC */
 LIBXT= $(LIBW) LIBXMU -lXt $(LIBXTR6) -lXext
@@ -474,9 +474,9 @@
 /* Versions of GCC >= 2.0 put their library, libgcc.a, in obscure
    places that are difficult to figure out at make time.  Fortunately,
    these same versions allow you to pass arbitrary flags on to the
-   linker, so there's no reason not to use it as a linker.
+   linker, so there''s no reason not to use it as a linker.
 
-   Well, it's not quite perfect.  The `-nostdlib' keeps GCC from
+   Well, it''s not quite perfect.  The ``-nostdlib'' keeps GCC from
    searching for libraries in its internal directories, so we have to
    ask GCC explicitly where to find libgcc.a.  */
 
@@ -493,9 +493,9 @@
 
 #ifndef LINKER_WAS_SPECIFIED
 /* GCC passes any argument prefixed with -Xlinker directly to the
-   linker.  See prefix-args.c for an explanation of why we don't do
-   this with the shell's `for' construct.
-   Note that some people don't have '.'  in their paths, so we must
+   linker.  See prefix-args.c for an explanation of why we don''t do
+   this with the shell''s ``for'' construct.
+   Note that some people don''t have '.'  in their paths, so we must
    use ./prefix-args.  */
 #define YMF_PASS_LDFLAGS(flags) `./prefix-args -Xlinker flags`
 #else
@@ -536,12 +536,12 @@
 #endif /* not ORDINARY_LINK */
 
 /* Flags to pass to LD only for temacs.  */
-/* Don't split this line with a backslash.  That can cause trouble with
+/* Don''t split this line with a backslash.  That can cause trouble with
    some cpps.  */
 TEMACS_LDFLAGS = LD_SWITCH_SYSTEM LD_SWITCH_SYSTEM_TEMACS LD_SWITCH_MACHINE LD_SWITCH_MACHINE_TEMACS LD_SWITCH_SITE
 
 /* A macro which other sections of Makefile can redefine to munge the
-   flags before they're passed to LD.  This is helpful if you have
+   flags before they''re passed to LD.  This is helpful if you have
    redefined LD to something odd, like "gcc".
    (The YMF prefix is a holdover from the old name "ymakefile".)
   */
@@ -728,8 +728,8 @@
 #define TOOLTIP_SUPPORT
 #endif
 
-/* List of Lisp files loaded into the dumped Emacs.  It's arranged
-   like this because it's easier to generate it semi-mechanically from
+/* List of Lisp files loaded into the dumped Emacs.  It''s arranged
+   like this because it''s easier to generate it semi-mechanically from
    loadup.el this way.
 
    Note that this list should not include lisp files which might not
@@ -915,7 +915,7 @@
    We must unconditionally put them in the DOC file.
    We use ../lisp/ to start the file names
    to reduce the size of the argument list for make-docfile
-   for the sake of systems which can\'t handle large ones.  */
+   for the sake of systems which can''t handle large ones.  */
 SOME_MACHINE_LISP = ${dotdot}/lisp/mouse.elc \
   ${dotdot}/lisp/select.elc ${dotdot}/lisp/scroll-bar.elc \
   ${dotdot}/lisp/vmsproc.elc ${dotdot}/lisp/vms-patch.elc \
@@ -1003,13 +1003,13 @@
     -o temacs ${STARTFILES} ${obj} ${otherobj}  \
     OBJECTS_MACHINE ${LIBES}
 
-/* We don't use ALL_LDFLAGS because LD_SWITCH_SYSTEM and LD_SWITCH_MACHINE
-   often contain options that have to do with using Emacs's crt0,
+/* We don''t use ALL_LDFLAGS because LD_SWITCH_SYSTEM and LD_SWITCH_MACHINE
+   often contain options that have to do with using Emacs''s crt0,
    which are only good with temacs.  */
 prefix-args${EXEEXT}: prefix-args.c $(config_h)
 	$(CC) $(ALL_CFLAGS) $(LDFLAGS) ${srcdir}/prefix-args.c -o prefix-args
 
-/* Don't lose if this was not defined.  */
+/* Don''t lose if this was not defined.  */
 #ifndef OLDXMENU_OPTIONS
 #define OLDXMENU_OPTIONS
 #endif
@@ -1072,7 +1072,7 @@
 #endif /* not USE_X_TOOLKIT */
 #else /* not (HAVE_X_WINDOWS && HAVE_X11 && HAVE_MENUS && ! HAVE_GTK) */
 
-/* We don\'t really need this, but satisfy the dependency.  */
+/* We don''t really need this, but satisfy the dependency.  */
 stamp-oldxmenu:
 	touch stamp-oldxmenu
 #endif /* not (HAVE_X_WINDOWS && HAVE_X11 && HAVE_MENUS && ! HAVE_GTK) */
--- a/src/buffer.c	Thu Aug 31 07:43:01 2006 +0000
+++ b/src/buffer.c	Tue Sep 05 02:54:22 2006 +0000
@@ -375,6 +375,7 @@
   BUF_ZV_BYTE (b) = BEG_BYTE;
   BUF_Z_BYTE (b) = BEG_BYTE;
   BUF_MODIFF (b) = 1;
+  BUF_CHARS_MODIFF (b) = 1;
   BUF_OVERLAY_MODIFF (b) = 1;
   BUF_SAVE_MODIFF (b) = 1;
   BUF_INTERVALS (b) = 0;
@@ -1149,6 +1150,31 @@
 
   return make_number (BUF_MODIFF (buf));
 }
+
+DEFUN ("buffer-chars-modified-tick", Fbuffer_chars_modified_tick,
+       Sbuffer_chars_modified_tick, 0, 1, 0,
+       doc: /* Return BUFFER's character-change tick counter.
+Each buffer has a character-change tick counter, which is set to the
+value of the buffer's tick counter \(see `buffer-modified-tick'), each
+time text in that buffer is inserted or deleted.  By comparing the
+values returned by two individual calls of `buffer-chars-modified-tick',
+you can tell whether a character change occurred in that buffer in
+between these calls.  No argument or nil as argument means use current
+buffer as BUFFER.  */)
+     (buffer)
+     register Lisp_Object buffer;
+{
+  register struct buffer *buf;
+  if (NILP (buffer))
+    buf = current_buffer;
+  else
+    {
+      CHECK_BUFFER (buffer);
+      buf = XBUFFER (buffer);
+    }
+
+  return make_number (BUF_CHARS_MODIFF (buf));
+}
 
 DEFUN ("rename-buffer", Frename_buffer, Srename_buffer, 1, 2,
        "sRename buffer (to new name): \nP",
@@ -6060,6 +6086,7 @@
   defsubr (&Sbuffer_modified_p);
   defsubr (&Sset_buffer_modified_p);
   defsubr (&Sbuffer_modified_tick);
+  defsubr (&Sbuffer_chars_modified_tick);
   defsubr (&Srename_buffer);
   defsubr (&Sother_buffer);
   defsubr (&Sbuffer_enable_undo);
--- a/src/buffer.h	Thu Aug 31 07:43:01 2006 +0000
+++ b/src/buffer.h	Tue Sep 05 02:54:22 2006 +0000
@@ -82,6 +82,9 @@
 /* Modification count.  */
 #define MODIFF (current_buffer->text->modiff)
 
+/* Character modification count.  */
+#define CHARS_MODIFF (current_buffer->text->chars_modiff)
+
 /* Overlay modification count.  */
 #define OVERLAY_MODIFF (current_buffer->text->overlay_modiff)
 
@@ -147,6 +150,9 @@
 /* Modification count.  */
 #define BUF_MODIFF(buf) ((buf)->text->modiff)
 
+/* Character modification count.  */
+#define BUF_CHARS_MODIFF(buf) ((buf)->text->chars_modiff)
+
 /* Modification count as of last visit or save.  */
 #define BUF_SAVE_MODIFF(buf) ((buf)->text->save_modiff)
 
@@ -410,6 +416,10 @@
 				   for this buffer.  It is incremented for
 				   each such event, and never otherwise
 				   changed.  */
+    int chars_modiff;           /* This is modified with character change
+				   events for this buffer.  It is set to
+				   modiff for each such event, and never
+				   otherwise changed.  */
     int save_modiff;		/* Previous value of modiff, as of last
 				   time buffer visited or saved a file.  */
 
--- a/src/casefiddle.c	Thu Aug 31 07:43:01 2006 +0000
+++ b/src/casefiddle.c	Tue Sep 05 02:54:22 2006 +0000
@@ -196,7 +196,7 @@
   validate_region (&b, &e);
   start = XFASTINT (b);
   end = XFASTINT (e);
-  modify_region (current_buffer, start, end);
+  modify_region (current_buffer, start, end, 0);
   record_change (start, end - start);
   start_byte = CHAR_TO_BYTE (start);
   end_byte = CHAR_TO_BYTE (end);
--- a/src/coding.c	Thu Aug 31 07:43:01 2006 +0000
+++ b/src/coding.c	Tue Sep 05 02:54:22 2006 +0000
@@ -7461,7 +7461,8 @@
        doc: /* Detect coding system of the text in the region between START and END.
 Return a list of possible coding systems ordered by priority.
 
-If only ASCII characters are found, it returns a list of single element
+If only ASCII characters are found (except for such ISO-2022 control
+characters ISO-2022 as ESC), it returns a list of single element
 `undecided' or its subsidiary coding system according to a detected
 end-of-line format.
 
@@ -7497,7 +7498,8 @@
        doc: /* Detect coding system of the text in STRING.
 Return a list of possible coding systems ordered by priority.
 
-If only ASCII characters are found, it returns a list of single element
+If only ASCII characters are found (except for such ISO-2022 control
+characters ISO-2022 as ESC), it returns a list of single element
 `undecided' or its subsidiary coding system according to a detected
 end-of-line format.
 
--- a/src/editfns.c	Thu Aug 31 07:43:01 2006 +0000
+++ b/src/editfns.c	Tue Sep 05 02:54:22 2006 +0000
@@ -2802,7 +2802,7 @@
 	  else if (!changed)
 	    {
 	      changed = -1;
-	      modify_region (current_buffer, pos, XINT (end));
+	      modify_region (current_buffer, pos, XINT (end), 0);
 
 	      if (! NILP (noundo))
 		{
@@ -2982,7 +2982,7 @@
   pos = XINT (start);
   pos_byte = CHAR_TO_BYTE (pos);
   end_pos = XINT (end);
-  modify_region (current_buffer, pos, end_pos);
+  modify_region (current_buffer, pos, end_pos, 0);
 
   cnt = 0;
   for (; pos < end_pos; )
@@ -3890,7 +3890,13 @@
 	      this_format[format - this_format_start] = 0;
 
 	      if (INTEGERP (args[n]))
-		sprintf (p, this_format, XINT (args[n]));
+		{
+		  if (format[-1] == 'd')
+		    sprintf (p, this_format, XINT (args[n]));
+		  /* Don't sign-extend for octal or hex printing.  */
+		  else
+		    sprintf (p, this_format, XUINT (args[n]));
+		}
 	      else
 		sprintf (p, this_format, XFLOAT_DATA (args[n]));
 
@@ -4306,7 +4312,7 @@
 
   if (end1 == start2)		/* adjacent regions */
     {
-      modify_region (current_buffer, start1, end2);
+      modify_region (current_buffer, start1, end2, 0);
       record_change (start1, len1 + len2);
 
       tmp_interval1 = copy_intervals (cur_intv, start1, len1);
@@ -4362,8 +4368,8 @@
         {
 	  USE_SAFE_ALLOCA;
 
-          modify_region (current_buffer, start1, end1);
-          modify_region (current_buffer, start2, end2);
+          modify_region (current_buffer, start1, end1, 0);
+          modify_region (current_buffer, start2, end2, 0);
           record_change (start1, len1);
           record_change (start2, len2);
           tmp_interval1 = copy_intervals (cur_intv, start1, len1);
@@ -4392,7 +4398,7 @@
         {
 	  USE_SAFE_ALLOCA;
 
-          modify_region (current_buffer, start1, end2);
+          modify_region (current_buffer, start1, end2, 0);
           record_change (start1, (end2 - start1));
           tmp_interval1 = copy_intervals (cur_intv, start1, len1);
           tmp_interval_mid = copy_intervals (cur_intv, end1, len_mid);
@@ -4423,7 +4429,7 @@
 	  USE_SAFE_ALLOCA;
 
           record_change (start1, (end2 - start1));
-          modify_region (current_buffer, start1, end2);
+          modify_region (current_buffer, start1, end2, 0);
 
           tmp_interval1 = copy_intervals (cur_intv, start1, len1);
           tmp_interval_mid = copy_intervals (cur_intv, end1, len_mid);
--- a/src/eval.c	Thu Aug 31 07:43:01 2006 +0000
+++ b/src/eval.c	Tue Sep 05 02:54:22 2006 +0000
@@ -199,6 +199,14 @@
 
 static Lisp_Object funcall_lambda P_ ((Lisp_Object, int, Lisp_Object*));
 static void unwind_to_catch P_ ((struct catchtag *, Lisp_Object)) NO_RETURN;
+
+#if __GNUC__
+/* "gcc -O3" enables automatic function inlining, which optimizes out
+   the arguments for the invocations of these functions, whereas they
+   expect these values on the stack.  */
+Lisp_Object apply1 () __attribute__((noinline));
+Lisp_Object call2 () __attribute__((noinline));
+#endif
 
 void
 init_eval_once ()
--- a/src/fns.c	Thu Aug 31 07:43:01 2006 +0000
+++ b/src/fns.c	Tue Sep 05 02:54:22 2006 +0000
@@ -385,7 +385,12 @@
   return i1 < SCHARS (s2) ? Qt : Qnil;
 }
 
-static Lisp_Object concat ();
+#if __GNUC__
+/* "gcc -O3" enables automatic function inlining, which optimizes out
+   the arguments for the invocations of this function, whereas it
+   expects these values on the stack.  */
+static Lisp_Object concat () __attribute__((noinline));
+#endif
 
 /* ARGSUSED */
 Lisp_Object
--- a/src/gtkutil.c	Thu Aug 31 07:43:01 2006 +0000
+++ b/src/gtkutil.c	Tue Sep 05 02:54:22 2006 +0000
@@ -1326,9 +1326,10 @@
   message[0] = '\0';
   if (action != GTK_FILE_CHOOSER_ACTION_SAVE)
     strcat (message, "\nType C-l to display a file name text entry box.\n");
-  strcat (message, "\nIf you don't like this file selector, customize "
-          "use-file-dialog\nto turn it off, or type C-x C-f to visit files.");
-
+  strcat (message, "\nIf you don't like this file selector, use the "
+          "corresponding\nkey binding or customize "
+          "use-file-dialog to turn it off.");
+    
   wmessage = gtk_label_new (message);
   gtk_widget_show (wmessage);
   gtk_box_pack_start (GTK_BOX (wbox), wtoggle, FALSE, FALSE, 0);
@@ -1340,6 +1341,7 @@
       Lisp_Object file;
       struct gcpro gcpro1;
       GCPRO1 (file);
+      char *utf8_filename;
 
       file = build_string (default_filename);
 
@@ -1347,14 +1349,23 @@
          an absolute name starting with /.  */
       if (default_filename[0] != '/')
         file = Fexpand_file_name (file, Qnil);
-
-      default_filename = SSDATA (file);
-      if (Ffile_directory_p (file))
+      
+      utf8_filename = SSDATA (ENCODE_UTF_8 (file));
+      if (! NILP (Ffile_directory_p (file)))
         gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (filewin),
-                                             default_filename);
+                                             utf8_filename);
       else
-        gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (filewin),
-                                       default_filename);
+        {
+          gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (filewin),
+                                         utf8_filename);
+          if (action == GTK_FILE_CHOOSER_ACTION_SAVE)
+            {
+              char *cp = strrchr (utf8_filename, '/');
+              if (cp) ++cp;
+              else cp = utf8_filename;
+              gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (filewin), cp);
+            }
+        }
 
       UNGCPRO;
     }
--- a/src/indent.c	Thu Aug 31 07:43:01 2006 +0000
+++ b/src/indent.c	Tue Sep 05 02:54:22 2006 +0000
@@ -2074,7 +2074,7 @@
     {
       int it_start;
       int oselective;
-      int start_on_image_or_stretch_p;
+      int start_on_image_or_stretch_or_string_p;
 
       SET_TEXT_POS (pt, PT, PT_BYTE);
       start_display (&it, w, pt);
@@ -2086,8 +2086,9 @@
 	 while the end position is really at some X > 0, the same X that
 	 PT had.  */
       it_start = IT_CHARPOS (it);
-      start_on_image_or_stretch_p = (it.method == GET_FROM_IMAGE
-				     || it.method == GET_FROM_STRETCH);
+      start_on_image_or_stretch_or_string_p = (it.method == GET_FROM_IMAGE
+					       || it.method == GET_FROM_STRETCH
+					       || it.method == GET_FROM_STRING);
       reseat_at_previous_visible_line_start (&it);
       it.current_x = it.hpos = 0;
       /* Temporarily disable selective display so we don't move too far */
@@ -2098,10 +2099,10 @@
 
       /* Move back if we got too far.  This may happen if
 	 truncate-lines is on and PT is beyond right margin.
-	 It may also happen if it_start is on an image or a stretch
-	 glyph -- in that case, don't go back.  */
+	 It may also happen if it_start is on an image, stretch
+	 glyph, or string -- in that case, don't go back.  */
       if (IT_CHARPOS (it) > it_start && XINT (lines) > 0
-	  && !start_on_image_or_stretch_p)
+	  && !start_on_image_or_stretch_or_string_p)
 	move_it_by_lines (&it, -1, 0);
 
       it.vpos = 0;
--- a/src/insdel.c	Thu Aug 31 07:43:01 2006 +0000
+++ b/src/insdel.c	Tue Sep 05 02:54:22 2006 +0000
@@ -996,6 +996,7 @@
      will add up to the right stuff in the undo list.  */
   record_insert (PT, nchars);
   MODIFF++;
+  CHARS_MODIFF = MODIFF;
 
   bcopy (string, GPT_ADDR, nbytes);
 
@@ -1133,6 +1134,7 @@
 
   record_insert (PT, nchars);
   MODIFF++;
+  CHARS_MODIFF = MODIFF;
 
   GAP_SIZE -= outgoing_nbytes;
   GPT += nchars;
@@ -1328,6 +1330,7 @@
 
   record_insert (PT, nchars);
   MODIFF++;
+  CHARS_MODIFF = MODIFF;
 
   GAP_SIZE -= outgoing_nbytes;
   GPT += nchars;
@@ -1436,6 +1439,7 @@
   if (len == 0)
     evaporate_overlays (from);
   MODIFF++;
+  CHARS_MODIFF = MODIFF;
 }
 
 /* Like adjust_after_replace, but doesn't require PREV_TEXT.
@@ -1486,6 +1490,7 @@
   if (len == 0)
     evaporate_overlays (from);
   MODIFF++;
+  CHARS_MODIFF = MODIFF;
 }
 
 /* Record undo information, adjust markers and position keepers for an
@@ -1678,6 +1683,7 @@
   CHECK_MARKERS ();
 
   MODIFF++;
+  CHARS_MODIFF = MODIFF;
   UNGCPRO;
 
   signal_after_change (from, nchars_del, GPT - from);
@@ -1802,6 +1808,7 @@
   CHECK_MARKERS ();
 
   MODIFF++;
+  CHARS_MODIFF = MODIFF;
 }
 
 /* Delete characters in current buffer
@@ -1983,6 +1990,7 @@
   if (! EQ (current_buffer->undo_list, Qt))
     record_delete (from, deletion);
   MODIFF++;
+  CHARS_MODIFF = MODIFF;
 
   /* Relocate point as if it were a marker.  */
   if (from < PT)
@@ -2023,12 +2031,15 @@
    character positions START to END.  This checks the read-only
    properties of the region, calls the necessary modification hooks,
    and warns the next redisplay that it should pay attention to that
-   area.  */
+   area.
+
+   If PRESERVE_CHARS_MODIFF is non-zero, do not update CHARS_MODIFF.
+   Otherwise set CHARS_MODIFF to the new value of MODIFF.  */
 
 void
-modify_region (buffer, start, end)
+modify_region (buffer, start, end, preserve_chars_modiff)
      struct buffer *buffer;
-     int start, end;
+     int start, end, preserve_chars_modiff;
 {
   struct buffer *old_buffer = current_buffer;
 
@@ -2042,6 +2053,8 @@
   if (MODIFF <= SAVE_MODIFF)
     record_first_change ();
   MODIFF++;
+  if (! preserve_chars_modiff)
+    CHARS_MODIFF = MODIFF;
 
   buffer->point_before_scroll = Qnil;
 
--- a/src/lisp.h	Thu Aug 31 07:43:01 2006 +0000
+++ b/src/lisp.h	Tue Sep 05 02:54:22 2006 +0000
@@ -2484,7 +2484,7 @@
 extern void del_range_byte P_ ((int, int, int));
 extern void del_range_both P_ ((int, int, int, int, int));
 extern Lisp_Object del_range_2 P_ ((int, int, int, int, int));
-extern void modify_region P_ ((struct buffer *, int, int));
+extern void modify_region P_ ((struct buffer *, int, int, int));
 extern void prepare_to_modify_buffer P_ ((int, int, int *));
 extern void signal_before_change P_ ((int, int, int *));
 extern void signal_after_change P_ ((int, int, int));
--- a/src/macterm.c	Thu Aug 31 07:43:01 2006 +0000
+++ b/src/macterm.c	Tue Sep 05 02:54:22 2006 +0000
@@ -9507,6 +9507,18 @@
 
       break;
 
+    case kEventWindowClose:
+      {
+	struct input_event buf;
+
+	EVENT_INIT (buf);
+	buf.kind = DELETE_WINDOW_EVENT;
+	XSETFRAME (buf.frame_or_window, mac_window_to_frame (wp));
+	buf.arg = Qnil;
+	kbd_buffer_store_event (&buf);
+      }
+      return noErr;
+
 #ifdef MAC_OSX
     case kEventWindowToolbarSwitchMode:
       result = CallNextEventHandler (next_handler, event);
@@ -9796,6 +9808,8 @@
 			read_socket_inev->kind = ASCII_KEYSTROKE_EVENT;
 			read_socket_inev->code = code;
 			read_socket_inev->modifiers =
+			  mac_to_emacs_modifiers (modifiers);
+			read_socket_inev->modifiers |=
 			  (extra_keyboard_modifiers
 			   & (meta_modifier | alt_modifier
 			      | hyper_modifier | super_modifier));
@@ -9920,6 +9934,7 @@
      {kEventClassWindow, kEventWindowHidden},
      {kEventClassWindow, kEventWindowExpanded},
      {kEventClassWindow, kEventWindowCollapsed},
+     {kEventClassWindow, kEventWindowClose},
 #ifdef MAC_OSX
      {kEventClassWindow, kEventWindowToolbarSwitchMode},
 #endif
--- a/src/marker.c	Thu Aug 31 07:43:01 2006 +0000
+++ b/src/marker.c	Tue Sep 05 02:54:22 2006 +0000
@@ -460,7 +460,8 @@
 }
 
 DEFUN ("marker-position", Fmarker_position, Smarker_position, 1, 1, 0,
-       doc: /* Return the position MARKER points at, as a character number.  */)
+       doc: /* Return the position MARKER points at, as a character number.
+Returns nil if MARKER points nowhere.  */)
      (marker)
      Lisp_Object marker;
 {
--- a/src/minibuf.c	Thu Aug 31 07:43:01 2006 +0000
+++ b/src/minibuf.c	Tue Sep 05 02:54:22 2006 +0000
@@ -1195,8 +1195,8 @@
 	  prompt = Fformat (3, args);
 	}
 
-      return Fcompleting_read (prompt, Vbuffer_alist, Qnil,
-			       require_match, Qnil, Qbuffer_name_history,
+      return Fcompleting_read (prompt, intern ("internal-complete-buffer"),
+			       Qnil, require_match, Qnil, Qbuffer_name_history,
 			       def, Qnil);
     }
   else
@@ -1905,6 +1905,24 @@
     return Qt;
 }
 
+DEFUN ("internal-complete-buffer", Finternal_complete_buffer, Sinternal_complete_buffer, 3, 3, 0,
+       doc: /* Perform completion on buffer names.
+If the argument FLAG is nil, invoke `try-completion', if it's t, invoke
+`all-completions', otherwise invoke `test-completion'.
+
+The arguments STRING and PREDICATE are as in  `try-completion',
+`all-completions', and `test-completion'. */)
+     (string, predicate, flag)
+     Lisp_Object string, predicate, flag;
+{
+  if (NILP (flag))
+    return Ftry_completion (string, Vbuffer_alist, predicate);
+  else if (EQ (flag, Qt))
+    return Fall_completions (string, Vbuffer_alist, predicate, Qt);
+  else				/* assume `lambda' */
+    return Ftest_completion (string, Vbuffer_alist, predicate);
+}
+
 /* returns:
  * 0 no possible completion
  * 1 was already an exact and unique completion
@@ -2906,6 +2924,7 @@
   defsubr (&Sread_string);
   defsubr (&Sread_command);
   defsubr (&Sread_variable);
+  defsubr (&Sinternal_complete_buffer);
   defsubr (&Sread_buffer);
   defsubr (&Sread_no_blanks_input);
   defsubr (&Sminibuffer_depth);
--- a/src/textprop.c	Thu Aug 31 07:43:01 2006 +0000
+++ b/src/textprop.c	Tue Sep 05 02:54:22 2006 +0000
@@ -1253,7 +1253,7 @@
     }
 
   if (BUFFERP (object))
-    modify_region (XBUFFER (object), XINT (start), XINT (end));
+    modify_region (XBUFFER (object), XINT (start), XINT (end), 1);
 
   /* We are at the beginning of interval I, with LEN chars to scan.  */
   for (;;)
@@ -1393,7 +1393,7 @@
     }
 
   if (BUFFERP (object))
-    modify_region (XBUFFER (object), XINT (start), XINT (end));
+    modify_region (XBUFFER (object), XINT (start), XINT (end), 1);
 
   set_text_properties_1 (start, end, properties, object, i);
 
@@ -1541,7 +1541,7 @@
     }
 
   if (BUFFERP (object))
-    modify_region (XBUFFER (object), XINT (start), XINT (end));
+    modify_region (XBUFFER (object), XINT (start), XINT (end), 1);
 
   /* We are at the beginning of an interval, with len to scan */
   for (;;)
@@ -1655,7 +1655,7 @@
 	  if (LENGTH (i) == len)
 	    {
 	      if (!modified && BUFFERP (object))
-		modify_region (XBUFFER (object), XINT (start), XINT (end));
+		modify_region (XBUFFER (object), XINT (start), XINT (end), 1);
 	      remove_properties (Qnil, properties, i, object);
 	      if (BUFFERP (object))
 		signal_after_change (XINT (start), XINT (end) - XINT (start),
@@ -1668,7 +1668,7 @@
 	  i = split_interval_left (i, len);
 	  copy_properties (unchanged, i);
 	  if (!modified && BUFFERP (object))
-	    modify_region (XBUFFER (object), XINT (start), XINT (end));
+	    modify_region (XBUFFER (object), XINT (start), XINT (end), 1);
 	  remove_properties (Qnil, properties, i, object);
 	  if (BUFFERP (object))
 	    signal_after_change (XINT (start), XINT (end) - XINT (start),
@@ -1679,7 +1679,7 @@
       if (interval_has_some_properties_list (properties, i))
 	{
 	  if (!modified && BUFFERP (object))
-	    modify_region (XBUFFER (object), XINT (start), XINT (end));
+	    modify_region (XBUFFER (object), XINT (start), XINT (end), 1);
 	  remove_properties (Qnil, properties, i, object);
 	  modified = 1;
 	}
--- a/src/w32.c	Thu Aug 31 07:43:01 2006 +0000
+++ b/src/w32.c	Tue Sep 05 02:54:22 2006 +0000
@@ -4113,6 +4113,25 @@
 }
 
 /*
+        shutdown_handler ensures that buffers' autosave files are
+	up to date when the user logs off, or the system shuts down.
+*/
+BOOL WINAPI shutdown_handler(DWORD type)
+{
+  /* Ctrl-C and Ctrl-Break are already suppressed, so don't handle them.  */
+  if (type == CTRL_CLOSE_EVENT        /* User closes console window.  */
+      || type == CTRL_LOGOFF_EVENT    /* User logs off.  */
+      || type == CTRL_SHUTDOWN_EVENT) /* User shutsdown.  */
+    {
+      /* Shut down cleanly, making sure autosave files are up to date.  */
+      shut_down_emacs (0, 0, Qnil);
+    }
+
+  /* Allow other handlers to handle this signal.  */  
+  return FALSE;
+}
+
+/*
 	globals_of_w32 is used to initialize those global variables that
 	must always be initialized on startup even when the global variable
 	initialized is non zero (see the function main in emacs.c).
@@ -4124,6 +4143,11 @@
   g_b_init_get_token_information = 0;
   g_b_init_lookup_account_sid = 0;
   g_b_init_get_sid_identifier_authority = 0;
+  /* The following sets a handler for shutdown notifications for
+     console apps. This actually applies to Emacs in both console and
+     GUI modes, since we had to fool windows into thinking emacs is a
+     console application to get console mode to work.  */
+  SetConsoleCtrlHandler(shutdown_handler, TRUE);
 }
 
 /* end of nt.c */
--- a/src/window.c	Thu Aug 31 07:43:01 2006 +0000
+++ b/src/window.c	Tue Sep 05 02:54:22 2006 +0000
@@ -7290,16 +7290,18 @@
   next_screen_context_lines = 2;
 
   DEFVAR_INT ("split-height-threshold", &split_height_threshold,
-	      doc: /* *A window must be at least this tall to be eligible for splitting by `display-buffer'.
+	      doc: /* *A window must be at least this tall to be eligible for splitting
+by `display-buffer'.  The value is in line units.
 If there is only one window, it is split regardless of this value.  */);
   split_height_threshold = 500;
 
   DEFVAR_INT ("window-min-height", &window_min_height,
-	      doc: /* *Delete any window less than this tall (including its mode line).  */);
+	      doc: /* *Delete any window less than this tall (including its mode line).
+The value is in line units. */);
   window_min_height = 4;
 
   DEFVAR_INT ("window-min-width", &window_min_width,
-	      doc: /* *Delete any window less than this wide.  */);
+	      doc: /* *Delete any window less than this wide (measured in characters).  */);
   window_min_width = 10;
 
   DEFVAR_LISP ("scroll-preserve-screen-position",
--- a/src/xdisp.c	Thu Aug 31 07:43:01 2006 +0000
+++ b/src/xdisp.c	Tue Sep 05 02:54:22 2006 +0000
@@ -21547,6 +21547,7 @@
   /* Use normal cursor if not blinked off.  */
   if (!w->cursor_off_p)
     {
+#ifdef HAVE_WINDOW_SYSTEM
       if (glyph != NULL && glyph->type == IMAGE_GLYPH)
 	{
 	  if (cursor_type == FILLED_BOX_CURSOR)
@@ -21572,6 +21573,7 @@
 	      cursor_type = HOLLOW_BOX_CURSOR;
 	    }
       }
+#endif
       return cursor_type;
     }