changeset 83182:4e92102a0172

Merged in changes from CVS trunk. Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-468 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-469 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-222
author Karoly Lorentey <lorentey@elte.hu>
date Tue, 27 Jul 2004 07:43:21 +0000
parents 159920fd1024 (current diff) 7e0e6be19969 (diff)
children bc1eb76e4766
files lisp/ChangeLog lisp/frame.el lisp/subr.el man/ChangeLog src/alloc.c src/dispextern.h src/fileio.c src/keyboard.h src/window.c src/xdisp.c src/xfaces.c
diffstat 25 files changed, 346 insertions(+), 138 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Sat Jul 24 22:08:12 2004 +0000
+++ b/lisp/ChangeLog	Tue Jul 27 07:43:21 2004 +0000
@@ -1,3 +1,34 @@
+2004-07-26  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* imenu.el (imenu-prev-index-position-function)
+	(imenu-extract-index-name-function, imenu-name-lookup-function)
+	(imenu--index-alist): Docstring redundancy fix.
+
+2004-07-25  Lars Hansen  <larsh@math.ku.dk>
+
+	* wdired.el (wdired-finish-edit): Require dired-aux before locally
+	binding dired-backup-overwrite.
+
+2004-07-25  John Paul Wallington  <jpw@gnu.org>
+
+	* subr.el (butlast, event-modifiers, event-basic-type): Doc fixes.
+
+2004-07-24  Luc Teirlinck  <teirllm@auburn.edu>
+
+	* term/tty-colors.el (tty-color-approximate): Doc fix.
+
+	* select.el (x-get-selection, x-set-selection): Doc fixes.
+
+	* frame.el (make-frame): Doc fix.
+
+2004-07-24  Richard M. Stallman  <rms@gnu.org>
+
+	* mail/rmail.el (rmail-mime-charset-pattern):
+	Don't include semicolon in the charset value.
+
+	* replace.el (occur-next-error): Call set-window-point.
+	(occur-engine): Handle negative NLINES.
+
 2004-07-23  Luc Teirlinck  <teirllm@auburn.edu>
 
 	* frame.el (modify-all-frames-parameters): Minor doc fix.
@@ -49,8 +80,8 @@
 
 2004-07-17  Kai Grossjohann  <kai.grossjohann@gmx.net>
 
-	* net/tramp.el (tramp-handle-verify-visited-file-modtime): New
-	docstring.  From Luc Teirlinck.
+	* net/tramp.el (tramp-handle-verify-visited-file-modtime):
+	New docstring.  From Luc Teirlinck.
 
 2004-07-17  Luc Teirlinck  <teirllm@auburn.edu>
 
--- a/lisp/frame.el	Sat Jul 24 22:08:12 2004 +0000
+++ b/lisp/frame.el	Tue Jul 27 07:43:21 2004 +0000
@@ -642,7 +642,13 @@
 
 Before the frame is created (via `frame-creation-function-alist'), functions on the
 hook `before-make-frame-hook' are run.  After the frame is created, functions
-on `after-make-frame-functions' are run with one arg, the newly created frame."
+on `after-make-frame-functions' are run with one arg, the newly created frame.
+
+This function itself does not make the new frame the selected frame.
+The previously selected frame remains selected.  However, the
+window system may select the new frame for its own reasons, for
+instance if the frame appears under the mouse pointer and your
+setup is for focus to follow the pointer."
   (interactive)
   (let* ((w (cond
 	     ((assq 'display-id parameters)
--- a/lisp/imenu.el	Sat Jul 24 22:08:12 2004 +0000
+++ b/lisp/imenu.el	Tue Jul 27 07:43:21 2004 +0000
@@ -1,6 +1,7 @@
 ;;; imenu.el --- framework for mode-specific buffer indexes
 
-;; Copyright (C) 1994, 1995, 1996, 1997, 1998, 2003 Free Software Foundation, Inc.
+;; Copyright (C) 1994, 1995, 1996, 1997, 1998, 2003, 2004
+;;           Free Software Foundation, Inc.
 
 ;; Author: Ake Stenhoff <etxaksf@aom.ericsson.se>
 ;;         Lars Lindberg <lli@sypro.cap.se>
@@ -255,9 +256,7 @@
 file.
 
 The function should leave point at the place to be connected to the
-index and it should return nil when it doesn't find another index.
-
-This variable is local in all buffers.")
+index and it should return nil when it doesn't find another index.")
 ;;;###autoload
 (make-variable-buffer-local 'imenu-prev-index-position-function)
 
@@ -267,9 +266,7 @@
 
 This function is called after `imenu-prev-index-position-function'
 finds a position for an index item, with point at that position.
-It should return the name for that index item.
-
-This variable is local in all buffers.")
+It should return the name for that index item.")
 ;;;###autoload
 (make-variable-buffer-local 'imenu-extract-index-name-function)
 
@@ -283,9 +280,7 @@
 If nil, comparison is done with `string='.
 Set this to some other function for more advanced comparisons,
 such as \"begins with\" or \"name matches and number of
-arguments match\".
-
-This variable is local in all buffers.")
+arguments match\".")
 ;;;###autoload
 (make-variable-buffer-local 'imenu-name-lookup-function)
 
@@ -453,9 +448,7 @@
   "The buffer index computed for this buffer in Imenu.
 Simple elements in the alist look like (INDEX-NAME . INDEX-POSITION).
 Special elements look like (INDEX-NAME INDEX-POSITION FUNCTION ARGUMENTS...).
-A nested sub-alist element looks like (INDEX-NAME SUB-ALIST).
-
-This variable is local in all buffers, once set.")
+A nested sub-alist element looks like (INDEX-NAME SUB-ALIST).")
 
 (make-variable-buffer-local 'imenu--index-alist)
 
--- a/lisp/mail/rmail.el	Sat Jul 24 22:08:12 2004 +0000
+++ b/lisp/mail/rmail.el	Tue Jul 27 07:43:21 2004 +0000
@@ -484,7 +484,7 @@
 
 ;;;###autoload
 (defvar rmail-mime-charset-pattern
-  "^content-type:[ ]*text/plain;[ \t\n]*charset=\"?\\([^ \t\n\"]+\\)\"?"
+  "^content-type:[ ]*text/plain;[ \t\n]*charset=\"?\\([^ \t\n\";]+\\)\"?"
   "Regexp to match MIME-charset specification in a header of message.
 The first parenthesized expression should match the MIME-charset name.")
 
--- a/lisp/replace.el	Sat Jul 24 22:08:12 2004 +0000
+++ b/lisp/replace.el	Tue Jul 27 07:43:21 2004 +0000
@@ -732,6 +732,8 @@
        #'previous-single-property-change
      #'next-single-property-change)
    "No more matches")
+  ;; In case the *Occur* buffer is visible in a nonselected window.
+  (set-window-point (get-buffer-window (current-buffer)) (point))
   (occur-mode-goto-occurrence))
 
 
@@ -1009,9 +1011,11 @@
 			      ;; concatenate them all together.
 			      (apply #'concat
 				     (nconc
-				      (occur-engine-add-prefix (nreverse (cdr (occur-accumulate-lines (- (1+ nlines)) keep-props))))
+				      (occur-engine-add-prefix (nreverse (cdr (occur-accumulate-lines (- (1+ (abs nlines))) keep-props))))
 				      (list out-line)
-				      (occur-engine-add-prefix (cdr (occur-accumulate-lines (1+ nlines) keep-props))))))))
+				      (if (> nlines 0)
+					  (occur-engine-add-prefix
+					   (cdr (occur-accumulate-lines (1+ nlines) keep-props)))))))))
 		      ;; Actually insert the match display data
 		      (with-current-buffer out-buf
 			(let ((beg (point))
--- a/lisp/select.el	Sat Jul 24 22:08:12 2004 +0000
+++ b/lisp/select.el	Tue Jul 27 07:43:21 2004 +0000
@@ -3,7 +3,7 @@
 ;; Maintainer: FSF
 ;; Keywords: internal
 
-;; Copyright (c) 1993, 1994 Free Software Foundation, Inc.
+;; Copyright (c) 1993, 1994, 2004 Free Software Foundation, Inc.
 ;; Based partially on earlier release by Lucid.
 
 ;; This file is part of GNU Emacs.
@@ -35,7 +35,11 @@
 and the argument DATA-TYPE (default `STRING') says
 how to convert the data.
 
-TYPE may be `SECONDARY' or `CLIPBOARD', in addition to `PRIMARY'.
+TYPE may be any symbol \(but nil stands for `PRIMARY').  However,
+only a few symbols are commonly used.  They conventionally have
+all upper-case names.  The most often used ones, in addition to
+`PRIMARY', are `SECONDARY' and `CLIPBOARD'.
+
 DATA-TYPE is usually `STRING', but can also be one of the symbols
 in `selection-converter-alist', which see."
   (let ((data (x-get-selection-internal (or type 'PRIMARY)
@@ -57,9 +61,11 @@
 
 (defun x-set-selection (type data)
   "Make an X Windows selection of type TYPE and value DATA.
-The argument TYPE (default `PRIMARY') says which selection,
-and DATA specifies the contents.  DATA may be a string,
-a symbol, an integer (or a cons of two integers or list of two integers).
+The argument TYPE (nil means `PRIMARY') says which selection, and
+DATA specifies the contents.  TYPE must be a symbol.  \(It can also
+be a string, which stands for the symbol with that name, but this
+is considered obsolete.)  DATA may be a string, a symbol, an
+integer (or a cons of two integers or list of two integers).
 
 The selection may also be a cons of two markers pointing to the same buffer,
 or an overlay.  In these cases, the selection is considered to be the text
@@ -69,8 +75,11 @@
 
 The data may also be a vector of valid non-vector selection values.
 
-Interactively, the text of the region is used as the selection value
-if the prefix arg is set."
+The return value is DATA.
+
+Interactively, this command sets the primary selection.  Without
+prefix argument, it reads the selection in the minibuffer.  With
+prefix argument, it uses the text of the region as the selection value ."
   (interactive (if (not current-prefix-arg)
 		   (list 'PRIMARY (read-string "Set text for pasting: "))
 		 (list 'PRIMARY (buffer-substring (region-beginning) (region-end)))))
--- a/lisp/subr.el	Sat Jul 24 22:08:12 2004 +0000
+++ b/lisp/subr.el	Tue Jul 27 07:43:21 2004 +0000
@@ -198,7 +198,7 @@
     list))
 
 (defun butlast (list &optional n)
-  "Returns a copy of LIST with the last N elements removed."
+  "Return a copy of LIST with the last N elements removed."
   (if (and n (<= n 0)) list
     (nbutlast (copy-sequence list) n)))
 
@@ -641,7 +641,7 @@
 	   (get (car obj) 'event-symbol-elements))))
 
 (defun event-modifiers (event)
-  "Returns a list of symbols representing the modifier keys in event EVENT.
+  "Return a list of symbols representing the modifier keys in event EVENT.
 The elements of the list may include `meta', `control',
 `shift', `hyper', `super', `alt', `click', `double', `triple', `drag',
 and `down'."
@@ -670,7 +670,7 @@
 	list))))
 
 (defun event-basic-type (event)
-  "Returns the basic type of the given event (all modifiers removed).
+  "Return the basic type of the given event (all modifiers removed).
 The value is a printing character (not upper case) or a symbol."
   (if (consp event)
       (setq event (car event)))
--- a/lisp/term/tty-colors.el	Sat Jul 24 22:08:12 2004 +0000
+++ b/lisp/term/tty-colors.el	Tue Jul 27 07:43:21 2004 +0000
@@ -864,15 +864,10 @@
     (if (< mag 1) 0 (acos (/ (+ r g b) mag)))))
 
 (defun tty-color-approximate (rgb &optional frame)
-  "Given a list of 3 rgb values in RGB, find the color in `tty-color-alist'
-which is the best approximation in the 3-dimensional RGB space,
-and return its description.
-
-Value is a list of the form \(NAME INDEX R G B\).  Note that the returned
-NAME is not necessarily the same string as the argument COLOR, because
-the latter might need to be approximated if it is not supported directly.
-
-Each value of the RGB triplet should be in the range 0..65535 range.
+  "Find the color in `tty-color-alist' that best approximates RGB.
+Value is a list of the form \(NAME INDEX R G B\).
+The argument RGB should be an rgb value, that is, a list of three
+integers in the 0..65535 range.
 FRAME defaults to the selected frame."
   (let* ((color-list (tty-color-alist frame))
 	 (candidate (car color-list))
--- a/lisp/textmodes/flyspell.el	Sat Jul 24 22:08:12 2004 +0000
+++ b/lisp/textmodes/flyspell.el	Tue Jul 27 07:43:21 2004 +0000
@@ -2,7 +2,7 @@
 
 ;; Copyright (C) 1998, 2000, 2001, 2002 Free Software Foundation, Inc.
 
-;; Author: Manuel Serrano <Manuel.Serrano@unice.fr>
+;; Author: Manuel Serrano <Manuel.Serrano@sophia.inria.fr>
 ;; Maintainer: FSF
 ;; Keywords: convenience
 
--- a/lisp/wdired.el	Sat Jul 24 22:08:12 2004 +0000
+++ b/lisp/wdired.el	Tue Jul 27 07:43:21 2004 +0000
@@ -455,6 +455,11 @@
 		  (setq file-new (substitute-in-file-name file-new))
 		  (if wdired-use-interactive-rename
 		      (wdired-search-and-rename file-ori file-new)
+                    ;; If dired-rename-file autoloads dired-aux while
+                    ;; dired-backup-overwrite is locally bound,
+                    ;; dired-backup-overwrite won't be initialized.
+                    ;; So we must ensure dired-aux is loaded.
+                    (require 'dired-aux)
 		    (condition-case err
 			(let ((dired-backup-overwrite nil))
 			  (dired-rename-file file-ori file-new
--- a/lispref/ChangeLog	Sat Jul 24 22:08:12 2004 +0000
+++ b/lispref/ChangeLog	Tue Jul 27 07:43:21 2004 +0000
@@ -1,3 +1,31 @@
+2004-07-24  Luc Teirlinck  <teirllm@auburn.edu>
+
+	* frames.texi: Various changes in addition to:
+	(Creating Frames): Expand and clarify description of `make-frame'.
+	(Window Frame Parameters): Either none or both of the `icon-left'
+	and `icon-top' parameters must be specified.  Put descriptions of
+	`menu-bar-lines' and `toolbar-lines' closer together and change
+	them accordingly.
+	(Frame Titles): `multiple-frames' is not guaranteed to be accurate
+	except while processing `frame-title-format' or `icon-title-format'.
+	(Deleting Frames): Correct description of `delete-frame'.
+	Non-nil return values of `frame-live-p' are like those of `framep'.
+	(Frames and Windows): mention return value of
+	`set-frame-selected-window'.
+	(Visibility of Frames): Mention `force' argument to
+	`make-frame-invisible'.  `frame-visible-p' returns t for all
+	frames on text-only terminals.
+	(Frame Configurations): Restoring a frame configuration does not
+	restore deleted frames.
+	(Window System Selections): `x-set-selection' returns DATA.
+	(Resources): Add example.
+	(Display Feature Testing): Clarify descriptions of
+	`display-pixel-height', `display-pixel-width', `x-server-version'
+	and `x-server-vendor'.
+
+	* windows.texi (Choosing Window): Add anchor.
+	* minibuf.texi (Minibuffer Misc): Add anchor.
+
 2004-07-23  John Paul Wallington  <jpw@gnu.org>
 
 	* macros.texi (Defining Macros): Declaration keyword for setting
--- a/lispref/frames.texi	Sat Jul 24 22:08:12 2004 +0000
+++ b/lispref/frames.texi	Tue Jul 27 07:43:21 2004 +0000
@@ -79,8 +79,9 @@
 To create a new frame, call the function @code{make-frame}.
 
 @defun make-frame &optional alist
-This function creates a new frame.  If you are using a supported window
-system, it makes a window frame; otherwise, it makes a terminal frame.
+This function creates and returns a new frame, displaying the current
+buffer.  If you are using a supported window system, it makes a window
+frame; otherwise, it makes a terminal frame.
 
 The argument is an alist specifying frame parameters.  Any parameters
 not mentioned in @var{alist} default according to the value of the
@@ -91,6 +92,12 @@
 The set of possible parameters depends in principle on what kind of
 window system Emacs uses to display its frames.  @xref{Window Frame
 Parameters}, for documentation of individual parameters you can specify.
+
+This function itself does not make the new frame the selected frame.
+@xref{Input Focus}.  The previously selected frame remains selected.
+However, the window system may select the new frame for its own reasons,
+for instance if the frame appears under the mouse pointer and your
+setup is for focus to follow the pointer.
 @end defun
 
 @defvar before-make-frame-hook
@@ -138,9 +145,10 @@
 terminal.
 
 @deffn Command make-frame-on-display display &optional parameters
-This creates a new frame on display @var{display}, taking the other
-frame parameters from @var{parameters}.  Aside from the @var{display}
-argument, it is like @code{make-frame} (@pxref{Creating Frames}).
+This creates and returns a new frame on display @var{display}, taking
+the other frame parameters from @var{parameters}.  Aside from the
+@var{display} argument, it is like @code{make-frame} (@pxref{Creating
+Frames}).
 @end deffn
 
 @defun x-display-list
@@ -165,7 +173,7 @@
 "*BorderWidth: 3\n*InternalBorder: 2\n"
 @end example
 
-@xref{Resources}.
+@xref{X Resources,, X Resources, emacs, The GNU Emacs Manual}.
 
 If @var{must-succeed} is non-@code{nil}, failure to open the connection
 terminates Emacs.  Otherwise, it is an ordinary Lisp error.
@@ -207,9 +215,10 @@
 
 @defun frame-parameter frame parameter
 @tindex frame-parameter
-This function returns the value of the parameter named @var{parameter}
-of @var{frame}.  If @var{frame} is @code{nil}, it returns the
-selected  frame's parameter.
+This function returns the value of the parameter @var{parameter} (a
+symbol) of @var{frame}.  If @var{frame} is @code{nil}, it returns the
+selected frame's parameter.  If @var{frame} has no setting for
+@var{parameter}, this function returns @code{nil}.
 @end defun
 
 @defun frame-parameters &optional frame
@@ -230,8 +239,8 @@
 @defun modify-all-frames-parameters alist
 This function alters the frame parameters of all existing frames
 according to @var{alist}, then modifies @code{default-frame-alist}
-to apply the same parameter values to frames that will be created
-henceforth.
+(and, if necessary, @code{initial-frame-alist}) to apply the same
+parameter values to frames that will be created henceforth.
 @end defun
 
 @node Initial Parameters
@@ -285,9 +294,12 @@
 Emacs frames---the first frame, and subsequent frames.  When using the X
 Window System, you can get the same results by means of X resources
 in many cases.
+
+Setting this variable does not affect existing frames.
 @end defvar
 
-See also @code{special-display-frame-alist}, in @ref{Choosing Window}.
+See also @code{special-display-frame-alist}.  @xref{Definition of
+special-display-frame-alist}.
 
 If you use options that specify window appearance when you invoke Emacs,
 they take effect by adding elements to @code{default-frame-alist}.  One
@@ -368,6 +380,10 @@
 pixels, counting from the left edge of the screen.  This takes effect if
 and when the frame is iconified.
 
+If you specify a value for this parameter, then you must also specify
+a value for @code{icon-top} and vice versa.  The window manager may
+ignore these two parameters.
+
 @item icon-top
 The screen position of the top edge @emph{of the frame's icon}, in
 pixels, counting from the top edge of the screen.  This takes effect if
@@ -528,8 +544,8 @@
 columns, so the actual default fringe widths for the frame may be
 larger than the specified values.  The extra width needed to reach an
 acceptable total is distributed evenly between the left and right
-fringe.  However, you can force one frame or the other to a precise
-width by specifying that width a negative integer.  If both widths are
+fringe.  However, you can force one fringe or the other to a precise
+width by specifying that width as a negative integer.  If both widths are
 negative, only the left fringe gets the specified width.
 
 @item unsplittable
@@ -541,10 +557,15 @@
 iconified.  @xref{Visibility of Frames}.
 
 @item menu-bar-lines
-The number of lines to allocate at the top of the frame for a menu bar.
-The default is 1.  @xref{Menu Bar}.  (In Emacs versions that use the X
-toolkit or GTK, there is only one menu bar line; all that matters about the
-number you specify is whether it is greater than zero.)
+The number of lines to allocate at the top of the frame for a menu
+bar.  The default is 1.  A value of @code{nil} means don't display a
+menu bar.  @xref{Menu Bar}.  (The X toolkit and GTK allow at most one
+menu bar line; they treat larger values as 1.)
+
+@item tool-bar-lines
+The number of lines to use for the toolbar.  A value of @code{nil} means
+don't display a tool bar.  (GTK allows at most one tool bar line; it
+treats larger values as 1.)
 
 @item screen-gamma
 @cindex gamma correction
@@ -557,7 +578,7 @@
 on a monitor with that gamma value.  If you specify 2.2 for
 @code{screen-gamma}, that means no correction is needed.  Other values
 request correction, designed to make the corrected colors appear on
-your screen they way they would have appeared without correction on an
+your screen the way they would have appeared without correction on an
 ordinary monitor with a gamma value of 2.2.
 
 If your monitor displays colors too light, you should specify a
@@ -565,14 +586,14 @@
 that makes colors darker.  A screen gamma value of 1.5 may give good
 results for LCD color displays.
 
-@item tool-bar-lines
-The number of lines to use for the toolbar.  A value of @code{nil} means
-don't display a tool bar.  (In Emacs versions that use GTK, there is
-only one tool bar line; all that matters about the number you specify
-is whether it is greater than zero.)
+@item line-spacing
+Additional space put below text lines, in pixels (a positive integer)
 
-@item line-spacing
-Additional space put below text lines in pixels (a positive integer).
+@item wait-for-wm
+If non-@code{nil}, tell Xt to wait for the window manager to confirm
+geometry changes.  Some window managers, including versions of Fvwm2
+and KDE, fail to confirm, so Xt hangs.  Set this to @code{nil} to
+prevent hanging with those window managers.
 
 @ignore
 @item parent-id
@@ -637,12 +658,6 @@
 If non-@code{nil}, the color for the background of scroll bars.  It is
 equivalent to the @code{:background} attribute of the
 @code{scroll-bar} face.
-
-@item wait-for-wm
-If non-@code{nil}, tell Xt to wait for the window manager to confirm
-geometry changes.  Some window managers, including versions of Fvwm2
-and KDE, fail to confirm, so Xt hangs.  Set this to @code{nil} to
-prevent hanging with those window managers.
 @end table
 
 @node Size and Position
@@ -818,6 +833,10 @@
 invisible frames).  The default value of @code{frame-title-format} uses
 @code{multiple-frames} so as to put the buffer name in the frame title
 only when there is more than one frame.
+
+The value of this variable is not guaranteed to be accurate except
+while processing @code{frame-title-format} or
+@code{icon-title-format}.
 @end defvar
 
 @node Deleting Frames
@@ -826,16 +845,14 @@
 
 Frames remain potentially visible until you explicitly @dfn{delete}
 them.  A deleted frame cannot appear on the screen, but continues to
-exist as a Lisp object until there are no references to it.  There is no
-way to cancel the deletion of a frame aside from restoring a saved frame
-configuration (@pxref{Frame Configurations}); this is similar to the
-way windows behave.
+exist as a Lisp object until there are no references to it.
 
 @deffn Command delete-frame &optional frame force
 @vindex delete-frame-functions
-This function deletes the frame @var{frame} after running the hook
-@code{delete-frame-functions} (each function gets one argument,
-@var{frame}).  By default, @var{frame} is the selected frame.
+This function deletes the frame @var{frame}.  Unless @var{frame} is a
+tooltip, it first runs the hook @code{delete-frame-functions} (each
+function gets one argument, @var{frame}).  By default, @var{frame} is
+the selected frame.
 
 A frame cannot be deleted if its minibuffer is used by other frames.
 Normally, you cannot delete a frame if all other frames are invisible,
@@ -844,7 +861,8 @@
 
 @defun frame-live-p frame
 The function @code{frame-live-p} returns non-@code{nil} if the frame
-@var{frame} has not been deleted.
+@var{frame} has not been deleted.  The possible non-@code{nil} return
+values are like those of @code{framep}.  @xref{Frames}.
 @end defun
 
   Some window managers provide a command to delete a window.  These work
@@ -929,29 +947,31 @@
 selected window with @code{frame-selected-window}.
 
 @defun frame-selected-window  &optional frame
-This function returns the window on @var{frame} that is selected within
-@var{frame}.  If omitted or @code{nil}, @var{frame} defaults to the selected frame.
+This function returns the window on @var{frame} that is selected
+within @var{frame}.  If omitted or @code{nil}, @var{frame} defaults to
+the selected frame.
 @end defun
 
 @defun set-frame-selected-window frame window
 This sets the selected window of frame @var{frame} to @var{window}.
 If @var{frame} is @code{nil}, it operates on the selected frame.  If
 @var{frame} is the selected frame, this makes @var{window} the
-selected window.
+selected window.  This function returns @var{window}.
 @end defun
 
   Conversely, selecting a window for Emacs with @code{select-window} also
 makes that window selected within its frame.  @xref{Selecting Windows}.
 
   Another function that (usually) returns one of the windows in a given
-frame is @code{minibuffer-window}.  @xref{Minibuffer Misc}.
+frame is @code{minibuffer-window}.  @xref{Definition of minibuffer-window}.
 
 @node Minibuffers and Frames
 @section Minibuffers and Frames
 
 Normally, each frame has its own minibuffer window at the bottom, which
 is used whenever that frame is selected.  If the frame has a minibuffer,
-you can get it with @code{minibuffer-window} (@pxref{Minibuffer Misc}).
+you can get it with @code{minibuffer-window} (@pxref{Definition of
+minibuffer-window}).
 
 However, you can also create a frame with no minibuffer.  Such a frame
 must use the minibuffer window of some other frame.  When you create the
@@ -966,8 +986,9 @@
 
 @defvar default-minibuffer-frame
 This variable specifies the frame to use for the minibuffer window, by
-default.  It is always local to the current terminal and cannot be
-buffer-local.  @xref{Multiple Displays}.
+default.  It does not affect existing frames.  It is always local to
+the current terminal and cannot be buffer-local.  @xref{Multiple
+Displays}.
 @end defvar
 
 @node Input Focus
@@ -1026,7 +1047,10 @@
 This function selects frame @var{frame}, temporarily disregarding the
 focus of the X server if any.  The selection of @var{frame} lasts until
 the next time the user does something to select a different frame, or
-until the next time this function is called.  The specified @var{frame}
+until the next time this function is called.  (If you are using a
+window system, the previously selected frame may be restored as the
+selected frame after return to the command loop, because it still may
+have the window system's input focus.)  The specified @var{frame}
 becomes the selected frame, as explained above, and the terminal that
 @var{frame} is on becomes the selected terminal.  This function
 returns @var{frame}, or @code{nil} if @var{frame} has been deleted.
@@ -1107,9 +1131,12 @@
 it makes the selected frame visible.
 @end deffn
 
-@deffn Command make-frame-invisible &optional frame
+@deffn Command make-frame-invisible &optional frame force
 This function makes frame @var{frame} invisible.  If you omit
 @var{frame}, it makes the selected frame invisible.
+
+Unless @var{force} is non-@code{nil}, this function refuses to make
+@var{frame} invisible if all other frames are invisible..
 @end deffn
 
 @deffn Command iconify-frame &optional frame
@@ -1121,6 +1148,10 @@
 This returns the visibility status of frame @var{frame}.  The value is
 @code{t} if @var{frame} is visible, @code{nil} if it is invisible, and
 @code{icon} if it is iconified.
+
+On a text-only terminal, all frames are considered visible, whether
+they are currently being displayed or not, and this function returns
+@code{t} for all frames.
 @end defun
 
   The visibility status of a frame is also available as a frame
@@ -1155,6 +1186,7 @@
 
 @deffn Command raise-frame &optional frame
 This function raises frame @var{frame} (default, the selected frame).
+If @var{frame} is invisible or iconified, this makes it visible.
 @end deffn
 
 @deffn Command lower-frame &optional frame
@@ -1185,7 +1217,8 @@
 
 @defun set-frame-configuration configuration &optional nodelete
 This function restores the state of frames described in
-@var{configuration}.
+@var{configuration}.  However, this function does not restore deleted
+frames.
 
 Ordinarily, this function deletes all existing frames not listed in
 @var{configuration}.  But if @var{nodelete} is non-@code{nil}, the
@@ -1467,7 +1500,7 @@
 symbols.  X clients including Emacs can read or set the selection for
 any given type.
 
-@defun x-set-selection type data
+@deffn Command x-set-selection type data
 This function sets a ``selection'' in the X server.  It takes two
 arguments: a selection type @var{type}, and the value to assign to it,
 @var{data}.  If @var{data} is @code{nil}, it means to clear out the
@@ -1482,9 +1515,11 @@
 Each possible @var{type} has its own selection value, which changes
 independently.  The usual values of @var{type} are @code{PRIMARY},
 @code{SECONDARY} and @code{CLIPBOARD}; these are symbols with upper-case
-names, in accord with X Window System conventions.  The default is
-@code{PRIMARY}.
-@end defun
+names, in accord with X Window System conventions.  If @var{type} is
+@code{nil}, that stands for @code{PRIMARY}.
+
+This function returns @var{data}.
+@end deffn
 
 @defun x-get-selection &optional type data-type
 This function accesses selections set up by Emacs or by other X
@@ -1578,6 +1613,7 @@
 @tindex defined-colors
 This function returns a list of the color names that are defined
 and supported on frame @var{frame} (default, the selected frame).
+If @var{frame} does not support colors, the value is @code{nil}.
 
 @findex x-defined-colors
 This function used to be called @code{x-defined-colors},
@@ -1602,18 +1638,18 @@
 @tindex color-gray-p
 This returns @code{t} if @var{color} is a shade of gray, as defined on
 @var{frame}'s display.  If @var{frame} is omitted or @code{nil}, the
-question applies to the selected frame.  The argument @var{color} must
-be a valid color name.
+question applies to the selected frame.  If @var{color} is not a valid
+color name, this function returns @code{nil}.
 @end defun
 
 @defun color-values color &optional frame
 @tindex color-values
 This function returns a value that describes what @var{color} should
-ideally look like.  If @var{color} is defined, the value is a list of
-three integers, which give the amount of red, the amount of green, and
-the amount of blue.  Each integer ranges in principle from 0 to 65535,
-but in practice no value seems to be above 65280.  This kind
-of three-element list is called an @dfn{rgb value}.
+ideally look like on @var{frame}.  If @var{color} is defined, the
+value is a list of three integers, which give the amount of red, the
+amount of green, and the amount of blue.  Each integer ranges in
+principle from 0 to 65535, but some displays may not use the full
+range.  This kind of three-element list is called an @dfn{rgb value}.
 
 If @var{color} is not defined, the value is @code{nil}.
 
@@ -1658,8 +1694,7 @@
   Several of these functions use or return @dfn{rgb values}.  An rgb
 value is a list of three integers, which give the amount of red, the
 amount of green, and the amount of blue.  Each integer ranges in
-principle from 0 to 65535, but in practice the largest value used is
-65280.
+principle from 0 to 65535, but some displays may not use the full range.  .
 
   These functions accept a display (either a frame or the name of a
 terminal) as an optional argument.  We hope in the future to make Emacs
@@ -1701,13 +1736,14 @@
 @tindex tty-color-approximate
 This function finds the closest color, among the known colors supported
 for @var{display}, to that described by the rgb value @var{rgb}.
+The return value is an element of @code{tty-color-alist}.
 @end defun
 
 @defun tty-color-translate color &optional display
 @tindex tty-color-translate
 This function finds the closest color to @var{color} among the known
-colors supported for @var{display}.  If the name @var{color} is not
-defined, the value is @code{nil}.
+colors supported for @var{display} and returns its index (an integer).
+If the name @var{color} is not defined, the value is @code{nil}.
 
 @var{color} can be an X-style @code{"#@var{xxxyyyzzz}"} specification
 instead of an actual name.  The format
@@ -1747,6 +1783,29 @@
 or the value specified with the @samp{-name} or @samp{-rn} switches.
 @end defvar
 
+To illustrate some of the above, suppose that you have the line:
+
+@example
+xterm.vt100.background: yellow
+@end example
+
+@noindent
+in in your X resources file (usually named @file{~/.Xdefaults} or
+@file{~/.Xresources}).  Then:
+
+@example
+@group
+(let ((x-resource-class "XTerm") (x-resource-name "xterm"))
+  (x-get-resource "vt100.background" "VT100.Background"))
+     @result{} "yellow"
+@end group
+@group
+(let ((x-resource-class "XTerm") (x-resource-name "xterm"))
+  (x-get-resource "background" "VT100" "vt100" "Background"))
+     @result{} "yellow"
+@end group
+@end example
+
   @xref{X Resources,, X Resources, emacs, The GNU Emacs Manual}.
 
 @node Display Feature Testing
@@ -1854,6 +1913,7 @@
 @defun display-pixel-height &optional display
 @tindex display-pixel-height
 This function returns the height of the screen in pixels.
+On a character terminal, it gives the height in characters.
 @end defun
 
 @defun display-mm-height &optional display
@@ -1865,6 +1925,7 @@
 @defun display-pixel-width &optional display
 @tindex display-pixel-width
 This function returns the width of the screen in pixels.
+On a character terminal, it gives the width in characters.
 @end defun
 
 @defun display-mm-width &optional display
@@ -1918,11 +1979,13 @@
 
 @defun x-server-version &optional display
 This function returns the list of version numbers of the X server
-running the display.
+running the display.  The value is a list of three integers: the major
+and minor version numbers, and the vendor-specific release number.
 @end defun
 
 @defun x-server-vendor &optional display
-This function returns the vendor that provided the X server software.
+This function returns the ``vendor'' that provided the X server software
+(as a string).
 @end defun
 
 @ignore
--- a/lispref/minibuf.texi	Sat Jul 24 22:08:12 2004 +0000
+++ b/lispref/minibuf.texi	Tue Jul 27 07:43:21 2004 +0000
@@ -1773,6 +1773,7 @@
 @end defun
 
 @defun minibuffer-window &optional frame
+@anchor{Definition of minibuffer-window}
 This function returns the minibuffer window used for frame @var{frame}.
 If @var{frame} is @code{nil}, that stands for the current frame.  Note
 that the minibuffer window used by a frame need not be part of that
--- a/man/ChangeLog	Sat Jul 24 22:08:12 2004 +0000
+++ b/man/ChangeLog	Tue Jul 27 07:43:21 2004 +0000
@@ -1,3 +1,11 @@
+2004-07-24  Richard M. Stallman  <rms@gnu.org>
+
+	* text.texi (Paragraphs): Update how paragraphs are separated
+	and the default for paragraph-separate.
+
+	* search.texi (Regexp Replace): Further update text for new
+	replacement operators.
+
 2004-07-18  Luc Teirlinck  <teirllm@auburn.edu>
 
 	* emacs-xtra.texi (Subdir switches): Dired does not remember the
--- a/man/search.texi	Sat Jul 24 22:08:12 2004 +0000
+++ b/man/search.texi	Tue Jul 27 07:43:21 2004 +0000
@@ -1038,20 +1038,21 @@
   You can also use Lisp expressions to calculate parts of the
 replacement string.  To do this, write @samp{\,} followed by the
 expression in the replacement string.  Each replacement calculates the
-value of the expression, which ought to be a string, and uses it in
+value of the expression and converts it to text without quoting (if
+it's a string, this means using the string's contents), and uses it in
 the replacement string in place of the expression itself.  If the
 expression is a symbol, one space in the replacement string after the
-symbol name counts as part of the symbol name, so the value replaces
-them both.
+symbol name goes with the symbol name, so the value replaces them
+both.
 
-  Inside such an expression, @samp{\&} and @samp{\@var{n}} used as
-subexpressions refer respectively to the entire match as a string, and
-to a submatch as a string.  @var{n} may exceed 9 here, and the value
-of @samp{\@var{n}} is @code{nil} if subexpression @var{n} did not
-match.  You can also use @samp{\#&} and @samp{\#@var{n}} refer to
-those matches converted to numbers (this is valid when the match or
-submatch has the form of a number).  @samp{\#} stands for the number
-of already-completed replacements.
+  Inside such an expression, you can use some special sequences.
+@samp{\&} and @samp{\@var{n}} refer here, as usual, to the entire
+match as a string, and to a submatch as a string.  @var{n} may be
+multiple digits, and the value of @samp{\@var{n}} is @code{nil} if
+subexpression @var{n} did not match.  You can also use @samp{\#&} and
+@samp{\#@var{n}} to refer to those matches as numbers (this is valid
+when the match or submatch has the form of a numeral).  @samp{\#} here
+too stands for the number of already-completed replacements.
 
   Repeating our example to exchange @samp{x} and @samp{y}, we can thus
 do it also this way:
@@ -1061,9 +1062,9 @@
 \,(if \1 "y" "x") @key{RET}
 @end example
 
-  The @code{format} function (@pxref{Formatting Strings,,,elisp, GNU
-Emacs Lisp Reference Manual}) comes in handy for computing replacement
-strings for @samp{\,}.  For example, to add consecutively numbered
+  For computing replacement strings for @samp{\,}, the @code{format}
+function is often useful (@pxref{Formatting Strings,,,elisp, GNU Emacs
+Lisp Reference Manual}).  For example, to add consecutively numbered
 strings like @samp{ABC00042} to columns 73 @w{to 80} (unless they are
 already occupied), you can use
 
@@ -1074,8 +1075,8 @@
 
   If you want to enter part of the replacement string by hand each
 time, use @samp{\?} in the replacement string.  Each replacement will
-enter a recursive edit, with point at the position where the @samp{\?}
-was.  For example,
+ask you to edit the replacement string in the minibuffer, putting
+point where the @samp{\?} was.  For example,
 
 @example
 M-x replace-regexp @key{RET} \footnote@{ @key{RET}
--- a/man/text.texi	Sat Jul 24 22:08:12 2004 +0000
+++ b/man/text.texi	Tue Jul 27 07:43:21 2004 +0000
@@ -264,10 +264,10 @@
   @kbd{M-@{} moves to the beginning of the current or previous
 paragraph, while @kbd{M-@}} moves to the end of the current or next
 paragraph.  Blank lines and text-formatter command lines separate
-paragraphs and are not considered part of any paragraph.  In Fundamental
-mode, but not in Text mode, an indented line also starts a new
-paragraph.  (If a paragraph is preceded by a blank line, these commands
-treat that blank line as the beginning of the paragraph.)
+paragraphs and are not considered part of any paragraph.  In Indented
+Text mode, but not in Text mode, an indented line also starts a new
+paragraph.  (If a paragraph is preceded by a blank line, these
+commands treat that blank line as the beginning of the paragraph.)
 
   In major modes for programs, paragraphs begin and end only at blank
 lines.  This makes the paragraph commands continue to be useful even
@@ -300,7 +300,7 @@
 contained in it must match only @code{paragraph-start}, not
 @code{paragraph-separate}.  For example, in Fundamental mode,
 @code{paragraph-start} is @w{@code{"[ \t\n\f]"}}, and
-@code{paragraph-separate} is @w{@code{"[ \t\f]*$"}}.
+@code{paragraph-separate} is @w{@code{"\f\\|[ \t]*$"}}.
 
   Normally it is desirable for page boundaries to separate paragraphs.
 The default values of these variables recognize the usual separator for
--- a/src/ChangeLog	Sat Jul 24 22:08:12 2004 +0000
+++ b/src/ChangeLog	Tue Jul 27 07:43:21 2004 +0000
@@ -1,5 +1,40 @@
+2004-07-26  Kim F. Storm  <storm@cua.dk>
+
+	* xdisp.c (move_it_in_display_line_to): If overflow-newline-into-fringe
+	is enabled, return MOVE_LINE_CONTINUED rather than MOVE_POS_MATCH_OR_ZV
+	if target position is at end of display line but char is not a newline.
+
+2004-07-25  Richard M. Stallman  <rms@gnu.org>
+
+	* window.c (coordinates_in_window): Return ON_SCROLL_BAR
+	instead of ON_VERTICAL_BORDER, when on scroll bar.
+	(Fcoordinates_in_window_p): Handle ON_SCROLL_BAR--return nil.
+
+	* dispextern.h (enum window_part): Add ON_SCROLL_BAR.
+
+	* window.c (Fcoordinates_in_window_p):
+	Take account of FRAME_INTERNAL_BORDER_WIDTH.
+
+	* alloc.c (check_cons_list): New function (contents commented out).
+
+2004-07-24  Luc Teirlinck  <teirllm@auburn.edu>
+
+	* xfaces.c (Fcolor_supported_p): Doc fix.
+
+	* frame.c (Fselect_frame, Fset_frame_selected_window)
+	(Fframe_visible_p, Fraise_frame): Doc fixes.
+
 2004-07-24  Richard M. Stallman  <rms@gnu.org>
 
+	* keyboard.h (not_single_kboard_state): Declared.
+
+	* fileio.c (Fwrite_region): Doc fix.
+
+	* window.c (Fwindow_at): Take account of FRAME_INTERNAL_BORDER_WIDTH.
+
+	* abbrev.c (Fexpand_abbrev): Run Qpre_abbrev_expand_hook
+	only when a real abbrev is present.
+
 	* xfns.c (x_icon_verify): New function.
 	(Fx_create_frame): Use it.
 
--- a/src/abbrev.c	Sat Jul 24 22:08:12 2004 +0000
+++ b/src/abbrev.c	Tue Jul 27 07:43:21 2004 +0000
@@ -248,8 +248,6 @@
 
   value = Qnil;
 
-  Frun_hooks (1, &Qpre_abbrev_expand_hook);
-
   wordstart = 0;
   if (!(BUFFERP (Vabbrev_start_location_buffer)
 	&& XBUFFER (Vabbrev_start_location_buffer) == current_buffer))
@@ -326,6 +324,8 @@
   if (INTEGERP (sym) || NILP (SYMBOL_VALUE (sym)))
     return value;
 
+  Frun_hooks (1, &Qpre_abbrev_expand_hook);
+
   if (INTERACTIVE && !EQ (minibuf_window, selected_window))
     {
       /* Add an undo boundary, in case we are doing this for
--- a/src/alloc.c	Sat Jul 24 22:08:12 2004 +0000
+++ b/src/alloc.c	Tue Jul 27 07:43:21 2004 +0000
@@ -2396,6 +2396,17 @@
   return val;
 }
 
+/* Get an error now if there's any junk in the cons free list.  */
+void
+check_cons_list ()
+{
+  struct Lisp_Cons *tail = cons_free_list;
+
+#if 0
+  while (tail)
+    tail = *(struct Lisp_Cons **)&tail->cdr;
+#endif
+}
 
 /* Make a list of 2, 3, 4 or 5 specified objects.  */
 
--- a/src/dispextern.h	Sat Jul 24 22:08:12 2004 +0000
+++ b/src/dispextern.h	Tue Jul 27 07:43:21 2004 +0000
@@ -99,7 +99,8 @@
   ON_LEFT_FRINGE,
   ON_RIGHT_FRINGE,
   ON_LEFT_MARGIN,
-  ON_RIGHT_MARGIN
+  ON_RIGHT_MARGIN,
+  ON_SCROLL_BAR
 };
 
 /* Number of bits allocated to store fringe bitmap numbers.  */
--- a/src/fileio.c	Sat Jul 24 22:08:12 2004 +0000
+++ b/src/fileio.c	Tue Jul 27 07:43:21 2004 +0000
@@ -4868,7 +4868,7 @@
 Optional fourth argument APPEND if non-nil means
   append to existing file contents (if any).  If it is an integer,
   seek to that offset in the file before writing.
-Optional fifth argument VISIT if t means
+Optional fifth argument VISIT, if t or a string, means
   set the last-save-file-modtime of buffer to this file's modtime
   and mark buffer not modified.
 If VISIT is a string, it is a second file name;
--- a/src/keyboard.h	Sat Jul 24 22:08:12 2004 +0000
+++ b/src/keyboard.h	Tue Jul 27 07:43:21 2004 +0000
@@ -307,6 +307,7 @@
 extern void init_kboard P_ ((KBOARD *));
 extern void delete_kboard P_ ((KBOARD *));
 extern void single_kboard_state P_ ((void));
+extern void not_single_kboard_state P_ ((KBOARD *));
 extern void push_frame_kboard P_ ((struct frame *));
 extern void pop_frame_kboard P_ ((void));
 extern void record_asynch_buffer_change P_ ((void));
--- a/src/window.c	Sat Jul 24 22:08:12 2004 +0000
+++ b/src/window.c	Tue Jul 27 07:43:21 2004 +0000
@@ -581,6 +581,8 @@
    if it is on the window's modeline, return ON_MODE_LINE;
    if it is on the border between the window and its right sibling,
       return ON_VERTICAL_BORDER.
+   if it is on a scroll bar,
+      return ON_SCROLL_BAR.
    if it is on the window's top line, return ON_HEADER_LINE;
    if it is in left or right fringe of the window,
       return ON_LEFT_FRINGE or ON_RIGHT_FRINGE, and convert *X and *Y
@@ -675,7 +677,7 @@
 
   /* Outside any interesting column?  */
   if (*x < left_x || *x > right_x)
-    return ON_VERTICAL_BORDER;
+    return ON_SCROLL_BAR;
 
   lmargin_width = window_box_width (w, LEFT_MARGIN_AREA);
   rmargin_width = window_box_width (w, RIGHT_MARGIN_AREA);
@@ -785,8 +787,8 @@
   ly = Fcdr (coordinates);
   CHECK_NUMBER_OR_FLOAT (lx);
   CHECK_NUMBER_OR_FLOAT (ly);
-  x = FRAME_PIXEL_X_FROM_CANON_X (f, lx);
-  y = FRAME_PIXEL_Y_FROM_CANON_Y (f, ly);
+  x = FRAME_PIXEL_X_FROM_CANON_X (f, lx) + FRAME_INTERNAL_BORDER_WIDTH (f);
+  y = FRAME_PIXEL_Y_FROM_CANON_Y (f, ly) + FRAME_INTERNAL_BORDER_WIDTH (f);
 
   switch (coordinates_in_window (w, &x, &y))
     {
@@ -820,6 +822,10 @@
     case ON_RIGHT_MARGIN:
       return Qright_margin;
 
+    case ON_SCROLL_BAR:
+      /* Historically we are supposed to return nil in this case.  */
+      return Qnil;
+
     default:
       abort ();
     }
@@ -940,8 +946,10 @@
   CHECK_NUMBER_OR_FLOAT (y);
 
   return window_from_coordinates (f,
-				  FRAME_PIXEL_X_FROM_CANON_X (f, x),
-				  FRAME_PIXEL_Y_FROM_CANON_Y (f, y),
+				  (FRAME_PIXEL_X_FROM_CANON_X (f, x)
+				   + FRAME_INTERNAL_BORDER_WIDTH (f)),
+				  (FRAME_PIXEL_Y_FROM_CANON_Y (f, y)
+				   + FRAME_INTERNAL_BORDER_WIDTH (f)),
 				  0, 0, 0, 0);
 }
 
--- a/src/xdisp.c	Sat Jul 24 22:08:12 2004 +0000
+++ b/src/xdisp.c	Tue Jul 27 07:43:21 2004 +0000
@@ -5734,12 +5734,19 @@
 #ifdef HAVE_WINDOW_SYSTEM
 			  if (IT_OVERFLOW_NEWLINE_INTO_FRINGE (it))
 			    {
-			      if (!get_next_display_element (it)
-				  || BUFFER_POS_REACHED_P ())
+			      if (!get_next_display_element (it))
 				{
 				  result = MOVE_POS_MATCH_OR_ZV;
 				  break;
 				}
+			      if (BUFFER_POS_REACHED_P ())
+				{
+				  if (ITERATOR_AT_END_OF_LINE_P (it))
+				    result = MOVE_POS_MATCH_OR_ZV;
+				  else
+				    result = MOVE_LINE_CONTINUED;
+				  break;
+				}
 			      if (ITERATOR_AT_END_OF_LINE_P (it))
 				{
 				  result = MOVE_NEWLINE_OR_CR;
--- a/src/xfaces.c	Sat Jul 24 22:08:12 2004 +0000
+++ b/src/xfaces.c	Tue Jul 27 07:43:21 2004 +0000
@@ -1547,6 +1547,7 @@
        Scolor_supported_p, 1, 3, 0,
        doc: /* Return non-nil if COLOR can be displayed on FRAME.
 BACKGROUND-P non-nil means COLOR is used as a background.
+Otherwise, this function tells whether it can be used as a foreground.
 If FRAME is nil or omitted, use the selected frame.
 COLOR must be a valid color name.  */)
      (color, frame, background_p)