changeset 83302:5ae8a8b0a308

Merged from miles@gnu.org--gnu-2005 (patch 292-295) Patches applied: * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-292 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-293 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-294 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-295 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-342
author Karoly Lorentey <lorentey@elte.hu>
date Mon, 09 May 2005 16:13:15 +0000
parents b151ec53c504 (current diff) 598f5ebd4f94 (diff)
children 108e45fdcdbd
files ChangeLog admin/FOR-RELEASE lisp/ChangeLog lisp/files.el lisp/international/mule.el lisp/jka-comp-hook.el lisp/loadup.el lisp/progmodes/gdb-ui.el lisp/simple.el lispref/ChangeLog man/ChangeLog man/frames.texi src/Makefile.in src/fileio.c src/lread.c src/macterm.c src/macterm.h src/xfns.c
diffstat 75 files changed, 2199 insertions(+), 1381 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri May 06 21:06:31 2005 +0000
+++ b/ChangeLog	Mon May 09 16:13:15 2005 +0000
@@ -1,3 +1,9 @@
+2005-05-07  J,Ai(Br,At(Bme Marant  <jerome@marant.org>
+
+	* make-dist: Remove references to makefile.nt and makefile.def.
+	Include widgets and images subdirectories of etc.  Do not exclude
+	ldefs-boot.el.
+
 2005-04-23  Andreas Schwab  <schwab@suse.de>
 
 	* configure.in: Remove duplicate match for powerpc configuration.
--- a/admin/FOR-RELEASE	Fri May 06 21:06:31 2005 +0000
+++ b/admin/FOR-RELEASE	Mon May 09 16:13:15 2005 +0000
@@ -91,6 +91,12 @@
 Please record your name here and say which part of the distribution
 you're going to handle.
 
+DIRECTORY		STATUS		IN CHARGE
+---------		------		---------
+lisp/international	working		Kenichi Handa
+lisp/languages		working		Kenichi Handa
+
+
 ** Update AUTHORS.
 
 ** Reorder NEWS entries.
--- a/etc/ChangeLog	Fri May 06 21:06:31 2005 +0000
+++ b/etc/ChangeLog	Mon May 09 16:13:15 2005 +0000
@@ -1,7 +1,6 @@
-2005-05-05  Marcelo Toledo  <marcelo@marcelotoledo.org>  (tiny change)
-
-        * TUTORIAL.pl: Updated header. Patch by Slawomir Nowaczyk
-        <slawek@cs.lth.se>.
+2005-05-05  Slawomir Nowaczyk  <slawek@cs.lth.se>  (tiny change)
+
+        * TUTORIAL.pl: Updated header.
 
 2005-05-02  Richard M. Stallman  <rms@gnu.org>
 
--- a/etc/NEWS	Fri May 06 21:06:31 2005 +0000
+++ b/etc/NEWS	Mon May 09 16:13:15 2005 +0000
@@ -36,7 +36,7 @@
 ---
 ** By default, Emacs now uses a setgid helper program to update game
 scores.  The directory ${localstatedir}/games/emacs is the normal
-place for game scores to be stored.  This may be controlled by the
+place for game scores to be stored.  You can control this with the
 configure option `--with-game-dir'.  The specific user that Emacs uses
 to own the game scores is controlled by `--with-game-user'.  If access
 to a game user is not available, then scores will be stored separately
@@ -121,6 +121,23 @@
 the blinking cursor on graphical terminals.
 
 +++
+** The option --script FILE runs Emacs in batch mode and loads FILE.
+It is useful for writing Emacs Lisp shell script files, because they
+can start with this line:
+
+   #!/usr/bin/emacs --script
+
++++
+** The option --directory DIR now modifies `load-path' immediately.
+Directories are added to the front of `load-path' in the order they
+appear on the command line.  For example, with this command line:
+
+  emacs -batch -L .. -L /tmp --eval "(require 'foo)"
+
+Emacs looks for library `foo' in the parent directory, then in /tmp, then
+in the other directories in `load-path'.  (-L is short for --directory.)
+
++++
 ** The command line option --no-windows has been changed to
 --no-window-system.  The old one still works, but is deprecated.
 
@@ -130,6 +147,11 @@
 an interactively callable function.
 
 +++
+** When you specify a frame size with --geometry, the size applies to
+all frames you create.  A position specified with --geometry only
+affects the initial frame.
+
++++
 ** Emacs can now be invoked in full-screen mode on a windowed display.
 When Emacs is invoked on a window system, the new command-line options
 `--fullwidth', `--fullheight', and `--fullscreen' produce a frame
@@ -164,6 +186,10 @@
 * Editing Changes in Emacs 22.1
 
 +++
+** The max size of buffers and integers has been doubled.
+On 32bit machines, it is now 256M (i.e. 268435455).
+
++++
 ** The mode line position information now comes before the major mode.
 When the file is maintained under version control, that information
 appears between the position information and the major mode.
@@ -234,7 +260,26 @@
 `beginning-of-defun', `end-of-defun' do not set the mark if the mark
 is already active in Transient Mark mode.
 
-** Mark Changes:
++++
+** `apply-macro-to-region-lines' now operates on all lines that begin
+in the region, rather than on all complete lines in the region.
+
++++
+** M-x setenv now expands environment variables of the form `$foo' and
+`${foo}' in the specified new value of the environment variable.  To
+include a `$' in the value, use `$$'.
+
++++
+** Unquoted `$' in file names do not signal an error any more when
+the corresponding environment variable does not exist.
+Instead, the `$ENVVAR' text is left as is, so that `$$' quoting
+is only rarely needed.
+
++++
+** The default for the paper size (variable ps-paper-type) is taken
+from the locale.
+
+** Mark command changes:
 
 +++
 *** A prefix argument is no longer required to repeat a jump to a
@@ -340,6 +385,10 @@
 clicking on mouse-sensitive areas or moving there and pressing RET.
 
 +++
+*** The command `list-text-properties-at' has been deleted because
+C-u C-x = gives the same information and more.
+
++++
 *** New command `display-local-help' displays any local help at point
 in the echo area.  It is bound to `C-h .'.  It normally displays the
 same string that would be displayed on mouse-over using the
@@ -353,37 +402,92 @@
 determined by the user option `help-at-pt-timer-delay' and defaults
 to one second.  This feature is turned off by default.
 
-** Buffer Menu changes
-
-+++
-*** New command `Buffer-menu-toggle-files-only' toggles display of file
-buffers only in the Buffer Menu.  It is bound to `T' in Buffer Menu
-mode.
-
-+++
-*** `buffer-menu' and `list-buffers' now list buffers whose names begin
-with a space, when those buffers are visiting files.  Normally buffers
-whose names begin with space are omitted.
-
----
-*** The new options `buffers-menu-show-directories' and
-`buffers-menu-show-status' let you control how buffers are displayed
-in the menu dropped down when you click "Buffers" from the menu bar.
-
-`buffers-menu-show-directories' controls whether the menu displays
-leading directories as part of the file name visited by the buffer.
-If its value is `unless-uniquify', the default, directories are
-shown unless uniquify-buffer-name-style' is non-nil.  The value of nil
-and t turn the display of directories off and on, respectively.
-
-`buffers-menu-show-status' controls whether the Buffers menu includes
-the modified and read-only status of the buffers.  By default it is
-t, and the status is shown.
-
-Setting these variables directly does not take effect until next time
-the Buffers menu is regenerated.
-
-** File Operation Changes:
++++
+*** The apropos commands now accept a list of words to match.
+When more than one word is specified, at least two of those words must
+be present for an item to match.  Regular expression matching is still
+available.
+
++++
+*** The new option `apropos-sort-by-scores' causes the matching items
+to be sorted according to their score.  The score for an item is a
+number calculated to indicate how well the item matches the words or
+regular expression that you entered to the apropos command.  The best
+match is listed first, and the calculated score is shown for each
+matching item.
+
+** Window selection changes:
+
++++
+*** `special-display-buffer-names' and `special-display-regexps' now
+understand two new boolean pseudo-frame-parameters `same-frame' and
+`same-window'.
+
+** Incremental Search changes:
+
++++
+*** Vertical scrolling is now possible within incremental search.
+To enable this feature, customize the new user option
+`isearch-allow-scroll'.  User written commands which satisfy stringent
+constraints can be marked as "scrolling commands".  See the Emacs manual
+for details.
+
++++
+*** C-w in incremental search now grabs either a character or a word,
+making the decision in a heuristic way.  This new job is done by the
+command `isearch-yank-word-or-char'.  To restore the old behavior,
+bind C-w to `isearch-yank-word' in `isearch-mode-map'.
+
++++
+*** C-y in incremental search now grabs the next line if point is already
+at the end of a line.
+
++++
+*** C-M-w deletes and C-M-y grabs a character in isearch mode.
+Another method to grab a character is to enter the minibuffer by `M-e'
+and to type `C-f' at the end of the search string in the minibuffer.
+
++++
+*** M-% typed in isearch mode invokes `query-replace' or
+`query-replace-regexp' (depending on search mode) with the current
+search string used as the string to replace.
+
++++
+*** Isearch no longer adds `isearch-resume' commands to the command
+history by default.  To enable this feature, customize the new
+user option `isearch-resume-in-command-history'.
+
+** Replace command changes:
+
+---
+*** New user option `query-replace-skip-read-only': when non-nil,
+`query-replace' and related functions simply ignore
+a match if part of it has a read-only property.
+
++++
+*** When used interactively, the commands `query-replace-regexp' and
+`replace-regexp' allow \,expr to be used in a replacement string,
+where expr is an arbitrary Lisp expression evaluated at replacement
+time.  In many cases, this will be more convenient than using
+`query-replace-regexp-eval'.  `\#' in a replacement string now refers
+to the count of replacements already made by the replacement command.
+All regular expression replacement commands now allow `\?' in the
+replacement string to specify a position where the replacement string
+can be edited for each replacement.
+
++++
+*** query-replace uses isearch lazy highlighting when the new user option
+`query-replace-lazy-highlight' is non-nil.
+
+---
+*** The current match in query-replace is highlighted in new face
+`query-replace' which by default inherits from isearch face.
+
+** File operation changes:
+
++++
+*** In processing a local variables list, Emacs strips the prefix and
+suffix are from every line before processing all the lines.
 
 +++
 *** find-file-read-only visits multiple files in read-only mode,
@@ -433,7 +537,7 @@
 
 +++
 *** If the user visits a file larger than `large-file-warning-threshold',
-Emacs prompts her for confirmation.
+Emacs asks for confirmation.
 
 +++
 *** require-final-newline now has two new possible values:
@@ -453,10 +557,6 @@
 So you can customize mode-require-final-newline to control what these
 modes do.
 
-+++
-** The max size of buffers and integers has been doubled.
-On 32bit machines, it is now 256M (i.e. 268435455).
-
 ** Minibuffer changes:
 
 +++
@@ -481,7 +581,7 @@
 parts is, by contrast, slightly highlighted.
 
 +++
-*** File-name completion can now ignore directories.
+*** File-name completion can now ignore specified directories.
 If an element of the list in `completion-ignored-extensions' ends in a
 slash `/', it indicates a subdirectory that should be ignored when
 completing file names.  Elements of `completion-ignored-extensions'
@@ -498,7 +598,7 @@
 If set to t when adding a new history element, all previous identical
 elements are deleted.
 
-** Redisplay Changes
+** Redisplay changes:
 
 *** Easy to overlook single character negation is now font-locked.
 You can use the new variable `font-lock-negation-char-face' and the face of
@@ -535,11 +635,6 @@
 vscroll property.
 
 +++
-*** In graphical mode, with a C program, GUD Tooltips have been extended to
-display the #define directive associated with an identifier when program is
-not executing.
-
-+++
 *** The new face `mode-line-inactive' is used to display the mode line
 of non-selected windows.  The `mode-line' face is now used to display
 the mode line of the currently selected window.
@@ -555,10 +650,9 @@
 set-fringe-style.
 
 +++
-*** The buffer boundaries (i.e. first and last line in the buffer) may
-now be marked with angle bitmaps in the fringes.  In addition, up and
-down arrow bitmaps may be shown at the top and bottom of the left or
-right fringe if the window can be scrolled in either direction.
+*** Angle icons in the fringes can indicate the buffer boundaries.  In
+addition, up and down arrow bitmaps in the fringe indicate which ways
+the window can be scrolled.
 
 This behavior is activated by setting the buffer-local variable
 `indicate-buffer-boundaries' to a non-nil value.  The default value of
@@ -567,8 +661,8 @@
 If value is `left' or `right', both angle and arrow bitmaps are
 displayed in the left or right fringe, resp.
 
-Value may also be an alist which specifies the presense and position
-of each bitmap individually.
+The value can also be an alist which specifies the presense and
+position of each bitmap individually.
 
 For example, ((top . left) (t .  right)) places the top angle bitmap
 in left fringe, the bottom angle bitmap in right fringe, and both
@@ -582,23 +676,23 @@
 Instead, the newline now "overflows" into the right fringe, and the
 cursor will be displayed in the fringe when positioned on that newline.
 
-The new user option 'overflow-newline-into-fringe' may be set to nil to
+The new user option 'overflow-newline-into-fringe' can be set to nil to
 revert to the old behavior of continuing such lines.
 
 +++
-*** When display margins are present in a window, the fringes are now
+*** When a window has display margin areas, the fringes are now
 displayed between the margins and the buffer's text area, rather than
-at the edges of the window.
-
-+++
-*** A window may now have individual fringe and scroll-bar settings,
+outside those margins.
+
++++
+*** A window can now have individual fringe and scroll-bar settings,
 in addition to the individual display margin settings.
 
 Such individual settings are now preserved when windows are split
 horizontally or vertically, a saved window configuration is restored,
 or when the frame is resized.
 
-** Cursor Display Changes
+** Cursor display changes:
 
 +++
 *** On X, MS Windows, and Mac OS, the blinking cursor's "off" state is
@@ -622,21 +716,37 @@
 *** The variable `cursor-in-non-selected-windows' can now be set to any
 of the recognized cursor types.
 
-+++
-** font-lock-lines-before specifies a number of lines before the
+** Font-Lock changes:
+
++++
+*** All modes now support using M-x font-lock-mode to toggle
+fontification, even those such as Occur, Info, and comint-derived
+modes that do their own fontification in a special way.
+
+The variable `Info-fontify' is no longer applicable; to disable
+fontification in Info, remove `turn-on-font-lock' from
+`Info-mode-hook'.
+
++++
+*** font-lock-lines-before specifies a number of lines before the
 current line that should be refontified when you change the buffer.
 The default value is 1.
 
----
-** JIT-lock changes
-
++++
+*** font-lock: in modes like C and Lisp where the fontification assumes that
+an open-paren in column 0 is always outside of any string or comment,
+font-lock now highlights any such open-paren-in-column-zero in bold-red
+if it is inside a string or a comment, to indicate that it can cause
+trouble with fontification and/or indentation.
+
+---
 *** The default settings for JIT stealth lock parameters are changed.
 The default value for the user option jit-lock-stealth-time is now 16
 instead of 3, and the default value of jit-lock-stealth-nice is now
 0.5 instead of 0.125.  The new defaults should lower the CPU usage
 when Emacs is fontifying in the background.
 
-
+---
 *** jit-lock can now be delayed with `jit-lock-defer-time'.
 
 If this variable is non-nil, its value should be the amount of Emacs
@@ -644,13 +754,14 @@
 example, if you set `jit-lock-defer-time' to 0.25, fontification will
 only happen after 0.25s of idle time.
 
+---
 *** contextual refontification is now separate from stealth fontification.
 
 jit-lock-defer-contextually is renamed jit-lock-contextually and
 jit-lock-context-time determines the delay after which contextual
 refontification takes place.
 
-** Menu Bar changes
+** Menu Bar changes:
 
 ---
 *** A menu item "Show/Hide" was added to the top-level menu "Options".
@@ -664,16 +775,10 @@
 ---
 *** Speedbar has moved from the "Tools" top level menu to "Show/Hide".
 
-+++
-** You can now customize fill-nobreak-predicate to control where
-filling can break lines.  The value is now normally a list of
-functions, but it can also be a single function, for compatibility.
-
-We provide two sample predicates, fill-single-word-nobreak-p and
-fill-french-nobreak-p, for use in the value of fill-nobreak-predicate.
-
-+++
-** New display feature: focus follows the mouse from one Emacs window
+** Mouse changes:
+
++++
+*** New display feature: focus follows the mouse from one Emacs window
 to another, even within a frame.  If you set the variable
 mouse-autoselect-window to non-nil value, moving the mouse to a
 different Emacs window will select that window (minibuffer window can
@@ -681,7 +786,7 @@
 feature is not enabled.
 
 +++
-** On X, when the window manager requires that you click on a frame to
+*** On X, when the window manager requires that you click on a frame to
 select it (give it focus), the selected window and cursor position
 normally changes according to the mouse click position.  If you set
 the variable x-mouse-click-focus-ignore-position to t, the selected
@@ -689,39 +794,16 @@
 to give it focus.
 
 +++
-** When you specify a frame size with --geometry, the size applies to
-all frames you create.  A position specified with --geometry only
-affects the initial frame.
-
-+++
-** `special-display-buffer-names' and `special-display-regexps' now
-understand two new boolean pseudo-frame-parameters `same-frame' and
-`same-window'.
-
----
-** New commands `scan-buf-next-region' and `scan-buf-previous-region'
-move to the start of the next (previous, respectively) region with
-non-nil help-echo property and display any help found there in the
-echo area, using `display-local-help'.
-
-+++
-** In processing a local variables list, Emacs strips the prefix and
-suffix are from every line before processing all the lines.
-
-+++
-** `apply-macro-to-region-lines' now operates on all lines that begin
-in the region, rather than on all complete lines in the region.
-
-+++
-** You can now follow links by clicking Mouse-1 on the link.
+*** You can now follow links by clicking Mouse-1 on the link.
 
 Traditionally, Emacs uses a Mouse-1 click to set point and a Mouse-2
 click to follow a link, whereas most other applications use a Mouse-1
 click for both purposes, depending on whether you click outside or
 inside a link.  Now the behavior of a Mouse-1 click has been changed
-to match this context-sentitive dual behavior.
-
-Depending on the current mode, a Mouse-2 click in Emacs may do much
+to match this context-sentitive dual behavior.  (If you prefer the old
+behavior, set the user option `mouse-1-click-follows-link' to nil.)
+
+Depending on the current mode, a Mouse-2 click in Emacs can do much
 more than just follow a link, so the new Mouse-1 behavior is only
 activated for modes which explicitly mark a clickable text as a "link"
 (see the new function `mouse-on-link-p' for details).  The Lisp
@@ -743,56 +825,43 @@
 `mouse-1-click-follows-link' and `mouse-1-click-in-non-selected-windows'.
 
 +++
-** Emacs normally highlights mouse sensitive text whenever the mouse
+*** Emacs normally highlights mouse sensitive text whenever the mouse
 is over the text.  By setting the new variable `mouse-highlight', you
 can optionally enable mouse highlighting only after you move the
 mouse, so that highlighting disappears when you press a key.  You can
 also disable mouse highlighting.
 
 +++
-** You can now customize if selecting a region by dragging the mouse
+*** You can now customize if selecting a region by dragging the mouse
 shall not copy the selected text to the kill-ring by setting the new
 variable mouse-drag-copy-region to nil.
 
 ---
-** mouse-wheels can now scroll a specific fraction of the window
+*** mouse-wheels can now scroll a specific fraction of the window
 (rather than a fixed number of lines) and the scrolling is `progressive'.
 
 ---
-** Unexpected yanking of text due to accidental clicking on the mouse
+*** Unexpected yanking of text due to accidental clicking on the mouse
 wheel button (typically mouse-2) during wheel scrolling is now avoided.
 This behavior can be customized via the mouse-wheel-click-event and
 mouse-wheel-inhibit-click-time variables.
 
 +++
-** Under X, mouse-wheel-mode is turned on by default.
-
-+++
-** M-x setenv now expands environment variables of the form `$foo' and
-`${foo}' in the specified new value of the environment variable.  To
-include a `$' in the value, use `$$'.
-
-+++
-** Unquoted `$' in file names do not signal an error any more when
-the corresponding environment variable does not exist.
-Instead, the `$ENVVAR' text is left as is, so that `$$' quoting
-is only rarely needed.
-
----
-** Language environment and various default coding systems are setup
+*** Under X, mouse-wheel-mode is turned on by default.
+
+** Mule changes:
+
+---
+*** Language environment and various default coding systems are setup
 more correctly according to the current locale name.  If the locale
 name doesn't specify a charset, the default is what glibc defines.
-This change may result in using the different coding systems as
+This change can result in using the different coding systems as
 default in some locale (e.g. vi_VN).
 
 +++
-** The default for the paper size (variable ps-paper-type) is taken
-from the locale.
-
-+++
-** The keyboard-coding-system is now automatically set based on your
+*** The keyboard-coding-system is now automatically set based on your
 current locale settings if you are not using a window system.  This
-may mean that the META key doesn't work but generates non-ASCII
+can mean that the META key doesn't work but generates non-ASCII
 characters instead, depending on how the terminal (or terminal
 emulator) works.  Use `set-keyboard-coding-system' (or customize
 keyboard-coding-system) if you prefer META to work (the old default)
@@ -800,33 +869,33 @@
 by the keyboard.  See Info node `Single-Byte Character Support'.
 
 +++
-** The new command `revert-buffer-with-coding-system' (C-x RET r)
+*** The new command `revert-buffer-with-coding-system' (C-x RET r)
 revisits the current file using a coding system that you specify.
 
 +++
-** New command `recode-region' decodes the region again by a specified
+*** New command `recode-region' decodes the region again by a specified
 coding system.
 
 +++
-** The new command `recode-file-name' changes the encoding of the name
+*** The new command `recode-file-name' changes the encoding of the name
 of a file.
 
 ---
-** New command `ucs-insert' inserts a character specified by its
+*** New command `ucs-insert' inserts a character specified by its
 unicode.
 
 +++
-** The new command `set-file-name-coding-system' (C-x RET F) sets
+*** The new command `set-file-name-coding-system' (C-x RET F) sets
 coding system for encoding and decoding file names.  A new menu item
 (Options->Mule->Set Coding Systems->For File Name) invokes this
 command.
 
 +++
-** New command quail-show-key shows what key (or key sequence) to type
+*** New command quail-show-key shows what key (or key sequence) to type
 in the current input method to input a character at point.
 
 +++
-** Limited support for character `unification' has been added.
+*** Limited support for character `unification' has been added.
 Emacs now knows how to translate between different representations of
 the same characters in various Emacs charsets according to standard
 Unicode mappings.  This applies mainly to characters in the ISO 8859
@@ -846,20 +915,20 @@
 will often effectively clobber data with an iso-2022 encoding.
 
 ---
-** There is support for decoding Greek and Cyrillic characters into
+*** There is support for decoding Greek and Cyrillic characters into
 either Unicode (the mule-unicode charsets) or the iso-8859 charsets,
 when possible.  The latter are more space-efficient.  This is
 controlled by user option utf-fragment-on-decoding.
 
 ---
-** New language environments: French, Ukrainian, Tajik,
+*** New language environments: French, Ukrainian, Tajik,
 Bulgarian, Belarusian, Ukrainian, UTF-8, Windows-1255, Welsh, Latin-6,
 Latin-7, Lithuanian, Latvian, Swedish, Slovenian, Croatian, Georgian,
 Italian, Russian, Malayalam, Tamil, Russian, Chinese-EUC-TW.  (Set up
 automatically according to the locale.)
 
 ---
-** New input methods: latin-alt-postfix, latin-postfix, latin-prefix,
+*** New input methods: latin-alt-postfix, latin-postfix, latin-prefix,
 ukrainian-computer, belarusian, bulgarian-bds, russian-computer,
 vietnamese-telex, lithuanian-numeric, lithuanian-keyboard,
 latvian-keyboard, welsh, georgian, rfc1345, ucs, sgml,
@@ -867,11 +936,11 @@
 tamil-inscript.
 
 ---
-** New input method chinese-sisheng for inputting Chinese Pinyin
+*** New input method chinese-sisheng for inputting Chinese Pinyin
 characters.
 
 ---
-** Improved Thai support.  A new minor mode `thai-word-mode' (which is
+*** Improved Thai support.  A new minor mode `thai-word-mode' (which is
 automatically activated if you select Thai as a language
 environment) changes key bindings of most word-oriented commands to
 versions which recognize Thai words.  Affected commands are
@@ -883,17 +952,17 @@
     M-q     (fill-paragraph)
 
 ---
-** Indian support has been updated.
+*** Indian support has been updated.
 The in-is13194 coding system is now Unicode-based.  CDAC fonts are
 assumed.  There is a framework for supporting various
 Indian scripts, but currently only Devanagari, Malayalam and Tamil are
 supported.
 
 ---
-** A UTF-7 coding system is available in the library `utf-7'.
-
----
-** The utf-8/16 coding systems have been enhanced.
+*** A UTF-7 coding system is available in the library `utf-7'.
+
+---
+*** The utf-8/16 coding systems have been enhanced.
 By default, untranslatable utf-8 sequences are simply composed into
 single quasi-characters.  User option `utf-translate-cjk-mode' (it is
 turned on by default) arranges to translate many utf-8 CJK character
@@ -907,12 +976,12 @@
 The utf-16 coding system is affected similarly.
 
 ---
-** A new coding system `euc-tw' has been added for traditional Chinese
+*** A new coding system `euc-tw' has been added for traditional Chinese
 in CNS encoding; it accepts both Big 5 and CNS as input; on saving,
 Big 5 is then converted to CNS.
 
 ---
-** Many new coding systems are available by loading the `code-pages'
+*** Many new coding systems are available by loading the `code-pages'
 library.  These include complete versions of most of those in
 codepage.el, based on Unicode mappings.  `codepage-setup' is now
 obsolete and is used only in the MS-DOS port of Emacs.  windows-1252
@@ -920,82 +989,24 @@
 latter is used by GNU locales.
 
 ---
-** New variable `utf-translate-cjk-unicode-range' controls which
+*** New variable `utf-translate-cjk-unicode-range' controls which
 Unicode characters to translate in `utf-translate-cjk-mode'.
 
 ---
-** iso-10646-1 (`Unicode') fonts can be used to display any range of
+*** iso-10646-1 (`Unicode') fonts can be used to display any range of
 characters encodable by the utf-8 coding system.  Just specify the
 fontset appropriately.
 
-+++
-** Vertical scrolling is now possible within incremental search.
-To enable this feature, customize the new user option
-`isearch-allow-scroll'.  User written commands which satisfy stringent
-constraints can be marked as "scrolling commands".  See the Emacs manual
-for details.
-
-+++
-** C-w in incremental search now grabs either a character or a word,
-making the decision in a heuristic way.  This new job is done by the
-command `isearch-yank-word-or-char'.  To restore the old behavior,
-bind C-w to `isearch-yank-word' in `isearch-mode-map'.
-
-+++
-** C-y in incremental search now grabs the next line if point is already
-at the end of a line.
-
-+++
-** C-M-w deletes and C-M-y grabs a character in isearch mode.
-Another method to grab a character is to enter the minibuffer by `M-e'
-and to type `C-f' at the end of the search string in the minibuffer.
-
-+++
-** M-% typed in isearch mode invokes `query-replace' or
-`query-replace-regexp' (depending on search mode) with the current
-search string used as the string to replace.
-
-+++
-** Isearch no longer adds `isearch-resume' commands to the command
-history by default.  To enable this feature, customize the new
-user option `isearch-resume-in-command-history'.
-
----
-** New user option `query-replace-skip-read-only': when non-nil,
-`query-replace' and related functions simply ignore
-a match if part of it has a read-only property.
-
-+++
-** When used interactively, the commands `query-replace-regexp' and
-`replace-regexp' allow \,expr to be used in a replacement string,
-where expr is an arbitrary Lisp expression evaluated at replacement
-time.  In many cases, this will be more convenient than using
-`query-replace-regexp-eval'.  `\#' in a replacement string now refers
-to the count of replacements already made by the replacement command.
-All regular expression replacement commands now allow `\?' in the
-replacement string to specify a position where the replacement string
-can be edited for each replacement.
-
-+++
-** query-replace uses isearch lazy highlighting when the new user option
-`query-replace-lazy-highlight' is non-nil.
-
----
-** The current match in query-replace is highlighted in new face
-`query-replace' which by default inherits from isearch face.
-
-+++
-** M-x compare-windows now can automatically skip non-matching text to
-resync points in both windows.
-
-+++
-** The commands M-x customize-face and M-x customize-face-other-window
+** Customize changes:
+
++++
+*** The commands M-x customize-face and M-x customize-face-other-window
 now look at the character after point.  If a face or faces are
 specified for that character, the commands by default customize those
 faces.
 
 ---
-** The face-customization widget has been reworked to be less confusing.
+*** The face-customization widget has been reworked to be less confusing.
 In particular, when you enable a face attribute using the corresponding
 check-box, there's no longer a redundant `*' option in value selection
 for that attribute; the values you can choose are only those which make
@@ -1004,11 +1015,41 @@
 case you re-select the attribute) value is hidden.
 
 +++
-** When you set or reset a variable's value in a Customize buffer,
+*** When you set or reset a variable's value in a Customize buffer,
 the previous value becomes the "backup value" of the variable.
 You can go back to that backup value by selecting "Use Backup Value"
 under the "[State]" button.
 
+** Buffer Menu changes:
+
++++
+*** New command `Buffer-menu-toggle-files-only' toggles display of file
+buffers only in the Buffer Menu.  It is bound to `T' in Buffer Menu
+mode.
+
++++
+*** `buffer-menu' and `list-buffers' now list buffers whose names begin
+with a space, when those buffers are visiting files.  Normally buffers
+whose names begin with space are omitted.
+
+---
+*** The new options `buffers-menu-show-directories' and
+`buffers-menu-show-status' let you control how buffers are displayed
+in the menu dropped down when you click "Buffers" from the menu bar.
+
+`buffers-menu-show-directories' controls whether the menu displays
+leading directories as part of the file name visited by the buffer.
+If its value is `unless-uniquify', the default, directories are
+shown unless uniquify-buffer-name-style' is non-nil.  The value of nil
+and t turn the display of directories off and on, respectively.
+
+`buffers-menu-show-status' controls whether the Buffers menu includes
+the modified and read-only status of the buffers.  By default it is
+t, and the status is shown.
+
+Setting these variables directly does not take effect until next time
+the Buffers menu is regenerated.
+
 ** Dired mode:
 
 ---
@@ -1037,36 +1078,23 @@
 into the kill ring.  With a zero prefix arg, copies absolute file names.
 
 +++
-** The variables dired-free-space-program and dired-free-space-args
+*** In Dired-x, Omitting files is now a minor mode, dired-omit-mode.
+
+The mode toggling command is bound to M-o.  A new command
+dired-mark-omitted, bound to * O, marks omitted files.  The variable
+dired-omit-files-p is obsoleted, use the mode toggling function
+instead.
+
++++
+*** The variables dired-free-space-program and dired-free-space-args
 have been renamed to directory-free-space-program and
 directory-free-space-args, and they now apply whenever Emacs puts a
 directory listing into a buffer.
 
-+++
-** Dired-x:
-
-+++
-*** Omitting files is now a minor mode, dired-omit-mode.  The mode toggling
-command is bound to M-o.  A new command dired-mark-omitted, bound to * O,
-marks omitted files.  The variable dired-omit-files-p is obsoleted, use the
-mode toggling function instead.
-
-+++
-** In Outline mode, hide-body no longer hides lines at the top
-of the file that precede the first header line.
-
-+++
-** Occur, Info, and comint-derived modes now support using
-M-x font-lock-mode to toggle fontification.  The variable
-`Info-fontify' is no longer applicable; to disable fontification,
-remove `turn-on-font-lock' from `Info-mode-hook'.
-
----
-** The terminal emulation code in term.el has been improved, it can
-run most curses applications now.
-
----
-** The comint prompt can now be made read-only, using the new user
+** Comint changes:
+
+---
+*** The comint prompt can now be made read-only, using the new user
 option `comint-prompt-read-only'.  This is not enabled by default,
 except in IELM buffers.  The read-only status of IELM prompts can be
 controlled with the new user option `ielm-prompt-read-only', which
@@ -1088,20 +1116,19 @@
 kill-ring, but does not delete it.
 
 +++
-** The new command `comint-insert-previous-argument' in comint-derived
+*** The new command `comint-insert-previous-argument' in comint-derived
 modes (shell-mode etc) inserts arguments from previous command lines,
 like bash's `ESC .' binding.  It is bound by default to `C-c .', but
 otherwise behaves quite similarly to the bash version.
 
-** `comint-use-prompt-regexp-instead-of-fields' has been renamed
+*** `comint-use-prompt-regexp-instead-of-fields' has been renamed
 `comint-use-prompt-regexp'.  The old name has been kept as an alias,
 but declared obsolete.
 
-+++
-** Telnet now prompts you for a port number with C-u M-x telnet.
-
----
-** M-x compile has become more robust and reliable
+** M-x Compile changes:
+
+---
+*** M-x compile has become more robust and reliable
 
 Quite a few more kinds of messages are recognized.  Messages that are
 recognized as warnings or informational come in orange or green, instead of
@@ -1120,8 +1147,6 @@
 
 The new file etc/compilation.txt gives examples of each type of message.
 
-** Compilation mode enhancements:
-
 +++
 *** New user option `compilation-environment'.
 This option allows you to specify environment variables for inferior
@@ -1129,19 +1154,47 @@
 subprocesses inherit.
 
 +++
+*** New options `next-error-highlight' and `next-error-highlight-no-select'
+specify the method of highlighting of the corresponding source line
+in new face `next-error'.
+
++++
+*** A new minor mode `next-error-follow-minor-mode' can be used in
+compilation-mode, grep-mode, occur-mode, and diff-mode (i.e. all the
+modes that can use `next-error').  In this mode, cursor motion in the
+buffer causes automatic display in another window of the corresponding
+matches, compilation errors, etc.  This minor mode can be toggled with
+C-c C-f.
+
+** Occur mode changes:
+
++++
+*** In the *Occur* buffer, `o' switches to it in another window, and
+C-o displays the current line's occurrence in another window without
+switching to it.
+
++++
+*** You can now use next-error (C-x `) and previous-error to advance to
+the next/previous matching line found by M-x occur.
+
++++
+*** The new command `multi-occur' is just like `occur', except it can
+search multiple buffers.  There is also a new command
+`multi-occur-by-filename-regexp' which allows you to specify the
+buffers to search by their filename.  Internally, Occur mode has been
+rewritten, and now uses font-lock, among other changes.
+
++++
 ** Grep has been decoupled from compilation mode setup.
 
----
-*** There's a new separate package grep.el.
-
----
-*** M-x grep has been adapted to new compile
+There's a new separate package grep.el, with its own submenu and
+customization group.
+
+---
+*** M-x grep provides highlighting support.
 
 Hits are fontified in green, and hits in binary files in orange.  Grep buffers
-can be saved and automatically revisited with the new Grep mode.
-
----
-*** Grep commands now have their own submenu and customization group.
+can be saved and automatically revisited.
 
 +++
 *** `grep-find' is now also available under the name `find-grep' where
@@ -1149,8 +1202,8 @@
 
 ---
 *** The new variables `grep-window-height', `grep-auto-highlight', and
-`grep-scroll-output' can be used to override the corresponding
-compilation mode settings for grep commands.
+`grep-scroll-output' override the corresponding compilation mode
+settings, for grep commands only.
 
 +++
 *** New option `grep-highlight-matches' highlightes matches in *grep*
@@ -1170,70 +1223,17 @@
 file.
 
 +++
-** M-x grep now tries to avoid appending `/dev/null' to the command line
+*** M-x grep now tries to avoid appending `/dev/null' to the command line
 by using GNU grep `-H' option instead.  M-x grep automatically
 detects whether this is possible or not the first time it is invoked.
 When `-H' is used, the grep command line supplied by the user is passed
 unchanged to the system to execute, which allows more complicated
 command lines to be used than was possible before.
 
-+++
-** New options `next-error-highlight' and `next-error-highlight-no-select'
-specify the method of highlighting of the corresponding source line
-in new face `next-error'.
-
-+++
-** A new minor mode `next-error-follow-minor-mode' can be used in
-compilation-mode, grep-mode, occur-mode, and diff-mode (i.e. all the
-modes that can use `next-error').  In this mode, cursor motion in the
-buffer causes automatic display in another window of the corresponding
-matches, compilation errors, etc.  This minor mode can be toggled with
-C-c C-f.
-
-+++
-** M-x diff uses diff-mode instead of compilation-mode.
-
-+++
-** In the *Occur* buffer, `o' switches to it in another window, and
-C-o displays the current line's occurrence in another window without
-switching to it.
-
-+++
-** You can now use next-error (C-x `) and previous-error to advance to
-the next/previous matching line found by M-x occur.
-
-+++
-** The new command `multi-occur' is just like `occur', except it can
-search multiple buffers.  There is also a new command
-`multi-occur-by-filename-regexp' which allows you to specify the
-buffers to search by their filename.  Internally, Occur mode has been
-rewritten, and now uses font-lock, among other changes.
-
-+++
-** font-lock: in modes like C and Lisp where the fontification assumes that
-an open-paren in column 0 is always outside of any string or comment,
-font-lock now highlights any such open-paren-in-column-zero in bold-red
-if it is inside a string or a comment, to indicate that it can cause
-trouble with fontification and/or indentation.
-
-** Enhancements to apropos commands:
-
-+++
-*** The apropos commands now accept a list of words to match.
-When more than one word is specified, at least two of those words must
-be present for an item to match.  Regular expression matching is still
-available.
-
-+++
-*** The new option `apropos-sort-by-scores' causes the matching items
-to be sorted according to their score.  The score for an item is a
-number calculated to indicate how well the item matches the words or
-regular expression that you entered to the apropos command.  The best
-match is listed first, and the calculated score is shown for each
-matching item.
-
-+++
-** You can have several Emacs servers on the same machine.
+** Emacs server changes:
+
++++
+*** You can have several Emacs servers on the same machine.
 
 	% emacs --eval '(setq server-name "foo")' -f server-start &
 	% emacs --eval '(setq server-name "bar")' -f server-start &
@@ -1241,17 +1241,12 @@
 	% emacsclient -s bar file2
 
 +++
-** The `emacsclient' command understands the options `--eval' and
+*** The `emacsclient' command understands the options `--eval' and
 `--display' which tell Emacs respectively to evaluate the given elisp
 expression and to use the given display when visiting files.
 
 +++
-** User option `server-mode' can be used to start a server process.
-
-+++
-** New user option `add-log-always-start-new-record'.
-When this option is enabled, M-x add-change-log-entry always
-starts a new record regardless of when the last record is.
+*** User option `server-mode' can be used to start a server process.
 
 ** Menu support:
 
@@ -1284,7 +1279,7 @@
     (setq x-meta-keysym 'alt)
 
 +++
-*** The X resource useXIM can be used to turn off use of XIM, which may
+*** The X resource useXIM can be used to turn off use of XIM, which can
 speed up Emacs with slow networking to the X server.
 
 If the configure option `--without-xim' was used to turn off use of
@@ -1315,7 +1310,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 Gtk+ version 2.4, 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.
 
@@ -1333,7 +1328,7 @@
 These key bindings work on xterm from X.org 6.8, they might not work on
 some older versions of xterm, or on some proprietary versions.
 
-** Changes in support of colors on character terminals
+** Character terminal color support changes:
 
 +++
 *** The new command-line option --color=MODE lets you specify a standard
@@ -1362,10 +1357,12 @@
 
 ---
 *** There's a new support for colors on `rxvt' terminal emulator.
-
----
-** M-x view-file and commands that use it now avoid interfering
-with special modes such as Tar mode.
+
+* New modes and packages in Emacs 22.1
+
++++
+** New package benchmark.el contains simple support for convenient
+timing measurements of code (including the garbage collection component).
 
 +++
 ** Filesets are collections of files.  You can define a fileset in
@@ -1376,23 +1373,6 @@
 all the files in it, such as visiting them or searching and replacing
 in them.
 
----
-** Commands winner-redo and winner-undo, from winner.el, are now bound to
-C-c <left> and C-c <right>, respectively.  This is an incompatible change.
-
----
-** global-whitespace-mode is a new alias for whitespace-global-mode.
-
-+++
-** The command `list-text-properties-at' has been deleted because
-C-u C-x = gives the same information and more.
-
-* New modes and packages in Emacs 22.1
-
-+++
-** New package benchmark.el contains simple support for convenient
-timing measurements of code (including the garbage collection component).
-
 +++
 ** Calc is now part of the Emacs distribution.
 
@@ -1450,7 +1430,7 @@
 
 The features of cua also works with the standard emacs bindings for
 kill, copy, yank, and undo.  If you want to use cua mode, but don't
-want the C-x, C-c, C-v, and C-z bindings, you may customize the
+want the C-x, C-c, C-v, and C-z bindings, you can customize the
 `cua-enable-cua-keys' variable.
 
 Note: This version of cua mode is not backwards compatible with older
@@ -1468,7 +1448,7 @@
 filenames being entered by the user in the minibuffer are displayed, so
 that it's clear when part of the entered filename will be ignored due to
 emacs' filename parsing rules.  The ignored portion can be made dim,
-invisible, or otherwise less visually noticable.  The display method may
+invisible, or otherwise less visually noticable.  The display method can
 be displayed by customizing the variable `file-name-shadow-properties'.
 
 +++
@@ -1481,16 +1461,6 @@
 ---
 ** GDB-Script-mode is used for files like .gdbinit.
 
-+++
-** The new package gdb-ui.el provides an enhanced graphical interface to
-GDB. You can interact with GDB through the GUD buffer in the usual way, but
-there are also further buffers which control the execution and describe the
-state of your program.  It separates the input/output of your program from
-that of GDB and watches expressions in the speedbar.  It also uses features of
-Emacs 21 such as the display margin for breakpoints, and the toolbar.
-
-Use M-x gdba to start GDB-UI.
-
 ---
 ** The new package ibuffer provides a powerful, completely
 customizable replacement for buff-menu.el.
@@ -1577,12 +1547,6 @@
 similar to Refill mode, but more reliable.  To turn the word wrap
 feature off, set `longlines-auto-wrap' to nil.
 
----
-** The old Octave mode bindings C-c f and C-c i have been changed
-to C-c C-f and C-c C-i.  The C-c C-i subcommands now have duplicate
-bindings on control characters--thus, C-c C-i C-b is the same as
-C-c C-i b, and so on.
-
 ** The printing package is now part of the Emacs distribution.
 
 If you enable the printing package by including (require 'printing) in
@@ -1671,6 +1635,48 @@
 * Changes in specialized modes and packages:
 
 +++
+** In Outline mode, hide-body no longer hides lines at the top
+of the file that precede the first header line.
+
++++
+** Telnet now prompts you for a port number with C-u M-x telnet.
+
+---
+** The terminal emulation code in term.el has been improved, it can
+run most curses applications now.
+
++++
+** M-x diff uses diff-mode instead of compilation-mode.
+
++++
+** You can now customize fill-nobreak-predicate to control where
+filling can break lines.  The value is now normally a list of
+functions, but it can also be a single function, for compatibility.
+
+We provide two sample predicates, fill-single-word-nobreak-p and
+fill-french-nobreak-p, for use in the value of fill-nobreak-predicate.
+
+---
+** M-x view-file and commands that use it now avoid interfering
+with special modes such as Tar mode.
+
+---
+** Commands winner-redo and winner-undo, from winner.el, are now bound to
+C-c <left> and C-c <right>, respectively.  This is an incompatible change.
+
+---
+** global-whitespace-mode is a new alias for whitespace-global-mode.
+
++++
+** M-x compare-windows now can automatically skip non-matching text to
+resync points in both windows.
+
++++
+** New user option `add-log-always-start-new-record'.
+When this option is enabled, M-x add-change-log-entry always
+starts a new record regardless of when the last record is.
+
++++
 ** There is a new user option `mail-default-directory' that allows you
 to specify the value of `default-directory' for mail buffers.  This
 directory is used for auto-save files of mail buffers.  It defaults to
@@ -2060,6 +2066,12 @@
 ---
 ** Perl mode has a new variable `perl-indent-continued-arguments'.
 
+---
+** The old Octave mode bindings C-c f and C-c i have been changed
+to C-c C-f and C-c C-i.  The C-c C-i subcommands now have duplicate
+bindings on control characters--thus, C-c C-i C-b is the same as
+C-c C-i b, and so on.
+
 ** Fortran mode changes:
 
 ---
@@ -2184,6 +2196,24 @@
 *** GUD mode has its own tool bar for controlling execution of the inferior
 and other common debugger commands.
 
++++
+*** The new package gdb-ui.el provides an enhanced graphical interface to
+GDB. You can interact with GDB through the GUD buffer in the usual way, but
+there are also further buffers which control the execution and describe the
+state of your program.  It separates the input/output of your program from
+that of GDB and watches expressions in the speedbar.  It also uses features of
+Emacs 21 such as the display margin for breakpoints, and the toolbar.
+
+Use M-x gdba to start GDB-UI.
+
+*** GUD tooltips can be toggled independently of normal tooltips
+with the minor mode, gud-tooltip-mode.
+
++++
+*** In graphical mode, with a C program, GUD Tooltips have been extended to
+display the #define directive associated with an identifier when program is
+not executing.
+
 ---
 ** GUD mode improvements for jdb:
 
@@ -2236,7 +2266,7 @@
 displayed at the end of a file buffer in any window, it stays at
 the end of the buffer in that window.  This allows to tail a file:
 just put point at the end of the buffer and it stays there.  This
-rule applies to file buffers.  For non-file buffers, the behavior may
+rule applies to file buffers.  For non-file buffers, the behavior can
 be mode dependent.
 
 If you are sure that the file will only change by growing at the end,
@@ -2487,6 +2517,19 @@
 "checkout", "update" or "commit".  That means using cvs diff options
 -rBASE -rHEAD.
 
+** Rmail changes:
+
+---
+*** Rmail now displays 5-digit message ids in its summary buffer.
+
++++
+*** Support for `movemail' from GNU mailutils was added to Rmail.
+This version of `movemail' allows to read mail from a wide range of
+mailbox formats, including remote POP3 and IMAP4 mailboxes with or
+without TLS encryption.  If GNU mailutils is installed on the system
+and its version of `movemail' can be found in exec-path, it will be
+used instead of the native one.
+
 ** Gnus package
 
 ---
@@ -2499,17 +2542,6 @@
 See the file GNUS-NEWS or the node "Oort Gnus" in the Gnus manual for details.
 
 ---
-** Rmail now displays 5-digit message ids in its summary buffer.
-
-+++
-** Support for `movemail' from GNU mailutils was added to Rmail.
-This version of `movemail' allows to read mail from a wide range of
-mailbox formats, including remote POP3 and IMAP4 mailboxes with or
-without TLS encryption.  If GNU mailutils is installed on the system
-and its version of `movemail' can be found in exec-path, it will be
-used instead of the native one.
-
----
 ** MH-E changes.
 
 Upgraded to MH-E version 7.82. There have been major changes since
@@ -2839,22 +2871,17 @@
 
 * Lisp Changes in Emacs 22.1
 
-+++
-** The option --script FILE runs Emacs in batch mode and loads FILE.
-It is useful for writing Emacs Lisp shell script files, because they
-can start with this line:
-
-   #!/usr/bin/emacs --script
-
-+++
-** The option --directory DIR now modifies `load-path' immediately.
-Directories are added to the front of `load-path' in the order they
-appear on the command line.  For example, with this command line:
-
-  emacs -batch -L .. -L /tmp --eval "(require 'foo)"
-
-Emacs looks for library `foo' in the parent directory, then in /tmp, then
-in the other directories in `load-path'.  (-L is short for --directory.)
+** New function `locate-file' searches for a file in a list of directories.
+`locate-file' accepts a name of a file to search (a string), and two
+lists: a list of directories to search in and a list of suffixes to
+try; typical usage might use `exec-path' and `load-path' for the list
+of directories, and `exec-suffixes' and `load-suffixes' for the list
+of suffixes.  The function also accepts a predicate argument to
+further filter candidate files.
+
+One advantage of using this function is that the list of suffixes in
+`exec-suffixes' is OS-dependant, so this function will find
+executables without polluting Lisp code with OS dependancies.
 
 +++
 ** The default value of `sentence-end' is now defined using the new
@@ -2931,7 +2958,7 @@
 and does not return t for keyboard macros.
 
 +++
-** An interactive specification may now use the code letter 'U' to get
+** An interactive specification can now use the code letter 'U' to get
 the up-event that was discarded in case the last key sequence read for a
 previous 'k' or 'K' argument was a down-event; otherwise nil is used.
 
@@ -3184,7 +3211,7 @@
 a command to present progress messages for the user.
 
 +++
-** New `yank-handler' text property may be used to control how
+** New `yank-handler' text property can be used to control how
 previously killed text on the kill-ring is reinserted.
 
 The value of the yank-handler property must be a list with one to four
@@ -3209,7 +3236,7 @@
   If UNDO is present and non-nil, it is a function that will be called
 by `yank-pop' to undo the insertion of the current object.  It is
 called with two arguments, the start and end of the current region.
-FUNCTION may set `yank-undo-function' to override the UNDO value.
+FUNCTION can set `yank-undo-function' to override the UNDO value.
 
 *** The functions kill-new, kill-append, and kill-region now have an
 optional argument to specify the yank-handler text property to put on
@@ -3228,7 +3255,7 @@
 
 *** The new function insert-for-yank normally works like `insert', but
 removes the text properties in the `yank-excluded-properties' list.
-However, the insertion of the text may be modified by a `yank-handler'
+However, the insertion of the text can be modified by a `yank-handler'
 text property.
 
 +++
@@ -3321,7 +3348,7 @@
 - A server can open on a random port using :service t arg.
 - Local sockets are supported using :family 'local arg.
 - Non-blocking connect is supported using :nowait t arg.
-- The process' property list may be initialized using :plist PLIST arg;
+- The process' property list can be initialized using :plist PLIST arg;
   a copy of the server process' property list is automatically inherited
   by new client processes created to handle incoming connections.
 
@@ -3399,7 +3426,7 @@
 ** The line-move, scroll-up, and scroll-down functions will now
 modify the window vscroll to scroll through display rows that are
 taller that the height of the window, for example in the presense of
-large images.  To disable this feature, Lisp code may bind the new
+large images.  To disable this feature, Lisp code can bind the new
 variable `auto-window-vscroll' to nil.
 
 +++
@@ -3460,7 +3487,7 @@
 To change a built-in bitmap, do (require 'fringe) and use the symbol
 identifing the bitmap such as `left-truncation or `continued-line'.
 
-*** New function 'destroy-fringe-bitmap' may be used to destroy a
+*** New function 'destroy-fringe-bitmap' can be used to destroy a
 previously created bitmap, or restore a built-in bitmap.
 
 *** New function 'set-fringe-bitmap-face' can now be used to set a
@@ -3543,7 +3570,7 @@
 varibles which contain overlay arrow position markers, including
 the original `overlay-arrow-position' variable.
 
-Each variable on this list may have individual `overlay-arrow-string'
+Each variable on this list can have individual `overlay-arrow-string'
 and `overlay-arrow-bitmap' properties that specify an overlay arrow
 string (for non-window terminals) or fringe bitmap (for window
 systems) to display at the corresponding overlay arrow position.
@@ -3553,7 +3580,7 @@
 +++
 ** New line-height and line-spacing properties for newline characters
 
-A newline may now have line-height and line-spacing text or overlay
+A newline can now have line-height and line-spacing text or overlay
 properties that control the height of the corresponding display row.
 
 If the line-height property value is t, the newline does not
@@ -3588,11 +3615,11 @@
 overrides the default frame line-spacing and any buffer local value of
 the line-spacing variable.
 
-If the line-spacing property may be a float or cons, the line spacing
+If the line-spacing property is a float or cons, the line spacing
 is calculated as specified above for the line-height property.
 
 +++
-** The buffer local line-spacing variable may now have a float value,
+** The buffer local line-spacing variable can now have a float value,
 which is used as a height relative to the default frame line height.
 
 +++
@@ -3655,7 +3682,7 @@
 +++
 ** Support for displaying image slices
 
-*** New display property (slice X Y WIDTH HEIGHT) may be used with
+*** New display property (slice X Y WIDTH HEIGHT) can be used with
 an image property to display only a specific slice of the image.
 
 *** Function insert-image has new optional fourth arg to
@@ -3665,15 +3692,15 @@
 specified number of evenly sized slices (rows x columns).
 
 +++
-** Images may now have an associated image map via the :map property.
+** Images can now have an associated image map via the :map property.
 
 An image map is an alist where each element has the format (AREA ID PLIST).
 An AREA is specified as either a rectangle, a circle, or a polygon:
-A rectangle is a cons (rect . ((x0 . y0) . (x1 . y1))) specifying the
+A rectangle is a cons (rect . ((X0 . Y0) . (X1 . Y1))) specifying the
 pixel coordinates of the upper left and bottom right corners.
-A circle is a cons (circle . ((x0 . y0) . r)) specifying the center
-and the radius of the circle; r may be a float or integer.
-A polygon is a cons (poly . [x0 y0 x1 y1 ...]) where each pair in the
+A circle is a cons (circle . ((X0 . Y0) . R)) specifying the center
+and the radius of the circle; R can be a float or integer.
+A polygon is a cons (poly . [X0 Y0 X1 Y1 ...]) where each pair in the
 vector describes one corner in the polygon.
 
 When the mouse pointer is above a hot-spot area of an image, the
@@ -3705,7 +3732,7 @@
 function used by the new `mouse-1-click-follows-link' functionality.
 
 +++
-** The mouse pointer shape over ordinary text or images may now be
+** The mouse pointer shape over ordinary text or images can now be
 controlled/overriden via the `pointer' text property.
 
 ** Mouse event enhancements:
@@ -3739,7 +3766,7 @@
 *** New function `posn-actual-col-row' returns actual glyph coordinates.
 
 +++
-*** Mouse events may now include image object in addition to string object.
+*** Mouse events can now include image object in addition to string object.
 
 +++
 *** Mouse events include relative x and y pixel coordinates relative to
@@ -3769,7 +3796,7 @@
 +++
 ** Normally, the cursor is displayed at the end of any overlay and
 text property string that may be present at the current window
-position.  The cursor may now be placed on any character of such
+position.  The cursor can now be placed on any character of such
 strings by giving that character a non-nil `cursor' text property.
 
 +++
@@ -3815,10 +3842,10 @@
 a font to display the character set that CHAR belongs to.
 
 Fontsets can specify a font on a per-character basis; when the fontset
-does that, this value may not be accurate.
-
-+++
-** New function display-supports-face-attributes-p may be used to test
+does that, this value cannot be accurate.
+
++++
+** New function display-supports-face-attributes-p can be used to test
 whether a given set of face attributes is actually displayable.
 
 A new predicate `supports' has also been added to the `defface' face
@@ -3835,7 +3862,7 @@
 +++
 ** The first face specification element in a defface can specify
 `default' instead of frame classification.  Then its attributes act as
-defaults that apply to all the subsequent cases (and may be overridden
+defaults that apply to all the subsequent cases (and can be overridden
 by them).
 
 +++
@@ -4013,7 +4040,7 @@
 its last line.  It should match the regexp "\n\n(fn.*)\\'".
 
 +++
-** The `defmacro' form may contain declarations specifying how to
+** The `defmacro' form can contain declarations specifying how to
 indent the macro in Lisp mode and how to debug it with Edebug.  The
 syntax of defmacro has been extended to
 
@@ -4033,7 +4060,7 @@
 ** The functions all-completions and try-completion now accept lists
 of strings as well as hash-tables additionally to alists, obarrays
 and functions.  Furthermore, the function `test-completion' is now
-exported to Lisp.  The keys in alists and hash tables may be either
+exported to Lisp.  The keys in alists and hash tables can be either
 strings or symbols, which are automatically converted with to strings.
 
 +++
@@ -4044,8 +4071,8 @@
 
 FUN is called with one argument, the string for which completion is required,
 and it should return an alist containing all the intended possible
-completions. This alist may be a full list of possible completions so that FUN
-can ignore the value of its argument. If completion is performed in the
+completions.  This alist can be a full list of possible completions so that FUN
+can ignore the value of its argument.  If completion is performed in the
 minibuffer, FUN will be called in the buffer from which the minibuffer was
 entered. dynamic-completion-table then computes the completion.
 
@@ -4113,12 +4140,12 @@
 won't produce a warning if it's not defined as a function, and in the
 second case, using `foo' as a variable won't produce a warning if it's
 unbound.  The test must be in exactly one of the above forms (after
-macro expansion), but such tests may be nested.  Note that `when' and
+macro expansion), but such tests can be nested.  Note that `when' and
 `unless' expand to `if', but `cond' doesn't.
 
 *** `(featurep 'xemacs)' is treated by the compiler as nil.  This
 helps to avoid noisy compiler warnings in code meant to run under both
-Emacs and XEmacs and may sometimes make the result significantly more
+Emacs and XEmacs and can sometimes make the result significantly more
 efficient.  Since byte code from recent versions of XEmacs won't
 generally run in Emacs and vice versa, this optimization doesn't lose
 you anything.
@@ -4483,7 +4510,7 @@
 *** New function `macroexpand-all' expands all macros in a form.
 It is similar to the Common-Lisp function of the same name.
 One difference is that it guarantees to return the original argument
-if no expansion is done, which may be tested using `eq'.
+if no expansion is done, which can be tested using `eq'.
 
 *** The new function `minibufferp' returns non-nil if its optional
 buffer argument is a minibuffer.  If the argument is omitted, it
--- a/lisp/ChangeLog	Fri May 06 21:06:31 2005 +0000
+++ b/lisp/ChangeLog	Mon May 09 16:13:15 2005 +0000
@@ -1,3 +1,171 @@
+2005-05-09  Juanma Barranquero  <lekktu@gmail.com>
+
+	* obsolete/uncompress.el: Set `find-file-not-found-functions', not
+	`find-file-not-found-hooks'; use `add-hook'.
+	(uncompress-while-visiting): Set `write-file-functions', not
+	`write-file-hooks'; use `add-hook'.
+
+2005-05-09  Kim F. Storm  <storm@cua.dk>
+
+	* emulation/cua-base.el (cua-copy-region, cua-cut-region)
+	(cua-paste): Handle clipboard action.
+	(cua--init-keymaps): Remap clipboard-kill-region and
+	clipboard-kill-ring-save.
+
+2005-05-08  Eli Zaretskii  <eliz@gnu.org>
+
+	* emacs-lisp/easy-mmode.el (easy-mmode-pretty-mode-name): Improve
+	commentary.
+
+	* simple.el (next-error-overlay-arrow-position): Revert the change
+	made on 2005-04-30.
+
+2005-05-07  Jay Belanger  <belanger@truman.edu>
+
+	* calc/calcsel2.el (calc-commute-left, calc-commute-right)
+	(calc-sel-unpack, calc-sel-isolate): Rename variable `reselect' to
+	`calc-sel-reselect'.
+
+	* calc/calc-mode.el (calc-save-modes): Reset the modes list if
+	Calc is in embedded mode.
+
+2005-05-07  Eli Zaretskii  <eliz@gnu.org>
+
+	* progmodes/compile.el (compilation-setup): Set
+	overlay-arrow-string to an empty string on text terminals.
+
+	* textmodes/ispell.el (ispell-program-name): Try looking for
+	"aspell" along exec-path, and if found, use it as the default
+	speller program.
+
+2005-05-07  Jirka Kosek  <jirka@kosek.cz>  (tiny change)
+
+	* international/mule.el (sgml-xml-auto-coding-function): Recognize
+	encoding='FOO' in single quotes as well as in double quotes.
+
+2005-05-07  Johan Bockg,Ae(Brd  <bojohan@dd.chalmers.se>
+
+	* emacs-lisp/cl-macs.el (cl-transform-lambda): Recognize `declare'
+	as well as `interactive', so that defmacro* would recognize
+	`declare' forms.
+
+2005-05-07  Eli Zaretskii  <eliz@gnu.org>
+
+	* emacs-lisp/easy-mmode.el (easy-mmode-pretty-mode-name): Explain
+	more about the LIGHTER arg's usage in the doc string.  Add
+	commentary to clarify what the code does.  Fix the regexp that
+	strips whitespace from LIGHTER.  Quote LIGHTER before using it,
+	since it could have characters special to regular expressions.
+
+2005-05-07  Matt Hodges  <MPHodges@member.fsf.org>  (tiny change)
+
+	* replace.el (occur-1): Bind inhibit-read-only so that
+	erase-buffer doesn't barf on read-only text properties (likewise
+	for add-text-properties in occur-engine).  Mark buffer as
+	unmodified.
+	(occur-engine): Don't set buffer-read-only here.
+
+2005-05-06  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* pcvs.el (cvs-mode-commit, cvs-mode-edit-log): Don't fiddle with
+	list-buffers-directory.  This caused the *cvs-commit* buffer to be
+	sometimes mistakenly reused as a *cvs* buffer.
+
+2005-05-07  Nick Roberts  <nickrob@snap.net.nz>
+
+	* tooltip.el: Move code for GUD tooltips into gud.el.
+	(require): CL no longer needed to compile case.
+	(tooltip-mode): Do not toggle functions for GUD tooltips.
+	(tooltip-gud-tips-p): Remove. Replace with minor mode
+	gud-tooltip-mode in gud.el.
+	(tooltip-gud-modes, tooltip-gud-display, tooltip-gud-echo-area)
+	(tooltip-gud-toggle-dereference): Rename in gud.el by replacing
+	tooltip-gud prefix with gud-tooltip and obsolete.
+	(tooltip-change-major-mode, tooltip-activate-mouse-motions-if-enabled)
+	(tooltip-mouse-motions-active, tooltip-activate-mouse-motions)
+	(tooltip-mouse-motion): Mouse movement functions/variable.
+	Rename in gud.el by adding gud prefix.
+	(tooltip-gud-original-filter, tooltip-gud-dereference)
+	(tooltip-gud-event, tooltip-toggle-gud-tips)
+	(tooltip-gud-process-output, tooltip-gud-print-command)
+	(tooltip-gud-tips): GUD tooltip functions/variables. Rename in
+	gud.el by replacing tooltip-gud prefix with gud-tooltip.
+	(gdb-tooltip-print): Move to gdb-ui.el.
+
+	* progmodes/gud.el: Move code for GUD tooltips from tooltip.el.
+	(require): CL needed to compile case.
+	(gud-tooltip-mode): Use to toggle GUD tooltips unstead of
+	tooltip-gud-tips-p. Make it a minor-mode.
+	(gud-find-file): Only prepare GUD tooltips if gud-tooltip-mode is t.
+	(gud-menu-map): GUD tooltips use gud-tooltip-mode now.
+	(gud-tooltip-modes, gud-tooltip-display, gud-tooltip-echo-area)
+	(gud-tooltip-change-major-mode)
+	(gud-tooltip-activate-mouse-motions-if-enabled)
+	(gud-tooltip-mouse-motions-active, gud-tooltip-activate-mouse-motions)
+	(gud-tooltip-mouse-motion, gud-tooltip-toggle-dereference)
+	(gud-tooltip-original-filter, gud-tooltip-dereference)
+	(gud-tooltip-event, tooltip-toggle-gud-tips)
+	(gud-tooltip-process-output, gud-tooltip-print-command)
+	(gud-tooltip-tips): Move from tooltip.el.
+
+	* progmodes/gdb-ui.el (gdb-tooltip-print): Move from tooltip.el.
+	(gdb-cpp-define-alist-flags): Doc fix.
+	(gdb-set-gud-minor-mode-1): Only prepare GUD tooltips if
+	gud-tooltip-mode is t.
+
+2005-05-06  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* net/goto-addr.el (goto-address-fontify): Make sure the overlays
+	evaporate if their text is deleted.
+	(goto-address-at-point): Make it work as a mouse binding as well.
+	(goto-address-at-mouse): Obsolete it.  Update users.
+
+2005-05-06  Glenn Morris  <gmorris@ast.cam.ac.uk>
+
+	* calendar/appt.el (top-level): No longer activate on load.
+
+2005-05-06  Juanma Barranquero  <lekktu@gmail.com>
+
+	* calendar/cal-bahai.el (mark-bahai-diary-entries):
+	* net/webjump.el (webjump):
+	* progmodes/idlw-help.el (idlwave-do-context-help1)
+	(idlwave-highlight-linked-completions):
+	* textmodes/po.el (po-find-file-coding-system-guts):
+	Replace `assoc-ignore-case' by `assoc-string'.
+
+2005-05-06  Eli Zaretskii  <eliz@gnu.org>
+
+	* files.el (locate-file): Doc fix.
+
+	* progmodes/gdb-ui.el (gdb-cpp-define-alist-program): Doc fix.
+	Remove the redundant test for ms-dos.
+
+	* progmodes/cmacexp.el (c-macro-preprocessor): Use locate-file to
+	look for the preprocessor with exec-suffixes.  If not found in
+	standard places, look in exec-path.  Remove most of the tests that
+	used system-type.
+
+	* loadup.el: Load jka-cmpr-hook instead of jka-comp-hook.
+
+	* jka-compr.el (jka-compr-uninstall): Add autoload cookie.
+
+	* jka-cmpr-hook.el: Renamed from jka-comp-hook.el, to avoid
+	file-name clash with jka-compr.el on 8+3 filesystems.
+
+2005-05-06  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+	* term/mac-win.el: Don't define or bind scroll bar functions if
+	x-toolkit-scroll-bars is t.
+	(x-select-text, x-get-selection-value):
+	Clear x-last-selected-text-clipboard if x-select-enable-clipboard is
+	nil.
+	(PRIMARY): Put mac-scrap-name property.
+	(mac-select-convert-to-file-url): New function.
+	(public.file-url): New selection target type.  Add to
+	selection-converter-alist.
+	(x-get-selection, x-selection-value): Handle it.
+	(x-cut-buffer-or-selection-value): New alias.
+
 2005-05-05  Luc Teirlinck  <teirllm@auburn.edu>
 
 	* emacs-lisp/byte-run.el (define-obsolete-function-alias)
@@ -22,8 +190,8 @@
 	(ido-file-internal): Add with-no-warnings around ffap and dired code.
 	(ido-exit-minibuffer): Use exit-minibuffer instead of throw.
 	(ido-wide-find-file, ido-wide-find-dir): Catch quit to cancel find.
-	(ido-push-dir, ido-pop-dir, ido-wide-find-file-or-pop-dir): New
-	functions for M-b/M-f to move among the directory components.
+	(ido-push-dir, ido-pop-dir, ido-wide-find-file-or-pop-dir):
+	New functions for M-b/M-f to move among the directory components.
 	(ido-make-merged-file-list): Catch quit to cancel merge.
 	(ido-make-dir-list): Delete "." when ido-input-stack is non-empty.
 	(ido-completion-help): No warnings for ido-completion-buffer-full.
@@ -38,8 +206,8 @@
 
 2005-05-05  Juanma Barranquero  <lekktu@gmail.com>
 
-	* emacs-lisp/byte-run.el (define-obsolete-function-alias): Fix
-	typo in docstring.
+	* emacs-lisp/byte-run.el (define-obsolete-function-alias):
+	Fix typo in docstring.
 
 	* progmodes/ebrowse.el (ebrowse-install-1-to-9-keys)
 	(ebrowse-print-statistics-line)
@@ -55,12 +223,17 @@
 
 	* progmodes/gdb-ui.el (gdb-cpp-define-alist-flags): New variable.
 	(gdb-create-define-alist): Use it.
-	(gdb-cpp-define-alist-program): Update for MS-DOS?
+	(gdb-cpp-define-alist-program): Update for MS-DOS.
 
 2005-05-04  Nick Roberts  <nickrob@snap.net.nz>
 
 	* progmodes/cmacexp.el (c-macro-preprocessor): Update for Mac OSX.
 
+2005-05-04  Richard M. Stallman  <rms@gnu.org>
+
+	* simple.el (line-move-1): Fix previous change to signal errors
+	appropriately.
+
 2005-05-03  Ulf Jasper  <ulf.jasper@web.de>
 
 	* calendar/icalendar.el (icalendar-version): Now at 0.12.
@@ -218,10 +391,10 @@
 
 	* loadup.el: load jka-comp-hook.
 
-	* jka-compr.el: Many functions and vars moved to jka-compr-hook.el.
+	* jka-compr.el: Many functions and vars moved to jka-comp-hook.el.
 	(jka-compr-handler): Add autoload.  `put' calls moved
-	to jka-compr-hook.el.
-	(compression, jka-compr): defgroups moved to jka-compr-hook.el.
+	to jka-comp-hook.el.
+	(compression, jka-compr): defgroups moved to jka-comp-hook.el.
 	(jka-compr-inhibit): Autoload.
 
 	* jka-comp-hook.el: New file.
@@ -2189,7 +2362,7 @@
 	(menu-bar-showhide-menu): Use menu-bar-make-mm-toggle.
 	(menu-bar-make-mm-toggle): Simplify.
 
-2005-03-22  JUAN-LEON Lahoz Garcia <juanleon1@gmail.com>
+2005-03-22  JUAN-LEON Lahoz Garcia  <juanleon1@gmail.com>
 
 	* progmodes/perl-mode.el (perl-font-lock-keywords-2):
 	Accept qualified variable and function names.
@@ -2363,7 +2536,7 @@
 	(recentf-cleanup): Use it to conditionally check availablity of
 	remote files.
 
-2005-03-19  Joe Edmonds <joe-bugs-debian-org@elem.com>  (tiny change)
+2005-03-19  Joe Edmonds  <joe-bugs-debian-org@elem.com>  (tiny change)
 
 	* emacs-lisp/lisp-mode.el (lisp-mode-variables): Recognize `@' in
 	function names.
@@ -3938,7 +4111,7 @@
 	(bibtex-parse-field-name): Fix typos in docstrings.
 	(bibtex-field-list, bibtex-find-crossref): Fix typos in error messages.
 
-2005-01-24  Carsten Dominik <dominik@science.uva.nl>
+2005-01-24  Carsten Dominik  <dominik@science.uva.nl>
 
 	* textmodes/reftex-global.el (reftex-isearch-push-state-function)
 	(reftex-isearch-pop-state-function, reftex-isearch-isearch-search)
@@ -5070,7 +5243,7 @@
 	* ffap.el (ffap-string-at-point-mode-alist): Add "*" to url chars,
 	it can appear unencoded and has been seen from yahoo.
 
-2004-12-27  Sergey Poznyakoff <gray@Mirddin.farlep.net>  (tiny change)
+2004-12-27  Sergey Poznyakoff  <gray@Mirddin.farlep.net>  (tiny change)
 
 	* mail/smtpmail.el (smtpmail-try-auth-methods): Send AUTH CRAM-MD5
 	in upper case.  Reported by Wojciech Polak <polak@gnu.org>.
@@ -6440,7 +6613,7 @@
 	other frames.
 	(gdb-reset): Remove dedicated property after debugging.
 
-2004-11-24  Jay Belanger <belanger@truman.edu>
+2004-11-24  Jay Belanger  <belanger@truman.edu>
 
 	* calc/calc-sel.el: Add comment.
 
@@ -7728,7 +7901,7 @@
 	(gud-gdba-command-name, gdb-show-main, gdb-many-windows):
 	Add :version keyword.
 
-2004-11-02  Pavel Kobiakov <pk_at_work@yahoo.com>
+2004-11-02  Pavel Kobiakov  <pk_at_work@yahoo.com>
 
 	* progmodes/flymake.el (flymake-err-line-patterns):
 	Use `flymake-reformat-err-line-patterns-from-compile-el' to convert
@@ -8137,7 +8310,7 @@
 	Handle periods and underscores in a function name.
 	Remove the address fontification.
 
-2004-10-24 Masatake YAMATO <jet@gyve.org>
+2004-10-24  Masatake YAMATO  <jet@gyve.org>
 
 	* progmodes/asm-mode.el (asm-font-lock-keywords):
 	Use font-lock-variable-name-face for registers.
@@ -8279,7 +8452,7 @@
 
 	* paths.el (news-path): Fix previous change.
 
-2004-10-18 Jay Belanger  <belanger@truman.edu>
+2004-10-18  Jay Belanger  <belanger@truman.edu>
 
 	* calc/calc-help.el (calc-describe-bindings):
 	Set `buffer-read-only' to nil while working in the keybindings buffer;
@@ -9419,7 +9592,7 @@
 
 	* terminal.el (te-escape): Show `?' in prompt for help key.
 
-2004-09-04  Emilio C. Lopes <eclig@gmx.net>
+2004-09-04  Emilio C. Lopes  <eclig@gmx.net>
 
 	* emacs-lisp/lisp.el (kill-backward-up-list): New function.
 
@@ -9827,7 +10000,7 @@
 
 	* imenu.el: Several doc fixes: don't say variables are buffer-local.
 
-2004-08-16  Davis Herring <herring@lanl.gov>
+2004-08-16  Davis Herring  <herring@lanl.gov>
 
 	* isearch.el (isearch-string, isearch-message-string, isearch-point)
 	(isearch-success, isearch-forward-flag, isearch-other-end)
--- a/lisp/calc/README	Fri May 06 21:06:31 2005 +0000
+++ b/lisp/calc/README	Mon May 09 16:13:15 2005 +0000
@@ -2,7 +2,7 @@
 This directory contains Calc, an advanced desk calculator for GNU
 Emacs.
 
-"Calc"  Copyright 1990, 1991, 1992, 1993, 2001 Free Software Foundation, Inc.
+"Calc"  Copyright 1990, 1991, 1992, 1993, 2001, 2005  Free Software Foundation, Inc.
 
 Written by:
 	Dave Gillespie
@@ -52,20 +52,9 @@
 
 
 Calc is written entirely in Emacs Lisp, for maximum portability.
-You do not need to recompile Emacs to install and use Calc.
-
-You will need about six megabytes of disk space to install Calc
-and its Info documentation.
-
-See the file INSTALL for installation instructions.  The instructions
-may seem long, but on typical systems you will only need to follow the
-steps shown in the first section.
-
-Don't even try to run Calc in uncompiled (.el) form!  It's far too slow.
-
 
 I am anxious to hear about your experiences using Calc.  Send mail to
-"daveg@synaptics.com".  A bug report is most useful if you include the
+"belanger@truman.edu".  A bug report is most useful if you include the
 exact input and output that occurred, any modes in effect (such as the
 current precision), and so on.  If you find Calc is difficult to operate
 in any way, or if you have other suggestions, don't hesitate to let me
@@ -73,21 +62,32 @@
 me know.  Even if you find no bugs at all I would love to hear your
 opinions.
 
-The latest Calc tar files and patches are always available for anonymous
-FTP on prep.ai.mit.edu.
-
-Thanks,
-
-								-- Dave
-
-
-
 
 
 Summary of changes to "Calc"
 ------- -- ------- --  ----
 
 
+Version 2.1:
+
+* Added new functions: sec, csc, cot, sech, csch, coth.
+
+* 0^0 now evaluates to 1.
+
+* Added a new language mode for LaTeX.
+
+* Calc now tries to use an appropriate language mode in embedded mode.
+
+* Calc now restores original modes when leaving embedded mode.
+
+* User settable variables which are not set with keystrokes are now
+  customizable.
+
+* Made ~/.calc.el the default Calc settings file.
+
+* Miscellaneous updates and bugfixes.
+
+
 Version 2.02f:
 
  * Fixed a bug which broke `I', `H', `K' prefix keys in recent Emacs.
--- a/lisp/calc/calc-alg.el	Fri May 06 21:06:31 2005 +0000
+++ b/lisp/calc/calc-alg.el	Mon May 09 16:13:15 2005 +0000
@@ -1,6 +1,6 @@
 ;;; calc-alg.el --- algebraic functions for Calc
 
-;; Copyright (C) 1990, 1991, 1992, 1993, 2001 Free Software Foundation, Inc.
+;; Copyright (C) 1990, 1991, 1992, 1993, 2001, 2005 Free Software Foundation, Inc.
 
 ;; Author: David Gillespie <daveg@synaptics.com>
 ;; Maintainer: Jay Belanger  <belanger@truman.edu>
--- a/lisp/calc/calc-arith.el	Fri May 06 21:06:31 2005 +0000
+++ b/lisp/calc/calc-arith.el	Mon May 09 16:13:15 2005 +0000
@@ -1,6 +1,6 @@
 ;;; calc-arith.el --- arithmetic functions for Calc
 
-;; Copyright (C) 1990, 1991, 1992, 1993, 2001 Free Software Foundation, Inc.
+;; Copyright (C) 1990, 1991, 1992, 1993, 2001, 2005 Free Software Foundation, Inc.
 
 ;; Author: David Gillespie <daveg@synaptics.com>
 ;; Maintainer: Jay Belanger <belanger@truman.edu>
--- a/lisp/calc/calc-comb.el	Fri May 06 21:06:31 2005 +0000
+++ b/lisp/calc/calc-comb.el	Mon May 09 16:13:15 2005 +0000
@@ -1,6 +1,6 @@
 ;;; calc-comb.el --- combinatoric functions for Calc
 
-;; Copyright (C) 1990, 1991, 1992, 1993, 2001 Free Software Foundation, Inc.
+;; Copyright (C) 1990, 1991, 1992, 1993, 2001, 2004 Free Software Foundation, Inc.
 
 ;; Author: David Gillespie <daveg@synaptics.com>
 ;; Maintainer: Jay Belanger <belanger@truman.edu>
--- a/lisp/calc/calc-embed.el	Fri May 06 21:06:31 2005 +0000
+++ b/lisp/calc/calc-embed.el	Mon May 09 16:13:15 2005 +0000
@@ -148,6 +148,15 @@
           (setq calc-embedded-original-modes (cons lang modes)))
       (setq calc-embedded-original-modes nil))))
 
+(defun calc-embedded-preserve-modes ()
+  "Preserve the current modes when leaving embedded mode."
+  (interactive)
+  (if calc-embedded-info
+      (progn
+        (calc-embedded-save-original-modes)
+        (message "Current modes will be preserved when leaving embedded mode."))
+    (message "Not in embedded mode.")))
+
 (defun calc-embedded-restore-original-modes ()
   "Restore the original Calc modes when leaving embedded mode."
   (let ((calcbuf (get-buffer "*Calculator*"))
--- a/lisp/calc/calc-ext.el	Fri May 06 21:06:31 2005 +0000
+++ b/lisp/calc/calc-ext.el	Mon May 09 16:13:15 2005 +0000
@@ -378,6 +378,7 @@
   (define-key calc-mode-map "m?" 'calc-m-prefix-help)
   (define-key calc-mode-map "ma" 'calc-algebraic-mode)
   (define-key calc-mode-map "md" 'calc-degrees-mode)
+  (define-key calc-mode-map "me" 'calc-embedded-preserve-modes)
   (define-key calc-mode-map "mf" 'calc-frac-mode)
   (define-key calc-mode-map "mg" 'calc-get-modes)
   (define-key calc-mode-map "mh" 'calc-hms-mode)
@@ -737,7 +738,8 @@
 
  ("calc-embed" calc-do-embedded
 calc-do-embedded-activate calc-embedded-evaluate-expr
-calc-embedded-modes-change calc-embedded-var-change)
+calc-embedded-modes-change calc-embedded-var-change
+calc-embedded-preserve-modes)
 
  ("calc-fin" calc-to-percentage calcFunc-ddb
 calcFunc-fv calcFunc-fvb calcFunc-fvl calcFunc-irr calcFunc-irrb
--- a/lisp/calc/calc-lang.el	Fri May 06 21:06:31 2005 +0000
+++ b/lisp/calc/calc-lang.el	Mon May 09 16:13:15 2005 +0000
@@ -1,6 +1,6 @@
 ;;; calc-lang.el --- calc language functions
 
-;; Copyright (C) 1990, 1991, 1992, 1993, 2001 Free Software Foundation, Inc.
+;; Copyright (C) 1990, 1991, 1992, 1993, 2001, 2005 Free Software Foundation, Inc.
 
 ;; Author: David Gillespie <daveg@synaptics.com>
 ;; Maintainer: Jay Belanger <belanger@truman.edu>
--- a/lisp/calc/calc-math.el	Fri May 06 21:06:31 2005 +0000
+++ b/lisp/calc/calc-math.el	Mon May 09 16:13:15 2005 +0000
@@ -1,6 +1,6 @@
 ;;; calc-math.el --- mathematical functions for Calc
 
-;; Copyright (C) 1990, 1991, 1992, 1993, 2001 Free Software Foundation, Inc.
+;; Copyright (C) 1990, 1991, 1992, 1993, 2001, 2005 Free Software Foundation, Inc.
 
 ;; Author: David Gillespie <daveg@synaptics.com>
 ;; Maintainer: Jay Belanger <belanger@truman.edu>
--- a/lisp/calc/calc-misc.el	Fri May 06 21:06:31 2005 +0000
+++ b/lisp/calc/calc-misc.el	Mon May 09 16:13:15 2005 +0000
@@ -1,6 +1,6 @@
 ;;; calc-misc.el --- miscellaenous functions for Calc
 
-;; Copyright (C) 1990, 1991, 1992, 1993, 2001 Free Software Foundation, Inc.
+;; Copyright (C) 1990, 1991, 1992, 1993, 2001, 2004 Free Software Foundation, Inc.
 
 ;; Author: David Gillespie <daveg@synaptics.com>
 ;; Maintainer: Jay Belanger <belanger@truman.edu>
--- a/lisp/calc/calc-mode.el	Fri May 06 21:06:31 2005 +0000
+++ b/lisp/calc/calc-mode.el	Mon May 09 16:13:15 2005 +0000
@@ -304,7 +304,9 @@
 	       vals (cdr vals))))
      (run-hooks 'calc-mode-save-hook)
      (insert ";;; End of mode settings\n")
-     (save-buffer))))
+     (save-buffer)
+     (if calc-embedded-info
+         (calc-embedded-save-original-modes)))))
 
 (defun calc-settings-file-name (name &optional arg)
   (interactive
--- a/lisp/calc/calc-poly.el	Fri May 06 21:06:31 2005 +0000
+++ b/lisp/calc/calc-poly.el	Mon May 09 16:13:15 2005 +0000
@@ -1,6 +1,6 @@
 ;;; calc-poly.el --- polynomial functions for Calc
 
-;; Copyright (C) 1990, 1991, 1992, 1993, 2001 Free Software Foundation, Inc.
+;; Copyright (C) 1990, 1991, 1992, 1993, 2001, 2004 Free Software Foundation, Inc.
 
 ;; Author: David Gillespie <daveg@synaptics.com>
 ;; Maintainer: Jay Belanger <belanger@truman.edu>
--- a/lisp/calc/calc-rewr.el	Fri May 06 21:06:31 2005 +0000
+++ b/lisp/calc/calc-rewr.el	Mon May 09 16:13:15 2005 +0000
@@ -1,6 +1,6 @@
 ;;; calc-rewr.el --- rewriting functions for Calc
 
-;; Copyright (C) 1990, 1991, 1992, 1993, 2001 Free Software Foundation, Inc.
+;; Copyright (C) 1990, 1991, 1992, 1993, 2001, 2004 Free Software Foundation, Inc.
 
 ;; Author: David Gillespie <daveg@synaptics.com>
 ;; Maintainer: Jay Belanger <belanger@truman.edu>
--- a/lisp/calc/calc-store.el	Fri May 06 21:06:31 2005 +0000
+++ b/lisp/calc/calc-store.el	Mon May 09 16:13:15 2005 +0000
@@ -1,6 +1,6 @@
 ;;; calc-store.el --- value storage functions for Calc
 
-;; Copyright (C) 1990, 1991, 1992, 1993, 2001 Free Software Foundation, Inc.
+;; Copyright (C) 1990, 1991, 1992, 1993, 2001, 2004 Free Software Foundation, Inc.
 
 ;; Author: David Gillespie <daveg@synaptics.com>
 ;; Maintainer: Jay Belanger <belanger@truman.edu>
--- a/lisp/calc/calc-stuff.el	Fri May 06 21:06:31 2005 +0000
+++ b/lisp/calc/calc-stuff.el	Mon May 09 16:13:15 2005 +0000
@@ -1,6 +1,6 @@
 ;;; calc-stuff.el --- miscellaneous functions for Calc
 
-;; Copyright (C) 1990, 1991, 1992, 1993, 2001 Free Software Foundation, Inc.
+;; Copyright (C) 1990, 1991, 1992, 1993, 2001, 2004 Free Software Foundation, Inc.
 
 ;; Author: David Gillespie <daveg@synaptics.com>
 ;; Maintainer: Jay Belanger <belanger@truman.edu>
--- a/lisp/calc/calc-vec.el	Fri May 06 21:06:31 2005 +0000
+++ b/lisp/calc/calc-vec.el	Mon May 09 16:13:15 2005 +0000
@@ -1,6 +1,6 @@
 ;;; calc-vec.el --- vector functions for Calc
 
-;; Copyright (C) 1990, 1991, 1992, 1993, 2001 Free Software Foundation, Inc.
+;; Copyright (C) 1990, 1991, 1992, 1993, 2001, 2004 Free Software Foundation, Inc.
 
 ;; Author: David Gillespie <daveg@synaptics.com>
 ;; Maintainer: Jay Belanger <belanger@truman.edu>
--- a/lisp/calc/calcalg2.el	Fri May 06 21:06:31 2005 +0000
+++ b/lisp/calc/calcalg2.el	Mon May 09 16:13:15 2005 +0000
@@ -1,6 +1,6 @@
 ;;; calcalg2.el --- more algebraic functions for Calc
 
-;; Copyright (C) 1990, 1991, 1992, 1993, 2001 Free Software Foundation, Inc.
+;; Copyright (C) 1990, 1991, 1992, 1993, 2001, 2005 Free Software Foundation, Inc.
 
 ;; Author: David Gillespie <daveg@synaptics.com>
 ;; Maintainer: Jay Belanger <belanger@truman.edu>
--- a/lisp/calc/calcalg3.el	Fri May 06 21:06:31 2005 +0000
+++ b/lisp/calc/calcalg3.el	Mon May 09 16:13:15 2005 +0000
@@ -1,6 +1,6 @@
 ;;; calcalg3.el --- more algebraic functions for Calc
 
-;; Copyright (C) 1990, 1991, 1992, 1993, 2001 Free Software Foundation, Inc.
+;; Copyright (C) 1990, 1991, 1992, 1993, 2001, 2004 Free Software Foundation, Inc.
 
 ;; Author: David Gillespie <daveg@synaptics.com>
 ;; Maintainer: Jay Belanger <belanger@truman.edu>
--- a/lisp/calc/calccomp.el	Fri May 06 21:06:31 2005 +0000
+++ b/lisp/calc/calccomp.el	Mon May 09 16:13:15 2005 +0000
@@ -1,6 +1,6 @@
 ;;; calccomp.el --- composition functions for Calc
 
-;; Copyright (C) 1990, 1991, 1992, 1993, 2001 Free Software Foundation, Inc.
+;; Copyright (C) 1990, 1991, 1992, 1993, 2001, 2005 Free Software Foundation, Inc.
 
 ;; Author: David Gillespie <daveg@synaptics.com>
 ;; Maintainer: Jay Belanger <belanger@truman.edu>
--- a/lisp/calc/calcsel2.el	Fri May 06 21:06:31 2005 +0000
+++ b/lisp/calc/calcsel2.el	Mon May 09 16:13:15 2005 +0000
@@ -34,6 +34,10 @@
 ;; The variable calc-keep-selection is declared and set in calc-sel.el.
 (defvar calc-keep-selection)
 
+;; The variable calc-sel-reselect is local to the methods below,
+;; but is used by some functions in calc-sel.el which are called
+;; by the functions below.
+
 (defun calc-commute-left (arg)
   (interactive "p")
   (if (< arg 0)
@@ -41,7 +45,7 @@
     (calc-wrapper
      (calc-preserve-point)
      (let ((num (max 1 (calc-locate-cursor-element (point))))
-	   (reselect calc-keep-selection))
+	   (calc-sel-reselect calc-keep-selection))
        (if (= arg 0) (setq arg nil))
        (while (or (null arg) (>= (setq arg (1- arg)) 0))
 	 (let* ((entry (calc-top num 'entry))
@@ -106,14 +110,14 @@
 	   (if (null new)
 	       (if arg
 		   (error "Term is already leftmost")
-		 (or reselect
+		 (or calc-sel-reselect
 		     (calc-pop-push-list 1 (list expr) num '(nil)))
 		 (setq arg 0))
 	     (calc-pop-push-record-list
 	      1 "left"
 	      (list (calc-replace-sub-formula expr parent new))
 	      num
-	      (list (and (or (not (eq arg 0)) reselect)
+	      (list (and (or (not (eq arg 0)) calc-sel-reselect)
 			 sel))))))))))
 
 (defun calc-commute-right (arg)
@@ -123,7 +127,7 @@
     (calc-wrapper
      (calc-preserve-point)
      (let ((num (max 1 (calc-locate-cursor-element (point))))
-	   (reselect calc-keep-selection))
+	   (calc-sel-reselect calc-keep-selection))
        (if (= arg 0) (setq arg nil))
        (while (or (null arg) (>= (setq arg (1- arg)) 0))
 	 (let* ((entry (calc-top num 'entry))
@@ -189,14 +193,14 @@
 	   (if (null new)
 	       (if arg
 		   (error "Term is already rightmost")
-		 (or reselect
+		 (or calc-sel-reselect
 		     (calc-pop-push-list 1 (list expr) num '(nil)))
 		 (setq arg 0))
 	     (calc-pop-push-record-list
 	      1 "rght"
 	      (list (calc-replace-sub-formula expr parent new))
 	      num
-	      (list (and (or (not (eq arg 0)) reselect)
+	      (list (and (or (not (eq arg 0)) calc-sel-reselect)
 			 sel))))))))))
 
 (defun calc-build-assoc-term (op lhs rhs)
@@ -225,7 +229,7 @@
   (calc-wrapper
    (calc-preserve-point)
    (let* ((num (max 1 (calc-locate-cursor-element (point))))
-	  (reselect calc-keep-selection)
+	  (calc-sel-reselect calc-keep-selection)
 	  (entry (calc-top num 'entry))
 	  (expr (car entry))
 	  (sel (or (calc-auto-selection entry) expr)))
@@ -236,14 +240,14 @@
 				(list (calc-replace-sub-formula
 				       expr sel (nth 1 sel)))
 				num
-				(list (and reselect (nth 1 sel)))))))
+				(list (and calc-sel-reselect (nth 1 sel)))))))
 
 (defun calc-sel-isolate ()
   (interactive)
   (calc-slow-wrapper
    (calc-preserve-point)
    (let* ((num (max 1 (calc-locate-cursor-element (point))))
-	  (reselect calc-keep-selection)
+	  (calc-sel-reselect calc-keep-selection)
 	  (entry (calc-top num 'entry))
 	  (expr (car entry))
 	  (sel (or (calc-auto-selection entry) (error "No selection")))
@@ -266,7 +270,7 @@
 				(list (calc-replace-sub-formula
 				       expr eqn soln))
 				num
-				(list (and reselect sel)))
+				(list (and calc-sel-reselect sel)))
      (calc-handle-whys))))
 
 (defun calc-sel-commute (many)
--- a/lisp/calendar/appt.el	Fri May 06 21:06:31 2005 +0000
+++ b/lisp/calendar/appt.el	Mon May 09 16:13:15 2005 +0000
@@ -688,10 +688,6 @@
       (appt-check t))))
 
 
-;; This is needed for backwards compatibility. Feh.
-(appt-activate 1)
-
-
 (provide 'appt)
 
 ;;; arch-tag: bf5791c4-8921-499e-a26f-772b1788d347
--- a/lisp/calendar/cal-bahai.el	Fri May 06 21:06:31 2005 +0000
+++ b/lisp/calendar/cal-bahai.el	Mon May 09 16:13:15 2005 +0000
@@ -375,19 +375,21 @@
                          (string-to-int y-str)))))
             (if dd-name
                 (mark-calendar-days-named
-                 (cdr (assoc-ignore-case (substring dd-name 0 3)
-                                         (calendar-make-alist
-                                          calendar-day-name-array
-                                          0
-                                          '(lambda (x) (substring x 0 3))))))
+                 (cdr (assoc-string (substring dd-name 0 3)
+                                    (calendar-make-alist
+                                     calendar-day-name-array
+                                     0
+                                     '(lambda (x) (substring x 0 3)))
+                                    t)))
               (if mm-name
                   (if (string-equal mm-name "*")
                       (setq mm 0)
                     (setq mm
-                          (cdr (assoc-ignore-case
+                          (cdr (assoc-string
                                 mm-name
                                 (calendar-make-alist
-                                  bahai-calendar-month-name-array))))))
+                                  bahai-calendar-month-name-array)
+                                t)))))
               (mark-bahai-calendar-date-pattern mm dd yy)))))
       (setq d (cdr d)))))
 
--- a/lisp/calendar/solar.el	Fri May 06 21:06:31 2005 +0000
+++ b/lisp/calendar/solar.el	Mon May 09 16:13:15 2005 +0000
@@ -4,6 +4,7 @@
 
 ;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
 ;;	Denis B. Roegel <Denis.Roegel@loria.fr>
+;; Maintainer: Glenn Morris <gmorris@ast.cam.ac.uk>
 ;; Keywords: calendar
 ;; Human-Keywords: sunrise, sunset, equinox, solstice, calendar, diary,
 ;;	holidays
--- a/lisp/emacs-lisp/cl-macs.el	Fri May 06 21:06:31 2005 +0000
+++ b/lisp/emacs-lisp/cl-macs.el	Mon May 09 16:13:15 2005 +0000
@@ -233,7 +233,8 @@
 	 (bind-defs nil) (bind-enquote nil)
 	 (bind-inits nil) (bind-lets nil) (bind-forms nil)
 	 (header nil) (simple-args nil))
-    (while (or (stringp (car body)) (eq (car-safe (car body)) 'interactive))
+    (while (or (stringp (car body))
+	       (memq (car-safe (car body)) '(interactive declare)))
       (push (pop body) header))
     (setq args (if (listp args) (copy-list args) (list '&rest args)))
     (let ((p (last args))) (if (cdr p) (setcdr p (list '&rest (cdr p)))))
--- a/lisp/emacs-lisp/easy-mmode.el	Fri May 06 21:06:31 2005 +0000
+++ b/lisp/emacs-lisp/easy-mmode.el	Mon May 09 16:13:15 2005 +0000
@@ -58,16 +58,31 @@
 
 (defun easy-mmode-pretty-mode-name (mode &optional lighter)
   "Turn the symbol MODE into a string intended for the user.
-If provided LIGHTER will be used to help choose capitalization."
+If provided, LIGHTER will be used to help choose capitalization by,
+replacing its case-insensitive matches with the literal string in LIGHTER."
   (let* ((case-fold-search t)
+	 ;; Produce "Foo-Bar minor mode" from foo-bar-minor-mode.
 	 (name (concat (replace-regexp-in-string
+			;; If the original mode name included "-minor" (some
+			;; of them don't, e.g. auto-revert-mode), then
+			;; replace it with " minor".
 			"-Minor" " minor"
+			;; "foo-bar-minor" -> "Foo-Bar-Minor"
 			(capitalize (replace-regexp-in-string
+				     ;; "foo-bar-minor-mode" -> "foo-bar-minor"
 				     "-mode\\'" "" (symbol-name mode))))
 		       " mode")))
     (if (not (stringp lighter)) name
-      (setq lighter (replace-regexp-in-string "\\`\\s-+\\|\\-s+\\'" "" lighter))
-      (replace-regexp-in-string lighter lighter name t t))))
+      ;; Strip leading and trailing whitespace from LIGHTER.
+      (setq lighter (replace-regexp-in-string "\\`\\s-+\\|\\s-+\\'" ""
+					      lighter))
+      ;; Replace any (case-insensitive) matches for LIGHTER in NAME
+      ;; with a literal LIGHTER.  E.g., if NAME is "Iimage mode" and
+      ;; LIGHTER is " iImag", then this will produce "iImage mode".
+      ;; (LIGHTER normally comes from the mode-line string passed to
+      ;; define-minor-mode, and normally includes at least one leading
+      ;; space.)
+      (replace-regexp-in-string (regexp-quote lighter) lighter name t t))))
 
 ;;;###autoload
 (defalias 'easy-mmode-define-minor-mode 'define-minor-mode)
--- a/lisp/emulation/cua-base.el	Fri May 06 21:06:31 2005 +0000
+++ b/lisp/emulation/cua-base.el	Mon May 09 16:13:15 2005 +0000
@@ -777,9 +777,13 @@
   (let ((start (mark)) (end (point)))
     (or (<= start end)
 	(setq start (prog1 end (setq end start))))
-    (if cua--register
-	(copy-to-register cua--register start end nil)
-      (copy-region-as-kill start end))
+    (cond
+     (cua--register
+      (copy-to-register cua--register start end nil))
+     ((eq this-original-command 'clipboard-kill-ring-save)
+      (clipboard-kill-ring-save start end))
+     (t
+      (copy-region-as-kill start end)))
     (if cua-keep-region-after-copy
 	(cua--keep-active)
       (cua--deactivate))))
@@ -795,9 +799,13 @@
     (let ((start (mark)) (end (point)))
       (or (<= start end)
 	  (setq start (prog1 end (setq end start))))
-      (if cua--register
-	  (copy-to-register cua--register start end t)
-	(kill-region start end)))
+      (cond
+       (cua--register
+	(copy-to-register cua--register start end t))
+       ((eq this-original-command 'clipboard-kill-region)
+	(clipboard-kill-region start end))
+       (t
+	(kill-region start end))))
     (cua--deactivate)))
 
 ;;; Generic commands for regions, rectangles, and global marks
@@ -864,6 +872,8 @@
 	  (cua--insert-rectangle (cdr cua--last-killed-rectangle)
 				 nil paste-column paste-lines)
 	  (if arg (goto-char pt))))
+       ((eq this-original-command 'clipboard-yank)
+	(clipboard-yank))
        (t (yank arg)))))))
 
 (defun cua-paste-pop (arg)
@@ -1282,9 +1292,11 @@
   (define-key cua--region-keymap [remap delete-char]		'cua-delete-region)
   ;; kill region
   (define-key cua--region-keymap [remap kill-region]		'cua-cut-region)
+  (define-key cua--region-keymap [remap clipboard-kill-region]	'cua-cut-region)
   ;; copy region
   (define-key cua--region-keymap [remap copy-region-as-kill]	'cua-copy-region)
   (define-key cua--region-keymap [remap kill-ring-save]		'cua-copy-region)
+  (define-key cua--region-keymap [remap clipboard-kill-ring-save] 'cua-copy-region)
   ;; cancel current region/rectangle
   (define-key cua--region-keymap [remap keyboard-escape-quit]	'cua-cancel)
   (define-key cua--region-keymap [remap keyboard-quit]		'cua-cancel)
--- a/lisp/files.el	Fri May 06 21:06:31 2005 +0000
+++ b/lisp/files.el	Mon May 09 16:13:15 2005 +0000
@@ -632,8 +632,13 @@
 
 (defun locate-file (filename path &optional suffixes predicate)
   "Search for FILENAME through PATH.
+If found, return the absolute file name of FILENAME, with its suffixes;
+otherwise return nil.
+PATH should be a list of directories to look in, like the lists in
+`exec-path' or `load-path'.
 If SUFFIXES is non-nil, it should be a list of suffixes to append to
 file name when searching.  If SUFFIXES is nil, it is equivalent to '(\"\").
+Use '(\"/\") to disable PATH search, but still try the suffixes in SUFFIXES.
 If non-nil, PREDICATE is used instead of `file-readable-p'.
 PREDICATE can also be an integer to pass to the `access' system call,
 in which case file-name handlers are ignored.  This usage is deprecated.
--- a/lisp/international/mule.el	Fri May 06 21:06:31 2005 +0000
+++ b/lisp/international/mule.el	Mon May 09 16:13:15 2005 +0000
@@ -2188,9 +2188,9 @@
   (when (re-search-forward "\\`[[:space:]\n]*<\\?xml" size t)
     (let ((end (save-excursion
 		 ;; This is a hack.
-		 (re-search-forward "\"\\s-*\\?>" size t))))
+		 (re-search-forward "[\"']\\s-*\\?>" size t))))
       (when end
-	(if (re-search-forward "encoding=\"\\(.+?\\)\"" end t)
+	(if (re-search-forward "encoding=[\"']\\(.+?\\)[\"']" end t)
 	    (let* ((match (match-string 1))
 		   (sym (intern (downcase match))))
 	      (if (coding-system-p sym)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lisp/jka-cmpr-hook.el	Mon May 09 16:13:15 2005 +0000
@@ -0,0 +1,293 @@
+;;; jka-cmpr-hook.el --- preloaded code to enable jka-compr.el
+
+;; Copyright (C) 1993, 1994, 1995, 1997, 1999, 2000, 2003, 2004, 2005  Free Software Foundation, Inc.
+
+;; Author: jka@ece.cmu.edu (Jay K. Adams)
+;; Maintainer: FSF
+;; Keywords: data
+
+;; 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., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+;;; Commentary:
+
+;; This file contains the  code to enable and disable Auto-Compression mode.
+;; It is preloaded.  The guts of this mode are in jka-compr.el, which
+;; is loaded only when you really try to uncompress something.
+
+;;; Code:
+
+(defgroup compression nil
+  "Data compression utilities"
+  :group 'data)
+
+(defgroup jka-compr nil
+  "jka-compr customization"
+  :group 'compression)
+
+;;; I have this defined so that .Z files are assumed to be in unix
+;;; compress format; and .gz files, in gzip format, and .bz2 files in bzip fmt.
+(defcustom jka-compr-compression-info-list
+  ;;[regexp
+  ;; compr-message  compr-prog  compr-args
+  ;; uncomp-message uncomp-prog uncomp-args
+  ;; can-append auto-mode-flag strip-extension-flag file-magic-bytes]
+  '(["\\.Z\\(~\\|\\.~[0-9]+~\\)?\\'"
+     "compressing"    "compress"     ("-c")
+     "uncompressing"  "uncompress"   ("-c")
+     nil t "\037\235"]
+     ;; Formerly, these had an additional arg "-c", but that fails with
+     ;; "Version 0.1pl2, 29-Aug-97." (RedHat 5.1 GNU/Linux) and
+     ;; "Version 0.9.0b, 9-Sept-98".
+    ["\\.bz2\\'"
+     "bzip2ing"        "bzip2"         nil
+     "bunzip2ing"      "bzip2"         ("-d")
+     nil t "BZh"]
+    ["\\.tbz\\'"
+     "bzip2ing"        "bzip2"         nil
+     "bunzip2ing"      "bzip2"         ("-d")
+     nil nil "BZh"]
+    ["\\.tgz\\'"
+     "compressing"        "gzip"         ("-c" "-q")
+     "uncompressing"      "gzip"         ("-c" "-q" "-d")
+     t nil "\037\213"]
+    ["\\.g?z\\(~\\|\\.~[0-9]+~\\)?\\'"
+     "compressing"        "gzip"         ("-c" "-q")
+     "uncompressing"      "gzip"         ("-c" "-q" "-d")
+     t t "\037\213"]
+    ;; dzip is gzip with random access.  Its compression program can't
+    ;; read/write stdin/out, so .dz files can only be viewed without
+    ;; saving, having their contents decompressed with gzip.
+    ["\\.dz\\'"
+     nil              nil            nil
+     "uncompressing"      "gzip"         ("-c" "-q" "-d")
+     nil t "\037\213"])
+
+  "List of vectors that describe available compression techniques.
+Each element, which describes a compression technique, is a vector of
+the form [REGEXP COMPRESS-MSG COMPRESS-PROGRAM COMPRESS-ARGS
+UNCOMPRESS-MSG UNCOMPRESS-PROGRAM UNCOMPRESS-ARGS
+APPEND-FLAG STRIP-EXTENSION-FLAG FILE-MAGIC-CHARS], where:
+
+   regexp                is a regexp that matches filenames that are
+                         compressed with this format
+
+   compress-msg          is the message to issue to the user when doing this
+                         type of compression (nil means no message)
+
+   compress-program      is a program that performs this compression
+                         (nil means visit file in read-only mode)
+
+   compress-args         is a list of args to pass to the compress program
+
+   uncompress-msg        is the message to issue to the user when doing this
+                         type of uncompression (nil means no message)
+
+   uncompress-program    is a program that performs this compression
+
+   uncompress-args       is a list of args to pass to the uncompress program
+
+   append-flag           is non-nil if this compression technique can be
+                         appended
+
+   strip-extension-flag  non-nil means strip the regexp from file names
+                         before attempting to set the mode.
+
+   file-magic-chars      is a string of characters that you would find
+			 at the beginning of a file compressed in this way.
+
+Because of the way `call-process' is defined, discarding the stderr output of
+a program adds the overhead of starting a shell each time the program is
+invoked."
+  :type '(repeat (vector regexp
+			 (choice :tag "Compress Message"
+				 (string :format "%v")
+				 (const :tag "No Message" nil))
+			 (choice :tag "Compress Program"
+				 (string)
+				 (const :tag "None" nil))
+			 (repeat :tag "Compress Arguments" string)
+			 (choice :tag "Uncompress Message"
+				 (string :format "%v")
+				 (const :tag "No Message" nil))
+			 (choice :tag "Uncompress Program"
+				 (string)
+				 (const :tag "None" nil))
+			 (repeat :tag "Uncompress Arguments" string)
+			 (boolean :tag "Append")
+			 (boolean :tag "Strip Extension")
+			 (string :tag "Magic Bytes")))
+  :group 'jka-compr)
+
+(defcustom jka-compr-mode-alist-additions
+  (list (cons "\\.tgz\\'" 'tar-mode) (cons "\\.tbz\\'" 'tar-mode))
+  "A list of pairs to add to `auto-mode-alist' when jka-compr is installed."
+  :type '(repeat (cons string symbol))
+  :group 'jka-compr)
+
+(defcustom jka-compr-load-suffixes '(".gz")
+  "List of suffixes to try when loading files."
+  :type '(repeat string)
+  :group 'jka-compr)
+
+;; List of all the elements we actually added to file-coding-system-alist.
+(defvar jka-compr-added-to-file-coding-system-alist nil)
+
+(defvar jka-compr-file-name-handler-entry
+  nil
+  "The entry in `file-name-handler-alist' used by the jka-compr I/O functions.")
+
+(defun jka-compr-build-file-regexp ()
+  (mapconcat
+   'jka-compr-info-regexp
+   jka-compr-compression-info-list
+   "\\|"))
+
+;;; Functions for accessing the return value of jka-compr-get-compression-info
+(defun jka-compr-info-regexp               (info)  (aref info 0))
+(defun jka-compr-info-compress-message     (info)  (aref info 1))
+(defun jka-compr-info-compress-program     (info)  (aref info 2))
+(defun jka-compr-info-compress-args        (info)  (aref info 3))
+(defun jka-compr-info-uncompress-message   (info)  (aref info 4))
+(defun jka-compr-info-uncompress-program   (info)  (aref info 5))
+(defun jka-compr-info-uncompress-args      (info)  (aref info 6))
+(defun jka-compr-info-can-append           (info)  (aref info 7))
+(defun jka-compr-info-strip-extension      (info)  (aref info 8))
+(defun jka-compr-info-file-magic-bytes     (info)  (aref info 9))
+
+
+(defun jka-compr-get-compression-info (filename)
+  "Return information about the compression scheme of FILENAME.
+The determination as to which compression scheme, if any, to use is
+based on the filename itself and `jka-compr-compression-info-list'."
+  (catch 'compression-info
+    (let ((case-fold-search nil))
+      (mapcar
+       (function (lambda (x)
+		   (and (string-match (jka-compr-info-regexp x) filename)
+			(throw 'compression-info x))))
+       jka-compr-compression-info-list)
+      nil)))
+
+(defun jka-compr-install ()
+  "Install jka-compr.
+This adds entries to `file-name-handler-alist' and `auto-mode-alist'
+and `inhibit-first-line-modes-suffixes'."
+
+  (setq jka-compr-file-name-handler-entry
+	(cons (jka-compr-build-file-regexp) 'jka-compr-handler))
+
+  (setq file-name-handler-alist (cons jka-compr-file-name-handler-entry
+				      file-name-handler-alist))
+
+  (setq jka-compr-added-to-file-coding-system-alist nil)
+
+  (mapcar
+   (function (lambda (x)
+	       ;; Don't do multibyte encoding on the compressed files.
+	       (let ((elt (cons (jka-compr-info-regexp x)
+				 '(no-conversion . no-conversion))))
+		 (setq file-coding-system-alist
+		       (cons elt file-coding-system-alist))
+		 (setq jka-compr-added-to-file-coding-system-alist
+		       (cons elt jka-compr-added-to-file-coding-system-alist)))
+
+	       (and (jka-compr-info-strip-extension x)
+		    ;; Make entries in auto-mode-alist so that modes
+		    ;; are chosen right according to the file names
+		    ;; sans `.gz'.
+		    (setq auto-mode-alist
+			  (cons (list (jka-compr-info-regexp x)
+				      nil 'jka-compr)
+				auto-mode-alist))
+		    ;; Also add these regexps to
+		    ;; inhibit-first-line-modes-suffixes, so that a
+		    ;; -*- line in the first file of a compressed tar
+		    ;; file doesn't override tar-mode.
+		    (setq inhibit-first-line-modes-suffixes
+			  (cons (jka-compr-info-regexp x)
+				inhibit-first-line-modes-suffixes)))))
+   jka-compr-compression-info-list)
+  (setq auto-mode-alist
+	(append auto-mode-alist jka-compr-mode-alist-additions))
+
+  ;; Make sure that (load "foo") will find /bla/foo.el.gz.
+  (setq load-suffixes
+	(apply 'append
+	       (mapcar (lambda (suffix)
+			 (cons suffix
+			       (mapcar (lambda (ext) (concat suffix ext))
+				       jka-compr-load-suffixes)))
+		       load-suffixes))))
+
+
+(defun jka-compr-installed-p ()
+  "Return non-nil if jka-compr is installed.
+The return value is the entry in `file-name-handler-alist' for jka-compr."
+
+  (let ((fnha file-name-handler-alist)
+	(installed nil))
+
+    (while (and fnha (not installed))
+     (and (eq (cdr (car fnha)) 'jka-compr-handler)
+	   (setq installed (car fnha)))
+      (setq fnha (cdr fnha)))
+
+    installed))
+
+(define-minor-mode auto-compression-mode
+  "Toggle automatic file compression and uncompression.
+With prefix argument ARG, turn auto compression on if positive, else off.
+Returns the new status of auto compression (non-nil means on)."
+  :global t :group 'jka-compr
+  (let* ((installed (jka-compr-installed-p))
+	 (flag auto-compression-mode))
+    (cond
+     ((and flag installed) t)		; already installed
+     ((and (not flag) (not installed)) nil) ; already not installed
+     (flag (jka-compr-install))
+     (t (jka-compr-uninstall)))))
+
+(defmacro with-auto-compression-mode (&rest body)
+  "Evalute BODY with automatic file compression and uncompression enabled."
+  (let ((already-installed (make-symbol "already-installed")))
+    `(let ((,already-installed (jka-compr-installed-p)))
+       (unwind-protect
+	   (progn
+	     (unless ,already-installed
+	       (jka-compr-install))
+	     ,@body)
+	 (unless ,already-installed
+	   (jka-compr-uninstall))))))
+(put 'with-auto-compression-mode 'lisp-indent-function 0)
+
+
+;;; This is what we need to know about jka-compr-handler
+;;; in order to decide when to call it.
+
+(put 'jka-compr-handler 'safe-magic t)
+(put 'jka-compr-handler 'operations '(jka-compr-byte-compiler-base-file-name
+				      write-region insert-file-contents
+				      file-local-copy load))
+
+;;; Turn on the mode.
+(auto-compression-mode 1)
+
+(provide 'jka-cmpr-hook)
+
+;; arch-tag: 4bd73429-f400-45fe-a065-270a113e31a8
+;;; jka-cmpr-hook.el ends here
--- a/lisp/jka-comp-hook.el	Fri May 06 21:06:31 2005 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,293 +0,0 @@
-;;; jka-comp-hook.el --- preloaded code to enable jka-compr.el
-
-;; Copyright (C) 1993, 1994, 1995, 1997, 1999, 2000, 2003, 2004, 2005  Free Software Foundation, Inc.
-
-;; Author: jka@ece.cmu.edu (Jay K. Adams)
-;; Maintainer: FSF
-;; Keywords: data
-
-;; 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., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
-
-;;; Commentary:
-
-;; This file contains the  code to enable and disable Auto-Compression mode.
-;; It is preloaded.  The guts of this mode are in jka-compr.el, which
-;; is loaded only when you really try to uncompress something.
-
-;;; Code:
-
-(defgroup compression nil
-  "Data compression utilities"
-  :group 'data)
-
-(defgroup jka-compr nil
-  "jka-compr customization"
-  :group 'compression)
-
-;;; I have this defined so that .Z files are assumed to be in unix
-;;; compress format; and .gz files, in gzip format, and .bz2 files in bzip fmt.
-(defcustom jka-compr-compression-info-list
-  ;;[regexp
-  ;; compr-message  compr-prog  compr-args
-  ;; uncomp-message uncomp-prog uncomp-args
-  ;; can-append auto-mode-flag strip-extension-flag file-magic-bytes]
-  '(["\\.Z\\(~\\|\\.~[0-9]+~\\)?\\'"
-     "compressing"    "compress"     ("-c")
-     "uncompressing"  "uncompress"   ("-c")
-     nil t "\037\235"]
-     ;; Formerly, these had an additional arg "-c", but that fails with
-     ;; "Version 0.1pl2, 29-Aug-97." (RedHat 5.1 GNU/Linux) and
-     ;; "Version 0.9.0b, 9-Sept-98".
-    ["\\.bz2\\'"
-     "bzip2ing"        "bzip2"         nil
-     "bunzip2ing"      "bzip2"         ("-d")
-     nil t "BZh"]
-    ["\\.tbz\\'"
-     "bzip2ing"        "bzip2"         nil
-     "bunzip2ing"      "bzip2"         ("-d")
-     nil nil "BZh"]
-    ["\\.tgz\\'"
-     "compressing"        "gzip"         ("-c" "-q")
-     "uncompressing"      "gzip"         ("-c" "-q" "-d")
-     t nil "\037\213"]
-    ["\\.g?z\\(~\\|\\.~[0-9]+~\\)?\\'"
-     "compressing"        "gzip"         ("-c" "-q")
-     "uncompressing"      "gzip"         ("-c" "-q" "-d")
-     t t "\037\213"]
-    ;; dzip is gzip with random access.  Its compression program can't
-    ;; read/write stdin/out, so .dz files can only be viewed without
-    ;; saving, having their contents decompressed with gzip.
-    ["\\.dz\\'"
-     nil              nil            nil
-     "uncompressing"      "gzip"         ("-c" "-q" "-d")
-     nil t "\037\213"])
-
-  "List of vectors that describe available compression techniques.
-Each element, which describes a compression technique, is a vector of
-the form [REGEXP COMPRESS-MSG COMPRESS-PROGRAM COMPRESS-ARGS
-UNCOMPRESS-MSG UNCOMPRESS-PROGRAM UNCOMPRESS-ARGS
-APPEND-FLAG STRIP-EXTENSION-FLAG FILE-MAGIC-CHARS], where:
-
-   regexp                is a regexp that matches filenames that are
-                         compressed with this format
-
-   compress-msg          is the message to issue to the user when doing this
-                         type of compression (nil means no message)
-
-   compress-program      is a program that performs this compression
-                         (nil means visit file in read-only mode)
-
-   compress-args         is a list of args to pass to the compress program
-
-   uncompress-msg        is the message to issue to the user when doing this
-                         type of uncompression (nil means no message)
-
-   uncompress-program    is a program that performs this compression
-
-   uncompress-args       is a list of args to pass to the uncompress program
-
-   append-flag           is non-nil if this compression technique can be
-                         appended
-
-   strip-extension-flag  non-nil means strip the regexp from file names
-                         before attempting to set the mode.
-
-   file-magic-chars      is a string of characters that you would find
-			 at the beginning of a file compressed in this way.
-
-Because of the way `call-process' is defined, discarding the stderr output of
-a program adds the overhead of starting a shell each time the program is
-invoked."
-  :type '(repeat (vector regexp
-			 (choice :tag "Compress Message"
-				 (string :format "%v")
-				 (const :tag "No Message" nil))
-			 (choice :tag "Compress Program"
-				 (string)
-				 (const :tag "None" nil))
-			 (repeat :tag "Compress Arguments" string)
-			 (choice :tag "Uncompress Message"
-				 (string :format "%v")
-				 (const :tag "No Message" nil))
-			 (choice :tag "Uncompress Program"
-				 (string)
-				 (const :tag "None" nil))
-			 (repeat :tag "Uncompress Arguments" string)
-			 (boolean :tag "Append")
-			 (boolean :tag "Strip Extension")
-			 (string :tag "Magic Bytes")))
-  :group 'jka-compr)
-
-(defcustom jka-compr-mode-alist-additions
-  (list (cons "\\.tgz\\'" 'tar-mode) (cons "\\.tbz\\'" 'tar-mode))
-  "A list of pairs to add to `auto-mode-alist' when jka-compr is installed."
-  :type '(repeat (cons string symbol))
-  :group 'jka-compr)
-
-(defcustom jka-compr-load-suffixes '(".gz")
-  "List of suffixes to try when loading files."
-  :type '(repeat string)
-  :group 'jka-compr)
-
-;; List of all the elements we actually added to file-coding-system-alist.
-(defvar jka-compr-added-to-file-coding-system-alist nil)
-
-(defvar jka-compr-file-name-handler-entry
-  nil
-  "The entry in `file-name-handler-alist' used by the jka-compr I/O functions.")
-
-(defun jka-compr-build-file-regexp ()
-  (mapconcat
-   'jka-compr-info-regexp
-   jka-compr-compression-info-list
-   "\\|"))
-
-;;; Functions for accessing the return value of jka-compr-get-compression-info
-(defun jka-compr-info-regexp               (info)  (aref info 0))
-(defun jka-compr-info-compress-message     (info)  (aref info 1))
-(defun jka-compr-info-compress-program     (info)  (aref info 2))
-(defun jka-compr-info-compress-args        (info)  (aref info 3))
-(defun jka-compr-info-uncompress-message   (info)  (aref info 4))
-(defun jka-compr-info-uncompress-program   (info)  (aref info 5))
-(defun jka-compr-info-uncompress-args      (info)  (aref info 6))
-(defun jka-compr-info-can-append           (info)  (aref info 7))
-(defun jka-compr-info-strip-extension      (info)  (aref info 8))
-(defun jka-compr-info-file-magic-bytes     (info)  (aref info 9))
-
-
-(defun jka-compr-get-compression-info (filename)
-  "Return information about the compression scheme of FILENAME.
-The determination as to which compression scheme, if any, to use is
-based on the filename itself and `jka-compr-compression-info-list'."
-  (catch 'compression-info
-    (let ((case-fold-search nil))
-      (mapcar
-       (function (lambda (x)
-		   (and (string-match (jka-compr-info-regexp x) filename)
-			(throw 'compression-info x))))
-       jka-compr-compression-info-list)
-      nil)))
-
-(defun jka-compr-install ()
-  "Install jka-compr.
-This adds entries to `file-name-handler-alist' and `auto-mode-alist'
-and `inhibit-first-line-modes-suffixes'."
-
-  (setq jka-compr-file-name-handler-entry
-	(cons (jka-compr-build-file-regexp) 'jka-compr-handler))
-
-  (setq file-name-handler-alist (cons jka-compr-file-name-handler-entry
-				      file-name-handler-alist))
-
-  (setq jka-compr-added-to-file-coding-system-alist nil)
-
-  (mapcar
-   (function (lambda (x)
-	       ;; Don't do multibyte encoding on the compressed files.
-	       (let ((elt (cons (jka-compr-info-regexp x)
-				 '(no-conversion . no-conversion))))
-		 (setq file-coding-system-alist
-		       (cons elt file-coding-system-alist))
-		 (setq jka-compr-added-to-file-coding-system-alist
-		       (cons elt jka-compr-added-to-file-coding-system-alist)))
-
-	       (and (jka-compr-info-strip-extension x)
-		    ;; Make entries in auto-mode-alist so that modes
-		    ;; are chosen right according to the file names
-		    ;; sans `.gz'.
-		    (setq auto-mode-alist
-			  (cons (list (jka-compr-info-regexp x)
-				      nil 'jka-compr)
-				auto-mode-alist))
-		    ;; Also add these regexps to
-		    ;; inhibit-first-line-modes-suffixes, so that a
-		    ;; -*- line in the first file of a compressed tar
-		    ;; file doesn't override tar-mode.
-		    (setq inhibit-first-line-modes-suffixes
-			  (cons (jka-compr-info-regexp x)
-				inhibit-first-line-modes-suffixes)))))
-   jka-compr-compression-info-list)
-  (setq auto-mode-alist
-	(append auto-mode-alist jka-compr-mode-alist-additions))
-
-  ;; Make sure that (load "foo") will find /bla/foo.el.gz.
-  (setq load-suffixes
-	(apply 'append
-	       (mapcar (lambda (suffix)
-			 (cons suffix
-			       (mapcar (lambda (ext) (concat suffix ext))
-				       jka-compr-load-suffixes)))
-		       load-suffixes))))
-
-
-(defun jka-compr-installed-p ()
-  "Return non-nil if jka-compr is installed.
-The return value is the entry in `file-name-handler-alist' for jka-compr."
-
-  (let ((fnha file-name-handler-alist)
-	(installed nil))
-
-    (while (and fnha (not installed))
-     (and (eq (cdr (car fnha)) 'jka-compr-handler)
-	   (setq installed (car fnha)))
-      (setq fnha (cdr fnha)))
-
-    installed))
-
-(define-minor-mode auto-compression-mode
-  "Toggle automatic file compression and uncompression.
-With prefix argument ARG, turn auto compression on if positive, else off.
-Returns the new status of auto compression (non-nil means on)."
-  :global t :group 'jka-compr
-  (let* ((installed (jka-compr-installed-p))
-	 (flag auto-compression-mode))
-    (cond
-     ((and flag installed) t)		; already installed
-     ((and (not flag) (not installed)) nil) ; already not installed
-     (flag (jka-compr-install))
-     (t (jka-compr-uninstall)))))
-
-(defmacro with-auto-compression-mode (&rest body)
-  "Evalute BODY with automatic file compression and uncompression enabled."
-  (let ((already-installed (make-symbol "already-installed")))
-    `(let ((,already-installed (jka-compr-installed-p)))
-       (unwind-protect
-	   (progn
-	     (unless ,already-installed
-	       (jka-compr-install))
-	     ,@body)
-	 (unless ,already-installed
-	   (jka-compr-uninstall))))))
-(put 'with-auto-compression-mode 'lisp-indent-function 0)
-
-
-;;; This is what we need to know about jka-compr-handler
-;;; in order to decide when to call it.
-
-(put 'jka-compr-handler 'safe-magic t)
-(put 'jka-compr-handler 'operations '(jka-compr-byte-compiler-base-file-name
-				      write-region insert-file-contents
-				      file-local-copy load))
-
-;;; Turn on the mode.
-(auto-compression-mode 1)
-
-(provide 'jka-comp-hook)
-
-;; arch-tag: 4bd73429-f400-45fe-a065-270a113e31a8
-;;; jka-comp-hook.el ends here
\ No newline at end of file
--- a/lisp/jka-compr.el	Fri May 06 21:06:31 2005 +0000
+++ b/lisp/jka-compr.el	Mon May 09 16:13:15 2005 +0000
@@ -669,7 +669,7 @@
 	(inhibit-file-name-operation operation))
     (apply operation args)))
 
-
+;;;###autoload
 (defun jka-compr-uninstall ()
   "Uninstall jka-compr.
 This removes the entries in `file-name-handler-alist' and `auto-mode-alist'
--- a/lisp/loadup.el	Fri May 06 21:06:31 2005 +0000
+++ b/lisp/loadup.el	Mon May 09 16:13:15 2005 +0000
@@ -203,7 +203,7 @@
 (message "%s" (garbage-collect))
 
 (load "vc-hooks")
-(load "jka-comp-hook")
+(load "jka-cmpr-hook")
 (load "ediff-hook")
 (if (fboundp 'x-show-tip) (load "tooltip"))
 (message "%s" (garbage-collect))
--- a/lisp/net/goto-addr.el	Fri May 06 21:06:31 2005 +0000
+++ b/lisp/net/goto-addr.el	Mon May 09 16:13:15 2005 +0000
@@ -1,6 +1,6 @@
 ;;; goto-addr.el --- click to browse URL or to send to e-mail address
 
-;; Copyright (C) 1995, 2000, 2001 Free Software Foundation, Inc.
+;; Copyright (C) 1995, 2000, 2001, 2005  Free Software Foundation, Inc.
 
 ;; Author: Eric Ding <ericding@alum.mit.edu>
 ;; Maintainer: FSF
@@ -46,7 +46,7 @@
 ;;
 ;; (setq goto-address-highlight-keymap
 ;;   (let ((m (make-sparse-keymap)))
-;;     (define-key m [S-mouse-2] 'goto-address-at-mouse)
+;;     (define-key m [S-mouse-2] 'goto-address-at-point)
 ;;     m))
 ;;
 
@@ -118,9 +118,8 @@
 
 (defvar goto-address-highlight-keymap
   (let ((m (make-sparse-keymap)))
-    (if (featurep 'xemacs)
-	(define-key m (kbd "<button2>") 'goto-address-at-mouse)
-      (define-key m (kbd "<mouse-2>") 'goto-address-at-mouse))
+    (define-key m (if (featurep 'xemacs) (kbd "<button2>") (kbd "<mouse-2>"))
+      'goto-address-at-point)
     (define-key m (kbd "C-c RET") 'goto-address-at-point)
     m)
   "keymap to hold goto-addr's mouse key defs under highlighted URLs.")
@@ -165,6 +164,7 @@
                      (this-overlay (make-overlay s e)))
 		(and goto-address-fontify-p
                      (overlay-put this-overlay 'face goto-address-url-face))
+                (overlay-put this-overlay 'evaporate t)
 		(overlay-put this-overlay
                              'mouse-face goto-address-url-mouse-face)
 		(overlay-put this-overlay
@@ -179,6 +179,7 @@
                      (this-overlay (make-overlay s e)))
 		(and goto-address-fontify-p
                      (overlay-put this-overlay 'face goto-address-mail-face))
+                (overlay-put this-overlay 'evaporate t)
                 (overlay-put this-overlay 'mouse-face
                              goto-address-mail-mouse-face)
 		(overlay-put this-overlay
@@ -191,24 +192,18 @@
 ;; snarfed from browse-url.el
 
 ;;;###autoload
-(defun goto-address-at-mouse (event)
-  "Send to the e-mail address or load the URL clicked with the mouse.
-Send mail to address at position of mouse click.  See documentation for
-`goto-address-find-address-at-point'.  If no address is found
-there, then load the URL at or before the position of the mouse click."
-  (interactive "e")
-  (save-excursion
-    (mouse-set-point event)
-    (goto-address-at-point)))
+(define-obsolete-function-alias
+  'goto-address-at-mouse 'goto-address-at-point "22.1")
 
 ;;;###autoload
-(defun goto-address-at-point ()
+(defun goto-address-at-point (&optional event)
   "Send to the e-mail address or load the URL at point.
 Send mail to address at point.  See documentation for
 `goto-address-find-address-at-point'.  If no address is found
 there, then load the URL at or before point."
-  (interactive)
+  (interactive (list last-input-event))
   (save-excursion
+    (if event (mouse-set-point event))
     (let ((address (save-excursion (goto-address-find-address-at-point))))
       (if (and address
 	       (save-excursion
@@ -248,5 +243,5 @@
 
 (provide 'goto-addr)
 
-;;; arch-tag: ca47c505-5661-425d-a471-62bc6e75cf0a
+;; arch-tag: ca47c505-5661-425d-a471-62bc6e75cf0a
 ;;; goto-addr.el ends here
--- a/lisp/net/webjump.el	Fri May 06 21:06:31 2005 +0000
+++ b/lisp/net/webjump.el	Mon May 09 16:13:15 2005 +0000
@@ -274,9 +274,9 @@
 <nwv@acm.org>."
   (interactive)
   (let* ((completion-ignore-case t)
-	 (item (assoc-ignore-case
+	 (item (assoc-string
 		(completing-read "WebJump to site: " webjump-sites nil t)
-		webjump-sites))
+		webjump-sites t))
 	 (name (car item))
 	 (expr (cdr item)))
     (browse-url (webjump-url-fix
--- a/lisp/obsolete/uncompress.el	Fri May 06 21:06:31 2005 +0000
+++ b/lisp/obsolete/uncompress.el	Mon May 09 16:13:15 2005 +0000
@@ -83,14 +83,10 @@
   (goto-char (point-min))
   (message "Uncompressing...done")
   (set-buffer-modified-p nil)
-  (make-local-variable 'write-file-hooks)
-  (or (memq 'uncompress-backup-file write-file-hooks)
-      (setq write-file-hooks (cons 'uncompress-backup-file write-file-hooks)))
+  (add-hook 'write-file-functions 'uncompress-backup-file nil t)
   (normal-mode))
 
-(or (memq 'find-compressed-version find-file-not-found-hooks)
-    (setq find-file-not-found-hooks
-	  (cons 'find-compressed-version find-file-not-found-hooks)))
+(add-hook 'find-file-not-found-functions 'find-compressed-version)
 
 (defun find-compressed-version ()
   "Hook to read and uncompress the compressed version of a file."
--- a/lisp/pcvs.el	Fri May 06 21:06:31 2005 +0000
+++ b/lisp/pcvs.el	Mon May 09 16:13:15 2005 +0000
@@ -1438,12 +1438,10 @@
   ;; displayed in the wrong minibuffer).
   (cvs-mode!)
   (let ((buf (cvs-temp-buffer "message" 'normal 'nosetup))
-	(lbd list-buffers-directory)
 	(setupfun (or (nth 2 (cdr (assoc "message" cvs-buffer-name-alist)))
 		      'log-edit)))
     (funcall setupfun 'cvs-do-commit setup 'cvs-commit-filelist buf)
     (set (make-local-variable 'cvs-minor-wrap-function) 'cvs-commit-minor-wrap)
-    (set (make-local-variable 'list-buffers-directory) lbd)
     (run-hooks 'cvs-mode-commit-hook)))
 
 (defun cvs-commit-minor-wrap (buf f)
@@ -1494,14 +1492,12 @@
   ;; displayed in the wrong minibuffer).
   (cvs-mode!)
   (let ((buf (cvs-temp-buffer "message" 'normal 'nosetup))
-	(lbd list-buffers-directory)
 	(setupfun (or (nth 2 (cdr (assoc "message" cvs-buffer-name-alist)))
 		      'log-edit)))
     (funcall setupfun 'cvs-do-edit-log nil 'cvs-edit-log-filelist buf)
     (when text (erase-buffer) (insert text))
     (set (make-local-variable 'cvs-edit-log-revision) rev)
     (set (make-local-variable 'cvs-minor-wrap-function) 'cvs-edit-log-minor-wrap)
-    (set (make-local-variable 'list-buffers-directory) lbd)
     ;; (run-hooks 'cvs-mode-commit-hook)
     ))
 
--- a/lisp/progmodes/cmacexp.el	Fri May 06 21:06:31 2005 +0000
+++ b/lisp/progmodes/cmacexp.el	Mon May 09 16:13:15 2005 +0000
@@ -108,18 +108,23 @@
   :group 'c-macro)
 
 (defcustom c-macro-preprocessor
-  ;; Cannot rely on standard directory on MS-DOS to find CPP.  In
-  ;; fact, cannot rely on having cpp.exe, either, in latest GCC
-  ;; versions.
-  (cond ((eq system-type 'ms-dos) "gcc -E -C -o - -")
-	;; Solaris has it in an unusual place.
+  (cond ;; Solaris has it in an unusual place.
 	((and (string-match "^[^-]*-[^-]*-\\(solaris\\|sunos5\\)"
 			    system-configuration)
 	      (file-exists-p "/opt/SUNWspro/SC3.0.1/bin/acomp"))
 	 "/opt/SUNWspro/SC3.0.1/bin/acomp -C -E")
-        ((file-exists-p "/usr/ccs/lib/cpp") "/usr/ccs/lib/cpp -C")
-	((memq system-type '(darwin berkeley-unix)) "gcc -E -C -")
-	(t "/lib/cpp -C"))
+        ((locate-file "/usr/ccs/lib/cpp"
+		      '("/") exec-suffixes 'file-executable-p)
+	 "/usr/ccs/lib/cpp -C")
+	((locate-file "/lib/cpp"
+		      '("/") exec-suffixes 'file-executable-p)
+	 "/lib/cpp -C")
+	;; On some systems, we cannot rely on standard directories to
+	;; find CPP.  In fact, we cannot rely on having cpp, either,
+	;; in some GCC versions.
+	((locate-file "cpp" exec-path exec-suffixes 'file-executable-p)
+	 "cpp -C")
+	(t "gcc -E -C -o - -"))
   "The preprocessor used by the cmacexp package.
 
 If you change this, be sure to preserve the `-C' (don't strip comments)
--- a/lisp/progmodes/compile.el	Fri May 06 21:06:31 2005 +0000
+++ b/lisp/progmodes/compile.el	Mon May 09 16:13:15 2005 +0000
@@ -1247,7 +1247,8 @@
   (make-local-variable 'compilation-messages-start)
   (make-local-variable 'compilation-error-screen-columns)
   (make-local-variable 'overlay-arrow-position)
-  (set (make-local-variable 'overlay-arrow-string) "=>")
+  (set (make-local-variable 'overlay-arrow-string)
+       (if (display-graphic-p) "=>" ""))
   (setq next-error-overlay-arrow-position nil)
   (add-hook 'kill-buffer-hook
 	    (lambda () (setq next-error-overlay-arrow-position nil)) nil t)
--- a/lisp/progmodes/gdb-ui.el	Fri May 06 21:06:31 2005 +0000
+++ b/lisp/progmodes/gdb-ui.el	Mon May 09 16:13:15 2005 +0000
@@ -196,19 +196,20 @@
   :group 'gud
   :version "22.1")
 
-(defcustom gdb-cpp-define-alist-program 
-  (cond ((eq system-type 'ms-dos) "gcc -E -dM -o - -")
-	(t "gcc -E -dM -"))
-  "The program name for generating an alist of #define directives.
+(defcustom gdb-cpp-define-alist-program "gcc -E -dM -"
+  "Shell command for generating a list of defined macros in a source file.
 This list is used to display the #define directive associated
 with an identifier as a tooltip. It works in a debug session with
-GDB, when tooltip-gud-tips-p is t."
+GDB, when gud-tooltip-mode is t.
+
+Set `gdb-cpp-define-alist-flags' for any include paths or
+predefined macros."
   :type 'string
   :group 'gud
   :version "22.1")
 
 (defcustom gdb-cpp-define-alist-flags ""
-  "*Preprocessor flags used by `gdb-create-define-alist'."
+  "*Preprocessor flags for `gdb-cpp-define-alist-program'."
   :type 'string
   :group 'gud
   :version "22.1")
@@ -233,6 +234,14 @@
       (setq name (nth 1 (split-string define "[( ]")))
       (push (cons name define) gdb-define-alist))))
 
+(defun gdb-tooltip-print ()
+  (tooltip-show
+   (with-current-buffer (gdb-get-buffer 'gdb-partial-output-buffer)
+     (let ((string (buffer-string)))
+       ;; remove newline for gud-tooltip-echo-area
+       (substring string 0 (- (length string) 1))))
+   gud-tooltip-echo-area))
+
 (defun gdb-set-gud-minor-mode (buffer)
   "Set gud-minor-mode from find-file if appropriate."
   (goto-char (point-min))
@@ -252,9 +261,10 @@
     (with-current-buffer buffer
       (set (make-local-variable 'gud-minor-mode) 'gdba)
       (set (make-local-variable 'tool-bar-map) gud-tool-bar-map)
-      (make-local-variable 'gdb-define-alist)
-      (gdb-create-define-alist)
-      (add-hook 'after-save-hook 'gdb-create-define-alist nil t))))
+      (when gud-tooltip-mode
+	(make-local-variable 'gdb-define-alist)
+	(gdb-create-define-alist)
+	(add-hook 'after-save-hook 'gdb-create-define-alist nil t)))))
 
 (defun gdb-set-gud-minor-mode-existing-buffers ()
   (dolist (buffer (buffer-list))
--- a/lisp/progmodes/grep.el	Fri May 06 21:06:31 2005 +0000
+++ b/lisp/progmodes/grep.el	Mon May 09 16:13:15 2005 +0000
@@ -1,4 +1,4 @@
-;;; grep.el --- run compiler as inferior of Emacs, parse error messages
+;;; grep.el --- run Grep as inferior of Emacs, parse match messages
 
 ;; Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
 ;;   2001, 2002, 2004, 2005  Free Software Foundation, Inc.
--- a/lisp/progmodes/gud.el	Fri May 06 21:06:31 2005 +0000
+++ b/lisp/progmodes/gud.el	Mon May 09 16:13:15 2005 +0000
@@ -39,6 +39,8 @@
 
 ;;; Code:
 
+(eval-when-compile (require 'cl)) ; for case macro
+
 (require 'comint)
 (require 'etags)
 
@@ -113,11 +115,11 @@
 
 (easy-mmode-defmap gud-menu-map
   '(([help]     "Info" . gud-goto-info)
-    ([tooltips] menu-item "Toggle GUD tooltips" tooltip-toggle-gud-tips
+    ([tooltips] menu-item "Toggle GUD tooltips" gud-tooltip-mode
                   :enable  (and (not emacs-basic-display)
 				(display-graphic-p)
 				(fboundp 'x-show-tip))
-	          :button (:toggle . tooltip-gud-tips-p))
+	          :button (:toggle . gud-tooltip-mode))
     ([refresh]	"Refresh" . gud-refresh)
     ([run]	menu-item "Run" gud-run
                   :enable (and (not gud-running)
@@ -228,7 +230,8 @@
       (with-current-buffer buf
 	(set (make-local-variable 'gud-minor-mode) minor-mode)
 	(set (make-local-variable 'tool-bar-map) gud-tool-bar-map)
-	(when (memq gud-minor-mode '(gdbmi gdba))
+	(when (and gud-tooltip-mode
+		   (memq gud-minor-mode '(gdbmi gdba)))
 	  (make-local-variable 'gdb-define-alist)
 	  (unless  gdb-define-alist (gdb-create-define-alist))
 	  (add-hook 'after-save-hook 'gdb-create-define-alist nil t))
@@ -3100,6 +3103,204 @@
 	 (font-lock-syntactic-face-function
 	  . gdb-script-font-lock-syntactic-face))))
 
+
+;;; tooltips for GUD
+
+;;; Customizable settings
+(defcustom gud-tooltip-modes '(gud-mode c-mode c++-mode fortran-mode)
+  "List of modes for which to enable GUD tips."
+  :type 'sexp
+  :tag "GUD modes"
+  :group 'tooltip)
+
+(defcustom gud-tooltip-display
+  '((eq (tooltip-event-buffer gud-tooltip-event)
+	(marker-buffer gud-overlay-arrow-position)))
+  "List of forms determining where GUD tooltips are displayed.
+
+Forms in the list are combined with AND.  The default is to display
+only tooltips in the buffer containing the overlay arrow."
+  :type 'sexp
+  :tag "GUD buffers predicate"
+  :group 'tooltip)
+
+(defcustom gud-tooltip-echo-area nil
+  "Use the echo area instead of frames for GUD tooltips."
+  :type 'boolean
+  :tag "Use echo area"
+  :group 'tooltip)
+
+(define-obsolete-variable-alias 'tooltip-gud-modes
+                                'gud-tooltip-modes "22.1")
+(define-obsolete-variable-alias 'tooltip-gud-display
+                                'gud-tooltip-display "22.1")
+(define-obsolete-variable-alias 'tooltip-use-echo-area
+                                'gud-tooltip-echo-area "22.1")
+
+;;; Reacting on mouse movements
+
+(defun gud-tooltip-change-major-mode ()
+  "Function added to `change-major-mode-hook' when tooltip mode is on."
+  (add-hook 'post-command-hook 'gud-tooltip-activate-mouse-motions-if-enabled))
+
+(defun gud-tooltip-activate-mouse-motions-if-enabled ()
+  "Reconsider for all buffers whether mouse motion events are desired."
+  (remove-hook 'post-command-hook
+	       'gud-tooltip-activate-mouse-motions-if-enabled)
+  (dolist (buffer (buffer-list))
+    (save-excursion
+      (set-buffer buffer)
+      (if (and gud-tooltip-mode
+	       (memq major-mode gud-tooltip-modes))
+	  (gud-tooltip-activate-mouse-motions t)
+	(gud-tooltip-activate-mouse-motions nil)))))
+
+(defvar gud-tooltip-mouse-motions-active nil
+  "Locally t in a buffer if tooltip processing of mouse motion is enabled.")
+
+(defun gud-tooltip-activate-mouse-motions (activatep)
+  "Activate/deactivate mouse motion events for the current buffer.
+ACTIVATEP non-nil means activate mouse motion events."
+  (if activatep
+      (progn
+	(make-local-variable 'gud-tooltip-mouse-motions-active)
+	(setq gud-tooltip-mouse-motions-active t)
+	(make-local-variable 'track-mouse)
+	(setq track-mouse t))
+    (when gud-tooltip-mouse-motions-active
+      (kill-local-variable 'gud-tooltip-mouse-motions-active)
+      (kill-local-variable 'track-mouse))))
+
+(defun gud-tooltip-mouse-motion (event)
+  "Command handler for mouse movement events in `global-map'."
+  (interactive "e")
+  (tooltip-hide)
+  (when (car (mouse-pixel-position))
+    (setq tooltip-last-mouse-motion-event (copy-sequence event))
+    (tooltip-start-delayed-tip)))
+
+;;; Tips for `gud'
+
+(defvar gud-tooltip-original-filter nil
+  "Process filter to restore after GUD output has been received.")
+
+(defvar gud-tooltip-dereference nil
+  "Non-nil means print expressions with a `*' in front of them.
+For C this would dereference a pointer expression.")
+
+(defvar gud-tooltip-event nil
+  "The mouse movement event that led to a tooltip display.
+This event can be examined by forms in GUD-TOOLTIP-DISPLAY.")
+
+(defun gud-tooltip-toggle-dereference ()
+  "Toggle whether tooltips should show `* expr' or `expr'."
+  (interactive)
+  (setq gud-tooltip-dereference (not gud-tooltip-dereference))
+  (when (interactive-p)
+    (message "Dereferencing is now %s."
+	     (if gud-tooltip-dereference "on" "off"))))
+
+(define-obsolete-function-alias 'tooltip-gud-toggle-dereference
+                                'gud-tooltip-toggle-dereference "22.1")
+
+(define-minor-mode gud-tooltip-mode
+  "Toggle the display of GUD tooltips."
+  :global t
+  :group 'gud
+  (if gud-tooltip-mode
+      (progn
+	(add-hook 'change-major-mode-hook 'gud-tooltip-change-major-mode)
+	(add-hook 'pre-command-hook 'tooltip-hide)
+	(add-hook 'tooltip-hook 'gud-tooltip-tips)
+	(define-key global-map [mouse-movement] 'gud-tooltip-mouse-motion))
+    (unless tooltip-mode (remove-hook 'pre-command-hook 'tooltip-hide)
+    (remove-hook 'change-major-mode-hook 'tooltip-change-major-mode)
+    (remove-hook 'tooltip-hook 'gud-tooltip-tips)
+    (define-key global-map [mouse-movement] 'ignore)))
+  (gud-tooltip-activate-mouse-motions-if-enabled)
+  (if (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba))
+      (if gud-tooltip-mode
+	  (progn
+	    (dolist (buffer (buffer-list))
+	      (unless (eq buffer gud-comint-buffer)
+		(with-current-buffer buffer
+		  (when (and (memq gud-minor-mode '(gdbmi gdba))
+			     (not (string-match "\\`\\*.+\\*\\'"
+						(buffer-name))))
+		    (make-local-variable 'gdb-define-alist)
+		    (gdb-create-define-alist)
+		    (add-hook 'after-save-hook
+			      'gdb-create-define-alist nil t))))))
+	(kill-local-variable 'gdb-define-alist)
+	(remove-hook 'after-save-hook 'gdb-create-define-alist t))))
+
+; This will only display data that comes in one chunk.
+; Larger arrays (say 400 elements) are displayed in
+; the tootip incompletely and spill over into the gud buffer.
+; Switching the process-filter creates timing problems and
+; it may be difficult to do better. Using annotations as in
+; gdb-ui.el gets round this problem.
+(defun gud-tooltip-process-output (process output)
+  "Process debugger output and show it in a tooltip window."
+  (set-process-filter process gud-tooltip-original-filter)
+  (tooltip-show (tooltip-strip-prompt process output)
+		gud-tooltip-echo-area))
+
+(defun gud-tooltip-print-command (expr)
+  "Return a suitable command to print the expression EXPR.
+If GUD-TOOLTIP-DEREFERENCE is t, also prepend a `*' to EXPR."
+  (when gud-tooltip-dereference
+    (setq expr (concat "*" expr)))
+  (case gud-minor-mode
+    ((gdb gdba) (concat "server print " expr))
+    (dbx (concat "print " expr))
+    (xdb (concat "p " expr))
+    (sdb (concat expr "/"))
+    (perldb expr)))
+
+(defun gud-tooltip-tips (event)
+  "Show tip for identifier or selection under the mouse.
+The mouse must either point at an identifier or inside a selected
+region for the tip window to be shown.  If gud-tooltip-dereference is t,
+add a `*' in front of the printed expression. In the case of a C program
+controlled by GDB, show the associated #define directives when program is
+not executing.
+
+This function must return nil if it doesn't handle EVENT."
+  (let (process)
+    (when (and (eventp event)
+	       gud-tooltip-mode
+	       (boundp 'gud-comint-buffer)
+	       gud-comint-buffer
+	       (buffer-name gud-comint-buffer); gud-comint-buffer might be killed
+	       (setq process (get-buffer-process gud-comint-buffer))
+	       (posn-point (event-end event))
+	       (or (and (eq gud-minor-mode 'gdba) (not gdb-active-process))
+		   (progn (setq gud-tooltip-event event)
+			  (eval (cons 'and gud-tooltip-display)))))
+      (let ((expr (tooltip-expr-to-print event)))
+	(when expr
+	  (if (and (eq gud-minor-mode 'gdba)
+		   (not gdb-active-process))
+	      (progn
+		(with-current-buffer
+		    (window-buffer (let ((mouse (mouse-position)))
+				     (window-at (cadr mouse)
+						(cddr mouse))))
+		  (let ((define-elt (assoc expr gdb-define-alist)))
+		    (unless (null define-elt)
+		      (tooltip-show (cdr define-elt))
+		      expr))))
+	    (let ((cmd (gud-tooltip-print-command expr)))
+	      (unless (null cmd) ; CMD can be nil if unknown debugger
+		(if (eq gud-minor-mode 'gdba)
+		    (gdb-enqueue-input
+		     (list  (concat cmd "\n") 'gdb-tooltip-print))
+		  (setq gud-tooltip-original-filter (process-filter process))
+		  (set-process-filter process 'gud-tooltip-process-output)
+		  (gud-basic-call cmd))
+		expr))))))))
+
 (provide 'gud)
 
 ;;; arch-tag: 6d990948-df65-461a-be39-1c7fb83ac4c4
--- a/lisp/progmodes/idlw-help.el	Fri May 06 21:06:31 2005 +0000
+++ b/lisp/progmodes/idlw-help.el	Mon May 09 16:13:15 2005 +0000
@@ -36,7 +36,7 @@
 ;; information, at:
 ;;
 ;;           http://idlwave.org
-;; 
+;;
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 
@@ -52,10 +52,10 @@
   :group 'idlwave-online-help
   :type 'boolean)
 
-(defvar idlwave-html-link-sep 
+(defvar idlwave-html-link-sep
   (if idlwave-html-help-pre-v6 "#" "#wp"))
 
-(defcustom idlwave-html-help-location 
+(defcustom idlwave-html-help-location
   (if (memq system-type '(ms-dos windows-nt))
       nil
     "/usr/local/etc/")
@@ -83,7 +83,7 @@
   :group 'idlwave-online-help
   :type 'string)
 
-(defcustom idlwave-help-browser-generic-args 
+(defcustom idlwave-help-browser-generic-args
   (if (boundp 'browse-url-generic-args)
       browse-url-generic-args "")
   "Program args to use if using browse-url-generic-program."
@@ -191,7 +191,7 @@
 
 (defvar idlwave-help-activate-links-aggressively nil
   "Obsolete variable.")
-  
+
 (defvar idlwave-completion-help-info)
 
 (defvar idlwave-help-frame nil
@@ -314,7 +314,7 @@
       (setq idlwave-last-context-help-pos marker)
       (idlwave-do-context-help1 arg)
       (if idlwave-help-diagnostics
-	  (message "%s" (mapconcat 'identity 
+	  (message "%s" (mapconcat 'identity
 				   (nreverse idlwave-help-diagnostics)
 				   "; "))))))
 
@@ -323,7 +323,7 @@
 (defun idlwave-do-context-help1 (&optional arg)
   "The work-horse version of `idlwave-context-help', which see."
   (save-excursion
-    (if (equal (char-after) ?/) 
+    (if (equal (char-after) ?/)
 	(forward-char 1)
       (if (equal (char-before) ?=)
 	  (backward-char 1)))
@@ -333,7 +333,7 @@
 	   (beg (save-excursion (skip-chars-backward chars) (point)))
 	   (end (save-excursion (skip-chars-forward chars) (point)))
 	   (this-word (buffer-substring-no-properties beg end))
-	   (st-ass (assoc (downcase this-word) 
+	   (st-ass (assoc (downcase this-word)
 			  idlwave-help-special-topic-words))
 	   (classtag (and (string-match "self\\." this-word)
 			  (< beg (- end 4))))
@@ -341,7 +341,7 @@
 			   (string-match "\\`\\([^.]+\\)\\." this-word)
 			   (< beg (- end 4))))
 	   module keyword cw mod1 mod2 mod3)
-      (if (or arg 
+      (if (or arg
 	      (and (not st-ass)
 		   (not classtag)
 		   (not structtag)
@@ -360,15 +360,15 @@
 		      (setq module (list "init" 'fun (match-string 1 str))
 			    idlwave-current-obj_new-class (match-string 1 str))
 		    )))))
-      (cond 
+      (cond
        (arg (setq mod1 module))
-       
+
        ;; A special topic -- only system help
        (st-ass (setq mod1 (list (cdr st-ass))))
-       
+
        ;; A system variable -- only system help
-       ((string-match 
-	 "\\`!\\([a-zA-Z0-9_]+\\)\\(\.\\([A-Za-z0-9_]+\\)\\)?" 
+       ((string-match
+	 "\\`!\\([a-zA-Z0-9_]+\\)\\(\.\\([A-Za-z0-9_]+\\)\\)?"
 	 this-word)
 	(let* ((word  (match-string-no-properties 1 this-word))
 	       (entry (assq (idlwave-sintern-sysvar word)
@@ -380,18 +380,19 @@
 				      (cdr (assq 'tags entry))))))
 	       (link (nth 1 (assq 'link entry))))
 	  (if tag-target
-	      (setq link (idlwave-substitute-link-target link 
+	      (setq link (idlwave-substitute-link-target link
 							 tag-target)))
 	  (setq mod1 (list link))))
-			  
+
        ;; An executive command -- only system help
        ((string-match "^\\.\\([A-Z_]+\\)" this-word)
 	(let* ((word  (match-string 1 this-word))
-	       (link  (cdr (assoc-ignore-case 
+	       (link  (cdr (assoc-string
 			    word
-			    idlwave-executive-commands-alist))))
+			    idlwave-executive-commands-alist
+                            t))))
 	  (setq mod1 (list link))))
-       
+
        ;; A class -- system OR in-text help (via class__define).
        ((and (eq cw 'class)
 	     (or (idlwave-in-quote)  ; e.g. obj_new
@@ -405,28 +406,28 @@
 	       (name   (concat (downcase this-word) "__define"))
 	       (link   (nth 1 (assq 'link entry))))
 	  (setq mod1 (list link name 'pro))))
-       
+
        ;; A class structure tag (self.BLAH) -- only in-text help available
        (classtag
 	(let ((tag (substring this-word (match-end 0)))
 	      class-with found-in)
-	  (when (setq class-with 
+	  (when (setq class-with
 		      (idlwave-class-or-superclass-with-tag
 		       (nth 2 (idlwave-current-routine))
 		       tag))
 	    (setq found-in (idlwave-class-found-in class-with))
-	    (if (assq (idlwave-sintern-class class-with) 
+	    (if (assq (idlwave-sintern-class class-with)
 		      idlwave-system-class-info)
 		(error "No help available for system class tags"))
 	    (setq idlwave-help-do-class-struct-tag t)
-	    (setq mod1 (list nil 
+	    (setq mod1 (list nil
 			     (if found-in
 				 (cons (concat found-in "__define") class-with)
 			       (concat class-with "__define"))
 			     'pro
 			     nil ; no class.... it's a procedure!
 			     tag)))))
-       
+
        ;; A regular structure tag -- only in text, and if
        ;; optional `complete-structtag' loaded.
        (structtag
@@ -437,7 +438,7 @@
 	  (setq idlwave-help-do-struct-tag
 		idlwave-structtag-struct-location
 		mod1 (list nil nil nil nil tag))))
-       
+
        ;; A routine keyword -- in text or system help
        ((and (memq cw '(function-keyword procedure-keyword))
 	     (stringp this-word)
@@ -479,7 +480,7 @@
 	       (setq mod1 (append (list t) module (list keyword))
 		     mod2 (list t this-word 'fun nil)
 		     mod3 (append (list t) module)))))
-       
+
        ;; Everything else
        (t
 	(setq mod1 (append (list t) module))))
@@ -512,14 +513,14 @@
 	 word link)
     (mouse-set-point ev)
 
-	  
+
     ;; See if we can also find help somewhere, e.g. for multiple classes
     (setq word (idlwave-this-word))
     (if (string= word "")
 	(error "No help item selected"))
     (setq link (get-text-property 0 'link word))
     (select-window cw)
-    (cond 
+    (cond
      ;; Routine name
      ((memq what '(procedure function routine))
       (setq name word)
@@ -530,9 +531,9 @@
 			   type)))
 	    (setq link t)		; No specific link valid yet
 	    (if sclasses
-		(setq classes (idlwave-members-only 
+		(setq classes (idlwave-members-only
 			       classes (cons class sclasses))))
-	    (setq class (idlwave-popup-select ev classes 
+	    (setq class (idlwave-popup-select ev classes
 					      "Select Class" 'sort))))
 
       ;; XXX is this necessary, given all-method-classes?
@@ -552,7 +553,7 @@
 			   type)))
 	    (setq link t) ; Link can't be correct yet
 	    (if sclasses
-		(setq classes (idlwave-members-only 
+		(setq classes (idlwave-members-only
 			       classes (cons class sclasses))))
 	    (setq class (idlwave-popup-select ev classes
 					      "Select Class" 'sort))
@@ -564,14 +565,14 @@
 	(if (string= (downcase name) "obj_new")
 	    (setq class idlwave-current-obj_new-class
 		  name "Init"))))
-	  
+
      ;; Class name
      ((eq what 'class)
       (setq class word
 	    word nil))
-     
+
      ;; A special named function to call which sets some of our variables
-     ((and (symbolp what) 
+     ((and (symbolp what)
 	   (fboundp what))
       (funcall what 'set word))
 
@@ -586,7 +587,7 @@
   "Highlight all completions for which help is available and attach link.
 Those words in `idlwave-completion-help-links' have links.  The
 `idlwave-help-link-face' face is used for this."
-  (if idlwave-highlight-help-links-in-completion      
+  (if idlwave-highlight-help-links-in-completion
       (with-current-buffer (get-buffer "*Completions*")
 	(save-excursion
 	  (let* ((case-fold-search t)
@@ -602,13 +603,13 @@
 	      (setq beg (match-beginning 1) end (match-end 1)
 		    word (match-string 1) doit nil)
 	      ;; Call special completion function test
-	      (if (and (symbolp what) 
+	      (if (and (symbolp what)
 		       (fboundp what))
 		  (setq doit (funcall what 'test word))
 		;; Look for special link property passed in help-links
 		(if idlwave-completion-help-links
-		    (setq doit (assoc-ignore-case 
-				word idlwave-completion-help-links))))
+		    (setq doit (assoc-string
+				word idlwave-completion-help-links t))))
 	      (when doit
 		(if (consp doit)
 		    (setq props (append props `(link ,(cdr doit)))))
@@ -633,13 +634,13 @@
 	     ;; Try to select the return frame.
 	     ;; This can crash on slow network connections, obviously when
 	     ;; we kill the help frame before the return-frame is selected.
-	     ;; To protect the workings, we wait for up to one second 
+	     ;; To protect the workings, we wait for up to one second
 	     ;; and check if the return-frame *is* now selected.
 	     ;; This is marked "eperimental" since we are not sure when its OK.
 	     (let ((maxtime 1.0) (time 0.) (step 0.1))
 	       (select-frame idlwave-help-return-frame)
 	       (while (and (sit-for step)
-			   (not (eq (selected-frame) 
+			   (not (eq (selected-frame)
 				    idlwave-help-return-frame))
 			   (< (setq time (+ time step)) maxtime)))))
 	 (delete-frame idlwave-help-frame))
@@ -652,7 +653,7 @@
 (defvar default-toolbar-visible-p)
 
 (defun idlwave-help-display-help-window (&optional pos-or-func)
-  "Display the help window.  
+  "Display the help window.
 Move window start to POS-OR-FUNC, if passed as a position, or call it
 if passed as a function.  See `idlwave-help-use-dedicated-frame'."
   (let ((cw (selected-window))
@@ -663,13 +664,13 @@
 	  (switch-to-buffer buf))
       ;; Do it in this frame and save the window configuration
       (if (not (get-buffer-window buf nil))
-	  (setq idlwave-help-window-configuration 
+	  (setq idlwave-help-window-configuration
 		(current-window-configuration)))
       (display-buffer buf nil (selected-frame))
       (select-window (get-buffer-window buf)))
     (raise-frame)
-    (if pos-or-func 
-	(if (functionp pos-or-func) 
+    (if pos-or-func
+	(if (functionp pos-or-func)
 	    (funcall pos-or-func)
 	  (goto-char pos-or-func)
 	  (recenter 0)))
@@ -691,31 +692,31 @@
       (select-frame idlwave-help-return-frame)))
 
 (defun idlwave-online-help (link &optional name type class keyword)
-  "Display HTML or other special help on a certain topic.  
+  "Display HTML or other special help on a certain topic.
 Either loads an HTML link, if LINK is non-nil, or gets special-help on
 the optional arguments, if any special help is defined.  If LINK is
 `t', first look up the optional arguments in the routine info list to
 see if a link is set for it.  Try extra help functions if necessary."
   ;; Lookup link
-  (if (eq link t) 
-      (let ((entry (idlwave-best-rinfo-assoc name type class 
+  (if (eq link t)
+      (let ((entry (idlwave-best-rinfo-assoc name type class
 					     (idlwave-routines) nil t)))
 	(cond
 	 ;; Try keyword link
-	 ((and keyword 
+	 ((and keyword
 	       (setq link (cdr (idlwave-entry-find-keyword entry keyword)))))
 	 ;; Default, regular entry link
 	 (t (setq link (idlwave-entry-has-help entry))))))
 
   (cond
    ;; An explicit link
-   ((stringp link) 
+   ((stringp link)
     (idlwave-help-html-link link))
-   
+
    ;; Any extra help
    (idlwave-extra-help-function
     (idlwave-help-get-special-help name type class keyword))
-   
+
    ;; Nothing worked
    (t (idlwave-help-error name type class keyword))))
 
@@ -726,7 +727,7 @@
 	 (help-pos (save-excursion
 		     (set-buffer (idlwave-help-get-help-buffer))
 		     (let ((buffer-read-only nil))
-		       (funcall idlwave-extra-help-function 
+		       (funcall idlwave-extra-help-function
 				name type class keyword)))))
     (if help-pos
 	(idlwave-help-display-help-window help-pos)
@@ -740,7 +741,7 @@
 	(browse-url-generic-program idlwave-help-browser-generic-program)
 	;(browse-url-generic-args idlwave-help-browser-generic-args)
 	full-link)
-    
+
     (if (and (memq system-type '(ms-dos windows-nt))
 	     idlwave-help-use-hh)
 	(progn
@@ -755,12 +756,12 @@
       ;; Just a regular file name (+ anchor name)
       (unless (and (stringp help-loc)
 		   (file-directory-p help-loc))
-	(error 
+	(error
 	 "Invalid help location; customize `idlwave-html-help-location'."))
-      (setq full-link (concat 
+      (setq full-link (concat
 		       "file://"
-		       (expand-file-name 
-			link 
+		       (expand-file-name
+			link
 			(expand-file-name "idl_html_help" help-loc)))))
 
     ;; Check for a local browser
@@ -796,7 +797,7 @@
     (if class-only   ;Help with class?  Using "Init" as source.
 	(setq name "Init"
 	      type 'fun))
-    (if (not struct-tag) 
+    (if (not struct-tag)
 	(setq file
 	      (idlwave-routine-source-file
 	       (nth 3 (idlwave-best-rinfo-assoc
@@ -809,7 +810,7 @@
     (if (or struct-tag (stringp file))
 	(progn
 	  (setq in-buf ; structure-tag completion is always in current buffer
-		(if struct-tag 
+		(if struct-tag
 		    idlwave-current-tags-buffer
 		  (idlwave-get-buffer-visiting file)))
 	  ;; see if file is in a visited buffer, insert those contents
@@ -831,19 +832,19 @@
     ;; Try to find a good place to display
     (setq def-pos
 	  ;; Find the class structure tag if that's what we're after
-	  (cond 
+	  (cond
 	   ;; Class structure tags: find the class or named structure
 	   ;; definition
 	   (class-struct-tag
-	    (save-excursion 
+	    (save-excursion
 	      (setq class
-		    (if (string-match "[a-zA-Z0-9]\\(__\\)" name) 
+		    (if (string-match "[a-zA-Z0-9]\\(__\\)" name)
 			(substring name 0 (match-beginning 1))
 		      idlwave-current-tags-class))
 	      (and
 	       (idlwave-find-class-definition class nil real-class)
 	       (idlwave-find-struct-tag keyword))))
-	   
+
 	   ;; Generic structure tags: the structure definition
 	   ;; location within the file has been recorded in
 	   ;; `struct-tag'
@@ -853,14 +854,14 @@
 	       (integerp struct-tag)
 	       (goto-char struct-tag)
 	       (idlwave-find-struct-tag keyword))))
-	   
+
 	   ;; Just find the routine definition
 	   (t
 	    (if class-only (point-min)
 	      (idlwave-help-find-routine-definition name type class keyword))))
 	  idlwave-help-def-pos def-pos)
 
-    (if (and idlwave-help-source-try-header 
+    (if (and idlwave-help-source-try-header
 	     (not (or struct-tag class-struct-tag)))
 	;; Check if we can find the header
 	(save-excursion
@@ -870,7 +871,7 @@
 		idlwave-help-in-header header-pos)))
 
     (if (or header-pos def-pos)
-	(progn 
+	(progn
 	  (if (boundp 'idlwave-help-min-frame-width)
 	      (setq idlwave-help-min-frame-width 80))
 	  (goto-char (or header-pos def-pos)))
@@ -884,7 +885,7 @@
 KEYWORD is ignored. Returns the point of match if successful, nil otherwise."
   (save-excursion
     (goto-char (point-max))
-    (if (re-search-backward 
+    (if (re-search-backward
 	 (concat "^[ \t]*"
 		 (if (eq type 'pro) "pro"
 		   (if (eq type 'fun) "function"
@@ -930,22 +931,22 @@
 If there is a match, we assume it is the keyword description."
   (let* ((case-fold-search t)
 	 (rname (if (stringp class)
-		    (concat 
+		    (concat
 		     "\\("
 		     ;; Traditional name or class::name
 		     "\\("
 		     "\\(" (regexp-quote (downcase class)) "::\\)?"
 		     (regexp-quote (downcase name))
 		     "\\>\\)"
-		     (concat 
+		     (concat
 		      "\\|"
 		      ;; class__define or just class
 		      (regexp-quote (downcase class)) "\\(__define\\)?")
 		     "\\)")
 		  (regexp-quote (downcase name))))
-	 
+
 	 ;; NAME tag plus the routine name.  The new version is from JD.
-	 (name-re (concat 
+	 (name-re (concat
 		   "\\(^;+\\*?[ \t]*"
 		   idlwave-help-doclib-name
 		   "\\([ \t]*:\\|[ \t]*$\\)[ \t]*\\(\n;+[ \t]*\\)*"
@@ -980,7 +981,7 @@
 		       (regexp-quote (upcase keyword))
 		      "\\>")))
 	 dstart dend name-pos kwds-pos kwd-pos)
-    (catch 'exit 
+    (catch 'exit
       (save-excursion
 	(goto-char (point-min))
 	(while (and (setq dstart (re-search-forward idlwave-doclib-start nil t))
@@ -988,7 +989,7 @@
 	  ;; found a routine header
 	  (goto-char dstart)
 	  (if (setq name-pos (re-search-forward name-re dend t))
-	      (progn 
+	      (progn
 		(if keyword
 		    ;; We do need a keyword
 		    (progn
@@ -1070,7 +1071,7 @@
       (idlwave-help-find-first-header nil)
     (setq idlwave-help-in-header nil)
     (idlwave-help-toggle-header-match-and-def arg 'top)))
-  
+
 (defun idlwave-help-toggle-header-match-and-def (arg &optional top)
   (interactive "P")
   (let ((args idlwave-help-args)
@@ -1082,7 +1083,7 @@
 	  (setq pos idlwave-help-def-pos))
       ;; Try to display header
       (setq pos (apply 'idlwave-help-find-in-doc-header
-		       (if top 
+		       (if top
 			   (list (car args) (nth 1 args) (nth 2 args) nil)
 			 args)))
       (if pos
@@ -1116,7 +1117,7 @@
 	      (font-lock-fontify-buffer))
 	  (set-syntax-table syntax-table)))))
 
-      
+
 (defun idlwave-help-error (name type class keyword)
   (error "Can't find help on %s%s %s"
 	 (or (and (or class name) (idlwave-make-full-name class name))
--- a/lisp/replace.el	Fri May 06 21:06:31 2005 +0000
+++ b/lisp/replace.el	Mon May 09 16:13:15 2005 +0000
@@ -977,32 +977,33 @@
     (setq occur-buf (get-buffer-create buf-name))
 
     (with-current-buffer occur-buf
-      (setq buffer-read-only nil)
       (occur-mode)
-      (erase-buffer)
-      (let ((count (occur-engine
-		    regexp active-bufs occur-buf
-		    (or nlines list-matching-lines-default-context-lines)
-		    (and case-fold-search
-			 (isearch-no-upper-case-p regexp t))
-		    list-matching-lines-buffer-name-face
-		    nil list-matching-lines-face t)))
-	(let* ((bufcount (length active-bufs))
-	       (diff (- (length bufs) bufcount)))
-	  (message "Searched %d buffer%s%s; %s match%s for `%s'"
-		   bufcount (if (= bufcount 1) "" "s")
-		   (if (zerop diff) "" (format " (%d killed)" diff))
-		   (if (zerop count) "no" (format "%d" count))
-		   (if (= count 1) "" "es")
-		   regexp))
-	(setq occur-revert-arguments (list regexp nlines bufs)
-	      buffer-read-only t)
-	(if (> count 0)
-	    (progn
-	      (display-buffer occur-buf)
-	      (setq next-error-last-buffer occur-buf))
-	  (kill-buffer occur-buf)))
-      (run-hooks 'occur-hook))))
+      (let ((inhibit-read-only t))
+	(erase-buffer)
+	(let ((count (occur-engine
+		      regexp active-bufs occur-buf
+		      (or nlines list-matching-lines-default-context-lines)
+		      (and case-fold-search
+			   (isearch-no-upper-case-p regexp t))
+		      list-matching-lines-buffer-name-face
+		      nil list-matching-lines-face t)))
+	  (let* ((bufcount (length active-bufs))
+		 (diff (- (length bufs) bufcount)))
+	    (message "Searched %d buffer%s%s; %s match%s for `%s'"
+		     bufcount (if (= bufcount 1) "" "s")
+		     (if (zerop diff) "" (format " (%d killed)" diff))
+		     (if (zerop count) "no" (format "%d" count))
+		     (if (= count 1) "" "es")
+		     regexp))
+	  (setq occur-revert-arguments (list regexp nlines bufs))
+	  (if (> count 0)
+	      (progn
+		(display-buffer occur-buf)
+		(setq next-error-last-buffer occur-buf))
+	    (kill-buffer occur-buf)))
+	(run-hooks 'occur-hook))
+      (setq buffer-read-only t)
+      (set-buffer-modified-p nil))))
 
 (defun occur-engine-add-prefix (lines)
   (mapcar
@@ -1013,7 +1014,6 @@
 (defun occur-engine (regexp buffers out-buf nlines case-fold-search
 			    title-face prefix-face match-face keep-props)
   (with-current-buffer out-buf
-    (setq buffer-read-only nil)
     (let ((globalcount 0)
 	  (coding nil))
       ;; Map over all the buffers
--- a/lisp/simple.el	Fri May 06 21:06:31 2005 +0000
+++ b/lisp/simple.el	Mon May 09 16:13:15 2005 +0000
@@ -113,9 +113,7 @@
 (defvar next-error-highlight-timer nil)
 
 (defvar next-error-overlay-arrow-position nil)
-;; This is nil so as not to really display anything on text
-;; terminals.  On text terminals, it would hide part of the file name.
-(put 'next-error-overlay-arrow-position 'overlay-arrow-string "")
+(put 'next-error-overlay-arrow-position 'overlay-arrow-string "=>")
 (add-to-list 'overlay-arrow-variable-list 'next-error-overlay-arrow-position)
 
 (defvar next-error-last-buffer nil
--- a/lisp/term/mac-win.el	Fri May 06 21:06:31 2005 +0000
+++ b/lisp/term/mac-win.el	Mon May 09 16:13:15 2005 +0000
@@ -1168,7 +1168,8 @@
 (defun x-select-text (text &optional push)
   (x-set-selection 'PRIMARY text)
   (setq x-last-selected-text-primary text)
-  (when x-select-enable-clipboard
+  (if (not x-select-enable-clipboard)
+      (setq x-last-selected-text-clipboard nil)
     (x-set-selection 'CLIPBOARD text)
     (setq x-last-selected-text-clipboard text))
   )
@@ -1203,20 +1204,26 @@
 		 (setq data
 		       (decode-coding-string data 'utf-16)))))
 	    ((eq data-type 'com.apple.traditional-mac-plain-text)
-	     (setq data (decode-coding-string data coding))))
+	     (setq data (decode-coding-string data coding)))
+	    ((eq data-type 'public.file-url)
+	     (setq data (decode-coding-string data 'utf-8))
+	     ;; Remove a trailing nul character.
+	     (let ((len (length data)))
+	       (if (and (> len 0) (= (aref data (1- len)) ?\0))
+		   (setq data (substring data 0 (1- len)))))))
       (put-text-property 0 (length data) 'foreign-selection data-type data))
     data))
 
 (defun x-selection-value (type)
-  (let (text tiff-image)
-    (setq text (condition-case nil
-		   (x-get-selection type 'public.utf16-plain-text)
-		 (error nil)))
-    (if (not text)
-	(setq text (condition-case nil
-		       (x-get-selection type
-					'com.apple.traditional-mac-plain-text)
-		     (error nil))))
+  (let ((data-types '(public.utf16-plain-text
+		      com.apple.traditional-mac-plain-text
+		      public.file-url))
+	text tiff-image)
+    (while (and (null text) data-types)
+      (setq text (condition-case nil
+		     (x-get-selection type (car data-types))
+		   (error nil)))
+      (setq data-types (cdr data-types)))
     (if text
 	(remove-text-properties 0 (length text) '(foreign-selection nil) text))
     (setq tiff-image (condition-case nil
@@ -1237,7 +1244,8 @@
 ;;; selection won't be added to the kill ring over and over.
 (defun x-get-selection-value ()
   (let (clip-text primary-text)
-    (when x-select-enable-clipboard
+    (if (not x-select-enable-clipboard)
+	(setq x-last-selected-text-clipboard nil)
       (setq clip-text (x-selection-value 'CLIPBOARD))
       (if (string= clip-text "") (setq clip-text nil))
 
@@ -1286,11 +1294,14 @@
     ))
 
 (put 'CLIPBOARD 'mac-scrap-name "com.apple.scrap.clipboard")
-(if (eq system-type 'darwin)
-    (put 'FIND 'mac-scrap-name "com.apple.scrap.find"))
+(when (eq system-type 'darwin)
+  (put 'FIND 'mac-scrap-name "com.apple.scrap.find")
+  (put 'PRIMARY 'mac-scrap-name
+       (format "org.gnu.Emacs.%d.selection.PRIMARY" (emacs-pid))))
 (put 'com.apple.traditional-mac-plain-text 'mac-ostype "TEXT")
 (put 'public.utf16-plain-text 'mac-ostype "utxt")
 (put 'public.tiff 'mac-ostype "TIFF")
+(put 'public.file-url 'mac-ostype "furl")
 
 (defun mac-select-convert-to-string (selection type value)
   (let ((str (cdr (xselect-convert-to-string selection nil value)))
@@ -1326,6 +1337,16 @@
       (setq next-selection-coding-system nil)
       (cons type str))))
 
+(defun mac-select-convert-to-file-url (selection type value)
+  (let ((filename (xselect-convert-to-filename selection type value))
+	(coding (or file-name-coding-system default-file-name-coding-system)))
+    (if (and filename coding)
+	(setq filename (encode-coding-string filename coding)))
+    (and filename
+	 (concat "file://localhost"
+		 (mapconcat 'url-hexify-string
+			    (split-string filename "/") "/")))))
+
 (setq selection-converter-alist
       (nconc
        '((public.utf16-plain-text . mac-select-convert-to-string)
@@ -1333,6 +1354,7 @@
 	 ;; This is not enabled by default because the `Import Image'
 	 ;; menu makes Emacs crash or hang for unknown reasons.
 	 ;; (public.tiff . nil)
+	 (public.file-url . mac-select-convert-to-file-url)
 	 )
        selection-converter-alist))
 
@@ -1702,6 +1724,7 @@
 (setq interprogram-cut-function 'x-select-text)
 (setq interprogram-paste-function 'x-get-selection-value)
 
+(defalias 'x-cut-buffer-or-selection-value 'x-get-selection-value)
 
 ;;; Turn off window-splitting optimization; Mac is usually fast enough
 ;;; that this is only annoying.
@@ -1756,7 +1779,9 @@
 	  '(lambda ()
 	     (defvar mac-ready-for-drag-n-drop t)))
 
-;;;; Scroll bars
+;;;; Non-toolkit Scroll bars
+
+(unless x-toolkit-scroll-bars
 
 ;; for debugging
 ;; (defun mac-handle-scroll-bar-event (event) (interactive "e") (princ event))
@@ -1816,6 +1841,7 @@
     (mac-scroll-ignore-events)
     (scroll-up 1)))
 
+)
 
 ;;;; Others
 
--- a/lisp/textmodes/ispell.el	Fri May 06 21:06:31 2005 +0000
+++ b/lisp/textmodes/ispell.el	Mon May 09 16:13:15 2005 +0000
@@ -301,7 +301,9 @@
   :type 'integer
   :group 'ispell)
 
-(defcustom ispell-program-name "ispell"
+(defcustom ispell-program-name
+  (or (locate-file "aspell" exec-path exec-suffixes 'file-executable-p)
+      "ispell")
   "Program invoked by \\[ispell-word] and \\[ispell-region] commands."
   :type 'string
   :group 'ispell)
--- a/lisp/textmodes/po.el	Fri May 06 21:06:31 2005 +0000
+++ b/lisp/textmodes/po.el	Mon May 09 16:13:15 2005 +0000
@@ -80,14 +80,15 @@
 	    assoc)
        (list (cond
 	      ((setq assoc
-		     (assoc-ignore-case charset
-					po-content-type-charset-alist))
+		     (assoc-string charset
+                                   po-content-type-charset-alist
+                                   t))
 	       (cdr assoc))
-	      ((or (setq assoc (assoc-ignore-case charset coding-system-alist))
+	      ((or (setq assoc (assoc-string charset coding-system-alist t))
 		   (setq assoc
-			 (assoc-ignore-case (subst-char-in-string ?_ ?-
-								  charset)
-					    coding-system-alist)))
+			 (assoc-string (subst-char-in-string ?_ ?-
+                                                             charset)
+                                       coding-system-alist t)))
 	       (intern (car assoc)))
 	      ;; In principle we should also check the `mime-charset'
 	      ;; property of everything in the base coding system
@@ -101,10 +102,10 @@
 	       ;; to require it initially?
 	       (require 'code-pages nil t)
 	       (if (or
-		    (setq assoc (assoc-ignore-case charset coding-system-alist))
-		    (setq assoc (assoc-ignore-case (subst-char-in-string
-						    ?_ ?- charset)
-						   coding-system-alist)))
+		    (setq assoc (assoc-string charset coding-system-alist t))
+		    (setq assoc (assoc-string (subst-char-in-string
+                                               ?_ ?- charset)
+                                              coding-system-alist t)))
 		   (intern (car assoc))
 		 'raw-text))))))))
 
--- a/lisp/tooltip.el	Fri May 06 21:06:31 2005 +0000
+++ b/lisp/tooltip.el	Mon May 09 16:13:15 2005 +0000
@@ -27,9 +27,6 @@
 
 ;;; Code:
 
-(eval-when-compile (require 'cl)) ; for case macro
-
-
 ;;; Customizable settings
 
 (defgroup tooltip nil
@@ -116,42 +113,6 @@
   "Face for tooltips."
   :group 'tooltip)
 
-(defcustom tooltip-gud-tips-p nil
-  "*Non-nil means show tooltips in GUD sessions.
-
-This allows you to display a variable's value in a tooltip simply
-by pointing at it with the mouse.  In the case of a C program
-controlled by GDB, it shows the associated #define directives
-when program is not executing."
-  :type 'boolean
-  :tag "GUD"
-  :group 'tooltip)
-
-(defcustom tooltip-gud-modes '(gud-mode c-mode c++-mode fortran-mode)
-  "List of modes for which to enable GUD tips."
-  :type 'sexp
-  :tag "GUD modes"
-  :group 'tooltip)
-
-(defcustom tooltip-gud-display
-  '((eq (tooltip-event-buffer tooltip-gud-event)
-	(marker-buffer gud-overlay-arrow-position)))
-  "List of forms determining where GUD tooltips are displayed.
-
-Forms in the list are combined with AND.  The default is to display
-only tooltips in the buffer containing the overlay arrow."
-  :type 'sexp
-  :tag "GUD buffers predicate"
-  :group 'tooltip)
-
-(defcustom tooltip-gud-echo-area nil
-  "Use the echo area instead of frames for GUD tooltips."
-  :type 'boolean
-  :tag "Use echo area"
-  :group 'tooltip)
-
-(defvaralias 'tooltip-use-echo-area 'tooltip-gud-echo-area)
-(make-obsolete-variable 'tooltip-use-echo-area 'tooltip-gud-echo-area "22.1")
 
 ;;; Variables that are not customizable.
 
@@ -169,7 +130,6 @@
 (defvar tooltip-hide-time nil
   "Time when the last tooltip was hidden.")
 
-
 ;;; Event accessors
 
 (defun tooltip-event-buffer (event)
@@ -178,7 +138,6 @@
   (let ((window (posn-window (event-end event))))
     (and window (window-buffer window))))
 
-
 ;;; Switching tooltips on/off
 
 ;; We don't set track-mouse globally because this is a big redisplay
@@ -202,16 +161,15 @@
   :group 'tooltip
   (unless (or (null tooltip-mode) (fboundp 'x-show-tip))
     (error "Sorry, tooltips are not yet available on this system"))
-  (let ((hook-fn (if tooltip-mode 'add-hook 'remove-hook)))
-    (funcall hook-fn 'change-major-mode-hook 'tooltip-change-major-mode)
-    (tooltip-activate-mouse-motions-if-enabled)
-    (funcall hook-fn 'pre-command-hook 'tooltip-hide)
-    (funcall hook-fn 'tooltip-hook 'tooltip-gud-tips)
-    (funcall hook-fn 'tooltip-hook 'tooltip-help-tips)
-    (setq show-help-function (if tooltip-mode 'tooltip-show-help-function nil))
-    ;; `ignore' is the default binding for mouse movements.
-    (define-key global-map [mouse-movement]
-      (if tooltip-mode 'tooltip-mouse-motion 'ignore))))
+  (if tooltip-mode
+      (progn
+	(add-hook 'pre-command-hook 'tooltip-hide)
+	(add-hook 'tooltip-hook 'tooltip-help-tips))
+    (unless (and (boundp 'gud-tooltip-mode) gud-tooltip-mode)
+      (remove-hook 'pre-command-hook 'tooltip-hide))
+    (remove-hook 'tooltip-hook 'tooltip-help-tips))
+  (setq show-help-function
+	(if tooltip-mode 'tooltip-show-help-function nil)))
 
 
 ;;; Timeout for tooltip display
@@ -242,49 +200,6 @@
 				    tooltip-last-mouse-motion-event))
 
 
-;;; Reacting on mouse movements
-
-(defun tooltip-change-major-mode ()
-  "Function added to `change-major-mode-hook' when tooltip mode is on."
-  (add-hook 'post-command-hook 'tooltip-activate-mouse-motions-if-enabled))
-
-(defun tooltip-activate-mouse-motions-if-enabled ()
-  "Reconsider for all buffers whether mouse motion events are desired."
-  (remove-hook 'post-command-hook 'tooltip-activate-mouse-motions-if-enabled)
-  (dolist (buffer (buffer-list))
-    (save-excursion
-      (set-buffer buffer)
-      (if (and tooltip-mode
-	       tooltip-gud-tips-p
-	       (memq major-mode tooltip-gud-modes))
-	  (tooltip-activate-mouse-motions t)
-	(tooltip-activate-mouse-motions nil)))))
-
-(defvar tooltip-mouse-motions-active nil
-  "Locally t in a buffer if tooltip processing of mouse motion is enabled.")
-
-(defun tooltip-activate-mouse-motions (activatep)
-  "Activate/deactivate mouse motion events for the current buffer.
-ACTIVATEP non-nil means activate mouse motion events."
-  (if activatep
-      (progn
-	(make-local-variable 'tooltip-mouse-motions-active)
-	(setq tooltip-mouse-motions-active t)
-	(make-local-variable 'track-mouse)
-	(setq track-mouse t))
-    (when tooltip-mouse-motions-active
-      (kill-local-variable 'tooltip-mouse-motions-active)
-      (kill-local-variable 'track-mouse))))
-
-(defun tooltip-mouse-motion (event)
-  "Command handler for mouse movement events in `global-map'."
-  (interactive "e")
-  (tooltip-hide)
-  (when (car (mouse-pixel-position))
-    (setq tooltip-last-mouse-motion-event (copy-sequence event))
-    (tooltip-start-delayed-tip)))
-
-
 ;;; Displaying tips
 
 (defun tooltip-set-param (alist key value)
@@ -396,114 +311,6 @@
     output))
 
 
-;;; Tips for `gud'
-
-(defvar tooltip-gud-original-filter nil
-  "Process filter to restore after GUD output has been received.")
-
-(defvar tooltip-gud-dereference nil
-  "Non-nil means print expressions with a `*' in front of them.
-For C this would dereference a pointer expression.")
-
-(defvar tooltip-gud-event nil
-  "The mouse movement event that led to a tooltip display.
-This event can be examined by forms in TOOLTIP-GUD-DISPLAY.")
-
-(defun tooltip-gud-toggle-dereference ()
-  "Toggle whether tooltips should show `* expr' or `expr'."
-  (interactive)
-  (setq tooltip-gud-dereference (not tooltip-gud-dereference))
-  (when (interactive-p)
-    (message "Dereferencing is now %s."
-	     (if tooltip-gud-dereference "on" "off"))))
-
-(defun tooltip-toggle-gud-tips ()
-  "Toggle the display of GUD tooltips."
-  (interactive)
-  (setq tooltip-gud-tips-p (not tooltip-gud-tips-p))
-  ;; Reconsider for all buffers whether mouse motion events are desired.
-  (tooltip-change-major-mode)
-  (when (interactive-p)
-    (message (format "GUD tooltips %sabled"
-		     (if tooltip-gud-tips-p "en" "dis")))))
-
-; This will only display data that comes in one chunk.
-; Larger arrays (say 400 elements) are displayed in
-; the tootip incompletely and spill over into the gud buffer.
-; Switching the process-filter creates timing problems and
-; it may be difficult to do better. Using annotations as in
-; gdb-ui.el gets round this problem.
-(defun tooltip-gud-process-output (process output)
-  "Process debugger output and show it in a tooltip window."
-  (set-process-filter process tooltip-gud-original-filter)
-  (tooltip-show (tooltip-strip-prompt process output)
-		tooltip-gud-echo-area))
-
-(defun tooltip-gud-print-command (expr)
-  "Return a suitable command to print the expression EXPR.
-If TOOLTIP-GUD-DEREFERENCE is t, also prepend a `*' to EXPR."
-  (when tooltip-gud-dereference
-    (setq expr (concat "*" expr)))
-  (case gud-minor-mode
-    ((gdb gdba) (concat "server print " expr))
-    (dbx (concat "print " expr))
-    (xdb (concat "p " expr))
-    (sdb (concat expr "/"))
-    (perldb expr)))
-
-(defun tooltip-gud-tips (event)
-  "Show tip for identifier or selection under the mouse.
-The mouse must either point at an identifier or inside a selected
-region for the tip window to be shown.  If tooltip-gud-dereference is t,
-add a `*' in front of the printed expression. In the case of a C program
-controlled by GDB, show the associated #define directives when program is
-not executing.
-
-This function must return nil if it doesn't handle EVENT."
-  (let (process)
-    (when (and (eventp event)
-	       tooltip-gud-tips-p
-	       (boundp 'gud-comint-buffer)
-	       gud-comint-buffer
-	       (buffer-name gud-comint-buffer); gud-comint-buffer might be killed
-	       (setq process (get-buffer-process gud-comint-buffer))
-	       (posn-point (event-end event))
-	       (or (eq gud-minor-mode 'gdba)
-		   (progn (setq tooltip-gud-event event)
-			  (eval (cons 'and tooltip-gud-display)))))
-      (let ((expr (tooltip-expr-to-print event)))
-	(when expr
-	  (if (and (eq gud-minor-mode 'gdba)
-		   (not gdb-active-process))
-	      (progn
-		(with-current-buffer
-		    (window-buffer (let ((mouse (mouse-position)))
-				     (window-at (cadr mouse)
-						(cddr mouse))))
-		  (let ((define-elt (assoc expr gdb-define-alist)))
-		    (unless (null define-elt)
-		      (tooltip-show (cdr define-elt))
-		      expr))))
-	    (let ((cmd (tooltip-gud-print-command expr)))
-	      (unless (null cmd) ; CMD can be nil if unknown debugger
-		(case gud-minor-mode
-		  (gdba (gdb-enqueue-input
-			 (list  (concat cmd "\n") 'gdb-tooltip-print)))
-		  (t
-		   (setq tooltip-gud-original-filter (process-filter process))
-		   (set-process-filter process 'tooltip-gud-process-output)
-	       	  (gud-basic-call cmd)))
-		expr))))))))
-
-(defun gdb-tooltip-print ()
-  (tooltip-show
-   (with-current-buffer (gdb-get-buffer 'gdb-partial-output-buffer)
-     (let ((string (buffer-string)))
-       ;; remove newline for tooltip-gud-echo-area
-       (substring string 0 (- (length string) 1))))
-   tooltip-gud-echo-area))
-
-
 ;;; Tooltip help.
 
 (defvar tooltip-help-message nil
--- a/lispref/ChangeLog	Fri May 06 21:06:31 2005 +0000
+++ b/lispref/ChangeLog	Mon May 09 16:13:15 2005 +0000
@@ -1,3 +1,14 @@
+2005-05-08  Luc Teirlinck  <teirllm@auburn.edu>
+
+	* variables.texi (File Local Variables): `(hack-local-variables t)'
+	now also checks whether a mode is specified in the local variables
+	list.
+
+2005-05-05  Kevin Ryde  <user42@zip.com.au>
+
+	* display.texi (The Echo Area): Correct format function cross
+	reference.
+
 2005-05-05  Luc Teirlinck  <teirllm@auburn.edu>
 
 	* variables.texi (Variable Aliases): Change description of
--- a/lispref/display.texi	Fri May 06 21:06:31 2005 +0000
+++ b/lispref/display.texi	Mon May 09 16:13:15 2005 +0000
@@ -200,7 +200,7 @@
 @defun message string &rest arguments
 This function displays a message in the echo area.  The
 argument @var{string} is similar to a C language @code{printf} control
-string.  See @code{format} in @ref{String Conversion}, for the details
+string.  See @code{format} in @ref{Formatting Strings}, for the details
 on the conversion specifications.  @code{message} returns the
 constructed string.
 
--- a/lispref/variables.texi	Fri May 06 21:06:31 2005 +0000
+++ b/lispref/variables.texi	Mon May 09 16:13:15 2005 +0000
@@ -1804,10 +1804,9 @@
 @code{enable-local-variables} into account.
 
 If the optional argument @var{mode-only} is non-@code{nil}, then all
-this function does is return @code{t} if the @w{@samp{-*-}} line
-specifies a mode and @code{nil} otherwise.  It does not set the mode
-nor any other file local variable.  It does not check whether a mode
-is specified in the local variables list at the end of the file.
+this function does is return @code{t} if the @w{@samp{-*-}} line or
+the local variables list specifies a mode and @code{nil} otherwise.
+It does not set the mode nor any other file local variable.
 @end defun
 
   If a file local variable list could specify a function that would
--- a/mac/ChangeLog	Fri May 06 21:06:31 2005 +0000
+++ b/mac/ChangeLog	Mon May 09 16:13:15 2005 +0000
@@ -1,3 +1,7 @@
+2005-05-06  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+	* inc/config.h [HAVE_CARBON]: Define USE_TOOLKIT_SCROLL_BARS.
+
 2005-04-24  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
 
 	* makefile.MPW (MacObjects): Add macselect.c.x.
--- a/mac/inc/config.h	Fri May 06 21:06:31 2005 +0000
+++ b/mac/inc/config.h	Mon May 09 16:13:15 2005 +0000
@@ -91,7 +91,9 @@
 /* #undef HAVE_XAW3D */
 
 /* Define if we should use toolkit scroll bars.  */
-/* #undef USE_TOOLKIT_SCROLL_BARS */
+#ifdef HAVE_CARBON
+#define USE_TOOLKIT_SCROLL_BARS 1
+#endif
 
 /* Define if we should use XIM, if it is available.  */
 /* #undef USE_XIM */
--- a/make-dist	Fri May 06 21:06:31 2005 +0000
+++ b/make-dist	Mon May 09 16:13:15 2005 +0000
@@ -321,7 +321,9 @@
 	      leim/SKK-DIC leim/ja-dic leim/quail \
 	      src src/m src/s src/bitmaps lib-src oldXMenu lwlib \
 	      nt nt/inc nt/inc/sys nt/inc/arpa nt/inc/netinet nt/icons \
-	      etc etc/e info man msdos vms mac mac/inc mac/inc/sys \
+	      etc etc/e etc/images etc/images/gnus etc/images/smilies \
+	      etc/tree-widget etc/tree-widget/default etc/tree-widget/folder \
+	      info man msdos vms mac mac/inc mac/inc/sys \
 	      mac/src mac/Emacs.app mac/Emacs.app/Contents \
 	      mac/Emacs.app/Contents/MacOS mac/Emacs.app/Contents/Resources \
 	      mac/Emacs.app/Contents/Resources/English.lproj
@@ -349,7 +351,6 @@
  test -f README && ln README ../${tempdir}/lisp
  (cd ../${tempdir}/lisp
   rm -f TAGS =*
-  rm -f ldefs-boot.el
   rm -f site-init site-init.el site-init.elc
   rm -f site-load site-load.el site-load.elc
   rm -f site-start site-start.el site-start.elc
@@ -396,7 +397,7 @@
 echo "Making links to \`leim' and its subdirectories"
 ### Don't distribute TAGS, or =*.el files.
 (cd leim
- ln makefile.nt makefile.w32-in ../${tempdir}/leim
+ ln makefile.w32-in ../${tempdir}/leim
  ln ChangeLog README ../${tempdir}/leim
 
  ln CXTERM-DIC/*.tit ../${tempdir}/leim/CXTERM-DIC
@@ -443,7 +444,7 @@
    fi
  done
  ln README ChangeLog ChangeLog.*[0-9] ../${tempdir}/src
- ln makefile.nt makefile.w32-in ../${tempdir}/src
+ ln makefile.w32-in ../${tempdir}/src
  ln .gdbinit .dbxinit ../${tempdir}/src
  cd ../${tempdir}/src
  rm -f config.h epaths.h Makefile Makefile.c
@@ -466,7 +467,7 @@
 (cd lib-src
  ln [a-zA-Z]*.[chy] ../${tempdir}/lib-src
  ln ChangeLog Makefile.in README testfile vcdiff ../${tempdir}/lib-src
- ln grep-changelog rcs2log rcs-checkin makefile.nt ../${tempdir}/lib-src
+ ln grep-changelog rcs2log rcs-checkin ../${tempdir}/lib-src
  ln makefile.w32-in ../${tempdir}/lib-src
  ## If we ended up with a symlink, or if we did not get anything
  ## due to a cross-device symlink, copy the file.
@@ -492,7 +493,7 @@
 (cd nt
  ln emacs.rc config.nt [a-z]*.c ../${tempdir}/nt
  ln nmake.defs gmake.defs subdirs.el ../${tempdir}/nt
- ln [a-z]*.bat [a-z]*.h makefile.def makefile.nt ../${tempdir}/nt
+ ln [a-z]*.bat [a-z]*.h ../${tempdir}/nt
  ln ChangeLog INSTALL README makefile.w32-in ../${tempdir}/nt)
 
 echo "Making links to \`nt/inc'"
@@ -563,7 +564,8 @@
 ### tex litter.
 ### Don't distribute gfdl.1, since no man page references it.
 (cd etc
- files=`ls -d * | grep -v CVS | grep -v RCS | grep -v 'Old' | grep -v '^e$'`
+ files=`ls -d * | grep -v CVS | grep -v RCS | grep -v 'Old' | grep -v '^e$' \
+        | grep -v '^images$' | grep -v '^tree-widget$'`
  ln $files ../${tempdir}/etc
  ## If we ended up with a symlink, or if we did not get anything
  ## due to a cross-device symlink, copy the file.
@@ -592,6 +594,15 @@
  cd ../../${tempdir}/etc/e
  rm -f *~ \#*\# *,v =* core)
 
+for dir in etc/images/gnus etc/images/smilies \
+           etc/tree-widget/default etc/tree-widget/folder ; do
+    echo "Making links to \`${dir}'"
+    (cd ${dir}
+     ln `ls -d * | grep -v CVS | grep -v RCS` ../../../${tempdir}/${dir}
+     cd ../../../${tempdir}/${dir}
+     rm -f *~ \#*\# *,v =* core)
+done
+
 echo "Making links to \`info'"
 # Don't distribute backups or autosaves.
 (cd info
--- a/man/ChangeLog	Fri May 06 21:06:31 2005 +0000
+++ b/man/ChangeLog	Mon May 09 16:13:15 2005 +0000
@@ -1,3 +1,25 @@
+2005-05-08  Luc Teirlinck  <teirllm@auburn.edu>
+
+	* basic.texi: Various typo and grammar fixes.
+	(Moving Point): C-a now runs move-beginning-of-line.
+
+2005-05-08  Nick Roberts  <nickrob@snap.net.nz>
+
+	* building.texi (Debugger Operation): Describe gud-tooltip-echo-area.
+
+	* frames.texi (Tooltips): Describe help tooltips and GUD tooltips
+	as different animals.
+
+2005-05-07  Luc Teirlinck  <teirllm@auburn.edu>
+
+	* frames.texi (Mouse References): Clarify `mouse-1-click-follows-link'.
+	Correct index entry.
+
+2005-05-07  Nick Roberts  <nickrob@snap.net.nz>
+
+	* building.texi (Debugger Operation): Update to reflect changes
+	in GUD tooltips.
+
 2005-04-30  Richard M. Stallman  <rms@gnu.org>
 
 	* files.texi (Compressed Files): Auto Compression normally enabled.
--- a/man/basic.texi	Fri May 06 21:06:31 2005 +0000
+++ b/man/basic.texi	Mon May 09 16:13:15 2005 +0000
@@ -170,7 +170,7 @@
 @kindex RIGHT
 @kindex UP
 @kindex DOWN
-@findex beginning-of-line
+@findex move-beginning-of-line
 @findex move-end-of-line
 @findex forward-char
 @findex backward-char
@@ -183,7 +183,7 @@
 @findex move-to-window-line
 @table @kbd
 @item C-a
-Move to the beginning of the line (@code{beginning-of-line}).
+Move to the beginning of the line (@code{move-beginning-of-line}).
 @item C-e
 Move to the end of the line (@code{move-end-of-line}).
 @item C-f
@@ -261,7 +261,7 @@
 @xref{Variables}, for how to set variables such as @code{track-eol}.
 
 @vindex next-line-add-newlines
-  @kbd{C-n} normally stops at the end of the bufer when you use it on
+  @kbd{C-n} normally stops at the end of the buffer when you use it on
 the last line of the buffer.  But if you set the variable
 @code{next-line-add-newlines} to a non-@code{nil} value, @kbd{C-n} on
 the last line of a buffer creates an additional line at the end and
@@ -510,7 +510,7 @@
 
   You can make several blank lines by typing @kbd{C-o} several times, or
 by giving it a numeric argument to tell it how many blank lines to make.
-@xref{Arguments}, for how.  If you have a fill prefix, then @kbd{C-o}
+@xref{Arguments}, for how.  If you have a fill prefix, the @kbd{C-o}
 command inserts the fill prefix on the new line, when you use it at the
 beginning of a line.  @xref{Fill Prefix}.
 
@@ -677,7 +677,7 @@
 @cindex character set of character at point
 @cindex font of character at point
 @cindex text properties at point
-  @w{@kbd{C-u C-x =}} displays these additional information about a
+  @w{@kbd{C-u C-x =}} displays the following additional information about a
 character.
 
 @itemize @bullet
@@ -780,7 +780,7 @@
 sign has the special meaning of ``multiply by four.''  It multiplies the
 argument for the next command by four.  @kbd{C-u} twice multiplies it by
 sixteen.  Thus, @kbd{C-u C-u C-f} moves forward sixteen characters.  This
-is a good way to move forward ``fast,'' since it moves about 1/5 of a line
+is a good way to move forward ``fast'', since it moves about 1/5 of a line
 in the usual size screen.  Other useful combinations are @kbd{C-u C-n},
 @kbd{C-u C-u C-n} (move down a good fraction of a screen), @kbd{C-u C-u
 C-o} (make ``a lot'' of blank lines), and @kbd{C-u C-k} (kill four
--- a/man/building.texi	Fri May 06 21:06:31 2005 +0000
+++ b/man/building.texi	Mon May 09 16:13:15 2005 +0000
@@ -491,15 +491,18 @@
 
 @cindex tooltips with GUD
 @vindex tooltip-gud-modes
-@vindex tooltip-gud-tips-p
+@vindex gud-tooltip-mode
+@vindex gud-tooltip-echo-area
   The Tooltip facility (@pxref{Tooltips}) provides support for GUD@.
-You activate this feature by setting the variable
-@code{tooltip-gud-tips-p} to @code{t}.  Then you can display a
-variable's value in a tooltip simply by pointing at it with the mouse.
-In graphical mode, with a C program, you can also display the
-@code{#define} directive associated with an identifier when program is
-not executing.  This operates in the GUD buffer and in source buffers
-with major modes in the list @code{tooltip-gud-modes}.
+You activate this feature by turning on the minor mode
+@code{gud-tooltip-mode}.  Then you can display a variable's value in a
+tooltip simply by pointing at it with the mouse.  In graphical mode,
+with a C program, you can also display the @code{#define} directive
+associated with an identifier when the program is not executing.  This
+operates in the GUD buffer and in source buffers with major modes in
+the list @code{gud-tooltip-modes}.  If the variable
+@code{gud-tooltip-echo-area} is non-@code{nil} then the help text is
+displayed in the echo area.
 
 @node Commands of GUD
 @subsection Commands of GUD
--- a/man/calc.texi	Fri May 06 21:06:31 2005 +0000
+++ b/man/calc.texi	Mon May 09 16:13:15 2005 +0000
@@ -30634,11 +30634,15 @@
 @node Mode Settings in Embedded Mode, Customizing Embedded Mode, Assignments in Embedded Mode, Embedded Mode
 @section Mode Settings in Embedded Mode
 
+@kindex m e
+@pindex calc-embedded-preserve-modes
 @noindent
 The mode settings can be changed while Calc is in embedded mode, but
-will revert to their original values when embedded mode is ended
-(except for the modes saved when the mode-recording mode is
-@code{Save}; see below).
+by default they will revert to their original values when embedded mode
+is ended. However, the modes saved when the mode-recording mode is
+@code{Save} (see below) and the modes in effect when the @kbd{m e}
+(@code{calc-embedded-preserve-modes}) command is given
+will be preserved when embedded mode is ended.
 
 Embedded mode has a rather complicated mechanism for handling mode
 settings in Embedded formulas.  It is possible to put annotations
@@ -35580,6 +35584,7 @@
 @c
 @r{       @:      m a   @:             @: 12,13  @:calc-algebraic-mode@:}
 @r{       @:      m d   @:             @:        @:calc-degrees-mode@:}
+@r{       @:      m e   @:             @:        @:calc-embedded-preserve-modes@:}
 @r{       @:      m f   @:             @:    12  @:calc-frac-mode@:}
 @r{       @:      m g   @:             @:    52  @:calc-get-modes@:}
 @r{       @:      m h   @:             @:        @:calc-hms-mode@:}
--- a/man/frames.texi	Fri May 06 21:06:31 2005 +0000
+++ b/man/frames.texi	Mon May 09 16:13:15 2005 +0000
@@ -48,7 +48,7 @@
 * Menu Bars::	        Enabling and disabling the menu bar.
 * Tool Bars::           Enabling and disabling the tool bar.
 * Dialog Boxes::        Controlling use of dialog boxes.
-* Tooltips::            Showing "tooltips", AKA "balloon help" for active text.
+* Tooltips::            Displaying information at the current mouse position.
 * Mouse Avoidance::     Moving the mouse pointer out of the way.
 * Non-Window Terminals::  Multiple frames on terminals that show only one.
 * XTerm Mouse::         Using the mouse in an XTerm terminal emulator.
@@ -319,16 +319,14 @@
 @kbd{Mouse-2} on a completion in the @samp{*Completions*} buffer, you
 choose that completion.
 
-@vindex mouse-1-click-follows-link
   However, most applications use @kbd{Mouse-1} to do this sort of
 thing, so Emacs implements this too.  If you click @kbd{Mouse-1}
 quickly on a reference or button, it follows or activates.  If you
 click slowly, it moves point as usual.  Dragging, meaning moving the
 mouse while it is held down, also has its usual behavior of setting
-the region.  The variable @code{mouse-1-click-follows-link} controls
-whether @kbd{Mouse-1} has this behavior.
+the region.
 
-@vindex mouse-1-click-follows-link
+@vindex mouse-1-click-in-non-selected-windows
   Normally, the @kbd{Mouse-1} click behavior is performed on links in
 any window.  The variable @code{mouse-1-click-in-non-selected-windows}
 controls whether @kbd{Mouse-1} has this behavior even in non-selected
@@ -342,6 +340,14 @@
 where the mouse already is), never, or only immediately after you move
 the mouse.
 
+@vindex mouse-1-click-follows-link
+  In Emacs versions before 22, only @kbd{Mouse-2} follows links and
+@kbd{Mouse-1} always sets points.  If you prefer this behavior, set
+the variable @code{mouse-1-click-follows-link} to @code{nil}.  This
+variable also lets you choose various other alternatives for following
+links with the mouse.  Type @kbd{C-h v mouse-1-click-follows-link @key{RET}}
+for more details.
+
 @node Menu Mouse Clicks
 @section Mouse Clicks for Menus
 
@@ -963,19 +969,25 @@
 the setting of this variable has no effect.
 
 @node Tooltips
-@section Tooltips (or ``Balloon Help'')
+@section Tooltips
+
+  Tooltips are small windows that display text information at the
+current mouse position.  They activate when there is a pause in mouse
+movement.
 
-@cindex balloon help
-  Tooltips are small X windows displaying a help string at the current
-mouse position, typically over text---including the mode line---which
-can be activated with the mouse or other keys.  (This facility is
-sometimes known as @dfn{balloon help}.)  Help text may be available for
-menu items too.
+There are two types of tooltip: help tooltips and GUD tooltips.
+
+Help tooltips typically display over text--including the mode
+line--but may be also available for many other parts of the Emacs
+frame such as the toolbar and menu items.
 
 @findex tooltip-mode
-  You can toggle Tooltip mode with the command @kbd{M-x tooltip-mode}.
-When Tooltip mode is disabled, the help text is displayed in the echo
-area instead.
+  You can toggle help tooltips (Tooltip mode) with the command
+@kbd{M-x tooltip-mode}.  When Tooltip mode is disabled, the help text
+is displayed in the echo area instead.
+
+GUD tooltips are useful when you are debugging a
+program. @xref{Debugger Operation}.
 
 @vindex tooltip-delay
   The variables @code{tooltip-delay} specifies how long Emacs should
--- a/src/ChangeLog	Fri May 06 21:06:31 2005 +0000
+++ b/src/ChangeLog	Mon May 09 16:13:15 2005 +0000
@@ -1,3 +1,85 @@
+2005-05-09  Juanma Barranquero  <lekktu@gmail.com>
+
+	* fileio.c (Fexpand_file_name, Frename_file, Fadd_name_to_file)
+	(Fmake_symbolic_link, Faccess_file, Frecent_auto_save_p):
+	Doc fixes.
+
+	* dired.c (Ffile_name_completion): Make argument name
+	match its use in docstring.
+
+2005-05-08  Luc Teirlinck  <teirllm@auburn.edu>
+
+	* eval.c (Fdefvaralias): Remove any pre-existing
+	variable-documentation property of the alias.
+
+2005-05-07  Thien-Thi Nguyen  <ttn@gnu.org>
+
+	* xfns.c (start_hourglass): Do nothing when running on a tty.
+
+2005-05-07  Juanma Barranquero  <lekktu@gmail.com>
+
+	* fns.c (Fchar_table_range): Fix typos in docstring.
+
+2005-05-06  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* fns.c (Fchar_table_range): Yet Another Int/Lisp_Object Mixup.
+
+2005-05-06  Eli Zaretskii  <eliz@gnu.org>
+
+	* lread.c (Flocate_file_internal): Doc fix.
+
+	* Makefile.in (lisp, shortlisp): Add jka-cmpr-hook.elc.
+
+2005-05-06  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+	* macselect.c (x_own_selection): Accept Lisp string as result of
+	selection converter function.
+	(x_clear_frame_selections): Don't call x-lost-selection-functions
+	if Emacs is not owner of the selection.
+	(Vmac_services_selection): Put variable and initialization in
+	#ifdef MAC_OSX.
+	(syms_of_macselect) [MAC_OSX]: Set default value of
+	Vmac_services_selection to PRIMARY.
+
+	* macterm.c (toolkit_scroll_bar_interaction): Remove unused variable.
+	(mac_handle_tool_bar_click): Remove unused function and declaration.
+	[USE_TOOLKIT_SCROLL_BARS] (scroll_bar_timer_callback)
+	(install_scroll_bar_timer, set_scroll_bar_timer)
+	(control_part_code_to_scroll_bar_part, construct_scroll_bar_click)
+	(get_control_part_bound, x_scroll_bar_handle_press)
+	(x_scroll_bar_handle_release, x_scroll_bar_handle_drag)
+	(x_set_toolkit_scroll_bar_thumb): New functions and declarations.
+	[USE_TOOLKIT_SCROLL_BARS] (last_scroll_bar_part, scroll_bar_timer)
+	(scroll_bar_timer_event_posted_p): New variables.
+	[USE_TOOLKIT_SCROLL_BARS] (SCROLL_BAR_FIRST_DELAY)
+	(SCROLL_BAR_CONTINUOUS_DELAY): New macros.
+	(x_scroll_bar_create): Set control reference with NewControl.
+	(x_scroll_bar_create) [USE_TOOLKIT_SCROLL_BARS]:
+	Initialize track_top and track_height to nil.
+	(x_scroll_bar_set_handle, x_scroll_bar_note_movement):
+	Put functions in #ifndef USE_TOOLKIT_SCROLL_BARS.
+	(XTset_vertical_scroll_bar): Don't make space between scroll bar
+	and associated window.
+	(XTset_vertical_scroll_bar) [MAC_OSX]: Get scroll bar area width
+	from window config.
+	(XTset_vertical_scroll_bar) [USE_TOOLKIT_SCROLL_BARS]:
+	Set track_top and track_height to nil when scroll bar size is changed.
+	Recalculate them if they are nil.
+	(XTread_socket) [MAC_OSX]: Use control kind to determine if the
+	clicked control is a scroll bar.
+	(XTread_socket) [USE_TOOLKIT_SCROLL_BARS]: Use toolkit scroll bar
+	event handler functions.  Don't add modifiers to scroll bar click
+	events.  Call scroll bar release handler when window is deactivated.
+	(mac_initialize): Remove unused code for X toolkit.
+	(syms_of_macterm) [!USE_TOOLKIT_SCROLL_BARS]:
+	Initialize Vx_toolkit_scroll_bars to nil.
+
+	* macterm.h (struct scroll_bar) [USE_TOOLKIT_SCROLL_BARS]:
+	New members track_top and track_height.
+
+	* sysselect.h [DARWIN || MAC_OSX]: Temporarily undefine
+	init_process when including sys/select.h.
+
 2005-05-05  Luc Teirlinck  <teirllm@auburn.edu>
 
 	* eval.c (Fdefvaralias): Doc fix.
@@ -61,7 +143,7 @@
 2005-05-01  Kim F. Storm  <storm@cua.dk>
 
 	* xdisp.c (move_it_in_display_line_to): Stop if we move beyond
-	TO_CHARPOS. This may happen if last glyphs was an image or stretch
+	TO_CHARPOS.  This may happen if last glyphs was an image or stretch
 	glyph.
 
 2005-05-01  Luc Teirlinck  <teirllm@auburn.edu>
@@ -73,7 +155,7 @@
 	* xmenu.c [not HAVE_X_TOOLKIT] (xmenu_show):
 	If user cancels the menu, quit unless FOR_CLICK.
 
-	* macros.c (Vexecuting_kbd_macro): Renamed from Vexecuting_macro.
+	* macros.c (Vexecuting_kbd_macro): Rename from Vexecuting_macro.
 	All uses changed.
 	(syms_of_macros): Define only executing-kbd-macro, not executing-macro.
 	* keyboard.c: Change Vexecuting_macro to Vexecuting_kbd_macro.
@@ -95,8 +177,7 @@
 
 2005-04-29  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
 
-	* mac.c: Don't include time.h.  Include sysselect.h after
-	systime.h.
+	* mac.c: Don't include time.h.  Include sysselect.h after systime.h.
 
 	* macfns.c (Fx_server_version): Add BLOCK_INPUT around Gestalt.
 
@@ -159,13 +240,12 @@
 	(mac.o): Depend on ccl.h.
 	(macselect.o): New target.
 
-	* emacs.c (main) [MAC_OS8 || MAC_OSX && HAVE_CARBON]: Call
-	syms_of_macselect.
+	* emacs.c (main) [MAC_OS8 || MAC_OSX && HAVE_CARBON]:
+	Call syms_of_macselect.
 
 	* frame.c (Fdelete_frame) [MAC_OS]: Call x_clear_frame_selections.
 
-	* mac.c [!TARGET_API_MAC_CARBON]: Don't include charset.h or
-	coding.h.
+	* mac.c [!TARGET_API_MAC_CARBON]: Don't include charset.h or coding.h.
 	(QCLIPBOARD): Remove variable.
 	(syms_of_mac): Don't initialize it.
 	(Fmac_paste_function, Fmac_cut_function, Fx_selection_exists_p):
@@ -179,10 +259,10 @@
 	[TARGET_API_MAC_CARBON] (Fmac_code_convert_string): Likewise.
 	(syms_of_mac) [TARGET_API_MAC_CARBON]: Defsubr it.
 
-	* macterm.c (handling_window_update, terminate_flag): Remove
-	variables.
-	(do_window_update, do_ae_quit_application, XTread_socket): Don't
-	use them.
+	* macterm.c (handling_window_update, terminate_flag):
+	Remove variables.
+	(do_window_update, do_ae_quit_application, XTread_socket):
+	Don't use them.
 	(WNE_SLEEP_AT_SUSPEND, WNE_SLEEP_AT_RESUME): Don't define.
 	[USE_CARBON_EVENTS && MAC_OSX] (mac_handle_service_event)
 	(init_service_handler): Move to macselect.c.  Remove declarations.
@@ -277,8 +357,8 @@
 	Make a sub-chartable with correct initial value.
 
 	* fns.c (Fset_char_table_range): Don't set slots used as default
-	values for ascii, eight-bit-control, eight-bit-graphic.  Don't
-	call Faref with charset-id.
+	values for ascii, eight-bit-control, eight-bit-graphic.
+	Don't call Faref with charset-id.
 	(Fset_char_table_default): Document how to treat normal character
 	argument.  Handle special slots used as default values of ascii,
 	eight-bit-control, eight-bit-control.  Make a sub chartable if
@@ -313,8 +393,8 @@
 	create_text_encoding_info_alist instead.
 	(init_font_name_table) [TARGET_API_MAC_CARBON]: Use Font Manager
 	routines also on Mac OS Classic.
-	(init_font_name_table) [!TARGET_API_MAC_CARBON]: Use
-	add_font_name_table_entry.
+	(init_font_name_table) [!TARGET_API_MAC_CARBON]:
+	Use add_font_name_table_entry.
 	(mac_do_list_fonts): Regard 0 in XLFD scaleble fields as
 	specified.  Derive unspecified scalable fields from specified one.
 	(x_list_fonts): Consider Valternate_fontname_alist.
@@ -412,8 +492,7 @@
 
 	* mac.c: Include charset.h and coding.h.
 	[TARGET_API_MAC_CARBON] (Qutf_8): Remove extern.
-	[TARGET_API_MAC_CARBON] (cfstring_create_with_string): New
-	function.
+	[TARGET_API_MAC_CARBON] (cfstring_create_with_string): New function.
 	[TARGET_API_MAC_CARBON] (Fmac_get_preference): Use it.
 
 	* macfns.c [TARGET_API_MAC_CARBON] (Fx_file_dialog): Likewise.
@@ -422,8 +501,8 @@
 
 	* macterm.c (x_autoselect_window_p): Remove variable.
 	(last_window): New variable.
-	(XTreassert_line_highlight, x_change_line_highlight): Remove
-	declarations.
+	(XTreassert_line_highlight, x_change_line_highlight):
+	Remove declarations.
 	(mac_focus_changed, x_detect_focus_change): New functions and
 	declarations.
 	(XTextExtents16, front_emacs_window): Remove function.
@@ -436,8 +515,8 @@
 	(XTread_socket): Move its contents here.  Generate select-window
 	event on mouse movement if needed.  Use x_detect_focus_change on
 	activate/deactivate events.  Don't deiconify frame or invalidate
-	window rectangle when dnd items are dropped.  Don't
-	activate/deactivate root control.
+	window rectangle when dnd items are dropped.
+	Don't activate/deactivate root control.
 	(frame_highlight, frame_unhighlight): Activate/deactivate root
 	control here.
 	(syms_of_macterm): Delete DEFVAR_BOOL for x_autoselect_window_p.
@@ -453,17 +532,17 @@
 
 2005-04-14  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
 
-	* mac.c [!TARGET_API_MAC_CARBON]: Include MacLocales.h.  Don't
-	include TextEncodingConverter.h.
+	* mac.c [!TARGET_API_MAC_CARBON]: Include MacLocales.h.
+	Don't include TextEncodingConverter.h.
 	(mac_system_script_code, Vmac_system_locale): New variables.
 	(syms_of_mac): Defvar them.
 	(mac_get_system_locale): New function.
 
-	* macfns.c (x_set_name, x_set_title) [!TARGET_API_MAC_CARBON]: Use
-	ENCODE_SYSTEM to encode title bar string.
+	* macfns.c (x_set_name, x_set_title) [!TARGET_API_MAC_CARBON]:
+	Use ENCODE_SYSTEM to encode title bar string.
 	(x_create_tip_frame): Apply 2005-03-18 change for xfns.c.
-	(Fx_file_dialog) [TARGET_API_MAC_CARBON && !MAC_OSX]: Use
-	CFStringGetSystemEncoding to get system default string encoding.
+	(Fx_file_dialog) [TARGET_API_MAC_CARBON && !MAC_OSX]:
+	Use CFStringGetSystemEncoding to get system default string encoding.
 
 	* macterm.c [!TARGET_API_MAC_CARBON]: Don't include
 	TextEncodingConverter.h.
@@ -1080,7 +1159,7 @@
 	* xdisp.c (init_from_display_pos): Don't read past end of
 	it->overlay_strings array.
 
-2005-02-25  Stephan Stahl <stahl@eos.franken.de>  (tiny change)
+2005-02-25  Stephan Stahl  <stahl@eos.franken.de>  (tiny change)
 
 	* buffer.c (syms_of_buffer): Fix typo.
 
@@ -1110,7 +1189,7 @@
 	I think those asserts are bogus if buffer contains invisible text
 	or images.
 
-2005-02-21  David Kastrup <dak@gnu.org>
+2005-02-21  David Kastrup  <dak@gnu.org>
 
 	* gtkutil.c (xg_create_frame_widgets): UNBLOCK_INPUT on error.
 
@@ -3710,7 +3789,7 @@
 	compositions to encode.
 	(encode_coding_string): Likewise.  Free composition data.
 
-2004-09-30  Florian Weimer <fw@deneb.enyo.de>
+2004-09-30  Florian Weimer  <fw@deneb.enyo.de>
 
 	* coding.c (code_convert_region): Free composition data.
 
@@ -4248,7 +4327,7 @@
 	* xfns.c (x_icon_verify): New function.
 	(Fx_create_frame): Use it.
 
-2004-07-22  Barry Fishman <barry_fishman@att.net>  (tiny change)
+2004-07-22  Barry Fishman  <barry_fishman@att.net>  (tiny change)
 
 	* s/gnu-linux.h: Use GC_MARK_STACK if __amd64__ is defined.
 
@@ -5911,7 +5990,7 @@
 	* xdisp.c (note_mode_line_or_margin_highlight): Accept HEADER_LINE
 	when keymap and cursor are setup.
 
-2004-03-14  Steven Tamm <steventamm@mac.com>
+2004-03-14  Steven Tamm  <steventamm@mac.com>
 
 	* Makefile.in (XMENU_OBJ) [HAVE_CARBON]: Do not include xmenu.o.
 
@@ -5973,7 +6052,7 @@
 	(GTK_OBJ) [USE_GTK]: New declaration.
 	(obj): Add $(GTK_OBJ) to list.
 
-2004-03-11  Steven Tamm <steventamm@mac.com>
+2004-03-11  Steven Tamm  <steventamm@mac.com>
 
 	* image.c [MAC_OSX]: Include sys/stat.h.
 
--- a/src/Makefile.in	Fri May 06 21:06:31 2005 +0000
+++ b/src/Makefile.in	Mon May 09 16:13:15 2005 +0000
@@ -784,6 +784,7 @@
 	${lispsource}textmodes/paragraphs.elc \
 	${lispsource}textmodes/text-mode.elc \
 	${lispsource}emacs-lisp/timer.elc \
+	${lispsource}jka-cmpr-hook.elc \
 	${lispsource}vc-hooks.elc \
 	${lispsource}ediff-hook.elc \
 	TOOLTIP_SUPPORT \
@@ -878,6 +879,7 @@
 	../lisp/textmodes/text-mode.elc \
 	../lisp/emacs-lisp/timer.elc \
 	../lisp/vc-hooks.elc \
+	../lisp/jka-cmpr-hook.elc \
 	../lisp/ediff-hook.elc \
 	../lisp/widget.elc \
 	../lisp/window.elc \
--- a/src/dired.c	Fri May 06 21:06:31 2005 +0000
+++ b/src/dired.c	Mon May 09 16:13:15 2005 +0000
@@ -400,7 +400,7 @@
 Returns the longest string
 common to all file names in DIRECTORY that start with FILE.
 If there is only one and FILE matches it exactly, returns t.
-Returns nil if DIR contains no name starting with FILE.
+Returns nil if DIRECTORY contains no name starting with FILE.
 
 This function ignores some of the possible completions as
 determined by the variable `completion-ignored-extensions', which see.  */)
--- a/src/eval.c	Fri May 06 21:06:31 2005 +0000
+++ b/src/eval.c	Mon May 09 16:13:15 2005 +0000
@@ -747,6 +747,8 @@
   LOADHIST_ATTACH (symbol);
   if (!NILP (docstring))
     Fput (symbol, Qvariable_documentation, docstring);
+  else
+    Fput (symbol, Qvariable_documentation, Qnil);
 
   return aliased;
 }
--- a/src/fileio.c	Fri May 06 21:06:31 2005 +0000
+++ b/src/fileio.c	Mon May 09 16:13:15 2005 +0000
@@ -1022,7 +1022,7 @@
        doc: /* Convert filename NAME to absolute, and canonicalize it.
 Second arg DEFAULT-DIRECTORY is directory to start with if NAME is relative
 \(does not start with slash); if DEFAULT-DIRECTORY is nil or missing,
-the current buffer's value of default-directory is used.
+the current buffer's value of `default-directory' is used.
 File name components that are `.' are removed, and
 so are file name components followed by `..', along with the `..' itself;
 note that these simplifications are done without checking the resulting
@@ -2708,7 +2708,7 @@
 
 DEFUN ("rename-file", Frename_file, Srename_file, 2, 3,
        "fRename file: \nGRename %s to file: \np",
-       doc: /* Rename FILE as NEWNAME.  Both args strings.
+       doc: /* Rename FILE as NEWNAME.  Both args must be strings.
 If file has names other than FILE, it continues to have those names.
 Signals a `file-already-exists' error if a file NEWNAME already exists
 unless optional third argument OK-IF-ALREADY-EXISTS is non-nil.
@@ -2797,7 +2797,7 @@
 
 DEFUN ("add-name-to-file", Fadd_name_to_file, Sadd_name_to_file, 2, 3,
        "fAdd name to file: \nGName to add to %s: \np",
-       doc: /* Give FILE additional name NEWNAME.  Both args strings.
+       doc: /* Give FILE additional name NEWNAME.  Both args must be strings.
 Signals a `file-already-exists' error if a file NEWNAME already exists
 unless optional third argument OK-IF-ALREADY-EXISTS is non-nil.
 A number as third arg means request confirmation if NEWNAME already exists.
@@ -2864,7 +2864,7 @@
 #ifdef S_IFLNK
 DEFUN ("make-symbolic-link", Fmake_symbolic_link, Smake_symbolic_link, 2, 3,
        "FMake symbolic link to file: \nGMake symbolic link to file %s: \np",
-       doc: /* Make a symbolic link to FILENAME, named LINKNAME.  Both args strings.
+       doc: /* Make a symbolic link to FILENAME, named LINKNAME.  Both args must be strings.
 Signals a `file-already-exists' error if a file LINKNAME already exists
 unless optional third argument OK-IF-ALREADY-EXISTS is non-nil.
 A number as third arg means request confirmation if LINKNAME already exists.
@@ -3209,7 +3209,7 @@
 DEFUN ("access-file", Faccess_file, Saccess_file, 2, 2, 0,
        doc: /* Access file FILENAME, and get an error if that does not work.
 The second argument STRING is used in the error message.
-If there is no error, we return nil.  */)
+If there is no error, returns nil.  */)
      (filename, string)
      Lisp_Object filename, string;
 {
@@ -6038,7 +6038,7 @@
 
 DEFUN ("recent-auto-save-p", Frecent_auto_save_p, Srecent_auto_save_p,
        0, 0, 0,
-       doc: /* Return t if buffer has been auto-saved since last read in or saved.  */)
+       doc: /* Return t if current buffer has been auto-saved since last read in or saved.  */)
      ()
 {
   return (SAVE_MODIFF < current_buffer->auto_save_modified) ? Qt : Qnil;
--- a/src/fns.c	Fri May 06 21:06:31 2005 +0000
+++ b/src/fns.c	Mon May 09 16:13:15 2005 +0000
@@ -2536,19 +2536,19 @@
 	error ("Characters in the range have inconsistent values");
     }
   return val;
-}  
+}
 
 
 DEFUN ("char-table-range", Fchar_table_range, Schar_table_range,
        2, 2, 0,
        doc: /* Return the value in CHAR-TABLE for a range of characters RANGE.
-RANGE should be nil (for the default value)
+RANGE should be nil (for the default value),
 a vector which identifies a character set or a row of a character set,
 a character set name, or a character code.
 If the characters in the specified range have different values,
 an error is signalled.
 
-Note that this function doesn't check the parent of CHAR_TABLE.  */)
+Note that this function doesn't check the parent of CHAR-TABLE.  */)
      (char_table, range)
      Lisp_Object char_table, range;
 {
@@ -2582,7 +2582,7 @@
     {
       size = ASIZE (range);
       if (size == 0)
-	args_out_of_range (range, 0);
+	args_out_of_range (range, make_number (0));
       CHECK_NUMBER (AREF (range, 0));
       charset_id = XINT (AREF (range, 0));
       if (size > 1)
@@ -2631,7 +2631,7 @@
 	current_default = XCHAR_TABLE (char_table)->contents[defalt];
       return char_table_range (char_table, from, to, current_default);
     }
-  
+
   val = XCHAR_TABLE (char_table)->contents[128 + charset_id];
   if (! SUB_CHAR_TABLE_P (val))
     return (NILP (val) ? current_default : val);
--- a/src/lread.c	Fri May 06 21:06:31 2005 +0000
+++ b/src/lread.c	Mon May 09 16:13:15 2005 +0000
@@ -1006,6 +1006,7 @@
 
 DEFUN ("locate-file-internal", Flocate_file_internal, Slocate_file_internal, 2, 4, 0,
        doc: /* Search for FILENAME through PATH.
+Returns the file's name in absolute form, or nil if not found.
 If SUFFIXES is non-nil, it should be a list of suffixes to append to
 file name when searching.
 If non-nil, PREDICATE is used instead of `file-readable-p'.
--- a/src/macselect.c	Fri May 06 21:06:31 2005 +0000
+++ b/src/macselect.c	Mon May 09 16:13:15 2005 +0000
@@ -98,8 +98,10 @@
    selection type with a scrap flavor type via `mac-ostype'.  */
 static Lisp_Object Qmac_scrap_name, Qmac_ostype;
 
+#ifdef MAC_OSX
 /* Selection name for communication via Services menu.  */
 static Lisp_Object Vmac_services_selection;
+#endif
 
 /* Get a reference to the scrap corresponding to the symbol SYM.  The
    reference is set to *SCRAP, and it becomes NULL if there's no
@@ -455,9 +457,11 @@
 	    value = call3 (handler_fn, selection_name,
 			   type, selection_value);
 
-	  if (CONSP (value)
-	      && EQ (XCAR (value), type)
-	      && STRINGP (XCDR (value)))
+	  if (STRINGP (value))
+	    err = put_scrap_string (scrap, type, value);
+	  else if (CONSP (value)
+		   && EQ (XCAR (value), type)
+		   && STRINGP (XCDR (value)))
 	    err = put_scrap_string (scrap, type, XCDR (value));
 	}
 
@@ -622,7 +626,8 @@
       hooks = Vx_lost_selection_functions;
       selection_symbol = Fcar (Fcar (Vselection_alist));
 
-      if (!EQ (hooks, Qunbound))
+      if (!EQ (hooks, Qunbound)
+	  && !NILP (Fx_selection_owner_p (selection_symbol)))
 	{
 	  for (; CONSP (hooks); hooks = Fcdr (hooks))
 	    call1 (Fcar (hooks), selection_symbol);
@@ -646,7 +651,8 @@
 	hooks = Vx_lost_selection_functions;
 	selection_symbol = Fcar (Fcar (XCDR (rest)));
 
-	if (!EQ (hooks, Qunbound))
+	if (!EQ (hooks, Qunbound)
+	  && !NILP (Fx_selection_owner_p (selection_symbol)))
 	  {
 	    for (; CONSP (hooks); hooks = Fcdr (hooks))
 	      call1 (Fcar (hooks), selection_symbol);
--- a/src/macterm.c	Fri May 06 21:06:31 2005 +0000
+++ b/src/macterm.c	Mon May 09 16:13:15 2005 +0000
@@ -154,10 +154,6 @@
 
 struct frame *pending_autoraise_frame;
 
-/* Non-zero means user is interacting with a toolkit scroll bar.  */
-
-static int toolkit_scroll_bar_interaction;
-
 /* Mouse movement.
 
    Formerly, we used PointerMotionHintMask (in standard_event_mask)
@@ -256,7 +252,6 @@
 struct frame * x_window_to_frame (struct mac_display_info *, WindowPtr);
 struct mac_display_info *mac_display_info_for_display (Display *);
 static void x_update_window_end P_ ((struct window *, int, int));
-static void mac_handle_tool_bar_click P_ ((struct frame *, EventRecord *));
 static int x_io_error_quitter P_ ((Display *));
 int x_catch_errors P_ ((Display *));
 void x_uncatch_errors P_ ((Display *, int));
@@ -4131,29 +4126,315 @@
 }
 
 
-/***********************************************************************
-			       Tool-bars
- ***********************************************************************/
-
-/* Handle mouse button event on the tool-bar of frame F, at
-   frame-relative coordinates X/Y.  EVENT_TYPE is either ButtionPress
-   or ButtonRelase.  */
-
-static void
-mac_handle_tool_bar_click (f, button_event)
-     struct frame *f;
-     EventRecord *button_event;
-{
-  int x = button_event->where.h;
-  int y = button_event->where.v;
-
-  if (button_event->what == mouseDown)
-    handle_tool_bar_click (f, x, y, 1, 0);
+/************************************************************************
+			 Toolkit scroll bars
+ ************************************************************************/
+
+#ifdef USE_TOOLKIT_SCROLL_BARS
+
+static pascal void scroll_bar_timer_callback P_ ((EventLoopTimerRef, void *));
+static OSStatus install_scroll_bar_timer P_ ((void));
+static OSStatus set_scroll_bar_timer P_ ((EventTimerInterval));
+static int control_part_code_to_scroll_bar_part P_((ControlPartCode));
+static void construct_scroll_bar_click P_ ((struct scroll_bar *, int,
+					    unsigned long,
+					    struct input_event *));
+static OSErr get_control_part_bound P_((ControlHandle, ControlPartCode,
+					Rect *));
+static void x_scroll_bar_handle_press P_ ((struct scroll_bar *,
+					   ControlPartCode,
+					   unsigned long,
+					   struct input_event *));
+static void x_scroll_bar_handle_release P_ ((struct scroll_bar *,
+					     unsigned long,
+					     struct input_event *));
+static void x_scroll_bar_handle_drag P_ ((WindowPtr, struct scroll_bar *,
+					  Point, unsigned long,
+					  struct input_event *));
+static void x_set_toolkit_scroll_bar_thumb P_ ((struct scroll_bar *,
+						int, int, int));
+
+/* Last scroll bar part sent in x_scroll_bar_handle_*.  */
+
+static int last_scroll_bar_part;
+
+static EventLoopTimerRef scroll_bar_timer;
+
+static int scroll_bar_timer_event_posted_p;
+
+#define SCROLL_BAR_FIRST_DELAY 0.5
+#define SCROLL_BAR_CONTINUOUS_DELAY (1.0 / 15)
+
+static pascal void
+scroll_bar_timer_callback (timer, data)
+     EventLoopTimerRef timer;
+     void *data;
+{
+  EventRef event = NULL;
+  OSErr err;
+
+  err = CreateEvent (NULL, kEventClassMouse, kEventMouseMoved, 0,
+		     kEventAttributeNone, &event);
+  if (err == noErr)
+    {
+      Point mouse_pos;
+
+      GetMouse (&mouse_pos);
+      LocalToGlobal (&mouse_pos);
+      err = SetEventParameter (event, kEventParamMouseLocation, typeQDPoint,
+			       sizeof (Point), &mouse_pos);
+    }
+  if (err == noErr)
+    {
+      UInt32 modifiers = GetCurrentKeyModifiers ();
+
+      err = SetEventParameter (event, kEventParamKeyModifiers, typeUInt32,
+			       sizeof (UInt32), &modifiers);
+    }
+  if (err == noErr)
+    err = PostEventToQueue (GetCurrentEventQueue (), event,
+			    kEventPriorityStandard);
+  if (err == noErr)
+    scroll_bar_timer_event_posted_p = 1;
+
+  if (event)
+    ReleaseEvent (event);
+}
+
+static OSStatus
+install_scroll_bar_timer ()
+{
+  static EventLoopTimerUPP scroll_bar_timer_callbackUPP = NULL;
+
+  if (scroll_bar_timer_callbackUPP == NULL)
+    scroll_bar_timer_callbackUPP =
+      NewEventLoopTimerUPP (scroll_bar_timer_callback);
+
+  if (scroll_bar_timer == NULL)
+    /* Mac OS X and CarbonLib 1.5 and later allow us to specify
+       kEventDurationForever as delays.  */
+    return
+      InstallEventLoopTimer (GetCurrentEventLoop (),
+			     kEventDurationForever, kEventDurationForever,
+			     scroll_bar_timer_callbackUPP, NULL,
+			     &scroll_bar_timer);
+}
+
+static OSStatus
+set_scroll_bar_timer (delay)
+     EventTimerInterval delay;
+{
+  if (scroll_bar_timer == NULL)
+    install_scroll_bar_timer ();
+
+  scroll_bar_timer_event_posted_p = 0;
+
+  return SetEventLoopTimerNextFireTime (scroll_bar_timer, delay);
+}
+
+static int
+control_part_code_to_scroll_bar_part (part_code)
+     ControlPartCode part_code;
+{
+  switch (part_code)
+    {
+    case kControlUpButtonPart:		return scroll_bar_up_arrow;
+    case kControlDownButtonPart:	return scroll_bar_down_arrow;
+    case kControlPageUpPart:		return scroll_bar_above_handle;
+    case kControlPageDownPart:		return scroll_bar_below_handle;
+    case kControlIndicatorPart:		return scroll_bar_handle;
+    }
+
+  return -1;
+}
+
+static void
+construct_scroll_bar_click (bar, part, timestamp, bufp)
+     struct scroll_bar *bar;
+     int part;
+     unsigned long timestamp;
+     struct input_event *bufp;
+{
+  bufp->kind = SCROLL_BAR_CLICK_EVENT;
+  bufp->frame_or_window = bar->window;
+  bufp->arg = Qnil;
+  bufp->part = part;
+  bufp->code = 0;
+  bufp->timestamp = timestamp;
+  XSETINT (bufp->x, 0);
+  XSETINT (bufp->y, 0);
+  bufp->modifiers = 0;
+}
+
+static OSErr
+get_control_part_bound (ch, part_code, rect)
+     ControlHandle ch;
+     ControlPartCode part_code;
+     Rect *rect;
+{
+  RgnHandle region = NewRgn ();
+  OSStatus err;
+
+  err = GetControlRegion (ch, part_code, region);
+  if (err == noErr)
+    GetRegionBounds (region, rect);
+  DisposeRgn (region);
+
+  return err;
+}
+
+static void
+x_scroll_bar_handle_press (bar, part_code, timestamp, bufp)
+     struct scroll_bar *bar;
+     ControlPartCode part_code;
+     unsigned long timestamp;
+     struct input_event *bufp;
+{
+  int part = control_part_code_to_scroll_bar_part (part_code);
+
+  if (part < 0)
+    return;
+
+  if (part != scroll_bar_handle)
+    {
+      construct_scroll_bar_click (bar, part, timestamp, bufp);
+      HiliteControl (SCROLL_BAR_CONTROL_HANDLE (bar), part_code);
+      set_scroll_bar_timer (SCROLL_BAR_FIRST_DELAY);
+    }
+
+  last_scroll_bar_part = part;
+  bar->dragging = Qnil;
+  tracked_scroll_bar = bar;
+}
+
+static void
+x_scroll_bar_handle_release (bar, timestamp, bufp)
+     struct scroll_bar *bar;
+     unsigned long timestamp;
+     struct input_event *bufp;
+{
+  if (last_scroll_bar_part != scroll_bar_handle
+      || !GC_NILP (bar->dragging))
+    construct_scroll_bar_click (bar, scroll_bar_end_scroll, timestamp, bufp);
+
+  HiliteControl (SCROLL_BAR_CONTROL_HANDLE (bar), 0);
+  set_scroll_bar_timer (kEventDurationForever);
+
+  last_scroll_bar_part = -1;
+  bar->dragging = Qnil;
+  tracked_scroll_bar = NULL;
+}
+
+static void
+x_scroll_bar_handle_drag (win, bar, mouse_pos, timestamp, bufp)
+     WindowPtr win;
+     struct scroll_bar *bar;
+     Point mouse_pos;
+     unsigned long timestamp;
+     struct input_event *bufp;
+{
+  ControlHandle ch = SCROLL_BAR_CONTROL_HANDLE (bar);
+
+  if (last_scroll_bar_part == scroll_bar_handle)
+    {
+      int top, top_range;
+      Rect r;
+
+      get_control_part_bound (SCROLL_BAR_CONTROL_HANDLE (bar),
+			      kControlIndicatorPart, &r);
+
+      if (GC_NILP (bar->dragging))
+	XSETINT (bar->dragging, mouse_pos.v - r.top);
+
+      top = mouse_pos.v - XINT (bar->dragging) - XINT (bar->track_top);
+      top_range = (XINT (bar->track_height) - (r.bottom - r.top)) *
+	(1.0 + (float) GetControlViewSize (ch) / GetControl32BitMaximum (ch))
+	+ .5;
+      
+      if (top < 0)
+	top = 0;
+      if (top > top_range)
+	top = top_range;
+
+      construct_scroll_bar_click (bar, scroll_bar_handle, timestamp, bufp);
+      XSETINT (bufp->x, top);
+      XSETINT (bufp->y, top_range);
+    }
   else
-    handle_tool_bar_click (f, x, y, 0,
-			   x_mac_to_emacs_modifiers (FRAME_MAC_DISPLAY_INFO (f),
-						     button_event->modifiers));
-}
+    {
+      ControlPartCode part_code;
+      int unhilite_p = 0, part;
+
+      if (ch != FindControlUnderMouse (mouse_pos, win, &part_code))
+	unhilite_p = 1;
+      else
+	{
+	  part = control_part_code_to_scroll_bar_part (part_code);
+
+	  switch (last_scroll_bar_part)
+	    {
+	    case scroll_bar_above_handle:
+	    case scroll_bar_below_handle:
+	      if (part != scroll_bar_above_handle
+		  && part != scroll_bar_below_handle)
+		unhilite_p = 1;
+	      break;
+
+	    case scroll_bar_up_arrow:
+	    case scroll_bar_down_arrow:
+	      if (part != scroll_bar_up_arrow
+		  && part != scroll_bar_down_arrow)
+		unhilite_p = 1;
+	      break;
+	    }
+	}
+
+      if (unhilite_p)
+	HiliteControl (SCROLL_BAR_CONTROL_HANDLE (bar), 0);
+      else if (part != last_scroll_bar_part
+	       || scroll_bar_timer_event_posted_p)
+	{
+	  construct_scroll_bar_click (bar, part, timestamp, bufp);
+	  last_scroll_bar_part = part;
+	  HiliteControl (SCROLL_BAR_CONTROL_HANDLE (bar), part_code);
+	  set_scroll_bar_timer (SCROLL_BAR_CONTINUOUS_DELAY);
+	}
+    }
+}
+
+/* Set the thumb size and position of scroll bar BAR.  We are currently
+   displaying PORTION out of a whole WHOLE, and our position POSITION.  */
+
+static void
+x_set_toolkit_scroll_bar_thumb (bar, portion, position, whole)
+     struct scroll_bar *bar;
+     int portion, position, whole;
+{
+  ControlHandle ch = SCROLL_BAR_CONTROL_HANDLE (bar);
+
+  int value, viewsize, maximum;
+
+  if (whole == 0 || XINT (bar->track_height) == 0)
+    value = 0, viewsize = 1, maximum = 0;
+  else
+    {
+      value = position;
+      viewsize = portion;
+      maximum = max (0, whole - portion);
+    }
+
+  BLOCK_INPUT;
+
+  SetControl32BitMinimum (ch, 0);
+  SetControl32BitMaximum (ch, maximum);
+  SetControl32BitValue (ch, value);
+  SetControlViewSize (ch, viewsize);
+
+  UNBLOCK_INPUT;
+}
+
+#endif /* USE_TOOLKIT_SCROLL_BARS */
+
 
 
 /************************************************************************
@@ -4185,13 +4466,12 @@
 
 #if TARGET_API_MAC_CARBON
   ch = NewControl (FRAME_MAC_WINDOW (f), &r, "\p", 1, 0, 0, 0,
-		   kControlScrollBarProc, 0L);
+		   kControlScrollBarProc, (long) bar);
 #else
-  ch = NewControl (FRAME_MAC_WINDOW (f), &r, "\p", 1, 0, 0, 0, scrollBarProc,
-		   0L);
+  ch = NewControl (FRAME_MAC_WINDOW (f), &r, "\p", 1, 0, 0, 0,
+		   scrollBarProc, (long) bar);
 #endif
   SET_SCROLL_BAR_CONTROL_HANDLE (bar, ch);
-  SetControlReference (ch, (long) bar);
 
   XSETWINDOW (bar->window, w);
   XSETINT (bar->top, top);
@@ -4201,6 +4481,10 @@
   XSETINT (bar->start, 0);
   XSETINT (bar->end, 0);
   bar->dragging = Qnil;
+#ifdef USE_TOOLKIT_SCROLL_BARS
+  bar->track_top = Qnil;
+  bar->track_height = Qnil;
+#endif
 
   /* Add bar to its frame's list of scroll bars.  */
   bar->next = FRAME_SCROLL_BARS (f);
@@ -4227,6 +4511,8 @@
    the bar's top is as far down as it goes; otherwise, there's no way
    to move to the very end of the buffer.  */
 
+#ifndef USE_TOOLKIT_SCROLL_BARS
+
 static void
 x_scroll_bar_set_handle (bar, start, end, rebuild)
      struct scroll_bar *bar;
@@ -4286,6 +4572,7 @@
   UNBLOCK_INPUT;
 }
 
+#endif /* !USE_TOOLKIT_SCROLL_BARS */
 
 /* Destroy scroll bar BAR, and set its Emacs window's scroll bar to
    nil.  */
@@ -4324,11 +4611,7 @@
   /* Get window dimensions.  */
   window_box (w, -1, 0, &window_y, 0, &window_height);
   top = window_y;
-#ifdef MAC_OSX
-  width = 16;
-#else
   width = WINDOW_CONFIG_SCROLL_BAR_COLS (w) * FRAME_COLUMN_WIDTH (f);
-#endif
   height = window_height;
 
   /* Compute the left edge of the scroll bar area.  */
@@ -4343,9 +4626,9 @@
 
   /* Compute the left edge of the scroll bar.  */
   if (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT (w))
-    sb_left = left + width - sb_width - (width - sb_width) / 2;
+    sb_left = left;
   else
-    sb_left = left + (width - sb_width) / 2;
+    sb_left = left + width - sb_width;
 
   /* Adjustments according to Inside Macintosh to make it look nice */
   disp_top = top;
@@ -4418,11 +4701,44 @@
           XSETINT (bar->top, top);
           XSETINT (bar->width, sb_width);
           XSETINT (bar->height, height);
+#ifdef USE_TOOLKIT_SCROLL_BARS
+	  bar->track_top = Qnil;
+	  bar->track_height = Qnil;
+#endif
         }
 
       UNBLOCK_INPUT;
     }
 
+#ifdef USE_TOOLKIT_SCROLL_BARS
+  if (NILP (bar->track_top))
+    {
+      ControlHandle ch = SCROLL_BAR_CONTROL_HANDLE (bar);
+      Rect r0, r1;
+
+      BLOCK_INPUT;
+
+      SetControl32BitMinimum (ch, 0);
+      SetControl32BitMaximum (ch, 1);
+      SetControlViewSize (ch, 1);
+
+      /* Move the scroll bar thumb to the top.  */
+      SetControl32BitValue (ch, 0);
+      get_control_part_bound (ch, kControlIndicatorPart, &r0);
+
+      /* Move the scroll bar thumb to the bottom.  */
+      SetControl32BitValue (ch, 1);
+      get_control_part_bound (ch, kControlIndicatorPart, &r1);
+
+      UnionRect (&r0, &r1, &r0);
+      XSETINT (bar->track_top, r0.top);
+      XSETINT (bar->track_height, r0.bottom - r0.top);
+
+      UNBLOCK_INPUT;
+    }
+
+  x_set_toolkit_scroll_bar_thumb (bar, portion, position, whole);
+#else /* not USE_TOOLKIT_SCROLL_BARS */
   /* Set the scroll bar's current state, unless we're currently being
      dragged.  */
   if (NILP (bar->dragging))
@@ -4438,6 +4754,7 @@
 	  x_scroll_bar_set_handle (bar, start, end, 0);
 	}
     }
+#endif /* not USE_TOOLKIT_SCROLL_BARS */
 }
 
 
@@ -4619,6 +4936,7 @@
   XSETINT (bufp->y, top_range);
 }
 
+#ifndef USE_TOOLKIT_SCROLL_BARS
 
 /* Handle some mouse motion while someone is dragging the scroll bar.
 
@@ -4653,6 +4971,7 @@
     }
 }
 
+#endif /* !USE_TOOLKIT_SCROLL_BARS */
 
 /* Return information to the user about the current position of the
    mouse on the scroll bar.  */
@@ -8657,6 +8976,9 @@
 		    SInt16 control_part_code;
 		    ControlHandle ch;
 		    Point mouse_loc = er.where;
+#ifdef MAC_OSX
+		    ControlKind control_kind;
+#endif
 
 		    f = mac_window_to_frame (window_ptr);
 		    /* convert to local coordinates of new window */
@@ -8666,6 +8988,10 @@
 #if TARGET_API_MAC_CARBON
 		    ch = FindControlUnderMouse (mouse_loc, window_ptr,
 						&control_part_code);
+#ifdef MAC_OSX
+		    if (ch)
+		      GetControlKind (ch, &control_kind);
+#endif
 #else
 		    control_part_code = FindControl (mouse_loc, window_ptr,
 						     &ch);
@@ -8684,19 +9010,42 @@
 		    /* ticks to milliseconds */
 
 		    if (dpyinfo->grabbed && tracked_scroll_bar
+			|| ch != 0
+#ifndef USE_TOOLKIT_SCROLL_BARS
 			/* control_part_code becomes kControlNoPart if
-			   a progress indicator is clicked.  */
-			|| ch != 0 && control_part_code != kControlNoPart)
+ 			   a progress indicator is clicked.  */
+			&& control_part_code != kControlNoPart
+#else  /* USE_TOOLKIT_SCROLL_BARS */
+#ifdef MAC_OSX
+			&& control_kind.kind == kControlKindScrollBar
+#endif	/* MAC_OSX */
+#endif	/* USE_TOOLKIT_SCROLL_BARS */
+			)
 		      {
 			struct scroll_bar *bar;
 
 			if (dpyinfo->grabbed && tracked_scroll_bar)
 			  {
 			    bar = tracked_scroll_bar;
+#ifndef USE_TOOLKIT_SCROLL_BARS
 			    control_part_code = kControlIndicatorPart;
+#endif
 			  }
 			else
 			  bar = (struct scroll_bar *) GetControlReference (ch);
+#ifdef USE_TOOLKIT_SCROLL_BARS
+			/* Make the "Ctrl-Mouse-2 splits window" work
+			   for toolkit scroll bars.  */
+			if (er.modifiers & controlKey)
+			  x_scroll_bar_handle_click (bar, control_part_code,
+						     &er, &inev);
+			else if (er.what == mouseDown)
+			  x_scroll_bar_handle_press (bar, control_part_code,
+						     inev.timestamp, &inev);
+			else
+			  x_scroll_bar_handle_release (bar, inev.timestamp,
+						       &inev);
+#else  /* not USE_TOOLKIT_SCROLL_BARS */
 			x_scroll_bar_handle_click (bar, control_part_code,
 						   &er, &inev);
 			if (er.what == mouseDown
@@ -8704,6 +9053,7 @@
 			  tracked_scroll_bar = bar;
 			else
 			  tracked_scroll_bar = NULL;
+#endif  /* not USE_TOOLKIT_SCROLL_BARS */
 		      }
 		    else
 		      {
@@ -8753,15 +9103,18 @@
 			  dpyinfo->grabbed &= ~(1 << inev.code);
 		      }
 
-		    switch (er.what)
-		      {
-		      case mouseDown:
-			inev.modifiers |= down_modifier;
-			break;
-		      case mouseUp:
-			inev.modifiers |= up_modifier;
-			break;
-		      }
+#ifdef USE_TOOLKIT_SCROLL_BARS
+		    if (inev.kind == MOUSE_CLICK_EVENT)
+#endif
+		      switch (er.what)
+			{
+			case mouseDown:
+			  inev.modifiers |= down_modifier;
+			  break;
+			case mouseUp:
+			  inev.modifiers |= up_modifier;
+			  break;
+			}
 		  }
 		break;
 
@@ -8863,10 +9216,16 @@
 		  GlobalToLocal (&mouse_pos);
 
 		  if (dpyinfo->grabbed && tracked_scroll_bar)
+#ifdef USE_TOOLKIT_SCROLL_BARS
+		    x_scroll_bar_handle_drag (wp, tracked_scroll_bar,
+					      mouse_pos, er.when * (1000 / 60),
+					      &inev);
+#else /* not USE_TOOLKIT_SCROLL_BARS */
 		    x_scroll_bar_note_movement (tracked_scroll_bar,
 						mouse_pos.v
 						- XINT (tracked_scroll_bar->top),
-						TickCount() * (1000 / 60));
+						er.when * (1000 / 60));
+#endif /* not USE_TOOLKIT_SCROLL_BARS */
 		  else
 		    {
 		      /* Generate SELECT_WINDOW_EVENTs when needed.  */
@@ -8941,6 +9300,23 @@
 	    else
 	      {
 		/* A window has been deactivated */
+#if USE_TOOLKIT_SCROLL_BARS
+		if (dpyinfo->grabbed && tracked_scroll_bar)
+		  {
+		    struct input_event event;
+
+		    EVENT_INIT (event);
+		    event.kind = NO_EVENT;
+		    x_scroll_bar_handle_release (tracked_scroll_bar,
+						 er.when * (1000 / 60),
+						 &event);
+		    if (event.kind != NO_EVENT)
+		      {
+			kbd_buffer_store_event_hold (&event, hold_quit);
+			count++;
+		      }
+		  }
+#endif
 		dpyinfo->grabbed = 0;
 
 		x_detect_focus_change (dpyinfo, &er, &inev);
@@ -9720,42 +10096,6 @@
   /* Try to use interrupt input; if we can't, then start polling.  */
   Fset_input_mode (Qt, Qnil, Qt, Qnil);
 
-#ifdef USE_X_TOOLKIT
-  XtToolkitInitialize ();
-  Xt_app_con = XtCreateApplicationContext ();
-  XtAppSetFallbackResources (Xt_app_con, Xt_default_resources);
-
-  /* Install an asynchronous timer that processes Xt timeout events
-     every 0.1s.  This is necessary because some widget sets use
-     timeouts internally, for example the LessTif menu bar, or the
-     Xaw3d scroll bar.  When Xt timouts aren't processed, these
-     widgets don't behave normally.  */
-  {
-    EMACS_TIME interval;
-    EMACS_SET_SECS_USECS (interval, 0, 100000);
-    start_atimer (ATIMER_CONTINUOUS, interval, x_process_timeouts, 0);
-  }
-#endif
-
-#if USE_TOOLKIT_SCROLL_BARS
-  xaw3d_arrow_scroll = False;
-  xaw3d_pick_top = True;
-#endif
-
-#if 0
-  /* Note that there is no real way portable across R3/R4 to get the
-     original error handler.  */
-  XSetErrorHandler (x_error_handler);
-  XSetIOErrorHandler (x_io_error_quitter);
-
-  /* Disable Window Change signals;  they are handled by X events.  */
-#ifdef SIGWINCH
-  signal (SIGWINCH, SIG_DFL);
-#endif /* ! defined (SIGWINCH) */
-
-  signal (SIGPIPE, x_connection_signal);
-#endif
-
   BLOCK_INPUT;
 
 #if TARGET_API_MAC_CARBON
@@ -9832,7 +10172,11 @@
 
   DEFVAR_LISP ("x-toolkit-scroll-bars", &Vx_toolkit_scroll_bars,
 	       doc: /* If not nil, Emacs uses toolkit scroll bars.  */);
+#ifdef USE_TOOLKIT_SCROLL_BARS
   Vx_toolkit_scroll_bars = Qt;
+#else
+  Vx_toolkit_scroll_bars = Qnil;
+#endif
 
   DEFVAR_BOOL ("x-use-underline-position-properties",
                &x_use_underline_position_properties,
--- a/src/macterm.h	Fri May 06 21:06:31 2005 +0000
+++ b/src/macterm.h	Mon May 09 16:13:15 2005 +0000
@@ -492,6 +492,12 @@
      place where the user grabbed it.  If the handle isn't currently
      being dragged, this is Qnil.  */
   Lisp_Object dragging;
+
+#ifdef USE_TOOLKIT_SCROLL_BARS
+  /* The position and size of the scroll bar handle track area in
+     pixels, relative to the frame.  */
+  Lisp_Object track_top, track_height;
+#endif
 };
 
 /* The number of elements a vector holding a struct scroll_bar needs.  */
--- a/src/sysselect.h	Fri May 06 21:06:31 2005 +0000
+++ b/src/sysselect.h	Mon May 09 16:13:15 2005 +0000
@@ -19,7 +19,13 @@
 Boston, MA 02111-1307, USA.  */
 
 #ifdef HAVE_SYS_SELECT_H
+#if defined (DARWIN) || defined (MAC_OSX)
+#undef init_process
+#endif
 #include <sys/select.h>
+#if defined (DARWIN) || defined (MAC_OSX)
+#define init_process emacs_init_process
+#endif
 #endif
 
 #ifdef FD_SET
--- a/src/xfns.c	Fri May 06 21:06:31 2005 +0000
+++ b/src/xfns.c	Mon May 09 16:13:15 2005 +0000
@@ -4388,6 +4388,10 @@
   EMACS_TIME delay;
   int secs, usecs = 0;
 
+  /* Don't bother for ttys.  */
+  if (NILP (Vwindow_system))
+    return;
+
   cancel_hourglass ();
 
   if (INTEGERP (Vhourglass_delay)