changeset 863:42375619fa45

[xemacs-hg @ 2002-06-04 06:03:59 by andyp] merge 21.4 windows changes, minimally tested
author andyp
date Tue, 04 Jun 2002 06:05:53 +0000
parents 278c743f1578
children 5b3cf2203477
files etc/sample.init.el lisp/ChangeLog lisp/code-files.el lisp/dialog-items.el lisp/dialog.el lisp/files.el lisp/gutter-items.el lisp/help.el lisp/minibuf.el lisp/mule/european.el lisp/obsolete.el lisp/printer.el lisp/startup.el man/ChangeLog man/custom.texi man/external-widget.texi netinstall/ChangeLog nt/ChangeLog src/ChangeLog src/console.h src/device-gtk.c src/emacs.c src/event-Xt.c src/frame.c src/general-slots.h src/glyphs-msw.c src/glyphs-widget.c src/glyphs-x.c src/glyphs.h src/process.c src/process.h src/redisplay-output.c src/s/linux.h src/select-x.c src/symsinit.h src/sysdep.c src/sysdll.c tests/ChangeLog tests/automated/test-harness.el tests/gutter-test.el
diffstat 40 files changed, 2471 insertions(+), 747 deletions(-) [+]
line wrap: on
line diff
--- a/etc/sample.init.el	Mon Jun 03 12:24:14 2002 +0000
+++ b/etc/sample.init.el	Tue Jun 04 06:05:53 2002 +0000
@@ -24,16 +24,20 @@
 ;; Boston, MA 02111-1307, USA.
 
 ;; #### to do:
-;; -- #### figure out how init.el and custom.el interact and put
-;;         documentation about it here. (perhaps it already exists
-;;         elsewhere?)
+;; -- scan for #### markers and fix the problems noted there.
+;; -- #### maybe the setqs in this file should be changed to defvars
+;;    to avoid tromping on customizations when custom.el is loaded
+;;    early (dv and sjt at least favor making this the default)
+;; -- #### update documentation in (lispref)Starting Up XEmacs, in
+;;    (xemacs)Entering Emacs, and in (custom), then point to them
+;;    instead of going into detail here.
 
-;;; This is a sample init.el file.  It can be used without
-;;; modification as your init.el or .emacs.  In older versions of
-;;; XEmacs, this file was called .emacs and placed in your home
-;;; directory. (Under MS Windows, that directory is controlled by the
-;;; HOME environment variable and defaults to C:\.  You can find out
-;;; where XEmacs thinks your home directory is using
+;;; This is a sample init file.  It can be used without modification
+;;; as your init.el or .emacs.  In older versions of XEmacs, this file
+;;; was called .emacs and placed in your home directory. (Under MS
+;;; Windows, that directory is controlled by the HOME environment
+;;; variable and defaults to C:\.  You can find out where XEmacs
+;;; thinks your home directory is using
 ;;;
 ;;;   ESC : (expand-file-name "~")
 ;;;
@@ -52,7 +56,9 @@
 ;;; The language that this file (and most other XEmacs init files) is
 ;;; written in is called "XEmacs Lisp" or more commonly "Elisp".
 
-;;; There are many sources of further information:
+;;; Brief descriptions of how the init process works and how to
+;;; accomplish many useful customizations are given below in this
+;;; file.  There are many sources of further information:
 
 ;;; -- the XEmacs User's Manual (Access using the online Info browser:
 ;;;       Use `Help->Info (Online Docs)->XEmacs User's Manual' (if
@@ -121,6 +127,130 @@
 
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;                       Theory of Operation                        ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;;; XEmacs allows you to make persistent changes to editor behavior by
+;;; saving code in files which are by default loaded at startup.
+
+;; These files are just Lisp libraries with names built in to XEmacs.
+;; There are files for the use of the user (the init file and the
+;; custom file), for the site administrator (default.el and
+;; site-start.el), and for the XEmacs maintainers (auto-autoloads
+;; files).  See the Lispref for user and site files (node Starting Up
+;; XEmacs, currently inaccurate (it doesn't describe the custom
+;; file)).  Interactions among the files are complex; see
+;; lisp/startup.el for details.
+
+;; Briefly, after very basic initializations including processing a
+;; special command line options (including GUI toolkit options),
+;; setting up the terminal, and setting up `load-path', it executes
+;; customization code as follows:
+
+;; 1. It runs the normal hook `before-init-hook'.
+;; 2. It loads the library `site-start' (by default `site-start.el').
+;; 3. It loads the init file (by default `~/.xemacs/init.el').
+;; 4. It loads the custom file (by default `~/.xemacs/custom.el').
+;; 5. It loads the library `default' (by default `default.el').
+;; 6. It runs the normal hook `after-init-hook'.
+
+;; After this the *scratch* buffer is set up and the remaining command
+;; line arguments (actions and file names) are processed.
+
+;; N.B. Switching the order of steps 3 and 4 is under discussion and
+;; favored by several core developers.
+
+;; Step 2 is inhibited by the -no-site-file command line switch.
+;; Steps 3 and 4 are inhibited (as a unit) by the -no-init-file
+;; command line switch (-q is a convenient synonym).  Step 5 is
+;; inhibited by -no-init-file or a non-nil value of
+;; `inhibit-default-init' (set it in the init file).  From now on the
+;; hooks and the site initialization files will be ignored.
+
+;; The custom file and the init file contain customizations managed by
+;; XEmacs itself via the Custom subsystem and manual customizations,
+;; respectively.  Originally both were placed in the same file,
+;; usually ~/.emacs, but occasionally XEmacs would trash user settings
+;; when automatically changing options, and more frequently users
+;; would trash the automatically generated code.  So these functions
+;; have been reallocated to separate files, usually named custom.el
+;; and init.el, respectively.
+
+;; The Custom system is accessed most conveniently from the
+;; Options->Advanced (Customize) menu (also, the Options->Fonts and
+;; Options->Sizes menus are implicitly managed by Custom, and
+;; Options->Edit Faces explicitly invokes Custom).  You can also use
+;; the suite of customize commands directly (cf C-h a customize RET).
+;; Currently, Custom possesses specialized facilities for setting
+;; ordinary variables of many types, and for customizing faces.  As a
+;; general rule, variable and face initialization should be done using
+;; Custom, and other initializations should be done in the init file.
+
+;; A possible exception is a subsystem with its own complex init file,
+;; eg, Gnus and .gnus.  In these cases it is often preferable to keep
+;; even simple variable initializations together, and you may wish to
+;; maintain these configurations by hand.
+
+;; You should avoid editing the custom file by hand.  The syntax used
+;; is complex but concise, and it is easy to silently break the whole
+;; file with a single error that happens to result in a valid Lisp
+;; form.  On the other hand, the init file is just a Lisp library that
+;; is loaded before starting the read-eval-redisplay loop.
+
+;; The interactions between the custom file and other init files are
+;; governed by a simple idea:
+
+;; Custom to User:  ALL VARIABLES YOURS OURS NOW ARE.
+
+;; To be precise, Custom is pretty good about noticing and respecting
+;; existing settings in interactive use.  However, it is weak in
+;; understanding advanced use of specifier variables (these are used
+;; for customizations which depend on display characteristics and
+;; configuration in complex ways), and can be quite brutal at
+;; initialization.
+
+;; Normal practice for Custom at initialization is to (1) reset all
+;; customized faces before applying customizations and (2) force all
+;; variables to the values specified in custom.el.  For this reason,
+;; and because it is generally the case that the init file can
+;; usefully depend on customized variables, but Custom pays no
+;; attention to behavior of the init file, it is probably a good idea
+;; to force custom.el to be loaded before the init file.  (As
+;; mentioned, this will probably become the default in future versions
+;; of XEmacs.)
+
+;; To enable early loading of custom.el, uncomment the following line:
+;(setq Init-inhibit-custom-file-p (not (assoc custom-file load-history)))
+
+;; Code to implement early loading where late loading is the default.
+;; A crucial snippet of code must be the last thing in this file.
+
+;; defvars only initialize uninitialized variables; if the setq above
+;; is active, the variable below is defined but the value will not be
+;; altered.
+(defvar Init-inhibit-custom-file-p nil
+  "Internal user init flag.  Don't use this yourself.
+
+Non-nil if we need to inhibit XEmacs from loading custom.el after init.el.")
+
+(when Init-inhibit-custom-file-p
+  ;; This is the default custom-file.
+  (let ((file (expand-file-name "~/.xemacs/custom.el")))
+    (add-one-shot-hook 'after-init-hook
+		       `(lambda () (setq custom-file ,file)))
+    (cond ((file-readable-p file)
+	   (load file))
+	  ((file-exists-p file)
+	   (warn "Existing custom file \"%s\" is not readable!" file)))
+    (cond ((not (file-exists-p file))
+	   (display-warning ' resource
+	     (format "Custom file \"%s\" not found." file)
+	     'info))
+	  ((not (file-writable-p file))
+	   (warn "Existing custom file \"%s\" is not writable!" file)))))
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;                      Basic Customization                         ;;
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
@@ -1272,7 +1402,7 @@
 
 ;;; ********************
 ;;; resize-minibuffer-mode makes the minibuffer automatically
-;;; resize as necessary when it's too big to hold its contents.
+;;; resize as necessary when it's too small to hold its contents.
 
 (when (fboundp 'resize-minibuffer-mode)
   (resize-minibuffer-mode)
@@ -1302,3 +1432,11 @@
 ;      ;; of the session, specify the number of lines here.
 ;      w3-telnet-header-length 4
 ;      )
+
+;;; Inhibit loading of custom-file
+
+;; make-temp-name returns a name which does not refer to an existing file,
+;; and thus the named file is unreadable.
+(when Init-inhibit-custom-file-p
+  (setq custom-file (make-temp-name "/tmp/non-existent-")))
+
--- a/lisp/ChangeLog	Mon Jun 03 12:24:14 2002 +0000
+++ b/lisp/ChangeLog	Tue Jun 04 06:05:53 2002 +0000
@@ -1,3 +1,156 @@
+2002-06-03  Andy Piper  <andy@xemacs.org>
+
+	* dialog-items.el (make-search-dialog): align various subcontrols
+	in visually pleasing ways, allow frame to autosize to the dialog
+	size.
+	* dialog.el (make-dialog-box): add a border inside the frame. Add
+	:autosize property, if t then reset the frame size appropriately
+	before the frame is mapped.
+	* gutter-items.el (set-progress-feedback-instantiator): align
+	various subcontrols.
+	* gutter-items.el (set-progress-abort-instantiator): ditto.
+
+2002-05-30  Andy Piper  <andy@xemacs.org>
+
+	* files.el (revert-buffer-internal): don't visit
+	revert-buffer. Kill buffer when not used. Suggested by Mike
+	Alexander <mta@arbortext.com>
+
+2002-05-08  Andy Piper  <andy@xemacs.org>
+
+	* files.el (revert-buffer): observe noconfirm behavior.
+
+2002-04-09  Andy Piper  <andy@xemacs.org>
+
+	* files.el (revert-buffer): use revert-buffer-internal if it looks
+	like doing so will not result in any user-visible changes.
+	(revert-buffer-internal): new function. Do the actual process of
+	reversion and then see whether the result is any different to what
+	we have already. If it is not then do nothing.
+
+2002-02-04  Andy Piper  <andy@xemacs.org>
+
+	* files.el (convert-standard-filename): Fix for short filename
+	Peter Arius <pas@methodpark.de>
+
+2001-12-16  Andy Piper  <andy@xemacs.org>
+
+	* package-get.el (package-get-update-all): Make sure installed.db
+	gets updated after updating packages.
+
+2001-12-11  Andy Piper  <andy@xemacs.org>
+
+	* menubar.el (get-popup-menu-response): re-order so that it works
+	on more sane/facist window systems.
+
+2001-12-03  Andy Piper  <andy@xemacs.org>
+
+	* faces.el (frob-face-property): don't infloop in face frobbing
+	from Jan Vroonhof <jan@xemacs.org>.
+
+2001-11-30  Andy Piper  <andy@xemacs.org>
+
+	* printer.el (generic-print-region): fix for non-MS systems from
+	Mike Fabian.
+
+2001-11-30  Jan Vroonhof  <jan@xemacs.org>
+
+	* font.el (font-window-system-mappings): Add mapping for Gtk
+	(assume identical to X)	
+
+2001-11-30  Jan Vroonhof  <jan@xemacs.org>
+
+	* faces.el (frob-face-property): Follow face fall-back hierarchy
+	properly for face properties without an instance. Only do manual
+	copy form 'default in last resort. This handles in particular
+	the case where 'default itself has only a fall-back (which is
+	the case by default on windows).
+
+2001-11-24  Andy Piper  <andy@xemacs.org>
+
+	* printer.el (generic-print-region): set default-frame-plist to
+	nil while creating the printer frame so that sizes reflect the
+	printed page.
+
+	* faces.el (face-complain-about-font): Don't complain on printers.
+
+2002-04-25  Steve Youngs  <youngs@xemacs.org>
+
+	* mule/mule-charset.el (string-to-char-list): New.  This used to
+	be in 'mule-misc.el' but that file has been removed.
+
+2002-04-14  Steve Youngs  <youngs@xemacs.org>
+
+	* obsolete.el (find-non-ascii-charset-region): A couple of
+	packages use this.
+	(find-non-ascii-charset-string): Ditto.
+
+2002-04-14  Ben Wing  <ben@xemacs.org>
+
+	* abbrev.el:
+	* abbrev.el (abbrev-mode):
+	* abbrev.el (only-global-abbrevs):
+	* abbrev.el (defining-abbrev-turns-on-abbrev-mode): New.
+	* abbrev.el (define-abbrev-table):
+	* abbrev.el (global-abbrev-mode): New.
+	* abbrev.el (add-mode-abbrev):
+	* abbrev.el (add-global-abbrev):
+	* abbrev.el (inverse-add-mode-abbrev):
+	* abbrev.el (inverse-add-global-abbrev):
+	Add `global-abbrev-mode', which turns on or off abbrev-mode in all
+	buffers.  Added `defining-abbrev-turns-on-abbrev-mode' -- if
+	non-nil, defining an abbrev through an interactive function will
+	automatically turn on abbrev-mode, either globally or locally
+	depending on the command.  This is the "what you'd expect"
+	behavior.
+	* indent.el:
+	* indent.el (indent-balanced-expression-function): New.
+	* indent.el (indent-balanced-expression): New.
+	* indent.el (indent-region-or-balanced-expression): New.
+	general function for indenting a balanced expression in a
+	mode-correct way.  Works similar to indent-region in that a mode
+	can specify a specific command to do the whole operation; if not,
+	figure out the region using forward-sexp and indent each line
+	using indent-according-to-mode.
+	* keydefs.el:
+	* keydefs.el (global-map): Removed.
+	Modify M-C-backslash to do indent-region-or-balanced-expression.
+	Make S-Tab just insert a TAB char, like it's meant to do.
+	* make-docfile.el:
+	* make-docfile.el (docfile-out-of-date):
+	Now that we're using the call-process-in-lisp, we need to load
+	an extra file win32-native.el because we're running a bare temacs.
+	* menubar-items.el:
+	* menubar-items.el (default-menubar):
+	Totally redo the Cmds menu so that most used commands appear
+	directly on the menu and less used commands appear in submenus.
+	The old way may have been very pretty, but rather impractical.
+	* process.el (call-process-internal):
+	Under Windows, don't ever use old-call-process-internal, even
+	in batch mode.  We can do processes in batch mode.
+	* subr.el:
+	* subr.el (truncate-string-to-width):
+	* subr.el (truncate-string-with-continuation-dots): New.
+	* subr.el (plist-to-alist):
+	Someone recoded truncate-string-to-width, saying "the FSF version
+	is too complicated and does lots of hard-to-understand stuff" but
+	the resulting recoded version was *totally* wrong!  it
+	misunderstood the basic point of this function, which is work in
+	*columns* not chars.  i dumped ours and copied the version from
+	FSF 21.1.  Also added truncate-string-with-continuation-dots,
+	since this idiom is used often.  
+
+2002-04-07  William M. Perry  <wmperry@gnu.org>
+
+	* startup.el (command-line): Don't call init-menubar-at-startup
+	unless we were built with menubar support.
+
+2002-03-19  Daiki Ueno  <daiki@xemacs.org>
+
+	* mule/japanese.el: Don't quote function expressions listed as
+	`native-coding-system'.
+	* mule/chinese.el: Likewise.
+
 2002-06-03  Ben Wing  <ben@xemacs.org> and
             Michael Sperber [Mr. Preprocessor]  <sperber@informatik.uni-tuebingen.de>
 
@@ -295,139 +448,6 @@
 
 	* mule/mule-charset.el: Revert my last patch. 'string-to-char-list'.
 
-2002-04-09  Andy Piper  <andy@xemacs.org>
-
-	* files.el (revert-buffer): use revert-buffer-internal if it looks
-	like doing so will not result in any user-visible changes.
-	(revert-buffer-internal): new function. Do the actual process of
-	reversion and then see whether the result is any different to what
-	we have already. If it is not then do nothing.
-
-2002-02-04  Andy Piper  <andy@xemacs.org>
-
-	* files.el (convert-standard-filename): Fix for short filename
-	Peter Arius <pas@methodpark.de>
-
-2001-12-16  Andy Piper  <andy@xemacs.org>
-
-	* package-get.el (package-get-update-all): Make sure installed.db
-	gets updated after updating packages.
-
-2001-12-11  Andy Piper  <andy@xemacs.org>
-
-	* menubar.el (get-popup-menu-response): re-order so that it works
-	on more sane/facist window systems.
-
-2001-12-03  Andy Piper  <andy@xemacs.org>
-
-	* faces.el (frob-face-property): don't infloop in face frobbing
-	from Jan Vroonhof <jan@xemacs.org>.
-
-2001-11-30  Andy Piper  <andy@xemacs.org>
-
-	* printer.el (generic-print-region): fix for non-MS systems from
-	Mike Fabian.
-
-2001-11-30  Jan Vroonhof  <jan@xemacs.org>
-
-	* font.el (font-window-system-mappings): Add mapping for Gtk
-	(assume identical to X)	
-
-2001-11-30  Jan Vroonhof  <jan@xemacs.org>
-
-	* faces.el (frob-face-property): Follow face fall-back hierarchy
-	properly for face properties without an instance. Only do manual
-	copy form 'default in last resort. This handles in particular
-	the case where 'default itself has only a fall-back (which is
-	the case by default on windows).
-
-2001-11-24  Andy Piper  <andy@xemacs.org>
-
-	* printer.el (generic-print-region): set default-frame-plist to
-	nil while creating the printer frame so that sizes reflect the
-	printed page.
-
-	* faces.el (face-complain-about-font): Don't complain on printers.
-
-2002-04-25  Steve Youngs  <youngs@xemacs.org>
-
-	* mule/mule-charset.el (string-to-char-list): New.  This used to
-	be in 'mule-misc.el' but that file has been removed.
-
-2002-04-14  Steve Youngs  <youngs@xemacs.org>
-
-	* obsolete.el (find-non-ascii-charset-region): A couple of
-	packages use this.
-	(find-non-ascii-charset-string): Ditto.
-
-2002-04-14  Ben Wing  <ben@xemacs.org>
-
-	* abbrev.el:
-	* abbrev.el (abbrev-mode):
-	* abbrev.el (only-global-abbrevs):
-	* abbrev.el (defining-abbrev-turns-on-abbrev-mode): New.
-	* abbrev.el (define-abbrev-table):
-	* abbrev.el (global-abbrev-mode): New.
-	* abbrev.el (add-mode-abbrev):
-	* abbrev.el (add-global-abbrev):
-	* abbrev.el (inverse-add-mode-abbrev):
-	* abbrev.el (inverse-add-global-abbrev):
-	Add `global-abbrev-mode', which turns on or off abbrev-mode in all
-	buffers.  Added `defining-abbrev-turns-on-abbrev-mode' -- if
-	non-nil, defining an abbrev through an interactive function will
-	automatically turn on abbrev-mode, either globally or locally
-	depending on the command.  This is the "what you'd expect"
-	behavior.
-	* indent.el:
-	* indent.el (indent-balanced-expression-function): New.
-	* indent.el (indent-balanced-expression): New.
-	* indent.el (indent-region-or-balanced-expression): New.
-	general function for indenting a balanced expression in a
-	mode-correct way.  Works similar to indent-region in that a mode
-	can specify a specific command to do the whole operation; if not,
-	figure out the region using forward-sexp and indent each line
-	using indent-according-to-mode.
-	* keydefs.el:
-	* keydefs.el (global-map): Removed.
-	Modify M-C-backslash to do indent-region-or-balanced-expression.
-	Make S-Tab just insert a TAB char, like it's meant to do.
-	* make-docfile.el:
-	* make-docfile.el (docfile-out-of-date):
-	Now that we're using the call-process-in-lisp, we need to load
-	an extra file win32-native.el because we're running a bare temacs.
-	* menubar-items.el:
-	* menubar-items.el (default-menubar):
-	Totally redo the Cmds menu so that most used commands appear
-	directly on the menu and less used commands appear in submenus.
-	The old way may have been very pretty, but rather impractical.
-	* process.el (call-process-internal):
-	Under Windows, don't ever use old-call-process-internal, even
-	in batch mode.  We can do processes in batch mode.
-	* subr.el:
-	* subr.el (truncate-string-to-width):
-	* subr.el (truncate-string-with-continuation-dots): New.
-	* subr.el (plist-to-alist):
-	Someone recoded truncate-string-to-width, saying "the FSF version
-	is too complicated and does lots of hard-to-understand stuff" but
-	the resulting recoded version was *totally* wrong!  it
-	misunderstood the basic point of this function, which is work in
-	*columns* not chars.  i dumped ours and copied the version from
-	FSF 21.1.  Also added truncate-string-with-continuation-dots,
-	since this idiom is used often.  
-
-2002-04-07  William M. Perry  <wmperry@gnu.org>
-
-	* startup.el (command-line): Don't call init-menubar-at-startup
-	unless we were built with menubar support.
-
-2002-03-19  Daiki Ueno  <daiki@xemacs.org>
-
-	* mule/japanese.el: Don't quote function expressions listed as
-	`native-coding-system'.
-	* mule/chinese.el: Likewise.
-
-2002-04-05  Stephen J. Turnbull  <stephen@xemacs.org>
-
 	* XEmacs 21.5.6 "bok choi" is released.
 
 2002-03-31  Ben Wing  <ben@xemacs.org>
@@ -1155,6 +1175,101 @@
 	nil while creating the printer frame so that sizes reflect the
 	printed page.
 
+2002-05-09  Stephen J. Turnbull  <stephen@xemacs.org>
+
+	This patch is based on Jerry James's patch and analysis.
+
+	* select.el (get-clipboard):
+	(get-selection):
+	Update docstrings.
+	(get-clipboard-foreign):
+	(get-selection-foreign):
+	New function for use as `interprogram-paste-function's.
+
+	* simple.el (interprogram-paste-function): Change default to
+	`get-clipboard-foreign'; improve docstring.
+	(interprogram-cut-function): Improve dosctring.
+
+2002-03-18  Adrian Aichner  <adrian@xemacs.org>
+
+	* cus-edit.el (customize-save-variable): Fix typo in prompt.
+
+2002-03-26  John Paul Wallington  <jpw@xemacs.org>
+
+	* obsolete.el (assq-delete-all): New compatibility alias for 
+	remassq.
+
+2002-01-09  Simon Josefsson  <jas@extundo.com>
+
+	* files.el (auto-mode-alist): Support Sieve (*.siv, *.sieve).
+
+2002-01-04  Adrian Aichner  <adrian@xemacs.org>
+
+	* info.el (Info-auto-generate-directory): Default
+	Info-auto-generate-directory to 'if-outdated.
+
+2002-03-28  Stephen J. Turnbull  <stephen@xemacs.org>
+
+	* startup.el (normal-top-level): Prevent migration code from
+	trashing .emacs on an error in loading the init files.
+
+2002-03-14  Ville Skyttä  <ville.skytta@xemacs.org>
+
+	* files.el (auto-mode-alist): GNUmakefile is a Makefile,
+	"system default" Xdefaults and friends get xrdb-mode.
+
+2002-03-05  Mats Lidell  <matsl@contactor.se>
+ 
+ 	* help-nomule.el (tutorial-supported-languages): Added Swedish
+ 	tutorial. Sorted languages.
+
+2002-02-11  Mike Sperber <mike@xemacs.org>
+
+	* info.el (Info-maybe-update-dir): Regenerate dir if we're
+	regenerating outdated dir files and dir is non-existent.
+
+2002-01-27  Stephen J. Turnbull  <stephen@xemacs.org>
+
+	* code-files.el (convert-mbox-coding-system): Improve comment.
+	(write-region): Improve docstring.  Reformat to 80 columns.  Add
+	coding-system argument to `write-region-pre-hook' call.
+	(write-region-pre-hook): Fix docstring to mention lockname argument.
+
+2002-01-18  Stephen J. Turnbull  <stephen@xemacs.org>
+
+	* minibuf.el (completing-read): Remove redundant wrong arg list.
+
+	* help.el (with-displaying-help-buffer): Put usage advice in docstring.
+
+2001-12-27  John Paul Wallington  <jpw@shootybangbang.com>
+
+	* obsolete.el (interactive-form): new compatibility alias for 
+	function-interactive.
+
+2001-11-29  Adrian Aichner  <adrian@xemacs.org>
+
+	* menubar-items.el (Menubar-items-truncate-list): Removed.
+	* menubar-items.el (Menubar-items-truncate-history): New.
+	* menubar-items.el (default-menubar): Use
+	Menubar-items-truncate-history.
+
+2002-02-03  Adrian Aichner  <adrian@xemacs.org>
+
+	* printer.el (generic-print-region): Pass correct arguments to
+	lpr-region.  Thanks to Nevin Kapur <nevin@jhu.edu> and Björn
+	Torkelsson <torkel@acc.umu.se>.
+
+2002-01-09  John Paul Wallington  <jpw@shootybangbang.com>
+
+	* help.el (describe-mode): synched with FSF 19.34; handle nil
+	minor mode indicators.
+
+2001-12-03  Christoph Wedler  <Christoph.Wedler@sap.com>
+
+	* minibuf.el (completing-read): Update docstring.
+
+2001-12-17  Stephen J. Turnbull  <stephen@xemacs.org>
+
 	* faces.el (face-complain-about-font): Don't complain on printers.
 
 2001-11-21  Stephen J. Turnbull  <stephen@xemacs.org>
--- a/lisp/code-files.el	Mon Jun 03 12:24:14 2002 +0000
+++ b/lisp/code-files.el	Tue Jun 04 06:05:53 2002 +0000
@@ -454,18 +454,18 @@
   "A special hook to decide the coding system used for writing out a file.
 
 Before writing a file, `write-region' calls the functions on this hook with
-arguments START, END, FILENAME, APPEND, VISIT, LOCKNAME, and CODING-SYSTEM,
+arguments START, END, FILENAME, APPEND, VISIT, LOCKNAME and CODING-SYSTEM,
 the same as the corresponding arguments in the call to `write-region'.
 
 The return value of each function should be one of
 
 -- nil
 -- A coding system or a symbol denoting it, indicating the coding system
-   to be used for reading the file
+   to be used for writing the file
 -- A list of two elements (absolute pathname and length of data written),
-   which is used as the return value to `write-region'.  In this
-   case, `write-region' assumes that the function has written
-   the file, and returns.
+   which is used as the return value to `write-region'.  In this case,
+   `write-region' assumes that the function has written the file and
+   returns.
 
 If any function returns non-nil, the remaining functions are not called.")
 
@@ -476,11 +476,12 @@
 FILENAME, APPEND, VISIT, LOCKNAME, and CODING-SYSTEM, the same as the
 corresponding arguments in the call to `write-region'.")
 
-(defun write-region (start end filename &optional append visit lockname coding-system)
+(defun write-region (start end filename
+		     &optional append visit lockname coding-system)
   "Write current region into specified file.
 By default the file's existing contents are replaced by the specified region.
-Call interactively, prompts for the filename.  With a prefix arg, also prompts
-for a coding system.
+Called interactively, prompts for a file name.  With a prefix arg, prompts
+for a coding system as well.
 
 When called from a program, takes three required arguments:
 START, END and FILENAME.  START and END are buffer positions.
--- a/lisp/dialog-items.el	Mon Jun 03 12:24:14 2002 +0000
+++ b/lisp/dialog-items.el	Tue Jun 04 06:05:53 2002 +0000
@@ -60,17 +60,18 @@
      'general
      :parent parent
      :title "Search"
+     :autosize t
      :spec
      (setq search-dialog
 	   (make-glyph
 	    `[layout 
-	      :orientation horizontal :justify left
-	      ;; neither the following height/width nor the identical one
-	      ;; below should be necessary! (see below)
-	      :height 11 :width 40
+	      :orientation horizontal 
+	      :vertically-justify top 
+	      :horizontally-justify center 
 	      :border [string :data "Search"]
 	      :items 
-	      ([layout :orientation vertical :justify left
+	      ([layout :orientation vertical 
+		       :justify top	; implies left also
 		       :items 
 		       ([string :data "Search for:"]
 			[button :descriptor "Match Case"
@@ -92,10 +93,12 @@
 				:selected (not search-dialog-direction)
 				:callback (setq search-dialog-direction nil)]
 			)]
-	       [layout :orientation vertical :justify left
-		       :items 
+	       [layout :orientation vertical
+		       :vertically-justify top
+		       :horizontally-justify right
+		       :items
 		       ([edit-field :width 15 :descriptor "" :active t
-				    :face default :initial-focus t]
+				    :initial-focus t]
 			[button :width 10 :descriptor "Find Next"
 				:callback-ex
 				(lambda (image-instance event)
@@ -108,8 +111,9 @@
 				  (isearch-dehighlight)
 				  (delete-frame 
 				   (event-channel event)))])])]))
-     ;; neither this height/width nor the identical one above should
-     ;; be necessary! (in fact, if you omit the one above, the layout
-     ;; sizes itself correctly; but the frame as a whole doesn't use
-     ;; the layout's size, as it should.)
-     :properties '(height 11 width 40))))
+     ;; These are no longer strictly necessary, but not setting a size
+     ;; at all yields a much more noticeable resize since the initial
+     ;; frame is so big.
+     :properties `(height ,(widget-logical-to-character-height 6)
+			  width ,(widget-logical-to-character-width 39))
+     )))
--- a/lisp/dialog.el	Mon Jun 03 12:24:14 2002 +0000
+++ b/lisp/dialog.el	Tue Jun 04 06:05:53 2002 +0000
@@ -308,6 +308,8 @@
   The frame is made a child of this frame (defaults to the selected frame).
 :properties
   Additional properties of the frame, as well as `dialog-frame-plist'.
+:autosize
+  If t the frame is sized to exactly fit the widgets given by :spec.
 
 ---------------------------------------------------------------------------
 
@@ -681,6 +683,7 @@
 	     (:parent (selected-frame))
 	     :modal
 	     :properties
+	     :autosize
 	     :spec)
 	    ()
 	  (flet ((create-dialog-box-frame ()
@@ -728,6 +731,7 @@
 				      vertical-scrollbar-visible-p nil
 				      horizontal-scrollbar-visible-p nil
 				      unsplittable t
+				      internal-border-width 8
 				      left ,(+ fleft (- (/ fwidth 2)
 							(/ (* dfwidth
 							      fontw)
@@ -738,6 +742,19 @@
 							 2)))))))
 		     (set-face-foreground 'modeline [default foreground] frame)
 		     (set-face-background 'modeline [default background] frame)
+		     ;; resize before mapping
+		     (when cl-autosize
+		       (set-frame-pixel-size 
+			frame
+			(image-instance-width 
+			 (glyph-image-instance cl-spec 
+					       (frame-selected-window frame)))
+			(image-instance-height 
+			 (glyph-image-instance cl-spec 
+					       (frame-selected-window frame)))))
+		     ;; somehow, even though the resizing is supposed
+		     ;; to be while the frame is not visible, a
+		     ;; visible resize is perceptible
 		     (unless unmapped (make-frame-visible frame))
 		     (let ((newbuf (generate-new-buffer " *dialog box*")))
 		       (set-buffer-dedicated-frame newbuf frame)
--- a/lisp/files.el	Mon Jun 03 12:24:14 2002 +0000
+++ b/lisp/files.el	Tue Jun 04 06:05:53 2002 +0000
@@ -2989,7 +2989,7 @@
 	    (if (not (file-exists-p file-name))
 		(error "File %s no longer exists!" file-name))
 	    (widen)
-	    (insert-file-contents file-name t nil nil t)
+	    (insert-file-contents file-name nil nil nil t)
 	    (setq bmin (point-min)
 		  bmax (point-max))))))
     (if (not (and (eq bmin (point-min))
@@ -2997,7 +2997,7 @@
 		  (eq (compare-buffer-substrings 
 		       newbuf bmin bmax (current-buffer) bmin bmax) 0)))
 	newbuf
-      nil)))
+      (and (kill-buffer newbuf) nil))))
 
 (defvar recover-file-diff-program "diff"
   "Absolute or relative name of the `diff' program used by `recover-file'.")
--- a/lisp/gutter-items.el	Mon Jun 03 12:24:14 2002 +0000
+++ b/lisp/gutter-items.el	Tue Jun 04 06:05:53 2002 +0000
@@ -193,8 +193,8 @@
     (setq progress-glyph-height 24)
     (setq progress-layout-instantiator
 	  `[layout 
-	    :orientation vertical :justify left
-	    :margin-width 4
+	    :orientation vertical :margin-width 4
+	    :horizontally-justify left :vertically-justify center
 	    :items (,progress-text-instantiator
 		    [layout 
 		     :orientation horizontal
@@ -211,7 +211,8 @@
 
 (defun set-progress-abort-instantiator (&optional locale)
   (set-glyph-image progress-abort-glyph
-		   `[layout :orientation vertical :justify left
+		   `[layout :orientation vertical
+			    :horizontally-justify left :vertically-justify center
 			    :items (,progress-text-instantiator
 				    [layout
 				     :margin-width 4
--- a/lisp/help.el	Mon Jun 03 12:24:14 2002 +0000
+++ b/lisp/help.el	Tue Jun 04 06:05:53 2002 +0000
@@ -487,11 +487,7 @@
 	(format "*%s*" name))
     (format "*%s*" help-buffer-prefix-string)))
 
-;; Use this function for displaying help when C-h something is pressed
-;; or in similar situations.  Do *not* use it when you are displaying
-;; a help message and then prompting for input in the minibuffer --
-;; this macro usually selects the help buffer, which is not what you
-;; want in those situations.
+;; with-displaying-help-buffer
 
 ;; #### Should really be a macro to eliminate the requirement of
 ;; caller to code a lambda form in THUNK -- mrb
@@ -518,7 +514,13 @@
 
 (defun with-displaying-help-buffer (thunk &optional name)
   "Form which makes a help buffer with given NAME and evaluates BODY there.
-The actual name of the buffer is generated by the function `help-buffer-name'."
+The actual name of the buffer is generated by the function `help-buffer-name'.
+
+Use this function for displaying help when C-h something is pressed or
+in similar situations.  Do *not* use it when you are displaying a help
+message and then prompting for input in the minibuffer -- this macro
+usually selects the help buffer, which is not what you want in those
+situations."
   (let* ((winconfig (current-window-configuration))
 	 (was-one-window (one-window-p))
 	 (buffer-name (help-buffer-name name))
--- a/lisp/minibuf.el	Mon Jun 03 12:24:14 2002 +0000
+++ b/lisp/minibuf.el	Tue Jun 04 06:05:53 2002 +0000
@@ -761,10 +761,10 @@
                         &optional predicate require-match
                                   initial-contents history default)
   "Read a string in the minibuffer, with completion.
-Args: PROMPT, TABLE, PREDICATE, REQUIRE-MATCH, INITIAL-CONTENTS, HISTORY.
+
 PROMPT is a string to prompt with; normally it ends in a colon and a space.
 TABLE is an alist whose elements' cars are strings, or an obarray.
-TABLE can also be a function to do the completion itself.
+TABLE can also be a function which does the completion itself.
 PREDICATE limits completion to a subset of TABLE.
 See `try-completion' and `all-completions' for more details
   on completion, TABLE, and PREDICATE.
--- a/lisp/mule/european.el	Mon Jun 03 12:24:14 2002 +0000
+++ b/lisp/mule/european.el	Tue Jun 04 06:05:53 2002 +0000
@@ -27,7 +27,8 @@
 
 ;;; Commentary:
 
-;; Support six Latin coded character sets ISO8859-1,2,3,4,9,15.
+;; For Europeans, six coded character sets ISO8859-1,2,3,4,9 are supported.
+;; Note: ISO 8859/15 (Latin-9) is supported via the latin-unity package.
 
 ;; #### latin.el would be a better name for this file.
 
--- a/lisp/obsolete.el	Mon Jun 03 12:24:14 2002 +0000
+++ b/lisp/obsolete.el	Tue Jun 04 06:05:53 2002 +0000
@@ -259,7 +259,9 @@
 (make-obsolete-variable 'executing-macro 'executing-kbd-macro)
 
 (define-compatible-function-alias 'interactive-form 
-  'function-interactive) ;FSFmacs 21.1
+  'function-interactive) ;GNU 21.1
+(define-compatible-function-alias 'assq-delete-all
+  'remassq) ;GNU 21.1
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; modeline
 
--- a/lisp/printer.el	Mon Jun 03 12:24:14 2002 +0000
+++ b/lisp/printer.el	Tue Jun 04 06:05:53 2002 +0000
@@ -451,5 +451,5 @@
 	     (setq copies (1- copies)))))
 	((and (not (eq system-type 'windows-nt))
 	      (fboundp 'lpr-region))
-	 (declare-fboundp (lpr-region (point-min) (point-max))))
+	 (lpr-region start end))
 	(t (error "No print support available"))))
--- a/lisp/startup.el	Mon Jun 03 12:24:14 2002 +0000
+++ b/lisp/startup.el	Tue Jun 04 06:05:53 2002 +0000
@@ -563,7 +563,11 @@
       ;;	  (font-menu-add-default))
       (when window-setup-hook
 	(run-hooks 'window-setup-hook))
-      (setq window-setup-hook nil))
+      (setq window-setup-hook nil)
+      (if error-data
+	  ;; re-signal, and don't allow continuation as that will probably
+          ;; wipe out the user's .emacs if she hasn't migrated yet!
+	  (signal-error (car error-data) (cdr error-data))))
 
     (if load-user-init-file-p
 	(maybe-migrate-user-init-file))
@@ -908,6 +912,8 @@
 	    (find-user-init-file user-init-directory)))
   (if (not custom-file)
       (setq custom-file (make-custom-file-name user-init-file)))
+  ;; #### should test load-user-init-file-p here, not in load-init-file
+  ;; see comment there
   (if (and user-init-file
 	   (file-readable-p user-init-file))
       (load user-init-file t t t))
@@ -942,6 +948,8 @@
 	(debug-on-error-initial
 	 (if (eq init-file-debug t) 'startup init-file-debug)))
     (let ((debug-on-error debug-on-error-initial))
+      ;; #### I believe this test is incorrect, it leads to custom-file
+      ;; (at least) being undefined
       (if (and load-user-init-file-p init-file-debug)
 	  (progn
 	    ;; Do this without a condition-case if the user wants to debug.
--- a/man/ChangeLog	Mon Jun 03 12:24:14 2002 +0000
+++ b/man/ChangeLog	Tue Jun 04 06:05:53 2002 +0000
@@ -1,3 +1,62 @@
+2002-05-04  Stephen J. Turnbull  <stephen@xemacs.org>
+
+	* custom.texi (The Init File): Rewrite completely.
+
+2002-03-19  Adrian Aichner  <adrian@xemacs.org>
+
+	* widget.texi (constants): Typo fix.
+
+2002-02-07  Stephen J. Turnbull  <stephen@xemacs.org>
+
+	* external-widget.texi (External Client Widget Internals): New node.
+
+2001-11-15  Darryl Okahata  <darrylo@xemacs.org>
+
+	* lispref/glyphs.texi:
+	lispref/lispref.texi: Add examples of how to insert graphics into a
+	buffer.
+	
+2001-12-17  Stephen J. Turnbull  <stephen@xemacs.org>
+
+	* xemacs/packages.texi (Packages):
+	(Package Terminology):
+	Carefully distinguish libraries and packages.
+	(Package Terminology):
+	More careful definitions of ``category'' and ``distribution.''
+	Use ``generic'' instead of ``normal'' (N.B. package tools use
+	``standard''.)
+	(Installing Packages):
+	Use @var to mark variable version strings, not @t or <>.
+	(Sumo):
+	Add disk space estimate when unpacked.
+
+2002-02-06  Stephen J. Turnbull  <stephen@xemacs.org>
+
+	* xemacs-faq.texi (Q1.3.8, Q1.3.9): Unicode support via Mule-UCS.
+
+2002-02-01  Steve Youngs  <youngs@xemacs.org>
+
+	* xemacs/packages.texi (Removing Packages): The interactive
+	function is 'package-get-delete-package'.
+
+2001-11-27  Adrian Aichner  <adrian@xemacs.org>
+
+	* xemacs-faq.texi: Hyperlink fixes.
+	
+2002-02-04  Stephen J. Turnbull  <stephen@xemacs.org>
+
+	* xemacs-faq.texi (Q4.7.7): New FAQ on remote files.
+
+2002-01-24  Stephen J. Turnbull  <stephen@xemacs.org>
+
+	* xemacs-faq.texi (Q1.0.6): Update mail-to-news gateway information.
+
+2002-02-04  Stephen J. Turnbull  <stephen@xemacs.org>
+
+	* xemacs/files.texi (Files):
+	(File Names):
+	Document remote file editing, refer to EFS and TRAMP.
+
 2002-05-23  Stephen J. Turnbull  <stephen@xemacs.org>
 
 	* lispref/packaging.texi (package-info.in Fields): Typo fix.
--- a/man/custom.texi	Mon Jun 03 12:24:14 2002 +0000
+++ b/man/custom.texi	Tue Jun 04 06:05:53 2002 +0000
@@ -278,12 +278,24 @@
 @comment  node-name,  next,  previous,  up
 @section The Init File
 
-When you save the customizations, call to @code{custom-set-variables},
-@code{custom-set-faces} are inserted into the file specified by
-@code{custom-file}.  By default @code{custom-file} is your @file{.emacs}
-file.  If you use another file, you must explicitly load it yourself.
-The two functions will initialize variables and faces as you have
-specified.
+Customizations are saved to the file specified by @code{custom-file}, as
+calls to @code{custom-set-variables} and @code{custom-set-faces}.
+
+When you save customizations, the current implementation removes the
+calls to @code{custom-set-variables} and @code{custom-set-faces}, and
+replaces them with code generated on the basis of the current
+customization state in Emacs.
+
+By default @code{custom-file} is your @file{.emacs} file (for GNU Emacs
+and older XEmacs) and is @file{custom.el} in the same directory as
+@file{init.el} (in XEmacs 21.4 and later).  If you use another file, you
+must explicitly load it yourself.
+
+As of XEmacs 21.4.7, when @var{custom-file} is present, it is loaded
+@emph{after} @file{init.el}.  This is likely to change in the future,
+because (1) actions in @file{init.el} often would like to depend on
+customizations for consistent appearance and (2) Custom is quite brutal
+about enforcing its idea of the correct values at initialization.
 
 @node Wishlist,  , The Init File, Top
 @comment  node-name,  next,  previous,  up
--- a/man/external-widget.texi	Mon Jun 03 12:24:14 2002 +0000
+++ b/man/external-widget.texi	Tue Jun 04 06:05:53 2002 +0000
@@ -19,7 +19,7 @@
 * Using an External Client Widget::
 * External Client Widget Resource Settings::
 * Motif-Specific Info About the External Client Widget::
-* Example Program Using the External Client Widget::
+* External Client Widget Internals::
 @end menu
 
 
@@ -113,7 +113,7 @@
 made by parent or child widgets.
 
 
-@node Motif-Specific Info About the External Client Widget, Example Program Using the External Client Widget, External Client Widget Resource Settings, Top
+@node Motif-Specific Info About the External Client Widget, External Client Widget Internals, External Client Widget Resource Settings, Top
 @chapter Motif-Specific Info About the External Client Widget
 
 By default, the external client widget has navigation type
@@ -127,84 +127,112 @@
 @kbd{Ctrl-@key{TAB}} and @kbd{Shift-@key{TAB}} are silently filtered by
 the external client widget and are not seen by Emacs.
 
+@node External Client Widget Internals, , Motif-Specific Info About the External Client Widget, Top
+@chapter External Client Widget Internals
 
-@node Example Program Using the External Client Widget, , Motif-Specific Info About the External Client Widget, Top
-@chapter Example Program Using the External Client Widget
+The following text is lifted verbatim from Ben Wing's comments in
+@file{ExternalShell.c}.
 
-This is a very simple program.  It has some issues with exiting.
-Be careful to destroy the Emacs frame in the client window before
-exiting the client program.
+This is a special Shell that is designed to use an externally-
+provided window created by someone else (possibly another process).
+That other window should have an associated widget of class
+ExternalClient.  The two widgets communicate with each other using
+ClientMessage events and properties on the external window.
 
-@example
-/*
-   XEmacsInside.c
+Ideally this feature should be independent of Emacs.  Unfortunately
+there are lots and lots of specifics that need to be dealt with
+for this to work properly, and some of them can't conveniently
+be handled within the widget's methods.  Some day the code may
+be rewritten so that the embedded-widget feature can be used by
+any application, with appropriate entry points that are called
+at specific points within the application.
 
-   Copyright (C) 2002 Free Software Foundation
+This feature is similar to the OLE (Object Linking & Embedding)
+feature provided by MS Windows.
 
-   This program is part of XEmacs.  XEmacs is free software.  See the
-   file COPYING that came with XEmacs for conditions on redistribution.
-
-   This is an example of the XEmacs external widget facility.
+Communication between this shell and the client widget:
 
-   It uses libextcli-Xt.a to interface to the X Toolkit Intrinsics.
-
-   Compile with
+Communication is through ClientMessage events with message_type
+EXTW_NOTIFY and format 32.  Both the shell and the client widget
+communicate with each other by sending the message to the same
+window (the "external window" below), and the data.l[0] value is
+used to determine who sent the message.
 
-   gcc -I/path/to/XEmacs/source/src -L/path/to/XEmacs/build/src -static \
-       -lextcli_Xt -lXt -lX11 -lSM -lICE \
-       -o XEmacsInside XEmacsInside.c
+The data is formatted as follows:
 
-   Run it with the resource "*input: True" and a reasonable geometry spec.
-   It pops up a window, and prints a Lisp form on stdout.  Eval the form
-   in an XEmacs configured with --external-widget.
+data.l[0] = who sent this message: external_shell_send (0) or
+            external_client_send (1)
+data.l[1] = message type (see enum en_extw_notify below)
+data.l[2-4] = data associated with this message
 
-   Written by Stephen J. Turnbull <stephen@@xemacs.org>
+EventHandler() handles messages from the other side.
 
-   Based on simple_text.c from _The Motif Programming Manual_ by Heller
-   and Ferguson, O'Reilly.
-*/
+extw_send_notify_3() sends a message to the other side.
 
-#include <stdio.h>
+extw_send_geometry_value() is used when an XtWidgetGeometry structure
+   needs to be sent.  This is too much data to fit into a
+   ClientMessage, so the data is stored in a property and then
+   extw_send_notify_3() is called.
+
+extw_get_geometry_value() receives an XtWidgetGeometry structure from a
+   property.
 
-#include <X11/Intrinsic.h>
-#include <X11/StringDefs.h>
-#include <X11/Shell.h>
+extw_wait_for_response() is used when a response to a sent message
+   is expected.  It looks for a matching event within a
+   particular timeout.
 
-#include "ExternalClient.h"
+The particular message types are as follows:
+
+1) extw_notify_init (event_window, event_mask)
 
-main (int argc, char *argv[])
-@{
-  Widget toplevel, emacs;
-  XtAppContext app;
+This is sent from the shell to the client after the shell realizes
+its EmacsFrame widget on the client's "external window".  This
+tells the client that it should start passing along events of the
+types specified in event_mask.  event_window specifies the window
+of the EmacsFrame widget, which is a child of the client's
+external window.
+
+extw_notify_init (client_type)
 
-  XtSetLanguageProc (NULL, NULL, NULL);
+When the client receives an extw_notify_init message from the
+shell, it sends back a message of the same sort specifying the type
+of the toolkit used by the client (Motif, generic Xt, or Xlib).
 
-  toplevel = XtVaOpenApplication (&app, "Demo",
-				  NULL, 0, &argc, argv,
-				  NULL, sessionShellWidgetClass,
-				  NULL);
+2) extw_notify_end ()
+
+This is sent from the shell to the client when the shell's
+EmacsFrame widget is destroyed, and tells the client to stop
+passing events along.
 
-  emacs = XtVaCreateManagedWidget ("externalWidget", externalClientWidgetClass,
-				   toplevel,
-				   NULL);
+3) extw_notify_qg (result)
 
-  XtRealizeWidget (toplevel);
+This is sent from the client to the shell when a QueryGeometry
+request is received on the client.  The XtWidgetGeometry structure
+specified in the QueryGeometry request is passed on in the
+EXTW_QUERY_GEOMETRY property (of type EXTW_WIDGET_GEOMETRY) on the
+external window.  result is unused.
 
-  printf ("(make-frame '(window-id \"%d\"))\n", XtWindow(emacs));
-
-  XtAppMainLoop (app);
-@}
+In response, the shell passes the QueryGeometry request down the
+widget tree, and when a response is received, sends a message of
+type extw_notify_qg back to the client, with result specifying the
+GeometryResult value.  If this value is XtGeometryAlmost, the
+returned XtWidgetGeometry structure is stored into the same property
+as above. [BPW is there a possible race condition here?]
 
-/* This function doesn't belong here but somehow it's not getting resolved
-   from the library. */
-void
-fatal (char *msg)
-@{
-  fprintf (stderr, "%s", msg);
-  exit (1);
-@}
-@end example
+4) extw_notify_gm (result)
 
+A very similar procedure to that for extw_notify_qg is followed
+when the shell's RootGeometryManager method is called, indicating
+that a child widget wishes to change the shell's geometry.  The
+XtWidgetGeometry structure is stored in the EXTW_GEOMETRY_MANAGER
+property.
+
+5) extw_notify_focus_in (), extw_notify_focus_out ()
+
+These are sent from the client to the shell when the client gains
+or loses the keyboard focus.  It is done this way because Xt
+maintains its own concept of keyboard focus and only the client
+knows this information.
 
 @summarycontents
 @contents
--- a/netinstall/ChangeLog	Mon Jun 03 12:24:14 2002 +0000
+++ b/netinstall/ChangeLog	Tue Jun 04 06:05:53 2002 +0000
@@ -451,3 +451,9 @@
 
 	* all: port from cygwin setup.
 
+<<<<<<< ChangeLog
+=======
+%%% $Id: ChangeLog,v 1.18 2002/06/04 06:04:38 andyp Exp $
+$Revision: 1.18 $
+
+>>>>>>> 1.2.2.11.2.10
--- a/nt/ChangeLog	Mon Jun 03 12:24:14 2002 +0000
+++ b/nt/ChangeLog	Tue Jun 04 06:05:53 2002 +0000
@@ -1,3 +1,7 @@
+2002-03-29  Jonathan Harris  <jonathan@xemacs.org>
+
+	* xemacs.mak: Define STACK_TRACE_EYE_CATCHER.
+
 2002-05-28  Ben Wing  <ben@xemacs.org>
 
 	* xemacs.mak (CFLAGS_NO_LIB):
@@ -339,7 +343,6 @@
 
 	* XEmacs 21.5.0 "alfalfa" is released.
 
->>>>>>> 1.120
 2001-03-14  Craig Lanning  <CraigL@Knology.net>
 
 	* minitar.c: Clean up some compiler warnings.
--- a/src/ChangeLog	Mon Jun 03 12:24:14 2002 +0000
+++ b/src/ChangeLog	Tue Jun 04 06:05:53 2002 +0000
@@ -1,3 +1,148 @@
+2002-06-03  Andy Piper  <andy@xemacs.org>
+
+	* frame.c (frame_conversion_internal): add conversion appropriate
+	for setting frame dimensions in pixels.
+
+	* console.h (struct console_methods): add device-specific widget
+	layout functions.
+
+	* emacs.c (main_1): initialize glyph vars.
+
+	* event-Xt.c (handle_focus_event_1): call handle_focus_event_2
+	(handle_focus_event_2): new function. Allow focus to
+	be set to a particular window and widget.
+	(enqueue_focus_event): new function. Create a
+	synthetic focus event.
+	(emacs_Xt_handle_magic_event): call
+	handle_focus_event_2.
+
+	* frame.c (Fset_frame_pixel_height): new function. Allow
+	pixel-based sizing. Does the right thing on character-oriented
+	displays.
+	(Fset_frame_pixel_width): ditto.
+	(Fset_frame_pixel_size): ditto.
+	(syms_of_frame): declare.
+
+	* general-slots.h: add :vertically-justify and
+	:horizontally-justify.
+
+	* glyphs-msw.c (xbm_create_bitmap_from_data): warning fix.
+	(mswindows_widget_border_width): new function.
+	(mswindows_combo_box_instantiate): set border widths.
+	(console_type_create_glyphs_mswindows): declare.
+
+	* glyphs-widget.c:
+	(check_valid_justification): allow vertical and horizontal
+	justification.
+	(widget_border_width): new function. Call device methods.
+	(widget_instance_border_width): ditto.
+	(logical_unit_height): new function. Determine the height of a
+	logical-unit. Logical units are intended to provide grid-like
+	layout for subcontrols in a layout. If the layout is
+	:vertically-justify top then subcontrols will be positioned on
+	logical-unit boundaries, thus allowing adjacent subcontrols to
+	line up.
+	(widget_logical_unit_height): ditto for widgets.
+	(redisplay_widget): misc cleanup.
+	(widget_spacing): new function. Call device specific
+	methods. Intended to be the default gap between adjacent widgets.
+	(widget_query_geometry): use new spacing functions to determine
+	appropriate geometry.
+	(initialize_widget_image_instance): initialize horizontal and
+	vertical justification.
+	(widget_instantiate): use logica-units where appropriate for
+	sizing large widgets.
+	(button_query_geometry): use widget_instance_border_width.
+	(tree_view_query_geometry): ditto.
+	(tab_control_query_geometry): ditto.
+	(edit_field_query_geometry): new function.
+	(layout_update): pick up :justify, :horizontally-justify and
+	:vertically-justify none of which worked previously. :justify is
+	used as a fallback for both horizontal and vertical justification.
+	(layout_query_geometry): use logical units to size appropriately.
+	(layout_layout): ditto.
+	(Fwidget_logical_to_character_width): new function. Allow users to
+	convert from logical units to characters so that frame sizes can
+	be set appropriately.
+	(Fwidget_logical_to_character_height): ditto.
+	(syms_of_glyphs_widget): declare.
+	(image_instantiator_edit_fields): add edit_field_query_geometry.
+	(VALID_LAYOUT_KEYWORDS): declare :vertically-justify and
+	:horizontally-justify.
+	(specifier_vars_of_glyphs_widget): new function. Declare
+	Vwidget_border_width which is not yet used.
+
+	* glyphs-x.c (x_map_subwindow): enqueue appropriate focus events.
+	(x_widget_border_width): new function.
+	(x_widget_instantiate): create a sensible name for widgets.
+	(console_type_create_glyphs_x): declare x_widget_border_width.
+
+	* glyphs.h (DEFAULT_WIDGET_BORDER_WIDTH): new macro.
+	(struct Lisp_Image_Instance): add :vertically-justify and
+	:horizontally-justify.
+	(LAYOUT_JUSTIFY_TOP): new.
+	(IMAGE_INSTANCE_SUBWINDOW_H_JUSTIFY): new.
+	(ROUND_UP): new macro. Round argument up to next integral
+	interval.
+
+	* redisplay-output.c (redisplay_output_layout): misc formatting.
+
+	* symsinit.h: declare specifier_vars_of_glyphs_widget.
+
+2002-05-16  Mathias Grimmberger  <mgri@zaphod.sax.de>
+
+	* sysdep.c (sys_rename): Make sys_rename work for the case where
+	Windows rename sets errno to EACCES if target file exists.
+
+2002-05-21  Jonathan Harris  <jonathan@xemacs.org>
+
+	* device-msw.c (mswindows_handle_page_setup_dialog_box):
+	Fix detection of metric units to work on Win95
+
+2002-05-25  Andy Piper  <andy@xemacs.org>
+
+	* select-x.c (vars_of_select_x): Fix docstring of
+	x-selection-strict-motif-ownership
+
+2002-05-07  Nix  <nix@esperi.demon.co.uk>
+
+	Supersedes 2002-04-17 patch.
+
+	* process.h (PROCESS_LIVE_P): Use the process status as
+	evidence of health, not the state of the input stream.
+	(PROCESS_READABLE_P): Say if the process is readable
+	from. (It may be dead nonetheless.)
+	(CHECK_READABLE_PROCESS): Test for that condition.
+
+	* process.c (create_process): Use PROCESS_READABLE_P.
+	(read_process_output, set_process_filter): Likewise.
+
+	* process.c (Fprocess_input_coding_system): Use CHECK_READABLE_PROCESS.
+	(Fset_process_input_coding_system, Fprocess_coding_system): Likewise.
+
+	This code is #if 0'd, this is not the time to add new functions:
+
+	* process.c (Fprocess_readable_p): Report readability status.
+	* process.c (Qprocess_readable_p): New, associated symbol...
+	* process.c (syms_of_process): ... initialize it.
+
+2002-05-06  Andy Piper  <andy@xemacs.org>
+
+	* process.h (PROCESS_LIVE_P): revert previous change because of
+	tty problems.
+
+2002-04-27  Andy Piper  <andy@xemacs.org>
+
+	* glyphs-msw.c (mswindows_widget_instantiate): remove dead-code.
+
+2002-04-26  Andy Piper  <andy@xemacs.org>
+
+	* glyphs-msw.c (mswindows_map_subwindow): observe :initial-focus
+	behavior.
+
+	* config.h.in: pull in 21.5.x change to stop alloca warnings under
+	cygwin.
+
 2002-06-02  Michael Sperber [Mr. Preprocessor]  <sperber@informatik.uni-tuebingen.de>
 
 	* process.c (remove_process): Don't invalidate the process marker
@@ -1667,7 +1812,6 @@
 	* window.c (print_window):
 	* window.c (print_window_config):
 	* window.c (Fcurrent_pixel_column):
-
 	Another big Ben patch.
 
 	-- FUNCTIONALITY CHANGES:
@@ -1767,6 +1911,80 @@
 	char_to_unicode -> emchar_to_unicode
 	valid_char_p -> valid_emchar_p
 
+2002-04-30  Charles G. Waldman <cgw@xemacs.org>
+
+        * sysdep.c (sys_siglist): change "signum" to "signal"
+
+2001-04-21  Martin Buchholz  <martin@xemacs.org>
+
+	* s/darwin.h: New file.
+	Thanks to Greg Parker <gparker@cs.stanford.edu>.
+	
+2002-04-23  Andreas Jaeger  <aj@suse.de>
+
+	* s/linux.h (LIB_STANDARD): Define correctly for x86-64 and s390x
+	which use lib64 for 64-bit libs.
+        (START_FILES): Likewise.
+
+2002-02-11  Mike Sperber  <mike@xemacs.org>
+
+	* device-x.c: 
+	(x_IO_error_handler):
+	(x_init_device): Temporarily keep device in static variable
+	`device_being_initialized' so we can recover gracefully from
+	internal XOpenDevice failure.  (XOpenDevice is documented to
+	return NULL on failure, but sometimes calls the IO error handler
+	instead.)
+
+2002-01-31  John H. Palmieri  <palmieri@math.washington.edu>
+
+	* dired.c (Ffile_name_all_completions): Change documentation --
+	remove reference to completion-ignored-extensions.
+	* dired.c (vars_of_dired): Change documentation for
+	completion-ignored-extensions -- remove reference to
+	file-name-all-completions.
+
+2002-03-06  Jerry James  <james@xemacs.org>
+
+	* emodules.c (emodules_load): Fix multiple loading of same module.
+
+2002-01-25  Andrew Begel <abegel@cs.berkeley.edu>
+	* sysdll.c (dll_open): Changed to use RTLD_NOW instead of
+	RTLD_LAZY to avoid incorrect symbol binding when using nested
+	shared libraries on Solaris.
+
+2002-02-12  Stephen J. Turnbull  <stephen@xemacs.org>
+
+	* fileio.c (Ffind_file_name_handler): Improve docstring.
+
+2002-01-20  Stephen J. Turnbull  <stephen@xemacs.org>
+
+	* fns.c (Fmapconcat): Improve docstring.
+
+2002-01-03  Eric Gillespie, Jr.  <epg@pretzelnet.org>
+
+	* device-gtk.c: Add prototype for
+	emacs_gtk_selection_clear_event_handle.
+	(gtk_init_device): Call gtk_selection_add_target for CLIPBOARD
+	selection.  Setup signal handler for "selection_clear_event"
+	(emacs_gtk_selection_clear_event_handle).
+
+	* select-gtk.c (emacs_gtk_selection_clear_event_handle): Handle
+	other applications owning the clipboard (based on
+	x_handle_selection_clear).
+
+2001-12-23  William M. Perry  <wmperry@gnu.org>
+
+	* menubar-gtk.c (gtk_popup_menu)  Add sanity checks, fix crash.
+	
+2002-01-04  Martin Buchholz  <martin@xemacs.org>
+
+	* keymap.c (define_key_alternate_name): Parenthesize EQ.
+
+2001-12-17  Stephen J. Turnbull  <stephen@xemacs.org>
+
+	* XEmacs 21.4.6 "Common Lisp" is released.
+
 	Change intbyte_strcmp -> qxestrcmp_c (duplicated functionality).
 
 	-- INTERFACE CHANGES AFFECTING LESS CODE:
@@ -1896,9 +2114,17 @@
 
 2002-02-06  Adrian Aichner  <adrian@xemacs.org>
 
+	* src/window.c (window_loop): Implement new UNDEDICATE_BUFFER
+	operation.
+	* src/buffer.c (kill_buffer): Undedicate windows showing BUF
+	before replacing them.
+
 	* redisplay.c (mark_redisplay): Remove call to
 	update_frame_window_mirror.
 
+	* src/window.c (undedicate_windows): Use it.
+	* src/window.h: Add prototype.
+
 2002-01-03  Andy Piper  <andy@xemacs.org>
 
 	* realpath.c (ABS_LENGTH): dtrt for cygwin systems using drive
@@ -11138,8 +11364,8 @@
 
 2000-04-26  IKEYAMA Tomonori  <tomonori@suiyokai.org>
 
-        * redisplay-msw.c (mswindows_output_dibitmap): Set foreground
-        color if the image is a mono pixmap.
+	* redisplay-msw.c (mswindows_output_dibitmap): Set foreground
+	color if the image is a mono pixmap.
 
 2000-07-30  Ben Wing  <ben@xemacs.org>
 
@@ -11786,8 +12012,320 @@
         * buffer.c (Fget_file_buffer):
         Fixed GCPRO problem.
 
-        * buffer.c (get_truename_buffer):
-        Fixed comment about GC checking.
+	* glyphs-msw.c (bmp_normalize):
+	(mswindows_resource_normalize): add dest_mask so that it can be
+	proprogated by layout_normalize.
+	(begin_defer_window_pos): make optional because it may not be the
+	right thing to do and it introduces differences with X.
+	(mswindows_unmap_subwindow): ditto.
+	(mswindows_map_subwindow): ditto.
+	(mswindows_redisplay_subwindow): renamed from
+	mswindows_update_subwindow.
+	(mswindows_redisplay_widget): ditto.
+	(mswindows_button_redisplay): renamed from
+	mswindows_button_update. Update is now what the instantiation
+	function does for a changed instantiator.
+	(mswindows_progress_gauge_instantiate): set the progress value
+	here if appropriate.
+	(mswindows_tab_control_redisplay): cope with re-ordering of the
+	members of the tab widget by simply selecting the new top
+	widget. This makes things appear ok if you click on a tab.
+	(mswindows_combo_box_instantiate): image_instance_layout now takes
+	position as well as size.
+	(mswindows_progress_gauge_redisplay): renamed from
+	mswindows_progress_gauge_update.
+	(console_type_create_glyphs_mswindows): fix update -> redisplay.
+	(image_instantiator_format_create_glyphs_mswindows): ditto.
+
+	* glyphs-eimage.c (jpeg_normalize):
+	(gif_normalize):
+	(png_normalize):
+	(tiff_normalize): add dest_mask so that it can be proprogated by
+	layout_normalize.
+
+	* elhash.c:
+	(print_hash_table):
+	(hash_table_weakness_validate):
+	(decode_hash_table_weakness):
+	(Fhash_table_weakness):
+	(Fhash_table_type):
+	(syms_of_elhash): use Ben's naming scheme for hashtable types..
+
+	* console.h (struct console_methods): move update_* to
+	redisplay_*.
+
+2000-07-20  Ben Wing  <ben@xemacs.org>
+
+	* *.[ch] (XSETOBJ): remove unused middle argument.
+	lisp-disunion.h: correct wrap_object() to one argument.
+
+2000-07-15  Ben Wing  <ben@xemacs.org>
+
+	* s/cygwin32.h:
+	* s/cygwin32.h (CYGWIN_CONV_PATH):
+	Add missing logb prototype for v1.1.
+	Use post-b20 names and alias to pre-b20 names when pre-b20.
+
+	* s/windowsnt.h: [5].
+
+2000-07-15  Ben Wing  <ben@xemacs.org>
+
+	* Makefile.in.in (x_objs):
+	* Makefile.in.in (sheap_objs):
+	* Makefile.in.in (objs):
+	added win32.o, cosmetic cleanups.
+
+	* alloc.c (Fmake_byte_code):
+	[[[1]]]: Changes for new LIST_LOOP, EXTERNAL_LIST_LOOP,
+	etc. macros which declare their own args now.
+
+	* alloc.c (syms_of_alloc):
+	[[[2]]]: Use DEFSYMBOL, DEFKEYWORD, DEFERROR and friends.
+
+	* buffer.c:
+	Moved buffer-dedicated-frame, set-buffer-dedicated-frame into lisp.
+
+	* buffer.c (Fget_file_buffer):
+	Fixed GCPRO problem.
+
+	* buffer.c (get_truename_buffer):
+	Fixed comment about GC checking.
+
+	* buffer.c (syms_of_buffer):
+	Undeclared those dedicated frame funs.
+	[2].
+
+	* buffer.h:
+	Define convenience macros for internal/external conversions.
+	[[[3]]]: Define codesys aliases Qcommand_argument_encoding
+	and Qenvironment_variable_encoding for cleaner code.
+
+	* bufslots.h:
+	Remove dedicated-frame; in lisp.
+
+	* bytecode.c (funcall_compiled_function):
+	[1].
+
+	* bytecode.c (syms_of_bytecode):
+	[2].
+
+	* console-msw.c:
+	* console-msw.c (mswindows_show_console): Rewrote.
+
+	* console-msw.c (Fmswindows_debugging_output): New.
+	Sends to OutputDebugString (special MSWin debugger interface).
+
+	* console-msw.c (Fmswindows_message_box):
+	Fixed stupid bugs so it works when called from kill-emacs.
+
+	* console-msw.c (syms_of_console_mswindows):
+	Declare Fmswindows_debugging_output.
+
+	* console-msw.h:
+	New MSWin prototypes.
+
+	* console-msw.h (struct mswindows_frame):
+	New entry last-click-mods for improved button-modifier support.
+
+	* console-msw.h (FRAME_MSWINDOWS_POPUP):
+	New struct entry `popup' with corresponding accessor.
+
+	* console-x.c:
+	* console-x.c (split_up_display_spec):
+	* console-x.c (get_display_arg_connection):
+	* console-x.c (x_semi_canonicalize_console_connection):
+	* console-x.c (x_canonicalize_device_connection):
+	[[[6]]]: Change char to more specific type.
+	[[[8]]]: Make use of abstracting codesys aliases defined in [3], [4];
+
+	* console-x.c (x_semi_canonicalize_console_connection):
+	* console-x.c (x_canonicalize_device_connection):
+	[[[9]]]: Fix up error signalling to use new structured error system.
+
+	* console-x.h:
+	[[[4]]]: Define codesys aliases:
+	Qlwlib_encoding, Qx_atom_name_encoding, Qx_font_name_encoding,
+	Qx_color_name_encoding, Qx_display_name_encoding.
+
+	* console.h (struct console_methods):
+	New method make_dialog_box_internal supersedes older
+	popup_dialog_box method.
+
+	* data.c:
+	Define many new errors, part of new structured errors.
+
+	* data.c (init_errors_once_early):
+	* data.c (syms_of_data):
+	[2].
+
+	* device-msw.c (mswindows_init_device):
+	[[[5]]]: Cleanup to support NT 3.51.
+
+	* device-msw.c (decode_devmode): Cleanup.
+
+	* device-msw.c (mswindows_handle_print_setup_dialog_box):
+	* device-msw.c (mswindows_handle_print_dialog_box):
+	* device-msw.c (mswindows_handle_page_setup_dialog_box):
+	* device-msw.c (syms_of_device_mswindows):
+	Delete the dialog box primitives recently introduced by Kirill and
+	instead interface to general dialog box interface.
+
+	* device-x.c:
+	* device-x.c (compute_x_app_name):
+	* device-x.c (x_init_device):
+	* device-x.c (Fx_valid_keysym_name_p):
+	* device-x.c (Fx_set_font_path):
+	[6].
+	[7].
+
+	* device.h (wrap_device): New.
+	First of its kind; meant to replace XSETDEVICE.
+
+	* dialog-msw.c: Many file-dialog symbols.
+
+	* dialog-msw.c (mswindows_register_popup_frame): New.
+	* dialog-msw.c (mswindows_is_dialog_msg): New.
+	For supporting kbd traversal in dialog boxes.
+
+	* dialog-msw.c (dialog_proc):
+	Support hitting ESC in dialogs.
+
+	* dialog-msw.c (struct):
+	Common dialog box errors.
+
+	* dialog-msw.c (handle_file_dialog_box): New.
+	Add file dialog code.
+
+	* dialog-msw.c (handle_question_dialog_box):
+	Redo existing code to support new question dialog syntax.
+
+	* dialog-msw.c (console_type_create_dialog_mswindows):
+	We support new dialog console method.
+
+	* dialog-msw.c (syms_of_dialog_mswindows):
+	* dialog-msw.c (vars_of_dialog_mswindows):
+	New file dialog symbols, vars.
+
+	* dialog-x.c:
+	* dialog-x.c (maybe_run_dbox_text_callback):
+	* dialog-x.c (dbox_descriptor_to_widget_value):
+	* dialog-x.c (x_make_dialog_box_internal):
+	* dialog-x.c (console_type_create_dialog_x):
+	Mule-ize entire file.
+	Redo to support question dialog syntax.
+	[6].
+
+	* dialog.c:
+	* dialog.c (Fmake_dialog_box_internal):
+	* dialog.c (syms_of_dialog):
+	Kill old popup-dialog-box, replace with new primitive.
+	Just call device method or signal error.
+
+	* eldap.c (Fldap_open):
+	* eldap.c (Fldap_search_basic):
+	* eldap.c (Fldap_add):
+	* eldap.c (Fldap_modify):
+	[1].
+	[7].
+
+	* emacs.c:
+	* emacs.c (make_arg_list_1):
+	* emacs.c (make_arg_list):
+	Mule-ize call to dll_init().
+	[6].
+	[8].
+
+	* emacs.c (make_argc_argv):
+	* emacs.c (free_argc_argv):
+	* emacs.c (init_cmdargs):
+	* emacs.c (main_1):
+	* emacs.c (Fkill_emacs):
+	* emacs.c (Fdump_emacs):
+	Update comments about what can be used in syms_* etc.
+	Call init_win32() when necessary.
+	Fix up MS Win dialog box in kill-buffer to actually work right.
+	[7].
+
+	* eval.c:
+	* eval.c (For):
+	* eval.c (Fand):
+	* eval.c (Fprogn):
+	* eval.c (Fprog1):
+	* eval.c (Fprog2):
+	* eval.c (FletX):
+	* eval.c (Flet):
+	* eval.c (condition_case_3):
+	* eval.c (Feval):
+	* eval.c (function_argcount):
+	* eval.c (funcall_lambda):
+	[1].
+
+	* eval.c (type_error): New.
+	* eval.c (maybe_type_error): New.
+	* eval.c (continuable_type_error): New.
+	* eval.c (maybe_continuable_type_error): New.
+	* eval.c (type_error_with_frob): New.
+	* eval.c (maybe_type_error_with_frob): New.
+	* eval.c (continuable_type_error_with_frob): New.
+	* eval.c (maybe_continuable_type_error_with_frob): New.
+	New functions for use with structured errors.
+
+	* event-Xt.c:
+	* event-Xt.c (x_event_to_emacs_event):
+	Buttons are now modifiers too.
+
+	* event-Xt.c (emacs_Xt_current_event_timestamp):
+	Implement new event method.
+	* event-Xt.c (reinit_vars_of_event_Xt): Set it.
+
+	* event-msw.c:
+	* event-msw.c (ntpipe_shove_writer): [5].
+	* event-msw.c (mswindows_enqueue_mouse_button_event):
+	* event-msw.c (mswindows_drain_windows_queue):
+	* event-msw.c (mswindows_wnd_proc): [7].
+	* event-msw.c (mswindows_current_layout_has_AltGr): [5].
+	* event-msw.c (mswindows_modifier_state):
+	Throughout: support new button modifiers.
+
+	* event-msw.c (emacs_mswindows_current_event_timestamp):
+	Implement new event method.
+	* event-msw.c (reinit_vars_of_event_mswindows): Set it.
+
+	* event-stream.c:
+	* event-stream.c (event_stream_current_event_timestamp): New.
+	* event-stream.c (maybe_kbd_translate): New functionality.
+	* event-stream.c (vars_of_event_stream):
+	Document new kbd-translate-table functionality.
+
+	* event-stream.c (Fcurrent_event_timestamp): New.
+	New primitive for use in fabricated events.
+	* event-stream.c (syms_of_event_stream): [2]. Declare new primitive.
+
+	* events-mod.h (XEMACS_MOD_BUTTON1): new button modifiers.
+
+	* events.c:
+	* events.c (Fmake_event):
+	* events.c (WRONG_EVENT_TYPE_FOR_PROPERTY):
+	[1].
+	[9].
+
+	* events.c (format_event_object): fix gcc warnings.
+
+	* events.c (Fevent_timestamp): Document new primitives.
+
+	* events.c (TIMESTAMP_HALFSPACE): New.
+
+	* events.c (Fevent_timestamp_lessp): New.  New primitive for
+	comparing timestamps correctly (half-space algorithm).
+
+	* events.c (Fevent_modifier_bits): Doc fix.
+
+        	* buffer.c (get_truename_buffer): Fixed comment about GC
+	checking.
+
+	* events.c (Fevent_modifiers): Major doc addition.
+	* events.c (event_x_y_pixel_internal): Typo fix.
+	* events.c (syms_of_events): Declare new primitives.
 
         * buffer.c (syms_of_buffer):
         Undeclared those dedicated frame funs.
@@ -12222,172 +12760,376 @@
         Add prototypes for structured error functions.
         Add long comments describing looping macros and change interface
         so that lvalues are automatically declared.
+
+	* events.h:
+	Update long comment for button modifiers, timestamps.
+
+	* events.h (struct event_stream):
+	New current_event_timestamp method.
+
+	* extents.c:
+	* extents.c (extent_in_region_p):
+	* extents.c (decode_extent):
+	* extents.c (Fset_extent_parent):
+	* extents.c (decode_map_extents_flags):
+	Fix gcc warnings.
+	[9].
+
+	* extents.c (struct extent_at_arg):
+	* extents.c (decode_extent_at_flag):
+	* extents.c (extent_at_mapper):
+	* extents.c (extent_at_bytind):
+	* extents.c (Fextent_at): Adapt to new lower-level interface. [9].
+	* extents.c (Fextents_at): New primitive. [9].
+	* extents.c (symbol_to_glyph_layout): [9].
+	Support new primitive `extents-at'.
+
+
+	* extents.c (get_text_property_bytind):
+	extent_at_bytind has another arg.
+	[9].
+
+	* extents.c (syms_of_extents): New primitive.
+
+	* file-coding.c (Fmake_coding_system): [1].
+	* file-coding.c (subsidiary_coding_system): fix gcc warning
+	* file-coding.c (syms_of_file_coding): [2].
+
+	* fileio.c (Fexpand_file_name):
+	* fileio.c (Fsysnetunam):
+	* fileio.c (Ffile_exists_p):
+	* fileio.c (Ffile_executable_p):
+	* fileio.c (Fverify_visited_file_modtime):
+	Clean up GCPROing.
+
+	* fileio.c (syms_of_fileio): [2].
+
+	* filelock.c (lock_file_1):
+	* filelock.c (current_lock_owner):
+	* filelock.c (lock_if_free):
+	* filelock.c (lock_file):
+	* filelock.c (unlock_file):
+	Clean up GCPROing.
+
+	* fns.c (concat): Fix gcc warning.
+
+	* fns.c (Fmember):
+	* fns.c (Fold_member):
+	* fns.c (Fmemq):
+	* fns.c (Fold_memq):
+	* fns.c (memq_no_quit):
+	* fns.c (Fassoc):
+	* fns.c (Fold_assoc):
+	* fns.c (Fassq):
+	* fns.c (Fold_assq):
+	* fns.c (assq_no_quit):
+	* fns.c (Frassoc):
+	* fns.c (Fold_rassoc):
+	* fns.c (Frassq):
+	* fns.c (Fold_rassq):
+	* fns.c (rassq_no_quit):
+	* fns.c (Fdelete):
+	* fns.c (Fold_delete):
+	* fns.c (Fdelq):
+	* fns.c (Fold_delq):
+	* fns.c (delq_no_quit):
+	* fns.c (Fremassoc):
+	* fns.c (Fremassq):
+	* fns.c (remassq_no_quit):
+	* fns.c (Fremrassoc):
+	* fns.c (Fremrassq):
+	* fns.c (remrassq_no_quit):
+	* fns.c (Freverse):
+	* fns.c (mapcar1):
+	[1].
+
+	* frame-msw.c (mswindows_init_frame_1):
+	* frame-msw.c (mswindows_delete_frame):
+	Register popups with dialog code so keyboard traversing works.
+
+	* frame-tty.c (tty_raise_frame_no_select): [1].
+
+	* frame-x.c:
+	* frame-x.c (x_set_frame_text_value):
+	* frame-x.c (x_set_frame_properties):
+	* frame-x.c (x_create_widgets):
+	[7].
+
+	* frame.c:
+	* frame.c (Fmouse_pixel_position): Minor doc fixes.
+
+	* frame.h (wrap_frame): New.
+	Macro like wrap_device.
+
+	* general.c:
+	* general.c (SYMBOL):
+	* general.c (syms_of_general):
+	Major reorg.  This is now just a wrapper and symbols themselves
+	are listed in general-slots.h.
+
+	* glyphs-eimage.c (tiff_instantiate): Need cast to fix warning.
+	* glyphs-msw.c (mswindows_resource_instantiate): [5].
+
+	* glyphs-msw.c (mswindows_native_layout_instantiate):
+	Add DS_CONTROL so keyboard traversal will work.
+
+	* glyphs-widget.c:
+	* glyphs-widget.c (syms_of_glyphs_widget):
+	Move some symbols to general-slots.h.
+
+	* glyphs-x.c:
+	* glyphs-x.c (xbm_instantiate_1):
+	* glyphs-x.c (x_xbm_instantiate):
+	* glyphs-x.c (x_xface_instantiate):
+	* glyphs-x.c (autodetect_instantiate):
+	* glyphs-x.c (cursor_font_instantiate):
+	* glyphs-x.c (x_update_widget):
+	* glyphs-x.c (x_widget_instantiate):
+	* glyphs.c (bitmap_to_lisp_data):
+	* glyphs.c (pixmap_to_lisp_data):
+	[7].
+
+	* glyphs.c (syms_of_glyphs):
+	[2].
+
+	* gui-x.c:
+	* gui-x.c (print_widget_value):
+	* gui-x.c (menu_separator_style_and_to_external):
+	* gui-x.c (add_accel_and_to_external):
+	* gui-x.c (button_item_to_widget_value):
+	* gui-x.c (gui_items_to_widget_values_1):
+	* gui-x.c (gui_items_to_widget_values):
+	* gui-x.c (syms_of_gui_x):
+	* gui-x.c (vars_of_gui_x):
+	Mule-ize entire file.  Move menu-no-selection-hook to gui.c.
+	[9].
+
+	* gui-x.h:
+	Muleize, prototype changes matching gui-x.c.
+
+	* gui.c:
+	* gui.c (separator_string_p):
+	* gui.c (gui_item_add_keyval_pair):
+	* gui.c (make_gui_item_from_keywords_internal):
+	* gui.c (signal_too_long_error):
+	* gui.c (parse_gui_item_tree_item):
+	* gui.c (syms_of_gui):
+	* gui.c (vars_of_gui):
+	* gui.h:
+	menu-no-selection-hook moved here (used by MSWin).
+	Move some symbols to general-slots.h.
+	[6].
+	[9].
+
+	* insdel.c (get_buffer_pos_char):
+	* insdel.c (get_buffer_range_char):
+	Add GC comments.
+
+	* keymap.c (keymap_lookup_directly):
+	* keymap.c (keymap_store):
+	* keymap.c (ensure_meta_prefix_char_keymapp):
+	* keymap.c (describe_map):
+	* keymap.h:
+	Support new button modifiers.
+
+	* lisp-disunion.h (wrap_object):
+	* lisp-disunion.h (XSETOBJ):
+	Rename make_obj to wrap_object.
+
+	* lisp-union.h:
+	* lisp-union.h (make_int):
+	* lisp-union.h (make_char):
+	Support wrap_object.
+
+	* lisp.h:
+	* lisp.h (LIST_LOOP):
+	* lisp.h (EXTERNAL_LIST_LOOP):
+	* lisp.h (LIST_LOOP_2):
+	* lisp.h (EXTERNAL_LIST_LOOP_1):
+	* lisp.h (EXTERNAL_LIST_LOOP_2):
+	* lisp.h (EXTERNAL_LIST_LOOP_3):
+	* lisp.h (EXTERNAL_LIST_LOOP_4_NO_DECLARE):
+	* lisp.h (PRIVATE_EXTERNAL_LIST_LOOP_6):
+	* lisp.h (GET_EXTERNAL_LIST_LENGTH):
+	* lisp.h (EXTERNAL_ALIST_LOOP_5):
+	* lisp.h (EXTERNAL_ALIST_LOOP_6):
+	* lisp.h (EXTERNAL_ALIST_LOOP_6_NO_DECLARE):
+	* lisp.h (EXTERNAL_PROPERTY_LIST_LOOP_5_NO_DECLARE):
+	* lisp.h (EXTERNAL_PROPERTY_LIST_LOOP_7):
+	* lisp.h (struct Lisp_Symbol):
+	* lisp.h (maybe_continuable_error_with_frob):
+	Fix up section comments.
+	Add new types for char to indicate usage.
+	Delete symbols auto-generated from general-slots.h.
+	Add prototypes for structured error functions.
+	Add long comments describing looping macros and change interface
+	so that lvalues are automatically declared.
 	Add NO_DECLARE macro in case callers want to declare lvalues
 	themselves.
 
-        * lread.c (read_syntax_error):
-        * lread.c (continuable_read_syntax_error):
-        * lread.c (read_structure):
-        * lread.c (sequence_reader):
-        * lread.c (read_list_conser):
-        * lread.c (read_compiled_function):
-        Rename syntax_error and continuable_syntax_error to avoid clash
-        with same-named structured error functions.
-
-        * menubar-msw.c (mswindows_translate_menu_or_dialog_item):
-        * menubar-msw.c (populate_menu_add_item):
-        * menubar-msw.c (populate_or_checksum_helper):
-        [5].
-        [9].
-
-        * menubar-x.c:
-        * menubar-x.c (menu_item_descriptor_to_widget_value_1):
-        Mule-ize whole file.
-
-        * menubar.c (Fnormalize_menu_item_name): Add optimization.
-
-        * mule-charset.c (Fmake_charset):
-        * mule-wnnfns.c (Fwnn_set_param):
-        [1].
-
-        * ntproc.c (create_child):
-        * ntproc.c (Fwin32_set_current_locale):
-        Add comments portending doom.
-
-        * objects-msw.c:
-        * objects-msw.c (old_font_enum_callback_2):
-        * objects-msw.c (font_enum_callback_1):
-        * objects-msw.c (mswindows_enumerate_fonts):
-        [5].
-
-        * objects-x.c:
-        * objects-x.c (allocate_nearest_color):
-        * objects-x.c (x_parse_nearest_color):
-        * objects-x.c (x_initialize_color_instance):
-        * objects-x.c (x_print_color_instance):
-        * objects-x.c (x_finalize_color_instance):
-        * objects-x.c (x_valid_color_name_p):
-        * objects-x.c (x_initialize_font_instance):
-        * objects-x.c (x_print_font_instance):
-        * objects-x.c (valid_x_font_name_p):
-        * objects-x.c (truename_via_FONT_prop):
-        * objects-x.c (truename_via_random_props):
-        * objects-x.c (truename_via_XListFonts):
-        * objects-x.c (x_font_truename):
-        * objects-x.c (x_font_instance_truename):
-        * objects-x.c (x_font_instance_properties):
-        * objects-x.c (x_list_fonts):
-        * objects-x.c (x_find_charset_font):
-        Mule-ize entire file.
-        [7].
-
-        * objects-x.h:
-        Mule-verify.
-
-        * print.c:
-        * print.c (std_handle_out_external):
-        * print.c (debug_print_no_newline):
-        * print.c (syms_of_print):
-        Output to all debugger kinds in debug-print.
-        Fix console-output code under MSWin to actually work.
-
-        * process-nt.c (send_signal):
-        * process-nt.c (nt_create_process):
-        Use newer Unicode macros.
-
-        * process-unix.c (unix_create_process):
-        * process-unix.c (unix_canonicalize_host_name):
-        * process-unix.c (unix_open_network_stream):
-        [7].
-
-        * scrollbar-x.c:
-        Mule-verify.
-
-        * search.c (syms_of_search):
-        [2].
-
-        * select-msw.c (mswindows_destroy_selection):
-        Use LIST_LOOP_2.
-
-        * select-x.c (symbol_to_x_atom):
-        [7].
-
-        * select.c (syms_of_select):
-        [2].
-
-        * sound.c (Fplay_sound_file):
-        [7].
-
-        * specifier.c:
-        * specifier.c (decode_specifier_type):
-        * specifier.c (Fvalid_specifier_locale_type_p):
-        * specifier.c (check_valid_locale_or_locale_type):
-        * specifier.c (decode_locale):
-        * specifier.c (decode_locale_type):
-        * specifier.c (decode_locale_list):
-        * specifier.c (check_valid_domain):
-        * specifier.c (decode_specifier_tag_set):
-        * specifier.c (Fcanonicalize_tag_set):
-        * specifier.c (Fdefine_specifier_tag):
-        * specifier.c (Fspecifier_tag_predicate):
-        * specifier.c (check_valid_inst_list):
-        * specifier.c (check_valid_spec_list):
-        * specifier.c (decode_how_to_add_specification):
-        * specifier.c (check_modifiable_specifier):
-        * specifier.c (specifier_add_spec):
-        * specifier.c (boolean_validate):
-        * specifier.c (display_table_validate):
-        [9].
-
-        * specifier.c (syms_of_specifier):
-        Move some symbols to general-slots.h.
-        [2].
-
-        * symbols.c:
-        * symbols.c (Fmapatoms):
-        * symbols.c (Fapropos_internal):
-        Add GCPROs.
-
-        * symbols.c (set_default_buffer_slot_variable):
-        * symbols.c (set_default_console_slot_variable):
-        [1].
-
-        * symbols.c (defsymbol_massage_name_1):
-        * symbols.c (defkeyword_massage_name):
-        * symbols.c (deferror_1):
-        * symbols.c (deferror):
-        * symbols.c (deferror_massage_name_and_message):
-        * symeval.h:
-        * symeval.h (DEFSYMBOL):
-        Support DEFSYMBOL*, DEFKEYWORD, DEFERROR
-
-        * symbols.c (syms_of_symbols):
-        [2].
-
-        * symsinit.h:
-        * symsinit.h (init_win32): New.
-        Also new is syms_of_dialog_mswindows.
-
-        * syswindows.h:
+	* lread.c (read_syntax_error):
+	* lread.c (continuable_read_syntax_error):
+	* lread.c (read_structure):
+	* lread.c (sequence_reader):
+	* lread.c (read_list_conser):
+	* lread.c (read_compiled_function):
+	Rename syntax_error and continuable_syntax_error to avoid clash
+	with same-named structured error functions.
+
+	* menubar-msw.c (mswindows_translate_menu_or_dialog_item):
+	* menubar-msw.c (populate_menu_add_item):
+	* menubar-msw.c (populate_or_checksum_helper):
+	[5].
+	[9].
+
+	* menubar-x.c:
+	* menubar-x.c (menu_item_descriptor_to_widget_value_1):
+	Mule-ize whole file.
+
+	* menubar.c (Fnormalize_menu_item_name): Add optimization.
+
+	* mule-charset.c (Fmake_charset):
+	* mule-wnnfns.c (Fwnn_set_param):
+	[1].
+
+	* ntproc.c (create_child):
+	* ntproc.c (Fwin32_set_current_locale):
+	Add comments portending doom.
+
+	* objects-msw.c:
+	* objects-msw.c (old_font_enum_callback_2):
+	* objects-msw.c (font_enum_callback_1):
+	* objects-msw.c (mswindows_enumerate_fonts):
+	[5].
+
+	* objects-x.c:
+	* objects-x.c (allocate_nearest_color):
+	* objects-x.c (x_parse_nearest_color):
+	* objects-x.c (x_initialize_color_instance):
+	* objects-x.c (x_print_color_instance):
+	* objects-x.c (x_finalize_color_instance):
+	* objects-x.c (x_valid_color_name_p):
+	* objects-x.c (x_initialize_font_instance):
+	* objects-x.c (x_print_font_instance):
+	* objects-x.c (valid_x_font_name_p):
+	* objects-x.c (truename_via_FONT_prop):
+	* objects-x.c (truename_via_random_props):
+	* objects-x.c (truename_via_XListFonts):
+	* objects-x.c (x_font_truename):
+	* objects-x.c (x_font_instance_truename):
+	* objects-x.c (x_font_instance_properties):
+	* objects-x.c (x_list_fonts):
+	* objects-x.c (x_find_charset_font):
+	Mule-ize entire file.
+	[7].
+
+	* objects-x.h:
+	Mule-verify.
+
+	* print.c:
+	* print.c (std_handle_out_external):
+	* print.c (debug_print_no_newline):
+	* print.c (syms_of_print):
+	Output to all debugger kinds in debug-print.
+	Fix console-output code under MSWin to actually work.
+
+	* process-nt.c (send_signal):
+	* process-nt.c (nt_create_process):
+	Use newer Unicode macros.
+
+	* process-unix.c (unix_create_process):
+	* process-unix.c (unix_canonicalize_host_name):
+	* process-unix.c (unix_open_network_stream):
+	[7].
+
+	* scrollbar-x.c:
+	Mule-verify.
+
+	* search.c (syms_of_search):
+	[2].
+
+	* select-msw.c (mswindows_destroy_selection):
+	Use LIST_LOOP_2.
+
+	* select-x.c (symbol_to_x_atom):
+	[7].
+
+	* select.c (syms_of_select):
+	[2].
+
+	* sound.c (Fplay_sound_file):
+	[7].
+
+	* specifier.c:
+	* specifier.c (decode_specifier_type):
+	* specifier.c (Fvalid_specifier_locale_type_p):
+	* specifier.c (check_valid_locale_or_locale_type):
+	* specifier.c (decode_locale):
+	* specifier.c (decode_locale_type):
+	* specifier.c (decode_locale_list):
+	* specifier.c (check_valid_domain):
+	* specifier.c (decode_specifier_tag_set):
+	* specifier.c (Fcanonicalize_tag_set):
+	* specifier.c (Fdefine_specifier_tag):
+	* specifier.c (Fspecifier_tag_predicate):
+	* specifier.c (check_valid_inst_list):
+	* specifier.c (check_valid_spec_list):
+	* specifier.c (decode_how_to_add_specification):
+	* specifier.c (check_modifiable_specifier):
+	* specifier.c (specifier_add_spec):
+	* specifier.c (boolean_validate):
+	* specifier.c (display_table_validate):
+	[9].
+
+	* specifier.c (syms_of_specifier):
+	Move some symbols to general-slots.h.
+	[2].
+
+	* symbols.c:
+	* symbols.c (Fmapatoms):
+	* symbols.c (Fapropos_internal):
+	Add GCPROs.
+
+	* symbols.c (set_default_buffer_slot_variable):
+	* symbols.c (set_default_console_slot_variable):
+	[1].
+
+	* symbols.c (defsymbol_massage_name_1):
+	* symbols.c (defkeyword_massage_name):
+	* symbols.c (deferror_1):
+	* symbols.c (deferror):
+	* symbols.c (deferror_massage_name_and_message):
+	* symeval.h:
+	* symeval.h (DEFSYMBOL):
+	Support DEFSYMBOL*, DEFKEYWORD, DEFERROR
+
+	* symbols.c (syms_of_symbols):
+	[2].
+
+	* symsinit.h:
+	* symsinit.h (init_win32): New.
+	Also new is syms_of_dialog_mswindows.
+
+	* syswindows.h:
 	Add new Unicode macros, missing Cygwin wide-char functions,
 	convenience conversion macros for Qmswindows_tstr, macros for
 	encapsulating required MSWin <-> Cygwin filename conversions,
 	prototype for dynamically-extracted (not in NT 3.51) functions.
 
-        * toolbar-x.c:
-        Mule-verify.
-
-        * tooltalk.c (Fadd_tooltalk_message_arg):
-        * tooltalk.c (Fadd_tooltalk_pattern_attribute):
-        * tooltalk.c (Fadd_tooltalk_pattern_arg):
-        [7].
-
-        * tooltalk.c (syms_of_tooltalk):
-        [2].
-
-        * unexnt.c:
-        * unexnt.c (unexec):
-        Fix up headers, declaration of unexec() to be more standard.
+	* toolbar-x.c:
+	Mule-verify.
+
+	* tooltalk.c (Fadd_tooltalk_message_arg):
+	* tooltalk.c (Fadd_tooltalk_pattern_attribute):
+	* tooltalk.c (Fadd_tooltalk_pattern_arg):
+	[7].
+
+	* tooltalk.c (syms_of_tooltalk):
+	[2].
+
+	* unexnt.c:
+	* unexnt.c (unexec):
+	Fix up headers, declaration of unexec() to be more standard.
 
 2000-07-20  Martin Buchholz  <martin@xemacs.org>
 
@@ -12685,36 +13427,36 @@
 
 2000-07-05  Craig Lanning  <lanning@scra.org>
 
-        * Makefile.in.in: Add support for including the Windows resources
-        when building with the cygwin and mingw targets.
-
-        * buffer.c: from Dan Holmsand, on Windows $PWD is most likely either
-        not set or not correct.
-        (directory_is_current_directory): Don't compile for WIN32_NATIVE.
-        (init_initial_directory): Don't try to use $PWD on the
-        WIN32_NATIVE target.
-
-        * s\cygwin32.h:
+	* Makefile.in.in: Add support for including the Windows resources
+	when building with the cygwin and mingw targets.
+
+	* buffer.c: from Dan Holmsand, on Windows $PWD is most likely either
+	not set or not correct.
+	(directory_is_current_directory): Don't compile for WIN32_NATIVE.
+	(init_initial_directory): Don't try to use $PWD on the
+	WIN32_NATIVE target.
+
+	* s\cygwin32.h:
 	[[Add -mwindows to eliminate console window.]] not required --ben
-        (HAVE_NATIVE_SOUND): removed; now handled by configure.
-        (MAIL_USE_POP): removed; now handled by configure.
-
-        * s\mingw32.h: [[Add -mwindows to eliminate console window.]] not in
+	(HAVE_NATIVE_SOUND): removed; now handled by configure.
+	(MAIL_USE_POP): removed; now handled by configure.
+
+	* s\mingw32.h: [[Add -mwindows to eliminate console window.]] not in
 	C_SWITCH_SYSTEM or it will affect lib-src progs. --ben
-        (HAVE_NATIVE_SOUND): removed; now handled by configure.
-        (MAIL_USE_POP): removed; now handled by configure.
-        (ENCAPSULATE_STAT): from Dan Holmsand, added.
-        (ENCAPSULATE_FSTAT): from Dan Holmsand, added.
-        (DIRECTORY_SEP): from Dan Holmsand, use lisp variable instead of
-        constant string.
-        (HAVE_TIMEVAL): from Dan Holmsand, added; struct timeval is picked
-        up from <winsock.h> via systime.h.
-        (HAVE_GETPAGESIZE): from Dan Holmsand, added.
-        (getpagesize): from Dan Holmsand, added.
-        Added #endif which was left dangling by Ben's mega patch; added
-        comment to help prevent this in the future.
-
-        * sysdll.c: added #include <windows.h> for WIN32_NATIVE case.
+	(HAVE_NATIVE_SOUND): removed; now handled by configure.
+	(MAIL_USE_POP): removed; now handled by configure.
+	(ENCAPSULATE_STAT): from Dan Holmsand, added.
+	(ENCAPSULATE_FSTAT): from Dan Holmsand, added.
+	(DIRECTORY_SEP): from Dan Holmsand, use lisp variable instead of
+	constant string.
+	(HAVE_TIMEVAL): from Dan Holmsand, added; struct timeval is picked
+	up from <winsock.h> via systime.h.
+	(HAVE_GETPAGESIZE): from Dan Holmsand, added.
+	(getpagesize): from Dan Holmsand, added.
+	Added #endif which was left dangling by Ben's mega patch; added
+	comment to help prevent this in the future.
+
+	* sysdll.c: added #include <windows.h> for WIN32_NATIVE case.
 
 2000-07-05  Kirill 'Big K' Katsnelson  <kkm@dtmx.com>
 
@@ -12812,13 +13554,13 @@
 
 2000-06-08  Mike Alexander  <mta@arbortext.com>
 
-        (MAX_SHOVE_BUFFER_SIZE): Change to 512 to match stream buffer size
-        (shove_thread): Don't write the same output twice
-        (make_ntpipe_output_stream): Increase priority of shove thread
-        (ntpipe_shove_writer): Call SwitchToThread to give shove thread a
-        chance to run
-        (ntpipe_shove_closer): Don't delete the pipe until we're done with
-        it.
+	(MAX_SHOVE_BUFFER_SIZE): Change to 512 to match stream buffer size
+	(shove_thread): Don't write the same output twice
+	(make_ntpipe_output_stream): Increase priority of shove thread
+	(ntpipe_shove_writer): Call SwitchToThread to give shove thread a
+	chance to run
+	(ntpipe_shove_closer): Don't delete the pipe until we're done with
+	it.
 
 2000-06-12  Ben Wing  <ben@xemacs.org>
 
@@ -14609,12 +15351,12 @@
 
 	* redisplay.c (add_glyph_rune): Don't set 0 to bufpos for text
 	image glyph if allow_cursor.
-        (add_hscroll_rune): Don't allow cursor to border glyph.
-        (create_text_block): Ditto.
+	(add_hscroll_rune): Don't allow cursor to border glyph.
+	(create_text_block): Ditto.
 
 	* redisplay-output.c (redisplay_move_cursor): Do nothing even if
 	text not in buffer.
-        (redisplay_output_layout): Call ensure_face_cachel_complete for
+	(redisplay_output_layout): Call ensure_face_cachel_complete for
 	text image glyph.
 
 
@@ -15193,7 +15935,7 @@
 	* alloc.c (pdump_register_struct):
 	* alloc.c (pdump_dump_data):
 	* alloc.c (pdump_reloc_one):
-        Minor cleanups.
+	Minor cleanups.
 
  	* console-msw.c:
 	* console-msw.c (GetConsoleHwnd):
@@ -15203,16 +15945,16 @@
 	* console-msw.c (msw_output_console_string):
 	* console-msw.c (console_type_create_mswindows):
 
-        a) Added functions to manipulate the console window for use with
-        shell support.
-
-        b) Added support for writing text to the console, which is now
-        used under Windows when xemacs is not being run non-interactively,
-        to write text that would otherwise be destined for stdout because
-        under these circumstances, text written to stdout tends to
-        disappear and not be seen.
-
-        * console-msw.h:
+	a) Added functions to manipulate the console window for use with
+	shell support.
+
+	b) Added support for writing text to the console, which is now
+	used under Windows when xemacs is not being run non-interactively,
+	to write text that would otherwise be destined for stdout because
+	under these circumstances, text written to stdout tends to
+	disappear and not be seen.
+
+	* console-msw.h:
 	* event-Xt.c:
 	* event-Xt.c (x_event_to_emacs_event):
 	* event-Xt.c (describe_event_window):
@@ -15266,20 +16008,20 @@
 	* device-msw.c (msw_get_workspace_coords):
 	* device-msw.c (mswindows_device_system_metrics):
 	and various other files, added support for a new
-        device property called offset-workspace which returns the position
-        of the upper left corner of the workspace area and goes along with
-        the existing size-workspace property.
+	device property called offset-workspace which returns the position
+	of the upper left corner of the workspace area and goes along with
+	the existing size-workspace property.
 
 	* dialog-msw.c:
 	* dialog-msw.c (push_bufbyte_string_as_unicode):
 	* dialog-msw.c (mswindows_popup_dialog_box):
-        Added support for XEmacs-style accelerator specifications in
-        button text.  Note: I didn't add support for this under X Windows,
-        and somebody needs to do this.
+	Added support for XEmacs-style accelerator specifications in
+	button text.  Note: I didn't add support for this under X Windows,
+	and somebody needs to do this.
 
 	* dialog.c:
 	* dialog.c (Fpopup_dialog_box):
-        Documented the support for accelerators that was just mentioned.
+	Documented the support for accelerators that was just mentioned.
 
 	editfns.c (get_home_directory): Changed behavior under Windows
 	when HOME not defined; former behavior was irretrievably broken.
@@ -15298,9 +16040,9 @@
 	* print.c (debug_print):
 	* print.c (debug_backtrace):
 	* print.c (debug_short_backtrace):
-        Cleaned up the code that prints text to stdout so that this can be
-        changed to output into a console window instead under MS Windows,
-        as described above.
+	Cleaned up the code that prints text to stdout so that this can be
+	changed to output into a console window instead under MS Windows,
+	as described above.
 
 	* eval.c:
 	* eval.c (DEFEND_AGAINST_THROW_RECURSION):
@@ -15322,14 +16064,14 @@
 	* event-msw.c (mswindows_modifier_state):
 	* event-msw.c (emacs_mswindows_quit_p):
 	* event-msw.c (vars_of_event_mswindows):
-        a) Added support for using the alt key to select menu items as is
-        standard under MS Windows.  This is controlled using the variable
-        menu-accelerator-enabled, just like under X Windows.  There is an
-        option on the options menu to turn this support on.  I really
-        think that it should be on by default under Windows, but I'm not
-        going to make this change yet.
-
-        b)  Added support for dynamic display size changes under Windows.
+	a) Added support for using the alt key to select menu items as is
+	standard under MS Windows.  This is controlled using the variable
+	menu-accelerator-enabled, just like under X Windows.  There is an
+	option on the options menu to turn this support on.  I really
+	think that it should be on by default under Windows, but I'm not
+	going to make this change yet.
+
+	b)  Added support for dynamic display size changes under Windows.
 
 	* event-stream.c:
 	* event-stream.c (maybe_echo_keys):
@@ -15344,30 +16086,30 @@
 	* event-stream.c (complex_vars_of_event_stream):
 	* events.h (struct command_builder):
 
-        a) Tried to clean up a little bit the horribly written x-specific
-        accelerator code that crept into this file.  I moved this code
-        into menubar-x.c where it belongs. I also needed to move the
-        command builder structure into the file events.h because it is
-        accessed directly by this accelerator code.  What I didn't do, but
-        which should be done at some point, is to properly abstract this
-        code using device methods instead of the kludgy way that it
-        currently hooks into the event code.
-
-        b) Added the lisp variables this-command-properties and
-        last-command- properties, which should be used to synchronize two
-        adjacent commands in preference to playing games with the variable
-        this-command, which is typically what happens.
-
-        c) Added some slightly nasty code to hook into the lisp support
-        for shifted- motion-key selection.  This is actually necessary for
-        somewhat complicated reasons, which are described in
-        simple.el. (NB: I think the proper thing would be to have the code
-        that calls the pre and post command hooks also call out to generic
-        lisp functions in simple.el, where all built-in stuff could be
-        added.  I will think about this more.)
+	a) Tried to clean up a little bit the horribly written x-specific
+	accelerator code that crept into this file.  I moved this code
+	into menubar-x.c where it belongs. I also needed to move the
+	command builder structure into the file events.h because it is
+	accessed directly by this accelerator code.  What I didn't do, but
+	which should be done at some point, is to properly abstract this
+	code using device methods instead of the kludgy way that it
+	currently hooks into the event code.
+
+	b) Added the lisp variables this-command-properties and
+	last-command- properties, which should be used to synchronize two
+	adjacent commands in preference to playing games with the variable
+	this-command, which is typically what happens.
+
+	c) Added some slightly nasty code to hook into the lisp support
+	for shifted- motion-key selection.  This is actually necessary for
+	somewhat complicated reasons, which are described in
+	simple.el. (NB: I think the proper thing would be to have the code
+	that calls the pre and post command hooks also call out to generic
+	lisp functions in simple.el, where all built-in stuff could be
+	added.  I will think about this more.)
 
 	* event-unixoid.c (poll_fds_for_input):
-        * lread.c (readchar):
+	* lread.c (readchar):
 	* redisplay-tty.c (tty_clear_frame):
 	* redisplay-x.c (x_get_gc):
 	* signal.c (interrupt_signal):
@@ -15380,33 +16122,33 @@
 
 	* frame-msw.c:
 	* frame-msw.c (mswindows_size_frame_internal):
-        Fixed the computation of frame size and position to keep the frame
-        within the workspace area, rather than within the physical
-        dimensions of the screen, so that the frame doesn't overlap window
-        manager decorations, such as the start menu and toolbar, typically
-        at the bottom of the screen.
+	Fixed the computation of frame size and position to keep the frame
+	within the workspace area, rather than within the physical
+	dimensions of the screen, so that the frame doesn't overlap window
+	manager decorations, such as the start menu and toolbar, typically
+	at the bottom of the screen.
 
 	* frame.c (vars_of_frame):
-        Changed the default frame title format under MS Windows to consist
-        of buffername-XEmacs, which is standard under MS Windows.  I think
-        it might be a good idea to change this everywhere because I think
-        it is superior to the current frame title format, but this is the
-        kind of change that is likely to cause some people to get annoyed,
-        so I'm not making it.
+	Changed the default frame title format under MS Windows to consist
+	of buffername-XEmacs, which is standard under MS Windows.  I think
+	it might be a good idea to change this everywhere because I think
+	it is superior to the current frame title format, but this is the
+	kind of change that is likely to cause some people to get annoyed,
+	so I'm not making it.
 
 	* glyphs-eimage.c (png_instantiate): Fixed some compile warnings.
 
 	* gui-msw.c (mswindows_handle_gui_wm_command):
-        Fixed compile warnings.
+	Fixed compile warnings.
 
 	* gui-x.c:
 	* gui-x.c (strdup_and_add_accel):
 	* gui-x.c (button_item_to_widget_value):
 	* gui-x.h:
-        Added code to automatically put an accelerator onto the beginning
-        of menu items that don't have one as is now the standard, and is
-        described more later.  Also fixed things so that the menu item
-        name can be an evaluated expression, again a new standard.
+	Added code to automatically put an accelerator onto the beginning
+	of menu items that don't have one as is now the standard, and is
+	described more later.  Also fixed things so that the menu item
+	name can be an evaluated expression, again a new standard.
 
 	* gui.c:
 	* gui.c (gui_item_add_keyval_pair):
@@ -15425,9 +16167,9 @@
 	* line-number.c (buffer_line_number):
 	* lisp.h:
 	* lisp.h (EMACS_INT_MAX):
-        Added the manifest constant EMACS_INT_MIN corresponding to the
-        existing constant EMACS_INT_MAX.  This is partially to fix compile
-        warnings under Windows, and partly for cleanliness.
+	Added the manifest constant EMACS_INT_MIN corresponding to the
+	existing constant EMACS_INT_MAX.  This is partially to fix compile
+	warnings under Windows, and partly for cleanliness.
 
 	* menubar-msw.c:
 	* menubar-msw.c (REPLACE_ME_WITH_GLOBAL_VARIABLE_WHICH_CONTROLS_RIGHT_FLUSH):
@@ -15446,15 +16188,15 @@
 	* menubar-msw.c (mswindows_update_frame_menubars):
 	* menubar-msw.c (mswindows_free_frame_menubars):
 	* menubar-msw.c (mswindows_popup_menu):
-        Fixed a bug in handling accelerators where an extra character
-        would be displayed in the menu item.  Also generalized the
-        function displayable_menu_item because it is now used by the
-        dialog box code as well.  And finally, added code in the functions
-        that create the menubar to extract a list of accelerators for the
-        top level menubar, which is used in the event code to determine
-        whether a particular alt-key combination should be used to invoke
-        a menu item, or should be passed through to access the standard
-        XEmacs keymap binding for this key combination.
+	Fixed a bug in handling accelerators where an extra character
+	would be displayed in the menu item.  Also generalized the
+	function displayable_menu_item because it is now used by the
+	dialog box code as well.  And finally, added code in the functions
+	that create the menubar to extract a list of accelerators for the
+	top level menubar, which is used in the event code to determine
+	whether a particular alt-key combination should be used to invoke
+	a menu item, or should be passed through to access the standard
+	XEmacs keymap binding for this key combination.
 
 	Much needed GCPROing.
 
@@ -15473,10 +16215,10 @@
 	* menubar-x.c (command_builder_find_menu_accelerator):
 	* menubar-x.c (Faccelerate_menu):
 	* menubar.h:
-        Moved a whole bunch of code here that was previously in
-        event-stream.c as described above.  There is also code connected
-        to the new standard of adding an accelerator to the beginning of
-        menu items that don't have one as described above and below.
+	Moved a whole bunch of code here that was previously in
+	event-stream.c as described above.  There is also code connected
+	to the new standard of adding an accelerator to the beginning of
+	menu items that don't have one as described above and below.
 
 	* menubar.c:
 	* menubar.c (menu_parse_submenu_keywords):
@@ -15486,31 +16228,31 @@
 	* menubar.c (vars_of_menubar):
 	* menubar.c (complex_vars_of_menubar):
 
-        a) Cleaned up a bunch of documentation and improved it.
-
-        b) XEmacs now automatically adds an accelerator onto the beginning
-        of any menu items that don't have one.  I did this because there
-        will inevitably be some menu items on the main menubar that don't
-        have accelerators on them because the package that adds that
-        particular menu item hasn't yet been fixed up to have accelerators
-        in them and it looked rather strange to have some items with and
-        some items without accelerators, especially since even in items
-        without accelerators, you can, at least under windows, still
-        access the item through an accelerator corresponding to the first
-        character in the item's name.  If people don't like this behavior,
-        I can add a variable to turn it off optionally, but I'm not sure
-        this is a good idea because we really do need to have accelerators
-        on all of the menu items, and if a package doesn't like the
-        accelerators being put on the first character, then it should put
-        the accelerators where they belong.
-
-        c) I made a behavior change, which is that the descriptor that
-        specifies the text of the menu item, which formerly was just a
-        string, can now also be an evaluated expression.  This makes this
-        descriptor parallel with all of the others, which could also be
-        evaluated expressions.  This also obviates the need for the
-        keyword :label, which was previously listed in the documentation
-        as unimplemented, and which was for the same purpose.
+	a) Cleaned up a bunch of documentation and improved it.
+
+	b) XEmacs now automatically adds an accelerator onto the beginning
+	of any menu items that don't have one.  I did this because there
+	will inevitably be some menu items on the main menubar that don't
+	have accelerators on them because the package that adds that
+	particular menu item hasn't yet been fixed up to have accelerators
+	in them and it looked rather strange to have some items with and
+	some items without accelerators, especially since even in items
+	without accelerators, you can, at least under windows, still
+	access the item through an accelerator corresponding to the first
+	character in the item's name.  If people don't like this behavior,
+	I can add a variable to turn it off optionally, but I'm not sure
+	this is a good idea because we really do need to have accelerators
+	on all of the menu items, and if a package doesn't like the
+	accelerators being put on the first character, then it should put
+	the accelerators where they belong.
+
+	c) I made a behavior change, which is that the descriptor that
+	specifies the text of the menu item, which formerly was just a
+	string, can now also be an evaluated expression.  This makes this
+	descriptor parallel with all of the others, which could also be
+	evaluated expressions.  This also obviates the need for the
+	keyword :label, which was previously listed in the documentation
+	as unimplemented, and which was for the same purpose.
 
 	d) GCPROing.
 
@@ -15519,10 +16261,10 @@
 	* ntproc.c (sys_spawnve):
 	* ntproc.c (find_child_console):
 	* ntproc.c (sys_kill):
-        Fixed compile warnings.  By the way, this file should really go
-        away entirely, and this will happen as soon as Kirill makes his
-        final round of process cleanups, which affect the function
-        call-process.
+	Fixed compile warnings.  By the way, this file should really go
+	away entirely, and this will happen as soon as Kirill makes his
+	final round of process cleanups, which affect the function
+	call-process.
 
 	* process-nt.c:
 	* process-nt.c (struct nt_process_data):
@@ -15538,17 +16280,17 @@
 	* process-nt.c (nt_kill_process_by_pid):
 	* process-nt.c (nt_open_network_stream):
 	* process-nt.c (vars_of_process_nt):
-        Copied over code from Emacs 20.5 to correctly send signals to sub-
-        processes under Windows 95.  Also added code to automatically
-        create and hide console window when a sub-process is created under
-        Windows 95, which obviates the need for the separate runemacs.exe
-        executable, and finally implemented some variables that were
-        implemented in Emacs 20.5, but previously not in XEmacs.  These
-        include mswindows- start-process-share-console and
-        mswindows-start-process-inherit-error-mode. (Both of these only
-        apply to Windows 95.)
-
-        * regex.c (regex_compile): Fixed a compile warning.
+	Copied over code from Emacs 20.5 to correctly send signals to sub-
+	processes under Windows 95.  Also added code to automatically
+	create and hide console window when a sub-process is created under
+	Windows 95, which obviates the need for the separate runemacs.exe
+	executable, and finally implemented some variables that were
+	implemented in Emacs 20.5, but previously not in XEmacs.  These
+	include mswindows- start-process-share-console and
+	mswindows-start-process-inherit-error-mode. (Both of these only
+	apply to Windows 95.)
+
+	* regex.c (regex_compile): Fixed a compile warning.
 
 	* select-msw.c:
 	* select-msw.c (mswindows_own_selection):
@@ -15556,20 +16298,20 @@
 	* select-msw.c (mswindows_disown_selection):
 	* select-msw.c (console_type_create_select_mswindows):
 	* select-msw.c (syms_of_select_mswindows):
-        Cleaned up the file and implemented the device method
-        selection_exists_p, which had accidentally been left out.  Also
-        removed four lisp functions that were remnants from before the
-        time when the selection code was properly device abstracted.
-        These functions are no longer needed because there are generic
-        equivalents, and because they were added recently and don't exist
-        in FSF Emacs, I don't think there's any problem with just deleting
-        them.
+	Cleaned up the file and implemented the device method
+	selection_exists_p, which had accidentally been left out.  Also
+	removed four lisp functions that were remnants from before the
+	time when the selection code was properly device abstracted.
+	These functions are no longer needed because there are generic
+	equivalents, and because they were added recently and don't exist
+	in FSF Emacs, I don't think there's any problem with just deleting
+	them.
 
 	* sysdep.c:
 	* sysdep.c (sys_subshell):
-        Fixed a compile warning, although in this case there's probably
-        something wrong with this code, and it ought to be looked into
-        more thoroughly by somebody who understands it.
+	Fixed a compile warning, although in this case there's probably
+	something wrong with this code, and it ought to be looked into
+	more thoroughly by somebody who understands it.
 
 	* window.c:
 	* window.c (Fwindow_text_area_height):
@@ -15578,13 +16320,13 @@
 	* window.c (Fwindow_pixel_width):
 	* window.c (debug_print_window):
 	* window.c (syms_of_window):
-        Added functions window-text-area-height and window-full-width,
-        which are functions for returning various width and height
-        characteristics of a window. (One of these functions is necessary
-        for making the file dialog box work correctly, and the other one
-        was added for completeness.)  Also added a table to the
-        documentation for window-height which describes the entire scheme
-        for accessing width and height characteristics of a window.
+	Added functions window-text-area-height and window-full-width,
+	which are functions for returning various width and height
+	characteristics of a window. (One of these functions is necessary
+	for making the file dialog box work correctly, and the other one
+	was added for completeness.)  Also added a table to the
+	documentation for window-height which describes the entire scheme
+	for accessing width and height characteristics of a window.
 
 2000-03-12  Kirill 'Big K' Katsnelson  <kkm@dtmx.com>
 
--- a/src/console.h	Mon Jun 03 12:24:14 2002 +0000
+++ b/src/console.h	Tue Jun 04 06:05:53 2002 +0000
@@ -263,6 +263,11 @@
   void (*resize_subwindow_method) (Lisp_Image_Instance *, int w, int h);
   void (*redisplay_subwindow_method) (Lisp_Image_Instance *);
   void (*redisplay_widget_method) (Lisp_Image_Instance *);
+  /* Maybe this should be a specifier. Unfortunately specifiers don't
+     allow us to represent things at the toolkit level, which is what
+     is required here. */
+  int (*widget_border_width_method) (void);
+  int (*widget_spacing_method) (Lisp_Image_Instance *);
   int (*image_instance_equal_method) (Lisp_Image_Instance *,
 				      Lisp_Image_Instance *,
 				      int depth);
--- a/src/device-gtk.c	Mon Jun 03 12:24:14 2002 +0000
+++ b/src/device-gtk.c	Tue Jun 04 06:05:53 2002 +0000
@@ -122,6 +122,18 @@
 extern void gdk_imlib_init(void);
 #endif
 
+extern void emacs_gtk_selection_handle (GtkWidget *,
+					GtkSelectionData *selection_data,
+					guint info,
+					guint time_stamp,
+					gpointer data);
+extern void emacs_gtk_selection_clear_event_handle (GtkWidget *widget,
+                                                    GdkEventSelection *event,
+                                                    gpointer data);
+extern void emacs_gtk_selection_received (GtkWidget *widget,
+					  GtkSelectionData *selection_data,
+					  gpointer user_data);
+
 #ifdef HAVE_BONOBO
 static CORBA_ORB orb;
 #endif
--- a/src/emacs.c	Mon Jun 03 12:24:14 2002 +0000
+++ b/src/emacs.c	Tue Jun 04 06:05:53 2002 +0000
@@ -1932,6 +1932,7 @@
 	 */
 
       specifier_vars_of_glyphs ();
+      specifier_vars_of_glyphs_widget ();
       specifier_vars_of_gutter ();
 #ifdef HAVE_MENUBARS
       specifier_vars_of_menubar ();
--- a/src/event-Xt.c	Mon Jun 03 12:24:14 2002 +0000
+++ b/src/event-Xt.c	Tue Jun 04 06:05:53 2002 +0000
@@ -68,6 +68,7 @@
 #endif
 
 static void handle_focus_event_1 (struct frame *f, int in_p);
+static void handle_focus_event_2 (Window w, struct frame *f, int in_p);
 
 static struct event_stream *Xt_event_stream;
 
@@ -1536,6 +1537,16 @@
 static void
 handle_focus_event_1 (struct frame *f, int in_p)
 {
+  handle_focus_event_2 (XtWindow (FRAME_X_TEXT_WIDGET (f)), f, in_p);
+}
+
+static void
+handle_focus_event_2 (Window win, struct frame *f, int in_p)
+{
+  /* Although this treats focus differently for all widgets (including
+     the frame) it seems to work ok. */
+  Widget needs_it = XtWindowToWidget (FRAME_X_DISPLAY (f), win);
+
 #if XtSpecificationRelease > 5
   widget_with_focus = XtGetKeyboardFocusWidget (FRAME_X_TEXT_WIDGET (f));
 #endif
@@ -1566,14 +1577,19 @@
      click in the frame. Why is this?  */
   if (in_p
 #if XtSpecificationRelease > 5
-      && FRAME_X_TEXT_WIDGET (f) != widget_with_focus
+      && needs_it != widget_with_focus
 #endif
       )
     {
-      lw_set_keyboard_focus (FRAME_X_SHELL_WIDGET (f),
-			     FRAME_X_TEXT_WIDGET (f));
+      lw_set_keyboard_focus (FRAME_X_SHELL_WIDGET (f), needs_it);
     }
 
+  /* If we are focusing on a native widget then record and exit. */
+  if (needs_it != FRAME_X_TEXT_WIDGET (f)) {
+    widget_with_focus = needs_it;
+    return;
+  }
+
   /* We have the focus now. See comment in
      emacs_Xt_handle_widget_losing_focus (). */
   if (in_p)
@@ -1595,9 +1611,26 @@
   }
 }
 
+/* Create a synthetic X focus event. */
+void
+enqueue_focus_event (Widget wants_it, Lisp_Object frame, int in_p)
+{
+  Lisp_Object emacs_event = Fmake_event (Qnil, Qnil);
+  Lisp_Event *ev          = XEVENT (emacs_event);
+  XEvent *x_event = &ev->event.magic.underlying_x_event;
+
+  x_event->type = in_p ? FocusIn : FocusOut;
+  x_event->xfocus.window = XtWindow (wants_it);
+
+  ev->channel	            = frame;
+  ev->event_type	    = magic_event;
+
+  enqueue_Xt_dispatch_event (emacs_event);
+}
+
 /* The idea here is that when a widget glyph gets unmapped we don't
    want the focus to stay with it if it has focus - because it may
-   well just get deleted next andthen we have lost the focus until the
+   well just get deleted next and then we have lost the focus until the
    user does something. So handle_focus_event_1 records the widget
    with keyboard focus when FocusOut is processed, and then, when a
    widget gets unmapped, it calls this function to restore focus if
@@ -1974,7 +2007,7 @@
       if (FRAME_X_EXTERNAL_WINDOW_P (f))
 	break;
 #endif
-      handle_focus_event_1 (f, event->type == FocusIn);
+      handle_focus_event_2 (event->xfocus.window, f, event->type == FocusIn);
       break;
 
     case ClientMessage:
--- a/src/frame.c	Mon Jun 03 12:24:14 2002 +0000
+++ b/src/frame.c	Tue Jun 04 06:05:53 2002 +0000
@@ -118,6 +118,10 @@
 Lisp_Object Qframe_being_created;
 
 static void store_minibuf_frame_prop (struct frame *f, Lisp_Object val);
+static void frame_conversion_internal (struct frame *f, int pixel_to_char,
+				       int *pixel_width, int *pixel_height,
+				       int *char_width, int *char_height,
+				       int real_face);
 static struct display_line title_string_display_line;
 /* Used by generate_title_string. Global because they get used so much that
    the dynamic allocation time adds up. */
@@ -2692,6 +2696,37 @@
   return frame;
 }
 
+DEFUN ("set-frame-pixel-height", Fset_frame_pixel_height, 2, 3, 0, /*
+Specify that the frame FRAME is HEIGHT pixels tall.
+Optional third arg non-nil means that redisplay should be HEIGHT pixels tall
+but that the idea of the actual height of the frame should not be changed.
+*/
+       (frame, height, pretend))
+{
+  struct frame *f = decode_frame (frame);
+  int pheight, width;
+  frame = wrap_frame (f);
+  CHECK_INT (height);
+
+  if (!window_system_pixelated_geometry (frame)) 
+    {
+      int h = XINT (height);
+      width = FRAME_WIDTH (f);
+      /* Simply using pixel_to_real_char_size here is not good
+	 enough since we end up with a total frame size of HEIGHT
+	 rather than a displayable height of HEIGHT. */
+      frame_conversion_internal (f, 2, 0, &h, 0, &pheight, 0);
+    }
+  else 
+    {
+      width = FRAME_PIXWIDTH (f);
+      pheight = XINT (height);
+    }
+
+  internal_set_frame_size (f, width, pheight, !NILP (pretend));
+  return frame;
+}
+
 DEFUN ("set-frame-width", Fset_frame_width, 2, 3, 0, /*
 Specify that the frame FRAME has COLS columns.
 Optional third arg non-nil means that redisplay should use COLS columns
@@ -2719,6 +2754,37 @@
   return frame;
 }
 
+DEFUN ("set-frame-pixel-width", Fset_frame_pixel_width, 2, 3, 0, /*
+Specify that the frame FRAME is WIDTH pixels wide.
+Optional third arg non-nil means that redisplay should be WIDTH wide
+but that the idea of the actual height of the frame should not be changed.
+*/
+       (frame, width, pretend))
+{
+  struct frame *f = decode_frame (frame);
+  int height, pwidth;
+  frame = wrap_frame (f);
+  CHECK_INT (width);
+
+  if (!window_system_pixelated_geometry (frame))
+    {
+      int w = XINT (width);
+      height = FRAME_HEIGHT (f);
+      /* Simply using pixel_to_real_char_size here is not good
+	 enough since we end up with a total frame size of WIDTH
+	 rather than a displayable height of WIDTH. */
+      frame_conversion_internal (f, 2, &w, 0, &pwidth, 0, 0);
+    }
+  else
+    {
+      height = FRAME_PIXHEIGHT (f);
+      pwidth = XINT (width);
+    }
+
+  internal_set_frame_size (f, pwidth, height, !NILP (pretend));
+  return frame;
+}
+
 DEFUN ("set-frame-size", Fset_frame_size, 3, 4, 0, /*
 Set the size of FRAME to COLS by ROWS, measured in characters.
 Optional fourth arg non-nil means that redisplay should use COLS by ROWS
@@ -2744,6 +2810,38 @@
   return frame;
 }
 
+DEFUN ("set-frame-pixel-size", Fset_frame_pixel_size, 3, 4, 0, /*
+Set the size of FRAME to WIDTH by HEIGHT, measured in pixels.
+Optional fourth arg non-nil means that redisplay should use WIDTH by HEIGHT
+but that the idea of the actual size of the frame should not be changed.
+*/
+       (frame, width, height, pretend))
+{
+  struct frame *f = decode_frame (frame);
+  int pheight, pwidth;
+  frame = wrap_frame (f);
+  CHECK_INT (width);
+  CHECK_INT (height);
+
+  if (!window_system_pixelated_geometry (frame)) 
+    {
+      int w = XINT (width);
+      int h = XINT (height);
+      /* Simply using pixel_to_real_char_size here is not good enough
+	 since we end up with a total frame size of WIDTH x HEIGHT
+	 rather than a displayable height of WIDTH x HEIGHT. */
+      frame_conversion_internal (f, 2, &w, &h, &pwidth, &pheight, 0);
+    }
+  else
+    {
+      pheight = XINT (height);
+      pwidth = XINT (width);
+    }
+
+  internal_set_frame_size (f, pwidth, pheight, !NILP (pretend));
+  return frame;
+}
+
 DEFUN ("set-frame-position", Fset_frame_position, 3, 3, 0, /*
 Set position of FRAME in pixels to XOFFSET by YOFFSET.
 This is actually the position of the upper left corner of the frame.
@@ -2800,7 +2898,21 @@
     2 * FRAME_THEORETICAL_TOP_TOOLBAR_BORDER_WIDTH (f) +
     2 * FRAME_THEORETICAL_BOTTOM_TOOLBAR_BORDER_WIDTH (f);
 
-  if (pixel_to_char)
+  /* Convert to chars so that the displayable area is pixel_width x
+     pixel_height.
+
+     #### Consider rounding up to 0.5 characters to avoid adding too
+     much space. */
+  if (pixel_to_char > 1)
+    {
+      if (char_width)
+	*char_width = ROUND_UP (*pixel_width, cpw) / cpw;
+      if (char_height)
+	*char_height = ROUND_UP (*pixel_height, cph) / cph;
+    }
+  /* Convert to chars so that the total frame size is pixel_width x
+     pixel_height. */
+  else if (pixel_to_char)
     {
       if (char_width)
 	*char_width = 1 + ((*pixel_width - egw) - bdr - obw) / cpw;
@@ -3362,6 +3474,9 @@
   DEFSUBR (Fset_frame_height);
   DEFSUBR (Fset_frame_width);
   DEFSUBR (Fset_frame_size);
+  DEFSUBR (Fset_frame_pixel_height);
+  DEFSUBR (Fset_frame_pixel_width);
+  DEFSUBR (Fset_frame_pixel_size);
   DEFSUBR (Fset_frame_position);
   DEFSUBR (Fset_frame_pointer);
   DEFSUBR (Fprint_job_page_number);
--- a/src/general-slots.h	Mon Jun 03 12:24:14 2002 +0000
+++ b/src/general-slots.h	Tue Jun 04 06:05:53 2002 +0000
@@ -154,6 +154,8 @@
 SYMBOL (Qinternal);
 SYMBOL_KEYWORD (Q_items);
 SYMBOL_KEYWORD (Q_justify);
+SYMBOL_KEYWORD (Q_vertically_justify);
+SYMBOL_KEYWORD (Q_horizontally_justify);
 SYMBOL (Qkey);
 SYMBOL (Qkey_assoc);
 SYMBOL_KEYWORD (Q_key_sequence);
--- a/src/glyphs-msw.c	Mon Jun 03 12:24:14 2002 +0000
+++ b/src/glyphs-msw.c	Tue Jun 04 06:05:53 2002 +0000
@@ -1954,6 +1954,16 @@
 		    0, 0, 0, 0,
 		    SWP_NOZORDER | SWP_NOSIZE | SWP_NOMOVE
 		    | SWP_SHOWWINDOW | SWP_NOCOPYBITS | SWP_NOACTIVATE);
+
+      /* Doing this once does not seem to be enough, for instance when
+	 mapping the search dialog this gets called four times. If we
+	 only set on the first time through then the subwindow never
+	 gets focus as intended. However, doing this everytime doesn't
+	 seem so bad, after all we only need to redo this after the
+	 focus changes - and if that happens resetting the initial
+	 focus doesn't seem so bad. */
+      if (IMAGE_INSTANCE_WANTS_INITIAL_FOCUS (p))
+	SetFocus (WIDGET_INSTANCE_MSWINDOWS_HANDLE (p));
 #endif
     }
 }
@@ -2038,6 +2048,13 @@
 
 #ifdef HAVE_WIDGETS
 
+/* Account for some of the limitations with widget images. */
+static int
+mswindows_widget_border_width (void)
+{
+  return DEFAULT_WIDGET_BORDER_WIDTH;
+}
+
 /* register widgets into our hashtable so that we can cope with the
    callbacks. The hashtable is weak so deregistration is handled
    automatically */
@@ -2274,11 +2291,6 @@
 		    (IMAGE_INSTANCE_WIDGET_FACE (ii), domain,
 		     IMAGE_INSTANCE_WIDGET_TEXT (ii)),
 		    MAKELPARAM (TRUE, 0));
-#if 0
-  /* #### doesn't work.  need to investigate more closely. */
-  if (IMAGE_INSTANCE_WANTS_INITIAL_FOCUS (ii))
-    SetFocus (wnd);
-#endif
 }
 
 /* Instantiate a native layout widget. */
@@ -2763,7 +2775,7 @@
   default_face_font_info (domain, 0, 0, &height, 0, 0);
   GET_LIST_LENGTH (items, len);
 
-  height = (height + WIDGET_BORDER_HEIGHT * 2 ) * len;
+  height = (height + DEFAULT_WIDGET_BORDER_WIDTH * 2 ) * len;
   IMAGE_INSTANCE_HEIGHT (ii) = height;
 
   /* Now create the widget. */
@@ -2941,6 +2953,7 @@
   CONSOLE_HAS_METHOD (mswindows, locate_pixmap_file);
 #ifdef HAVE_WIDGETS
   CONSOLE_HAS_METHOD (mswindows, widget_query_string_geometry);
+  CONSOLE_HAS_METHOD (mswindows, widget_border_width);
 #endif
 
   /* image methods - printer */
--- a/src/glyphs-widget.c	Mon Jun 03 12:24:14 2002 +0000
+++ b/src/glyphs-widget.c	Tue Jun 04 06:05:53 2002 +0000
@@ -1,5 +1,5 @@
 /* Widget-specific glyph objects.
-   Copyright (C) 1998, 1999, 2000 Andy Piper.
+   Copyright (C) 1998, 1999, 2000, 2002 Andy Piper.
 
 This file is part of XEmacs.
 
@@ -61,6 +61,12 @@
 
 Lisp_Object Qetched_in, Qetched_out, Qbevel_in, Qbevel_out;
 Lisp_Object Qmake_glyph;
+Lisp_Object Vwidget_border_width;
+
+static int widget_border_width (Lisp_Object domain);
+static int widget_spacing (Lisp_Object domain);
+static void widget_query_string_geometry (Lisp_Object string, Lisp_Object face,
+					  int *width, int *height, Lisp_Object domain);
 
 #ifdef DEBUG_WIDGETS
 int debug_widget_instances;
@@ -119,7 +125,15 @@
 static void
 check_valid_justification (Lisp_Object data)
 {
-  if (!EQ (data, Qleft) && !EQ (data, Qright) && !EQ (data, Qcenter))
+  if (!EQ (data, Qleft) 
+      && 
+      !EQ (data, Qright) 
+      && 
+      !EQ (data, Qtop) 
+      && 
+      !EQ (data, Qbottom) 
+      && 
+      !EQ (data, Qcenter))
     invalid_constant ("unknown justification for layout", data);
 }
 
@@ -239,6 +253,54 @@
     }
 }
 
+/* Determine the border with of the widget. */
+static int
+widget_border_width (Lisp_Object domain)
+{
+  /* #### FIXME -- need to use specifiers (Vwidget_border_width) for
+     some portion of this. */
+  if (HAS_DEVMETH_P (DOMAIN_XDEVICE (domain),
+		     widget_border_width))
+    return DEVMETH (DOMAIN_XDEVICE (domain), widget_border_width, ());
+  else 
+    return DEFAULT_WIDGET_BORDER_WIDTH;
+}
+
+static int
+widget_instance_border_width (Lisp_Image_Instance* ii)
+{
+  return widget_border_width (IMAGE_INSTANCE_DOMAIN (ii));
+}
+
+/* #### Its not clear to me what the value of logical_unit_height should
+   be, or whether it should even depend on the current
+   image_instance. It really should probably only depend on the
+   default widget face and the domain, however you can envisage users
+   wanting different logical units for nested layouts - so using the
+   properties of the current lahyout is probably not so dumb. */
+static int
+logical_unit_height (Lisp_Object text, Lisp_Object face, Lisp_Object domain)
+{
+  int charheight = 0;
+  widget_query_string_geometry (text, face, 
+				0, &charheight, domain);
+  /* For the returned value to be useful it needs to be big enough to
+     accomodate the largest single-height widget. This is currently
+     the edit-field. */
+  return charheight + 2 * widget_spacing (domain)
+    + 4 * widget_border_width (domain);
+}
+
+static int
+widget_logical_unit_height (Lisp_Image_Instance* ii)
+{
+  return logical_unit_height (NILP (IMAGE_INSTANCE_WIDGET_TEXT (ii)) ?
+			      IMAGE_INSTANCE_NAME (ii) 
+			      : IMAGE_INSTANCE_WIDGET_TEXT (ii),
+			      IMAGE_INSTANCE_WIDGET_FACE (ii),
+			      IMAGE_INSTANCE_DOMAIN (ii));
+}
+
 /* Wire widget property invocations to specific widgets. The problem
    we are solving here is that when instantiators get converted to
    instances they lose some type information (they just become
@@ -425,7 +487,8 @@
      from lisp does not result in synchronous updates. Do this last so
      that format-specific methods have an opportunity to prevent
      wholesale changes - e.g. rebuilding tabs. */
-  MAYBE_DEVMETH (DOMAIN_XDEVICE (ii->domain), redisplay_widget, (ii));
+  MAYBE_DEVMETH (DOMAIN_XDEVICE (IMAGE_INSTANCE_DOMAIN (ii)),
+		 redisplay_widget, (ii));
 
   /* Pick up the items we recorded earlier. */
   if (IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED (ii))
@@ -450,6 +513,17 @@
     
 }
 
+/* Determine the spacing of the widget. */
+static int
+widget_spacing (Lisp_Object domain)
+{
+  if (HAS_DEVMETH_P (DOMAIN_XDEVICE (domain), widget_spacing))
+    return DEVMETH (DOMAIN_XDEVICE (domain),
+		    widget_spacing, (0));
+  else 
+    return DEFAULT_WIDGET_SPACING;
+}
+
 /* Query for a widgets desired geometry. If no type specific method is
    provided then use the widget text to calculate sizes. */
 static void
@@ -498,9 +572,9 @@
 					    &w, &h, domain);
 	      /* Adjust the size for borders. */
 	      if (IMAGE_INSTANCE_SUBWINDOW_H_RESIZEP (ii))
-		*width = w + 2 * WIDGET_BORDER_WIDTH;
+		*width = w + 2 * widget_instance_border_width (ii);
 	      if (IMAGE_INSTANCE_SUBWINDOW_V_RESIZEP (ii))
-		*height = h +  2 * WIDGET_BORDER_HEIGHT;
+		*height = h +  2 * widget_instance_border_width (ii);
 	    }
 	}
       /* Finish off with dynamic sizing. */
@@ -614,7 +688,8 @@
   IMAGE_INSTANCE_SUBWINDOW_H_RESIZEP (ii) = 1;
   IMAGE_INSTANCE_SUBWINDOW_V_RESIZEP (ii) = 1;
   IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii) = LAYOUT_HORIZONTAL;
-  IMAGE_INSTANCE_SUBWINDOW_JUSTIFY (ii) = 0;
+  IMAGE_INSTANCE_SUBWINDOW_H_JUSTIFY (ii) = 0;
+  IMAGE_INSTANCE_SUBWINDOW_V_JUSTIFY (ii) = 0;
 }
 
 /* Instantiate a button widget. Unfortunately instantiated widgets are
@@ -732,24 +807,44 @@
      size in characters is probably as good as any since the widget
      face is more likely to be proportional and thus give inadequate
      results. Using character sizes can only ever be approximate
-     anyway. */
-  if (tw || th)
+     anyway. :height is measured in logical characters which take into
+     account the borders and spacing on widgets. */
+  if (tw)
+    {
+      int charwidth;
+      default_face_font_info (domain, 0, 0, 0, &charwidth, 0);
+      pw = ROUND_UP (charwidth * tw + 4 * widget_instance_border_width (ii), charwidth);
+    }
+
+  /* For heights the widget face is more appropriate. */
+  if (th == 1) 
     {
-      int charwidth, charheight;
-      default_face_font_info (domain, 0, 0, &charheight, &charwidth, 0);
-      if (tw)
-	pw = charwidth * tw;
-      if (th)
-	ph = charheight * th;
+      int charheight;
+      if (!NILP (IMAGE_INSTANCE_WIDGET_TEXT (ii))) 
+	{
+	  widget_query_string_geometry (IMAGE_INSTANCE_WIDGET_TEXT (ii),
+					IMAGE_INSTANCE_WIDGET_FACE (ii),
+					0, &charheight, domain);
+	}
+      else 
+	{
+	  default_face_font_info (domain, 0, 0, &charheight, 0, 0);
+	}
+      ph = (charheight + 2 * widget_instance_border_width (ii)) * th;
+    }
+  /* For heights > 1 use logical units. */
+  else if (th > 1) 
+    {
+      ph = widget_logical_unit_height (ii) * th;
     }
 
   /* for a widget with an image pick up the dimensions from that */
   if (!NILP (glyph))
     {
       if (!pw)
-	pw = glyph_width (glyph, image_instance) + 2 * WIDGET_BORDER_WIDTH;
+	pw = glyph_width (glyph, image_instance) + 2 * widget_instance_border_width (ii);
       if (!ph)
-	ph = glyph_height (glyph, image_instance) + 2 * WIDGET_BORDER_HEIGHT;
+	ph = glyph_height (glyph, image_instance) + 2 * widget_instance_border_width (ii);
       IMAGE_INSTANCE_SUBWINDOW_V_RESIZEP (ii) = 0;
       IMAGE_INSTANCE_SUBWINDOW_H_RESIZEP (ii) = 0;
     }
@@ -796,7 +891,7 @@
   /* Adjust the size for borders. */
   if (IMAGE_INSTANCE_SUBWINDOW_H_RESIZEP (ii))
     {
-      *width = w + 2 * WIDGET_BORDER_WIDTH;
+      *width = w + 3 * widget_instance_border_width (ii);
 
       if (EQ (XGUI_ITEM (IMAGE_INSTANCE_WIDGET_ITEM (ii))->style, Qradio)
 	  ||
@@ -805,7 +900,25 @@
 	*width += 12;
     }
   if (IMAGE_INSTANCE_SUBWINDOW_V_RESIZEP (ii))
-    *height = h +  2 * WIDGET_BORDER_HEIGHT;
+    *height = h +  3 * widget_instance_border_width (ii);
+}
+
+/* Get the geometry of an edit field. */
+static void
+edit_field_query_geometry (Lisp_Object image_instance,
+		       int* width, int* height,
+		       enum image_instance_geometry disp, Lisp_Object domain)
+{
+  Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
+  int w, h;
+  widget_query_string_geometry (IMAGE_INSTANCE_WIDGET_TEXT (ii),
+				IMAGE_INSTANCE_WIDGET_FACE (ii),
+				&w, &h, domain);
+  /* Adjust the size for borders. */
+  if (IMAGE_INSTANCE_SUBWINDOW_H_RESIZEP (ii))
+    *width = w + 4 * widget_instance_border_width (ii);
+  if (IMAGE_INSTANCE_SUBWINDOW_V_RESIZEP (ii))
+    *height = h + 4 * widget_instance_border_width (ii);
 }
 
 /* tree-view geometry - get the height right */
@@ -828,6 +941,7 @@
   if (*height)
     {
       int len, h;
+      /* #### widget face would be better here. */
       default_face_font_info (domain, 0, 0, &h, 0, 0);
       GET_LIST_LENGTH (items, len);
       *height = len * h;
@@ -851,11 +965,11 @@
       int h, w;
 
       widget_query_string_geometry (XGUI_ITEM (XCAR (rest))->name,
-				    IMAGE_INSTANCE_WIDGET_FACE (ii),
-				    &w, &h, domain);
-      tw += 5 * WIDGET_BORDER_WIDTH; /* some bias */
+			     IMAGE_INSTANCE_WIDGET_FACE (ii),
+			     &w, &h, domain);
+      tw += 5 * widget_instance_border_width (ii); /* some bias */
       tw += w;
-      th = max (th, h + 2 * WIDGET_BORDER_HEIGHT);
+      th = max (th, h + 2 * widget_instance_border_width (ii));
     }
 
   /* Fixup returned values depending on orientation. */
@@ -965,14 +1079,50 @@
   Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
   Lisp_Object items = find_keyword_in_vector (instantiator, Q_items);
   Lisp_Object border_inst = find_keyword_in_vector (instantiator, Q_border);
+  Lisp_Object justify = find_keyword_in_vector (instantiator, Q_justify);
+  Lisp_Object hjustify = find_keyword_in_vector (instantiator, Q_horizontally_justify);
+  Lisp_Object vjustify = find_keyword_in_vector (instantiator, Q_vertically_justify);
   Lisp_Object border = Qnil;
   Lisp_Object children = IMAGE_INSTANCE_LAYOUT_CHILDREN (ii);
   int structure_changed = 0;
   struct gcpro gcpro1;
 
+  /* Pick up horizontal justification, left is the default.*/
+  if (!NILP (hjustify)) 
+    {
+      if (EQ (hjustify, Qright) || EQ (hjustify, Qbottom))
+	IMAGE_INSTANCE_SUBWINDOW_H_JUSTIFY (ii) = LAYOUT_JUSTIFY_RIGHT;
+      else if (EQ (hjustify, Qcenter))
+	IMAGE_INSTANCE_SUBWINDOW_H_JUSTIFY (ii) = LAYOUT_JUSTIFY_CENTER;
+    }
+  /* If not set use general justification. */
+  else if (!NILP (justify))
+    {
+      if (EQ (justify, Qright) || EQ (justify, Qbottom))
+	IMAGE_INSTANCE_SUBWINDOW_H_JUSTIFY (ii) = LAYOUT_JUSTIFY_RIGHT;
+      else if (EQ (justify, Qcenter))
+	IMAGE_INSTANCE_SUBWINDOW_H_JUSTIFY (ii) = LAYOUT_JUSTIFY_CENTER;
+    }
+
+  /* Pick up vertical justification, top is the default. */
+  if (!NILP (vjustify)) 
+    {
+      if (EQ (vjustify, Qright) || EQ (vjustify, Qbottom))
+	IMAGE_INSTANCE_SUBWINDOW_V_JUSTIFY (ii) = LAYOUT_JUSTIFY_BOTTOM;
+      else if (EQ (vjustify, Qcenter))
+	IMAGE_INSTANCE_SUBWINDOW_V_JUSTIFY (ii) = LAYOUT_JUSTIFY_CENTER;
+    }
+  /* If not set use general justification. */
+  else if (!NILP (justify)) 
+    {
+      if (EQ (justify, Qright) || EQ (justify, Qbottom))
+	IMAGE_INSTANCE_SUBWINDOW_V_JUSTIFY (ii) = LAYOUT_JUSTIFY_BOTTOM;
+      else if (EQ (justify, Qcenter))
+	IMAGE_INSTANCE_SUBWINDOW_V_JUSTIFY (ii) = LAYOUT_JUSTIFY_CENTER;
+    }
+
   /* We want to avoid consing if we can. This is quite awkward because
      we have to deal with the border as well as the items. */
-
   GCPRO1 (border);
 
   if (INTP (IMAGE_INSTANCE_LAYOUT_BORDER (ii)))
@@ -1124,7 +1274,30 @@
    glyphs are cached on a device basis like most other glyphs. Instead
    they should be cached per-window and then the instance would be
    fixed and we wouldn't have to mess around with font metrics and the
-   rest. */
+   rest. 
+
+   Another sizing problem is alignment. We provide layout widgets that
+   allow users to stack widgets vertically or horizontally. These
+   layouts also allow the widgets to be centered (space evenly
+   distributed), left or right justified (fixed spacing widgets
+   stacked against the left, righ, top or bottom edge). Unfortunately
+   this doesn't allow widgets in different layouts to be aligned. For
+   instance how should the search dialog be organized for alignment?
+   The obvious choice of two vertical columns does not work since the
+   size of individual widgets will affect where they get placed. The
+   same is true for several rows of widgets. To solve this problem we
+   introduce the notion of `logical_unit_height'. This is a size
+   quantity that is designed to be big enough to accomodate the
+   largest `single height unit'. The function
+   widget_logical_unit_height() determines the value of this in
+   pixels. It is dependent on the widget face and some combination of
+   spacing and border-width. Thus if users specify left or right
+   justification in a vertical layout they get something in logical
+   units. To simplify this the functions
+   `widget-logical-to-character-height' and
+   `widget-logical-to-character-width' allow conversion between
+   characters and logical units so that frames can be sized
+   appropriately. */
 
 /* Query the geometry of a layout widget. We assume that we can only
    get here if the size is not already fixed. */
@@ -1136,7 +1309,7 @@
   Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
   Lisp_Object items = IMAGE_INSTANCE_LAYOUT_CHILDREN (ii), rest;
   int maxph = 0, maxpw = 0, nitems = 0, ph_adjust = 0;
-  int gheight, gwidth;
+  int gheight, gwidth, luh;
 
   /* If we are not initialized then we won't have any children. */
   if (!IMAGE_INSTANCE_INITIALIZED (ii))
@@ -1152,12 +1325,14 @@
       !IMAGE_INSTANCE_SUBWINDOW_H_RESIZEP (ii))
     return;
 
+  luh = widget_logical_unit_height (ii);
+
   /* Pick up the border text if we have one. */
   if (INTP (IMAGE_INSTANCE_LAYOUT_BORDER (ii)))
     {
       glyph_query_geometry (XCAR (items), &gwidth, &gheight, disp,
 			    image_instance);
-      ph_adjust = gheight / 2;
+      ph_adjust = gheight;
       items = XCDR (items);
     }
 
@@ -1168,8 +1343,7 @@
       glyph_query_geometry (glyph, &gwidth, &gheight, disp, image_instance);
 
       nitems ++;
-      if (IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii)
-	  == LAYOUT_HORIZONTAL)
+      if (IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii) == LAYOUT_HORIZONTAL)
 	{
 	  maxph = max (maxph, gheight);
 	  maxpw += gwidth;
@@ -1190,13 +1364,16 @@
       if (INTP (dynamic_width))
 	*width = XINT (dynamic_width);
     }
-  else if (IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii)
-	   == LAYOUT_HORIZONTAL)
-    *width = maxpw + ((nitems + 1) * WIDGET_BORDER_WIDTH +
-		      IMAGE_INSTANCE_MARGIN_WIDTH (ii)) * 2;
+  else if (IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii) == LAYOUT_HORIZONTAL) 
+    {
+      *width = maxpw + ((nitems + 1) * widget_instance_border_width (ii) +
+			IMAGE_INSTANCE_MARGIN_WIDTH (ii)) * 2;
+    }
   else
-    *width = maxpw + 2 * (WIDGET_BORDER_WIDTH * 2 +
-			  IMAGE_INSTANCE_MARGIN_WIDTH (ii));
+    {
+      *width = maxpw + 2 * (widget_instance_border_width (ii) * 2 +
+			    IMAGE_INSTANCE_MARGIN_WIDTH (ii));
+    }
 
   /* Work out vertical spacings. */
   if (!NILP (IMAGE_INSTANCE_WIDGET_HEIGHT_SUBR (ii)))
@@ -1206,13 +1383,23 @@
       if (INTP (dynamic_height))
 	*height = XINT (dynamic_height);
     }
-  else if (IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii)
-	   == LAYOUT_VERTICAL)
-    *height = maxph + ((nitems + 1) * WIDGET_BORDER_HEIGHT +
-		       IMAGE_INSTANCE_MARGIN_WIDTH (ii)) * 2 + ph_adjust;
+  else if (IMAGE_INSTANCE_SUBWINDOW_LOGICAL_LAYOUT (ii))
+    {
+      *height = nitems * luh + ph_adjust;
+    }
+  else if (IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii) == LAYOUT_VERTICAL)
+    {
+      *height = maxph + ((nitems + 1) * widget_instance_border_width (ii) +
+			 IMAGE_INSTANCE_MARGIN_WIDTH (ii)) * 2 + ph_adjust;
+    }
   else
-    *height = maxph + (2 * WIDGET_BORDER_HEIGHT +
-		       IMAGE_INSTANCE_MARGIN_WIDTH (ii)) * 2 + ph_adjust;
+    {
+      *height = maxph + (2 * widget_instance_border_width (ii) +
+			 IMAGE_INSTANCE_MARGIN_WIDTH (ii)) * 2 + ph_adjust;
+    }
+#ifdef DEBUG_WIDGET_OUTPUT
+  stderr_out ("layout wants %dx%d\n", *width, *height);
+#endif
 }
 
 int
@@ -1226,20 +1413,34 @@
   int x, y, maxph = 0, maxpw = 0, nitems = 0,
     horiz_spacing, vert_spacing, ph_adjust = 0;
   int gheight, gwidth;
+  /* See comments in widget_logical_unit_height(). */
+  int luh = widget_logical_unit_height (ii);
 
   /* If we are not initialized then we won't have any children. */
   if (!IMAGE_INSTANCE_INITIALIZED (ii))
       return 0;
 
-  /* Pick up the border text if we have one. */
+#ifdef DEBUG_WIDGET_OUTPUT
+  stderr_out ("layout output %dx%d\n", width, height);
+#endif
+
+  /* Pick up the border text if we have one. A border can have the
+     values Qetched_in, Qetched_out, Qbevel_in, Qbevel_out or an
+     integer. The first four just affect the display properties of the
+     border that is drawn. The last is an offset and implies that the
+     first item in the list of subcontrols is a text control that
+     should be displayed on the border. */
   if (INTP (IMAGE_INSTANCE_LAYOUT_BORDER (ii)))
     {
       Lisp_Object border = XCAR (items);
       items = XCDR (items);
       glyph_query_geometry (border, &gwidth, &gheight,
 			    IMAGE_DESIRED_GEOMETRY, image_instance);
-      ph_adjust = gheight / 2;
-      IMAGE_INSTANCE_LAYOUT_BORDER (ii) = make_int (ph_adjust);
+      /* The vertical offset for subsequent items is the full height
+	 of the border glyph. */
+      ph_adjust = gheight;
+      /* The offset for the border is half the glyph height. */
+      IMAGE_INSTANCE_LAYOUT_BORDER (ii) = make_int (gheight / 2);
 
       /* #### Really, what should this be? */
       glyph_do_layout (border, gwidth, gheight, 10, 0,
@@ -1271,10 +1472,10 @@
   if (width < maxpw)
     /* The user wants a smaller space than the largest item, so we
        just provide default spacing and will let the output routines
-       clip.. */
-    horiz_spacing = WIDGET_BORDER_WIDTH * 2;
+       clip. */
+    horiz_spacing = widget_spacing (IMAGE_INSTANCE_DOMAIN (ii));
   else if (IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii)
-	   == LAYOUT_HORIZONTAL)
+	   == LAYOUT_HORIZONTAL) 
     /* We have a larger area to display in so distribute the space
        evenly. */
     horiz_spacing = (width - (maxpw +
@@ -1284,18 +1485,30 @@
     horiz_spacing = (width - maxpw) / 2
       - IMAGE_INSTANCE_MARGIN_WIDTH (ii);
 
+  /* We are trying here to get widgets to line up when they are left
+     or right justified vertically. This means that we must position
+     widgets on logical unit boundaries, even though their height may
+     be greater or less than a logical unit. In order to avoid
+     clipping we need to determine how big the widget wants to be and
+     then allocate as many logical units as necessary in order to
+     accommodate it. */
   if (height < maxph)
-    vert_spacing = WIDGET_BORDER_HEIGHT * 2;
+    vert_spacing = widget_spacing (IMAGE_INSTANCE_DOMAIN (ii)) * 2;
   else if (IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii)
 	   == LAYOUT_VERTICAL)
-    vert_spacing = (height - (maxph + ph_adjust +
-			      IMAGE_INSTANCE_MARGIN_WIDTH (ii) * 2))
-      / (nitems + 1);
+    {
+      if (!IMAGE_INSTANCE_SUBWINDOW_V_CENTERED (ii))
+	vert_spacing = widget_spacing (IMAGE_INSTANCE_DOMAIN (ii)) * 2;
+      else
+	vert_spacing = (height - (maxph + ph_adjust +
+				  IMAGE_INSTANCE_MARGIN_WIDTH (ii) * 2))
+	  / (nitems + 1);
+    }
   else
     vert_spacing = (height - (maxph + ph_adjust)) / 2
       - IMAGE_INSTANCE_MARGIN_WIDTH (ii);
 
-  y = vert_spacing + ph_adjust + IMAGE_INSTANCE_MARGIN_WIDTH (ii);
+  y = yoffset = vert_spacing + ph_adjust + IMAGE_INSTANCE_MARGIN_WIDTH (ii);
   x = horiz_spacing + IMAGE_INSTANCE_MARGIN_WIDTH (ii);
 
   /* Now flip through putting items where we want them, paying
@@ -1308,37 +1521,37 @@
       glyph_query_geometry (glyph, &gwidth, &gheight,
 			    IMAGE_DESIRED_GEOMETRY, image_instance);
 
-      if (IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii)
-	  == LAYOUT_HORIZONTAL)
+      if (IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii) == LAYOUT_HORIZONTAL)
 	{
-	  if (IMAGE_INSTANCE_SUBWINDOW_JUSTIFY (ii)
-	      == LAYOUT_JUSTIFY_RIGHT)
+	  if (IMAGE_INSTANCE_SUBWINDOW_BOTTOM_JUSTIFIED (ii))
 	    y = height - (gheight + vert_spacing);
-	  if (IMAGE_INSTANCE_SUBWINDOW_JUSTIFY (ii)
-	      == LAYOUT_JUSTIFY_CENTER)
+	  else if (IMAGE_INSTANCE_SUBWINDOW_V_CENTERED (ii))
 	    y = (height - gheight) / 2;
 	}
       else
 	{
-	  if (IMAGE_INSTANCE_SUBWINDOW_JUSTIFY (ii)
-	      == LAYOUT_JUSTIFY_RIGHT)
+	  if (IMAGE_INSTANCE_SUBWINDOW_RIGHT_JUSTIFIED (ii))
 	    x = width - (gwidth + horiz_spacing);
-	  if (IMAGE_INSTANCE_SUBWINDOW_JUSTIFY (ii)
-	      == LAYOUT_JUSTIFY_CENTER)
+	  else if (IMAGE_INSTANCE_SUBWINDOW_H_CENTERED (ii))
 	    x = (width - gwidth) / 2;
 	}
 
       /* Now layout subwidgets if they require it. */
       glyph_do_layout (glyph, gwidth, gheight, x, y, image_instance);
 
-      if (IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii)
-	  == LAYOUT_HORIZONTAL)
+      if (IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii) == LAYOUT_HORIZONTAL)
 	{
 	  x += (gwidth + horiz_spacing);
 	}
       else
 	{
 	  y += (gheight + vert_spacing);
+	  if (!IMAGE_INSTANCE_SUBWINDOW_V_CENTERED (ii))
+	    {
+	      /* justified, vertical layout, try and align on logical unit
+		 boundaries. */
+	      y = ROUND_UP (y - yoffset, luh) + yoffset;
+	    }
 	}
 
     }
@@ -1403,6 +1616,67 @@
   return 1;
 }
 
+DEFUN ("widget-logical-to-character-width", Fwidget_logical_to_character_width, 1, 3, 0, /*
+Convert the width in logical widget units to characters.
+Logical widget units do not take into account adjusments made for
+layout borders, so this adjusment is approximated.
+*/
+       (width, face, domain))
+{
+  int w, neww, charwidth;
+  int border_width = DEFAULT_WIDGET_BORDER_WIDTH;
+
+  if (NILP (domain))
+    domain = Fselected_frame (Qnil);
+
+  CHECK_INT (width);
+  w = XINT (width);
+  
+  if (HAS_DEVMETH_P (DOMAIN_XDEVICE (domain), widget_border_width))
+    border_width = DEVMETH (DOMAIN_XDEVICE (domain), widget_border_width, ());
+
+  default_face_font_info (domain, 0, 0, 0, &charwidth, 0);
+  neww = ROUND_UP (charwidth * w + 4 * border_width + 2 * widget_spacing (domain), 
+		charwidth) / charwidth;
+  
+  return make_int (neww);
+}
+
+DEFUN ("widget-logical-to-character-height", Fwidget_logical_to_character_height, 1, 3, 0, /*
+Convert the height in logical widget units to characters.
+Logical widget units do not take into account adjusments made for
+layout borders, so this adjustment is approximated.
+
+If the components of a widget layout are justified to the top or the
+bottom then they are aligned in terms of `logical units'. This is a
+size quantity that is designed to be big enough to accomodate the
+largest `single height' widget. It is dependent on the widget face and
+some combination of spacing and border-width. Thus if you specify top
+or bottom justification in a vertical layout the subcontrols are laid
+out one per logical unit. This allows adjoining layouts to have
+identical alignment for their subcontrols.
+
+Since frame sizes are measured in characters, this function allows you
+to do appropriate conversion between logical units and characters.
+*/
+       (height, face, domain))
+{
+  int h, newh, charheight;
+  
+  CHECK_INT (height);
+  if (NILP (domain))
+    domain = Fselected_frame (Qnil);
+
+  h = XINT (height);
+
+  default_face_font_info (domain, 0, 0, &charheight, 0, 0);
+  newh = ROUND_UP (logical_unit_height (Fsymbol_name (Qwidget), 
+					Vwidget_face, domain) * h, charheight)
+    / charheight;
+
+  return make_int (newh);
+}
+
 
 /************************************************************************/
 /*                            initialization                            */
@@ -1416,6 +1690,9 @@
   DEFSYMBOL (Qbevel_in);
   DEFSYMBOL (Qbevel_out);
   DEFSYMBOL (Qmake_glyph);
+
+  DEFSUBR (Fwidget_logical_to_character_height);
+  DEFSUBR (Fwidget_logical_to_character_width);
 }
 
 #define VALID_GUI_KEYWORDS(type) do {					      \
@@ -1479,6 +1756,7 @@
   IIFORMAT_HAS_SHARED_METHOD (edit_field, instantiate, widget);
   IIFORMAT_HAS_SHARED_METHOD (edit_field, post_instantiate, widget);
   IIFORMAT_HAS_SHARED_METHOD (edit_field, governing_domain, subwindow);
+  IIFORMAT_HAS_METHOD (edit_field, query_geometry);
   VALID_WIDGET_KEYWORDS (edit_field);
   VALID_GUI_KEYWORDS (edit_field);
 }
@@ -1576,6 +1854,8 @@
   VALID_WIDGET_KEYWORDS (layout);					   \
   IIFORMAT_VALID_KEYWORD (layout, Q_orientation, check_valid_orientation); \
   IIFORMAT_VALID_KEYWORD (layout, Q_justify, check_valid_justification);   \
+  IIFORMAT_VALID_KEYWORD (layout, Q_vertically_justify, check_valid_justification);   \
+  IIFORMAT_VALID_KEYWORD (layout, Q_horizontally_justify, check_valid_justification);   \
   IIFORMAT_VALID_KEYWORD (layout, Q_border, check_valid_border);	   \
   IIFORMAT_VALID_KEYWORD (layout, Q_margin_width, check_valid_int);	   \
   IIFORMAT_VALID_KEYWORD (layout, Q_items,				   \
@@ -1644,3 +1924,15 @@
 {
   reinit_vars_of_glyphs_widget ();
 }
+
+
+void
+specifier_vars_of_glyphs_widget (void)
+{
+  DEFVAR_SPECIFIER ("widget-border-width",
+		    &Vwidget_border_width /*
+*Border width of widgets.
+This is a specifier; use `set-specifier' to change it.
+*/ );
+  Vwidget_border_width = Fmake_specifier (Qnatnum);
+}
--- a/src/glyphs-x.c	Mon Jun 03 12:24:14 2002 +0000
+++ b/src/glyphs-x.c	Tue Jun 04 06:05:53 2002 +0000
@@ -4,7 +4,7 @@
    Copyright (C) 1995 Tinker Systems
    Copyright (C) 1995, 1996, 2001, 2002 Ben Wing
    Copyright (C) 1995 Sun Microsystems
-   Copyright (C) 1999, 2000 Andy Piper
+   Copyright (C) 1999, 2000, 2002 Andy Piper
 
 This file is part of XEmacs.
 
@@ -150,6 +150,8 @@
 #endif
 void
 emacs_Xt_handle_widget_losing_focus (struct frame* f, Widget losing_widget);
+void
+enqueue_focus_event (Widget wants_it, Lisp_Object frame, int in_p);
 
 #include "bitmaps.h"
 
@@ -2064,6 +2066,14 @@
 		    -dga->xoffset, -dga->yoffset);
       if (!IMAGE_INSTANCE_SUBWINDOW_DISPLAYEDP (p))
 	XtMapWidget (IMAGE_INSTANCE_X_CLIPWIDGET (p));
+      /* See comments in glyphs-msw.c about keyboard focus. */
+      if (IMAGE_INSTANCE_WANTS_INITIAL_FOCUS (p)) {
+	/* #### FIXME to pop-up the find dialog we map the text-field
+	   seven times! This doesn't show on a fast linux box but does
+	   under X on windows. */
+	enqueue_focus_event (IMAGE_INSTANCE_X_WIDGET_ID (p),
+			     IMAGE_INSTANCE_FRAME (p), 1);
+      }
     }
 }
 
@@ -2237,6 +2247,14 @@
   IMAGE_INSTANCE_SUBWINDOW_ID (ii) = (void*)win;
 }
 
+/* Account for some of the limitations with widget images. */
+static int
+x_widget_border_width (void)
+{
+  return DEFAULT_WIDGET_BORDER_WIDTH * 2;
+}
+
+
 #if 0
 /* #### Should this function exist? If there's any doubt I'm not implementing it --andyp */
 DEFUN ("change-subwindow-property", Fchange_subwindow_property, 3, 3, 0, /*
@@ -2401,6 +2419,10 @@
 
   free_widget_value_tree (clip_wv);
 
+  /* create a sensible name. */
+  if (wv->name == 0 || strcmp(wv->name, "") == 0)
+    wv->name = xstrdup (type);
+
   /* copy any args we were given */
   ac = 0;
   lw_add_value_args_to_args (wv, al, &ac);
@@ -2772,6 +2794,7 @@
   CONSOLE_HAS_METHOD (x, map_subwindow);
   CONSOLE_HAS_METHOD (x, redisplay_widget);
   CONSOLE_HAS_METHOD (x, redisplay_subwindow);
+  CONSOLE_HAS_METHOD (x, widget_border_width);
 }
 
 void
--- a/src/glyphs.h	Mon Jun 03 12:24:14 2002 +0000
+++ b/src/glyphs.h	Tue Jun 04 06:05:53 2002 +0000
@@ -97,8 +97,9 @@
 #define IMAGE_UNSPECIFIED_GEOMETRY -1
 #define IMAGE_UNCHANGED_GEOMETRY -2
 
-#define WIDGET_BORDER_HEIGHT 4
-#define WIDGET_BORDER_WIDTH 4
+#define DEFAULT_WIDGET_BORDER_WIDTH 2
+#define DEFAULT_WIDGET_SPACING 3
+#define DEFAULT_WIDGET_SHADOW_WIDTH 2
 
 enum governing_domain
 {
@@ -598,7 +599,8 @@
       unsigned int v_resize : 1;	/* Whether the vsize is allowed to change. */
       unsigned int h_resize : 1;	/* Whether the hsize is allowed to change. */
       unsigned int orientation : 1; /* Vertical or horizontal. */
-      unsigned int justification : 2; /* Left, right or center. */
+      unsigned int h_justification : 2; /* left, right or center. */
+      unsigned int v_justification : 2; /* top, bottom or center. */
       /* Face for colors and font. We specify this here because we
 	 want people to be able to put :face in the instantiator
 	 spec. Using glyph-face is more inconvenient, although more
@@ -627,7 +629,9 @@
 #define LAYOUT_VERTICAL	1
 
 #define LAYOUT_JUSTIFY_LEFT 0
+#define LAYOUT_JUSTIFY_TOP 0
 #define LAYOUT_JUSTIFY_RIGHT 1
+#define LAYOUT_JUSTIFY_BOTTOM 1
 #define LAYOUT_JUSTIFY_CENTER 2
 
 #define IMAGE_INSTANCE_HASH_DEPTH 0
@@ -719,8 +723,26 @@
 ((i)->u.subwindow.h_resize)
 #define IMAGE_INSTANCE_SUBWINDOW_ORIENT(i) \
 ((i)->u.subwindow.orientation)
-#define IMAGE_INSTANCE_SUBWINDOW_JUSTIFY(i) \
-((i)->u.subwindow.justification)
+#define IMAGE_INSTANCE_SUBWINDOW_H_JUSTIFY(i) \
+((i)->u.subwindow.h_justification)
+#define IMAGE_INSTANCE_SUBWINDOW_V_JUSTIFY(i) \
+((i)->u.subwindow.v_justification)
+#define IMAGE_INSTANCE_SUBWINDOW_RIGHT_JUSTIFIED(i) \
+ (IMAGE_INSTANCE_SUBWINDOW_H_JUSTIFY(i) == LAYOUT_JUSTIFY_RIGHT)
+#define IMAGE_INSTANCE_SUBWINDOW_LEFT_JUSTIFIED(i) \
+ (IMAGE_INSTANCE_SUBWINDOW_H_JUSTIFY(i) == LAYOUT_JUSTIFY_LEFT)
+#define IMAGE_INSTANCE_SUBWINDOW_TOP_JUSTIFIED(i) \
+ (IMAGE_INSTANCE_SUBWINDOW_V_JUSTIFY(i) == LAYOUT_JUSTIFY_TOP)
+#define IMAGE_INSTANCE_SUBWINDOW_BOTTOM_JUSTIFIED(i) \
+ (IMAGE_INSTANCE_SUBWINDOW_V_JUSTIFY(i) == LAYOUT_JUSTIFY_BOTTOM)
+#define IMAGE_INSTANCE_SUBWINDOW_H_CENTERED(i) \
+ (IMAGE_INSTANCE_SUBWINDOW_H_JUSTIFY(i) == LAYOUT_JUSTIFY_CENTER)
+#define IMAGE_INSTANCE_SUBWINDOW_V_CENTERED(i) \
+ (IMAGE_INSTANCE_SUBWINDOW_V_JUSTIFY(i) == LAYOUT_JUSTIFY_CENTER)
+#define IMAGE_INSTANCE_SUBWINDOW_LOGICAL_LAYOUT(i) \
+ (IMAGE_INSTANCE_SUBWINDOW_ORIENT (i) \
+  == LAYOUT_VERTICAL && !IMAGE_INSTANCE_SUBWINDOW_V_CENTERED (i))
+
 #define IMAGE_INSTANCE_SUBWINDOW_FACE(i) \
 ((i)->u.subwindow.face)
 
@@ -1161,4 +1183,6 @@
 			      int height);
 extern int hold_ignored_expose_registration;
 
+#define ROUND_UP(arg, unit) (((int)((arg) + (unit) - 1) / (int)(unit)) * (int)(unit))
+
 #endif /* INCLUDED_glyphs_h_ */
--- a/src/process.c	Mon Jun 03 12:24:14 2002 +0000
+++ b/src/process.c	Tue Jun 04 06:05:53 2002 +0000
@@ -63,7 +63,7 @@
 #include "systty.h"
 #include "syswait.h"
 
-Lisp_Object Qprocessp, Qprocess_live_p;
+Lisp_Object Qprocessp, Qprocess_live_p, Qprocess_readable_p;
 
 /* Process methods */
 struct process_methods the_process_methods;
@@ -300,6 +300,29 @@
     ? Qt : Qnil;
 }
 
+#if 0
+/* This is a reasonable definition for this new primitive.  Kyle sez:
+
+   "The patch looks OK to me except for the creation and exporting of the
+   Fprocess_readable_p function.  I don't think a new Lisp function
+   should be created until we know something actually needs it.  If
+   we later want to give process-readable-p different semantics it
+   may be hard to do it and stay compatible with what we hastily
+   create today."
+
+   He's right, not yet.  Let's discuss the semantics on XEmacs Design
+   before enabling this.
+*/
+DEFUN ("process-readable-p", Fprocess_readable_p, 1, 1, 0, /*
+Return t if OBJECT is a process from which input may be available.
+*/
+       (object))
+{
+  return PROCESSP (object) && PROCESS_READABLE_P (XPROCESS (object))
+    ? Qt : Qnil;
+}
+#endif
+
 DEFUN ("process-list", Fprocess_list, 0, 0, 0, /*
 Return a list of all processes.
 */
@@ -616,7 +639,7 @@
 				   separate_err));
 
   p->pid = make_int (pid);
-  if (PROCESS_LIVE_P (p))
+  if (PROCESS_READABLE_P (p))
     event_stream_select_process (p, 1, 1);
 }
 
@@ -1044,7 +1067,7 @@
      Really, the loop in execute_internal_event() should check itself
      for a process-filter change, like in status_notify(); but the
      struct Lisp_Process is not exported outside of this file. */
-  if (!PROCESS_LIVE_P (p))
+  if (!PROCESS_READABLE_P (p))
     {
       errno = 0;
       return -1; /* already closed */
@@ -1274,7 +1297,7 @@
   CHECK_PROCESS (process);
   if (set_stderr && !XPROCESS (process)->separate_stderr)
     invalid_change ("stdout and stderr not separate", process);
-  if (PROCESS_LIVE_P (XPROCESS (process)))
+  if (PROCESS_READABLE_P (XPROCESS (process))) 
     {
       if (EQ (filter, Qt))
 	event_stream_unselect_process (XPROCESS (process), !set_stderr,
@@ -1397,7 +1420,7 @@
        (process))
 {
   process = get_process (process);
-  CHECK_LIVE_PROCESS (process);
+  CHECK_READABLE_PROCESS (process);
   return (coding_stream_detected_coding_system
 	  (XLSTREAM (XPROCESS (process)->coding_instream)));
 }
@@ -1419,7 +1442,7 @@
        (process))
 {
   process = get_process (process);
-  CHECK_LIVE_PROCESS (process);
+  CHECK_READABLE_PROCESS (process);
   return Fcons (coding_stream_detected_coding_system
 		(XLSTREAM (XPROCESS (process)->coding_instream)),
 		coding_stream_coding_system
@@ -1435,7 +1458,7 @@
 {
   codesys = get_coding_system_for_text_file (codesys, 1);
   process = get_process (process);
-  CHECK_LIVE_PROCESS (process);
+  CHECK_READABLE_PROCESS (process);
 
   set_coding_stream_coding_system
     (XLSTREAM (XPROCESS (process)->coding_instream), codesys);
@@ -2496,7 +2519,10 @@
   DEFSYMBOL (Qstop);
   DEFSYMBOL (Qopen);
   DEFSYMBOL (Qclosed);
-
+#if 0
+  /* see comment at Fprocess_readable_p */
+  DEFSYMBOL (&Qprocess_readable_p);
+#endif
   DEFSYMBOL (Qtcp);
   DEFSYMBOL (Qudp);
 
@@ -2509,6 +2535,10 @@
 
   DEFSUBR (Fprocessp);
   DEFSUBR (Fprocess_live_p);
+#if 0
+  /* see comment at Fprocess_readable_p */
+  DEFSUBR (Fprocess_readable_p);
+#endif
   DEFSUBR (Fget_process);
   DEFSUBR (Fget_buffer_process);
   DEFSUBR (Fdelete_process);
--- a/src/process.h	Mon Jun 03 12:24:14 2002 +0000
+++ b/src/process.h	Tue Jun 04 06:05:53 2002 +0000
@@ -44,7 +44,8 @@
 #define wrap_process(p) wrap_record (p, process)
 #define PROCESSP(x) RECORDP (x, process)
 #define CHECK_PROCESS(x) CHECK_RECORD (x, process)
-#define PROCESS_LIVE_P(x) (!NILP ((x)->pipe_instream))
+#define PROCESS_LIVE_P(x) (EQ ((x)->status_symbol, Qrun))
+#define PROCESS_READABLE_P(x) (!NILP ((x)->pipe_instream))
 
 #define CHECK_LIVE_PROCESS(x) do {			\
   CHECK_PROCESS (x);					\
@@ -52,6 +53,12 @@
     dead_wrong_type_argument (Qprocess_live_p, (x));	\
 } while (0)
 
+#define CHECK_READABLE_PROCESS(x) do {			\
+  CHECK_PROCESS (x);					\
+  if (! PROCESS_READABLE_P (XPROCESS (x)))		\
+    dead_wrong_type_argument (Qprocess_readable_p, (x));	\
+} while (0)
+
 EXFUN (Fprocess_kill_without_query, 2);
 EXFUN (Fprocess_id, 1);
 
--- a/src/redisplay-output.c	Mon Jun 03 12:24:14 2002 +0000
+++ b/src/redisplay-output.c	Tue Jun 04 06:05:53 2002 +0000
@@ -2,7 +2,7 @@
    Copyright (C) 1994, 1995 Board of Trustees, University of Illinois.
    Copyright (C) 1995, 1996, 2002 Ben Wing.
    Copyright (C) 1996 Chuck Thompson.
-   Copyright (C) 1999 Andy Piper.
+   Copyright (C) 1999, 2002 Andy Piper.
 
 This file is part of XEmacs.
 
@@ -1432,17 +1432,22 @@
 	  int edges = 0;
 	  enum edge_style style;
 	  int ypos = db->ypos;
+	  int xpos = db->xpos;
 	  int height = dga->height;
+	  int width = dga->width;
 
-	  if (dga->xoffset >= 0)
+	  /* The bevel_area routines always draw in from the specified
+	     area so there is no need to adjust the displayed area to
+	     make sure that the lines are visible. */
+	  if (dga->xoffset >= 0) 
 	    edges |= EDGE_LEFT;
-	  if (dga->width - dga->xoffset == layout_width)
+	  if (dga->width - dga->xoffset == layout_width) 
 	    edges |= EDGE_RIGHT;
-	  if (dga->yoffset >= 0)
+	  if (dga->yoffset >= 0) 
 	    edges |= EDGE_TOP;
 	  if (dga->height - dga->yoffset == layout_height)
 	    edges |= EDGE_BOTTOM;
-
+	  
 	  if (EQ (IMAGE_INSTANCE_LAYOUT_BORDER (p), Qetched_in))
 	    style = EDGE_ETCHED_IN;
 	  else if (EQ (IMAGE_INSTANCE_LAYOUT_BORDER (p), Qetched_out))
@@ -1462,9 +1467,8 @@
 	    style = EDGE_BEVEL_OUT;
 
 	  MAYBE_DEVMETH (d, bevel_area,
-			 (w, findex, db->xpos,
-			  ypos,
-			  dga->width, height, 2, edges, style));
+			 (w, findex, xpos, ypos, width, height,
+			  DEFAULT_WIDGET_SHADOW_WIDTH, edges, style));
 	}
     }
 
--- a/src/s/linux.h	Mon Jun 03 12:24:14 2002 +0000
+++ b/src/s/linux.h	Tue Jun 04 06:05:53 2002 +0000
@@ -86,8 +86,11 @@
 #if	defined(__linux__) && defined(powerpc)	/*Added by Fukui*/
 #define START_FILES		/*Added by Fukui*/
 #else				/*Added by Fukui*/
-
+#if defined __s390x__ || defined __x86_64__
+#define START_FILES "pre-crt0.o /usr/lib64/crt1.o /usr/lib64/crti.o"
+#else
 #define START_FILES "pre-crt0.o /usr/lib/crt1.o /usr/lib/crti.o"
+#endif
 #endif				/*Added by Fukui*/
 #endif
 
@@ -108,7 +111,11 @@
 #else
 /*#undef LIB_GCC
   #define LIB_GCC*/
+#if defined __s390x__  || defined __x86_64__
+#define LIB_STANDARD "-lgcc -lc -lgcc /usr/lib64/crtn.o"
+#else
 #define LIB_STANDARD "-lgcc -lc -lgcc /usr/lib/crtn.o"
+#endif
 #define LINKER "$(CC) -nostdlib"
 #endif
 
--- a/src/select-x.c	Mon Jun 03 12:24:14 2002 +0000
+++ b/src/select-x.c	Tue Jun 04 06:05:53 2002 +0000
@@ -1482,7 +1482,7 @@
   x_selection_timeout = 0;
 
   DEFVAR_BOOL ("x-selection-strict-motif-ownership", &x_selection_strict_motif_ownership /*
-*If true and XEmacs already owns the clipboard, don't own it again in the
+*If nil and XEmacs already owns the clipboard, don't own it again in the
 Motif way. Owning the selection on the Motif way does a huge amount of
 X protocol, and it makes killing text incredibly slow when using an
 X terminal.  However, when enabled Motif text fields don't bother to look up
--- a/src/symsinit.h	Mon Jun 03 12:24:14 2002 +0000
+++ b/src/symsinit.h	Tue Jun 04 06:05:53 2002 +0000
@@ -440,6 +440,7 @@
 /* Initialize specifier variables (dump-time only). */
 
 void specifier_vars_of_glyphs (void);
+void specifier_vars_of_glyphs_widget (void);
 void specifier_vars_of_gutter (void);
 void specifier_vars_of_menubar (void);
 void specifier_vars_of_redisplay (void);
--- a/src/sysdep.c	Mon Jun 03 12:24:14 2002 +0000
+++ b/src/sysdep.c	Tue Jun 04 06:05:53 2002 +0000
@@ -3166,7 +3166,14 @@
 qxe_rename (const Intbyte *old, const Intbyte *new)
 {
 #ifdef WIN32_NATIVE
-  return mswindows_rename (old, new);
+  /* Windows rename fails if NEW exists */
+  if (mswindows_rename (old, new) == 0)
+    return 0;
+  /* In some cases errno is EACCES if NEW exists */
+  if (errno != EEXIST && errno != EACCES)
+    return -1;
+  if (mswindows_unlink (new) != 0)
+    return -1;
 #else /* not WIN32_NATIVE */
   Extbyte *oldout, *newout;
   PATHNAME_CONVERT_OUT (old, oldout);
@@ -3654,35 +3661,34 @@
 const char *sys_siglist[NSIG + 1] =
   {
     /* AIX has changed the signals a bit */
-    /* $$####begin-snarf */
-    "bogus signal",			/* 0 */
-    "hangup",				/* 1  SIGHUP */
-    "interrupt",			/* 2  SIGINT */
-    "quit",				/* 3  SIGQUIT */
-    "illegal instruction",		/* 4  SIGILL */
-    "trace trap",			/* 5  SIGTRAP */
-    "IOT instruction",			/* 6  SIGIOT */
-    "crash likely",			/* 7  SIGDANGER */
-    "floating point exception",		/* 8  SIGFPE */
-    "kill",				/* 9  SIGKILL */
-    "bus error",			/* 10 SIGBUS */
-    "segmentation violation",		/* 11 SIGSEGV */
-    "bad argument to system call",	/* 12 SIGSYS */
-    "write on a pipe with no one to read it", /* 13 SIGPIPE */
-    "alarm clock",			/* 14 SIGALRM */
-    "software termination signal",	/* 15 SIGTERM */
-    "user defined signal 1",		/* 16 SIGUSR1 */
-    "user defined signal 2",		/* 17 SIGUSR2 */
-    "death of a child",			/* 18 SIGCLD */
-    "power-fail restart",		/* 19 SIGPWR */
-    "bogus signal",			/* 20 */
-    "bogus signal",			/* 21 */
-    "bogus signal",			/* 22 */
-    "bogus signal",			/* 23 */
-    "bogus signal",			/* 24 */
-    "LAN I/O interrupt",		/* 25 SIGAIO */
-    "PTY I/O interrupt",		/* 26 SIGPTY */
-    "I/O intervention required",	/* 27 SIGIOINT */
+    DEFER_GETTEXT ("bogus signal"),			/* 0 */
+    DEFER_GETTEXT ("hangup"),				/* 1  SIGHUP */
+    DEFER_GETTEXT ("interrupt"),			/* 2  SIGINT */
+    DEFER_GETTEXT ("quit"),				/* 3  SIGQUIT */
+    DEFER_GETTEXT ("illegal instruction"),		/* 4  SIGILL */
+    DEFER_GETTEXT ("trace trap"),			/* 5  SIGTRAP */
+    DEFER_GETTEXT ("IOT instruction"),			/* 6  SIGIOT */
+    DEFER_GETTEXT ("crash likely"),			/* 7  SIGDANGER */
+    DEFER_GETTEXT ("floating point exception"),		/* 8  SIGFPE */
+    DEFER_GETTEXT ("kill"),				/* 9  SIGKILL */
+    DEFER_GETTEXT ("bus error"),			/* 10 SIGBUS */
+    DEFER_GETTEXT ("segmentation violation"),		/* 11 SIGSEGV */
+    DEFER_GETTEXT ("bad argument to system call"),	/* 12 SIGSYS */
+    DEFER_GETTEXT ("write on a pipe with no one to read it"), /* 13 SIGPIPE */
+    DEFER_GETTEXT ("alarm clock"),			/* 14 SIGALRM */
+    DEFER_GETTEXT ("software termination signal"),	/* 15 SIGTERM */
+    DEFER_GETTEXT ("user defined signal 1"),		/* 16 SIGUSR1 */
+    DEFER_GETTEXT ("user defined signal 2"),		/* 17 SIGUSR2 */
+    DEFER_GETTEXT ("death of a child"),			/* 18 SIGCLD */
+    DEFER_GETTEXT ("power-fail restart"),		/* 19 SIGPWR */
+    DEFER_GETTEXT ("bogus signal"),			/* 20 */
+    DEFER_GETTEXT ("bogus signal"),			/* 21 */
+    DEFER_GETTEXT ("bogus signal"),			/* 22 */
+    DEFER_GETTEXT ("bogus signal"),			/* 23 */
+    DEFER_GETTEXT ("bogus signal"),			/* 24 */
+    DEFER_GETTEXT ("LAN I/O interrupt"),		/* 25 SIGAIO */
+    DEFER_GETTEXT ("PTY I/O interrupt"),		/* 26 SIGPTY */
+    DEFER_GETTEXT ("I/O intervention required"),	/* 27 SIGIOINT */
 #ifdef AIXHFT
     "HFT grant",			/* 28 SIGGRANT */
     "HFT retract",			/* 29 SIGRETRACT */
@@ -3695,27 +3701,26 @@
 #else /* USG, not AIX */
 const char *sys_siglist[NSIG + 1] =
   {
-    /* $$####begin-snarf */
-    "bogus signal",			/* 0 */
-    "hangup",				/* 1  SIGHUP */
-    "interrupt",			/* 2  SIGINT */
-    "quit",				/* 3  SIGQUIT */
-    "illegal instruction",		/* 4  SIGILL */
-    "trace trap",			/* 5  SIGTRAP */
-    "IOT instruction",			/* 6  SIGIOT */
-    "EMT instruction",			/* 7  SIGEMT */
-    "floating point exception",		/* 8  SIGFPE */
-    "kill",				/* 9  SIGKILL */
-    "bus error",			/* 10 SIGBUS */
-    "segmentation violation",		/* 11 SIGSEGV */
-    "bad argument to system call",	/* 12 SIGSYS */
-    "write on a pipe with no one to read it", /* 13 SIGPIPE */
-    "alarm clock",			/* 14 SIGALRM */
-    "software termination signal",	/* 15 SIGTERM */
-    "user defined signal 1",		/* 16 SIGUSR1 */
-    "user defined signal 2",		/* 17 SIGUSR2 */
-    "death of a child",			/* 18 SIGCLD */
-    "power-fail restart",		/* 19 SIGPWR */
+    DEFER_GETTEXT ("bogus signal"),			/* 0 */
+    DEFER_GETTEXT ("hangup"),				/* 1  SIGHUP */
+    DEFER_GETTEXT ("interrupt"),			/* 2  SIGINT */
+    DEFER_GETTEXT ("quit"),				/* 3  SIGQUIT */
+    DEFER_GETTEXT ("illegal instruction"),		/* 4  SIGILL */
+    DEFER_GETTEXT ("trace trap"),			/* 5  SIGTRAP */
+    DEFER_GETTEXT ("IOT instruction"),			/* 6  SIGIOT */
+    DEFER_GETTEXT ("EMT instruction"),			/* 7  SIGEMT */
+    DEFER_GETTEXT ("floating point exception"),		/* 8  SIGFPE */
+    DEFER_GETTEXT ("kill"),				/* 9  SIGKILL */
+    DEFER_GETTEXT ("bus error"),			/* 10 SIGBUS */
+    DEFER_GETTEXT ("segmentation violation"),		/* 11 SIGSEGV */
+    DEFER_GETTEXT ("bad argument to system call"),	/* 12 SIGSYS */
+    DEFER_GETTEXT ("write on a pipe with no one to read it"), /* 13 SIGPIPE */
+    DEFER_GETTEXT ("alarm clock"),			/* 14 SIGALRM */
+    DEFER_GETTEXT ("software termination signal"),	/* 15 SIGTERM */
+    DEFER_GETTEXT ("user defined signal 1"),		/* 16 SIGUSR1 */
+    DEFER_GETTEXT ("user defined signal 2"),		/* 17 SIGUSR2 */
+    DEFER_GETTEXT ("death of a child"),			/* 18 SIGCLD */
+    DEFER_GETTEXT ("power-fail restart"),		/* 19 SIGPWR */
 #ifdef sun
     "window size changed",		/* 20 SIGWINCH */
     "urgent socket condition",		/* 21 SIGURG */
--- a/src/sysdll.c	Mon Jun 03 12:24:14 2002 +0000
+++ b/src/sysdll.c	Tue Jun 04 06:05:53 2002 +0000
@@ -42,6 +42,10 @@
 # define RTLD_GLOBAL 0
 #endif
 
+#ifndef RTLD_NOW
+# define RTLD_NOW 2
+#endif
+
 int
 dll_init (const char *arg)
 {
@@ -51,7 +55,7 @@
 dll_handle
 dll_open (const char *fname)
 {
-  return (dll_handle) dlopen (fname, RTLD_LAZY | RTLD_GLOBAL);
+  return (dll_handle) dlopen (fname, RTLD_NOW | RTLD_GLOBAL);
 }
 
 int
--- a/tests/ChangeLog	Mon Jun 03 12:24:14 2002 +0000
+++ b/tests/ChangeLog	Tue Jun 04 06:05:53 2002 +0000
@@ -1,3 +1,8 @@
+2002-04-27  Stephen J. Turnbull  <stephen@xemacs.org>
+
+	* automated/test-harness.el (test-harness-from-buffer): Clean up
+	Check-Message and Check-Error-Message when done.
+
 2002-05-05  Ben Wing  <ben@xemacs.org>
 
 	* automated/lisp-tests.el:
--- a/tests/automated/test-harness.el	Mon Jun 03 12:24:14 2002 +0000
+++ b/tests/automated/test-harness.el	Tue Jun 04 06:05:53 2002 +0000
@@ -290,6 +290,8 @@
 	(message "Test suite execution failed unexpectedly."))
       (fmakunbound 'Assert)
       (fmakunbound 'Check-Error)
+      (fmakunbound 'Check-Message)
+      (fmakunbound 'Check-Error-Message)
       (fmakunbound 'Ignore-Ebola)
       (fmakunbound 'Int-to-Marker)
       )))
--- a/tests/gutter-test.el	Mon Jun 03 12:24:14 2002 +0000
+++ b/tests/gutter-test.el	Tue Jun 04 06:05:53 2002 +0000
@@ -21,10 +21,10 @@
 (set-gutter-element 
  bottom-gutter 'str
  (make-glyph 
-  [layout :orientation vertical 
-	  :justify left :margin-width 4 
+  [layout :orientation vertical :margin-width 4
+	  :vertically-justify center :horizontally-justify left
 	  :items ([string :data "Fontifying glyphs.c..."]
-		  [layout :orientation horizontal 
+		  [layout :orientation horizontal
 			  :items 
 			  ([progress-gauge :value 0 :pixel-height 24
 					   :pixel-width 250 :descriptor 
@@ -33,7 +33,7 @@
 				   :descriptor " Stop " 
 				   :callback (quote quit)])])]))
 
-(set-gutter-element bottom-gutter 'str2 str2)
 (set-gutter-element-visible-p bottom-gutter-visible-p 'str t)
-(set-gutter-element-visible-p bottom-gutter-visible-p 'str2 t)
+(set-gutter-element left-gutter 'str2 str2)
+(set-gutter-element-visible-p left-gutter-visible-p 'str2 t)