changeset 83483:8976b9f5eda1

Merged from emacs@sv.gnu.org Patches applied: * emacs@sv.gnu.org/emacs--devo--0--patch-120 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-121 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-122 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-123 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-124 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-125 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-126 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-127 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-40 Merge from emacs--devo--0 * emacs@sv.gnu.org/gnus--rel--5.10--patch-41 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-42 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-523
author Karoly Lorentey <lorentey@elte.hu>
date Tue, 28 Feb 2006 17:35:08 +0000
parents b55933c26094 (current diff) 3fc5f80af468 (diff)
children a380ca43a190
files admin/FOR-RELEASE lisp/ChangeLog lisp/files.el lisp/mh-e/ChangeLog lisp/progmodes/gdb-ui.el lisp/startup.el lisp/subr.el lispref/ChangeLog lispref/elisp.texi man/ChangeLog man/cc-mode.texi src/buffer.c src/lisp.h src/lread.c src/process.c src/xfns.c src/xselect.c src/xterm.c src/xterm.h
diffstat 64 files changed, 1677 insertions(+), 644 deletions(-) [+]
line wrap: on
line diff
--- a/admin/ChangeLog	Sat Feb 25 01:07:18 2006 +0000
+++ b/admin/ChangeLog	Tue Feb 28 17:35:08 2006 +0000
@@ -1,3 +1,7 @@
+2006-02-24  Reiner Steib  <Reiner.Steib@gmx.de>
+
+	* FOR-RELEASE (BUGS): Add URLs/MIDs.
+
 2006-02-20  Kim F. Storm  <storm@cua.dk>
 
 	* FOR-RELEASE (NEW FEATURES): Completed work on this item:
--- a/admin/FOR-RELEASE	Sat Feb 25 01:07:18 2006 +0000
+++ b/admin/FOR-RELEASE	Tue Feb 28 17:35:08 2006 +0000
@@ -31,15 +31,25 @@
 ** Ensure MH-E 8.0 has been released.
 Assigned to Bill Wohler <wohler@newt.com>.
 
-* NEW FEATURES
-
 * BUGS
 
 ** Reiner Steib's 23 Jan 2006 bug report that tool bar icons don't update.
+URL/MID: http://mid.gmane.org/v9acdmrcse.fsf@marauder.physik.uni-ulm.de
 
 ** Ralf Angeli's 4 Jul 2005 bug report about scroll-preserve-screen-position.
+URL/MID: http://mid.gmane.org/877jg6o7k4.fsf@neutrino.iwi.uni-sb.de
 
-** Martin Rudalics' 30 Jan 2006 bug report about overlays at end of buffer.
+** Problems with moving point across invisible text,
+including Ralf Angeli's 21 Feb bug report
+and Martin Rudalics' 14 Feb bug report "Re: moving point and invisible text"
+  
+** Markus Gritsch's report about Emacs looping on Windoze with the following
+.emacs file, and then reduce Emacs frame width to "something quite narrow":
+	(setq-default truncate-lines t)
+	(custom-set-variables
+	 '(hscroll-margin 20)
+	 '(hscroll-step 1)
+	)
 
 ** TCP server processes do not work on Windows.
 
--- a/etc/gnus-tut.txt	Sat Feb 25 01:07:18 2006 +0000
+++ b/etc/gnus-tut.txt	Tue Feb 28 17:35:08 2006 +0000
@@ -223,7 +223,7 @@
 
 Create the group by saying
 
-`M-a my.virtual.newsgroup<RET>nnvirtual<RET>^rec\.aquaria\.*<RET>'
+`G m my.virtual.newsgroup<RET>nnvirtual<RET>^rec\.aquaria\.*<RET>'
 
 This will create the group "nnvirtual:my.virtual.newsgroup", which
 will collect all articles from all the groups in the "rec.aquaria"
--- a/lisp/ChangeLog	Sat Feb 25 01:07:18 2006 +0000
+++ b/lisp/ChangeLog	Tue Feb 28 17:35:08 2006 +0000
@@ -1,3 +1,192 @@
+2006-02-28  Nick Roberts  <nickrob@snap.net.nz>
+
+	* speedbar.el: Re-instate comments about developing for speedbar
+	[this is what info and gdb-ui use even if better methods exist now].
+
+	* t-mouse.el: New file.
+	(t-mouse-tty): Use with-temp-buffer.  Add more terminal types.
+	(t-mouse-lispy-buffer-posn-from-coords): Remove.  Use the C
+	primitive...
+	(t-mouse-make-event-element): ...posn-at-x-y instead.
+	(t-mouse-make-event): Deal with Fedora Core 3.
+	(t-mouse-make-event): Don't sink the `stupid text mode menubar'.
+	(t-mouse-mouse-position-function): New function.  Use it instead
+	of advising mouse-position.
+	(t-mouse-mode): New minor mode.
+	(t-mouse-stop, t-mouse-run): Remove.  Use t-mouse-mode instead.
+
+2006-02-27  Glenn Morris  <rgm@gnu.org>
+
+	* calendar/calendar.el (calendar-holidays): Doc fix.
+
+2006-02-27  Nick Roberts  <nickrob@snap.net.nz>
+
+	* progmodes/gdb-ui.el: (gdb-source-window): New variable.
+	Re-introduce the concept of a source window.
+	(gdb-get-buffer-create): Rename from gdb-get-create-buffer for
+	consistency with get-buffer-create.
+	(def-gdb-auto-update-handler, gdb-info-locals-handler)
+	(gdb-data-list-register-values-handler)
+	(gdb-stack-list-locals-handler): Try to preserve window-start as
+	well as window-point.
+	(gdb-display-source-buffer): New function (old concept).
+	(gdb-goto-breakpoint): Use it.
+
+	* progmodes/gud.el (gud-display-line): Use gdb-display-source-buffer
+	for gdb-ui/gdb-mi (old concept).
+
+2006-02-27  Carsten Dominik  <dominik@science.uva.nl>
+
+	* textmodes/reftex-index.el (reftex-index-map): Add `follow-mouse'
+	binding.
+
+	* textmodes/reftex-toc.el (reftex-toc-map): Add `follow-mouse'
+	binding.
+
+	* textmodes/reftex-sel.el (reftex-select-label-map,
+	reftex-select-bib-map): Add `follow-mouse' binding.
+
+2006-02-26  Luc Teirlinck  <teirllm@auburn.edu>
+
+	* jka-cmpr-hook.el (jka-compr-compression-info-list)
+	(jka-compr-mode-alist-additions, jka-compr-load-suffixes):
+	Give :set functions to provide automatic updating.
+	Update docstring.  Give compiler defvars early in the file
+	and move the defcustoms to a later spot where all called functions
+	are defined.
+	(jka-compr-file-name-handler-entry): Doc fix.
+	(jka-compr-compression-info-list--internal)
+	(jka-compr-mode-alist-additions--internal)
+	(jka-compr-load-suffixes--internal): New variables.
+	(jka-compr-install): Set the three above variables.
+	Update `load-file-rep-suffixes' instead of `load-suffixes'.
+	(jka-compr-update, jka-compr-set): New functions.
+	(auto-compression-mode): Doc fix.
+
+	* jka-compr.el (jka-compr-uninstall): Replace `mapcar' with `mapc'.
+	Update `load-file-rep-suffixes' instead of `load-suffixes'.
+	Use jka-compr-compression-info-list--internal,
+	jka-compr-mode-alist-additions--internal and
+	jka-compr-load-suffixes--internal.
+
+	* files.el (load-library):
+	* loadhist.el (file-loadhist-lookup):
+	* startup.el (command-line):
+	* subr.el (locate-library):
+	* emacs-lisp/autoload.el (update-directory-autoloads):
+	* emacs-lisp/find-func.el (find-library-suffixes): Use
+	`get-load-suffixes' instead of `load-suffixes'.
+
+	* subr.el (locate-library):
+	* emacs-lisp/find-func.el (find-library-name): Use
+	`load-file-rep-suffixes' instead of '("").
+
+2006-02-26  Kim F. Storm  <storm@cua.dk>
+
+	* ido.el (ido-save-history, ido-load-history): Simplify.  Don't
+	use find-file-noselect to avoid interference from other modes.
+
+2006-02-25  Thien-Thi Nguyen  <ttn@gnu.org>
+
+	* progmodes/sh-script.el (sh-mode): Fix bug: Arrange
+	to use the default shell if filename is not available.
+	Reported by Giorgos Keramidas.
+
+2006-02-25  John Williams  <jrw@pobox.com>  (tiny change)
+
+	* progmodes/etags.el (tags-completion-table): Do completion from
+	all the tables in the current list, as documented in the manual.
+
+2006-02-24  Alan Mackenzie  <bug-cc-mode@gnu.org>
+
+	* CC Mode Update to 5.31.3.
+
+2006-02-24  Alan Mackenzie  <bug-cc-mode@gnu.org>
+
+	* progmodes/cc-mode.el (c-postprocess-file-styles): bind
+	inhibit-read-only to t, around the call to
+	c-remove-any-local-eval-or-mode-variables, so that it works on a
+	RO file.
+
+2006-02-24  Alan Mackenzie  <bug-cc-mode@gnu.org>
+
+	* progmodes/cc-awk.el: Correct a typo.
+
+2006-02-24  Alan Mackenzie  <bug-cc-mode@gnu.org>
+
+	* progmodes/cc-cmds.el, cc-mode.el: Rename c-hungry-backspace to
+	c-hungry-delete-backwards, at the request of RMS.  Leave the old
+	name as an alias.
+
+2006-02-24  Alan Mackenzie  <bug-cc-mode@gnu.org>
+
+	* progmodes/cc-mode.el: Correct a typo.
+
+2006-02-24  Alan Mackenzie  <bug-cc-mode@gnu.org>
+
+	* progmodes/cc-defs.el: Update the version number to 5.31.3.
+
+2006-02-24  Alan Mackenzie  <bug-cc-mode@gnu.org>
+
+	* progmodes/cc-cmds.el (c-electric-brace): Fix clean-up
+	brace-else-brace (error due to mbeg, mend being undefined).
+
+2006-02-24  Alan Mackenzie  <bug-cc-mode@gnu.org>
+
+	* progmodes/cc-mode.el: File Local variables: Solve the problem
+	where both `mode' and c-file-offsets are specified: `mode' will
+	overwrite c-f-o's settings:
+	(c-remove-any-local-eval-or-mode-variables): new function.
+	(c-postprocess-file-styles): call the above new function, within
+	c-tentative-buffer-change, to splat `mode' and `eval' before the
+	second hack-local-variables.
+
+2006-02-24  Alan Mackenzie  <bug-cc-mode@gnu.org>
+
+	* progmodes/cc-mode.el:
+	[Supersedes patch to cc-engine.el V 1.45]
+	(c-after-change): Protect the match data with save-match-data.  It
+	was getting corrupted by c-after-change-check-<>-operators.
+
+	* cc-defs.el: [Supersedes patch V1.38]:
+	(top level): Check for a buggy font-lock-compile-keywords ONLY in
+	XEmacs.  GNU Emacs 22 now has a check which would throw an error
+	here.
+
+	* progmodes/cc-awk.el (c-awk-after-change): Protect the match data
+	with save-match-data.  It was being corrupted when Font Lock was
+	not enabled.
+
+2006-02-24  Alan Mackenzie  <bug-cc-mode@gnu.org>
+
+	* progmodes/cc-langs.el (c-mode-menu): Add menu items for Electric
+	Mode and Subword Mode.
+
+	* progmodes/cc-engine.el (c-beginning-of-statment-1): Distinguish
+	real labels ("case 1:" or "foo:") from non-labels ("public:").
+	(c-forward-objc-directive): Replace c-forward-token-2 with crude
+	coding; c-f-t-2 doesn't move over a token at EOB.
+
+	* progmodes/cc-defs.el (c-version): Update version number to
+	5.31.2
+
+	* progmodes/cc-cmds.el, cc-mode.el, cc-engine.el
+	(c-update-modeline): Concatenate the minor mode indicators
+	directly onto mode-name, removing c-submode-indicators.
+	Sometimes, c-s-i got separated from the mode name on the mode
+	line.
+
+	* progmodes/cc-cmds.el (c-electric-brace, c-electric-semi&comma,
+	c-electric-colon): Correct doc-strings: "/ln" -> "/la".
+
+2006-02-24  Martin Stjernholm  <bug-cc-mode@gnu.org>
+
+	* progmodes/cc-langs.el (c-make-init-lang-vars-fun): Improved the
+	error message when there's an evaluation error to show whether
+	it's loaded from source or not.
+	(c-filter-ops): Made it available at runtime too to work when
+	`c-make-init-lang-vars-fun' needs to evaluate from source.
+
 2006-02-24  Juanma Barranquero  <lekktu@gmail.com>
 
 	* help.el (help): Revert last part of 2006-02-23 change (deletion
@@ -76,6 +265,11 @@
 	* textmodes/reftex.el (reftex-locate-file): Search all extensions
 	if `reftex-try-all-extensions' is set.
 
+	* textmodes/reftex-dcr.el (reftex-view-crossref): New argument to
+	fail silently when there is no valid argument at point.
+	(reftex-view-crossref-when-idle): Call `reftex-view-crossref' with
+	`fail-silently' argument.  From a patch by David Reiter.
+	
 	* textmodes/org.el (org-mark-ring-push, org-mark-ring-goto):
 	New commands.
 	(org-mark-ring): New variable.
@@ -5064,7 +5258,7 @@
 
 2005-11-29  Michael Kifer  <kifer@cs.stonybrook.edu>
 
-	* ediff-wind (ediff-setup-control-frame, ediff-make-wide-display):
+	* ediff-wind.el (ediff-setup-control-frame, ediff-make-wide-display):
 	Preserve user position.
 
 2005-11-28  Luc Teirlinck  <teirllm@auburn.edu>
@@ -5837,13 +6031,13 @@
 
 2005-11-15  Michael Kifer  <kifer@cs.stonybrook.edu>
 
-	* viper-utils (viper-non-word-characters-reformed-vi): Quote `-' in
-	string.
+	* viper-utils.el (viper-non-word-characters-reformed-vi):
+	Quote `-' in string.
 
 	* viper.el (viper-emacs-state-mode-list): Ensure that
 	rcirc-mode buffers come up in Emacs state.
 
-	* ediff-util (ediff-make-temp-file): Use proper file-name-handler
+	* ediff-util.el (ediff-make-temp-file): Use proper file-name-handler
 	operation.
 
 2005-11-15  Dan Nicolaescu  <dann@ics.uci.edu>
--- a/lisp/ChangeLog.1	Sat Feb 25 01:07:18 2006 +0000
+++ b/lisp/ChangeLog.1	Tue Feb 28 17:35:08 2006 +0000
@@ -1565,7 +1565,7 @@
 	Move rmail-delete-after-output from rmail.el.
 	Flush rmail-mmdf-inbox-list and rmail-make-summary-line-function.
 
-	* mail-utils (mail-strip-quoted-names):
+	* mail-utils.el (mail-strip-quoted-names):
 	Delete leading and trailing whitespace.
 
 1985-10-19  Richard M. Stallman  (rms@mit-prep)
--- a/lisp/ChangeLog.10	Sat Feb 25 01:07:18 2006 +0000
+++ b/lisp/ChangeLog.10	Tue Feb 28 17:35:08 2006 +0000
@@ -2916,7 +2916,7 @@
 	(comment-valid-prefix-p): Rename from comment-valid-prefix
 	and fix to actually use its argument.
 
-	* tex-mode (tex-mode-syntax-table): ~ is not whitespace.
+	* tex-mode.el (tex-mode-syntax-table): ~ is not whitespace.
 	(tex-guess-mode): Add `renewcommand'.
 	(tex-mode): Move the autoload to get the correct docstring and usage.
 
@@ -6170,7 +6170,7 @@
 
 	Changes from 2002-02-28:
 
-	* antlr-mode: Version 2.2 is released.
+	* antlr-mode.el: Version 2.2 is released.
 
 	* antlr-mode.el (antlr): Moved to SourceForge.net
 
--- a/lisp/calendar/calendar.el	Sat Feb 25 01:07:18 2006 +0000
+++ b/lisp/calendar/calendar.el	Tue Feb 28 17:35:08 2006 +0000
@@ -1190,9 +1190,16 @@
 of `general-holidays', `local-holidays' `christian-holidays',
 `hebrew-holidays', `islamic-holidays', `bahai-holidays',
 `oriental-holidays', or `solar-holidays' to nil in your .emacs file,
-you can eliminate unwanted categories of holidays.  The intention is
-that (in the US) `local-holidays' be set in site-init.el and
-`other-holidays' be set by the user.
+you can eliminate unwanted categories of holidays.
+
+Note that these variables are only used to initialize the default
+value of `calendar-holidays'.  In other words, they only have an
+effect on the displayed holidays if set before the calendar is
+loaded.  After the calendar has been loaded, you must customize
+`calendar-holidays' directly.
+
+The intention is that (in the US) `local-holidays' be set in
+site-init.el and `other-holidays' be set by the user.
 
 Entries on the list are expressions that return (possibly empty) lists of
 items of the form ((month day year) string) of a holiday in the in the
--- a/lisp/emacs-lisp/autoload.el	Sat Feb 25 01:07:18 2006 +0000
+++ b/lisp/emacs-lisp/autoload.el	Tue Feb 28 17:35:08 2006 +0000
@@ -512,7 +512,7 @@
 directory or directories specified."
   (interactive "DUpdate autoloads from directory: ")
   (let* ((files-re (let ((tmp nil))
-		     (dolist (suf load-suffixes
+		     (dolist (suf (get-load-suffixes)
 				  (concat "^[^=.].*" (regexp-opt tmp t) "\\'"))
 		       (unless (string-match "\\.elc" suf) (push suf tmp)))))
 	 (files (apply 'nconc
--- a/lisp/emacs-lisp/find-func.el	Sat Feb 25 01:07:18 2006 +0000
+++ b/lisp/emacs-lisp/find-func.el	Tue Feb 28 17:35:08 2006 +0000
@@ -142,7 +142,7 @@
 
 (defun find-library-suffixes ()
   (let ((suffixes nil))
-    (dolist (suffix load-suffixes (nreverse suffixes))
+    (dolist (suffix (get-load-suffixes) (nreverse suffixes))
       (unless (string-match "elc" suffix) (push suffix suffixes)))))
 
 (defun find-library-name (library)
@@ -153,7 +153,7 @@
       (setq library (replace-match "" t t library)))
   (or (locate-file library
 		   (or find-function-source-path load-path)
-		   (append (find-library-suffixes) '("")))
+		   (append (find-library-suffixes) load-file-rep-suffixes))
       (error "Can't find library %s" library)))
 
 (defvar find-function-C-source-directory
--- a/lisp/files.el	Sat Feb 25 01:07:18 2006 +0000
+++ b/lisp/files.el	Tue Feb 28 17:35:08 2006 +0000
@@ -699,7 +699,7 @@
   (interactive
    (list (completing-read "Load library: "
 			  'locate-file-completion
-			  (cons load-path load-suffixes))))
+			  (cons load-path (get-load-suffixes)))))
   (load library))
 
 (defun file-remote-p (file)
--- a/lisp/gnus/ChangeLog	Sat Feb 25 01:07:18 2006 +0000
+++ b/lisp/gnus/ChangeLog	Tue Feb 28 17:35:08 2006 +0000
@@ -1,3 +1,13 @@
+2006-02-27  Reiner Steib  <Reiner.Steib@gmx.de>
+
+	* gnus-sum.el (gnus-sequence-of-unread-articles): Return nil if
+	first or last are nil.
+
+2006-02-24  Simon Josefsson  <jas@extundo.com>
+
+	* flow-fill.el (fill-flowed): Flow-fill unquoted lines too.
+	Merge of 2005-10-26 change from the trunk.
+
 2006-02-23  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
 	* flow-fill.el (fill-flowed): Bind adaptive-fill-mode to nil.
@@ -863,10 +873,9 @@
 	* pgg-parse.el (top-level): Don't require custom, it is
 	autoloaded.  (To sync with No Gnus.)
 
-2005-05-09  Simon Josefsson  <jas@extundo.com>
-
-	* pgg-gpg.el (pgg-gpg-possibly-cache-passphrase): Fix PIN caching,
-	tiny patch from "Georg C. F. Greve" <greve@gnu.org>.
+2005-05-09  Georg C. F. Greve  <greve@gnu.org>  (tiny change)
+
+	* pgg-gpg.el (pgg-gpg-possibly-cache-passphrase): Fix PIN caching.
 
 2005-10-08  Simon Josefsson  <jas@extundo.com>
 
@@ -2571,11 +2580,13 @@
 
 	* deuglify.el (gnus-outlook-deuglify): Add :version.
 
-	* html2text.el: Beautify code.  Improve doc strings.  Some checkdoc
-	cleanup.
+	* html2text.el: Beautify code.  Improve doc strings.  Some
+	checkdoc cleanup.
 	(html2text-get-attr, html2text-fix-paragraph): Simplify code.
-	(html2text-format-tag-list): Add "strong" and "em".
-	From "Alfred M. Szmidt" <ams@kemisten.nu> (tiny change).
+
+2004-11-01  Alfred M. Szmidt  <ams@kemisten.nu>  (tiny change)
+
+	* html2text.el (html2text-format-tag-list): Add "strong" and "em".
 
 2004-10-29  Katsumi Yamaoka  <yamaoka@jpl.org>
 
@@ -3436,14 +3447,13 @@
 	Check `starttls-use-gnutls' and pass on to corresponding *-gnutls
 	function if it is set.
 
-2004-08-31  Simon Josefsson  <jas@extundo.com>
+2004-08-30  Andreas Schwab  <schwab@suse.de>
 
 	* rfc2231.el (rfc2231-parse-string): Restore whitespace syntax for
-	?* and ?\; (tiny patch).  From Andreas Schwab <schwab@suse.de>.
+	?* and ?\;.
 
 	* ietf-drums.el (ietf-drums-syntax-table): Set syntax of ?* ?\;
-	and ?\' to symbol instead of whitespace (tiny patch).
-	From Andreas Schwab <schwab@suse.de>.
+	and ?\' to symbol instead of whitespace.
 
 2004-08-31  Jesper Harder  <harder@ifa.au.dk>
 
--- a/lisp/gnus/flow-fill.el	Sat Feb 25 01:07:18 2006 +0000
+++ b/lisp/gnus/flow-fill.el	Tue Feb 28 17:35:08 2006 +0000
@@ -121,7 +121,7 @@
     (while (re-search-forward " $" nil t)
       (when (save-excursion
 	      (beginning-of-line)
-	      (looking-at "^\\(>+\\)\\( ?\\)"))
+	      (looking-at "^\\(>*\\)\\( ?\\)"))
 	(let ((quote (match-string 1))
 	      sig)
 	  (if (string= quote "")
--- a/lisp/gnus/gnus-sum.el	Sat Feb 25 01:07:18 2006 +0000
+++ b/lisp/gnus/gnus-sum.el	Tue Feb 28 17:35:08 2006 +0000
@@ -6452,10 +6452,12 @@
 	  (setq nlast (if (atom (cadr read)) (cadr read) (caadr read)))
 	  (setq read (cdr read)))))
     ;; And add the last unread articles.
-    (cond ((< first last)
-           (push (cons first last) unread))
-          ((= first last)
-           (push first unread)))
+    (cond ((not (and first last))
+	   nil)
+	  ((< first last)
+	   (push (cons first last) unread))
+	  ((= first last)
+	   (push first unread)))
     ;; Return the sequence of unread articles.
     (delq 0 (nreverse unread))))
 
--- a/lisp/ido.el	Sat Feb 25 01:07:18 2006 +0000
+++ b/lisp/ido.el	Tue Feb 28 17:35:08 2006 +0000
@@ -1181,25 +1181,19 @@
 (defun ido-save-history ()
   "Save ido history and cache information between sessions."
   (interactive)
-  (if (and ido-last-directory-list ido-save-directory-list-file)
-      (save-excursion
-	(save-window-excursion
-	  (if (find-buffer-visiting ido-save-directory-list-file)
-	      (kill-buffer (find-buffer-visiting ido-save-directory-list-file)))
-	  (if (file-exists-p ido-save-directory-list-file)
-	      (delete-file ido-save-directory-list-file))
-	  (set-buffer (let ((enable-local-variables nil))
-			(find-file-noselect ido-save-directory-list-file t)))
-	  (goto-char (point-min))
-	  (delete-region (point-min) (point-max))
-	  (ido-pp 'ido-last-directory-list)
-	  (ido-pp 'ido-work-directory-list)
-	  (ido-pp 'ido-work-file-list)
-	  (ido-pp 'ido-dir-file-cache "\n\n ")
-	  (insert "\n")
-	  (let ((version-control 'never))
+  (when (and ido-last-directory-list ido-save-directory-list-file)
+    (let ((buf (get-buffer-create " *ido session*"))
+	  (version-control 'never))
+      (unwind-protect
+	  (with-current-buffer buf
+	    (erase-buffer)
+	    (ido-pp 'ido-last-directory-list)
+	    (ido-pp 'ido-work-directory-list)
+	    (ido-pp 'ido-work-file-list)
+	    (ido-pp 'ido-dir-file-cache "\n\n ")
+	    (insert "\n")
 	    (write-file ido-save-directory-list-file nil))
-	  (kill-buffer (current-buffer))))))
+	(kill-buffer buf)))))
 
 (defun ido-load-history (&optional arg)
   "Load ido history and cache information from previous session.
@@ -1209,18 +1203,18 @@
       (let ((file (expand-file-name ido-save-directory-list-file))
 	    buf)
 	(when (file-readable-p file)
-	  (save-excursion
-	    (save-window-excursion
-	      (setq buf (set-buffer (let ((enable-local-variables nil))
-				      (find-file-noselect file))))
-	      (goto-char (point-min))
-	      (condition-case nil
-		  (setq ido-last-directory-list (read (current-buffer))
-			ido-work-directory-list (read (current-buffer))
-			ido-work-file-list (read (current-buffer))
-			ido-dir-file-cache (read (current-buffer)))
-		(error nil))))
-	  (kill-buffer buf))))
+	  (setq buf (get-buffer-create " *ido session*"))
+	  (unwind-protect
+	      (with-current-buffer buf
+		(erase-buffer)
+		(insert-file-contents file)
+		(condition-case nil
+		    (setq ido-last-directory-list (read (current-buffer))
+			  ido-work-directory-list (read (current-buffer))
+			  ido-work-file-list (read (current-buffer))
+			  ido-dir-file-cache (read (current-buffer)))
+		  (error nil)))
+	    (kill-buffer buf)))))
   (ido-wash-history))
 
 (defun ido-wash-history ()
--- a/lisp/jka-cmpr-hook.el	Sat Feb 25 01:07:18 2006 +0000
+++ b/lisp/jka-cmpr-hook.el	Tue Feb 28 17:35:08 2006 +0000
@@ -26,7 +26,7 @@
 
 ;;; Commentary:
 
-;; This file contains the  code to enable and disable Auto-Compression mode.
+;; This file contains the code to enable and disable Auto-Compression mode.
 ;; It is preloaded.  The guts of this mode are in jka-compr.el, which
 ;; is loaded only when you really try to uncompress something.
 
@@ -40,6 +40,143 @@
   "jka-compr customization."
   :group 'compression)
 
+;; List of all the elements we actually added to file-coding-system-alist.
+(defvar jka-compr-added-to-file-coding-system-alist nil)
+
+(defvar jka-compr-file-name-handler-entry
+  nil
+  "`file-name-handler-alist' entry used by jka-compr I/O functions.")
+
+;; Compiler defvars.  These three variables will be defined later with
+;; `defcustom' when everything used in the :set functions is defined.
+(defvar jka-compr-compression-info-list)
+(defvar jka-compr-mode-alist-additions)
+(defvar jka-compr-load-suffixes)
+
+(defvar jka-compr-compression-info-list--internal nil
+  "Stored value of `jka-compr-compression-info-list'.
+If Auto Compression mode is enabled, this is the value of
+`jka-compr-compression-info-list' when `jka-compr-install' was last called.
+Otherwise, it is nil.")
+
+(defvar jka-compr-mode-alist-additions--internal nil
+  "Stored value of `jka-compr-mode-alist-additions'.
+If Auto Compression mode is enabled, this is the value of
+`jka-compr-mode-alist-additions' when `jka-compr-install' was last called.
+Otherwise, it is nil.")
+
+(defvar jka-compr-load-suffixes--internal nil
+  "Stored value of `jka-compr-load-suffixes'.
+If Auto Compression mode is enabled, this is the value of
+`jka-compr-load-suffixes' when `jka-compr-install' was last called.
+Otherwise, it is nil.")
+
+
+(defun jka-compr-build-file-regexp ()
+  (mapconcat
+   'jka-compr-info-regexp
+   jka-compr-compression-info-list
+   "\\|"))
+
+;; Functions for accessing the return value of jka-compr-get-compression-info
+(defun jka-compr-info-regexp               (info)  (aref info 0))
+(defun jka-compr-info-compress-message     (info)  (aref info 1))
+(defun jka-compr-info-compress-program     (info)  (aref info 2))
+(defun jka-compr-info-compress-args        (info)  (aref info 3))
+(defun jka-compr-info-uncompress-message   (info)  (aref info 4))
+(defun jka-compr-info-uncompress-program   (info)  (aref info 5))
+(defun jka-compr-info-uncompress-args      (info)  (aref info 6))
+(defun jka-compr-info-can-append           (info)  (aref info 7))
+(defun jka-compr-info-strip-extension      (info)  (aref info 8))
+(defun jka-compr-info-file-magic-bytes     (info)  (aref info 9))
+
+
+(defun jka-compr-get-compression-info (filename)
+  "Return information about the compression scheme of FILENAME.
+The determination as to which compression scheme, if any, to use is
+based on the filename itself and `jka-compr-compression-info-list'."
+  (catch 'compression-info
+    (let ((case-fold-search nil))
+      (mapcar
+       (function (lambda (x)
+		   (and (string-match (jka-compr-info-regexp x) filename)
+			(throw 'compression-info x))))
+       jka-compr-compression-info-list)
+      nil)))
+
+(defun jka-compr-install ()
+  "Install jka-compr.
+This adds entries to `file-name-handler-alist' and `auto-mode-alist'
+and `inhibit-first-line-modes-suffixes'."
+
+  (setq jka-compr-file-name-handler-entry
+	(cons (jka-compr-build-file-regexp) 'jka-compr-handler))
+
+  (push jka-compr-file-name-handler-entry file-name-handler-alist)
+
+  (setq jka-compr-compression-info-list--internal
+	jka-compr-compression-info-list
+	jka-compr-mode-alist-additions--internal
+	jka-compr-mode-alist-additions
+	jka-compr-load-suffixes--internal
+	jka-compr-load-suffixes)
+
+  (dolist (x jka-compr-compression-info-list)
+    ;; Don't do multibyte encoding on the compressed files.
+    (let ((elt (cons (jka-compr-info-regexp x)
+                     '(no-conversion . no-conversion))))
+      (push elt file-coding-system-alist)
+      (push elt jka-compr-added-to-file-coding-system-alist))
+
+    (and (jka-compr-info-strip-extension x)
+         ;; Make entries in auto-mode-alist so that modes
+         ;; are chosen right according to the file names
+         ;; sans `.gz'.
+         (push (list (jka-compr-info-regexp x) nil 'jka-compr) auto-mode-alist)
+         ;; Also add these regexps to
+         ;; inhibit-first-line-modes-suffixes, so that a
+         ;; -*- line in the first file of a compressed tar
+         ;; file doesn't override tar-mode.
+         (push (jka-compr-info-regexp x)
+               inhibit-first-line-modes-suffixes)))
+  (setq auto-mode-alist
+	(append auto-mode-alist jka-compr-mode-alist-additions))
+
+  ;; Make sure that (load "foo") will find /bla/foo.el.gz.
+  (setq load-file-rep-suffixes
+	(append load-file-rep-suffixes jka-compr-load-suffixes nil)))
+
+(defun jka-compr-installed-p ()
+  "Return non-nil if jka-compr is installed.
+The return value is the entry in `file-name-handler-alist' for jka-compr."
+
+  (let ((fnha file-name-handler-alist)
+	(installed nil))
+
+    (while (and fnha (not installed))
+     (and (eq (cdr (car fnha)) 'jka-compr-handler)
+	   (setq installed (car fnha)))
+      (setq fnha (cdr fnha)))
+
+    installed))
+
+(defun jka-compr-update ()
+  "Update Auto Compression mode for changes in option values.
+If you change the options `jka-compr-compression-info-list',
+`jka-compr-mode-alist-additions' or `jka-compr-load-suffixes'
+outside Custom, while Auto Compression mode is already enabled
+\(as it is by default), then you have to call this function
+afterward to properly update other variables.  Setting these
+options through Custom does this automatically."
+  (when (jka-compr-installed-p)
+    (jka-compr-uninstall)
+    (jka-compr-install)))
+
+(defun jka-compr-set (variable value)
+  "Internal Custom :set function."
+  (set-default variable value)
+  (jka-compr-update))
+
 ;; I have this defined so that .Z files are assumed to be in unix
 ;; compress format; and .gz files, in gzip format, and .bz2 files in bzip fmt.
 (defcustom jka-compr-compression-info-list
@@ -113,7 +250,12 @@
 
 Because of the way `call-process' is defined, discarding the stderr output of
 a program adds the overhead of starting a shell each time the program is
-invoked."
+invoked.
+
+If you set this outside Custom while Auto Compression mode is
+already enabled \(as it is by default), you have to call
+`jka-compr-update' after setting it to properly update other
+variables.  Setting this through Custom does that automatically."
   :type '(repeat (vector regexp
 			 (choice :tag "Compress Message"
 				 (string :format "%v")
@@ -132,118 +274,41 @@
 			 (boolean :tag "Append")
 			 (boolean :tag "Strip Extension")
 			 (string :tag "Magic Bytes")))
+  :set 'jka-compr-set
   :group 'jka-compr)
 
 (defcustom jka-compr-mode-alist-additions
   (list (cons "\\.tgz\\'" 'tar-mode) (cons "\\.tbz\\'" 'tar-mode))
-  "A list of pairs to add to `auto-mode-alist' when jka-compr is installed."
+  "List of pairs added to `auto-mode-alist' when installing jka-compr.
+Uninstalling jka-compr removes all pairs from `auto-mode-alist' that
+installing added.
+
+If you set this outside Custom while Auto Compression mode is
+already enabled \(as it is by default), you have to call
+`jka-compr-update' after setting it to properly update other
+variables.  Setting this through Custom does that automatically."
   :type '(repeat (cons string symbol))
+  :set 'jka-compr-set
   :group 'jka-compr)
 
 (defcustom jka-compr-load-suffixes '(".gz")
-  "List of suffixes to try when loading files."
-  :type '(repeat string)
-  :group 'jka-compr)
-
-;; List of all the elements we actually added to file-coding-system-alist.
-(defvar jka-compr-added-to-file-coding-system-alist nil)
-
-(defvar jka-compr-file-name-handler-entry
-  nil
-  "The entry in `file-name-handler-alist' used by the jka-compr I/O functions.")
-
-(defun jka-compr-build-file-regexp ()
-  (mapconcat
-   'jka-compr-info-regexp
-   jka-compr-compression-info-list
-   "\\|"))
-
-;; Functions for accessing the return value of jka-compr-get-compression-info
-(defun jka-compr-info-regexp               (info)  (aref info 0))
-(defun jka-compr-info-compress-message     (info)  (aref info 1))
-(defun jka-compr-info-compress-program     (info)  (aref info 2))
-(defun jka-compr-info-compress-args        (info)  (aref info 3))
-(defun jka-compr-info-uncompress-message   (info)  (aref info 4))
-(defun jka-compr-info-uncompress-program   (info)  (aref info 5))
-(defun jka-compr-info-uncompress-args      (info)  (aref info 6))
-(defun jka-compr-info-can-append           (info)  (aref info 7))
-(defun jka-compr-info-strip-extension      (info)  (aref info 8))
-(defun jka-compr-info-file-magic-bytes     (info)  (aref info 9))
-
-
-(defun jka-compr-get-compression-info (filename)
-  "Return information about the compression scheme of FILENAME.
-The determination as to which compression scheme, if any, to use is
-based on the filename itself and `jka-compr-compression-info-list'."
-  (catch 'compression-info
-    (let ((case-fold-search nil))
-      (mapcar
-       (function (lambda (x)
-		   (and (string-match (jka-compr-info-regexp x) filename)
-			(throw 'compression-info x))))
-       jka-compr-compression-info-list)
-      nil)))
-
-(defun jka-compr-install ()
-  "Install jka-compr.
-This adds entries to `file-name-handler-alist' and `auto-mode-alist'
-and `inhibit-first-line-modes-suffixes'."
+  "List of compression related suffixes to try when loading files.
+Enabling Auto Compression mode appends this list to `load-file-rep-suffixes',
+which see.  Disabling Auto Compression mode removes all suffixes
+from `load-file-rep-suffixes' that enabling added.
 
-  (setq jka-compr-file-name-handler-entry
-	(cons (jka-compr-build-file-regexp) 'jka-compr-handler))
-
-  (push jka-compr-file-name-handler-entry file-name-handler-alist)
-
-  (dolist (x jka-compr-compression-info-list)
-    ;; Don't do multibyte encoding on the compressed files.
-    (let ((elt (cons (jka-compr-info-regexp x)
-                     '(no-conversion . no-conversion))))
-      (push elt file-coding-system-alist)
-      (push elt jka-compr-added-to-file-coding-system-alist))
-
-    (and (jka-compr-info-strip-extension x)
-         ;; Make entries in auto-mode-alist so that modes
-         ;; are chosen right according to the file names
-         ;; sans `.gz'.
-         (push (list (jka-compr-info-regexp x) nil 'jka-compr) auto-mode-alist)
-         ;; Also add these regexps to
-         ;; inhibit-first-line-modes-suffixes, so that a
-         ;; -*- line in the first file of a compressed tar
-         ;; file doesn't override tar-mode.
-         (push (jka-compr-info-regexp x)
-               inhibit-first-line-modes-suffixes)))
-  (setq auto-mode-alist
-	(append auto-mode-alist jka-compr-mode-alist-additions))
-
-  ;; Make sure that (load "foo") will find /bla/foo.el.gz.
-  (setq load-suffixes
-	(apply 'append
-	       (append (mapcar (lambda (suffix)
-                               (cons suffix
-                                     (mapcar (lambda (ext) (concat suffix ext))
-                                             jka-compr-load-suffixes)))
-                             load-suffixes)
-                       (list jka-compr-load-suffixes)))))
-
-
-(defun jka-compr-installed-p ()
-  "Return non-nil if jka-compr is installed.
-The return value is the entry in `file-name-handler-alist' for jka-compr."
-
-  (let ((fnha file-name-handler-alist)
-	(installed nil))
-
-    (while (and fnha (not installed))
-     (and (eq (cdr (car fnha)) 'jka-compr-handler)
-	   (setq installed (car fnha)))
-      (setq fnha (cdr fnha)))
-
-    installed))
+If you set this outside Custom while Auto Compression mode is
+already enabled \(as it is by default), you have to call
+`jka-compr-update' after setting it to properly update other
+variables.  Setting this through Custom does that automatically."
+  :type '(repeat string)
+  :set 'jka-compr-set
+  :group 'jka-compr)
 
 (define-minor-mode auto-compression-mode
   "Toggle automatic file compression and uncompression.
 With prefix argument ARG, turn auto compression on if positive, else off.
-Returns the new status of auto compression (non-nil means on)."
+Return the new status of auto compression (non-nil means on)."
   :global t :init-value t :group 'jka-compr :version "22.1"
   (let* ((installed (jka-compr-installed-p))
 	 (flag auto-compression-mode))
--- a/lisp/jka-compr.el	Sat Feb 25 01:07:18 2006 +0000
+++ b/lisp/jka-compr.el	Tue Feb 28 17:35:08 2006 +0000
@@ -662,13 +662,13 @@
 by `jka-compr-installed'."
   ;; Delete from inhibit-first-line-modes-suffixes
   ;; what jka-compr-install added.
-  (mapcar
+  (mapc
      (function (lambda (x)
 		 (and (jka-compr-info-strip-extension x)
 		      (setq inhibit-first-line-modes-suffixes
 			    (delete (jka-compr-info-regexp x)
 				    inhibit-first-line-modes-suffixes)))))
-     jka-compr-compression-info-list)
+     jka-compr-compression-info-list--internal)
 
   (let* ((fnha (cons nil file-name-handler-alist))
 	 (last fnha))
@@ -686,7 +686,7 @@
 
     (while (cdr last)
       (setq entry (car (cdr last)))
-      (if (or (member entry jka-compr-mode-alist-additions)
+      (if (or (member entry jka-compr-mode-alist-additions--internal)
 	      (and (consp (cdr entry))
 		   (eq (nth 2 entry) 'jka-compr)))
 	  (setcdr last (cdr (cdr last)))
@@ -701,12 +701,12 @@
                 file-coding-system-alist)))
 
   ;; Remove the suffixes that were added by jka-compr.
-  (let ((suffixes nil)
-	(re (jka-compr-build-file-regexp)))
-    (dolist (suffix load-suffixes)
-      (unless (string-match re suffix)
-	(push suffix suffixes)))
-    (setq load-suffixes (nreverse suffixes))))
+  (dolist (suff jka-compr-load-suffixes--internal)
+    (setq load-file-rep-suffixes (delete suff load-file-rep-suffixes)))
+
+  (setq jka-compr-compression-info-list--internal nil
+	jka-compr-mode-alist-additions--internal nil
+	jka-compr-load-suffixes--internal nil))
 
 (provide 'jka-compr)
 
--- a/lisp/loadhist.el	Sat Feb 25 01:07:18 2006 +0000
+++ b/lisp/loadhist.el	Tue Feb 28 17:35:08 2006 +0000
@@ -60,8 +60,8 @@
   (let ((symbols (assoc file load-history)))
     ;; Try converting a library name to an absolute file name.
     (and (null symbols)
-	 (let ((absname 
-		(locate-file file load-path load-suffixes)))
+	 (let ((absname
+		(locate-file file load-path (get-load-suffixes))))
 	   (and absname (not (equal absname file))
 		(setq symbols (cdr (assoc absname load-history))))))
     symbols))
--- a/lisp/mh-e/ChangeLog	Sat Feb 25 01:07:18 2006 +0000
+++ b/lisp/mh-e/ChangeLog	Tue Feb 28 17:35:08 2006 +0000
@@ -1,3 +1,20 @@
+2006-02-27  Bill Wohler  <wohler@newt.com>
+
+	* mh-e.el (mh-default-folder-for-message-function): Sync docstring
+	with manual.
+
+	* mh-mime.el (mh-minibuffer-read-type): Deleted comment in
+	docstring about obsolete variable mh-mime-content-types.
+
+	* mh-e.el (mh-variant): Sync docstring with manual.
+	(cus-face): Require as it is needed by mh-inherit-face-flag.
+
+	* mh-compat.el (mh-display-color-cells): Return 2 if
+	device-color-cells returns nil (closes SF #1436924).
+
+	* mh-e.el (mh-compiling-flag): Delete. No longer needed by
+	mh-display-color-cells.
+
 2006-02-21  Eric Ding  <ericding@alum.mit.edu>
 
 	* mh-e.el (mh-invisible-header-fields-internal): Added entry
--- a/lisp/mh-e/mh-compat.el	Sat Feb 25 01:07:18 2006 +0000
+++ b/lisp/mh-e/mh-compat.el	Tue Feb 28 17:35:08 2006 +0000
@@ -79,11 +79,11 @@
 
 (mh-defun-compat mh-display-color-cells display-color-cells (&optional display)
   "Return the number of color cells supported by DISPLAY.
-This function is used by XEmacs to always return 0 when compiling
-to avoid compiling errors. Otherwise uses `device-color-cells'."
-  (if mh-compiling-flag
-      0
-    (device-color-cells display)))
+This function is used by XEmacs to return 2 when
+`device-color-cells' returns nil. This happens when compiling or
+running on a tty and causes errors since `display-color-cells' is
+expected to return an integer."
+  (or (device-color-cells display) 2))
 
 (defmacro mh-display-completion-list (completions &optional common-substring)
   "Display the list of COMPLETIONS.
--- a/lisp/mh-e/mh-e.el	Sat Feb 25 01:07:18 2006 +0000
+++ b/lisp/mh-e/mh-e.el	Tue Feb 28 17:35:08 2006 +0000
@@ -101,12 +101,7 @@
 
 (eval-and-compile
   (defvar mh-xemacs-flag (featurep 'xemacs)
-    "Non-nil means the current Emacs is XEmacs.")
-  (defvar mh-compiling-flag nil
-    "Non-nil means we're compiling."))
-
-(eval-when (compile)
-  (setq mh-compiling-flag t))
+    "Non-nil means the current Emacs is XEmacs."))
 
 (mh-do-in-xemacs
   (require 'mh-xemacs))
@@ -869,14 +864,18 @@
 that MH-E will automatically choose the first of nmh, MH, or GNU
 mailutils that it finds in the directories listed in
 `mh-path' (which you can customize), `mh-sys-path', and
-`exec-path'. If, for example, you have both nmh and mailutils
-installed and `mh-variant-in-use' was initialized to nmh but you
-want to use mailutils, then you can set this option to
-\"mailutils\".
+`exec-path'. If MH-E can't find MH at all, you may have to
+customize `mh-path' and add the directory in which the command
+\"mhparam\" is located. If, on the other hand, you have both nmh
+and mailutils installed (for example) and `mh-variant-in-use' was
+initialized to nmh but you want to use mailutils, then you can
+set this option to \"mailutils\".
 
 When this variable is changed, MH-E resets `mh-progs', `mh-lib',
 `mh-lib-progs', `mh-flists-present-flag', and `mh-variant-in-use'
-accordingly."
+accordingly. Prior to version 8, it was often necessary to set
+some of these variables in \"~/.emacs\"; now it is no longer
+necessary and can actually cause problems."
   :type `(radio
           (const :tag "Auto-detect" autodetect)
           ,@(mapcar (lambda (x) `(const ,(car x))) (mh-variants)))
@@ -1241,11 +1240,11 @@
 (defcustom mh-default-folder-for-message-function nil
   "Function to select a default folder for refiling or \"Fcc:\".
 
-The current buffer is set to the message being refiled with point
-at the start of the message. This function should return the
-default folder as a string with a leading \"+\" sign. It can also
-return nil so that the last folder name is used as the default,
-or an empty string to suppress the default entirely."
+When this function is called, the current buffer contains the message
+being refiled and point is at the start of the message. This function
+should return the default folder as a string with a leading \"+\"
+sign. It can also return nil so that the last folder name is used as
+the default, or an empty string to suppress the default entirely."
   :type 'function
   :group 'mh-folder-selection)
 
@@ -2994,6 +2993,8 @@
                 (setq new-spec (cons entry new-spec)))))
       new-spec)))
 
+(require 'cus-face)
+
 (defvar mh-inherit-face-flag (assq :inherit custom-face-attributes)
   "Non-nil means that the `defface' :inherit keyword is available.
 The :inherit keyword is available on all supported versions of
--- a/lisp/mh-e/mh-mime.el	Sat Feb 25 01:07:18 2006 +0000
+++ b/lisp/mh-e/mh-mime.el	Tue Feb 28 17:35:08 2006 +0000
@@ -1689,8 +1689,7 @@
   "Return the content type associated with the given FILENAME.
 If the \"file\" command exists and recognizes the given file,
 then its value is returned\; otherwise, the user is prompted for
-a type (see `mailcap-mime-types' and for Emacs 20,
-`mh-mime-content-types').
+a type (see `mailcap-mime-types').
 Optional argument DEFAULT is returned if a type isn't entered."
   (mailcap-parse-mimetypes)
   (let* ((default (or default
--- a/lisp/progmodes/cc-align.el	Sat Feb 25 01:07:18 2006 +0000
+++ b/lisp/progmodes/cc-align.el	Tue Feb 28 17:35:08 2006 +0000
@@ -1,7 +1,7 @@
 ;;; cc-align.el --- custom indentation functions for CC Mode
 
-;; Copyright (C) 1985,1987,1992-2003, 2004, 2005, 2006
-;; Free Software Foundation, Inc.
+;; Copyright (C) 1985,1987,1992-2003, 2004, 2005, 2006 Free Software
+;; Foundation, Inc.
 
 ;; Authors:    1998- Martin Stjernholm
 ;;             1992-1999 Barry A. Warsaw
--- a/lisp/progmodes/cc-awk.el	Sat Feb 25 01:07:18 2006 +0000
+++ b/lisp/progmodes/cc-awk.el	Tue Feb 28 17:35:08 2006 +0000
@@ -1,7 +1,7 @@
 ;;; cc-awk.el --- AWK specific code within cc-mode.
 
-;; Copyright (C) 1988,94,96,2000, 2001, 2002, 2003, 2004, 2005, 2006
-;; Free Software Foundation, Inc.
+;; Copyright (C) 1988,94,96,2000, 2001, 2002, 2003, 2004, 2005, 2006 Free
+;; Software Foundation, Inc.
 
 ;; Author: Alan Mackenzie <acm@muc.de> (originally based on awk-mode.el)
 ;; Maintainer: FSF
@@ -804,7 +804,7 @@
 (defun c-awk-end-of-change-region (beg end old-len)
   ;; Find the end of the region which needs to be font-locked after a change.
   ;; This is the end of the logical line on which the change happened, either
-  ;; as it was before the change, or as it is now, which ever is later.
+  ;; as it was before the change, or as it is now, whichever is later.
   ;; N.B. point is left undefined.
   ;;
   ;; This function might do hidden buffer changes.
@@ -822,11 +822,12 @@
   (unless (and (boundp 'font-lock-mode) font-lock-mode)
     (save-restriction
       (save-excursion
-        (setq end (c-awk-end-of-change-region beg end old-len))
-        (c-awk-beginning-of-logical-line beg)
-        (c-save-buffer-state nil ; So that read-only status isn't affected.
+	(save-match-data
+	  (setq end (c-awk-end-of-change-region beg end old-len))
+	  (c-awk-beginning-of-logical-line beg)
+	  (c-save-buffer-state nil  ; So that read-only status isn't affected.
                                         ; (e.g. when first loading the buffer)
-          (c-awk-set-syntax-table-properties end))))))
+	    (c-awk-set-syntax-table-properties end)))))))
 
 ;; ACM 2002/5/25.  When font-locking is invoked by a buffer change, the region
 ;; specified by the font-lock after-change function must be expanded to
--- a/lisp/progmodes/cc-bytecomp.el	Sat Feb 25 01:07:18 2006 +0000
+++ b/lisp/progmodes/cc-bytecomp.el	Tue Feb 28 17:35:08 2006 +0000
@@ -1,7 +1,7 @@
 ;;; cc-bytecomp.el --- compile time setup for proper compilation
 
-;; Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006
-;; Free Software Foundation, Inc.
+;; Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software
+;; Foundation, Inc.
 
 ;; Author:     Martin Stjernholm
 ;; Maintainer: bug-cc-mode@gnu.org
--- a/lisp/progmodes/cc-cmds.el	Sat Feb 25 01:07:18 2006 +0000
+++ b/lisp/progmodes/cc-cmds.el	Tue Feb 28 17:35:08 2006 +0000
@@ -1,7 +1,7 @@
 ;;; cc-cmds.el --- user level commands for CC Mode
 
-;; Copyright (C) 1985,1987,1992-2003, 2004, 2005, 2006
-;; Free Software Foundation, Inc.
+;; Copyright (C) 1985, 1987, 1992-2003, 2004, 2005, 2006 Free Software
+;; Foundation, Inc.
 
 ;; Authors:    1998- Martin Stjernholm
 ;;             1992-1999 Barry A. Warsaw
@@ -262,10 +262,17 @@
 			  (boundp 'c-subword-mode)
 			  (symbol-value 'c-subword-mode))
 			 "w"
-		       ""))))
-    (setq c-submode-indicators
+		       "")))
+	(bare-mode-name (if (string-match "\\(^[^/]*\\)/" mode-name)
+			    (substring mode-name (match-beginning 1) (match-end 1))
+			  mode-name)))
+;;     (setq c-submode-indicators
+;; 	  (if (> (length fmt) 1)
+;; 	      fmt))
+    (setq mode-name
 	  (if (> (length fmt) 1)
-	      fmt))
+	      (concat bare-mode-name fmt) 
+	bare-mode-name))
     (force-mode-line-update)))
 
 (defun c-toggle-syntactic-indentation (&optional arg)
@@ -365,9 +372,9 @@
 	    arg
 	    (c-in-literal)))
       (funcall c-backspace-function (prefix-numeric-value arg))
-    (c-hungry-backspace)))
-
-(defun c-hungry-backspace ()
+    (c-hungry-delete-backwards)))
+
+(defun c-hungry-delete-backwards ()
   "Delete the preceding character or all preceding whitespace
 back to the previous non-whitespace character.
 See also \\[c-hungry-delete-forward]."
@@ -378,6 +385,8 @@
 	(delete-region (point) here)
       (funcall c-backspace-function 1))))
 
+(defalias 'c-hungry-backspace 'c-hungry-delete-backwards)
+
 (defun c-electric-delete-forward (arg)
   "Delete the following character or whitespace.
 If `c-hungry-delete-key' is non-nil (indicated by \"/h\" on the mode
@@ -396,7 +405,7 @@
 (defun c-hungry-delete-forward ()
   "Delete the following character or all following whitespace
 up to the next non-whitespace character.
-See also \\[c-hungry-backspace]."
+See also \\[c-hungry-delete-backwards]."
   (interactive)
   (let ((here (point)))
     (c-skip-ws-forward)
@@ -436,7 +445,7 @@
   (if (and (fboundp 'delete-forward-p)
 	   (delete-forward-p))
       (c-hungry-delete-forward)
-    (c-hungry-backspace)))
+    (c-hungry-delete-backwards)))
 
 (defun c-electric-pound (arg)
   "Insert a \"#\".
@@ -648,7 +657,7 @@
 numeric ARG hasn't been supplied, the command performs several electric
 actions:
 
-\(a) If the auto-newline feature is turned on (indicated by \"/ln\" on
+\(a) If the auto-newline feature is turned on (indicated by \"/la\" on
 the mode line) newlines are inserted before and after the brace as
 directed by the settings in `c-hanging-braces-alist'.
 
@@ -752,7 +761,7 @@
 				"{"
 				"\\=")
 			nil t))
-		  (delete-region mbeg mend)
+		  (delete-region (match-beginning 0) (match-end 0))
 		  (insert-and-inherit "} else {"))
 		 ((and (memq 'brace-elseif-brace c-cleanup-list)
 		       (progn
@@ -886,7 +895,7 @@
 numeric ARG hasn't been supplied, the command performs several electric
 actions:
 
-\(a) When the auto-newline feature is turned on (indicated by \"/ln\" on
+\(a) When the auto-newline feature is turned on (indicated by \"/la\" on
 the mode line) a newline might be inserted.  See the variable
 `c-hanging-semi&comma-criteria' for how newline insertion is determined.
 
@@ -958,7 +967,7 @@
 numeric ARG hasn't been supplied, the command performs several electric
 actions:
 
-\(a) If the auto-newline feature is turned on (indicated by \"/ln\" on
+\(a) If the auto-newline feature is turned on (indicated by \"/la\" on
 the mode line) newlines are inserted before and after the colon based on
 the settings in `c-hanging-colons-alist'.
 
--- a/lisp/progmodes/cc-compat.el	Sat Feb 25 01:07:18 2006 +0000
+++ b/lisp/progmodes/cc-compat.el	Tue Feb 28 17:35:08 2006 +0000
@@ -1,7 +1,7 @@
 ;;; cc-compat.el --- cc-mode compatibility with c-mode.el confusion
 
-;; Copyright (C) 1985,1987,1992-2003, 2004, 2005, 2006
-;; Free Software Foundation, Inc.
+;; Copyright (C) 1985,1987,1992-2003, 2004, 2005, 2006 Free Software
+;; Foundation, Inc.
 
 ;; Authors:    1998- Martin Stjernholm
 ;;	       1994-1999 Barry A. Warsaw
--- a/lisp/progmodes/cc-defs.el	Sat Feb 25 01:07:18 2006 +0000
+++ b/lisp/progmodes/cc-defs.el	Tue Feb 28 17:35:08 2006 +0000
@@ -1,7 +1,7 @@
 ;;; cc-defs.el --- compile time definitions for CC Mode
 
-;; Copyright (C) 1985,1987,1992-2003, 2004, 2005, 2006
-;; Free Software Foundation, Inc.
+;; Copyright (C) 1985,1987,1992-2003, 2004, 2005, 2006 Free Software
+;; Foundation, Inc.
 
 ;; Authors:    1998- Martin Stjernholm
 ;;             1992-1999 Barry A. Warsaw
@@ -71,10 +71,10 @@
 
 (eval-after-load "font-lock"
   '(if (and (not (featurep 'cc-fix)) ; only load the file once.
+	    (featurep 'xemacs) ; There is now (2005/12) code in GNU Emacs CVS
+			       ; to make the call to f-l-c-k throw an error.
             (let (font-lock-keywords)
-              (condition-case nil
-		  (font-lock-compile-keywords '("\\<\\>"))
-		(error nil))
+              (font-lock-compile-keywords '("\\<\\>"))
 	      font-lock-keywords))     ; did the previous call foul this up?
        (load "cc-fix")))
 
@@ -82,19 +82,18 @@
 ;; to ensure correct byte compilation.
 (eval-when-compile
   (if (and (not (featurep 'cc-fix))
+	   (featurep 'xemacs)
 	   (progn
 	     (require 'font-lock)
 	     (let (font-lock-keywords)
-	       (condition-case nil
-		   (font-lock-compile-keywords '("\\<\\>"))
-		 (error nil))
+	       (font-lock-compile-keywords '("\\<\\>"))
 	       font-lock-keywords)))
       (cc-load "cc-fix")))
 
 
 ;;; Variables also used at compile time.
 
-(defconst c-version "5.31"
+(defconst c-version "5.31.3"
   "CC Mode version number.")
 
 (defconst c-version-sym (intern c-version))
@@ -2041,5 +2040,5 @@
 
 (cc-provide 'cc-defs)
 
-;; arch-tag: 3bb2629d-dd84-4ff0-ad39-584be0fe3cda
+;;; arch-tag: 3bb2629d-dd84-4ff0-ad39-584be0fe3cda
 ;;; cc-defs.el ends here
--- a/lisp/progmodes/cc-engine.el	Sat Feb 25 01:07:18 2006 +0000
+++ b/lisp/progmodes/cc-engine.el	Tue Feb 28 17:35:08 2006 +0000
@@ -1,7 +1,7 @@
 ;;; cc-engine.el --- core syntax guessing engine for CC mode
 
-;; Copyright (C) 1985,1987,1992-2003, 2004, 2005, 2006
-;; Free Software Foundation, Inc.
+;; Copyright (C) 1985,1987,1992-2003, 2004, 2005, 2006 Free Software Foundation,
+;; Inc.
 
 ;; Authors:    1998- Martin Stjernholm
 ;;             1992-1999 Barry A. Warsaw
@@ -179,8 +179,8 @@
 (make-variable-buffer-local 'c-auto-newline)
 
 ;; Included in the mode line to indicate the active submodes.
-(defvar c-submode-indicators nil)
-(make-variable-buffer-local 'c-submode-indicators)
+;; (defvar c-submode-indicators nil)
+;; (make-variable-buffer-local 'c-submode-indicators)
 
 (defun c-calculate-state (arg prevstate)
   ;; Calculate the new state of PREVSTATE, t or nil, based on arg. If
@@ -525,14 +525,15 @@
 
 Labels are treated as part of the following statements if
 IGNORE-LABELS is non-nil.  (FIXME: Doesn't work if we stop at a known
-statement start keyword.)
-
-Macros are ignored unless point is within one, in which case the
-content of the macro is treated as normal code.  Aside from any normal
-statement starts found in it, stop at the first token of the content
-in the macro, i.e. the expression of an \"#if\" or the start of the
-definition in a \"#define\".  Also stop at start of macros before
-leaving them.
+statement start keyword.)  Otherwise, each label is treated as a
+separate statement.
+
+Macros are ignored \(i.e. skipped over) unless point is within one, in
+which case the content of the macro is treated as normal code.  Aside
+from any normal statement starts found in it, stop at the first token
+of the content in the macro, i.e. the expression of an \"#if\" or the
+start of the definition in a \"#define\".  Also stop at start of
+macros before leaving them.
 
 Return 'label if stopped at a label, 'same if stopped at the beginning
 of the current statement, 'up if stepped to a containing statement,
@@ -547,8 +548,9 @@
 
 NOERROR turns off error logging to `c-parsing-error'.
 
-Normally only ';' is considered to delimit statements, but if
-COMMA-DELIM is non-nil then ',' is treated likewise.
+Normally only ';' and virtual semicolons are considered to delimit
+statements, but if COMMA-DELIM is non-nil then ',' is treated
+as a delimiter too.
 
 Note that this function might do hidden buffer changes.  See the
 comment at the start of cc-engine.el for more info."
@@ -883,6 +885,7 @@
 		      ;; barriers in this round.
 		      (sexp-loop-end-pos pos))
 
+		  ;; The following while goes back one sexp per iteration.
 		  (while
 		      (progn
 			(unless (c-safe (c-backward-sexp) t)
@@ -954,7 +957,7 @@
 			    ;; Like a C "continue".  Analyze the next sexp.
 			    (throw 'loop t)))
 
-			sexp-loop-continue-pos)
+			sexp-loop-continue-pos)	; End of "go back a sexp" loop.
 		    (goto-char sexp-loop-continue-pos)
 		    (setq sexp-loop-end-pos sexp-loop-continue-pos
 			  sexp-loop-continue-pos nil))))
@@ -969,17 +972,26 @@
 	      ;; Handle labels.
 	      (unless (eq ignore-labels t)
 		(when (numberp c-maybe-labelp)
-		  ;; `c-crosses-statement-barrier-p' has found a
-		  ;; colon, so we might be in a label now.
-		  (if after-labels-pos
-		      (if (not last-label-pos)
-			  (setq last-label-pos (or tok start)))
-		    (setq after-labels-pos (or tok start)))
-		  (setq c-maybe-labelp t
-			label-good-pos nil))
-
-		(when (and (not label-good-pos)
-			   (looking-at c-nonlabel-token-key))
+		  ;; `c-crosses-statement-barrier-p' has found a colon, so we
+		  ;; might be in a label now.  Have we got a real label
+		  ;; (including a case label) or something like C++'s "public:"?
+		  (if (or (not (looking-at c-nonlabel-token-key)) ; proper label
+			  (save-excursion ; e.g. "case 'a':" ?
+			    (and (c-safe (c-backward-sexp) t)
+				 (looking-at "\\<case\\>")))) ; FIXME!!! this is
+					; wrong for AWK.  2006/1/14.
+		      (progn
+			(if after-labels-pos ; Have we already encountered a label?
+			    (if (not last-label-pos)
+				(setq last-label-pos (or tok start)))
+			  (setq after-labels-pos (or tok start)))
+			(setq c-maybe-labelp t
+			      label-good-pos nil))
+		    (setq c-maybe-labelp nil))) ; bogus "label"
+
+		(when (and (not label-good-pos)	; i.e. no invalid "label"'s yet
+						; been found.
+			   (looking-at c-nonlabel-token-key)) ; e.g. "while :"
 		  ;; We're in a potential label and it's the first
 		  ;; time we've found something that isn't allowed in
 		  ;; one.
@@ -3993,36 +4005,35 @@
   ;;
   ;; This function might do hidden buffer changes.
 
-  (save-match-data
-    (save-excursion
+  (save-excursion
+    (goto-char beg)
+    (when (or (looking-at "[<>]")
+	      (< (skip-chars-backward "<>") 0))
+
       (goto-char beg)
+      (c-beginning-of-current-token)
+      (when (and (< (point) beg)
+		 (looking-at c-<>-multichar-token-regexp)
+		 (< beg (setq beg (match-end 0))))
+	(while (progn (skip-chars-forward "^<>" beg)
+		      (< (point) beg))
+	  (c-clear-char-property (point) 'syntax-table)
+	  (forward-char))))
+
+    (when (< beg end)
+      (goto-char end)
       (when (or (looking-at "[<>]")
 		(< (skip-chars-backward "<>") 0))
 
-	(goto-char beg)
+	(goto-char end)
 	(c-beginning-of-current-token)
-	(when (and (< (point) beg)
+	(when (and (< (point) end)
 		   (looking-at c-<>-multichar-token-regexp)
-		   (< beg (setq beg (match-end 0))))
-	  (while (progn (skip-chars-forward "^<>" beg)
-			(< (point) beg))
+		   (< end (setq end (match-end 0))))
+	  (while (progn (skip-chars-forward "^<>" end)
+			(< (point) end))
 	    (c-clear-char-property (point) 'syntax-table)
-	    (forward-char))))
-
-      (when (< beg end)
-	(goto-char end)
-	(when (or (looking-at "[<>]")
-		  (< (skip-chars-backward "<>") 0))
-
-	  (goto-char end)
-	  (c-beginning-of-current-token)
-	  (when (and (< (point) end)
-		     (looking-at c-<>-multichar-token-regexp)
-		     (< end (setq end (match-end 0))))
-	    (while (progn (skip-chars-forward "^<>" end)
-			  (< (point) end))
-	      (c-clear-char-property (point) 'syntax-table)
-	      (forward-char))))))))
+	    (forward-char)))))))
 
 ;; Dynamically bound variable that instructs `c-forward-type' to also
 ;; treat possible types (i.e. those that it normally returns 'maybe or
@@ -5991,7 +6002,10 @@
 
 	    ;; Handle the name of the class itself.
 	    (progn
-	      (c-forward-token-2)
+;	      (c-forward-token-2) ; 2006/1/13 This doesn't move if the token's
+;	      at EOB.
+	      (goto-char (match-end 0))
+	      (c-skip-ws-forward)
 	      (c-forward-type))
 
 	    (catch 'break
--- a/lisp/progmodes/cc-langs.el	Sat Feb 25 01:07:18 2006 +0000
+++ b/lisp/progmodes/cc-langs.el	Tue Feb 28 17:35:08 2006 +0000
@@ -1,7 +1,7 @@
 ;;; cc-langs.el --- language specific settings for CC Mode
 
-;; Copyright (C) 1985,1987,1992-2003, 2004, 2005, 2006
-;; Free Software Foundation, Inc.
+;; Copyright (C) 1985,1987,1992-2003, 2004, 2005, 2006 Free Software
+;; Foundation, Inc.
 
 ;; Authors:    1998- Martin Stjernholm
 ;;             1992-1999 Barry A. Warsaw
@@ -177,7 +177,7 @@
   '(def-edebug-spec c-lang-defvar
      (&define name def-form &optional stringp)))
 
-(eval-when-compile
+(eval-and-compile
   ;; Some helper functions used when building the language constants.
 
   (defun c-filter-ops (ops opgroup-filter op-filter &optional xlate)
@@ -260,10 +260,14 @@
       ("Toggle..."
        ["Syntactic indentation" c-toggle-syntactic-indentation
 	:style toggle :selected c-syntactic-indentation]
-       ["Auto newline" c-toggle-auto-newline
+       ["Electric mode"         c-toggle-electric-state
+	:style toggle :selected c-electric-flag]
+       ["Auto newline"          c-toggle-auto-newline
 	:style toggle :selected c-auto-newline]
-       ["Hungry delete" c-toggle-hungry-state
-	:style toggle :selected c-hungry-delete-key])))
+       ["Hungry delete"         c-toggle-hungry-state
+	:style toggle :selected c-hungry-delete-key]
+       ["Subword mode"          c-subword-mode
+	:style toggle :selected c-subword-mode])))
 
 
 ;;; Syntax tables.
@@ -2826,7 +2830,7 @@
 	 ;; This let sets up the context for `c-mode-var' and similar
 	 ;; that could be in the result from `cl-macroexpand-all'.
 	 (let ((c-buffer-is-cc-mode ',mode)
-	       current-var)
+	       current-var source-eval)
 	   (condition-case err
 
 	       (if (eq c-version-sym ',c-version-sym)
@@ -2852,6 +2856,7 @@
 		 ;;  (put ',mode 'c-has-warned-lang-consts t))
 
 		 (require 'cc-langs)
+		 (setq source-eval t)
 		 (let ((init (cdr c-lang-variable-inits)))
 		   (while init
 		     (setq current-var (caar init))
@@ -2860,8 +2865,14 @@
 
 	     (error
 	      (if current-var
-		  (message "Eval error in the `c-lang-defvar' for `%s': %S"
-			   current-var err)
+		  (message "Eval error in the `c-lang-defvar' for `%s'%s: %S"
+			   current-var
+			   (if source-eval
+			       (format "\
+ (fallback source eval - %s compiled with CC Mode %s but loaded with %s)"
+				       ',mode ,c-version c-version)
+			     "")
+			   err)
 		(signal (car err) (cdr err)))))))
 
     ;; Being evaluated from source.  Always use the dynamic method to
@@ -2881,8 +2892,9 @@
 
 	   (error
 	    (if current-var
-		(message "Eval error in the `c-lang-defvar' for `%s': %S"
-			 current-var err)
+		(message
+		 "Eval error in the `c-lang-defvar' for `%s' (source eval): %S"
+		 current-var err)
 	      (signal (car err) (cdr err)))))))
     ))
 
--- a/lisp/progmodes/cc-menus.el	Sat Feb 25 01:07:18 2006 +0000
+++ b/lisp/progmodes/cc-menus.el	Tue Feb 28 17:35:08 2006 +0000
@@ -1,7 +1,7 @@
 ;;; cc-menus.el --- imenu support for CC Mode
 
-;; Copyright (C) 1985,1987,1992-2003, 2004, 2005, 2006
-;; Free Software Foundation, Inc.
+;; Copyright (C) 1985,1987,1992-2003, 2004, 2005, 2006 Free Software
+;; Foundation, Inc.
 
 ;; Authors:    1998- Martin Stjernholm
 ;;             1992-1999 Barry A. Warsaw
--- a/lisp/progmodes/cc-mode.el	Sat Feb 25 01:07:18 2006 +0000
+++ b/lisp/progmodes/cc-mode.el	Tue Feb 28 17:35:08 2006 +0000
@@ -1,7 +1,7 @@
 ;;; cc-mode.el --- major mode for editing C and similar languages
 
-;; Copyright (C) 1985,1987,1992-2003, 2004, 2005, 2006
-;; Free Software Foundation, Inc.
+;; Copyright (C) 1985,1987,1992-2003, 2004, 2005, 2006 Free Software
+;; Foundation, Inc.
 
 ;; Authors:    2003- Alan Mackenzie
 ;;             1998- Martin Stjernholm
@@ -242,9 +242,9 @@
 	(define-key c-mode-base-map (kbd "C-c C-<delete>")
 	  'c-hungry-delete-forward)
 	(define-key c-mode-base-map (kbd "C-c C-<backspace>")
-	  'c-hungry-backspace))
+	  'c-hungry-delete-backwards))
     (define-key c-mode-base-map (kbd "C-c C-<delete>")
-      'c-hungry-backspace)
+      'c-hungry-delete-backwards)
     (define-key c-mode-base-map (kbd "C-c C-<backspace>")
       'c-hungry-delete-forward)))
 
@@ -304,10 +304,11 @@
   ;; `c-electric-backspace'.  The hungry variants are bound to the
   ;; same keys but prefixed with C-c.  This implies that C-c C-d is
   ;; `c-hungry-delete-forward'.  For consistency, we bind not only C-c
-  ;; <backspace> to `c-hungry-backspace' but also C-c C-<backspace>,
-  ;; so that the Ctrl key can be held down during the whole sequence
-  ;; regardless of the direction.  This in turn implies that we bind
-  ;; C-c C-<delete> to `c-hungry-delete-forward', for the same reason.
+  ;; <backspace> to `c-hungry-delete-backwards' but also
+  ;; C-c C-<backspace>, so that the Ctrl key can be held down during
+  ;; the whole sequence regardless of the direction.  This in turn
+  ;; implies that we bind C-c C-<delete> to `c-hungry-delete-forward',
+  ;; for the same reason.
 
   ;; Bind the electric deletion functions to C-d and DEL.  Emacs 21
   ;; automatically maps the [delete] and [backspace] keys to these two
@@ -316,8 +317,8 @@
   (define-key c-mode-base-map "\C-d" 'c-electric-delete-forward)
   (define-key c-mode-base-map "\177" 'c-electric-backspace)
   (define-key c-mode-base-map "\C-c\C-d"     'c-hungry-delete-forward)
-  (define-key c-mode-base-map [?\C-c ?\d]    'c-hungry-backspace)
-  (define-key c-mode-base-map [?\C-c ?\C-\d] 'c-hungry-backspace)
+  (define-key c-mode-base-map [?\C-c ?\d]    'c-hungry-delete-backwards)
+  (define-key c-mode-base-map [?\C-c ?\C-\d] 'c-hungry-delete-backwards)
   (define-key c-mode-base-map [?\C-c deletechar] 'c-hungry-delete-forward) ; C-c <delete> on a tty.
   (define-key c-mode-base-map [?\C-c (control deletechar)] ; C-c C-<delete> on a tty.
     'c-hungry-delete-forward)
@@ -339,8 +340,10 @@
     (define-key c-mode-base-map [backspace] 'c-electric-backspace)
     (define-key c-mode-base-map (kbd "C-c <delete>") 'c-hungry-delete)
     (define-key c-mode-base-map (kbd "C-c C-<delete>") 'c-hungry-delete)
-    (define-key c-mode-base-map (kbd "C-c <backspace>") 'c-hungry-backspace)
-    (define-key c-mode-base-map (kbd "C-c C-<backspace>") 'c-hungry-backspace))
+    (define-key c-mode-base-map (kbd "C-c <backspace>")
+      'c-hungry-delete-backwards)
+    (define-key c-mode-base-map (kbd "C-c C-<backspace>")
+      'c-hungry-delete-backwards))
 
   (define-key c-mode-base-map "#"         'c-electric-pound)
   (define-key c-mode-base-map "{"         'c-electric-brace)
@@ -414,23 +417,24 @@
     ;; with regions outside the current narrowing.  This has been
     ;; observed in Emacs 20.7.
     (save-restriction
-      (widen)
+      (save-match-data		  ; c-recognize-<>-arglists changes match-data
+	(widen)
 
-      (when (> end (point-max))
-	;; Some emacsen might return positions past the end. This has been
-	;; observed in Emacs 20.7 when rereading a buffer changed on disk
-	;; (haven't been able to minimize it, but Emacs 21.3 appears to
-	;; work).
-	(setq end (point-max))
-	(when (> beg end)
-	  (setq beg end)))
+	(when (> end (point-max))
+	  ;; Some emacsen might return positions past the end. This has been
+	  ;; observed in Emacs 20.7 when rereading a buffer changed on disk
+	  ;; (haven't been able to minimize it, but Emacs 21.3 appears to
+	  ;; work).
+	  (setq end (point-max))
+	  (when (> beg end)
+	    (setq beg end)))
 
-      (c-invalidate-sws-region-after beg end)
-      (c-invalidate-state-cache beg)
-      (c-invalidate-find-decl-cache beg)
+	(c-invalidate-sws-region-after beg end)
+	(c-invalidate-state-cache beg)
+	(c-invalidate-find-decl-cache beg)
 
-      (when c-recognize-<>-arglists
-	(c-after-change-check-<>-operators beg end)))))
+	(when c-recognize-<>-arglists
+	  (c-after-change-check-<>-operators beg end))))))
 
 (defun c-basic-common-init (mode default-style)
   "Do the necessary initialization for the syntax handling routines
@@ -550,11 +554,12 @@
   (make-local-variable 'comment-indent-function)
   (setq comment-indent-function 'c-comment-indent)
 
-  ;; Put submode indicators onto minor-mode-alist, but only once.
-  (or (assq 'c-submode-indicators minor-mode-alist)
-      (setq minor-mode-alist
-	    (cons '(c-submode-indicators c-submode-indicators)
-		  minor-mode-alist)))
+;;   ;; Put submode indicators onto minor-mode-alist, but only once.
+;;   (or (assq 'c-submode-indicators minor-mode-alist)
+;;       (setq minor-mode-alist
+;; 	    (cons '(c-submode-indicators c-submode-indicators)
+;; 		  minor-mode-alist)))
+  (c-update-modeline)
 
   ;; Install the functions that ensure that various internal caches
   ;; don't become invalid due to buffer changes.
@@ -629,6 +634,51 @@
       (and (cdr rfn)
 	   (setq require-final-newline mode-require-final-newline)))))
 
+(defun c-remove-any-local-eval-or-mode-variables ()
+  ;; If the buffer specifies `mode' or `eval' in its File Local Variable list
+  ;; or on the first line, remove all occurrences.  See
+  ;; `c-postprocess-file-styles' for justification.  There is no need to save
+  ;; point here, or even bother too much about the buffer contents.
+  ;;
+  ;; Most of the code here is derived from Emacs 21.3's `hack-local-variables'
+  ;; in files.el.
+  (goto-char (point-max))
+  (search-backward "\n\^L" (max (- (point-max) 3000) (point-min)) 'move)
+  (let (lv-point (prefix "") (suffix ""))
+    (when (let ((case-fold-search t))
+	    (search-forward "Local Variables:" nil t))
+      (setq lv-point (point))
+      ;; The prefix is what comes before "local variables:" in its line.
+      ;; The suffix is what comes after "local variables:" in its line.
+      (skip-chars-forward " \t")
+      (or (eolp)
+	  (setq suffix (buffer-substring (point)
+					 (progn (end-of-line) (point)))))
+      (goto-char (match-beginning 0))
+      (or (bolp)
+	  (setq prefix
+		(buffer-substring (point)
+				  (progn (beginning-of-line) (point)))))
+
+      (while (search-forward-regexp
+	      (concat "^[ \t]*"
+		      (regexp-quote prefix)
+		      "\\(mode\\|eval\\):.*"
+		      (regexp-quote suffix)
+		      "$")
+	      nil t)
+	(beginning-of-line)
+	(kill-line 1)))
+
+    ;; Delete the first line, if we've got one, in case it contains a mode spec.
+    (unless (and lv-point
+		 (progn (goto-char lv-point)
+			(forward-line 0)
+			(bobp)))
+      (goto-char (point-min))
+      (unless (eobp)
+	(kill-line 1)))))
+
 (defun c-postprocess-file-styles ()
   "Function that post processes relevant file local variables in CC Mode.
 Currently, this function simply applies any style and offset settings
@@ -656,12 +706,20 @@
     ;; overwritten this.  So we run `hack-local-variables' again to remedy
     ;; this.  There are no guarantees this will work properly, particularly as
     ;; we have no control over what the other hook functions on
-    ;; `hack-local-variables-hook' would have done, or what any "eval"
-    ;; expression will do when evaluated again.  C'est la vie!  ACM,
-    ;; 2005/11/2.
+    ;; `hack-local-variables-hook' would have done.  We now (2006/2/1) remove
+    ;; any `eval' or `mode' expressions before we evaluate again (see below).
+    ;; ACM, 2005/11/2.
+    ;;
+    ;; Problem (bug reported by Gustav Broberg): if one of the variables is
+    ;; `mode', this will invoke c-mode (etc.) again, setting up the style etc.
+    ;; We prevent this by temporarily removing `mode' from the Local Variables
+    ;; section.
     (if (or c-file-style c-file-offsets)
-	(let ((hack-local-variables-hook nil))
-	  (hack-local-variables)))))
+	(c-tentative-buffer-changes
+	  (let ((hack-local-variables-hook nil))
+	    (c-remove-any-local-eval-or-mode-variables)
+	    (hack-local-variables))
+	  nil))))
 
 (add-hook 'hack-local-variables-hook 'c-postprocess-file-styles)
 
--- a/lisp/progmodes/cc-styles.el	Sat Feb 25 01:07:18 2006 +0000
+++ b/lisp/progmodes/cc-styles.el	Tue Feb 28 17:35:08 2006 +0000
@@ -1,7 +1,7 @@
 ;;; cc-styles.el --- support for styles in CC Mode
 
-;; Copyright (C) 1985,1987,1992-2003, 2004, 2005, 2006
-;; Free Software Foundation, Inc.
+;; Copyright (C) 1985,1987,1992-2003, 2004, 2005, 2006 Free Software
+;; Foundation, Inc.
 
 ;; Authors:    1998- Martin Stjernholm
 ;;             1992-1999 Barry A. Warsaw
--- a/lisp/progmodes/cc-vars.el	Sat Feb 25 01:07:18 2006 +0000
+++ b/lisp/progmodes/cc-vars.el	Tue Feb 28 17:35:08 2006 +0000
@@ -1,7 +1,7 @@
 ;;; cc-vars.el --- user customization variables for CC Mode
 
-;; Copyright (C) 1985,1987,1992-2003, 2004, 2005, 2006
-;; Free Software Foundation, Inc.
+;; Copyright (C) 1985,1987,1992-2003, 2004, 2005, 2006 Free Software
+;; Foundation, Inc.
 
 ;; Authors:    1998- Martin Stjernholm
 ;;             1992-1999 Barry A. Warsaw
--- a/lisp/progmodes/etags.el	Sat Feb 25 01:07:18 2006 +0000
+++ b/lisp/progmodes/etags.el	Tue Feb 28 17:35:08 2006 +0000
@@ -746,27 +746,25 @@
 ;; their tags included in the completion table.
 (defun tags-completion-table ()
   (or tags-completion-table
+      ;; No cached value for this buffer.
       (condition-case ()
-	  (prog2
-	   (message "Making tags completion table for %s..." buffer-file-name)
-	   (let ((included (tags-included-tables))
-		 (table (funcall tags-completion-table-function)))
-	     (save-excursion
-	       ;; Iterate over the list of included tables, and combine each
-	       ;; included table's completion obarray to the parent obarray.
-	       (while included
-		 ;; Visit the buffer.
-		 (let ((tags-file-name (car included)))
-		   (visit-tags-table-buffer 'same))
-		 ;; Recurse in that buffer to compute its completion table.
-		 (if (tags-completion-table)
-		     ;; Combine the tables.
-		     (mapatoms (lambda (sym) (intern (symbol-name sym) table))
-			       tags-completion-table))
-		 (setq included (cdr included))))
-	     (setq tags-completion-table table))
-	   (message "Making tags completion table for %s...done"
-		    buffer-file-name))
+	  (let (current-table combined-table)
+	    (message "Making tags completion table for %s..." buffer-file-name)
+	    (save-excursion
+	      ;; Iterate over the current list of tags tables.
+	      (while (visit-tags-table-buffer (and combined-table t))
+		;; Find possible completions in this table.
+		(setq current-table (funcall tags-completion-table-function))
+		;; Merge this buffer's completions into the combined table.
+		(if combined-table
+		    (mapatoms
+		     (lambda (sym) (intern (symbol-name sym) combined-table))
+		     current-table)
+		  (setq combined-table current-table))))
+	    (message "Making tags completion table for %s...done"
+		     buffer-file-name)
+	    ;; Cache the result a buffer-local variable.
+	    (setq tags-completion-table combined-table))
 	(quit (message "Tags completion table construction aborted.")
 	      (setq tags-completion-table nil)))))
 
--- a/lisp/progmodes/gdb-ui.el	Sat Feb 25 01:07:18 2006 +0000
+++ b/lisp/progmodes/gdb-ui.el	Tue Feb 28 17:35:08 2006 +0000
@@ -124,6 +124,7 @@
   "Non-nil if GDB knows that the inferior includes preprocessor macro info.")
 (defvar gdb-buffer-fringe-width nil)
 (defvar gdb-signalled nil)
+(defvar gdb-source-window nil)
 
 (defvar gdb-buffer-type nil
   "One of the symbols bound in `gdb-buffer-rules'.")
@@ -489,7 +490,8 @@
 	gdb-macro-info nil
 	gdb-buffer-fringe-width (car (window-fringes))
 	gdb-debug-ring nil
-	gdb-signalled nil)
+	gdb-signalled nil
+	gdb-source-window nil)
 
   (setq gdb-buffer-type 'gdba)
 
@@ -835,7 +837,7 @@
 ;; The usual gdb interaction buffer is given the type `gdba' and
 ;; is constructed specially.
 ;;
-;; Others are constructed by gdb-get-create-buffer and
+;; Others are constructed by gdb-get-buffer-create and
 ;; named according to the rules set forth in the gdb-buffer-rules-assoc
 
 (defvar gdb-buffer-rules-assoc '())
@@ -846,7 +848,7 @@
   (save-excursion
     (gdb-look-for-tagged-buffer key (buffer-list))))
 
-(defun gdb-get-create-buffer (key)
+(defun gdb-get-buffer-create (key)
   "Create a new gdb  buffer of the type specified by KEY.
 The key should be one of the cars in `gdb-buffer-rules-assoc'."
   (or (gdb-get-buffer key)
@@ -924,7 +926,7 @@
   (interactive)
   (if gdb-use-separate-io-buffer
       (gdb-display-buffer
-       (gdb-get-create-buffer 'gdb-inferior-io))))
+       (gdb-get-buffer-create 'gdb-inferior-io))))
 
 (defconst gdb-frame-parameters
   '((height . 14) (width . 80)
@@ -939,7 +941,7 @@
   (if gdb-use-separate-io-buffer
       (let ((special-display-regexps (append special-display-regexps '(".*")))
 	    (special-display-frame-alist gdb-frame-parameters))
-	(display-buffer (gdb-get-create-buffer 'gdb-inferior-io)))))
+	(display-buffer (gdb-get-buffer-create 'gdb-inferior-io)))))
 
 (defvar gdb-inferior-io-mode-map
   (let ((map (make-sparse-keymap)))
@@ -1156,7 +1158,7 @@
       (setq gdb-output-sink 'user)
       (let ((handler
 	     (car (cdr gdb-current-item))))
-	(with-current-buffer (gdb-get-create-buffer 'gdb-partial-output-buffer)
+	(with-current-buffer (gdb-get-buffer-create 'gdb-partial-output-buffer)
 	  (funcall handler))))
      (t
       (gdb-resync)
@@ -1253,7 +1255,7 @@
     (gdb-get-selected-frame)
     (gdb-invalidate-frames)
     ;; Regenerate breakpoints buffer in case it has been inadvertantly deleted.
-    (gdb-get-create-buffer 'gdb-breakpoints-buffer)
+    (gdb-get-buffer-create 'gdb-breakpoints-buffer)
     (gdb-invalidate-breakpoints)
     ;; Do this through gdb-get-selected-frame -> gdb-frame-handler
     ;; so gdb-frame-address is updated.
@@ -1288,6 +1290,22 @@
       (gdb-resync)
       (error "Phase error in gdb-post-prompt (got %s)" sink)))))
 
+;; GUD displays the selected GDB frame.  This might might not be the current
+;; GDB frame (after up, down etc).  If no GDB frame is visible but the last
+;; visited breakpoint is, use that window.
+(defun gdb-display-source-buffer (buffer)
+  (let* ((last-window (if gud-last-last-frame
+			 (get-buffer-window
+			  (gud-find-file (car gud-last-last-frame)))))
+	 (source-window (or last-window
+			    (if (and gdb-source-window
+				     (window-live-p gdb-source-window))
+				gdb-source-window))))
+    (when source-window
+      (setq gdb-source-window source-window)
+      (set-window-buffer source-window buffer))
+    source-window))
+
 (defun gud-gdba-marker-filter (string)
   "A gud marker filter for gdb.  Handle a burst of output from GDB."
   (if gdb-flush-pending-output
@@ -1370,23 +1388,23 @@
       (error "Bogon output sink %S" sink)))))
 
 (defun gdb-append-to-partial-output (string)
-  (with-current-buffer (gdb-get-create-buffer 'gdb-partial-output-buffer)
+  (with-current-buffer (gdb-get-buffer-create 'gdb-partial-output-buffer)
     (goto-char (point-max))
     (insert string)))
 
 (defun gdb-clear-partial-output ()
-  (with-current-buffer (gdb-get-create-buffer 'gdb-partial-output-buffer)
+  (with-current-buffer (gdb-get-buffer-create 'gdb-partial-output-buffer)
     (erase-buffer)))
 
 (defun gdb-append-to-inferior-io (string)
-  (with-current-buffer (gdb-get-create-buffer 'gdb-inferior-io)
+  (with-current-buffer (gdb-get-buffer-create 'gdb-inferior-io)
     (goto-char (point-max))
     (insert-before-markers string))
   (if (not (string-equal string ""))
-      (gdb-display-buffer (gdb-get-create-buffer 'gdb-inferior-io))))
+      (gdb-display-buffer (gdb-get-buffer-create 'gdb-inferior-io))))
 
 (defun gdb-clear-inferior-io ()
-  (with-current-buffer (gdb-get-create-buffer 'gdb-inferior-io)
+  (with-current-buffer (gdb-get-buffer-create 'gdb-inferior-io)
     (erase-buffer)))
 
 
@@ -1434,11 +1452,13 @@
        (and buf
 	    (with-current-buffer buf
 	      (let* ((window (get-buffer-window buf 0))
+		     (start (window-start window))
 		     (p (window-point window))
 		    (buffer-read-only nil))
 		(erase-buffer)
-		(insert-buffer-substring (gdb-get-create-buffer
+		(insert-buffer-substring (gdb-get-buffer-create
 					  'gdb-partial-output-buffer))
+		(set-window-start window start)
 		(set-window-point window p)))))
      ;; put customisation here
      (,custom-defun)))
@@ -1688,14 +1708,14 @@
   "Display status of user-settable breakpoints."
   (interactive)
   (gdb-display-buffer
-   (gdb-get-create-buffer 'gdb-breakpoints-buffer)))
+   (gdb-get-buffer-create 'gdb-breakpoints-buffer)))
 
 (defun gdb-frame-breakpoints-buffer ()
   "Display status of user-settable breakpoints in a new frame."
   (interactive)
   (let ((special-display-regexps (append special-display-regexps '(".*")))
 	(special-display-frame-alist gdb-frame-parameters))
-    (display-buffer (gdb-get-create-buffer 'gdb-breakpoints-buffer))))
+    (display-buffer (gdb-get-buffer-create 'gdb-breakpoints-buffer))))
 
 (defvar gdb-breakpoints-mode-map
   (let ((map (make-sparse-keymap))
@@ -1767,9 +1787,6 @@
   "Display the breakpoint location specified at current line."
   (interactive (list last-input-event))
   (if event (posn-set-point (event-end event)))
-  ;; Hack to stop gdb-goto-breakpoint displaying in GUD buffer.
-  (let ((window (get-buffer-window gud-comint-buffer)))
-    (if window (save-selected-window  (select-window window))))
   (save-excursion
     (beginning-of-line 1)
     (if (looking-at "\\([0-9]+\\) .+ in .+ at\\s-+\\(\\S-+\\):\\([0-9]+\\)")
@@ -1777,11 +1794,13 @@
 	      (file  (match-string 2))
 	      (line  (match-string 3)))
 	  (save-selected-window
-	    (let* ((buf (find-file-noselect
+	    (let* ((buffer (find-file-noselect
 			 (if (file-exists-p file) file
 			   (cdr (assoc bptno gdb-location-alist)))))
-		   (window (display-buffer buf)))
-	      (with-current-buffer buf
+		   (window (unless (gdb-display-source-buffer buffer)
+			       (display-buffer buffer))))
+	      (setq gdb-source-window window)
+	      (with-current-buffer buffer
 		(goto-line (string-to-number line))
 		(set-window-point window (point))))))
       (error "No location specified."))))
@@ -1844,14 +1863,14 @@
   "Display backtrace of current stack."
   (interactive)
   (gdb-display-buffer
-   (gdb-get-create-buffer 'gdb-stack-buffer)))
+   (gdb-get-buffer-create 'gdb-stack-buffer)))
 
 (defun gdb-frame-stack-buffer ()
   "Display backtrace of current stack in a new frame."
   (interactive)
   (let ((special-display-regexps (append special-display-regexps '(".*")))
 	(special-display-frame-alist gdb-frame-parameters))
-    (display-buffer (gdb-get-create-buffer 'gdb-stack-buffer))))
+    (display-buffer (gdb-get-buffer-create 'gdb-stack-buffer))))
 
 (defvar gdb-frames-mode-map
   (let ((map (make-sparse-keymap)))
@@ -1925,14 +1944,14 @@
   "Display IDs of currently known threads."
   (interactive)
   (gdb-display-buffer
-   (gdb-get-create-buffer 'gdb-threads-buffer)))
+   (gdb-get-buffer-create 'gdb-threads-buffer)))
 
 (defun gdb-frame-threads-buffer ()
   "Display IDs of currently known threads in a new frame."
   (interactive)
   (let ((special-display-regexps (append special-display-regexps '(".*")))
 	(special-display-frame-alist gdb-frame-parameters))
-    (display-buffer (gdb-get-create-buffer 'gdb-threads-buffer))))
+    (display-buffer (gdb-get-buffer-create 'gdb-threads-buffer))))
 
 (defvar gdb-threads-mode-map
   (let ((map (make-sparse-keymap)))
@@ -2061,14 +2080,14 @@
   "Display integer register contents."
   (interactive)
   (gdb-display-buffer
-   (gdb-get-create-buffer 'gdb-registers-buffer)))
+   (gdb-get-buffer-create 'gdb-registers-buffer)))
 
 (defun gdb-frame-registers-buffer ()
   "Display integer register contents in a new frame."
   (interactive)
   (let ((special-display-regexps (append special-display-regexps '(".*")))
 	(special-display-frame-alist gdb-frame-parameters))
-    (display-buffer (gdb-get-create-buffer 'gdb-registers-buffer))))
+    (display-buffer (gdb-get-buffer-create 'gdb-registers-buffer))))
 
 (defun gdb-all-registers ()
   "Toggle the display of floating-point registers (pre GDB 6.4 only)."
@@ -2077,10 +2096,10 @@
     (if gdb-all-registers
 	(progn
 	  (setq gdb-all-registers nil)
-	  (with-current-buffer (gdb-get-create-buffer 'gdb-registers-buffer)
+	  (with-current-buffer (gdb-get-buffer-create 'gdb-registers-buffer)
 	    (setq mode-name "Registers")))
       (setq gdb-all-registers t)
-      (with-current-buffer (gdb-get-create-buffer 'gdb-registers-buffer)
+      (with-current-buffer (gdb-get-buffer-create 'gdb-registers-buffer)
 	(setq mode-name "Registers:All")))
     (message (format "Display of floating-point registers %sabled"
 		     (if gdb-all-registers "en" "dis")))
@@ -2385,14 +2404,14 @@
   "Display memory contents."
   (interactive)
   (gdb-display-buffer
-   (gdb-get-create-buffer 'gdb-memory-buffer)))
+   (gdb-get-buffer-create 'gdb-memory-buffer)))
 
 (defun gdb-frame-memory-buffer ()
   "Display memory contents in a new frame."
   (interactive)
   (let ((special-display-regexps (append special-display-regexps '(".*")))
 	(special-display-frame-alist gdb-frame-parameters))
-    (display-buffer (gdb-get-create-buffer 'gdb-memory-buffer))))
+    (display-buffer (gdb-get-buffer-create 'gdb-memory-buffer))))
 
 
 ;; Locals buffer.
@@ -2450,12 +2469,15 @@
     (and buf
 	 (with-current-buffer buf
 	      (let* ((window (get-buffer-window buf 0))
+		     (start (window-start window))
 		     (p (window-point window))
 		     (buffer-read-only nil))
 		 (erase-buffer)
-		 (insert-buffer-substring (gdb-get-create-buffer
+		 (insert-buffer-substring (gdb-get-buffer-create
 					   'gdb-partial-output-buffer))
-		(set-window-point window p)))))
+		(set-window-start window start)
+		(set-window-point window p))
+)))
   (run-hooks 'gdb-info-locals-hook))
 
 (defvar gdb-locals-mode-map
@@ -2489,14 +2511,14 @@
   "Display local variables of current stack and their values."
   (interactive)
   (gdb-display-buffer
-   (gdb-get-create-buffer 'gdb-locals-buffer)))
+   (gdb-get-buffer-create 'gdb-locals-buffer)))
 
 (defun gdb-frame-locals-buffer ()
   "Display local variables of current stack and their values in a new frame."
   (interactive)
   (let ((special-display-regexps (append special-display-regexps '(".*")))
 	(special-display-frame-alist gdb-frame-parameters))
-    (display-buffer (gdb-get-create-buffer 'gdb-locals-buffer))))
+    (display-buffer (gdb-get-buffer-create 'gdb-locals-buffer))))
 
 
 ;;;; Window management
@@ -2619,7 +2641,7 @@
     (split-window-horizontally)
     (other-window 1)
     (gdb-set-window-buffer
-     (gdb-get-create-buffer 'gdb-inferior-io)))
+     (gdb-get-buffer-create 'gdb-inferior-io)))
   (other-window 1)
   (gdb-set-window-buffer (gdb-stack-buffer-name))
   (split-window-horizontally)
@@ -2707,7 +2729,7 @@
       (setq gdb-macro-info t))
  (if gdb-many-windows
       (gdb-setup-windows)
-   (gdb-get-create-buffer 'gdb-breakpoints-buffer)
+   (gdb-get-buffer-create 'gdb-breakpoints-buffer)
    (if gdb-show-main
        (let ((pop-up-windows t))
 	 (display-buffer (gud-find-file gdb-main-file))))))
@@ -2960,7 +2982,7 @@
   (interactive)
   (setq gdb-previous-frame nil)
   (gdb-display-buffer
-   (gdb-get-create-buffer 'gdb-assembler-buffer)))
+   (gdb-get-buffer-create 'gdb-assembler-buffer)))
 
 (defun gdb-frame-assembler-buffer ()
   "Display disassembly view in a new frame."
@@ -2968,7 +2990,7 @@
   (setq gdb-previous-frame nil)
   (let ((special-display-regexps (append special-display-regexps '(".*")))
 	(special-display-frame-alist gdb-frame-parameters))
-    (display-buffer (gdb-get-create-buffer 'gdb-assembler-buffer))))
+    (display-buffer (gdb-get-buffer-create 'gdb-assembler-buffer))))
 
 ;; modified because if gdb-frame-address has changed value a new command
 ;; must be enqueued to update the buffer with the new output
@@ -3166,11 +3188,14 @@
 	      (concat register-values register-string)))
       (let ((buf (gdb-get-buffer 'gdb-registers-buffer)))
 	(with-current-buffer buf
-	  (let ((p (window-point (get-buffer-window buf 0)))
-		(buffer-read-only nil))
+	  (let* ((window (get-buffer-window buf 0))
+		 (start (window-start window))
+		 (p (window-point window))
+		 (buffer-read-only nil))
 	    (erase-buffer)
 	    (insert register-values)
-	    (set-window-point (get-buffer-window buf 0) p))))))
+	    (set-window-start window start)
+	    (set-window-point window p))))))
   (gdb-data-list-register-values-custom))
 
 (defun gdb-data-list-register-values-custom ()
@@ -3255,6 +3280,7 @@
     (let ((buf (gdb-get-buffer 'gdb-locals-buffer)))
       (and buf (with-current-buffer buf
 		 (let* ((window (get-buffer-window buf 0))
+			(start (window-start window))
 			(p (window-point window))
 			(buffer-read-only nil))
 		   (erase-buffer)
@@ -3270,6 +3296,7 @@
 		       (insert 
 			(concat name "\t" (nth 1 local)
 				"\t" (nth 2 local) "\n")))
+		   (set-window-start window start)
 		   (set-window-point window p)))))))
 
 (defun gdb-get-register-names ()
--- a/lisp/progmodes/gud.el	Sat Feb 25 01:07:18 2006 +0000
+++ b/lisp/progmodes/gud.el	Tue Feb 28 17:35:08 2006 +0000
@@ -2753,9 +2753,10 @@
 	  (with-current-buffer gud-comint-buffer
 	    (gud-find-file true-file)))
 	 (window (and buffer (or (get-buffer-window buffer)
-				   (display-buffer buffer))))
+				 (if (memq gud-minor-mode '(gdbmi gdba))
+				     (gdb-display-source-buffer buffer))
+				 (display-buffer buffer))))
 	 (pos))
-    (message "%s %s" (current-buffer) buffer)
     (if buffer
 	(progn
 	  (with-current-buffer buffer
--- a/lisp/progmodes/sh-script.el	Sat Feb 25 01:07:18 2006 +0000
+++ b/lisp/progmodes/sh-script.el	Tue Feb 28 17:35:08 2006 +0000
@@ -1430,25 +1430,27 @@
   (set (make-local-variable 'parse-sexp-ignore-comments) t)
   ;; Parse or insert magic number for exec, and set all variables depending
   ;; on the shell thus determined.
-  (let ((interpreter
-	 (save-excursion
-	   (goto-char (point-min))
-	   (cond ((looking-at "#![ \t]?\\([^ \t\n]*/bin/env[ \t]\\)?\\([^ \t\n]+\\)")
-		  (match-string 2))
-		 ((and buffer-file-name
-		       (string-match "\\.m?spec\\'" buffer-file-name))
-		  "rpm")))))
-    (unless interpreter
-      (setq interpreter
-	    (cond ((string-match "[.]sh\\>" buffer-file-name)
-		   "sh")
-		  ((string-match "[.]bash\\>" buffer-file-name)
-		   "bash")
-		  ((string-match "[.]ksh\\>" buffer-file-name)
-		   "ksh")
-		  ((string-match "[.]csh\\>" buffer-file-name)
-		   "csh"))))
-    (sh-set-shell (or interpreter sh-shell-file) nil nil))
+  (sh-set-shell
+   (cond ((save-excursion
+            (goto-char (point-min))
+            (looking-at "#![ \t]?\\([^ \t\n]*/bin/env[ \t]\\)?\\([^ \t\n]+\\)"))
+          (match-string 2))
+         ((not buffer-file-name)
+          sh-shell-file)
+         ;; Checks that use `buffer-file-name' follow.
+         ((string-match "\\.m?spec\\'" buffer-file-name)
+          "rpm")
+         ((string-match "[.]sh\\>" buffer-file-name)
+          "sh")
+         ((string-match "[.]bash\\>" buffer-file-name)
+          "bash")
+         ((string-match "[.]ksh\\>" buffer-file-name)
+          "ksh")
+         ((string-match "[.]csh\\>" buffer-file-name)
+          "csh")
+         (t
+          sh-shell-file))
+   nil nil)
   (run-mode-hooks 'sh-mode-hook))
 
 ;;;###autoload
--- a/lisp/speedbar.el	Sat Feb 25 01:07:18 2006 +0000
+++ b/lisp/speedbar.el	Tue Feb 28 17:35:08 2006 +0000
@@ -57,6 +57,73 @@
 ;;     http://www.dina.kvl.dk/~abraham/custom/
 ;;     custom is available in all versions of Emacs version 20 or better.
 ;;
+;;; Developing for speedbar
+;;
+;; Adding a speedbar specialized display mode:
+;;
+;; Speedbar can be configured to create a special display for certain
+;; modes that do not display traditional file/tag data.  Rmail, Info,
+;; and the debugger are examples.  These modes can, however, benefit
+;; from a speedbar style display in their own way.
+;;
+;; If your `major-mode' is `foo-mode', the only requirement is to
+;; create a function called `foo-speedbar-buttons' which takes one
+;; argument, BUFFER.  BUFFER will be the buffer speedbar wants filled.
+;; In `foo-speedbar-buttons' there are several functions that make
+;; building a speedbar display easy.  See the documentation for
+;; `speedbar-with-writable' (needed because the buffer is usually
+;; read-only) `speedbar-make-tag-line', `speedbar-insert-button', and
+;; `speedbar-insert-generic-list'.  If you use
+;; `speedbar-insert-generic-list', also read the doc for
+;; `speedbar-tag-hierarchy-method' in case you wish to override it.
+;; The macro `speedbar-with-attached-buffer' brings you back to the
+;; buffer speedbar is displaying for.
+;;
+;; For those functions that make buttons, the "function" should be a
+;; symbol that is the function to call when clicked on.  The "token"
+;; is extra data you can pass along.  The "function" must take three
+;; parameters.  They are (TEXT TOKEN INDENT).  TEXT is the text of the
+;; button clicked on.  TOKEN is the data passed in when you create the
+;; button.  INDENT is an indentation level, or 0.  You can store
+;; indentation levels with `speedbar-make-tag-line' which creates a
+;; line with an expander (eg.  [+]) and a text button.
+;;
+;; Some useful functions when writing expand functions, and click
+;; functions are `speedbar-change-expand-button-char',
+;; `speedbar-delete-subblock', and `speedbar-center-buffer-smartly'.
+;; The variable `speedbar-power-click' is set to t in your functions
+;; when the user shift-clicks.  This is an indication of anything from
+;; refreshing cached data to making a buffer appear in a new frame.
+;;
+;; If you wish to add to the default speedbar menu for the case of
+;; `foo-mode', create a variable `foo-speedbar-menu-items'.  This
+;; should be a list compatible with the `easymenu' package.  It will
+;; be spliced into the main menu.  (Available with click-mouse-3).  If
+;; you wish to have extra key bindings in your special mode, create a
+;; variable `foo-speedbar-key-map'.  Instead of using `make-keymap',
+;; or `make-sparse-keymap', use the function
+;; `speedbar-make-specialized-keymap'.  This lets you inherit all of
+;; speedbar's default bindings with low overhead.
+;;
+;; Adding a speedbar top-level display mode:
+;;
+;; Unlike the specialized modes, there are no name requirements,
+;; however the methods for writing a button display, menu, and keymap
+;; are the same.  Once you create these items, you can call the
+;; function `speedbar-add-expansion-list'.  It takes one parameter
+;; which is a list element of the form (NAME MENU KEYMAP &rest
+;; BUTTON-FUNCTIONS).  NAME is a string that will show up in the
+;; Displays menu item.  MENU is a symbol containing the menu items to
+;; splice in.  KEYMAP is a symbol holding the keymap to use, and
+;; BUTTON-FUNCTIONS are the function names to call, in order, to create
+;; the display.
+;;  Another tweakable variable is `speedbar-stealthy-function-list'
+;; which is of the form (NAME &rest FUNCTION ...).  NAME is the string
+;; name matching `speedbar-add-expansion-list'.  (It does not need to
+;; exist.). This provides additional display info which might be
+;; time-consuming to calculate.
+;;  Lastly, `speedbar-mode-functions-list' allows you to set special
+;; function overrides.
 
 ;;; TODO:
 ;; - Timeout directories we haven't visited in a while.
--- a/lisp/startup.el	Sat Feb 25 01:07:18 2006 +0000
+++ b/lisp/startup.el	Tue Feb 28 17:35:08 2006 +0000
@@ -652,7 +652,7 @@
   (let ((lisp-dir
 	 (file-name-directory
 	  (locate-file "simple" load-path
-		       load-suffixes))))
+		       (get-load-suffixes)))))
 
     (setq load-history
 	  (mapcar (lambda (elt)
--- a/lisp/subr.el	Sat Feb 25 01:07:18 2006 +0000
+++ b/lisp/subr.el	Tue Feb 28 17:35:08 2006 +0000
@@ -1324,12 +1324,13 @@
 and the file name is displayed in the echo area."
   (interactive (list (completing-read "Locate library: "
 				      'locate-file-completion
-				      (cons load-path load-suffixes))
+				      (cons load-path (get-load-suffixes)))
 		     nil nil
 		     t))
   (let ((file (locate-file library
 			   (or path load-path)
-			   (append (unless nosuffix load-suffixes) '("")))))
+			   (append (unless nosuffix (get-load-suffixes))
+				   load-file-rep-suffixes))))
     (if interactive-call
 	(if file
 	    (message "Library is file %s" (abbreviate-file-name file))
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lisp/t-mouse.el	Tue Feb 28 17:35:08 2006 +0000
@@ -0,0 +1,306 @@
+;;; t-mouse.el --- mouse support within the text terminal
+
+;; Authors: Alessandro Rubini and Ian T Zimmerman
+;; Maintainer: Nick Roberts <nickrob@gnu.org>
+;; Keywords: mouse gpm linux
+
+;; Copyright (C) 1994,1995 Alessandro Rubini <rubini@linux.it>
+;;               parts are by Ian T Zimmermann <itz@rahul.net>, 1995,1998
+;; Copyright (C) 2006 
+;; Free Software Foundation, Inc.
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING.  If not, write to the
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
+
+;;; Commentary:
+
+;; This package provides access to mouse event as reported by the
+;; gpm-Linux package. It uses the program "mev" to get mouse events.
+;; It tries to reproduce the functionality offered by emacs under X.
+;; The "gpm" server runs under Linux, so this package is rather
+;; Linux-dependent.
+
+;; Modified by Nick Roberts for Emacs 22.  In particular, the mode-line is
+;; now position sensitive.
+
+(defvar t-mouse-process nil 
+  "Embeds the process which passes mouse events to emacs.
+It is used by the program t-mouse.")
+
+(defvar t-mouse-filter-accumulator ""
+  "Accumulates input from the mouse reporting process.")
+
+(defvar t-mouse-debug-buffer nil
+  "Events normally posted to command queue are printed here in debug mode.
+See `t-mouse-start-debug'.")
+
+(defvar t-mouse-current-xy '(0 . 0)
+  "Stores the last mouse position t-mouse has been told about.")
+
+(defvar t-mouse-drag-start nil
+  "Whenever a drag starts in a special part of a window
+(not the text), the `translated' starting coordinates including the
+window and part involved are saved here.  This is necessary lest they
+get re-translated when the button goes up, at which time window
+configuration may have changed.")
+
+(defvar t-mouse-prev-set-selection-function 'x-set-selection)
+(defvar t-mouse-prev-get-selection-function 'x-get-selection)
+
+(defvar t-mouse-swap-alt-keys nil
+  "When set, Emacs will handle mouse events with the right Alt
+(a.k.a. Alt-Ger) modifier, not with the regular left Alt modifier.
+Useful for people who play strange games with their keyboard tables.")
+
+(defvar t-mouse-fix-21 nil 
+  "Enable brain-dead chords for 2 button mice.")
+
+
+;;; Code:
+
+;; get the number of the current virtual console
+
+(defun t-mouse-tty ()
+  "Returns number of virtual terminal Emacs is running on, as a string.
+For example, \"2\" for /dev/tty2."
+  (with-temp-buffer
+    (call-process "ps" nil t nil "h" (format "%s" (emacs-pid)))
+    (goto-char (point-min))
+    (if (or
+	 ;; Many versions of "ps", all different....
+	 (re-search-forward " +tty\\(.?[0-9a-f]\\)" nil t)
+	 (re-search-forward "p \\([0-9a-f]\\)" nil t)
+	 (re-search-forward "v0\\([0-9a-f]\\)" nil t)
+	 (re-search-forward "[0-9]+ +\\([0-9]+\\)" nil t)
+	 (re-search-forward "[\\t ]*[0-9]+[\\t ]+\\([0-9]+\\)" nil t)
+	 (re-search-forward " +vc/\\(.?[0-9a-f]\\)" nil t)
+	 (re-search-forward " +pts/\\(.?[0-9a-f]\\)" nil t))
+	(buffer-substring (match-beginning 1) (match-end 1)))))
+
+
+;; due to a horrible kludge in Emacs' keymap handler
+;; (read_key_sequence) mouse clicks on funny parts of windows generate
+;; TWO events, the first being a dummy of the sort '(mode-line).
+;; That's why Per Abrahamsen's code in xt-mouse.el doesn't work for
+;; the modeline, for instance.
+
+;; now get this:  the Emacs C code that generates these fake events
+;; depends on certain things done by the very lowest level input
+;; handlers; namely the symbols for the events (for instance
+;; 'C-S-double-mouse-2) must have an 'event-kind property, set to
+;; 'mouse-click.  Since events from unread-command-events do not pass
+;; through the low level handlers, they don't get this property unless
+;; I set it myself.  I imagine this has caused innumerable attempts by
+;; hackers to do things similar to t-mouse to lose.
+
+;; The next page of code is devoted to fixing this ugly problem.
+
+;; WOW! a fully general powerset generator
+;; (C) Ian Zimmerman Mon Mar 23 12:00:16 PST 1998 :-)
+(defun t-mouse-powerset (l)
+  (if (null l) '(nil)
+    (let ((l1 (t-mouse-powerset (cdr l)))
+          (first (nth 0 l)))
+      (append
+       (mapcar (function (lambda (l) (cons first l))) l1) l1))))
+
+;; and a slightly less general cartesian product
+(defun t-mouse-cartesian (l1 l2)
+  (if (null l1) l2
+    (append (mapcar (function (lambda (x) (append (nth 0 l1) x))) l2)
+            (t-mouse-cartesian (cdr l1) l2))))
+      
+(let* ((modifier-sets (t-mouse-powerset '(control meta shift)))
+       (typed-sets (t-mouse-cartesian '((down) (drag))
+                                      '((mouse-1) (mouse-2) (mouse-3))))
+       (multipled-sets (t-mouse-cartesian '((double) (triple)) typed-sets))
+       (all-sets (t-mouse-cartesian modifier-sets multipled-sets)))
+  (while all-sets
+    (let ((event-sym (event-convert-list (nth 0 all-sets))))
+      (if (not (get event-sym 'event-kind))
+          (put event-sym 'event-kind 'mouse-click)))
+    (setq all-sets (cdr all-sets))))
+
+(defun t-mouse-make-event-element (x-dot-y-avec-time)
+  (let* ((x-dot-y (nth 0 x-dot-y-avec-time))
+         (x (car x-dot-y))
+         (y (cdr x-dot-y))
+         (w (window-at x y))
+         (ltrb (window-edges w))
+         (left (nth 0 ltrb))
+         (top (nth 1 ltrb)))
+    (if w (posn-at-x-y (- x left) (- y top) w t)
+      (append (list nil 'menu-bar) (nthcdr 2 (posn-at-x-y x y w t))))))
+
+;;; This fun is partly Copyright (C) 1994 Per Abrahamsen <abraham@iesd.auc.dk>
+(defun t-mouse-make-event ()
+  "Makes a Lisp style event from the contents of mouse input accumulator.
+Also trims the accumulator by all the data used to build the event."
+  (let (ob (ob-pos (condition-case nil
+		       (progn
+			 ;; this test is just needed for Fedora Core 3
+			 (if (string-match "STILL RUNNING_1\n"
+					   t-mouse-filter-accumulator)
+			     (setq t-mouse-filter-accumulator
+				   (substring
+				    t-mouse-filter-accumulator (match-end 0))))
+			 (read-from-string t-mouse-filter-accumulator))
+                     (error nil))))
+    ;; this test is just needed for Fedora Core 3
+    (if (or (eq (car ob-pos) 'STILL) (eq (car ob-pos) '***) (not ob-pos))
+	nil
+      (setq ob (car ob-pos))
+      (setq t-mouse-filter-accumulator
+            (substring t-mouse-filter-accumulator (cdr ob-pos)))
+
+      ;;now the real work
+
+      (let ((event-type (nth 0 ob))
+            (current-xy-avec-time (nth 1 ob))
+            (type-switch (length ob)))
+ 	(if t-mouse-fix-21
+            (let
+                ;;Acquire the event's symbol's name.
+                ((event-name-string (symbol-name event-type))
+                 end-of-root-event-name
+                 new-event-name-string)
+ 
+              (if (string-match "-\\(21\\|\\12\\)$" event-name-string)
+ 
+                  ;;Transform the name to what it should have been.
+                  (progn
+                    (setq end-of-root-event-name (match-beginning 0))
+                    (setq new-event-name-string
+                          (concat (substring  
+                                   event-name-string 0
+                                   end-of-root-event-name) "-3"))
+ 	      
+                    ;;Change the event to the symbol that corresponds to the
+                    ;;name we made. The proper symbol already exists.
+                    (setq event-type 
+                          (intern new-event-name-string))))))
+ 	
+        ;;store current position for mouse-position
+
+        (setq t-mouse-current-xy (nth 0 current-xy-avec-time))
+
+        ;;events have many types but fortunately they differ in length
+
+        (cond
+         ((= type-switch 4)             ;must be drag
+          (let ((count (nth 2 ob))
+                (start-element
+                 (or t-mouse-drag-start
+                     (t-mouse-make-event-element (nth 3 ob))))
+                (end-element
+                 (t-mouse-make-event-element current-xy-avec-time)))
+            (setq t-mouse-drag-start nil)
+            (list event-type start-element end-element count)))
+         ((= type-switch 3)             ;down or up
+          (let ((count (nth 2 ob))
+                (element
+                 (t-mouse-make-event-element current-xy-avec-time)))
+            (if (and (not t-mouse-drag-start)
+                     (symbolp (nth 1 element)))
+                ;; OUCH! GOTCHA! emacs uses setc[ad]r on these!
+                (setq t-mouse-drag-start (copy-sequence element))
+              (setq t-mouse-drag-start nil))
+            (list event-type element count)))
+         ((= type-switch 2)             ;movement
+          (list (if (eq 'vertical-scroll-bar
+                        (nth 1 t-mouse-drag-start)) 'scroll-bar-movement
+                  'mouse-movement)
+                (t-mouse-make-event-element current-xy-avec-time))))))))
+
+(defun t-mouse-process-filter (proc string)
+  (setq t-mouse-filter-accumulator
+        (concat t-mouse-filter-accumulator string))
+  (let ((event (t-mouse-make-event)))
+    (while event
+      (if (or track-mouse 
+              (not (eq 'mouse-movement (event-basic-type event))))
+          (setq unread-command-events
+                (nconc unread-command-events (list event))))
+      (if t-mouse-debug-buffer
+          (print unread-command-events t-mouse-debug-buffer))
+      (setq event (t-mouse-make-event)))))
+
+(defun t-mouse-mouse-position-function (pos)
+  "Return the t-mouse-position unless running with a window system.
+The (secret) scrollbar interface is not implemented yet."
+  (setcdr pos t-mouse-current-xy)
+  pos)
+
+;; It should be possible to just send SIGTSTP to the inferior with
+;; stop-process.  That doesn't work; mev receives the signal fine but
+;; is not really stopped: instead it returns from
+;; kill(getpid(), SIGTSTP) immediately.  I don't understand what's up
+;; itz Tue Mar 24 14:27:38 PST 1998. 
+
+(add-hook 'suspend-hook
+          (function (lambda ()
+                      (and t-mouse-process
+                           ;(stop-process t-mouse-process)
+                           (process-send-string
+                            t-mouse-process "push -enone -dall -Mnone\n")))))
+
+(add-hook 'suspend-resume-hook
+          (function (lambda ()
+                      (and t-mouse-process
+                           ;(continue-process t-mouse-process)
+                           (process-send-string t-mouse-process "pop\n")))))
+
+;;;###autoload
+(define-minor-mode t-mouse-mode
+  "Toggle t-mouse mode.
+With prefix arg, turn t-mouse mode on iff arg is positive.
+
+Turn it on to use emacs mouse commands, and off to use t-mouse commands."
+  nil " Mouse" nil :global t
+  (if t-mouse-mode
+      ;; Turn it on
+      (unless window-system
+        ;; Starts getting a stream of mouse events from an asynchronous process.
+        ;; Only works if Emacs is running on a virtual terminal without a window system.
+	(progn
+	 (setq mouse-position-function #'t-mouse-mouse-position-function)
+	 (let ((tty (t-mouse-tty))
+	       (process-connection-type t))
+	   (if (not (stringp tty))
+	       (error "Cannot find a virtual terminal."))
+	   (setq t-mouse-process 
+		 (start-process "t-mouse" nil
+				"mev" "-i" "-E" "-C" tty
+				(if t-mouse-swap-alt-keys
+				    "-M-leftAlt" "-M-rightAlt")
+				"-e-move"
+				"-dall" "-d-hard"
+				"-f")))
+	 (setq t-mouse-filter-accumulator "")
+	 (set-process-filter t-mouse-process 't-mouse-process-filter)
+; use commented line instead for emacs 21.4 onwards
+	 (process-kill-without-query t-mouse-process)))
+;	 (set-process-query-on-exit-flag t-mouse-process nil)))
+    ;; Turn it off
+    (setq mouse-position-function nil)
+    (delete-process t-mouse-process)
+    (setq t-mouse-process nil)))
+
+(provide 't-mouse)
+
+;; arch-tag: a63163b3-bfbe-4eb2-ab4f-201cd164b05d
+;;; t-mouse.el ends here
--- a/lisp/textmodes/reftex-index.el	Sat Feb 25 01:07:18 2006 +0000
+++ b/lisp/textmodes/reftex-index.el	Tue Feb 28 17:35:08 2006 +0000
@@ -1034,6 +1034,7 @@
 ;; Index map
 (define-key reftex-index-map (if (featurep 'xemacs) [(button2)] [(mouse-2)])
   'reftex-index-mouse-goto-line-and-hide)
+(define-key reftex-index-map [follow-mouse] 'mouse-face)
 
 (substitute-key-definition
  'next-line 'reftex-index-next reftex-index-map global-map)
--- a/lisp/textmodes/reftex-sel.el	Sat Feb 25 01:07:18 2006 +0000
+++ b/lisp/textmodes/reftex-sel.el	Tue Feb 28 17:35:08 2006 +0000
@@ -685,7 +685,9 @@
   ;; The mouse-2 binding
   (if (featurep 'xemacs)
       (define-key map [(button2)] 'reftex-select-mouse-accept)
-    (define-key map [(mouse-2)] 'reftex-select-mouse-accept))
+    (define-key map [(mouse-2)] 'reftex-select-mouse-accept)
+    (define-key map [follow-link] 'mouse-face))
+    
 
   ;; Digit arguments
   (loop for key across "0123456789" do
--- a/lisp/textmodes/reftex-toc.el	Sat Feb 25 01:07:18 2006 +0000
+++ b/lisp/textmodes/reftex-toc.el	Tue Feb 28 17:35:08 2006 +0000
@@ -1011,6 +1011,7 @@
 ;; Table of Contents map
 (define-key reftex-toc-map (if (featurep 'xemacs) [(button2)] [(mouse-2)])
   'reftex-toc-mouse-goto-line-and-hide)
+(define-key reftex-toc-map [follow-mouse] 'mouse-face)
 
 (substitute-key-definition
  'next-line 'reftex-toc-next reftex-toc-map global-map)
--- a/lispref/ChangeLog	Sat Feb 25 01:07:18 2006 +0000
+++ b/lispref/ChangeLog	Tue Feb 28 17:35:08 2006 +0000
@@ -1,3 +1,18 @@
+2006-02-27  Luc Teirlinck  <teirllm@auburn.edu>
+
+	* elisp.texi (Top): Include "Load Suffixes" in the detailed menu.
+
+	* files.texi (Locating Files): Suggest additional values for the
+	SUFFIXES arg of `locate-file'.  Update pxref.
+
+	* loading.texi (Loading): Include new node "Load Suffixes" in menu.
+	(How Programs Do Loading): Discuss the effects of Auto Compression
+	mode on `load'.
+	(Load Suffixes): New node.
+	(Library Search): Delete description of `load-suffixes'; it was
+	moved to "Load Suffixes".
+	(Autoload, Named Features): Mention `load-suffixes'.
+
 2006-02-21  Giorgos Keramidas  <keramida@ceid.upatras.gr>  (tiny change)
 
 	* display.texi (Fringe Indicators, Fringe Cursors): Fix typos.
--- a/lispref/elisp.texi	Sat Feb 25 01:07:18 2006 +0000
+++ b/lispref/elisp.texi	Tue Feb 28 17:35:08 2006 +0000
@@ -78,7 +78,7 @@
 
 @ifnottex
 @node Top, Introduction, (dir), (dir)
-@top Emacs Lisp 
+@top Emacs Lisp
 
 This Info file contains edition @value{VERSION} of the GNU Emacs Lisp
 Reference Manual, corresponding to GNU Emacs version @value{EMACSVER}.
@@ -438,6 +438,7 @@
 Loading
 
 * How Programs Do Loading:: The @code{load} function and others.
+* Load Suffixes::           Details about the suffixes that @code{load} tries.
 * Library Search::          Finding a library to load.
 * Loading Non-ASCII::       Non-@acronym{ASCII} characters in Emacs Lisp files.
 * Autoload::                Setting up a function to autoload.
--- a/lispref/files.texi	Sat Feb 25 01:07:18 2006 +0000
+++ b/lispref/files.texi	Tue Feb 28 17:35:08 2006 +0000
@@ -1283,8 +1283,9 @@
 suffixes.  If @var{suffixes} is @code{nil}, or @code{("")}, then there
 are no suffixes, and @var{filename} is used only as-is.  Typical
 values of @var{suffixes} are @code{exec-suffixes} (@pxref{Subprocess
-Creation, exec-suffixes}) and @code{load-suffixes} (@pxref{Library
-Search, load-suffixes}).
+Creation, exec-suffixes}), @code{load-suffixes},
+@code{load-file-rep-suffixes} and the return value of the function
+@code{get-load-suffixes} (@pxref{Load Suffixes}).
 
 Typical values for @var{path} are @code{exec-path} (@pxref{Subprocess
 Creation, exec-path}) when looking for executable programs or
--- a/lispref/loading.texi	Sat Feb 25 01:07:18 2006 +0000
+++ b/lispref/loading.texi	Tue Feb 28 17:35:08 2006 +0000
@@ -36,6 +36,7 @@
 
 @menu
 * How Programs Do Loading:: The @code{load} function and others.
+* Load Suffixes::           Details about the suffixes that @code{load} tries.
 * Library Search::          Finding a library to load.
 * Loading Non-ASCII::       Non-@acronym{ASCII} characters in Emacs Lisp files.
 * Autoload::                Setting up a function to autoload.
@@ -72,17 +73,27 @@
 @var{filename}.  In the perverse case of a file named @file{foo.el.el},
 evaluation of @code{(load "foo.el")} will indeed find it.)
 
-If the optional argument @var{nosuffix} is non-@code{nil}, then the
-suffixes @samp{.elc} and @samp{.el} are not tried.  In this case, you
-must specify the precise file name you want.  By specifying the precise
-file name and using @code{t} for @var{nosuffix}, you can prevent
-perverse file names such as @file{foo.el.el} from being tried.
+If Auto Compression mode is enabled, as it is by default, then
+if @code{load} can not find a file, it searches for a compressed
+version of the file before trying other file names.  It decompresses
+and loads it if it exists.  It looks for compressed versions by
+appending the suffixes in @code{jka-compr-load-suffixes} to the file
+name.  The value of this variable must be a list of strings. Its
+standard value is @code{(".gz")}.
+
+If the optional argument @var{nosuffix} is non-@code{nil}, then
+@code{load} does not try the suffixes @samp{.elc} and @samp{.el}.  In
+this case, you must specify the precise file name you want, except
+that, if Auto Compression mode is enabled, @code{load} will still use
+@code{jka-compr-load-suffixes} to find compressed versions.  By
+specifying the precise file name and using @code{t} for
+@var{nosuffix}, you can prevent perverse file names such as
+@file{foo.el.el} from being tried.
 
 If the optional argument @var{must-suffix} is non-@code{nil}, then
 @code{load} insists that the file name used must end in either
-@samp{.el} or @samp{.elc}, unless it contains an explicit directory
-name.  If @var{filename} does not contain an explicit directory name,
-and does not end in a suffix, then @code{load} insists on adding one.
+@samp{.el} or @samp{.elc} (possibly extended with a compression
+suffix), unless it contains an explicit directory name.
 
 If @var{filename} is a relative file name, such as @file{foo} or
 @file{baz/foo.bar}, @code{load} searches for the file using the variable
@@ -127,8 +138,10 @@
 @deffn Command load-file filename
 This command loads the file @var{filename}.  If @var{filename} is a
 relative file name, then the current default directory is assumed.
-@code{load-path} is not used, and suffixes are not appended.  Use this
-command if you wish to specify precisely the file name to load.
+This command does not use @code{load-path}, and does not append
+suffixes.  However, it does look for compressed versions (if Auto
+Compression Mode is enabled).  Use this command if you wish to specify
+precisely the file name to load.
 @end deffn
 
 @deffn Command load-library library
@@ -158,6 +171,53 @@
   For information about how @code{load} is used in building Emacs, see
 @ref{Building Emacs}.
 
+@node Load Suffixes
+@section Load Suffixes
+We now describe some technical details about the exact suffixes that
+@code{load} tries.
+
+@defvar load-suffixes
+This is a list of suffixes indicating (compiled or source) Emacs Lisp
+files.  It should not include the empty string.  @code{load} uses
+these suffixes in order when it appends Lisp suffixes to the specified
+file name.  The standard value is @code{(".elc" "el")} which produces
+the behavior described in the previous section.
+@end defvar
+
+@defvar load-file-rep-suffixes
+This is a list of suffixes that indicate representations of the same
+file.  This list should normally start with the empty string.
+When @code{load} searches for a file it appends the suffixes in this
+list, in order, to the file name, before searching for another file.
+
+Enabling Auto Compression mode appends the suffixes in
+@code{jka-compr-load-suffixes} to this list and disabling Auto
+Compression mode removes them again.  The standard value of
+@code{load-file-rep-suffixes} if Auto Compression mode is disabled is
+@code{("")}.  Given that the standard value of
+@code{jka-compr-load-suffixes} is @code{(".gz")}, the standard value
+of @code{load-file-rep-suffixes} if Auto Compression mode is enabled
+is @code{("" ".gz")}.
+@end defvar
+
+@defun get-load-suffixes
+This function returns the list of all suffixes that @code{load} should
+try, in order, when its @var{must-suffix} argument is non-@code{nil}.
+This takes both @code{load-suffixes} and @code{load-file-rep-suffixes}
+into account.  If @code{load-suffixes}, @code{jka-compr-load-suffixes}
+and @code{load-file-rep-suffixes} all have their standard values, this
+function returns @code{(".elc" "elc.gz" ".el" ".el.gz")} if Auto
+Compression mode is enabled and @code{(".elc" ".el")} if Auto
+Compression mode is disabled.
+@end defun
+
+To summarize, if both its @var{nosuffix} and @var{must-suffix}
+arguments are @code{nil}, @code{load} first tries the suffixes in the
+return value of @code{get-load-suffixes} and then those in
+@code{load-file-rep-suffixes}.  If @var{nosuffix} is non-@code{nil},
+it only tries the latter and is @var{must-suffix} is non-@code{nil},
+only the former.
+
 @node Library Search
 @section Library Search
 
@@ -288,13 +348,6 @@
 tells @code{locate-library} to display the file name in the echo area.
 @end deffn
 
-@defvar load-suffixes
-This variable is a list of suffixes (strings) that @code{load} should
-try adding to the specified file name.  The default value is
-@code{(".elc" ".elc.gz" ".el" ".el.gz" ".gz")}.  There is no need to
-include the null suffix.
-@end defvar
-
 @node Loading Non-ASCII
 @section Loading Non-@acronym{ASCII} Characters
 
@@ -362,7 +415,8 @@
 If @var{filename} does not contain either a directory name, or the
 suffix @code{.el} or @code{.elc}, then @code{autoload} insists on adding
 one of these suffixes, and it will not load from a file whose name is
-just @var{filename} with no added suffix.
+just @var{filename} with no added suffix.  (The variable
+@code{load-suffixes} specifies the exact required suffixes.)
 
 The argument @var{docstring} is the documentation string for the
 function.  Specifying the documentation string in the call to
@@ -699,8 +753,10 @@
 with @code{load}.  If @var{filename} is not supplied, then the name of
 the symbol @var{feature} is used as the base file name to load.
 However, in this case, @code{require} insists on finding @var{feature}
-with an added suffix; a file whose name is just @var{feature} won't be
-used.
+with an added @samp{el} or @samp{.elc} suffix (possibly extended with
+a compression suffix); a file whose name is just @var{feature} won't
+be used.  (The variable @code{load-suffixes} specifies the exact
+required Lisp suffixes.)
 
 If @var{noerror} is non-@code{nil}, that suppresses errors from actual
 loading of the file.  In that case, @code{require} returns @code{nil}
--- a/man/ChangeLog	Sat Feb 25 01:07:18 2006 +0000
+++ b/man/ChangeLog	Tue Feb 28 17:35:08 2006 +0000
@@ -1,3 +1,35 @@
+2006-02-28  Andre Spiegel  <spiegel@gnu.org>
+
+	* files.texi (Old Versions): Clarify operation of C-x v =.
+
+2006-02-27  Simon Josefsson  <jas@extundo.com>
+
+	* emacs-mime.texi (Flowed text): Add mm-fill-flowed.  (Sync
+	2004-01-27 from the trunk).
+
+2006-02-24  Alan Mackenzie  <bug-cc-mode@gnu.org>
+
+	* cc-mode.texi: Rename c-hungry-backspace to
+	c-hungry-delete-backwards, at the request of RMS.  Leave the old
+	name as an alias.
+
+2006-02-24  Alan Mackenzie  <bug-cc-mode@gnu.org>
+
+	* cc-mode.texi: Correct the definition of c-beginning-of-defun, to
+	include the function header within the defun.
+
+2006-02-24  Alan Mackenzie  <bug-cc-mode@gnu.org>
+
+	* cc-mode.texi: Correct two typos.
+
+2006-02-24  Alan Mackenzie  <bug-cc-mode@gnu.org>
+
+	* cc-mode.texi (Comment Commands): State that C-u M-; kills any
+	existing comment.
+	(Electric Keys): Add a justification for electric indentation.
+	(Hungry WS Deletion): Clear up the names and complications of the
+	BACKSPACE and DELETE keys.
+	
 2006-02-23  Juri Linkov  <juri@jurta.org>
 
 	* faq.texi (Common requests): Move `Turning on auto-fill by
@@ -810,6 +842,13 @@
 	prefix keys even when mark is active.  Decribe that RET moves
 	cursor to next corner in rectangle; clarify insert around rectangle.
 
+2005-12-08  Alan Mackenzie <bug-cc-mode@gnu.org>
+
+	* cc-mode.texi: The manual has been extensively revised: the
+	information about using CC Mode has been separated from the larger
+	and more difficult chapters about configuration.  It has been
+	updated for CC Mode 5.31.
+
 2005-12-05  Katsumi Yamaoka  <yamaoka@jpl.org>
 
 	* pgg.texi (User Commands): Fix description of pgg-verify-region.
--- a/man/cc-mode.texi	Sat Feb 25 01:07:18 2006 +0000
+++ b/man/cc-mode.texi	Tue Feb 28 17:35:08 2006 +0000
@@ -210,7 +210,7 @@
 
 This manual was generated from $Revision$ of $RCSfile$, which can be
 downloaded from
-@url{http://cvs.sf.net/viewcvs.py/cc-mode/cc-mode/cc-mode.texi}.
+@url{http://cvs.savannah.gnu.org/viewcvs/emacs/emacs/man/cc-mode.texi}.
 @end titlepage
 
 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -447,7 +447,7 @@
 lists the standard styles that @ccmode{} supplies.
 
 @item
-The next few chapters, describe in detail how to customize the various
+The next few chapters describe in detail how to customize the various
 features of @ccmode{}.
 
 @item
@@ -525,7 +525,7 @@
 be disconcerting until you get used to it.  To disable @dfn{electric
 indentation} in the current buffer, type @kbd{C-c C-l}.  Type the same
 thing to enable it again.  To have electric indentation disabled by
-default, put the following into your @file{.emacs} mode@footnote{There
+default, put the following into your @file{.emacs} file@footnote{There
 is no ``easy customization'' facility for making this change.}:
 
 @example
@@ -836,8 +836,9 @@
 (@pxref{Comments,,, xemacs, XEmacs User's Manual})
 @end ifset
 and the variables below.  Finally, position the point after the
-comment starter.  This is a standard Emacs command, but @ccmode{}
-enhances it a bit with two variables:
+comment starter.  @kbd{C-u M-;} kills any comment on the current line,
+together with any whitespace before it.  This is a standard Emacs
+command, but @ccmode{} enhances it a bit with two variables:
 
 @defopt c-indent-comment-alist
 @vindex indent-comment-alist (c-)
@@ -887,12 +888,14 @@
 @findex end-of-defun (c-)
 @findex beginning-of-defun
 @findex end-of-defun
-Move to the start or end of the current top-level definition, this
-being the outermost brace pair which encloses point.  These functions
-are analogous to the Emacs built-in commands @code{beginning-of-defun}
-and @code{end-of-defun}, except they eliminate the constraint that the
-top-level opening brace of the defun must be in column zero.  See
-@ref{Defuns,,,@emacsman{}, @emacsmantitle{}}, for more information.
+Move to the start or end of the current top-level definition.  This is
+the outermost brace pair which encloses point, together with the
+function header or similar preamble which precedes the opening brace.
+These functions are analogous to the Emacs built-in commands
+@code{beginning-of-defun} and @code{end-of-defun}, except they
+eliminate the constraint that the top-level opening brace of the defun
+must be in column zero.  See @ref{Defuns,,,@emacsman{},
+@emacsmantitle{}}, for more information.
 
 Depending on the coding style you're using, you might prefer these two
 commands to the standard Emacs ones.  If so, consider binding them to
@@ -1220,15 +1223,16 @@
 
 Most punctuation keys provide @dfn{electric} behavior - as well as
 inserting themselves they perform some other action, such as
-reindenting the line.  A few keywords, such as @code{else}, also
-trigger electric action.
+reindenting the line.  This reindentation saves you from having to
+reindent a line manually after typing, say, a @samp{@}}.  A few
+keywords, such as @code{else}, also trigger electric action.
 
 You can inhibit the electric behaviour described here by disabling
-electric minor mode (@pxref{Minor Modes}.)
-
-Common to all of them is that they only behave electrically when used
-in normal code (as contrasted with getting typed in a string literal
-or comment).  Those which cause re-indentation do so only when
+electric minor mode (@pxref{Minor Modes}).
+
+Common to all these keys is that they only behave electrically when
+used in normal code (as contrasted with getting typed in a string
+literal or comment).  Those which cause re-indentation do so only when
 @code{c-syntactic-indentation} has a non-@code{nil} value (which it
 does by default).
 
@@ -1453,8 +1457,6 @@
 @cindex hungry-deletion
 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
-@kindex C-d
-
 If you want to delete an entire block of whitespace at point, you can
 use @dfn{hungry deletion}.  This deletes all the contiguous whitespace
 either before point or after point in a single operation.
@@ -1468,6 +1470,10 @@
 useful.  In fact, you might find yourself wanting it in @strong{all}
 your editing modes!
 
+Loosely speaking, in what follows, @dfn{@key{DEL}} means ``the
+backspace key'' and @dfn{@key{DELETE}} means ``the forward delete
+key''.  This is discussed in more detail below.
+
 There are two different ways you can use hungry deletion:
 
 @table @asis
@@ -1476,7 +1482,7 @@
 c-toggle-hungry-state}@footnote{Prior to @ccmode{} 5.31, this command
 was bound to @kbd{C-c C-d}.  @kbd{C-c C-d} is now the default binding
 for @code{c-hungry-delete-forward}.} (@pxref{Minor Modes}.)  This
-makes @kbd{@key{DEL}} and @kbd{C-d} do forward and backwards hungry
+makes @kbd{@key{DEL}} and @kbd{C-d} do backwards and forward hungry
 deletion.
 
 @table @asis
@@ -1524,61 +1530,62 @@
 
 @item Using Distinct Bindings
 The other (newer and recommended) way to use hungry deletion is to
-perform @code{c-hungry-backspace} and @code{c-hungry-delete-forward}
-directly through their key sequences rather than using the minor mode
-toggling.
+perform @code{c-hungry-delete-backwards} and
+@code{c-hungry-delete-forward} directly through their key sequences
+rather than using the minor mode toggling.
 
 @table @asis
-@item @kbd{C-c C-@key{Backspace}}, @kbd{C-c DEL}, or @kbd{C-c @key{Backspace}} (@code{c-hungry-backspace})
+@item @kbd{C-c C-@key{DEL}}, or @kbd{C-c @key{DEL}} (@code{c-hungry-delete-backwards})@footnote{This command was formerly known as @code{c-hungry-backspace}.}
 @kindex C-c C-<backspace>
+@kindex C-c <backspace>
+@kindex C-c C-DEL
 @kindex C-c DEL
-@kindex C-c <backspace>
-@findex c-hungry-backspace
-@findex hungry-backspace (c-)
+@findex c-hungry-delete-backwards
+@findex hungry-delete-backwards (c-)
 Delete any amount of whitespace in the backwards direction (regardless
 whether hungry-delete mode is enabled or not).  This command is bound
-to both @kbd{C-c C-@key{Backspace}} and @kbd{C-c @key{Backspace}},
-since the more natural one, @kbd{C-c C-@key{Backspace}}, is sometimes
-difficult to type at a character terminal.
-
-@item @kbd{C-c C-@key{Delete}}, @kbd{C-c C-d}, or @kbd{C-c @key{Delete}} (@code{c-hungry-delete-forward})
-@kindex C-c C-<delete>
+to both @kbd{C-c C-@key{DEL}} and @kbd{C-c @key{DEL}}, since the more
+natural one, @kbd{C-c C-@key{DEL}}, is sometimes difficult to type at
+a character terminal.
+
+@item @kbd{C-c C-d}, @kbd{C-c C-@key{DELETE}}, or @kbd{C-c @key{DELETE}} (@code{c-hungry-delete-forward})
 @kindex C-c C-d
-@kindex C-c <delete>
+@kindex C-c C-<DELETE>
+@kindex C-c <DELETE>
 @findex c-hungry-delete-forward
 @findex hungry-delete-forward (c-)
 Delete any amount of whitespace in the forward direction (regardless
 whether hungry-delete mode is enabled or not).  This command is bound
-to both @kbd{C-c C-@key{Delete}} and @kbd{C-c @key{Delete}} for the
-same reason as for @key{Backspace} above.
+to both @kbd{C-c C-@key{DELETE}} and @kbd{C-c @key{DELETE}} for the
+same reason as for @key{DEL} above.
 @end table
 @end table
 
 @kindex <delete>
 @kindex <backspace>
 
-When we talk about @kbd{DEL}, @kbd{C-d}, @key{Backspace} and
-@key{Delete} above, we actually do so without connecting them to the
-physical keys commonly known as @key{Backspace} and @key{Delete}.  The
-default bindings to those two keys depends on the flavor of (X)Emacs
-you are using.
+When we talk about @kbd{@key{DEL}}, and @kbd{@key{DELETE}} above, we
+actually do so without connecting them to the physical keys commonly
+known as @key{Backspace} and @key{Delete}.  The default bindings to
+those two keys depends on the flavor of (X)Emacs you are using.
 
 @findex c-electric-delete
 @findex electric-delete (c-)
 @findex c-hungry-delete
 @findex hungry-delete (c-)
 @vindex delete-key-deletes-forward
-
 In XEmacs 20.3 and beyond, the @key{Backspace} key is bound to
 @code{c-electric-backspace} and the @key{Delete} key is bound to
 @code{c-electric-delete}.  You control the direction it deletes in by
 setting the variable @code{delete-key-deletes-forward}, a standard
-XEmacs variable.  When this variable is non-@code{nil},
-@code{c-electric-delete} will do forward deletion with
-@code{c-electric-delete-forward}, otherwise it does backward deletion
-with @code{c-electric-backspace}.  Similarly, @kbd{C-c @key{Delete}}
-and @kbd{C-c C-@key{Delete}} are bound to @code{c-hungry-delete} which
-is controlled in the same way by @code{delete-key-deletes-forward}.
+XEmacs variable.
+@c This variable is encapsulated by XEmacs's (defsubst delete-forward-p ...).
+When this variable is non-@code{nil}, @code{c-electric-delete} will do
+forward deletion with @code{c-electric-delete-forward}, otherwise it
+does backward deletion with @code{c-electric-backspace}.  Similarly,
+@kbd{C-c @key{Delete}} and @kbd{C-c C-@key{Delete}} are bound to
+@code{c-hungry-delete} which is controlled in the same way by
+@code{delete-key-deletes-forward}.
 
 @findex normal-erase-is-backspace-mode
 
--- a/man/emacs-mime.texi	Sat Feb 25 01:07:18 2006 +0000
+++ b/man/emacs-mime.texi	Tue Feb 28 17:35:08 2006 +0000
@@ -983,7 +983,11 @@
 @code{fill-flowed-display-column}.  The default is to wrap after
 @code{fill-column}.
 
-
+@table @code
+@item mm-fill-flowed
+@vindex mm-fill-flowed
+If non-@code{nil} a format=flowed article will be displayed flowed.
+@end table
 
 
 @node Interface Functions
--- a/man/files.texi	Sat Feb 25 01:07:18 2006 +0000
+++ b/man/files.texi	Tue Feb 28 17:35:08 2006 +0000
@@ -1661,11 +1661,11 @@
 the options in @code{vc-rcs-diff-switches}.  The
 @samp{vc@dots{}diff-switches} variables are @code{nil} by default.
 
-  Unlike the @kbd{M-x diff} command, @kbd{C-x v =} does not try to
-locate the changes in the old and new versions.  This is because
-normally one or both versions do not exist as files when you compare
-them; they exist only in the records of the master file.
-@xref{Comparing Files}, for more information about @kbd{M-x diff}.
+  The buffer produced by @kbd{C-x v =} supports the commands of
+Compilation mode (@pxref{Compilation Mode}), such as @kbd{C-x `} and
+@kbd{C-c C-c}, in both the ``old'' and ``new'' text, and they always
+find the corresponding locations in the current work file.  (Older
+versions are not, in general, present as files on your disk.)
 
 @findex vc-annotate
 @kindex C-x v g
--- a/src/ChangeLog	Sat Feb 25 01:07:18 2006 +0000
+++ b/src/ChangeLog	Tue Feb 28 17:35:08 2006 +0000
@@ -1,3 +1,85 @@
+2006-02-26  Chong Yidong  <cyd@stupidchicken.com>
+
+	* xterm.h, xterm.c (x_uncatch_errors): Delete unneccessary
+	argument.
+
+	* xterm.c: (x_load_font, x_term_init, XTmouse_position)
+	(handle_one_xevent, x_connection_closed, x_list_fonts): No arg for
+	x_uncatch_errors.
+
+	* xselect.c (x_own_selection, x_decline_selection_request)
+	(x_reply_selection_request, x_get_foreign_selection)
+	(Fx_get_atom_name, Fx_send_client_event): Likewise.
+
+	* xfns.c (x_real_positions, x_set_mouse_color, Fx_focus_frame):
+	Likewise.
+
+2006-02-26  Luc Teirlinck  <teirllm@auburn.edu>
+
+	* lread.c: Declare Vload_file_rep_suffixes instead of
+	deleted variable default_suffixes.
+	(Fget_load_suffixes): New function.
+	(Fload): Use Fget_load_suffixes and Vload_file_rep_suffixes.
+	No longer use deleted variable default_suffixes.  Update docstring.
+	(syms_of_lread): defsubr Sget_load_suffixes.
+	Expand `load-suffixes' docstring.
+	Delete default_suffixes and DEFVAR_LISP the new variable
+	`load-file-rep-suffixes'.
+
+	* w32.c (check_windows_init_file): Use Fget_load_suffixes instead
+	of Vload_suffixes.
+
+	* lisp.h: EXFUN Fget_load_suffixes.
+	Extern Vload_file_rep_suffixes.
+
+	* eval.c (specpdl_ptr): Remove volatile qualifier for consistency
+	with lisp.h.
+
+2006-02-26  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* lisp.h (struct specbinding, specpdl_ptr): Remove the volatile
+	qualifier which was trying to avoid the bug that was fixed by
+	yesterday's changes to xterm.c.
+
+2006-02-25  Chong Yidong  <cyd@stupidchicken.com>
+
+	* xterm.h (x_catch_errors) Return value changed to void.
+	(x_uncatch_errors): Delete unused count argument.
+
+	* xterm.c (x_catch_errors): Don't use record_unwind_protect, since
+	it can be called in a signal handler.
+	(x_catch_errors_unwind): Function deleted.
+	(x_uncatch_errors): Deallocate last x_error_message_stack struct.
+	(x_check_errors): Call x_uncatch_errors before signalling error.
+
+	(x_load_font, x_term_init, XTmouse_position, handle_one_xevent)
+	(x_connection_closed, x_list_fonts): Use new versions of
+	x_catch_errors and x_uncatch_errors.
+
+	* xselect.c (x_own_selection, x_decline_selection_request)
+	(x_reply_selection_request, x_get_foreign_selection)
+	(Fx_get_atom_name, Fx_send_client_event): Likewise.
+
+	* xfns.c (x_real_positions, x_set_mouse_color, Fx_focus_frame):
+	Likewise.
+
+	* eval.c (record_unwind_protect): Add an assertion.
+
+2006-02-25  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* process.c (Fmake_network_process): Init the process's mark.
+
+2006-02-25  Kim F. Storm  <storm@cua.dk>
+
+	* buffer.c (modify_overlay): Force redisplay if we modify an
+	overlay at the end of the buffer.
+
+2006-02-24  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>
+
+	* gtkutil.c (xg_get_image_for_pixmap): If x_find_image_file returns
+	nil the image file has been removed, in that case use the (cached)
+	pixmap.
+
 2006-02-24  Kenichi Handa  <handa@m17n.org>
 
 	* fileio.c (Finsert_file_contents): When a text is replaced
--- a/src/buffer.c	Sat Feb 25 01:07:18 2006 +0000
+++ b/src/buffer.c	Tue Feb 28 17:35:08 2006 +0000
@@ -3679,6 +3679,10 @@
   /* If multiple windows show this buffer, we must do other windows.  */
   else if (buffer_shared > 1)
     windows_or_buffers_changed = 1;
+  /* If we modify an overlay at the end of the buffer, we cannot
+     be sure that window end is still valid.  */
+  else if (end >= ZV && start <= ZV)
+    windows_or_buffers_changed = 1;
 
   ++BUF_OVERLAY_MODIFF (buf);
 }
@@ -4120,6 +4124,7 @@
 	      == OVERLAY_POSITION (OVERLAY_END (overlay))))
 	Fdelete_overlay (overlay);
     }
+
   return value;
 }
 
--- a/src/eval.c	Sat Feb 25 01:07:18 2006 +0000
+++ b/src/eval.c	Tue Feb 28 17:35:08 2006 +0000
@@ -117,7 +117,7 @@
 
 /* Pointer to first unused element in specpdl.  */
 
-volatile struct specbinding *specpdl_ptr;
+struct specbinding *specpdl_ptr;
 
 /* Maximum size allowed for specpdl allocation */
 
@@ -3199,6 +3199,8 @@
      Lisp_Object (*function) P_ ((Lisp_Object));
      Lisp_Object arg;
 {
+  eassert (!handling_signal);
+
   if (specpdl_ptr == specpdl + specpdl_size)
     grow_specpdl ();
   specpdl_ptr->func = function;
--- a/src/gtkutil.c	Sat Feb 25 01:07:18 2006 +0000
+++ b/src/gtkutil.c	Tue Feb 28 17:35:08 2006 +0000
@@ -327,6 +327,7 @@
      look good in all cases.  */
   Lisp_Object specified_file = Qnil;
   Lisp_Object tail;
+  Lisp_Object file;
   extern Lisp_Object QCfile;
 
   for (tail = XCDR (img->spec);
@@ -335,23 +336,18 @@
     if (EQ (XCAR (tail), QCfile))
       specified_file = XCAR (XCDR (tail));
 
-  if (STRINGP (specified_file))
+  /* We already loaded the image once before calling this
+     function, so this only fails if the image file has been removed.
+     In that case, use the pixmap already loaded.  */
+
+  if (STRINGP (specified_file)
+      && STRINGP (file = x_find_image_file (specified_file)))
     {
-      Lisp_Object file = Qnil;
-      struct gcpro gcpro1;
-      GCPRO1 (file);
-
-      file = x_find_image_file (specified_file);
-      /* We already loaded the image once before calling this
-         function, so this should not fail.  */
-      xassert (STRINGP (file) != 0);
-
       if (! old_widget)
         old_widget = GTK_IMAGE (gtk_image_new_from_file (SSDATA (file)));
       else
         gtk_image_set_from_file (old_widget, SSDATA (file));
 
-      UNGCPRO;
       return GTK_WIDGET (old_widget);
     }
 
--- a/src/lisp.h	Sat Feb 25 01:07:18 2006 +0000
+++ b/src/lisp.h	Tue Feb 28 17:35:08 2006 +0000
@@ -1744,13 +1744,13 @@
 
 struct specbinding
   {
-    volatile Lisp_Object symbol, old_value;
-    volatile specbinding_func func;
+    Lisp_Object symbol, old_value;
+    specbinding_func func;
     Lisp_Object unused;		/* Dividing by 16 is faster than by 12 */
   };
 
 extern struct specbinding *specpdl;
-extern volatile struct specbinding *specpdl_ptr;
+extern struct specbinding *specpdl_ptr;
 extern int specpdl_size;
 
 extern EMACS_INT max_specpdl_size;
@@ -2603,6 +2603,7 @@
 EXFUN (Fintern, 2);
 EXFUN (Fintern_soft, 2);
 EXFUN (Fload, 5);
+EXFUN (Fget_load_suffixes, 0);
 EXFUN (Fget_file_char, 0);
 EXFUN (Fread_char, 2);
 EXFUN (Fread_event, 2);
@@ -2614,7 +2615,7 @@
 #define LOADHIST_ATTACH(x) \
  if (initialized) Vcurrent_load_list = Fcons (x, Vcurrent_load_list)
 extern Lisp_Object Vcurrent_load_list;
-extern Lisp_Object Vload_history, Vload_suffixes;
+extern Lisp_Object Vload_history, Vload_suffixes, Vload_file_rep_suffixes;
 extern int openp P_ ((Lisp_Object, Lisp_Object, Lisp_Object,
 		      Lisp_Object *, Lisp_Object));
 extern int isfloat_string P_ ((char *));
--- a/src/lread.c	Sat Feb 25 01:07:18 2006 +0000
+++ b/src/lread.c	Tue Feb 28 17:35:08 2006 +0000
@@ -100,7 +100,7 @@
 Lisp_Object Vsource_directory;
 
 /* Search path and suffixes for files to be loaded. */
-Lisp_Object Vload_path, Vload_suffixes, default_suffixes;
+Lisp_Object Vload_path, Vload_suffixes, Vload_file_rep_suffixes;
 
 /* File name of user's init file.  */
 Lisp_Object Vuser_init_file;
@@ -655,28 +655,64 @@
   return Qnil;
 }
 
+DEFUN ("get-load-suffixes", Fget_load_suffixes, Sget_load_suffixes, 0, 0, 0,
+       doc: /* Return the suffixes that `load' should try if a suffix is \
+required.
+This uses the variables `load-suffixes' and `load-file-rep-suffixes'.  */)
+     ()
+{
+  Lisp_Object lst = Qnil, suffixes = Vload_suffixes, suffix, ext;
+  while (CONSP (suffixes))
+    {
+      Lisp_Object exts = Vload_file_rep_suffixes;
+      suffix = XCAR (suffixes);
+      suffixes = XCDR (suffixes);
+      while (CONSP (exts))
+	{
+	  ext = XCAR (exts);
+	  exts = XCDR (exts);
+	  lst = Fcons (concat2 (suffix, ext), lst);
+	}
+    }
+  return Fnreverse (lst);
+}
+
 DEFUN ("load", Fload, Sload, 1, 5, 0,
        doc: /* Execute a file of Lisp code named FILE.
 First try FILE with `.elc' appended, then try with `.el',
- then try FILE unmodified (the exact suffixes are determined by
-`load-suffixes').  Environment variable references in FILE
- are replaced with their values by calling `substitute-in-file-name'.
+then try FILE unmodified (the exact suffixes in the exact order are
+determined by  `load-suffixes').  Environment variable references in
+FILE are replaced with their values by calling `substitute-in-file-name'.
 This function searches the directories in `load-path'.
+
 If optional second arg NOERROR is non-nil,
- report no error if FILE doesn't exist.
+report no error if FILE doesn't exist.
 Print messages at start and end of loading unless
- optional third arg NOMESSAGE is non-nil.
+optional third arg NOMESSAGE is non-nil.
 If optional fourth arg NOSUFFIX is non-nil, don't try adding
- suffixes `.elc' or `.el' to the specified name FILE.
+suffixes `.elc' or `.el' to the specified name FILE.
 If optional fifth arg MUST-SUFFIX is non-nil, insist on
- the suffix `.elc' or `.el'; don't accept just FILE unless
- it ends in one of those suffixes or includes a directory name.
+the suffix `.elc' or `.el'; don't accept just FILE unless
+it ends in one of those suffixes or includes a directory name.
+
+If this function fails to find a file, it may look for different
+representations of that file before trying another file.
+It does so by adding the non-empty suffixes in `load-file-rep-suffixes'
+to the file name.  Emacs uses this feature mainly to find compressed
+versions of files when Auto Compression mode is enabled.
+
+The exact suffixes that this function tries out, in the exact order,
+are given by the value of the variable `load-file-rep-suffixes' if
+NOSUFFIX is non-nil and by the return value of the function
+`get-load-suffixes' if MUST-SUFFIX is non-nil.  If both NOSUFFIX and
+MUST-SUFFIX are nil, this function first tries out the latter suffixes
+and then the former.
 
 Loading a file records its definitions, and its `provide' and
 `require' calls, in an element of `load-history' whose
 car is the file name loaded.  See `load-history'.
 
-Return t if file exists.  */)
+Return t if the file exists and loads successfully.  */)
      (file, noerror, nomessage, nosuffix, must_suffix)
      Lisp_Object file, noerror, nomessage, nosuffix, must_suffix;
 {
@@ -751,9 +787,9 @@
 
       fd = openp (Vload_path, file,
 		  (!NILP (nosuffix) ? Qnil
-		   : !NILP (must_suffix) ? Vload_suffixes
-		   : Fappend (2, (tmp[0] = Vload_suffixes,
-				  tmp[1] = default_suffixes,
+		   : !NILP (must_suffix) ? Fget_load_suffixes ()
+		   : Fappend (2, (tmp[0] = Fget_load_suffixes (),
+				  tmp[1] = Vload_file_rep_suffixes,
 				  tmp))),
 		  &found, Qnil);
       UNGCPRO;
@@ -1111,7 +1147,7 @@
 	fn = (char *) alloca (fn_size = 100 + want_size);
 
       /* Loop over suffixes.  */
-      for (tail = NILP (suffixes) ? default_suffixes : suffixes;
+      for (tail = NILP (suffixes) ? Fcons (build_string (""), Qnil) : suffixes;
 	   CONSP (tail); tail = XCDR (tail))
 	{
 	  int lsuffix = SBYTES (XCAR (tail));
@@ -3842,6 +3878,7 @@
   defsubr (&Sintern);
   defsubr (&Sintern_soft);
   defsubr (&Sunintern);
+  defsubr (&Sget_load_suffixes);
   defsubr (&Sload);
   defsubr (&Seval_buffer);
   defsubr (&Seval_region);
@@ -3903,13 +3940,27 @@
 otherwise to default specified by file `epaths.h' when Emacs was built.  */);
 
   DEFVAR_LISP ("load-suffixes", &Vload_suffixes,
-	       doc: /* *List of suffixes to try for files to load.
-This list should not include the empty string.  */);
+	       doc: /* List of suffixes for (compiled or source) Emacs Lisp files.
+This list should not include the empty string.
+`load' and related functions try to append these suffixes, in order,
+to the specified file name if a Lisp suffix is allowed or required.  */);
   Vload_suffixes = Fcons (build_string (".elc"),
 			  Fcons (build_string (".el"), Qnil));
+  DEFVAR_LISP ("load-file-rep-suffixes", &Vload_file_rep_suffixes,
+	       doc: /* List of suffixes that indicate representations of \
+the same file.
+This list should normally start with the empty string.
+
+Enabling Auto Compression mode appends the suffixes in
+`jka-compr-load-suffixes' to this list and disabling Auto Compression
+mode removes them again.  `load' and related functions use this list to
+determine whether they should look for compressed versions of a file
+and, if so, which suffixes they should try to append to the file name
+in order to do so.  However, if you want to customize which suffixes
+the loading functions recognize as compression suffixes, you should
+customize `jka-compr-load-suffixes' rather than the present variable.  */);
   /* We don't use empty_string because it's not initialized yet.  */
-  default_suffixes = Fcons (build_string (""), Qnil);
-  staticpro (&default_suffixes);
+  Vload_file_rep_suffixes = Fcons (build_string (""), Qnil);
 
   DEFVAR_BOOL ("load-in-progress", &load_in_progress,
 	       doc: /* Non-nil iff inside of `load'.  */);
--- a/src/process.c	Sat Feb 25 01:07:18 2006 +0000
+++ b/src/process.c	Tue Feb 28 17:35:08 2006 +0000
@@ -1582,7 +1582,7 @@
 #endif
 
   /* Make the process marker point into the process buffer (if any).  */
-  if (!NILP (buffer))
+  if (BUFFERP (buffer))
     set_marker_both (XPROCESS (proc)->mark, buffer,
 		     BUF_ZV (XBUFFER (buffer)),
 		     BUF_ZV_BYTE (XBUFFER (buffer)));
@@ -3360,6 +3360,12 @@
   if (is_server && socktype == SOCK_STREAM)
     p->status = Qlisten;
 
+  /* Make the process marker point into the process buffer (if any).  */
+  if (BUFFERP (buffer))
+    set_marker_both (p->mark, buffer,
+		     BUF_ZV (XBUFFER (buffer)),
+		     BUF_ZV_BYTE (XBUFFER (buffer)));
+
 #ifdef NON_BLOCKING_CONNECT
   if (is_non_blocking_client)
     {
--- a/src/w32.c	Sat Feb 25 01:07:18 2006 +0000
+++ b/src/w32.c	Tue Feb 28 17:35:08 2006 +0000
@@ -3888,7 +3888,7 @@
       objs[1] = decode_env_path (0, (getenv ("EMACSLOADPATH")));
       full_load_path = Fappend (2, objs);
       init_file = build_string ("term/w32-win");
-      fd = openp (full_load_path, init_file, Vload_suffixes, NULL, Qnil);
+      fd = openp (full_load_path, init_file, Fget_load_suffixes (), NULL, Qnil);
       if (fd < 0)
 	{
 	  Lisp_Object load_path_print = Fprin1_to_string (full_load_path, Qnil);
--- a/src/xfns.c	Sat Feb 25 01:07:18 2006 +0000
+++ b/src/xfns.c	Tue Feb 28 17:35:08 2006 +0000
@@ -588,11 +588,9 @@
   int had_errors = 0;
   Window win = f->output_data.x->parent_desc;
 
-  int count;
-
   BLOCK_INPUT;
 
-  count = x_catch_errors (FRAME_X_DISPLAY (f));
+  x_catch_errors (FRAME_X_DISPLAY (f));
 
   if (win == FRAME_X_DISPLAY_INFO (f)->root_window)
     win = FRAME_OUTER_WINDOW (f);
@@ -679,7 +677,7 @@
       had_errors = x_had_errors_p (FRAME_X_DISPLAY (f));
     }
 
-  x_uncatch_errors (FRAME_X_DISPLAY (f), count);
+  x_uncatch_errors ();
 
   UNBLOCK_INPUT;
 
@@ -957,7 +955,6 @@
   Display *dpy = FRAME_X_DISPLAY (f);
   Cursor cursor, nontext_cursor, mode_cursor, hand_cursor;
   Cursor hourglass_cursor, horizontal_drag_cursor;
-  int count;
   unsigned long pixel = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f));
   unsigned long mask_color = x->background_pixel;
 
@@ -974,7 +971,7 @@
   BLOCK_INPUT;
 
   /* It's not okay to crash if the user selects a screwy cursor.  */
-  count = x_catch_errors (dpy);
+  x_catch_errors (dpy);
 
   if (!NILP (Vx_pointer_shape))
     {
@@ -1035,7 +1032,7 @@
 
   /* Check and report errors with the above calls.  */
   x_check_errors (dpy, "can't set cursor shape: %s");
-  x_uncatch_errors (dpy, count);
+  x_uncatch_errors ();
 
   {
     XColor fore_color, back_color;
@@ -3458,13 +3455,12 @@
 {
   struct frame *f = check_x_frame (frame);
   Display *dpy = FRAME_X_DISPLAY (f);
-  int count;
 
   BLOCK_INPUT;
-  count = x_catch_errors (dpy);
+  x_catch_errors (dpy);
   XSetInputFocus (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
 		  RevertToParent, CurrentTime);
-  x_uncatch_errors (dpy, count);
+  x_uncatch_errors ();
   UNBLOCK_INPUT;
 
   return Qnil;
--- a/src/xselect.c	Sat Feb 25 01:07:18 2006 +0000
+++ b/src/xselect.c	Tue Feb 28 17:35:08 2006 +0000
@@ -402,7 +402,6 @@
   Time time = last_event_timestamp;
   Atom selection_atom;
   struct x_display_info *dpyinfo;
-  int count;
 
   if (! FRAME_X_P (sf))
     return;
@@ -415,10 +414,10 @@
   selection_atom = symbol_to_x_atom (dpyinfo, display, selection_name);
 
   BLOCK_INPUT;
-  count = x_catch_errors (display);
+  x_catch_errors (display);
   XSetSelectionOwner (display, selection_atom, selecting_window, time);
   x_check_errors (display, "Can't set selection: %s");
-  x_uncatch_errors (display, count);
+  x_uncatch_errors ();
   UNBLOCK_INPUT;
 
   /* Now update the local cache */
@@ -579,7 +578,6 @@
      struct input_event *event;
 {
   XSelectionEvent reply;
-  int count;
 
   reply.type = SelectionNotify;
   reply.display = SELECTION_EVENT_DISPLAY (event);
@@ -592,10 +590,10 @@
   /* The reason for the error may be that the receiver has
      died in the meantime.  Handle that case.  */
   BLOCK_INPUT;
-  count = x_catch_errors (reply.display);
+  x_catch_errors (reply.display);
   XSendEvent (reply.display, reply.requestor, False, 0L, (XEvent *) &reply);
   XFlush (reply.display);
-  x_uncatch_errors (reply.display, count);
+  x_uncatch_errors ();
   UNBLOCK_INPUT;
 }
 
@@ -698,7 +696,7 @@
   int format_bytes = format/8;
   int max_bytes = SELECTION_QUANTUM (display);
   struct x_display_info *dpyinfo = x_display_info_for_display (display);
-  int count;
+  int count = SPECPDL_INDEX ();
 
   if (max_bytes > MAX_SELECTION_QUANTUM)
     max_bytes = MAX_SELECTION_QUANTUM;
@@ -715,7 +713,7 @@
 
   /* #### XChangeProperty can generate BadAlloc, and we must handle it! */
   BLOCK_INPUT;
-  count = x_catch_errors (display);
+  x_catch_errors (display);
 
 #ifdef TRACE_SELECTION
   {
@@ -868,7 +866,9 @@
      UNBLOCK to enter the event loop and get possible errors delivered,
      and then BLOCK again because x_uncatch_errors requires it.  */
   BLOCK_INPUT;
-  x_uncatch_errors (display, count);
+
+  unbind_to (count, Qnil);
+  x_uncatch_errors ();
   UNBLOCK_INPUT;
 }
 
@@ -1409,7 +1409,7 @@
 
   BLOCK_INPUT;
 
-  count = x_catch_errors (display);
+  x_catch_errors (display);
 
   TRACE2 ("Get selection %s, type %s",
 	  XGetAtomName (display, type_atom),
@@ -1426,6 +1426,8 @@
 
   frame = some_frame_on_display (dpyinfo);
 
+  count = SPECPDL_INDEX ();
+
   /* If the display no longer has frames, we can't expect
      to get many more selection requests from it, so don't
      bother trying to queue them.  */
@@ -1447,8 +1449,9 @@
   TRACE1 ("  Got event = %d", !NILP (XCAR (reading_selection_reply)));
 
   BLOCK_INPUT;
+  unbind_to (count, Qnil);
   x_check_errors (display, "Cannot get selection: %s");
-  x_uncatch_errors (display, count);
+  x_uncatch_errors ();
   UNBLOCK_INPUT;
 
   if (NILP (XCAR (reading_selection_reply)))
@@ -2682,7 +2685,6 @@
   struct frame *f = check_x_frame (frame);
   char *name = 0;
   Lisp_Object ret = Qnil;
-  int count;
   Display *dpy = FRAME_X_DISPLAY (f);
   Atom atom;
 
@@ -2696,14 +2698,14 @@
     error ("Wrong type, value must be number or cons");
 
   BLOCK_INPUT;
-  count = x_catch_errors (dpy);
+  x_catch_errors (dpy);
 
   name = atom ? XGetAtomName (dpy, atom) : "";
 
   if (! x_had_errors_p (dpy))
     ret = make_string (name, strlen (name));
 
-  x_uncatch_errors (dpy, count);
+  x_uncatch_errors ();
 
   if (atom && name) XFree (name);
   if (NILP (ret)) ret = make_string ("", 0);
@@ -2803,7 +2805,6 @@
   Lisp_Object cons;
   int size;
   struct frame *f = check_x_frame (from);
-  int count;
   int to_root;
 
   CHECK_STRING (message_type);
@@ -2873,14 +2874,14 @@
      the destination window.  But if we are sending to the root window,
      there is no such client.  Then we set the event mask to 0xffff.  The
      event then goes to clients selecting for events on the root window.  */
-  count = x_catch_errors (dpyinfo->display);
+  x_catch_errors (dpyinfo->display);
   {
     int propagate = to_root ? False : True;
     unsigned mask = to_root ? 0xffff : 0;
     XSendEvent (dpyinfo->display, wdest, propagate, mask, &event);
     XFlush (dpyinfo->display);
   }
-  x_uncatch_errors (dpyinfo->display, count);
+  x_uncatch_errors ();
   UNBLOCK_INPUT;
 
   return Qnil;
--- a/src/xterm.c	Sat Feb 25 01:07:18 2006 +0000
+++ b/src/xterm.c	Tue Feb 28 17:35:08 2006 +0000
@@ -327,8 +327,8 @@
 void x_delete_display P_ ((struct x_display_info *));
 
 static int x_io_error_quitter P_ ((Display *));
-int x_catch_errors P_ ((Display *));
-void x_uncatch_errors P_ ((Display *, int));
+void x_catch_errors P_ ((Display *));
+void x_uncatch_errors P_ ((void));
 void x_lower_frame P_ ((struct frame *));
 void x_scroll_bar_clear P_ ((struct frame *));
 int x_had_errors_p P_ ((Display *));
@@ -3726,7 +3726,6 @@
 	Window win, child;
 	int win_x, win_y;
 	int parent_x = 0, parent_y = 0;
-	int count;
 
 	win = root;
 
@@ -3734,7 +3733,7 @@
 	   structure is changing at the same time this function
 	   is running.  So at least we must not crash from them.  */
 
-	count = x_catch_errors (FRAME_X_DISPLAY (*fp));
+	x_catch_errors (FRAME_X_DISPLAY (*fp));
 
 	if (FRAME_X_DISPLAY_INFO (*fp)->grabbed && last_mouse_frame
 	    && FRAME_LIVE_P (last_mouse_frame))
@@ -3803,7 +3802,7 @@
 	if (x_had_errors_p (FRAME_X_DISPLAY (*fp)))
 	  f1 = 0;
 
-	x_uncatch_errors (FRAME_X_DISPLAY (*fp), count);
+	x_uncatch_errors ();
 
 	/* If not, is it one of our scroll bars?  */
 	if (! f1)
@@ -5726,7 +5725,7 @@
                     Display *d = event.xclient.display;
                     /* Catch and ignore errors, in case window has been
                        iconified by a window manager such as GWM.  */
-                    int count = x_catch_errors (d);
+                    x_catch_errors (d);
                     XSetInputFocus (d, event.xclient.window,
                                     /* The ICCCM says this is
                                        the only valid choice.  */
@@ -5735,7 +5734,7 @@
                     /* This is needed to detect the error
                        if there is an error.  */
                     XSync (d, False);
-                    x_uncatch_errors (d, count);
+                    x_uncatch_errors ();
                   }
                 /* Not certain about handling scroll bars here */
 #endif /* 0 */
@@ -7483,7 +7482,11 @@
 #define X_ERROR_MESSAGE_SIZE 200
 
 /* If non-nil, this should be a string.
-   It means catch X errors  and store the error message in this string.  */
+   It means catch X errors  and store the error message in this string.
+
+   The reason we use a stack is that x_catch_error/x_uncatch_error can
+   be called from a signal handler.
+*/
 
 struct x_error_message_stack {
   char string[X_ERROR_MESSAGE_SIZE];
@@ -7520,20 +7523,12 @@
    Calling x_uncatch_errors resumes the normal error handling.  */
 
 void x_check_errors ();
-static Lisp_Object x_catch_errors_unwind ();
-
-int
+
+void
 x_catch_errors (dpy)
      Display *dpy;
 {
-  int count = SPECPDL_INDEX ();
   struct x_error_message_stack *data = xmalloc (sizeof (*data));
-  Lisp_Object dummy;
-#ifdef ENABLE_CHECKING
-  dummy = make_number ((EMACS_INT)dpy + (EMACS_INT)x_error_message);
-#else
-  dummy = Qnil;
-#endif
 
   /* Make sure any errors from previous requests have been dealt with.  */
   XSync (dpy, False);
@@ -7542,43 +7537,28 @@
   data->string[0] = 0;
   data->prev = x_error_message;
   x_error_message = data;
-
-  record_unwind_protect (x_catch_errors_unwind, dummy);
-
-  return count;
-}
-
-/* Unbind the binding that we made to check for X errors.  */
-
-static Lisp_Object
-x_catch_errors_unwind (dummy)
-     Lisp_Object dummy;
-{
-  Display *dpy;
+}
+
+/* Undo the last x_catch_errors call.
+   DPY should be the display that was passed to x_catch_errors.  */
+
+void
+x_uncatch_errors ()
+{
   struct x_error_message_stack *tmp;
 
-  if (!x_error_message)
-    abort ();
-
-  dpy = x_error_message->dpy;
-
   /* The display may have been closed before this function is called.
      Check if it is still open before calling XSync.  */
-  if (x_display_info_for_display (dpy) != 0)
+  if (x_display_info_for_display (x_error_message->dpy) != 0)
     {
       BLOCK_INPUT;
-      XSync (dpy, False);
+      XSync (x_error_message->dpy, False);
       UNBLOCK_INPUT;
     }
 
   tmp = x_error_message;
   x_error_message = x_error_message->prev;
-  free (tmp);
-
-  eassert (EQ (dummy,
-	       make_number ((EMACS_INT)dpy + (EMACS_INT)x_error_message)));
-
-  return Qnil;
+  xfree (tmp);
 }
 
 /* If any X protocol errors have arrived since the last call to
@@ -7594,7 +7574,12 @@
   XSync (dpy, False);
 
   if (x_error_message->string[0])
-    error (format, x_error_message->string);
+    {
+      char string[X_ERROR_MESSAGE_SIZE];
+      bcopy (x_error_message->string, string, X_ERROR_MESSAGE_SIZE);
+      x_uncatch_errors ();
+      error (format, string);
+    }
 }
 
 /* Nonzero if we had any X protocol errors
@@ -7619,19 +7604,6 @@
   x_error_message->string[0] = 0;
 }
 
-/* Stop catching X protocol errors and let them make Emacs die.
-   DPY should be the display that was passed to x_catch_errors.
-   COUNT should be the value that was returned by
-   the corresponding call to x_catch_errors.  */
-
-void
-x_uncatch_errors (dpy, count)
-     Display *dpy;
-     int count;
-{
-  unbind_to (count, Qnil);
-}
-
 #if 0
 static unsigned int x_wire_count;
 x_trace_wire ()
@@ -7688,7 +7660,6 @@
 {
   struct x_display_info *dpyinfo = x_display_info_for_display (dpy);
   Lisp_Object frame, tail;
-  int count;
   int index = SPECPDL_INDEX ();
 
   error_msg = (char *) alloca (strlen (error_message) + 1);
@@ -7699,7 +7670,7 @@
      below.  Otherwise, we might end up with printing ``can't find per
      display information'' in the recursive call instead of printing
      the original message here.  */
-  count = x_catch_errors (dpy);
+  x_catch_errors (dpy);
 
   /* Inhibit redisplay while frames are being deleted. */
   specbind (Qinhibit_redisplay, Qt);
@@ -7785,7 +7756,7 @@
       x_delete_display (dpyinfo);
     }
 
-  x_uncatch_errors (dpy, count);
+  x_uncatch_errors ();
 
   if (terminal_list == 0)
     {
@@ -9393,7 +9364,6 @@
     = f ? FRAME_X_DISPLAY_INFO (f) : x_display_list;
   Display *dpy = dpyinfo->display;
   int try_XLoadQueryFont = 0;
-  int count;
   int allow_auto_scaled_font = 0;
 
   if (size < 0)
@@ -9433,7 +9403,7 @@
       /* At first, put PATTERN in the cache.  */
 
       BLOCK_INPUT;
-      count = x_catch_errors (dpy);
+      x_catch_errors (dpy);
 
       if (try_XLoadQueryFont)
 	{
@@ -9514,7 +9484,7 @@
 	    }
 	}
 
-      x_uncatch_errors (dpy, count);
+      x_uncatch_errors ();
       UNBLOCK_INPUT;
 
       if (names)
@@ -9605,7 +9575,7 @@
 	      XFontStruct *thisinfo;
 
 	      BLOCK_INPUT;
-	      count = x_catch_errors (dpy);
+	      x_catch_errors (dpy);
 	      thisinfo = XLoadQueryFont (dpy,
 					 SDATA (XCAR (tem)));
 	      if (x_had_errors_p (dpy))
@@ -9615,7 +9585,7 @@
 		  thisinfo = NULL;
 		  x_clear_errors (dpy);
 		}
-	      x_uncatch_errors (dpy, count);
+	      x_uncatch_errors ();
 	      UNBLOCK_INPUT;
 
 	      if (thisinfo)
@@ -9771,7 +9741,6 @@
 {
   struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
   Lisp_Object font_names;
-  int count;
 
   /* Get a list of all the fonts that match this name.  Once we
      have a list of matching fonts, we compare them against the fonts
@@ -9810,7 +9779,7 @@
       fontname = (char *) SDATA (XCAR (font_names));
 
     BLOCK_INPUT;
-    count = x_catch_errors (FRAME_X_DISPLAY (f));
+    x_catch_errors (FRAME_X_DISPLAY (f));
     font = (XFontStruct *) XLoadQueryFont (FRAME_X_DISPLAY (f), fontname);
     if (x_had_errors_p (FRAME_X_DISPLAY (f)))
       {
@@ -9819,7 +9788,7 @@
 	font = NULL;
 	x_clear_errors (FRAME_X_DISPLAY (f));
       }
-    x_uncatch_errors (FRAME_X_DISPLAY (f), count);
+    x_uncatch_errors ();
     UNBLOCK_INPUT;
     if (!font)
       return NULL;
@@ -10612,7 +10581,6 @@
     Display *dpy = dpyinfo->display;
     XrmValue d, fr, to;
     Font font;
-    int count;
 
     d.addr = (XPointer)&dpy;
     d.size = sizeof (Display *);
@@ -10620,12 +10588,12 @@
     fr.size = sizeof (XtDefaultFont);
     to.size = sizeof (Font *);
     to.addr = (XPointer)&font;
-    count = x_catch_errors (dpy);
+    x_catch_errors (dpy);
     if (!XtCallConverter (dpy, XtCvtStringToFont, &d, 1, &fr, &to, NULL))
       abort ();
     if (x_had_errors_p (dpy) || !XQueryFont (dpy, font))
       XrmPutLineResource (&xrdb, "Emacs.dialog.*.font: 9x15");
-    x_uncatch_errors (dpy, count);
+    x_uncatch_errors ();
   }
 #endif
 #endif
--- a/src/xterm.h	Sat Feb 25 01:07:18 2006 +0000
+++ b/src/xterm.h	Tue Feb 28 17:35:08 2006 +0000
@@ -958,9 +958,9 @@
 void x_make_frame_visible P_ ((struct frame *));
 void x_iconify_frame P_ ((struct frame *));
 void x_wm_set_size_hint P_ ((struct frame *, long, int));
-int x_catch_errors P_ ((Display *));
+void x_catch_errors P_ ((Display *));
 int x_had_errors_p P_ ((Display *));
-void x_uncatch_errors P_ ((Display *, int));
+void x_uncatch_errors P_ ((void));
 void x_check_errors P_ ((Display *, char *));
 int x_text_icon P_ ((struct frame *, char *));
 int x_bitmap_icon P_ ((struct frame *, Lisp_Object));
@@ -974,10 +974,10 @@
 extern void x_scroll_bar_clear P_ ((struct frame *));
 extern int x_text_icon P_ ((struct frame *, char *));
 extern int x_bitmap_icon P_ ((struct frame *, Lisp_Object));
-extern int x_catch_errors P_ ((Display *));
+extern void x_catch_errors P_ ((Display *));
 extern void x_check_errors P_ ((Display *, char *));
 extern int x_had_errors_p P_ ((Display *));
-extern void x_uncatch_errors P_ ((Display *, int));
+extern void x_uncatch_errors P_ ((void));
 extern void x_set_window_size P_ ((struct frame *, int, int, int));
 extern void x_set_mouse_position P_ ((struct frame *, int, int));
 extern void x_set_mouse_pixel_position P_ ((struct frame *, int, int));