changeset 83473:428d132b4028

Merged from Patches applied: * emacs@sv.gnu.org/emacs--devo--0--patch-73 Merge from erc--emacs--0 * emacs@sv.gnu.org/emacs--devo--0--patch-74 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-75 Make ERC comply with the new copyright year guidelines. * emacs@sv.gnu.org/emacs--devo--0--patch-76 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-77 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-78 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-79 (rcirc-format-response-string): Fix small bugs * emacs@sv.gnu.org/emacs--devo--0--patch-80 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-81 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-82 Fix compiler error in erc-dcc.el. * emacs@sv.gnu.org/emacs--devo--0--patch-83 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-84 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-85 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-86 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-87 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-88 Merge from erc--emacs--0 * emacs@sv.gnu.org/emacs--devo--0--patch-89 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-90 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-513
author Karoly Lorentey <lorentey@elte.hu>
date Thu, 16 Feb 2006 16:18:54 +0000
parents b8bd59a73456 (current diff) b2331da25bb1 (diff)
children d08a7ef0cb8a
files ChangeLog configure.in lisp/ChangeLog lisp/cus-start.el lisp/files.el lisp/mh-e/ChangeLog lisp/net/rcirc.el lisp/progmodes/ebrowse.el lisp/progmodes/gdb-ui.el lisp/simple.el lisp/subr.el lispref/ChangeLog man/ChangeLog man/frames.texi src/.gdbinit src/frame.c src/xfns.c src/xterm.c src/xterm.h
diffstat 98 files changed, 1864 insertions(+), 1236 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue Feb 14 12:32:39 2006 +0000
+++ b/ChangeLog	Thu Feb 16 16:18:54 2006 +0000
@@ -1,3 +1,7 @@
+2006-02-14  Richard M. Stallman  <rms@gnu.org>
+
+	* configure.in (s390x-*-linux-gnu*): New configuration.
+
 2006-01-31  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>
 
 	* configure.in: Require GTK 2.4 or newer.
--- a/configure.in	Tue Feb 14 12:32:39 2006 +0000
+++ b/configure.in	Thu Feb 16 16:18:54 2006 +0000
@@ -654,6 +654,9 @@
   s390-*-linux-gnu* )
     machine=ibms390 opsys=gnu-linux
   ;;
+  s390x-*-linux-gnu* )
+    machine=ibms390x opsys=gnu-linux
+  ;;
   rs6000-ibm-aix3.1* | powerpc-ibm-aix3.1*  )
     machine=ibmrs6000 opsys=aix3-1
   ;;
--- a/etc/ChangeLog	Tue Feb 14 12:32:39 2006 +0000
+++ b/etc/ChangeLog	Thu Feb 16 16:18:54 2006 +0000
@@ -1,3 +1,11 @@
+2006-02-14  Chong Yidong  <cyd@stupidchicken.com>
+
+	* NEWS: Changes in handling of file local variables.
+
+2006-02-14  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>
+
+	* NEWS: Gtk+ 2.4 is required.
+
 2006-02-10  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
 
 	* PROBLEMS (Mac OS X): Add QuickTime 7.0.4 / Mac OS X 10.3.9 breakage.
--- a/etc/ERC-NEWS	Tue Feb 14 12:32:39 2006 +0000
+++ b/etc/ERC-NEWS	Thu Feb 16 16:18:54 2006 +0000
@@ -1,5 +1,41 @@
 ERC NEWS                                                       -*- outline -*-
 
+* Changes in ERC 5.1.2 (unreleased)
+
+** Fix compiler errors in erc-autojoin.el and erc-dcc.el.
+
+** Move to end of prompt when ERC reconnects to a server.
+
+** Changes and additions to modules
+
+*** Spell-checking (erc-spelling.el)
+
+**** Don't spell-check nicks or words that are prefixed with '/'.
+
+**** Remove flyspell properties from words we shouldn't spell-check.
+
+**** Fix an issue that caused the ispell process to reload every time
+we switch to an ERC buffer.
+
+*** Timestamps (erc-stamp.el)
+
+**** Fix an inconsistency in calculating width of right timestamps.
+
+**** Rename option `erc-timestamp-right-align-by-pixel' to
+`erc-timestamp-use-align-to'.  This controls whether to use the more
+fail-proof method of aligning right timestamps, as mentioned below.
+
+**** Fix a right timestamp spacing problem that used to occur when
+erc-stamp.el was byte-compiled.  Now that this is fixed, it is safe to
+use the method that aligns right timestamps perfectly in Emacs22 with
+X.  If the current version of Emacs doesn't support this method, use
+the simpler method, which is prone to alignment issues for math
+symbols and other variable-width text.
+
+A side effect of using this new method is that there will only be one
+space before a right timestamp in any saved logs.  If this is
+unacceptable, set `erc-timestamp-use-align-to' to nil.
+
 * Changes in ERC 5.1.1
 
 ** Fix a requirement on cl.el.
--- a/etc/NEWS	Tue Feb 14 12:32:39 2006 +0000
+++ b/etc/NEWS	Thu Feb 16 16:18:54 2006 +0000
@@ -27,7 +27,7 @@
 
 ---
 ** You can build Emacs with Gtk+ widgets by specifying `--with-x-toolkit=gtk'
-when you run configure.  This requires Gtk+ 2.0 or newer.  This port
+when you run configure.  This requires Gtk+ 2.4 or newer.  This port
 provides a way to display multilingual text in menus (with some caveats).
 
 ---
@@ -575,6 +575,21 @@
 suffix from every line before processing all the lines.
 
 +++
+*** If the local variables list contains any variable-value pairs that
+are not known to be safe, Emacs shows a prompt asking whether to apply
+the local variables list as a whole.  In earlier versions, a prompt
+was only issued for variables explicitly marked as risky (for the
+definition of risky variables, see `risky-local-variable-p').
+
+At the prompt, the user can choose to save the contents of this local
+variables list to `safe-local-variable-values'.  This new customizable
+option is a list of variable-value pairs that are known to be safe.
+Variables can also be marked as safe with the existing
+`safe-local-variable' property (see `safe-local-variable-p').
+However, risky variables will not be added to
+`safe-local-variable-values' in this way.
+
++++
 *** find-file-read-only visits multiple files in read-only mode,
 when the file name contains wildcard characters.
 
@@ -942,7 +957,7 @@
 ESC, like they do for Gtk+, Mac and W32.
 
 +++
-*** For Gtk+ version 2.4, you can make Emacs use the old file dialog
+*** For the Gtk+ version, you can make Emacs use the old file dialog
 by setting the variable `x-use-old-gtk-file-dialog' to t.  Default is to use
 the new dialog.
 
--- a/lisp/ChangeLog	Tue Feb 14 12:32:39 2006 +0000
+++ b/lisp/ChangeLog	Thu Feb 16 16:18:54 2006 +0000
@@ -1,3 +1,229 @@
+2006-02-16  Juanma Barranquero  <lekktu@gmail.com>
+
+	* calendar/icalendar.el (icalendar--get-event-property)
+	(icalendar--get-event-property-attributes): Fix typos in
+	docstrings.
+
+	* progmodes/flymake.el (flymake-fix-file-name): Fix typo in
+	docstring.
+
+2006-02-15  Juanma Barranquero  <lekktu@gmail.com>
+
+	* bs.el (bs-mode): Use `buffer-disable-undo'.
+	(bs--get-file-name): Simplify.
+	(bs-show-in-buffer): Mark the buffer as not modified.
+
+2006-02-14  Chong Yidong  <cyd@stupidchicken.com>
+
+	* wid-edit.el (widget-keymap): Bind down-mouse-1 to
+	widget-button-click.
+
+	* cus-edit.el (custom-mode-map): Remove mouse-1 binding.
+	(custom-mode): Update docstring.
+
+	* cus-theme.el (custom-new-theme-mode-map): Remove mouse-1
+	binding.
+
+	* files.el (hack-local-variables-confirm): Allow scrolling if the
+	file variable list is too long.  Kill temp buffer after use.
+
+2006-02-15  Nick Roberts  <nickrob@snap.net.nz>
+
+	* progmodes/gud.el (gdb): Improve doc string.
+	(gdb-script-font-lock-keywords): Expand allowed character set.
+
+	* progmodes/gdb-ui.el (gdb-use-separate-io-buffer)
+	(gdb-display-separate-io-buffer, gdb-frame-separate-io-buffer)
+	(gdb-separate-io-interrupt, gdb-separate-io-quit)
+	(gdb-separate-io-stop, gdb-separate-io-eof):
+	Rename from gdb-inferior-* to gdb-separate-*.
+	(gdb-set-gud-minor-mode-existing-buffers-1): Improve doc string.
+
+2006-02-14  Jay Belanger  <belanger@truman.edu>
+
+	* calc/calc-arith.el (math-check-known-scalarp): Make sure
+	expression is a symbol before checking that it is bound.
+
+	* calc/calcalg2.el (math-integrate-by-parts): Do a more careful
+	test to see if equation can be solved.
+
+2006-02-14  Chong Yidong  <cyd@stupidchicken.com>
+
+	* wid-edit.el (widget-button-click): Use :pressed-face property
+	for overlay face, if it exists.
+
+	* cus-edit.el (custom-manual, custom-add-see-also)
+	(custom-add-parent-links, custom-group-link): Add :pressed-face
+	property to links.
+
+	* files.el (hack-local-variables): Remove ignored variables before
+	checking if any variables need setting.
+
+2006-02-14  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>
+
+	* cus-start.el (all): Add x-gtk-whole-detached-tool-bar.
+
+2006-02-14  Juanma Barranquero  <lekktu@gmail.com>
+
+	* help.el (where-is): Fix message for remapped commands.
+
+	* mwheel.el (mouse-wheel-click-event, mouse-wheel-mode):
+	Fix typos in docstrings.
+
+2006-02-13  Chong Yidong  <cyd@stupidchicken.com>
+
+	* files.el (safe-local-variable-values): New option.
+	(hack-local-variables-prop-line): Return a list of variable-value
+	pairs if MODE-ONLY is non-nil.
+	(hack-local-variables): Construct list of variable-value pairs,
+	and apply or reject them in one go.  Ask for confirmation if
+	variables are not known safe.
+	(hack-local-variables-confirm): Complete rewrite.  Support
+	`safe-local-variable-values'.
+	(enable-local-variables): Update docstring to reflect new
+	behavior.
+	(ignored-local-variables): Ignore ignored-local-variables and
+	safe-local-variable-values.
+	(safe-local-variable-p): New function.
+	(risky-local-variable-p): `safe-local-variable' property check
+	moved to safe-local-variable-p.
+	(hack-one-local-variable): Checks moved to hack-local-variables.
+
+	(byte-compile-dynamic, c-basic-offset, c-file-style)
+	(c-indent-level, comment-column, fill-column, fill-prefix)
+	(indent-tabs-mode, kept-new-versions, no-byte-compile)
+	(no-update-autoloads, outline-regexp, page-delimiter)
+	(paragraph-start, paragraph-separate, sentence-end)
+	(sentence-end-double-space tab-width, version-control):
+	Add `safe-local-variable' property.
+
+	* find-lisp.el: Delete nonexistent `autocompile' file variable.
+
+	* icomplete.el, play/landmark.el: Change nonexistent
+	`outline-layout' file variable to `allout-layout'.
+
+2006-02-14  Nick Roberts  <nickrob@snap.net.nz>
+
+	* progmodes/gdb-ui.el (gud-watch, gdb-invalidate-registers-1)
+	(gdb-get-changed-registers): Test value of gud-minor-mode relative
+	to gud-comint-buffer.
+	(gdb-speedbar-expand-node, gdb-locals-mode): Use functions in
+	gdb-ui.el for gdb-mi.el.
+	(gdb-post-prompt, gdb-get-changed-registers): Move test for
+	registers buffer to gdb-get-changed-registers.
+	(gdb-breakpoint-regexp): New regexp.  Allow toggling and
+	deletion of catchpoints (throw and catch).
+	(gdb-toggle-breakpoint, gdb-delete-breakpoint)
+	(gdb-goto-breakpoint): Use it for both gdb-ui and gdb-mi.
+	(gdb-find-file-hook, gdb-set-gud-minor-mode-existing-buffers-1)
+	(gdb-var-list-children-1, gdb-info-breakpoints-custom)
+	(gdb-var-update-1, gdb-invalidate-locals-1): Use also for gdb-mi.
+
+2006-02-13  Jay Belanger  <belanger@truman.edu>
+
+	* calc/calc-arith.el (math-check-known-matrixp): Make sure
+	expression is a symbol before checking that it is bound.
+
+2006-02-13  Richard M. Stallman  <rms@gnu.org>
+
+	* mouse.el (mouse-drag-mode-line-1): Use mouse-drag-move-window-bottom
+	for the minibuffer too, but not if resize-mini-windows will interfere.
+
+	* help.el (describe-key-briefly, describe-key): Do all arg-reading
+	inside `interactive' spec.
+	(describe-key-briefly-internal, describe-key-internal):
+	Functions merged back into their callers.
+
+2006-02-13  Martin Rudalics  <rudalics@gmx.at>  (tiny change)
+
+	* info.el (info-xref-visited): Inherit from info-xref too.
+	(Info-set-mode-line): Replace occurrences of `%' by `%%'
+	when propertizing Info-current-file and Info-current-node.
+
+2006-02-13  Juri Linkov  <juri@jurta.org>
+
+	* tumme.el (tumme-thumbnail-storage): Fix docstring.
+	(tumme-thumb-name): Fix per-directory format.
+
+2006-02-13  Juanma Barranquero  <lekktu@gmail.com>
+
+	* subr.el (substitute-key-definition): Doc fix (hide internal arg).
+
+2006-02-12  Miles Bader  <miles@gnu.org>
+
+	* net/rcirc.el (rcirc-format-response-string): Fix small bugs.
+
+2006-02-13  Mathias Dahl  <mathias.dahl@gmail.com>
+
+	* tumme.el: Remove history section.  If someone needs the it, it
+	can always be found in CVS.
+
+2006-02-12  Mathias Dahl  <mathias.dahl@gmail.com>
+
+	* tumme.el (tumme-thumbnail-storage): Update docstring.  Add info
+	about the Thumbnail Managing Standard option.
+
+2006-02-12  Richard M. Stallman  <rms@gnu.org>
+
+	* subr.el (substitute-key-definition): Doc fix.
+
+	* simple.el (blink-matching-paren-dont-ignore-comments): Doc fix.
+
+	* files.el (magic-mode-alist): Don't use `\\s ' in regexps.
+
+	* info.el (Info-mode): Doc fix.
+
+	* progmodes/ebrowse.el (ebrowse-global-prefix-key): Change to C-c C-m.
+
+2006-02-12  Michael Albinus  <michael.albinus@gmx.de>
+
+	* net/tramp.el (tramp-remote-path): Add "/usr/xpg4/bin" on top,
+	because on Solaris a POSIX compatible "id" is needed.  Reported by
+	Magnus Henoch <mange@freemail.hu>.
+
+2006-02-12  Juri Linkov  <juri@jurta.org>
+
+	* tumme.el: Remove todo item about Thumbnail Managing Standard.
+	(tumme) <defgroup>: Change :group to `multimedia'.
+	(tumme-thumbnail-storage): Add choice `standard' for Thumbnail
+	Managing Standard.
+	(tumme-cmd-create-thumbnail-options): Use %w and %h instead of %s.
+	Fix dostring.
+	(tumme-cmd-create-temp-image-options): Use %w and %h instead of %x
+	and %y.  Fix docstring.
+	(tumme-cmd-pngnq-program, tumme-cmd-pngcrush-program)
+	(tumme-cmd-create-standard-thumbnail-command): New user options.
+	(tumme-thumb-size): Set default to 128 if tumme-thumbnail-storage
+	is `standard'.  Fix docstring.
+	(tumme-thumb-width, tumme-thumb-height): New user options.
+	(tumme-external-viewer): Try to find various viewers.
+	(tumme-get-thumbnail-image): Use `create-image' instead of
+	constructing the `image' structure.
+	(tumme-insert-thumbnail): Use `png' if tumme-thumbnail-storage is
+	`standard'.
+	(tumme-thumb-name): Add file name generation for standard storage.
+	Simplify code for other storages.
+	(tumme-thumb-name): Use width %w and height %h instead of size %s.
+	Add modification time %m and thumbnail-nq8 %q.
+	Use `tumme-cmd-create-standard-thumbnail-command' if
+	tumme-thumbnail-storage is `standard'.
+	(tumme-dired-insert-marked-thumbs): New autoload command.
+	(tumme-dired-after-readin-hook): New function.
+	(tumme-line-up-dynamic): Use `tumme-thumb-width' instead of
+	`tumme-thumb-size'.
+	(tumme-display-image): Replace size-x %x and size-y %y with
+	width %w and height %h.
+
+	* dired.el (dired-mode-map): Bind `\C-t\C-t' to
+	`tumme-dired-insert-marked-thumbs'.
+
+2006-02-12  Mathias Dahl  <mathias.dahl@gmail.com>
+
+	* tumme.el (tumme-write-tag): Fix small bug (file name did not
+	include path).
+	(tumme-mark-tagged-files): Fix bug in regexp used to find rows
+	matching tag.
+
 2006-02-12  Miles Bader  <miles@gnu.org>
 
 	* net/rcirc.el (rcirc-nick-abbrevs, rcirc-response-formats):
@@ -13,19 +239,19 @@
 
 2006-02-11  Mathias Dahl  <brakjoller@hotmail.com>
 
-	* tumme.el: Enhanced some docstrings.  Added todo item about
-	  Thumbnail Managing Standard.
+	* tumme.el: Enhance some docstrings.  Add todo item about Thumbnail
+	Managing Standard.
 
 2006-02-11  Kim F. Storm  <storm@cua.dk>
 
 	* ido.el (ido-buffer-internal): Set mark for ido-insert-buffer.
 	Don't use insert-buffer; do insert-buffer-substring directly.
-	(ido-file-internal): Set mark for ido-insert-file. Use insert-file-1.
+	(ido-file-internal): Set mark for ido-insert-file.  Use insert-file-1.
 
 2006-02-11  Martin Rudalics  <rudalics@gmx.at>
 
 	* files.el (revert-buffer, recover-file): Replace buffer-read-only
-	with inhibit-read-only.	Suggested by Stefan Monnier.
+	with inhibit-read-only.  Suggested by Stefan Monnier.
 	(revert-buffer): Let insert-file-contents discard
 	buffer-undo-list.  Simplify code.
 	(find-file, find-file-existing, revert-buffer): Doc-string fixes.
@@ -54,9 +280,8 @@
 
 2006-02-11  Mathias Dahl  <brakjoller@hotmail.com>
 
-	* tumme.el (tumme-dir): Changed default value to
-	  "~/.emacs-d/tumme"
-	  (tumme-dir): New function. Copied from thumbs.el.
+	* tumme.el (tumme-dir): Change default value to "~/.emacs.d/tumme/".
+	(tumme-dir): New function.  Copied from thumbs.el.
 
 2006-02-10  Juanma Barranquero  <lekktu@gmail.com>
 
@@ -79,12 +304,12 @@
 
 2006-02-10  Mathias Dahl  <mathias.dahl@gmail.com>
 
-	* tumme.el (tumme-copy-with-exif-file-name): Tried to make
-	docstring less `colloquial'...
+	* tumme.el (tumme-copy-with-exif-file-name): Try to make docstring
+	less `colloquial'...
 
 2006-02-09  Mathias Dahl  <mathias.dahl@gmail.com>
 
-	* tumme.el: Added a couple of todo items.
+	* tumme.el: Add a couple of todo items.
 
 2006-02-09  Lars Hansen  <larsh@soem.dk>
 
--- a/lisp/bs.el	Tue Feb 14 12:32:39 2006 +0000
+++ b/lisp/bs.el	Thu Feb 16 16:18:54 2006 +0000
@@ -652,6 +652,7 @@
   (use-local-map bs-mode-map)
   (make-local-variable 'font-lock-defaults)
   (make-local-variable 'font-lock-verbose)
+  (buffer-disable-undo)
   (setq major-mode 'bs-mode
 	mode-name "Buffer-Selection-Menu"
 	buffer-read-only t
@@ -1164,7 +1165,8 @@
     (bs--set-window-height)
     (bs--goto-current-buffer)
     (font-lock-fontify-buffer)
-    (bs-apply-sort-faces)))
+    (bs-apply-sort-faces)
+    (set-buffer-modified-p nil)))
 
 (defun bs-next-buffer (&optional buffer-list sorting-p)
   "Return next buffer and buffer list for buffer cycling in BUFFER-LIST.
@@ -1338,16 +1340,11 @@
 default directory.
 START-BUFFER is the buffer where we started buffer selection.
 ALL-BUFFERS is the list of buffer appearing in Buffer Selection Menu."
-  (let ((string (copy-sequence (if (member major-mode
-					   '(shell-mode dired-mode))
-				   default-directory
-				 (or buffer-file-name "")))))
-    (add-text-properties
-     0 (length string)
-     '(mouse-face highlight
-       help-echo "mouse-2: select this buffer, mouse-3: select in other frame")
-     string)
-    string))
+  (propertize (if (member major-mode '(shell-mode dired-mode))
+                  default-directory
+                (or buffer-file-name ""))
+              'mouse-face 'highlight
+              'help-echo "mouse-2: select this buffer, mouse-3: select in other frame"))
 
 (defun bs--insert-one-entry (buffer)
   "Generate one entry for buffer BUFFER in Buffer Selection Menu.
--- a/lisp/calc/calc-arith.el	Tue Feb 14 12:32:39 2006 +0000
+++ b/lisp/calc/calc-arith.el	Thu Feb 16 16:18:54 2006 +0000
@@ -334,6 +334,7 @@
             ((memq 'scalar (nth 1 decl))
              t)
             ((and (eq (car a) 'var)
+                  (symbolp (nth 2 a))
                   (boundp (nth 2 a))
                   (setq val (symbol-value (nth 2 a))))
              (math-check-known-scalarp val))
@@ -362,6 +363,7 @@
             ((memq 'matrix (nth 1 decl))
              t)
             ((and (eq (car a) 'var)
+                  (symbolp (nth 2 a))
                   (boundp (nth 2 a))
                   (setq val (symbol-value (nth 2 a))))
              (math-check-known-matrixp val))
--- a/lisp/calc/calcalg2.el	Tue Feb 14 12:32:39 2006 +0000
+++ b/lisp/calc/calcalg2.el	Thu Feb 16 16:18:54 2006 +0000
@@ -1253,9 +1253,11 @@
 			(calcFunc-expand temp)
 		      (setq v (list 'var 'PARTS math-cur-record)
 			    temp (let (calc-next-why)
-				   (math-solve-for (math-sub v temp) 0 v nil)))
-		      (and temp (not (integerp temp))
-			   (math-simplify-extended temp)))))
+                                   (math-simplify-extended
+                                    (math-solve-for (math-sub v temp) 0 v nil)))
+                            temp (if (and (eq (car-safe temp) '/) 
+                                          (math-zerop (nth 2 temp))) 
+                                     nil temp)))))
 	   (setcar (cdr math-cur-record) 'busy)))))
 
 ;;; This tries two different formulations, hoping the algebraic simplifier
--- a/lisp/calendar/icalendar.el	Tue Feb 14 12:32:39 2006 +0000
+++ b/lisp/calendar/icalendar.el	Thu Feb 16 16:18:54 2006 +0000
@@ -293,7 +293,7 @@
 ;;  (car (cddr event)))
 
 (defun icalendar--get-event-property (event prop)
-  "For the given EVENT return the value of the first occurence of PROP."
+  "For the given EVENT return the value of the first occurrence of PROP."
   (catch 'found
     (let ((props (car (cddr event))) pp)
       (while props
@@ -304,7 +304,7 @@
     nil))
 
 (defun icalendar--get-event-property-attributes (event prop)
-  "For the given EVENT return attributes of the first occurence of PROP."
+  "For the given EVENT return attributes of the first occurrence of PROP."
   (catch 'found
     (let ((props (car (cddr event))) pp)
       (while props
@@ -705,7 +705,7 @@
   "Export diary file to iCalendar format.
 All diary entries in the file DIARY-FILENAME are converted to iCalendar
 format.  The result is appended to the file ICAL-FILENAME."
-  (interactive "FExport diary data from file: 
+  (interactive "FExport diary data from file:
 Finto iCalendar file: ")
   (save-current-buffer
     (set-buffer (find-file diary-filename))
@@ -1449,8 +1449,8 @@
 Argument DIARY-FILENAME input `diary-file'.
 Optional argument NON-MARKING determines whether events are created as
 non-marking or not."
-  (interactive "fImport iCalendar data from file: 
-Finto diary file: 
+  (interactive "fImport iCalendar data from file:
+Finto diary file:
 p")
   ;; clean up the diary file
   (save-current-buffer
--- a/lisp/cus-edit.el	Tue Feb 14 12:32:39 2006 +0000
+++ b/lisp/cus-edit.el	Thu Feb 16 16:18:54 2006 +0000
@@ -1720,6 +1720,7 @@
   :help-echo "Read the manual entry for this option."
   :button-face 'custom-link
   :mouse-face 'highlight
+  :pressed-face 'highlight
   :tag "Manual")
 
 ;;; The `custom-magic' Widget.
@@ -2201,7 +2202,8 @@
 	(push (widget-create-child-and-convert
 	       widget (car links)
 	       :button-face 'custom-link
-	       :mouse-face 'highlight)
+	       :mouse-face 'highlight
+	       :pressed-face 'highlight)
 	      buttons)
 	(setq links (cdr links))
 	(cond ((null links)
@@ -2247,7 +2249,8 @@
                (push (widget-create-child-and-convert
 		      widget (car links)
 		      :button-face 'custom-link
-		      :mouse-face 'highlight)
+		      :mouse-face 'highlight
+		      :pressed-face 'highlight)
                      buttons)
                (setq links (cdr links))
                (cond ((null links)
@@ -3590,6 +3593,7 @@
   "Show parent in other window when activated."
   :button-face 'custom-link
   :mouse-face 'highlight
+  :pressed-face 'highlight
   :help-echo "Create customization buffer for this group."
   :action 'custom-group-link-action)
 
@@ -4365,7 +4369,6 @@
     (define-key map "u" 'Custom-goto-parent)
     (define-key map "n" 'widget-forward)
     (define-key map "p" 'widget-backward)
-    (define-key map [mouse-1] 'widget-move-and-invoke)
     map)
   "Keymap for `custom-mode'.")
 
@@ -4421,7 +4424,7 @@
 \\<custom-field-keymap>\
 Complete content of editable text field.   \\[widget-complete]
 \\<custom-mode-map>\
-Invoke button under the mouse pointer.     \\[widget-move-and-invoke]
+Invoke button under the mouse pointer.     \\[widget-button-click]
 Invoke button under point.                 \\[widget-button-press]
 Set all options from current text.         \\[Custom-set]
 Make values in current text permanent.     \\[Custom-save]
--- a/lisp/cus-start.el	Tue Feb 14 12:32:39 2006 +0000
+++ b/lisp/cus-start.el	Thu Feb 16 16:18:54 2006 +0000
@@ -359,6 +359,7 @@
 				 (repeat (directory :format "%v")))
 	     (x-use-old-gtk-file-dialog menu boolean "22.1")
 	     (x-gtk-show-hidden-files menu boolean "22.1")
+	     (x-gtk-whole-detached-tool-bar x boolean "22.1")
 	     ;; xterm.c
              (mouse-autoselect-window display boolean "21.3")
 	     (x-use-underline-position-properties display boolean "21.3")
--- a/lisp/cus-theme.el	Tue Feb 14 12:32:39 2006 +0000
+++ b/lisp/cus-theme.el	Thu Feb 16 16:18:54 2006 +0000
@@ -38,7 +38,6 @@
     (suppress-keymap map)
     (define-key map "n" 'widget-forward)
     (define-key map "p" 'widget-backward)
-    (define-key map [mouse-1] 'widget-move-and-invoke)
     map)
   "Keymap for `custom-new-theme-mode'.")
 
--- a/lisp/dired.el	Tue Feb 14 12:32:39 2006 +0000
+++ b/lisp/dired.el	Thu Feb 16 16:18:54 2006 +0000
@@ -1258,6 +1258,7 @@
     (define-key map "\C-t." 'tumme-display-thumb)
     (define-key map "\C-tc" 'tumme-dired-comment-files)
     (define-key map "\C-tf" 'tumme-mark-tagged-files)
+    (define-key map "\C-t\C-t" 'tumme-dired-insert-marked-thumbs)
 
     ;; Make menu bar items.
 
--- a/lisp/erc/ChangeLog	Tue Feb 14 12:32:39 2006 +0000
+++ b/lisp/erc/ChangeLog	Thu Feb 16 16:18:54 2006 +0000
@@ -1,3 +1,97 @@
+2006-02-15  Michael Olson  <mwolson@gnu.org>
+
+	* erc.el (erc): Move to the end of the buffer when a continued
+	session is detected.  Thanks to e1f and indio for the report and
+	testing a potential fix.
+
+2006-02-14  Michael Olson  <mwolson@gnu.org>
+
+	* debian/changelog: Prepare a new Debian package.
+
+	* Makefile (debprepare): New rule that creates an ERC snapshot
+	directory for use in both new Debian releases and revisions for
+	Debian packages.
+	(debrelease, debrevision-mwolson): Use debprepare.
+
+	* NEWS: Bring up-to-date.
+
+	* erc-stamp.el (erc-insert-timestamp-right): For now, put
+	timestamps before rather than after erc-fill-column when
+	erc-timestamp-right-column is nil.  This way we won't surprise
+	anyone unpleasantly, or so it is hoped.
+
+2006-02-13  Michael Olson  <mwolson@gnu.org>
+
+	* erc-dcc.el: Use (eval-when-compile (require 'cl)).
+
+2006-02-12  Michael Olson  <mwolson@gnu.org>
+
+	* erc-autoaway.el, erc-dcc.el, erc-ezbounce.el, erc-fill.el,
+	erc-goodies.el, erc-hecomplete.el, erc-ibuffer.el, erc-identd.el,
+	erc-imenu.el, erc-join.el, erc-lang.el, erc-list.el, erc-log.el,
+	erc-match.el, erc-menu.el, erc-netsplit.el, erc-networks.el,
+	erc-notify.el, erc-page.el, erc-pcomplete.el, erc-replace.el,
+	erc-ring.el, erc-services.el, erc-sound.el, erc-speedbar.el,
+	erc-spelling.el, erc-track.el, erc-truncate.el, erc-xdcc.el: Add
+	2006 to copyright years, to comply with the changed guidelines.
+
+2006-02-11  Michael Olson  <mwolson@gnu.org>
+
+	* erc.el (erc-update-modules): Make some requirements shorter, so
+	that it's easier to see why they are needed.
+
+	* erc-stamp.el (erc-timestamp-use-align-to): Renamed from
+	`erc-timestamp-right-align-by-pixel'.  Set the default based on
+	whether we are in Emacs 22, and using X.  Improve documentation.
+	(erc-insert-aligned): Remove calculation of offset, since
+	:align-to pos works after all.  Unlike the previous solution, this
+	one works when erc-stamp.el is compiled.
+	(erc-insert-timestamp-right): Don't add length of string, and then
+	later remove its displayed width.  This puts timestamps after
+	erc-fill-column when erc-timestamp-right-column is nil, rather
+	than before it.  It also fixes a subtle bug.  Remove use of
+	`current-window', since there is no variable by that name in
+	Emacs21, Emacs22, or XEmacs21 beta.  Check to see whether
+	`erc-fill-column' is non-nil before using it.
+
+2006-02-11  Diane Murray  <disumu@x3y2z1.net>
+
+	* erc-list.el: Define `list' module which sets the alias
+	`erc-cmd-LIST' to `erc-list-channels' when enabled and
+	`erc-list-channels-simple' when disabled.
+	(erc-list-channels): Was `erc-cmd-LIST', renamed.
+	(erc-list-channels-simple): New function.
+
+	* erc.el (erc-modules): Added `list' to enabled modules.  Moved
+	customization options left in source code.
+
+	* erc-menu.el (erc-menu-definition): Use `erc-list-channels'.
+
+	* erc-spelling.el (define-erc-module): Make sure there's a buffer
+	before calling `with-current-buffer'.
+
+2006-02-10  Michael Olson  <mwolson@gnu.org>
+
+	* Makefile (debbuild): Split from debrelease.
+	(debrevision-mwolson): New rule that causes a Debian revision to
+	be built.
+
+	* erc.el (erc-migrate-modules): Use a better algorithm.  Thanks to
+	Johan Bockgård.
+	(erc-modules): Change use of 'pcomplete to 'completion.
+
+2006-02-09  Diane Murray  <disumu@x3y2z1.net>
+
+	* erc.el (erc-get-parsed-vector, erc-get-parsed-vector-nick)
+	(erc-get-parsed-vector-type): Moved here from erc-match.el.
+
+	* erc-match.el (erc-get-parsed-vector, erc-get-parsed-vector-nick)
+	(erc-get-parsed-vector-type): Moved these functions to erc.el
+	since they can be useful outside of the text matching module.
+
+	* erc-dcc.el, erc-stamp.el, erc-xdcc.el: Changed "Emacs IRC Client"
+	to "ERC".
+
 2006-02-07  Michael Olson  <mwolson@gnu.org>
 
 	* ChangeLog.01, ChangeLog.02, ChangeLog.03, ChangeLog.04,
--- a/lisp/erc/erc-autoaway.el	Tue Feb 14 12:32:39 2006 +0000
+++ b/lisp/erc/erc-autoaway.el	Thu Feb 16 16:18:54 2006 +0000
@@ -1,6 +1,6 @@
 ;;; erc-autoaway.el --- Provides autoaway for ERC
 
-;; Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+;; Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
 
 ;; Author: Jorgen Schaefer <forcer@forcix.cx>
 ;; URL: http://www.emacswiki.org/cgi-bin/wiki.pl?ErcAutoAway
--- a/lisp/erc/erc-dcc.el	Tue Feb 14 12:32:39 2006 +0000
+++ b/lisp/erc/erc-dcc.el	Thu Feb 16 16:18:54 2006 +0000
@@ -1,6 +1,6 @@
 ;;; erc-dcc.el --- CTCP DCC module for ERC
 
-;; Copyright (C) 1993, 1994, 1995, 1998, 2002, 2003, 2004
+;; Copyright (C) 1993, 1994, 1995, 1998, 2002, 2003, 2004, 2006
 ;;   Free Software Foundation, Inc.
 
 ;; Author: Ben A. Mesander <ben@gnu.ai.mit.edu>
@@ -29,7 +29,7 @@
 
 ;;; Commentary:
 
-;; This file provides Direct Client-to-Client support for the Emacs IRC Client.
+;; This file provides Direct Client-to-Client support for ERC.
 ;;
 ;; The original code was taken from zenirc-dcc.el, heavily mangled and
 ;; rewritten to support the way how ERC operates.  Server socket support
@@ -55,7 +55,8 @@
 
 (require 'erc)
 (eval-when-compile
- (require 'pcomplete))
+  (require 'cl)
+  (require 'pcomplete))
 
 (defgroup erc-dcc nil
   "DCC stands for Direct Client Communication, where you and your
--- a/lisp/erc/erc-ezbounce.el	Tue Feb 14 12:32:39 2006 +0000
+++ b/lisp/erc/erc-ezbounce.el	Thu Feb 16 16:18:54 2006 +0000
@@ -1,6 +1,6 @@
 ;;; erc-ezbounce.el ---  Handle EZBounce bouncer commands
 
-;; Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+;; Copyright (C) 2002, 2004, 2006 Free Software Foundation, Inc.
 
 ;; Author: Andreas Fuchs <asf@void.at>
 ;; Keywords: comm
--- a/lisp/erc/erc-fill.el	Tue Feb 14 12:32:39 2006 +0000
+++ b/lisp/erc/erc-fill.el	Thu Feb 16 16:18:54 2006 +0000
@@ -1,6 +1,6 @@
 ;;; erc-fill.el --- Filling IRC messages in various ways
 
-;; Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+;; Copyright (C) 2001, 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
 
 ;; Author: Andreas Fuchs <asf@void.at>
 ;;         Mario Lang <mlang@delysid.org>
--- a/lisp/erc/erc-goodies.el	Tue Feb 14 12:32:39 2006 +0000
+++ b/lisp/erc/erc-goodies.el	Thu Feb 16 16:18:54 2006 +0000
@@ -1,6 +1,7 @@
 ;; erc-goodies.el --- Collection of ERC modules
 
-;; Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation
+;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006
+;;   Free Software Foundation, Inc.
 
 ;; Author: Jorgen Schaefer <forcer@forcix.cx>
 
--- a/lisp/erc/erc-hecomplete.el	Tue Feb 14 12:32:39 2006 +0000
+++ b/lisp/erc/erc-hecomplete.el	Thu Feb 16 16:18:54 2006 +0000
@@ -1,6 +1,6 @@
 ;;; erc-hecomplete.el --- Provides Nick name completion for ERC
 
-;; Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc.
+;; Copyright (C) 2001, 2002, 2004, 2006 Free Software Foundation, Inc.
 
 ;; Author: Alex Schroeder <alex@gnu.org>
 ;; URL: http://www.emacswiki.org/cgi-bin/wiki.pl?ErcCompletion
--- a/lisp/erc/erc-ibuffer.el	Tue Feb 14 12:32:39 2006 +0000
+++ b/lisp/erc/erc-ibuffer.el	Thu Feb 16 16:18:54 2006 +0000
@@ -1,6 +1,6 @@
 ;;; erc-ibuffer.el --- ibuffer integration with ERC
 
-;; Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+;; Copyright (C) 2002, 2004, 2006 Free Software Foundation, Inc.
 
 ;; Author: Mario Lang <mlang@delysid.org>
 ;; Keywords: comm
--- a/lisp/erc/erc-identd.el	Tue Feb 14 12:32:39 2006 +0000
+++ b/lisp/erc/erc-identd.el	Thu Feb 16 16:18:54 2006 +0000
@@ -1,6 +1,6 @@
 ;;; erc-identd.el --- RFC1413 (identd authentication protocol) server
 
-;; Copyright (C) 2003 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2006 Free Software Foundation, Inc.
 
 ;; Author: John Wiegley <johnw@gnu.org>
 ;; Keywords: comm, processes
--- a/lisp/erc/erc-imenu.el	Tue Feb 14 12:32:39 2006 +0000
+++ b/lisp/erc/erc-imenu.el	Thu Feb 16 16:18:54 2006 +0000
@@ -1,6 +1,6 @@
 ;;; erc-imenu.el -- Imenu support for ERC
 
-;; Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc.
+;; Copyright (C) 2001, 2002, 2004, 2006 Free Software Foundation, Inc.
 
 ;; Author: Mario Lang <mlang@delysid.org>
 ;; Keywords: comm
--- a/lisp/erc/erc-join.el	Tue Feb 14 12:32:39 2006 +0000
+++ b/lisp/erc/erc-join.el	Thu Feb 16 16:18:54 2006 +0000
@@ -1,6 +1,6 @@
 ;;; erc-join.el --- autojoin channels on connect and reconnects
 
-;; Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+;; Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
 
 ;; Author: Alex Schroeder <alex@gnu.org>
 ;; Keywords: irc
--- a/lisp/erc/erc-lang.el	Tue Feb 14 12:32:39 2006 +0000
+++ b/lisp/erc/erc-lang.el	Thu Feb 16 16:18:54 2006 +0000
@@ -1,6 +1,6 @@
 ;;; erc-lang.el --- provide the LANG command to ERC
 
-;; Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+;; Copyright (C) 2002, 2004, 2006 Free Software Foundation, Inc.
 
 ;; Author: Alex Schroeder <alex@gnu.org>
 ;; Maintainer: Alex Schroeder <alex@gnu.org>
--- a/lisp/erc/erc-list.el	Tue Feb 14 12:32:39 2006 +0000
+++ b/lisp/erc/erc-list.el	Thu Feb 16 16:18:54 2006 +0000
@@ -1,6 +1,6 @@
 ;;; erc-list.el --- Provide a faster channel listing mechanism
 
-;; Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+;; Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
 ;; Copyright (C) 2004 Brian Palmer
 
 ;; Author: Mario Lang <mlang@lexx.delysid.org>
@@ -140,12 +140,19 @@
   (setq truncate-lines t)
   (add-hook 'post-command-hook 'erc-chanlist-post-command-hook 'append 'local))
 
+;; Define module:
+;;;###autoload (autoload 'erc-list-mode "erc-list")
+(define-erc-module list nil
+  "List channels nicely in a separate buffer."
+  ((defalias 'erc-cmd-LIST 'erc-list-channels))
+  ((defalias 'erc-cmd-LIST 'erc-list-channels-simple)))
+
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Functions.
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 ;;;###autoload
-(defun erc-cmd-LIST (&rest channel)
+(defun erc-list-channels (&rest channel)
   "Display a buffer containing a list of channels on the current server.
 Optional argument CHANNEL specifies a single channel to list (instead of every
 available channel)."
@@ -163,6 +170,18 @@
     (erc-chanlist channel))
   t)
 
+(defun erc-list-channels-simple (&optional line)
+  "Send the LIST command to the current server with optional channels LINE."
+  (when (string-match "^\\s-*\\(.*\\)$" line)
+    (let ((channels (match-string 1 line)))
+      (erc-log (format "cmd: LIST: %s" channels))
+      (erc-server-send
+       (if (string= channels "")
+	   "LIST"
+	 (concat "LIST :" channels))))
+    t))
+(put 'erc-list-channels-simple 'do-not-parse-args t)
+
 ;;;###autoload
 (defun erc-chanlist (&optional channels)
   "Show a channel listing of the current server in a special mode.
--- a/lisp/erc/erc-log.el	Tue Feb 14 12:32:39 2006 +0000
+++ b/lisp/erc/erc-log.el	Thu Feb 16 16:18:54 2006 +0000
@@ -1,6 +1,6 @@
 ;;; erc-log.el --- Logging facilities for ERC.
 
-;; Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
 
 ;; Author: Lawrence Mitchell <wence@gmx.li>
 ;; Keywords: IRC, chat, client, Internet, logging
--- a/lisp/erc/erc-match.el	Tue Feb 14 12:32:39 2006 +0000
+++ b/lisp/erc/erc-match.el	Thu Feb 16 16:18:54 2006 +0000
@@ -1,6 +1,6 @@
 ;;; erc-match.el --- Highlight messages matching certain regexps
 
-;; Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+;; Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
 
 ;; Author: Andreas Fuchs <asf@void.at>
 ;; Keywords: comm, faces
@@ -428,24 +428,6 @@
     (or (erc-list-match fools-beg msg)
 	(erc-list-match fools-end msg))))
 
-(defun erc-get-parsed-vector (point)
-  "Return the whole parsed vector on POINT."
-  (get-text-property point 'erc-parsed))
-
-(defun erc-get-parsed-vector-nick (vect)
-  "Return nickname in the parsed vector VECT."
-  (let* ((untreated-nick (and vect (erc-response.sender vect)))
-	 (maybe-nick (when untreated-nick
-		       (car (split-string untreated-nick "!")))))
-    (when (and (not (null maybe-nick))
-	       (erc-is-valid-nick-p maybe-nick))
-      untreated-nick)))
-
-(defun erc-get-parsed-vector-type (vect)
-  "Return message type in the parsed vector VECT."
-  (and vect
-       (erc-response.command vect)))
-
 (defun erc-match-message ()
   "Mark certain keywords in a region.
 Use this defun with `erc-insert-modify-hook'."
--- a/lisp/erc/erc-menu.el	Tue Feb 14 12:32:39 2006 +0000
+++ b/lisp/erc/erc-menu.el	Thu Feb 16 16:18:54 2006 +0000
@@ -1,6 +1,6 @@
 ;; erc-menu.el -- Menu-bar definitions for ERC
 
-;; Copyright (C) 2001, 2002, 2004, 2005 Free Software Foundation, Inc.
+;; Copyright (C) 2001, 2002, 2004, 2005, 2006 Free Software Foundation, Inc.
 
 ;; Author: Mario Lang <mlang@delysid.org>
 ;; Keywords: comm, processes, menu
@@ -36,8 +36,8 @@
 	["Connect to server..." erc-select t]
 	["Disconnect from server..." erc-quit-server erc-server-connected]
 	"-"
-	["List channels..." erc-cmd-LIST
-	 (and erc-server-connected (fboundp 'erc-cmd-LIST))]
+	["List channels..." erc-list-channels
+	 (and erc-server-connected (fboundp 'erc-list-channels))]
 	["Join channel..." erc-join-channel erc-server-connected]
 	["Start a query..." erc-cmd-QUERY erc-server-connected]
 	"-"
--- a/lisp/erc/erc-netsplit.el	Tue Feb 14 12:32:39 2006 +0000
+++ b/lisp/erc/erc-netsplit.el	Thu Feb 16 16:18:54 2006 +0000
@@ -1,6 +1,6 @@
 ;;; erc-netsplit.el --- Reduce JOIN/QUIT messages on netsplits
 
-;; Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+;; Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
 
 ;; Author: Mario Lang <mlang@delysid.org>
 ;; Keywords: comm
--- a/lisp/erc/erc-networks.el	Tue Feb 14 12:32:39 2006 +0000
+++ b/lisp/erc/erc-networks.el	Thu Feb 16 16:18:54 2006 +0000
@@ -1,6 +1,6 @@
 ;;; erc-networks.el --- IRC networks
 
-;; Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
+;; Copyright (C) 2002, 2004, 2005, 2006 Free Software Foundation, Inc.
 
 ;; Author: Mario Lang <mlang@lexx.delysid.org>
 ;; Keywords: comm
--- a/lisp/erc/erc-notify.el	Tue Feb 14 12:32:39 2006 +0000
+++ b/lisp/erc/erc-notify.el	Thu Feb 16 16:18:54 2006 +0000
@@ -1,6 +1,6 @@
 ;;; erc-notify.el --- Online status change notification
 
-;; Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+;; Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
 
 ;; Author: Mario Lang <mlang@lexx.delysid.org>
 ;; Keywords: comm
--- a/lisp/erc/erc-page.el	Tue Feb 14 12:32:39 2006 +0000
+++ b/lisp/erc/erc-page.el	Thu Feb 16 16:18:54 2006 +0000
@@ -1,6 +1,6 @@
 ;; erc-page.el - CTCP PAGE support for ERC
 
-;; Copyright (C) 2002, 2004 Free Software Foundation
+;; Copyright (C) 2002, 2004, 2006 Free Software Foundation
 
 ;; This file is part of GNU Emacs.
 
--- a/lisp/erc/erc-pcomplete.el	Tue Feb 14 12:32:39 2006 +0000
+++ b/lisp/erc/erc-pcomplete.el	Thu Feb 16 16:18:54 2006 +0000
@@ -1,6 +1,6 @@
 ;;; erc-pcomplete.el --- Provides programmable completion for ERC
 
-;; Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+;; Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
 
 ;; Author: Sacha Chua <sacha@free.net.ph>
 ;; Keywords: comm, convenience
--- a/lisp/erc/erc-replace.el	Tue Feb 14 12:32:39 2006 +0000
+++ b/lisp/erc/erc-replace.el	Thu Feb 16 16:18:54 2006 +0000
@@ -1,6 +1,6 @@
 ;; erc-replace.el -- wash and massage messages inserted into the buffer
 
-;; Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc.
+;; Copyright (C) 2001, 2002, 2004, 2006 Free Software Foundation, Inc.
 
 ;; Author: Andreas Fuchs <asf@void.at>
 ;; Maintainer: Mario Lang (mlang@delysid.org)
--- a/lisp/erc/erc-ring.el	Tue Feb 14 12:32:39 2006 +0000
+++ b/lisp/erc/erc-ring.el	Thu Feb 16 16:18:54 2006 +0000
@@ -1,6 +1,6 @@
 ;; erc-ring.el -- Command history handling for erc using ring.el
 
-;; Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+;; Copyright (C) 2001, 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
 
 ;; Author: Alex Schroeder <alex@gnu.org>
 ;; Keywords: comm
--- a/lisp/erc/erc-services.el	Tue Feb 14 12:32:39 2006 +0000
+++ b/lisp/erc/erc-services.el	Thu Feb 16 16:18:54 2006 +0000
@@ -1,6 +1,6 @@
 ;;; erc-services.el --- Identify to NickServ
 
-;; Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+;; Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
--- a/lisp/erc/erc-sound.el	Tue Feb 14 12:32:39 2006 +0000
+++ b/lisp/erc/erc-sound.el	Thu Feb 16 16:18:54 2006 +0000
@@ -1,6 +1,6 @@
 ;;; erc-sound.el --- CTCP SOUND support for ERC
 
-;; Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+;; Copyright (C) 2002, 2003, 2006 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
--- a/lisp/erc/erc-speedbar.el	Tue Feb 14 12:32:39 2006 +0000
+++ b/lisp/erc/erc-speedbar.el	Thu Feb 16 16:18:54 2006 +0000
@@ -1,6 +1,6 @@
 ;;; erc-speedbar.el --- Speedbar support for ERC
 
-;; Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+;; Copyright (C) 2001, 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
 
 ;; Author: Mario Lang <mlang@delysid.org>
 ;; Contributor: Eric M. Ludlam <eric@siege-engine.com>
--- a/lisp/erc/erc-spelling.el	Tue Feb 14 12:32:39 2006 +0000
+++ b/lisp/erc/erc-spelling.el	Thu Feb 16 16:18:54 2006 +0000
@@ -1,6 +1,6 @@
 ;;; erc-spelling.el --- use flyspell in ERC
 
-;; Copyright (C) 2005, 2006  Free Software Foundation, Inc.
+;; Copyright (C) 2005, 2006 Free Software Foundation, Inc.
 
 ;; Author: Jorgen Schaefer <forcer@forcix.cx>
 ;; Keywords: irc
@@ -41,11 +41,13 @@
   ;; called AFTER the server buffer is initialized.
   ((add-hook 'erc-connect-pre-hook 'erc-spelling-init)
    (mapc (lambda (buffer)
-           (with-current-buffer buffer (erc-spelling-init)))
+           (when buffer
+             (with-current-buffer buffer (erc-spelling-init))))
          (erc-buffer-list)))
   ((remove-hook 'erc-connect-pre-hook 'erc-spelling-init)
    (mapc (lambda (buffer)
-           (with-current-buffer buffer (flyspell-mode 0)))
+           (when buffer
+             (with-current-buffer buffer (flyspell-mode 0))))
          (erc-buffer-list))))
 
 (defcustom erc-spelling-dictionaries nil
--- a/lisp/erc/erc-stamp.el	Tue Feb 14 12:32:39 2006 +0000
+++ b/lisp/erc/erc-stamp.el	Thu Feb 16 16:18:54 2006 +0000
@@ -1,4 +1,4 @@
-;;; erc-stamp.el --- Timestamping for Emacs IRC CLient
+;;; erc-stamp.el --- Timestamping for ERC messages
 
 ;; Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
 
@@ -180,11 +180,17 @@
 	  (integer :tag "Column number")
 	  (const :tag "Unspecified" nil)))
 
-(defcustom erc-timestamp-right-align-by-pixel nil
-  "*If non-nil, insert the right timestamp based on a pixel value.
-This is needed when variable-width text precedes a timestamp.
+(defcustom erc-timestamp-use-align-to (and (not (featurep 'xemacs))
+					   (>= emacs-major-version 22)
+					   (eq window-system 'x))
+  "*If non-nil, use the :align-to display property to align the stamp.
+This gives better results when variable-width characters (like
+Asian language characters and math symbols) precede a timestamp.
 Unfortunately, it only works in Emacs 22 and when using the X
-Window System."
+Window System.
+
+A side effect of enabling this is that there will only be one
+space before a right timestamp in any saved logs."
   :group 'erc-stamp
   :type 'boolean)
 
@@ -200,18 +206,15 @@
     (insert s)))
 
 (defun erc-insert-aligned (string pos)
-  "Insert STRING based on a fraction of the width of the buffer.
-Fraction is roughly (/ POS (window-width)).
+  "Insert STRING at the POSth column.
 
-If `erc-timestamp-right-align-by-pixel' is nil, insert STRING at the
-POSth column, without using pixel coordinates."
-  (if (not erc-timestamp-right-align-by-pixel)
+If `erc-timestamp-use-align-to' is t, use the :align-to display
+property to get to the POSth column."
+  (if (not erc-timestamp-use-align-to)
       (indent-to pos)
     (insert " ")
-    (let ((offset (floor (* (/ (1- pos) (window-width) 1.0)
-			    (nth 2 (window-inside-pixel-edges))))))
-      (put-text-property (1- (point)) (point) 'display
-			 `(space :align-to (,offset)))))
+    (put-text-property (1- (point)) (point) 'display
+		       (list 'space ':align-to pos)))
   (insert string))
 
 (defun erc-insert-timestamp-right (string)
@@ -237,31 +240,26 @@
     (goto-char (point-max))
     (forward-char -1);; before the last newline
     (let* ((current-window (get-buffer-window (current-buffer)))
+	   (str-width (string-width string))
 	   (pos (cond
-		 (erc-timestamp-right-column
-		  (+ erc-timestamp-right-column (length string)))
+		 (erc-timestamp-right-column erc-timestamp-right-column)
 		 ((and (boundp 'erc-fill-mode)
 		       erc-fill-mode
-		       (boundp 'erc-fill-column))
-		  (1+ erc-fill-column))
-		 (current-window
-		  (- (window-width current-window)
-		     1))
+		       (boundp 'erc-fill-column)
+		       erc-fill-column)
+		  (1+ (- erc-fill-column str-width)))
 		 (fill-column
-		  (1+ fill-column))
+		  (1+ (- fill-column str-width)))
 		 (t
-		  (- (window-width)
-		     1))))
+		  (- (window-width) str-width 1))))
 	   (from (point))
 	   (col (current-column))
 	   indent)
-      ;; deal with variable-width characters
-      (setq pos (- pos (string-width string))
-	    ;; The following is a kludge that works with most
-	    ;; international input.  It is now only used to calculate
-	    ;; whether to move to the next line before inserting a
-	    ;; stamp.
-	    col (+ col (ceiling (/ (- col (- (point) (point-at-bol))) 1.6))))
+      ;; The following is a kludge used to calculate whether to move
+      ;; to the next line before inserting a stamp.  It allows for
+      ;; some margin of error if what is displayed on the line differs
+      ;; from the number of characters on the line.
+      (setq col (+ col (ceiling (/ (- col (- (point) (point-at-bol))) 1.6))))
       (if (< col pos)
 	  (erc-insert-aligned string pos)
 	(newline)
--- a/lisp/erc/erc-track.el	Tue Feb 14 12:32:39 2006 +0000
+++ b/lisp/erc/erc-track.el	Thu Feb 16 16:18:54 2006 +0000
@@ -1,6 +1,6 @@
 ;;; erc-track.el --- Track modified channel buffers
 
-;; Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+;; Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
 
 ;; Author: Mario Lang <mlang@delysid.org>
 ;; Keywords: comm, faces
--- a/lisp/erc/erc-truncate.el	Tue Feb 14 12:32:39 2006 +0000
+++ b/lisp/erc/erc-truncate.el	Thu Feb 16 16:18:54 2006 +0000
@@ -1,6 +1,6 @@
 ;;; erc-truncate.el --- Functions for truncating ERC buffers
 
-;; Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2004, 2006 Free Software Foundation, Inc.
 
 ;; Author: Andreas Fuchs <asf@void.at>
 ;; Keywords: IRC, chat, client, Internet, logging
--- a/lisp/erc/erc-xdcc.el	Tue Feb 14 12:32:39 2006 +0000
+++ b/lisp/erc/erc-xdcc.el	Thu Feb 16 16:18:54 2006 +0000
@@ -1,6 +1,6 @@
 ;;; erc-xdcc.el --- XDCC file-server support for ERC
 
-;; Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2004, 2006 Free Software Foundation, Inc.
 
 ;; Author: Mario Lang <mlang@delysid.org>
 ;; Keywords: comm, processes
@@ -24,7 +24,7 @@
 
 ;;; Commentary:
 
-;; This file provides a very simple XDCC file server for the Emacs IRC Client.
+;; This file provides a very simple XDCC file server for ERC.
 
 ;;; Code:
 
--- a/lisp/erc/erc.el	Tue Feb 14 12:32:39 2006 +0000
+++ b/lisp/erc/erc.el	Thu Feb 16 16:18:54 2006 +0000
@@ -1719,22 +1719,15 @@
 (defun erc-migrate-modules (mods)
   "Migrate old names of ERC modules to new ones."
   ;; modify `transforms' to specify what needs to be changed
-  ;; each item is in the format '(new .old)
-  (let ((transforms '((pcomplete . completion)))
-	(modules (copy-alist mods)))
-    (dolist (transform transforms)
-      (let ((addp nil))
-	(setq modules (erc-delete-if `(lambda (val)
-					(and (eq val ',(car transform))
-					     (setq addition t)))
-				     modules))
-	(when addp
-	  (add-to-list 'modules (cdr transform)))))
-    (erc-delete-dups modules)))
-
-(defcustom erc-modules '(netsplit fill button match track pcomplete readonly
+  ;; each item is in the format '(old . new)
+  (let ((transforms '((pcomplete . completion))))
+    (erc-delete-dups
+     (mapcar (lambda (m) (or (cdr (assoc m transforms)) m))
+	     mods))))
+
+(defcustom erc-modules '(netsplit fill button match track completion readonly
 				  ring autojoin noncommands irccontrols
-				  stamp)
+				  stamp list)
   "A list of modules which erc should enable.
 If you set the value of this without using `customize' remember to call
 \(erc-update-modules) after you change it.  When using `customize', modules
@@ -1755,40 +1748,42 @@
 	 ;; this test is for the case where erc hasn't been loaded yet
 	 (when (fboundp 'erc-update-modules)
 	   (erc-update-modules)))
-  :type '(set :greedy t
-	      (const :tag "Set away status automatically" autoaway)
-	      (const :tag "Join channels automatically" autojoin)
-	      (const :tag "Integrate with Big Brother Database" bbdb)
-	      (const :tag "Buttonize URLs, nicknames, and other text" button)
-	      (const :tag "Wrap long lines" fill)
-	      (const :tag "Highlight or remove IRC control characters"
-		     irccontrols)
-	      (const :tag "Save buffers in logs" log)
-	      (const :tag "Highlight pals, fools, and other keywords" match)
-	      (const :tag "Detect netsplits" netsplit)
-	      (const :tag "Don't display non-IRC commands after evaluation"
-		     noncommands)
-	      (const :tag
-		     "Notify when the online status of certain users changes"
-		     notify)
-	      (const :tag "Complete nicknames and commands (programmable)"
-		     completion)
-	      (const :tag "Complete nicknames and commands (old)" hecomplete)
-	      (const :tag "Make displayed lines read-only" readonly)
-	      (const :tag "Replace text in messages" replace)
-	      (const :tag "Enable an input history" ring)
-	      (const :tag "Scroll to the bottom of the buffer" scrolltobottom)
-	      (const :tag "Identify to Nickserv (IRC Services) automatically"
-		     services)
-	      (const :tag "Convert smileys to pretty icons" smiley)
-	      (const :tag "Play sounds when you receive CTCP SOUND requests"
-		     sound)
-	      (const :tag "Add timestamps to messages" stamp)
-	      (const :tag "Check spelling" spelling)
-	      (const :tag "Track channel activity in the mode-line" track)
-	      (const :tag "Truncate buffers to a certain size" truncate)
-	      (const :tag "Translate morse code in messages" unmorse)
-	      (repeat :tag "Others" :inline t symbol))
+  :type
+  '(set
+    :greedy t
+    (const :tag "Set away status automatically" autoaway)
+    (const :tag "Join channels automatically" autojoin)
+    (const :tag "Integrate with Big Brother Database" bbdb)
+    (const :tag "Buttonize URLs, nicknames, and other text" button)
+    (const :tag "Wrap long lines" fill)
+    (const :tag "Highlight or remove IRC control characters"
+	   irccontrols)
+    (const :tag "Save buffers in logs" log)
+    (const :tag "Highlight pals, fools, and other keywords" match)
+    (const :tag "Detect netsplits" netsplit)
+    (const :tag "Don't display non-IRC commands after evaluation"
+	   noncommands)
+    (const :tag
+	   "Notify when the online status of certain users changes"
+	   notify)
+    (const :tag "Complete nicknames and commands (programmable)"
+	   completion)
+    (const :tag "Complete nicknames and commands (old)" hecomplete)
+    (const :tag "Make displayed lines read-only" readonly)
+    (const :tag "Replace text in messages" replace)
+    (const :tag "Enable an input history" ring)
+    (const :tag "Scroll to the bottom of the buffer" scrolltobottom)
+    (const :tag "Identify to Nickserv (IRC Services) automatically"
+	   services)
+    (const :tag "Convert smileys to pretty icons" smiley)
+    (const :tag "Play sounds when you receive CTCP SOUND requests"
+	   sound)
+    (const :tag "Add timestamps to messages" stamp)
+    (const :tag "Check spelling" spelling)
+    (const :tag "Track channel activity in the mode-line" track)
+    (const :tag "Truncate buffers to a certain size" truncate)
+    (const :tag "Translate morse code in messages" unmorse)
+    (repeat :tag "Others" :inline t symbol))
   :group 'erc)
 
 (defun erc-update-modules ()
@@ -1799,14 +1794,11 @@
       (cond
        ;; yuck. perhaps we should bring the filenames into sync?
        ((string= req "erc-completion")
-	(setq req "erc-pcomplete")
-	(setq mod 'completion))
+	(setq req "erc-pcomplete"))
        ((string= req "erc-pcomplete")
-	(setq req "erc-pcomplete")
 	(setq mod 'completion))
        ((string= req "erc-autojoin")
-	(setq req "erc-join")
-	(setq mod 'autojoin)))
+	(setq req "erc-join")))
       (condition-case nil
 	  (require (intern req))
 	(error nil))
@@ -1935,7 +1927,8 @@
       (goto-char (point-max))
       (insert "\n"))
     (set-marker (process-mark erc-server-process) (point))
-    (unless continued-session
+    (if continued-session
+	(goto-char (point-max))
       (set-marker erc-insert-marker (point))
       (erc-display-prompt)
       (goto-char (point-max)))
@@ -6143,6 +6136,26 @@
 			       (funcall erc-part-reason nil))
 		       nil tgt))))
 
+;;; Dealing with `erc-parsed'
+
+(defun erc-get-parsed-vector (point)
+  "Return the whole parsed vector on POINT."
+  (get-text-property point 'erc-parsed))
+
+(defun erc-get-parsed-vector-nick (vect)
+  "Return nickname in the parsed vector VECT."
+  (let* ((untreated-nick (and vect (erc-response.sender vect)))
+	 (maybe-nick (when untreated-nick
+		       (car (split-string untreated-nick "!")))))
+    (when (and (not (null maybe-nick))
+	       (erc-is-valid-nick-p maybe-nick))
+      untreated-nick)))
+
+(defun erc-get-parsed-vector-type (vect)
+  "Return message type in the parsed vector VECT."
+  (and vect
+       (erc-response.command vect)))
+
 (provide 'erc)
 
 ;;; Deprecated. We might eventually stop requiring the goodies automatically.
--- a/lisp/ffap.el	Tue Feb 14 12:32:39 2006 +0000
+++ b/lisp/ffap.el	Thu Feb 16 16:18:54 2006 +0000
@@ -287,9 +287,9 @@
 
 ;;; Compatibility:
 ;;
-;; This version of ffap supports Emacs 20 only, see the ftp site
-;; for a more general version.  The following functions are necessary
-;; "leftovers" from the more general version.
+;; This version of ffap supports only the Emacs it is distributed in.
+;; See the ftp site for a more general version.  The following
+;; functions are necessary "leftovers" from the more general version.
 
 (defun ffap-mouse-event nil		; current mouse event, or nil
   (and (listp last-nonmenu-event) last-nonmenu-event))
@@ -730,7 +730,7 @@
 	  path)))
 
 (defun ffap-locate-file (file &optional nosuffix path dir-ok)
-  ;; The Emacs 20 version of locate-library could almost replace this,
+  ;; The current version of locate-library could almost replace this,
   ;; except it does not let us override the suffix list.  The
   ;; compression-suffixes search moved to ffap-file-exists-string.
   "A generic path-searching function, mimics `load' by default.
--- a/lisp/files.el	Tue Feb 14 12:32:39 2006 +0000
+++ b/lisp/files.el	Thu Feb 16 16:18:54 2006 +0000
@@ -445,8 +445,13 @@
 (defcustom enable-local-variables t
   "*Control use of local variables in files you visit.
 The value can be t, nil or something else.
-A value of t means file local variables specifications are obeyed;
-nil means they are ignored; anything else means query.
+
+A value of t means file local variables specifications are obeyed
+if all the specified variables are safe.  If any variables are
+not safe, you will be queries before setting them.
+A value of nil means file local variables are ignored.
+Any other value means to always query.
+
 This variable also controls use of major modes specified in
 a -*- line.
 
@@ -2024,18 +2029,19 @@
 (defvar magic-mode-alist
   `(;; The < comes before the groups (but the first) to reduce backtracking.
     ;; TODO: UTF-16 <?xml may be preceded by a BOM 0xff 0xfe or 0xfe 0xff.
+    ;; We use [ \t\n] instead of `\\s ' to make regex overflow less likely.
     (,(let* ((incomment-re "\\(?:[^-]\\|-[^-]\\)")
-	     (comment-re (concat "\\(?:!--" incomment-re "*-->\\s *<\\)")))
-	(concat "\\(?:<\\?xml\\s +[^>]*>\\)?\\s *<"
+	     (comment-re (concat "\\(?:!--" incomment-re "*-->[ \t\n]*<\\)")))
+	(concat "\\(?:<\\?xml[ \t\n]+[^>]*>\\)?[ \t\n]*<"
 		comment-re "*"
-		"\\(?:!DOCTYPE\\s +[^>]*>\\s *<\\s *" comment-re "*\\)?"
+		"\\(?:!DOCTYPE[ \t\n]+[^>]*>[ \t\n]*<[ \t\n]*" comment-re "*\\)?"
 		"[Hh][Tt][Mm][Ll]"))
      . html-mode)
     ;; These two must come after html, because they are more general:
     ("<\\?xml " . xml-mode)
     (,(let* ((incomment-re "\\(?:[^-]\\|-[^-]\\)")
-	     (comment-re (concat "\\(?:!--" incomment-re "*-->\\s *<\\)")))
-	(concat "\\s *<" comment-re "*!DOCTYPE "))
+	     (comment-re (concat "\\(?:!--" incomment-re "*-->[ \t\n]*<\\)")))
+	(concat "[ \t\n]*<" comment-re "*!DOCTYPE "))
      . sgml-mode)
     ("%![^V]" . ps-mode)
     ("# xmcd " . conf-unix-mode))
@@ -2213,42 +2219,89 @@
        (goto-char beg)
        end))))
 
-(defun hack-local-variables-confirm (string flag-to-check)
-  (or (eq flag-to-check t)
-      (and flag-to-check
-	   (save-window-excursion
-	     (condition-case nil
-		 (switch-to-buffer (current-buffer))
-	       (error
-		;; If we fail to switch in the selected window,
-		;; it is probably a minibuffer or dedicated window.
-		;; So try another window.
-		(let ((pop-up-frames nil))
-		  ;; Refrain from popping up frames since it can't
-		  ;; be undone by save-window-excursion.
-		  (pop-to-buffer (current-buffer)))))
-	     (save-excursion
-	       (beginning-of-line)
-	       (set-window-start (selected-window) (point)))
-	     (y-or-n-p (format string
-			       (if buffer-file-name
-				   (file-name-nondirectory buffer-file-name)
-				 (concat "buffer " (buffer-name)))))))))
+(defun hack-local-variables-confirm (vars unsafe-vars risky-vars)
+  (if noninteractive
+      nil
+    (let ((name (if buffer-file-name
+		    (file-name-nondirectory buffer-file-name)
+		  (concat "buffer " (buffer-name))))
+	  prompt char)
+      (save-window-excursion
+	(let ((buf (get-buffer-create "*Local Variables*")))
+	  (pop-to-buffer buf)
+	  (set (make-local-variable 'cursor-type) nil)
+	  (erase-buffer)
+	  (if unsafe-vars
+	      (insert "The local variables list in " name
+		      "\ncontains values that may not be safe (*)"
+		      (if risky-vars
+			  ", and variables that are risky (**)."
+			"."))
+	    (if risky-vars
+		(insert "The local variables list in " name
+			"\ncontains variables that are risky (**).")
+	      (insert "A local variables list is specified in " name ".")))
+	  (insert "\n\nDo you want to apply it?  You can type
+y  -- to apply the local variables list.
+n  -- to ignore the local variables list.
+!  -- to apply the local variables list, and mark these values (*) as
+      safe (in the future, they can be set automatically.)\n\n")
+	  (dolist (elt vars)
+	    (cond ((member elt unsafe-vars)
+		   (insert "  * "))
+		  ((member elt risky-vars)
+		   (insert " ** "))
+		  (t
+		   (insert "    ")))
+	    (princ (car elt) buf)
+	    (insert " : ")
+	    (princ (cdr elt) buf)
+	    (insert "\n"))
+	  (if (< (line-number-at-pos) (window-body-height))
+	      (setq prompt "Please type y, n, or !: ")
+	    (goto-char (point-min))
+	    (setq prompt "Please type y, n, or !, or C-v to scroll: "))
+	  (let ((inhibit-quit t)
+		(cursor-in-echo-area t)
+		done)
+	    (while (not done)
+	      (message prompt)
+	      (setq char (read-event))
+	      (if (numberp char)
+		  (if (eq char ?\C-v)
+		      (condition-case nil
+			  (scroll-up)
+			(error (goto-char (point-min))))
+		    (setq done (memq (downcase char)
+				     '(?! ?y ?n ?\s ?\C-g))))))
+	    (if (= char ?\C-g)
+		(setq quit-flag nil)))
+	  (setq char (downcase char))
+	  (when (and (= char ?!) unsafe-vars)
+	    (dolist (elt unsafe-vars)
+	      (add-to-list 'safe-local-variable-values elt))
+	    (customize-save-variable
+	     'safe-local-variable-values
+	     safe-local-variable-values))
+	  (kill-buffer buf)
+	  (or (= char ?!)
+	      (= char ?\s)
+	      (= char ?y)))))))
 
 (defun hack-local-variables-prop-line (&optional mode-only)
-  "Set local variables specified in the -*- line.
+  "Return local variables specified in the -*- line.
 Ignore any specification for `mode:' and `coding:';
 `set-auto-mode' should already have handled `mode:',
 `set-auto-coding' should already have handled `coding:'.
-If MODE-ONLY is non-nil, all we do is check whether the major mode
-is specified, returning t if it is specified."
+
+If MODE-ONLY is non-nil, all we do is check whether the major
+mode is specified, returning t if it is specified.  Otherwise,
+return an alist of elements (VAR . VAL), where VAR is a variable
+and VAL is the specified value."
   (save-excursion
     (goto-char (point-min))
-    (let ((result nil)
-	  (end (set-auto-mode-1))
-	  mode-specified
-	  (enable-local-variables
-	   (and local-enable-local-variables enable-local-variables)))
+    (let ((end (set-auto-mode-1))
+	  result mode-specified)
       ;; Parse the -*- line into the RESULT alist.
       ;; Also set MODE-SPECIFIED if we see a spec or `mode'.
       (cond ((not end)
@@ -2278,128 +2331,163 @@
 		 ;; so we must do that here as well.
 		 ;; That is inconsistent, but we're stuck with it.
 		 ;; The same can be said for `coding' in set-auto-coding.
-		 (or (equal (downcase (symbol-name key)) "mode")
+		 (or (and (equal (downcase (symbol-name key)) "mode")
+			  (setq mode-specified t))
 		     (equal (downcase (symbol-name key)) "coding")
-		     (setq result (cons (cons key val) result)))
-		 (if (equal (downcase (symbol-name key)) "mode")
-		     (setq mode-specified t))
-		 (skip-chars-forward " \t;")))
-	     (setq result (nreverse result))))
-
-      (if mode-only mode-specified
-	(if (and result
-		 (or mode-only
-		     (hack-local-variables-confirm
-		      "Set local variables as specified in -*- line of %s? "
-		      enable-local-variables)))
-	    (let ((enable-local-eval enable-local-eval))
-	      (while result
-		(hack-one-local-variable (car (car result)) (cdr (car result)))
-		(setq result (cdr result)))))
-	nil))))
+		     (condition-case nil
+			 (push (cons (if (eq key 'eval)
+					 'eval
+				       (indirect-variable key))
+				     val) result)
+		       (error nil)))
+		 (skip-chars-forward " \t;")))))
+
+      (if mode-only
+	  mode-specified
+	result))))
 
 (defvar hack-local-variables-hook nil
   "Normal hook run after processing a file's local variables specs.
 Major modes can use this to examine user-specified local variables
 in order to initialize other data structure based on them.")
 
+(defcustom safe-local-variable-values nil
+  "List variable-value pairs that are considered safe.
+Each element is a cons cell (VAR . VAL), where VAR is a variable
+symbol and VAL is a value that is considered safe."
+  :group 'find-file
+  :type  'alist)
+
 (defun hack-local-variables (&optional mode-only)
   "Parse and put into effect this buffer's local variables spec.
 If MODE-ONLY is non-nil, all we do is check whether the major mode
 is specified, returning t if it is specified."
-  (let ((mode-specified
-	 ;; If MODE-ONLY is t, we check here for specifying the mode
-	 ;; in the -*- line.  If MODE-ONLY is nil, we process
-	 ;; the -*- line here.
-	 (hack-local-variables-prop-line mode-only))
-	(enable-local-variables
-	 (and local-enable-local-variables enable-local-variables)))
-    ;; Look for "Local variables:" line in last page.
-    (save-excursion
-      (goto-char (point-max))
-      (search-backward "\n\^L" (max (- (point-max) 3000) (point-min)) 'move)
-      (when (let ((case-fold-search t))
-	      (and (search-forward "Local Variables:" nil t)
-		   (or mode-only
-		       (hack-local-variables-confirm
-			"Set local variables as specified at end of %s? "
-			enable-local-variables))))
-	(skip-chars-forward " \t")
-	(let ((enable-local-eval enable-local-eval)
-	      ;; suffix is what comes after "local variables:" in its line.
-	      (suffix
-	       (concat
-		(regexp-quote (buffer-substring (point) (line-end-position)))
-		"$"))
-	      ;; prefix is what comes before "local variables:" in its line.
-	      (prefix
-	       (concat "^" (regexp-quote
-			    (buffer-substring (line-beginning-position)
-					      (match-beginning 0)))))
-	      beg)
-
-	  (forward-line 1)
-	  (let ((startpos (point))
-		endpos
-		(thisbuf (current-buffer)))
-	    (save-excursion
-	      (unless (let ((case-fold-search t))
-			(re-search-forward
-			 (concat prefix "[ \t]*End:[ \t]*" suffix)
-			 nil t))
-		(error "Local variables list is not properly terminated"))
-	      (beginning-of-line)
-	      (setq endpos (point)))
-
-	    (with-temp-buffer
-	      (insert-buffer-substring thisbuf startpos endpos)
-	      (goto-char (point-min))
-	      (subst-char-in-region (point) (point-max) ?\^m ?\n)
-	      (while (not (eobp))
-		;; Discard the prefix.
-		(if (looking-at prefix)
-		    (delete-region (point) (match-end 0))
-		  (error "Local variables entry is missing the prefix"))
-		(end-of-line)
-		;; Discard the suffix.
-		(if (looking-back suffix)
-		    (delete-region (match-beginning 0) (point))
-		  (error "Local variables entry is missing the suffix"))
-		(forward-line 1))
-	      (goto-char (point-min))
-
-	      (while (not (eobp))
-		;; Find the variable name; strip whitespace.
-		(skip-chars-forward " \t")
-		(setq beg (point))
-		(skip-chars-forward "^:\n")
-		(if (eolp) (error "Missing colon in local variables entry"))
-		(skip-chars-backward " \t")
-		(let* ((str (buffer-substring beg (point)))
-		       (var (read str))
-		       val)
-		  ;; Read the variable value.
-		  (skip-chars-forward "^:")
-		  (forward-char 1)
-		  (setq val (read (current-buffer)))
-		  (if mode-only
-		      (if (eq var 'mode)
-			  (setq mode-specified t))
-		    ;; Set the variable.  "Variables" mode and eval are funny.
-		    (with-current-buffer thisbuf
-		      (hack-one-local-variable var val))))
-		(forward-line 1)))))))
-    (unless mode-only
-      (run-hooks 'hack-local-variables-hook))
-    mode-specified))
-
-(defvar ignored-local-variables ()
+  (let ((enable-local-variables
+	 (and local-enable-local-variables enable-local-variables))
+	result)
+    (when (or mode-only enable-local-variables)
+      (setq result (hack-local-variables-prop-line mode-only))
+      ;; Look for "Local variables:" line in last page.
+      (save-excursion
+	(goto-char (point-max))
+	(search-backward "\n\^L" (max (- (point-max) 3000) (point-min))
+			 'move)
+	(when (let ((case-fold-search t))
+		(search-forward "Local Variables:" nil t))
+	  (skip-chars-forward " \t")
+	  ;; suffix is what comes after "local variables:" in its line.
+	  ;; prefix is what comes before "local variables:" in its line.
+	  (let ((suffix
+		 (concat
+		  (regexp-quote (buffer-substring (point)
+						  (line-end-position)))
+		  "$"))
+		(prefix
+		 (concat "^" (regexp-quote
+			      (buffer-substring (line-beginning-position)
+						(match-beginning 0)))))
+		beg)
+
+	    (forward-line 1)
+	    (let ((startpos (point))
+		  endpos
+		  (thisbuf (current-buffer)))
+	      (save-excursion
+		(unless (let ((case-fold-search t))
+			  (re-search-forward
+			   (concat prefix "[ \t]*End:[ \t]*" suffix)
+			   nil t))
+		  (error "Local variables list is not properly terminated"))
+		(beginning-of-line)
+		(setq endpos (point)))
+
+	      (with-temp-buffer
+		(insert-buffer-substring thisbuf startpos endpos)
+		(goto-char (point-min))
+		(subst-char-in-region (point) (point-max) ?\^m ?\n)
+		(while (not (eobp))
+		  ;; Discard the prefix.
+		  (if (looking-at prefix)
+		      (delete-region (point) (match-end 0))
+		    (error "Local variables entry is missing the prefix"))
+		  (end-of-line)
+		  ;; Discard the suffix.
+		  (if (looking-back suffix)
+		      (delete-region (match-beginning 0) (point))
+		    (error "Local variables entry is missing the suffix"))
+		  (forward-line 1))
+		(goto-char (point-min))
+
+		(while (not (eobp))
+		  ;; Find the variable name; strip whitespace.
+		  (skip-chars-forward " \t")
+		  (setq beg (point))
+		  (skip-chars-forward "^:\n")
+		  (if (eolp) (error "Missing colon in local variables entry"))
+		  (skip-chars-backward " \t")
+		  (let* ((str (buffer-substring beg (point)))
+			 (var (read str))
+			 val)
+		    ;; Read the variable value.
+		    (skip-chars-forward "^:")
+		    (forward-char 1)
+		    (setq val (read (current-buffer)))
+		    (if mode-only
+			(if (eq var 'mode)
+			    (setq result t))
+		      (unless (eq var 'coding)
+			(condition-case nil
+			    (push (cons (if (eq var 'eval)
+					    'eval
+					  (indirect-variable var))
+					val) result)
+			  (error nil)))))
+		  (forward-line 1)))))))
+
+      ;; We've read all the local variables.  Now, return whether the
+      ;; mode is specified (if MODE-ONLY is non-nil), or set the
+      ;; variables (if MODE-ONLY is nil.)
+      (if mode-only
+	  result
+	(dolist (ignored ignored-local-variables)
+	  (setq result (assq-delete-all ignored result)))
+	(if (null enable-local-eval)
+	    (setq result (assq-delete-all 'eval result)))
+	(when result
+	  (setq result (nreverse result))
+	  ;; Find those variables that we may want to save to
+	  ;; `safe-local-variable-values'.
+	  (let (risky-vars unsafe-vars)
+	    (dolist (elt result)
+	      (let ((var (car elt))
+		    (val (cdr elt)))
+		(or (eq var 'mode)
+		    (and (eq var 'eval)
+			 (or (eq enable-local-eval t)
+			     (hack-one-local-variable-eval-safep
+			      (eval (quote val)))))
+		    (safe-local-variable-p var val)
+		    (and (risky-local-variable-p var val)
+			 (push elt risky-vars))
+		    (push elt unsafe-vars))))
+	    (if (or (and (eq enable-local-variables t)
+			 (null unsafe-vars)
+			 (null risky-vars))
+		    (hack-local-variables-confirm
+		     result unsafe-vars risky-vars))
+		(dolist (elt result)
+		  (hack-one-local-variable (car elt) (cdr elt)))))
+	  (run-hooks 'hack-local-variables-hook))))))
+
+(defvar ignored-local-variables
+  '(ignored-local-variables safe-local-variable-values)
   "Variables to be ignored in a file's local variable spec.")
 
 ;; Get confirmation before setting these variables as locals in a file.
 (put 'debugger 'risky-local-variable t)
 (put 'enable-local-eval 'risky-local-variable t)
 (put 'ignored-local-variables 'risky-local-variable t)
+(put 'ignored-local-variables 'safe-local-variable-values t)
 (put 'eval 'risky-local-variable t)
 (put 'file-name-handler-alist 'risky-local-variable t)
 (put 'inhibit-quit 'risky-local-variable t)
@@ -2452,27 +2540,68 @@
 (put 'display-time-string 'risky-local-variable t)
 (put 'parse-time-rules 'risky-local-variable t)
 
-;; This case is safe because the user gets to check it before it is used.
-(put 'compile-command 'safe-local-variable 'stringp)
-
-(defun risky-local-variable-p (sym &optional val)
-  "Non-nil if SYM could be dangerous as a file-local variable with value VAL.
-If VAL is nil or omitted, the question is whether any value might be
-dangerous."
+;; Commonly-encountered local variables that are safe:
+(let ((string-or-null (lambda (a) (or (stringp a) (null a)))))
+  (eval
+   `(mapc (lambda (pair)
+	    (put (car pair) 'safe-local-variable (cdr pair)))
+	  '((byte-compile-dynamic . t)
+	    (c-basic-offset     .  integerp)
+	    (c-file-style       .  stringp)
+	    (c-indent-level     .  integerp)
+	    (comment-column     .  integerp)
+	    (compile-command    . ,string-or-null)
+	    (fill-column        .  integerp)
+	    (fill-prefix        . ,string-or-null)
+	    (indent-tabs-mode   .  t)
+	    (kept-new-versions  .  integerp)
+	    (no-byte-compile    .  t)
+	    (no-update-autoloads . t)
+	    (outline-regexp     . ,string-or-null)
+	    (page-delimiter     . ,string-or-null)
+	    (paragraph-start    . ,string-or-null)
+	    (paragraph-separate . ,string-or-null)
+	    (sentence-end       . ,string-or-null)
+	    (sentence-end-double-space . t)
+	    (tab-width          .  integerp)
+	    (version-control    .  t)))))
+
+(defun safe-local-variable-p (sym val)
+  "Non-nil if SYM is safe as a file-local variable with value VAL.
+It is safe if any of these conditions are met:
+
+ * There is a matching entry (SYM . VAL) in the
+   `safe-local-variable-values' user option.
+
+ * The `safe-local-variable' property of SYM is t.
+
+ * The `safe-local-variable' property of SYM is a function that
+   evaluates to a non-nil value with VAL as an argument."
+  (or (member (cons sym val) safe-local-variable-values)
+      (let ((safep (get sym 'safe-local-variable)))
+	(or (eq safep t)
+	    (and (functionp safep)
+		 (funcall safep val))))))
+
+(defun risky-local-variable-p (sym &optional ignored)
+  "Non-nil if SYM could be dangerous as a file-local variable.
+It is dangerous if either of these conditions are met:
+
+ * Its `risky-local-variable' property is non-nil.
+
+ * Its name ends with \"hook(s)\", \"function(s)\", \"form(s)\", \"map\",
+   \"program\", \"command(s)\", \"predicate(s)\", \"frame-alist\",
+   \"mode-alist\", \"font-lock-(syntactic-)keyword*\", or
+   \"map-alist\"."
   ;; If this is an alias, check the base name.
   (condition-case nil
       (setq sym (indirect-variable sym))
     (error nil))
-  (let ((safep (get sym 'safe-local-variable)))
-    (or (get sym 'risky-local-variable)
-	(and (string-match "-hooks?$\\|-functions?$\\|-forms?$\\|-program$\\|-commands?$\\|-predicates?$\\|font-lock-keywords$\\|font-lock-keywords-[0-9]+$\\|font-lock-syntactic-keywords$\\|-frame-alist$\\|-mode-alist$\\|-map$\\|-map-alist$"
-			   (symbol-name sym))
-	     (not safep))
-	;; If the safe-local-variable property isn't t or nil,
-	;; then it must return non-nil on the proposed value to be safe.
-	(and (not (memq safep '(t nil)))
-	     (or (null val)
-		 (not (funcall safep val)))))))
+  (or (get sym 'risky-local-variable)
+      (string-match "-hooks?$\\|-functions?$\\|-forms?$\\|-program$\\|\
+-commands?$\\|-predicates?$\\|font-lock-keywords$\\|font-lock-keywords\
+-[0-9]+$\\|font-lock-syntactic-keywords$\\|-frame-alist$\\|-mode-alist$\\|\
+-map$\\|-map-alist$" (symbol-name sym))))
 
 (defcustom safe-local-eval-forms nil
   "*Expressions that are considered \"safe\" in an `eval:' local variable.
@@ -2529,35 +2658,12 @@
 		      ok)))))))
 
 (defun hack-one-local-variable (var val)
-  "\"Set\" one variable in a local variables spec.
-A few patterns are specified so that any name which matches one
-is considered risky."
+  "Set local variable VAR with value VAL."
   (cond ((eq var 'mode)
 	 (funcall (intern (concat (downcase (symbol-name val))
 				  "-mode"))))
-	((eq var 'coding)
-	 ;; We have already handled coding: tag in set-auto-coding.
-	 nil)
-	((memq var ignored-local-variables)
-	 nil)
-	;; "Setting" eval means either eval it or do nothing.
-	;; Likewise for setting hook variables.
-	((risky-local-variable-p var val)
-	 ;; Permit evalling a put of a harmless property.
-	 ;; if the args do nothing tricky.
-	 (if (or (and (eq var 'eval)
-		      (hack-one-local-variable-eval-safep val))
-		 ;; Permit eval if not root and user says ok.
-		 (and (not (zerop (user-uid)))
-		      (hack-local-variables-confirm
-		       "Process `eval' or hook local variables in %s? "
-		       enable-local-eval)))
-	     (if (eq var 'eval)
-		 (save-excursion (eval val))
-	       (make-local-variable var)
-	       (set var val))
-	   (message "Ignoring risky spec in the local variables list")))
-	;; Ordinary variable, really set it.
+	((eq var 'eval)
+	 (save-excursion (eval val)))
 	(t (make-local-variable var)
 	   ;; Make sure the string has no text properties.
 	   ;; Some text properties can get evaluated in various ways,
--- a/lisp/find-lisp.el	Tue Feb 14 12:32:39 2006 +0000
+++ b/lisp/find-lisp.el	Thu Feb 16 16:18:54 2006 +0000
@@ -359,9 +359,5 @@
 
 (provide 'find-lisp)
 
-;; Local Variables:
-;; autocompile: t
-;; End:
-
 ;;; arch-tag: a711374c-f12a-46f6-aa18-ba7d77b9602a
 ;;; find-lisp.el ends here
--- a/lisp/gnus/ChangeLog	Tue Feb 14 12:32:39 2006 +0000
+++ b/lisp/gnus/ChangeLog	Thu Feb 16 16:18:54 2006 +0000
@@ -1,3 +1,12 @@
+2006-02-16  Juanma Barranquero  <lekktu@gmail.com>
+
+	* html2text.el (html2text-remove-tag-list):
+	* spam-stat.el (spam-stat-buffer-words): Fix typo in docstring.
+
+2006-02-14  Chong Yidong  <cyd@stupidchicken.com>
+
+	* gnus-cus.el: Revert 2005-10-17 change.
+
 2006-02-10  Reiner Steib  <Reiner.Steib@gmx.de>
 
 	* gnus.el: Remove bogus comment.
--- a/lisp/gnus/gnus-cus.el	Tue Feb 14 12:32:39 2006 +0000
+++ b/lisp/gnus/gnus-cus.el	Thu Feb 16 16:18:54 2006 +0000
@@ -36,14 +36,6 @@
 
 ;;; Widgets:
 
-(defvar gnus-custom-map
-  (let ((map (make-keymap)))
-    (set-keymap-parent map widget-keymap)
-    (suppress-keymap map)
-    (define-key map [mouse-1] 'widget-move-and-invoke)
-    map)
-  "Keymap for editing Gnus customization buffers.")
-
 (defun gnus-custom-mode ()
   "Major mode for editing Gnus customization buffers.
 
@@ -59,7 +51,7 @@
   (kill-all-local-variables)
   (setq major-mode 'gnus-custom-mode
 	mode-name "Gnus Customize")
-  (use-local-map gnus-custom-map)
+  (use-local-map widget-keymap)
   ;; Emacs 21 stuff:
   (when (and (facep 'custom-button-face)
 	     (facep 'custom-button-pressed-face))
@@ -490,7 +482,7 @@
 	    (widget-create 'sexp
 			   :tag "Method"
 			   :value (gnus-info-method info))))
-    (use-local-map gnus-custom-map)
+    (use-local-map widget-keymap)
     (widget-setup)
     (buffer-enable-undo)
     (goto-char (point-min))))
@@ -884,7 +876,7 @@
 			 '(repeat :inline t
 				  :tag "Unknown entries"
 				  sexp)))
-    (use-local-map gnus-custom-map)
+    (use-local-map widget-keymap)
     (widget-setup)))
 
 (defun gnus-score-customize-done (&rest ignore)
@@ -1061,7 +1053,7 @@
 
       (gnus-agent-cat-prepare-category-field agent-enable-undownloaded-faces)
 
-      (use-local-map gnus-custom-map)
+      (use-local-map widget-keymap)
       (widget-setup)
       (buffer-enable-undo))))
 
--- a/lisp/gnus/html2text.el	Tue Feb 14 12:32:39 2006 +0000
+++ b/lisp/gnus/html2text.el	Thu Feb 16 16:18:54 2006 +0000
@@ -59,7 +59,7 @@
 
 This is a list of tags which should be removed, without any
 formatting.  Note that tags in the list are presented *without*
-any \"<\" or \">\".  All occurences of a tag appearing in this
+any \"<\" or \">\".  All occurrences of a tag appearing in this
 list are removed, irrespective of whether it is a closing or
 opening tag, or if the tag has additional attributes.  The
 deletion is done by the function `html2text-remove-tags'.
--- a/lisp/gnus/spam-stat.el	Tue Feb 14 12:32:39 2006 +0000
+++ b/lisp/gnus/spam-stat.el	Thu Feb 16 16:18:54 2006 +0000
@@ -323,7 +323,7 @@
      ,@body))
 
 (defun spam-stat-buffer-words ()
-  "Return a hash table of words and number of occurences in the buffer."
+  "Return a hash table of words and number of occurrences in the buffer."
   (with-spam-stat-max-buffer-size
    (with-syntax-table spam-stat-syntax-table
      (goto-char (point-min))
--- a/lisp/help.el	Tue Feb 14 12:32:39 2006 +0000
+++ b/lisp/help.el	Thu Feb 16 16:18:54 2006 +0000
@@ -510,7 +510,7 @@
 		(if (> (length keys) 0)
 		    (if remapped
 			(format "%s is remapped to %s which is on %s"
-				definition symbol keys)
+				symbol remapped keys)
 		      (format "%s is on %s" symbol keys))
 		  ;; If this is the command the user asked about,
 		  ;; and it is not on any key, say so.
@@ -565,31 +565,30 @@
 
 If KEY is a menu item or a tool-bar button that is disabled, this command
 temporarily enables it to allow getting help on disabled items and buttons."
-  (interactive)
-  (let ((enable-disabled-menus-and-buttons t)
-	(save-yank-menu))
-    (if key
-	;; Non-interactive invocation
-	(describe-key-briefly-internal key insert untranslated)
-      ;; If yank-menu is empty, populate it temporarily, so that
-      ;; "Select and Paste" menu can generate a complete event
-      (if (null (cdr yank-menu))
-	  (unwind-protect
-	      (progn
-		(setq save-yank-menu (copy-sequence yank-menu))
-		(menu-bar-update-yank-menu "(any string)" nil)
-		(call-interactively 'describe-key-briefly-internal))
-	    (progn (setq yank-menu (copy-sequence save-yank-menu))
-		   (fset 'yank-menu (cons 'keymap yank-menu))))
-	(call-interactively 'describe-key-briefly-internal)))))
-
-(defun describe-key-briefly-internal (key &optional insert untranslated)
-  "Print the name of the function KEY invokes.  KEY is a string.
-If INSERT (the prefix arg) is non-nil, insert the message in the buffer.
-If non-nil UNTRANSLATED is a vector of the untranslated events.
-It can also be a number in which case the untranslated events from
-the last key hit are used."
-  (interactive "kDescribe key briefly: \nP\np")
+  (interactive
+   (let ((enable-disabled-menus-and-buttons t)
+	 (cursor-in-echo-area t)
+	 saved-yank-menu)
+     (unwind-protect
+	 (let (key)
+	   ;; If yank-menu is empty, populate it temporarily, so that
+	   ;; "Select and Paste" menu can generate a complete event.
+	   (when (null (cdr yank-menu))
+	     (setq saved-yank-menu (copy-sequence yank-menu))
+	     (menu-bar-update-yank-menu "(any string)" nil))
+	   (setq key (read-key-sequence "Describe key (or click or menu item): "))
+	   (list
+	    key
+	    (prefix-numeric-value current-prefix-arg)
+	    ;; If KEY is a down-event, read the corresponding up-event
+	    ;; and use it as the third argument.
+	    (if (and (consp key) (symbolp (car key))
+		     (memq 'down (cdr (get (car key) 'event-symbol-elements))))
+		(read-event))))
+       ;; Put yank-menu back as it was, if we changed it.
+       (when saved-yank-menu
+	 (setq yank-menu (copy-sequence saved-yank-menu))
+	 (fset 'yank-menu (cons 'keymap yank-menu))))))
   (if (numberp untranslated)
       (setq untranslated (this-single-command-raw-keys)))
   (save-excursion
@@ -611,6 +610,11 @@
       (let ((defn (or (string-key-binding key)
 		      (key-binding key t)))
 	    key-desc)
+	;; Handle the case where we faked an entry in "Select and Paste" menu.
+	(if (and (eq defn nil)
+		 (stringp (aref key (1- (length key))))
+		 (eq (key-binding (substring key 0 -1)) 'yank-menu))
+	    (setq defn 'menu-bar-select-yank))
 	;; Don't bother user with strings from (e.g.) the select-paste menu.
 	(if (stringp (aref key (1- (length key))))
 	    (aset key (1- (length key)) "(any string)"))
@@ -641,35 +645,30 @@
 
 If KEY is a menu item or a tool-bar button that is disabled, this command
 temporarily enables it to allow getting help on disabled items and buttons."
-  (interactive)
-  (let ((enable-disabled-menus-and-buttons t)
-	(save-yank-menu))
-    (if key
-	;; Non-interactive invocation
-	(describe-key-internal key untranslated up-event)
-      ;; If yank-menu is empty, populate it temporarily, so that
-      ;; "Select and Paste" menu can generate a complete event
-      (if (null (cdr yank-menu))
-	  (unwind-protect
-	      (progn
-		(setq save-yank-menu (copy-sequence yank-menu))
-		(menu-bar-update-yank-menu "(any string)" nil)
-		(call-interactively 'describe-key-internal))
-	    (progn (setq yank-menu (copy-sequence save-yank-menu))
-		   (fset 'yank-menu (cons 'keymap yank-menu))))
-	(call-interactively 'describe-key-internal)))))
-
-(defun describe-key-internal (key &optional untranslated up-event)
-  "Display documentation of the function invoked by KEY.
-KEY can be any kind of a key sequence; it can include keyboard events,
-mouse events, and/or menu events.  When calling from a program,
-pass KEY as a string or a vector.
-
-If non-nil, UNTRANSLATED is a vector of the corresponding untranslated events.
-It can also be a number, in which case the untranslated events from
-the last key sequence entered are used.
-UP-EVENT is the up-event that was discarded by reading KEY, or nil."
-  (interactive "kDescribe key (or click or menu item): \np\nU")
+  (interactive
+   (let ((enable-disabled-menus-and-buttons t)
+	 (cursor-in-echo-area t)
+	 saved-yank-menu)
+     (unwind-protect
+	 (let (key)
+	   ;; If yank-menu is empty, populate it temporarily, so that
+	   ;; "Select and Paste" menu can generate a complete event.
+	   (when (null (cdr yank-menu))
+	     (setq saved-yank-menu (copy-sequence yank-menu))
+	     (menu-bar-update-yank-menu "(any string)" nil))
+	   (setq key (read-key-sequence "Describe key (or click or menu item): "))
+	   (list
+	    key
+	    (prefix-numeric-value current-prefix-arg)
+	    ;; If KEY is a down-event, read the corresponding up-event
+	    ;; and use it as the third argument.
+	    (if (and (consp key) (symbolp (car key))
+		     (memq 'down (cdr (get (car key) 'event-symbol-elements))))
+		(read-event))))
+       ;; Put yank-menu back as it was, if we changed it.
+       (when saved-yank-menu
+	 (setq yank-menu (copy-sequence saved-yank-menu))
+	 (fset 'yank-menu (cons 'keymap yank-menu))))))
   (if (numberp untranslated)
       (setq untranslated (this-single-command-raw-keys)))
   (save-excursion
@@ -686,6 +685,11 @@
 	    (set-buffer (window-buffer window))
 	(goto-char position))
       (let ((defn (or (string-key-binding key) (key-binding key t))))
+	;; Handle the case where we faked an entry in "Select and Paste" menu.
+	(if (and (eq defn nil)
+		 (stringp (aref key (1- (length key))))
+		 (eq (key-binding (substring key 0 -1)) 'yank-menu))
+	    (setq defn 'menu-bar-select-yank))
 	(if (or (null defn) (integerp defn) (equal defn 'undefined))
 	    (message "%s is undefined" (help-key-description key untranslated))
 	  (help-setup-xref (list #'describe-function defn) (interactive-p))
--- a/lisp/icomplete.el	Tue Feb 14 12:32:39 2006 +0000
+++ b/lisp/icomplete.el	Thu Feb 16 16:18:54 2006 +0000
@@ -325,7 +325,7 @@
 
 ;;;_* Local emacs vars.
 ;;;Local variables:
-;;;outline-layout: (-2 :)
+;;;allout-layout: (-2 :)
 ;;;End:
 
 ;; arch-tag: 339ec25a-0741-4eb6-be63-997532e89b0f
--- a/lisp/info.el	Tue Feb 14 12:32:39 2006 +0000
+++ b/lisp/info.el	Thu Feb 16 16:18:54 2006 +0000
@@ -134,7 +134,7 @@
   :group 'info)
 
 (defface info-xref-visited
-  '((t :inherit link-visited))
+  '((t :inherit (link-visited info-xref)))
   "Face for visited Info cross-references."
   :version "22.1"
   :group 'info)
@@ -1407,11 +1407,13 @@
 		(concat
 		 " ("
 		 (if (stringp Info-current-file)
-		     (file-name-nondirectory Info-current-file)
+		     (replace-regexp-in-string
+		      "%" "%%" (file-name-nondirectory Info-current-file))
 		   "")
 		 ") "
 		 (if Info-current-node
-		     (propertize Info-current-node
+		     (propertize (replace-regexp-in-string
+				  "%" "%%" Info-current-node)
 				 'face 'mode-line-buffer-id
 				 'help-echo
 				 "mouse-1: scroll forward, mouse-3: scroll back"
@@ -3352,7 +3354,7 @@
 \\[Info-search-case-sensitively]	Search through this Info file for specified regexp case-sensitively.
 \\[Info-search-next]	Search for another occurrence of regexp
 	  from a previous \\<Info-mode-map>\\[Info-search] command.
-\\[Info-index]	Look up a topic in this manual's Index and move to that index entry.
+\\[Info-index]	Search for a topic in this manual's Index and go to index entry.
 \\[Info-index-next]	(comma) Move to the next match from a previous \\<Info-mode-map>\\[Info-index] command.
 \\[info-apropos]	Look for a string in the indices of all manuals.
 \\[Info-goto-node]	Move to node specified by name.
--- a/lisp/mh-e/ChangeLog	Tue Feb 14 12:32:39 2006 +0000
+++ b/lisp/mh-e/ChangeLog	Thu Feb 16 16:18:54 2006 +0000
@@ -1,3 +1,11 @@
+2006-02-15  Peter S Galbraith  <psg@debian.org>
+
+	* mh-compat.el (mh-image-search-load-path): Compatibility code.
+	Emacs 21 and XEmacs don't have `image-search-load-path'.
+
+	* mh-utils.el (mh-image-load-path): Don't bail out on error if the
+	images are already found.
+
 2006-02-10  Bill Wohler  <wohler@newt.com>
 
 	* mh-search.el (mh-search): Wrap code in (block mh-search ...)
--- a/lisp/mh-e/mh-compat.el	Tue Feb 14 12:32:39 2006 +0000
+++ b/lisp/mh-e/mh-compat.el	Thu Feb 16 16:18:54 2006 +0000
@@ -115,6 +115,12 @@
       `(face-background ,face ,frame)
     `(face-background ,face ,frame ,inherit)))
 
+(mh-defun-compat mh-image-search-load-path
+  image-search-load-path (file &optional path)
+  "Emacs 21 and XEmacs don't have `image-search-load-path'.
+This function returns nil on those systems."
+  nil)
+
 ;; For XEmacs.
 (defalias 'mh-line-beginning-position
   (if (fboundp 'line-beginning-position)
@@ -131,7 +137,7 @@
 (mh-defun-compat mh-mail-abbrev-make-syntax-table
   mail-abbrev-make-syntax-table ()
   "Emacs 21 and XEmacs don't have `mail-abbrev-make-syntax-table'.
-This function does nothing on those systems."
+This function returns nil on those systems."
   nil)
 
 (mh-defun-compat mh-match-string-no-properties
--- a/lisp/mh-e/mh-utils.el	Tue Feb 14 12:32:39 2006 +0000
+++ b/lisp/mh-e/mh-utils.el	Thu Feb 16 16:18:54 2006 +0000
@@ -109,21 +109,41 @@
 
 See also variable `mh-image-load-path-called-flag'."
   (unless mh-image-load-path-called-flag
-    (if (or (not mh-image-load-path)
-            (not (file-exists-p mh-image-load-path)))
-        (let (mh-library-name)
-          ;; First, find mh-e in the load-path.
-          (setq mh-library-name (locate-library "mh-e"))
-          (if (not mh-library-name)
-              (error "Can not find MH-E in load-path"))
-          (setq mh-image-load-path
-                (expand-file-name (concat (file-name-directory mh-library-name)
-                                          "../../etc/images")))))
-    (if (not (file-exists-p mh-image-load-path))
-        (error "Can not find image directory %s" mh-image-load-path))
-    (if (boundp 'image-load-path)
-        (add-to-list 'image-load-path mh-image-load-path)
-      (add-to-list 'load-path mh-image-load-path))
+    (cond
+     ((and mh-image-load-path
+           (file-exists-p (expand-file-name "mh-logo.xpm"
+                                            mh-image-load-path))))
+      ;; User setting exists. We're done.
+     ((and mh-image-load-path
+           (not (file-exists-p (expand-file-name "mh-logo.xpm"
+                                                 mh-image-load-path))))
+      ;; User setting does not exist.
+      (message "Variable mh-image-load-path %s does not contain MH-E images"
+               mh-image-load-path))
+     ((mh-image-search-load-path "mh-logo.xpm")
+      ;; Emacs 22 already knows where the images are.
+      (setq mh-image-load-path
+	    (file-name-directory (mh-image-search-load-path "mh-logo.xpm"))))
+     ((locate-library "mh-logo.xpm")
+      ;; Other Emacs already knows where the images are...
+      (setq mh-image-load-path
+	    (file-name-directory (locate-library "mh-logo.xpm"))))
+     (t      
+      ;; Guess `mh-image-load-path' if it wasn't provided by the user.
+      (let (mh-library-name)
+        ;; First, find mh-e in the load-path.
+        (setq mh-library-name (locate-library "mh-e"))
+        (if (not mh-library-name)
+            (error "Can not find MH-E in load-path"))
+        (setq mh-image-load-path
+              (expand-file-name (concat
+                                 (file-name-directory mh-library-name)
+                                 "../../etc/images"))))
+      (if (not (file-exists-p mh-image-load-path))
+	  (error "Can not find image directory %s" mh-image-load-path))
+      (if (boundp 'image-load-path)
+	  (add-to-list 'image-load-path mh-image-load-path)
+	(add-to-list 'load-path mh-image-load-path))))
     (setq mh-image-load-path-called-flag t)))
 
 ;;;###mh-autoload
--- a/lisp/mouse.el	Tue Feb 14 12:32:39 2006 +0000
+++ b/lisp/mouse.el	Thu Feb 16 16:18:54 2006 +0000
@@ -481,21 +481,8 @@
 
 		 ;; grow/shrink minibuffer?
 		 (if should-enlarge-minibuffer
-		     (progn
-		       ;; yes.  briefly select minibuffer so
-		       ;; enlarge-window will affect the
-		       ;; correct window.
-		       (select-window minibuffer)
-		       ;; scale back shrinkage if it would
-		       ;; make the minibuffer less than 1
-		       ;; line tall.
-		       (if (and (> growth 0)
-				(< (- (window-height minibuffer)
-				      growth)
-				   1))
-			   (setq growth (1- (window-height minibuffer))))
-		       (enlarge-window (- growth))
-		       (select-window start-event-window))
+		     (unless resize-mini-windows
+		       (mouse-drag-move-window-bottom start-event-window growth))
 		   ;; no.  grow/shrink the selected window
 		   ;(message "growth = %d" growth)
 		   (if mode-line-p
--- a/lisp/mwheel.el	Tue Feb 14 12:32:39 2006 +0000
+++ b/lisp/mwheel.el	Thu Feb 16 16:18:54 2006 +0000
@@ -91,7 +91,7 @@
 		  mouse-wheel-click-button))
   "Event that should be temporarily inhibited after mouse scrolling.
 The mouse wheel is typically on the mouse-2 button, so it may easily
-happen that text is accidentially yanked into the buffer when
+happen that text is accidentally yanked into the buffer when
 scrolling with the mouse wheel.  To prevent that, this variable can be
 set to the event sent when clicking on the mouse wheel button."
   :group 'mouse
@@ -220,7 +220,7 @@
 (define-minor-mode mouse-wheel-mode
   "Toggle mouse wheel support.
 With prefix argument ARG, turn on if positive, otherwise off.
-Returns non-nil if the new state is enabled."
+Return non-nil if the new state is enabled."
   :global t
   :group 'mouse
   (let* ((dn mouse-wheel-down-event)
--- a/lisp/net/rcirc.el	Tue Feb 14 12:32:39 2006 +0000
+++ b/lisp/net/rcirc.el	Thu Feb 16 16:18:54 2006 +0000
@@ -929,7 +929,7 @@
   %fp       Following text uses the face `rcirc-server-prefix'
   %fs       Following text uses the face `rcirc-server'
   %f[FACE]  Following text uses the face FACE
-  %f-        Following text uses the default face
+  %f-       Following text uses the default face
   %%        A literal `%' character
 "
   :type '(alist :key-type (choice (string :tag "Type")
@@ -957,59 +957,56 @@
 	(setq chunk (substring chunk 1)))
       (setq repl
 	    (cond ((eq key ?%)
-		   ;; %% -- literal % character	;
+		   ;; %% -- literal % character
 		   "%")
 		  ((eq key ?n)
-		   ;; %n -- nick	;
+		   ;; %n -- nick
 		   (rcirc-facify (concat (rcirc-abbrev-nick sender)
 					 (and target (concat "," target)))
 				 (if (string= sender (rcirc-nick process))
 				     'rcirc-my-nick
 				   'rcirc-other-nick)))
 		  ((eq key ?T)
-		   ;; %T -- timestamp	;
+		   ;; %T -- timestamp
 		   (rcirc-facify
 		    (format-time-string rcirc-time-format (current-time))
 		    'rcirc-timestamp))
 		  ((eq key ?m)
-		   ;; %m -- message text ;
-		   ;; We add the text property `rcirc-text' to identify this ;
-		   ;; as the body text.	;
+		   ;; %m -- message text
+		   ;; We add the text property `rcirc-text' to identify this
+		   ;; as the body text.
 		   (propertize
 		    (rcirc-mangle-text process (rcirc-facify text face))
 		    'rcirc-text text))
 		  ((eq key ?t)
-		   ;; %t -- target	;
+		   ;; %t -- target
 		   (rcirc-facify (or rcirc-target "") face))
 		  ((eq key ?r)
-		   ;; %r -- response	;
+		   ;; %r -- response
 		   (rcirc-facify response face))
 		  ((eq key ?f)
-		   ;; %f -- change face	;
+		   ;; %f -- change face
 		   (setq face-key (aref chunk 0))
+		   (setq chunk (substring chunk 1))
 		   (cond ((eq face-key ?w)
-			  ;; %fw -- warning face ;
+			  ;; %fw -- warning face
 			  (setq face 'font-lock-warning-face))
 			 ((eq face-key ?p)
-			  ;; %fp -- server-prefix face ;
+			  ;; %fp -- server-prefix face
 			  (setq face 'rcirc-server-prefix))
 			 ((eq face-key ?s)
-			  ;; %fs -- warning face ;
+			  ;; %fs -- warning face
 			  (setq face 'rcirc-server))
 			 ((eq face-key ?-)
-			  ;; %fs -- warning face ;
+			  ;; %fs -- warning face
 			  (setq face nil))
 			 ((and (eq face-key ?\[)
-			       (string-match "^[[]\\([^]]*\\)[]]" chunk)
+			       (string-match "^\\([^]]*\\)[]]" chunk)
 			       (facep (match-string 1 chunk)))
-			  ;; %f[...] -- named face ;
+			  ;; %f[...] -- named face
 			  (setq face (intern (match-string 1 chunk)))
-			  (setq chunk (substring chunk (match-end 1)))))
-		   (setq chunk (substring chunk 1))
-		   "")
-		  (t
-		   ;; just insert the key literally ;
-		   (rcirc-facify (substring chunk 0 1) face))))
+			  (setq chunk (substring chunk (match-end 0)))))
+		   "")))
       (setq result (concat result repl (rcirc-facify chunk face))))
     result))
 
--- a/lisp/net/tramp.el	Tue Feb 14 12:32:39 2006 +0000
+++ b/lisp/net/tramp.el	Thu Feb 16 16:18:54 2006 +0000
@@ -836,8 +836,10 @@
   :type 'string)
 
 (defcustom tramp-remote-path
-  '("/bin" "/usr/bin" "/usr/sbin" "/usr/local/bin" "/usr/ccs/bin"
-    "/local/bin" "/local/freeware/bin" "/local/gnu/bin"
+  ;; "/usr/xpg4/bin" has been placed first, because on Solaris a POSIX
+  ;; compatible "id" is needed.
+  '("/usr/xpg4/bin" "/bin" "/usr/bin" "/usr/sbin" "/usr/local/bin"
+    "/usr/ccs/bin" "/local/bin" "/local/freeware/bin" "/local/gnu/bin"
     "/usr/freeware/bin" "/usr/pkg/bin" "/usr/contrib/bin")
   "*List of directories to search for executables on remote host.
 Please notify me about other semi-standard directories to include here.
@@ -1735,7 +1737,7 @@
 (defvar tramp-perl-encode
   "%s -e '
 # This script contributed by Juanma Barranquero <lektu@terra.es>.
-# Copyright (C) 2006 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2006 Free Software Foundation, Inc.
 use strict;
 
 my %%trans = do {
@@ -1777,7 +1779,7 @@
 (defvar tramp-perl-decode
   "%s -e '
 # This script contributed by Juanma Barranquero <lektu@terra.es>.
-# Copyright (C) 2006 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2006 Free Software Foundation, Inc.
 use strict;
 
 my %%trans = do {
--- a/lisp/play/landmark.el	Tue Feb 14 12:32:39 2006 +0000
+++ b/lisp/play/landmark.el	Thu Feb 16 16:18:54 2006 +0000
@@ -1694,13 +1694,13 @@
 
 ;;;_ + Local variables
 
-;;; The following `outline-layout' local variable setting:
+;;; The following `allout-layout' local variable setting:
 ;;;  - closes all topics from the first topic to just before the third-to-last,
 ;;;  - shows the children of the third to last (config vars)
 ;;;  - and the second to last (code section),
 ;;;  - and closes the last topic (this local-variables section).
 ;;;Local variables:
-;;;outline-layout: (0 : -1 -1 0)
+;;;allout-layout: (0 : -1 -1 0)
 ;;;End:
 
 (provide 'landmark)
--- a/lisp/progmodes/ebrowse.el	Tue Feb 14 12:32:39 2006 +0000
+++ b/lisp/progmodes/ebrowse.el	Thu Feb 16 16:18:54 2006 +0000
@@ -4236,7 +4236,7 @@
   "*Keymap for Ebrowse commands.")
 
 
-(defvar ebrowse-global-prefix-key "\C-cb"
+(defvar ebrowse-global-prefix-key "\C-cC-m"
   "Prefix key for Ebrowse commands.")
 
 
--- a/lisp/progmodes/flymake.el	Tue Feb 14 12:32:39 2006 +0000
+++ b/lisp/progmodes/flymake.el	Thu Feb 16 16:18:54 2006 +0000
@@ -339,7 +339,7 @@
             nil)))))
 
 (defun flymake-fix-file-name (name)
-  "Replace all occurences of '\' with '/'."
+  "Replace all occurrences of '\' with '/'."
   (when name
     (setq name (expand-file-name name))
     (setq name (abbreviate-file-name name))
--- a/lisp/progmodes/gdb-ui.el	Tue Feb 14 12:32:39 2006 +0000
+++ b/lisp/progmodes/gdb-ui.el	Thu Feb 16 16:18:54 2006 +0000
@@ -185,7 +185,6 @@
   "Font lock keywords used in `gdb-local-mode'.")
 
 ;; Variables for GDB 6.4+
-
 (defvar gdb-register-names nil "List of register names.")
 (defvar gdb-changed-registers nil
   "List of changed register numbers (strings).")
@@ -203,7 +202,7 @@
 
 If `gdb-many-windows' is t, regardless of the value of
 `gdb-show-main', the layout below will appear unless
-`gdb-use-inferior-io-buffer' is nil when the source buffer
+`gdb-use-separate-io-buffer' is nil when the source buffer
 occupies the full width of the frame.  Keybindings are given in
 relevant buffer.
 
@@ -281,26 +280,26 @@
   :group 'gud
   :version "22.1")
 
-(defcustom gdb-use-inferior-io-buffer nil
+(defcustom gdb-use-separate-io-buffer nil
   "Non-nil means display output from the inferior in a separate buffer."
   :type 'boolean
   :group 'gud
   :version "22.1")
 
-(defun gdb-use-inferior-io-buffer (arg)
+(defun gdb-use-separate-io-buffer (arg)
   "Toggle separate IO for inferior.
 With arg, use separate IO iff arg is positive."
   (interactive "P")
-  (setq gdb-use-inferior-io-buffer
+  (setq gdb-use-separate-io-buffer
 	(if (null arg)
-	    (not gdb-use-inferior-io-buffer)
+	    (not gdb-use-separate-io-buffer)
 	  (> (prefix-numeric-value arg) 0)))
   (message (format "Separate inferior IO %sabled"
-		   (if gdb-use-inferior-io-buffer "en" "dis")))
+		   (if gdb-use-separate-io-buffer "en" "dis")))
   (if (and gud-comint-buffer
 	   (buffer-name gud-comint-buffer))
       (condition-case nil
-	  (if gdb-use-inferior-io-buffer
+	  (if gdb-use-separate-io-buffer
 	      (gdb-restore-windows)
 	    (kill-buffer (gdb-inferior-io-name)))
 	(error nil))))
@@ -462,7 +461,7 @@
 
   (setq gdb-buffer-type 'gdba)
 
-  (if gdb-use-inferior-io-buffer (gdb-clear-inferior-io))
+  (if gdb-use-separate-io-buffer (gdb-clear-inferior-io))
 
   ;; Hack to see test for GDB 6.4+ (-stack-info-frame was implemented in 6.4)
   (setq gdb-version nil)
@@ -571,7 +570,7 @@
 	(set-text-properties 0 (length expr) nil expr)
 	(gdb-enqueue-input
 	 (list
-	  (if (eq gud-minor-mode 'gdba)
+	  (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
 	      (concat "server interpreter mi \"-var-create - * "  expr "\"\n")
 	    (concat"-var-create - * "  expr "\n"))
 	  `(lambda () (gdb-var-create-handler ,expr))))))))
@@ -594,8 +593,7 @@
 	  (speedbar-change-initial-expansion-list "GUD"))
 	(gdb-enqueue-input
 	 (list
-	  (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer)
-		  'gdba)
+	  (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
 	      (concat "server interpreter mi \"-var-evaluate-expression "
 		      (nth 1 var) "\"\n")
 	    (concat "-var-evaluate-expression " (nth 1 var) "\n"))
@@ -743,13 +741,11 @@
 TOKEN is data related to this node.
 INDENT is the current indentation depth."
   (cond ((string-match "+" text)        ;expand this node
-	 (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
-	     (if (string-equal gdb-version "pre-6.4")
-		 (gdb-var-list-children token)
-	       (gdb-var-list-children-1 token))
-	   (progn
-	     (gdbmi-var-update)
-	     (gdbmi-var-list-children token))))
+	 (if (and
+	      (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
+	      (string-equal gdb-version "pre-6.4"))
+	     (gdb-var-list-children token)
+	   (gdb-var-list-children-1 token)))
 	((string-match "-" text)	;contract this node
 	 (dolist (var gdb-var-list)
 	   (if (string-match (concat token "\\.") (nth 1 var))
@@ -856,10 +852,10 @@
 	  (gdb-get-target-string)
 	  "*"))
 
-(defun gdb-display-inferior-io-buffer ()
+(defun gdb-display-separate-io-buffer ()
   "Display IO of inferior in a separate window."
   (interactive)
-  (if gdb-use-inferior-io-buffer
+  (if gdb-use-separate-io-buffer
       (gdb-display-buffer
        (gdb-get-create-buffer 'gdb-inferior-io))))
 
@@ -870,21 +866,21 @@
     (menu-bar-lines . nil)
     (minibuffer . nil)))
 
-(defun gdb-frame-inferior-io-buffer ()
+(defun gdb-frame-separate-io-buffer ()
   "Display IO of inferior in a new frame."
   (interactive)
-  (if gdb-use-inferior-io-buffer
+  (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)))))
 
 (defvar gdb-inferior-io-mode-map
   (let ((map (make-sparse-keymap)))
-    (define-key map "\C-c\C-c" 'gdb-inferior-io-interrupt)
-    (define-key map "\C-c\C-z" 'gdb-inferior-io-stop)
-    (define-key map "\C-c\C-\\" 'gdb-inferior-io-quit)
-    (define-key map "\C-c\C-d" 'gdb-inferior-io-eof)
-    (define-key map "\C-d" 'gdb-inferior-io-eof)
+    (define-key map "\C-c\C-c" 'gdb-separate-io-interrupt)
+    (define-key map "\C-c\C-z" 'gdb-separate-io-stop)
+    (define-key map "\C-c\C-\\" 'gdb-separate-io-quit)
+    (define-key map "\C-c\C-d" 'gdb-separate-io-eof)
+    (define-key map "\C-d" 'gdb-separate-io-eof)
     map))
 
 (define-derived-mode gdb-inferior-io-mode comint-mode "Inferior I/O"
@@ -905,25 +901,25 @@
     (process-send-string proc string)
     (process-send-string proc "\n")))
 
-(defun gdb-inferior-io-interrupt ()
+(defun gdb-separate-io-interrupt ()
   "Interrupt the program being debugged."
   (interactive)
   (interrupt-process
    (get-buffer-process gud-comint-buffer) comint-ptyp))
 
-(defun gdb-inferior-io-quit ()
+(defun gdb-separate-io-quit ()
   "Send quit signal to the program being debugged."
   (interactive)
   (quit-process
    (get-buffer-process gud-comint-buffer) comint-ptyp))
 
-(defun gdb-inferior-io-stop ()
+(defun gdb-separate-io-stop ()
   "Stop the program being debugged."
   (interactive)
   (stop-process
    (get-buffer-process gud-comint-buffer) comint-ptyp))
 
-(defun gdb-inferior-io-eof ()
+(defun gdb-separate-io-eof ()
   "Send end-of-file to the program being debugged."
   (interactive)
   (process-send-eof
@@ -1119,7 +1115,7 @@
      ((eq sink 'user)
       (progn
 	(setq gud-running t)
-	(if gdb-use-inferior-io-buffer
+	(if gdb-use-separate-io-buffer
 	    (setq gdb-output-sink 'inferior))))
      (t
       (gdb-resync)
@@ -1129,7 +1125,7 @@
   "An annotation handler for `breakpoint' and other annotations.
 They say that I/O for the subprocess is now GDB, not the program
 being debugged."
-  (if gdb-use-inferior-io-buffer
+  (if gdb-use-separate-io-buffer
       (let ((sink gdb-output-sink))
 	(cond
 	 ((eq sink 'inferior)
@@ -1195,7 +1191,7 @@
 
     (if (string-equal gdb-version "pre-6.4")
 	(gdb-invalidate-registers)
-      (if (gdb-get-buffer 'gdb-registers-buffer) (gdb-get-changed-registers))
+      (gdb-get-changed-registers)
       (gdb-invalidate-registers-1))
 
     (gdb-invalidate-memory)
@@ -1498,7 +1494,7 @@
     ;; Remove all breakpoint-icons in source buffers but not assembler buffer.
     (dolist (buffer (buffer-list))
       (with-current-buffer buffer
-	(if (and (eq gud-minor-mode 'gdba)
+	(if (and (memq gud-minor-mode '(gdba gdbmi))
 		 (not (string-match "\\`\\*.+\\*\\'" (buffer-name))))
 	    (gdb-remove-breakpoint-icons (point-min) (point-max)))))
     (with-current-buffer (gdb-get-buffer 'gdb-breakpoints-buffer)
@@ -1633,7 +1629,7 @@
 (defvar gdb-breakpoints-mode-map
   (let ((map (make-sparse-keymap))
 	(menu (make-sparse-keymap "Breakpoints")))
-    (define-key menu [quit] '("Quit"   . kill-this-buffer))
+    (define-key menu [quit] '("Quit"   . gdb-delete-frame-or-window))
     (define-key menu [goto] '("Goto"   . gdb-goto-breakpoint))
     (define-key menu [delete] '("Delete" . gdb-delete-breakpoint))
     (define-key menu [toggle] '("Toggle" . gdb-toggle-breakpoint))
@@ -1668,15 +1664,15 @@
       'gdb-invalidate-breakpoints
     'gdbmi-invalidate-breakpoints))
 
+(defconst gdb-breakpoint-regexp
+  "\\([0-9]+\\).*?\\(?:point\\|catch\\s-+\\S-+\\)\\s-+\\S-+\\s-+\\(.\\)\\s-+")
+
 (defun gdb-toggle-breakpoint ()
   "Enable/disable breakpoint at current line."
   (interactive)
   (save-excursion
     (beginning-of-line 1)
-    (if (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
-	    (looking-at "\\([0-9]+\\).*?point\\s-+\\S-+\\s-+\\(.\\)\\s-+")
-	  (looking-at
-     "\\([0-9]+\\)\\s-+\\S-+\\s-+\\S-+\\s-+\\(.\\)\\s-+\\S-+\\s-+\\S-+:[0-9]+"))
+    (if (looking-at gdb-breakpoint-regexp)
 	(gdb-enqueue-input
 	 (list
 	  (concat gdb-server-prefix
@@ -1690,10 +1686,7 @@
   "Delete the breakpoint at current line."
   (interactive)
   (beginning-of-line 1)
-  (if (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
-	  (looking-at "\\([0-9]+\\).*?point\\s-+\\S-+\\s-+\\(.\\)")
-	(looking-at
-	 "\\([0-9]+\\)\\s-+\\S-+\\s-+\\S-+\\s-+\\s-+\\S-+\\s-+\\S-+:[0-9]+"))
+  (if (looking-at gdb-breakpoint-regexp)
       (gdb-enqueue-input
        (list
 	(concat gdb-server-prefix "delete " (match-string 1) "\n") 'ignore))
@@ -1708,11 +1701,7 @@
     (if window (save-selected-window  (select-window window))))
   (save-excursion
     (beginning-of-line 1)
-    (if (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
-	    (looking-at "\\([0-9]+\\) .+ in .+ at\\s-+\\(\\S-+\\):\\([0-9]+\\)")
-	  (looking-at
-	   "\\([0-9]+\\)\\s-+\\S-+\\s-+\\S-+\\s-+.\\s-+\\S-+\\s-+\
-\\(\\S-+\\):\\([0-9]+\\)"))
+    (if (looking-at "\\([0-9]+\\) .+ in .+ at\\s-+\\(\\S-+\\):\\([0-9]+\\)")
 	(let ((bptno (match-string 1))
 	      (file  (match-string 2))
 	      (line  (match-string 3)))
@@ -1724,7 +1713,7 @@
 	      (with-current-buffer buf
 		(goto-line (string-to-number line))
 		(set-window-point window (point))))))
-      (error "Not recognized as break/watchpoint line"))))
+      (error "No location specified."))))
 
 
 ;; Frames buffer.  This displays a perpetually correct bactracktrace
@@ -2416,11 +2405,10 @@
   (set (make-local-variable 'font-lock-defaults)
        '(gdb-locals-font-lock-keywords))
   (run-mode-hooks 'gdb-locals-mode-hook)
-  (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
-      (if (string-equal gdb-version "pre-6.4")
-	  'gdb-invalidate-locals
-	'gdb-invalidate-locals-1)
-    'gdbmi-invalidate-locals))
+  (if (and (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
+	   (string-equal gdb-version "pre-6.4"))
+      'gdb-invalidate-locals
+    'gdb-invalidate-locals-1))
 
 (defun gdb-locals-buffer-name ()
   (with-current-buffer gud-comint-buffer
@@ -2478,8 +2466,8 @@
     '("Disassembly" . gdb-display-assembler-buffer))
   (define-key menu [registers] '("Registers" . gdb-display-registers-buffer))
   (define-key menu [inferior]
-    '(menu-item "Inferior IO" gdb-display-inferior-io-buffer
-		:enable gdb-use-inferior-io-buffer))
+    '(menu-item "Inferior IO" gdb-display-separate-io-buffer
+		:enable gdb-use-separate-io-buffer))
   (define-key menu [locals] '("Locals" . gdb-display-locals-buffer))
   (define-key menu [frames] '("Stack" . gdb-display-stack-buffer))
   (define-key menu [breakpoints]
@@ -2495,8 +2483,8 @@
   (define-key menu [disassembly] '("Disassembiy" . gdb-frame-assembler-buffer))
   (define-key menu [registers] '("Registers" . gdb-frame-registers-buffer))
   (define-key menu [inferior]
-    '(menu-item "Inferior IO" gdb-frame-inferior-io-buffer
-		:enable gdb-use-inferior-io-buffer))
+    '(menu-item "Inferior IO" gdb-frame-separate-io-buffer
+		:enable gdb-use-separate-io-buffer))
   (define-key menu [locals] '("Locals" . gdb-frame-locals-buffer))
   (define-key menu [frames] '("Stack" . gdb-frame-stack-buffer))
   (define-key menu [breakpoints]
@@ -2506,11 +2494,11 @@
   (define-key gud-menu-map [ui]
     `(menu-item (if (eq gud-minor-mode 'gdba) "GDB-UI" "GDB-MI")
 		,menu :visible (memq gud-minor-mode '(gdbmi gdba))))
-  (define-key menu [gdb-use-inferior-io]
-  '(menu-item "Separate inferior IO" gdb-use-inferior-io-buffer
+  (define-key menu [gdb-use-separate-io]
+  '(menu-item "Separate inferior IO" gdb-use-separate-io-buffer
 	      :visible (eq gud-minor-mode 'gdba)
 	      :help "Toggle separate IO for inferior."
-	      :button (:toggle . gdb-use-inferior-io-buffer)))
+	      :button (:toggle . gdb-use-separate-io-buffer)))
   (define-key menu [gdb-many-windows]
   '(menu-item "Display Other Windows" gdb-many-windows
 	      :help "Toggle display of locals, stack and breakpoint information"
@@ -2556,7 +2544,7 @@
        (if gud-last-last-frame
 	   (gud-find-file (car gud-last-last-frame))
 	 (gud-find-file gdb-main-file)))
-  (when gdb-use-inferior-io-buffer
+  (when gdb-use-separate-io-buffer
     (split-window-horizontally)
     (other-window 1)
     (gdb-set-window-buffer
@@ -2684,11 +2672,12 @@
   (if (and (buffer-name gud-comint-buffer)
 	   ;; in case gud or gdb-ui is just loaded
 	   gud-comint-buffer
-	   (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer)
-	       'gdba))
+	   (memq (buffer-local-value 'gud-minor-mode gud-comint-buffer)
+	       '(gdba gdbmi)))
       (if (member buffer-file-name gdb-source-file-list)
 	  (with-current-buffer (find-buffer-visiting buffer-file-name)
-	    (set (make-local-variable 'gud-minor-mode) 'gdba)
+	    (set (make-local-variable 'gud-minor-mode)
+		 (buffer-local-value 'gud-minor-mode gud-comint-buffer))
 	    (set (make-local-variable 'tool-bar-map) gud-tool-bar-map)))))
 
 ;;from put-image
@@ -2967,49 +2956,23 @@
   (if (re-search-forward " source language \\(\\S-*\\)\." nil t)
       (setq gdb-current-language (match-string 1)))
   (gdb-invalidate-assembler))
+
 
-
-;; For debugging Emacs only (assumes that usual stack buffer already exists).
-(defun gdb-xbacktrace ()
-  "Generate a full lisp level backtrace with arguments."
-  (interactive)
-  (setq my-frames nil)
-  (with-current-buffer (get-buffer-create "xbacktrace")
-    (erase-buffer))
-  (let (frame-number gdb-frame-number)
-    (with-current-buffer (gdb-get-buffer 'gdb-stack-buffer)
-      (save-excursion
-	(goto-char (point-min))
-	(while (search-forward "in Ffuncall " nil t)
-	  (goto-char (line-beginning-position))
-	  (looking-at "^#\\([0-9]+\\)")
-	  (push (match-string-no-properties 1) my-frames)
-	  (forward-line 1))))
-    (dolist (frame my-frames)
-      (gdb-enqueue-input (list (concat "server frame " frame "\n")
-			       'ignore))
-;    (gdb-enqueue-input (list "server ppargs\n" 'gdb-get-arguments))
-      (gud-basic-call "server ppargs")
-)
-    (gdb-enqueue-input (list (concat "server frame " frame-number "\n")
-			     'ignore))))
-    
-(defun gdb-get-arguments ()
-  (with-current-buffer "xbacktrace"
-    (insert-buffer-substring (gdb-get-buffer 'gdb-partial-output-buffer))))
-
 ;; Code specific to GDB 6.4
 (defconst gdb-source-file-regexp-1 "fullname=\"\\(.*?\\)\"")
 
 (defun gdb-set-gud-minor-mode-existing-buffers-1 ()
-  "Create list of source files for current GDB session."
+  "Create list of source files for current GDB session.
+If buffers already exist for any of these files, gud-minor-mode
+is set in them."
   (goto-char (point-min))
   (while (re-search-forward gdb-source-file-regexp-1 nil t)
     (push (match-string 1) gdb-source-file-list))
   (dolist (buffer (buffer-list))
     (with-current-buffer buffer
       (when (member buffer-file-name gdb-source-file-list)
-	(set (make-local-variable 'gud-minor-mode) 'gdba)
+	(set (make-local-variable 'gud-minor-mode)
+	     (buffer-local-value 'gud-minor-mode gud-comint-buffer))
 	(set (make-local-variable 'tool-bar-map) gud-tool-bar-map)
 	(when gud-tooltip-mode
 	  (make-local-variable 'gdb-define-alist)
@@ -3019,12 +2982,12 @@
 ; Uses "-var-list-children --all-values".  Needs GDB 6.1 onwards.
 (defun gdb-var-list-children-1 (varnum)
   (gdb-enqueue-input
-   (list (concat "server interpreter mi \"-var-update " varnum "\"\n")
-	 'ignore))
-  (gdb-enqueue-input
-   (list (concat "server interpreter mi \"-var-list-children --all-values "  
-		 varnum "\"\n")
-	     `(lambda () (gdb-var-list-children-handler-1 ,varnum)))))
+   (list
+    (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
+	(concat "server interpreter mi \"-var-list-children --all-values "  
+		varnum "\"\n")
+      (concat "-var-list-children --all-values " varnum "\n"))
+    `(lambda () (gdb-var-list-children-handler-1 ,varnum)))))
 
 (defconst gdb-var-list-children-regexp-1
   "name=\"\\(.+?\\)\",exp=\"\\(.+?\\)\",numchild=\"\\(.+?\\)\",\
@@ -3059,10 +3022,10 @@
       (progn
 	(gdb-enqueue-input
 	 (list
-	  (if (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba))
+	  (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
 	      "server interpreter mi \"-var-update --all-values *\"\n"
 	    "-var-update --all-values *\n")
-				 'gdb-var-update-handler-1))
+	  'gdb-var-update-handler-1))
 	(push 'gdb-var-update gdb-pending-triggers))))
 
 (defconst gdb-var-update-regexp-1 "name=\"\\(.*?\\)\",value=\\(\".*?\"\\),")
@@ -3098,7 +3061,7 @@
 
 (def-gdb-auto-update-trigger gdb-invalidate-registers-1
   (gdb-get-buffer 'gdb-registers-buffer)
-  (if (eq gud-minor-mode 'gdba)
+  (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
       "server interpreter mi \"-data-list-register-values x\"\n"
     "-data-list-register-values x\n")
     gdb-data-list-register-values-handler)
@@ -3157,14 +3120,15 @@
 
 ;; Needs GDB 6.4 onwards (used to fail with no stack).
 (defun gdb-get-changed-registers ()
-  (if (not (member 'gdb-get-changed-registers gdb-pending-triggers))
+  (if (and (gdb-get-buffer 'gdb-registers-buffer)
+	   (not (member 'gdb-get-changed-registers gdb-pending-triggers)))
       (progn
 	(gdb-enqueue-input
 	 (list
-	  (if (eq gud-minor-mode 'gdba)
+	  (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
 	      "server interpreter mi -data-list-changed-registers\n"
 	    "-data-list-changed-registers\n")
-	       'gdb-get-changed-registers-handler))
+	  'gdb-get-changed-registers-handler))
 	(push 'gdb-get-changed-registers gdb-pending-triggers))))
 
 (defconst gdb-data-list-register-names-regexp "\"\\(.*?\\)\"")
@@ -3187,7 +3151,9 @@
 
 (def-gdb-auto-update-trigger gdb-invalidate-locals-1
   (gdb-get-buffer 'gdb-locals-buffer)
-  "server interpreter mi -\"stack-list-locals --simple-values\"\n"
+  (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
+      "server interpreter mi -\"stack-list-locals --simple-values\"\n"
+    "-stack-list-locals --simple-values\n")
   gdb-stack-list-locals-handler)
 
 (defconst gdb-stack-list-locals-regexp
--- a/lisp/progmodes/gud.el	Tue Feb 14 12:32:39 2006 +0000
+++ b/lisp/progmodes/gud.el	Thu Feb 16 16:18:54 2006 +0000
@@ -656,8 +656,13 @@
 ;;;###autoload
 (defun gdb (command-line)
   "Run gdb on program FILE in buffer *gud-FILE*.
-The directory containing FILE becomes the initial working directory
-and source-file directory for your debugger."
+The directory containing FILE becomes the initial working
+directory and source-file directory for your debugger.  By
+default this command starts GDB using a graphical interface.  See
+`gdba' for more information.
+
+To run GDB in text command mode, set `gud-gdb-command-name' to
+\"gdb --fullname\" and include the pathname, if necessary."
   (interactive (list (gud-query-cmdline 'gdb)))
 
   (if (and gud-comint-buffer
@@ -3120,7 +3125,7 @@
 (defvar gdb-script-font-lock-keywords
   '(("^define\\s-+\\(\\(\\w\\|\\s_\\)+\\)" (1 font-lock-function-name-face))
     ("\\$\\(\\w+\\)" (1 font-lock-variable-name-face))
-    ("^\\s-*\\([a-z]+\\)" (1 font-lock-keyword-face))))
+    ("^\\s-*\\(\\(\\w\\|\\s_\\)+\\)" (1 font-lock-keyword-face))))
 
 ;; FIXME: The keyword "end" associated with "document"
 ;; should have font-lock-keyword-face (currently font-lock-doc-face).
--- a/lisp/simple.el	Tue Feb 14 12:32:39 2006 +0000
+++ b/lisp/simple.el	Thu Feb 16 16:18:54 2006 +0000
@@ -4328,7 +4328,9 @@
   :group 'paren-blinking)
 
 (defcustom blink-matching-paren-dont-ignore-comments nil
-  "*Non-nil means `blink-matching-paren' will not ignore comments."
+  "*nil means `blink-matching-paren' ignores comments.
+More precisely, when looking for the matching parenthesis,
+it skips the contents of comments that end before point."
   :type 'boolean
   :group 'paren-blinking)
 
--- a/lisp/subr.el	Tue Feb 14 12:32:39 2006 +0000
+++ b/lisp/subr.el	Thu Feb 16 16:18:54 2006 +0000
@@ -561,8 +561,10 @@
 Alternatively, if optional fourth argument OLDMAP is specified, we redefine
 in KEYMAP as NEWDEF those keys which are defined as OLDDEF in OLDMAP.
 
-For most uses, it is simpler and safer to use command remapping like this:
-  \(define-key KEYMAP [remap OLDDEF] NEWDEF)"
+If you don't specify OLDMAP, you can usually get the same results
+in a cleaner way with command remapping, like this:
+  \(define-key KEYMAP [remap OLDDEF] NEWDEF)
+\n(fn OLDDEF NEWDEF KEYMAP &optional OLDMAP)"
   ;; Don't document PREFIX in the doc string because we don't want to
   ;; advertise it.  It's meant for recursive calls only.  Here's its
   ;; meaning
--- a/lisp/tumme.el	Tue Feb 14 12:32:39 2006 +0000
+++ b/lisp/tumme.el	Thu Feb 16 16:18:54 2006 +0000
@@ -135,390 +135,9 @@
 ;; backup of `tumme-db-file' when testing new versions.
 ;;
 ;;
-;;; History:
-;; ========
-;;
-;; Version 0.1, 2005-04-16
-;;
-;; * First release, only browsing support for now.
-;;
-;; Version 0.2, 2005-04-21
-;;
-;; * Changed calls to dired-filename-at-point to dired-get-filename
-;;
-;; Version 0.3, 2005-04-25
-;;
-;;   Quite a lot of changes:
-;;
-;; * Added basic image tagging support.  No commands that make use of
-;;   it yet.
-;;
-;; * Added text properties for the thumbnail images to be able to
-;;   track where they came from originally.  Used in `tumme-mode'.
-;;
-;; * Added `tumme-mode' to be used when navigating the thumbnail
-;;   buffer.  Currently, there are commands to mark, unmark, flag and
-;;   jump to the original file in associated dired buffer.
-;;
-;; * When moving around in the thumbnail buffer (in `tumme-mode'), the
-;;   user can turn on tracking of the movements and let them be
-;;   mirrored in the associated dired buffer.
-;;
-;; * In this version I have been looking at some ideas in thumbs.el,
-;;   for example the image margin and relief and the `thumbs-mode'
-;;   which I copied and made the `tumme-mode' from.
-;;
-;; Version 0.4, 2005-05-02
-;;
-;; * Renamed the functions that are to be used in `tumme-mode' in the
-;;   thumbnail buffer.
-;;
-;; * The mark, unmark and flag commands in `tumme-mode' now also moves
-;;   to next thumbnail, like how dired normally works.
-;;
-;; * Added `tumme-mode-line-up', `tumme-display-thumbs-append' and
-;;   `tumme-mode-delete-char'.
-;;
-;; * Each thumbnail's tags is now displayed when navigating among the
-;;   thumbnails in the thumbnail buffer.
-;;
-;; * Added simple slideshow functionality.
-;;
-;; Version 0.4.1, 2005-05-05
-;;
-;; * Fixed bug in `tumme-flag-thumb-original-file'
-;;
-;; * Added commands to display original image in external viewer
-;;   (`tumme-display-external') and in a Emacs buffer
-;;   (`tumme-display-image').
-;;
-;; * Minor code clean-up
-;;
-;; * Renamed some functions back again...
-;;
-;; * Added rotation of thumbnail images (90 degrees left and right)
-;;
-;; Version 0.4.2, 2005-05-06
-;;
-;; * Removed need for `tumme-display-image-size' in
-;;   `tumme-display-image'.  Now, the maximum image size that fits in
-;;   `tumme-display-buffer' is calculated automatically.  Introduced
-;;   two correction variables, `tumme-display-window-width-correction'
-;;   and `tumme-display-window-height-correction' to be used to
-;;   correct width and height depending on width and height of window
-;;   decorations, fringes etc.  This works really well!
-;;
-;; Version 0.4.3, 2005-05-07
-;;
-;; * Added menus to `dired-mode' and `tumme-mode'
-;;
-;; * Added `tumme-mark-and-display-next'
-;;
-;; * Added `tumme-jump-thumbnail-buffer'
-;;
-;; * Bound TAB in `dired-mode-map' and `tumme-mode-map' to
-;;   `tumme-jump-thumbnail-buffer' and
-;;   `tumme-jump-original-dired-buffer', respectively.
-;;
-;; * Changed `tumme-display-image' to be more general.  Now, it can be
-;;   used from both thumbnail buffer and dired buffer by calling
-;;   `tumme-display-thumbnail-original-image' and
-;;   `tumme-display-dired-image', respectively.
-;;
-;; Version 0.4.4, 2005-05-10
-;;
-;; * Added `tumme-get-exif-file-name' and
-;; `tumme-copy-with-exif-file-name'.  These commands might not be
-;; useful for all people because they are very specific.  See the
-;; documentation for each function for more information.
-;;
-;; * Added `tumme-display-next-thumbnail-original' and
-;; `tumme-display-previous-thumbnail-original' to be used for easy
-;; image browsing in thumbnail buffer.
-;;
-;; * Added support for comments.  New function
-;; `tumme-comment-thumbnail' added, to be used in thumbnail buffer.
-;;
-;; * Added `tumme-mark-tagged-files'.  Use it in dired buffer to mark
-;; tagged files.
-;;
-;; * Added `mouse-face' property `highlight' for mouse highlighting
-;; and had to add a space between each thumbnail to avoid whole rows
-;; to be highlighted.  Doing this meant that I had to update
-;; `tumme-line-up' too...
-;;
-;; * Added `tumme-mouse-display-image'.  Use mouse-2 to display image
-;; thumbnail when is highlighted.
-;;
-;; * As suggested by Ehud Karni on gnu.emacs.help, changed
-;; `tumme-window-DIMENSION-pixels' to use `frame-char-DIMENSION'
-;; instead of `frame-pixel-DIMENSION'.  Feels better
-;;
-;; * Corrected a bug in `tumme-window-height-pixels'.  I did not know
-;; that the mode-line consumed one line.  Also, after experimenting, it
-;; seems that the only correction needed for the image display width
-;; is one single pixel.  I left the corection variables in there, just
-;; in case someone has a system that differs.
-;;
-;; Version 0.4.5, 2005-05-19
-;;
-;; * Added `tumme-line-up-dynamic' that calculates the number of
-;; thumbnails that will fit in the thumbnail buffer's window and
-;; `tumme-line-up-interactive' that asks the user.
-;;
-;; * Changed `tumme-display-thumbs' to call one of the `tumme-line-up'
-;; functions instead of doing the line-up itself.
-;;
-;; * Finally! Added experimental gallery creation.  See customizable
-;; variables `tumme-gallery-dir', `tumme-gallery-image-root-url' and
-;; `tumme-gallery-thumb-image-root-url' and new command
-;; `tumme-gallery-generate'.  Not beatiful, but it works quite
-;; well.  Probably needs some CSS-stuff in it eventually.  Also, I'm not
-;; sure this is the way I want to generate my image galleries in the
-;; future.  After all, static pages cannot do what dynamic pages using
-;; PHP et al can do.  Serves like a proof-of-concept of the tagging
-;; though.
-;;
-;; * Added option to hide images with certain tags.  See
-;; `tumme-gallery-hidden-tags'.
-;;
-;; * Added `tumme-tag-thumbnail' for tagging files from thumbnail
-;; buffer.
-;;
-;; * Added `tumme-tag-remove' and `tumme-tag-thumbnail-remove' so that
-;; you can remove tags.  Sorry if I have kept you waiting for
-;; this... :)
-;;
-;; * Added option `tumme-append-when-browsing' and new command
-;; `tumme-toggle-append-browsing'.
-;;
-;; Version 0.4.6, 2005-05-21
-;;
-;; * Changed `tumme-thumb-name' to always use ".jpg" as file extension
-;; for thumbnail files, instead of using the extension from the
-;; original file's name.  This was a very easy way to open up for
-;; allowing browsing of all image file types that Emacs support,
-;; assuming ImageMagick supports it too.
-;;
-;; * Fixed bug in `tumme-create-thumb' `tumme-rotate-thumbnail' and
-;; `tumme-display-image' by adding quotes around the file names.  The
-;; conversion failed if the file name, or path, contained a
-;; space.  Also expanded the file name, as convert (or is it bash?)
-;; does not work as expected for paths like "~/.tumme...".
-;;
-;; * Fixed another "space bug" :) in `tumme-display-external'.
-;;
-;; * In call to convert, added "jpeg:" in front of the output file
-;; name, so that all generated files becomes JPEG files.  For now, only
-;; useful if `tumme-temp-image-file' does not end in .jpg.
-;;
-;; Version 0.4.7, 2005-05-26
-;;
-;; * Change header line of tumme.el so that it does not wrap and cause
-;; evaluation problems for people getting the source from Usenet.
-;;
-;; * Changed `tumme-write-tag' slightly to get better performance when
-;; tagging many files.
-;;
-;; * Fixed bug in `tumme-create-gallery-lists' that made it puke if
-;; there was empty lines in the database.  Changed the code so that it
-;; does not car about that.  Also, fixed `tumme-remove-tag' so that it
-;; tries not to add empty lines at the end of the database.
-;;
-;; * Changed all commands that execute shell commands to be
-;; configurable using the `tumme-cmd-x' custom variables.  This makes
-;; it easier to switch among different image conversion tools which
-;; might use different syntax and options.
-;;
-;; * Added `tumme-toggle-dired-display-properties'.
-;;
-;; * Added `tumme-thumb-file-name-format' and changed
-;; `tumme-thumb-name' to make it possible to configure the format of
-;; thumbnail files.  Did not make it customizable yet though.  It might
-;; be a bad idea to be able to switch between formats...
-;;
-;; * Changed `tumme-display-window' so that it looks for tumme's
-;; display window in all frames.  Useful if you want to create an own
-;; frame for displaying the temporary image.
-;;
-;; * After changing the call to `get-window-with-predicate' to scan
-;; all frames for tumme's special buffers in visible windows, and also
-;; changing the way tumme tracks thumbnail movement in the dired
-;; buffer (now using `set-buffer' together with `set-window-point'),
-;; tumme now works quite happily with all three buffers in different
-;; frames.  This empowers the user to setup the special buffers the way
-;; that best fits his need at the time.  Jumping between dired and
-;; `tumme-thumbnail-buffer' work independent on in which frames they
-;; are.
-;;
-;; * Renamed `tumme-track-movement-in-dired' to
-;; `tumme-toggle-movement-tracking'.
-;;
-;; * Added `tumme-track-thumbnail' for movement tracking from dired
-;; buffer, analoguous to the tracking done in thumbnail buffer.  Both
-;; uses the same custom variable `tumme-track-movement' which can be
-;; toggled on and off with `tumme-toggle-movement-tracking'.  This is
-;; neat.  :) Changed `tumme-setup-dired-keybindings' to make use of
-;; this in the best way.  Read more about this there.
-;;
-;; Version 0.4.8, 2005-06-05
-;;
-;; * Changed `tumme-display-dired-image' and
-;; `tumme-display-thumbnail-original-image' so that when called with a
-;; prefix argument, the image is not resized in the display
-;; buffer.  This will be useful for later additions of image
-;; manipulation commands.
-;;
-;; * Added `tumme-kill-buffer-and-window' to make it easy to kill the
-;; tumme buffers.
-;;
-;; * Renamed `tumme-mode' to `tumme-thumbnail-mode'.
-;;
-;; * `tumme-tag-thumbnail' and `tumme-tag-thumbnail-remove' now
-;; updates the tags property for the thumbnail.
-;;
-;; * Added `tumme-dired-display-external' to display images in
-;; external viewer from dired buffer.
-;;
-;; * Added support for multiple files in `tumme-remove-tag' to
-;; increase performance.
-;;
-;; * Added `tumme-display-image-mode' so that we can add image
-;; manipulation commands there.
-;;
-;; * Added call to `tumme-display-thumb-properties' in
-;; `tumme-track-thumbnail'.
-;;
-;; * Added command `tumme-display-current-image-in-full-size' to be
-;; used in `tumme-display-image-mode'.
-;;
-;; * Changed `tumme-display-image' to call
-;; `tumme-create-display-image-buffer' so that we are sure that
-;; `tumme-display-image-buffer' is always available.
-;;
-;; * Added optional prefix argument to `tumme-dired-folder' that tells
-;; it to skip the window splitting and just creates the needed
-;; buffers.
-;;
-;; * Fixed bug somewhere that relied on `tumme-dired-folder' having
-;; created the `tumme-display-image-buffer'.  Now `tumme-dired-folder'
-;; *should* not be necessary to call at all, just convenient.
-;;
-;; * Added tracking to `tumme-mouse-display-image'.
-;;
-;; * Added `tumme-mouse-select-thumbnail' and bound mouse-1 to it, so
-;; that selecting a thumbnail will track the original file.
-;;
-;; * Added three new custom variables, `tumme-cmd-ACTION-program' to
-;; make the command options cleaner and easier to read.
-;;
-;; * Added `tumme-display-properties-format' and
-;; `tumme-format-properties-string' to make it possible to configure
-;; the display format of the image file's properties.
-;;
-;; * Added missing (require 'format-spec)
-;;
-;; Version 0.4.9, 2005-09-25
-;;
-;; * Fixed bug in `tumme-display-thumbs'.  If a thumbnail file could
-;; not be created for some reason (bad file for example), even if
-;; several other thumbnails was created sucessfully, the code
-;; generated an error and never continued doing the line-up.
-;;
-;; * Made tumme.el pass the M-x checkdoc test, phew!
-;;
-;; * Added `tumme-rotate-original', `tumme-rotate-original-left' and
-;; `tumme-rotate-original-right' to rotate the original image from
-;; thumbnail view. By default it uses JpegTRAN to rotate the images
-;; non-lossy. Only works on JPEG images. The two new commands were
-;; added to thumbnail mode. Thanks to Colin Marquardt who told me
-;; about the "-copy all" option to jpegtran.
-;;
-;; * Added the functions `tumme-get-exif-data' and
-;; `tumme-set-exif-data' for reading and writing EXIF data to image files.
-;;
-;; * Rewrote `tumme-get-exif-file-name': now uses
-;; `tumme-get-exif-data'. Slight change to replace spaces with
-;; underscores (tt seems not all cameras use the exact same format for
-;; DateTimeOriginal). Added code for handling files that has no
-;; EXIF-data (use file's timestamp instead).
-;;
-;; * Changed from using the exif program to exiftool because exiftool
-;; also handles writing of EXIF data, which is very useful.
-;;
-;; * Added the command `tumme-thumbnail-set-image-description' that
-;; can be used to set the EXIF tag ImageDescription. Thanks to Colin
-;; Marquardt for the suggestion.
-;;
-;; * Added `tumme-toggle-mark-thumb-original-file' and
-;; `tumme-mouse-toggle-mark' and changed
-;; `tumme-modify-mark-on-thumb-original-file' to support toggling of
-;; mark of original image file in dired, from
-;; `tumme-thumbnail-mode'. Bound C-down-mouse-1
-;; `tumme-mouse-toggle-mark' to in `tumme-thumbnail-mode'.
-;;
-;; * Changed `tumme-mouse-select-thumbnail' to also display properties
-;; after the file is selected.
-;;
-;; Version 0.4.10, 2005-11-07
-;;
-;; * Renamed `tumme-dired-folder' to `tumme-dired'.
-;;
-;; * Changed format of the database file slightly, now the full path
-;; and file name is used. Had to change most of the tag functions
-;; (writing, reading, searching) slightly to cope with the change. If
-;; you are an old tumme user, you have to update your database
-;; manually, probably you only need to prefix all rows with a
-;; directory name to get the full path and file name.
-;;
-;; * Removed `tumme-thumb-file-name-format'. Added
-;; `tumme-thumbnail-storage' and changed `tumme-thumb-name' to provide
-;; two different thumbnail storage schemes. It is no longer necessary
-;; to have unique image file names to use tumme fully.
-;;
-;; * As a consequence of the above, gallery generation is currently
-;; not supported if per-directory thumbnail file storage is used.
-;;
-;; * Changed parameters to `tumme-create-thumb'.
-;;
-;; * To be included in Emacs 22.
-;;
-;;
-;; Version 0.4.11, 2006-MM-DD
-;;
-;; * Changed `tumme-display-thumbs' so that it calls `display-buffer'
-;; after generating the thumbnails and changed
-;; `tumme-display-thumbnail-original-image' to display the image
-;; buffer. These small changes should make it easier for a user to
-;; start using tumme.
-;;
-;; * Added `tumme-show-all-from-dir' to mimic thumbs.el's easy-to-use
-;; `thumbs' command. A new customize option,
-;; `tumme-show-all-from-dir-max-files' was added too.
-;;
-;; * Renamed `tumme-dired' to `tumme-dired-with-window-configuration'
-;; and added code to save the window configuration before messing it
-;; up. The saved window configuration can be restored using the new
-;; command `tumme-restore-window-configuration'.
-;;
-;; * Added `tumme-get-thumbnail-image', created by Chong Yidong. His
-;; own comments: ..., that just takes the original filename and
-;; returns a thumbnail image descriptor.  Then third-party libraries
-;; won't have to muck around with tumme.el's internal functions like
-;; `thumme-thumb-name', `tumme-create-thumb', etc. His code to get
-;; speedbar display tumme thumbnails, might be integrated soon.
-;;
-;; * Changed the default value of `tumme-dir' to "~/.emacs.d/tumme"
-;; and added a new function, `tumme-dir' to handle the creating of
-;; it. Code copied from thumbs.el.
-;;
-;;
 ;; TODO
 ;; ====
 ;;
-;; * Look into supporting the Thumbnail Managing Standard, maybe as a
-;; configurable option.
-;;
 ;; * Support gallery creation when using per-directory thumbnail
 ;; storage.
 ;;
@@ -579,7 +198,7 @@
 (defgroup tumme nil
   "Use dired to browse your images as thumbnails, and more."
   :prefix "tumme-"
-  :group 'files)
+  :group 'multimedia)
 
 (defcustom tumme-dir "~/.emacs.d/tumme/"
   "*Directory where thumbnail images are stored."
@@ -592,8 +211,12 @@
 controlled by this variable.  \"Use tumme dir\" means that the
 thumbnails are stored in a central directory.  \"Per directory\"
 means that each thumbnail is stored in a subdirectory called
-\".tumme\" in the same directory where the image file is."
+\".tumme\" in the same directory where the image file is.
+\"Thumbnail Managing Standard\" means that the thumbnails are
+stored and generated according to the Thumbnail Managing Standard
+that allows sharing of thumbnails across different programs."
   :type '(choice :tag "How to store thumbnail files"
+                 (const :tag "Thumbnail Managing Standard" standard)
                  (const :tag "Use tumme-dir" use-tumme-dir)
                  (const :tag "Per-directory" per-directory))
   :group 'tumme)
@@ -639,13 +262,13 @@
   :group 'tumme)
 
 (defcustom tumme-cmd-create-thumbnail-options
-  "%p -size %sx%s \"%f\" -resize %sx%s +profile \"*\" jpeg:\"%t\""
+  "%p -size %wx%h \"%f\" -resize %wx%h +profile \"*\" jpeg:\"%t\""
   "*Format of command used to create thumbnail image.
 Available options are %p which is replaced by
-`tumme-cmd-create-thumbnail-program', %s which is replaced by
-`tumme-thumb-size', %f which is replaced by the file name of the
-original image and %t which is replaced by the file name of the
-thumbnail file."
+`tumme-cmd-create-thumbnail-program', %w which is replaced by
+`tumme-thumb-width', %h which is replaced by `tumme-thumb-height',
+%f which is replaced by the file name of the original image and %t
+which is replaced by the file name of the thumbnail file."
   :type 'string
   :group 'tumme)
 
@@ -657,16 +280,64 @@
   :group 'tumme)
 
 (defcustom tumme-cmd-create-temp-image-options
-  "%p -size %xx%y \"%f\" -resize %xx%y +profile \"*\" jpeg:\"%t\""
+  "%p -size %wx%h \"%f\" -resize %wx%h +profile \"*\" jpeg:\"%t\""
   "*Format of command used to create temporary image for display window.
 Available options are %p which is replaced by
-`tumme-cmd-create-temp-image-program', %x and %y which is replaced by
-the calculated max size for x and y in the image display window, %f
-which is replaced by the file name of the original image and %t which
+`tumme-cmd-create-temp-image-program', %w and %h which is replaced by
+the calculated max size for width and height in the image display window,
+%f which is replaced by the file name of the original image and %t which
 is replaced by the file name of the temporary file."
   :type 'string
   :group 'tumme)
 
+(defcustom tumme-cmd-pngnq-program (executable-find "pngnq")
+  "*The file name of the `pngnq' program.
+It quantizes colors of PNG images down to 256 colors."
+  :type '(choice (const :tag "Not Set" nil) string)
+  :group 'tumme)
+
+(defcustom tumme-cmd-pngcrush-program (executable-find "pngcrush")
+  "*The file name of the `pngcrush' program.
+It optimizes the compression of PNG images.  Also it adds PNG textual chunks
+with the information required by the Thumbnail Managing Standard."
+  :type '(choice (const :tag "Not Set" nil) string)
+  :group 'tumme)
+
+(defcustom tumme-cmd-create-standard-thumbnail-command
+  (concat
+   tumme-cmd-create-thumbnail-program " "
+   "-size %wx%h \"%f\" "
+   (unless (or tumme-cmd-pngcrush-program tumme-cmd-pngnq-program)
+     (concat
+      "-set \"Thumb::MTime\" \"%m\" "
+      "-set \"Thumb::URI\" \"file://%f\" "
+      "-set \"Description\" \"Thumbnail of file://%f\" "
+      "-set \"Software\" \"" (emacs-version) "\" "))
+   "-thumbnail %wx%h png:\"%t\""
+   (if tumme-cmd-pngnq-program
+       (concat
+        " ; " tumme-cmd-pngnq-program " -f \"%t\""
+        (unless tumme-cmd-pngcrush-program
+          " ; mv %q %t")))
+   (if tumme-cmd-pngcrush-program
+       (concat
+        (unless tumme-cmd-pngcrush-program
+          " ; cp %t %q")
+        " ; " tumme-cmd-pngcrush-program " -q "
+        "-text b \"Description\" \"Thumbnail of file://%f\" "
+        "-text b \"Software\" \"" (emacs-version) "\" "
+        ;; "-text b \"Thumb::Image::Height\" \"%oh\" "
+        ;; "-text b \"Thumb::Image::Mimetype\" \"%mime\" "
+        ;; "-text b \"Thumb::Image::Width\" \"%ow\" "
+        "-text b \"Thumb::MTime\" \"%m\" "
+        ;; "-text b \"Thumb::Size\" \"%b\" "
+        "-text b \"Thumb::URI\" \"file://%f\" "
+        "%q %t"
+        " ; rm %q")))
+  "*Command to create thumbnails according to the Thumbnail Managing Standard."
+  :type 'string
+  :group 'tumme)
+
 (defcustom tumme-cmd-rotate-thumbnail-program
   "mogrify"
   "*Executable used to rotate thumbnail.
@@ -757,8 +428,19 @@
   :type '(repeat string)
   :group 'tumme)
 
-(defcustom tumme-thumb-size 100
-  "Size of thumbnails, in pixels."
+(defcustom tumme-thumb-size (if (eq 'standard tumme-thumbnail-storage) 128 100)
+  "Size of thumbnails, in pixels.
+This is the default size for both `tumme-thumb-width' and `tumme-thumb-height'."
+  :type 'integer
+  :group 'tumme)
+
+(defcustom tumme-thumb-width tumme-thumb-size
+  "Width of thumbnails, in pixels."
+  :type 'integer
+  :group 'tumme)
+
+(defcustom tumme-thumb-height tumme-thumb-size
+  "Height of thumbnails, in pixels."
   :type 'integer
   :group 'tumme)
 
@@ -841,7 +523,11 @@
   :type 'string
   :group 'tumme)
 
-(defcustom tumme-external-viewer "qiv -t"
+(defcustom tumme-external-viewer
+  ;; TODO: use mailcap, dired-guess-shell-alist-default, dired-view-command-alist
+  (cond ((executable-find "display"))
+        ((executable-find "xli"))
+        ((executable-find "qiv") "qiv -t"))
   "*Name of external viewer.
 Including parameters.  Used when displaying original image from
 `tumme-thumbnail-mode'."
@@ -888,8 +574,11 @@
 		 (<= (float-time (nth 5 (file-attributes file)))
 		     (float-time (nth 5 (file-attributes thumb-file)))))
       (tumme-create-thumb file thumb-file))
-    (list 'image :type 'jpeg :file thumb-file
-	  :relief tumme-thumb-relief :margin tumme-thumb-margin)))
+    (create-image thumb-file)
+;;     (list 'image :type 'jpeg
+;;           :file thumb-file
+;; 	  :relief tumme-thumb-relief :margin tumme-thumb-margin)
+    ))
 
 (defun tumme-insert-thumbnail (file original-file-name
                                     associated-dired-buffer)
@@ -898,7 +587,9 @@
   (let (beg end)
     (setq beg (point))
     (tumme-insert-image file
-                        'jpeg
+                        ;; TODO: this should depend on the real file type
+                        (if (eq 'standard tumme-thumbnail-storage)
+                            'png 'jpeg)
                         tumme-thumb-relief
                         tumme-thumb-margin)
     (setq end (point))
@@ -917,38 +608,52 @@
 name will vary.  For central thumbnail file storage, make a
 MD5-hash of the image file's directory name and add that to make
 the thumbnail file name unique.  For per-directory storage, just
-add a subdirectory."
-  (let ((f (expand-file-name file))
-        md5-hash)
-    (format "%s%s%s.thumb.%s"
-            (cond ((eq 'use-tumme-dir tumme-thumbnail-storage)
-                   ;; Is MD5 hashes fast enough? The checksum of a
-                   ;; thumbnail file name need not be that
-                   ;; "cryptographically" good so a faster one could
-                   ;; be used here.
-                   (setq md5-hash (md5 (file-name-as-directory
-                                        (file-name-directory file))))
-                   (file-name-as-directory (expand-file-name (tumme-dir))))
-                  ((eq 'per-directory tumme-thumbnail-storage)
-                   (format "%s.tumme/"
-                           (file-name-directory f))))
-            (file-name-sans-extension
-             (file-name-nondirectory f))
-            (if md5-hash
-                (concat "_" md5-hash)
-              "")
-            (file-name-extension f))))
+add a subdirectory.  For standard storage, produce the file name
+according to the Thumbnail Managing Standard."
+  (cond ((eq 'standard tumme-thumbnail-storage)
+         (expand-file-name
+          (concat "~/.thumbnails/normal/"
+                  (md5 (concat "file://" (expand-file-name file))) ".png")))
+        ((eq 'use-tumme-dir tumme-thumbnail-storage)
+         (let* ((f (expand-file-name file))
+                (md5-hash
+                 ;; Is MD5 hashes fast enough? The checksum of a
+                 ;; thumbnail file name need not be that
+                 ;; "cryptographically" good so a faster one could
+                 ;; be used here.
+                 (md5 (file-name-as-directory (file-name-directory f)))))
+           (format "%s%s%s.thumb.%s"
+                   (file-name-as-directory (expand-file-name (tumme-dir)))
+                   (file-name-sans-extension (file-name-nondirectory f))
+                   (if md5-hash (concat "_" md5-hash) "")
+                   (file-name-extension f))))
+        ((eq 'per-directory tumme-thumbnail-storage)
+         (let ((f (expand-file-name file)))
+           (format "%s.tumme/%s.thumb.%s"
+                   (file-name-directory f)
+                   (file-name-sans-extension (file-name-nondirectory f))
+                   (file-name-extension f))))))
 
 (defun tumme-create-thumb (original-file thumbnail-file)
   "For ORIGINAL-FILE, create thumbnail image named THUMBNAIL-FILE."
-  (let* ((size (int-to-string tumme-thumb-size))
+  (let* ((width (int-to-string tumme-thumb-width))
+         (height (int-to-string tumme-thumb-height))
+         (modif-time (format "%.0f" (float-time (nth 5 (file-attributes
+                                                        original-file)))))
+         (thumbnail-nq8-file (replace-regexp-in-string ".png\\'" "-nq8.png"
+                                                       thumbnail-file))
          (command
           (format-spec
-           tumme-cmd-create-thumbnail-options
+           (if (eq 'standard tumme-thumbnail-storage)
+               tumme-cmd-create-standard-thumbnail-command
+             tumme-cmd-create-thumbnail-options)
            (list
             (cons ?p tumme-cmd-create-thumbnail-program)
-            (cons ?s size)
+            (cons ?w width)
+            (cons ?h height)
+            (cons ?m modif-time)
             (cons ?f original-file)
+            (cons ?q thumbnail-nq8-file)
             (cons ?t thumbnail-file))))
          thumbnail-dir)
     (when (not (file-exists-p
@@ -957,6 +662,40 @@
       (make-directory thumbnail-dir))
     (shell-command command nil)))
 
+;;;###autoload
+(defun tumme-dired-insert-marked-thumbs ()
+  "Insert thumbnails before file names of marked files in the dired buffer."
+  (interactive)
+  (dired-map-over-marks
+   (let* ((image-pos (dired-move-to-filename))
+          (image-file (dired-get-filename))
+          (thumb-file (tumme-get-thumbnail-image image-file))
+          overlay)
+     ;; If image is not already added, then add it.
+     (unless (delq nil (mapcar (lambda (o) (overlay-get o 'put-image))
+                               ;; Can't use (overlays-at (point)), BUG?
+                               (overlays-in (point) (1+ (point)))))
+       (put-image thumb-file image-pos)
+       (setq overlay (car (delq nil (mapcar (lambda (o) (and (overlay-get o 'put-image) o))
+                                            (overlays-in (point) (1+ (point)))))))
+       (overlay-put overlay 'image-file image-file)
+       (overlay-put overlay 'thumb-file thumb-file)))
+   nil)
+  (add-hook 'dired-after-readin-hook 'tumme-dired-after-readin-hook nil t))
+
+(defun tumme-dired-after-readin-hook ()
+  "Relocate existing thumbnail overlays in dired buffer after reverting.
+Move them to their corresponding files if they are still exist.
+Otherwise, delete overlays."
+  (mapc (lambda (overlay)
+          (when (overlay-get overlay 'put-image)
+            (let* ((image-file (overlay-get overlay 'image-file))
+                   (image-pos (dired-goto-file image-file)))
+              (if image-pos
+                  (move-overlay overlay image-pos image-pos)
+                (delete-overlay overlay)))))
+        (overlays-in (point-min) (point-max))))
+
 (defun tumme-next-line-and-display ()
   "Move to next dired line and display thumbnail image."
   (interactive)
@@ -1966,7 +1705,7 @@
          (/ width
             (+ (* 2 tumme-thumb-relief)
                (* 2 tumme-thumb-margin)
-               tumme-thumb-size char-width))))
+               tumme-thumb-width char-width))))
     (tumme-line-up)))
 
 (defun tumme-line-up-interactive ()
@@ -2058,19 +1797,19 @@
 If optional argument ORIGINAL-SIZE is non-nil, display image in its
 original size."
   (let ((new-file (expand-file-name tumme-temp-image-file))
-        size-x size-y command ret)
+        width height command ret)
     (setq file (expand-file-name file))
     (if (not original-size)
         (progn
-          (setq size-x (tumme-display-window-width))
-          (setq size-y (tumme-display-window-height))
+          (setq width (tumme-display-window-width))
+          (setq height (tumme-display-window-height))
           (setq command
                 (format-spec
                  tumme-cmd-create-temp-image-options
                  (list
                   (cons ?p tumme-cmd-create-temp-image-program)
-                  (cons ?x size-x)
-                  (cons ?y size-y)
+                  (cons ?w width)
+                  (cons ?h height)
                   (cons ?f file)
                   (cons ?t new-file))))
           (setq ret (shell-command command nil))
@@ -2308,12 +2047,11 @@
 (defun tumme-write-comment (file comment)
   "For FILE, write comment COMMENT in database."
   (save-excursion
-    (let (end buf comment-beg
-              (base-name (file-name-nondirectory file)))
+    (let (end buf comment-beg)
       (setq buf (find-file tumme-db-file))
       (goto-char (point-min))
       (if (search-forward-regexp
-           (format "^%s" base-name) nil t)
+           (format "^%s" file) nil t)
           (progn
             (end-of-line)
             (setq end (point))
@@ -2336,7 +2074,7 @@
             (insert (format "comment:%s;" comment)))
         ;; File does not exist in databse - add it.
         (goto-char (point-max))
-        (insert (format "\n%s;comment:%s" base-name comment)))
+        (insert (format "\n%s;comment:%s" file comment)))
       (save-buffer)
       (kill-buffer buf))))
 
@@ -2417,7 +2155,7 @@
       (goto-char (point-min))
       ;; Collect matches
       (while (search-forward-regexp
-              (concat "\\(^[^;]+\\);.*" tag ".*$") nil t)
+              (concat "\\(^[^;\n]+\\);.*" tag ".*$") nil t)
         (setq files (append (list (match-string 1)) files)))
       (kill-buffer buf)
       ;; Mark files
--- a/lisp/wid-edit.el	Tue Feb 14 12:32:39 2006 +0000
+++ b/lisp/wid-edit.el	Thu Feb 16 16:18:54 2006 +0000
@@ -860,6 +860,7 @@
     (define-key map [(shift tab)] 'advertised-widget-backward)
     (define-key map [backtab] 'widget-backward)
     (define-key map [down-mouse-2] 'widget-button-click)
+    (define-key map [down-mouse-1] 'widget-button-click)
     (define-key map "\C-m" 'widget-button-press)
     map)
   "Keymap containing useful binding for buffers containing widgets.
@@ -929,6 +930,8 @@
 	      (save-excursion
 		(goto-char (posn-point (event-start event)))
 		(let* ((overlay (widget-get button :button-overlay))
+		       (pressed-face (or (widget-get button :pressed-face)
+					 widget-button-pressed-face))
 		       (face (overlay-get overlay 'face))
 		       (mouse-face (overlay-get overlay 'mouse-face)))
 		  (unwind-protect
@@ -938,10 +941,8 @@
 		      ;; on when we move over it.
 		      (save-excursion
 			(when face	; avoid changing around image
-			  (overlay-put overlay
-				       'face widget-button-pressed-face)
-			  (overlay-put overlay
-				       'mouse-face widget-button-pressed-face))
+			  (overlay-put overlay 'face pressed-face)
+			  (overlay-put overlay 'mouse-face pressed-face))
 			(unless (widget-apply button :mouse-down-action event)
 			  (let ((track-mouse t))
 			    (while (not (widget-button-release-event-p event))
@@ -951,12 +952,8 @@
 				       (eq (get-char-property pos 'button)
 					   button))
 				  (when face
-				    (overlay-put overlay
-						 'face
-						 widget-button-pressed-face)
-				    (overlay-put overlay
-						 'mouse-face
-						 widget-button-pressed-face))
+				    (overlay-put overlay 'face pressed-face)
+				    (overlay-put overlay 'mouse-face pressed-face))
 				(overlay-put overlay 'face face)
 				(overlay-put overlay 'mouse-face mouse-face)))))
 
--- a/lispref/ChangeLog	Tue Feb 14 12:32:39 2006 +0000
+++ b/lispref/ChangeLog	Thu Feb 16 16:18:54 2006 +0000
@@ -1,3 +1,17 @@
+2006-02-14  Richard M. Stallman  <rms@gnu.org>
+
+	* variables.texi (File Local Variables): Clarifications.
+
+2006-02-14  Juanma Barranquero  <lekktu@gmail.com>
+
+	* variables.texi (File Local Variables): Use @code for a cons
+	cell, not @var.
+
+2006-02-13  Chong Yidong  <cyd@stupidchicken.com>
+
+	* variables.texi (File Local Variables): Document new file local
+	variable behavior.
+
 2006-02-10  Kim F. Storm  <storm@cua.dk>
 
 	* eval.texi (Function Indirection): Add NOERROR to indirect-function.
--- a/lispref/variables.texi	Tue Feb 14 12:32:39 2006 +0000
+++ b/lispref/variables.texi	Thu Feb 16 16:18:54 2006 +0000
@@ -1752,9 +1752,9 @@
 
 @defopt enable-local-variables
 This variable controls whether to process file local variables.  A
-value of @code{t} means process them unconditionally; @code{nil} means
-ignore them; anything else means ask the user what to do for each
-file.  The default value is @code{t}.
+value of @code{t} means to process them, querying the user if unsafe
+variables are encountered; @code{nil} means ignore them; anything else
+means to query the user for each file.  The default value is @code{t}.
 @end defopt
 
 @defun hack-local-variables &optional mode-only
@@ -1773,46 +1773,66 @@
 
   If a file local variable could specify a function that would
 be called later, or an expression that would be executed later, simply
-visiting a file could take over your Emacs.  To prevent this, Emacs
-takes care not to allow to set such file local variables.
+visiting a file could take over your Emacs.  Emacs takes several
+measures to prevent this.
+
+@cindex safe local variable
+  You can specify safe values for a variable with a
+@code{safe-local-variable} property.  If the property is @code{t},
+setting that variable in a file is always considered safe, regardless
+of the value used.  If the property is a function of one argument,
+then any value is safe if the function returns non-@code{nil} given
+that value.  Many commonly encountered file variables standardly have
+@code{safe-local-variable} properties, including @code{fill-column},
+@code{fill-prefix}, and @code{indent-tabs-mode}.
 
-  For one thing, any variable whose name ends in any of
-@samp{-command}, @samp{-frame-alist}, @samp{-function},
+@defopt safe-local-variable-values
+This variable provides another way to mark some variable values as
+safe.  It is a list of cons cells @code{(@var{var} . @var{val})},
+where @var{var} is a variable name and @var{val} is a value which is
+safe for that variable.
+
+When Emacs asks the user whether or not to obey a set of file local
+variable specifications, the user can choose to mark them as safe.
+Doing so adds those variable/value pairs to
+@code{safe-local-variable-values}, and saves it to the user's custom
+file.
+@end defopt
+
+@defun safe-local-variable-p sym val
+This function returns non-@code{nil} if it is safe to give @var{sym}
+the value @var{val}, based on the above criteria.
+@end defun
+
+@cindex risky local variable
+  Some variables are considered @dfn{risky}.  A variable whose name
+ends in any of @samp{-command}, @samp{-frame-alist}, @samp{-function},
 @samp{-functions}, @samp{-hook}, @samp{-hooks}, @samp{-form},
 @samp{-forms}, @samp{-map}, @samp{-map-alist}, @samp{-mode-alist},
-@samp{-program}, or @samp{-predicate} cannot be given a file local
-value.  In general, you should use such a name whenever it is
-appropriate for the variable's meaning.  The variables
-@samp{font-lock-keywords}, @samp{font-lock-keywords} followed by a
-digit, and @samp{font-lock-syntactic-keywords} cannot be given file
-local values either.  These rules can be overridden by giving the
-variable's name a non-@code{nil} @code{safe-local-variable} property.
-If one gives it a @code{safe-local-variable} property of @code{t},
-then one can give the variable any file local value.  One can also
-give any symbol, including the above, a @code{safe-local-variable}
-property that is a function taking exactly one argument.  In that
-case, giving a variable with that name a file local value is only
-allowed if the function returns non-@code{nil} when called with that
-value as argument.
+@samp{-program}, or @samp{-predicate} is considered risky.  The
+variables @samp{font-lock-keywords}, @samp{font-lock-keywords}
+followed by a digit, and @samp{font-lock-syntactic-keywords} are also
+considered risky.  Finally, any variable whose name has a
+non-@code{nil} @code{risky-local-variable} property is considered
+risky.
 
-  In addition, any variable whose name has a non-@code{nil}
-@code{risky-local-variable} property is also ignored.  So are all
-variables listed in @code{ignored-local-variables}:
+@defun risky-local-variable-p sym
+This function returns non-@code{nil} if @var{sym} is a risky variable,
+based on the above criteria.
+@end defun
+
+  If a variable is risky, it will not be entered automatically into
+@code{safe-local-variable-values} as described above.  Therefore,
+Emacs will always query before setting a risky variable, unless the
+user explicitly allows the setting by customizing
+@code{safe-local-variable-values} directly.
 
 @defvar ignored-local-variables
 This variable holds a list of variables that should not be given local
 values by files.  Any value specified for one of these variables is
-ignored.
+completely ignored.
 @end defvar
 
-@defun risky-local-variable-p sym &optional val
-If @var{val} is non-@code{nil}, returns non-@code{nil} if giving
-@var{sym} a file local value of @var{val} would be risky, for any of
-the reasons stated above.  If @var{val} is @code{nil} or omitted, only
-returns @code{nil} if @var{sym} can be safely assigned any file local
-value whatsoever.
-@end defun
-
   The @samp{Eval:} ``variable'' is also a potential loophole, so Emacs
 normally asks for confirmation before handling it.
 
--- a/man/ChangeLog	Tue Feb 14 12:32:39 2006 +0000
+++ b/man/ChangeLog	Thu Feb 16 16:18:54 2006 +0000
@@ -1,3 +1,63 @@
+2006-02-15  Francesco Potort,Al(B  <pot@gnu.org>
+
+	* maintaining.texi (Create Tags Table): Explain why the
+	exception when etags writes to files under the /dev tree.
+
+2006-02-14  Richard M. Stallman  <rms@gnu.org>
+
+	* custom.texi (Safe File Variables): Lots of clarification.
+	Renamed from Unsafe File Variables.
+
+2006-02-14  Chong Yidong  <cyd@stupidchicken.com>
+
+	* custom.texi (Unsafe File Variables): File variable confirmation
+	assumed denied in batch mode.
+
+2006-02-14  Richard M. Stallman  <rms@gnu.org>
+
+	* building.texi (GDB User Interface Layout): Don't say `inferior'
+	for program being debugged.
+
+2006-02-15  Nick Roberts  <nickrob@snap.net.nz>
+
+	* building.texi (GDB Graphical Interface): Replace
+	gdb-use-inferior-io-buffer with gdb-use-separate-io-buffer.
+
+2006-02-13  Chong Yidong  <cyd@stupidchicken.com>
+
+	* custom.texi (Specifying File Variables, Unsafe File Variables):
+	New nodes, split from File Variables.  Document new file local
+	variable behavior.
+
+2006-02-13  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+	* display.texi (Standard Faces):
+	* faq.texi (Colors on a TTY):
+	* files.texi (Visiting):
+	* frames.texi (Clipboard):
+	* glossary.texi (Glossary) <Clipboard>:
+	* xresources.texi (X Resources): Mention Mac OS port.
+
+2006-02-12  Karl Berry  <karl@gnu.org>
+
+	* faq.texi (Emacs for Atari ST): use Sch@"auble instead of the
+	8-bit accented a.
+
+2006-02-12  Richard M. Stallman  <rms@gnu.org>
+
+	* building.texi (Building): Clarify topic in intro.
+
+	* maintaining.texi (Maintaining): Change title; clarify topic.
+	Delete duplicate index entries.
+
+	* building.texi (Other GDB User Interface Buffers): Clarifications.
+
+	* text.texi (Cell Commands): Clarifications.
+
+	* programs.texi (Defuns): Delete duplicate explanation of
+	left-margin paren convention.
+	(Hungry Delete): Minor cleanup.
+
 2006-02-11  Mathias Dahl  <mathias.dahl@gmail.com>
 
 	* dired.texi (Tumme): More tumme documentation.
--- a/man/building.texi	Tue Feb 14 12:32:39 2006 +0000
+++ b/man/building.texi	Thu Feb 16 16:18:54 2006 +0000
@@ -10,7 +10,7 @@
 
   The previous chapter discusses the Emacs commands that are useful for
 making changes in programs.  This chapter deals with commands that assist
-in the larger process of developing and maintaining programs.
+in the larger process of compiling and testing programs.
 
 @menu
 * Compilation::         Compiling programs in languages other
@@ -828,20 +828,20 @@
 @example
 +--------------------------------+--------------------------------+
 |                                |                                |
-|  GUD buffer (I/O of GDB)       |     Locals buffer              |
+|   GUD buffer (I/O of GDB)      |   Locals buffer                |
 |                                |                                |
 |--------------------------------+--------------------------------+
 |                                |                                |
-|  Source buffer                 |     I/O buffer (of inferior)   |
+|   Source buffer                |   I/O buffer for debugged pgm  |
 |                                |                                |
 |--------------------------------+--------------------------------+
 |                                |                                |
-|  Stack buffer                  |     Breakpoints buffer         |
+|   Stack buffer                 |   Breakpoints buffer           |
 |                                |                                |
 +--------------------------------+--------------------------------+
 @end example
 
-  However, if @code{gdb-use-inferior-io-buffer} is @code{nil}, the I/O
+  However, if @code{gdb-use-separate-io-buffer} is @code{nil}, the I/O
 buffer does not appear and the source buffer occupies the full width
 of the frame.
 
@@ -972,15 +972,17 @@
 
 @table @asis
 @item Input/Output Buffer
-@vindex gdb-use-inferior-io-buffer
-If the variable @code{gdb-use-inferior-io-buffer} is non-@code{nil},
+@vindex gdb-use-separate-io-buffer
+If the variable @code{gdb-use-separate-io-buffer} is non-@code{nil},
 the executable program that is being debugged takes its input and
 displays its output here.  Otherwise it uses the GUD buffer for that.
-To toggle the use of this buffer, do @kbd{M-x
-gdb-use-inferior-io-buffer}.
+To toggle whether GUD mode uses this buffer, do @kbd{M-x
+gdb-use-separate-io-buffer}.  That takes effect when you next
+restart the program you are debugging.
 
-Some of the commands from shell mode are available here.  @xref{Shell
-Mode}.
+The history and replay commands from Shell mode are available here,
+as are the commands to send signals to the program you are debugging.
+@xref{Shell Mode}.
 
 @item Locals Buffer
 The locals buffer displays the values of local variables of the
@@ -990,8 +992,8 @@
 Arrays and structures display their type only.  With GDB 6.4 or later,
 move point to their name and press @key{RET}, or alternatively click
 @kbd{Mouse-2} there, to examine their values.  With earlier versions
-of GDB, move point to their type description ([struct/union] or
-[array]).  @xref{Watch Expressions}.
+of GDB, use @kbd{Mouse-2} or @key{RET} on the type description
+(@samp{[struct/union]} or @samp{[array]}).  @xref{Watch Expressions}.
 
 @item Registers Buffer
 @findex toggle-gdb-all-registers
--- a/man/custom.texi	Tue Feb 14 12:32:39 2006 +0000
+++ b/man/custom.texi	Thu Feb 16 16:18:54 2006 +0000
@@ -1043,7 +1043,15 @@
 specifications; it automatically makes these variables local to the
 buffer, and sets them to the values specified in the file.
 
-  There are two ways to specify local variable values: in the first
+@menu
+* Specifying File Variables:: Specifying file local variables.
+* Safe File Variables::       Making sure file local variables are safe.
+@end menu
+
+@node Specifying File Variables
+@subsubsection Specifying File Variables
+
+  There are two ways to specify file local variable values: in the first
 line, or with a local variables list.  Here's how to specify them in the
 first line:
 
@@ -1089,7 +1097,7 @@
 in the @samp{-*-} line first, and @emph{everything} in the local
 variables list afterward.
 
-Here is an example of a local variables list:
+  Here is an example of a local variables list:
 
 @example
 ;;; Local Variables: ***
@@ -1170,33 +1178,63 @@
 major mode of a buffer according to the file name and contents,
 including the local variables list if any.  @xref{Choosing Modes}.
 
-@findex enable-local-variables
-  The variable @code{enable-local-variables} controls whether to process
-local variables in files, and thus gives you a chance to override them.
-Its default value is @code{t}, which means do process local variables in
-files.  If you set the value to @code{nil}, Emacs simply ignores local
-variables in files.  Any other value says to query you about each file
-that has local variables, showing you the local variable specifications
-so you can judge.
-
-@findex enable-local-eval
-  The @code{eval} ``variable,'' and certain actual variables, create a
-special risk; when you visit someone else's file, local variable
-specifications for these could affect your Emacs in arbitrary ways.
-Therefore, the variable @code{enable-local-eval} controls whether Emacs
-processes @code{eval} variables, as well variables with names that end
-in @samp{-hook}, @samp{-hooks}, @samp{-function} or @samp{-functions},
-and certain other variables.  The three possibilities for the variable's
-value are @code{t}, @code{nil}, and anything else, just as for
-@code{enable-local-variables}.  The default is @code{maybe}, which is
-neither @code{t} nor @code{nil}, so normally Emacs does ask for
-confirmation about file settings for these variables.
-
-@findex safe-local-eval-forms
+@node Safe File Variables
+@subsubsection Safety of File Variables
+
+  File-local variables can be dangerous; when you visit someone else's
+file, there's no telling what its local variables list could do to
+your Emacs.  Improper values of the @code{eval} ``variable,'' and
+other variables such as @code{load-path}, could execute Lisp code you
+didn't intend to run.
+
+  Therefore, whenever Emacs encounters file local variable values that
+are not known to be safe, it displays the file's entire local
+variables list, and asks you for confirmation before setting them.
+You can type @kbd{y} or @key{SPC} to put the local variables list into
+effect, or @kbd{n} to ignore it.  When Emacs is run in batch mode
+(@pxref{Initial Options}), it can't really ask you, so it assumes the
+answer @samp{n}.
+
+  Emacs normally recognizes certain variables/value pairs as safe.
+For instance, it is safe to give @code{comment-column} or
+@code{fill-column} any integer value.  If a file specifies only safe
+variable/value pairs, Emacs does not ask for confirmation before
+setting them.  Otherwise, you can tell Emacs to record that all the
+variable/value pairs in the file are safe, by typing @kbd{!} at the
+confirmation prompt.  When Emacs encounters these variable/value pairs
+subsequently, in the same file or others, it will assume they are
+safe.
+
+@vindex safe-local-variable-values
+@cindex risky variable
+  Some variables, such as @code{load-path}, are considered
+particularly @dfn{risky}: there is seldom any reason to specify them
+as local variables, and changing them can be dangerous.  Even if you
+enter @kbd{!} at the confirmation prompt, Emacs will not record any
+values as safe for these variables.  If you really want to record safe
+values for these variables, do it directly by customizing
+@samp{safe-local-variable-values} (@pxref{Easy Customization}).
+
+@vindex enable-local-variables
+  The variable @code{enable-local-variables} allows you to change the
+way Emacs processes local variables.  Its default value is @code{t},
+which specifies the behavior described above.  If it is @code{nil},
+Emacs simply ignores all file local variables.  Any other value says
+to query you about each file that has local variables, without trying
+to determine whether the values are known to be safe.
+
+@vindex enable-local-eval
+  The variable @code{enable-local-eval} controls whether Emacs
+processes @code{eval} variables.  The three possibilities for the
+variable's value are @code{t}, @code{nil}, and anything else, just as
+for @code{enable-local-variables}.  The default is @code{maybe}, which
+is neither @code{t} nor @code{nil}, so normally Emacs does ask for
+confirmation about processes @code{eval} variables.
+
+@vindex safe-local-eval-forms
   The @code{safe-local-eval-forms} is a customizable list of eval
 forms which are safe to eval, so Emacs should not ask for
-confirmation to evaluate these forms, even if
-@code{enable-local-variables} says to ask for confirmation in general.
+confirmation to evaluate these forms.
 
 @node Key Bindings
 @section Customizing Key Bindings
--- a/man/dired.texi	Tue Feb 14 12:32:39 2006 +0000
+++ b/man/dired.texi	Thu Feb 16 16:18:54 2006 +0000
@@ -1146,6 +1146,7 @@
 @section Thumbnail and image file viewing and manipulation
 
 @cindex tumme mode
+
   Tumme provides for simple viewing of thumbnails of image files.  It
 provides viewing of the original file, sized or in full size, inside
 Emacs or in an external viewer.
@@ -1159,14 +1160,14 @@
 for them, and the thumbnails will be displayed in the ``thumbnail
 buffer''.
 
-  Because thumbnails are created on the fly and before they can be
-displayed, the above command might take a long time, especially the
-first time, if the directory contains many image files.  If the number
-of image files is higher than
-@code{tumme-show-all-from-dir-max-files}, the command will be aborted.
-To work around this you can instead mark the files you want to look
-at, using @kbd{m} as usual in Dired, and then type @kbd{C-t d}
-(@code{tumme-display-thumbs}).
+  If the directory contains many image files and becayse thumbnails
+are created on the fly before they can be displayed, the above command
+might take a long time, especially the first time (consecutive
+viewings will use the cached thumbnail files).  Also, if the number of
+image files is higher than @code{tumme-show-all-from-dir-max-files},
+the command will be aborted.  To work around this you can instead mark
+the files you want to look at, using @kbd{m} as usual in Dired, and
+then type @kbd{C-t d} (@code{tumme-display-thumbs}).
 
   Regardless of which command you chose to display the thumbnails, a
 new buffer will open up, displaying thumbnail images of the files that
@@ -1193,26 +1194,37 @@
 the thumbnail image from the thumbnail buffer, type @kbd{C-d}
 (@code{tumme-delete-char}).
 
-  More advanced features include commands for using ``tags'' (another
-name for ``keyword'' or ``label'') to tag image files and to search
-for image files with a certain tag.
+  More advanced features include commands for using ``tags''.  ``Tag''
+is just another word for ``keyword'', ``label'' or ``category''.  In
+short, it is meta data used to categorize an image file.  Commands
+exist to add tags for one or many image files from dired, to mark
+files having a certain tag in Dired and to remove tags from files.
+The tags put on image files are stored in a database file (currently a
+plain text file).
 
-  The tags put on image files are stored in a database file and can be
-used for marking image files.  For example, you can let Tumme mark all
-files in the current directory tagged with the tag `flowers'.  To tag
-image files, mark them in the dired buffer and type @kbd{C-t t}
-(@code{tumme-tag-files}).  To mark files having a certain tag, type
-@kbd{C-t f} (@code{tumme-mark-tagged-files}).
+  To tag image files, mark them in the dired buffer and type @kbd{C-t
+t} (@code{tumme-tag-files}).  You will be prompted for a tag. To mark
+files having a certain tag, type @kbd{C-t f}
+(@code{tumme-mark-tagged-files}). After marking image files with a
+certain tag, they can be viewed as explained earlier, by typing
+@key{C-t d}.
 
-  After marking image files with a certain tag, they can be viewed as
-explained earlier, by typing @key{C-t d}.
+  You can also tag a file from the thumbnail buffer by typing @kbd{t
+t} and remove it by typing @kbd{t r}.  There is also a special ``tag''
+called ``comment'' for each file (it is not a tag in the exact same
+sense as the other tags, it is handled slightly different).  That is
+used to enter a comment or description about the image.  You comment a
+file from the thumbnail buffer by typing @kbd{c}.  You will be
+prompted for a comment.  Comments can also be added from Dired, and
+then also to multiple files at once, by typing @kbd{C-t c}
+(@code{tumme-dired-comment-files}).
 
   Tumme also provide simple image manipulation commands, like rotating
 thumbnails and original image files.  In the thumbnail buffer, type
 @kbd{L} to rotate the original image 90 degrees anti clockwise, and
-@kbd{R} to rotate it 90 degrees clockwise.
-
-
+@kbd{R} to rotate it 90 degrees clockwise.  This rotation will be done
+lossless (the image quality will not be reduced) and needs an external
+utility called JpegTRAN to work.
 
 @node Misc Dired Features
 @section Other Dired Features
--- a/man/display.texi	Tue Feb 14 12:32:39 2006 +0000
+++ b/man/display.texi	Thu Feb 16 16:18:54 2006 +0000
@@ -472,7 +472,7 @@
 Bars}.  Setting the font of LessTif/Motif menus is currently not
 supported; attempts to set the font are ignored in this case.
 Likewise, attempts to customize this face in Emacs built with GTK and
-in the MS-Windows port are ignored by the respective GUI toolkits;
+in the MS-Windows/Mac ports are ignored by the respective GUI toolkits;
 you need to use system-wide styles and options to change the
 appearance of the menus.
 @end table
--- a/man/faq.texi	Tue Feb 14 12:32:39 2006 +0000
+++ b/man/faq.texi	Thu Feb 16 16:18:54 2006 +0000
@@ -1272,7 +1272,7 @@
 
 In Emacs 21.1 and later, colors and faces are supported in non-windowed mode,
 i.e.@: on Unix and GNU/Linux text-only terminals and consoles, and when
-invoked as @samp{emacs -nw} on X and MS-Windows.  (Colors and faces were
+invoked as @samp{emacs -nw} on X, MS-Windows, and Mac.  (Colors and faces were
 supported in the MS-DOS port since Emacs 19.29.)  Emacs automatically
 detects color support at startup and uses it if available.  If you think
 that your terminal supports colors, but Emacs won't use them, check the
@@ -3670,7 +3670,7 @@
 @cindex Atari ST, Emacs for
 @cindex TOS, Emacs for
 
-Roland Schäuble reports that Emacs 18.58 running on plain TOS and MiNT
+Roland Sch@"auble reports that Emacs 18.58 running on plain TOS and MiNT
 is available at
 @uref{ftp://atari.archive.umich.edu/Editors/Emacs-18-58/1858b-d3.zoo}.
 
--- a/man/files.texi	Tue Feb 14 12:32:39 2006 +0000
+++ b/man/files.texi	Thu Feb 16 16:18:54 2006 +0000
@@ -239,7 +239,7 @@
 or tool bar) use the toolkit's standard File Selection dialog instead
 of prompting for the file name in the minibuffer.  On Unix and
 GNU/Linux platforms, Emacs does that when built with GTK, LessTif, and
-Motif toolkits; on MS-Windows, the GUI version does that by default.
+Motif toolkits; on MS-Windows and Mac, the GUI version does that by default.
 For information on how to customize this, see @ref{Dialog Boxes}.
 
   Secondly, Emacs supports ``drag and drop''; dropping a file into an
--- a/man/frames.texi	Tue Feb 14 12:32:39 2006 +0000
+++ b/man/frames.texi	Thu Feb 16 16:18:54 2006 +0000
@@ -293,7 +293,7 @@
 the Emacs yank functions consult the clipboard before the primary
 selection, and to make the kill functions to store in the clipboard as
 well as the primary selection.  Otherwise they do not access the
-clipboard at all.  Using the clipboard is the default on MS-Windows,
+clipboard at all.  Using the clipboard is the default on MS-Windows and Mac,
 but not on other systems.
 
 @node Mouse References
--- a/man/glossary.texi	Tue Feb 14 12:32:39 2006 +0000
+++ b/man/glossary.texi	Thu Feb 16 16:18:54 2006 +0000
@@ -175,7 +175,7 @@
 @item Clipboard
 A clipboard is a buffer provided by the window system for transferring
 text between applications.  On the X Window system, the clipboard is
-provided in addition to the primary selection (q.v.@:); on MS-Windows,
+provided in addition to the primary selection (q.v.@:); on MS-Windows and Mac,
 the clipboard is used @emph{instead} of the primary selection.
 @xref{Clipboard}.
 
--- a/man/maintaining.texi	Tue Feb 14 12:32:39 2006 +0000
+++ b/man/maintaining.texi	Thu Feb 16 16:18:54 2006 +0000
@@ -3,14 +3,11 @@
 @c   2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
 @c See file emacs.texi for copying conditions.
 @node Maintaining, Abbrevs, Building, Top
-@chapter Maintaining Programs
-@cindex Lisp editing
-@cindex C editing
-@cindex program editing
+@chapter Maintaining Large Programs
 
-  This chapter describes Emacs features for maintaining programs.  The
-version control features (@pxref{Version Control}) are also particularly
-useful for this purpose.
+  This chapter describes Emacs features for maintaining large
+programs.  The version control features (@pxref{Version Control}) are
+also particularly useful for this purpose.
 
 @menu
 * Change Log::	        Maintaining a change history for your program.
@@ -407,7 +404,8 @@
 move an entire directory tree containing both the tags file and the
 source files, and the tags file will still refer correctly to the source
 files.  If the tags file is in @file{/dev}, however, the file names are
-made relative to the current working directory.
+made relative to the current working directory.  This is useful, for
+example, when writing the tags to @file{/dev/stdout}.
 
   If you specify absolute file names as arguments to @code{etags}, then
 the tags file will contain absolute file names.  This way, the tags file
--- a/man/programs.texi	Tue Feb 14 12:32:39 2006 +0000
+++ b/man/programs.texi	Thu Feb 16 16:18:54 2006 +0000
@@ -132,19 +132,6 @@
 something like a function, is called a @dfn{defun}.  The name comes
 from Lisp, but in Emacs we use it for all languages.
 
-  In many programming language modes, Emacs assumes that a defun is
-any pair of parentheses (or braces, if the language uses braces this
-way) that starts at the left margin.  For example, in C, the body of a
-function definition is a defun, usually recognized as an open-brace
-that begins at the left margin@footnote{Alternatively, you can set up
-C Mode to recognize a defun at an opening brace at the outermost
-level.  @xref{Movement Commands,,, ccmode, the CC Mode Manual}.}.  A
-variable's initializer can also count as a defun, if the open-brace
-that begins the initializer is at the left margin.
-
-  However, some language modes provide their own code for recognizing
-defuns in a way that suits the language syntax and conventions better.
-
 @menu
 * Left Margin Paren::   An open-paren or similar opening delimiter
                           starts a defun if it is at the left margin.
@@ -1573,9 +1560,9 @@
 
   As an alternative to the above commands, you can enable @dfn{hungry
 delete mode}.  When this feature is enabled (indicated by @samp{/h} in
-the mode line after the mode name), a single @key{DEL} command deletes
-all preceding whitespace, not just one space, and a single @kbd{C-c
-C-d} (but @emph{not} @key{DELETE}) deletes all following whitespace.
+the mode line after the mode name), a single @key{DEL} deletes all
+preceding whitespace, not just one space, and a single @kbd{C-c C-d}
+(but @emph{not} plain @key{DELETE}) deletes all following whitespace.
 
 @table @kbd
 @item M-x c-toggle-hungry-state
--- a/man/text.texi	Tue Feb 14 12:32:39 2006 +0000
+++ b/man/text.texi	Thu Feb 16 16:18:54 2006 +0000
@@ -2575,10 +2575,10 @@
 moves to the last cell.
 
 @findex table-span-cell
-  The command @code{table-span-cell} spans the current cell into one
-of the four directions---right, left, above or below---and merges the
-current cell with the adjacent cell.  It does not allow directions to
-which spanning does not produce a legitimate cell.
+  The command @code{table-span-cell} merges the current cell with the
+adjacent cell in a specified direction---right, left, above or below.
+You specify the direction with the minibuffer.  It does not allow
+merges which don't result in a legitimate cell layout.
 
 @findex table-split-cell
 @cindex text-based tables, split a cell
@@ -2586,7 +2586,8 @@
   The command @code{table-split-cell} splits the current cell
 vertically or horizontally.  This command is a wrapper to the
 direction specific commands @code{table-split-cell-vertically} and
-@code{table-split-cell-horizontally}.
+@code{table-split-cell-horizontally}.  You specify the direction with
+a minibuffer argument.
 
 @findex table-split-cell-vertically
   The command @code{table-split-cell-vertically} splits the current
--- a/man/xresources.texi	Tue Feb 14 12:32:39 2006 +0000
+++ b/man/xresources.texi	Thu Feb 16 16:18:54 2006 +0000
@@ -8,7 +8,8 @@
   You can customize some X-related aspects of Emacs behavior using X
 resources, as is usual for programs that use X.  On MS-Windows, you
 can customize some of the same aspects using the system registry.
-@xref{MS-Windows Registry}.
+@xref{MS-Windows Registry}.  Likewise, the Mac Carbon port emulates X
+resources using the Preferences system.  @xref{Mac Environment Variables}.
 
   When Emacs is built using an `X toolkit', such as Lucid or LessTif,
 you need to use X resources to customize the appearance of the
--- a/src/.gdbinit	Tue Feb 14 12:32:39 2006 +0000
+++ b/src/.gdbinit	Thu Feb 16 16:18:54 2006 +0000
@@ -548,7 +548,16 @@
 define xwindow
   xgetptr $
   print (struct window *) $ptr
-  printf "%dx%d+%d+%d\n", $->width, $->height, $->left, $->top
+  set $window = (struct window *) $ptr
+  xgetint $window->total_cols
+  set $width=$int
+  xgetint $window->total_lines
+  set $height=$int
+  xgetint $window->left_col
+  set $left=$int
+  xgetint $window->top_line
+  set $top=$int
+  printf "%dx%d+%d+%d\n", $width, $height, $left, $top
 end
 document xwindow
 Print $ as a window pointer, assuming it is an Emacs Lisp window value.
--- a/src/ChangeLog	Tue Feb 14 12:32:39 2006 +0000
+++ b/src/ChangeLog	Thu Feb 16 16:18:54 2006 +0000
@@ -1,3 +1,49 @@
+2006-02-15  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+	* frame.c (x_get_arg): Clear out PARAM in ALIST also on Mac.
+
+	* macfns.c (x_set_menu_bar_lines): Menu bar is always shown on Mac.
+
+	* macmenu.c (set_frame_menubar): Don't call DrawMenuBar.
+
+2006-02-14  Richard M. Stallman  <rms@gnu.org>
+
+	* frame.c (x_get_arg): Clear out all occurrences of PARAM in ALIST.
+
+	* m/ibms390x.h: New file.
+
+2006-02-14  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>
+
+	* gtkutil.c (xg_tool_bar_detach_callback): Set show-arrow to the
+	value of x-gtk-whole-detached-tool-bar.
+	(xg_tool_bar_attach_callback): Set show-arrow to TRUE.
+
+	* xfns.c (syms_of_xfns): New variable: x-gtk-whole-detached-tool-bar.
+
+2006-02-14  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>
+
+	* xterm.c (x_x_to_emacs_modifiers): Make non-static.
+
+	* xterm.h: Declare x_x_to_emacs_modifiers.
+
+	* gtkutil.c (xg_tool_bar_button_cb): New function.
+	(xg_tool_bar_callback): Call x_x_to_emacs_modifiers to
+	store modifiers in event.
+	(update_frame_tool_bar): Connect button-release-event to
+	xg_tool_bar_button_cb.
+
+2006-02-13  Richard M. Stallman  <rms@gnu.org>
+
+	* .gdbinit (xwindow): Update the code to show the window box.
+
+2006-02-13  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>
+
+	* xterm.c (note_mouse_movement): Check for NULL FRAME_X_OUTPUT (frame).
+
+2006-02-12  Richard M. Stallman  <rms@gnu.org>
+
+	* cmds.c (internal_self_insert): Handle weird auto-fill-function.
+
 2006-02-11  Eli Zaretskii  <eliz@gnu.org>
 
 	* keyboard.c (Venable_disabled_menus_and_buttons): New variable.
--- a/src/cmds.c	Tue Feb 14 12:32:39 2006 +0000
+++ b/src/cmds.c	Thu Feb 16 16:18:54 2006 +0000
@@ -528,7 +528,8 @@
 	   justification, if any, know where the end is going to be.  */
 	SET_PT_BOTH (PT - 1, PT_BYTE - 1);
       tem = call0 (current_buffer->auto_fill_function);
-      if (c == '\n')
+      /* Test PT < ZV in case the auto-fill-function is strange.  */
+      if (c == '\n' && PT < ZV)
 	SET_PT_BOTH (PT + 1, PT_BYTE + 1);
       if (!NILP (tem))
 	hairy = 2;
--- a/src/frame.c	Tue Feb 14 12:32:39 2006 +0000
+++ b/src/frame.c	Thu Feb 16 16:18:54 2006 +0000
@@ -3824,9 +3824,15 @@
     {
       /* If we find this parm in ALIST, clear it out
 	 so that it won't be "left over" at the end.  */
-#ifdef HAVE_X_WINDOWS /* macfns.c and w32fns.c have not yet
-			 been changed to cope with this.  */
+#ifndef WINDOWSNT /* w32fns.c has not yet been changed to cope with this.  */
+      Lisp_Object tail;
       XSETCAR (tem, Qnil);
+      /* In case the parameter appears more than once in the alist,
+	 clear it out.  */
+      for (tail = alist; CONSP (tail); tail = XCDR (tail))
+	if (CONSP (XCAR (tail))
+	    && EQ (XCAR (XCAR (tail)), param))
+	  XSETCAR (XCAR (tail), Qnil);
 #endif
     }
   else
--- a/src/gtkutil.c	Tue Feb 14 12:32:39 2006 +0000
+++ b/src/gtkutil.c	Thu Feb 16 16:18:54 2006 +0000
@@ -3242,11 +3242,28 @@
    the GtkImage with a new image.  */
 #define XG_TOOL_BAR_IMAGE_DATA "emacs-tool-bar-image"
 
+/* The key for storing the latest modifiers so the activate callback can
+   get them.  */
+#define XG_TOOL_BAR_LAST_MODIFIER "emacs-tool-bar-modifier"
+
+
 /* Callback function invoked when a tool bar item is pressed.
    W is the button widget in the tool bar that got pressed,
    CLIENT_DATA is an integer that is the index of the button in the
    tool bar.  0 is the first button.  */
 
+static gboolean
+xg_tool_bar_button_cb (widget, event, user_data)
+    GtkWidget      *widget;
+    GdkEventButton *event;
+    gpointer        user_data;
+{
+  g_object_set_data (G_OBJECT (user_data), XG_TOOL_BAR_LAST_MODIFIER,
+                     (gpointer) event->state);
+  return FALSE;
+}
+
+
 static void
 xg_tool_bar_callback (w, client_data)
      GtkWidget *w;
@@ -3254,6 +3271,8 @@
 {
   /* The EMACS_INT cast avoids a warning. */
   int idx = (int) (EMACS_INT) client_data;
+  int mod = (int) g_object_get_data (G_OBJECT (w), XG_TOOL_BAR_LAST_MODIFIER);
+
   FRAME_PTR f = (FRAME_PTR) g_object_get_data (G_OBJECT (w), XG_FRAME_DATA);
   Lisp_Object key, frame;
   struct input_event event;
@@ -3274,7 +3293,10 @@
   event.kind = TOOL_BAR_EVENT;
   event.frame_or_window = frame;
   event.arg = key;
-  event.modifiers = 0;  /* These are not available.  */
+  /* Convert between the modifier bits GDK uses and the modifier bits
+     Emacs uses.  This assumes GDK an X masks are the same, which they are when
+     this is written.  */
+  event.modifiers = x_x_to_emacs_modifiers (FRAME_X_DISPLAY_INFO (f), mod);
   kbd_buffer_store_event (&event);
 }
 
@@ -3292,6 +3314,10 @@
      gpointer client_data;
 {
   FRAME_PTR f = (FRAME_PTR) client_data;
+  extern int x_gtk_whole_detached_tool_bar;
+
+  g_object_set (G_OBJECT (w), "show-arrow", !x_gtk_whole_detached_tool_bar,
+		NULL);
 
   if (f)
     {
@@ -3322,6 +3348,7 @@
      gpointer client_data;
 {
   FRAME_PTR f = (FRAME_PTR) client_data;
+  g_object_set (G_OBJECT (w), "show-arrow", TRUE, NULL);
 
   if (f)
     {
@@ -3629,6 +3656,13 @@
           while (! GTK_IS_BUTTON (w))
             w = gtk_widget_get_parent (w);
 
+          /* Callback to save modifyer mask (Shift/Control, etc).  GTK makes
+             no distinction based on modifiers in the activate callback,
+             so we have to do it ourselves.  */
+          g_signal_connect (w, "button-release-event",
+                            GTK_SIGNAL_FUNC (xg_tool_bar_button_cb),
+                            ti);
+
           g_object_set_data (G_OBJECT (w), XG_FRAME_DATA, (gpointer)f);
 
           /* Use enter/leave notify to show help.  We use the events
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/m/ibms390x.h	Thu Feb 16 16:18:54 2006 +0000
@@ -0,0 +1,163 @@
+/* machine description file for IBM S390 in 64-bit mode
+   Copyright (C) 2002, 2003, 2004, 2005, 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.  */
+
+/* This file was made by copying the significant parts of amdx86-64.h
+   into ibms390.h.  */
+
+
+/* The following line tells the configuration script what sort of 
+   operating system this machine is likely to run.
+   USUAL-OPSYS="<name of system .h file here, without the s- or .h>"
+
+NOTE-START
+IBM s390 64 bits (-machine=ibms390x64)
+
+  The possibilities for -opsystem are: gnu-linux.
+
+NOTE-END */
+
+#define BITS_PER_LONG 64
+#define BITS_PER_EMACS_INT 64
+
+/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+   is the most significant byte.  */
+
+#define WORDS_BIG_ENDIAN
+
+/* Define NO_ARG_ARRAY if you cannot take the address of the first of a
+ * group of arguments and treat it as an array of the arguments.  */
+
+#define NO_ARG_ARRAY
+
+/* Define WORD_MACHINE if addresses and such have
+ * to be corrected before they can be used as byte counts.  */
+
+#define WORD_MACHINE
+
+/* Now define a symbol for the cpu type, if your compiler
+   does not define it automatically:
+   Ones defined so far include vax, m68000, ns16000, pyramid,
+   orion, tahoe, APOLLO and many others */
+
+/* Use type int rather than a union, to represent Lisp_Object */
+/* This is desirable for most machines.  */
+
+#define NO_UNION_TYPE
+
+/* Define the type to use.  */
+#define EMACS_INT long
+#define EMACS_UINT unsigned long
+#define SPECIAL_EMACS_INT
+
+/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend
+   the 24-bit bit field into an int.  In other words, if bit fields
+   are always unsigned.
+
+   If you use NO_UNION_TYPE, this flag does not matter.  */
+
+#undef EXPLICIT_SIGN_EXTEND
+
+/* Data type of load average, as read out of kmem.  */
+
+#define LOAD_AVE_TYPE long
+
+/* Convert that into an integer that is 100 for a load average of 1.0  */
+
+#define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE)
+
+/* Define CANNOT_DUMP on machines where unexec does not work.
+   Then the function dump-emacs will not be defined
+   and temacs will do (load "loadup") automatically unless told otherwise.  */
+
+#undef CANNOT_DUMP
+
+/* Define VIRT_ADDR_VARIES if the virtual addresses of
+   pure and impure space as loaded can vary, and even their
+   relative order cannot be relied on.
+
+   Otherwise Emacs assumes that text space precedes data space,
+   numerically.  */
+
+#define VIRT_ADDR_VARIES
+
+/* Define C_ALLOCA if this machine does not support a true alloca
+   and the one written in C should be used instead.
+   Define HAVE_ALLOCA to say that the system provides a properly
+   working alloca function and it should be used.
+   Define neither one if an assembler-language alloca
+   in the file alloca.s should be used.  */
+
+#undef C_ALLOCA
+#define HAVE_ALLOCA
+
+/* Define NO_REMAP if memory segmentation makes it not work well
+   to change the boundary between the text section and data section
+   when Emacs is dumped.  If you define this, the preloaded Lisp
+   code will not be sharable; but that's better than failing completely.  */
+
+#undef NO_REMAP
+
+/* Some really obscure 4.2-based systems (like Sequent DYNIX)
+ * do not support asynchronous I/O (using SIGIO) on sockets,
+ * even though it works fine on tty's.  If you have one of
+ * these systems, define the following, and then use it in
+ * config.h (or elsewhere) to decide when (not) to use SIGIO.
+ *
+ * You'd think this would go in an operating-system description file,
+ * but since it only occurs on some, but not all, BSD systems, the
+ * reasonable place to select for it is in the machine description
+ * file.
+ */
+
+#undef NO_SOCK_SIGIO
+
+
+/* After adding support for a new system, modify the large case
+   statement in the `configure' script to recognize reasonable
+   configuration names, and add a description of the system to
+   `etc/MACHINES'.
+
+   If you've just fixed a problem in an existing configuration file,
+   you should also check `etc/MACHINES' to make sure its descriptions
+   of known problems in that configuration should be updated.  */
+
+#define PNTR_COMPARISON_TYPE unsigned long
+
+/* On the 64 bit architecture, we can use 60 bits for addresses */
+
+#define VALBITS         60
+
+/* This definition of MARKBIT is necessary because of the comparison of
+   ARRAY_MARK_FLAG and MARKBIT in an #if in lisp.h, which cpp doesn't like. */
+
+#define MARKBIT         0x8000000000000000L
+
+#define LINKER $(CC) -nostdlib
+
+/* Define XINT and XUINT so that they can take arguments of type int */
+#define XINT(a)  (((long) (a) << (BITS_PER_LONG - VALBITS)) >> (BITS_PER_LONG - VALBITS))
+#define XUINT(a) ((long) (a) & VALMASK)
+
+/* Define XPNTR to avoid or'ing with DATA_SEG_BITS */
+
+#define XPNTR(a) XUINT (a)
+
+/* arch-tag: 4b87653c-6add-4663-8691-7d9dc17b5519
+   (do not change this comment) */
--- a/src/macfns.c	Tue Feb 14 12:32:39 2006 +0000
+++ b/src/macfns.c	Thu Feb 16 16:18:54 2006 +0000
@@ -1647,36 +1647,15 @@
      struct frame *f;
      Lisp_Object value, oldval;
 {
-  int nlines;
-  int olines = FRAME_MENU_BAR_LINES (f);
-
-  /* Right now, menu bars don't work properly in minibuf-only frames;
-     most of the commands try to apply themselves to the minibuffer
-     frame itself, and get an error because you can't switch buffers
-     in or split the minibuffer window.  */
-  if (FRAME_MINIBUF_ONLY_P (f))
-    return;
-
-  if (INTEGERP (value))
-    nlines = XINT (value);
-  else
-    nlines = 0;
+  /* Make sure we redisplay all windows in this frame.  */
+  windows_or_buffers_changed++;
 
   FRAME_MENU_BAR_LINES (f) = 0;
-  if (nlines)
-    FRAME_EXTERNAL_MENU_BAR (f) = 1;
-  else
-    {
-      if (FRAME_EXTERNAL_MENU_BAR (f) == 1)
-	free_frame_menubar (f);
-      FRAME_EXTERNAL_MENU_BAR (f) = 0;
-
-      /* Adjust the frame size so that the client (text) dimensions
-	 remain the same.  This depends on FRAME_EXTERNAL_MENU_BAR being
-	 set correctly.  */
-      x_set_window_size (f, 0, FRAME_COLS (f), FRAME_LINES (f));
-      do_pending_window_change (0);
-    }
+  /* The menu bar is always shown.  */
+  FRAME_EXTERNAL_MENU_BAR (f) = 1;
+  if (FRAME_MAC_P (f) && f->output_data.mac->menubar_widget == 0)
+    /* Make sure next redisplay shows the menu bar.  */
+    XWINDOW (FRAME_SELECTED_WINDOW (f))->update_mode_line = Qt;
   adjust_glyphs (f);
 }
 
--- a/src/macmenu.c	Tue Feb 14 12:32:39 2006 +0000
+++ b/src/macmenu.c	Thu Feb 16 16:18:54 2006 +0000
@@ -1701,8 +1701,6 @@
 
   fill_menubar (first_wv->contents);
 
-  DrawMenuBar ();
-
   /* Add event handler so we can detect C-g. */
   install_menu_quit_handler (NULL);
   free_menubar_widget_value_tree (first_wv);
--- a/src/xfns.c	Tue Feb 14 12:32:39 2006 +0000
+++ b/src/xfns.c	Thu Feb 16 16:18:54 2006 +0000
@@ -159,6 +159,10 @@
 
 int x_gtk_show_hidden_files;
 
+/* If non-zero, don't collapse to tool bar when it is detached.  */
+
+int x_gtk_whole_detached_tool_bar;
+
 /* The background and shape of the mouse pointer, and shape when not
    over text or in the modeline.  */
 
@@ -5809,6 +5813,12 @@
 chooser to show or not show hidden files on a case by case basis.  */);
   x_gtk_show_hidden_files = 0;
 
+  DEFVAR_BOOL ("x-gtk-whole-detached-tool-bar", &x_gtk_whole_detached_tool_bar,
+    doc: /* *If non-nil, a detached tool bar is shown in full.
+The default is to just show an arrow and pressing on that arrow shows
+the tool bar buttons.  */);
+  x_gtk_whole_detached_tool_bar = 0;
+
   Fprovide (intern ("x"), Qnil);
 
 #ifdef USE_X_TOOLKIT
--- a/src/xterm.c	Tue Feb 14 12:32:39 2006 +0000
+++ b/src/xterm.c	Thu Feb 16 16:18:54 2006 +0000
@@ -325,8 +325,7 @@
 static const XColor *x_color_cells P_ ((Display *, int *));
 static void x_update_window_end P_ ((struct window *, int, int));
 void x_delete_display P_ ((struct x_display_info *));
-static unsigned int x_x_to_emacs_modifiers P_ ((struct x_display_info *,
-						unsigned));
+
 static int x_io_error_quitter P_ ((Display *));
 int x_catch_errors P_ ((Display *));
 void x_uncatch_errors P_ ((Display *, int));
@@ -3470,7 +3469,7 @@
 /* Convert between the modifier bits X uses and the modifier bits
    Emacs uses.  */
 
-static unsigned int
+unsigned int
 x_x_to_emacs_modifiers (dpyinfo, state)
      struct x_display_info *dpyinfo;
      unsigned int state;
@@ -3598,6 +3597,9 @@
   last_mouse_motion_event = *event;
   XSETFRAME (last_mouse_motion_frame, frame);
 
+  if (!FRAME_X_OUTPUT (frame))
+    return 0;
+
   if (event->window != FRAME_X_WINDOW (frame))
     {
       frame->mouse_moved = 1;
--- a/src/xterm.h	Tue Feb 14 12:32:39 2006 +0000
+++ b/src/xterm.h	Thu Feb 16 16:18:54 2006 +0000
@@ -1004,6 +1004,8 @@
 extern void set_vertical_scroll_bar P_ ((struct window *));
 
 extern int x_dispatch_event P_ ((XEvent *, Display *));
+extern unsigned int x_x_to_emacs_modifiers P_ ((struct x_display_info *,
+						unsigned));
 
 /* Defined in xselect.c */