changeset 4992:ef3b2f38dd7c

Automatic merge
author Ben Wing <ben@xemacs.org>
date Sat, 06 Feb 2010 04:05:16 -0600
parents 97c45e3ad810 (current diff) 8f0cf4fd3d2c (diff)
children 76af7fc13e81
files src/ChangeLog src/depend src/select-common.h tests/DLL/dltest.c
diffstat 15 files changed, 694 insertions(+), 508 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Sat Feb 06 03:26:34 2010 -0600
+++ b/lisp/ChangeLog	Sat Feb 06 04:05:16 2010 -0600
@@ -1,3 +1,50 @@
+2010-02-06  Ben Wing  <ben@xemacs.org>
+
+	* code-init.el:
+	* code-init.el (set-eol-detection):
+	* code-init.el (coding-system-current-system-configuration):
+	* code-init.el (coding-system-default-configuration-table): New.
+	* code-init.el (no-mule-no-eol-detection):
+	* code-init.el (define-coding-system-default-configuration): New.
+	* code-init.el (coding-system-variable-default-value-table): Removed.
+	* code-init.el (no-mule-eol-detection):
+	* code-init.el (coding-system-default-configuration-list): Removed.
+	* code-init.el (coding-system-default-variable-list):
+	* code-init.el (get-coding-system-variable):
+	* code-init.el (set-coding-system-variable):
+	* code-init.el (coding-system-variable-default-value):
+	* code-init.el (reset-coding-categories-to-default):
+	Significant clean-up, add Cygwin-UTF-8 support.
+
+	1. Shorten the names of the coding system variables to follow
+	   what used to be considered the "abbreviations":
+
+	   default-process-coding-system-read	->	process-read
+	   default-process-coding-system-write	->	process-write
+	   buffer-file-coding-system-for-read	->	bfcs-for-read
+	   default-buffer-file-coding-system	->	default-bfcs
+	   no-conversion-coding-system-mapping	->	no-conv-cs
+
+	2. Instead of listing all the defaults in a big, strangely organized
+	   table, use a new function
+	   `define-coding-system-default-configuration' to define a
+	   particular configuration.  This uses a hash table stored in
+	   `coding-system-default-configuration-table'.  Rewrite
+	   `coding-system-variable-default-value' appropriately.
+
+	3. Rename configurations to eliminate `unix' from the name:
+
+	   unix-no-mule-no-eol-detection      ->     no-mule-no-eol-detection
+	   unix-no-mule-eol-detection	      ->     no-mule-eol-detection
+	   unix-mule			      ->     mule
+
+	   This is because these are really for all systems but Windows,
+	   not just Unix.
+
+	4. Add configuration `cygwin-utf-8', enabled when (featurep
+	   'cygwin-use-utf-8).  Uses `utf-8' for all defaults except for
+	   `bfcs-for-read', which is `undecided'.
+
 2010-01-28  Ben Wing  <ben@xemacs.org>
 
 	* lisp-mode.el: Finish documenting `lisp-indent-specform',
--- a/lisp/code-init.el	Sat Feb 06 03:26:34 2010 -0600
+++ b/lisp/code-init.el	Sat Feb 06 04:05:16 2010 -0600
@@ -1,6 +1,6 @@
 ;;; code-init.el --- Handle coding system default values
 
-;; Copyright (C) 2001, 2002, 2003 Ben Wing.
+;; Copyright (C) 2001, 2002, 2003, 2010 Ben Wing.
 
 ;; This file is part of XEmacs.
 
@@ -21,6 +21,8 @@
 
 ;;; Commentary:
 
+;; Author: Ben wing, 2001?
+
 ;; Placed in a separate file so it can be loaded after the various
 ;; coding systems have been created, because we'll be using them at
 ;; load time.
@@ -60,62 +62,112 @@
 default, but this may change.  NOTE: You *REALLY* should not turn off EOL
 detection on Windows!  Your files will have lots of annoying ^M's in them
 if you do this."
-  (dolist (x '(buffer-file-coding-system-for-read
+  (dolist (x '(bfcs-for-read
 	       keyboard
-	       default-process-coding-system-read
-	       no-conversion-coding-system-mapping))
+	       process-read
+	       no-conv-cs))
     (set-coding-system-variable
      x (coding-system-change-eol-conversion (get-coding-system-variable x)
 					    (if flag nil 'lf)))))
 
 (defun coding-system-current-system-configuration ()
-  (cond ((memq system-type '(windows-nt cygwin32))
+  "Function to decide which default coding system configuration applies."
+  (cond ((featurep 'cygwin-use-utf-8) 'cygwin-utf-8)
+	((memq system-type '(windows-nt cygwin32))
 	 (if (featurep 'mule) 'windows-mule 'windows-no-mule))
-	((featurep 'mule) 'unix-mule)
-	(eol-detection-enabled-p 'unix-no-mule-eol-detection)
-	(t 'unix-no-mule-no-eol-detection)))
+	((featurep 'mule) 'mule)
+	(eol-detection-enabled-p 'no-mule-eol-detection)
+	(t 'no-mule-no-eol-detection)))
+
+(defvar coding-system-default-configuration-table (make-hash-table))
+
+(defun define-coding-system-default-configuration (name doc props)
+  (puthash name (nconc `(doc ,doc) props)
+	   coding-system-default-configuration-table))
 
 ;; NOTE NOTE NOTE: These values may get overridden when the language
 ;; environment is initialized (set-language-environment-coding-systems).
-(defvar coding-system-variable-default-value-table
-  '((buffer-file-coding-system-for-read
-     binary raw-text undecided raw-text undecided)
-    (default-buffer-file-coding-system
-      ;; #### iso-2022-8 with no eol specified?  can that be OK?
-      binary binary iso-2022-8 raw-text-dos mswindows-multibyte-dos)
-    (native
-     binary binary binary raw-text-dos mswindows-multibyte-system-default-dos)
-    (keyboard
-     binary raw-text undecided-unix raw-text undecided-unix)
-    ;; the `terminal' coding system is used for output to stderr.  such
-    ;; streams do automatic lf->crlf encoding in the C library, so we need
-    ;; to not do the same translations ourselves.
-    (terminal
-     binary binary binary binary mswindows-multibyte-unix)
-    (default-process-coding-system-read
-      binary raw-text undecided raw-text undecided)
-    (default-process-coding-system-write
-      binary binary binary raw-text mswindows-multibyte-system-default)
-    (no-conversion-coding-system-mapping
-     binary raw-text raw-text raw-text mswindows-multibyte)
-    ))
+(define-coding-system-default-configuration
+  'no-mule-no-eol-detection
+  "No Mule support, EOL detection not enabled."
+  '(bfcs-for-read	binary
+    default-bfcs	binary
+    process-read	binary
+    process-write	binary
+    keyboard		binary
+    native		binary
+    no-conv-cs		binary
+    terminal		binary))
+
+(define-coding-system-default-configuration
+  'no-mule-eol-detection
+  "No Mule support, EOL detection enabled."
+  '(bfcs-for-read	raw-text
+    default-bfcs	binary
+    process-read	raw-text
+    process-write	binary
+    keyboard		raw-text
+    native		binary
+    no-conv-cs		raw-text
+    terminal		binary))
+
+(define-coding-system-default-configuration
+  'mule
+  "Mule support enabled."
+  '(bfcs-for-read	undecided
+    default-bfcs	iso-2022-8
+    process-read	undecided
+    process-write	binary
+    keyboard		undecided-unix
+    native		binary
+    no-conv-cs		raw-text
+    terminal		binary))
 
-(defvar coding-system-default-configuration-list
-  '(unix-no-mule-no-eol-detection
-    unix-no-mule-eol-detection
-    unix-mule
-    windows-no-mule
-    windows-mule))
+(define-coding-system-default-configuration
+  'windows-no-mule
+  "Microsoft Windows, no Mule support."
+  '(bfcs-for-read	raw-text
+    default-bfcs	raw-text-dos
+    process-read	raw-text
+    process-write	raw-text
+    keyboard		raw-text
+    native		raw-text-dos
+    no-conv-cs		raw-text
+    terminal		binary))
+
+(define-coding-system-default-configuration
+  'windows-mule
+  "Microsoft Windows, Mule support enabled."
+  '(bfcs-for-read	undecided
+    default-bfcs	mswindows-multibyte-dos
+    process-read	undecided
+    process-write	mswindows-multibyte-system-default
+    keyboard		undecided-unix
+    native		mswindows-multibyte-system-default-dos
+    no-conv-cs		mswindows-multibyte
+    terminal		mswindows-multibyte-unix))
+
+(define-coding-system-default-configuration
+  'cygwin-utf-8
+  "Mule support enabled."
+  '(bfcs-for-read	undecided
+    default-bfcs	utf-8
+    process-read	utf-8
+    process-write	utf-8
+    keyboard		utf-8
+    native		utf-8
+    no-conv-cs		utf-8
+    terminal		utf-8))
 
 (defvar coding-system-default-variable-list
-  '(buffer-file-coding-system-for-read
-    default-buffer-file-coding-system
+  '(bfcs-for-read
+    default-bfcs
     native
     keyboard
     terminal
-    default-process-coding-system-read
-    default-process-coding-system-write
-    no-conversion-coding-system-mapping))
+    process-read
+    process-write
+    no-conv-cs))
 
 (defun get-coding-system-variable (var)
   "Return the value of a basic coding system variable.
@@ -124,15 +176,15 @@
 `coding-system-variable-default-value' for a list of the possible values of
 VAR."
   (case var
-    (buffer-file-coding-system-for-read buffer-file-coding-system-for-read)
-    (default-buffer-file-coding-system
+    (bfcs-for-read buffer-file-coding-system-for-read)
+    (default-bfcs
       (default-value 'buffer-file-coding-system))
     (native (coding-system-aliasee 'native))
     (keyboard (coding-system-aliasee 'keyboard))
     (terminal (coding-system-aliasee 'terminal))
-    (default-process-coding-system-read (car default-process-coding-system))
-    (default-process-coding-system-write (cdr default-process-coding-system))
-    (no-conversion-coding-system-mapping
+    (process-read (car default-process-coding-system))
+    (process-write (cdr default-process-coding-system))
+    (no-conv-cs
      (coding-category-system 'no-conversion))
     (t (error 'invalid-constant "Invalid coding system variable" var))))
 
@@ -143,20 +195,20 @@
 `coding-system-variable-default-value' for a list of the possible values of
 VAR."
   (case var
-    (buffer-file-coding-system-for-read
+    (bfcs-for-read
      (set-buffer-file-coding-system-for-read value))
-    (default-buffer-file-coding-system
+    (default-bfcs
       (set-default-buffer-file-coding-system value))
     (native (define-coding-system-alias 'native value))
     (keyboard (set-keyboard-coding-system value))
     (terminal (set-terminal-coding-system value))
-    (default-process-coding-system-read
+    (process-read
       (setq default-process-coding-system
 	    (cons value (cdr default-process-coding-system))))
-    (default-process-coding-system-write
+    (process-write
       (setq default-process-coding-system
 	    (cons (car default-process-coding-system) value)))
-    (no-conversion-coding-system-mapping
+    (no-conv-cs
      (set-coding-category-system 'no-conversion value))
     (t (error 'invalid-constant "Invalid coding system variable" var))))
 
@@ -170,28 +222,29 @@
 The table of default values looks like this: (see below for abbreviations)
 
 
-               Unix    Unix+EOL  Unix+Mule       MSW           MSW+Mule
------------------------------------------------------------------------------
-bfcs-for-read  binary  raw-text  undecided       raw-text      undecided
-default bfcs   binary  binary    iso-2022-8      raw-text-dos  MSW-MB-dos
-native         binary  binary    binary          raw-text-dos  MSW-MB-SD-dos
-keyboard       binary  raw-text  undecided-unix  raw-text      undecided-unix
-terminal       binary  binary    binary          binary        MSW-MB-unix
-process-read   binary  raw-text  undecided       raw-text      undecided
-process-write  binary  binary    binary          raw-text      MSW-MB-SD
-no-conv-cs     binary  raw-text  raw-text        raw-text      MSW-MB
+              NoMule NoMuleEOL Mule       MSW          MSWMule       CygUTF 
+------------------------------------------------------------------------------
+bfcs-for-read binary raw-text undecided   raw-text     undecided     undecided
+default-bfcs  binary binary   iso-2022-8  raw-text-dos MSW-MB-dos    utf-8
+native        binary binary   binary      raw-text-dos MSW-MB-SD-dos utf-8
+keyboard      binary raw-text undecided-  raw-text     undecided-    utf-8
+                                unix                     unix
+terminal      binary binary   binary      binary       MSW-MB-unix   utf-8
+process-read  binary raw-text undecided   raw-text     undecided     utf-8
+process-write binary binary   binary      raw-text     MSW-MB-SD     utf-8
+no-conv-cs    binary raw-text raw-text    raw-text     MSW-MB        utf-8
 
 
-VAR can be one of: (abbreviations in parens)
+VAR can be one of:
 
-`buffer-file-coding-system-for-read' (bfcs-for-read)
+`bfcs-for-read'
 
   Lisp variable of the same name; the default coding system used when
   reading in a file, in the absence of more specific settings. (See
   `insert-file-contents' for a description of exactly how a file's
   coding system is determined when it's read in.)
 
-`default-buffer-file-coding-system' (default bfcs)
+`default-bfcs'
 
   Default value of `buffer-file-coding-system', the buffer-local
   variable specifying a file's coding system to be used when it is
@@ -201,58 +254,61 @@
   system used to read the file in; the default value applies to newly
   created files.
 
-`native' (native)
+`native'
 
   The coding system named `native'.  Changed using
   `define-coding-system-alias'.  Used internally when passing
   text to or from system API's, unless the particular
   API specifies another coding system.
 
-`keyboard' (keyboard)
+`keyboard'
 
  #### fill in
 
-`terminal' (terminal)
+`terminal'
 
  #### fill in
 
-`default-process-coding-system-read' (process-read)
+`process-read'
 
  #### fill in
 
-`default-process-coding-system-write' (process-write)
+`process-write'
 
  #### fill in
 
-`no-conversion-coding-system-mapping' (no-conv-cs)
+`no-conv-cs'
 
   Coding system used when category `no-conversion' is detected.
 
 
 CONFIG is one of: (abbreviations in parens)
 
-`unix-no-mule-no-eol-detection' (Unix)
+`no-mule-no-eol-detection' (NoMule)
 
-Unix, no Mule support, no automatic EOL detection. (Controlled by
+Non-Windows, no Mule support, no automatic EOL detection. (Controlled by
 `eol-detection-enabled-p', which is set by the command-line flag
 -enable-eol-detection or the configure flag --with-default-eol-detection.)
 
-`unix-no-mule-eol-detection' (Unix+EOL)
+`unix-no-mule-eol-detection' (NoMuleEOL)
 
-Unix, no Mule support, automatic EOL detection.
+Non-Windows, no Mule support, automatic EOL detection.
 
-`unix-mule' (Unix+Mule)
+`unix-mule' (Mule)
 
-Unix, Mule support.
+Non-Windows, Mule support.
 
 `windows-no-mule' (MSW)
 
-MS Windows or Cygwin, no Mule support.
+MS Windows or old Cygwin, no Mule support.
+
+`windows-mule' (MSWMule)
 
-`windows-mule'. (MSW+Mule)
+MS Windows or old Cygwin, Mule support.
 
-MS Windows or Cygwin, Mule support.
+`cygwin-utf-8' (CygUTF)
 
+Cygwin 1.7 or later, which uses UTF-8 consistently.
 
 The following coding system abbreviations are also used in the table:
 
@@ -260,12 +316,12 @@
 MSW-MB = mswindows-multibyte-system-default
 "
   (setq config (or config (coding-system-current-system-configuration)))
-  (let ((defs (cdr (assq var coding-system-variable-default-value-table))))
-    (or defs (error 'invalid-constant "Invalid coding system variable" var))
-    (let ((pos (position config coding-system-default-configuration-list)))
-      (or pos (error 'invalid-constant "Invalid coding system configuration"
+  (or (memq var coding-system-default-variable-list)
+      (error 'invalid-constant "Invalid coding system variable" var))
+  (let ((props (gethash config coding-system-default-configuration-table)))
+    (or props (error 'invalid-constant "Invalid coding system configuration"
 		     config))
-      (nth pos defs))))
+    (getf props var)))
 
 (defun reset-coding-system-defaults (&optional config)
   "Reset all basic coding system variables are set to their default values.
@@ -332,7 +388,7 @@
     )
   (set-coding-category-system
    'no-conversion
-   (coding-system-variable-default-value 'no-conversion-coding-system-mapping))
+   (coding-system-variable-default-value 'no-conv-cs))
   (set-coding-category-system 'ucs-4 'ucs-4)
   (set-coding-category-system 'utf-8 'utf-8)
   (set-coding-category-system 'utf-8-bom 'utf-8-bom)
--- a/man/ChangeLog	Sat Feb 06 03:26:34 2010 -0600
+++ b/man/ChangeLog	Sat Feb 06 04:05:16 2010 -0600
@@ -1,3 +1,13 @@
+2010-02-05  Ben Wing  <ben@xemacs.org>
+
+	* internals/internals.texi (A Summary of the Various XEmacs Modules):
+	* internals/internals.texi (Conversion to and from External Data):
+	* internals/internals.texi (General Guidelines for Writing Mule-Aware Code):
+	Correct names of files renamed common -> xlike.
+	Fix up outdated explanation of old-style DFC conversion macros.
+	Add a section on the different types of character and their uses,
+	taken from a long comment in lisp.h.
+
 2010-01-27  Ben Wing  <ben@xemacs.org>
 
 	* internals/internals.texi (lrecords):
--- a/man/internals/internals.texi	Sat Feb 06 03:26:34 2010 -0600
+++ b/man/internals/internals.texi	Sat Feb 06 04:05:16 2010 -0600
@@ -3183,7 +3183,7 @@
 @item @file{scrollbar.c} @tab @ref{Modules for other Display-Related Lisp Objects}.
 @item @file{scrollbar.h} @tab @ref{Modules for other Display-Related Lisp Objects}.
 @item @file{search.c} @tab @ref{Modules for Standard Editing Operations}.
-@item @file{select-common.h} @tab
+@item @file{select-xlike-inc.c} @tab
 @item @file{select-gtk.c} @tab
 @item @file{select-msw.c} @tab @ref{Modules for Interfacing with X Windows}.
 @item @file{select-x.c} @tab @ref{Modules for Interfacing with X Windows}.
@@ -3229,8 +3229,8 @@
 @item @file{tests.c} @tab
 @item @file{text.c} @tab
 @item @file{text.h} @tab
-@item @file{toolbar-common.c} @tab
-@item @file{toolbar-common.h} @tab
+@item @file{toolbar-xlike.c} @tab
+@item @file{toolbar-xlike.h} @tab
 @item @file{toolbar-gtk.c} @tab
 @item @file{toolbar-msw.c} @tab @ref{Modules for other Display-Related Lisp Objects}.
 @item @file{toolbar-x.c} @tab @ref{Modules for other Display-Related Lisp Objects}.
@@ -12901,19 +12901,18 @@
 especially when the output is an @code{alloca()}ed string. (When the
 destination is a Lisp string, there are other functions that should be
 used instead -- @code{build_extstring()} and @code{make_extstring()},
-for example.) The convenience macros are of two types -- the older kind
-that store the result into a specified variable, and the newer kind that
-return the result.  The newer kind of macros don't exist when the output
-is sized data, because that would have two return values.  NOTE: All
-convenience macros are ultimately defined in terms of
-@code{TO_EXTERNAL_FORMAT} and @code{TO_INTERNAL_FORMAT}.  Thus, any
-comments above about the workings of these macros also apply to all
-convenience macros.
-
-A typical old-style convenience macro is
-
-@example
-  C_STRING_TO_EXTERNAL (in, out, codesys);
+for example.) Most convenience macros return the result as the return
+value.  However, when two values need to be returned (that is, the
+output is sized data), both values are stored into variables that are
+passed into the macros as parameters.  NOTE: All convenience macros
+are ultimately defined in terms of @code{TO_EXTERNAL_FORMAT} and
+@code{TO_INTERNAL_FORMAT}.  Thus, any comments above about the
+workings of these macros also apply to all convenience macros.
+
+A typical convenience macro is
+
+@example
+  out = ITEXT_TO_EXTERNAL (in, codesys);
 @end example
 
 This is equivalent to
@@ -12922,14 +12921,13 @@
   TO_EXTERNAL_FORMAT (C_STRING, in, C_STRING_ALLOCA, out, codesys);
 @end example
 
-but is easier to write and somewhat clearer, since it clearly identifies
-the arguments without the clutter of having the preprocessor types mixed
-in.
-
-The new-style equivalent is @code{NEW_C_STRING_TO_EXTERNAL (src,
-codesys)}, which @emph{returns} the converted data (still in
-@code{alloca()} space).  This is far more convenient for most
-operations.
+but is easier to write and somewhat clearer, since it clearly
+identifies the arguments without the clutter of having the
+preprocessor types mixed in.  Furthermore, it @emph{returns} the
+converted data (still in @code{alloca()} space) rather than
+@emph{storing} it, which is far more convenient for most operations
+as there is no need to declare an extra temporary variable to hold
+the return value.
 
 @node General Guidelines for Writing Mule-Aware Code, An Example of Mule-Aware Code, Conversion to and from External Data, Coding for Mule
 @subsection General Guidelines for Writing Mule-Aware Code
@@ -12948,9 +12946,69 @@
 format, use @code{Ibyte}.  If you want a Lisp-visible character, use a
 @code{Lisp_Object} and @code{make_char}.  If you want a pointer to move
 through the internal text, use @code{Ibyte *}.  Also note that you
-almost certainly do not need @code{Ichar *}.  Other typedefs to clarify
-the use of @code{char} are @code{Char_ASCII}, @code{Char_Binary},
-@code{UChar_Binary}, and @code{CIbyte}.
+almost certainly do not need @code{Ichar *}.
+
+All uses of @code{char} should be replaced with one of the following:
+
+@table @code
+@item Ibyte
+Pointer to internally-formatted text.  The data representing the text
+in a buffer is logically a set of Ibytes.
+@item CIbyte
+Used when you are working with internal data but for whatever reason
+need to have it declared a @code{char *}.  Examples are function arguments
+whose values are most commonly literal strings, or where you have to
+apply a stdlib string function to internal data.
+
+In general, you should avoid this where possible and use Ascbyte if the
+text is just ASCII (e.g. string literals) or otherwise Ibyte, for
+consistency.  For example, the new Mule workspace contains Ibyte
+versions of the stdlib string functions.
+@item Extbyte, UExtbyte
+Pointer to text in some external format, which can be defined as all
+formats other than the internal one.  The data representing a string
+in "external" format (binary or any external encoding) is logically a
+set of Extbytes.  Extbyte is guaranteed to be just a char, so for
+example strlen (Extbyte *) is OK.  Extbyte is only a documentation
+device for referring to external text.
+@item Ascbyte, UAscbyte
+pure ASCII text, consisting of bytesf in a string in entirely US-ASCII
+format: (Nothing outside the range 00 - 7F).
+@item Binbyte, CBinbyte, SBinbyte
+Binary data that is not meant to be interpreted as text.
+@item Rawbyte, CRawbyte
+General data in memory, where we don't care about whether it's text or
+binary; often used when computing memory-based/byte-based offsets of
+pointers.  In general, there should be no manipulation of the memory
+pointed to by these pointers other than just copying it around.
+@item Boolbyte
+A byte used to represent a boolean value: 0 or 1.
+Normally use plain Boolint, and only use Boolbyte to save space.
+@item Bitbyte
+A byte composed of bitfields.  Hardly ever used.
+@item Chbyte, UChbyte, SChbyte
+A no-semantics @code{char}.  Used (pretty-much) ONLY for casting
+arguments to functions accepting a @code{char *}, @code{unsigned char
+*}, etc. where the other types don't exactly apply and what you are
+logically concerned with is the type of the function's argument and
+not its semantics.
+
+DO NOT DO NOT DO NOT DO NOT use this as a sloppy replacement for one of
+the other types.  If you're not using this as part of casting an
+argument to a function call, and you're not Ben Wing, you're using it
+wrong.  Go find another one of the types.
+@end table
+
+Note the significance of the prefixed versions of the above types:
+
+@table @code
+@item U
+@code{unsigned char}
+@item S
+@code{signed char}
+@item C
+plain @code{char}
+@end table
 
 @item Be careful not to confuse @code{Charcount}, @code{Bytecount}, @code{Charbpos} and @code{Bytebpos}.
 The whole point of using different types is to avoid confusion about the
--- a/src/ChangeLog	Sat Feb 06 03:26:34 2010 -0600
+++ b/src/ChangeLog	Sat Feb 06 04:05:16 2010 -0600
@@ -10,6 +10,35 @@
 
 2010-02-05  Ben Wing  <ben@xemacs.org>
 
+	* syswindows.h (LOCAL_FILE_FORMAT_TO_TSTR):
+	Cast pointer when storing value to avoid problems because some
+	store vars are Extbyte * and some are LPTSTR.
+
+2010-02-05  Jerry James  <james@xemacs.org>
+
+	* s/sco7.h: Add copyright and license header with the permission of
+	Ron Record, the author.
+
+2010-02-05  Ben Wing  <ben@xemacs.org>
+
+	* depend:
+	Regenerate.
+	* make-src-depend (PrintPatternDeps):
+	Remove refs to xgccache, no longer existent.
+	
+	* select-gtk.c (THIS_IS_GTK):
+	* select-gtk.c (gtk_decline_selection_request):
+	* select-x.c (THIS_IS_X):
+	* select-xlike-inc.c:
+	* select-xlike-inc.c (selection_data_to_lisp_data):
+	Rename PROCESSING_X_CODE to THIS_IS_X and PROCESSING_GTK_CODE to
+	THIS_SI_GTK for consistency with other xlike code.
+	
+	Rename select-xlike-inc.c from select-common.h, in keeping with
+	xlike terminology.
+
+2010-02-05  Ben Wing  <ben@xemacs.org>
+
 	* console-msw.c (write_string_to_mswindows_debugging_output):
 	* console-msw.c (Fmswindows_message_box):
 	* console-x.c (x_perhaps_init_unseen_key_defaults):
--- a/src/depend	Sat Feb 06 03:26:34 2010 -0600
+++ b/src/depend	Sat Feb 06 04:05:16 2010 -0600
@@ -34,6 +34,7 @@
 event-xlike-inc.o: 
 objects-xlike-inc.o: $(LWLIB_SRCDIR)/lwlib.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console-x-impl.h console-x.h console-xlike-inc.h console.h gccache-gtk.h gccache-x.h glyphs-gtk.h glyphs-x.h glyphs.h objects-gtk-impl.h objects-gtk.h objects-impl.h objects-x-impl.h objects-x.h objects.h redisplay.h scrollbar.h specifier.h sysgtk.h window-impl.h window.h winslots.h xintrinsic.h
 redisplay-xlike-inc.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console-x-impl.h console-x.h console-xlike-inc.h console.h debug.h device-impl.h device.h devslots.h dumper.h faces.h file-coding.h frame-impl.h frame.h frameslots.h gc.h gccache-gtk.h gccache-x.h general-slots.h glyphs-gtk.h glyphs-x.h glyphs.h gutter.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h mule-ccl.h number-gmp.h number-mp.h number.h objects-gtk-impl.h objects-gtk.h objects-impl.h objects-x-impl.h objects-x.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysgtk.h sysproc.h syssignal.h systime.h text.h vdb.h window-impl.h window.h winslots.h xintrinsic.h xintrinsicp.h xmotif.h xmprimitivep.h
+select-xlike-inc.o: 
 toolbar-xlike.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h charset.h compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h dumper.h faces.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysgtk.h text.h toolbar-xlike.h toolbar.h vdb.h window-impl.h window.h winslots.h xintrinsic.h
 #endif
 #if defined(HAVE_X_WINDOWS)
@@ -55,7 +56,7 @@
 objects-x.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h charset.h compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console-x-impl.h console-x.h console-xlike-inc.h console.h device-impl.h device.h devslots.h dumper.h elhash.h font-mgr.h gc.h gccache-gtk.h gccache-x.h general-slots.h glyphs-gtk.h glyphs-x.h glyphs.h insdel.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects-gtk-impl.h objects-gtk.h objects-impl.h objects-x-impl.h objects-x.h objects-xlike-inc.c objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysgtk.h text.h vdb.h window-impl.h window.h winslots.h xintrinsic.h
 redisplay-x.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console-x-impl.h console-x.h console-xlike-inc.h console.h debug.h device-impl.h device.h devslots.h dumper.h faces.h file-coding.h frame-impl.h frame.h frameslots.h gc.h gccache-gtk.h gccache-x.h general-slots.h glyphs-gtk.h glyphs-x.h glyphs.h gutter.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h mule-ccl.h number-gmp.h number-mp.h number.h objects-gtk-impl.h objects-gtk.h objects-impl.h objects-x-impl.h objects-x.h objects.h redisplay-xlike-inc.c redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysgtk.h sysproc.h syssignal.h systime.h text.h vdb.h window-impl.h window.h winslots.h xintrinsic.h xintrinsicp.h xmotif.h xmprimitivep.h
 scrollbar-x.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h compiler.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h dumper.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs-x.h glyphs.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h scrollbar-x.h scrollbar.h specifier.h symeval.h symsinit.h text.h vdb.h window-impl.h window.h winslots.h xintrinsic.h
-select-x.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h charset.h compiler.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h dumper.h frame-impl.h frame.h frameslots.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects-x.h objects.h opaque.h redisplay.h select-common.h select.h specifier.h symeval.h symsinit.h systime.h text.h vdb.h xintrinsic.h xmotif.h
+select-x.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h charset.h compiler.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h dumper.h frame-impl.h frame.h frameslots.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects-x.h objects.h opaque.h redisplay.h select-xlike-inc.c select.h specifier.h symeval.h symsinit.h systime.h text.h vdb.h xintrinsic.h xmotif.h
 toolbar-x.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h charset.h compiler.h conslots.h console-impl.h console-x-impl.h console-x.h console.h dumper.h faces.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs-x.h glyphs.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects-x.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h text.h toolbar-xlike.h toolbar.h vdb.h window-impl.h window.h winslots.h xintrinsic.h xintrinsicp.h xmotif.h xmprimitivep.h
 #endif
 #if defined(HAVE_TTY)
@@ -85,7 +86,7 @@
 objects-gtk.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console-x-impl.h console-x.h console-xlike-inc.h console.h device-impl.h device.h devslots.h dumper.h gc.h gccache-gtk.h gccache-x.h general-slots.h glyphs-gtk.h glyphs-x.h glyphs.h insdel.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects-gtk-impl.h objects-gtk.h objects-impl.h objects-x-impl.h objects-x.h objects-xlike-inc.c objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysgdkx.h sysgtk.h text.h vdb.h window-impl.h window.h winslots.h xintrinsic.h
 redisplay-gtk.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console-x-impl.h console-x.h console-xlike-inc.h console.h debug.h device-impl.h device.h devslots.h dumper.h faces.h file-coding.h frame-impl.h frame.h frameslots.h gc.h gccache-gtk.h gccache-x.h general-slots.h glyphs-gtk.h glyphs-x.h glyphs.h gutter.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h mule-ccl.h number-gmp.h number-mp.h number.h objects-gtk-impl.h objects-gtk.h objects-impl.h objects-x-impl.h objects-x.h objects.h redisplay-xlike-inc.c redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysgdkx.h sysgtk.h sysproc.h syssignal.h systime.h text.h vdb.h window-impl.h window.h winslots.h xintrinsic.h xintrinsicp.h xmotif.h xmprimitivep.h
 scrollbar-gtk.o: $(CONFIG_H) $(LISP_H) compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h dumper.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs-gtk.h glyphs.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h scrollbar-gtk.h scrollbar.h specifier.h symeval.h symsinit.h sysgtk.h text.h vdb.h window-impl.h window.h winslots.h
-select-gtk.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h device-impl.h device.h devslots.h dumper.h events.h frame.h gc.h general-slots.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h redisplay.h select-common.h select.h specifier.h symeval.h symsinit.h sysgtk.h systime.h text.h vdb.h
+select-gtk.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h device-impl.h device.h devslots.h dumper.h events.h frame.h gc.h general-slots.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h redisplay.h select-xlike-inc.c select.h specifier.h symeval.h symsinit.h sysgtk.h systime.h text.h vdb.h
 toolbar-gtk.o: $(CONFIG_H) $(LISP_H) compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h dumper.h frame.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h specifier.h symeval.h symsinit.h sysgtk.h text.h toolbar-xlike.h vdb.h
 ui-byhand.o: gui.h
 ui-gtk.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h device.h dumper.h elhash.h emacs-marshals.c emacs-widget-accessors.c events.h faces.h gc.h general-slots.h glade.c glyphs-gtk.h glyphs.h gtk-glue.c gui.h hash.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects-gtk-impl.h objects-gtk.h objects-impl.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdll.h sysgtk.h systime.h text.h ui-byhand.c ui-gtk.h vdb.h window-impl.h window.h winslots.h
--- a/src/make-src-depend	Sat Feb 06 03:26:34 2010 -0600
+++ b/src/make-src-depend	Sat Feb 06 04:05:16 2010 -0600
@@ -142,8 +142,8 @@
 
 PrintPatternDeps ('-msw\\.',   "HAVE_MS_WINDOWS");
 PrintPatternDeps ('-xlike',   "HAVE_XLIKE");
-# X-specific files: *-x.c *-x-impl.h xgccache.c balloon_help.c x*.h Emacs*.[ch]
-PrintPatternDeps ('-x\\.|xgccache|balloon_help|^Emacs',     "HAVE_X_WINDOWS");
+# X-specific files: *-x.c *-x-impl.h balloon_help.c x*.h Emacs*.[ch]
+PrintPatternDeps ('-x\\.|balloon_help|^Emacs',     "HAVE_X_WINDOWS");
 PrintPatternDeps ('-tty\\.',   "HAVE_TTY");
 # GTK-specific files: *-gtk.[ch] *-gtk-*.[ch] gtk-*.[ch] emacs-marshals.c emacs-widget-accessors.c glade.c ui-byhand.c
 PrintPatternDeps ('gtk|emacs-marshals|emacs-widget-accessors|glade|ui-byhand',   "HAVE_GTK");
--- a/src/s/sco7.h	Sat Feb 06 03:26:34 2010 -0600
+++ b/src/s/sco7.h	Sat Feb 06 04:05:16 2010 -0600
@@ -1,6 +1,24 @@
-/* Synched up with: FSF 19.31. */
+/* Definitions file for XEmacs running on SCO System V release 4.2
+   Copyright (C) 1999 Ron Record
+
+This file is part of XEmacs.
+
+XEmacs is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option) any
+later version.
 
-/* s/ file for System V release 4.2.  */
+XEmacs is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with XEmacs; see the file COPYING.  If not, write to
+the Free Software Foundation, Inc., 51 Franklin St. - Fifth Floor,
+Boston, MA 02110-1301, USA.  */
+
+/* Synched up with: FSF 19.31. */
 
 #include "usg5-4.h"
 
--- a/src/select-common.h	Sat Feb 06 03:26:34 2010 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,342 +0,0 @@
-/* Selection processing for XEmacs -- common btwn select-x.c and select-gtk.c
-   Copyright (C) 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
-
-This file is part of XEmacs.
-
-XEmacs is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License as published by the
-Free Software Foundation; either version 2, or (at your option) any
-later version.
-
-XEmacs is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License
-along with XEmacs; see the file COPYING.  If not, write to
-the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA.  */
-
-/* Synched up with: Not synched with FSF. */
-
-#ifdef PROCESSING_X_CODE
-#define XE_ATOM_TYPE Atom
-#define XE_ATOM_TO_SYMBOL x_atom_to_symbol
-#define XE_SYMBOL_TO_ATOM symbol_to_x_atom
-#else
-#define XE_ATOM_TYPE GdkAtom
-#define XE_ATOM_TO_SYMBOL atom_to_symbol
-#define XE_SYMBOL_TO_ATOM symbol_to_gtk_atom
-#endif /* PROCESSING_X_CODE */
-
-/* #### These are going to move into Lisp code(!) with the aid of
-        some new functions I'm working on - ajh */
-
-/* These functions convert from the selection data read from the server into
-   something that we can use from elisp, and vice versa.
-
-	Type:	Format:	Size:		Elisp Type:
-	-----	-------	-----		-----------
-	*	8	*		String
-	ATOM	32	1		Symbol
-	ATOM	32	> 1		Vector of Symbols
-	*	16	1		Integer
-	*	16	> 1		Vector of Integers
-	*	32	1		if <=16 bits: Integer
-					if > 16 bits: Cons of top16, bot16
-	*	32	> 1		Vector of the above
-
-   NOTE NOTE NOTE:
-   Format == 32 means that the buffer will be C longs, which need not be
-   32-bit quantities.  See the note in select-x.c (x_get_window_property).
-
-   When converting a Lisp number to C, it is assumed to be of format 16 if
-   it is an integer, and of format 32 if it is a cons of two integers.
-
-   When converting a vector of numbers from Elisp to C, it is assumed to be
-   of format 16 if every element in the vector is an integer, and is assumed
-   to be of format 32 if any element is a cons of two integers.
-
-   When converting an object to C, it may be of the form (SYMBOL . <data>)
-   where SYMBOL is what we should claim that the type is.  Format and
-   representation are as above.
-
-   NOTE: Under Mule, when someone shoves us a string without a type, we
-   set the type to `COMPOUND_TEXT' and automatically convert to Compound
-   Text.  If the string has a type, we assume that the user wants the
-   data sent as-is so we just do "binary" conversion.
- */
-
-
-static Lisp_Object
-selection_data_to_lisp_data (struct device *d,
-			     Rawbyte *data,
-			     Bytecount size,
-			     XE_ATOM_TYPE type,
-			     int format)
-{
-#ifdef PROCESSING_X_CODE
-  if (type == DEVICE_XATOM_NULL (d))
-    return QNULL;
-
-  /* Convert any 8-bit data to a string, for compactness. */
-  else if (format == 8)
-    return make_extstring ((Extbyte *) data, size,
-			    type == DEVICE_XATOM_TEXT (d) ||
-			    type == DEVICE_XATOM_COMPOUND_TEXT (d)
-			    ? Qctext : Qbinary);
-
-  /* Convert a single atom to a Lisp Symbol.
-     Convert a set of atoms to a vector of symbols. */
-  else if (type == XA_ATOM)
-#else
-  if (type == gdk_atom_intern ("NULL", 0))
-    return QNULL;
-
-  /* Convert any 8-bit data to a string, for compactness. */
-  else if (format == 8)
-    return make_extstring ((Extbyte *) data, size,
-			    ((type == gdk_atom_intern ("TEXT", FALSE)) ||
-			     (type == gdk_atom_intern ("COMPOUND_TEXT", FALSE)))
-			    ? Qctext : Qbinary);
-
-  /* Convert a single atom to a Lisp Symbol.
-     Convert a set of atoms to a vector of symbols. */
-  else if (type == gdk_atom_intern ("ATOM", FALSE))
-#endif /* PROCESSING_X_CODE */
-    {
-      if (size == sizeof (XE_ATOM_TYPE))
-	return XE_ATOM_TO_SYMBOL (d, *((XE_ATOM_TYPE *) data));
-      else
-	{
-	  Elemcount i;
-	  Elemcount len = size / sizeof (XE_ATOM_TYPE);
-	  Lisp_Object v = Fmake_vector (make_int (len), Qzero);
-	  for (i = 0; i < len; i++)
-	    Faset (v, make_int (i), XE_ATOM_TO_SYMBOL (d, ((XE_ATOM_TYPE *) data) [i]));
-	  return v;
-	}
-    }
-
-  /* Convert a single 16 or small 32 bit number to a Lisp Int.
-     If the number is > 16 bits, convert it to a cons of integers,
-     16 bits in each half.
-   */
-  else if (format == 32 && size == sizeof (long))
-    return word_to_lisp (((unsigned long *) data) [0]);
-  else if (format == 16 && size == sizeof (short))
-    return make_int ((int) (((unsigned short *) data) [0]));
-
-  /* Convert any other kind of data to a vector of numbers, represented
-     as above (as an integer, or a cons of two 16 bit integers).
-
-     #### Perhaps we should return the actual type to lisp as well.
-
-	(x-get-selection-internal 'PRIMARY 'LINE_NUMBER)
-	==> [4 4]
-
-     and perhaps it should be
-
-	(x-get-selection-internal 'PRIMARY 'LINE_NUMBER)
-	==> (SPAN . [4 4])
-
-     Right now the fact that the return type was SPAN is discarded before
-     lisp code gets to see it.
-   */
-  else if (format == 16)
-    {
-      Elemcount i;
-      Lisp_Object v = make_vector (size / 4, Qzero);
-      for (i = 0; i < size / 4; i++)
-	{
-	  int j = (int) ((unsigned short *) data) [i];
-	  Faset (v, make_int (i), make_int (j));
-	}
-      return v;
-    }
-  else
-    {
-      Elemcount i;
-      Lisp_Object v = make_vector (size / 4, Qzero);
-      for (i = 0; i < size / 4; i++)
-	{
-	  unsigned long j = ((unsigned long *) data) [i];
-	  Faset (v, make_int (i), word_to_lisp (j));
-	}
-      return v;
-    }
-}
-
-
-static void
-lisp_data_to_selection_data (struct device *d,
-			     Lisp_Object obj,
-			     Rawbyte **data_ret,
-			     XE_ATOM_TYPE *type_ret,
-			     Bytecount *size_ret,
-			     int *format_ret)
-{
-  Lisp_Object type = Qnil;
-
-  if (CONSP (obj) && SYMBOLP (XCAR (obj)))
-    {
-      type = XCAR (obj);
-      obj = XCDR (obj);
-      if (CONSP (obj) && NILP (XCDR (obj)))
-	obj = XCAR (obj);
-    }
-
-  if (EQ (obj, QNULL) || (EQ (type, QNULL)))
-    {				/* This is not the same as declining */
-      *format_ret = 32;
-      *size_ret = 0;
-      *data_ret = 0;
-      type = QNULL;
-    }
-  else if (STRINGP (obj))
-    {
-      const Extbyte *extval;
-      Bytecount extvallen;
-
-      LISP_STRING_TO_SIZED_EXTERNAL (obj, extval, extvallen,
-				     (NILP (type) ? Qctext : Qbinary));
-      *format_ret = 8;
-      *size_ret = extvallen;
-      *data_ret = xnew_rawbytes (*size_ret);
-      memcpy (*data_ret, extval, *size_ret);
-#ifdef MULE
-      if (NILP (type)) type = QCOMPOUND_TEXT;
-#else
-      if (NILP (type)) type = QSTRING;
-#endif
-    }
-  else if (CHARP (obj))
-    {
-      Ibyte buf[MAX_ICHAR_LEN];
-      Bytecount len;
-      const Extbyte *extval;
-      Bytecount extvallen;
-
-      *format_ret = 8;
-      len = set_itext_ichar (buf, XCHAR (obj));
-      TO_EXTERNAL_FORMAT (DATA, (buf, len),
-			  ALLOCA, (extval, extvallen),
-			  Qctext);
-      *size_ret = extvallen;
-      *data_ret = xnew_rawbytes (*size_ret);
-      memcpy (*data_ret, extval, *size_ret);
-#ifdef MULE
-      if (NILP (type)) type = QCOMPOUND_TEXT;
-#else
-      if (NILP (type)) type = QSTRING;
-#endif
-    }
-  else if (SYMBOLP (obj))
-    {
-      *format_ret = 32;
-      *size_ret = 1;
-      *data_ret = xnew_rawbytes (sizeof (XE_ATOM_TYPE) + 1);
-      (*data_ret) [sizeof (XE_ATOM_TYPE)] = 0;
-      (*(XE_ATOM_TYPE **) data_ret) [0] = XE_SYMBOL_TO_ATOM (d, obj, 0);
-      if (NILP (type)) type = QATOM;
-    }
-  else if (INTP (obj) &&
-	   XINT (obj) <= 0x7FFF &&
-	   XINT (obj) >= -0x8000)
-    {
-      *format_ret = 16;
-      *size_ret = 1;
-      *data_ret = xnew_rawbytes (sizeof (short) + 1);
-      (*data_ret) [sizeof (short)] = 0;
-      (*(short **) data_ret) [0] = (short) XINT (obj);
-      if (NILP (type)) type = QINTEGER;
-    }
-  else if (INTP (obj) || CONSP (obj))
-    {
-      *format_ret = 32;
-      *size_ret = 1;
-      *data_ret = xnew_rawbytes (sizeof (long) + 1);
-      (*data_ret) [sizeof (long)] = 0;
-      (*(unsigned long **) data_ret) [0] = lisp_to_word (obj);
-      if (NILP (type)) type = QINTEGER;
-    }
-  else if (VECTORP (obj))
-    {
-      /* Lisp Vectors may represent a set of ATOMs;
-	 a set of 16 or 32 bit INTEGERs;
-	 or a set of ATOM_PAIRs (represented as [[A1 A2] [A3 A4] ...]
-       */
-      Elemcount i;
-
-      if (SYMBOLP (XVECTOR_DATA (obj) [0]))
-	/* This vector is an ATOM set */
-	{
-	  if (NILP (type)) type = QATOM;
-	  *size_ret = XVECTOR_LENGTH (obj);
-	  *format_ret = 32;
-	  *data_ret = xnew_rawbytes ((*size_ret) * sizeof (XE_ATOM_TYPE));
-	  for (i = 0; i < *size_ret; i++)
-	    if (SYMBOLP (XVECTOR_DATA (obj) [i]))
-	      (*(XE_ATOM_TYPE **) data_ret) [i] =
-		XE_SYMBOL_TO_ATOM (d, XVECTOR_DATA (obj) [i], 0);
-	    else
-              syntax_error
-		("all elements of the vector must be of the same type", obj);
-	}
-#if 0 /* #### MULTIPLE doesn't work yet */
-      else if (VECTORP (XVECTOR_DATA (obj) [0]))
-	/* This vector is an ATOM_PAIR set */
-	{
-	  if (NILP (type)) type = QATOM_PAIR;
-	  *size_ret = XVECTOR_LENGTH (obj);
-	  *format_ret = 32;
-	  *data_ret =
-	    xnew_rawbytes ((*size_ret) * sizeof (XE_ATOM_TYPE) * 2);
-	  for (i = 0; i < *size_ret; i++)
-	    if (VECTORP (XVECTOR_DATA (obj) [i]))
-	      {
-		Lisp_Object pair = XVECTOR_DATA (obj) [i];
-		if (XVECTOR_LENGTH (pair) != 2)
-		  syntax_error
-		    ("elements of the vector must be vectors of exactly two elements", pair);
-
-		(*(XE_ATOM_TYPE **) data_ret) [i * 2] =
-		  XE_SYMBOL_TO_ATOM (d, XVECTOR_DATA (pair) [0], 0);
-		(*(XE_ATOM_TYPE **) data_ret) [(i * 2) + 1] =
-		  XE_SYMBOL_TO_ATOM (d, XVECTOR_DATA (pair) [1], 0);
-	      }
-	    else
-	      syntax_error
-		("all elements of the vector must be of the same type", obj);
-	}
-#endif
-      else
-	/* This vector is an INTEGER set, or something like it */
-	{
-	  *size_ret = XVECTOR_LENGTH (obj);
-	  if (NILP (type)) type = QINTEGER;
-	  *format_ret = 16;
-	  for (i = 0; i < *size_ret; i++)
-	    if (CONSP (XVECTOR_DATA (obj) [i]))
-	      *format_ret = 32;
-	    else if (!INTP (XVECTOR_DATA (obj) [i]))
-	      syntax_error
-		("all elements of the vector must be integers or conses of integers", obj);
-
-	  *data_ret = xnew_rawbytes (*size_ret * (*format_ret/8));
-	  for (i = 0; i < *size_ret; i++)
-	    if (*format_ret == 32)
-	      (*((unsigned long **) data_ret)) [i] =
-		lisp_to_word (XVECTOR_DATA (obj) [i]);
-	    else
-	      (*((unsigned short **) data_ret)) [i] =
-		(unsigned short) lisp_to_word (XVECTOR_DATA (obj) [i]);
-	}
-    }
-  else
-    invalid_argument ("unrecognized selection data", obj);
-
-  *type_ret = XE_SYMBOL_TO_ATOM (d, type, 0);
-}
-
--- a/src/select-gtk.c	Sat Feb 06 03:26:34 2010 -0600
+++ b/src/select-gtk.c	Sat Feb 06 04:05:16 2010 -0600
@@ -82,9 +82,9 @@
   }
 }
 
-#define PROCESSING_GTK_CODE
-#include "select-common.h"
-#undef PROCESSING_GTK_CODE
+#define THIS_IS_GTK
+#include "select-xlike-inc.c"
+#undef THIS_IS_GTK
 
 
 /* Set the selection data to GDK_NONE and NULL data, meaning we were
--- a/src/select-x.c	Sat Feb 06 03:26:34 2010 -0600
+++ b/src/select-x.c	Sat Feb 06 04:05:16 2010 -0600
@@ -194,9 +194,9 @@
   }
 }
 
-#define PROCESSING_X_CODE
-#include "select-common.h"
-#undef PROCESSING_X_CODE
+#define THIS_IS_X
+#include "select-xlike-inc.c"
+#undef THIS_IS_X
 
 /* Do protocol to assert ourself as a selection owner.
  */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/select-xlike-inc.c	Sat Feb 06 04:05:16 2010 -0600
@@ -0,0 +1,342 @@
+/* Selection processing for XEmacs -- common btwn select-x.c and select-gtk.c
+   Copyright (C) 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
+
+This file is part of XEmacs.
+
+XEmacs is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option) any
+later version.
+
+XEmacs is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with XEmacs; see the file COPYING.  If not, write to
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+/* Synched up with: Not synched with FSF. */
+
+#ifdef THIS_IS_X
+#define XE_ATOM_TYPE Atom
+#define XE_ATOM_TO_SYMBOL x_atom_to_symbol
+#define XE_SYMBOL_TO_ATOM symbol_to_x_atom
+#else
+#define XE_ATOM_TYPE GdkAtom
+#define XE_ATOM_TO_SYMBOL atom_to_symbol
+#define XE_SYMBOL_TO_ATOM symbol_to_gtk_atom
+#endif /* THIS_IS_X */
+
+/* #### These are going to move into Lisp code(!) with the aid of
+        some new functions I'm working on - ajh */
+
+/* These functions convert from the selection data read from the server into
+   something that we can use from elisp, and vice versa.
+
+	Type:	Format:	Size:		Elisp Type:
+	-----	-------	-----		-----------
+	*	8	*		String
+	ATOM	32	1		Symbol
+	ATOM	32	> 1		Vector of Symbols
+	*	16	1		Integer
+	*	16	> 1		Vector of Integers
+	*	32	1		if <=16 bits: Integer
+					if > 16 bits: Cons of top16, bot16
+	*	32	> 1		Vector of the above
+
+   NOTE NOTE NOTE:
+   Format == 32 means that the buffer will be C longs, which need not be
+   32-bit quantities.  See the note in select-x.c (x_get_window_property).
+
+   When converting a Lisp number to C, it is assumed to be of format 16 if
+   it is an integer, and of format 32 if it is a cons of two integers.
+
+   When converting a vector of numbers from Elisp to C, it is assumed to be
+   of format 16 if every element in the vector is an integer, and is assumed
+   to be of format 32 if any element is a cons of two integers.
+
+   When converting an object to C, it may be of the form (SYMBOL . <data>)
+   where SYMBOL is what we should claim that the type is.  Format and
+   representation are as above.
+
+   NOTE: Under Mule, when someone shoves us a string without a type, we
+   set the type to `COMPOUND_TEXT' and automatically convert to Compound
+   Text.  If the string has a type, we assume that the user wants the
+   data sent as-is so we just do "binary" conversion.
+ */
+
+
+static Lisp_Object
+selection_data_to_lisp_data (struct device *d,
+			     Rawbyte *data,
+			     Bytecount size,
+			     XE_ATOM_TYPE type,
+			     int format)
+{
+#ifdef THIS_IS_X
+  if (type == DEVICE_XATOM_NULL (d))
+    return QNULL;
+
+  /* Convert any 8-bit data to a string, for compactness. */
+  else if (format == 8)
+    return make_extstring ((Extbyte *) data, size,
+			    type == DEVICE_XATOM_TEXT (d) ||
+			    type == DEVICE_XATOM_COMPOUND_TEXT (d)
+			    ? Qctext : Qbinary);
+
+  /* Convert a single atom to a Lisp Symbol.
+     Convert a set of atoms to a vector of symbols. */
+  else if (type == XA_ATOM)
+#else
+  if (type == gdk_atom_intern ("NULL", 0))
+    return QNULL;
+
+  /* Convert any 8-bit data to a string, for compactness. */
+  else if (format == 8)
+    return make_extstring ((Extbyte *) data, size,
+			    ((type == gdk_atom_intern ("TEXT", FALSE)) ||
+			     (type == gdk_atom_intern ("COMPOUND_TEXT", FALSE)))
+			    ? Qctext : Qbinary);
+
+  /* Convert a single atom to a Lisp Symbol.
+     Convert a set of atoms to a vector of symbols. */
+  else if (type == gdk_atom_intern ("ATOM", FALSE))
+#endif /* THIS_IS_X */
+    {
+      if (size == sizeof (XE_ATOM_TYPE))
+	return XE_ATOM_TO_SYMBOL (d, *((XE_ATOM_TYPE *) data));
+      else
+	{
+	  Elemcount i;
+	  Elemcount len = size / sizeof (XE_ATOM_TYPE);
+	  Lisp_Object v = Fmake_vector (make_int (len), Qzero);
+	  for (i = 0; i < len; i++)
+	    Faset (v, make_int (i), XE_ATOM_TO_SYMBOL (d, ((XE_ATOM_TYPE *) data) [i]));
+	  return v;
+	}
+    }
+
+  /* Convert a single 16 or small 32 bit number to a Lisp Int.
+     If the number is > 16 bits, convert it to a cons of integers,
+     16 bits in each half.
+   */
+  else if (format == 32 && size == sizeof (long))
+    return word_to_lisp (((unsigned long *) data) [0]);
+  else if (format == 16 && size == sizeof (short))
+    return make_int ((int) (((unsigned short *) data) [0]));
+
+  /* Convert any other kind of data to a vector of numbers, represented
+     as above (as an integer, or a cons of two 16 bit integers).
+
+     #### Perhaps we should return the actual type to lisp as well.
+
+	(x-get-selection-internal 'PRIMARY 'LINE_NUMBER)
+	==> [4 4]
+
+     and perhaps it should be
+
+	(x-get-selection-internal 'PRIMARY 'LINE_NUMBER)
+	==> (SPAN . [4 4])
+
+     Right now the fact that the return type was SPAN is discarded before
+     lisp code gets to see it.
+   */
+  else if (format == 16)
+    {
+      Elemcount i;
+      Lisp_Object v = make_vector (size / 4, Qzero);
+      for (i = 0; i < size / 4; i++)
+	{
+	  int j = (int) ((unsigned short *) data) [i];
+	  Faset (v, make_int (i), make_int (j));
+	}
+      return v;
+    }
+  else
+    {
+      Elemcount i;
+      Lisp_Object v = make_vector (size / 4, Qzero);
+      for (i = 0; i < size / 4; i++)
+	{
+	  unsigned long j = ((unsigned long *) data) [i];
+	  Faset (v, make_int (i), word_to_lisp (j));
+	}
+      return v;
+    }
+}
+
+
+static void
+lisp_data_to_selection_data (struct device *d,
+			     Lisp_Object obj,
+			     Rawbyte **data_ret,
+			     XE_ATOM_TYPE *type_ret,
+			     Bytecount *size_ret,
+			     int *format_ret)
+{
+  Lisp_Object type = Qnil;
+
+  if (CONSP (obj) && SYMBOLP (XCAR (obj)))
+    {
+      type = XCAR (obj);
+      obj = XCDR (obj);
+      if (CONSP (obj) && NILP (XCDR (obj)))
+	obj = XCAR (obj);
+    }
+
+  if (EQ (obj, QNULL) || (EQ (type, QNULL)))
+    {				/* This is not the same as declining */
+      *format_ret = 32;
+      *size_ret = 0;
+      *data_ret = 0;
+      type = QNULL;
+    }
+  else if (STRINGP (obj))
+    {
+      const Extbyte *extval;
+      Bytecount extvallen;
+
+      LISP_STRING_TO_SIZED_EXTERNAL (obj, extval, extvallen,
+				     (NILP (type) ? Qctext : Qbinary));
+      *format_ret = 8;
+      *size_ret = extvallen;
+      *data_ret = xnew_rawbytes (*size_ret);
+      memcpy (*data_ret, extval, *size_ret);
+#ifdef MULE
+      if (NILP (type)) type = QCOMPOUND_TEXT;
+#else
+      if (NILP (type)) type = QSTRING;
+#endif
+    }
+  else if (CHARP (obj))
+    {
+      Ibyte buf[MAX_ICHAR_LEN];
+      Bytecount len;
+      const Extbyte *extval;
+      Bytecount extvallen;
+
+      *format_ret = 8;
+      len = set_itext_ichar (buf, XCHAR (obj));
+      TO_EXTERNAL_FORMAT (DATA, (buf, len),
+			  ALLOCA, (extval, extvallen),
+			  Qctext);
+      *size_ret = extvallen;
+      *data_ret = xnew_rawbytes (*size_ret);
+      memcpy (*data_ret, extval, *size_ret);
+#ifdef MULE
+      if (NILP (type)) type = QCOMPOUND_TEXT;
+#else
+      if (NILP (type)) type = QSTRING;
+#endif
+    }
+  else if (SYMBOLP (obj))
+    {
+      *format_ret = 32;
+      *size_ret = 1;
+      *data_ret = xnew_rawbytes (sizeof (XE_ATOM_TYPE) + 1);
+      (*data_ret) [sizeof (XE_ATOM_TYPE)] = 0;
+      (*(XE_ATOM_TYPE **) data_ret) [0] = XE_SYMBOL_TO_ATOM (d, obj, 0);
+      if (NILP (type)) type = QATOM;
+    }
+  else if (INTP (obj) &&
+	   XINT (obj) <= 0x7FFF &&
+	   XINT (obj) >= -0x8000)
+    {
+      *format_ret = 16;
+      *size_ret = 1;
+      *data_ret = xnew_rawbytes (sizeof (short) + 1);
+      (*data_ret) [sizeof (short)] = 0;
+      (*(short **) data_ret) [0] = (short) XINT (obj);
+      if (NILP (type)) type = QINTEGER;
+    }
+  else if (INTP (obj) || CONSP (obj))
+    {
+      *format_ret = 32;
+      *size_ret = 1;
+      *data_ret = xnew_rawbytes (sizeof (long) + 1);
+      (*data_ret) [sizeof (long)] = 0;
+      (*(unsigned long **) data_ret) [0] = lisp_to_word (obj);
+      if (NILP (type)) type = QINTEGER;
+    }
+  else if (VECTORP (obj))
+    {
+      /* Lisp Vectors may represent a set of ATOMs;
+	 a set of 16 or 32 bit INTEGERs;
+	 or a set of ATOM_PAIRs (represented as [[A1 A2] [A3 A4] ...]
+       */
+      Elemcount i;
+
+      if (SYMBOLP (XVECTOR_DATA (obj) [0]))
+	/* This vector is an ATOM set */
+	{
+	  if (NILP (type)) type = QATOM;
+	  *size_ret = XVECTOR_LENGTH (obj);
+	  *format_ret = 32;
+	  *data_ret = xnew_rawbytes ((*size_ret) * sizeof (XE_ATOM_TYPE));
+	  for (i = 0; i < *size_ret; i++)
+	    if (SYMBOLP (XVECTOR_DATA (obj) [i]))
+	      (*(XE_ATOM_TYPE **) data_ret) [i] =
+		XE_SYMBOL_TO_ATOM (d, XVECTOR_DATA (obj) [i], 0);
+	    else
+              syntax_error
+		("all elements of the vector must be of the same type", obj);
+	}
+#if 0 /* #### MULTIPLE doesn't work yet */
+      else if (VECTORP (XVECTOR_DATA (obj) [0]))
+	/* This vector is an ATOM_PAIR set */
+	{
+	  if (NILP (type)) type = QATOM_PAIR;
+	  *size_ret = XVECTOR_LENGTH (obj);
+	  *format_ret = 32;
+	  *data_ret =
+	    xnew_rawbytes ((*size_ret) * sizeof (XE_ATOM_TYPE) * 2);
+	  for (i = 0; i < *size_ret; i++)
+	    if (VECTORP (XVECTOR_DATA (obj) [i]))
+	      {
+		Lisp_Object pair = XVECTOR_DATA (obj) [i];
+		if (XVECTOR_LENGTH (pair) != 2)
+		  syntax_error
+		    ("elements of the vector must be vectors of exactly two elements", pair);
+
+		(*(XE_ATOM_TYPE **) data_ret) [i * 2] =
+		  XE_SYMBOL_TO_ATOM (d, XVECTOR_DATA (pair) [0], 0);
+		(*(XE_ATOM_TYPE **) data_ret) [(i * 2) + 1] =
+		  XE_SYMBOL_TO_ATOM (d, XVECTOR_DATA (pair) [1], 0);
+	      }
+	    else
+	      syntax_error
+		("all elements of the vector must be of the same type", obj);
+	}
+#endif
+      else
+	/* This vector is an INTEGER set, or something like it */
+	{
+	  *size_ret = XVECTOR_LENGTH (obj);
+	  if (NILP (type)) type = QINTEGER;
+	  *format_ret = 16;
+	  for (i = 0; i < *size_ret; i++)
+	    if (CONSP (XVECTOR_DATA (obj) [i]))
+	      *format_ret = 32;
+	    else if (!INTP (XVECTOR_DATA (obj) [i]))
+	      syntax_error
+		("all elements of the vector must be integers or conses of integers", obj);
+
+	  *data_ret = xnew_rawbytes (*size_ret * (*format_ret/8));
+	  for (i = 0; i < *size_ret; i++)
+	    if (*format_ret == 32)
+	      (*((unsigned long **) data_ret)) [i] =
+		lisp_to_word (XVECTOR_DATA (obj) [i]);
+	    else
+	      (*((unsigned short **) data_ret)) [i] =
+		(unsigned short) lisp_to_word (XVECTOR_DATA (obj) [i]);
+	}
+    }
+  else
+    invalid_argument ("unrecognized selection data", obj);
+
+  *type_ret = XE_SYMBOL_TO_ATOM (d, type, 0);
+}
+
--- a/src/syswindows.h	Sat Feb 06 03:26:34 2010 -0600
+++ b/src/syswindows.h	Sat Feb 06 04:05:16 2010 -0600
@@ -978,21 +978,22 @@
   ttlff_utf8_path = alloca_extbytes (ttlff_size);			\
   cygwin_conv_path (CCP_WIN_T_TO_POSIX | CCP_RELATIVE,			\
 		    ttlff, ttlff_utf8_path, ttlff_size);		\
-  (out) = EXTERNAL_TO_ITEXT (ttlff_utf8_path, Qutf_8);		\
+  (out) = EXTERNAL_TO_ITEXT (ttlff_utf8_path, Qutf_8);			\
 } while (0)
 #else /* not HAVE_CYGWIN_CONV_PATH */
 #define LOCAL_FILE_FORMAT_TO_TSTR(path, out)		\
 do {							\
   const Ibyte *lfftt;					\
+  const Extbyte **lffttout = (const Extbyte **) &(out);	\
 							\
   LOCAL_FILE_FORMAT_TO_INTERNAL_MSWIN (path, lfftt);	\
-  PATHNAME_CONVERT_OUT_TSTR (lfftt, out);		\
+  PATHNAME_CONVERT_OUT_TSTR (lfftt, *lffttout);		\
 } while (0)
 #define TSTR_TO_LOCAL_FILE_FORMAT(path, out)		\
 do {							\
   const Ibyte *ttlff;					\
 							\
-  ttlff = TSTR_TO_ITEXT (path);			\
+  ttlff = TSTR_TO_ITEXT (path);				\
   INTERNAL_MSWIN_TO_LOCAL_FILE_FORMAT (ttlff, out);	\
 } while (0)
 #endif /* (not) HAVE_CYGWIN_CONV_PATH */
--- a/tests/ChangeLog	Sat Feb 06 03:26:34 2010 -0600
+++ b/tests/ChangeLog	Sat Feb 06 04:05:16 2010 -0600
@@ -1,3 +1,8 @@
+2010-02-05  Jerry James  <james@xemacs.org>
+
+	* DLL/dltest.c: Remove old test.  Building and using any module now
+	provides a better test than this.
+
 2010-02-05  Jerry James  <james@xemacs.org>
 
 	* frame.el: Martin Buchholz claims ownership.
--- a/tests/DLL/dltest.c	Sat Feb 06 03:26:34 2010 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-/*
-Make a symbolic link to ${blddir}/src/config.h in this directory and do:
-
-gcc -shared -fPIC -Demacs -DHAVE_CONFIG_H -I. \
-		-I/home/xemacs/xemacs-20.0/src -g dltest.c -o dltest
-*/
-
-# include <config.h>
-# include "lisp.h"
-
-Lisp_Object Qdltest_counter;
-
-DEFUN ("dltest", Fdltest, 0, 0, 0, /*
-Simple test function.
-*/
-())
-{
-	Qdltest_counter = make_int(XINT(Qdltest_counter) + 1);
-
-	return Qdltest_counter;
-}
-
-void
-vars_of()
-{
-	DEFVAR_LISP("dltest-counter", &Qdltest_counter /*
-counter.
-*/ );
-
-	printf("Ten = %d\n", 10);
-
-	Qdltest_counter = make_int(10);
-}
-
-void
-syms_of()
-{
-	DEFSUBR(Fdltest);
-}